diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..9473a1acc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Build Release Artifacts + +on: + release: + types: [created] + +jobs: + build-sdz: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: FranzDiebold/github-env-vars-action@v2.3.0 + - run: sudo apt install -y zip + - run: zip -r repo.sdz * -x .git @ + - uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./repo.sdz + asset_name: ${{ env.CI_REPOSITORY_NAME }}-${{ env.CI_REF_NAME }}.sdz + asset_content_type: application/zip diff --git a/CC-BY-SA-4.0.txt b/CC-BY-SA-4.0.txt new file mode 100644 index 000000000..3b7b82d0d --- /dev/null +++ b/CC-BY-SA-4.0.txt @@ -0,0 +1,427 @@ +Attribution-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-ShareAlike 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-ShareAlike 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + + including for purposes of Section 3(b); and + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.â€� The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git "a/Creative Commons \342\200\224 Attribution-ShareAlike 4.0 International \342\200\224 CC BY-SA 4.pdf" "b/Creative Commons \342\200\224 Attribution-ShareAlike 4.0 International \342\200\224 CC BY-SA 4.pdf" deleted file mode 100644 index 55dc821f9..000000000 Binary files "a/Creative Commons \342\200\224 Attribution-ShareAlike 4.0 International \342\200\224 CC BY-SA 4.pdf" and /dev/null differ diff --git a/DummyCommit.txt b/DummyCommit.txt index b3c29b4d5..bdbe4075c 100644 --- a/DummyCommit.txt +++ b/DummyCommit.txt @@ -1,3 +1 @@ -VERSION{v7.65} -VERSION{Campaign Branch v1.5} - \ No newline at end of file +VERSION{v15.01} \ No newline at end of file diff --git a/EngineOptions.lua b/EngineOptions.lua index 82d60f04b..e02764b58 100644 --- a/EngineOptions.lua +++ b/EngineOptions.lua @@ -27,92 +27,92 @@ local options = { - { - key = 'MaxUnits', - name = 'Max units', - desc = 'Maximum number of units (including buildings) for each team allowed at the same time', - type = 'number', - def = 5000, - min = 100, - max = 5000, --- engine caps at lower limit if more than 3 team are ingame - step = 1, -- quantization is aligned to the def value - -- (step <= 0) means that there is no quantization - }, + { + key = 'engineoptions', + name = 'Engine Options', + desc = 'Limits maximum and minimum speed that the players will be allowed to change to', + type = 'section', + }, + { + key = 'maxunits', + name = 'Max units', + desc = 'Maximum number of units (including buildings) for each team allowed at the same time', + type = 'number', + section= 'engineoptions', + def = 5000, + min = 100, + max = 5000, --- engine caps at lower limit if more than 3 team are ingame + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'ghostedbuildings', + name = 'Ghosted buildings', + desc = "Once an enemy building will be spotted\na ghost trail will be placed to memorize location even after the loss of the line of sight", + type = 'bool', + section= 'engineoptions', + def = true, + }, + { + key = 'fixedallies', + name = 'Fixed ingame alliances', + desc = 'Disables the possibility of players to dynamically change alliances ingame', + type = 'bool', + section= 'engineoptions', + def = false, + }, + { + key = 'disablemapdamage', + name = 'Undeformable map', + desc = 'Prevents the map shape from being changed by weapons', + type = 'bool', + section= 'engineoptions', + def = false, + }, - { - key = 'LimitDgun', - name = 'Limit D-Gun range', - desc = "The commander's D-Gun weapon will be usable only close to the player's starting location", - type = 'bool', - def = false, - }, + { + key = 'limitspeed', + name = 'Speed Restriction', + desc = 'Limits maximum and minimum speed that the players will be allowed to change to', + type = 'section', + }, - { - key = 'GhostedBuildings', - name = 'Ghosted buildings', - desc = "Once an enemy building will be spotted\na ghost trail will be placed to memorize location even after the loss of the line of sight", - type = 'bool', - def = true, - }, - { - key = 'FixedAllies', - name = 'Fixed ingame alliances', - desc = 'Disables the possibility of players to dynamically change alliances ingame', - type = 'bool', - def = false, - }, + { + key = 'maxspeed', + name = 'Maximum game speed', + desc = 'Sets the maximum speed that the players will be allowed to change to', + type = 'number', + section= 'limitspeed', + def = 1, + min = 0.1, + max = 100, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, - { - key = 'LimitSpeed', - name = 'Speed Restriction', - desc = 'Limits maximum and minimum speed that the players will be allowed to change to', - type = 'section', - }, + { + key = 'minspeed', + name = 'Minimum game speed', + desc = 'Sets the minimum speed that the players will be allowed to change to', + type = 'number', + section= 'limitspeed', + def = 1, + min = 0.1, + max = 100, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + --[[ + -- the following options can create problems and were never used by interface programs, thus are commented out for the moment - { - key = 'MaxSpeed', - name = 'Maximum game speed', - desc = 'Sets the maximum speed that the players will be allowed to change to', - type = 'number', - section= 'LimitSpeed', - def = 3, - min = 0.1, - max = 100, - step = 0.1, -- quantization is aligned to the def value - -- (step <= 0) means that there is no quantization - }, - - { - key = 'MinSpeed', - name = 'Minimum game speed', - desc = 'Sets the minimum speed that the players will be allowed to change to', - type = 'number', - section= 'LimitSpeed', - def = 0.3, - min = 0.1, - max = 100, - step = 0.1, -- quantization is aligned to the def value - -- (step <= 0) means that there is no quantization - }, - - { - key = 'DisableMapDamage', - name = 'Undeformable map', - desc = 'Prevents the map shape from being changed by weapons', - type = 'bool', - def = false, - }, ---[[ --- the following options can create problems and were never used by interface programs, thus are commented out for the moment - - { - key = 'NoHelperAIs', - name = 'Disable helper AIs', - desc = 'Disables luaui ai usage for all players', - type = 'bool', - def = false, - }, ---]] + { + key = 'NoHelperAIs', + name = 'Disable helper AIs', + desc = 'Disables luaui ai usage for all players', + type = 'bool', + def = false, + }, + --]] } return options diff --git a/Evolution RTS Crash Course.txt b/Evolution RTS Crash Course.txt deleted file mode 100644 index 2c65191f3..000000000 --- a/Evolution RTS Crash Course.txt +++ /dev/null @@ -1,40 +0,0 @@ -Metal is used to make unit and structures. - -Energy is only used for units to fire, shields, nukes etc. - -Energy is not used for building, but you will need tons of it because it is often depleted by units firing their weapons in battles, or shields powering up or simply used by metal makers when converting energy to metal -Without energy, your units can't fire. Along those lines, build storage. Build LOTS of storage. Storage buildings increase the total amount of metal and energy that youc an store, and so in that way act like capacitors for your army. Storage buildings are quite possibly the most important buildings in your base. - -In order to tech up put generators next to your factories. - -Basic generators give you 5 supply, 1 power (in a radius) and 1 energy -Geothermal generators give you 20 supply 7 power and 7 energy -Advanced generators give you 30 supply, 10 power and 10 energy - -Generators give you supply. The supply cap is 200/200. Generators say how much supply, power, and energy they give you in the unit descriptions that pop up when you mouseover them on the build menu. You need supply in order to build units. - -Power is used to tech up. The generators have graphics around them when you place them for building. That graphic is a visualization of the radius in which power is supplied. Place generators so that they are near your factory, and the power they provide will unlock higher tech units within the factory. - -In this way, teching up is easy, but if you lose your generators, then you will lose the tech that the generator was allowing you to build. - -Engineers, ORBs, and Overseers do not use supply. Make as many as you would like. It's a good idea to have many on hand sot hat you always have workers available and they will assist with other construction projects. - -ORBs are field repair units. They repair everything in a huge radius for 10hp every second, as long as what they are repairing is out of combat (for free). - -Metal Makers are good. They are not as efficient as metal extractors, but they can help use your excess energy while supplying you you additional income. Each Metal Maker uses 5 energy to produce 0.5 metal (The same income as a metal extractor). - -However, if you are using metal makers, remember that you need energy in order for your units to fire, so build storage so that you have a buffer zone. - -There are 5 tech paths: - -Hover, Amphibious, All Terrain, Air and Destroyers - -Hover can of course go over water and are moderately good in all situations. - -Amphibious units are extremely fast, very high damage output, but have very weak armor. Amphibious units are stealthed to radar. - -All Terrains units can of course go everywhere except water. They are the slowest of the 3 main technologies (Hover/Amphibious/All-Terrain), but have good firepower and solid damage output and good armor. All Terrain units can cloak. All Terrain units can't be automatically targeted when cloaked, but you can see them via seismic indicators, so you can fore fire at them if you want. Cloaking All Terrain units is uses a lot of energy (2 per unit). The best way to use them is to cloak them right before a fight so that you get the first shot in the battle. It can make the difference between winning and losing a battle. - -Destroyer units are end-game units. They are extremely powerful and deal critical amounts of damage, but they can be brought down by surrounding them and focusing your fire. Make sure that if you are using them, that you keep them protected. - -This might seem like a lot to take in, but the game and the gameplay itself is quite simple really. I hope that this crash course has been helpful! \ No newline at end of file diff --git a/Features/0ad/ad0_baobab_0.lua b/Features/0ad/ad0_baobab_0.lua deleted file mode 100644 index a96834935..000000000 --- a/Features/0ad/ad0_baobab_0.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_baobab_0" -local featureDef = { - name = "ad0_baobab_0", - world ="All Worlds", - description ="Baobab Tree", - category ="Vegetation", - object ="features/0ad/ad0_baobab_0.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =220, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_baobab_1.lua b/Features/0ad/ad0_baobab_1.lua deleted file mode 100644 index 50ea0486a..000000000 --- a/Features/0ad/ad0_baobab_1.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "ad0_baobab_1" -local featureDef = { - name = "ad0_baobab_1", - world ="All Worlds", - description ="Baobab Tree", - category ="Vegetation", - object ="features/0ad/ad0_baobab_1.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) \ No newline at end of file diff --git a/Features/0ad/ad0_baobab_2.lua b/Features/0ad/ad0_baobab_2.lua deleted file mode 100644 index 022d8d17e..000000000 --- a/Features/0ad/ad0_baobab_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_baobab_2" -local featureDef = { - name = "ad0_baobab_2", - world ="All Worlds", - description ="Baobab Tree", - category ="Vegetation", - object ="features/0ad/ad0_baobab_2.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_baobab_3.lua b/Features/0ad/ad0_baobab_3.lua deleted file mode 100644 index 208b7eaa7..000000000 --- a/Features/0ad/ad0_baobab_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_baobab_3" -local featureDef = { - name = "ad0_baobab_3", - world ="All Worlds", - description ="Baobab Tree", - category ="Vegetation", - object ="features/0ad/ad0_baobab_3.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_baobab_4.lua b/Features/0ad/ad0_baobab_4.lua deleted file mode 100644 index e005c5374..000000000 --- a/Features/0ad/ad0_baobab_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_baobab_4" -local featureDef = { - name = "ad0_baobab_4", - world ="All Worlds", - description ="Baobab Tree", - category ="Vegetation", - object ="features/0ad/ad0_baobab_4.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_1_l.lua b/Features/0ad/ad0_pine_1_l.lua deleted file mode 100644 index 29f1dd3f3..000000000 --- a/Features/0ad/ad0_pine_1_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_1_l" -local featureDef = { - name = "ad0_pine_1_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_1_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_1_m.lua b/Features/0ad/ad0_pine_1_m.lua deleted file mode 100644 index 98ee7708f..000000000 --- a/Features/0ad/ad0_pine_1_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_1_m" -local featureDef = { - name = "ad0_pine_1_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_1_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_1_s.lua b/Features/0ad/ad0_pine_1_s.lua deleted file mode 100644 index 73d2cc7d4..000000000 --- a/Features/0ad/ad0_pine_1_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_1_s" -local featureDef = { - name = "ad0_pine_1_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_1_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_1_xl.lua b/Features/0ad/ad0_pine_1_xl.lua deleted file mode 100644 index 5e00a674d..000000000 --- a/Features/0ad/ad0_pine_1_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_1_xl" -local featureDef = { - name = "ad0_pine_1_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_1_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_1_xxl.lua b/Features/0ad/ad0_pine_1_xxl.lua deleted file mode 100644 index cda0c1246..000000000 --- a/Features/0ad/ad0_pine_1_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_1_xxl" -local featureDef = { - name = "ad0_pine_1_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_1_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_2_l.lua b/Features/0ad/ad0_pine_2_l.lua deleted file mode 100644 index bb242073b..000000000 --- a/Features/0ad/ad0_pine_2_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_2_l" -local featureDef = { - name = "ad0_pine_2_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_2_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_2_m.lua b/Features/0ad/ad0_pine_2_m.lua deleted file mode 100644 index da58a7411..000000000 --- a/Features/0ad/ad0_pine_2_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_2_m" -local featureDef = { - name = "ad0_pine_2_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_2_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_2_s.lua b/Features/0ad/ad0_pine_2_s.lua deleted file mode 100644 index 20cee4a12..000000000 --- a/Features/0ad/ad0_pine_2_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_2_s" -local featureDef = { - name = "ad0_pine_2_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_2_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_2_xl.lua b/Features/0ad/ad0_pine_2_xl.lua deleted file mode 100644 index 36209d614..000000000 --- a/Features/0ad/ad0_pine_2_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_2_xl" -local featureDef = { - name = "ad0_pine_2_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_2_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_2_xxl.lua b/Features/0ad/ad0_pine_2_xxl.lua deleted file mode 100644 index 0c1bf132f..000000000 --- a/Features/0ad/ad0_pine_2_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_2_xxl" -local featureDef = { - name = "ad0_pine_2_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_2_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_3_l.lua b/Features/0ad/ad0_pine_3_l.lua deleted file mode 100644 index b8869f7a7..000000000 --- a/Features/0ad/ad0_pine_3_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_3_l" -local featureDef = { - name = "ad0_pine_3_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_3_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_3_m.lua b/Features/0ad/ad0_pine_3_m.lua deleted file mode 100644 index 666e4f825..000000000 --- a/Features/0ad/ad0_pine_3_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_3_m" -local featureDef = { - name = "ad0_pine_3_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_3_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_3_s.lua b/Features/0ad/ad0_pine_3_s.lua deleted file mode 100644 index 5b8b802b4..000000000 --- a/Features/0ad/ad0_pine_3_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_3_s" -local featureDef = { - name = "ad0_pine_3_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_3_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_3_xl.lua b/Features/0ad/ad0_pine_3_xl.lua deleted file mode 100644 index 18087e169..000000000 --- a/Features/0ad/ad0_pine_3_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_3_xl" -local featureDef = { - name = "ad0_pine_3_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_3_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_3_xxl.lua b/Features/0ad/ad0_pine_3_xxl.lua deleted file mode 100644 index c1098a65d..000000000 --- a/Features/0ad/ad0_pine_3_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_3_xxl" -local featureDef = { - name = "ad0_pine_3_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_3_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_1_l.lua b/Features/0ad/ad0_pine_snow_1_l.lua deleted file mode 100644 index 33ba3e4c4..000000000 --- a/Features/0ad/ad0_pine_snow_1_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_1_l" -local featureDef = { - name = "ad0_pine_snow_1_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_1_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_1_m.lua b/Features/0ad/ad0_pine_snow_1_m.lua deleted file mode 100644 index b4bd9c0ea..000000000 --- a/Features/0ad/ad0_pine_snow_1_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_1_m" -local featureDef = { - name = "ad0_pine_snow_1_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_1_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_1_s.lua b/Features/0ad/ad0_pine_snow_1_s.lua deleted file mode 100644 index 02347b0da..000000000 --- a/Features/0ad/ad0_pine_snow_1_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_1_s" -local featureDef = { - name = "ad0_pine_snow_1_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_1_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_1_xl.lua b/Features/0ad/ad0_pine_snow_1_xl.lua deleted file mode 100644 index 6a81e51fa..000000000 --- a/Features/0ad/ad0_pine_snow_1_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_1_xl" -local featureDef = { - name = "ad0_pine_snow_1_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_1_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_1_xxl.lua b/Features/0ad/ad0_pine_snow_1_xxl.lua deleted file mode 100644 index 84d76e465..000000000 --- a/Features/0ad/ad0_pine_snow_1_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_1_xxl" -local featureDef = { - name = "ad0_pine_snow_1_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_1_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_2_l.lua b/Features/0ad/ad0_pine_snow_2_l.lua deleted file mode 100644 index 105e778f3..000000000 --- a/Features/0ad/ad0_pine_snow_2_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_2_l" -local featureDef = { - name = "ad0_pine_snow_2_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_2_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_2_m.lua b/Features/0ad/ad0_pine_snow_2_m.lua deleted file mode 100644 index 1ebe8b67c..000000000 --- a/Features/0ad/ad0_pine_snow_2_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_2_m" -local featureDef = { - name = "ad0_pine_snow_2_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_2_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_2_s.lua b/Features/0ad/ad0_pine_snow_2_s.lua deleted file mode 100644 index d85336b38..000000000 --- a/Features/0ad/ad0_pine_snow_2_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_2_s" -local featureDef = { - name = "ad0_pine_snow_2_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_2_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_2_xl.lua b/Features/0ad/ad0_pine_snow_2_xl.lua deleted file mode 100644 index 2caafa2e0..000000000 --- a/Features/0ad/ad0_pine_snow_2_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_2_xl" -local featureDef = { - name = "ad0_pine_snow_2_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_2_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_2_xxl.lua b/Features/0ad/ad0_pine_snow_2_xxl.lua deleted file mode 100644 index 76984d752..000000000 --- a/Features/0ad/ad0_pine_snow_2_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_2_xxl" -local featureDef = { - name = "ad0_pine_snow_2_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_2_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_3_l.lua b/Features/0ad/ad0_pine_snow_3_l.lua deleted file mode 100644 index 27ee3f9b2..000000000 --- a/Features/0ad/ad0_pine_snow_3_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_3_l" -local featureDef = { - name = "ad0_pine_snow_3_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_3_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_3_m.lua b/Features/0ad/ad0_pine_snow_3_m.lua deleted file mode 100644 index 2b4b65696..000000000 --- a/Features/0ad/ad0_pine_snow_3_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_3_m" -local featureDef = { - name = "ad0_pine_snow_3_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_3_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_3_s.lua b/Features/0ad/ad0_pine_snow_3_s.lua deleted file mode 100644 index c9f46913a..000000000 --- a/Features/0ad/ad0_pine_snow_3_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_3_s" -local featureDef = { - name = "ad0_pine_snow_3_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_3_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_3_xl.lua b/Features/0ad/ad0_pine_snow_3_xl.lua deleted file mode 100644 index 4dffd9f91..000000000 --- a/Features/0ad/ad0_pine_snow_3_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_3_xl" -local featureDef = { - name = "ad0_pine_snow_3_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_3_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_3_xxl.lua b/Features/0ad/ad0_pine_snow_3_xxl.lua deleted file mode 100644 index e4dedecf3..000000000 --- a/Features/0ad/ad0_pine_snow_3_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_3_xxl" -local featureDef = { - name = "ad0_pine_snow_3_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_3_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_4_l.lua b/Features/0ad/ad0_pine_snow_4_l.lua deleted file mode 100644 index ec9ef2a52..000000000 --- a/Features/0ad/ad0_pine_snow_4_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_4_l" -local featureDef = { - name = "ad0_pine_snow_4_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_4_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_4_m.lua b/Features/0ad/ad0_pine_snow_4_m.lua deleted file mode 100644 index ca41f8446..000000000 --- a/Features/0ad/ad0_pine_snow_4_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_4_m" -local featureDef = { - name = "ad0_pine_snow_4_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_4_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_4_s.lua b/Features/0ad/ad0_pine_snow_4_s.lua deleted file mode 100644 index 81033302a..000000000 --- a/Features/0ad/ad0_pine_snow_4_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_4_s" -local featureDef = { - name = "ad0_pine_snow_4_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_4_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_4_xl.lua b/Features/0ad/ad0_pine_snow_4_xl.lua deleted file mode 100644 index 577dd016e..000000000 --- a/Features/0ad/ad0_pine_snow_4_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_4_xl" -local featureDef = { - name = "ad0_pine_snow_4_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_4_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_4_xxl.lua b/Features/0ad/ad0_pine_snow_4_xxl.lua deleted file mode 100644 index 602e4f238..000000000 --- a/Features/0ad/ad0_pine_snow_4_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_4_xxl" -local featureDef = { - name = "ad0_pine_snow_4_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_4_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_5_l.lua b/Features/0ad/ad0_pine_snow_5_l.lua deleted file mode 100644 index 2ceafc7c9..000000000 --- a/Features/0ad/ad0_pine_snow_5_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_5_l" -local featureDef = { - name = "ad0_pine_snow_5_l", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_5_l.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_5_m.lua b/Features/0ad/ad0_pine_snow_5_m.lua deleted file mode 100644 index adfa3cf1e..000000000 --- a/Features/0ad/ad0_pine_snow_5_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_5_m" -local featureDef = { - name = "ad0_pine_snow_5_m", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_5_m.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_5_s.lua b/Features/0ad/ad0_pine_snow_5_s.lua deleted file mode 100644 index 5fc5bc0ec..000000000 --- a/Features/0ad/ad0_pine_snow_5_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_5_s" -local featureDef = { - name = "ad0_pine_snow_5_s", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_5_s.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_5_xl.lua b/Features/0ad/ad0_pine_snow_5_xl.lua deleted file mode 100644 index d03ea6430..000000000 --- a/Features/0ad/ad0_pine_snow_5_xl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_5_xl" -local featureDef = { - name = "ad0_pine_snow_5_xl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_5_xl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_pine_snow_5_xxl.lua b/Features/0ad/ad0_pine_snow_5_xxl.lua deleted file mode 100644 index 14ee2a57a..000000000 --- a/Features/0ad/ad0_pine_snow_5_xxl.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_pine_snow_5_xxl" -local featureDef = { - name = "ad0_pine_snow_5_xxl", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_pine_snow_5_xxl.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_1.lua b/Features/0ad/ad0_senegal_1.lua deleted file mode 100644 index 91905e944..000000000 --- a/Features/0ad/ad0_senegal_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_1" -local featureDef = { - name = "ad0_senegal_1", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_1.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_1_large.lua b/Features/0ad/ad0_senegal_1_large.lua deleted file mode 100644 index 492f64ff3..000000000 --- a/Features/0ad/ad0_senegal_1_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_1_large" -local featureDef = { - name = "ad0_senegal_1_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_1_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_2.lua b/Features/0ad/ad0_senegal_2.lua deleted file mode 100644 index 8337a228f..000000000 --- a/Features/0ad/ad0_senegal_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_2" -local featureDef = { - name = "ad0_senegal_2", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_2.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_2_large.lua b/Features/0ad/ad0_senegal_2_large.lua deleted file mode 100644 index 201e6e118..000000000 --- a/Features/0ad/ad0_senegal_2_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_2_large" -local featureDef = { - name = "ad0_senegal_2_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_2_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_3.lua b/Features/0ad/ad0_senegal_3.lua deleted file mode 100644 index c758f4158..000000000 --- a/Features/0ad/ad0_senegal_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_3" -local featureDef = { - name = "ad0_senegal_3", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_3.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_3_large.lua b/Features/0ad/ad0_senegal_3_large.lua deleted file mode 100644 index c4634cb11..000000000 --- a/Features/0ad/ad0_senegal_3_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_3_large" -local featureDef = { - name = "ad0_senegal_3_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_3_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_4.lua b/Features/0ad/ad0_senegal_4.lua deleted file mode 100644 index 81ee73eac..000000000 --- a/Features/0ad/ad0_senegal_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_4" -local featureDef = { - name = "ad0_senegal_4", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_4.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_4_large.lua b/Features/0ad/ad0_senegal_4_large.lua deleted file mode 100644 index 260f86844..000000000 --- a/Features/0ad/ad0_senegal_4_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_4_large" -local featureDef = { - name = "ad0_senegal_4_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_4_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_5.lua b/Features/0ad/ad0_senegal_5.lua deleted file mode 100644 index 8b643f438..000000000 --- a/Features/0ad/ad0_senegal_5.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_5" -local featureDef = { - name = "ad0_senegal_5", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_5.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_5_large.lua b/Features/0ad/ad0_senegal_5_large.lua deleted file mode 100644 index 6481c5823..000000000 --- a/Features/0ad/ad0_senegal_5_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_5_large" -local featureDef = { - name = "ad0_senegal_5_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_5_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_6.lua b/Features/0ad/ad0_senegal_6.lua deleted file mode 100644 index 21b315d84..000000000 --- a/Features/0ad/ad0_senegal_6.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_6" -local featureDef = { - name = "ad0_senegal_6", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_6.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_6_large.lua b/Features/0ad/ad0_senegal_6_large.lua deleted file mode 100644 index 7a61c60ac..000000000 --- a/Features/0ad/ad0_senegal_6_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_6_large" -local featureDef = { - name = "ad0_senegal_6_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_6_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_7.lua b/Features/0ad/ad0_senegal_7.lua deleted file mode 100644 index 5132a0602..000000000 --- a/Features/0ad/ad0_senegal_7.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_7" -local featureDef = { - name = "ad0_senegal_7", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_7.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/ad0_senegal_7_large.lua b/Features/0ad/ad0_senegal_7_large.lua deleted file mode 100644 index 8a8b083fc..000000000 --- a/Features/0ad/ad0_senegal_7_large.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_senegal_7_large" -local featureDef = { - name = "ad0_senegal_7_large", - world ="All Worlds", - description ="Palm Tree", - category ="Vegetation", - object ="features/0ad/ad0_senegal_7_large.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_1_l.lua b/Features/0ad/bushes/ad0_bush_1_l.lua deleted file mode 100644 index 125d6ef19..000000000 --- a/Features/0ad/bushes/ad0_bush_1_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_1_l" -local featureDef = { - name = "ad0_bush_1_l", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_1_l.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_1_m.lua b/Features/0ad/bushes/ad0_bush_1_m.lua deleted file mode 100644 index 69ca6f7cc..000000000 --- a/Features/0ad/bushes/ad0_bush_1_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_1_m" -local featureDef = { - name = "ad0_bush_1_m", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_1_m.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_1_s.lua b/Features/0ad/bushes/ad0_bush_1_s.lua deleted file mode 100644 index 69d3ba7d4..000000000 --- a/Features/0ad/bushes/ad0_bush_1_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_1_s" -local featureDef = { - name = "ad0_bush_1_s", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_1_s.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_2_l.lua b/Features/0ad/bushes/ad0_bush_2_l.lua deleted file mode 100644 index 7b9f44818..000000000 --- a/Features/0ad/bushes/ad0_bush_2_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_2_l" -local featureDef = { - name = "ad0_bush_2_l", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_2_l.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_2_m.lua b/Features/0ad/bushes/ad0_bush_2_m.lua deleted file mode 100644 index d0ba2f9b6..000000000 --- a/Features/0ad/bushes/ad0_bush_2_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_2_m" -local featureDef = { - name = "ad0_bush_2_m", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_2_m.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_2_s.lua b/Features/0ad/bushes/ad0_bush_2_s.lua deleted file mode 100644 index c59631d7d..000000000 --- a/Features/0ad/bushes/ad0_bush_2_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_2_s" -local featureDef = { - name = "ad0_bush_2_s", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_2_s.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_3_l.lua b/Features/0ad/bushes/ad0_bush_3_l.lua deleted file mode 100644 index c23567314..000000000 --- a/Features/0ad/bushes/ad0_bush_3_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_3_l" -local featureDef = { - name = "ad0_bush_3_l", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_3_l.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_3_m.lua b/Features/0ad/bushes/ad0_bush_3_m.lua deleted file mode 100644 index b1358c569..000000000 --- a/Features/0ad/bushes/ad0_bush_3_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_3_m" -local featureDef = { - name = "ad0_bush_3_m", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_3_m.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_3_s.lua b/Features/0ad/bushes/ad0_bush_3_s.lua deleted file mode 100644 index a22d939e0..000000000 --- a/Features/0ad/bushes/ad0_bush_3_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_3_s" -local featureDef = { - name = "ad0_bush_3_s", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_3_s.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_4_l.lua b/Features/0ad/bushes/ad0_bush_4_l.lua deleted file mode 100644 index b791693bf..000000000 --- a/Features/0ad/bushes/ad0_bush_4_l.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_4_l" -local featureDef = { - name = "ad0_bush_4_l", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_4_l.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_4_m.lua b/Features/0ad/bushes/ad0_bush_4_m.lua deleted file mode 100644 index 418005648..000000000 --- a/Features/0ad/bushes/ad0_bush_4_m.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_4_m" -local featureDef = { - name = "ad0_bush_4_m", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_4_m.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bush_4_s.lua b/Features/0ad/bushes/ad0_bush_4_s.lua deleted file mode 100644 index 63c3bf9cd..000000000 --- a/Features/0ad/bushes/ad0_bush_4_s.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "ad0_bush_4_s" -local featureDef = { - name = "ad0_bush_4_s", - world ="All Worlds", - description ="Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bush_4_s.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_1.lua b/Features/0ad/bushes/ad0_bushes_l_1.lua deleted file mode 100644 index 80fd2850c..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_1.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_1" -local featureDef = { - name = "ad0_bushes_l_1", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_1.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_2.lua b/Features/0ad/bushes/ad0_bushes_l_2.lua deleted file mode 100644 index bc5b38abc..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_2.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_2" -local featureDef = { - name = "ad0_bushes_l_2", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_2.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_3.lua b/Features/0ad/bushes/ad0_bushes_l_3.lua deleted file mode 100644 index ade1e2835..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_3.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_3" -local featureDef = { - name = "ad0_bushes_l_3", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_3.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_4.lua b/Features/0ad/bushes/ad0_bushes_l_4.lua deleted file mode 100644 index 843efe5f8..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_4.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_4" -local featureDef = { - name = "ad0_bushes_l_4", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_4.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_5.lua b/Features/0ad/bushes/ad0_bushes_l_5.lua deleted file mode 100644 index dc293aa8e..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_5.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_5" -local featureDef = { - name = "ad0_bushes_l_5", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_5.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_6.lua b/Features/0ad/bushes/ad0_bushes_l_6.lua deleted file mode 100644 index 4528e5282..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_6.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_6" -local featureDef = { - name = "ad0_bushes_l_6", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_6.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_7.lua b/Features/0ad/bushes/ad0_bushes_l_7.lua deleted file mode 100644 index 28a5099be..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_7.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_7" -local featureDef = { - name = "ad0_bushes_l_7", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_7.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_l_8.lua b/Features/0ad/bushes/ad0_bushes_l_8.lua deleted file mode 100644 index 1e3028660..000000000 --- a/Features/0ad/bushes/ad0_bushes_l_8.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_l_8" -local featureDef = { - name = "ad0_bushes_l_8", - world ="All Worlds", - description ="Large Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_l_8.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_1.lua b/Features/0ad/bushes/ad0_bushes_m_1.lua deleted file mode 100644 index 87a943054..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_1.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_1" -local featureDef = { - name = "ad0_bushes_m_1", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_1.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_2.lua b/Features/0ad/bushes/ad0_bushes_m_2.lua deleted file mode 100644 index 5baacbe3b..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_2.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_2" -local featureDef = { - name = "ad0_bushes_m_2", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_2.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_3.lua b/Features/0ad/bushes/ad0_bushes_m_3.lua deleted file mode 100644 index 21bada641..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_3.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_3" -local featureDef = { - name = "ad0_bushes_m_3", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_3.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_4.lua b/Features/0ad/bushes/ad0_bushes_m_4.lua deleted file mode 100644 index 963786cff..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_4.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_4" -local featureDef = { - name = "ad0_bushes_m_4", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_4.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_5.lua b/Features/0ad/bushes/ad0_bushes_m_5.lua deleted file mode 100644 index 147a8f9ca..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_5.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_5" -local featureDef = { - name = "ad0_bushes_m_5", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_5.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_6.lua b/Features/0ad/bushes/ad0_bushes_m_6.lua deleted file mode 100644 index ea1b740e0..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_6.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_6" -local featureDef = { - name = "ad0_bushes_m_6", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_6.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_7.lua b/Features/0ad/bushes/ad0_bushes_m_7.lua deleted file mode 100644 index 8ae8c2a85..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_7.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_7" -local featureDef = { - name = "ad0_bushes_m_7", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_7.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_m_8.lua b/Features/0ad/bushes/ad0_bushes_m_8.lua deleted file mode 100644 index e0bbb5374..000000000 --- a/Features/0ad/bushes/ad0_bushes_m_8.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_m_8" -local featureDef = { - name = "ad0_bushes_m_8", - world ="All Worlds", - description ="Medium Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_m_8.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =40, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_1.lua b/Features/0ad/bushes/ad0_bushes_s_1.lua deleted file mode 100644 index af35c2059..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_1.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_1" -local featureDef = { - name = "ad0_bushes_s_1", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_1.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_2.lua b/Features/0ad/bushes/ad0_bushes_s_2.lua deleted file mode 100644 index c9e16a3ed..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_2.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_2" -local featureDef = { - name = "ad0_bushes_s_2", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_2.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_3.lua b/Features/0ad/bushes/ad0_bushes_s_3.lua deleted file mode 100644 index 794748cbc..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_3.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_3" -local featureDef = { - name = "ad0_bushes_s_3", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_3.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_4.lua b/Features/0ad/bushes/ad0_bushes_s_4.lua deleted file mode 100644 index 01c41b3ad..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_4.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_4" -local featureDef = { - name = "ad0_bushes_s_4", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_4.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_5.lua b/Features/0ad/bushes/ad0_bushes_s_5.lua deleted file mode 100644 index 4bea4660e..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_5.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_5" -local featureDef = { - name = "ad0_bushes_s_5", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_5.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_6.lua b/Features/0ad/bushes/ad0_bushes_s_6.lua deleted file mode 100644 index a5744c3d4..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_6.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_6" -local featureDef = { - name = "ad0_bushes_s_6", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_6.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_s_7.lua b/Features/0ad/bushes/ad0_bushes_s_7.lua deleted file mode 100644 index 9d91eb199..000000000 --- a/Features/0ad/bushes/ad0_bushes_s_7.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_s_7" -local featureDef = { - name = "ad0_bushes_s_7", - world ="All Worlds", - description ="Small Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_s_7.s3o", - footprintx =0, - footprintz =0, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =30, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_1.lua b/Features/0ad/bushes/ad0_bushes_xl_1.lua deleted file mode 100644 index 2add05da9..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_1.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_1" -local featureDef = { - name = "ad0_bushes_xl_1", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_1.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_2.lua b/Features/0ad/bushes/ad0_bushes_xl_2.lua deleted file mode 100644 index a95473e5a..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_2.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_2" -local featureDef = { - name = "ad0_bushes_xl_2", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_2.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_3.lua b/Features/0ad/bushes/ad0_bushes_xl_3.lua deleted file mode 100644 index 2b5733c08..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_3.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_3" -local featureDef = { - name = "ad0_bushes_xl_3", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_3.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_4.lua b/Features/0ad/bushes/ad0_bushes_xl_4.lua deleted file mode 100644 index 01e9ac74a..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_4.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_4" -local featureDef = { - name = "ad0_bushes_xl_4", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_4.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_5.lua b/Features/0ad/bushes/ad0_bushes_xl_5.lua deleted file mode 100644 index 52f08d394..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_5.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_5" -local featureDef = { - name = "ad0_bushes_xl_5", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_5.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/0ad/bushes/ad0_bushes_xl_6.lua b/Features/0ad/bushes/ad0_bushes_xl_6.lua deleted file mode 100644 index 108734f8d..000000000 --- a/Features/0ad/bushes/ad0_bushes_xl_6.lua +++ /dev/null @@ -1,26 +0,0 @@ -local objectname= "ad0_bushes_xl_6" -local featureDef = { - name = "ad0_bushes_xl_6", - world ="All Worlds", - description ="Larger Bush", - category ="Vegetation", - object ="features/0ad/bushes/ad0_bushes_xl_6.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - metal = 0, ---metal =0, - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/All Worlds/ammobox.lua b/Features/All Worlds/ammobox.lua index 69ddc6643..da3c3fd34 100644 --- a/Features/All Worlds/ammobox.lua +++ b/Features/All Worlds/ammobox.lua @@ -1,10 +1,10 @@ local objectname= "ammobox" local featureDef = { name = "ammobox", - description =[[Energy Core - • Can be reclaimed for 5 Metal and 5 Energy by moving an Overseer or an ORB in range - - • Can be converted to MidKnight Gunship Drone by moving an Engineer in range + description =[[Energy Core (Dropped from destroyed units): + +Can be reclaimed for 5 Metal and 5 Energy by moving an O.R.B. in range +Can be converted to MidKnight Gunship Drone by moving a B.O.X. in range ]], object ="ammobox2.s3o", footprintx =1, @@ -18,6 +18,8 @@ local featureDef = { reclaimable =false, autoreclaimable =false, indestructible = true, + smokeTime = 0, + upright = false, -- nodrawundergray ="1.0", customParams = { diff --git a/Features/All Worlds/treedefs.lua b/Features/All Worlds/treedefs.lua index 7790b8217..270a1bb91 100644 --- a/Features/All Worlds/treedefs.lua +++ b/Features/All Worlds/treedefs.lua @@ -6,18 +6,22 @@ local treeDefs = {} local function CreateTreeDef(type) treeDefs["treetype" .. type] = { + name = "tree", description = [[Tree]], - blocking = true, + blocking = false, burnable = true, reclaimable = true, - energy = 10, --- energy = 10, + upright = true, + category = "vegetation", + energy = 0, + damage = 5, metal = 0, ---metal = 0, + object ="features/enginetreereplacement/enginetreereplacement.s3o", + reclaimTime = 25, - mass = 20, - drawType = DRAWTYPE.TREE, + mass = 5, + drawType = DRAWTYPE.MODEL, footprintX = 2, footprintZ = 2, collisionVolumeTest = 0, @@ -30,7 +34,7 @@ local function CreateTreeDef(type) } end -for i=0,20 do +for i=0,259 do CreateTreeDef(i) end diff --git a/Features/ChickenFeatures/chicken_egg.tdf b/Features/ChickenFeatures/chicken_egg.tdf new file mode 100644 index 000000000..db7aa399f --- /dev/null +++ b/Features/ChickenFeatures/chicken_egg.tdf @@ -0,0 +1,72 @@ +[chicken_egg] +{ + description=Egg; + blocking=0; + category=corpses; + damage=2000; + energy=250; + featurereclamate=SMUDGE01; + footprintx=1; + footprintz=1; + height=30; + hitdensity=999999; + metal=25; + object=ChickenDefenseModels/chickenegg.s3o; + reclaimable=1; + seqnamereclamate=TREE1RECLAMATE; + world=All Worlds; +} +[chicken_eggb] +{ + description=Egg; + blocking=0; + category=corpses; + damage=2000; + energy=250; + featurereclamate=SMUDGE01; + footprintx=1; + footprintz=1; + height=30; + hitdensity=999999; + metal=25; + object=ChickenDefenseModels/chickeneggb.s3o; + reclaimable=1; + seqnamereclamate=TREE1RECLAMATE; + world=All Worlds; +} +[chicken_eggc] +{ + description=Egg; + blocking=0; + category=corpses; + damage=2000; + energy=250; + featurereclamate=SMUDGE01; + footprintx=1; + footprintz=1; + height=30; + hitdensity=999999; + metal=25; + object=ChickenDefenseModels/chickeneggc.s3o; + reclaimable=1; + seqnamereclamate=TREE1RECLAMATE; + world=All Worlds; +} +[chicken_eggd] +{ + description=Egg; + blocking=0; + category=corpses; + damage=2000; + energy=250; + featurereclamate=SMUDGE01; + footprintx=1; + footprintz=1; + height=30; + hitdensity=999999; + metal=25; + object=ChickenDefenseModels/chickeneggd.s3o; + reclaimable=1; + seqnamereclamate=TREE1RECLAMATE; + world=All Worlds; +} \ No newline at end of file diff --git a/Features/agorm/agorm_fatpalm1.lua b/Features/agorm/agorm_fatpalm1.lua deleted file mode 100644 index 1b246e7be..000000000 --- a/Features/agorm/agorm_fatpalm1.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_fatpalm1 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_fatpalm1", - blocking = true, - category = "vegitation", - damage = 5000, - description = "short palm", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palmfat1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_fatpalm2.lua b/Features/agorm/agorm_fatpalm2.lua deleted file mode 100644 index 27a6de25b..000000000 --- a/Features/agorm/agorm_fatpalm2.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_fatpalm2 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_fatpalm2", - blocking = true, - category = "vegitation", - damage = 5000, - description = "short palm", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palmfat2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_fatpalm3.lua b/Features/agorm/agorm_fatpalm3.lua deleted file mode 100644 index fbc0c060b..000000000 --- a/Features/agorm/agorm_fatpalm3.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_fatpalm3 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_fatpalm3", - blocking = true, - category = "vegitation", - damage = 5000, - description = "short palm", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palmfat3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_fatpalm4.lua b/Features/agorm/agorm_fatpalm4.lua deleted file mode 100644 index 65ffceac2..000000000 --- a/Features/agorm/agorm_fatpalm4.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_fatpalm4 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_fatpalm4", - blocking = true, - category = "vegitation", - damage = 5000, - description = "short palm", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palmfat4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm1.lua b/Features/agorm/agorm_palm1.lua deleted file mode 100644 index a992f5cb6..000000000 --- a/Features/agorm/agorm_palm1.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm1 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm1", - blocking = true, - category = "vegitation", - damage = 100, - description = "palmtree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm2.lua b/Features/agorm/agorm_palm2.lua deleted file mode 100644 index f8ba4188b..000000000 --- a/Features/agorm/agorm_palm2.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm2 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm2", - blocking = true, - category = "vegitation", - damage = 100, - description = "palmtree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm3.lua b/Features/agorm/agorm_palm3.lua deleted file mode 100644 index 9f5b9b5e4..000000000 --- a/Features/agorm/agorm_palm3.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm5 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm3", - blocking = true, - category = "vegitation", - damage = 100, - description = "palm tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm4.lua b/Features/agorm/agorm_palm4.lua deleted file mode 100644 index e0a8473d8..000000000 --- a/Features/agorm/agorm_palm4.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm4 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm4", - blocking = true, - category = "vegitation", - damage = 100, - description = "palm tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm5.lua b/Features/agorm/agorm_palm5.lua deleted file mode 100644 index 12b9e3402..000000000 --- a/Features/agorm/agorm_palm5.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm5 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm5", - blocking = true, - category = "vegitation", - damage = 100, - description = "palm tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_palm6.lua b/Features/agorm/agorm_palm6.lua deleted file mode 100644 index 7f5a71865..000000000 --- a/Features/agorm/agorm_palm6.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_palm6 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_palm6", - blocking = true, - category = "vegitation", - damage = 100, - description = "palm tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/palm6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_rock1.lua b/Features/agorm/agorm_rock1.lua deleted file mode 100644 index 434ee6c79..000000000 --- a/Features/agorm/agorm_rock1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock1 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock1", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_rock2.lua b/Features/agorm/agorm_rock2.lua deleted file mode 100644 index aa28d6e79..000000000 --- a/Features/agorm/agorm_rock2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock2 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock2", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_rock3.lua b/Features/agorm/agorm_rock3.lua deleted file mode 100644 index 269976c1d..000000000 --- a/Features/agorm/agorm_rock3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock3 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock3", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_rock4.lua b/Features/agorm/agorm_rock4.lua deleted file mode 100644 index 52d28e7ed..000000000 --- a/Features/agorm/agorm_rock4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock4 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock4", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_rock5.lua b/Features/agorm/agorm_rock5.lua deleted file mode 100644 index 97e161346..000000000 --- a/Features/agorm/agorm_rock5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock5 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock5", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_rock6.lua b/Features/agorm/agorm_rock6.lua deleted file mode 100644 index 3eb9c9719..000000000 --- a/Features/agorm/agorm_rock6.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_rock6 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_rock6", - blocking = true, - category = "rocks", - damage = 100, - description = "rock", - energy = 10, --- energy = 0, - - flammable = false, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/agorm/rock6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub1.lua b/Features/agorm/agorm_shrub1.lua deleted file mode 100644 index 4bda3ac58..000000000 --- a/Features/agorm/agorm_shrub1.lua +++ /dev/null @@ -1,25 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub1 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub1", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - object = "features/agorm/shrub1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_shrub2.lua b/Features/agorm/agorm_shrub2.lua deleted file mode 100644 index df3da5baf..000000000 --- a/Features/agorm/agorm_shrub2.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub2 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub2", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub3.lua b/Features/agorm/agorm_shrub3.lua deleted file mode 100644 index 39d28a39c..000000000 --- a/Features/agorm/agorm_shrub3.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub3 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub3", - blocking = true, - category = "vegitation", - damage = 100, - energy = 10, --- energy = 1, - description = "shrub", - flammable = true, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub4.lua b/Features/agorm/agorm_shrub4.lua deleted file mode 100644 index 1686c7108..000000000 --- a/Features/agorm/agorm_shrub4.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub4 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub4", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub5.lua b/Features/agorm/agorm_shrub5.lua deleted file mode 100644 index 5ee82fb9d..000000000 --- a/Features/agorm/agorm_shrub5.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub5 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub5", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub6.lua b/Features/agorm/agorm_shrub6.lua deleted file mode 100644 index e69fb8759..000000000 --- a/Features/agorm/agorm_shrub6.lua +++ /dev/null @@ -1,25 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub6 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub6", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - object = "features/agorm/shrub6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub7.lua b/Features/agorm/agorm_shrub7.lua deleted file mode 100644 index 79d6b4503..000000000 --- a/Features/agorm/agorm_shrub7.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub7 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub7", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_shrub8.lua b/Features/agorm/agorm_shrub8.lua deleted file mode 100644 index 843894925..000000000 --- a/Features/agorm/agorm_shrub8.lua +++ /dev/null @@ -1,26 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_shrub8 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_shrub8", - blocking = true, - category = "vegitation", - damage = 100, - description = "shrub", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - - object = "features/agorm/shrub8.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/agorm/agorm_talltree1.lua b/Features/agorm/agorm_talltree1.lua deleted file mode 100644 index e3038d827..000000000 --- a/Features/agorm/agorm_talltree1.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree1 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree1", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_talltree2.lua b/Features/agorm/agorm_talltree2.lua deleted file mode 100644 index c517e6748..000000000 --- a/Features/agorm/agorm_talltree2.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree2 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree2", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_talltree3.lua b/Features/agorm/agorm_talltree3.lua deleted file mode 100644 index ad2057b21..000000000 --- a/Features/agorm/agorm_talltree3.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree3 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree3", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_talltree4.lua b/Features/agorm/agorm_talltree4.lua deleted file mode 100644 index 6739ad99a..000000000 --- a/Features/agorm/agorm_talltree4.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree4 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree4", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_talltree5.lua b/Features/agorm/agorm_talltree5.lua deleted file mode 100644 index 279ef096f..000000000 --- a/Features/agorm/agorm_talltree5.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree5 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree5", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/agorm/agorm_talltree6.lua b/Features/agorm/agorm_talltree6.lua deleted file mode 100644 index ee90672f8..000000000 --- a/Features/agorm/agorm_talltree6.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- agorm_talltree6 ------------------------------------------------------------------------------ -local featureDef = { - name = "agorm_talltree6", - blocking = true, - category = "vegitation", - damage = 100, - description = "tree", - energy = 10, --- energy = 1, - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/agorm/talltree6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/anarchid/mexes/crystal.lua b/Features/anarchid/mexes/crystal.lua new file mode 100644 index 000000000..1e5dc06bf --- /dev/null +++ b/Features/anarchid/mexes/crystal.lua @@ -0,0 +1,22 @@ + +local featureDef = { + alwaysvisible = true, + name = "Crystal Ring", + blocking = false, + category = "mexspot", + damage = 10000, + description = "Indicates metal deposit", + energy = 0, + flammable = 0, + footprintX = 0, + footprintZ = 0, + height = "8", + hitdensity = "0", + metal = 0, + object = "features/anarchid/mexes/crystal.dae", + reclaimable = false, + autoreclaimable = false, + indestructible = true, + world = "All Worlds", +} +return lowerkeys({crystalring = featureDef}) diff --git a/Features/artturi/artBirchBigHi.lua b/Features/artturi/artBirchBigHi.lua deleted file mode 100644 index e6b1eb7b0..000000000 --- a/Features/artturi/artBirchBigHi.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "artBirchBigHi" -local featureDef = { - name = "artBirchBigHi", - world ="All Worlds", - description ="artBirchBigHi", - category ="Vegetation", - object ="features/artturi/artBirchBigHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - damage =200, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchBigLo.lua b/Features/artturi/artBirchBigLo.lua deleted file mode 100644 index 57e2c2bed..000000000 --- a/Features/artturi/artBirchBigLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchBigLo" -local featureDef = { - name = "artBirchBigLo", - world ="All Worlds", - description ="artBirchBigLo", - category ="Vegetation", - object ="features/artturi/artBirchBigLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchMediumHi.lua b/Features/artturi/artBirchMediumHi.lua deleted file mode 100644 index 10d98ffa2..000000000 --- a/Features/artturi/artBirchMediumHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchMediumHi" -local featureDef = { - name = "artBirchMediumHi", - world ="All Worlds", - description ="artBirchMediumHi", - category ="Vegetation", - object ="features/artturi/artBirchMediumHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchMediumLo.lua b/Features/artturi/artBirchMediumLo.lua deleted file mode 100644 index ec651783a..000000000 --- a/Features/artturi/artBirchMediumLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchMediumLo" -local featureDef = { - name = "artBirchMediumLo", - world ="All Worlds", - description ="artBirchMediumLo", - category ="Vegetation", - object ="features/artturi/artBirchMediumLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchOldHi.lua b/Features/artturi/artBirchOldHi.lua deleted file mode 100644 index f1f92b31d..000000000 --- a/Features/artturi/artBirchOldHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchOldHi" -local featureDef = { - name = "artBirchOldHi", - world ="All Worlds", - description ="artBirchOldHi", - category ="Vegetation", - object ="features/artturi/artBirchOldHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchOldLo.lua b/Features/artturi/artBirchOldLo.lua deleted file mode 100644 index 78d8be1a8..000000000 --- a/Features/artturi/artBirchOldLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchOldLo" -local featureDef = { - name = "artBirchOldLo", - world ="All Worlds", - description ="artBirchOldLo", - category ="Vegetation", - object ="features/artturi/artBirchOldLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchSmallHi.lua b/Features/artturi/artBirchSmallHi.lua deleted file mode 100644 index d1424a81a..000000000 --- a/Features/artturi/artBirchSmallHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchSmallHi" -local featureDef = { - name = "artBirchSmallHi", - world ="All Worlds", - description ="artBirchSmallHi", - category ="Vegetation", - object ="features/artturi/artBirchSmallHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchSmallLo.lua b/Features/artturi/artBirchSmallLo.lua deleted file mode 100644 index ecf649722..000000000 --- a/Features/artturi/artBirchSmallLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchSmallLo" -local featureDef = { - name = "artBirchSmallLo", - world ="All Worlds", - description ="artBirchSmallLo", - category ="Vegetation", - object ="features/artturi/artBirchSmallLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchWinterHi.lua b/Features/artturi/artBirchWinterHi.lua deleted file mode 100644 index 1a3d49f3d..000000000 --- a/Features/artturi/artBirchWinterHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchWinterHi" -local featureDef = { - name = "artBirchWinterHi", - world ="All Worlds", - description ="artBirchWinterHi", - category ="Vegetation", - object ="features/artturi/artBirchWinterHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBirchWinterLo.lua b/Features/artturi/artBirchWinterLo.lua deleted file mode 100644 index 28092dea0..000000000 --- a/Features/artturi/artBirchWinterLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBirchWinterLo" -local featureDef = { - name = "artBirchWinterLo", - world ="All Worlds", - description ="artBirchWinterLo", - category ="Vegetation", - object ="features/artturi/artBirchWinterLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush1Hi.lua b/Features/artturi/artBush1Hi.lua deleted file mode 100644 index 568fd1fc7..000000000 --- a/Features/artturi/artBush1Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush1Hi" -local featureDef = { - name = "artBush1Hi", - world ="All Worlds", - description ="artBush1Hi", - category ="Vegetation", - object ="features/artturi/artBush1Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush1Lo.lua b/Features/artturi/artBush1Lo.lua deleted file mode 100644 index 22bef6ec4..000000000 --- a/Features/artturi/artBush1Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush1Lo" -local featureDef = { - name = "artBush1Lo", - world ="All Worlds", - description ="artBush1Lo", - category ="Vegetation", - object ="features/artturi/artBush1Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush2Hi.lua b/Features/artturi/artBush2Hi.lua deleted file mode 100644 index a66a21325..000000000 --- a/Features/artturi/artBush2Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush2Hi" -local featureDef = { - name = "artBush2Hi", - world ="All Worlds", - description ="artBush2Hi", - category ="Vegetation", - object ="features/artturi/artBush2Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush2Lo.lua b/Features/artturi/artBush2Lo.lua deleted file mode 100644 index de97ce90c..000000000 --- a/Features/artturi/artBush2Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush2Lo" -local featureDef = { - name = "artBush2Lo", - world ="All Worlds", - description ="artBush2Lo", - category ="Vegetation", - object ="features/artturi/artBush2Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush3Hi.lua b/Features/artturi/artBush3Hi.lua deleted file mode 100644 index 43633b3c8..000000000 --- a/Features/artturi/artBush3Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush3Hi" -local featureDef = { - name = "artBush3Hi", - world ="All Worlds", - description ="artBush3Hi", - category ="Vegetation", - object ="features/artturi/artBush3Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBush3Lo.lua b/Features/artturi/artBush3Lo.lua deleted file mode 100644 index ad08d50f1..000000000 --- a/Features/artturi/artBush3Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBush3Lo" -local featureDef = { - name = "artBush3Lo", - world ="All Worlds", - description ="artBush3Lo", - category ="Vegetation", - object ="features/artturi/artBush3Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBushWeird1Hi.lua b/Features/artturi/artBushWeird1Hi.lua deleted file mode 100644 index e92c9f9c2..000000000 --- a/Features/artturi/artBushWeird1Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBushWeird1Hi" -local featureDef = { - name = "artBushWeird1Hi", - world ="All Worlds", - description ="artBushWeird1Hi", - category ="Vegetation", - object ="features/artturi/artBushWeird1Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBushWeird1Lo.lua b/Features/artturi/artBushWeird1Lo.lua deleted file mode 100644 index 597a6bc50..000000000 --- a/Features/artturi/artBushWeird1Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBushWeird1Lo" -local featureDef = { - name = "artBushWeird1Lo", - world ="All Worlds", - description ="artBushWeird1Lo", - category ="Vegetation", - object ="features/artturi/artBushWeird1Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBushWeird2Hi.lua b/Features/artturi/artBushWeird2Hi.lua deleted file mode 100644 index 74ed2ae05..000000000 --- a/Features/artturi/artBushWeird2Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBushWeird2Hi" -local featureDef = { - name = "artBushWeird2Hi", - world ="All Worlds", - description ="artBushWeird2Hi", - category ="Vegetation", - object ="features/artturi/artBushWeird2Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artBushWeird2Lo.lua b/Features/artturi/artBushWeird2Lo.lua deleted file mode 100644 index 7c6cedbdc..000000000 --- a/Features/artturi/artBushWeird2Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artBushWeird2Lo" -local featureDef = { - name = "artBushWeird2Lo", - world ="All Worlds", - description ="artBushWeird2Lo", - category ="Vegetation", - object ="features/artturi/artBushWeird2Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleBasicHi.lua b/Features/artturi/artMapleBasicHi.lua deleted file mode 100644 index 443343b4d..000000000 --- a/Features/artturi/artMapleBasicHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleBasicHi" -local featureDef = { - name = "artMapleBasicHi", - world ="All Worlds", - description ="artMapleBasicHi", - category ="Vegetation", - object ="features/artturi/artMapleBasicHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleBasicLo.lua b/Features/artturi/artMapleBasicLo.lua deleted file mode 100644 index b1026a78b..000000000 --- a/Features/artturi/artMapleBasicLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleBasicLo" -local featureDef = { - name = "artMapleBasicLo", - world ="All Worlds", - description ="artMapleBasicLo", - category ="Vegetation", - object ="features/artturi/artMapleBasicLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleBigHi.lua b/Features/artturi/artMapleBigHi.lua deleted file mode 100644 index 3c837f19c..000000000 --- a/Features/artturi/artMapleBigHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleBigHi" -local featureDef = { - name = "artMapleBigHi", - world ="All Worlds", - description ="artMapleBigHi", - category ="Vegetation", - object ="features/artturi/artMapleBigHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleBigLo.lua b/Features/artturi/artMapleBigLo.lua deleted file mode 100644 index 976f68bdb..000000000 --- a/Features/artturi/artMapleBigLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleBigLo" -local featureDef = { - name = "artMapleBigLo", - world ="All Worlds", - description ="artMapleBigLo", - category ="Vegetation", - object ="features/artturi/artMapleBigLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleOldHi.lua b/Features/artturi/artMapleOldHi.lua deleted file mode 100644 index 24b8645d2..000000000 --- a/Features/artturi/artMapleOldHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleOldHi" -local featureDef = { - name = "artMapleOldHi", - world ="All Worlds", - description ="artMapleOldHi", - category ="Vegetation", - object ="features/artturi/artMapleOldHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleOldLo.lua b/Features/artturi/artMapleOldLo.lua deleted file mode 100644 index 0e8a2377c..000000000 --- a/Features/artturi/artMapleOldLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleOldLo" -local featureDef = { - name = "artMapleOldLo", - world ="All Worlds", - description ="artMapleOldLo", - category ="Vegetation", - object ="features/artturi/artMapleOldLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleTallHi.lua b/Features/artturi/artMapleTallHi.lua deleted file mode 100644 index a0933565e..000000000 --- a/Features/artturi/artMapleTallHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleTallHi" -local featureDef = { - name = "artMapleTallHi", - world ="All Worlds", - description ="artMapleTallHi", - category ="Vegetation", - object ="features/artturi/artMapleTallHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleTallLo.lua b/Features/artturi/artMapleTallLo.lua deleted file mode 100644 index f241dbe3f..000000000 --- a/Features/artturi/artMapleTallLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleTallLo" -local featureDef = { - name = "artMapleTallLo", - world ="All Worlds", - description ="artMapleTallLo", - category ="Vegetation", - object ="features/artturi/artMapleTallLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleVarHi.lua b/Features/artturi/artMapleVarHi.lua deleted file mode 100644 index 1d8953af5..000000000 --- a/Features/artturi/artMapleVarHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleVarHi" -local featureDef = { - name = "artMapleVarHi", - world ="All Worlds", - description ="artMapleVarHi", - category ="Vegetation", - object ="features/artturi/artMapleVarHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleWinterHi.lua b/Features/artturi/artMapleWinterHi.lua deleted file mode 100644 index fbc1907e8..000000000 --- a/Features/artturi/artMapleWinterHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleWinterHi" -local featureDef = { - name = "artMapleWinterHi", - world ="All Worlds", - description ="artMapleWinterHi", - category ="Vegetation", - object ="features/artturi/artMapleWinterHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleWinterLo.lua b/Features/artturi/artMapleWinterLo.lua deleted file mode 100644 index ca444ba1a..000000000 --- a/Features/artturi/artMapleWinterLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleWinterLo" -local featureDef = { - name = "artMapleWinterLo", - world ="All Worlds", - description ="artMapleWinterLo", - category ="Vegetation", - object ="features/artturi/artMapleWinterLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleYoungHi.lua b/Features/artturi/artMapleYoungHi.lua deleted file mode 100644 index d6033ddd4..000000000 --- a/Features/artturi/artMapleYoungHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleYoungHi" -local featureDef = { - name = "artMapleYoungHi", - world ="All Worlds", - description ="artMapleYoungHi", - category ="Vegetation", - object ="features/artturi/artMapleYoungHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artMapleYoungLo.lua b/Features/artturi/artMapleYoungLo.lua deleted file mode 100644 index 4f5697ad8..000000000 --- a/Features/artturi/artMapleYoungLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artMapleYoungLo" -local featureDef = { - name = "artMapleYoungLo", - world ="All Worlds", - description ="artMapleYoungLo", - category ="Vegetation", - object ="features/artturi/artMapleYoungLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBasicHi.lua b/Features/artturi/artOakBasicHi.lua deleted file mode 100644 index e55bdbd0d..000000000 --- a/Features/artturi/artOakBasicHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBasicHi" -local featureDef = { - name = "artOakBasicHi", - world ="All Worlds", - description ="artOakBasicHi", - category ="Vegetation", - object ="features/artturi/artOakBasicHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBasicLo.lua b/Features/artturi/artOakBasicLo.lua deleted file mode 100644 index f396680db..000000000 --- a/Features/artturi/artOakBasicLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBasicLo" -local featureDef = { - name = "artOakBasicLo", - world ="All Worlds", - description ="artOakBasicLo", - category ="Vegetation", - object ="features/artturi/artOakBasicLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBasicVarHi.lua b/Features/artturi/artOakBasicVarHi.lua deleted file mode 100644 index b8a962e1e..000000000 --- a/Features/artturi/artOakBasicVarHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBasicVarHi" -local featureDef = { - name = "artOakBasicVarHi", - world ="All Worlds", - description ="artOakBasicVarHi", - category ="Vegetation", - object ="features/artturi/artOakBasicVarHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBasicVarLo.lua b/Features/artturi/artOakBasicVarLo.lua deleted file mode 100644 index b6bb95edd..000000000 --- a/Features/artturi/artOakBasicVarLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBasicVarLo" -local featureDef = { - name = "artOakBasicVarLo", - world ="All Worlds", - description ="artOakBasicVarLo", - category ="Vegetation", - object ="features/artturi/artOakBasicVarLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBigHi.lua b/Features/artturi/artOakBigHi.lua deleted file mode 100644 index f60cc4c56..000000000 --- a/Features/artturi/artOakBigHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBigHi" -local featureDef = { - name = "artOakBigHi", - world ="All Worlds", - description ="artOakBigHi", - category ="Vegetation", - object ="features/artturi/artOakBigHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakBigLo.lua b/Features/artturi/artOakBigLo.lua deleted file mode 100644 index f5233a87c..000000000 --- a/Features/artturi/artOakBigLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakBigLo" -local featureDef = { - name = "artOakBigLo", - world ="All Worlds", - description ="artOakBigLo", - category ="Vegetation", - object ="features/artturi/artOakBigLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakGrandHi.lua b/Features/artturi/artOakGrandHi.lua deleted file mode 100644 index ae07a6328..000000000 --- a/Features/artturi/artOakGrandHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakGrandHi" -local featureDef = { - name = "artOakGrandHi", - world ="All Worlds", - description ="artOakGrandHi", - category ="Vegetation", - object ="features/artturi/artOakGrandHi.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={10, 300, 10}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakGrandLo.lua b/Features/artturi/artOakGrandLo.lua deleted file mode 100644 index b66c85823..000000000 --- a/Features/artturi/artOakGrandLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakGrandLo" -local featureDef = { - name = "artOakGrandLo", - world ="All Worlds", - description ="artOakGrandLo", - category ="Vegetation", - object ="features/artturi/artOakGrandLo.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={10, 300, 10}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakOldHi.lua b/Features/artturi/artOakOldHi.lua deleted file mode 100644 index 7fe9895f6..000000000 --- a/Features/artturi/artOakOldHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakOldHi" -local featureDef = { - name = "artOakOldHi", - world ="All Worlds", - description ="artOakOldHi", - category ="Vegetation", - object ="features/artturi/artOakOldHi.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={10, 300, 10}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakOldLo.lua b/Features/artturi/artOakOldLo.lua deleted file mode 100644 index f439fbf93..000000000 --- a/Features/artturi/artOakOldLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakOldLo" -local featureDef = { - name = "artOakOldLo", - world ="All Worlds", - description ="artOakOldLo", - category ="Vegetation", - object ="features/artturi/artOakOldLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakTallHi.lua b/Features/artturi/artOakTallHi.lua deleted file mode 100644 index 151a37982..000000000 --- a/Features/artturi/artOakTallHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakTallHi" -local featureDef = { - name = "artOakTallHi", - world ="All Worlds", - description ="artOakTallHi", - category ="Vegetation", - object ="features/artturi/artOakTallHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakTallLo.lua b/Features/artturi/artOakTallLo.lua deleted file mode 100644 index 360444650..000000000 --- a/Features/artturi/artOakTallLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakTallLo" -local featureDef = { - name = "artOakTallLo", - world ="All Worlds", - description ="artOakTallLo", - category ="Vegetation", - object ="features/artturi/artOakTallLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakYoungHi.lua b/Features/artturi/artOakYoungHi.lua deleted file mode 100644 index 718724708..000000000 --- a/Features/artturi/artOakYoungHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakYoungHi" -local featureDef = { - name = "artOakYoungHi", - world ="All Worlds", - description ="artOakYoungHi", - category ="Vegetation", - object ="features/artturi/artOakYoungHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/artOakYoungLo.lua b/Features/artturi/artOakYoungLo.lua deleted file mode 100644 index 8624f41a8..000000000 --- a/Features/artturi/artOakYoungLo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "artOakYoungLo" -local featureDef = { - name = "artOakYoungLo", - world ="All Worlds", - description ="artOakYoungLo", - category ="Vegetation", - object ="features/artturi/artOakYoungLo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPine1Lo.lua b/Features/artturi/finPine1Lo.lua deleted file mode 100644 index 709496fd0..000000000 --- a/Features/artturi/finPine1Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPine1Lo" -local featureDef = { - name = "finPine1Lo", - world ="All Worlds", - description ="finPine1Lo", - category ="Vegetation", - object ="features/artturi/finPine1Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPine2Lo.lua b/Features/artturi/finPine2Lo.lua deleted file mode 100644 index e6d9d55bf..000000000 --- a/Features/artturi/finPine2Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPine2Lo" -local featureDef = { - name = "finPine2Lo", - world ="All Worlds", - description ="finPine2Lo", - category ="Vegetation", - object ="features/artturi/finPine2Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineBigHi.lua b/Features/artturi/finPineBigHi.lua deleted file mode 100644 index 6ac9db80f..000000000 --- a/Features/artturi/finPineBigHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineBigHi" -local featureDef = { - name = "finPineBigHi", - world ="All Worlds", - description ="finPineBigHi", - category ="Vegetation", - object ="features/artturi/finPineBigHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineMediumHi.lua b/Features/artturi/finPineMediumHi.lua deleted file mode 100644 index abc356090..000000000 --- a/Features/artturi/finPineMediumHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineMediumHi" -local featureDef = { - name = "finPineMediumHi", - world ="All Worlds", - description ="finPineMediumHi", - category ="Vegetation", - object ="features/artturi/finPineMediumHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineSmallHi.lua b/Features/artturi/finPineSmallHi.lua deleted file mode 100644 index b636bc53d..000000000 --- a/Features/artturi/finPineSmallHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineSmallHi" -local featureDef = { - name = "finPineSmallHi", - world ="All Worlds", - description ="finPineSmallHi", - category ="Vegetation", - object ="features/artturi/finPineSmallHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineTallHi.lua b/Features/artturi/finPineTallHi.lua deleted file mode 100644 index 2d2e3c508..000000000 --- a/Features/artturi/finPineTallHi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineTallHi" -local featureDef = { - name = "finPineTallHi", - world ="All Worlds", - description ="finPineTallHi", - category ="Vegetation", - object ="features/artturi/finPineTallHi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineVar1Hi.lua b/Features/artturi/finPineVar1Hi.lua deleted file mode 100644 index 096b085a7..000000000 --- a/Features/artturi/finPineVar1Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineVar1Hi" -local featureDef = { - name = "finPineVar1Hi", - world ="All Worlds", - description ="finPineVar1Hi", - category ="Vegetation", - object ="features/artturi/finPineVar1Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineVar1Lo.lua b/Features/artturi/finPineVar1Lo.lua deleted file mode 100644 index a827f0d3b..000000000 --- a/Features/artturi/finPineVar1Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineVar1Lo" -local featureDef = { - name = "finPineVar1Lo", - world ="All Worlds", - description ="finPineVar1Lo", - category ="Vegetation", - object ="features/artturi/finPineVar1Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 50}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineVar2Hi.lua b/Features/artturi/finPineVar2Hi.lua deleted file mode 100644 index 3b82e6228..000000000 --- a/Features/artturi/finPineVar2Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineVar2Hi" -local featureDef = { - name = "finPineVar2Hi", - world ="All Worlds", - description ="finPineVar2Hi", - category ="Vegetation", - object ="features/artturi/finPineVar2Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineVar2Lo.lua b/Features/artturi/finPineVar2Lo.lua deleted file mode 100644 index 7297a882b..000000000 --- a/Features/artturi/finPineVar2Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineVar2Lo" -local featureDef = { - name = "finPineVar2Lo", - world ="All Worlds", - description ="finPineVar2Lo", - category ="Vegetation", - object ="features/artturi/finPineVar2Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird1Hi.lua b/Features/artturi/finPineWeird1Hi.lua deleted file mode 100644 index 973ae1a55..000000000 --- a/Features/artturi/finPineWeird1Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird1Hi" -local featureDef = { - name = "finPineWeird1Hi", - world ="All Worlds", - description ="finPineWeird1Hi", - category ="Vegetation", - object ="features/artturi/finPineWeird1Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird1Lo.lua b/Features/artturi/finPineWeird1Lo.lua deleted file mode 100644 index 8b408f8e0..000000000 --- a/Features/artturi/finPineWeird1Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird1Lo" -local featureDef = { - name = "finPineWeird1Lo", - world ="All Worlds", - description ="finPineWeird1Lo", - category ="Vegetation", - object ="features/artturi/finPineWeird1Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird2Hi.lua b/Features/artturi/finPineWeird2Hi.lua deleted file mode 100644 index e346de307..000000000 --- a/Features/artturi/finPineWeird2Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird2Hi" -local featureDef = { - name = "finPineWeird2Hi", - world ="All Worlds", - description ="finPineWeird2Hi", - category ="Vegetation", - object ="features/artturi/finPineWeird2Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird2Lo.lua b/Features/artturi/finPineWeird2Lo.lua deleted file mode 100644 index 028dca6d4..000000000 --- a/Features/artturi/finPineWeird2Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird2Lo" -local featureDef = { - name = "finPineWeird2Lo", - world ="All Worlds", - description ="finPineWeird2Lo", - category ="Vegetation", - object ="features/artturi/finPineWeird2Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird3Hi.lua b/Features/artturi/finPineWeird3Hi.lua deleted file mode 100644 index 6b09fb369..000000000 --- a/Features/artturi/finPineWeird3Hi.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird3Hi" -local featureDef = { - name = "finPineWeird3Hi", - world ="All Worlds", - description ="finPineWeird3Hi", - category ="Vegetation", - object ="features/artturi/finPineWeird3Hi.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/artturi/finPineWeird3Lo.lua b/Features/artturi/finPineWeird3Lo.lua deleted file mode 100644 index b08ddfd34..000000000 --- a/Features/artturi/finPineWeird3Lo.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "finPineWeird3Lo" -local featureDef = { - name = "finPineWeird3Lo", - world ="All Worlds", - description ="finPineWeird3Lo", - category ="Vegetation", - object ="features/artturi/finPineWeird3Lo.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy = 1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - collisionvolumetype ="box", - collisionvolumescales ={5, 50, 5}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_1.lua b/Features/beherith/brock_1.lua deleted file mode 100644 index 9a4627da7..000000000 --- a/Features/beherith/brock_1.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_1" -local featureDef = { - name = "brock_1", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_1.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =5, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_10.lua b/Features/beherith/brock_10.lua deleted file mode 100644 index 6379bf4a5..000000000 --- a/Features/beherith/brock_10.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_10" -local featureDef = { - name = "brock_10", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_10.s3o", - footprintx =6, - footprintz =6, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_2.lua b/Features/beherith/brock_2.lua deleted file mode 100644 index 274d1ab2b..000000000 --- a/Features/beherith/brock_2.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_2" -local featureDef = { - name = "brock_2", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_2.s3o", - footprintx =1, - footprintz =1, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =5, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_3.lua b/Features/beherith/brock_3.lua deleted file mode 100644 index 25d52ce43..000000000 --- a/Features/beherith/brock_3.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_3" -local featureDef = { - name = "brock_3", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_3.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =5, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_4.lua b/Features/beherith/brock_4.lua deleted file mode 100644 index d98dfe50b..000000000 --- a/Features/beherith/brock_4.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_4" -local featureDef = { - name = "brock_4", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_4.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =5, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_5.lua b/Features/beherith/brock_5.lua deleted file mode 100644 index 5719c2d00..000000000 --- a/Features/beherith/brock_5.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_5" -local featureDef = { - name = "brock_5", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_5.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_6.lua b/Features/beherith/brock_6.lua deleted file mode 100644 index ed18ed50a..000000000 --- a/Features/beherith/brock_6.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_6" -local featureDef = { - name = "brock_6", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_6.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_7.lua b/Features/beherith/brock_7.lua deleted file mode 100644 index acdf0f2fe..000000000 --- a/Features/beherith/brock_7.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_7" -local featureDef = { - name = "brock_7", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_7.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_8.lua b/Features/beherith/brock_8.lua deleted file mode 100644 index e2d66eac8..000000000 --- a/Features/beherith/brock_8.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_8" -local featureDef = { - name = "brock_8", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_8.s3o", - footprintx =4, - footprintz =4, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/brock_9.lua b/Features/beherith/brock_9.lua deleted file mode 100644 index afcc17118..000000000 --- a/Features/beherith/brock_9.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "brock_9" -local featureDef = { - name = "brock_9", - world ="All Worlds", - description ="Rock", - category ="Vegetation", - object ="features/beherith/brock_9.s3o", - footprintx =5, - footprintz =5, - height =30, - blocking =true, - upright =false, - hitdensity =1, - - metal = 0, ---metal =10, - damage =3000, - flammable =false, - reclaimable =true, - autoreclaimable =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreea_1.lua b/Features/beherith/btreea_1.lua deleted file mode 100644 index c20d86b31..000000000 --- a/Features/beherith/btreea_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreea_1" -local featureDef = { - name = "btreea_1", - world ="All Worlds", - description ="Birch Tree", - category ="Vegetation", - object ="features/beherith/btreea_1.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreea_2.lua b/Features/beherith/btreea_2.lua deleted file mode 100644 index 098561a21..000000000 --- a/Features/beherith/btreea_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreea_2" -local featureDef = { - name = "btreea_2", - world ="All Worlds", - description ="Birch Tree", - category ="Vegetation", - object ="features/beherith/btreea_2.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreea_3.lua b/Features/beherith/btreea_3.lua deleted file mode 100644 index e0469d342..000000000 --- a/Features/beherith/btreea_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreea_3" -local featureDef = { - name = "btreea_3", - world ="All Worlds", - description ="Birch Tree", - category ="Vegetation", - object ="features/beherith/btreea_3.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreea_4.lua b/Features/beherith/btreea_4.lua deleted file mode 100644 index 767fddbbc..000000000 --- a/Features/beherith/btreea_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreea_4" -local featureDef = { - name = "btreea_4", - world ="All Worlds", - description ="Birch Tree", - category ="Vegetation", - object ="features/beherith/btreea_4.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreea_5.lua b/Features/beherith/btreea_5.lua deleted file mode 100644 index 86445795f..000000000 --- a/Features/beherith/btreea_5.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreea_5" -local featureDef = { - name = "btreea_5", - world ="All Worlds", - description ="Birch Tree", - category ="Vegetation", - object ="features/beherith/btreea_5.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =0, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreebhi_1.lua b/Features/beherith/btreebhi_1.lua deleted file mode 100644 index b63d3324d..000000000 --- a/Features/beherith/btreebhi_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreebhi_1" -local featureDef = { - name = "btreebhi_1", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreebhi_1.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreebhi_2.lua b/Features/beherith/btreebhi_2.lua deleted file mode 100644 index 069c48f28..000000000 --- a/Features/beherith/btreebhi_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreebhi_2" -local featureDef = { - name = "btreebhi_2", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreebhi_2.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreebhi_3.lua b/Features/beherith/btreebhi_3.lua deleted file mode 100644 index 3766209ee..000000000 --- a/Features/beherith/btreebhi_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreebhi_3" -local featureDef = { - name = "btreebhi_3", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreebhi_3.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreebhi_4.lua b/Features/beherith/btreebhi_4.lua deleted file mode 100644 index 141821738..000000000 --- a/Features/beherith/btreebhi_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreebhi_4" -local featureDef = { - name = "btreebhi_4", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreebhi_4.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreebhi_5.lua b/Features/beherith/btreebhi_5.lua deleted file mode 100644 index 0cc1e14fd..000000000 --- a/Features/beherith/btreebhi_5.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreebhi_5" -local featureDef = { - name = "btreebhi_5", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreebhi_5.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeblo_1.lua b/Features/beherith/btreeblo_1.lua deleted file mode 100644 index 9c53e49ee..000000000 --- a/Features/beherith/btreeblo_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeblo_1" -local featureDef = { - name = "btreeblo_1", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreeblo_1.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeblo_2.lua b/Features/beherith/btreeblo_2.lua deleted file mode 100644 index 3169fe6ad..000000000 --- a/Features/beherith/btreeblo_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeblo_2" -local featureDef = { - name = "btreeblo_2", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreeblo_2.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeblo_3.lua b/Features/beherith/btreeblo_3.lua deleted file mode 100644 index 72279d6ed..000000000 --- a/Features/beherith/btreeblo_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeblo_3" -local featureDef = { - name = "btreeblo_3", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreeblo_3.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeblo_4.lua b/Features/beherith/btreeblo_4.lua deleted file mode 100644 index a3dda1d76..000000000 --- a/Features/beherith/btreeblo_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeblo_4" -local featureDef = { - name = "btreeblo_4", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreeblo_4.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeblo_5.lua b/Features/beherith/btreeblo_5.lua deleted file mode 100644 index 6cfd95df3..000000000 --- a/Features/beherith/btreeblo_5.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeblo_5" -local featureDef = { - name = "btreeblo_5", - world ="All Worlds", - description ="Elm Tree", - category ="Vegetation", - object ="features/beherith/btreeblo_5.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreechi_1.lua b/Features/beherith/btreechi_1.lua deleted file mode 100644 index 12cf90a2e..000000000 --- a/Features/beherith/btreechi_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreechi_1" -local featureDef = { - name = "btreechi_1", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreechi_1.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreechi_2.lua b/Features/beherith/btreechi_2.lua deleted file mode 100644 index 4edcb85a6..000000000 --- a/Features/beherith/btreechi_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreechi_2" -local featureDef = { - name = "btreechi_2", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreechi_2.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreechi_3.lua b/Features/beherith/btreechi_3.lua deleted file mode 100644 index b6a4b9814..000000000 --- a/Features/beherith/btreechi_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreechi_3" -local featureDef = { - name = "btreechi_3", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreechi_3.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreechi_4.lua b/Features/beherith/btreechi_4.lua deleted file mode 100644 index 9e9a124f8..000000000 --- a/Features/beherith/btreechi_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreechi_4" -local featureDef = { - name = "btreechi_4", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreechi_4.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeclo_1.lua b/Features/beherith/btreeclo_1.lua deleted file mode 100644 index 97711834e..000000000 --- a/Features/beherith/btreeclo_1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeclo_1" -local featureDef = { - name = "btreeclo_1", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreeclo_1.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeclo_2.lua b/Features/beherith/btreeclo_2.lua deleted file mode 100644 index 66cc84748..000000000 --- a/Features/beherith/btreeclo_2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeclo_2" -local featureDef = { - name = "btreeclo_2", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreeclo_2.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeclo_3.lua b/Features/beherith/btreeclo_3.lua deleted file mode 100644 index e4f88d769..000000000 --- a/Features/beherith/btreeclo_3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeclo_3" -local featureDef = { - name = "btreeclo_3", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreeclo_3.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/beherith/btreeclo_4.lua b/Features/beherith/btreeclo_4.lua deleted file mode 100644 index e120d0818..000000000 --- a/Features/beherith/btreeclo_4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "btreeclo_4" -local featureDef = { - name = "btreeclo_4", - world ="All Worlds", - description ="Cedar Tree", - category ="Vegetation", - object ="features/beherith/btreeclo_4.s3o", - footprintx =3, - footprintz =3, - height =30, - blocking =true, - upright =true, - hitdensity =50, - energy = 10, --- energy =1, - - damage =100, - flammable =true, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Buds.lua b/Features/lathan/Buds.lua deleted file mode 100644 index 5d9eca665..000000000 --- a/Features/lathan/Buds.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Buds" -local featureDef = { - name = "Buds", - world ="allworld", - description ="Plant Stems", - category ="Vegitation", - object ="features/lathan/Buds.s3o", - footprintx =1, - footprintz =1, - height =8, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =50, - metal = 0, ---metal =0, - damage =50, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/BushyPlant.lua b/Features/lathan/BushyPlant.lua deleted file mode 100644 index 52e6789b2..000000000 --- a/Features/lathan/BushyPlant.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "BushyPlant" -local featureDef = { - name = "BushyPlant", - world ="allworld", - description ="Bushy Plant", - category ="Vegitation", - object ="features/lathan/BushyPlant.s3o", - footprintx =2, - footprintz =2, - height =12, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =220, - metal = 0, ---metal =0, - damage =80, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Cactus1.lua b/Features/lathan/Cactus1.lua deleted file mode 100644 index 947edd66d..000000000 --- a/Features/lathan/Cactus1.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus1 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus1", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus2.lua b/Features/lathan/Cactus2.lua deleted file mode 100644 index a4dab2a33..000000000 --- a/Features/lathan/Cactus2.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus2 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus2", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus3.lua b/Features/lathan/Cactus3.lua deleted file mode 100644 index fc102d705..000000000 --- a/Features/lathan/Cactus3.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus3 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus3", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus4.lua b/Features/lathan/Cactus4.lua deleted file mode 100644 index 00331b930..000000000 --- a/Features/lathan/Cactus4.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus4 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus4", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus5.lua b/Features/lathan/Cactus5.lua deleted file mode 100644 index c24863fd9..000000000 --- a/Features/lathan/Cactus5.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus5 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus5", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus6.lua b/Features/lathan/Cactus6.lua deleted file mode 100644 index 857ea2bcd..000000000 --- a/Features/lathan/Cactus6.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus6 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus6", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Cactus7.lua b/Features/lathan/Cactus7.lua deleted file mode 100644 index 39cb68294..000000000 --- a/Features/lathan/Cactus7.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Cactus7 ------------------------------------------------------------------------------ -local featureDef = { - name = "Cactus7", - blocking = false, - category = "Vegitation", - damage = 500, - description = "Cactus", - energy = 10, --- energy = 50, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Cactus7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/CattailBig.lua b/Features/lathan/CattailBig.lua deleted file mode 100644 index 93ccb261b..000000000 --- a/Features/lathan/CattailBig.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "CattailBig" -local featureDef = { - name = "CattailBig", - world ="allworld", - description ="Cattails", - category ="Vegitation", - object ="features/lathan/CattailBig.s3o", - footprintx =3, - footprintz =3, - height =33, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =290, - metal = 0, ---metal =0, - damage =120, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/CattailSmall.lua b/Features/lathan/CattailSmall.lua deleted file mode 100644 index e08b7585e..000000000 --- a/Features/lathan/CattailSmall.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "CattailSmall" -local featureDef = { - name = "CattailSmall", - world ="allworld", - description ="Cattails", - category ="Vegitation", - object ="features/lathan/CattailSmall.s3o", - footprintx =2, - footprintz =2, - height =27, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =180, - metal = 0, ---metal =0, - damage =90, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/EIStatue1.lua b/Features/lathan/EIStatue1.lua deleted file mode 100644 index b645fd9f6..000000000 --- a/Features/lathan/EIStatue1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue1 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue1", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "42", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue2.lua b/Features/lathan/EIStatue2.lua deleted file mode 100644 index 25f2b0b41..000000000 --- a/Features/lathan/EIStatue2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue2 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue2", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "42", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue3.lua b/Features/lathan/EIStatue3.lua deleted file mode 100644 index 4f305ff38..000000000 --- a/Features/lathan/EIStatue3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue3 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue3", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 4, - height = "25", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue4.lua b/Features/lathan/EIStatue4.lua deleted file mode 100644 index 62984a750..000000000 --- a/Features/lathan/EIStatue4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue4 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue4", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "42", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue5.lua b/Features/lathan/EIStatue5.lua deleted file mode 100644 index 4a9587e43..000000000 --- a/Features/lathan/EIStatue5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue5 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue5", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 7, - footprintZ = 7, - height = "42", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue6.lua b/Features/lathan/EIStatue6.lua deleted file mode 100644 index 46636778a..000000000 --- a/Features/lathan/EIStatue6.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue6 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue6", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 7, - footprintZ = 7, - height = "25", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue7.lua b/Features/lathan/EIStatue7.lua deleted file mode 100644 index cea42740d..000000000 --- a/Features/lathan/EIStatue7.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue7 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue7", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "42", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatue8.lua b/Features/lathan/EIStatue8.lua deleted file mode 100644 index 53cef3b6b..000000000 --- a/Features/lathan/EIStatue8.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatue8 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatue8", - blocking = v, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 3, - height = "12", - hitdensity = "5", - metal = 0, ---metal = 15, - object = "features/lathan/EIStatue8.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatueCL1.lua b/Features/lathan/EIStatueCL1.lua deleted file mode 100644 index 8f11fd9c2..000000000 --- a/Features/lathan/EIStatueCL1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatueCL1 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatueCL1", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 12, - footprintZ = 2, - height = "12", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/EIStatueCL1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/EIStatueCL2.lua b/Features/lathan/EIStatueCL2.lua deleted file mode 100644 index 013ed0ba9..000000000 --- a/Features/lathan/EIStatueCL2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatueCL2 ------------------------------------------------------------------------------ -local featureDef = { - name = "EIStatueCL2", - blocking = true, - category = "Rocks", - damage = 500, - description = "Easter Island statue", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 6, - height = "12", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/EIStatueCL2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Espire1.lua b/Features/lathan/Espire1.lua deleted file mode 100644 index 5a4f5ea67..000000000 --- a/Features/lathan/Espire1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Espire1 ------------------------------------------------------------------------------ -local featureDef = { - name = "Espire1", - blocking = true, - category = "rocks", - damage = 4000, - description = "Energy Spire", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Espire1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Espire2.lua b/Features/lathan/Espire2.lua deleted file mode 100644 index 748f2f193..000000000 --- a/Features/lathan/Espire2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Espire2 ------------------------------------------------------------------------------ -local featureDef = { - name = "Espire2", - blocking = true, - category = "rocks", - damage = 4000, - description = "Energy Spire", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Espire2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Espire3.lua b/Features/lathan/Espire3.lua deleted file mode 100644 index 03ceadd3c..000000000 --- a/Features/lathan/Espire3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Espire3 ------------------------------------------------------------------------------ -local featureDef = { - name = "Espire3", - blocking = true, - category = "rocks", - damage = 4000, - description = "Energy Spire", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Espire3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Espire4.lua b/Features/lathan/Espire4.lua deleted file mode 100644 index 7dde3656a..000000000 --- a/Features/lathan/Espire4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Espire4 ------------------------------------------------------------------------------ -local featureDef = { - name = "Espire4", - blocking = true, - category = "rocks", - damage = 4000, - description = "Energy Spire", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Espire4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Espire5.lua b/Features/lathan/Espire5.lua deleted file mode 100644 index 06a84e2bf..000000000 --- a/Features/lathan/Espire5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Espire5 ------------------------------------------------------------------------------ -local featureDef = { - name = "Espire5", - blocking = true, - category = "rocks", - damage = 4000, - description = "Energy Spire", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Espire5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Fern_Big.lua b/Features/lathan/Fern_Big.lua deleted file mode 100644 index 4ab9cf3be..000000000 --- a/Features/lathan/Fern_Big.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Fern_Big" -local featureDef = { - name = "Fern_Big", - world ="allworld", - description ="Big Fern", - category ="Vegitation", - object ="features/lathan/Fern_Big.s3o", - footprintx =3, - footprintz =3, - height =12, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =180, - metal = 0, ---metal =0, - damage =120, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Fern_Sword.lua b/Features/lathan/Fern_Sword.lua deleted file mode 100644 index 7ebf32ec4..000000000 --- a/Features/lathan/Fern_Sword.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Fern_Sword" -local featureDef = { - name = "Fern_Sword", - world ="allworld", - description ="Fern", - category ="Vegitation", - object ="features/lathan/Fern_Sword.s3o", - footprintx =2, - footprintz =2, - height =15, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =150, - metal = 0, ---metal =0, - damage =120, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Grass_Big.lua b/Features/lathan/Grass_Big.lua deleted file mode 100644 index 515e71d4d..000000000 --- a/Features/lathan/Grass_Big.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Grass_Big" -local featureDef = { - name = "Grass_Big", - world ="allworld", - description ="Tall Grass", - category ="Vegitation", - object ="features/lathan/Grass_Big.s3o", - footprintx =4, - footprintz =4, - height =12, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =160, - metal = 0, ---metal =0, - damage =120, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Grass_Small.lua b/Features/lathan/Grass_Small.lua deleted file mode 100644 index de776199a..000000000 --- a/Features/lathan/Grass_Small.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Grass_Small" -local featureDef = { - name = "Grass_Small", - world ="allworld", - description ="Tall Grass", - category ="Vegitation", - object ="features/lathan/Grass_Small.s3o", - footprintx =2, - footprintz =2, - height =12, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =80, - metal = 0, ---metal =0, - damage =75, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/GreyRock1.lua b/Features/lathan/GreyRock1.lua deleted file mode 100644 index d93e0e8a5..000000000 --- a/Features/lathan/GreyRock1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock1 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock1", - blocking = true, - category = "rocks", - damage = 500, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 5, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock2.lua b/Features/lathan/GreyRock2.lua deleted file mode 100644 index 0ecdf1743..000000000 --- a/Features/lathan/GreyRock2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock2 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock2", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock3.lua b/Features/lathan/GreyRock3.lua deleted file mode 100644 index a8c5258d3..000000000 --- a/Features/lathan/GreyRock3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock3 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock3", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock4.lua b/Features/lathan/GreyRock4.lua deleted file mode 100644 index 1e7586a0e..000000000 --- a/Features/lathan/GreyRock4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock4 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock4", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock5.lua b/Features/lathan/GreyRock5.lua deleted file mode 100644 index 8e35be9cf..000000000 --- a/Features/lathan/GreyRock5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock5 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock5", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock6.lua b/Features/lathan/GreyRock6.lua deleted file mode 100644 index e8cd89a8a..000000000 --- a/Features/lathan/GreyRock6.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock6 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock6", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/GreyRock7.lua b/Features/lathan/GreyRock7.lua deleted file mode 100644 index 2cb0ada0e..000000000 --- a/Features/lathan/GreyRock7.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock7 ------------------------------------------------------------------------------ -local featureDef = { - name = "GreyRock7", - blocking = true, - category = "rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 35, - object = "features/lathan/GreyRock7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Leafy_Plant.lua b/Features/lathan/Leafy_Plant.lua deleted file mode 100644 index c88e9c0d0..000000000 --- a/Features/lathan/Leafy_Plant.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "Leafy_Plant" -local featureDef = { - name = "Leafy_Plant", - world ="allworld", - description ="Orange Mushrooms", - category ="Vegitation", - object ="features/lathan/Leafy_Plant.s3o", - footprintx =2, - footprintz =2, - height =49, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =200, - metal = 0, ---metal =0, - damage =120, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad1E.lua b/Features/lathan/LilyPad1E.lua deleted file mode 100644 index 53aa124b4..000000000 --- a/Features/lathan/LilyPad1E.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad1E" -local featureDef = { - name = "LilyPad1E", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad1E.s3o", - footprintx =4, - footprintz =4, - height =13, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =220, - metal = 0, ---metal =0, - damage =120, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad1N.lua b/Features/lathan/LilyPad1N.lua deleted file mode 100644 index 7dab9f607..000000000 --- a/Features/lathan/LilyPad1N.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad1N" -local featureDef = { - name = "LilyPad1N", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad1N.s3o", - footprintx =4, - footprintz =4, - height =13, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =220, - metal = 0, ---metal =0, - damage =120, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad1S.lua b/Features/lathan/LilyPad1S.lua deleted file mode 100644 index fd3a5cef8..000000000 --- a/Features/lathan/LilyPad1S.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad1S" -local featureDef = { - name = "LilyPad1S", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad1S.s3o", - footprintx =4, - footprintz =4, - height =13, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =220, - metal = 0, ---metal =0, - damage =120, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad1W.lua b/Features/lathan/LilyPad1W.lua deleted file mode 100644 index 68aaf9ec9..000000000 --- a/Features/lathan/LilyPad1W.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad1W" -local featureDef = { - name = "LilyPad1W", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad1W.s3o", - footprintx =4, - footprintz =4, - height =13, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =220, - metal = 0, ---metal =0, - damage =120, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad2E.lua b/Features/lathan/LilyPad2E.lua deleted file mode 100644 index 9c0e5924b..000000000 --- a/Features/lathan/LilyPad2E.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad2E" -local featureDef = { - name = "LilyPad2E", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad2E.s3o", - footprintx =4, - footprintz =4, - height =1, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =120, - metal = 0, ---metal =0, - damage =70, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad2N.lua b/Features/lathan/LilyPad2N.lua deleted file mode 100644 index 60ba21b86..000000000 --- a/Features/lathan/LilyPad2N.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad2N" -local featureDef = { - name = "LilyPad2N", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad2N.s3o", - footprintx =4, - footprintz =4, - height =1, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =120, - metal = 0, ---metal =0, - damage =70, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad2S.lua b/Features/lathan/LilyPad2S.lua deleted file mode 100644 index a6323eb3f..000000000 --- a/Features/lathan/LilyPad2S.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad2S" -local featureDef = { - name = "LilyPad2S", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad2S.s3o", - footprintx =4, - footprintz =4, - height =1, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =120, - metal = 0, ---metal =0, - damage =70, - flammable =false, - reclaimable =false, - indestructible ="1.0", - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/LilyPad2W.lua b/Features/lathan/LilyPad2W.lua deleted file mode 100644 index 1d7a5ebe7..000000000 --- a/Features/lathan/LilyPad2W.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "LilyPad2W" -local featureDef = { - name = "LilyPad2W", - world ="allworld", - description ="Lily Pads", - category ="Vegitation", - object ="features/lathan/LilyPad2W.s3o", - footprintx =4, - footprintz =4, - height =1, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =120, - metal = 0, ---metal =0, - damage =70, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Mushroom01.lua b/Features/lathan/Mushroom01.lua deleted file mode 100644 index ea12f5878..000000000 --- a/Features/lathan/Mushroom01.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom01 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom01", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom01.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom02.lua b/Features/lathan/Mushroom02.lua deleted file mode 100644 index b3e812a5a..000000000 --- a/Features/lathan/Mushroom02.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom02 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom02", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom02.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom03.lua b/Features/lathan/Mushroom03.lua deleted file mode 100644 index 664a45d46..000000000 --- a/Features/lathan/Mushroom03.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom03 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom03", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom03.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom04.lua b/Features/lathan/Mushroom04.lua deleted file mode 100644 index 10a589b35..000000000 --- a/Features/lathan/Mushroom04.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom04 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom04", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom04.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom05.lua b/Features/lathan/Mushroom05.lua deleted file mode 100644 index d0a079cd3..000000000 --- a/Features/lathan/Mushroom05.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom05 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom05", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom05.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom06.lua b/Features/lathan/Mushroom06.lua deleted file mode 100644 index 00b5fc8be..000000000 --- a/Features/lathan/Mushroom06.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom06 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom06", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom06.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom07.lua b/Features/lathan/Mushroom07.lua deleted file mode 100644 index 017d43d98..000000000 --- a/Features/lathan/Mushroom07.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom07 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom07", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom07.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom08.lua b/Features/lathan/Mushroom08.lua deleted file mode 100644 index d2d1e27f0..000000000 --- a/Features/lathan/Mushroom08.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom08 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom08", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 7, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom08.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom09.lua b/Features/lathan/Mushroom09.lua deleted file mode 100644 index 5ab413ecb..000000000 --- a/Features/lathan/Mushroom09.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom09 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom09", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 8, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom09.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom10.lua b/Features/lathan/Mushroom10.lua deleted file mode 100644 index dc8b304ad..000000000 --- a/Features/lathan/Mushroom10.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom10 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom10", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Orange Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 10, - footprintZ = 8, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom10.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom11.lua b/Features/lathan/Mushroom11.lua deleted file mode 100644 index b4f55320e..000000000 --- a/Features/lathan/Mushroom11.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom11 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom11", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom11.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom12.lua b/Features/lathan/Mushroom12.lua deleted file mode 100644 index 051a63702..000000000 --- a/Features/lathan/Mushroom12.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom12 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom12", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom12.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom13.lua b/Features/lathan/Mushroom13.lua deleted file mode 100644 index 11afa5a56..000000000 --- a/Features/lathan/Mushroom13.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom13 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom13", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom13.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom14.lua b/Features/lathan/Mushroom14.lua deleted file mode 100644 index ccf5b6c12..000000000 --- a/Features/lathan/Mushroom14.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom14 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom14", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom14.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom15.lua b/Features/lathan/Mushroom15.lua deleted file mode 100644 index b4410dca7..000000000 --- a/Features/lathan/Mushroom15.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom15 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom15", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom15.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom16.lua b/Features/lathan/Mushroom16.lua deleted file mode 100644 index fe8827123..000000000 --- a/Features/lathan/Mushroom16.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom16 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom16", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom16.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom17.lua b/Features/lathan/Mushroom17.lua deleted file mode 100644 index dd5463773..000000000 --- a/Features/lathan/Mushroom17.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom17 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom17", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom17.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom18.lua b/Features/lathan/Mushroom18.lua deleted file mode 100644 index 243a3300b..000000000 --- a/Features/lathan/Mushroom18.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom18 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom18", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 7, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom18.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom19.lua b/Features/lathan/Mushroom19.lua deleted file mode 100644 index d6db850ce..000000000 --- a/Features/lathan/Mushroom19.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom19 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom19", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 8, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom19.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom20.lua b/Features/lathan/Mushroom20.lua deleted file mode 100644 index ff3967594..000000000 --- a/Features/lathan/Mushroom20.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom20 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom20", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Purple Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 10, - footprintZ = 8, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom20.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom21.lua b/Features/lathan/Mushroom21.lua deleted file mode 100644 index 79e3cdd36..000000000 --- a/Features/lathan/Mushroom21.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom21 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom21", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom21.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom22.lua b/Features/lathan/Mushroom22.lua deleted file mode 100644 index 983427831..000000000 --- a/Features/lathan/Mushroom22.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom22 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom22", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom22.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom23.lua b/Features/lathan/Mushroom23.lua deleted file mode 100644 index 1fa072081..000000000 --- a/Features/lathan/Mushroom23.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom23 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom23", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom23.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom24.lua b/Features/lathan/Mushroom24.lua deleted file mode 100644 index 4678ec187..000000000 --- a/Features/lathan/Mushroom24.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom24 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom24", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom24.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom25.lua b/Features/lathan/Mushroom25.lua deleted file mode 100644 index 2281e28da..000000000 --- a/Features/lathan/Mushroom25.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom25 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom25", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom25.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom26.lua b/Features/lathan/Mushroom26.lua deleted file mode 100644 index 1ee6ff797..000000000 --- a/Features/lathan/Mushroom26.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom26 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom26", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom26.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom27.lua b/Features/lathan/Mushroom27.lua deleted file mode 100644 index 55a901884..000000000 --- a/Features/lathan/Mushroom27.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom27 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom27", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 7, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom27.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom28.lua b/Features/lathan/Mushroom28.lua deleted file mode 100644 index e84ad3b9d..000000000 --- a/Features/lathan/Mushroom28.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom28 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom28", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom28.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom29.lua b/Features/lathan/Mushroom29.lua deleted file mode 100644 index 392ba9cd0..000000000 --- a/Features/lathan/Mushroom29.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom29 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom29", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 8, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom29.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Mushroom30.lua b/Features/lathan/Mushroom30.lua deleted file mode 100644 index 14a2c6079..000000000 --- a/Features/lathan/Mushroom30.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Mushroom30 ------------------------------------------------------------------------------ -local featureDef = { - name = "Mushroom30", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Tan Mushrooms", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 6, - footprintZ = 6, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Mushroom30.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/PosionIvy.lua b/Features/lathan/PosionIvy.lua deleted file mode 100644 index 93c7b0869..000000000 --- a/Features/lathan/PosionIvy.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "PosionIvy" -local featureDef = { - name = "PosionIvy", - world ="allworld", - description ="Posion Ivy", - category ="Vegitation", - object ="features/lathan/PosionIvy.s3o", - footprintx =1, - footprintz =1, - height =46, - blocking =false, - upright =true, - hitdensity =0, - energy = 10, --- energy =140, - metal = 0, ---metal =0, - damage =80, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SLRock1.lua b/Features/lathan/SLRock1.lua deleted file mode 100644 index fb008a1c5..000000000 --- a/Features/lathan/SLRock1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- SLRock1 ------------------------------------------------------------------------------ -local featureDef = { - name = "SLRock1", - blocking = true, - category = "Rocks", - damage = 6000, - description = "ShorelineRock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 11, - footprintZ = 7, - height = "298", - hitdensity = "5", - metal = 0, ---metal = 50, - object = "features/lathan/SLRock1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SLRock2.lua b/Features/lathan/SLRock2.lua deleted file mode 100644 index 2bf7c3505..000000000 --- a/Features/lathan/SLRock2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- SLRock2 ------------------------------------------------------------------------------ -local featureDef = { - name = "SLRock2", - blocking = true, - category = "Rocks", - damage = 6000, - description = "Shoreline Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 12, - footprintZ = 6, - height = "298", - hitdensity = "5", - metal = 0, ---metal = 50, - object = "features/lathan/SLRock2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SLRock3.lua b/Features/lathan/SLRock3.lua deleted file mode 100644 index 05abd0781..000000000 --- a/Features/lathan/SLRock3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- SLRock3 ------------------------------------------------------------------------------ -local featureDef = { - name = "SLRock3", - blocking = true, - category = "Rocks", - damage = 6000, - description = "Shoreline Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 12, - footprintZ = 13, - height = "298", - hitdensity = "5", - metal = 0, ---metal = 50, - object = "features/lathan/SLRock3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SLRock4.lua b/Features/lathan/SLRock4.lua deleted file mode 100644 index 88370185b..000000000 --- a/Features/lathan/SLRock4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- SLRock4 ------------------------------------------------------------------------------ -local featureDef = { - name = "SLRock4", - blocking = true, - category = "Rocks", - damage = 6000, - description = "Shoreline Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 10, - footprintZ = 10, - height = "298", - hitdensity = "5", - metal = 0, ---metal = 50, - object = "features/lathan/SLRock4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SLRockCL1.lua b/Features/lathan/SLRockCL1.lua deleted file mode 100644 index f9b8dfaee..000000000 --- a/Features/lathan/SLRockCL1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- EIStatueCL2 ------------------------------------------------------------------------------ -local featureDef = { - name = "SLRockCL1", - blocking = true, - category = "Rocks", - damage = 3000, - description = "ShorelineRock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 19, - footprintZ = 19, - height = "298", - hitdensity = "5", - metal = 0, ---metal = 50, - object = "features/lathan/SLRockCL1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/STRoot101.lua b/Features/lathan/STRoot101.lua deleted file mode 100644 index 7f3a4e22d..000000000 --- a/Features/lathan/STRoot101.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- STRoot101 ------------------------------------------------------------------------------ -local featureDef = { - name = "STRoot101", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Gigantic Swamp Tree", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "4972", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/STRoot101.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/STRoot201.lua b/Features/lathan/STRoot201.lua deleted file mode 100644 index 5ffb20979..000000000 --- a/Features/lathan/STRoot201.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- STRoot201 ------------------------------------------------------------------------------ -local featureDef = { - name = "STRoot201", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Gigantic Swamp Tree", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 8, - footprintZ = 5, - height = "4972", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/STRoot201.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/STRoot301.lua b/Features/lathan/STRoot301.lua deleted file mode 100644 index 7a9f5b892..000000000 --- a/Features/lathan/STRoot301.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- STRoot301 ------------------------------------------------------------------------------ -local featureDef = { - name = "STRoot301", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Gigantic Swamp Tree", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 4, - footprintZ = 13, - height = "4972", - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/STRoot301.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/STRoot401.lua b/Features/lathan/STRoot401.lua deleted file mode 100644 index 1b413a435..000000000 --- a/Features/lathan/STRoot401.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- STRoot401 ------------------------------------------------------------------------------ -local featureDef = { - name = "STRoot401", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Gigantic Swamp Tree", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "4972", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/STRoot401.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/STTrunk01.lua b/Features/lathan/STTrunk01.lua deleted file mode 100644 index 7133ca08e..000000000 --- a/Features/lathan/STTrunk01.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- STTrunk01 ------------------------------------------------------------------------------ -local featureDef = { - name = "STTrunk01", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Gigantic Swamp Tree", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 8, - footprintZ = 7, - height = "4972", - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/STTrunk01.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowIndyDish1.lua b/Features/lathan/SnowIndyDish1.lua deleted file mode 100644 index 00839d393..000000000 --- a/Features/lathan/SnowIndyDish1.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowIndyDish1 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowIndyDish1", - blocking = true, - category = "industrial", - damage = 6500, - description = "Snowy Satellite Dish", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 16, - footprintZ = 16, - height = "4972", - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 0, - object = "features/lathan/SnowIndyDish1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowIndyDish2.lua b/Features/lathan/SnowIndyDish2.lua deleted file mode 100644 index 206a3ff8c..000000000 --- a/Features/lathan/SnowIndyDish2.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowIndyDish2 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowIndyDish2", - blocking = true, - category = "industrial", - damage = 6500, - description = "Snowy Satellite Dish", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 16, - footprintZ = 16, - height = "4972", - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/SnowIndyDish2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowIndyPC1E.lua b/Features/lathan/SnowIndyPC1E.lua deleted file mode 100644 index 087ae19dd..000000000 --- a/Features/lathan/SnowIndyPC1E.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowIndyPC1E" -local featureDef = { - name = "SnowIndyPC1E", - world ="allworld", - description ="Snowy Petrochemical Plant", - category ="SnowyIndy", - object ="features/lathan/SnowIndyPC1E.s3o", - footprintx =14, - footprintz =14, - height =80, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =4200, - damage =1100, - flammable =false, - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowIndyPC1N.lua b/Features/lathan/SnowIndyPC1N.lua deleted file mode 100644 index b9e0b2215..000000000 --- a/Features/lathan/SnowIndyPC1N.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowIndyPC1N" -local featureDef = { - name = "SnowIndyPC1N", - world ="allworld", - description ="Snowy Petrochemical Plant", - category ="SnowyIndy", - object ="features/lathan/SnowIndyPC1N.s3o", - footprintx =14, - footprintz =14, - height =80, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =4200, - damage =1100, - flammable =false, - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowIndyPC1S.lua b/Features/lathan/SnowIndyPC1S.lua deleted file mode 100644 index e0c4e8a17..000000000 --- a/Features/lathan/SnowIndyPC1S.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowIndyPC1S" -local featureDef = { - name = "SnowIndyPC1S", - world ="allworld", - description ="Snowy Petrochemical Plant", - category ="SnowyIndy", - object ="features/lathan/SnowIndyPC1S.s3o", - footprintx =14, - footprintz =14, - height =80, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =4200, - damage =1100, - flammable =false, - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowIndyPC1W.lua b/Features/lathan/SnowIndyPC1W.lua deleted file mode 100644 index 103e951cf..000000000 --- a/Features/lathan/SnowIndyPC1W.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowIndyPC1W" -local featureDef = { - name = "SnowIndyPC1W", - world ="allworld", - description ="Snowy Petrochemical Plant", - category ="SnowyIndy", - object ="features/lathan/SnowIndyPC1W.s3o", - footprintx =14, - footprintz =14, - height =80, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =4200, - damage =1100, - flammable =false, - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeCNS.lua b/Features/lathan/SnowPipeCNS.lua deleted file mode 100644 index 5355fb85c..000000000 --- a/Features/lathan/SnowPipeCNS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeCNS" -local featureDef = { - name = "SnowPipeCNS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeCNS.s3o", - footprintx =4, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeCWE.lua b/Features/lathan/SnowPipeCWE.lua deleted file mode 100644 index 625debfc5..000000000 --- a/Features/lathan/SnowPipeCWE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeCWE" -local featureDef = { - name = "SnowPipeCWE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeCWE.s3o", - footprintx =4, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLBE.lua b/Features/lathan/SnowPipeLBE.lua deleted file mode 100644 index 7e31212c4..000000000 --- a/Features/lathan/SnowPipeLBE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLBE" -local featureDef = { - name = "SnowPipeLBE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLBE.s3o", - footprintx =8, - footprintz =5, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLBN.lua b/Features/lathan/SnowPipeLBN.lua deleted file mode 100644 index ab3526896..000000000 --- a/Features/lathan/SnowPipeLBN.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLBN" -local featureDef = { - name = "SnowPipeLBN", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLBN.s3o", - footprintx =5, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLBS.lua b/Features/lathan/SnowPipeLBS.lua deleted file mode 100644 index 3e6001734..000000000 --- a/Features/lathan/SnowPipeLBS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLBS" -local featureDef = { - name = "SnowPipeLBS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLBS.s3o", - footprintx =5, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLBW.lua b/Features/lathan/SnowPipeLBW.lua deleted file mode 100644 index 15dc38cdb..000000000 --- a/Features/lathan/SnowPipeLBW.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLBW" -local featureDef = { - name = "SnowPipeLBW", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLBW.s3o", - footprintx =8, - footprintz =5, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLE.lua b/Features/lathan/SnowPipeLE.lua deleted file mode 100644 index 4011bf033..000000000 --- a/Features/lathan/SnowPipeLE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLE" -local featureDef = { - name = "SnowPipeLE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLE.s3o", - footprintx =8, - footprintz =5, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLN.lua b/Features/lathan/SnowPipeLN.lua deleted file mode 100644 index 2e13845d3..000000000 --- a/Features/lathan/SnowPipeLN.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLN" -local featureDef = { - name = "SnowPipeLN", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLN.s3o", - footprintx =5, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLS.lua b/Features/lathan/SnowPipeLS.lua deleted file mode 100644 index e661039da..000000000 --- a/Features/lathan/SnowPipeLS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLS" -local featureDef = { - name = "SnowPipeLS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLS.s3o", - upright =true, - footprintx =5, - footprintz =8, - height =78, - blocking =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeLW.lua b/Features/lathan/SnowPipeLW.lua deleted file mode 100644 index 114eccff6..000000000 --- a/Features/lathan/SnowPipeLW.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeLW" -local featureDef = { - name = "SnowPipeLW", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeLW.s3o", - footprintx =8, - footprintz =5, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTBE.lua b/Features/lathan/SnowPipeTBE.lua deleted file mode 100644 index 5f0fd9d24..000000000 --- a/Features/lathan/SnowPipeTBE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTBE" -local featureDef = { - name = "SnowPipeTBE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTBE.s3o", - footprintx =8, - footprintz =4, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTBN.lua b/Features/lathan/SnowPipeTBN.lua deleted file mode 100644 index fd16b6357..000000000 --- a/Features/lathan/SnowPipeTBN.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTBN" -local featureDef = { - name = "SnowPipeTBN", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTBN.s3o", - footprintx =4, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTBS.lua b/Features/lathan/SnowPipeTBS.lua deleted file mode 100644 index bfb2c7384..000000000 --- a/Features/lathan/SnowPipeTBS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTBS" -local featureDef = { - name = "SnowPipeTBS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTBS.s3o", - footprintx =4, - footprintz =8, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTBW.lua b/Features/lathan/SnowPipeTBW.lua deleted file mode 100644 index 20f285341..000000000 --- a/Features/lathan/SnowPipeTBW.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTBW" -local featureDef = { - name = "SnowPipeTBW", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTBW.s3o", - footprintx =8, - footprintz =4, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTE.lua b/Features/lathan/SnowPipeTE.lua deleted file mode 100644 index 2c1da5f16..000000000 --- a/Features/lathan/SnowPipeTE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTE" -local featureDef = { - name = "SnowPipeTE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTE.s3o", - footprintx =7, - footprintz =4, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTN.lua b/Features/lathan/SnowPipeTN.lua deleted file mode 100644 index 7fe99f9dc..000000000 --- a/Features/lathan/SnowPipeTN.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTN" -local featureDef = { - name = "SnowPipeTN", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTN.s3o", - footprintx =4, - footprintz =7, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTPNS.lua b/Features/lathan/SnowPipeTPNS.lua deleted file mode 100644 index 372ca2350..000000000 --- a/Features/lathan/SnowPipeTPNS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTPNS" -local featureDef = { - name = "SnowPipeTPNS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTPNS.s3o", - footprintx =2, - footprintz =7, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =200, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTPWE.lua b/Features/lathan/SnowPipeTPWE.lua deleted file mode 100644 index 3990ccc56..000000000 --- a/Features/lathan/SnowPipeTPWE.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTPWE" -local featureDef = { - name = "SnowPipeTPWE", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTPWE.s3o", - footprintx =7, - footprintz =2, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =200, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTS.lua b/Features/lathan/SnowPipeTS.lua deleted file mode 100644 index d3c9ce0c5..000000000 --- a/Features/lathan/SnowPipeTS.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTS" -local featureDef = { - name = "SnowPipeTS", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTS.s3o", - footprintx =4, - footprintz =7, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowPipeTW.lua b/Features/lathan/SnowPipeTW.lua deleted file mode 100644 index e9045cd12..000000000 --- a/Features/lathan/SnowPipeTW.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "SnowPipeTW" -local featureDef = { - name = "SnowPipeTW", - world ="allworld", - description ="SnowyPipe", - category ="SnowyPipes", - object ="features/lathan/SnowPipeTW.s3o", - footprintx =7, - footprintz =4, - height =78, - blocking =true, - upright =true, - hitdensity =5, - energy = 10, --- energy =0, - metal = 0, ---metal =220, - damage =900, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/SnowTree1.lua b/Features/lathan/SnowTree1.lua deleted file mode 100644 index f6c6d8322..000000000 --- a/Features/lathan/SnowTree1.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree1 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree1", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree2.lua b/Features/lathan/SnowTree2.lua deleted file mode 100644 index 9e7b492a5..000000000 --- a/Features/lathan/SnowTree2.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree2 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree2", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 4, - footprintZ = 4, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree3.lua b/Features/lathan/SnowTree3.lua deleted file mode 100644 index 1d423dd9d..000000000 --- a/Features/lathan/SnowTree3.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree3 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree3", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 5, - footprintZ = 3, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree4.lua b/Features/lathan/SnowTree4.lua deleted file mode 100644 index 6d0f5fd4d..000000000 --- a/Features/lathan/SnowTree4.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree4 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree4", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 7, - footprintZ = 5, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree5.lua b/Features/lathan/SnowTree5.lua deleted file mode 100644 index ed5280af1..000000000 --- a/Features/lathan/SnowTree5.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree5 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree5", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 8, - footprintZ = 6, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree6.lua b/Features/lathan/SnowTree6.lua deleted file mode 100644 index 6358fc1cc..000000000 --- a/Features/lathan/SnowTree6.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree6 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree6", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 4, - footprintZ = 7, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SnowTree7.lua b/Features/lathan/SnowTree7.lua deleted file mode 100644 index d11551f91..000000000 --- a/Features/lathan/SnowTree7.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- SnowTree7 ------------------------------------------------------------------------------ -local featureDef = { - name = "SnowTree7", - blocking = true, - category = "Vegitation", - damage = 120, - description = "Snowy Tree", - energy = 10, --- energy = 400, - flammable = 0, - footprintX = 7, - footprintZ = 9, - upright = true, - height = "66", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/SnowTree7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/SquattyGrass.lua b/Features/lathan/SquattyGrass.lua deleted file mode 100644 index 7c4111f42..000000000 --- a/Features/lathan/SquattyGrass.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname= "SquattyGrass" -local featureDef = { - name = "SquattyGrass", - world ="allworld", - description ="Grass Tuffs", - category ="Vegitation", - object ="features/lathan/SquattyGrass.s3o", - footprintx =3, - footprintz =2, - height =14, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =140, - metal = 0, ---metal =0, - damage =90, - flammable =false, - indestructible ="1.0", - reclaimable =false, - autoreclaimable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/Tiberium01.lua b/Features/lathan/Tiberium01.lua deleted file mode 100644 index 920064731..000000000 --- a/Features/lathan/Tiberium01.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium01 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium01", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 1600, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 27, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 150, - object = "features/lathan/Tiberium01.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium01blue.lua b/Features/lathan/Tiberium01blue.lua deleted file mode 100644 index f34553a09..000000000 --- a/Features/lathan/Tiberium01blue.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium01blue ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium01blue", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 1000, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = 27, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 1000, - object = "features/lathan/Tiberium01blue.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium02.lua b/Features/lathan/Tiberium02.lua deleted file mode 100644 index ab6dba954..000000000 --- a/Features/lathan/Tiberium02.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium02 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium02", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 1450, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 27, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 100, - object = "features/lathan/Tiberium02.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium03.lua b/Features/lathan/Tiberium03.lua deleted file mode 100644 index fbab643df..000000000 --- a/Features/lathan/Tiberium03.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium03 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium03", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 1250, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 27, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 75, - object = "features/lathan/Tiberium03.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium04.lua b/Features/lathan/Tiberium04.lua deleted file mode 100644 index ace385013..000000000 --- a/Features/lathan/Tiberium04.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium04 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium04", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 1050, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 357, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 60, - object = "features/lathan/Tiberium04.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium06.lua b/Features/lathan/Tiberium06.lua deleted file mode 100644 index 18efc1a0c..000000000 --- a/Features/lathan/Tiberium06.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium06 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium06", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 750, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 20, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 40, - object = "features/lathan/Tiberium06.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium07.lua b/Features/lathan/Tiberium07.lua deleted file mode 100644 index 2579d88a8..000000000 --- a/Features/lathan/Tiberium07.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium07 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium07", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 650, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 13, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tiberium07.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium08.lua b/Features/lathan/Tiberium08.lua deleted file mode 100644 index 2c6e8ea7d..000000000 --- a/Features/lathan/Tiberium08.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium08 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium08", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 500, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 11, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tiberium08.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium09.lua b/Features/lathan/Tiberium09.lua deleted file mode 100644 index c74da380d..000000000 --- a/Features/lathan/Tiberium09.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium09 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium09", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 450, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 13, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tiberium09.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tiberium10.lua b/Features/lathan/Tiberium10.lua deleted file mode 100644 index 68158df2d..000000000 --- a/Features/lathan/Tiberium10.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tiberium10 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tiberium10", - blocking = true, - category = "rocks", - damage = 2800, - description = "Tiberium Crystal", - energy = 10, --- energy = 100, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = 9, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tiberium10.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tyranid1.lua b/Features/lathan/Tyranid1.lua deleted file mode 100644 index 71fd2ca2b..000000000 --- a/Features/lathan/Tyranid1.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tyranid1 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tyranid1", - blocking = true, - category = "Vegitation", - damage = 2800, - description = "Tyranid Cappilary Tower", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 11, - footprintZ = 7, - height = 357, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tyranid1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tyranid2.lua b/Features/lathan/Tyranid2.lua deleted file mode 100644 index b2a0a7b3b..000000000 --- a/Features/lathan/Tyranid2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- Tyranid2 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tyranid2", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Tyranid Cappilary Tower", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 8, - footprintZ = 8, - height = 357, - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/lathan/Tyranid2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tyranid3.lua b/Features/lathan/Tyranid3.lua deleted file mode 100644 index 1e014ced3..000000000 --- a/Features/lathan/Tyranid3.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- Tyranid3 ------------------------------------------------------------------------------ -local featureDef = { - name = "Tyranid3", - blocking = true, - category = "Vegitation", - damage = 2000, - description = "Tyranid Cappilary Tower", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = 272, - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/Tyranid3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/Tyranidc.lua b/Features/lathan/Tyranidc.lua deleted file mode 100644 index 609705ab3..000000000 --- a/Features/lathan/Tyranidc.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- TyranidC ------------------------------------------------------------------------------ -local featureDef = { - name = "TyranidC", - blocking = true, - category = "Vegitation", - damage = 6500, - description = "Tyranid Cappilary Tower", - energy = 10, --- energy = 2300, - flammable = 0, - footprintX = 17, - footprintZ = 17, - height = "4972", - hitdensity = "5", - indestructible = true, - metal = 0, ---metal = 10, - object = "features/lathan/TyranidC.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/lathan/WeedBig.lua b/Features/lathan/WeedBig.lua deleted file mode 100644 index 295e0b0bc..000000000 --- a/Features/lathan/WeedBig.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "WeedBig" -local featureDef = { - name = "WeedBig", - world ="allworld", - description ="Weeds", - category ="Vegitation", - object ="features/lathan/WeedBig.s3o", - footprintx =4, - footprintz =3, - height =24, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =200, - metal = 0, ---metal =0, - damage =110, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/WeedSmall.lua b/Features/lathan/WeedSmall.lua deleted file mode 100644 index 2f202c752..000000000 --- a/Features/lathan/WeedSmall.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "WeedSmall" -local featureDef = { - name = "WeedSmall", - world ="allworld", - description ="Weeds", - category ="Vegitation", - object ="features/lathan/WeedSmall.s3o", - footprintx =3, - footprintz =2, - height =15, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =130, - metal = 0, ---metal =0, - damage =70, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/WideLeafPlant.lua b/Features/lathan/WideLeafPlant.lua deleted file mode 100644 index 56a626c25..000000000 --- a/Features/lathan/WideLeafPlant.lua +++ /dev/null @@ -1,28 +0,0 @@ -local objectname= "WideLeafPlant" -local featureDef = { - name = "WideLeafPlant", - world ="allworld", - description ="Plant", - category ="Vegitation", - object ="features/lathan/WideLeafPlant.s3o", - footprintx =2, - footprintz =2, - height =30, - blocking =false, - upright =false, - hitdensity =0, - energy = 10, --- energy =240, - metal = 0, ---metal =0, - damage =150, - flammable =false, - reclaimable =true, - autoreclaimable =true, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern1.lua b/Features/lathan/fern1.lua deleted file mode 100644 index 1e830ba0a..000000000 --- a/Features/lathan/fern1.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern1" -local featureDef = { - name = "fern1", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern1.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =2000, - metal = 0, ---metal =10, - damage =10000, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern2.lua b/Features/lathan/fern2.lua deleted file mode 100644 index e0969750c..000000000 --- a/Features/lathan/fern2.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern2" -local featureDef = { - name = "fern2", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern2.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =1000, - metal = 0, ---metal =10, - damage =300, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern3.lua b/Features/lathan/fern3.lua deleted file mode 100644 index c7202e1a4..000000000 --- a/Features/lathan/fern3.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern3" -local featureDef = { - name = "fern3", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern3.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =1000, - metal = 0, ---metal =10, - damage =300, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern4.lua b/Features/lathan/fern4.lua deleted file mode 100644 index 505af983a..000000000 --- a/Features/lathan/fern4.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern4" -local featureDef = { - name = "fern4", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern4.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =1000, - metal = 0, ---metal =10, - damage =300, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern5.lua b/Features/lathan/fern5.lua deleted file mode 100644 index f5f02e2d4..000000000 --- a/Features/lathan/fern5.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern5" -local featureDef = { - name = "fern5", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern5.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =1000, - metal = 0, ---metal =10, - damage =300, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern6.lua b/Features/lathan/fern6.lua deleted file mode 100644 index afafb6a85..000000000 --- a/Features/lathan/fern6.lua +++ /dev/null @@ -1,25 +0,0 @@ -local objectname= "fern6" -local featureDef = { - name = "fern6", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern6.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =2000, - metal = 0, ---metal =5, - damage =10000, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern7.lua b/Features/lathan/fern7.lua deleted file mode 100644 index ac79462d8..000000000 --- a/Features/lathan/fern7.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern7" -local featureDef = { - name = "fern7", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern7.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =1000, - metal = 0, ---metal =10, - damage =300, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/lathan/fern8.lua b/Features/lathan/fern8.lua deleted file mode 100644 index bea8f085f..000000000 --- a/Features/lathan/fern8.lua +++ /dev/null @@ -1,27 +0,0 @@ -local objectname= "fern8" -local featureDef = { - name = "fern8", - world ="All Worlds", - description ="Ferns", - category ="arm_corpses", - object ="features/lathan/fern8.s3o", - footprintx =1, - footprintz =1, - height =7, - blocking =true, - hitdensity =2000, - metal = 0, ---metal =5, - damage =10000, - flammable =false, - featurereclamate ="smudge01", - seqnamereclamate ="tree1reclamate", - indestructible ="0.0", - upright =true, - energy = 10, --- energy =100, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/noize/nGreyRock2.lua b/Features/noize/nGreyRock2.lua deleted file mode 100644 index f9b10a725..000000000 --- a/Features/noize/nGreyRock2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock2 ------------------------------------------------------------------------------ -local featureDef = { - name = "nGreyRock2", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/GreyRock2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/nGreyRock3.lua b/Features/noize/nGreyRock3.lua deleted file mode 100644 index bf16e8a0a..000000000 --- a/Features/noize/nGreyRock3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock3 ------------------------------------------------------------------------------ -local featureDef = { - name = "nGreyRock3", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/GreyRock3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/nGreyRock4.lua b/Features/noize/nGreyRock4.lua deleted file mode 100644 index 52e64d1f0..000000000 --- a/Features/noize/nGreyRock4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock4 ------------------------------------------------------------------------------ -local featureDef = { - name = "nGreyRock4", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/GreyRock4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/nGreyRock5.lua b/Features/noize/nGreyRock5.lua deleted file mode 100644 index 73d4db918..000000000 --- a/Features/noize/nGreyRock5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock5 ------------------------------------------------------------------------------ -local featureDef = { - name = "nGreyRock5", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/GreyRock5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/nGreyRock6.lua b/Features/noize/nGreyRock6.lua deleted file mode 100644 index fa71ed7b5..000000000 --- a/Features/noize/nGreyRock6.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- GreyRock6 ------------------------------------------------------------------------------ -local featureDef = { - name = "nGreyRock6", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/GreyRock6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock1.lua b/Features/noize/pdrock1.lua deleted file mode 100644 index 2c74a9eb7..000000000 --- a/Features/noize/pdrock1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock1 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock1", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock2.lua b/Features/noize/pdrock2.lua deleted file mode 100644 index 42e359b19..000000000 --- a/Features/noize/pdrock2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock2 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock2", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock3.lua b/Features/noize/pdrock3.lua deleted file mode 100644 index f5f3f1909..000000000 --- a/Features/noize/pdrock3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock3 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock3", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock4.lua b/Features/noize/pdrock4.lua deleted file mode 100644 index 186408cc0..000000000 --- a/Features/noize/pdrock4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock4 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock4", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock5.lua b/Features/noize/pdrock5.lua deleted file mode 100644 index 0a24d26e7..000000000 --- a/Features/noize/pdrock5.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock5 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock5", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock5.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock6.lua b/Features/noize/pdrock6.lua deleted file mode 100644 index af4fe0c11..000000000 --- a/Features/noize/pdrock6.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock6 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock6", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock6.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock7.lua b/Features/noize/pdrock7.lua deleted file mode 100644 index 8fc0036aa..000000000 --- a/Features/noize/pdrock7.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock7 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock7", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock7.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/pdrock8.lua b/Features/noize/pdrock8.lua deleted file mode 100644 index bc4c22909..000000000 --- a/Features/noize/pdrock8.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- pdrock8 ------------------------------------------------------------------------------ -local featureDef = { - name = "pdrock8", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Grey Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 4, - footprintZ = 4, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/pdrock8.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/tcpice1.lua b/Features/noize/tcpice1.lua deleted file mode 100644 index 5aaff33ea..000000000 --- a/Features/noize/tcpice1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- tcpice1 ------------------------------------------------------------------------------ -local featureDef = { - name = "tcpice1", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Ice Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/tcpice1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/tcpice2.lua b/Features/noize/tcpice2.lua deleted file mode 100644 index 5df786342..000000000 --- a/Features/noize/tcpice2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- tcpice2 ------------------------------------------------------------------------------ -local featureDef = { - name = "tcpice2", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Ice Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/tcpice2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/tcpice3.lua b/Features/noize/tcpice3.lua deleted file mode 100644 index a81dba14b..000000000 --- a/Features/noize/tcpice3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- tcpice3 ------------------------------------------------------------------------------ -local featureDef = { - name = "tcpice3", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Ice Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/tcpice3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/noize/tcpice4.lua b/Features/noize/tcpice4.lua deleted file mode 100644 index 45419016e..000000000 --- a/Features/noize/tcpice4.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- tcpice4 ------------------------------------------------------------------------------ -local featureDef = { - name = "tcpice4", - blocking = true, - category = "Rocks", - damage = 1000, - description = "Ice Rock", - energy = 10, --- energy = 0, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "21", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/noize/tcpice4.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/s44/S44tree_sprucea.lua b/Features/s44/S44tree_sprucea.lua deleted file mode 100644 index fe297f8c2..000000000 --- a/Features/s44/S44tree_sprucea.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_sprucea ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_sprucea", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_sprucea.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/s44/S44tree_spruceb.lua b/Features/s44/S44tree_spruceb.lua deleted file mode 100644 index 808e613ee..000000000 --- a/Features/s44/S44tree_spruceb.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_spruceb ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_spruceb", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_spruceb.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/s44/S44tree_sprucec.lua b/Features/s44/S44tree_sprucec.lua deleted file mode 100644 index bdd08853e..000000000 --- a/Features/s44/S44tree_sprucec.lua +++ /dev/null @@ -1,30 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_sprucec ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_sprucec", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_sprucec.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - - diff --git a/Features/s44/houses/s44_b_house_1_1.lua b/Features/s44/houses/s44_b_house_1_1.lua deleted file mode 100644 index 8b55975f5..000000000 --- a/Features/s44/houses/s44_b_house_1_1.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_1" -local featureDef = { - name = "s44_b_house_1_1", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_1.s3o", - footprintx =3, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={48, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_1_2.lua b/Features/s44/houses/s44_b_house_1_2.lua deleted file mode 100644 index 4bf7fa728..000000000 --- a/Features/s44/houses/s44_b_house_1_2.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_2" -local featureDef = { - name = "s44_b_house_1_2", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_2.s3o", - footprintx =6, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_1_3.lua b/Features/s44/houses/s44_b_house_1_3.lua deleted file mode 100644 index ad453b05c..000000000 --- a/Features/s44/houses/s44_b_house_1_3.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_3" -local featureDef = { - name = "s44_b_house_1_3", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_3.s3o", - footprintx =9, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={144, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_1_4.lua b/Features/s44/houses/s44_b_house_1_4.lua deleted file mode 100644 index 7ac926075..000000000 --- a/Features/s44/houses/s44_b_house_1_4.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_4" -local featureDef = { - name = "s44_b_house_1_4", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_4.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_1_5.lua b/Features/s44/houses/s44_b_house_1_5.lua deleted file mode 100644 index 9c5f55cf9..000000000 --- a/Features/s44/houses/s44_b_house_1_5.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_5" -local featureDef = { - name = "s44_b_house_1_5", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_5.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_1_6.lua b/Features/s44/houses/s44_b_house_1_6.lua deleted file mode 100644 index b4b065b58..000000000 --- a/Features/s44/houses/s44_b_house_1_6.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_1_6" -local featureDef = { - name = "s44_b_house_1_6", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_1_6.s3o", - footprintx =6, - footprintz =9, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 144}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_1.lua b/Features/s44/houses/s44_b_house_2_1.lua deleted file mode 100644 index 801fcc82d..000000000 --- a/Features/s44/houses/s44_b_house_2_1.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_1" -local featureDef = { - name = "s44_b_house_2_1", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_1.s3o", - footprintx =3, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={48, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_2.lua b/Features/s44/houses/s44_b_house_2_2.lua deleted file mode 100644 index 022ec0858..000000000 --- a/Features/s44/houses/s44_b_house_2_2.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_2" -local featureDef = { - name = "s44_b_house_2_2", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_2.s3o", - footprintx =6, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_3.lua b/Features/s44/houses/s44_b_house_2_3.lua deleted file mode 100644 index 38626c4c8..000000000 --- a/Features/s44/houses/s44_b_house_2_3.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_3" -local featureDef = { - name = "s44_b_house_2_3", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_3.s3o", - footprintx =9, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={144, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_4.lua b/Features/s44/houses/s44_b_house_2_4.lua deleted file mode 100644 index bf79a2482..000000000 --- a/Features/s44/houses/s44_b_house_2_4.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_4" -local featureDef = { - name = "s44_b_house_2_4", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_4.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_5.lua b/Features/s44/houses/s44_b_house_2_5.lua deleted file mode 100644 index fa8215588..000000000 --- a/Features/s44/houses/s44_b_house_2_5.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_5" -local featureDef = { - name = "s44_b_house_2_5", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_5.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_2_6.lua b/Features/s44/houses/s44_b_house_2_6.lua deleted file mode 100644 index 021b916a5..000000000 --- a/Features/s44/houses/s44_b_house_2_6.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_2_6" -local featureDef = { - name = "s44_b_house_2_6", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_2_6.s3o", - footprintx =6, - footprintz =9, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 144}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_1.lua b/Features/s44/houses/s44_b_house_3_1.lua deleted file mode 100644 index fe3a9366d..000000000 --- a/Features/s44/houses/s44_b_house_3_1.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_1" -local featureDef = { - name = "s44_b_house_3_1", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_1.s3o", - footprintx =3, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={48, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_2.lua b/Features/s44/houses/s44_b_house_3_2.lua deleted file mode 100644 index 918538e2b..000000000 --- a/Features/s44/houses/s44_b_house_3_2.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_2" -local featureDef = { - name = "s44_b_house_3_2", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_2.s3o", - footprintx =6, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_3.lua b/Features/s44/houses/s44_b_house_3_3.lua deleted file mode 100644 index 9ba30fe3e..000000000 --- a/Features/s44/houses/s44_b_house_3_3.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_3" -local featureDef = { - name = "s44_b_house_3_3", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_3.s3o", - footprintx =9, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={144, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_4.lua b/Features/s44/houses/s44_b_house_3_4.lua deleted file mode 100644 index 96ef79991..000000000 --- a/Features/s44/houses/s44_b_house_3_4.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_4" -local featureDef = { - name = "s44_b_house_3_4", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_4.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_5.lua b/Features/s44/houses/s44_b_house_3_5.lua deleted file mode 100644 index 131e3c85b..000000000 --- a/Features/s44/houses/s44_b_house_3_5.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_5" -local featureDef = { - name = "s44_b_house_3_5", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_5.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_3_6.lua b/Features/s44/houses/s44_b_house_3_6.lua deleted file mode 100644 index ece5207f6..000000000 --- a/Features/s44/houses/s44_b_house_3_6.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_3_6" -local featureDef = { - name = "s44_b_house_3_6", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_3_6.s3o", - footprintx =6, - footprintz =9, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 144}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_1.lua b/Features/s44/houses/s44_b_house_4_1.lua deleted file mode 100644 index 6eefcbc1f..000000000 --- a/Features/s44/houses/s44_b_house_4_1.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_1" -local featureDef = { - name = "s44_b_house_4_1", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_1.s3o", - footprintx =3, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={48, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_2.lua b/Features/s44/houses/s44_b_house_4_2.lua deleted file mode 100644 index 907ed692e..000000000 --- a/Features/s44/houses/s44_b_house_4_2.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_2" -local featureDef = { - name = "s44_b_house_4_2", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_2.s3o", - footprintx =6, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_3.lua b/Features/s44/houses/s44_b_house_4_3.lua deleted file mode 100644 index 9626b187c..000000000 --- a/Features/s44/houses/s44_b_house_4_3.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_3" -local featureDef = { - name = "s44_b_house_4_3", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_3.s3o", - footprintx =9, - footprintz =3, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={144, 72, 48}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_4.lua b/Features/s44/houses/s44_b_house_4_4.lua deleted file mode 100644 index ee74721f2..000000000 --- a/Features/s44/houses/s44_b_house_4_4.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_4" -local featureDef = { - name = "s44_b_house_4_4", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_4.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_5.lua b/Features/s44/houses/s44_b_house_4_5.lua deleted file mode 100644 index df78c6889..000000000 --- a/Features/s44/houses/s44_b_house_4_5.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_5" -local featureDef = { - name = "s44_b_house_4_5", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_5.s3o", - footprintx =7, - footprintz =6, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={120, 72, 96}, - collisionvolumeoffsets ={12, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/houses/s44_b_house_4_6.lua b/Features/s44/houses/s44_b_house_4_6.lua deleted file mode 100644 index 8b29b2019..000000000 --- a/Features/s44/houses/s44_b_house_4_6.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname= "s44_b_house_4_6" -local featureDef = { - name = "s44_b_house_4_6", - world ="All Worlds", - description ="House", - category ="Buildings", - object ="features/s44/houses/s44_b_house_4_6.s3o", - footprintx =6, - footprintz =9, - height =96, - blocking =true, - upright =true, - hitdensity =1, - energy = 10, --- energy =0, - metal = 0, ---metal =0, - damage =20000, - mass ="20000.0", - burnable ="0.0", - reclaimable =false, - autoreclaimable =false, - collisionvolumetype ="box", - collisionvolumescales ={96, 72, 144}, - collisionvolumeoffsets ={0, 0, 0}, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) diff --git a/Features/s44/s44tree_01a.lua b/Features/s44/s44tree_01a.lua deleted file mode 100644 index 696442b93..000000000 --- a/Features/s44/s44tree_01a.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_01a ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_01a", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_01a.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/s44/s44tree_01b.lua b/Features/s44/s44tree_01b.lua deleted file mode 100644 index 43673df6e..000000000 --- a/Features/s44/s44tree_01b.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_01b ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_01b", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_01b.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/s44/s44tree_02a.lua b/Features/s44/s44tree_02a.lua deleted file mode 100644 index 0c6e58914..000000000 --- a/Features/s44/s44tree_02a.lua +++ /dev/null @@ -1,30 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_02a ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_02a", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_02a.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - - diff --git a/Features/s44/s44tree_02b.lua b/Features/s44/s44tree_02b.lua deleted file mode 100644 index 592d56292..000000000 --- a/Features/s44/s44tree_02b.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_02b ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_02b", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_02b.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/s44/s44tree_02c.lua b/Features/s44/s44tree_02c.lua deleted file mode 100644 index ab6521fd9..000000000 --- a/Features/s44/s44tree_02c.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- S44tree_02c ------------------------------------------------------------------------------ -local featureDef = { - name = "S44tree_02c", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = true, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/s44/S44tree_02c.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster1.lua b/Features/smoth/cluster1.lua deleted file mode 100644 index 176d82e20..000000000 --- a/Features/smoth/cluster1.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- cluster1 ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster1", - blocking = true, - category = "Trees", - damage = 4000, - description = "palm trees", - energy = 10, --- energy = 10, - flammable = 0, - featuredead = "cluster1_dead", - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster1_dead.lua b/Features/smoth/cluster1_dead.lua deleted file mode 100644 index a71453179..000000000 --- a/Features/smoth/cluster1_dead.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- cluster1_dead ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster1_dead", - blocking = true, - category = "Trees", - damage = 4000, - description = "Dead palm trees", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster1_dead.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster2.lua b/Features/smoth/cluster2.lua deleted file mode 100644 index 9f717779b..000000000 --- a/Features/smoth/cluster2.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- cluster2_dead ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster2", - blocking = true, - category = "Trees", - damage = 4000, - description = "Dead palm trees", - energy = 10, --- energy = 10, - flammable = 0, - featuredead = "cluster2_dead", - footprintX = 4, - footprintZ = 4, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster2_dead.lua b/Features/smoth/cluster2_dead.lua deleted file mode 100644 index f5b297ab9..000000000 --- a/Features/smoth/cluster2_dead.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- cluster2_dead ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster2_dead", - blocking = true, - category = "Trees", - damage = 4000, - description = "Dead palm trees", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 4, - footprintZ = 4, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster2_dead.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster3.lua b/Features/smoth/cluster3.lua deleted file mode 100644 index d8c324c63..000000000 --- a/Features/smoth/cluster3.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- cluster3_dead ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster3", - blocking = true, - category = "Trees", - damage = 4000, - description = "Palm trees", - energy = 10, --- energy = 10, - flammable = 0, - featuredead = "cluster3_dead", - footprintX = 6, - footprintZ = 6, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/cluster3_dead.lua b/Features/smoth/cluster3_dead.lua deleted file mode 100644 index 28ba2fee8..000000000 --- a/Features/smoth/cluster3_dead.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- cluster2_dead ------------------------------------------------------------------------------ -local featureDef = { - name = "cluster3_dead", - blocking = true, - category = "Trees", - damage = 4000, - description = "Dead palm trees", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 6, - footprintZ = 6, - upright = true, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/cluster3_dead.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/harborset/Industrial_smokestack_1.lua b/Features/smoth/harborset/Industrial_smokestack_1.lua deleted file mode 100644 index 2d80b6759..000000000 --- a/Features/smoth/harborset/Industrial_smokestack_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "Industrial_smokestack_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Smoke stack", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 2, - footprintZ = 4, - collisionvolumetype = "box", - collisionvolumescales = "32 45 64", - collisionvolumeoffsets = "0 0 0", - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Industrial_smokestack_2.lua b/Features/smoth/harborset/Industrial_smokestack_2.lua deleted file mode 100644 index 46d669d3d..000000000 --- a/Features/smoth/harborset/Industrial_smokestack_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "Industrial_smokestack_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Smoke stack", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 2, - footprintZ = 4, - collisionvolumetype = "box", - collisionvolumescales = "45 32 64", - collisionvolumeoffsets = "0 0 0", - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 400, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Industrial_smokestack_tall_1.lua b/Features/smoth/harborset/Industrial_smokestack_tall_1.lua deleted file mode 100644 index f49c621f3..000000000 --- a/Features/smoth/harborset/Industrial_smokestack_tall_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "Industrial_smokestack_tall_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Smoke stack", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "48 120 48", - collisionvolumeoffsets = "0 0 0", - footprintX = 3, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 400, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Industrial_structure_1.lua b/Features/smoth/harborset/Industrial_structure_1.lua deleted file mode 100644 index 10bf2c1ac..000000000 --- a/Features/smoth/harborset/Industrial_structure_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "Industrial_structure_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Building", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "112 90 80", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Industrial_structure_2.lua b/Features/smoth/harborset/Industrial_structure_2.lua deleted file mode 100644 index a814b3b5f..000000000 --- a/Features/smoth/harborset/Industrial_structure_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "Industrial_structure_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Building", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "60 80 32", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Industrial_structure_pipes_1.lua b/Features/smoth/harborset/Industrial_structure_pipes_1.lua deleted file mode 100644 index d35c60bdf..000000000 --- a/Features/smoth/harborset/Industrial_structure_pipes_1.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "Industrial_structure_pipes_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Building pipes", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/Trailer_1.lua b/Features/smoth/harborset/Trailer_1.lua deleted file mode 100644 index d5829178a..000000000 --- a/Features/smoth/harborset/Trailer_1.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "Trailer_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Foreman trailer", - energy = 10, --- energy = 1000, - flammable = 0, - footprintX = 2, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/boxcar_1.lua b/Features/smoth/harborset/boxcar_1.lua deleted file mode 100644 index 07e2f90b8..000000000 --- a/Features/smoth/harborset/boxcar_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "boxcar_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Train Boxcar", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "13 16 45", - collisionvolumeoffsets = "0 0 0", - footprintX = 1, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/boxcar_2.lua b/Features/smoth/harborset/boxcar_2.lua deleted file mode 100644 index 983a06c2c..000000000 --- a/Features/smoth/harborset/boxcar_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "boxcar_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Train Boxcar", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "13 16 45", - collisionvolumeoffsets = "0 0 0", - footprintX = 1, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/boxcar_3.lua b/Features/smoth/harborset/boxcar_3.lua deleted file mode 100644 index b0a5739ad..000000000 --- a/Features/smoth/harborset/boxcar_3.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "boxcar_3" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Train Boxcar", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "13 16 45", - collisionvolumeoffsets = "0 0 0", - footprintX = 1, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/bunker_1.lua b/Features/smoth/harborset/bunker_1.lua deleted file mode 100644 index c3f0af7ea..000000000 --- a/Features/smoth/harborset/bunker_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "bunker_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "millitary", - damage = 2000, - description = "fortified bunker", - energy = 10, --- energy = 10000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "160 50 128", - collisionvolumeoffsets = "0 0 0", - footprintX = 10, - footprintZ = 8, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 1000, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/crane_1.lua b/Features/smoth/harborset/crane_1.lua deleted file mode 100644 index 6e89e46d5..000000000 --- a/Features/smoth/harborset/crane_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "crane_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Large crane", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "80 150 80", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/crates_1.lua b/Features/smoth/harborset/crates_1.lua deleted file mode 100644 index 6ced4e3bb..000000000 --- a/Features/smoth/harborset/crates_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "crates_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Large Pile of crates", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "64 48 48", - collisionvolumeoffsets = "0 0 0", - footprintX = 4, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/crates_2.lua b/Features/smoth/harborset/crates_2.lua deleted file mode 100644 index 9558e2fd3..000000000 --- a/Features/smoth/harborset/crates_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "crates_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Large Pile of crates", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "64 48 48", - collisionvolumeoffsets = "0 0 0", - footprintX = 4, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/crates_3.lua b/Features/smoth/harborset/crates_3.lua deleted file mode 100644 index 8271769c1..000000000 --- a/Features/smoth/harborset/crates_3.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "crates_3" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Large Pile of crates", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "64 48 48", - collisionvolumeoffsets = "0 0 0", - footprintX = 4, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/fence.lua b/Features/smoth/harborset/fence.lua deleted file mode 100644 index f3a8c2871..000000000 --- a/Features/smoth/harborset/fence.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname = "fence" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 20, - description = "hurricane fencing", - energy = 10, --- energy = 20, - flammable = 0, - footprintX = 1, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 1, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - upright = true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/forklift_1.lua b/Features/smoth/harborset/forklift_1.lua deleted file mode 100644 index b331c8550..000000000 --- a/Features/smoth/harborset/forklift_1.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "forklift_1" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "forklift", - energy = 10, --- energy = 500, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 3, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/holding_tank1.lua b/Features/smoth/harborset/holding_tank1.lua deleted file mode 100644 index 74852906a..000000000 --- a/Features/smoth/harborset/holding_tank1.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "holding_tank1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Chemical tank", - featuredead = "holding_tank1_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "CylY", - collisionvolumescales = "36 30 36", - collisionvolumeoffsets = "0 0 0", - footprintX = 3, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/holding_tank1_dead.lua b/Features/smoth/harborset/holding_tank1_dead.lua deleted file mode 100644 index a71dafaa7..000000000 --- a/Features/smoth/harborset/holding_tank1_dead.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "holding_tank1_dead" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "Chemical tank", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/holding_tank2.lua b/Features/smoth/harborset/holding_tank2.lua deleted file mode 100644 index 24679fa78..000000000 --- a/Features/smoth/harborset/holding_tank2.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "holding_tank2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Chemical tank", - featuredead = "holding_tank2_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "CylY", - collisionvolumescales = "36 30 36", - collisionvolumeoffsets = "0 0 0", - footprintX = 3, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/holding_tank2_dead.lua b/Features/smoth/harborset/holding_tank2_dead.lua deleted file mode 100644 index 64d0c0c46..000000000 --- a/Features/smoth/harborset/holding_tank2_dead.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "holding_tank2_dead" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "Chemical tank", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 3, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_large_1.lua b/Features/smoth/harborset/pipe_large_1.lua deleted file mode 100644 index 8e338c8c4..000000000 --- a/Features/smoth/harborset/pipe_large_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "pipe_large_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "cylinder", - collisionvolumescales = "144 20 16", - collisionvolumeoffsets = "0 20 0", - footprintX = 2, - footprintZ = 9, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_large_2.lua b/Features/smoth/harborset/pipe_large_2.lua deleted file mode 100644 index caa38a355..000000000 --- a/Features/smoth/harborset/pipe_large_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "pipe_large_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "cylinder", - collisionvolumescales = "144 20 16", - collisionvolumeoffsets = "0 20 0", - footprintX = 2, - footprintZ = 9, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_long_1.lua b/Features/smoth/harborset/pipe_long_1.lua deleted file mode 100644 index fe79a1734..000000000 --- a/Features/smoth/harborset/pipe_long_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "pipe_long_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "224 20 32", - collisionvolumeoffsets = "0 0 0", - footprintX = 15, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_long_2.lua b/Features/smoth/harborset/pipe_long_2.lua deleted file mode 100644 index e8b378f35..000000000 --- a/Features/smoth/harborset/pipe_long_2.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "pipe_long_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "224 20 32", - collisionvolumeoffsets = "0 0 0", - footprintX = 15, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_really_tall_2.lua b/Features/smoth/harborset/pipe_really_tall_2.lua deleted file mode 100644 index 6c34a4fe7..000000000 --- a/Features/smoth/harborset/pipe_really_tall_2.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_really_tall_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 2, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_small_1.lua b/Features/smoth/harborset/pipe_small_1.lua deleted file mode 100644 index e6322636c..000000000 --- a/Features/smoth/harborset/pipe_small_1.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_small_1" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 1, - footprintZ = 4, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_small_2.lua b/Features/smoth/harborset/pipe_small_2.lua deleted file mode 100644 index a60e13a50..000000000 --- a/Features/smoth/harborset/pipe_small_2.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_small_2" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 200, - flammable = 0, - footprintX = 1, - footprintZ = 4, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_small_2.lua.lua b/Features/smoth/harborset/pipe_small_2.lua.lua deleted file mode 100644 index 9c7d559d5..000000000 --- a/Features/smoth/harborset/pipe_small_2.lua.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_small_2" - -local featureDef = { - name = objectname, - blocking = false, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 1, - footprintZ = 4, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_tall_1.lua b/Features/smoth/harborset/pipe_tall_1.lua deleted file mode 100644 index 7d094c9fa..000000000 --- a/Features/smoth/harborset/pipe_tall_1.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_tall_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 2, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/pipe_tall_2.lua b/Features/smoth/harborset/pipe_tall_2.lua deleted file mode 100644 index b9e608ded..000000000 --- a/Features/smoth/harborset/pipe_tall_2.lua +++ /dev/null @@ -1,29 +0,0 @@ -local objectname = "pipe_tall_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Pipeline", - energy = 10, --- energy = 2000, - flammable = 0, - footprintX = 2, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 35, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/radardish_1.lua b/Features/smoth/harborset/radardish_1.lua deleted file mode 100644 index 319c6081b..000000000 --- a/Features/smoth/harborset/radardish_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "radardish_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Satellite Dish", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "CylY", - collisionvolumescales = "32 32 32", - collisionvolumeoffsets = "0 0 0", - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/raddome_1.lua b/Features/smoth/harborset/raddome_1.lua deleted file mode 100644 index 7d45b984f..000000000 --- a/Features/smoth/harborset/raddome_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "raddome_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Radar Dome", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "CylY", - collisionvolumescales = "80 180 80", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/ship_1.lua b/Features/smoth/harborset/ship_1.lua deleted file mode 100644 index edeca3022..000000000 --- a/Features/smoth/harborset/ship_1.lua +++ /dev/null @@ -1,34 +0,0 @@ -local objectname = "ship_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Cargo ship", - energy = 10, --- energy = 10000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "144 50 520", - collisionvolumeoffsets = "0 -20 -20", - footprintX = 9, - footprintZ = 35, - nodrawundergray = true, - waterline = 10, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 3500, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/ship_2.lua b/Features/smoth/harborset/ship_2.lua deleted file mode 100644 index c4d4f304b..000000000 --- a/Features/smoth/harborset/ship_2.lua +++ /dev/null @@ -1,34 +0,0 @@ -local objectname = "ship_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Tanker ship", - energy = 10, --- energy = 10000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 40 360", - collisionvolumeoffsets = "0 -10 -20", - footprintX = 7, - footprintZ = 25, - nodrawundergray = true, - waterline = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 3000, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/silo_1.lua b/Features/smoth/harborset/silo_1.lua deleted file mode 100644 index 8d8dad1e4..000000000 --- a/Features/smoth/harborset/silo_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "silo_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "military", - damage = 2000, - description = "Underground Silo Entrance", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "80 5 64", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 4, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/storage_sheds_1.lua b/Features/smoth/harborset/storage_sheds_1.lua deleted file mode 100644 index 146c662d2..000000000 --- a/Features/smoth/harborset/storage_sheds_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "storage_sheds_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Storage sheds", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "200 26 60", - collisionvolumeoffsets = "0 0 0", - footprintX = 13, - footprintZ = 4, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 350, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/streetlamp_1.lua b/Features/smoth/harborset/streetlamp_1.lua deleted file mode 100644 index b9f66e849..000000000 --- a/Features/smoth/harborset/streetlamp_1.lua +++ /dev/null @@ -1,30 +0,0 @@ -local objectname = "streetlamp_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "urban", - damage = 2000, - description = "large streetlamp", - energy = 10, --- energy = 20, - flammable = 0, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 3, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - upright = true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/tent_1.lua b/Features/smoth/harborset/tent_1.lua deleted file mode 100644 index 157c4bd6f..000000000 --- a/Features/smoth/harborset/tent_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "tent_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "millitary", - damage = 2000, - description = "Big Tent", - energy = 10, --- energy = 1000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "48 30 80", - collisionvolumeoffsets = "0 0 0", - footprintX = 3, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 3, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/trainengine_1.lua b/Features/smoth/harborset/trainengine_1.lua deleted file mode 100644 index 65de678ac..000000000 --- a/Features/smoth/harborset/trainengine_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "trainengine_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Train engine", - energy = 10, --- energy = 5000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "13 16 45", - collisionvolumeoffsets = "0 0 0", - footprintX = 1, - footprintZ = 3, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_fortified_1.lua b/Features/smoth/harborset/warehouse_fortified_1.lua deleted file mode 100644 index a67ac41a4..000000000 --- a/Features/smoth/harborset/warehouse_fortified_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "warehouse_fortified_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Concrete warehouse", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 30 96", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 9, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 500, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_large_1.lua b/Features/smoth/harborset/warehouse_large_1.lua deleted file mode 100644 index 592c79048..000000000 --- a/Features/smoth/harborset/warehouse_large_1.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_large_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Warehouse", - featuredead = "warehouse_large_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 50 172", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 11, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 400, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_large_2 .lua b/Features/smoth/harborset/warehouse_large_2 .lua deleted file mode 100644 index 2af1637cf..000000000 --- a/Features/smoth/harborset/warehouse_large_2 .lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_large_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Warehouse", - featuredead = "warehouse_large_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 50 172", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 11, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 400, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_large_3.lua b/Features/smoth/harborset/warehouse_large_3.lua deleted file mode 100644 index 9a1276abc..000000000 --- a/Features/smoth/harborset/warehouse_large_3.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_large_3" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Warehouse", - featuredead = "warehouse_large_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 50 172", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 11, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 400, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_large_dead.lua b/Features/smoth/harborset/warehouse_large_dead.lua deleted file mode 100644 index 4380260ee..000000000 --- a/Features/smoth/harborset/warehouse_large_dead.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "warehouse_large_dead" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Warehouse", - energy = 10, --- energy = 1000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "110 50 172", - collisionvolumeoffsets = "0 0 0", - footprintX = 7, - footprintZ = 11, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 100, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_1.lua b/Features/smoth/harborset/warehouse_small_1.lua deleted file mode 100644 index 1275f1aff..000000000 --- a/Features/smoth/harborset/warehouse_small_1.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_small_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 5000, - description = "Warehouse", - featuredead = "warehouse_small_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "78 36 110", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 200, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_2.lua b/Features/smoth/harborset/warehouse_small_2.lua deleted file mode 100644 index 1b16dfc96..000000000 --- a/Features/smoth/harborset/warehouse_small_2.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_small_2" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 5000, - description = "Warehouse", - featuredead = "warehouse_small_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "78 36 110", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 200, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_3.lua b/Features/smoth/harborset/warehouse_small_3.lua deleted file mode 100644 index cadb3fb0e..000000000 --- a/Features/smoth/harborset/warehouse_small_3.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_small_3" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 5000, - description = "Warehouse", - featuredead = "warehouse_small_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "78 36 110", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 200, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_4.lua b/Features/smoth/harborset/warehouse_small_4.lua deleted file mode 100644 index 188f08d6a..000000000 --- a/Features/smoth/harborset/warehouse_small_4.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_small_4" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 5000, - description = "Warehouse", - featuredead = "warehouse_small_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "78 36 110", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 200, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_5.lua b/Features/smoth/harborset/warehouse_small_5.lua deleted file mode 100644 index 305c741a7..000000000 --- a/Features/smoth/harborset/warehouse_small_5.lua +++ /dev/null @@ -1,33 +0,0 @@ -local objectname = "warehouse_small_5" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 5000, - description = "Warehouse", - featuredead = "warehouse_small_dead", - energy = 10, --- energy = 2000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "78 36 110", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 200, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/warehouse_small_dead.lua b/Features/smoth/harborset/warehouse_small_dead.lua deleted file mode 100644 index ba2192884..000000000 --- a/Features/smoth/harborset/warehouse_small_dead.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "warehouse_small_dead" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 20000, - description = "Warehouse", - energy = 10, --- energy = 1000, - flammable = 0, - collisionvolumetype = "box", - collisionvolumescales = "80 20 112", - collisionvolumeoffsets = "0 0 0", - footprintX = 5, - footprintZ = 7, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 50, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/harborset/watertower_1.lua b/Features/smoth/harborset/watertower_1.lua deleted file mode 100644 index 515a38df3..000000000 --- a/Features/smoth/harborset/watertower_1.lua +++ /dev/null @@ -1,32 +0,0 @@ -local objectname = "watertower_1" - -local featureDef = { - name = objectname, - blocking = true, - category = "industrial", - damage = 2000, - description = "Water tower", - energy = 10, --- energy = 30, - flammable = 0, - collisionvolumetype = "CylY", - collisionvolumescales = "36 180 36", - collisionvolumeoffsets = "0 0 0", - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - --metal = 0, ---metal = 20, - object = "features/smoth/harborset/" .. objectname .. ".s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) - diff --git a/Features/smoth/metal.lua b/Features/smoth/metal.lua deleted file mode 100644 index e081f8c32..000000000 --- a/Features/smoth/metal.lua +++ /dev/null @@ -1,24 +0,0 @@ -local objectname= "metal" -local featureDef = { - name = "metal", - world ="allworld", - description ="Metal Patch", - category ="Resource", - object ="metal.s3o", - footprintx =4, - footprintz =4, - height =5, - blocking =false, - hitdensity =0, - energy =0, - metal =0, - damage =9999999999, - flammable =false, - reclaimable =false, - autoreclaimable =false, - indestructible =true, - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[objectname] = featureDef}) \ No newline at end of file diff --git a/Features/smoth/neutralhlvlanding_dead.lua b/Features/smoth/neutralhlvlanding_dead.lua deleted file mode 100644 index a1d624a58..000000000 --- a/Features/smoth/neutralhlvlanding_dead.lua +++ /dev/null @@ -1,31 +0,0 @@ ------------------------------------------------------------------------------ --- neutralhlvlanding_dead ------------------------------------------------------------------------------ - -local featureDef = { - - name = "neutralhlvlanding_dead", - blocking = true, - category = "corpse", - damage = 10000, - description = "Wreckage", - energy = 10, --- energy = 2000, - featureDead = "rubble", - flammable = 0, - footprintX = 23, - footprintZ = 23, - height = "50", - hitdensity = "70", - metal = 0, ---metal = 150, - object = "neutralhlvlanding_dead.s3o", - reclaimable = true, - autoreclaimable = false, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} - -return lowerkeys({[featureDef.name] = featureDef}) \ No newline at end of file diff --git a/Features/smoth/palmetto_1.lua b/Features/smoth/palmetto_1.lua deleted file mode 100644 index 5ad417615..000000000 --- a/Features/smoth/palmetto_1.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- palmetto_1 ------------------------------------------------------------------------------ -local featureDef = { - name = "palmetto_1", - blocking = false, - category = "Trees", - damage = 4000, - description = "palmetto", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/palmetto_1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/palmetto_2.lua b/Features/smoth/palmetto_2.lua deleted file mode 100644 index 9332b1f62..000000000 --- a/Features/smoth/palmetto_2.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- palmetto_2 ------------------------------------------------------------------------------ -local featureDef = { - name = "palmetto_2", - blocking = false, - category = "Trees", - damage = 4000, - description = "palmetto", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/palmetto_2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/palmetto_3.lua b/Features/smoth/palmetto_3.lua deleted file mode 100644 index 83e66891e..000000000 --- a/Features/smoth/palmetto_3.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- palmetto_3 ------------------------------------------------------------------------------ -local featureDef = { - name = "palmetto_3", - blocking = false, - category = "Trees", - damage = 4000, - description = "palmetto", - energy = 10, --- energy = 10, - flammable = 0, - footprintX = 2, - footprintZ = 2, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 10, - object = "features/smoth/palmetto_3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothdeadtree1.lua b/Features/smoth/smothdeadtree1.lua deleted file mode 100644 index 6225d3776..000000000 --- a/Features/smoth/smothdeadtree1.lua +++ /dev/null @@ -1,32 +0,0 @@ ------------------------------------------------------------------------------ --- smothdeadtree1 ------------------------------------------------------------------------------ - -local featureDef = { - - name = "smothdeadtree1", - blocking = true, - category = "Trees", - damage = 100, - description = "Dead Tree", - energy = 10, --- energy = 1, - featuredead = "smothtree123dead", - flammable = 1, - footprintX = 1, - footprintZ = 1, - height = "36", - hitdensity = "5", - object = "features/smoth/smothdeadtree1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} - -return lowerkeys({[featureDef.name] = featureDef}) - - - \ No newline at end of file diff --git a/Features/smoth/smothdist.lua b/Features/smoth/smothdist.lua deleted file mode 100644 index d0f36eb44..000000000 --- a/Features/smoth/smothdist.lua +++ /dev/null @@ -1,29 +0,0 @@ ------------------------------------------------------------------------------ --- smothdist ------------------------------------------------------------------------------ -local featureDef = { - name = "smothdist", - blocking = true, - category = "industrial", - damage = 2000, - description = "distiller", - energy = 10, --- energy = 20, - featureDead = "rubble", - flammable = 0, - footprintX = 6, - footprintZ = 5, - height = "36", - hitdensity = "5", - metal = 0, ---metal = 0, - object = "features/smoth/smothdist.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) - diff --git a/Features/smoth/smothoilrig.lua b/Features/smoth/smothoilrig.lua deleted file mode 100644 index 12cd202d5..000000000 --- a/Features/smoth/smothoilrig.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- smothoilrig ------------------------------------------------------------------------------ -local featureDef = { - name = "smothoilrig", - blocking = true, - category = "Industrial", - damage = 10000, - description = "sci-fi oilrig", - energy = 10, --- energy = 2000, - featureDead = "rubble", - flammable = false, - footprintX = 30, - footprintZ = 30, - height = "20", - hitdensity = "5", - metal = 0, ---metal = 350, - object = "features/smoth/smothoilrig.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothpipes.lua b/Features/smoth/smothpipes.lua deleted file mode 100644 index 4245c71a8..000000000 --- a/Features/smoth/smothpipes.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- smothpipes ------------------------------------------------------------------------------ -local featureDef = { - name = "pipes", - blocking = true, - category = "Industrial", - damage = 1000, - description = "pile of pipes", - energy = 10, --- energy = 2000, - featureDead = "rubble", - flammable = false, - footprintX = 4, - footprintZ = 10, - height = "10", - hitdensity = "5", - metal = 0, ---metal = 0, - object = "features/smoth/pipes.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothtree1.lua b/Features/smoth/smothtree1.lua deleted file mode 100644 index 7d9413e87..000000000 --- a/Features/smoth/smothtree1.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- smothtree1 ------------------------------------------------------------------------------ -local featureDef = { - name = "smothtree1", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/smoth/smothtree1.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothtree123dead.lua b/Features/smoth/smothtree123dead.lua deleted file mode 100644 index 343c802ca..000000000 --- a/Features/smoth/smothtree123dead.lua +++ /dev/null @@ -1,27 +0,0 @@ ------------------------------------------------------------------------------ --- smothtree123dead ------------------------------------------------------------------------------ -local featureDef = { - name = "smothtree123dead", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree Trunk", - energy = 10, --- energy = 1, - flammable = 0, - footprintX = 1, - footprintZ = 1, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/smoth/smothtree123dead.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothtree2.lua b/Features/smoth/smothtree2.lua deleted file mode 100644 index 062fe8392..000000000 --- a/Features/smoth/smothtree2.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- smothtree2 ------------------------------------------------------------------------------ -local featureDef = { - name = "smothtree2", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = 0, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/smoth/smothtree2.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/Features/smoth/smothtree3.lua b/Features/smoth/smothtree3.lua deleted file mode 100644 index 444ab6b6b..000000000 --- a/Features/smoth/smothtree3.lua +++ /dev/null @@ -1,28 +0,0 @@ ------------------------------------------------------------------------------ --- smothtree3 ------------------------------------------------------------------------------ -local featureDef = { - name = "smothtree3", - blocking = true, - category = "Trees", - damage = 100, - description = "Tree", - energy = 10, --- energy = 1, - featuredead = "smothdeadtree1", - flammable = 0, - footprintX = 2, - footprintZ = 2, - upright = true, - height = "36", - hitdensity = "5", - - object = "features/smoth/smothtree3.s3o", - reclaimable = true, - autoreclaimable = true, - world = "All Worlds", - customparams = { - randomrotate = "true", - }, -} -return lowerkeys({[featureDef.name] = featureDef}) diff --git a/GPL-2.0.txt b/GPL-2.0.txt new file mode 100644 index 000000000..d159169d1 --- /dev/null +++ b/GPL-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/Gamedata/alldefs_post.lua b/Gamedata/alldefs_post.lua new file mode 100644 index 000000000..d698a7574 --- /dev/null +++ b/Gamedata/alldefs_post.lua @@ -0,0 +1,638 @@ +-------------------------- +-- DOCUMENTATION +------------------------- + +-- Evolution RTS contains weapondefs in its unitdef files +-- Standalone weapondefs are only loaded by Spring after unitdefs are loaded +-- So, if we want to do post processing and include all the unit+weapon defs, and have the ability to bake these changes into files, we must do it after both have been loaded +-- That means, ALL UNIT AND WEAPON DEF POST PROCESSING IS DONE HERE + +-- What happens: +-- unitdefs_post.lua calls the _Post functions for unitDefs and any weaponDefs that are contained in the unitdef files +-- unitdefs_post.lua writes the corresponding unitDefs to customparams (if wanted) +-- weapondefs_post.lua fetches any weapondefs from the unitdefs, +-- weapondefs_post.lua fetches the standlaone weapondefs, calls the _post functions for them, writes them to customparams (if wanted) +-- strictly speaking, alldefs.lua is a misnomer since this file does not handle armordefs, featuredefs or movedefs + +-- Switch for when we want to save defs into customparams as strings (so as a widget can then write them to file) +-- The widget to do so can be found in 'etc/Lua/bake_unitdefs_post' +SaveDefsToCustomParams = false + +------------------------- +-- Process relevant modoptions and gamewide features first +------------------------- +unitHealthModifier = tonumber(Spring.GetModOptions().unithealthmodifier) +if unitHealthModifier == nil then + unitHealthModifier = 500 +end + +unitHealthModifier = unitHealthModifier * 0.01 + +canAnyUnitsReclaim = false + +------------------------- +-- DEFS POST PROCESSING +------------------------- + +local function tobool(val) + local t = type(val) + if (t == 'nil') then + return false + elseif (t == 'boolean') then + return val + elseif (t == 'number') then + return (val ~= 0) + elseif (t == 'string') then + return ((val ~= '0') and (val ~= 'false')) + end + return false +end + +-- process unitdef +function UnitDef_Post(name, uDef) + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Utility + -- + + local function tobool(val) + local t = type(val) + if (t == 'nil') then + return false + elseif (t == 'boolean') then + return val + elseif (t == 'number') then + return (val ~= 0) + elseif (t == 'string') then + return ((val ~= '0') and (val ~= 'false')) + end + return false + end + + + local function disableunits(unitlist) + for name, ud in pairs(UnitDefs) do + if (ud.buildoptions) then + for _, toremovename in ipairs(unitlist) do + for index, unitname in pairs(ud.buildoptions) do + if (unitname == toremovename) then + table.remove(ud.buildoptions, index) + end + end + end + end + end + end + + -- Allow all unit to see planes high above + -- This ties in with the global Cylinder Targetting + -- Default airsightdistance is sightdistance * 1.5 + --uDef.airsightdistance = uDef.sightdistance * 2 --No longer needed + if uDef.airsightdistance == uDef.sightdistance * 1.5 then + uDef.airsightdistance = uDef.sightdistance + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Set building Mask 0 for all mobile units + -- + if uDef.customparams and uDef.customparams.unittype == "mobile" then + uDef.buildingmask = 0 + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- 3dbuildrange for all none plane builders + -- + --[[ + for name, ud in pairs(UnitDefs) do + if (tobool(ud.isBuilder) and not tobool(ud.canfly)) then + ud.buildrange3d = true + end + end + --]] + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- turn off unit collision check for planes + -- + + if uDef.canfly and not uDef.istransport then + uDef.collide = false + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Set building start sound for all builders + -- + + if uDef.builder == true and uDef.sounds then + uDef.sounds.build = "miscfx/buildstart-nano.wav" + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Calculate mincloakdistance based on unit footprint size + -- + + local sqrt = math.sqrt + + local fx = uDef.footprintx and tonumber(uDef.footprintx) or 1 + local fz = uDef.footprintz and tonumber(uDef.footprintz) or 1 + local radius = 8 * sqrt((fx * fx) + (fz * fz)) + if uDef.customparams and uDef.customparams.decloakradiusmodifier then + uDef.mincloakdistance = (radius * uDef.customparams.decloakradiusmodifier) + elseif uDef.customparams and uDef.customparams.decloakradiushalved then + uDef.mincloakdistance = (radius * 3) + else + uDef.mincloakdistance = (radius * 6) + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Spring Kludge Removal + -- + uDef.activateWhenBuilt = true + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + + --Set reverse velocity automatically + if uDef.maxvelocity then + uDef.maxreversevelocity = uDef.maxvelocity * 0.75 + end + + --Override groundplate used + if uDef.usegrounddecal == true and uDef.customparams and uDef.customparams.customgrounddecal ~= true then + if uDef.customparams and uDef.customparams.factionname == "ateran" then + uDef.buildinggrounddecaltype = "groundplate.dds" + --Make decals sizing easy + if uDef.footprintx ~= nil and uDef.footprintz ~= nil then + uDef.buildinggrounddecalsizex = uDef.footprintx + 2 + uDef.buildinggrounddecalsizey = uDef.footprintz + 2 + uDef.buildinggrounddecaldecayspeed = 0.9 + else + Spring.Echo("[AllDefsPost] " .. uDef.name .. " Does not have it's footprint defined") + end + end + if uDef.customparams and uDef.customparams.factionname == "zaal" then + uDef.buildinggrounddecaltype = "zgroundtexture2.dds" + end + if uDef.customparams and uDef.customparams.factionname == "pattern" then + uDef.buildinggrounddecaltype = "groundplate.dds" + end + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Turn off nanospray globally + if uDef.shownanospray then + uDef.shownanospray = false + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- Make units unable to be built in the water + if uDef.maxwaterdepth then + uDef.maxwaterdepth = 25 + end + if uDef.floater then + uDef.floater = false + end + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Turn off Chicken Egg drops + if uDef.corpse == "chicken_egg" then + uDef.corpse = "" + end + + if string.find(name, '_scav') then + VFS.Include("gamedata/scavengers/unitdef_post.lua") + uDef = scav_Udef_Post(name, uDef) + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Use per piece collision volumes + -- !Potentially very expensive! + -- I'm using this to save myself a boatload of time + uDef.usePieceCollisionVolumes = false + +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- process weapondef +function WeaponDef_Post(name, wDef) + + -- Cylinder Targeting and infinite vertical range for everything + --wDef.cylindertargeting = 128 + --wDef.heightmod = 1 + + wDef.name = wDef.weapontype + + --Use targetborderoverride in weapondef customparams to override this global setting + --Controls whether the weapon aims for the center or the edge of its target's collision volume. Clamped between -1.0 - target the far border, and 1.0 - target the near border. + if wDef.customparams and wDef.customparams.targetborderoverride == nil then + wDef.targetborder = 0.75 --Aim for just inside the hitsphere + elseif wDef.customparams and wDef.customparams.targetborderoverride ~= nil then + wDef.targetborder = tonumber(wDef.customparams.targetborderoverride) + end + + -- weapon reloadTime and stockpileTime were separated in 77b1 + if (tobool(wDef.stockpile) and (wDef.stockpiletime==nil)) then + wDef.stockpiletime = wDef.reloadtime + --wDef.reloadtime = 2 -- 2 seconds + end + + if (tobool(wDef.ballistic) or tobool(wDef.dropped)) then + wDef.gravityaffected = true + end + + --Potentially fix times when weapons explode without doing damage + if tonumber(wDef.areaofeffect) ~= nil and tonumber(wDef.areaofeffect) <= 25 then + if wDef.customparams and wDef.customparams.aoeoverride == true then + wDef.areaofeffect = wDef.areaofeffect + else + wDef.areaofeffect = 25 + end + end + if tonumber(wDef.areaofeffect) ~= nil and tonumber(wDef.areaofeffect) <= 25 then + if wDef.customparams and wDef.customparams.edgeeffectiveness == true then + wDef.edgeeffectiveness = wDef.edgeeffectiveness + else + wDef.edgeeffectiveness = 1 + end + end + + --Override map gravity for all weapons + wDef.mygravity = 0.14 + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Set up params for Point Defense turrets + if wDef.customparams and wDef.customparams.ispointdefenselaser == true then + if wDef.customparams.primaryweaponrange ~= nil then + primaryWeaponRange = tonumber(wDef.customparams.primaryweaponrange) + else + primaryWeaponRange = 0 + end + wDef.areaofeffect = 0 + wDef.avoidfeature = false + wDef.avoidfriendly = false + wDef.collidefeature = false + wDef.collidefriendly = false + wDef.corethickness = 0.2 + wDef.duration = 0.2 + wDef.explosiongenerator = [[custom:genericshellexplosion-small-sparks-burn]] + wDef.falloffrate = 1 + wDef.impulsefactor = 0 + wDef.interceptedbyshieldtype = 4 + wDef.minintensity = 1 + wDef.name = [[Point Defense Laser]] + wDef.projectiles = 1 + wDef.range = primaryWeaponRange + wDef.reloadtime = 0.25 + wDef.weapontype = [[LaserCannon]] + wDef.rgbcolor = [[0 0.5 1]] + wDef.rgbcolor2 = [[1 1 1]] + wDef.soundtrigger = true + wDef.soundstart = [[weapons/pointdefensefire.wav]] + wDef.texture1 = [[shot]] + wDef.texture2 = [[empty]] + wDef.thickness = 2 + wDef.tolerance = 1000 + wDef.turret = true + wDef.weaponvelocity = 1500 + wDef.customparams.damagetype = [[pdlaser]] + wDef.damage.default = 6.25 + wDef.energypershot = math.floor(wDef.damage.default * 0.05 * wDef.projectiles * ((wDef.areaofeffect * 0.001) + 1) * wDef.range^0.25 * 0.5 * 10 + 0.5) * 0.1 + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- Turn off waterweapons + if wDef.waterweapon then + wDef.waterweapon = false + end + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Disable Friendly Fire Completely + if wDef.customparams and wDef.customparams.friendlyfireexception == nil then + wDef.customparams.nofriendlyfire = 1 + end + + if string.find(name, '_scav') then + VFS.Include("gamedata/scavengers/weapondef_post.lua") + wDef = scav_Wdef_Post(name, wDef) + end + +end + + +-------------------------- +-- MODOPTIONS +------------------------- + +-- process modoptions (last, because they should not get baked) +function ModOptions_Post (UnitDefs, WeaponDefs) + if (Spring.GetModOptions) then + local modOptions = Spring.GetModOptions() + + for id,unitDef in pairs(UnitDefs) do + unitDef.buildcostmetal = unitDef.buildcostmetal * 2 + + --Disabled due to boxcollector cpu costs + -- if unitDef.customparams.corpse == "energycore" then + -- unitDef.corpse = "ammobox" + -- end + + --Shield handling + if unitDef.weapondefs then + for _, weaponDef in pairs(unitDef.weapondefs) do + if weaponDef.weapontype == "Shield" then + unitDef.customparams.shield_radius = weaponDef.shieldradius + unitDef.customparams.shield_power = weaponDef.shieldpower + unitDef.customparams.shield_rate = (weaponDef.customparams or {}).shield_rate or weaponDef.shieldpowerregen + break + end + end + end + + -- Set building Hitpoints + -- Ateran + if unitDef.customparams and unitDef.customparams.factionname == "ateran" + or unitDef.customparams and unitDef.customparams.factionname == "Federation of Kala" + or unitDef.customparams and unitDef.customparams.factionname == "Loz Alliance" then + if unitDef.customparams then + if unitDef.customparams.unittype == "building" then + unitDef.maxdamage = unitDef.buildcostmetal * 5 + end + if unitDef.customparams.unittype == "factory" then + unitDef.maxdamage = unitDef.buildcostmetal * 30 + end + if unitDef.customparams.unittype == "turret" then + unitDef.maxdamage = unitDef.buildcostmetal * 5 + end + if unitDef.customparams.unittype == "shield" then + unitDef.maxdamage = unitDef.buildcostmetal * 5 + end + end + end + -- Zaal + if unitDef.customparams and unitDef.customparams.factionname == "zaal" then + if unitDef.customparams then + if unitDef.customparams.unittype == "building" then + unitDef.maxdamage = unitDef.buildcostmetal * 10 + end + end + end + + -- Add a modifier for unit HP + if unitDef.maxdamage then + --Spring.Echo(uDef.name) + --Spring.Echo(uDef.maxdamage) + unitDef.maxdamage = unitDef.maxdamage * unitHealthModifier --Look in the top of this file for default health modifier + --Spring.Echo(uDef.name) + --Spring.Echo(uDef.maxdamage) + end + end + + -- Make sure that land based defense weapons and turrets are scaled up to match + -- for id,wDef in pairs(WeaponDefs) do + -- if wDef.customparams and wDef.customparams.effectedbyunithealthmodifier == true then + -- if wDef.damage.default then + -- wDef.damage.default = wDef.damage.default * (unitHealthModifier * 0.33) + -- end + -- --Spring.Echo(wDef.damage.default) + -- end + -- end + + -------------------------------------------------------------------------------- + -- Process Upgrades -- + -------------------------------------------------------------------------------- + + for id,uDef in pairs(UnitDefs) do + -- Handle upgraded units HP and Max Speed + if uDef.customparams and uDef.customparams.isupgraded == "1" then + uDef.maxdamage = uDef.maxdamage * 1.20 + if uDef.maxvelocity then + uDef.maxvelocity = uDef.maxvelocity * 0.95 + end + end + if uDef.customparams and uDef.customparams.isupgraded == "2" then + uDef.maxdamage = uDef.maxdamage * 1.35 + if uDef.maxvelocity then + uDef.maxvelocity = uDef.maxvelocity * 0.90 + end + end + if uDef.customparams and uDef.customparams.isupgraded == "3" then + uDef.maxdamage = uDef.maxdamage * 1.50 + if uDef.maxvelocity then + uDef.maxvelocity = uDef.maxvelocity * 0.85 + end + end + if uDef.customparams and uDef.customparams.isupgraded == "boss" then + uDef.maxdamage = uDef.maxdamage * 2.50 + if uDef.maxvelocity then + uDef.maxvelocity = uDef.maxvelocity * 0.75 + end + end + end + + for id,wDef in pairs(WeaponDefs) do + -- Handle upgraded units weapon reload times + if wDef.customparams and wDef.customparams.isupgraded == "1" then + wDef.reloadtime = wDef.reloadtime * 0.85 + wDef.damage.default = wDef.damage.default * 1.20 + if wDef.exteriorshield == true and wDef.shieldpower < 0 then + wDef.shieldpower = wDef.shieldpower * 1.20 + end + end + if wDef.customparams and wDef.customparams.isupgraded == "2" then + wDef.reloadtime = wDef.reloadtime * 0.70 + wDef.damage.default = wDef.damage.default * 1.35 + if wDef.exteriorshield == true and wDef.shieldpower < 0 then + wDef.shieldpower = wDef.shieldpower * 1.35 + end + end + if wDef.customparams and wDef.customparams.isupgraded == "3" then + wDef.reloadtime = wDef.reloadtime * 0.65 + wDef.damage.default = wDef.damage.default * 1.50 + if wDef.exteriorshield == true and wDef.shieldpower < 0 then + wDef.shieldpower = wDef.shieldpower * 1.50 + end + end + if wDef.customparams and wDef.customparams.isupgraded == "boss" then + wDef.reloadtime = wDef.reloadtime * 0.5 + wDef.damage.default = wDef.damage.default * 10 + if wDef.exteriorshield == true and wDef.shieldpower < 0 then + wDef.shieldpower = wDef.shieldpower * 2.50 + end + end + + --Handle Shields + if wDef.customparams and wDef.customparams.isshieldupgraded == "1" then + if wDef.exteriorshield == true then + wDef.shieldpower = wDef.shieldpower * 1.20 + end + end + if wDef.customparams and wDef.customparams.isshieldupgraded == "2" then + if wDef.exteriorshield == true then + wDef.shieldpower = wDef.shieldpower * 1.35 + end + end + if wDef.customparams and wDef.customparams.isshieldupgraded == "3" then + if wDef.exteriorshield == true then + wDef.shieldpower = wDef.shieldpower * 1.50 + end + end + if wDef.customparams and wDef.customparams.isshieldupgraded == "boss" then + if wDef.exteriorshield == true then + wDef.shieldpower = wDef.shieldpower * 2.50 + end + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + + -------------------------------------------------------------------------------- + -- Process Armortypes -- + -------------------------------------------------------------------------------- + + local damageClasses = VFS.Include("gamedata/configs/damageTypes.lua") + local damageTypes = damageClasses.damageTypes + local defaultClass = damageClasses.default + + weapondamage = tonumber(wDef.damage.default) + if (weapondamage > 0) then + if (wDef.customparams) then + local damagetypelower + if wDef.customparams.damagetype ~=nil then + damagetypelower = string.lower(wDef.customparams.damagetype) + end + if damagetypelower == '' or damagetypelower == nil then + damagetypelower = defaultClass + end + --Spring.Echo(damagetypelower) + --Spring.Echo(" ") + if damageTypes[damagetypelower] then + for armorClass, armorMultiplier in pairs(damageTypes[damagetypelower]) do + --Spring.Echo(wd.name, armorClass, weapondamage*armorMultiplier ) + wDef.damage[armorClass] = weapondamage*armorMultiplier + end + else + Spring.Echo("!!WARNING!! Invalid damagetype: " .. damagetypelower) + end + end + end + + -------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- + -- Set energy cost to fire automatically + -- There are 2 weapondef customparams used to control this + -- oldcosttofireformula = true, will result in the original formula that did not account for weapon range to be used + -- nocosttofire == true, will result in cost to fire being set at 0 + local weaponDefaultDamage = wDef.damage.default + local weaponAreaOfEffect = wDef.areaofeffect or 0 + local weaponRange = wDef.range or 0 + local weaponProjectiles = wDef.projectiles or 1 + local weaponBurst = wDef.burst or 1 + if wDef.customparams and wDef.customparams.nocosttofire == true then + wDef.energypershot = 0 + else + wDef.energypershot = 0 + end + + --Here is the rest of the function for units using energy to fire their weapons +--[[ elseif wDef.customparams and wDef.customparams.oldcosttofireforumula == true then + local energycosttofire = math.floor(weaponDefaultDamage * 0.1 * weaponProjectiles * ((weaponAreaOfEffect * 0.001) + 1)*10 + 0.5)*0.1 + wDef.energypershot = energycosttofire * weaponBurst + else + --energycosttofire = weaponDefaultDamage * 0.05 * weaponProjectiles * ((weaponAreaOfEffect * 0.001) + 1) * weaponRange^0.5 * 0.1 + local energycosttofire = math.floor(weaponDefaultDamage * 0.05 * weaponProjectiles * ((weaponAreaOfEffect * 0.001) + 1) * weaponRange^0.25 * 0.5*10 + 0.5)*0.1 + wDef.energypershot = energycosttofire * weaponBurst + end +]]-- + --Set shield energy cost to recharge +--[[ if wDef.exteriorshield == true then + if wDef.customparams and wDef.customparams.nocosttofire == true then + wDef.shieldpowerregenenergy = 0 + else + --wDef.shieldpowerregenenergy = math.floor(wDef.shieldpowerregen * 0.05 * wDef.shieldradius^0.25 * 0.5 * 10 + 0.5) * 0.1 + --Spring.Echo("Energy usage is " .. wDef.shieldpowerregenenergy) + wDef.shieldpowerregenenergy = wDef.shieldpowerregen / 10 + end + end +]]-- + end + + -------------------------------------------------------------------------------- + -- Gameplay Costs -- + -------------------------------------------------------------------------------- + + for id,unitDef in pairs(UnitDefs) do + + if unitDef.customparams and unitDef.customparams.unitdefbuildtime == nil then + -- Set Rules for Ateran race + if unitDef.customparams and unitDef.customparams.factionname == "ateran" then + unitDef.buildtime = unitDef.buildcostmetal / 4 + unitDef.buildcostenergy = unitDef.buildcostmetal * 1.5 + if unitDef.customparams and unitDef.customparams.requiretech == "tech1" or unitDef.customparams and unitDef.customparams.isupgraded == "1" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 3 + end + if unitDef.customparams and unitDef.customparams.requiretech == "tech2" or unitDef.customparams and unitDef.customparams.isupgraded == "2" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 6 + end + if unitDef.customparams and unitDef.customparams.requiretech == "tech3" or unitDef.customparams and unitDef.customparams.isupgraded == "3" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 12 + end + if unitDef.customparams and unitDef.customparams.noenergycost == true then + unitDef.buildcostenergy = 0 + end + if unitDef.customparams and unitDef.customparams.buildcostenergyoverride ~= nil then + unitDef.buildcostenergy = unitDef.customparams.buildcostenergyoverride + end + end + + -- Set Rules for Zaal race + if unitDef.customparams and unitDef.customparams.factionname == "zaal" then + unitDef.buildtime = unitDef.buildcostmetal / 4 + unitDef.buildcostenergy = unitDef.buildcostmetal * 5 + if unitDef.customparams and unitDef.customparams.requiretech == "tech1" or unitDef.customparams and unitDef.customparams.isupgraded == "1" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 7.5 + end + if unitDef.customparams and unitDef.customparams.requiretech == "tech2" or unitDef.customparams and unitDef.customparams.isupgraded == "2" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 10 + end + if unitDef.customparams and unitDef.customparams.requiretech == "tech3" or unitDef.customparams and unitDef.customparams.isupgraded == "3" then + unitDef.buildcostenergy = unitDef.buildcostmetal * 12.5 + end + if unitDef.customparams and unitDef.customparams.noenergycost == true then + unitDef.buildcostenergy = 0 + end + if unitDef.customparams and unitDef.customparams.buildcostenergyoverride ~= nil then + unitDef.buildcostenergy = unitDef.customparams.buildcostenergyoverride + end + end + + -- This is a catchall for units that don't have a factionname declared + if unitDef.customparams and unitDef.customparams.factionname == nil then + unitDef.buildtime = unitDef.buildcostmetal / 4 + unitDef.buildcostenergy = unitDef.buildcostmetal * 0.25 + end + end + + -- Set maximum possible workertime to 8 + if unitDef.workertime and unitDef.workertime >= 8 then + unitDef.workertime = 8 + end + -- Set reclaimspeed to be a multiple of workertime. This relies on max defaults set in featuredefs post. Without some max defaults there, this will be a funny result. + unitDef.reclaimspeed = unitDef.workertime + + if canAnyUnitsReclaim == false then + if unitDef.canreclaim == true then + unitDef.canreclaim = false + end + end + end + end +end \ No newline at end of file diff --git a/Gamedata/configs/damageTypes.lua b/Gamedata/configs/damageTypes.lua index c6365c882..2028a90c3 100644 --- a/Gamedata/configs/damageTypes.lua +++ b/Gamedata/configs/damageTypes.lua @@ -4,250 +4,106 @@ local damageClasses = { -- classes with armor classes for weapons damageTypes = { - nonexistent = { - ARMORED = 0.1, - LIGHT = 0.1, - BUILDING = 0.1, - }, - ---------------------------------------------------------------------------- - - -- Start Hovers - eaatank = { - ARMORED = 1, - LIGHT = 0.66, - BUILDING = 0.66, - }, - eartytank = { - ARMORED = 0.25, - LIGHT = 0.25, - BUILDING = 1, - }, - ebomb = { - ARMORED = 0.5, - LIGHT = 0.5, - BUILDING = 1, - }, - efatso = { - ARMORED = 0.125, - LIGHT = 0.125, - BUILDING = 1, - }, - eflametank = { - ARMORED = 0.5, - LIGHT = 0.5, - BUILDING = 1, - }, - elighttank3 = { + -- + light = { -- These values should always mirror antilight and vice versa + LIGHT = 1.5, ARMORED = 1, - LIGHT = 1, - BUILDING = 1, + BUILDING = 1, + AIR = 1, }, - eheavytank3 = { + antilight = { + LIGHT = 1.5, ARMORED = 1, - LIGHT = 1, - BUILDING = 0.5, + BUILDING = 1, + AIR = 1, }, - emediumtank3 = { + -- + turretantilight = { + LIGHT = 1.5, ARMORED = 1, - LIGHT = 0.5, - BUILDING = 0.5, + BUILDING = 0.1, + AIR = 1, }, - emissiletank = { - ARMORED = 1, - LIGHT = 1, - BUILDING = 0.5, - }, - eriottank2 = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.5, - }, - eriottank2shotgun = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.25, - }, - -- End Hovers - - -- Start All Terrains - eallterrheavy = { - ARMORED = 1, + turretantiarmored = { LIGHT = 1, - BUILDING = 0.5, + ARMORED = 1.5, + BUILDING = 0.1, + AIR = 1, }, - eallterrlight = { - ARMORED = 0.5, + antiarmored = { LIGHT = 1, - BUILDING = 0.5, - }, - eallterrmed = { - ARMORED = 1, - LIGHT = 0.5, - BUILDING = 0.5, + ARMORED = 1.5, + BUILDING = 1, + AIR = 1, }, - eallterraa = { - ARMORED = 1, - LIGHT = 0.66, - BUILDING = 0.66, - }, - eallterrriot = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.5, - }, - eallterrriotshotgun = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.25, - }, - eallterrassault = { - ARMORED = 0.125, - LIGHT = 0.125, - BUILDING = 1, - }, - -- End All Terrains - - -- Start Amphibs - eamphibbuggy = { - ARMORED = 0.5, + antibuilding = { LIGHT = 1, - BUILDING = 0.5, - }, - eamphibriot = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.5, - }, - eamphibriotshotgun = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.25, - }, - eamphibaa = { - ARMORED = 0.5, - LIGHT = 1, - BUILDING = 0.5, - }, - eamphibmedtank = { ARMORED = 1, - LIGHT = 1, - BUILDING = 0.5, + BUILDING = 1.5, + AIR = 1, }, - eamphibrock = { - ARMORED = 1, - LIGHT = 0.5, - BUILDING = 0.5, - }, - eamphibarty = { - ARMORED = 0.25, + antibuildingarty = { LIGHT = 0.25, - BUILDING = 1, + ARMORED = 0.25, + BUILDING = 1.5, + AIR = 0.25, }, - -- End Amphibs - - -- Start Aircraft - edrone = { - ARMORED = 1, + antiair = { LIGHT = 1, - BUILDING = 1, - }, - efighter = { ARMORED = 1, - LIGHT = 1, - BUILDING = 0.25, + BUILDING = 1, + AIR = 1.5, }, - egunship2 = { - ARMORED = 1, - LIGHT = 1, - BUILDING = 0.5, - }, - ebomber = { - ARMORED = 0.25, - LIGHT = 0.25, - BUILDING = 1, + antilightarmored = { + LIGHT = 1.5, + ARMORED = 1.5, + BUILDING = 1, + AIR = 1, }, - -- End Aircraft - - -- Start Experimentals - eexkrabgroth = { - ARMORED = 0.1, - LIGHT = 0.1, - BUILDING = 1, - }, - eextankdestroyer = { + antilightbuilding = { + LIGHT = 1.5, ARMORED = 1, - LIGHT = 1, - BUILDING = 0.1, - }, - eexnukearty = { - ARMORED = 0.5, - LIGHT = 0.5, - BUILDING = 1, + BUILDING = 1.5, + AIR = 1, }, - -- End Experimentals - - -- Start Buildings - elightturret2 = { - ARMORED = 0.25, + antiarmoredbuilding = { LIGHT = 1, - BUILDING = 0.1, - }, - eheavyturret2 = { - ARMORED = 1, - LIGHT = 0.5, - BUILDING = 0.1, + ARMORED = 1.5, + BUILDING = 1.5, + AIR = 1, }, - eaaturret = { + antibuildingair = { + LIGHT = 1, ARMORED = 1, - LIGHT = 0.66, - BUILDING = 0.66, - }, - elrpc = { - ARMORED = 0.25, - LIGHT = 0.25, - BUILDING = 1, + BUILDING = 1.5, + AIR = 1.5, }, - euwturret = { - ARMORED = 1, + antiarmoredair = { LIGHT = 1, - BUILDING = 0.1, + ARMORED = 1.5, + BUILDING = 1, + AIR = 1.5, }, - emine = { - ARMORED = 1, - LIGHT = 1, - BUILDING = 0, + turretantilightarmored = { + LIGHT = 1.5, + ARMORED = 1.5, + BUILDING = 0.1, + AIR = 1, }, - -- End Buildings - - -- Start Miscellaneous - queenbeam = { - ARMORED = 0.1, - LIGHT = 0.1, - BUILDING = 1, - }, - queenflames = { - ARMORED = 1, - LIGHT = 1, - BUILDING = 0.1, - }, - queencannon = { - ARMORED = 1, - LIGHT = 1, - BUILDING = 0.1, - }, - -- End Miscellaneous default = { - ARMORED = 1, LIGHT = 1, - BUILDING = 1, + ARMORED = 1, + BUILDING = 1, + AIR = 1, }, }, armorDefs = { - "LIGHT", + "LIGHT", "ARMORED", - "BUILDING", + "BUILDING", + "AIR", }, } return damageClasses; \ No newline at end of file diff --git a/Gamedata/configs/game manual/1) gameplay.lua b/Gamedata/configs/game manual/1) gameplay.lua new file mode 100644 index 000000000..2e5a0579f --- /dev/null +++ b/Gamedata/configs/game manual/1) gameplay.lua @@ -0,0 +1,150 @@ +local topic = { + ["details"] = { + sectionTitle = "Gameplay", + }, + ["article"] = { + { --page + ["details"] = { + pageTitle = "Basics", + }, + ["sections"] = {-- sections + { + text = [[Crash Course: + +Metal is used to make units and structures. + +Energy is only used for units to fire, shields, nukes etc. + +Energy is not used for building, but you will need tons of it because it is often depleted by units firing their weapons in battles, or shields powering up or simply used by metal makers when converting energy to metal (it's also used to build nukes). + +Without energy, your units can't fire. Along those lines, build storage. Storage buildings increase the total amount of metal and energy that you can store, and so in that way act like capacitors for your army. Storage buildings are quite possibly the most important buildings in your base. + +In order to tech up, put generators next to your factories. + +Basic generators give you 5 supply, 1 power (in a radius) and 1 energy. Geothermal generators give you 20 supply 7 power and 7 energy. Advanced generators give you 30 supply, 10 power and 10 energy. + +Generators give you supply. The supply cap is 200/200. Generators say how much supply, power, and energy they give you in the unit descriptions that pop up when you mouse-over them on the build menu. You need supply in order to build units. + +Power is used to tech up. The generators have graphics around them when you place them for building. That graphic is a visualization of the radius in which power is supplied. Place generators so that they are near your factory, and the power they provide will unlock higher tech units within the factory. + +In this way, teching up is easy, but if you lose your generators, then you will lose the tech that the generator was allowing you to build. + +Engineers, ORBs, and Overseers do not use supply. Make as many as you would like. It's a good idea to have many on hand so that you always have workers available, and they will assist with other construction projects. + +ORBs are field repair units. They repair everything in a huge radius for 10hp every second, as long as what they are repairing is out of combat (for free). + +Metal Makers are good. They are not as efficient as metal extractors, but they can help use your excess energy while supplying you additional income. Each Metal Maker uses 5 energy to produce 0.5 metal (The same income as a metal extractor). + +However, if you are using metal makers, remember that you need energy in order for your units to fire, so build storage so that you have a buffer zone. + +There are 5 tech paths: + +Hover, Amphibious, All Terrain, Air and Destroyers + +Hover can of course go over water and are moderately good in all situations. + +Amphibious units are extremely fast, very high damage output, but have very weak armor. Amphibious units are stealthed to radar. + +All Terrains units can of course go everywhere except water. They are the slowest of the 3 main technologies (Hover/Amphibious/All-Terrain), but have good firepower and solid damage output and good armor. All Terrain units can cloak. All Terrain units can't be automatically targeted when cloaked, but you can see them via seismic indicators, so you can force fire at them if you want. Cloaking All Terrain units uses a lot of energy (2 per unit). The best way to use them is to cloak them right before a fight so that you get the first shot in the battle. It can make the difference between winning and losing a battle. + +Destroyer units are end-game units. They are extremely powerful and deal critical amounts of damage, but they can be brought down by surrounding them and focusing your fire. Make sure that if you are using them, you keep them protected. + +This might seem like a lot to take in, but the game and the gameplay itself is quite simple really. I hope that this crash course has been helpful! + + ]], + textColor = {0.9,0.9,0.9,1.0}, + fontShadow = false, + --thumbImage = "bitmaps/ui/loadingscreen/princess.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + --backgroundImage1 = "bitmaps/ui/loadingscreen/horizon2.png", + }, + } + }, + { --page + ["details"] = { + pageTitle = "Resources", + }, + ["sections"] = {-- sections + { + text = [[Metal: + +Metal is used solely for construction projects, whether you are trying to build a turret, factory, generator, tank, aircraft, etc, Metal is what is used for that construction project. More metal income means that you can build more things simultaneously, faster. + +Metal can be obtained via the following methods: + +Metal Extractor (MEX) + +Metal Maker + ]], + textColor = {0.9,0.9,0.9,1.0}, + fontShadow = false, + --thumbImage = "bitmaps/ui/loadingscreen/princess.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + --backgroundImage1 = "bitmaps/ui/loadingscreen/horizon2.png", + }, + { + text = [[Energy: + +Energy is used specifically for utilitarian purposes. Those purposes include, Units firing, Recharging shields, Building Nuclear Missiles, Building anti-nukes, Cloaking, synthesizing metal, etc. + +Energy is extremely important. The same buildings that provide energy also provide you with Power and Supply. The most basic reasons of why energy is so important is the fact that your units require it in order to fire their weapons. As a result, if you get in the middle of a battle and run out of energy, your units will no longer be able to fire, and that might not only cost you the battle, it might also cost you the game! + +Energy can be obtained via the following methods: + +Basic Generator + +Geothermal Generator + +Advanced Generator + ]], + textColor = {0.9,0.9,0.9,1.0}, + fontShadow = false, + --thumbImage = "bitmaps/ui/loadingscreen/princess.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + --backgroundImage1 = "bitmaps/ui/loadingscreen/horizon2.png", + }, + { + text = [[Storage: + +Storage buildings are excellent tools to help buffer your Metal and Energy reserves. When your Metal and Energy reserves are full, any excess is wasted (if in a 1v1 game, otherwise it spills over to your allies in team games), so it makes a lot of sense to have a large buffer zone for your resources. It can also help with Metal stalling with large construction projects, and more importantly, it can allow you to have much greater staying power in a large battle where your units are using tons of energy in order to keep fighting. + +Resource storage can be obtained via: + +Storage Facility + ]], + textColor = {0.9,0.9,0.9,1.0}, + fontShadow = false, + --thumbImage = "bitmaps/ui/loadingscreen/princess.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + --backgroundImage1 = "bitmaps/ui/loadingscreen/horizon2.png", + }, + } + }, + { --page + ["details"] = { + pageTitle = "Power", + }, + ["sections"] = {-- sections + { + text = [[Overview: + +Power is used by factories to unlock attack units, it is provided by the same buildings that produce Energy and Supply. They are Basic Generator, Geothermal Generator, and Advanced Generator. Generators can only give Power to factories that are close to them, this is indicated by the blue circle you see when you are placing a generator. If the blue circle touches the center of a factory, then the generator will be able to give Power to that factory once it is completed. + +Tips: + +Use Basic Generators to unlock units, start building Advanced Generators only when all units are unlocked. Advanced Generators are not meant for unlocking units due to how long it takes just to build one. + +Geothermal Generator can only be placed on spots that have smoke coming out of it, you can find these spots easier if you try to place a Geothermal Generator. If you can place a Geothermal Generator near your start position, it is a good idea to build it rather than Basic Generators as you get to start with most units unlocked. + ]], + textColor = {0.9,0.9,0.9,1.0}, + fontShadow = false, + --thumbImage = "bitmaps/ui/loadingscreen/princess.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + --backgroundImage1 = "bitmaps/ui/loadingscreen/horizon2.png", + }, + } + }, + } +} + +return topic \ No newline at end of file diff --git a/Gamedata/configs/game manual/3) units.lua b/Gamedata/configs/game manual/3) units.lua new file mode 100644 index 000000000..4d14951ef --- /dev/null +++ b/Gamedata/configs/game manual/3) units.lua @@ -0,0 +1,25 @@ +local topic = { + ["details"] = { + sectionTitle = "Units", + }, + ["article"] = { + { --page + ["details"] = { + pageTitle = "3rd page", + }, + ["sections"] = {-- sections + { + text = "Black diamond ship, \n\n Sluggish but powerful, it's twin plasma miniguns certainly will brighten your day!", + textColor = {0.5,0.5,0.5,1.0}, + fontShadow = false, + thumbImage = "bitmaps/ui/loadingscreen/black diamond.png", + backgroundColor = {0.5,0.1,0.5,0.0}, + backgroundImage1 = "bitmaps/ui/loadingscreen/rainbows.png", + }, + } + }, + + } +} + +return topic \ No newline at end of file diff --git a/Gamedata/configs/loadscreens.lua b/Gamedata/configs/loadscreens.lua deleted file mode 100644 index 814800e8b..000000000 --- a/Gamedata/configs/loadscreens.lua +++ /dev/null @@ -1,107 +0,0 @@ -local loadscreens = { - - - { - tipText = "Be sure to use the Repeat button. It will cause it's current orders to be repeated over and over until the unit dies. In this way, you could assign base building to an Engineer on repeat, and if anything dies, the engineer will go and rebuild it!", - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background1.png", - tipImage = "bitmaps/ui/loadingscreen/repeattip.png", - backgroundColor = {0,0,0,0}, - }, - { - tipText = [[The ORB field medic will automatically reclaim and energy cores it gets close to. This means that if you include them in your unit groups, not only do you get excellent repair, you can also turn a profit from even a bad engagement.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background2.png", - tipImage = "bitmaps/ui/loadingscreen/orbtip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[Hoverbombs are extremely fast and maneuverable kamikaze bombs that deal heavy damage to structures and moderate damage to mobile units. They have a very high top speed but cannot turn well, so it's best to get it pointed in the correct direction before sending them in.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background3.png", - tipImage = "bitmaps/ui/loadingscreen/ebombtip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[MidKnight gunship drones are spawned from energy cores by Engineers. Their damage is very low but with enough of them they make excellent economy raiders. They are also quite good for scouting purposes.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background4.png", - tipImage = "bitmaps/ui/loadingscreen/edronetip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[Advanced generators are probably the most important structure in the game. Now only do they give you lots of energy and lots of power in a radius, they also provide a large amount of supply as well. The more you have, the better.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background5.png", - tipImage = "bitmaps/ui/loadingscreen/efusion2tip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[Kmar shield generators are excellent for shielding turrets or clustered buildings. If you have more than one in an area, the shields will link together and feed off of each other's power levels and regeneration.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background6.png", - tipImage = "bitmaps/ui/loadingscreen/ekmartip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[In team games, the income from Metal Extractors is split between all allies. Because of this reason, it does not matter which ally makes the Metal Extractors; The entire team will benefit from them. This resource splitting only applies to Metal Extractors.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background7.png", - tipImage = "bitmaps/ui/loadingscreen/emetalextractortip.png", - backgroundColor = {0,0,0,0}, - }, - - { - tipText = [[Endbringer class units are extremely powerful, but they are very vulnerable if left alone. Remember to protect your investment by sending along a squad of escort units.]], - tipTextColor = {1.0,1.0,1.0,1.0}, - fontShadow = true, - backgroundImage1 = "bitmaps/ui/loadingscreen/background8.png", - tipImage = "bitmaps/ui/loadingscreen/eextankdestroyertip.png", - backgroundColor = {0,0,0,0}, - }, - ---[[ - { - tipText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.", - tipTextColor = {1.0,0.2,0.2,0.6}, - tipImage = "bitmaps/ui/loadingscreen/5units.png", - }, - { - tipText = "look at all the colors ERHMAGERD!", - tipTextColor = {1.0,0.2,0.2,0.6}, - tipImage = "bitmaps/ui/loadingscreen/panels.png", - }, - { - tipText = "MEGUSTA!", - fontAlign = "center", - tipFontSize = 48, - tipTextColor = {0.0,1.0,0.0,1.0}, - tipImage = "bitmaps/ui/loadingscreen/megusta.png", - backgroundColor = {0.8,0.8,0.5,1.0}, - }, - { - tipText = "look at all the colors AWESOME!", - tipTextColor = {1.0,0.2,1.0,1.0}, - tipFontSize = 64, - tipWindowWidth = "80%", - fontShadow = false, - tipImage = "bitmaps/ui/loadingscreen/awesome.png", - backgroundColor = {0.5,0.1,0.5,0.0}, - backgroundImage1 = "bitmaps/ui/loadingscreen/rainbows.png", - }, -]]-- -} - -return loadscreens \ No newline at end of file diff --git a/Gamedata/configs/outer_colonies_spawn_defs.lua b/Gamedata/configs/outer_colonies_spawn_defs.lua index 8ae07c4a8..c12c3506b 100644 --- a/Gamedata/configs/outer_colonies_spawn_defs.lua +++ b/Gamedata/configs/outer_colonies_spawn_defs.lua @@ -12,7 +12,7 @@ burrowName = "burrow" -- burrow unit name maxAge = 120 -- chicken die at this age, seconds queenName = Spring.GetModOptions().mo_queendifficulty or "queen" burrowDef = UnitDefNames[burrowName].id -defenderChance = 0.5 -- probability of spawning a single turret +defenderChance = 1 -- probability of spawning a single turret maxTurrets = 6 -- Max Turrets per burrow queenSpawnMult = 1 -- how many times bigger is a queen hatch than a normal burrow hatch burrowSpawnRate = 20 @@ -21,7 +21,7 @@ minBaseDistance = 1000 maxBaseDistance = 7200 chickensPerPlayer = 1 spawnChance = 0.5 -bonusTurret = "eaaturret" -- Turret that gets spawned when a burrow dies +bonusTurret = "eheavyturret2" -- Turret that gets spawned when a burrow dies angerBonus = 204 expStep = 0.0625 lobberEMPTime = 4 @@ -56,7 +56,6 @@ local chickenTypes = { eriottank2 = true, eheavytank3 = true, emissiletank = true, - eaatank = true, eartytank = true, efatso2 = true, ebomb = true, @@ -75,7 +74,6 @@ local chickenTypes = { eamphibmedtank = true, eamphibriot = true, eamphibrock = true, - eamphibaa = true, eexkrabgroth = true, eextankdestroyer = true, @@ -113,11 +111,10 @@ chickenSwitches = { local defenders = { elightturret2 = true, eheavyturret2 = true, - eaaturret = true, + eartyturret = true, ekmar = true, } -addWave(1,{"1 eaatank"}) addWave(1,{"1 elighttank3"}) addWave(1,{"1 eamphibbuggy"}) addWave(1,{"1 eallterrlight"}) @@ -125,30 +122,24 @@ addWave(1,{"1 eallterrlight"}) addWave(2,{"2 elighttank3"}) addWave(2,{"1 eheavytank3"}) addWave(2,{"1 eamphibmedtank"}) -addWave(2,{"2 eaatank"}) addWave(3,{"2 elighttank3"}) addWave(3,{"1 eheavytank3"}) addWave(3,{"1 emissiletank"}) -addWave(3,{"2 eaatank"}) addWave(4,{"2 elighttank3"}) addWave(4,{"1 eheavytank3"}) addWave(4,{"1 emissiletank"}) -addWave(4,{"2 eamphibaa"}) addWave(4,{"2 ebomb"}) -addWave(4,{"2 eaatank"}) addWave(5,{"2 elighttank3"}) addWave(5,{"2 eamphibmedtank"}) -addWave(5,{"2 eaatank"}) addWave(6,{"2 elighttank3"}) addWave(6,{"1 eriottank2"}) addWave(6,{"1 eheavytank3"}) addWave(6,{"1 eallterrheavy"}) addWave(6,{"1 eartytank"}) -addWave(6,{"2 eaatank"}) addWave(7,{"2 egunship2"}) addWave(7,{"1 ebomber"}) @@ -161,7 +152,6 @@ addWave(8,{"2 eamphibrock"}) addWave(6,{"3 eartytank"}) addWave(6,{"3 eallterrassault"}) addWave(6,{"3 eamphibarty"}) -addWave(8,{"2 eamphibaa"}) addWave(8,{"1 ebomber"}) addWave(9,{"3 elighttank3"}) @@ -176,8 +166,9 @@ difficulties = { chickenSpawnRate = 130, burrowSpawnRate = 100, queenSpawnMult = 0, + queenHealthMult = 0.2, angerBonus = 20, - expStep = 0, + expStep = 0, lobberEMPTime = 0, chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), @@ -188,8 +179,9 @@ difficulties = { chickenSpawnRate = 90, burrowSpawnRate = 50, queenSpawnMult = 0.5, + queenHealthMult = 0.5, angerBonus = 20, - expStep = 0.09375, + expStep = 0.09375, lobberEMPTime = 2.5, chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), @@ -201,8 +193,9 @@ difficulties = { chickenSpawnRate = 45, burrowSpawnRate = 30, queenSpawnMult = 1, + queenHealthMult = 1.0, angerBonus = 25, - expStep = 0.125, + expStep = 0.125, lobberEMPTime = 4, chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), @@ -214,8 +207,9 @@ difficulties = { chickenSpawnRate = 20, burrowSpawnRate = 20, queenSpawnMult = 3, + queenHealthMult = 2.0, angerBonus = 30, - expStep = 0.25, + expStep = 0.25, lobberEMPTime = 5, chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), @@ -228,8 +222,9 @@ difficulties = { chickenSpawnRate = 10, burrowSpawnRate = 10, queenSpawnMult = 5, + queenHealthMult = 4.0, angerBonus = 35, - expStep = 0.4, + expStep = 0.4, lobberEMPTime = 7.5, chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), @@ -242,7 +237,7 @@ difficulties = { burrowSpawnRate = tonumber(Spring.GetModOptions().mo_custom_burrowspawn), queenSpawnMult = tonumber(Spring.GetModOptions().mo_custom_queenspawnmult), angerBonus = tonumber(Spring.GetModOptions().mo_custom_angerbonus), - expStep = (tonumber(Spring.GetModOptions().mo_custom_expstep) or 0.6) * -1, + expStep = (tonumber(Spring.GetModOptions().mo_custom_expstep) or 0.6) * -1, lobberEMPTime = tonumber(Spring.GetModOptions().mo_custom_lobberemp), chickenTypes = Copy(chickenTypes), defenders = Copy(defenders), diff --git a/Gamedata/configs/survival_settings.lua b/Gamedata/configs/survival_settings.lua index 105422e81..e3906271b 100644 --- a/Gamedata/configs/survival_settings.lua +++ b/Gamedata/configs/survival_settings.lua @@ -1,8 +1,8 @@ local spawnerSettings = { smallUnit = "elighttank3",--"aacar" - mediumUnit = "emediumtank3",--"ez8" + mediumUnit = "eriottank2",--"ez8" largeUnit = "eheavytank3",--xamel - referenceUnit = "efatso2",--fedmechist + referenceUnit = "eheavytank3",--fedmechist testUnit = "elighttank3", @@ -24,7 +24,7 @@ local spawnerSettings = { defenders = { elightturret2 = true, eheavyturret2 = true, - eaaturret = true, + eartyturret = true, ekmar = true, } } diff --git a/Gamedata/explosions/100RLexplode.tdf b/Gamedata/explosions/100RLexplode.tdf deleted file mode 100644 index 3ba0751c5..000000000 --- a/Gamedata/explosions/100RLexplode.tdf +++ /dev/null @@ -1,207 +0,0 @@ -[100RLexplode] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=fireyexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 24; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF00] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.5 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 3; - particleSize = 25; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[100RLexplodesmall] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=fireyexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 2; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF00] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.5 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 3; - particleSize = 25; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/100rlexplode.lua b/Gamedata/explosions/100rlexplode.lua new file mode 100644 index 000000000..e1291371a --- /dev/null +++ b/Gamedata/explosions/100rlexplode.lua @@ -0,0 +1,168 @@ +-- 100rlexplode +-- 100rlexplodesmall + +return { + ["100rlexplode"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + poof00 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.5 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 24, + speed = [[0, 1 0, 0]], + texture = [[fireyexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["100rlexplodesmall"] = { + poof00 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.5 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 0.5, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[fireyexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/330RLexplode.tdf b/Gamedata/explosions/330RLexplode.tdf deleted file mode 100644 index 93bbd5bc8..000000000 --- a/Gamedata/explosions/330RLexplode.tdf +++ /dev/null @@ -1,196 +0,0 @@ -[330RLexplode] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=redexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.4; - - size = 5; - sizeGrowth = 24; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [flare] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1 1 1 0.01 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 14; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 70; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - size=22; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 4, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=28; - - particleSpeed=1; - particleSpeedSpread=20; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=10; - particleSpeedSpread=10; - particleSize=35; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.5, 0.2; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/330rlexplode.lua b/Gamedata/explosions/330rlexplode.lua new file mode 100644 index 000000000..44fbce96d --- /dev/null +++ b/Gamedata/explosions/330rlexplode.lua @@ -0,0 +1,153 @@ +-- 330rlexplode + +return { + ["330rlexplode"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 22, + speed = [[r1.5 r-1.5, 4, r1.5 r-1.5]], + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 28, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 20, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 10, + particlesize = 35, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + flare = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 14, + particlelifespread = 0, + particlesize = 70, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0.20000000298023, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.4, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 5, + sizegrowth = 24, + speed = [[0, 1 0, 0]], + texture = [[redexplo]], + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ARTILLERY_EXPLOSION.tdf b/Gamedata/explosions/ARTILLERY_EXPLOSION.tdf deleted file mode 100644 index e1d66a610..000000000 --- a/Gamedata/explosions/ARTILLERY_EXPLOSION.tdf +++ /dev/null @@ -1,141 +0,0 @@ -[ARTILLERY_EXPLOSION] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=crimsonnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 3.5; - - size = 5; - sizeGrowth = 40; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-20 r20, 34, r-20 r20; - speed=r-2 r2, 1 r2.3, r-2 r2; - } - air=1; - water=1; - ground=1; - count=4; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.2 0.2 0.01 0.8 0.1 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 30; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=30; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-25 r25, 0, r-25 r25; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 9; - circleAlpha = 0.6; - - color = 1, 0.2, 0.1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/BEAM_EXPLOSION.tdf b/Gamedata/explosions/BEAM_EXPLOSION.tdf deleted file mode 100644 index 1ce7b5bb4..000000000 --- a/Gamedata/explosions/BEAM_EXPLOSION.tdf +++ /dev/null @@ -1,67 +0,0 @@ -[BEAM_EXPLOSION] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=2explo; - heat = 10; - maxheat = 15; - heatFalloff = 0.4; - - size = 55; - sizeGrowth = 0.9; - - pos = r-25 r25, 5, r-25 r25; - speed=r-1 r1, 1 0, r-1 r1; - } - air=1; - water=1; - ground=1; - count=5; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.04; - - startSize = 10; - sizeExpansion = 0.9; - size = 40; - sizeGrowth = 15; - - pos = r-3 r3, r-3 r3, r-3 r3; - speed=0, 1 r2.3, 0; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - flashSize = 120; - flashAlpha = 0.9; - - circleSize = 10; - circleGrowth = 10; - circleAlpha = 0.5; - - ttl = 15; - color = 1, 0.3, 1; - - air=1; - ground=1; - water=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/BLUE_EXPLOSION.tdf b/Gamedata/explosions/BLUE_EXPLOSION.tdf deleted file mode 100644 index 117de13c9..000000000 --- a/Gamedata/explosions/BLUE_EXPLOSION.tdf +++ /dev/null @@ -1,534 +0,0 @@ -[BLUE_EXPLOSION] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - - - -[BLUE_EXPLOSION2] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - - -[BLUE_EXPLOSION_SMALL] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=0; - dir=-45 r90,-45 r90,-45 r90; - width=0.5; - length=0.5; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=0; - ttl=2; - alpha=0.4; - expansionSpeed=1 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=0; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 0.2; - sizeGrowth = 1; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=0; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 0.2; - sizeGrowth = 1; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=randdots; - - colorMap =0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 1; - particleLifeSpread = 2; - numParticles = 16; - particleSpeed = 1; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 1; - particleLifeSpread = 2; - numParticles = 16; - particleSpeed = 1; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/BURNTEAL.tdf b/Gamedata/explosions/BURNTEAL.tdf deleted file mode 100644 index 50aca4b1d..000000000 --- a/Gamedata/explosions/BURNTEAL.tdf +++ /dev/null @@ -1,178 +0,0 @@ -[BURNTEALCEG] -{ - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 8; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[BURNTEAL] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=novabg; - heat = 10; - maxheat = 10; - heatFalloff = 1; - - size = 0.2; - sizeGrowth = 8; - - pos = 0, 5, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=3explo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 0.2; - sizeGrowth = 3; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.0 1.0 1.0 0.04 0.2 0.9 0.9 0.01 0.1 0.8 0.8 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 8; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - flashSize = 25; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 1; - ttl = 8; - color = 0, 0.5, 0.5; - } -} diff --git a/Gamedata/explosions/BeamImpact.tdf b/Gamedata/explosions/BeamImpact.tdf deleted file mode 100644 index c7ad79445..000000000 --- a/Gamedata/explosions/BeamImpact.tdf +++ /dev/null @@ -1,106 +0,0 @@ -[BeamImpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 1; - - size = 0.2; - sizeGrowth = 8; - - pos = 0, 5, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=2explo; - heat = 10; - maxheat = 15; - heatFalloff = 2; - - size = 0.2; - sizeGrowth = 4; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 8; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [groundflash] - { - alwaysVisible=1; - ttl = 10; - flashSize = 110; - flashAlpha = 0.5; - - circleGrowth = 4; - circleAlpha = 0.2; - - color = 0.5, 0, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/BigBulletImpact.tdf b/Gamedata/explosions/BigBulletImpact.tdf deleted file mode 100644 index 4f607e3ab..000000000 --- a/Gamedata/explosions/BigBulletImpact.tdf +++ /dev/null @@ -1,258 +0,0 @@ -[BigBulletImpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/BulletImpact.tdf b/Gamedata/explosions/BulletImpact.tdf deleted file mode 100644 index 7569b6bdd..000000000 --- a/Gamedata/explosions/BulletImpact.tdf +++ /dev/null @@ -1,93 +0,0 @@ -[BulletImpact] -{ - - [pillar] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 15; - maxheat = 15; - heatFalloff = 2.5; - - size = 20; - sizeGrowth = -1; - - pos = 0,1, 0; - speed=0, 0, 0; - } - air=1; - count=3; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.3; - ageSpeed=0.15; - - size = 10; - sizeGrowth = 0; - - pos = 0,-1 i4,0; - speed=0, 5, 0; - } - air=1; - ground=1; - count=2; - } - - [dirt01] - { - class=dirt; - - [properties] - { - size=10; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed=r1.5 r-1.5, 1.7, r1.5 r-1.5; - pos=r-5 r5, 0, r-5 r5; - } - ground=1; - count=3; - } - - [dirtw03] - { - class=dirt; - - [properties] - { - size = 7; - color = 0.7, 0.7, 1.0; - alphaFalloff = 2; - speed = r1.5 r-1.5, 1.7, r1.5 r-1.5; - pos = r-5 r5, 0, r-5 r5; - } - water=1; - count=5; - } - - - [dirt03] - { - class=dirt; - - [properties] - { - size=10; - color=0.5, 0.5, 0.2; - alphaFalloff=2; - speed=r1.5 r-1.5, 1.7, r1.5 r-1.5; - pos=r-5 r5, 0, r-5 r5; - } - air=1; - count=2; - } -} diff --git a/Gamedata/explosions/BulletImpact2.tdf b/Gamedata/explosions/BulletImpact2.tdf deleted file mode 100644 index b03aa654c..000000000 --- a/Gamedata/explosions/BulletImpact2.tdf +++ /dev/null @@ -1,260 +0,0 @@ - -[BulletImpact2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=5; - particleSpeedSpread=1; - particleSize=7; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=3; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 6; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/BulletImpact3.tdf b/Gamedata/explosions/BulletImpact3.tdf deleted file mode 100644 index 92e1f8699..000000000 --- a/Gamedata/explosions/BulletImpact3.tdf +++ /dev/null @@ -1,260 +0,0 @@ - -[BulletImpact3] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=newboom; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=5; - particleSpeedSpread=1; - particleSize=7; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=3; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 40; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 2; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/BulletImpactBlue.tdf b/Gamedata/explosions/BulletImpactBlue.tdf deleted file mode 100644 index 8897f4e01..000000000 --- a/Gamedata/explosions/BulletImpactBlue.tdf +++ /dev/null @@ -1,260 +0,0 @@ - -[BulletImpactBlue] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=newboom; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=5; - particleSpeedSpread=1; - particleSize=7; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=3; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=5; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 6; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/COMM_EXPLOSION.tdf b/Gamedata/explosions/COMM_EXPLOSION.tdf deleted file mode 100644 index f09adec44..000000000 --- a/Gamedata/explosions/COMM_EXPLOSION.tdf +++ /dev/null @@ -1,122 +0,0 @@ -[COMM_EXPLOSION] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 37; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 30; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=5; - } - - [dirt2] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=3; - sizeMod=1.0; - - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0.2, 0; - - colorMap=1 1 1 0.01 0.5 0.3 0.0 0.05 0.5 0.5 0.5 1.0 0 0 0 0.01; - Texture=dirt; - - airdrag=0.9; - - particleLife=70; - particleLifeSpread=0; - - numParticles=50; - - particleSpeed=5; - particleSpeedSpread=57; - particleSize=100; - particleSizeSpread=10; - - emitRot=90; - emitRotSpread=10; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/COMM_EXPLOSIONA.tdf b/Gamedata/explosions/COMM_EXPLOSIONA.tdf deleted file mode 100644 index b5f646849..000000000 --- a/Gamedata/explosions/COMM_EXPLOSIONA.tdf +++ /dev/null @@ -1,192 +0,0 @@ -[COMM_EXPLOSIONA] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 37; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 30; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=10; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 52; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap = 0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 32; - particleSpeed = 64; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF03] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap =0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 32; - particleSpeed = 64; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/ChickenCEGs/blob_fire.tdf b/Gamedata/explosions/ChickenCEGs/blob_fire.tdf new file mode 100644 index 000000000..7f71a7bbd --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/blob_fire.tdf @@ -0,0 +1,56 @@ +[blob_fire] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddropwhite; + colorMap=0 0.6 0.6 1 0.3 0.6 0.6 0.4 0.85 0.6 0.6 0; + airdrag=.96; + particleLife=18; + particleLifeSpread=8; + numParticles=2; + particleSpeed=1; + particleSpeedSpread=2; + particleSize=9; + particleSizeSpread=4; + emitRot=0; + emitRotSpread=30; + directional=1; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=0.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblastwhite; + colorMap=0.85 0.6 0.6 1 0 0.6 0.6 0.4 0 0 0 0; + airdrag=.9; + particleLife=14; + particleLifeSpread=2; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=6; + particleSizeSpread=5; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +} diff --git a/Gamedata/explosions/ChickenCEGs/blob_trail.tdf b/Gamedata/explosions/ChickenCEGs/blob_trail.tdf new file mode 100644 index 000000000..1336bb199 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/blob_trail.tdf @@ -0,0 +1,115 @@ +[blob_trail] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.2; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddropwhite; + colorMap=0.2 0.5 0.9 1 0.3 0.6 0.8 0.3 0.4 0.7 0.7 0; + airdrag=.96; + particleLife=2; + particleLifeSpread=4; + numParticles=2; + particleSpeed=1; + particleSpeedSpread=2; + particleSize=6; + particleSizeSpread=3; + emitRot=0; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.35; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblastwhite; + colorMap=0.4 0.7 1 1 0.3 0.6 0.8 0.3 0.4 0.7 0.7 0; + airdrag=.9; + particleLife=2; + particleLifeSpread=3; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=3; + particleSizeSpread=6; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +} + + +[blood_trail] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.2; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddrop; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.96; + particleLife=2; + particleLifeSpread=4; + numParticles=2; + particleSpeed=1; + particleSpeedSpread=2; + particleSize=6; + particleSizeSpread=9; + emitRot=0; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.35; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblast; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.9; + particleLife=2; + particleLifeSpread=3; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=3; + particleSizeSpread=6; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +} + diff --git a/Gamedata/explosions/ChickenCEGs/blood_explode.tdf b/Gamedata/explosions/ChickenCEGs/blood_explode.tdf new file mode 100644 index 000000000..7d544c7a1 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/blood_explode.tdf @@ -0,0 +1,234 @@ +[blood_explode] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddrop; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.96; + particleLife=12; + particleLifeSpread=8; + numParticles=5; + particleSpeed=3; + particleSpeedSpread=6; + particleSize=24; + particleSizeSpread=16; + emitRot=0; + emitRotSpread=80; + directional=1; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=3; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblast; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.9; + particleLife=16; + particleLifeSpread=0; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=24; + particleSizeSpread=16; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +/* [groundflash] + { + flashSize = 96; // flash size + flashAlpha = .6; // initial alpha of the flash + circleGrowth = 9; // size increase/frame + circleAlpha = .4; // initial alpha of the ring + ttl = 16; // number of frames + color = .2,.4,.9; // color RGB + }*/ +} + +[control_explode] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddrop; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.96; + particleLife=12; + particleLifeSpread=8; + numParticles=5; + particleSpeed=3; + particleSpeedSpread=6; + particleSize=24; + particleSizeSpread=16; + emitRot=0; + emitRotSpread=80; + directional=1; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=3; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblast; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.9; + particleLife=16; + particleLifeSpread=0; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=24; + particleSizeSpread=16; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } + + [MOREDOTS] + { + class=CSimpleParticleSystem; + + [properties] + { + Texture=randdots; + + colorMap = 0.5 0.05 0.05 0.05 0.3 0.05 0.05 0.01 0.1 0.00 0.00 0.01; + + pos = 0, 2, 0; + gravity = 0, -0.1, 0; + emitVector = 0, 1, 0; + emitRot = 45; + emitRotSpread = 32; + + sizeGrowth = 0.5; + sizeMod = 1; + + airdrag = 0.8; + particleLife = 5; + particleLifeSpread = 12; + numParticles = 16; + particleSpeed = 10; + particleSpeedSpread = 6; + particleSize = 15; + particleSizeSpread = 10; + + directional = 1; + useAirLos = 0; + } + air=1; + ground=1; + count=1; + } + + [ongoingblood] + { + class=CExpGenSpawner; + [properties] + { + pos=15 r-30, 0, 15 r-30; + delay=20 r300; + explosionGenerator=custom:LITTLE_BLOOD_SPLASH; + } + air=1; + water=1; + ground=1; + count=25; + } + +} + + +[LITTLE_BLOOD_SPLASH] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddrop; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.96; + particleLife=6; + particleLifeSpread=12; + numParticles=2; + particleSpeed=3; + particleSpeedSpread=6; + particleSize=6; + particleSizeSpread=12; + emitRot=0; + emitRotSpread=80; + directional=1; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=3; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblast; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=.9; + particleLife=8; + particleLifeSpread=0; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=8; + particleSizeSpread=16; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +} + + diff --git a/Gamedata/explosions/ChickenCEGs/blood_explode_blue.tdf b/Gamedata/explosions/ChickenCEGs/blood_explode_blue.tdf new file mode 100644 index 000000000..8af45508f --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/blood_explode_blue.tdf @@ -0,0 +1,65 @@ +[blood_explode_blue] +{ + [splashes] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=-.1; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=blooddropwhite; + colorMap=0 0.6 0.6 1 0 0.6 0.6 1 0 0 0 0; + airdrag=.96; + particleLife=12; + particleLifeSpread=8; + numParticles=5; + particleSpeed=1.5; + particleSpeedSpread=3; + particleSize=12; + particleSizeSpread=8; + emitRot=0; + emitRotSpread=80; + directional=1; + } + air=1; + ground=1; + } + + [pop] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=3; + sizemod=1; + pos=0, 1.0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + Texture=bloodblastwhite; + colorMap=0 0.6 0.6 1 0 0.6 0.6 1 0 0 0 0; + airdrag=.9; + particleLife=20; + particleLifeSpread=2; + numParticles=1; + particleSpeed=0; + particleSpeedSpread=0; + particleSize=22; + particleSizeSpread=8; + emitRot=45; + emitRotSpread=30; + directional=0; + } + air=1; + ground=1; + } +/* [groundflash] + { + flashSize = 96; // flash size + flashAlpha = .6; // initial alpha of the flash + circleGrowth = 9; // size increase/frame + circleAlpha = .4; // initial alpha of the ring + ttl = 16; // number of frames + color = .2,.4,.9; // color RGB + }*/ +} diff --git a/Gamedata/explosions/ChickenCEGs/blood_spray.tdf b/Gamedata/explosions/ChickenCEGs/blood_spray.tdf new file mode 100644 index 000000000..296890427 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/blood_spray.tdf @@ -0,0 +1,51 @@ +[blood_spray] +{ + +/* [splash] + { + class=CSimpleParticleSystem; + [properties] { + sizegrowth=4; + sizemod=1; + pos=0, 1.0, 0; + emitVector=dir; + gravity=0, 0, 0; + Texture=bloodsplat; + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + airdrag=1; + particleLife=12; + particleLifeSpread=2; + numParticles=2; + particleSpeed=10; + particleSpeedSpread=2; + particleSize=2; + particleSizeSpread=1; + emitRot=0; + emitRotSpread=40; + directional=1; + } + air=1; + water=1; + ground=0; + }*/ + [flare] + { + class = CBitmapMuzzleFlame; + + [properties] + { + colorMap=1 1 1 1 1 1 1 1 0 0 0 0; + size=1; + length=2; + sizeGrowth=16; + ttl=18; + frontOffset=0; + sideTexture=bloodsplat; + frontTexture=bloodsplat; + dir=-1 r2, -1 r2, -1 r2; + } + water=1; + air=1; + ground=0; + } +} diff --git a/Gamedata/explosions/ChickenCEGs/chickenh5.tdf b/Gamedata/explosions/ChickenCEGs/chickenh5.tdf new file mode 100644 index 000000000..db65ada66 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/chickenh5.tdf @@ -0,0 +1,40 @@ +[BRAIN_SPHERE_EMIT] +{ + [nanodecay] + { + class=CSimpleParticleSystem; + + [properties] + { + alwaysVisible=0; + Texture=nanoball; + + colorMap = 0.5 0 0 0.0001 0.5 0.0 0.0 0.0001 0.5 0.0 0.0 0.7 0.3 0.0 0.0 0.5 0.2 0.0 0.0 0.001; + + pos = 10 r-20, 0, 10 r-20; + gravity = 0, 0.1, 0; + emitVector = 0, 1, 0; + emitRot = 16; + emitRotSpread = 16; + + sizeGrowth = -0.01; + sizeMod = 1; + + airdrag = 0.8; + particleLife = 5; + particleLifeSpread = 18; + numParticles = 1; + particleSpeed = 1; + particleSpeedSpread = 3; + particleSize = 4; + particleSizeSpread = 8; + + directional = 1; + useAirLos = 0; + } + air=1; + unit=1; + ground=1; + count=3; + } +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/chickenspike-sparks-burn.lua b/Gamedata/explosions/ChickenCEGs/chickenspike-sparks-burn.lua new file mode 100644 index 000000000..28d47ab49 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/chickenspike-sparks-burn.lua @@ -0,0 +1,409 @@ +-- chickenspike-small-sparks-burn +-- chickenspike-medium-sparks-burn +-- chickenspike-large-sparks-burn + +return { + ["chickenspike-small-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 0, 0]], + texture = [[flare-chickens]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[randomdots-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot-chickens]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake-chickens]], + useairlos = false, + }, + }, + }, + + ["chickenspike-medium-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[flare-chickens]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[randomdots-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot-chickens]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake-chickens]], + useairlos = false, + }, + }, + }, + + ["chickenspike-large-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[flare-chickens]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 7, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot-chickens]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake-chickens]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ChickenCEGs/chickentrails.tdf b/Gamedata/explosions/ChickenCEGs/chickentrails.tdf new file mode 100644 index 000000000..0cbdb0f69 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/chickentrails.tdf @@ -0,0 +1,140 @@ +[DODOTRAIL] +{ + usedefaultexplosions=1; + [rocks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0,0,0; + colorMap= 0 0 0 0.01 0.9 0.9 0 0.05 0.9 0.9 0 0.1 0.9 0.9 0 0.15 0.9 0.9 0 0.2 0.9 0.9 0 0.25 0.8 0.8 0.1 0.3 0.7 0.7 0.2 0.4 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0 0 0 0.01; + texture=fireball; + airdrag=0.95; + particleLife=5; + particleLifeSpread=15; + numParticles=1; + particleSpeed=5; + particleSpeedSpread=2; + particleSize=15; + particleSizeSpread=5; + directional=1; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } + [smokey] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + colorMap=0 0 0 0 0 0 0 0 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0.01; + texture=graysmoke; + airdrag=0.95; + particleLife=35; + particleLifeSpread=45; + numParticles=1; + particleSpeed=6; + particleSpeedSpread=1; + particleSize=20; + particleSizeSpread=15; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } +} + + +[ANGRYLOBBERTRAIL] +{ + [unit_sparkles] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=1.25; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, -1, 0; + gravity=0,0,0; + colorMap=0 0 0 0 0.5 0.5 0.5 0.2 0.8 0.8 0.8 0.4 0.3 0.3 0.3 0.2 0.1 0.1 0.1 0.1 0 0 0 0.01; + texture=lightb2; + airdrag=0.95; + particleLife=6; + particleLifeSpread=3; + numParticles=1; + particleSpeed=2; + particleSpeedSpread=2; + particleSize=5; + particleSizeSpread=30; + directional=1; + emitRot=0; + emitRotSpread=270; + } + air=1; + water=1; + ground=1; + unit=1; + count=2; + } + +} + + +[CHICKENHERO] +{ + [fireworks] + { + class=CSimpleParticleSystem; + + [properties] + { + alwaysVisible=0; + Texture=nanoball; + + colorMap = 0.9 0 0 0.2 0.8 0.0 0.0 0.4 0.7 0.0 0.0 0.7 0.6 0.0 0.0 0.4 0.5 0.0 0.0 0.001; + + pos = 0, 0, 0; + gravity = 0, -0.3, 0; + emitVector = 0, 1, 0; + emitRot = 45; + emitRotSpread = 32; + + sizeGrowth = -0.02; + sizeMod = 1; + + airdrag = 0.95; + particleLife = 8; + particleLifeSpread = 14; + numParticles = 1; + particleSpeed = 1; + particleSpeedSpread = 5; + particleSize = 2; + particleSizeSpread = 5; + + directional = 1; + useAirLos = 0; + } + air=1; + unit=1; + ground=1; + count=1; + } + +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/chickenunitexplosion-red.lua b/Gamedata/explosions/ChickenCEGs/chickenunitexplosion-red.lua new file mode 100644 index 000000000..6faa284ec --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/chickenunitexplosion-red.lua @@ -0,0 +1,527 @@ +-- chickenunitexplosion-small-red +-- chickenunitexplosion-medium-red +-- chickenunitexplosion-large-red + +return { + ["chickenunitexplosion-small-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare-chickens]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[bloodblast]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + flashalpha = 0.5, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2-chickens]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, + + ["chickenunitexplosion-medium-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare-chickens]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[bloodblast]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2-chickens]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, + + ["chickenunitexplosion-large-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare-chickens]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[bloodblast]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke-chickens]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake-chickens]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2-chickens]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[bloodblast]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ChickenCEGs/emg.tdf b/Gamedata/explosions/ChickenCEGs/emg.tdf new file mode 100644 index 000000000..f7f6434bb --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/emg.tdf @@ -0,0 +1,344 @@ +[brawlermuzzle] +{ + [BitmapMuzzleFlame] + { + class = CBitmapMuzzleFlame; + + [properties] + { + dir = dir; + colorMap=1 1 0 0.01 1 0.5 0 0.01 0 0 0 0.01; + size=12; + length=18; + sizeGrowth=1; + ttl=3; + frontOffset=0.1; + sideTexture=plasma2; + frontTexture=flowerflash; + } + water=1; + air=1; + underwater=1; + ground=1; + count=1; + } + [GROUNDFLASH] + { + flashsize=35; + flashalpha=0.9; + circlegrowth=0; + circlealpha=1; + ttl=3; + color=1,0.7,0; + } +} + +[BRAWLIMPACTS] +{ + usedefaultexplosions=0; + [GROUNDFLASH] + { + flashsize=12; + flashalpha=0.9; + circlegrowth=0; + circlealpha=1; + ttl=3; + color=1,0.7,0; + } + [sparks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0; + sizeMod=1.0; + pos=0, 1, 0; + emitVector=dir; + gravity=0, -0.4, 0; + colorMap=1 1 0 0.01 1 1 0 0.01 1 0.5 0 0.01 0 0 0 0.01; + Texture=plasma; + airdrag=0.97; + particleLife=14; + particleLifeSpread=0; + numParticles=4; + particleSpeed=5; + particleSpeedSpread=10; + particleSize=6; + particleSizeSpread=0; + emitRot=0; + emitRotSpread=90; + directional=1; + } + air=1; + water=1; + ground=1; + count=1; + + } +} + +[flashplosion] +{ + usedefaultexplosions=0; + [GROUNDFLASH] + { + flashsize=12; + flashalpha=0.9; + circlegrowth=0; + circlealpha=1; + ttl=3; + color=1,0.7,0; + } + [sparks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0; + sizeMod=1.0; + pos=0, 1, 0; + emitVector=dir; + gravity=0, -0.2, 0; + colorMap=1 1 0 0.01 1 1 0 0.01 1 0.5 0 0.01 0 0 0 0.01; + Texture=plasma; + airdrag=0.97; + particleLife=7; + particleLifeSpread=0; + numParticles=4; + particleSpeed=3; + particleSpeedSpread=4; + particleSize=6; + particleSizeSpread=0; + emitRot=0; + emitRotSpread=40; + directional=1; + } + air=1; + water=1; + ground=1; + count=1; + + } +} + + +[emg_shells_l] +{ + usedefaultexplosions=0; + [shells] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=dir; + gravity=0, -0.5, 0; + colorMap=1 1 1 1 1 1 1 1; + Texture=shell; + airdrag=0.97; + particleLife=15; + particleLifeSpread=0; + numParticles=1; + particleSpeed=3; + particleSpeedSpread=0; + particleSize=2.5; + particleSizeSpread=0; + emitRot=0; + emitRotSpread=10; + directional=1; + } + air=1; + water=1; + ground=1; + count=1; + + } +} + +[emg_shells_m] +{ + usedefaultexplosions=0; + [shells] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=dir; + gravity=0, -0.5, 0; + colorMap=1 1 1 1 1 1 1 1; + Texture=shell; + airdrag=0.97; + particleLife=45; + particleLifeSpread=0; + numParticles=1; + particleSpeed=3; + particleSpeedSpread=0; + particleSize=2.5; + particleSizeSpread=0; + emitRot=0; + emitRotSpread=10; + directional=1; + } + air=1; + water=1; + ground=1; + count=1; + + } +} + +[flashmuzzle1] +{ + [BitmapMuzzleFlame] + { + class = CBitmapMuzzleFlame; + + [properties] + { + dir = dir; + colorMap=1 1 1 0.07 1 0.7 0 0.01 0.9 0.3 0 0.01 0 0 0 0.01; + size=12; + length=18; + sizeGrowth=1; + ttl=3; + frontOffset=0; + sideTexture=plasma2; + frontTexture=flowerflash; + } + water=1; + air=1; + underwater=1; + ground=1; + count=1; + } + [GROUNDFLASH] + { + flashsize=35; + flashalpha=0.4; + circlegrowth=0; + circlealpha=1; + ttl=3; + color=1,0.7,0; + } +} + +[EMG_HIT_HE] +{ + usedefaultexplosions=0; + [main]{ + class=heatcloud; + [properties]{ + texture=explo; + heat = 6; + maxheat = 6; + heatFalloff = 1; + + size = 1; + sizeGrowth = 8; + + pos = 0, 1, 0; + speed=0, 1, 0; + } + air=1; + water=1; + ground=1; + count=1; + } + [sparks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0; + sizeMod=1.0; + pos=0, 1, 0; + emitVector=0, 1, 0; + gravity=0, -0.2, 0; + colorMap=1 0.95 0.5 0.01 1 0.95 0.5 0.01 1 0.95 0.5 0.01 0 0 0 0.01; + Texture=plasma; + airdrag=0.97; + particleLife=10; + particleLifeSpread=0; + numParticles=16; + particleSpeed=1; + particleSpeedSpread=6; + particleSize=2; + particleSizeSpread=1; + emitRot=0; + emitRotSpread=90; + directional=1; + } + air=1; + water=1; + ground=1; + count=1; + } + [groundsmoke] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=1; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0.2, 0; + colorMap=1 1 0 1 1 0.25 0 0.8 0 0 0 0.6 0 0 0 0.4 0 0 0 0.2 0 0 0 0; + Texture=smokesmall; + airdrag=0.8; + particleLife=10; + particleLifeSpread=5; + numParticles=1; + particleSpeed=2; + particleSpeedSpread=2; + particleSize=4; + particleSizeSpread=4; + emitRot=0; + emitRotSpread=90; + directional=1; + } + unit=1; + ground=1; + count=3; + } + [watermist]{ + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=1; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0.2, 0; + colorMap=0.75 0.75 1 1 0 0 0 0; + Texture=smokesmall; + airdrag=0.8; + particleLife=10; + particleLifeSpread=5; + numParticles=1; + particleSpeed=2; + particleSpeedSpread=2; + particleSize=4; + particleSizeSpread=4; + emitRot=0; + emitRotSpread=90; + directional=1; + } + water=1; + count=3; + } + [GROUNDFLASH] + { + flashsize=48; + flashalpha=0.25; + circlegrowth=0; + circlealpha=1; + ttl=3; + color=1,0.95,0.5; + } +} diff --git a/Gamedata/explosions/ChickenCEGs/gundam_comm_explosion.tdf b/Gamedata/explosions/ChickenCEGs/gundam_comm_explosion.tdf new file mode 100644 index 000000000..e1dc036f2 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/gundam_comm_explosion.tdf @@ -0,0 +1,122 @@ +[COMM_EXPLOSION] +{ + [pop1] + { + class=heatcloud; + + [properties] + { + alwaysVisible=1; + texture=fireball; + heat = 10; + maxheat = 10; + heatFalloff = 0.4; + + size = 1; + sizeGrowth = 37; + + pos = r-10 r10, 0, r-10 r10; + speed=0, 0, 0; + } + air=1; + water=1; + ground=1; + count=2; + } + + [pop2] + { + class=heatcloud; + + [properties] + { + alwaysVisible=1; + texture=purpleexplo; + heat = 10; + maxheat = 15; + heatFalloff = 0.6; + + size = 1; + sizeGrowth = 30; + + pos = r-150 r150, 0, r-300 r150; + speed=0, 0, 0; + } + air=1; + water=1; + ground=1; + count=5; + } + + [dirt2] + { + class=CSimpleParticleSystem; + [properties] + { + alwaysVisible=1; + sizeGrowth=3; + sizeMod=1.0; + + pos = r-1 r1, r-1 r1, r-1 r1; + emitVector=0, 1, 0; + gravity= 0, 0.2, 0; + + colorMap=1 1 1 0.01 0.5 0.3 0.0 0.05 0.5 0.5 0.5 1.0 0 0 0 0.01; + Texture=dirt; + + airdrag=0.9; + + particleLife=30; + particleLifeSpread=0; + + numParticles=50; + + particleSpeed=5; + particleSpeedSpread=57; + particleSize=60; + particleSizeSpread=10; + + emitRot=90; + emitRotSpread=10; + + directional=1; + useAirLos=1; + } + water=1; + air=1; + ground=1; + count=1; + } + + [dirt] + { + [properties] + { + alwaysVisible=1; + size=20; + color=0.2, 0.1, 0.05; + alphaFalloff=2; + speed= r1.5 r-1.5, 2, r1.5 r-1.5; + pos=r-10 r10, 0, r-10 r10; + } + ground=1; + count=4; + } + + [groundflash] + { + alwaysVisible=1; + ttl = 17; + flashSize = 120; + flashAlpha = 0.9; + + circleGrowth = 8; + circleAlpha = 0.5; + + color = 0.7, 0.0, 0.5; + + air=1; + ground=1; + water=1; + } +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/gundam_electric_explosion.tdf b/Gamedata/explosions/ChickenCEGs/gundam_electric_explosion.tdf new file mode 100644 index 000000000..878735cea --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/gundam_electric_explosion.tdf @@ -0,0 +1,174 @@ +[ELECTRIC_EXPLOSION] +{ + [ELECTRIC1] + { + class=heatcloud; + + [properties] + { + texture=electnovaexplo; + heat = 10; + maxheat = 15; + heatFalloff = 1.1; + + size = 1; + sizeGrowth = 15; + + pos = r-2 r2, 5, r-2 r2; + speed=0, 1 0, 0; + } + air=1; + water=1; + ground=1; + count=3; + } + + [ELECTRIC2] + { + class=heatcloud; + + [properties] + { + texture=flare; + heat = 10; + maxheat = 15; + heatFalloff = 1.3; + + size = 3; + sizeGrowth = 25; + + pos = r-2 r2, 5, r-2 r2; + speed=0, 0, 0; + } + air=1; + water=1; + ground=1; + count=1; + } + + [whiteglow] + { + class=heatcloud; + + [properties] + { + texture=laserend; + heat = 10; + maxheat = 15; + heatFalloff = 1.1; + + size = 10; + sizeGrowth = 20; + + pos = 0, 5, 0; + speed=0, 1 0, 0; + } + air=1; + water=1; + ground=1; + count=2; + } + + [ELECTRICARCS1] + { + class=CSimpleParticleSystem; + + [properties] + { + Texture=lightening; + + colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; + + pos = 0, 2, 0; + gravity = 0, -0.05, 0; + emitVector = 0, 1, 0; + emitRot = 45; + emitRotSpread = 32; + + sizeGrowth = 1; + sizeMod = 1.0; + + airdrag = 0.8; + particleLife = 10; + particleLifeSpread = 5; + numParticles = 14; + particleSpeed = 5; + particleSpeedSpread = 5; + particleSize = 10; + particleSizeSpread = 0; + + directional = 1; + useAirLos = 0; + } + air=1; + ground=1; + count=1; + } + + [MOREDOTS] + { + class=CSimpleParticleSystem; + + [properties] + { + Texture=randdots; + + colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; + + pos = 0, 2, 0; + gravity = 0, -0.1, 0; + emitVector = 0, 1, 0; + emitRot = 45; + emitRotSpread = 32; + + sizeGrowth = 0.5; + sizeMod = 1; + + airdrag = 0.8; + particleLife = 5; + particleLifeSpread = 16; + numParticles = 16; + particleSpeed = 10; + particleSpeedSpread = 3; + particleSize = 25; + particleSizeSpread = 0; + + directional = 1; + useAirLos = 0; + } + air=1; + ground=1; + count=1; + } + + [dirt] + { + [properties] + { + size=20; + color=0.2, 0.1, 0.05; + alphaFalloff=2; + speed= r1.5 r-1.5, 2, r1.5 r-1.5; + pos=r-10 r10, 0, r-10 r10; + } + ground=1; + count=4; + } + + [groundflash] + { + alwaysVisible=1; + ttl = 13; + flashSize = 220; + flashAlpha = 0.9; + + circleGrowth = 6; + circleAlpha = 0.6; + + color = 0.0, 0.5, 1.0; + + air=1; + ground=1; + water=1; + } +} diff --git a/Gamedata/explosions/ChickenCEGs/gundam_missile_explosion.tdf b/Gamedata/explosions/ChickenCEGs/gundam_missile_explosion.tdf new file mode 100644 index 000000000..c75969044 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/gundam_missile_explosion.tdf @@ -0,0 +1,172 @@ +[gundam_MISSILE_EXPLOSION] +{ + [pop1] + { + class=heatcloud; + + [properties] + { + texture=uglynovaexplo; + heat = 10; + maxheat = 15; + heatFalloff = 1.1; + + size = 1; + sizeGrowth = 15; + + pos = r-2 r2, 5, r-2 r2; + speed=0, 1 0, 0; + } + air=1; + water=1; + ground=1; + count=2; + } + + [pop2] + { + class=heatcloud; + + [properties] + { + texture=flare; + heat = 10; + maxheat = 15; + heatFalloff = 1.3; + + size = 3; + sizeGrowth = 25; + + pos = r-2 r2, 5, r-2 r2; + speed=0, 1 0, 0; + } + air=1; + water=1; + ground=1; + count=1; + } + + [POOF01] + { + class=CSimpleParticleSystem; + + [properties] + { + Texture=flashside1; + + colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; + + pos = 0, 2, 0; + gravity = 0, -0.05, 0; + emitVector = 0, 1, 0; + emitRot = 45; + emitRotSpread = 32; + + sizeGrowth = 1; + sizeMod = 1.0; + + airdrag = 0.8; + particleLife = 10; + particleLifeSpread = 5; + numParticles = 8; + particleSpeed = 10; + particleSpeedSpread = 15; + particleSize = 30; + particleSizeSpread = 10; + + directional = 1; + useAirLos = 0; + } + air=1; + ground=1; + count=1; + } + + [dirt] + { + [properties] + { + size=20; + color=0.2, 0.1, 0.05; + alphaFalloff=2; + speed= r1.5 r-1.5, 2, r1.5 r-1.5; + pos=r-10 r10, 0, r-10 r10; + } + ground=1; + count=4; + } + + [groundflash] + { + ttl = 13; + flashSize = 180; + flashAlpha = 0.9; + + circleGrowth = 6; + circleAlpha = 0.6; + + color = 1, 0.5, 0; + + air=1; + ground=1; + water=1; + } +} + +[gundam_MISSILE_EXPLOSION_mod] +{ + [pop2] + { + class=heatcloud; + + [properties] + { + texture=flare; + heat = 10; + maxheat = 15; + heatFalloff = 1.3; + + size = 3; + sizeGrowth = 25; + + pos = r-2 r2, 5, r-2 r2; + speed=0, 1 0, 0; + } + air=1; + water=1; + ground=1; + count=1; + } + + + [dirt] + { + [properties] + { + size=20; + color=0.2, 0.1, 0.05; + alphaFalloff=2; + speed= r1.5 r-1.5, 2, r1.5 r-1.5; + pos=r-10 r10, 0, r-10 r10; + } + ground=1; + count=4; + } + + [groundflash] + { + ttl = 13; + flashSize = 120; + flashAlpha = 0.9; + + circleGrowth = 6; + circleAlpha = 0.6; + + color = 1, 0.5, 0; + + air=1; + ground=1; + water=1; + } +} + diff --git a/Gamedata/explosions/ChickenCEGs/none.tdf b/Gamedata/explosions/ChickenCEGs/none.tdf new file mode 100644 index 000000000..f6a546175 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/none.tdf @@ -0,0 +1,3 @@ +[NONE] +{ +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/nukedatbewm-roost.lua b/Gamedata/explosions/ChickenCEGs/nukedatbewm-roost.lua new file mode 100644 index 000000000..04d2cfba9 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/nukedatbewm-roost.lua @@ -0,0 +1,128 @@ +-- nukedatbewm-roost + +return { + ["nukedatbewm-roost"] = { + alwaysvisible = true, + groundflash = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 2, + flashalpha = 0.5, + flashsize = 2000, + ground = true, + ttl = 300, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof02 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 128, + particlelife = 150, + particlelifespread = 150, + particlesize = 50, + particlesizespread = 1, + particlespeed = 104, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke-chickens]], + useairlos = false, + }, + }, + poof04 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 20, + particlelife = 150, + particlelifespread = 150, + particlesize = 50, + particlesizespread = 1, + particlespeed = 20, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke-chickens]], + useairlos = false, + }, + }, + pop1 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 2, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke-chickens]], + }, + }, + pop2 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 10, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke-chickens]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ChickenCEGs/nuketrail-roost.lua b/Gamedata/explosions/ChickenCEGs/nuketrail-roost.lua new file mode 100644 index 000000000..63cf07f9f --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/nuketrail-roost.lua @@ -0,0 +1,78 @@ +-- nuketrail-roost + +return { + ["nuketrail-roost"] = { + usedefaultexplosions = false, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 120, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.6 0.35 0.2 0.1 0.1 0.1 0.1 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 80, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 4, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 1, + width = 22, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ChickenCEGs/queenspike.tdf b/Gamedata/explosions/ChickenCEGs/queenspike.tdf new file mode 100644 index 000000000..c505f20b3 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/queenspike.tdf @@ -0,0 +1,61 @@ +[QUEENSPIKES] +{ + usedefaultexplosions=1; + [rocks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0,0,0; + colorMap=0 0 0 0.01 0.9 0.9 0 0.05 0.9 0.9 0 0.1 0.9 0.9 0 0.15 0.9 0.9 0 0.2 0.9 0.9 0 0.25 0.8 0.8 0.1 0.3 0.7 0.7 0.2 0.4 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0 0 0 0.01; + texture=fireball; + airdrag=0.95; + particleLife=1; + particleLifeSpread=5; + numParticles=1; + particleSpeed=5; + particleSpeedSpread=2; + particleSize=10; + particleSizeSpread=5; + directional=1; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } + [smokey] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + colorMap=0 0 0 0 0 0 0 0 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0.01; + texture=graysmoke; + airdrag=0.95; + particleLife=5; + particleLifeSpread=15; + numParticles=1; + particleSpeed=6; + particleSpeedSpread=1; + particleSize=15; + particleSizeSpread=15; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/rocktrail.tdf b/Gamedata/explosions/ChickenCEGs/rocktrail.tdf new file mode 100644 index 000000000..f51c1fe1d --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/rocktrail.tdf @@ -0,0 +1,124 @@ +[ROCKTRAIL] +{ + usedefaultexplosions=1; + [rocks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0,0,0; + colorMap=0 0 0 0.01 0.9 0.9 0 0.05 0.9 0.9 0 0.1 0.9 0.9 0 0.15 0.9 0.9 0 0.2 0.9 0.9 0 0.25 0.8 0.8 0.1 0.3 0.7 0.7 0.2 0.4 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0 0 0 0.01; + texture=fireball; + airdrag=0.95; + particleLife=1; + particleLifeSpread=5; + numParticles=1; + particleSpeed=5; + particleSpeedSpread=2; + particleSize=10; + particleSizeSpread=5; + directional=1; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } + [smokey] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + colorMap=0 0 0 0 0 0 0 0 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0.01; + texture=graysmoke; + airdrag=0.95; + particleLife=5; + particleLifeSpread=15; + numParticles=1; + particleSpeed=6; + particleSpeedSpread=1; + particleSize=15; + particleSizeSpread=15; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=3; + } +} + + +[ROCKTRAILsm] +{ + usedefaultexplosions=1; + [rocks] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0,0,0; + colorMap=0 0 0 0.01 0.9 0.9 0 0.05 0.9 0.9 0 0.1 0.9 0.9 0 0.15 0.9 0.9 0 0.2 0.9 0.9 0 0.25 0.8 0.8 0.1 0.3 0.7 0.7 0.2 0.4 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0.5 0.35 0. 0.5 0 0 0 0.01; + texture=fireball; + airdrag=0.95; + particleLife=1; + particleLifeSpread=3; + numParticles=1; + particleSpeed=5; + particleSpeedSpread=2; + particleSize=5; + particleSizeSpread=5; + directional=1; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=5; + } + [smokey] + { + class=CSimpleParticleSystem; + [properties] + { + sizeGrowth=0.05; + sizeMod=1.0; + pos=0, 0, 0; + emitVector=0, 1, 0; + gravity=0, 0, 0; + colorMap=0 0 0 0 0 0 0 0 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.7 0.3 0.3 0.3 0.6 0 0 0 0.01; + texture=graysmoke; + airdrag=0.95; + particleLife=3; + particleLifeSpread=10; + numParticles=1; + particleSpeed=6; + particleSpeedSpread=1; + particleSize=8; + particleSizeSpread=8; + emitRot=10; + emitRotSpread=10; + } + air=1; + water=1; + ground=1; + count=2; + } +} \ No newline at end of file diff --git a/Gamedata/explosions/ChickenCEGs/xta_nano.tdf b/Gamedata/explosions/ChickenCEGs/xta_nano.tdf new file mode 100644 index 000000000..e39a7ea57 --- /dev/null +++ b/Gamedata/explosions/ChickenCEGs/xta_nano.tdf @@ -0,0 +1,24 @@ +[NANO]//Gives better effect +{ + [heatcloud]// Fire burst + { + [properties] + { + heat = 25; + Texture=Light; + maxheat = 25; + heatFalloff = 1.5; + size = 8.0 r1; + sizeGrowth = 0.08 r.16; + sizemod = 0; + sizemodmod = 0; + speed = 0.05 r-0.1, 0.05 r-0.1, 0.05 r-0.1; + pos = 0, 0.0, 0; + } + air=1; + water=0; + ground=1; + count=1; + useAirLos=0; + } +} \ No newline at end of file diff --git a/Gamedata/explosions/ELECTRIC_EXPLOSION.tdf b/Gamedata/explosions/ELECTRIC_EXPLOSION.tdf deleted file mode 100644 index a542e78be..000000000 --- a/Gamedata/explosions/ELECTRIC_EXPLOSION.tdf +++ /dev/null @@ -1,361 +0,0 @@ -[ELECTRIC_EXPLOSION] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 10; - sizeGrowth = 20; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 14; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 3; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 220; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0.0, 0.5, 1.0; - - air=1; - ground=1; - water=1; - } -} - -[ELECTRIC_EXPLOSION_BIG] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 60; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 14; - particleSpeed = 15; - particleSpeedSpread = 15; - particleSize = 30; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 30; - particleSpeedSpread = 9; - particleSize = 75; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 220; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0.0, 0.5, 1.0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/FACTORY_EXPLOSION.tdf b/Gamedata/explosions/FACTORY_EXPLOSION.tdf deleted file mode 100644 index 8e00f2514..000000000 --- a/Gamedata/explosions/FACTORY_EXPLOSION.tdf +++ /dev/null @@ -1,575 +0,0 @@ -[FACTORY_EXPLOSION] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.8; - - size = 5; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff =0.8; - - size = 5; - sizeGrowth = 28; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.05; - - airdrag = 0.8; - particleLife = 9; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 10; - particleSize = 30; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smokeblack] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed= r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0; - } - air=1; - water=1; - ground=1; - count=22; - } - - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap=0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=25; - particleLifeSpread=10; - - numParticles=180; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - - [smokegrey] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.8; - ageSpeed=0.02; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 256; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.3, 0; - - air=1; - ground=1; - water=1; - } - -} - -[FACTORY_EXPLOSION_MEDIUM] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.8; - - size = 2; - sizeGrowth = 7; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff =0.8; - - size = 2; - sizeGrowth = 14; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.05; - - airdrag = 0.8; - particleLife = 9; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 15; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smokeblack] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 5; - sizeExpansion = 0.3; - size = 25; - sizeGrowth = 7; - - pos = r-60 r60, 24, r-60 r60; - speed= r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0; - } - air=1; - water=1; - ground=1; - count=22; - } - - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap=0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=25; - particleLifeSpread=10; - - numParticles=180; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=7; - particleSizeSpread=3; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - - [smokegrey] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.8; - ageSpeed=0.02; - - startSize = 5; - sizeExpansion = 0.3; - size = 25; - sizeGrowth = 7; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 10; - flashSize = 128; - flashAlpha = 0.9; - - circleGrowth = 3; - circleAlpha = 0.6; - - color = 1, 0.3, 0; - - air=1; - ground=1; - water=1; - } - -} - -[FACTORY_EXPLOSION_SMALL] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 4; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff =0.8; - - size = 1; - sizeGrowth = 7; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.05; - - airdrag = 0.8; - particleLife = 9; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 2.5; - particleSpeedSpread = 2.5; - particleSize = 7; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smokeblack] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 2.5; - sizeExpansion = 0.2; - size = 12; - sizeGrowth = 4; - - pos = r-60 r60, 24, r-60 r60; - speed= r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0; - } - air=1; - water=1; - ground=1; - count=22; - } - - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap=0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=25; - particleLifeSpread=10; - - numParticles=180; - - particleSpeed=1; - particleSpeedSpread=2.5; - particleSize=4; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - - [smokegrey] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color = 0.8; - ageSpeed=0.02; - - startSize = 2.5; - sizeExpansion = 0.2; - size = 12; - sizeGrowth = 4; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 5; - flashSize = 66; - flashAlpha = 0.9; - - circleGrowth = 2; - circleAlpha = 0.6; - - color = 1, 0.3, 0; - - air=1; - ground=1; - water=1; - } - -} diff --git a/Gamedata/explosions/GD LASER Explosions.tdf b/Gamedata/explosions/GD LASER Explosions.tdf deleted file mode 100644 index d8719e686..000000000 --- a/Gamedata/explosions/GD LASER Explosions.tdf +++ /dev/null @@ -1,38 +0,0 @@ -//LASER Weapons - -[LASER] -{ - [smoke] - { - [properties] - { - color = 0.8 r0.2; - startSize = 0.5; - sizeExpansion = 0.25; - ageSpeed=0.03; - size = 0.5; - sizeGrowth = -0.75; - pos = 5 r-5, 5 r-5, 5 r-5; - speed=0, 0.6 r0.3, 0; - } - air=1; - water=1; - ground=1; - count=2; - } -[groundflash] - { - flashSize = 3; - flashAlpha = 0.9; - circleGrowth = 0; - circleAlpha = 0; - ttl = 15; - color = 1, 0.25, 0.5; - air=1; - ground=1; - water=1; - } -} - - - diff --git a/Gamedata/explosions/Game FX.tdf b/Gamedata/explosions/Game FX.tdf deleted file mode 100644 index 42d05ed3e..000000000 --- a/Gamedata/explosions/Game FX.tdf +++ /dev/null @@ -1,436 +0,0 @@ - -[ffmuzzle] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 0 0.01 1 0.5 0 0.01 0 0 0 0.01; - size=12; - length=18; - sizeGrowth=1; - ttl=3; - frontOffset=0.1; - sideTexture=shot; - frontTexture=randdots; - airlos=0; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[surfacesplash] -{ - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=randdots; - sizeGrowth=0.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.5; - - particleLife=22; - particleLifeSpread=8; - - numParticles=6; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=3; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=0.4; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=5; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=4; - particleSize=4; - particleSizeSpread=3; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } -} - -[upwelling] -{ - [pillar] - { - class=heatcloud; - - [properties] - { - texture=LightningStrike; - heat = 15; - maxheat = 15; - heatFalloff = 2.5; - - size = 10; - sizeGrowth = -1; - - pos = 0,-10 i5, 0; - speed=0, 5, 0; - } - air=1; - water=1; - ground=1; - count=7; - } -} - - -[jetstrail] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01; - size=7; - length=15; - sizeGrowth=1; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[jetmtrail] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01; - size=7; - length=15; - sizeGrowth=1; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[airfactoryhtrail] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01; - size=15; - length=25; - sizeGrowth=2; - ttl=3; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[jethtrail] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01; - size=7; - length=25; - sizeGrowth=2; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - - -[jetbtrail] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01 0 0 0 0.01; - size=7; - length=25; - sizeGrowth=2; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - - -[nanoflame] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.5 0.7 0.6 0.01 0.2 0.9 0.5 0.01 0 0 0 0.01; - size=3; - length=60; - sizeGrowth=1.2; - ttl=40; - frontOffset=0.05; - sideTexture=flashside2; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[nanoflamepurple] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.7 0.1 0.7 0.01 0.9 0.4 0.9 0.01 0 0 0 0.01; - size=3; - length=10; - sizeGrowth=2; - ttl=2; - frontOffset=0.05; - sideTexture=flashside2; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - - -[missilepoofs] -{ - [smoke] - { - [properties] - { - dir = dir; - color = 0.8 r0.2; - ageSpeed=0.15; - - size = 25; - sizeGrowth = -1.5; - - - } - air=1; - water=1; - ground=1; - count=10; - } -} - -[reactionalien] -{ - [heatcloud] - { - [properties] - { - texture=PlasmaHeatDB; - heat = 20; - maxheat = 25; - heatFalloff = 1; - size = 1.5; - sizeGrowth = 0.2; - sizemod = 0; - sizemodmod = 0; - speed = r-0.25 r0.25, r-0.25 r0.25, r-0.25 r0.25; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - -} - -[reactionalien2] -{ - [heatcloud] - { - [properties] - { - texture=PlasmaHeatDB; - heat = 20; - maxheat = 25; - heatFalloff = 1; - size = 3.5; - sizeGrowth = -0.2; - sizemod = 0; - sizemodmod = 0; - speed = r-0.1 r0.1, r-0.1 r0.1, r-0.1 r0.1; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } -} - -[reactionalien3] -{ - [heatcloud] - { - [properties] - { - texture=PlasmaHeatDB; - heat = 20; - maxheat = 25; - heatFalloff = 1; - size = 2.5; - sizeGrowth = 0.125; - sizemod = 0; - sizemodmod = 0; - speed = r-1.25 r1.25, r-1.25 r1.25, r-1.25 r1.25; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } -} - -[reactionalien4] -{ - [heatcloud] - { - [properties] - { - texture=PlasmaHeatDB; - heat = 20; - maxheat = 25; - heatFalloff = 1; - size = 6; - sizeGrowth = 0.125; - sizemod = 0; - sizemodmod = 0; - speed = r-0.65 r0.65, r-0.65 r0.65, r-0.65 r0.65; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - -} diff --git a/Gamedata/explosions/HeavyBulletImpact.tdf b/Gamedata/explosions/HeavyBulletImpact.tdf deleted file mode 100644 index 533c87e90..000000000 --- a/Gamedata/explosions/HeavyBulletImpact.tdf +++ /dev/null @@ -1,178 +0,0 @@ -[HeavyBulletImpact] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 5; - - size = 1; - sizeGrowth = 20; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=3; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=7; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.0 0.55 0.5 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/MEDMECHPOP.tdf b/Gamedata/explosions/MEDMECHPOP.tdf deleted file mode 100644 index a74dfcddd..000000000 --- a/Gamedata/explosions/MEDMECHPOP.tdf +++ /dev/null @@ -1,154 +0,0 @@ -[MEDMECHPOP] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.5; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color=1, 0.3, 0.5; - } - ground=1; - air=1; - count=1; - } - - [pop0] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.7; - size = 20; - sizeGrowth = 15; - - pos = 0, 5, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purpleexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.1, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 40; - particleSpeed = 19; - particleSpeedSpread = 10; - particleSize = 15; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 12; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 10; - circleAlpha = 0.7; - - color = 1, 0.3, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/MISSILE_EXPLOSION.tdf b/Gamedata/explosions/MISSILE_EXPLOSION.tdf deleted file mode 100644 index 0cce76361..000000000 --- a/Gamedata/explosions/MISSILE_EXPLOSION.tdf +++ /dev/null @@ -1,119 +0,0 @@ -[MISSILE_EXPLOSION] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/POWERPLANT_EXPLOSION.tdf b/Gamedata/explosions/POWERPLANT_EXPLOSION.tdf deleted file mode 100644 index 5a86c0c4b..000000000 --- a/Gamedata/explosions/POWERPLANT_EXPLOSION.tdf +++ /dev/null @@ -1,452 +0,0 @@ -[POWERPLANT_EXPLOSION] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 10; - sizeGrowth = 25; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 7; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 50; - flashSize = 220; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[POWERPLANT_EXPLOSION_MEDIUM] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 10; - sizeGrowth = 25; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 7; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 80; - flashSize = 220; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.2, 0; - - air=1; - ground=1; - water=1; - } -} - -[POWERPLANT_EXPLOSION_BIG] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 75; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 120; - flashSize = 400; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0.0, 0.5, 1.0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/Steam.lua b/Gamedata/explosions/Steam.lua new file mode 100644 index 000000000..720b86f49 --- /dev/null +++ b/Gamedata/explosions/Steam.lua @@ -0,0 +1,35 @@ + + +return { + ["steam"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = false, + colormap = [[0.5 0.5 0.5 1.0 0.7 0.7 0.7 1.0 0.9 0.9 0.9 1.0 0.9 0.9 0.9 0.5 0.9 0.9 0.9 0.1 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 4, + particlelife = 60, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 2, + particlespeed = 0.5, + particlespeedspread = 12, + sizegrowth = 1, + sizemod = 0.9, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, +} + diff --git a/Gamedata/explosions/Unit Muzzle Flash.tdf b/Gamedata/explosions/Unit Muzzle Flash.tdf deleted file mode 100644 index 07fda5501..000000000 --- a/Gamedata/explosions/Unit Muzzle Flash.tdf +++ /dev/null @@ -1,836 +0,0 @@ -[hellfireflare] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.1 0.7 1 0.1 1 0.2 0.01 0.01 0 0 0 0.01; - size=5; - length=28; - sizeGrowth=-1; - ttl=1; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gunshipcannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=12; - length=28; - sizeGrowth=-1; - ttl=1; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[emgcannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=5; - length=28; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdscannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=12; - length=28; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdmcannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=16; - length=34; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdhcannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.4 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=18; - length=60; - sizeGrowth=-1; - ttl=1; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } - - [front_muzzlesmoke] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 3; - emitVector=dir; - gravity=0, 0.05, 0; - colorMap=1 0.8 0.6 0.01 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.2 0 0 0 0.001 0 0 0 0.001; - Texture=smoke; - airdrag=0.8; - particleLife=70; - particleLifeSpread=5; - numParticles=4; - particleSpeed=2; - particleSpeedSpread=6; - particleSize=6; - particleSizeSpread=0.6; - emitRot=0; - emitRotSpread=10; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [exhaustsmoke] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.05; - sizeMod=1.0; - pos=0, 1, 3; - emitVector=dir; - gravity= 0.05 r-0.1, 0.05 r-0.1, 0.05 r-0.1; - colorMap=1 0.8 0.6 0.01 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.2 0 0 0 0.001 0 0 0 0.001; - Texture=smoke; - airdrag=0.8; - particleLife=62; - particleLifeSpread=0; - numParticles=3; - particleSpeed=-5; - particleSpeedSpread=-2; //12 - particleSize=6; - particleSizeSpread=2; - emitRot=0; - emitRotSpread=20; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[gdsflak] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.4 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=10; - length=20; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=flash2; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdmflak] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.4 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=11; - length=24; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=flash2; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdsarty] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=18; - length=40; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdmarty] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=22; - length=44; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdharty] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=25; - length=50; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdminigun] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=8; - length=20; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shot; - frontTexture=flash1; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdsion] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01; - size=20; - length=30; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdmion] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01; - size=30; - length=40; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[gdhion] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01; - size=40; - length=50; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urcsplasma] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.2 1 0.2 0.01 0.2 1 0.3 0.01 0 0 0 0.01; - size=13; - length=18; - sizeGrowth=-1; - ttl=10; - frontOffset=0; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urcmplasma] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.2 1 0.2 0.01 0.2 1 0.4 0.01 0 0 0 0.01; - size=17; - length=23; - sizeGrowth=-1; - ttl=10; - frontOffset=0; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urchplasma] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.2 1 0.2 0.01 0.2 1 0.7 0.01 0 0 0 0.01; - size=20; - length=28; - sizeGrowth=-1; - ttl=10; - frontOffset=0; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urcmortor] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.5 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=20; - length=36; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urcscannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=12; - length=28; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[urcmcannon] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01; - size=15; - length=35; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[alienburst] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=0.0 0.3 0.9 0.01 0.0 0.1 0.9 0.01 0 0 0 0.01; - size=20; - length=30; - sizeGrowth=-1; - ttl=15; - frontOffset=0; - sideTexture=pulseshot; - frontTexture=beamrifletip; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[rocketlaunch] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 6; - - sizeGrowth = 0.1; - sizeMod = 1.00; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 2; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 2; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} - -[rocketlaunchsam] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 6; - - sizeGrowth = 0.1; - sizeMod = 1.00; - - airdrag = 0.8; - particleLife = 15; - particleLifeSpread = 2; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} - -[rocketlaunchmed] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 6; - - sizeGrowth = 0.1; - sizeMod = 1.00; - - airdrag = 0.8; - particleLife = 12; - particleLifeSpread = 3; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} - -[rocketlaunchhev] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 6; - - sizeGrowth = 0.1; - sizeMod = 1.00; - - airdrag = 0.8; - particleLife = 14; - particleLifeSpread = 3; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 4; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} - -[rocketlaunchback] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 10; - emitRotSpread = 20; - - sizeGrowth = 0.3; - sizeMod = 1.00; - - airdrag = 0.8; - particleLife = 12; - particleLifeSpread = 4; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} diff --git a/Gamedata/explosions/VERT_EXPLOSION.tdf b/Gamedata/explosions/VERT_EXPLOSION.tdf deleted file mode 100644 index 9adcfa311..000000000 --- a/Gamedata/explosions/VERT_EXPLOSION.tdf +++ /dev/null @@ -1,127 +0,0 @@ -[VERT_EXPLOSION] -{ - -[pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - -[pillar0] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bigexplo; - heat = 15; - maxheat = 15; - heatFalloff = 1.5; - - size = 90; - sizeGrowth = -11; - - pos = 0,-100 i18, 0; - speed=0, 25, 0; - } - air=1; - water=1; - ground=1; - count=8; - } - -[POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 15; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -[smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.3; - ageSpeed=0.02; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 15, r-60 r60; - speed=r-3 r3, 2.5 r1.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - -[groundflash] - { - alwaysVisible=1; - ttl = 30; - flashSize = 500; - flashAlpha = 0.9; - - circleGrowth = 25; - circleAlpha = 0.9; - - color = 1, 0.1, 0.0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/airraidershot.lua b/Gamedata/explosions/airraidershot.lua new file mode 100644 index 000000000..b78add711 --- /dev/null +++ b/Gamedata/explosions/airraidershot.lua @@ -0,0 +1,51 @@ +return { + ["airraidershot"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.3 0.9 0.01 0.9 0 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[lightb4-bw]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 7, + speed = [[0, 0, 0]], + texture = [[LightningStrike]], + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/antiassualtshot.lua b/Gamedata/explosions/antiassualtshot.lua new file mode 100644 index 000000000..04be3363b --- /dev/null +++ b/Gamedata/explosions/antiassualtshot.lua @@ -0,0 +1,211 @@ +-- superantiassualtshot2 +-- antiassualtshot +-- antiassualtshot2 + +return { + ["superantiassualtshot2"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.0 0.3 0.5 0.01 0 0 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.6, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[firenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["antiassualtshot"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["antiassualtshot2"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.6, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[gizboom]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/antiassualtshot.tdf b/Gamedata/explosions/antiassualtshot.tdf deleted file mode 100644 index a384f0911..000000000 --- a/Gamedata/explosions/antiassualtshot.tdf +++ /dev/null @@ -1,266 +0,0 @@ -[antiassualtshot] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 3; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 0; - particleSize = 4; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[antiassualtshot2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=gizboom; - heat = 8; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 3; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=muzzleside; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.6; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 0; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[superantiassualtshot2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=firenovaexplo; - heat = 8; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 3; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=muzzleside; - - colorMap = 1.0 1.0 1.0 0.04 0.0 0.3 0.5 0.01 0 0 0.5 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.6; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 0; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/areahealing.lua b/Gamedata/explosions/areahealing.lua new file mode 100644 index 000000000..71d10a084 --- /dev/null +++ b/Gamedata/explosions/areahealing.lua @@ -0,0 +1,123 @@ +-- areahealing + +return { + ["areahealing"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 400, + ground = true, + ttl = 120, + water = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 75, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/areahealing.tdf b/Gamedata/explosions/areahealing.tdf deleted file mode 100644 index 3ee2cd7c0..000000000 --- a/Gamedata/explosions/areahealing.tdf +++ /dev/null @@ -1,150 +0,0 @@ -[AREAHEALING] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 75; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 120; - flashSize = 400; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0.0, 1.0, 0.0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/artillery_explosion.lua b/Gamedata/explosions/artillery_explosion.lua new file mode 100644 index 000000000..59b129b0d --- /dev/null +++ b/Gamedata/explosions/artillery_explosion.lua @@ -0,0 +1,117 @@ +-- artillery_explosion + +return { + ["artillery_explosion"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-25 r25, 0, r-25 r25]], + size = 30, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 9, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.20000000298023, + [3] = 0.10000000149012, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.2 0.2 0.01 0.8 0.1 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 30, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 1 0, 0]], + texture = [[crimsonnovaexplo]], + }, + }, + smoke = { + air = true, + count = 4, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-20 r20, 34, r-20 r20]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-2 r2, 1 r2.3, r-2 r2]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 3.5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/artyshot2.lua b/Gamedata/explosions/artyshot2.lua new file mode 100644 index 000000000..420ca07f5 --- /dev/null +++ b/Gamedata/explosions/artyshot2.lua @@ -0,0 +1,70 @@ +-- artyshot2 +-- artyshot3 + +return { + ["artyshot2"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.9 0.25 0.0 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["artyshot3"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.9 0.25 0.0 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 15, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/artyshot2.tdf b/Gamedata/explosions/artyshot2.tdf deleted file mode 100644 index cd65ba81e..000000000 --- a/Gamedata/explosions/artyshot2.tdf +++ /dev/null @@ -1,64 +0,0 @@ -[artyshot2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=fireyexplo; - heat = 8; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=muzzleside; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.6; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 0; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/beam_explosion.lua b/Gamedata/explosions/beam_explosion.lua new file mode 100644 index 000000000..ed9e43de6 --- /dev/null +++ b/Gamedata/explosions/beam_explosion.lua @@ -0,0 +1,60 @@ +-- beam_explosion + +return { + ["beam_explosion"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 10, + circlesize = 10, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 15, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 5, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 15, + pos = [[r-25 r25, 5, r-25 r25]], + size = 55, + sizegrowth = 0.9, + speed = [[r-1 r1, 1 0, r-1 r1]], + texture = [[2explo]], + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.04, + alwaysvisible = true, + color = 0.1, + pos = [[r-3 r3, r-3 r3, r-3 r3]], + size = 40, + sizeexpansion = 0.9, + sizegrowth = 15, + speed = [[0, 1 r2.3, 0]], + startsize = 10, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/beamimpact.lua b/Gamedata/explosions/beamimpact.lua new file mode 100644 index 000000000..3f1a9bbd1 --- /dev/null +++ b/Gamedata/explosions/beamimpact.lua @@ -0,0 +1,89 @@ +-- beamimpact + +return { + ["beamimpact"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.2, + circlegrowth = 4, + flashalpha = 0.5, + flashsize = 110, + ground = true, + ttl = 10, + water = true, + color = { + [1] = 0.5, + [2] = 0, + [3] = 1, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 10, + pos = [[0, 5, 0]], + size = 0.2, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 2, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.2, + sizegrowth = 4, + speed = [[0, 1, 0]], + texture = [[2explo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bigbulletimpact.lua b/Gamedata/explosions/bigbulletimpact.lua new file mode 100644 index 000000000..d97ae1d9a --- /dev/null +++ b/Gamedata/explosions/bigbulletimpact.lua @@ -0,0 +1,197 @@ +-- bigbulletimpact + +return { + ["bigbulletimpact"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/blacksmoke.lua b/Gamedata/explosions/blacksmoke.lua index 2fc55e709..b00fdb24f 100644 --- a/Gamedata/explosions/blacksmoke.lua +++ b/Gamedata/explosions/blacksmoke.lua @@ -5,30 +5,60 @@ return { dirtg = { air = true, class = [[CSimpleParticleSystem]], - count = 1, + count = 2, ground = true, water = true, + underwater = false, properties = { airdrag = 0.7, - alwaysvisible = true, - colormap = [[1 0.5 0 1.0 1 0.5 0 1.0 0.9 0.4 0 1.0 0.6 0.2 0 1.0 0.3 0.1 0 1.0 0 0 0 1.0 0 0 0 0.9 0 0 0 0.8 0 0 0 0.7 0 0 0 0.6 0 0 0 0.5 0 0 0 0.4 0 0 0 0.3 0 0 0 0.2 0 0 0 0.1]], + --alwaysvisible = true, + colormap = [[1 0.5 0 1.0 1 0.5 0 1.0 0.9 0.4 0 1.0 0.6 0.2 0 1.0 0.3 0.1 0 1.0 0 0 0 1.0 0 0 0 0.5 0 0 0 0.1]], directional = true, - emitrot = 0, - emitrotspread = 0, + emitrot = 45, + emitrotspread = 32, emitvector = [[0, 1, 0]], gravity = [[0, 0.3, 0]], numparticles = 4, - particlelife = 30, + particlelife = 60, particlelifespread = 20, particlesize = 1, particlesizespread = 2, particlespeed = 1, - particlespeedspread = 1, + particlespeedspread = 4, sizegrowth = 1, sizemod = 0.9, texture = [[new_dirta]], useairlos = false, - colorchange = "stuffs", + }, + }, + + bubblesuw = { + air = false, + class = [[CSimpleParticleSystem]], + count = 2, + ground = false, + water = false, + underwater = true, + properties = { + airdrag = 0.7, + --alwaysvisible = true, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 4, + particlelife = 60, + particlelifespread = 20, + particlesize = 1, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 4, + sizegrowth = 1, + sizemod = 0.9, + texture = [[randdots]], + useairlos = false, }, }, }, diff --git a/Gamedata/explosions/blue_explosion.lua b/Gamedata/explosions/blue_explosion.lua new file mode 100644 index 000000000..62762cd7c --- /dev/null +++ b/Gamedata/explosions/blue_explosion.lua @@ -0,0 +1,423 @@ +-- blue_explosion +-- blue_explosion_small +-- blue_explosion2 + +return { + ["blue_explosion"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["blue_explosion_small"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = false, + color = [[0.0, 0.3, 1]], + expansionspeed = [[1 r3]], + ttl = 2, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = false, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.5, + width = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = false, + colormap = [[1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 1, + particlelifespread = 2, + particlesize = 1, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = false, + colormap = [[0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 1, + particlelifespread = 2, + particlesize = 1, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = false, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.2, + sizegrowth = 1, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = false, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.2, + sizegrowth = 1, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["blue_explosion2"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bluegreennovaexplode.lua b/Gamedata/explosions/bluegreennovaexplode.lua new file mode 100644 index 000000000..24bbf6f15 --- /dev/null +++ b/Gamedata/explosions/bluegreennovaexplode.lua @@ -0,0 +1,89 @@ +-- bluegreennovaexplo + +return { + ["bluegreennovaexplo"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.2, + circlegrowth = 4, + flashalpha = 0.5, + flashsize = 50, + ground = true, + ttl = 10, + water = true, + color = { + [1] = 0.10000000149012, + [2] = 1, + [3] = 0.60000002384186, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.2 0.8 0.8 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 10, + pos = [[0, 5, 0]], + size = 0.2, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[bluegreennovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 2, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.2, + sizegrowth = 3, + speed = [[0, 1, 0]], + texture = [[3explo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bluegreennovaexplode.tdf b/Gamedata/explosions/bluegreennovaexplode.tdf deleted file mode 100644 index 1268fed41..000000000 --- a/Gamedata/explosions/bluegreennovaexplode.tdf +++ /dev/null @@ -1,105 +0,0 @@ -[bluegreennovaexplo] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluegreennovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 1; - - size = 0.2; - sizeGrowth = 8; - - pos = 0, 5, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=3explo; - heat = 10; - maxheat = 15; - heatFalloff = 2; - - size = 0.2; - sizeGrowth = 3; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - colorMap =0.2 0.8 0.8 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 8; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [groundflash] - { - alwaysVisible=1; - ttl = 10; - flashSize = 50; - flashAlpha = 0.5; - - circleGrowth = 4; - circleAlpha = 0.2; - - color = 0.1, 1, 0.6; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/bombs.lua b/Gamedata/explosions/bombs.lua new file mode 100644 index 000000000..17dda66f9 --- /dev/null +++ b/Gamedata/explosions/bombs.lua @@ -0,0 +1,68 @@ +-- lightbomb +-- heavybomb + +return { + ["lightbomb"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + }, + + ["heavybomb"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bombs.tdf b/Gamedata/explosions/bombs.tdf deleted file mode 100644 index fd2ced17e..000000000 --- a/Gamedata/explosions/bombs.tdf +++ /dev/null @@ -1,81 +0,0 @@ -[lightbomb] -{ - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} - -[heavybomb] -{ - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/booms.lua b/Gamedata/explosions/booms.lua new file mode 100644 index 000000000..52df3dcf1 --- /dev/null +++ b/Gamedata/explosions/booms.lua @@ -0,0 +1,1291 @@ +-- lrpc_expl +-- mini_nuclear_expl +-- med_unit_expl +-- plasma_expl +-- small_unit_expl +-- neutron_expl +-- big_unit_expl +-- flame +-- med_suicide_expl +-- stunner_expl +-- flak_burst_expl +-- nuke_expl +-- pyro_suicide_expl +-- huge_unit_expl +-- crawl_unit_expl +-- crawl_suicide_expl +-- big_suicide_expl +-- neutron_explosion +-- small_suicide_expl +-- pyro_unit_expl + +return { + ["lrpc_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .5, + circlegrowth = 20, + flashalpha = 1, + flashsize = 300, + ttl = 10, + color = { + [1] = 0.69999998807907, + [2] = 0.69999998807907, + [3] = 0.69999998807907, + }, + }, + }, + + ["mini_nuclear_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = 1, + circlegrowth = 35, + flashalpha = 1, + flashsize = 600, + ttl = 16, + color = { + [1] = 0.80000001192093, + [2] = 0.80000001192093, + [3] = 0.60000002384186, + }, + }, + }, + + ["med_unit_expl"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.1, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + expansionspeed = [[10 r3]], + ttl = 18, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.5, + width = 8, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.7, + circlegrowth = 10, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 18, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 40, + particlelife = 10, + particlelifespread = 16, + particlesize = 15, + particlesizespread = 0, + particlespeed = 19, + particlespeedspread = 10, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop0 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.7, + maxheat = 15, + pos = [[0, 5, 0]], + size = 40, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 2, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[purpleexplo]], + }, + }, + }, + + ["plasma_expl"] = { + usedefaultexplosions = false, + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["small_unit_expl"] = { + usedefaultexplosions = false, + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + circlealpha = .3, + circlegrowth = 12, + flashalpha = 1, + flashsize = 270, + ttl = 16, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + poof00 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 24, + speed = [[0, 1 0, 0]], + texture = [[redexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["neutron_expl"] = { + ground = true, + usedefaultexplosions = false, + water = true, + groundflash = { + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 2.4, + flashalpha = 1, + flashsize = 100, + ttl = 250, + color = { + [1] = 0.20000000298023, + [2] = 0.20000000298023, + [3] = 0.60000002384186, + }, + }, + }, + + ["big_unit_expl"] = { + usedefaultexplosions = false, + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + circlealpha = .4, + circlegrowth = 11, + flashalpha = 1, + flashsize = 450, + ttl = 26, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["flame"] = { + heatcloud = { + air = true, + count = 1, + ground = true, + water = true, + properties = { + heat = 15, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1.25, + sizegrowth = 0.5, + sizemod = 0, + sizemodmod = 0, + speed = [[0, 2, 0]], + texture = [[ExplodeHeat]], + }, + }, + smoke = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.03, + color = 0.1, + pos = [[5 r-5, 5 r-5, 5 r-5]], + size = 2.5, + sizeexpansion = 0.5, + sizegrowth = 0.5, + speed = [[0, 2 r0.5, 0]], + startsize = 0.75, + }, + }, + }, + + ["med_suicide_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .5, + circlegrowth = 12, + flashalpha = 1, + flashsize = 350, + ttl = 24, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + }, + + ["stunner_expl"] = { + ground = true, + usedefaultexplosions = false, + water = true, + groundflash = { + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 2.4, + flashalpha = 1, + flashsize = 100, + ttl = 250, + color = { + [1] = 0.69999998807907, + [2] = 0.69999998807907, + [3] = 1, + }, + }, + }, + + ["flak_burst_expl"] = { + usedefaultexplosions = false, + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["nuke_expl"] = { + ground = true, + usedefaultexplosions = false, + water = true, + groundflash = { + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 10, + flashalpha = 1, + flashsize = 100, + ttl = 250, + color = { + [1] = 1, + [2] = 0.40000000596046, + [3] = 0, + }, + }, + }, + + ["pyro_suicide_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 1, + flashsize = 440, + ttl = 60, + color = { + [1] = 1, + [2] = 0.80000001192093, + [3] = 0.30000001192093, + }, + }, + heatcloud = { + air = true, + count = 32, + ground = true, + water = true, + properties = { + heat = 40, + heatfalloff = .5, + maxheat = 40, + pos = [[-15 r30, r15, -15 r30]], + size = 30, + speed = [[.8 r-1.6, r1.6-.3, .8 r-1.6]], + }, + }, + }, + + ["huge_unit_expl"] = { + usedefaultexplosions = false, + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + circlealpha = .4, + circlegrowth = 11, + flashalpha = 1, + flashsize = 450, + ttl = 26, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["crawl_unit_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .3, + circlegrowth = 10, + flashalpha = 1, + flashsize = 500, + ttl = 26, + color = { + [1] = 0.69999998807907, + [2] = 0.69999998807907, + [3] = 0.69999998807907, + }, + }, + }, + + ["crawl_suicide_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .5, + circlegrowth = 10, + flashalpha = 1, + flashsize = 700, + ttl = 30, + color = { + [1] = 0.69999998807907, + [2] = 0.69999998807907, + [3] = 0.69999998807907, + }, + }, + }, + + ["big_suicide_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .5, + circlegrowth = 10, + flashalpha = 1, + flashsize = 400, + ttl = 28, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + }, + + ["neutron_explosion"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 2.4, + flashalpha = 1, + flashsize = 100, + ground = true, + ttl = 250, + water = true, + color = { + [1] = 0.40000000596046, + [2] = 0.40000000596046, + [3] = 0.60000002384186, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 75, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["small_suicide_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = .5, + circlegrowth = 12, + flashalpha = 1, + flashsize = 300, + ttl = 20, + color = { + [1] = 1, + [2] = 0.89999997615814, + [3] = 0.80000001192093, + }, + }, + }, + + ["pyro_unit_expl"] = { + usedefaultexplosions = false, + groundflash = { + circlealpha = 0, + circlegrowth = 0, + flashalpha = 1, + flashsize = 300, + ttl = 25, + color = { + [1] = 1, + [2] = 0.80000001192093, + [3] = 0.30000001192093, + }, + }, + heatcloud = { + air = true, + count = 10, + ground = true, + water = true, + properties = { + heat = 22, + heatfalloff = .5, + maxheat = 22, + pos = [[-15 r30, r15, -15 r30]], + size = 25, + speed = [[.8 r-1.6, r1.6-.3, .8 r-1.6]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/booms.tdf b/Gamedata/explosions/booms.tdf deleted file mode 100644 index 2c0c10eae..000000000 --- a/Gamedata/explosions/booms.tdf +++ /dev/null @@ -1,1584 +0,0 @@ - -[NEUTRON_EXPLOSION] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 75; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - flashSize = 100; - flashAlpha = 1; - circleGrowth = 2.4; - circleAlpha = 1; - ttl = 250; - color = 0.4, 0.4, 0.6; - alwaysvisible=1; - - air=1; - ground=1; - water=1; - } -} - -[NUKE_Expl] -{ - usedefaultexplosions=0; - [groundflash] - { - flashSize = 100; - flashAlpha = 1; - circleGrowth = 10; - circleAlpha = 1; - ttl = 250; - color = 1, 0.4, 0; - alwaysvisible=1; - } - water=1; - ground=1; -} - -[NEUTRON_Expl] -{ - usedefaultexplosions=0; - [groundflash] - { - flashSize = 100; - flashAlpha = 1; - circleGrowth = 2.4; - circleAlpha = 1; - ttl = 250; - color = 0.2, 0.2, 0.6; - alwaysvisible=1; - } - water=1; - ground=1; -} - -[STUNNER_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 100; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 2.4; // size increase/frame - circleAlpha = 1; // initial alpha of the ring - ttl = 250; // number of frames - color = 0.7, 0.7, 1; - alwaysvisible=1; - } - water=1; - ground=1; -} - -[MINI_NUCLEAR_Expl] -{ - usedefaultexplosions=0; - [groundflash] - { - flashSize = 600; - flashAlpha = 1; - circleGrowth = 35; - circleAlpha = 1; - ttl = 16; - color = 0.8, 0.8, 0.6; - - } -} - -[LRPC_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 300; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 20; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 10; // number of frames - color = 0.7, 0.7, .7; - } -} - -[PLASMA_Expl] -{ - usedefaultexplosions=0; - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[SMALL_UNIT_Expl] -{ - - usedefaultexplosions=0; - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=redexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 24; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF00] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 3; - particleSize = 25; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - flashSize = 270; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 12; // size increase/frame - circleAlpha = .3; // initial alpha of the ring - ttl = 16; // number of frames - color = 0, 0.5, 1; - } -} - - -[MED_UNIT_Expl] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=8; - length=0.5; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.5; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=18; - alpha=0.4; - expansionSpeed=10 r3; - color=1, 0.3, 0.5; - } - ground=1; - air=1; - count=1; - } - - [pop0] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - - heat = 10; - - maxheat = 15; - - heatFalloff = 1.7; - size = 40; - - sizeGrowth = 15; - - - pos = 0, 5, 0; - - speed=0, 0, 0; - - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purpleexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 2; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.1, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 10; - particleLifeSpread = 16; - numParticles = 40; - particleSpeed = 19; - particleSpeedSpread = 10; - particleSize = 15; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 18; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 10; - circleAlpha = 0.7; - - color = 1, 0.3, 0.5; - - air=1; - ground=1; - water=1; - } -} - - -[BIG_UNIT_Expl] -{ - - usedefaultexplosions=0; - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 20; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=10; - particleSpeedSpread=1; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - flashSize = 450; //300 flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 11; // size increase/frame - circleAlpha = .4; // initial alpha of the ring - ttl = 26; //20 number of frames - color = 1, 0, 0; - } -} - - -[HUGE_UNIT_Expl] -{ - - usedefaultexplosions=0; - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 20; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=10; - particleSpeedSpread=1; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - flashSize = 450; //300 flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 11; // size increase/frame - circleAlpha = .4; // initial alpha of the ring - ttl = 26; //20 number of frames - color = 1, 0, 0; - } -} - -[SMALL_SUICIDE_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 300; //300 flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 12; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 20; //20 number of frames - color = 1, 0.9, .8; - } -} - -[MED_SUICIDE_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 350; //350 flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 12; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 24; //22 number of frames - color = 1, 0.3, 0.5; - } -} - -[BIG_SUICIDE_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 400; //400 flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 10; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 28; //26 number of frames - color = 1, 0.3, 0; - } -} - -[CRAWL_SUICIDE_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 700; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 10; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 30; // number of frames - color = 0.7, 0.7, 0.7; - } -} - -[CRAWL_UNIT_Expl] -{ - - usedefaultexplosions=0; - [groundflash] - { - flashSize = 500; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 10; // size increase/frame - circleAlpha = .3; // initial alpha of the ring - ttl = 26; // number of frames - color = 0.7, 0.7, .7; - } -} - -[PYRO_UNIT_Expl] -{ - usedefaultexplosions=0; - [heatcloud] - { - [properties] - { - pos = -15 r30, r15, -15 r30; - speed=.8 r-1.6, r1.6-.3, .8 r-1.6; - heat = 22; - maxheat=22; - heatFalloff=.5; - size = 25; - } - ground=1; - air=1; - water=1; - count=10; - } - [groundflash] - { - flashSize = 300; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 0; // size increase/frame - circleAlpha = 0; // initial alpha of the ring - ttl = 25; // number of frames - color = 1, .8, .3; - } -} - -[PYRO_SUICIDE_Expl] -{ - usedefaultexplosions=0; - [heatcloud] - { - [properties] - { - pos = -15 r30, r15, -15 r30; - speed=.8 r-1.6, r1.6-.3, .8 r-1.6; - heat = 40; - maxheat=40; - heatFalloff=.5; - size = 30; - } - ground=1; - air=1; - water=1; - count=32; - } - [groundflash] - { - flashSize = 440; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 0; // size increase/frame - circleAlpha = 0; // initial alpha of the ring - ttl = 60; // number of frames - color = 1, .8, .3; - } -} - -[FLAK_BURST_Expl] -{ - usedefaultexplosions=0; - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - - -[FLAME] -{ -[heatcloud] - { - [properties] - { - texture=ExplodeHeat; - heat = 15; - maxheat = 15; - heatFalloff = 1; - size = 1.25; - sizeGrowth = 0.5; - sizemod = 0; - sizemodmod = 0; - speed = 0, 2, 0; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } -[smoke] - { - [properties] - { - color = 0.1; - startSize = 0.75; - sizeExpansion = 0.5; - ageSpeed=0.03; - size = 2.5; - sizeGrowth = 0.5; - pos = 5 r-5, 5 r-5, 5 r-5; - speed=0, 2 r0.5, 0; - } - air=1; - water=1; - ground=1; - count=3; - } -} diff --git a/Gamedata/explosions/bruisercannon.lua b/Gamedata/explosions/bruisercannon.lua new file mode 100644 index 000000000..f793af09b --- /dev/null +++ b/Gamedata/explosions/bruisercannon.lua @@ -0,0 +1,53 @@ +-- bruisercannon + +return { + ["bruisercannon"] = { + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[0, 0, 0]], + size = 20, + sizegrowth = -0.5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[1 0.2 0.1 0.01 1 0.5 0.1 0.01 0 0 0 0.01]], + emitrot = 0, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 1, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[1 r3, 1 r3, 1 r3]], + sizegrowth = 0, + sizemod = 1, + texture = [[starexplobw]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bruisercannon.tdf b/Gamedata/explosions/bruisercannon.tdf deleted file mode 100644 index 196bf67ff..000000000 --- a/Gamedata/explosions/bruisercannon.tdf +++ /dev/null @@ -1,67 +0,0 @@ -[bruisercannon] -{ - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=starexplobw; - - colorMap = 1 0.2 0.1 0.01 1 0.5 0.1 0.01 0 0 0 0.01; - - pos = 1 r3, 1 r3, 1 r3; - gravity = 0, 0, 0; - - sizeGrowth = 0; - sizeMod = 1; - - airdrag = 1; - - particleLife = 1; - particleLifeSpread = 5; - numParticles = 1; - particleSpeed = 0; - particleSpeedSpread = 0; - particleSize = 10; - particleSizeSpread = 0; - - - emitVector = dir; - emitRot = 0; - emitRotSpread = 0; - - useAirLos = 1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 20; - sizeGrowth = -0.5; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - -} \ No newline at end of file diff --git a/Gamedata/explosions/bubbles.lua b/Gamedata/explosions/bubbles.lua new file mode 100644 index 000000000..18d76e183 --- /dev/null +++ b/Gamedata/explosions/bubbles.lua @@ -0,0 +1,95 @@ +-- bubbles +-- dirtsmall + +return { + ["bubbles"] = { + bubblesuw = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 1, + particlelife = 100, + particlelifespread = 20, + particlesize = [[7 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["dirtsmall"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 4, + particlelife = 15, + particlelifespread = 20, + particlesize = [[4 r4]], + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.0, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 20, + particlesize = [[3 r4]], + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 3, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bubbles.tdf b/Gamedata/explosions/bubbles.tdf deleted file mode 100644 index 87f1cf7e7..000000000 --- a/Gamedata/explosions/bubbles.tdf +++ /dev/null @@ -1,123 +0,0 @@ -// use this effect sparingly. It can slow machines down. -[bubbles] -{ - [bubblesuw] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=-0.2; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0; - airdrag = 0.7; - - particleLife=100; - particleLifeSpread=20; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=6; - particleSize=7 r4; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - underwater=1; - count=1; - } -} - - -[dirtsmall] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.0; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 0.25 0.20 0.10 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=20; - - numParticles=4; - - particleSpeed=1; - particleSpeedSpread=6; - particleSize=4 r4; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } - - [dirtw] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=-0.2; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=20; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=3; - particleSize=3 r4; - particleSizeSpread=1; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - water=1; - underwater=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/buildanimation.lua b/Gamedata/explosions/buildanimation.lua new file mode 100644 index 000000000..1cf658b2e --- /dev/null +++ b/Gamedata/explosions/buildanimation.lua @@ -0,0 +1,90 @@ +-- buildanimation + +return { + ["buildanimation"] = { + usedefaultexplosions = false, + lightball50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball52 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/buildanimation.tdf b/Gamedata/explosions/buildanimation.tdf deleted file mode 100644 index c9c968dc9..000000000 --- a/Gamedata/explosions/buildanimation.tdf +++ /dev/null @@ -1,93 +0,0 @@ -[buildanimation] -{ - usedefaultexplosions=0; - [lightball50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/bulletimpact.lua b/Gamedata/explosions/bulletimpact.lua new file mode 100644 index 000000000..783009cdc --- /dev/null +++ b/Gamedata/explosions/bulletimpact.lua @@ -0,0 +1,74 @@ +-- bulletimpact + +return { + ["bulletimpact"] = { + dirt01 = { + class = [[dirt]], + count = 3, + ground = true, + properties = { + alphafalloff = 2, + color = [[0.2, 0.1, 0.05]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 10, + speed = [[r1.5 r-1.5, 1.7, r1.5 r-1.5]], + }, + }, + dirt03 = { + air = true, + class = [[dirt]], + count = 2, + properties = { + alphafalloff = 2, + color = [[0.5, 0.5, 0.2]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 10, + speed = [[r1.5 r-1.5, 1.7, r1.5 r-1.5]], + }, + }, + dirtw03 = { + class = [[dirt]], + count = 5, + water = true, + properties = { + alphafalloff = 2, + color = [[0.7, 0.7, 1.0]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 7, + speed = [[r1.5 r-1.5, 1.7, r1.5 r-1.5]], + }, + }, + pillar = { + air = true, + class = [[heatcloud]], + count = 3, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,1, 0]], + size = 20, + sizegrowth = -1, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + smoke = { + air = true, + count = 2, + ground = true, + properties = { + agespeed = 0.15, + alwaysvisible = true, + color = 0.3, + pos = [[0,-1 i4,0]], + size = 10, + sizegrowth = 0, + speed = [[0, 5, 0]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bulletimpact2.lua b/Gamedata/explosions/bulletimpact2.lua new file mode 100644 index 000000000..1fc9668d7 --- /dev/null +++ b/Gamedata/explosions/bulletimpact2.lua @@ -0,0 +1,197 @@ +-- bulletimpact2 + +return { + ["bulletimpact2"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 2, + particlespeed = 5, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 6, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bulletimpact3.lua b/Gamedata/explosions/bulletimpact3.lua new file mode 100644 index 000000000..3f7c6c918 --- /dev/null +++ b/Gamedata/explosions/bulletimpact3.lua @@ -0,0 +1,197 @@ +-- bulletimpact3 + +return { + ["bulletimpact3"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 2, + particlespeed = 5, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 40, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[newboom]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/bulletimpactblue.lua b/Gamedata/explosions/bulletimpactblue.lua new file mode 100644 index 000000000..56708f1e6 --- /dev/null +++ b/Gamedata/explosions/bulletimpactblue.lua @@ -0,0 +1,197 @@ +-- bulletimpactblue + +return { + ["bulletimpactblue"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 2, + particlespeed = 5, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 6, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[newboom]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/burn.lua b/Gamedata/explosions/burn.lua new file mode 100644 index 000000000..2fd71388c --- /dev/null +++ b/Gamedata/explosions/burn.lua @@ -0,0 +1,401 @@ +-- missileburn +-- electricburn +-- burn +-- burnold +-- burnblack +-- burngreen + +return { + ["missileburn"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 0.5, 0.5]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + }, + + ["electricburn"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0, + [2] = 0.10000000149012, + [3] = 0.80000001192093, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["burn"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.9 0.9 0.0 0.01 1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 1, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-3 r3, 1.5, r-3 r3]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = false, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.0, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 25, + ground = true, + ttl = 3, + underwater = 1, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + shatter = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.9 0.0 0.04 1.0 0.5 0.0 0.01 1.0 0.5 0.0 0.00]], + directional = true, + emitrot = 35, + emitrotspread = 1, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 4, + particlelife = 7, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2, + particlespeed = 7, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[longshot]], + useairlos = false, + }, + }, + }, + + ["burnold"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["burnblack"] = { + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0.0 0.2 0 0 0 0.2 0 0 0 0.01]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flame]], + }, + }, + }, + + ["burngreen"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.4 0.9 0.4 0.04 0.4 0.9 0.1 0.01 0.1 0.5 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 0.5, 0.5]], + gravity = [[0, 2, 0]], + numparticles = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.5 0.0 0.05 0.1 0.5 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[1, 1, 1]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/burn.tdf b/Gamedata/explosions/burn.tdf deleted file mode 100644 index e82e7244e..000000000 --- a/Gamedata/explosions/burn.tdf +++ /dev/null @@ -1,508 +0,0 @@ -[BURN] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-3 r3, 1.5, r-3 r3; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.9 0.9 0.0 0.01 1.0 0.5 0.0 0.01 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=1; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } - - [shatter] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=longshot; - - colorMap = 0.9 0.9 0.0 0.04 1.0 0.5 0.0 0.01 1.0 0.5 0.0 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 35; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 7; - particleLifeSpread = 0; - numParticles = 4; - particleSpeed = 7; - particleSpeedSpread = 5; - particleSize = 2; - particleSizeSpread = 2; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.3, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=15; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=5; - particleSize=3; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - water=1; - underwater=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 3; - flashSize = 25; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.0; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - underwater=1; - } - -} - - -[BURNBLACK] -{ -[kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=1; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=flame; - airdrag=0.87; - colorMap=1 0.5 0.0 0.2 0 0 0 0.2 0 0 0 0.01; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - -} - - -[BURNOLD] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, 2, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 10; - particleSpeed = 5; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} - -[ELECTRICBURN] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.0, 0.1, 0.8; - } -} - -[BURNGREEN] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 1, 1, 1; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.5 0.0 0.05 0.1 0.5 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.4 0.9 0.4 0.04 0.4 0.9 0.1 0.01 0.1 0.5 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, 2, 0; - emitVector = 0.5, 0.5, 0.5; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 10; - particleSpeed = 5; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} - -[MISSILEBURN] -{ - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, 2, 0; - emitVector = 0.5, 0.5, 0.5; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 10; - particleSpeed = 5; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} diff --git a/Gamedata/explosions/burnteal.lua b/Gamedata/explosions/burnteal.lua new file mode 100644 index 000000000..e6e2474d5 --- /dev/null +++ b/Gamedata/explosions/burnteal.lua @@ -0,0 +1,147 @@ +-- burntealceg +-- burnteal + +return { + ["burntealceg"] = { + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["burnteal"] = { + groundflash = { + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 25, + ttl = 8, + color = { + [1] = 0, + [2] = 0.5, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.0 1.0 1.0 0.04 0.2 0.9 0.9 0.01 0.1 0.8 0.8 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 10, + pos = [[0, 5, 0]], + size = 0.2, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[novabg]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.2, + sizegrowth = 3, + speed = [[0, 1, 0]], + texture = [[3explo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/centralprocessing.lua b/Gamedata/explosions/centralprocessing.lua new file mode 100644 index 000000000..f0330fef1 --- /dev/null +++ b/Gamedata/explosions/centralprocessing.lua @@ -0,0 +1,55 @@ +-- centralprocessing + +return { + ["centralprocessing"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = false, + color = [[0.0, 0.3, 0.5]], + expansionspeed = [[3 r3]], + ttl = 20, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = false, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.4, + width = 4, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = false, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/centralprocessing.tdf b/Gamedata/explosions/centralprocessing.tdf deleted file mode 100644 index d00f9a8e6..000000000 --- a/Gamedata/explosions/centralprocessing.tdf +++ /dev/null @@ -1,62 +0,0 @@ -[centralprocessing] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=0; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.4; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=0; - ttl=20; - alpha=0.4; - expansionSpeed=3 r3; - color= 0.0, 0.3, 0.5; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=0; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/comm_explosion.lua b/Gamedata/explosions/comm_explosion.lua new file mode 100644 index 000000000..e88f4faa0 --- /dev/null +++ b/Gamedata/explosions/comm_explosion.lua @@ -0,0 +1,101 @@ +-- comm_explosion + +return { + ["comm_explosion"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + dirt2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.5 0.3 0.0 0.05 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 50, + particlelife = 70, + particlelifespread = 0, + particlesize = 100, + particlesizespread = 10, + particlespeed = 5, + particlespeedspread = 57, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 3, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 37, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 5, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 30, + speed = [[0, 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/comm_explosiona.lua b/Gamedata/explosions/comm_explosiona.lua new file mode 100644 index 000000000..80d4f4358 --- /dev/null +++ b/Gamedata/explosions/comm_explosiona.lua @@ -0,0 +1,154 @@ +-- comm_explosiona + +return { + ["comm_explosiona"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 32, + particlelife = 3, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 64, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.5, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 52, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof03 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.5 0.5 0.8 0.01 0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 32, + particlelife = 3, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 64, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 37, + speed = [[0, 0, 0]], + texture = [[electnovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 10, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 30, + speed = [[0, 0, 0]], + texture = [[electnovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/commplosion.lua b/Gamedata/explosions/commplosion.lua new file mode 100644 index 000000000..e61bc28d2 --- /dev/null +++ b/Gamedata/explosions/commplosion.lua @@ -0,0 +1,23 @@ +-- comm_expl + +return { + ["comm_expl"] = { + ground = true, + usedefaultexplosions = false, + water = true, + groundflash = { + circlealpha = 0.7, + circlegrowth = 50, + flashalpha = 0.7, + flashsize = 500, + ttl = 500, + color = { + [1] = 0.40000000596046, + [2] = 0.40000000596046, + [3] = 0.60000002384186, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/commplosion.tdf b/Gamedata/explosions/commplosion.tdf deleted file mode 100644 index 6be953d57..000000000 --- a/Gamedata/explosions/commplosion.tdf +++ /dev/null @@ -1,16 +0,0 @@ -[COMM_Expl] -{ - usedefaultexplosions=0; - [groundflash] - { - flashSize = 500; - flashAlpha = 0.7; - circleGrowth = 50; - circleAlpha = 0.7; - ttl = 500; - color = 0.4, 0.4, 0.6; - - } - water=1; - ground=1; -} diff --git a/Gamedata/explosions/constdusts.lua b/Gamedata/explosions/constdusts.lua new file mode 100644 index 000000000..7435da66c --- /dev/null +++ b/Gamedata/explosions/constdusts.lua @@ -0,0 +1,36 @@ +-- constdust + +return { + ["constdust"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 30, + particlelife = 5, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/constdusts.tdf b/Gamedata/explosions/constdusts.tdf deleted file mode 100644 index eeee23f1d..000000000 --- a/Gamedata/explosions/constdusts.tdf +++ /dev/null @@ -1,40 +0,0 @@ -[constdust] -{ - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap= 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=5; - particleLifeSpread=10; - - numParticles=30; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=0; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/cruisemissile.lua b/Gamedata/explosions/cruisemissile.lua new file mode 100644 index 000000000..58f89ba78 --- /dev/null +++ b/Gamedata/explosions/cruisemissile.lua @@ -0,0 +1,175 @@ +-- cruisemissile + +return { + ["cruisemissile"] = { + alwaysvisible = true, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 2, + flashalpha = 0.5, + flashsize = 1000, + ground = true, + ttl = 300, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0.2 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 150, + particlelifespread = 200, + particlesize = 26, + particlesizespread = 1.5, + particlespeed = 64, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 128, + particlelife = 150, + particlelifespread = 200, + particlesize = 25, + particlesizespread = 0.5, + particlespeed = 52, + particlespeedspread = 16, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + poof03 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 300, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 25, + particlelifespread = 200, + particlesize = 26, + particlesizespread = 1.5, + particlespeed = 64, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof04 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 20, + particlelife = 150, + particlelifespread = 200, + particlesize = 25, + particlesizespread = 0.5, + particlespeed = 10, + particlespeedspread = 16, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + pop1 = { + air = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 5, + heatfalloff = 0.4, + maxheat = 5, + pos = [[r-10 r10, 0, r-10 r10]], + size = 0.5, + sizegrowth = 25, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + pop2 = { + air = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 10, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 5, + heatfalloff = 0.6, + maxheat = 8, + pos = [[r-150 r150, 0, r-300 r150]], + size = 0.5, + sizegrowth = 20, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/cruisemissiletrail.lua b/Gamedata/explosions/cruisemissiletrail.lua new file mode 100644 index 000000000..d2b0c71d2 --- /dev/null +++ b/Gamedata/explosions/cruisemissiletrail.lua @@ -0,0 +1,78 @@ +-- cruisemissiletrail + +return { + ["cruisemissiletrail"] = { + usedefaultexplosions = false, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 200, + particlelifespread = 7, + particlesize = 6, + particlesizespread = 0.5, + particlespeed = 1, + particlespeedspread = 2.5, + pos = [[0, 1, 0]], + sizegrowth = 0.25, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.6 0.35 0.2 0.1 0.1 0.1 0.1 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 140, + particlelifespread = 7, + particlesize = 6, + particlesizespread = 0.5, + particlespeed = 1, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 4, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 1, + width = 11, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/deathceg.lua b/Gamedata/explosions/deathceg.lua new file mode 100644 index 000000000..9ac56bfa6 --- /dev/null +++ b/Gamedata/explosions/deathceg.lua @@ -0,0 +1,270 @@ +-- deathceg1 +-- deathceg0 + +return { + ["deathceg1"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = false, + colormap = [[0.6 0.3 0.1 0.04 0.5 0.2 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = false, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["deathceg0"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = false, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = false, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["deathceg3"] = { + core = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.5 0.3 0.0 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["deathceg4"] = { + core = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0 0 0 0.25 0 0 0 0.35 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/deathceg.tdf b/Gamedata/explosions/deathceg.tdf deleted file mode 100644 index 18a717b0d..000000000 --- a/Gamedata/explosions/deathceg.tdf +++ /dev/null @@ -1,181 +0,0 @@ -[deathceg0] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=0.9; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} - -[deathceg1] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=0.9; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=gunshot; - - colorMap = 0.6 0.3 0.1 0.04 0.5 0.2 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/dgun.lua b/Gamedata/explosions/dgun.lua new file mode 100644 index 000000000..dc712b49a --- /dev/null +++ b/Gamedata/explosions/dgun.lua @@ -0,0 +1,83 @@ +-- dgun + +return { + ["dgun"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 0.6, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[0, 0, 0]], + size = 10, + sizegrowth = -0.5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[1 0.2 0.1 0.01 1 0.5 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[starexplobw]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/dgun.tdf b/Gamedata/explosions/dgun.tdf deleted file mode 100644 index 93427ca4d..000000000 --- a/Gamedata/explosions/dgun.tdf +++ /dev/null @@ -1,104 +0,0 @@ -[dgun] -{ - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=starexplobw; - - colorMap = 1 0.2 0.1 0.01 1 0.5 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - - sizeGrowth = -0.5; - sizeMod = 1; - - airdrag = 1; - - particleLife = 5; - particleLifeSpread = 5; - numParticles = 1; - particleSpeed = 0; - particleSpeedSpread = 0; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - - emitVector=dir; - emitRot = 0; - emitRotSpread = 0; - - useAirLos = 1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 10; - sizeGrowth = -0.5; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=muzzleside; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.6; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 1; - particleSpeedSpread = 0; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/dirt.lua b/Gamedata/explosions/dirt.lua index 739f79a31..64f96b44e 100644 --- a/Gamedata/explosions/dirt.lua +++ b/Gamedata/explosions/dirt.lua @@ -9,14 +9,46 @@ return { ground = true, properties = { airdrag = 0.7, - alwaysvisible = true, + --alwaysvisible = true, colormap = [[0.25 0.20 0.10 1.0 0 0 0 0.0]], directional = true, emitrot = 90, emitrotspread = 0, emitvector = [[0, 1, 0]], gravity = [[0, 0.3 r0.3, 0]], - numparticles = 4, + numparticles = 0, + particlelife = 15, + particlelifespread = 20, + particlesize = [[12 r4]], + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, + + + ["dirtoriginal"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + --alwaysvisible = true, + colormap = [[0.25 0.20 0.10 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 1, particlelife = 15, particlelifespread = 20, particlesize = [[12 r4]], @@ -28,7 +60,6 @@ return { sizemod = 1.0, texture = [[new_dirta]], useairlos = false, - colorchange = "stuffs", }, }, dirtw = { @@ -38,24 +69,24 @@ return { underwater = true, properties = { airdrag = 0.7, - alwaysvisible = true, + --alwaysvisible = true, colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], directional = true, emitrot = 90, emitrotspread = 0, emitvector = [[0, 1, 0]], gravity = [[0, 0.3 r0.3, 0]], - numparticles = 10, + numparticles = 1, particlelife = 15, particlelifespread = 20, particlesize = [[7 r4]], - particlesizespread = 2, + particlesizespread = 10, particlespeed = 1, particlespeedspread = 6, pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], - sizegrowth = -0.2, + sizegrowth = 0.5, sizemod = 1.0, - texture = [[new_dirta]], + texture = [[randdots]], useairlos = false, }, }, @@ -70,7 +101,7 @@ return { ground = true, properties = { airdrag = 0.7, - alwaysvisible = true, + --alwaysvisible = true, colormap = [[0.25 0.20 0.10 1.0 0 0 0 0.0]], directional = true, emitrot = 90, @@ -89,7 +120,6 @@ return { sizemod = 1.0, texture = [[new_dirta]], useairlos = false, - colorchange = "stuffs", }, }, dirtw = { @@ -99,7 +129,7 @@ return { underwater = true, properties = { airdrag = 0.7, - alwaysvisible = true, + --alwaysvisible = true, colormap = [[1 1 1 0.5 0.5 0.5 1 0.8 0 0 0 0.0]], directional = true, emitrot = 90, diff --git a/Gamedata/explosions/dodaibombexplode.lua b/Gamedata/explosions/dodaibombexplode.lua new file mode 100644 index 000000000..272023bb8 --- /dev/null +++ b/Gamedata/explosions/dodaibombexplode.lua @@ -0,0 +1,214 @@ +-- dodaibomb + +return { + ["dodaibomb"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.9 0.8 0.5 0.04 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 1, 0]], + numparticles = 5, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 5, + pos = [[r-1 r1, 3, r-1 r1]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + explosionsphere = { + class = [[CSpherePartSpawner]], + count = 1, + underwater = 1, + water = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.5, 0.5, 0.9]], + expansionspeed = [[10 r3]], + ttl = 14, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + underwater = 1, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 10, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + underwater = 1, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.9 0.8 0.5 0.04 0.9 0.5 0.0 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/dodaibombexplode.tdf b/Gamedata/explosions/dodaibombexplode.tdf deleted file mode 100644 index 72bb3ef6b..000000000 --- a/Gamedata/explosions/dodaibombexplode.tdf +++ /dev/null @@ -1,276 +0,0 @@ -[dodaibomb] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=10; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.1; - - } - air=1; - water=1; - underwater=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=14; - alpha=0.4; - expansionSpeed=10 r3; - color=0.5, 0.5, 0.9; - } - water=1; - underwater=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - underwater=1; - ground=1; - count=2; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1 1 1 0.01 0.9 0.8 0.5 0.04 0.9 0.5 0.0 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - underwater=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.5; - sizeMod=1.0; - - pos = r-1 r1, 3, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 1, 0; - - colorMap = 1 1 1 0.01 0.9 0.8 0.5 0.04 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=2; - particleSpeedSpread=5; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - underwater=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - underwater=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - underwater=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/ebombexpl.lua b/Gamedata/explosions/ebombexpl.lua new file mode 100644 index 000000000..5cb3c48a8 --- /dev/null +++ b/Gamedata/explosions/ebombexpl.lua @@ -0,0 +1,126 @@ +-- ebombexpl + +return { + ["ebombexpl"] = { + usedefaultexplosions = false, + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = .5, + circlegrowth = 10, + flashalpha = 1, + flashsize = 700, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 0.69999998807907, + [2] = 0.69999998807907, + [3] = 0.69999998807907, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 1.5, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[rednovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[rednovaexplo]], + useairlos = false, + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 5, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 15, + pos = [[r-25 r25, 5, r-25 r25]], + size = 55, + sizegrowth = 1.5, + speed = [[r-1 r1, 1 0, r-1 r1]], + texture = [[bigexplo]], + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.04, + alwaysvisible = true, + color = 0.1, + pos = [[r-3 r3, r-3 r3, r-3 r3]], + size = 80, + sizeexpansion = 0.9, + sizegrowth = 30, + speed = [[0, 1 r2.3, 0]], + startsize = 10, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/ebombexpl.tdf b/Gamedata/explosions/ebombexpl.tdf deleted file mode 100644 index 091906a27..000000000 --- a/Gamedata/explosions/ebombexpl.tdf +++ /dev/null @@ -1,151 +0,0 @@ -[ebombexpl] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bigexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.4; - - size = 55; - sizeGrowth = 1.5; - - pos = r-25 r25, 5, r-25 r25; - speed=r-1 r1, 1 0, r-1 r1; - } - air=1; - water=1; - ground=1; - count=5; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.04; - - startSize = 10; - sizeExpansion = 0.9; - size = 80; - sizeGrowth = 30; - - pos = r-3 r3, r-3 r3, r-3 r3; - speed=0, 1 r2.3, 0; - } - air=1; - water=1; - ground=1; - count=8; - } - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=rednovaexplo; - - colorMap = 1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 1.5; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=rednovaexplo; - - colorMap =1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - usedefaultexplosions=0; - [groundflash] - { - alwaysVisible=1; - flashSize = 700; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 10; // size increase/frame - circleAlpha = .5; // initial alpha of the ring - ttl = 30; // number of frames - color = 0.7, 0.7, 0.7; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/electric_explosion.lua b/Gamedata/explosions/electric_explosion.lua new file mode 100644 index 000000000..4d977df6d --- /dev/null +++ b/Gamedata/explosions/electric_explosion.lua @@ -0,0 +1,288 @@ +-- electric_explosion_big +-- electric_explosion + +return { + ["electric_explosion_big"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 14, + particlelife = 10, + particlelifespread = 5, + particlesize = 30, + particlesizespread = 0, + particlespeed = 15, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 220, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 75, + particlesizespread = 0, + particlespeed = 30, + particlespeedspread = 9, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 60, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["electric_explosion"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 14, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 220, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 10, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/electricbolt.lua b/Gamedata/explosions/electricbolt.lua new file mode 100644 index 000000000..d0cb6a21d --- /dev/null +++ b/Gamedata/explosions/electricbolt.lua @@ -0,0 +1,182 @@ +-- lightningplosion_bluebolts511 +-- lightningplosion_stormbolt500 +-- lightningplosion_yellowbolts500 +-- electricbolt + +return { + ["lightningplosion_bluebolts511"] = { + ["electric thingies52"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb]], + }, + }, + }, + + ["lightningplosion_stormbolt500"] = { + lightningballs50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r20, 1.0, -10 r20]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb]], + }, + }, + }, + + ["lightningplosion_yellowbolts500"] = { + ["electric thingies50"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0.0 1 0.01 0.0 0.0 0.5 0.01 0 0 1 0.01 0.0 0.0 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + sparks50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0 0.0 1 0.01 0.0 0.3 0.4 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 40, + particlelife = 20, + particlelifespread = 5, + particlesize = 6, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["electricbolt"] = { + bluebolts51 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS511]], + pos = [[0, 0, 0]], + }, + }, + electricstorm50 = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT500]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserendred]], + }, + }, + yellowbolts50 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS500]], + pos = [[0, 0, 0]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/electricbolt.tdf b/Gamedata/explosions/electricbolt.tdf deleted file mode 100644 index 5b2eefa9b..000000000 --- a/Gamedata/explosions/electricbolt.tdf +++ /dev/null @@ -1,200 +0,0 @@ -[electricbolt] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendred; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm50] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT500; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts50] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS500; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts51] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS511; - } - air=1; - water=1; - ground=1; - count=1; - } -} - - -[LIGHTNINGPLOSION_BLUEBOLTS511] -{ - [electric thingies52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=15; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} -[LIGHTNINGPLOSION_YELLOWBOLTS500] -{ - [electric thingies50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0.0 1 0.01 0.0 0.0 0.5 0.01 0 0 1 0.01 0.0 0.0 0.5 0.01 0 0 0 0.01; - Texture=whitelightb; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=0 0.0 1 0.01 0.0 0.3 0.4 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=40; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=6; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT500] -{ - [lightningballs50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r20, 1.0, -10 r20; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/electricity.lua b/Gamedata/explosions/electricity.lua new file mode 100644 index 000000000..a276ae477 --- /dev/null +++ b/Gamedata/explosions/electricity.lua @@ -0,0 +1,138 @@ +-- electricity +-- emptowerexplosion + +return { + ["electricity"] = { + usedefaultexplosions = false, + lightball50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball52 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + + ["emptowerexplosion"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 2.4, + flashalpha = 1, + flashsize = 100, + ground = true, + ttl = 250, + water = true, + color = { + [1] = 0.40000000596046, + [2] = 0.40000000596046, + [3] = 0.60000002384186, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/electricity.tdf b/Gamedata/explosions/electricity.tdf deleted file mode 100644 index 06d900de7..000000000 --- a/Gamedata/explosions/electricity.tdf +++ /dev/null @@ -1,151 +0,0 @@ -[electricity] -{ - usedefaultexplosions=0; - [lightball50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - - -[EMPTOWEREXPLOSION] -{ - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - flashSize = 100; - flashAlpha = 1; - circleGrowth = 2.4; - circleAlpha = 1; - ttl = 250; - color = 0.4, 0.4, 0.6; - alwaysvisible=1; - - air=1; - ground=1; - water=1; - } -} - diff --git a/Gamedata/explosions/emp_overseer.lua b/Gamedata/explosions/emp_overseer.lua new file mode 100644 index 000000000..3e19ea170 --- /dev/null +++ b/Gamedata/explosions/emp_overseer.lua @@ -0,0 +1,242 @@ +-- empoverseershot +-- empoverseerdeath + +return { + ["empoverseershot"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 20, + flashalpha = 0.9, + flashsize = 500, + ground = true, + ttl = 20, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 75, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["empoverseerdeath"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 700, + ground = true, + ttl = 120, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 75, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/emp_overseer.tdf b/Gamedata/explosions/emp_overseer.tdf deleted file mode 100644 index f3263b04d..000000000 --- a/Gamedata/explosions/emp_overseer.tdf +++ /dev/null @@ -1,305 +0,0 @@ -[EMPOVERSEERDEATH] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 75; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 120; - flashSize = 700; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0.0, 0.5, 1.0; - - air=1; - ground=1; - water=1; - } -} - - - - - -[EMPOVERSEERSHOT] -{ - [ELECTRIC1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 45; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [ELECTRIC2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 9; - sizeGrowth = 75; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 30; - sizeGrowth = 75; - - pos = 0, 5, 0; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 16; - particleSpeed = 21; - particleSpeedSpread = 15; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.01; - - startSize = 10; - sizeExpansion = 0.6; - size = 50; - sizeGrowth = 15; - - pos = r-60 r60, 24, r-60 r60; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=8; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 500; - flashAlpha = 0.9; - - circleGrowth = 20; - circleAlpha = 0.6; - - color = 0.0, 0.5, 1.0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/empty.lua b/Gamedata/explosions/empty.lua new file mode 100644 index 000000000..cd82d4c29 --- /dev/null +++ b/Gamedata/explosions/empty.lua @@ -0,0 +1,65 @@ +-- empty + +return { + ["empty"] = { + empty = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0, -0.5, 0]], + numparticles = 0, + particlelife = 0, + particlelifespread = 0, + particlesize = 0, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 0, + texture = [[shell]], + }, + }, + }, + + ["emptydirt"] = { + empty = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[dir]], + gravity = [[0, -0.5, 0]], + numparticles = 0, + particlelife = 0, + particlelifespread = 0, + particlesize = 0, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 0, + texture = [[shell]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/empty.tdf b/Gamedata/explosions/empty.tdf deleted file mode 100644 index c9d52d0c6..000000000 --- a/Gamedata/explosions/empty.tdf +++ /dev/null @@ -1,32 +0,0 @@ -[empty] -{ - [empty] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, -0.5, 0; - colorMap=1 1 1 1 1 1 1 1; - Texture=shell; - airdrag=0.97; - particleLife=0; - particleLifeSpread=0; - numParticles=0; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=0; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/evobooms.lua b/Gamedata/explosions/evobooms.lua new file mode 100644 index 000000000..450901db0 --- /dev/null +++ b/Gamedata/explosions/evobooms.lua @@ -0,0 +1,616 @@ +-- largeunitexp +-- smallunitexp +-- medunitexp +-- medunitexpgreen + +return { + ["largeunitexp"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.1, 0.3, 0.0]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 60, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 0.0 0.04 0.8 0.2 0.2 0.01 0.4 0.2 0.2 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[firenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightredexplo]], + }, + }, + }, + + ["smallunitexp"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["medunitexp"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.0, 0.3, 1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.8 0.2 0.8 0.01 0.4 0.2 0.4 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.8 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightpinkexplo]], + }, + }, + }, + + ["medunitexpgreen"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.0, 1, 0.3]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[0.0, 1, 0.3]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.0 1.0 0.0 0.04 0.2 0.8 0.2 0.01 0.2 0.4 0.2 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[greennovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[brightgreenexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/evobooms.tdf b/Gamedata/explosions/evobooms.tdf deleted file mode 100644 index 898fa186c..000000000 --- a/Gamedata/explosions/evobooms.tdf +++ /dev/null @@ -1,771 +0,0 @@ -[SMALLUNITEXP] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.2 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.2 0.2 0.8 0.01 0.2 0.2 0.4 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - -[MEDUNITEXP] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.0, 0.3, 1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightpinkexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.8 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.8 0.2 0.8 0.01 0.4 0.2 0.4 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 30; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - -[MEDUNITEXPGREEN] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.0, 1, 0.3; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 1, 0.3; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightgreenexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 0.0 1.0 0.0 0.04 0.2 0.8 0.2 0.01 0.2 0.4 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 30; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - -[LARGEUNITEXP] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=0.1, 0.3, 0.0; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color= 0.0, 0.3, 1; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=firenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightredexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 12; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 0.0 0.04 0.8 0.2 0.2 0.01 0.4 0.2 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 3; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 60; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/explosions.lua b/Gamedata/explosions/explosions.lua new file mode 100644 index 000000000..90f6dafaf --- /dev/null +++ b/Gamedata/explosions/explosions.lua @@ -0,0 +1,344 @@ +-- purpleimpact1 +-- bigbomb_explosion +-- burnpurple +-- purpleimpact2 +-- red_explosion + +return { + ["purpleimpact1"] = { + dirt = { + count = 2, + ground = true, + water = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[1, 0.2, 1]], + pos = [[-10 r20, 20, -10 r20]], + size = 10, + speed = [[0.75 r-1.5, 1.7 r1.6, 0.75 r-1.5]], + }, + }, + gfx = { + count = 25, + water = true, + properties = { + alwaysvisible = true, + color = 200, + creationtime = 2, + lifetime = 10, + pos = [[-8 r8, 0 r15, -8 r8]], + speed = [[0.5 r-0.5, 0.7 r1.6, 0.5 r-0.5]], + }, + }, + groundflash = { + alwaysvisible = true, + circlealpha = 0.4, + circlegrowth = 10, + flashalpha = 5, + flashsize = 50, + ttl = 10, + color = { + [1] = 0.80000001192093, + [2] = 0, + [3] = 0.80000001192093, + }, + }, + heatcloud = { + air = false, + count = 6, + ground = true, + underwater = 0, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 10, + pos = [[0, 20, 0]], + size = 20, + sizegrowth = 0.2, + }, + }, + }, + + ["bigbomb_explosion"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 5, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 15, + pos = [[r-2 r2, 3, r-2 r2]], + size = 100, + sizegrowth = 0.9, + speed = [[0, 1 0, 0]], + texture = [[redexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.5, + maxheat = 15, + pos = [[r-55 r55, 5, r-55 r55]], + size = [[90 r-1.5]], + sizegrowth = 0.9, + speed = [[r-1 r1, 1 0, r-1 r1]], + texture = [[bigexplo]], + }, + }, + smoke = { + air = true, + count = 5, + ground = true, + water = true, + properties = { + agespeed = 0.04, + alwaysvisible = true, + color = 0.6, + pos = [[r-30 r30, 10 r10, r-30 r30]], + size = 80, + sizeexpansion = 0.5, + sizegrowth = 15, + speed = [[0, 1 r9, 0]], + startsize = 40, + texture = [[bigexplosmoke]], + }, + }, + }, + + ["burnpurple"] = { + dirt = { + count = 2, + ground = true, + water = true, + properties = { + alphafalloff = 3, + alwaysvisible = true, + color = [[0.8, 0.1, 0.8]], + pos = [[-10 r20, 0, -10 r20]], + speed = [[0.75 r-1.5, 1.7 r1.6, 0.75 r-1.5]], + }, + }, + gfx = { + count = 25, + water = true, + properties = { + alwaysvisible = true, + color = 200, + creationtime = 2, + lifetime = 10, + pos = [[-8 r8, 0 r15, -8 r8]], + speed = [[0.5 r-0.5, 0.7 r1.6, 0.5 r-0.5]], + }, + }, + groundflash = { + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 10, + ttl = 8, + color = { + [1] = 0.5, + [2] = 0, + [3] = 0.5, + }, + }, + heatcloud = { + air = true, + count = 6, + ground = true, + properties = { + alwaysvisible = true, + heat = 6, + heatfalloff = 2, + maxheat = 10, + pos = [[-10 r10, r10,-10 r10]], + size = 10, + sizegrowth = -0.2, + speed = [[-1 r2, r2, -1 r2]], + }, + }, + }, + + ["purpleimpact2"] = { + groundflash = { + circlealpha = 0.4, + circlegrowth = 10, + flashalpha = 5, + flashsize = 30, + ttl = 10, + color = { + [1] = 0.80000001192093, + [2] = 0, + [3] = 0.80000001192093, + }, + }, + heatcloud = { + air = false, + count = 6, + ground = true, + underwater = 0, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 2, + maxheat = 10, + pos = [[-10 r20, r20,-10 r20]], + size = 20, + sizegrowth = 0.2, + texture = [[pinkexplo]], + }, + }, + }, + + ["red_explosion"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.4, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 70, + ground = true, + ttl = 20, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.5, + maxheat = 15, + pos = [[0, 0 0, 0]], + size = [[35 r-1.5]], + sizegrowth = 0.75, + speed = [[1 r0.35, 0 0, 1 r0.35]], + texture = [[redexplo]], + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.04, + alwaysvisible = true, + color = 0.1, + pos = [[0, -1, 0]], + size = 30, + sizeexpansion = -0.6, + sizegrowth = 15, + speed = [[0, 1 r1.3, 0]], + startsize = 10, + }, + }, + smoke00 = { + air = true, + class = [[smoke]], + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.08, + alwaysvisible = true, + color = [[0.3 r0.3]], + pos = [[0, 0 r4, 0]], + size = [[1 r5]], + sizegrowth = 1, + speed = [[0 r-3, 0, 0 r-3]], + }, + }, + smoke01 = { + air = true, + class = [[smoke]], + count = 10, + ground = true, + water = true, + properties = { + agespeed = 0.08, + alwaysvisible = true, + color = [[0.3 r0.3]], + pos = [[0, 0 r4, 0]], + size = [[15 r5]], + sizegrowth = 1, + speed = [[0 r3, 0, 0 r3]], + }, + }, + smoke02 = { + air = true, + class = [[smoke]], + count = 10, + ground = true, + water = true, + properties = { + agespeed = 0.08, + alwaysvisible = true, + color = [[0.3 r0.3]], + pos = [[0, 0 r4, 0]], + size = [[15 r5]], + sizegrowth = 1, + speed = [[0 r3, 0, 0 r-3]], + }, + }, + smoke04 = { + air = true, + class = [[smoke]], + count = 10, + ground = true, + water = true, + properties = { + agespeed = 0.08, + alwaysvisible = true, + color = [[0.3 r0.3]], + pos = [[0, 0 r4, 0]], + size = [[15 r5]], + sizegrowth = 1, + speed = [[0 r-3, 0, 0 r3]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/explosions.tdf b/Gamedata/explosions/explosions.tdf deleted file mode 100644 index 6f88d67b6..000000000 --- a/Gamedata/explosions/explosions.tdf +++ /dev/null @@ -1,409 +0,0 @@ -[BIGBOMB_EXPLOSION] -{ - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bigexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.5; - - size = 90 r-1.5; - sizeGrowth = 0.9; - - pos = r-55 r55, 5, r-55 r55; - speed=r-1 r1, 1 0, r-1 r1; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=redexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.4; - - size = 100; - sizeGrowth = 0.9; - - pos = r-2 r2, 3, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=5; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - texture=bigexplosmoke; - color = 0.6; - ageSpeed=0.04; - - startSize = 40; - sizeExpansion = 0.5; - size = 80; - sizeGrowth = 15; - - pos = r-30 r30, 10 r10, r-30 r30; - speed=0, 1 r9, 0; - } - air=1; - water=1; - ground=1; - count=5; - } - - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.3, 0; - - air=1; - ground=1; - water=1; - } - -} - -[BURNPURPLE] -{ - [heatcloud] - { - [properties] - { - alwaysVisible=1; - pos = -10 r10, r10,-10 r10; - speed = -1 r2, r2, -1 r2; - heat = 6; - maxheat=10; - heatFalloff=2; - size = 10; - sizeGrowth=-0.2; - } - air=1; - ground=1; - count=6; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - color=0.8, 0.1, 0.8; - alphaFalloff=3; - speed=0.75 r-1.5, 1.7 r1.6, 0.75 r-1.5; - pos=-10 r20, 0, -10 r20; - } - ground=1; - water=1; - count=2; - } - [gfx] - { - [properties] - { - alwaysVisible=1; - creationTime=2; - lifeTime= 10; - color=200; - speed=0.5 r-0.5, 0.7 r1.6, 0.5 r-0.5; - pos=-8 r8, 0 r15, -8 r8; - } - - water=1; - count=25; - } - [groundflash] - { - alwaysVisible=1; - flashSize = 10; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 1; - ttl = 8; - color = 0.5, 0.0, 0.5; - } -} - - -[PurpleImpact1] -{ - [heatcloud] - { - [properties] - { - alwaysVisible=1; - pos = 0, 20, 0; - heat = 10; - maxheat=10; - heatFalloff=1; - size = 20; - sizeGrowth=0.2; - } - water=1; - air=0; - underwater=0; - ground=1; - count=6; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=10; - color=1, 0.2, 1; - alphaFalloff=2; - speed=0.75 r-1.5, 1.7 r1.6, 0.75 r-1.5; - pos=-10 r20, 20, -10 r20; - } - ground=1; - water=1; - count=2; - } - [gfx] - { - [properties] - { - alwaysVisible=1; - creationTime=2; - lifeTime= 10; - color=200; - speed=0.5 r-0.5, 0.7 r1.6, 0.5 r-0.5; - pos=-8 r8, 0 r15, -8 r8; - } - - water=1; - count=25; - } - [groundflash] - { - alwaysVisible=1; - flashSize = 50; - flashAlpha = 5; - circleGrowth = 10; - circleAlpha = 0.4; - ttl = 10; - color = 0.8, 0, 0.8; - } -} - - - -[PurpleImpact2] -{ - [heatcloud] - { - [properties] - { - alwaysVisible=1; - pos = -10 r20, r20,-10 r20; - texture=pinkexplo; - heat = 10; - maxheat=10; - heatFalloff=2; - size = 20; - sizeGrowth=0.2; - } - water=1; - air=0; - underwater=0; - ground=1; - count=6; - } - - [groundflash] - { - flashSize = 30; - flashAlpha = 5; - circleGrowth = 10; - circleAlpha = 0.4; - ttl = 10; - color = 0.8, 0, 0.8; - } -} - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////UNIT EXPLOSIONS/////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -[RED_EXPLOSION] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=redexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.5; - size = 35 r-1.5; - sizeGrowth = 0.75; - - pos = 0, 0 0, 0; - speed=1 r0.35, 0 0, 1 r0.35; - } - air=1; - water=1; - ground=1; - count=2; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - startSize = 10; - sizeExpansion = -0.6; - ageSpeed=0.04; - - size = 30; - sizeGrowth = 15; - - pos = 0, -1, 0; - speed=0, 1 r1.3, 0; - } - air=1; - water=1; - ground=1; - count=8; - } - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - [smoke00] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color=0.3 r0.3; - ageSpeed=0.08; - - size = 1 r5; - sizeGrowth = 1; - - pos = 0, 0 r4, 0; - speed= 0 r-3, 0, 0 r-3; - } - air=1; - water=1; - ground=1; - count=3; - } - - [smoke01] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color=0.3 r0.3; - ageSpeed=0.08; - - size = 15 r5; - sizeGrowth = 1; - - pos = 0, 0 r4, 0; - speed=0 r3, 0, 0 r3; - } - air=1; - water=1; - ground=1; - count=10; - } - - [smoke02] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color=0.3 r0.3; - ageSpeed=0.08; - - size = 15 r5; - sizeGrowth = 1; - - pos = 0, 0 r4, 0; - speed= 0 r3, 0, 0 r-3; - } - air=1; - water=1; - ground=1; - count=10; - } - - [smoke04] - { - class=smoke; - [properties] - { - alwaysVisible=1; - color=0.3 r0.3; - ageSpeed=0.08; - - size = 15 r5; - sizeGrowth = 1; - - pos = 0, 0 r4, 0; - speed=0 r-3, 0, 0 r3; - } - air=1; - water=1; - ground=1; - count=10; - } - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - [groundflash] - { - alwaysVisible=1; - flashSize = 70; - flashAlpha = 0.9; - circleGrowth = 8; - circleAlpha = 0.4; - ttl = 20; - color = 1, 0.3, 0; - air=1; - ground=1; - water=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/f1.lua b/Gamedata/explosions/f1.lua new file mode 100644 index 000000000..3f2ae7ae5 --- /dev/null +++ b/Gamedata/explosions/f1.lua @@ -0,0 +1,79 @@ +-- f1 + +return { + ["f1"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.6 0.5 0.0 0.01 0.3 0.2 0.1 0.01 0.01 0.01 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 20, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.6 0.4 0.0 0.01 0.3 0.2 0.1 0.01 0.01 0.01 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 15, + particlelifespread = 5, + particlesize = 3, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1.2, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 1, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f1.tdf b/Gamedata/explosions/f1.tdf deleted file mode 100644 index ad1a1c05c..000000000 --- a/Gamedata/explosions/f1.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[f1] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 1; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 10; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.1 0.1 0.1 0.01 0.6 0.5 0.0 0.01 0.3 0.2 0.1 0.01 0.01 0.01 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 2; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 20; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 10; - particleSize = 2; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.1 0.1 0.1 0.01 0.6 0.4 0.0 0.01 0.3 0.2 0.1 0.01 0.01 0.01 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 2; - emitRotSpread = 1; - - sizeGrowth = 1.2; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/f2.lua b/Gamedata/explosions/f2.lua new file mode 100644 index 000000000..c2116a235 --- /dev/null +++ b/Gamedata/explosions/f2.lua @@ -0,0 +1,79 @@ +-- f2 + +return { + ["f2"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.01 0.5 0.1 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 20, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.01 0.5 0.1 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 2, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 15, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f2.tdf b/Gamedata/explosions/f2.tdf deleted file mode 100644 index 9cad8ae24..000000000 --- a/Gamedata/explosions/f2.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[f2] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 5; - sizeGrowth = 10; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.01 0.5 0.1 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 2; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 20; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 10; - particleSize = 7; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.01 0.5 0.1 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 2; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/f3.lua b/Gamedata/explosions/f3.lua new file mode 100644 index 000000000..57a603f7e --- /dev/null +++ b/Gamedata/explosions/f3.lua @@ -0,0 +1,156 @@ +-- f3mech +-- f3 + +return { + ["f3mech"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 0.5 0.1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 75, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 0.5 0.1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 75, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["f3"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.5 1 0.01 0.8 0.3 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 50, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 1, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 0, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.1 0.1 0.1 0.01 0.4 0.4 1 0.01 0.8 0.3 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 50, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 2, + sizegrowth = 5, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f3.tdf b/Gamedata/explosions/f3.tdf deleted file mode 100644 index a7caab378..000000000 --- a/Gamedata/explosions/f3.tdf +++ /dev/null @@ -1,203 +0,0 @@ -[f3] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 2; - sizeGrowth = 5; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.5 1 0.01 0.8 0.3 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 1; - - particleLife = 50; - particleLifeSpread = 0; - numParticles = 10; - particleSpeed = 8; - particleSpeedSpread = 2; - particleSize = 2; - particleSizeSpread = 1; - - directional = 1; - useAirLos = 1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.1 0.1 0.1 0.01 0.4 0.4 1 0.01 0.8 0.3 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 1; - - particleLife = 50; - particleLifeSpread = 5; - numParticles = 10; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - water=1; - air=1; - ground=1; - count=1; - } - -} - -[f3MECH] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 5; - sizeGrowth = 10; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.1 0.1 0.1 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 1 0.5 0.5 0.01 0.5 0.1 1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 75; - particleLifeSpread = 5; - numParticles = 3; - particleSpeed = 2; - particleSpeedSpread = 10; - particleSize = 15; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.1 0.1 0.1 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 1 0.4 0.4 0.01 0.5 0.1 1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 75; - particleLifeSpread = 5; - numParticles = 3; - particleSpeed = 2; - particleSpeedSpread = 10; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/f4.lua b/Gamedata/explosions/f4.lua new file mode 100644 index 000000000..25bdfd20a --- /dev/null +++ b/Gamedata/explosions/f4.lua @@ -0,0 +1,79 @@ +-- f4 + +return { + ["f4"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.5 0.7 0.5 0.001 0.0 0.2 0.1 0.01 0.0 0.2 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 4, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.5 0.7 0.5 0.001 0.0 0.2 0.1 0.01 0.0 0.2 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[laserendyellow]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f4.tdf b/Gamedata/explosions/f4.tdf deleted file mode 100644 index f8979fc72..000000000 --- a/Gamedata/explosions/f4.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[f4] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserendyellow; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 5; - sizeGrowth = 15; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.5 0.7 0.5 0.001 0.0 0.2 0.1 0.01 0.0 0.2 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 4; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 20; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.5 0.7 0.5 0.001 0.0 0.2 0.1 0.01 0.0 0.2 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 7; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/f5.lua b/Gamedata/explosions/f5.lua new file mode 100644 index 000000000..db3ec0c50 --- /dev/null +++ b/Gamedata/explosions/f5.lua @@ -0,0 +1,79 @@ +-- f5 + +return { + ["f5"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.94 0.69 0.83 0.01 0.6 0.34 0.52 0.01 0.33 0.1 0.1 0.01 1 0 0 0.01]], + directional = true, + emitrot = 4, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.94 0.69 0.83 0.01 0.6 0.34 0.52 0.01 0.33 0.1 0.1 0.01 1 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[laserendyellow]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f5.tdf b/Gamedata/explosions/f5.tdf deleted file mode 100644 index 956edade8..000000000 --- a/Gamedata/explosions/f5.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[f5] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserendyellow; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 5; - sizeGrowth = 15; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.94 0.69 0.83 0.01 0.6 0.34 0.52 0.01 0.33 0.1 0.1 0.01 1 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 4; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 20; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.94 0.69 0.83 0.01 0.6 0.34 0.52 0.01 0.33 0.1 0.1 0.01 1 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 7; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/f6.lua b/Gamedata/explosions/f6.lua new file mode 100644 index 000000000..1acf0e0ca --- /dev/null +++ b/Gamedata/explosions/f6.lua @@ -0,0 +1,79 @@ +-- f6 + +return { + ["f6"] = { + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.9 0.9 0.1 0.001 0.4 0.5 0.0 0.01 0.1 0.5 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 7, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = true, + }, + }, + searinggreenflames = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.9 0.9 0.1 0.001 0.4 0.5 0.0 0.01 0.1 0.5 0.1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 4, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 6, + particlelife = 15, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 4, + particlespeed = 2, + particlespeedspread = 30, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[fire]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 5, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[laserendyellow]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/f6.tdf b/Gamedata/explosions/f6.tdf deleted file mode 100644 index 0015efafe..000000000 --- a/Gamedata/explosions/f6.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[f6] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserendyellow; - heat = 5; - maxheat = 15; - heatFalloff = 1; - - size = 5; - sizeGrowth = 15; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searinggreenflames] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=fire; - - colorMap = 0.9 0.9 0.1 0.001 0.4 0.5 0.0 0.01 0.1 0.5 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 4; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 20; - particleSizeSpread = 4; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flashside2; - - colorMap = 0.9 0.9 0.1 0.001 0.4 0.5 0.0 0.01 0.1 0.5 0.1 0.01 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 15; - particleLifeSpread = 5; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 30; - particleSize = 7; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/factory_explosion.lua b/Gamedata/explosions/factory_explosion.lua new file mode 100644 index 000000000..6c625f92a --- /dev/null +++ b/Gamedata/explosions/factory_explosion.lua @@ -0,0 +1,367 @@ +-- factory_explosion_medium +-- factory_explosion +-- factory_explosion_small + +return { + ["factory_explosion_medium"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 128, + ground = true, + ttl = 10, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 180, + particlelife = 25, + particlelifespread = 10, + particlesize = 7, + particlesizespread = 3, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 2, + sizegrowth = 14, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + smokeblack = { + air = true, + class = [[smoke]], + count = 22, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 25, + sizeexpansion = 0.3, + sizegrowth = 7, + speed = [[r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0]], + startsize = 5, + }, + }, + smokegrey = { + air = true, + class = [[smoke]], + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.02, + alwaysvisible = true, + color = 0.8, + pos = [[r-60 r60, 24, r-60 r60]], + size = 25, + sizeexpansion = 0.3, + sizegrowth = 7, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 5, + }, + }, + }, + + ["factory_explosion"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 256, + ground = true, + ttl = 20, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 180, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 5, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 5, + sizegrowth = 28, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + smokeblack = { + air = true, + class = [[smoke]], + count = 22, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0]], + startsize = 10, + }, + }, + smokegrey = { + air = true, + class = [[smoke]], + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.02, + alwaysvisible = true, + color = 0.8, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + }, + + ["factory_explosion_small"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.9, + flashsize = 66, + ground = true, + ttl = 5, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 180, + particlelife = 25, + particlelifespread = 10, + particlesize = 4, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 2.5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 7, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + smokeblack = { + air = true, + class = [[smoke]], + count = 22, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 12, + sizeexpansion = 0.2, + sizegrowth = 4, + speed = [[r-4.0 r4.0, -1.5 r-1.0, r-4.0 r4.0]], + startsize = 2.5, + }, + }, + smokegrey = { + air = true, + class = [[smoke]], + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.02, + alwaysvisible = true, + color = 0.8, + pos = [[r-60 r60, 24, r-60 r60]], + size = 12, + sizeexpansion = 0.2, + sizegrowth = 4, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 2.5, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/factorydustsmall.lua b/Gamedata/explosions/factorydustsmall.lua new file mode 100644 index 000000000..d1eb9e2fe --- /dev/null +++ b/Gamedata/explosions/factorydustsmall.lua @@ -0,0 +1,36 @@ +-- factorydustsmall + +return { + ["factorydustsmall"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 80, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/factorydustsmall.tdf b/Gamedata/explosions/factorydustsmall.tdf deleted file mode 100644 index 6801d830a..000000000 --- a/Gamedata/explosions/factorydustsmall.tdf +++ /dev/null @@ -1,40 +0,0 @@ -[factorydustsmall] -{ - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap=0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=15; - particleLifeSpread=10; - - numParticles=80; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=0; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/factorysparks.lua b/Gamedata/explosions/factorysparks.lua new file mode 100644 index 000000000..1a470849f --- /dev/null +++ b/Gamedata/explosions/factorysparks.lua @@ -0,0 +1,79 @@ +-- factorysparks + +return { + ["factorysparks"] = { + sparks1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.1 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 4, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, 0, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + sparks2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.1 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 4, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, r6, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + heat = 6, + heatfalloff = 2, + maxheat = 6, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 6, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/factorysparks.tdf b/Gamedata/explosions/factorysparks.tdf deleted file mode 100644 index 07eb85577..000000000 --- a/Gamedata/explosions/factorysparks.tdf +++ /dev/null @@ -1,97 +0,0 @@ -[factorysparks] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 6; - maxheat = 6; - heatFalloff = 2; - - size = 1; - sizeGrowth = 6; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [sparks1] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.1 0.01 0.1 0.1 0.5 0.01; - - pos = r3, 0, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 4; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [sparks2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.1 0.05; - - pos = r3, r6, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 4; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/fatsoimpact.lua b/Gamedata/explosions/fatsoimpact.lua new file mode 100644 index 000000000..8302bd481 --- /dev/null +++ b/Gamedata/explosions/fatsoimpact.lua @@ -0,0 +1,197 @@ +-- fatsoimpact + +return { + ["fatsoimpact"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.3 0.4 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fatsoimpact.tdf b/Gamedata/explosions/fatsoimpact.tdf deleted file mode 100644 index fd55a7278..000000000 --- a/Gamedata/explosions/fatsoimpact.tdf +++ /dev/null @@ -1,259 +0,0 @@ -[fatsoimpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electnovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 20; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.3 0.4 0.5 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=10; - particleSpeedSpread=1; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/fightershot.lua b/Gamedata/explosions/fightershot.lua new file mode 100644 index 000000000..ff96d5daa --- /dev/null +++ b/Gamedata/explosions/fightershot.lua @@ -0,0 +1,51 @@ +return { + ["fightershot"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 1, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 7, + speed = [[0, 0, 0]], + texture = [[LightningStrike]], + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/fireimpact.lua b/Gamedata/explosions/fireimpact.lua new file mode 100644 index 000000000..516a7a163 --- /dev/null +++ b/Gamedata/explosions/fireimpact.lua @@ -0,0 +1,42 @@ +-- fireimpact + +return { + ["fireimpact"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.0, + circlegrowth = 9, + flashalpha = 0.3, + flashsize = 50, + ground = true, + ttl = 7, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.10000000149012, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.7, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fireimpact.tdf b/Gamedata/explosions/fireimpact.tdf deleted file mode 100644 index 25e387f15..000000000 --- a/Gamedata/explosions/fireimpact.tdf +++ /dev/null @@ -1,44 +0,0 @@ -[fireimpact] -{ - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.7; - - size = 5; - sizeGrowth = 10; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 7; - flashSize = 50; - flashAlpha = 0.3; - - circleGrowth = 9; - circleAlpha = 0.0; - - color = 1, 0.7, 0.1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/flame.lua b/Gamedata/explosions/flame.lua new file mode 100644 index 000000000..62042afe7 --- /dev/null +++ b/Gamedata/explosions/flame.lua @@ -0,0 +1,57 @@ +-- flame + +return { + ["flame"] = { + groundflash = { + air = true, + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.8, + flashsize = 12, + ground = true, + ttl = 60, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.20000000298023, + }, + }, + heatcloud = { + air = true, + count = 1, + ground = true, + water = true, + properties = { + heat = 15, + heatfalloff = 1, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1.25, + sizegrowth = 0.5, + sizemod = 0, + sizemodmod = 0, + speed = [[0, 2, 0]], + texture = [[ExplodeHeat]], + }, + }, + smoke = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.03, + color = 0.1, + pos = [[5 r-5, 5 r-5, 5 r-5]], + size = 2.5, + sizeexpansion = 0.5, + sizegrowth = 0.5, + speed = [[0, 2 r0.5, 0]], + startsize = 0.75, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/flame.tdf b/Gamedata/explosions/flame.tdf deleted file mode 100644 index 710061bf9..000000000 --- a/Gamedata/explosions/flame.tdf +++ /dev/null @@ -1,53 +0,0 @@ -[FLAME] -{ -[heatcloud] - { - [properties] - { - texture=ExplodeHeat; - heat = 15; - maxheat = 15; - heatFalloff = 1; - size = 1.25; - sizeGrowth = 0.5; - sizemod = 0; - sizemodmod = 0; - speed = 0, 2, 0; - pos = 0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } -[smoke] - { - [properties] - { - color = 0.1; - startSize = 0.75; - sizeExpansion = 0.5; - ageSpeed=0.03; - size = 2.5; - sizeGrowth = 0.5; - pos = 5 r-5, 5 r-5, 5 r-5; - speed=0, 2 r0.5, 0; - } - air=1; - water=1; - ground=1; - count=3; - } -[groundflash] - { - flashSize = 12; - flashAlpha = 0.8; - circleGrowth = 0; - circleAlpha = 0; - ttl = 60; - color = 1, 0.3, 0.2; - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/flamethrowerrange1000.lua b/Gamedata/explosions/flamethrowerrange1000.lua new file mode 100644 index 000000000..65eec0558 --- /dev/null +++ b/Gamedata/explosions/flamethrowerrange1000.lua @@ -0,0 +1,36 @@ +-- flamethrowerrange1000 + +return { + ["flamethrowerrange1000"] = { + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.01 0.01 0.01 0.005 0.04 0.04 0.1 0.005 0.08 0.03 0.01 0.005 0 0 0 0.05 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 30, + particlelife = 120, + particlelifespread = 5, + particlesize = [[2 r3]], + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flame]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/flamethrowerrange500.lua b/Gamedata/explosions/flamethrowerrange500.lua new file mode 100644 index 000000000..f981dce38 --- /dev/null +++ b/Gamedata/explosions/flamethrowerrange500.lua @@ -0,0 +1,36 @@ +-- flamethrowerrange500 + +return { + ["flamethrowerrange500"] = { + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.01 0.01 0.01 0.005 0.04 0.04 0.1 0.005 0.08 0.03 0.01 0.005 0 0 0 0.05 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 30, + particlelife = 60, + particlelifespread = 5, + particlesize = [[2 r3]], + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flame]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/flamethrowerrange500.tdf b/Gamedata/explosions/flamethrowerrange500.tdf deleted file mode 100644 index 2b4ba0b74..000000000 --- a/Gamedata/explosions/flamethrowerrange500.tdf +++ /dev/null @@ -1,45 +0,0 @@ -[flamethrowerrange500] -{ - [searingflame2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=flame; - - colorMap = 0.01 0.01 0.01 0.005 0.04 0.04 0.1 0.005 0.08 0.03 0.01 0.005 0 0 0 0.05 0 0 0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0.05, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 1; - - particleLife = 60; - particleLifeSpread = 5; - numParticles = 30; - particleSpeed = 8; - particleSpeedSpread = 3; - particleSize = 2 r3; - particleSizeSpread = 0; - - directional = 1; - - emitVector=dir; - emitRotSpread=5; - - useAirLos = 1; - } - water=1; - air=1; - ground=1; - count=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/flamethrowerrange750.lua b/Gamedata/explosions/flamethrowerrange750.lua new file mode 100644 index 000000000..afd9dd63f --- /dev/null +++ b/Gamedata/explosions/flamethrowerrange750.lua @@ -0,0 +1,36 @@ +-- flamethrowerrange750 + +return { + ["flamethrowerrange750"] = { + searingflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.01 0.01 0.01 0.005 0.04 0.04 0.1 0.005 0.08 0.03 0.01 0.005 0 0 0 0.05 0 0 0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 15, + particlelife = 90, + particlelifespread = 5, + particlesize = [[2 r3]], + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 3, + pos = [[0, 0, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[flame]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fusionelectrical.lua b/Gamedata/explosions/fusionelectrical.lua new file mode 100644 index 000000000..e69631ee1 --- /dev/null +++ b/Gamedata/explosions/fusionelectrical.lua @@ -0,0 +1,36 @@ +-- fusionelectrical + +return { + ["fusionelectrical"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.1 r0.3, 0, 0.1r0.3]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 20, + particlesize = [[3 r4]], + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 3, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.0, + sizemod = 1.0, + texture = [[electricalarc]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fusionelectrical.tdf b/Gamedata/explosions/fusionelectrical.tdf deleted file mode 100644 index 954191257..000000000 --- a/Gamedata/explosions/fusionelectrical.tdf +++ /dev/null @@ -1,41 +0,0 @@ -[fusionelectrical] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=electricalarc; - sizeGrowth=1.0; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0.1 r0.3, 0, 0.1r0.3; - gravity = 0, 0, 0; - - colorMap = 1 1 1 1 1 1 1 1; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=20; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=3; - particleSize=3 r4; - particleSizeSpread=10; - - emitRot=0; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/fusionfx.lua b/Gamedata/explosions/fusionfx.lua new file mode 100644 index 000000000..8f1392596 --- /dev/null +++ b/Gamedata/explosions/fusionfx.lua @@ -0,0 +1,145 @@ +-- fusionfx + +return { + ["fusionfx"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[1, 0.3, 0]], + expansionspeed = [[10 r3]], + ttl = 5, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.1, + width = 1, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 4, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.8 0.2 0.2 0.01 0.4 0.2 0.2 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 0.4, + sizemod = 0.5, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 0.5, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.5, + sizegrowth = 6, + speed = [[0, 1, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fusionfx.tdf b/Gamedata/explosions/fusionfx.tdf deleted file mode 100644 index 8f55fc81d..000000000 --- a/Gamedata/explosions/fusionfx.tdf +++ /dev/null @@ -1,177 +0,0 @@ -[fusionfx] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=1; - length=0.1; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=5; - alpha=0.4; - expansionSpeed=10 r3; - color= 1, 0.3, 0; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 0.5; - sizeGrowth = 8; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 0.5; - sizeGrowth = 6; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.3; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.8 0.2 0.2 0.01 0.4 0.2 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.4; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 4; - circleAlpha = 0.5; - - color = 1, 0.3, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/fusionreaction.lua b/Gamedata/explosions/fusionreaction.lua new file mode 100644 index 000000000..eb26133d0 --- /dev/null +++ b/Gamedata/explosions/fusionreaction.lua @@ -0,0 +1,1552 @@ +-- fusionreactionstorage +-- fusionreactionhoverfac +-- fusionreactionmaker +-- fusionreactionbasic +-- fusionreactionnuclear +-- fusionreactiongeo +-- fusionreactionmex +-- fusionreaction +-- fusionreactionmakernew +-- fusionreactionstoragenew +-- fusionreactionburrow + +return { + ["fusionreactionstorage"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + underwater_electricarcs1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionhoverfac"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionmaker"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + underwater_electricarcs1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionbasic"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 2, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.7, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + underwater_electricarcs1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 2, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactiongeo"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 2, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.7, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionmex"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 2, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreaction"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + underwater_electricarcs1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionstoragenew"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionstoragenew-blue"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionstoragenew-small"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 0.1, + particlespeedspread = 0.5, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionstoragenew-blue-small"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 0.1, + particlespeedspread = 0.5, + pos = [[0, 2, 0]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionburrow"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0.5 0.01 0.8 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.7, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + underwater_electricarcs1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0.5 0.01 0.8 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.7, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + +---------------------------------------------------------- +-- Begin fusionreactionnuclear-small +---------------------------------------------------------- + + ["fusionreactionnuclear-small-1color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclear-small-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-small-2color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclear-small-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-small-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-small-3color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclear-small-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-small-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclear-small-purple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-small-4color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclear-small-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-small-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclear-small-purple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors3 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r120]], + explosiongenerator = [[custom:fusionreactionnuclear-small-green]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-small-orange"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 0.9, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-small-blue"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 0.9, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-small-purple"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.6 0 0.6 0.01 0.3 0 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 0.9, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-small-green"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0.5 0 0.01 0 0.8 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 0.9, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + +---------------------------------------------------------- +-- End fusionreactionnuclear-small +---------------------------------------------------------- + +---------------------------------------------------------- +-- Begin fusionreactionnuclear +---------------------------------------------------------- + + ["fusionreactionnuclear-1color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclearorange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-2color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclearorange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclearblue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-3color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclearorange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclearblue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclearpurple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-4color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r500]], + explosiongenerator = [[custom:fusionreactionnuclearorange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclearblue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclearpurple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors3 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r120]], + explosiongenerator = [[custom:fusionreactionnucleargreen]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclearorange"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclearblue"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclearpurple"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.6 0 0.6 0.01 0.3 0 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnucleargreen"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0.5 0 0.01 0 0.8 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + +---------------------------------------------------------- +-- End fusionreactionnuclear +---------------------------------------------------------- + +---------------------------------------------------------- +-- Begin fusionreactionnuclear-huge +---------------------------------------------------------- + + ["fusionreactionnuclear-huge-1color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r30]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-huge-2color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r30]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-huge-3color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r30]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-purple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-huge-4color"] = { + othercolors = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + --delay = [[10 r30]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-orange]], + --pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r60]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-blue]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors2 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r90]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-purple]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + othercolors3 = { + air = true, + class = [[CExpGenSpawner]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r120]], + explosiongenerator = [[custom:fusionreactionnuclear-huge-green]], + pos = [[0 r15, 1, 0 r15]], + }, + }, + }, + + ["fusionreactionnuclear-huge-orange"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-huge-blue"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-huge-purple"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.6 0 0.6 0.01 0.3 0 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionnuclear-huge-green"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0.5 0 0.01 0 0.8 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + numparticles = 1, + particlelife = 45, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + +---------------------------------------------------------- +-- End fusionreactionnuclear-huge +---------------------------------------------------------- + +---------------------------------------------------------- +-- Begin fusionreactionmaker +---------------------------------------------------------- + + ["fusionreactionmaker-orange"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionmaker-blue"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionmaker-purple"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.6 0 0.6 0.01 0.3 0 0.6 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + + ["fusionreactionmaker-green"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + --alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0 0.5 0 0.01 0 0.8 0.2 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 30, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 70, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0.2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.6, + sizemod = 1, + texture = [[plasmaball]], + useairlos = false, + }, + }, + }, + +---------------------------------------------------------- +-- end fusionreactionmaker +---------------------------------------------------------- + +} + diff --git a/Gamedata/explosions/fusionreaction.tdf b/Gamedata/explosions/fusionreaction.tdf deleted file mode 100644 index 6ae1fefbc..000000000 --- a/Gamedata/explosions/fusionreaction.tdf +++ /dev/null @@ -1,779 +0,0 @@ -[fusionreaction] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionbasic] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactiongeo] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionnuclear] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.7; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 4; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.7; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 4; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionburrow] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0.5 0.01 0.8 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.7; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 4; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0.5 0.01 0.8 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.7; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 4; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionmex] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 3; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - underwater=1; - count=1; - } -} - -[fusionreactionstorage] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionstoragenew] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 15; - - sizeGrowth = 0.2; - sizeMod = 1; - - airdrag = 1; - particleLife = 70; - particleLifeSpread = 1; - numParticles = 4; - particleSpeed = 0.2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 15; - - sizeGrowth = 0.2; - sizeMod = 1; - - airdrag = 1; - particleLife = 70; - particleLifeSpread = 1; - numParticles = 4; - particleSpeed = 0.2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } - - -} - -[fusionreactionmaker] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } -} - -[fusionreactionmakernew] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 30; - - sizeGrowth = 0.4; - sizeMod = 1; - - airdrag = 1; - particleLife = 70; - particleLifeSpread = 1; - numParticles = 4; - particleSpeed = 0.2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [UNDERWATER_ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0 0 0.5 0.01 0 0.5 0.8 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 15; - - sizeGrowth = 0.2; - sizeMod = 1; - - airdrag = 1; - particleLife = 70; - particleLifeSpread = 1; - numParticles = 4; - particleSpeed = 0.2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } - - -} - -[fusionreactionhoverfac] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=plasmaball; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0 0 0.01 0.8 0.5 0 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 45; - particleLifeSpread = 1; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/fx.lua b/Gamedata/explosions/fx.lua new file mode 100644 index 000000000..82229db7d --- /dev/null +++ b/Gamedata/explosions/fx.lua @@ -0,0 +1,198 @@ +-- kampfertail +-- lildirt +-- vernier +-- whitetail +-- gawtail + +return { + ["kampfertail"] = { + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r1 r-1, 0, r-1 r1]], + size = [[10 r-1.5]], + sizegrowth = -0.9, + speed = [[0, r-1.5, 0]], + texture = [[blueexplo]], + }, + }, + }, + + ["lildirt"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1.0, + colormap = [[0.8 0.6 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[r-0.05 r0.05, 0 r0.05, r-0.05 r0.05]], + numparticles = 3, + particlelife = 3, + particlelifespread = 40, + particlesize = 5, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 10, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1.0, + colormap = [[0.8 0.6 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[r-0.1 r0.1, 0 r0.1, r-0.1 r0.1]], + numparticles = 4, + particlelife = 2, + particlelifespread = 20, + particlesize = 10, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + wpoof01 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 1.0, + colormap = [[0.1 0.1 0.3 0.03 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[r-0.05 r0.05, 0 r0.05, r-0.05 r0.05]], + numparticles = 3, + particlelife = 1, + particlelifespread = 40, + particlesize = 5, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 10, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + wpoof02 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 1.0, + colormap = [[0.2 0.2 0.5 0.03 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[r-0.1 r0.1, 0 r0.1, r-0.1 r0.1]], + numparticles = 4, + particlelife = 1, + particlelifespread = 20, + particlesize = 10, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["vernier"] = { + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[0, 0, 0]], + size = [[10 r-1.5]], + sizegrowth = -0.9, + speed = [[0, r-1.5, 0]], + texture = [[flare]], + }, + }, + }, + + ["whitetail"] = { + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r1 r-1, 0, r-1 r1]], + size = [[30 r-1.5]], + sizegrowth = -0.9, + speed = [[0, r-1.5, 0]], + texture = [[blueexplo]], + }, + }, + }, + + ["gawtail"] = { + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[0, 0, 0]], + size = [[5 r-1.5]], + sizegrowth = 0.9, + speed = [[0, 0, 0]], + texture = [[explo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/fx.tdf b/Gamedata/explosions/fx.tdf deleted file mode 100644 index 5686a2f0d..000000000 --- a/Gamedata/explosions/fx.tdf +++ /dev/null @@ -1,235 +0,0 @@ -[gawtail] -{ - [pop2] - { - class=heatcloud; - - [properties] - { - texture=explo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 5 r-1.5; - sizeGrowth = 0.9; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } -} - -[vernier] -{ - [pop2] - { - class=heatcloud; - - [properties] - { - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 10 r-1.5; - sizeGrowth = -0.9; - - pos = 0, 0, 0; - speed=0, r-1.5, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - -} - -[whitetail] -{ - [pop2] - { - class=heatcloud; - - [properties] - { - - texture=blueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 30 r-1.5; - sizeGrowth = -0.9; - - pos = r1 r-1, 0, r-1 r1; - speed=0, r-1.5, 0; - } - air=1; - water=1; - ground=1; - count=2; - } -} - -[lildirt] -{ - - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 0, 0; - gravity=r-0.05 r0.05, 0 r0.05, r-0.05 r0.05; - colorMap= 0.8 0.6 0.5 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=1.0; - particleLife=3; - particleLifeSpread=40; - numParticles=3; - particleSpeed=2; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=0; - emitRot=90; - emitRotSpread=25; - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - } - - - [POOF02] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 1, 0; - gravity=r-0.1 r0.1, 0 r0.1, r-0.1 r0.1; - colorMap= 0.8 0.6 0.5 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=1.0; - particleLife=2; - particleLifeSpread=20; - numParticles=4; - particleSpeed=2; - particleSpeedSpread=1; - particleSize=10; - particleSizeSpread=0; - emitRot=90; - emitRotSpread=25; - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - } - - [wPOOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 0, 0; - gravity=r-0.05 r0.05, 0 r0.05, r-0.05 r0.05; - colorMap= 0.1 0.1 0.3 0.03 0 0 0 0.01; - Texture=dirt; - airdrag=1.0; - particleLife=1; - particleLifeSpread=40; - numParticles=3; - particleSpeed=3; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=0; - emitRot=90; - emitRotSpread=25; - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - - [wPOOF02] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 1, 0; - gravity=r-0.1 r0.1, 0 r0.1, r-0.1 r0.1; - colorMap= 0.2 0.2 0.5 0.03 0 0 0 0.01; - Texture=dirt; - airdrag=1.0; - particleLife=1; - particleLifeSpread=20; - numParticles=4; - particleSpeed=2; - particleSpeedSpread=1; - particleSize=10; - particleSizeSpread=0; - emitRot=90; - emitRotSpread=25; - directional=1; - useAirLos=1; - } - water=1; - count=1; - } -} - - -[kampfertail] -{ - [pop2] - { - class=heatcloud; - - [properties] - { - texture=blueexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 10 r-1.5; - sizeGrowth = -0.9; - - pos = r1 r-1, 0, r-1 r1; - speed=0, r-1.5, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - -} - - - diff --git a/Gamedata/explosions/game fx.lua b/Gamedata/explosions/game fx.lua new file mode 100644 index 000000000..ba31d1360 --- /dev/null +++ b/Gamedata/explosions/game fx.lua @@ -0,0 +1,371 @@ +-- jethtrail +-- reactionalien4 +-- nanoflame +-- surfacesplash +-- upwelling +-- reactionalien +-- jetmtrail +-- jetbtrail +-- nanoflamepurple +-- missilepoofs +-- reactionalien2 +-- airfactoryhtrail +-- reactionalien3 +-- ffmuzzle +-- jetstrail + +return { + ["jethtrail"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 25, + sidetexture = [[shot]], + size = 7, + sizegrowth = 2, + ttl = 2, + }, + }, + }, + + ["reactionalien4"] = { + heatcloud = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + heat = 20, + heatfalloff = 1, + maxheat = 25, + pos = [[0, 0, 0]], + size = 6, + sizegrowth = 0.125, + sizemod = 0, + sizemodmod = 0, + speed = [[r-0.65 r0.65, r-0.65 r0.65, r-0.65 r0.65]], + texture = [[PlasmaHeatDB]], + }, + }, + }, + + ["nanoflame"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.5 0.7 0.6 0.01 0.2 0.9 0.5 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 60, + sidetexture = [[flashside2]], + size = 3, + sizegrowth = 1.2, + ttl = 40, + }, + }, + }, + + ["surfacesplash"] = { + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 6, + particlelife = 22, + particlelifespread = 8, + particlesize = 3, + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 5, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 5, + particlesize = 4, + particlesizespread = 3, + particlespeed = 1, + particlespeedspread = 4, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.4, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["upwelling"] = { + pillar = { + air = true, + class = [[heatcloud]], + count = 7, + ground = true, + water = true, + properties = { + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,-10 i5, 0]], + size = 10, + sizegrowth = -1, + speed = [[0, 5, 0]], + texture = [[LightningStrike]], + }, + }, + }, + + ["reactionalien"] = { + heatcloud = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + heat = 20, + heatfalloff = 1, + maxheat = 25, + pos = [[0, 0, 0]], + size = 1.5, + sizegrowth = 0.2, + sizemod = 0, + sizemodmod = 0, + speed = [[r-0.25 r0.25, r-0.25 r0.25, r-0.25 r0.25]], + texture = [[PlasmaHeatDB]], + }, + }, + }, + + ["jetmtrail"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 15, + sidetexture = [[shot]], + size = 7, + sizegrowth = 1, + ttl = 2, + }, + }, + }, + + ["jetbtrail"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 25, + sidetexture = [[shot]], + size = 7, + sizegrowth = 2, + ttl = 2, + }, + }, + }, + + ["nanoflamepurple"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.1 0.7 0.01 0.9 0.4 0.9 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 10, + sidetexture = [[flashside2]], + size = 3, + sizegrowth = 2, + ttl = 2, + }, + }, + }, + + ["missilepoofs"] = { + smoke = { + air = true, + count = 10, + ground = true, + water = true, + properties = { + agespeed = 0.15, + color = [[0.8 r0.2]], + dir = [[dir]], + size = 25, + sizegrowth = -1.5, + }, + }, + }, + + ["reactionalien2"] = { + heatcloud = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + heat = 20, + heatfalloff = 1, + maxheat = 25, + pos = [[0, 0, 0]], + size = 3.5, + sizegrowth = -0.2, + sizemod = 0, + sizemodmod = 0, + speed = [[r-0.1 r0.1, r-0.1 r0.1, r-0.1 r0.1]], + texture = [[PlasmaHeatDB]], + }, + }, + }, + + ["airfactoryhtrail"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 25, + sidetexture = [[shot]], + size = 15, + sizegrowth = 2, + ttl = 3, + }, + }, + }, + + ["reactionalien3"] = { + heatcloud = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + heat = 20, + heatfalloff = 1, + maxheat = 25, + pos = [[0, 0, 0]], + size = 2.5, + sizegrowth = 0.125, + sizemod = 0, + sizemodmod = 0, + speed = [[r-1.25 r1.25, r-1.25 r1.25, r-1.25 r1.25]], + texture = [[PlasmaHeatDB]], + }, + }, + }, + + ["ffmuzzle"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airlos = 0, + colormap = [[1 1 0 0.01 1 0.5 0 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.1, + fronttexture = [[randomdots]], + length = 18, + sidetexture = [[shot]], + size = 12, + sizegrowth = 1, + ttl = 3, + }, + }, + }, + + ["jetstrail"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 15, + sidetexture = [[shot]], + size = 7, + sizegrowth = 1, + ttl = 2, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/gd laser explosions.lua b/Gamedata/explosions/gd laser explosions.lua new file mode 100644 index 000000000..1febd8ce0 --- /dev/null +++ b/Gamedata/explosions/gd laser explosions.lua @@ -0,0 +1,39 @@ +-- laser + +return { + ["laser"] = { + groundflash = { + air = true, + circlealpha = 0, + circlegrowth = 0, + flashalpha = 0.9, + flashsize = 3, + ground = true, + ttl = 15, + water = true, + color = { + [1] = 1, + [2] = 0.25, + [3] = 0.5, + }, + }, + smoke = { + air = true, + count = 2, + ground = true, + water = true, + properties = { + agespeed = 0.03, + color = [[0.8 r0.2]], + pos = [[5 r-5, 5 r-5, 5 r-5]], + size = 0.5, + sizeexpansion = 0.25, + sizegrowth = -0.75, + speed = [[0, 0.6 r0.3, 0]], + startsize = 0.5, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue-emp.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue-emp.lua new file mode 100644 index 000000000..837b40390 --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue-emp.lua @@ -0,0 +1,859 @@ +-- genericbuildingexplosion-small-blue-emp +-- genericbuildingexplosion-large-blue-emp +-- genericbuildingexplosion-medium-blue-emp +-- genericbuildingexplosion-huge-blue-emp + +return { + ["genericbuildingexplosion-small-blue-emp"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 30, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r300, 1, -100 r300]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.75 0.75 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-blue-emp"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 30, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r300, 1, -100 r300]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.75 0.75 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-blue-emp"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 30, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r300, 1, -100 r300]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.75 0.75 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-blue-emp"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 30, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r300, 1, -100 r300]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.75 0.75 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue.lua new file mode 100644 index 000000000..0b64209be --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-blue.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small-blue +-- genericbuildingexplosion-large-blue +-- genericbuildingexplosion-medium-blue +-- genericbuildingexplosion-huge-blue + +return { + ["genericbuildingexplosion-small-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-green.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-green.lua new file mode 100644 index 000000000..b0021bae4 --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-green.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small-green +-- genericbuildingexplosion-large-green +-- genericbuildingexplosion-medium-green +-- genericbuildingexplosion-huge-green + +return { + ["genericbuildingexplosion-small-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-purple.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-purple.lua new file mode 100644 index 000000000..d9380448e --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-purple.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small-purple +-- genericbuildingexplosion-large-purple +-- genericbuildingexplosion-medium-purple +-- genericbuildingexplosion-huge-purple + +return { + ["genericbuildingexplosion-small-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-red.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-red.lua new file mode 100644 index 000000000..ccd79ad5f --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-red.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small-red +-- genericbuildingexplosion-large-red +-- genericbuildingexplosion-medium-red +-- genericbuildingexplosion-huge-red + +return { + ["genericbuildingexplosion-small-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-white.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-white.lua new file mode 100644 index 000000000..5730f2c42 --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion-white.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small-white +-- genericbuildingexplosion-large-white +-- genericbuildingexplosion-medium-white +-- genericbuildingexplosion-huge-white + +return { + ["genericbuildingexplosion-small-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion.lua b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion.lua new file mode 100644 index 000000000..083be0290 --- /dev/null +++ b/Gamedata/explosions/generic-building-explosions/genericbuildingexplosion.lua @@ -0,0 +1,904 @@ +-- genericbuildingexplosion-small +-- genericbuildingexplosion-large +-- genericbuildingexplosion-medium +-- genericbuildingexplosion-huge + +return { + ["genericbuildingexplosion-small"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-large"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-medium"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericbuildingexplosion-huge"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-helper-explosions/generic-helper-explosions.lua b/Gamedata/explosions/generic-helper-explosions/generic-helper-explosions.lua new file mode 100644 index 000000000..23f04963e --- /dev/null +++ b/Gamedata/explosions/generic-helper-explosions/generic-helper-explosions.lua @@ -0,0 +1,47 @@ +-- lightning_stormbolt + +return { + ["lightning_stormbolt"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 3, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, +} + diff --git a/Gamedata/explosions/generic-projectile-cegs/generic-projectile-cegs.lua b/Gamedata/explosions/generic-projectile-cegs/generic-projectile-cegs.lua new file mode 100644 index 000000000..e4c5ae0d2 --- /dev/null +++ b/Gamedata/explosions/generic-projectile-cegs/generic-projectile-cegs.lua @@ -0,0 +1,69 @@ +return { + ["thudshot"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.6, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 5, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[starexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue-emp.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue-emp.lua new file mode 100644 index 000000000..0cd9902f3 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue-emp.lua @@ -0,0 +1,187 @@ +-- genericshellexplosion-large-blue-emp + +return { + ["genericshellexplosion-large-blue-emp"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.2, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 0.2 0, 0]], + texture = [[flare]], + }, + }, + centerflare2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.2, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 0.2 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 30, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r300, 1, -100 r300]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0.5 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[30]], -- same as groundflash ttl + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = [[8 r20]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.9, + flashsize = 250, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.75 0.75 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = [[20 r40]], + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = [[8 r20]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue.lua new file mode 100644 index 000000000..99c22e8d7 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-blue.lua @@ -0,0 +1,529 @@ +-- genericshellexplosion-small-blue +-- genericshellexplosion-medium-blue +-- genericshellexplosion-large-blue + +return { + ["genericshellexplosion-small-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-medium-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-large-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-crusher.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-crusher.lua new file mode 100644 index 000000000..07089473d --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-crusher.lua @@ -0,0 +1,153 @@ +-- genericshellexplosion-crusher + +return { + ["genericshellexplosion-crusher"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.30000001192093 0.5 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.011]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-green.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-green.lua new file mode 100644 index 000000000..c4e5e3685 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-green.lua @@ -0,0 +1,529 @@ +-- genericshellexplosion-small-green +-- genericshellexplosion-medium-green +-- genericshellexplosion-large-green + +return { + ["genericshellexplosion-small-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + }, + + ["genericshellexplosion-medium-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + }, + + ["genericshellexplosion-large-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-lightning.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-lightning.lua new file mode 100644 index 000000000..f1618c6bb --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-lightning.lua @@ -0,0 +1,397 @@ +-- genericshellexplosion-medium-lightning +-- genericshellexplosion-small-lightning +-- genericshellexplosion-large-lightning + +return { + ["genericshellexplosion-medium-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericshellexplosion-small-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericshellexplosion-large-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-purple.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-purple.lua new file mode 100644 index 000000000..2fabd91c1 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-purple.lua @@ -0,0 +1,529 @@ +-- genericshellexplosion-medium-purple +-- genericshellexplosion-small-purple +-- genericshellexplosion-large-purple + +return { + ["genericshellexplosion-medium-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-small-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-large-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-red.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-red.lua new file mode 100644 index 000000000..4ef903579 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-red.lua @@ -0,0 +1,529 @@ +-- genericshellexplosion-small-red +-- genericshellexplosion-medium-red +-- genericshellexplosion-large-red + +return { + ["genericshellexplosion-small-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + }, + + ["genericshellexplosion-medium-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + }, + + ["genericshellexplosion-large-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks-burn.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks-burn.lua new file mode 100644 index 000000000..29362710e --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks-burn.lua @@ -0,0 +1,545 @@ +-- genericshellexplosion-small-sparks-burn +-- genericshellexplosion-medium-sparks-burn +-- genericshellexplosion-large-sparks-burn +-- genericshellexplosion-huge-sparks-burn + +return { + ["genericshellexplosion-small-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[randomdots]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, + + ["genericshellexplosion-medium-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[randomdots]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 0.7, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, + + ["genericshellexplosion-large-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 7, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 4, + particlelifespread = 15, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, + + + ["genericshellexplosion-huge-sparks-burn"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + underwater = 1, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 12, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[randomdots]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 15, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 4, + particlespeedspread = 12, + pos = [[0, 1, 0]], + sizegrowth = 0.7, + sizemod = 0.7, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 16, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 14, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + underwaterexplosionspikes = { + class = [[CSimpleParticleSystem]], + count = 2, + underwater = 1, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 4, + particlelife = 8, + particlelifespread = 30, + particlesize = 1, + particlesizespread = 0, + particlespeed = 6, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 2, + sizemod = 0.25, + texture = [[wake]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks.lua new file mode 100644 index 000000000..f53b3dfd3 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-sparks.lua @@ -0,0 +1,147 @@ +-- genericshellexplosion-sparks + +return { + ["genericshellexplosion-sparks"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 2.5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 0.5, + particlesizespread = 0, + particlespeed = 6, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[gunshot]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-white.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-white.lua new file mode 100644 index 000000000..435263547 --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion-white.lua @@ -0,0 +1,529 @@ +-- genericshellexplosion-small-white +-- genericshellexplosion-medium-white +-- genericshellexplosion-large-white + +return { + ["genericshellexplosion-small-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericshellexplosion-medium-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericshellexplosion-large-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-shell-explosions/genericshellexplosion.lua b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion.lua new file mode 100644 index 000000000..10e3db37e --- /dev/null +++ b/Gamedata/explosions/generic-shell-explosions/genericshellexplosion.lua @@ -0,0 +1,704 @@ +-- genericshellexplosion-small +-- genericshellexplosion +-- genericshellexplosion-medium +-- genericshellexplosion-large + +return { + ["genericshellexplosion-small"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + + ["genericshellexplosion"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-medium"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + + ["genericshellexplosion-large"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-blue.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-blue.lua new file mode 100644 index 000000000..339a537a9 --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-blue.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-huge-blue +-- genericunitexplosion-medium-blue +-- genericunitexplosion-large-blue +-- genericunitexplosion-small-blue + +return { + ["genericunitexplosion-huge-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-medium-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-small-blue"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 0 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.5 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-green.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-green.lua new file mode 100644 index 000000000..f3dd59d99 --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-green.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-huge-green +-- genericunitexplosion-medium-green +-- genericunitexplosion-large-green +-- genericunitexplosion-small-green + +return { + ["genericunitexplosion-huge-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-medium-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-small-green"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0 1 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[greennovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 1.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-purple.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-purple.lua new file mode 100644 index 000000000..c759ba6be --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-purple.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-small-purple +-- genericunitexplosion-medium-purple +-- genericunitexplosion-large-purple +-- genericunitexplosion-huge-purple + +return { + ["genericunitexplosion-small-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-medium-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 1, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-huge-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-red.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-red.lua new file mode 100644 index 000000000..022e842b0 --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-red.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-medium-red +-- genericunitexplosion-large-red +-- genericunitexplosion-small-red +-- genericunitexplosion-huge-red + +return { + ["genericunitexplosion-medium-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-small-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-huge-red"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[rednovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-white.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-white.lua new file mode 100644 index 000000000..7a453114a --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion-white.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-medium-white +-- genericunitexplosion-huge-white +-- genericunitexplosion-small-white +-- genericunitexplosion-large-white + +return { + ["genericunitexplosion-medium-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-huge-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-small-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large-white"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 1.0 1.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/generic-unit-explosions/genericunitexplosion.lua b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion.lua new file mode 100644 index 000000000..37a2f5310 --- /dev/null +++ b/Gamedata/explosions/generic-unit-explosions/genericunitexplosion.lua @@ -0,0 +1,824 @@ +-- genericunitexplosion-small +-- genericunitexplosion-large +-- genericunitexplosion-medium +-- genericunitexplosion-huge + +return { + ["genericunitexplosion-small"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-large"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-medium"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericunitexplosion-huge"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 0.5 0 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[100]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 4, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 4, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 100, + water = true, + underwater = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.5 0.0 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/genericshellexplosion-blue-emp.tdf b/Gamedata/explosions/genericshellexplosion-blue-emp.tdf deleted file mode 100644 index f5089a607..000000000 --- a/Gamedata/explosions/genericshellexplosion-blue-emp.tdf +++ /dev/null @@ -1,161 +0,0 @@ -[genericshellexplosion-large-blue-emp] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [blueelectricityspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=whitelightb; - - colorMap = 0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - delay=10 r200; - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=whitelightb; - airdrag=0.87; - colorMap=1 1 1 0.05 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=20 r40; - numParticles=20; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=8 r20; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - water=1; - count=10; - } - - [electricstorm] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r300, 1, -100 r300; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT; - } - air=1; - water=1; - ground=1; - count=30; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 250; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-blue.tdf b/Gamedata/explosions/genericshellexplosion-blue.tdf deleted file mode 100644 index 00bf973d8..000000000 --- a/Gamedata/explosions/genericshellexplosion-blue.tdf +++ /dev/null @@ -1,545 +0,0 @@ -[genericshellexplosion-small-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-crusher.tdf b/Gamedata/explosions/genericshellexplosion-crusher.tdf deleted file mode 100644 index dbddfd4cd..000000000 --- a/Gamedata/explosions/genericshellexplosion-crusher.tdf +++ /dev/null @@ -1,144 +0,0 @@ -[genericshellexplosion-crusher] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.011; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; - particleSpeed=2; - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.3, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-green.tdf b/Gamedata/explosions/genericshellexplosion-green.tdf deleted file mode 100644 index 252715fbb..000000000 --- a/Gamedata/explosions/genericshellexplosion-green.tdf +++ /dev/null @@ -1,545 +0,0 @@ -[genericshellexplosion-small-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-lightning.tdf b/Gamedata/explosions/genericshellexplosion-lightning.tdf deleted file mode 100644 index e0ac76533..000000000 --- a/Gamedata/explosions/genericshellexplosion-lightning.tdf +++ /dev/null @@ -1,483 +0,0 @@ -[genericshellexplosion-small-lightning] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [blueelectricityspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=whitelightb; - - colorMap = 0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=whitelightb; - airdrag=0.87; - colorMap=1 1 1 0.05 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=5; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - water=1; - count=1; - } - - [electricstorm] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT; - } - air=1; - water=1; - ground=1; - count=10; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } -} - - -[genericshellexplosion-medium-lightning] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [blueelectricityspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=whitelightb; - - colorMap = 0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=whitelightb; - airdrag=0.87; - colorMap=1 1 1 0.05 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=10; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - water=1; - count=1; - } - - [electricstorm] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT; - } - air=1; - water=1; - ground=1; - count=10; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-lightning] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [blueelectricityspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=whitelightb; - - colorMap = 0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=whitelightb; - airdrag=0.87; - colorMap=1 1 1 0.05 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=20; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - water=1; - count=1; - } - - [electricstorm] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT; - } - air=1; - water=1; - ground=1; - count=10; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-purple.tdf b/Gamedata/explosions/genericshellexplosion-purple.tdf deleted file mode 100644 index 2f0d93304..000000000 --- a/Gamedata/explosions/genericshellexplosion-purple.tdf +++ /dev/null @@ -1,545 +0,0 @@ -[genericshellexplosion-small-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-red.tdf b/Gamedata/explosions/genericshellexplosion-red.tdf deleted file mode 100644 index 4de882495..000000000 --- a/Gamedata/explosions/genericshellexplosion-red.tdf +++ /dev/null @@ -1,545 +0,0 @@ -[genericshellexplosion-small-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-sparks-burn.tdf b/Gamedata/explosions/genericshellexplosion-sparks-burn.tdf deleted file mode 100644 index ec78f413d..000000000 --- a/Gamedata/explosions/genericshellexplosion-sparks-burn.tdf +++ /dev/null @@ -1,532 +0,0 @@ -[genericshellexplosion-small-sparks-burn] -{ - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - underwater=1; - water=1; - ground=1; - count=1; - } - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 0.5; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [underwaterexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=wake; - - colorMap = 0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0; - - pos = 0, 2, 0; - gravity = 0, 0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 2; - sizeMod = 0.25; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.9; - particleLife = 4; - particleLifeSpread = 15; - numParticles = 4; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=randdots; - airdrag=0.87; - colorMap=0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=1; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=1; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } -} - -[genericshellexplosion-medium-sparks-burn] -{ - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - underwater=1; - water=1; - ground=1; - count=1; - } - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 0.5; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [underwaterexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=wake; - - colorMap = 0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0; - - pos = 0, 2, 0; - gravity = 0, 0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 2; - sizeMod = 0.25; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.9; - particleLife = 4; - particleLifeSpread = 15; - numParticles = 4; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=2; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=randdots; - airdrag=0.87; - colorMap=0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } -} - - - -[genericshellexplosion-large-sparks-burn] -{ - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - underwater=1; - water=1; - ground=1; - count=1; - } - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 7; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 0.5; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [underwaterexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=wake; - - colorMap = 0.7 0.8 0.9 0.03 0.2 0.5 0.9 0.01 0 0 0 0.0; - - pos = 0, 2, 0; - gravity = 0, 0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 2; - sizeMod = 0.25; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.9; - particleLife = 4; - particleLifeSpread = 15; - numParticles = 4; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - underwater=1; - count=2; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.7; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=randdots; - airdrag=0.87; - colorMap=0.8 0.2 0.0 0.35 0.5 0.5 0.0 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=4; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.7; - sizeMod=0.7; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=15; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=4; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-sparks.tdf b/Gamedata/explosions/genericshellexplosion-sparks.tdf deleted file mode 100644 index 766540f5f..000000000 --- a/Gamedata/explosions/genericshellexplosion-sparks.tdf +++ /dev/null @@ -1,181 +0,0 @@ -[genericshellexplosion-sparks] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 2.5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 6; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 0.5; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=2; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=1; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=15; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=1; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion-white.tdf b/Gamedata/explosions/genericshellexplosion-white.tdf deleted file mode 100644 index 77f7c9df1..000000000 --- a/Gamedata/explosions/genericshellexplosion-white.tdf +++ /dev/null @@ -1,545 +0,0 @@ -[genericshellexplosion-small-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericshellexplosion.tdf b/Gamedata/explosions/genericshellexplosion.tdf deleted file mode 100644 index b39ab9170..000000000 --- a/Gamedata/explosions/genericshellexplosion.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericshellexplosion] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-small] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 3; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 50; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-medium] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 8; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 100; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 6; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericshellexplosion-large] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 20; - flashSize = 150; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 12; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion-blue.tdf b/Gamedata/explosions/genericunitexplosion-blue.tdf deleted file mode 100644 index ad7426708..000000000 --- a/Gamedata/explosions/genericunitexplosion-blue.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge-blue] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 0, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion-green.tdf b/Gamedata/explosions/genericunitexplosion-green.tdf deleted file mode 100644 index 54e0e8182..000000000 --- a/Gamedata/explosions/genericunitexplosion-green.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge-green] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion-purple.tdf b/Gamedata/explosions/genericunitexplosion-purple.tdf deleted file mode 100644 index 151980c9e..000000000 --- a/Gamedata/explosions/genericunitexplosion-purple.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge-purple] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=purplenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 0.11, 0, 0.29; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion-red.tdf b/Gamedata/explosions/genericunitexplosion-red.tdf deleted file mode 100644 index 20b472fd5..000000000 --- a/Gamedata/explosions/genericunitexplosion-red.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge-red] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=rednovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion-white.tdf b/Gamedata/explosions/genericunitexplosion-white.tdf deleted file mode 100644 index cb04732f0..000000000 --- a/Gamedata/explosions/genericunitexplosion-white.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge-white] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=brightblueexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/genericunitexplosion.tdf b/Gamedata/explosions/genericunitexplosion.tdf deleted file mode 100644 index af7edb875..000000000 --- a/Gamedata/explosions/genericunitexplosion.tdf +++ /dev/null @@ -1,727 +0,0 @@ -[genericunitexplosion-small] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 10; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 5; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 12; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=30; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=2; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - //flashsize * 4, ttl * 5, circlegrowth / 2 - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 200; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 1.5; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-medium] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 8; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 16; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=60; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=5; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 400; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 2; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-large] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 30; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 12; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 20; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=120; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=10; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 600; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 3; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} - -[genericunitexplosion-huge] -{ - [outerflash] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=orangenovaexplo; - heat = 10; - maxheat = 20; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 40; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [centerflare] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 20; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 18; //when adjusting the sizes, adjust this up and down - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [orangeexplosionspikes] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1; //when adjusting the size of the spikes, adjust this up and down - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 26; //when adjusting the distance that the spikes travel, adjust this up and down - particleSpeedSpread = 2; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [kickedupdirt] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=bigexplosmoke; - airdrag=0.87; - colorMap=0.25 0.20 0.10 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - air=1; - ground=1; - count=1; - } - - [kickedupwater] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=0.5; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=wake; - airdrag=0.87; - colorMap=0.7 0.7 0.9 0.35 0 0 0 0.0; - - particleLifeSpread=30; //This adjusts how long the particles stick around travelling upward - particleSpeedSpread=6; - particleSizeSpread=1; - - particleLife=2; - numParticles=160; //These particles die incredibly quickly, you can feel free to go nuts here - particleSpeed=14; //Adjusting this will control how far out the dust spreads - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=90; - emitRotSpread=5; - directional=0; - - - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 100; - flashSize = 800; //This is the glow on the ground, you'll want to size this so that it covers the entire area of the explosion - flashAlpha = 0.9; - - circleGrowth = 4; //Use this to control how large the pretty expanding shockwave graphic travels - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/goldshells.lua b/Gamedata/explosions/goldshells.lua new file mode 100644 index 000000000..ea97d25e6 --- /dev/null +++ b/Gamedata/explosions/goldshells.lua @@ -0,0 +1,35 @@ +-- goldshells + +return { + ["goldshells"] = { + shells = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 10, + emitvector = [[dir]], + gravity = [[0, -0.5, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[goldshell]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/goldshells.tdf b/Gamedata/explosions/goldshells.tdf deleted file mode 100644 index 8960ce0ad..000000000 --- a/Gamedata/explosions/goldshells.tdf +++ /dev/null @@ -1,32 +0,0 @@ -[goldshells] -{ - [shells] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, -0.5, 0; - colorMap=1 1 1 1 1 1 1 1; - Texture=goldshell; - airdrag=0.97; - particleLife=30; - particleLifeSpread=0; - numParticles=1; - particleSpeed=4; - particleSpeedSpread=0; - particleSize=4; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=10; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/greencannonimpact.lua b/Gamedata/explosions/greencannonimpact.lua new file mode 100644 index 000000000..bfeaea8ad --- /dev/null +++ b/Gamedata/explosions/greencannonimpact.lua @@ -0,0 +1,113 @@ +-- greencannonimpact + +return { + ["greencannonimpact"] = { + groundflash = { + air = true, + circlealpha = 1, + circlegrowth = 5.5, + flashalpha = 0.8, + flashsize = 120, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 0, + [2] = 1, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.9 0.2 0.01 0.1 0.8 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 50, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 8, + particlesize = 10, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[0, 5, 0]], + size = 0.2, + sizegrowth = 7, + speed = [[0, 0, 0]], + texture = [[greennovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 2, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 0.2, + sizegrowth = 3, + speed = [[0, 1, 0]], + texture = [[3explo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/greencannonimpact.tdf b/Gamedata/explosions/greencannonimpact.tdf deleted file mode 100644 index dd61ccfe2..000000000 --- a/Gamedata/explosions/greencannonimpact.tdf +++ /dev/null @@ -1,144 +0,0 @@ -[greencannonimpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=greennovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 0.2; - sizeGrowth = 7; - - pos = 0, 5, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - - texture=3explo; - heat = 10; - maxheat = 15; - heatFalloff = 2; - - size = 0.2; - sizeGrowth = 3; - - pos = r-3 r3, 5, r-3 r3; - speed=0, 1, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.9 0.2 0.01 0.1 0.8 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 50; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 5; - particleSize = 15; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - - Texture=randdots; - - colorMap =0.8 0.8 0.2 0.01 0.2 0.8 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 8; - numParticles = 8; - particleSpeed = 20; - particleSpeedSpread = 3; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [groundflash] - { - - ttl = 30; - flashSize = 120; - flashAlpha = 0.8; - - circleGrowth = 5.5; - circleAlpha = 1; - - color = 0, 1, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/heal.lua b/Gamedata/explosions/heal.lua new file mode 100644 index 000000000..6dd34027c --- /dev/null +++ b/Gamedata/explosions/heal.lua @@ -0,0 +1,64 @@ +-- heal + +return { + ["heal"] = { + healg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = false, + colormap = [[0.25 0.60 0.10 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[1 r0.3, 1 r0.3, 1 r0.3]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 8, + particlelife = 15, + particlelifespread = 20, + particlesize = 4, + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 2, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[heal]], + useairlos = false, + }, + }, + healw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.7, + alwaysvisible = false, + colormap = [[1 0.5 1 1 0.5 0.5 1 1 0 0 0 0.5]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 10, + particlelife = 15, + particlelifespread = 20, + particlesize = [[4 r4]], + particlesizespread = 2, + particlespeed = 1, + particlespeedspread = 2, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[heal]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/heal.tdf b/Gamedata/explosions/heal.tdf deleted file mode 100644 index 2c4afef87..000000000 --- a/Gamedata/explosions/heal.tdf +++ /dev/null @@ -1,80 +0,0 @@ -// use this effect sparingly. It can slow machines down. -[heal] -{ - [healg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=heal; - sizeGrowth=0; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 1 r0.3, 1 r0.3, 1 r0.3; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 0.25 0.60 0.10 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=20; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=2; - particleSize=4; - particleSizeSpread=10; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } - - [healw] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=heal; - sizeGrowth=-0.2; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 1 0.5 1 1 0.5 0.5 1 1 0 0 0 0.5; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=20; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=2; - particleSize=4 r4; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - water=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/heavybulletimpact.lua b/Gamedata/explosions/heavybulletimpact.lua new file mode 100644 index 000000000..948e952ec --- /dev/null +++ b/Gamedata/explosions/heavybulletimpact.lua @@ -0,0 +1,135 @@ +-- heavybulletimpact + +return { + ["heavybulletimpact"] = { + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 3, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 7, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.0 0.55 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 3, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 20, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/heavycannon.lua b/Gamedata/explosions/heavycannon.lua new file mode 100644 index 000000000..eb0c0eb77 --- /dev/null +++ b/Gamedata/explosions/heavycannon.lua @@ -0,0 +1,272 @@ +-- heavycannonweapon +-- heavycannonweapon2 +-- riotweapon + +return { + ["heavycannonweapon"] = { + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["heavycannonweapon2"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["riotweapon"] = { + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 4, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/heavycannon.tdf b/Gamedata/explosions/heavycannon.tdf deleted file mode 100644 index f464e7db5..000000000 --- a/Gamedata/explosions/heavycannon.tdf +++ /dev/null @@ -1,359 +0,0 @@ -[HEAVYCANNONWEAPON] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 8; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } -} - - -[HEAVYCANNONWEAPON2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 8; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=3; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } -} - - -[RIOTWEAPON] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.5; - - size = 1; - sizeGrowth = 4; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/jetflash.lua b/Gamedata/explosions/jetflash.lua new file mode 100644 index 000000000..6ee32d54a --- /dev/null +++ b/Gamedata/explosions/jetflash.lua @@ -0,0 +1,56 @@ +-- jetflash + +return { + ["jetflash"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 15, + sidetexture = [[shot]], + size = 7, + sizegrowth = 1, + ttl = 2, + }, + }, + redpuff = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 0.6 0 0.01 0.9 0.8 0.7 0.01 0 0 0 0.01]], + directional = true, + emitrot = 1, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0, .0]], + numparticles = 3, + particlelife = 1, + particlelifespread = 2, + particlesize = 1, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 3, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.9, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/jetflash.tdf b/Gamedata/explosions/jetflash.tdf deleted file mode 100644 index a1b3abdbf..000000000 --- a/Gamedata/explosions/jetflash.tdf +++ /dev/null @@ -1,65 +0,0 @@ -[jetflash] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap= 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0 0 0 0.01; - size=7; - length=15; - sizeGrowth=1; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } - - [redpuff] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=0.9; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = dir; - gravity = 0.0, 0, .0; - - colorMap = 1 0.6 0 0.01 0.9 0.8 0.7 0.01 0 0 0 0.01; - airdrag = 1; - - particleLife=1; - particleLifeSpread=2; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=3; - particleSize=1; - particleSizeSpread=3; - - emitRot=1; - emitRotSpread=5; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/kampferimpact.lua b/Gamedata/explosions/kampferimpact.lua new file mode 100644 index 000000000..157ad7002 --- /dev/null +++ b/Gamedata/explosions/kampferimpact.lua @@ -0,0 +1,224 @@ +-- kampferimpact + +return { + ["kampferimpact"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 1.0 1 0.4 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.5, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 12, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + poof2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[gunshot]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/kampferimpact.tdf b/Gamedata/explosions/kampferimpact.tdf deleted file mode 100644 index 708cea640..000000000 --- a/Gamedata/explosions/kampferimpact.tdf +++ /dev/null @@ -1,293 +0,0 @@ -[kampferimpact] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=12; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.5, 0.1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [POOF2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1 1 1 1.0 1 0.4 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=10; - particleSpeedSpread=1; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/krabdeath.lua b/Gamedata/explosions/krabdeath.lua new file mode 100644 index 000000000..7e5ce18f4 --- /dev/null +++ b/Gamedata/explosions/krabdeath.lua @@ -0,0 +1,90 @@ +-- krabdeath + +return { + ["krabdeath"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 45, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.5 0.01 0.5 0.2 0.3 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 1.5, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.5 0.01 0.5 0.2 0.3 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/krabdeath.tdf b/Gamedata/explosions/krabdeath.tdf deleted file mode 100644 index 941fb5c14..000000000 --- a/Gamedata/explosions/krabdeath.tdf +++ /dev/null @@ -1,107 +0,0 @@ -[KRABDEATH] -{ - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap = 0.8 0.2 0.5 0.01 0.5 0.2 0.3 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 1.5; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap =0.8 0.2 0.5 0.01 0.5 0.2 0.3 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 45; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/las1.lua b/Gamedata/explosions/las1.lua new file mode 100644 index 000000000..80cc69057 --- /dev/null +++ b/Gamedata/explosions/las1.lua @@ -0,0 +1,76 @@ +-- las1 + +return { + ["las1"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.89999997615814, + [2] = 0.69999998807907, + [3] = 0.5, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.7 0.0 0.04 0.9 0.9 0.9 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.4 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/las1.tdf b/Gamedata/explosions/las1.tdf deleted file mode 100644 index 976e94a62..000000000 --- a/Gamedata/explosions/las1.tdf +++ /dev/null @@ -1,90 +0,0 @@ -[las1] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.4 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.7 0.0 0.04 0.9 0.9 0.9 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.9, 0.7, 0.5; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/las2.lua b/Gamedata/explosions/las2.lua new file mode 100644 index 000000000..3fe491af0 --- /dev/null +++ b/Gamedata/explosions/las2.lua @@ -0,0 +1,76 @@ +-- las2 + +return { + ["las2"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 1, + [2] = 1, + [3] = 0.80000001192093, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.0 0.55 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.0 0.55 0.5 0.01 0.1 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/las2.tdf b/Gamedata/explosions/las2.tdf deleted file mode 100644 index cad626364..000000000 --- a/Gamedata/explosions/las2.tdf +++ /dev/null @@ -1,90 +0,0 @@ -[las2] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 1 1 1 0.01 0.0 0.55 0.5 0.01 0.1 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 1 1 1 0.01 0.0 0.55 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.0 0.55 0.5 0.01; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/las3.lua b/Gamedata/explosions/las3.lua new file mode 100644 index 000000000..2bf80e7bb --- /dev/null +++ b/Gamedata/explosions/las3.lua @@ -0,0 +1,76 @@ +-- las3 + +return { + ["las3"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/las3.tdf b/Gamedata/explosions/las3.tdf deleted file mode 100644 index 4ae83d2fe..000000000 --- a/Gamedata/explosions/las3.tdf +++ /dev/null @@ -1,90 +0,0 @@ -[las3] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/launchsmoke.lua b/Gamedata/explosions/launchsmoke.lua new file mode 100644 index 000000000..56b5d6fe2 --- /dev/null +++ b/Gamedata/explosions/launchsmoke.lua @@ -0,0 +1,53 @@ +-- launchsmoke + +return { + ["launchsmoke"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.2, + circlegrowth = 6, + flashalpha = 0.3, + flashsize = 100, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 22, + particlelife = 3, + particlelifespread = 3, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/launchsmoke.tdf b/Gamedata/explosions/launchsmoke.tdf deleted file mode 100644 index 71a12a767..000000000 --- a/Gamedata/explosions/launchsmoke.tdf +++ /dev/null @@ -1,58 +0,0 @@ -[launchsmoke] -{ - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - alwaysVisible=1; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0, 0; - - colorMap=0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - Texture=dirt; - airdrag=0.95; - - particleLife=3; - particleLifeSpread=3; - - numParticles=22; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 100; - flashAlpha = 0.3; - - circleGrowth = 6; - circleAlpha = 0.2; - - color = 1, 1, 1; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/lightning1.lua b/Gamedata/explosions/lightning1.lua new file mode 100644 index 000000000..9bd8911c5 --- /dev/null +++ b/Gamedata/explosions/lightning1.lua @@ -0,0 +1,323 @@ +-- lightningplosion_yellowbolts +-- zeusmuzzle +-- lightningplosion_bluebolts1 +-- lightningplosion1 +-- lightningplosion_stormbolt +-- zeusgroundflash + +return { + ["lightningplosion_yellowbolts"] = { + ["electric thingies"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightbw]], + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 0.01 1 1 1 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 20, + particlelife = 20, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["zeusmuzzle"] = { + usedefaultexplosions = false, + lightball = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 0.7 0.7 0.7 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + + ["lightningplosion_bluebolts1"] = { + ["electric thingies2"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 10, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, + + ["lightningplosion1"] = { + bluebolts1 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS1]], + pos = [[0, 0, 0]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 86, + ttl = 12, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + pikes = { + air = true, + class = [[explspike]], + count = 5, + ground = true, + water = true, + properties = { + alpha = 0.8, + alphadecay = 0.1, + color = [[0.5,0.5,1]], + dir = [[-15 r30,-15 r30,-15 r30]], + length = 30, + width = 5, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + yellowbolts = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS]], + pos = [[0, 0, 0]], + }, + }, + }, + + ["lightningplosion_stormbolt"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 3, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, + + ["zeusgroundflash"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 12, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lightning1.tdf b/Gamedata/explosions/lightning1.tdf deleted file mode 100644 index 3af26599c..000000000 --- a/Gamedata/explosions/lightning1.tdf +++ /dev/null @@ -1,345 +0,0 @@ -[LIGHTNINGPLOSION1] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 1; - sizeGrowth = 10; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts1] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pikes] - { - class=explspike; - [properties] - { - dir=-15 r30,-15 r30,-15 r30; - width=5; - length=30; - alpha=0.8; - alphadecay=0.1; - color=0.5,0.5,1; - - } - air=1; - water=1; - ground=1; - count=5; - } - [groundflash] - { - flashsize=86; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1,1,1; - } -} - - -[LIGHTNINGPLOSION_BLUEBOLTS1] -{ - [electric thingies2] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbw; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=10; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_YELLOWBOLTS] -{ - [electric thingies] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=whitelightbw; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=20; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT] -{ - [lightningballs] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r10, 1.0, -10 r10; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbw; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - [groundflash] - { - flashsize=46; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=3; - color=1,1,1; - } -} - -[ZEUSMUZZLE] -{ - usedefaultexplosions=0; - [lightball] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=10; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 0.7 0.7 0.7 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball2] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=10; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[ZEUSGROUNDFLASH] -{ - [groundflash] - { - flashsize=46; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1,1,1; - } -} diff --git a/Gamedata/explosions/lightning2.lua b/Gamedata/explosions/lightning2.lua new file mode 100644 index 000000000..bc5629e4a --- /dev/null +++ b/Gamedata/explosions/lightning2.lua @@ -0,0 +1,323 @@ +-- lightningplosion_stormbolt20 +-- lightningplosion2 +-- zeusgroundflash20 +-- lightningplosion_yellowbolts20 +-- lightningplosion_bluebolts21 +-- zeusmuzzle20 + +return { + ["lightningplosion_stormbolt20"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 3, + color = { + [1] = 0.5, + [2] = 0.5, + [3] = 1, + }, + }, + lightningballs20 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r20, 1.0, -10 r20]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb]], + }, + }, + }, + + ["lightningplosion2"] = { + bluebolts21 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS21]], + pos = [[0, 0, 0]], + }, + }, + electricstorm20 = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT20]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 86, + ttl = 12, + color = { + [1] = 0.5, + [2] = 0.5, + [3] = 1, + }, + }, + pikes20 = { + air = true, + class = [[explspike]], + count = 15, + ground = true, + water = true, + properties = { + alpha = 0.8, + alphadecay = 0.1, + color = [[0.5,0.5,1]], + dir = [[-15 r30,-15 r30,-15 r30]], + length = 30, + width = 5, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserendblue]], + }, + }, + yellowbolts20 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS20]], + pos = [[0, 0, 0]], + }, + }, + }, + + ["zeusgroundflash20"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 12, + color = { + [1] = 0.5, + [2] = 0.5, + [3] = 1, + }, + }, + }, + + ["lightningplosion_yellowbolts20"] = { + ["electric thingies20"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.5 0.5 1 0.01 0.5 0.5 1 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + sparks20 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.2 0.2 1 0.01 0.4 0.4 1 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 40, + particlelife = 20, + particlelifespread = 5, + particlesize = 5, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["lightningplosion_bluebolts21"] = { + ["electric thingies22"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb]], + }, + }, + }, + + ["zeusmuzzle20"] = { + usedefaultexplosions = false, + lightball20 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball22 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring20 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.7 0.01 0.7 0.7 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lightning2.tdf b/Gamedata/explosions/lightning2.tdf deleted file mode 100644 index f6fc8431d..000000000 --- a/Gamedata/explosions/lightning2.tdf +++ /dev/null @@ -1,345 +0,0 @@ -[LIGHTNINGPLOSION2] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendblue; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm20] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT20; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts20] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS20; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts21] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS21; - } - air=1; - water=1; - ground=1; - count=1; - } - [pikes20] - { - class=explspike; - [properties] - { - dir=-15 r30,-15 r30,-15 r30; - width=5; - length=30; - alpha=0.8; - alphadecay=0.1; - color=0.5,0.5,1; - - } - air=1; - water=1; - ground=1; - count=15; - } - [groundflash] - { - flashsize=86; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=0.5,0.5,1; - } -} - - - - -[LIGHTNINGPLOSION_BLUEBOLTS21] -{ - [electric thingies22] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=15; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} -[LIGHTNINGPLOSION_YELLOWBOLTS20] -{ - [electric thingies20] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0.5 0.5 1 0.01 0.5 0.5 1 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01; - Texture=whitelightb; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks20] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=0.2 0.2 1 0.01 0.4 0.4 1 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=40; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=5; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT20] -{ - [lightningballs20] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r20, 1.0, -10 r20; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - [groundflash] - { - flashsize=46; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=3; - color=0.5,0.5,1; - } -} - -[ZEUSMUZZLE20] -{ - usedefaultexplosions=0; - [lightball20] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring20] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.3 0.3 0.7 0.01 0.7 0.7 1 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball22] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[ZEUSGROUNDFLASH20] -{ - [groundflash] - { - flashsize=46; - flashalpha=0.3; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=0.5,0.5,1; - } -} diff --git a/Gamedata/explosions/lightning3.lua b/Gamedata/explosions/lightning3.lua new file mode 100644 index 000000000..8418ada67 --- /dev/null +++ b/Gamedata/explosions/lightning3.lua @@ -0,0 +1,323 @@ +-- lightningplosion_stormbolt30 +-- lightningplosion_yellowbolts30 +-- lightningplosion3 +-- zeusgroundflash30 +-- lightningplosion_bluebolts31 +-- zeusmuzzle30 + +return { + ["lightningplosion_stormbolt30"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 0.5, + [2] = 0, + [3] = 0.5, + }, + }, + lightningballs30 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r20, 1.0, -10 r20]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbp]], + }, + }, + }, + + ["lightningplosion_yellowbolts30"] = { + ["electric thingies30"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.5 0.5 1 0.01 0.5 0.5 1 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + sparks30 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[0.5 0.0 0.5 0.01 0.4 0.0 0.4 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 40, + particlelife = 20, + particlelifespread = 5, + particlesize = 6, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["lightningplosion3"] = { + bluebolts31 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS31]], + pos = [[0, 0, 0]], + }, + }, + electricstorm30 = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT30]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 0.5, + [2] = 0, + [3] = 0.5, + }, + }, + pikes30 = { + air = true, + class = [[explspike]], + count = 10, + ground = true, + water = true, + properties = { + alpha = 0.8, + alphadecay = 0.1, + color = [[0.5,0.5,1]], + dir = [[-15 r30,-15 r30,-15 r30]], + length = 30, + width = 5, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserendpurple]], + }, + }, + yellowbolts30 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS30]], + pos = [[0, 0, 0]], + }, + }, + }, + + ["zeusgroundflash30"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 0.5, + [2] = 0, + [3] = 0.5, + }, + }, + }, + + ["lightningplosion_bluebolts31"] = { + ["electric thingies32"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbp]], + }, + }, + }, + + ["zeusmuzzle30"] = { + usedefaultexplosions = false, + lightball30 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball32 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring30 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.3 0.7 0.01 0.7 0.7 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lightning3.tdf b/Gamedata/explosions/lightning3.tdf deleted file mode 100644 index 286241a43..000000000 --- a/Gamedata/explosions/lightning3.tdf +++ /dev/null @@ -1,345 +0,0 @@ -[LIGHTNINGPLOSION3] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendpurple; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm30] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT30; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts30] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS30; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts31] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS31; - } - air=1; - water=1; - ground=1; - count=1; - } - [pikes30] - { - class=explspike; - [properties] - { - dir=-15 r30,-15 r30,-15 r30; - width=5; - length=30; - alpha=0.8; - alphadecay=0.1; - color=0.5,0.5,1; - - } - air=1; - water=1; - ground=1; - count=10; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=0.5,0,0.5; - } -} - - - - -[LIGHTNINGPLOSION_BLUEBOLTS31] -{ - [electric thingies32] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbp; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=15; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} -[LIGHTNINGPLOSION_YELLOWBOLTS30] -{ - [electric thingies30] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0.5 0.5 1 0.01 0.5 0.5 1 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01; - Texture=whitelightb; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks30] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=0.5 0.0 0.5 0.01 0.4 0.0 0.4 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=40; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=6; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT30] -{ - [lightningballs30] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r20, 1.0, -10 r20; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbp; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=0.5,0,0.5; - } -} - -[ZEUSMUZZLE30] -{ - usedefaultexplosions=0; - [lightball30] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring30] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.3 0.3 0.7 0.01 0.7 0.7 1 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball32] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[ZEUSGROUNDFLASH30] -{ - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=0.5,0,0.5; - } -} diff --git a/Gamedata/explosions/lightning4.lua b/Gamedata/explosions/lightning4.lua new file mode 100644 index 000000000..b5da3d4c5 --- /dev/null +++ b/Gamedata/explosions/lightning4.lua @@ -0,0 +1,323 @@ +-- lightningplosion_yellowbolts40 +-- zeusmuzzle40 +-- lightningplosion_bluebolts41 +-- lightningplosion_stormbolt40 +-- lightningplosion4 +-- zeusgroundflash40 + +return { + ["lightningplosion_yellowbolts40"] = { + ["electric thingies40"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.8 0.1 0.01 0.5 0.5 0 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + sparks40 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.8 0.1 0.01 0.4 0.3 0.0 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 40, + particlelife = 20, + particlelifespread = 5, + particlesize = 6, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["zeusmuzzle40"] = { + usedefaultexplosions = false, + lightball40 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball42 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring40 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.8 0.1 0.01 0.7 0.7 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + + ["lightningplosion_bluebolts41"] = { + ["electric thingies42"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightby]], + }, + }, + }, + + ["lightningplosion_stormbolt40"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0.80000001192093, + [3] = 0.10000000149012, + }, + }, + lightningballs40 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r20, 1.0, -10 r20]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightby]], + }, + }, + }, + + ["lightningplosion4"] = { + bluebolts41 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS41]], + pos = [[0, 0, 0]], + }, + }, + electricstorm40 = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT40]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0.80000001192093, + [3] = 0.10000000149012, + }, + }, + pikes40 = { + air = true, + class = [[explspike]], + count = 10, + ground = true, + water = true, + properties = { + alpha = 0.8, + alphadecay = 0.1, + color = [[1,0.8,0.1]], + dir = [[-15 r30,-15 r30,-15 r30]], + length = 30, + width = 5, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserendyellow]], + }, + }, + yellowbolts40 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS40]], + pos = [[0, 0, 0]], + }, + }, + }, + + ["zeusgroundflash40"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0.80000001192093, + [3] = 0.10000000149012, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lightning4.tdf b/Gamedata/explosions/lightning4.tdf deleted file mode 100644 index 572b7e4d7..000000000 --- a/Gamedata/explosions/lightning4.tdf +++ /dev/null @@ -1,346 +0,0 @@ -[LIGHTNINGPLOSION4] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendyellow; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm40] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT40; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts40] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS40; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts41] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS41; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pikes40] - { - class=explspike; - [properties] - { - dir=-15 r30,-15 r30,-15 r30; - width=5; - length=30; - alpha=0.8; - alphadecay=0.1; - color=1,0.8,0.1; - - } - air=1; - water=1; - ground=1; - count=10; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1,0.8,0.1; - } -} - - - - -[LIGHTNINGPLOSION_BLUEBOLTS41] -{ - [electric thingies42] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightby; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=15; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} -[LIGHTNINGPLOSION_YELLOWBOLTS40] -{ - [electric thingies40] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.8 0.1 0.01 0.5 0.5 0 0.01 1 1 0 0.01 0.5 0.5 1 0.01 0 0 0 0.01; - Texture=whitelightb; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks40] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=1 0.8 0.1 0.01 0.4 0.3 0.0 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=40; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=6; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT40] -{ - [lightningballs40] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r20, 1.0, -10 r20; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightby; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1,0.8,0.1; - } -} - -[ZEUSMUZZLE40] -{ - usedefaultexplosions=0; - [lightball40] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring40] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 0.8 0.1 0.01 0.7 0.7 0 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball42] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[ZEUSGROUNDFLASH40] -{ - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1,0.8,0.1; - } -} diff --git a/Gamedata/explosions/lightning5.lua b/Gamedata/explosions/lightning5.lua new file mode 100644 index 000000000..09add7e7b --- /dev/null +++ b/Gamedata/explosions/lightning5.lua @@ -0,0 +1,323 @@ +-- zeusgroundflash50 +-- lightningplosion5 +-- lightningplosion_bluebolts51 +-- lightningplosion_yellowbolts50 +-- lightningplosion_stormbolt50 +-- zeusmuzzle50 + +return { + ["zeusgroundflash50"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + }, + + ["lightningplosion5"] = { + bluebolts51 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 3, + explosiongenerator = [[custom:LIGHTNINGPLOSION_BLUEBOLTS51]], + pos = [[0, 0, 0]], + }, + }, + electricstorm50 = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:LIGHTNINGPLOSION_STORMBOLT50]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + pikes50 = { + air = true, + class = [[explspike]], + count = 10, + ground = true, + water = true, + properties = { + alpha = 0.8, + alphadecay = 0.1, + color = [[1,0.8,0.1]], + dir = [[-15 r30,-15 r30,-15 r30]], + length = 30, + width = 5, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.2, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserendred]], + }, + }, + yellowbolts50 = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + properties = { + delay = 0, + explosiongenerator = [[custom:LIGHTNINGPLOSION_YELLOWBOLTS50]], + pos = [[0, 0, 0]], + }, + }, + }, + + ["lightningplosion_bluebolts51"] = { + ["electric thingies52"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.1, + colormap = [[1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 80, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 8, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 15, + particlespeed = 20, + particlespeedspread = 20, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbr]], + }, + }, + }, + + ["lightningplosion_yellowbolts50"] = { + ["electric thingies50"] = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.0 0.0 0.01 0.5 0.0 0 0.01 1 0 0 0.01 0.5 0.0 0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 180, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 5, + particlesize = 40, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0, 1.0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + sparks50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 0.0 0.0 0.01 0.4 0.3 0.0 0.01 0.0 0.0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 40, + particlelife = 20, + particlelifespread = 5, + particlesize = 6, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[spark]], + }, + }, + }, + + ["lightningplosion_stormbolt50"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.6, + flashsize = 66, + ttl = 12, + color = { + [1] = 1, + [2] = 0, + [3] = 0, + }, + }, + lightningballs50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r20, 1.0, -10 r20]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbr]], + }, + }, + }, + + ["zeusmuzzle50"] = { + usedefaultexplosions = false, + lightball50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball52 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lightning5.tdf b/Gamedata/explosions/lightning5.tdf deleted file mode 100644 index d701cf5f4..000000000 --- a/Gamedata/explosions/lightning5.tdf +++ /dev/null @@ -1,345 +0,0 @@ -[LIGHTNINGPLOSION5] //big container effect for the lightning impact -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendred; - heat = 10; - maxheat = 15; - heatFalloff = 1.2; - - size = 10; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [electricstorm50] // residual electricity effect - { - class=CExpGenSpawner; - [properties] - { - pos=-100 r200, 1, -100 r200; - delay=10 r200; - explosionGenerator=custom:LIGHTNINGPLOSION_STORMBOLT50; - } - air=1; - water=1; - ground=1; - count=10; - } - - [yellowbolts50] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=0; - explosionGenerator=custom:LIGHTNINGPLOSION_YELLOWBOLTS50; - } - air=1; - water=1; - ground=1; - count=1; - } - - [bluebolts51] - { - class=CExpGenSpawner; - [properties] - { - pos=0, 0, 0; - delay=3; - explosionGenerator=custom:LIGHTNINGPLOSION_BLUEBOLTS51; - } - air=1; - water=1; - ground=1; - count=1; - } - [pikes50] - { - class=explspike; - [properties] - { - dir=-15 r30,-15 r30,-15 r30; - width=5; - length=30; - alpha=0.8; - alphadecay=0.1; - color=1,0.8,0.1; - - } - air=1; - water=1; - ground=1; - count=10; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1, 0.0, 0.0; - } -} - - - - -[LIGHTNINGPLOSION_BLUEBOLTS51] -{ - [electric thingies52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbr; - airdrag=0.1; - particleLife=8; - particleLifeSpread=4; - numParticles=10; - particleSpeed=20; - particleSpeedSpread=20; - particleSize=15; - particleSizeSpread=15; - emitRot=0; - emitRotSpread=80; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} -[LIGHTNINGPLOSION_YELLOWBOLTS50] -{ - [electric thingies50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 1.0, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.0 0.0 0.01 0.5 0.0 0 0.01 1 0 0 0.01 0.5 0.0 0 0.01 0 0 0 0.01; - Texture=whitelightb; - airdrag=0.95; - particleLife=2; - particleLifeSpread=5; - numParticles=5; - particleSpeed=2; - particleSpeedSpread=0; - particleSize=40; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=180; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [sparks50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=0, 1, 0; - gravity=0, -0.2, 0; - colorMap=1 0.0 0.0 0.01 0.4 0.3 0.0 0.01 0.0 0.0 0 0.01; - Texture=spark; - airdrag=0.97; - particleLife=20; - particleLifeSpread=5; - numParticles=40; - particleSpeed=5; - particleSpeedSpread=0; - particleSize=6; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=60; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[LIGHTNINGPLOSION_STORMBOLT50] -{ - [lightningballs50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=-10 r20, 1.0, -10 r20; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightbr; - airdrag=1; - particleLife=3; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0.01; - particleSpeedSpread=0; - particleSize=2; - particleSizeSpread=20; - emitRot=80; - emitRotSpread=0; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1, 0.0, 0.0; - } -} - -[ZEUSMUZZLE50] -{ - usedefaultexplosions=0; - [lightball50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 0.0 0.0 0.01 0.7 0.0 0 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} - -[ZEUSGROUNDFLASH50] -{ - [groundflash] - { - flashsize=66; - flashalpha=0.6; - circlegrowth=0; - circlealpha=1; - ttl=12; - color=1, 0.0, 0.0; - } -} diff --git a/Gamedata/explosions/lootboxes.lua b/Gamedata/explosions/lootboxes.lua new file mode 100644 index 000000000..2ac058d4e --- /dev/null +++ b/Gamedata/explosions/lootboxes.lua @@ -0,0 +1,101 @@ +-- lootbox beacons + +return { + ["LootboxBeaconBronze"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx0]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconSilver"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx1]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconGold"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx2]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconPlatinum"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.8 1 1 1 0.7 1 1 1 0.3 0 0 0 0.01]], + size = 38, + ttl = 54, + sizegrowth = 0.4, + texture = [[circlefx3]], + alwaysvisible = true, + }, + }, + }, + ["LootboxLightGold"] = { + useAirLos = false, + usedefaultexplosions = false, + ["heatcloud"] = { + air = true, + water = true, + ground = true, + unit = true, + count = 3, + properties = { + --alwaysVisible = true, + heat = 30, + texture = [[glow2]], + maxheat = 30, + heatFalloff = 1.4, + size = [[4.0 r0.4]], + sizeGrowth = [[-0.02 r0.02]], + sizemod = 0, + sizemodmod = 0, + speed = [[0.05 r-0.05, 0.05 r-0.05, 0.05 r-0.05]], + pos = [[0, 0.0, 0]], + useAirLos = false, + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/lootboxes/lootbox-trail.lua b/Gamedata/explosions/lootboxes/lootbox-trail.lua new file mode 100644 index 000000000..9bffbc172 --- /dev/null +++ b/Gamedata/explosions/lootboxes/lootbox-trail.lua @@ -0,0 +1,208 @@ +-- Spawntrail for Lootbox Drops + +return { + ["lootbox-trail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[1 0.75 0.1 0.01 0.9 0.55 0.08 0.01 0.8 0.35 0.05 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 15.5, + sizegrowth = [[0.2 r0.9]], + ttl = 1, + }, + }, + fireglow = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.95 0.75 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.95 0.75 0 0.1 0.45 0.32 0 0.1 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 15, + particlesize = 19, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.6 0 0.15 0.55 0.40 0 0.1 0.028 0.020 0 0.15 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.65, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 7, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + trail = { + + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -20, + sidetexture = [[smoketrail]], + size = 2.0, + sizegrowth = 0.05, + ttl = 40, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.9 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 2, + ground = true, + water = true, + properties = { + alpha = 0.6, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 2, + width = 9, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lootboxes/lootboxes.lua b/Gamedata/explosions/lootboxes/lootboxes.lua new file mode 100644 index 000000000..2ac058d4e --- /dev/null +++ b/Gamedata/explosions/lootboxes/lootboxes.lua @@ -0,0 +1,101 @@ +-- lootbox beacons + +return { + ["LootboxBeaconBronze"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx0]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconSilver"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx1]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconGold"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.6 1 1 1 0.3 0 0 0 0.01]], + size = 36, + ttl = 46, + sizegrowth = 0.4, + texture = [[circlefx2]], + alwaysvisible = true, + }, + }, + }, + ["LootboxBeaconPlatinum"] = { + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + colormap = [[0 0 0 0.01 1 1 1 0.9 1 1 1 0.8 1 1 1 0.7 1 1 1 0.3 0 0 0 0.01]], + size = 38, + ttl = 54, + sizegrowth = 0.4, + texture = [[circlefx3]], + alwaysvisible = true, + }, + }, + }, + ["LootboxLightGold"] = { + useAirLos = false, + usedefaultexplosions = false, + ["heatcloud"] = { + air = true, + water = true, + ground = true, + unit = true, + count = 3, + properties = { + --alwaysVisible = true, + heat = 30, + texture = [[glow2]], + maxheat = 30, + heatFalloff = 1.4, + size = [[4.0 r0.4]], + sizeGrowth = [[-0.02 r0.02]], + sizemod = 0, + sizemodmod = 0, + speed = [[0.05 r-0.05, 0.05 r-0.05, 0.05 r-0.05]], + pos = [[0, 0.0, 0]], + useAirLos = false, + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/lvl1c.lua b/Gamedata/explosions/lvl1c.lua new file mode 100644 index 000000000..b5f2a12d4 --- /dev/null +++ b/Gamedata/explosions/lvl1c.lua @@ -0,0 +1,80 @@ +-- lvl1c + +return { + ["lvl1c"] = { + dirt1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 0.5 0.3 0.3 0.45 0.37 0.3 1 0.45 0.37 0.3 1 0.0 0.0 0.0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 18.5, + particlelifespread = 5, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 19, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 1.0, + texture = [[flashside2alpha]], + }, + }, + dirt2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 0.5 0.3 0.3 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 8.5, + particlelifespread = 5, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 19, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 1.0, + texture = [[flashside2alpha]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.3, + circlegrowth = 1, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 7, + water = true, + color = { + [1] = 0.80000001192093, + [2] = 0.5, + [3] = 0, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl1c.tdf b/Gamedata/explosions/lvl1c.tdf deleted file mode 100644 index 4871e0152..000000000 --- a/Gamedata/explosions/lvl1c.tdf +++ /dev/null @@ -1,85 +0,0 @@ -[lvl1c] -{ - - [groundflash] - { - alwaysVisible=1; - ttl = 7; - flashSize = 100; - flashAlpha = 0.9; - - circleGrowth = 1; - circleAlpha = 0.3; - - color = 0.8, 0.5, 0.0; - - air=1; - ground=1; - water=1; - } - - [dirt1] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=1.0; - pos=0, 2, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.5 0.3 0.3 0.45 0.37 0.3 1 0.45 0.37 0.3 1 0.0 0.0 0.0 0.01 0 0 0 0.01; - Texture=flashside2alpha; - airdrag=0.8; - particleLife=18.5; - particleLifeSpread=5; - numParticles=20; - particleSpeed=0; - particleSpeedSpread=19; - particleSize=1.5; - particleSizeSpread=3; - emitRot=0; - emitRotSpread=25; - directional=1; - alwaysvisible=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [dirt2] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=1.0; - pos=0, 2, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.5 0.3 0.3 0 0 0 0.01; - Texture=flashside2alpha; - airdrag=0.8; - particleLife=8.5; - particleLifeSpread=5; - numParticles=20; - particleSpeed=0; - particleSpeedSpread=19; - particleSize=1.5; - particleSizeSpread=3; - emitRot=0; - emitRotSpread=25; - directional=1; - alwaysvisible=1; - } - air=1; - water=1; - ground=1; - count=0; - } - - -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl1m.lua b/Gamedata/explosions/lvl1m.lua new file mode 100644 index 000000000..2368999fb --- /dev/null +++ b/Gamedata/explosions/lvl1m.lua @@ -0,0 +1,78 @@ +-- lvl1m + +return { + ["lvl1m"] = { + dirtw03 = { + class = [[dirt]], + count = 5, + water = true, + properties = { + alphafalloff = 2, + color = [[0.7, 0.7, 1.0]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 7, + speed = [[r1.5 r-1.5, 1.7, r1.5 r-1.5]], + }, + }, + pillar = { + air = true, + class = [[heatcloud]], + count = 3, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,1, 0]], + size = 20, + sizegrowth = -1, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.6 0.3 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.1, + texture = [[flashside1]], + useairlos = false, + }, + }, + smoke = { + air = true, + count = 2, + ground = true, + properties = { + agespeed = 0.15, + alwaysvisible = true, + color = 0.3, + pos = [[0,-1 i4,0]], + size = 10, + sizegrowth = 0, + speed = [[0, 5, 0]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl1m.tdf b/Gamedata/explosions/lvl1m.tdf deleted file mode 100644 index 845baa46c..000000000 --- a/Gamedata/explosions/lvl1m.tdf +++ /dev/null @@ -1,98 +0,0 @@ -[lvl1m] -{ - - [pillar] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 15; - maxheat = 15; - heatFalloff = 2.5; - - size = 20; - sizeGrowth = -1; - - pos = 0,1, 0; - speed=0, 0, 0; - } - air=1; - count=3; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.3; - ageSpeed=0.15; - - size = 10; - sizeGrowth = 0; - - pos = 0,-1 i4,0; - speed=0, 5, 0; - } - air=1; - ground=1; - count=2; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.7 0.6 0.3 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.1; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 5; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - - [dirtw03] - { - class=dirt; - - [properties] - { - size = 7; - color = 0.7, 0.7, 1.0; - alphaFalloff = 2; - speed = r1.5 r-1.5, 1.7, r1.5 r-1.5; - pos = r-5 r5, 0, r-5 r5; - } - water=1; - count=5; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl1rl.lua b/Gamedata/explosions/lvl1rl.lua new file mode 100644 index 000000000..cf59fc10c --- /dev/null +++ b/Gamedata/explosions/lvl1rl.lua @@ -0,0 +1,129 @@ +-- lvl1rl + +return { + ["lvl1rl"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.7, + alwaysvisible = true, + color = [[1, 0.3, 0]], + expansionspeed = [[14 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.5, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 7, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 256, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 22, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 35, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl1rl.tdf b/Gamedata/explosions/lvl1rl.tdf deleted file mode 100644 index b1e7afbd8..000000000 --- a/Gamedata/explosions/lvl1rl.tdf +++ /dev/null @@ -1,155 +0,0 @@ -[lvl1rl] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=7; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.5, 0.1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.7; - expansionSpeed=14 r3; - color=1, 0.3, 0; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 20; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 35; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 22; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 256; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/lvl2c.lua b/Gamedata/explosions/lvl2c.lua new file mode 100644 index 000000000..dc9ddaccf --- /dev/null +++ b/Gamedata/explosions/lvl2c.lua @@ -0,0 +1,154 @@ +-- lvl2c + +return { + ["lvl2c"] = { + dirt1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 0.5 0.3 0.3 0.45 0.37 0.3 1 0.45 0.37 0.3 1 0.0 0.0 0.0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 18.5, + particlelifespread = 5, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 19, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 1.0, + texture = [[flashside2alpha]], + }, + }, + dirt2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 0, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 0.5 0.3 0.3 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 25, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 8.5, + particlelifespread = 5, + particlesize = 1.5, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 19, + pos = [[0, 2, 0]], + sizegrowth = 3, + sizemod = 1.0, + texture = [[flashside2alpha]], + }, + }, + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.3 0.2 0.1 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.5, 0.0]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.1, + width = 8, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.3, + circlegrowth = 5, + flashalpha = 0.9, + flashsize = 200, + ground = true, + ttl = 7, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl2c.tdf b/Gamedata/explosions/lvl2c.tdf deleted file mode 100644 index 56a03de76..000000000 --- a/Gamedata/explosions/lvl2c.tdf +++ /dev/null @@ -1,181 +0,0 @@ -[lvl2c] -{ - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.3 0.2 0.1 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - water=1; - count=1; - } - - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=8; - length=0.1; - alpha=1; - alphadecay=0.19; - color=1, 0.5, 0.0; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 7; - flashSize = 200; - flashAlpha = 0.9; - - circleGrowth = 5; - circleAlpha = 0.3; - - color = 1, 0.5, 0.0; - - air=1; - ground=1; - water=1; - } - - [dirt1] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=1.0; - pos=0, 2, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.5 0.3 0.3 0.45 0.37 0.3 1 0.45 0.37 0.3 1 0.0 0.0 0.0 0.01 0 0 0 0.01; - Texture=flashside2alpha; - airdrag=0.8; - particleLife=18.5; - particleLifeSpread=5; - numParticles=20; - particleSpeed=0; - particleSpeedSpread=19; - particleSize=1.5; - particleSizeSpread=3; - emitRot=0; - emitRotSpread=25; - directional=1; - alwaysvisible=1; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [dirt2] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=1.0; - pos=0, 2, 0; - emitVector=0, 1, 0; - gravity=0, 0, 0; - colorMap=1 0.5 0.3 0.3 0 0 0 0.01; - Texture=flashside2alpha; - airdrag=0.8; - particleLife=8.5; - particleLifeSpread=5; - numParticles=20; - particleSpeed=0; - particleSpeedSpread=19; - particleSize=1.5; - particleSizeSpread=3; - emitRot=0; - emitRotSpread=25; - directional=1; - alwaysvisible=1; - } - air=1; - water=1; - ground=1; - count=0; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl2m.lua b/Gamedata/explosions/lvl2m.lua new file mode 100644 index 000000000..9850ec2ce --- /dev/null +++ b/Gamedata/explosions/lvl2m.lua @@ -0,0 +1,135 @@ +-- lvl2m + +return { + ["lvl2m"] = { + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 3, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 7, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.0 0.55 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 3, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 22, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl2m.tdf b/Gamedata/explosions/lvl2m.tdf deleted file mode 100644 index c6c569913..000000000 --- a/Gamedata/explosions/lvl2m.tdf +++ /dev/null @@ -1,178 +0,0 @@ -[lvl2m] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 5; - - size = 1; - sizeGrowth = 22; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=3; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=7; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.0 0.55 0.5 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl2rl.lua b/Gamedata/explosions/lvl2rl.lua new file mode 100644 index 000000000..d97ae1d9a --- /dev/null +++ b/Gamedata/explosions/lvl2rl.lua @@ -0,0 +1,197 @@ +-- bigbulletimpact + +return { + ["bigbulletimpact"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl2rl.tdf b/Gamedata/explosions/lvl2rl.tdf deleted file mode 100644 index 4f607e3ab..000000000 --- a/Gamedata/explosions/lvl2rl.tdf +++ /dev/null @@ -1,258 +0,0 @@ -[BigBulletImpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/lvl3rl.lua b/Gamedata/explosions/lvl3rl.lua new file mode 100644 index 000000000..24e31f8af --- /dev/null +++ b/Gamedata/explosions/lvl3rl.lua @@ -0,0 +1,197 @@ +-- lvl3rl + +return { + ["lvl3rl"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.4, + circlegrowth = 6, + flashalpha = 0.4, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.6 0.5 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl3rl.tdf b/Gamedata/explosions/lvl3rl.tdf deleted file mode 100644 index ececcfac1..000000000 --- a/Gamedata/explosions/lvl3rl.tdf +++ /dev/null @@ -1,258 +0,0 @@ -[lvl3rl] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.6 0.5 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.4; - - circleGrowth = 6; - circleAlpha = 0.4; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl4r.lua b/Gamedata/explosions/lvl4r.lua new file mode 100644 index 000000000..c670f63c9 --- /dev/null +++ b/Gamedata/explosions/lvl4r.lua @@ -0,0 +1,85 @@ +-- lvl4r + +return { + ["lvl4r"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + water = true, + properties = { + alpha = 0.6, + alwaysvisible = true, + color = [[0.7, 0.5, 0.1]], + expansionspeed = [[2 r3]], + ttl = 50, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 50, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 25, + particlelife = 40, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 20, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = true, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl4r.tdf b/Gamedata/explosions/lvl4r.tdf deleted file mode 100644 index 02b8715e7..000000000 --- a/Gamedata/explosions/lvl4r.tdf +++ /dev/null @@ -1,99 +0,0 @@ -[lvl4r] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 5; - - size = 1; - sizeGrowth = 50; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=50; - alpha=0.6; - expansionSpeed=2 r3; - color=0.7, 0.5, 0.1; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 40; - particleLifeSpread = 0; - numParticles = 25; - particleSpeed = 10; - particleSpeedSpread = 20; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 50; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/lvl5r.lua b/Gamedata/explosions/lvl5r.lua new file mode 100644 index 000000000..9f7121859 --- /dev/null +++ b/Gamedata/explosions/lvl5r.lua @@ -0,0 +1,103 @@ +-- lvl5r + +return { + ["lvl5r"] = { + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + water = true, + properties = { + alpha = 0.6, + alwaysvisible = true, + color = [[0.1, 0.5, 0.7]], + expansionspeed = [[2 r3]], + ttl = 50, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 50, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 25, + particlelife = 40, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 20, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = true, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[laserendblue]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/lvl5r.tdf b/Gamedata/explosions/lvl5r.tdf deleted file mode 100644 index 9407db6f6..000000000 --- a/Gamedata/explosions/lvl5r.tdf +++ /dev/null @@ -1,123 +0,0 @@ -[lvl5r] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserendblue; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 10; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 10; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=50; - alpha=0.6; - expansionSpeed=2 r3; - color=0.1, 0.5, 0.7; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 40; - particleLifeSpread = 0; - numParticles = 25; - particleSpeed = 10; - particleSpeedSpread = 20; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 1; - } - air=1; - ground=1; - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 50; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 0, 0.5, 1; - - air=1; - ground=1; - water=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/maeksmoke.lua b/Gamedata/explosions/maeksmoke.lua new file mode 100644 index 000000000..d957a249f --- /dev/null +++ b/Gamedata/explosions/maeksmoke.lua @@ -0,0 +1,63 @@ +-- maeksmoke + +return { + ["maeksmoke"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.20 0.20 0.20 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0 0, 0]], + numparticles = 4, + particlelife = 50, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 10, + particlespeed = 10, + particlespeedspread = 2, + pos = [[0.5 0.5, 1 2, 0.5 0.5]], + sizegrowth = 1.2, + sizemod = 1, + texture = [[new_dirta]], + useairlos = false, + }, + }, + dirtw = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0 0, 0]], + numparticles = 10, + particlelife = 50, + particlelifespread = 5, + particlesize = 2, + particlesizespread = 2, + particlespeed = 10, + particlespeedspread = 2, + pos = [[0.5 0.5, 1 2, 0.5 0.5]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[new_dirta]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/maeksmoke.tdf b/Gamedata/explosions/maeksmoke.tdf deleted file mode 100644 index 9a91bfb93..000000000 --- a/Gamedata/explosions/maeksmoke.tdf +++ /dev/null @@ -1,80 +0,0 @@ -// use this effect sparingly. It can slow machines down. -[maeksmoke] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=new_dirta; - sizeGrowth=1.2; - sizeMod=1; - - pos = 0.5 0.5, 1 2, 0.5 0.5; - emitVector = 0, 1, 0; - gravity = 0, 0 0, 0; - - colorMap = 0.20 0.20 0.20 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=50; - particleLifeSpread=5; - - numParticles=4; - - particleSpeed=10; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=10; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } - - [dirtw] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=new_dirta; - sizeGrowth=-0.2; - sizeMod=1; - - pos = 0.5 0.5, 1 2, 0.5 0.5; - emitVector = 0, 1, 0; - gravity = 0, 0 0, 0; - - colorMap = 1 1 1 0.5 0.5 0.5 0.5 0.8 0 0 0 0.0; - airdrag = 0.7; - - particleLife=50; - particleLifeSpread=5; - - numParticles=10; - - particleSpeed=10; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=2; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - water=1; - count=1; - } -} diff --git a/Gamedata/explosions/mainmegapartgun.lua b/Gamedata/explosions/mainmegapartgun.lua new file mode 100644 index 000000000..b0b27506e --- /dev/null +++ b/Gamedata/explosions/mainmegapartgun.lua @@ -0,0 +1,100 @@ +-- mainmegapartgun + +return { + ["mainmegapartgun"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + pillar = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,0 i5, 0]], + size = 90, + sizegrowth = -11, + speed = [[0, 10, 0]], + texture = [[pinknovaexplo]], + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 0.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 40, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 19, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 90, + sizegrowth = 0.9, + speed = [[0, 1 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mainmegapartgun.tdf b/Gamedata/explosions/mainmegapartgun.tdf deleted file mode 100644 index be990578c..000000000 --- a/Gamedata/explosions/mainmegapartgun.tdf +++ /dev/null @@ -1,114 +0,0 @@ -[mainmegapartgun] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.5; - size = 90; - sizeGrowth = 0.9; - pos = r-2 r2, 5, r-2 r2; speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [pillar] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 15; - maxheat = 15; - heatFalloff = 2.5; - size = 90; - sizeGrowth = -11; - - pos = 0,0 i5, 0; - speed=0, 10, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 0.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 40; - particleSpeed = 19; - particleSpeedSpread = 4; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 120; flashAlpha = 0.9; - circleGrowth = 8; - circleAlpha = 0.5; - alwaysVisible=1; - - color = 1, 0.3, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/mediumcannon.lua b/Gamedata/explosions/mediumcannon.lua new file mode 100644 index 000000000..0e3a91f51 --- /dev/null +++ b/Gamedata/explosions/mediumcannon.lua @@ -0,0 +1,319 @@ +-- mediumcannonweapon3 +-- mediumcannonweapon2 +-- mediumcannonweapon + +return { + ["mediumcannonweapon3"] = { + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 1, + speed = [[0, 0 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 5, + heatfalloff = 1.3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 1, + speed = [[0, 0 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["mediumcannonweapon2"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 1, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0.6, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 2, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + + ["mediumcannonweapon"] = { + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 15, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 1, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 5, + heatfalloff = 1.3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 1, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mediumcannon.tdf b/Gamedata/explosions/mediumcannon.tdf deleted file mode 100644 index d9337d117..000000000 --- a/Gamedata/explosions/mediumcannon.tdf +++ /dev/null @@ -1,421 +0,0 @@ -[MEDIUMCANNONWEAPON] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 0.5; - sizeGrowth = 1; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 5; - maxheat = 10; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 1; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 1; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } -} - - - -[MEDIUMCANNONWEAPON2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 0.5; - sizeGrowth = 2; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 3; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 4; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=0.5; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=0.6; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=0.6; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=1; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=0.6; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } -} - -[MEDIUMCANNONWEAPON3] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 0.5; - sizeGrowth = 1; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 5; - maxheat = 10; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 1; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = 0, 0, 0; - emitRot = 45; - emitRotSpread = 15; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 1; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } -} diff --git a/Gamedata/explosions/medmechpop.lua b/Gamedata/explosions/medmechpop.lua new file mode 100644 index 000000000..5c05e110b --- /dev/null +++ b/Gamedata/explosions/medmechpop.lua @@ -0,0 +1,129 @@ +-- medmechpop + +return { + ["medmechpop"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.1, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.7, + circlegrowth = 10, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 12, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 40, + particlelife = 5, + particlelifespread = 16, + particlesize = 15, + particlesizespread = 0, + particlespeed = 19, + particlespeedspread = 10, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop0 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.7, + maxheat = 15, + pos = [[0, 5, 0]], + size = 20, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-3 r3, 5, r-3 r3]], + size = 1, + sizegrowth = 12, + speed = [[0, 1, 0]], + texture = [[purpleexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/megapartgun.lua b/Gamedata/explosions/megapartgun.lua new file mode 100644 index 000000000..428c68abc --- /dev/null +++ b/Gamedata/explosions/megapartgun.lua @@ -0,0 +1,72 @@ +-- megapartgun + +return { + ["megapartgun"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 140, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0.30000001192093, + [3] = 0.5, + }, + }, + pillar = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,0 i5, 0]], + size = 90, + sizegrowth = -11, + speed = [[0, 10, 0]], + texture = [[pinknovaexplo]], + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.5, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 90, + sizegrowth = 0.9, + speed = [[0, 1 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/megapartgun.tdf b/Gamedata/explosions/megapartgun.tdf deleted file mode 100644 index 22e8434ca..000000000 --- a/Gamedata/explosions/megapartgun.tdf +++ /dev/null @@ -1,72 +0,0 @@ -[megapartgun] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; texture=pinknovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.5; - size = 90; - sizeGrowth = 0.9; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - - air=1; - water=1; - ground=1; - count=1; - } - - [pillar] - { - class=heatcloud; - - [properties] { - alwaysVisible=1; - texture=pinknovaexplo; heat = 15; maxheat = 15; - heatFalloff = 2.5; - size = 90; sizeGrowth = -11; - - pos = 0,0 i5, 0; speed=0, 10, 0; - } - air=1; - water=1; - ground=1; - count=3; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; pos=r-10 r10, 0, r-10 r10; } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 140; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 1, 0.3, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/meteortrail.lua b/Gamedata/explosions/meteortrail.lua new file mode 100644 index 000000000..a164b3205 --- /dev/null +++ b/Gamedata/explosions/meteortrail.lua @@ -0,0 +1,36 @@ +-- meteortrail + +return { + ["meteortrail"] = { + usedefaultexplosions = false, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.0 0.0 0.0 0.1 0.7 0.5 0.2 0.1 0.0 0.0 0.0 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 1, 0]], + numparticles = 4, + particlelife = 200, + particlelifespread = 15, + particlesize = 50, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 50, + pos = [[0, 1, 0]], + sizegrowth = -1, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mexbase.lua b/Gamedata/explosions/mexbase.lua new file mode 100644 index 000000000..77d29db4e --- /dev/null +++ b/Gamedata/explosions/mexbase.lua @@ -0,0 +1,53 @@ +-- mexbaseeffect + +return { + ["mexbaseeffect"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.1 0.65 0.01 1.0 0.7 0.3 0.15 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 20, + particlesizespread = 0, + particlespeed = 17, + particlespeedspread = 2, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + smoke = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.05, + alwaysvisible = true, + color = 0.1, + pos = [[r-800 r800, 3, r-800 r800]], + size = 2, + sizeexpansion = 0.6, + sizegrowth = 5, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 1, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mexbase.tdf b/Gamedata/explosions/mexbase.tdf deleted file mode 100644 index 7cb1247c8..000000000 --- a/Gamedata/explosions/mexbase.tdf +++ /dev/null @@ -1,64 +0,0 @@ -[mexbaseeffect] -{ - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0.3, 0; - - colorMap= 0.1 0.65 0.01 1.0 0.7 0.3 0.15 0.1 0 0 0 0.01; - Texture=dirt; - - airdrag=0.95; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=17; - particleSpeedSpread=2; - particleSize=20; - particleSizeSpread=0; - - emitRot=90; - emitRotSpread=10; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.05; - - startSize = 1; - sizeExpansion = 0.6; - size = 2; - sizeGrowth = 5; - - pos = r-800 r800, 3, r-800 r800; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=3; - } - -} diff --git a/Gamedata/explosions/mexbaseeffect.lua b/Gamedata/explosions/mexbaseeffect.lua new file mode 100644 index 000000000..1262f659e --- /dev/null +++ b/Gamedata/explosions/mexbaseeffect.lua @@ -0,0 +1,25 @@ +-- mexbaseeffect + +return { + ["mexbaseeffect"] = { + smoke = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.05, + alwaysvisible = true, + color = 0.1, + pos = [[r-800 r800, 3, r-800 r800]], + size = 2, + sizeexpansion = 0.6, + sizegrowth = 5, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 1, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mexbaseeffect.tdf b/Gamedata/explosions/mexbaseeffect.tdf deleted file mode 100644 index 324fbdc4a..000000000 --- a/Gamedata/explosions/mexbaseeffect.tdf +++ /dev/null @@ -1,25 +0,0 @@ -[mexbaseeffect] -{ - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.05; - - startSize = 1; - sizeExpansion = 0.6; - size = 2; - sizeGrowth = 5; - - pos = r-800 r800, 3, r-800 r800; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=3; - } - -} diff --git a/Gamedata/explosions/mextopeffect.lua b/Gamedata/explosions/mextopeffect.lua new file mode 100644 index 000000000..38168ead2 --- /dev/null +++ b/Gamedata/explosions/mextopeffect.lua @@ -0,0 +1,244 @@ +-- mextopeffectup1 +-- mextopeffectup3 +-- mextopeffectup2 +-- mextopeffect + +return { + ["mextopeffectup1"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.2 0.5 0.01 0.1 1 0.3 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 6, + particlelife = 30, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 16, + particlesize = 3, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["mextopeffectup3"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 1 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 6, + particlelife = 30, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 16, + particlesize = 3, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["mextopeffectup2"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 1 0.5 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 6, + particlelife = 30, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 16, + particlesize = 3, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["mextopeffect"] = { + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 6, + particlelife = 30, + particlelifespread = 1, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + moredots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.1, 0]], + numparticles = 6, + particlelife = 20, + particlelifespread = 16, + particlesize = 3, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/mextopeffect.tdf b/Gamedata/explosions/mextopeffect.tdf deleted file mode 100644 index 05dfd09c5..000000000 --- a/Gamedata/explosions/mextopeffect.tdf +++ /dev/null @@ -1,315 +0,0 @@ -[mextopeffect] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 30; - particleLifeSpread = 1; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 20; - particleLifeSpread = 16; - numParticles = 6; - particleSpeed = 5; - particleSpeedSpread = 3; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} - -[mextopeffectup1] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.2 0.2 0.5 0.01 0.1 1 0.3 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 30; - particleLifeSpread = 1; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 20; - particleLifeSpread = 16; - numParticles = 6; - particleSpeed = 5; - particleSpeedSpread = 3; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} - -[mextopeffectup2] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 1 0.5 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 30; - particleLifeSpread = 1; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 20; - particleLifeSpread = 16; - numParticles = 6; - particleSpeed = 5; - particleSpeedSpread = 3; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} - -[mextopeffectup3] -{ - - [ELECTRICARCS1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=lightening; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 30; - particleLifeSpread = 1; - numParticles = 6; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [MOREDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.05 0.2 0.5 0.9 0.01 0.1 0.1 0.8 0.00; - - pos = 0, 2, 0; - gravity = 0, -0.1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 20; - particleLifeSpread = 16; - numParticles = 6; - particleSpeed = 5; - particleSpeedSpread = 3; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} diff --git a/Gamedata/explosions/minigun.lua b/Gamedata/explosions/minigun.lua new file mode 100644 index 000000000..f4e7c59e3 --- /dev/null +++ b/Gamedata/explosions/minigun.lua @@ -0,0 +1,120 @@ +-- minigun +-- minigun2 + +return { + ["minigun"] = { + sparks1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.1 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 13, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, 0, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + sparks2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.1 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 13, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, r6, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + }, + + ["minigun2"] = { + sparks1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.04 0.1 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 13, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, 0, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + sparks2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.9, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.1 0.1 0.1 0.05]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 5, + particlelife = 13, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 1, + pos = [[r3, r6, r3]], + sizegrowth = 0.7, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/minigun.tdf b/Gamedata/explosions/minigun.tdf deleted file mode 100644 index 37b1f9aa4..000000000 --- a/Gamedata/explosions/minigun.tdf +++ /dev/null @@ -1,151 +0,0 @@ -[minigun] -{ - [sparks1] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.1 0.01 0.1 0.1 0.5 0.01; - - pos = r3, 0, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 13; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [sparks2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.1 0.05; - - pos = r3, r6, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 13; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} - - - -[minigun2] -{ - [sparks1] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.9 0.5 0.4 0.04 0.1 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = r3, 0, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 13; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [sparks2] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.1 0.1 0.1 0.05; - - pos = r3, r6, r3; - gravity = 0, -1, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.7; - sizeMod = 0.5; - - airdrag = 0.9; - particleLife = 13; - particleLifeSpread = 5; - numParticles = 5; - particleSpeed = 2; - particleSpeedSpread = 1; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/miofskyparticles.lua b/Gamedata/explosions/miofskyparticles.lua new file mode 100644 index 000000000..cb0691e05 --- /dev/null +++ b/Gamedata/explosions/miofskyparticles.lua @@ -0,0 +1,53 @@ +-- miofskyparticles + +return { + ["miofskyparticles"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0.3 0.5 0.01 1.0 0.15 0.2 0.15 0.1 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 10, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.3, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 20, + particlesizespread = 0, + particlespeed = 17, + particlespeedspread = 2, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + smoke = { + air = true, + count = 3, + ground = true, + water = true, + properties = { + agespeed = 0.05, + alwaysvisible = true, + color = 0.1, + pos = [[r-800 r800, 3, r-800 r800]], + size = 2, + sizeexpansion = 0.6, + sizegrowth = 5, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 1, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/miofskyparticles.tdf b/Gamedata/explosions/miofskyparticles.tdf deleted file mode 100644 index 894972105..000000000 --- a/Gamedata/explosions/miofskyparticles.tdf +++ /dev/null @@ -1,64 +0,0 @@ -[miofskyparticles] -{ - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 1, 0; - gravity= 0, 0.3, 0; - - colorMap= 0.3 0.5 0.01 1.0 0.15 0.2 0.15 0.1 0 0 0 0.01; - Texture=dirt; - - airdrag=0.95; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=17; - particleSpeedSpread=2; - particleSize=20; - particleSizeSpread=0; - - emitRot=90; - emitRotSpread=10; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.05; - - startSize = 1; - sizeExpansion = 0.6; - size = 2; - sizeGrowth = 5; - - pos = r-800 r800, 3, r-800 r800; - speed=r-3 r3, 1 r2.3, r-3 r3; - } - air=1; - water=1; - ground=1; - count=3; - } - -} diff --git a/Gamedata/explosions/missile_explosion.lua b/Gamedata/explosions/missile_explosion.lua new file mode 100644 index 000000000..ba4b597a5 --- /dev/null +++ b/Gamedata/explosions/missile_explosion.lua @@ -0,0 +1,100 @@ +-- missile_explosion + +return { + ["missile_explosion"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/missiletrail-optimized.lua b/Gamedata/explosions/missiletrail-optimized.lua new file mode 100644 index 000000000..02c3796a1 --- /dev/null +++ b/Gamedata/explosions/missiletrail-optimized.lua @@ -0,0 +1,294 @@ +return { +--hover + ["emissiletanktrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 15, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 31, + sidetexture = [[flashside2-red]], + size = 5, + sizegrowth = 0, + ttl = 40, + }, + }, + }, + +--hbot + ["ehbotrocko-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 15, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 31, + sidetexture = [[flashside2-purple]], + size = 5, + sizegrowth = 0, + ttl = 40, + }, + }, + }, + +--amphibs + ["amphibrocktrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 15, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 30, + sidetexture = [[flashside2-orange]], + size = 5, + sizegrowth = 0, + ttl = 30, + }, + }, + }, + + +--aircraft + ["gunshiptrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 32, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 31, + sidetexture = [[flashside2]], + size = 5, + sizegrowth = 0, + ttl = 20, + }, + }, + }, + + + ["bombertrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 32, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 31, + sidetexture = [[flashside2-red]], + size = 10, + sizegrowth = 0, + ttl = 20, + }, + }, + }, + ["emptrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 60, + sidetexture = [[sparkexplo]], + size = 5, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 60, + sidetexture = [[flashside2-blue]], + size = 15, + sizegrowth = 0, + ttl = 20, + }, + }, + }, + +--Zaal + ["zaalspiketrail-optimized"] = { + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.73 0.4 0.01 1 0.64 0.25 0.01 1.0 0.4 0.12 0.01 0.5 0.22 0.03 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 4, + sidetexture = [[sparkexplo]], + size = 3, + sizegrowth = 1, + ttl = 3, + }, + }, + trail = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.70 0.70 0.70 0.025 0.05 0.05 0.05 0.025 0 0 0 0.01 0 0 0 0.0]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = 5, + sidetexture = [[flashside2-orange]], + size = 1, + sizegrowth = 0, + ttl = 30, + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/missiletrail.lua b/Gamedata/explosions/missiletrail.lua new file mode 100644 index 000000000..e24ea4350 --- /dev/null +++ b/Gamedata/explosions/missiletrail.lua @@ -0,0 +1,760 @@ +-- missiletrailblue +-- missiletrail +-- missiletrailsmall +-- missiletrailgunshiplesssmokey +-- missiletrailbomber +-- missiletrailflashy +-- missiletrailnuke +-- missiletrailaa +-- missiletrailgunship +-- missiletrailgreen + +return { + ["missiletrailblue"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 4, + particlesize = 2, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrail"] = { + core = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 5, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.5 0.3 0.0 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrailsmall"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrailsabot"] = { + + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.1 0.0 0.05 0.5 0.3 0.0 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 5, + particlelife = 3, + particlelifespread = 2, + particlesize = 3, + particlesizespread = 5, + particlespeed = 4, + particlespeedspread = 0, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.25 0.25 0.25 0.05 0.2 0.2 0.2 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0.0, 0.5, 0.0]], + numparticles = 2, + particlelife = 8, + particlelifespread = 2, + particlesize = 2, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 0, + pos = [[0.0, 1, 0.0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrailgunshiplesssmokey"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 35, + emitrotspread = 2, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 5, + particlelifespread = 7, + particlesize = 13, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 10, + pos = [[0, 1, 0]], + sizegrowth = 5, + sizemod = 0.8, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.25 0.25 0.25 0.1 0.5 0.5 0.5 0.1 0.25 0.25 0.25 0.1 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 1, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 5, + particlelifespread = 7, + particlesize = 13, + particlesizespread = 1, + particlespeed = 1.25, + particlespeedspread = 0, + pos = [[0, 1, 0]], + sizegrowth = 3, + sizemod = 0.8, + texture = [[smoke]], + }, + }, + coreflame2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + exhale2 = { + air = false, + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + underwater = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 4, + particlelife = 30, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + + ["missiletrailbomber"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 50, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 100, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + }, + + ["missiletrailflashy"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 10, + particlelife = 5, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 20, + particlespeed = 10, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.8, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrailnuke"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 20, + particlelife = 50, + particlelifespread = 4, + particlesize = 2, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.8, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["missiletrailaa"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 30, + particlelifespread = 15, + particlesize = 15, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + }, + + ["missiletrailgunship"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 50, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 100, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + coreflame2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 4, + particlelife = 30, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + + ["missiletrailgreen"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0.80000001192093, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.5 0.3 0.05 0.1 0.5 0.1 1.0 0.1 0.2 0.1 1.0 0.3 0.5 0.3 1.0 0 0.2 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 10, + particlelife = 5, + particlelifespread = 4, + particlesize = 15, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -1, + sizemod = 0.9, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/missiletrail.tdf b/Gamedata/explosions/missiletrail.tdf deleted file mode 100644 index 0371b3637..000000000 --- a/Gamedata/explosions/missiletrail.tdf +++ /dev/null @@ -1,777 +0,0 @@ -[missiletrail] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.1; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap =0.5 0.3 0.0 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=2; - - particleSpeed=2; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=20; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [core] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.1; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.1 0.1 0.1 0.005 0 0 0 0.01; - airdrag = 0.70; - - particleLife=5; - particleLifeSpread=4; - - numParticles=2; - - particleSpeed=2; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=20; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} - -[missiletrailflashy] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=0.8; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=10; - - particleSpeed=10; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} - -[missiletrailnuke] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=0.8; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=20; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} - - - -[missiletrailblue] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - water=1; - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} - - -[missiletrailbomber] -{ - - [coreflame] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - - particleLifeSpread=0; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=50; - numParticles=4; - particleSpeed=0; - particleSize=5; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=0; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } - - [exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=100; - numParticles=4; - particleSpeed=2; - particleSize=13; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - } - air=1; - water=1; - ground=1; - count=1; - } -} - - -[missiletrailgunship] -{ - - [coreflame] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - - particleLifeSpread=0; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=50; - numParticles=4; - particleSpeed=0; - particleSize=5; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=0; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } - - [exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=100; - numParticles=4; - particleSpeed=2; - particleSize=13; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - } - air=1; - water=1; - ground=1; - count=1; - } -} - - - - -[missiletrailgunshiplesssmokey] -{ - - [coreflame] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=0.8; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.5; - colorMap=0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=1; - particleSizeSpread=1; - - particleLife=20; - numParticles=4; - particleSpeed=0.; - particleSize=13; - - - emitVector=dir; - emitRot=0; - emitRotSpread=0.015; - directional=0; - - } - air=1; - water=1; - ground=1; - count=1; - } - - [exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=3; - sizeMod=0.8; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.25 0.25 0.25 0.5 0.5 0.5 0.5 0.5 0.25 0.25 0.25 0.5 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=1; - particleSizeSpread=1; - - particleLife=40; - numParticles=4; - particleSpeed=2; - particleSize=13; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=2; - directional=0; - - } - air=1; - water=1; - ground=1; - count=1; - } -} - - - - - - -[missiletrailaa] -{ - - [coreflame] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - - particleLifeSpread=0; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=20; - numParticles=2; - particleSpeed=0; - particleSize=5; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=0; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } - - [exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=2; - particleSizeSpread=1; - - particleLife=30; - numParticles=4; - particleSpeed=2; - particleSize=15; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - } - air=1; - water=1; - ground=1; - count=1; - } -} - - -[missiletrailsmall] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-0.2; - sizeMod=0.9; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - water=1; - air=1; - ground=1; - count=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} - -[missiletrailgreen] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=-1; - sizeMod=0.9; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.5 0.3 0.05 0.1 0.5 0.1 1.0 0.1 0.2 0.1 1.0 0.3 0.5 0.3 1.0 0 0.2 0 0.01; - airdrag = 0.70; - - particleLife=5; - particleLifeSpread=4; - - numParticles=10; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=15; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=gunshot; - - colorMap = 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - water=1; - air=1; - ground=1; - count=1; - } - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.8, 0.1, 0.0; - } -} diff --git a/Gamedata/explosions/muzzelflash.lua b/Gamedata/explosions/muzzelflash.lua new file mode 100644 index 000000000..169a9473b --- /dev/null +++ b/Gamedata/explosions/muzzelflash.lua @@ -0,0 +1,348 @@ +-- shotgun +-- bluemuzzle +-- large_muzzle_flash_fx +-- megapartflash +-- smallvulcan +-- redmuzzle +-- yellowmuzzelflash +-- beammuzzle +-- vulcan + +return { + ["shotgun"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.03 1.0 0.7 0.0 0.0 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 6, + sidetexture = [[shotgunside]], + size = 5, + sizegrowth = 3, + ttl = 2, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[1.0 0.7 0.0 0.0 1.0 0.7 0.0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[gunshot]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["bluemuzzle"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.01 0.0 0.55 0.5 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash3]], + length = 30, + sidetexture = [[shot]], + size = 10, + sizegrowth = 1, + ttl = 3, + }, + }, + }, + + ["large_muzzle_flash_fx"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.9 0.8 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[muzzlefront]], + length = 50, + sidetexture = [[muzzleside]], + size = 9, + sizegrowth = -1, + ttl = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 3.5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["megapartflash"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.01 1 0.5 0.8 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[flash3]], + length = 20, + sidetexture = [[shot]], + size = 10, + sizegrowth = 1, + ttl = 3, + }, + }, + redpuff = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 0.6 0 0.01 0.9 0.8 0.7 0.03 0 0 0 0.01]], + directional = true, + emitrot = 1, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0, .0]], + numparticles = 3, + particlelife = 1, + particlelifespread = 2, + particlesize = 1, + particlesizespread = 1, + particlespeed = 0, + particlespeedspread = 3, + pos = [[0.0, 1, 0.0]], + sizegrowth = 0.9, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + + ["smallvulcan"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.01 1 0.5 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[flash3]], + length = 5, + sidetexture = [[shot]], + size = 2, + sizegrowth = 1, + ttl = 2, + }, + }, + }, + + ["redmuzzle"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.01 1 0.9 0.36 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[flash3]], + length = 30, + sidetexture = [[shot]], + size = 10, + sizegrowth = 1, + ttl = 7, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + heat = 10, + heatfalloff = 3.5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 5, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["yellowmuzzelflash"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1 0.5 0.2 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[flash3]], + length = 30, + sidetexture = [[shot]], + size = 9, + sizegrowth = 1, + ttl = 1, + }, + }, + }, + + ["beammuzzle"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 1 1 0.01 1 0.2 1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash3]], + length = 50, + sidetexture = [[shot]], + size = 20, + sizegrowth = -1, + ttl = 5, + }, + }, + }, + + ["vulcan"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.6 0.9 0.01 1 0.5 0.8 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0.05, + fronttexture = [[flash3]], + length = 30, + sidetexture = [[shot]], + size = 5, + sizegrowth = 1, + ttl = 1.5, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.70, + colormap = [[0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 2, 0.0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 4, + particlesize = 0, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = 3, + sizemod = 0.5, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/muzzelflash.tdf b/Gamedata/explosions/muzzelflash.tdf deleted file mode 100644 index 270f43ac7..000000000 --- a/Gamedata/explosions/muzzelflash.tdf +++ /dev/null @@ -1,418 +0,0 @@ -[bluemuzzle] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.01 0.0 0.55 0.5 0.01 0 0 0 0.01; - size=10; - length=30; - sizeGrowth=1; - ttl=3; - frontOffset=0; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[redmuzzle] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 3.5; - - size = 5; - sizeGrowth = 40; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.01 1 0.9 0.36 0.01 0 0 0 0.01; - size=10; - length=30; - sizeGrowth=1; - ttl=7; - frontOffset=0.05; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[yellowmuzzelflash] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.7 0.4 0.01 1 0.5 0.2 0.01 0 0 0 0.01; - size=9; - length=30; - sizeGrowth=1; - ttl=1; - frontOffset=0.05; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - - -[vulcan] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 0.6 0.9 0.01 1 0.5 0.8 0.01 0 0 0 0.01; - size=5; - length=30; - sizeGrowth=1; - ttl=1.5; - frontOffset=0.05; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=3; - sizeMod=0.5; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 2, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.5 0.3 0.0 0.05 0.5 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=10; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=0; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[megapartflash] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.01 1 0.5 0.8 0.01 0 0 0 0.01; - size=10; - length=20; - sizeGrowth=1; - ttl=3; - frontOffset=0.05; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } - [redpuff] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=0.9; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = dir; - gravity = 0.0, 0, .0; - - colorMap = 1 0.6 0 0.01 0.9 0.8 0.7 0.03 0 0 0 0.01; - airdrag = 1; - - particleLife=1; - particleLifeSpread=2; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=3; - particleSize=1; - particleSizeSpread=1; - - emitRot=1; - emitRotSpread=5; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[smallvulcan] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.01 1 0.5 0.1 0.01 0 0 0 0.01; - size=2; - length=5; - sizeGrowth=1; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[shotgun] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 5; - - size = 1; - sizeGrowth = 40; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=gunshot; - - colorMap = 1.0 0.7 0.0 0.0 1.0 0.7 0.0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 20; - particleSpeedSpread = 10; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.03 1.0 0.7 0.0 0.0 0 0 0 0.01; - size=5; - length=6; - sizeGrowth=3; - ttl=2; - frontOffset=0; - sideTexture=shotgunside; - frontTexture=shotgunflare; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[beammuzzle] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = dir; - colorMap=1 1 1 0.01 1 0.2 1 0.01 0 0 0 0.01; - size=20; - length=50; - sizeGrowth=-1; - ttl=5; - frontOffset=0; - sideTexture=shot; - frontTexture=flash3; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} - -[LARGE_MUZZLE_FLASH_FX] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 3.5; - - size = 5; - sizeGrowth = 40; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - [properties] - { - dir = dir; // don't touch me - colorMap=0.9 0.8 0.1 0.01 0 0 0 0.01; - size=9; - length=50; - sizeGrowth=-1; - ttl=10; - frontOffset=0; - sideTexture=muzzleside; - frontTexture=muzzlefront; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nano.lua b/Gamedata/explosions/nano.lua new file mode 100644 index 000000000..90f9130dd --- /dev/null +++ b/Gamedata/explosions/nano.lua @@ -0,0 +1,68 @@ +-- nano +-- nanohuge + +return { + ["nano"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.25 0.60 0.30 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 20, + particlesize = 12, + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[electriclight]], + useairlos = false, + }, + }, + }, + + ["nanohuge"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.25 0.60 0.30 1.0 0 0 0 0.0]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 0, 0]], + gravity = [[0, 0.3 r0.3, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 20, + particlesize = [[12 r4]], + particlesizespread = 10, + particlespeed = 1, + particlespeedspread = 6, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[electriclight]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nano.tdf b/Gamedata/explosions/nano.tdf deleted file mode 100644 index 501c59df6..000000000 --- a/Gamedata/explosions/nano.tdf +++ /dev/null @@ -1,84 +0,0 @@ -// use this effect sparingly. It can slow machines down. -[nano] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=electriclight; - sizeGrowth=1.5; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.25 0.60 0.30 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=60; - particleLifeSpread=20; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=6; - particleSize=12; - particleSizeSpread=10; - - emitRot=90; - emitRotSpread=32; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } -} - -[nanohuge] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=electriclight; - sizeGrowth=1.5; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 0, 0; - gravity = 0, 0.3 r0.3, 0; - - colorMap = 0.25 0.60 0.30 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=60; - particleLifeSpread=20; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=6; - particleSize=12 r4; - particleSizeSpread=10; - - emitRot=0; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nanoorb.lua b/Gamedata/explosions/nanoorb.lua new file mode 100644 index 000000000..5b581ba10 --- /dev/null +++ b/Gamedata/explosions/nanoorb.lua @@ -0,0 +1,90 @@ +-- nanoorb + +return { + ["nanoorb"] = { + usedefaultexplosions = false, + lightball50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0.7 0.01 0 0 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb3]], + }, + }, + lightball52 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 15, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightb4]], + }, + }, + lightring50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 1 1 0.01 0.7 0.7 0.7 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightring]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nanoorb.tdf b/Gamedata/explosions/nanoorb.tdf deleted file mode 100644 index b486bbc21..000000000 --- a/Gamedata/explosions/nanoorb.tdf +++ /dev/null @@ -1,93 +0,0 @@ -[nanoorb] -{ - usedefaultexplosions=0; - [lightball50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0.7 0.01 0 0 1 0.01 0 0 0 0.01; - Texture=lightb3; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightring50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 1 1 0.01 0.7 0.7 0.7 0.01 0 0 0 0.01; - Texture=lightring; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [lightball52] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=0 0 0 0.01 0 0 0 0.01 0.7 0.7 0.7 0.01 1 1 1 0.01 0 0 0 0.01; - Texture=lightb4; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=15; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/needspower.lua b/Gamedata/explosions/needspower.lua new file mode 100644 index 000000000..100bb814e --- /dev/null +++ b/Gamedata/explosions/needspower.lua @@ -0,0 +1,36 @@ +-- needspower + +return { + ["needspower"] = { + usedefaultexplosions = false, + lightring50 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.95, + colormap = [[1 0.5 0.0 0.01 1 1 0 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[powersymbol]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/needspower.tdf b/Gamedata/explosions/needspower.tdf deleted file mode 100644 index f7827dd0b..000000000 --- a/Gamedata/explosions/needspower.tdf +++ /dev/null @@ -1,35 +0,0 @@ -[needspower] -{ - usedefaultexplosions=0; - - [lightring50] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, 0, 0; - colorMap=1 0.5 0.0 0.01 1 1 0 0.01 0 0 0 0.01; - Texture=powersymbol; - airdrag=0.95; - particleLife=20; - particleLifeSpread=0; - numParticles=1; - particleSpeed=0; - particleSpeedSpread=0; - particleSize=1; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=1; - directional=0; - } - air=1; - water=1; - ground=1; - count=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/nuke.lua b/Gamedata/explosions/nuke.lua new file mode 100644 index 000000000..969c3983a --- /dev/null +++ b/Gamedata/explosions/nuke.lua @@ -0,0 +1,456 @@ +-- nuke2 +-- nukeimpact +-- nuke + +return { + ["nuke2"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 4, + flashalpha = 0.9, + flashsize = 1000, + ground = true, + ttl = 200, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.5, 0]], + numparticles = 128, + particlelife = 60, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 104, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof03 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 6, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 10, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + }, + + ["nukeimpact"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 4, + flashalpha = 0.9, + flashsize = 1000, + ground = true, + ttl = 200, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.5, 0]], + numparticles = 128, + particlelife = 60, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 104, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof03 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 6, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 10, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + }, + + ["nuke"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 45, + water = true, + color = { + [1] = 0, + [2] = 0.30000001192093, + [3] = 1, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.5, 0]], + numparticles = 128, + particlelife = 3, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 104, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + poof03 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 6, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[electnovaexplo]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 74, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 10, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 60, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nuke.tdf b/Gamedata/explosions/nuke.tdf deleted file mode 100644 index 0ab8b1cb5..000000000 --- a/Gamedata/explosions/nuke.tdf +++ /dev/null @@ -1,580 +0,0 @@ -[NUKE] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 74; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 60; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=10; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 128; - particleSpeed = 104; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap = 0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF03] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap =0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 6; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 45; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.5; - - color = 0.0, 0.3, 1; - - air=1; - ground=1; - water=1; - } -} - -[NUKE2] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 50; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 40; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=10; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 60; - particleLifeSpread = 350; - numParticles = 128; - particleSpeed = 104; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap = 0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF03] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=electnovaexplo; - - colorMap =0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 6; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 200; - flashSize = 1000; - flashAlpha = 0.9; - - circleGrowth = 4; - circleAlpha = 0.5; - - color = 1, 0.7, 0.3; - - air=1; - ground=1; - water=1; - } -} - -[NUKEIMPACT] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 50; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 40; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=10; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap =0.8 0.2 0.2 0.01 0.8 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 60; - particleLifeSpread = 350; - numParticles = 128; - particleSpeed = 104; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=electnovaexplo; - - colorMap = 0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF03] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=electnovaexplo; - - colorMap =0.8 0.2 0.2 0.01 0.5 0.2 0.2 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 6; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 200; - flashSize = 1000; - flashAlpha = 0.9; - - circleGrowth = 4; - circleAlpha = 0.5; - - color = 1, 0.7, 0.3; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nukeartyexpl.lua b/Gamedata/explosions/nukeartyexpl.lua new file mode 100644 index 000000000..917666006 --- /dev/null +++ b/Gamedata/explosions/nukeartyexpl.lua @@ -0,0 +1,126 @@ +-- nukeartyexpl + +return { + ["nukeartyexpl"] = { + usedefaultexplosions = false, + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 40, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 1, + circlegrowth = 10, + flashalpha = 0.9, + flashsize = 700, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 0.69999998807907, + [2] = 0.30000001192093, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 1.5, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[uglynovaexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 2, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 64, + particlelife = 3, + particlelifespread = 350, + particlesize = 25, + particlesizespread = 3, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[uglynovaexplo]], + useairlos = false, + }, + }, + pop = { + air = true, + class = [[heatcloud]], + count = 5, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 15, + pos = [[r-25 r25, 5, r-25 r25]], + size = 55, + sizegrowth = 1.5, + speed = [[r-1 r1, 1 0, r-1 r1]], + texture = [[bigexplo]], + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.04, + alwaysvisible = true, + color = 0.1, + pos = [[r-3 r3, r-3 r3, r-3 r3]], + size = 80, + sizeexpansion = 0.9, + sizegrowth = 30, + speed = [[0, 1 r2.3, 0]], + startsize = 10, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nukeartyexpl.tdf b/Gamedata/explosions/nukeartyexpl.tdf deleted file mode 100644 index e62f56504..000000000 --- a/Gamedata/explosions/nukeartyexpl.tdf +++ /dev/null @@ -1,151 +0,0 @@ -[nukeartyexpl] -{ - [pop] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bigexplo; - heat = 10; - maxheat = 15; - heatFalloff = 0.4; - - size = 55; - sizeGrowth = 1.5; - - pos = r-25 r25, 5, r-25 r25; - speed=r-1 r1, 1 0, r-1 r1; - } - air=1; - water=1; - ground=1; - count=5; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.1; - ageSpeed=0.04; - - startSize = 10; - sizeExpansion = 0.9; - size = 80; - sizeGrowth = 30; - - pos = r-3 r3, r-3 r3, r-3 r3; - speed=0, 1 r2.3, 0; - } - air=1; - water=1; - ground=1; - count=8; - } - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=uglynovaexplo; - - colorMap = 1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 1.5; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=uglynovaexplo; - - colorMap =1 0.5 0.0 0.01 0.6 0.2 0.0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 3; - particleLifeSpread = 350; - numParticles = 64; - particleSpeed = 25; - particleSpeedSpread = 6; - particleSize = 25; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=40; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - usedefaultexplosions=0; - [groundflash] - { - alwaysVisible=1; - flashSize = 700; // flash size - flashAlpha = 0.9; // initial alpha of the flash - circleGrowth = 10; // size increase/frame - circleAlpha = 1; // initial alpha of the ring - ttl = 30; // number of frames - color = 0.7, 0.3, 0; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nukeartyshot.lua b/Gamedata/explosions/nukeartyshot.lua new file mode 100644 index 000000000..cf227fd68 --- /dev/null +++ b/Gamedata/explosions/nukeartyshot.lua @@ -0,0 +1,55 @@ +-- nukeartyshot + +return { + ["nukeartyshot"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 0, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.6, + texture = [[muzzleside]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 8, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[electriclight]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nukeartyshot.tdf b/Gamedata/explosions/nukeartyshot.tdf deleted file mode 100644 index 8956ef50f..000000000 --- a/Gamedata/explosions/nukeartyshot.tdf +++ /dev/null @@ -1,64 +0,0 @@ -[nukeartyshot] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=electriclight; - heat = 8; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=muzzleside; - - colorMap = 1.0 1.0 1.0 0.04 0.5 0.3 0.0 0.01 0.5 0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.6; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 0; - particleSize = 2; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nukedatbewm.lua b/Gamedata/explosions/nukedatbewm.lua new file mode 100644 index 000000000..f8a95d77f --- /dev/null +++ b/Gamedata/explosions/nukedatbewm.lua @@ -0,0 +1,188 @@ +-- nukedatbewm + +return { + ["nukedatbewm"] = { + alwaysvisible = true, + groundflash = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 2, + flashalpha = 0.5, + flashsize = 2000, + ground = true, + ttl = 600, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof01 = { + class = [[CSimpleParticleSystem]], + count = 2, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0.2 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 300, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 128, + particlelife = 300, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 104, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + poof03 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 2, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 300, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 50, + particlelifespread = 350, + particlesize = 55, + particlesizespread = 3, + particlespeed = 128, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof04 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 20, + particlelife = 300, + particlelifespread = 350, + particlesize = 50, + particlesizespread = 1, + particlespeed = 20, + particlespeedspread = 32, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + pop1 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 2, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 50, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + pop2 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 10, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 40, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nukedatbewm.tdf b/Gamedata/explosions/nukedatbewm.tdf deleted file mode 100644 index 2e74c029a..000000000 --- a/Gamedata/explosions/nukedatbewm.tdf +++ /dev/null @@ -1,218 +0,0 @@ -[NUKEDATBEWM] -{ - alwaysVisible=1; - [pop1] - { - class=heatcloud; - alwaysVisible=1; - - [properties] - { - alwaysVisible=1; - texture=bigexplosmoke; - heat = 10; - maxheat = 10; - heatFalloff = 0.4; - - size = 1; - sizeGrowth = 50; - - pos = r-10 r10, 0, r-10 r10; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - alwaysVisible=1; - - [properties] - { - alwaysVisible=1; - texture=bigexplosmoke; - heat = 10; - maxheat = 15; - heatFalloff = 0.6; - - size = 1; - sizeGrowth = 40; - - pos = r-150 r150, 0, r-300 r150; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=10; - } - - [POOF02] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=bigexplosmoke; - - colorMap =0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.5, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 300; - particleLifeSpread = 350; - numParticles = 128; - particleSpeed = 104; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=cloudexplo; - - colorMap = 0.8 0.6 0.2 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, 1, 0; - emitRot = 15; - emitRotSpread = 90; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 300; - particleLifeSpread = 350; - numParticles = 150; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF03] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=cloudexplo; - - colorMap =0.8 0.6 0 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.05, 0; - emitVector = 0, -1, 0; - emitRot = 15; - emitRotSpread = 300; - - sizeGrowth = 0; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 50; - particleLifeSpread = 350; - numParticles = 150; - particleSpeed = 128; - particleSpeedSpread = 6; - particleSize = 55; - particleSizeSpread = 3; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=2; - } - - [POOF04] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=bigexplosmoke; - - colorMap =0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0.2, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 300; - particleLifeSpread = 350; - numParticles = 20; - particleSpeed = 20; - particleSpeedSpread = 32; - particleSize = 50; - particleSizeSpread = 1; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 600; - flashSize = 2000; - flashAlpha = 0.5; - - circleGrowth = 2; - circleAlpha = 0.5; - - color = 1, 0.7, 0.3; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/nukedatbewmsmall.lua b/Gamedata/explosions/nukedatbewmsmall.lua new file mode 100644 index 000000000..fa402fe04 --- /dev/null +++ b/Gamedata/explosions/nukedatbewmsmall.lua @@ -0,0 +1,188 @@ +-- nukedatbewmsmall + +return { + ["nukedatbewmsmall"] = { + alwaysvisible = true, + groundflash = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + circlealpha = 0.5, + circlegrowth = 1, + flashalpha = 0.5, + flashsize = 500, + ground = true, + ttl = 300, + water = true, + color = { + [1] = 1, + [2] = 0.69999998807907, + [3] = 0.30000001192093, + }, + }, + poof01 = { + class = [[CSimpleParticleSystem]], + count = 2, + air = true, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0.2 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 90, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 15, + particlelifespread = 90, + particlesize = 16, + particlesizespread = 2, + particlespeed = 25, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof02 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 128, + particlelife = 15, + particlelifespread = 90, + particlesize = 16, + particlesizespread = 1, + particlespeed = 28, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + poof03 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 2, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0 0 0 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 15, + emitrotspread = 300, + emitvector = [[0, -1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 150, + particlelife = 15, + particlelifespread = 90, + particlesize = 16, + particlesizespread = 3, + particlespeed = 32, + particlespeedspread = 6, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[cloudexplo]], + useairlos = false, + }, + }, + poof04 = { + air = true, + ground = true, + water = true, + underwater = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.8 0.6 0 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 20, + particlelife = 15, + particlelifespread = 90, + particlesize = 16, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 10, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + pop1 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 2, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.4, + maxheat = 10, + pos = [[r-10 r10, 0, r-10 r10]], + size = 1, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + pop2 = { + air = true, + ground = true, + water = true, + underwater = true, + alwaysvisible = true, + class = [[heatcloud]], + count = 10, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.6, + maxheat = 15, + pos = [[r-150 r150, 0, r-300 r150]], + size = 1, + sizegrowth = 8, + speed = [[0, 0, 0]], + texture = [[bigexplosmoke]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nuketrail.lua b/Gamedata/explosions/nuketrail.lua new file mode 100644 index 000000000..96361fc85 --- /dev/null +++ b/Gamedata/explosions/nuketrail.lua @@ -0,0 +1,78 @@ +-- nuketrail + +return { + ["nuketrail"] = { + usedefaultexplosions = false, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 200, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.6 0.35 0.2 0.1 0.1 0.1 0.1 0.2 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 4, + particlelife = 140, + particlelifespread = 15, + particlesize = 13, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 10, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 4, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 1, + width = 22, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/nuketrail.tdf b/Gamedata/explosions/nuketrail.tdf deleted file mode 100644 index 2969e40ef..000000000 --- a/Gamedata/explosions/nuketrail.tdf +++ /dev/null @@ -1,98 +0,0 @@ -[NUKETRAIL] -{ - usedefaultexplosions=0; - [spikes] - { - class=explspike; - [properties] - { - dir=-10 r20,-10 r20,-10 r20; - width=22; - length=1; //60; - alpha=1; - alphadecay=0.08; - color=1.0, 0.5, 0.2; - - - } - air=1; - water=1; - ground=1; - count=4; - } -[exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.7 0.5 0.2 0.1 0.15 0.15 0.15 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=5; - particleSizeSpread=1; - - particleLife=200; - numParticles=4; - particleSpeed=2; - particleSize=13; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } - -[exhale2] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0, 0; - - - Texture=smoke; - airdrag=0.87; - colorMap=0.6 0.35 0.2 0.1 0.1 0.1 0.1 0.2 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=10; - particleSizeSpread=1; - - particleLife=140; - numParticles=4; - particleSpeed=2; - particleSize=13; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/particleraise.lua b/Gamedata/explosions/particleraise.lua new file mode 100644 index 000000000..4841ef162 --- /dev/null +++ b/Gamedata/explosions/particleraise.lua @@ -0,0 +1,35 @@ +-- particleraise + +return { + ["particleraise"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + colormap = [[0.1 0.1 0.8 0.04 0.3 0.3 1.0 0.04 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 10, 0]], + numparticles = 20, + particlelife = 10, + particlelifespread = 32, + particlesize = 20, + particlesizespread = 0, + particlespeed = 128, + particlespeedspread = 128, + pos = [[0, -2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/particleraise.tdf b/Gamedata/explosions/particleraise.tdf deleted file mode 100644 index 91c0e14d2..000000000 --- a/Gamedata/explosions/particleraise.tdf +++ /dev/null @@ -1,38 +0,0 @@ -[particleraise] -{ - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=randdots; - - colorMap = 0.1 0.1 0.8 0.04 0.3 0.3 1.0 0.04 0.1 0.1 0.1 0.01; - - pos = 0, -2, 0; - gravity = 0, 10, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 10; - particleLifeSpread = 32; - numParticles = 20; - particleSpeed = 128; - particleSpeedSpread = 128; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/pinkBulletImpact.tdf b/Gamedata/explosions/pinkBulletImpact.tdf deleted file mode 100644 index 512b5af9b..000000000 --- a/Gamedata/explosions/pinkBulletImpact.tdf +++ /dev/null @@ -1,178 +0,0 @@ -[pinkBulletImpact] -{ - [whiteglow] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=laserend; - heat = 10; - maxheat = 15; - heatFalloff = 5; - - size = 1; - sizeGrowth = 20; - - pos = 0, 0, 0; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=3; - - particleSpeed=1; - particleSpeedSpread=3; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=7; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=5; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=10; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=7; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.0 0.55 0.5 0.01 0 0 0 0.01; - - pos = 0, 2, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 2; - particleSpeedSpread = 5; - particleSize = 3; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/pinkbulletimpact.lua b/Gamedata/explosions/pinkbulletimpact.lua new file mode 100644 index 000000000..b68595fad --- /dev/null +++ b/Gamedata/explosions/pinkbulletimpact.lua @@ -0,0 +1,135 @@ +-- pinkbulletimpact + +return { + ["pinkbulletimpact"] = { + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 3, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 3, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 7, + particlesize = 5, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 10, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 7, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.0 0.55 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 3, + particlesizespread = 0, + particlespeed = 2, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 5, + maxheat = 15, + pos = [[0, 0, 0]], + size = 1, + sizegrowth = 20, + speed = [[0, 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/plasmabattery.lua b/Gamedata/explosions/plasmabattery.lua new file mode 100644 index 000000000..e14d83071 --- /dev/null +++ b/Gamedata/explosions/plasmabattery.lua @@ -0,0 +1,73 @@ +-- plasmabatteryweapon + +return { + ["plasmabatteryweapon"] = { + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 0.5, + sizegrowth = 2, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 3, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/plasmabattery.tdf b/Gamedata/explosions/plasmabattery.tdf deleted file mode 100644 index 5b6a3757c..000000000 --- a/Gamedata/explosions/plasmabattery.tdf +++ /dev/null @@ -1,88 +0,0 @@ -[PLASMABATTERYWEAPON] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 0.5; - sizeGrowth = 2; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 1; - sizeGrowth = 3; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 4; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } -} diff --git a/Gamedata/explosions/powerplant_explosion.lua b/Gamedata/explosions/powerplant_explosion.lua new file mode 100644 index 000000000..fe7ec72b9 --- /dev/null +++ b/Gamedata/explosions/powerplant_explosion.lua @@ -0,0 +1,361 @@ +-- powerplant_explosion +-- powerplant_explosion_big +-- powerplant_explosion_medium + +return { + ["powerplant_explosion"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 7, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 220, + ground = true, + ttl = 50, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["powerplant_explosion_big"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 45, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 9, + sizegrowth = 75, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 21, + particlespeedspread = 15, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 400, + ground = true, + ttl = 120, + water = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 30, + sizegrowth = 75, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + + ["powerplant_explosion_medium"] = { + electric1 = { + air = true, + class = [[heatcloud]], + count = 3, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[electnovaexplo]], + }, + }, + electric2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + electricarcs1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.2 0.5 0.9 0.01 0.1 0.5 0.7 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 7, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[lightening]], + useairlos = false, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 220, + ground = true, + ttl = 80, + water = true, + color = { + [1] = 1, + [2] = 0.20000000298023, + [3] = 0, + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 1 r2.3, r-3 r3]], + startsize = 10, + }, + }, + whiteglow = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[0, 5, 0]], + size = 10, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[laserend]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/prettypop.lua b/Gamedata/explosions/prettypop.lua new file mode 100644 index 000000000..3a73edb1e --- /dev/null +++ b/Gamedata/explosions/prettypop.lua @@ -0,0 +1,70 @@ +-- prettypop + +return { + ["prettypop"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.0, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 20, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 0.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/prettypop.tdf b/Gamedata/explosions/prettypop.tdf deleted file mode 100644 index 33917d6aa..000000000 --- a/Gamedata/explosions/prettypop.tdf +++ /dev/null @@ -1,80 +0,0 @@ -[prettypop] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 0.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 16; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 20; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.0; - - color = 1.0, 0.0, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/railgun.lua b/Gamedata/explosions/railgun.lua index 4947993ab..87e26e98d 100644 --- a/Gamedata/explosions/railgun.lua +++ b/Gamedata/explosions/railgun.lua @@ -15,10 +15,10 @@ return { emitvector = [[0, 0, 0]], gravity = [[0, 0, 0]], numparticles = 1, - particlelife = 60, - particlelifespread = 20, - particlesize = [[2]], - particlesizespread = 10, + particlelife = 10, + particlelifespread = 5, + particlesize = [[1]], + particlesizespread = 5, particlespeed = 1, particlespeedspread = 6, pos = [[0, 0, 0]], @@ -26,7 +26,6 @@ return { sizemod = 1.0, texture = [[Lightring]], useairlos = false, - colorchange = "stuffs", }, }, }, diff --git a/Gamedata/explosions/rocketlaunch.lua b/Gamedata/explosions/rocketlaunch.lua new file mode 100644 index 000000000..d17e8e494 --- /dev/null +++ b/Gamedata/explosions/rocketlaunch.lua @@ -0,0 +1,79 @@ +-- rocketlaunch + +return { + ["rocketlaunch"] = { + groundflash = { + air = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 1, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 17, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 10, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.05, + sizemod = 1.01, + texture = [[dirt]], + useairlos = false, + }, + }, + poofflash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.6, + colormap = [[0.9 0.4 0.4 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.0]], + directional = true, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 1, + pos = [[0, 0, 0]], + sizegrowth = 1.3, + sizemod = 0.8, + texture = [[shot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/rocketlaunch.tdf b/Gamedata/explosions/rocketlaunch.tdf deleted file mode 100644 index 6649d5409..000000000 --- a/Gamedata/explosions/rocketlaunch.tdf +++ /dev/null @@ -1,130 +0,0 @@ -[rocketlaunch] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 20; - - sizeGrowth = 0.05; - sizeMod = 1.01; - - airdrag = 1; - particleLife = 17; - particleLifeSpread = 0; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 5; - particleSizeSpread = 10; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - /*[POOFCORE] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 2; - - sizeGrowth = 1.3; - sizeMod = 0.8; - - airdrag = 1; - particleLife = 7; - particleLifeSpread = 0; - numParticles = 16; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - }*/ - - [POOFflash] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 0.9 0.4 0.4 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 1; - - sizeGrowth = 1.3; - sizeMod = 0.8; - - airdrag = 0.6; - particleLife = 15; - particleLifeSpread = 5; - numParticles = 1; - particleSpeed = 0; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [groundflash] - { - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/rocketlaunchback.lua b/Gamedata/explosions/rocketlaunchback.lua new file mode 100644 index 000000000..e06cb3a40 --- /dev/null +++ b/Gamedata/explosions/rocketlaunchback.lua @@ -0,0 +1,36 @@ +-- rocketexhaust + +return { + ["rocketexhaust"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = -180, + emitrotspread = 50, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 30, + particlelifespread = 8, + particlesize = 15, + particlesizespread = 5, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.3, + sizemod = 1.0, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/rocketlaunchback.tdf b/Gamedata/explosions/rocketlaunchback.tdf deleted file mode 100644 index 3e3cdb7ad..000000000 --- a/Gamedata/explosions/rocketlaunchback.tdf +++ /dev/null @@ -1,40 +0,0 @@ -[rocketexhaust] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = -180; - emitRotSpread = 50; - - sizeGrowth = 0.3; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 30; - particleLifeSpread = 8; - numParticles = 16; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 15; - particleSizeSpread = 5; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - -} diff --git a/Gamedata/explosions/rocketlaunchsmall.lua b/Gamedata/explosions/rocketlaunchsmall.lua new file mode 100644 index 000000000..b6735c34b --- /dev/null +++ b/Gamedata/explosions/rocketlaunchsmall.lua @@ -0,0 +1,81 @@ +-- rocketlaunchsmall + +return { + ["rocketlaunchsmall"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 17, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 5, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.05, + sizemod = 1.01, + texture = [[dirt]], + useairlos = false, + }, + }, + poofflash = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.6, + alwaysvisible = true, + colormap = [[0.9 0.4 0.4 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.0]], + directional = true, + emitrot = 0, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 15, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 0, + particlespeedspread = 1, + pos = [[0, 0, 0]], + sizegrowth = 1.3, + sizemod = 0.8, + texture = [[shot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/rocketlaunchsmall.tdf b/Gamedata/explosions/rocketlaunchsmall.tdf deleted file mode 100644 index bd051a014..000000000 --- a/Gamedata/explosions/rocketlaunchsmall.tdf +++ /dev/null @@ -1,96 +0,0 @@ -[rocketlaunchsmall] -{ - [POOFDOTS] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - - colorMap = 0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 20; - - sizeGrowth = 0.05; - sizeMod = 1.01; - - airdrag = 0.9; - particleLife = 17; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 0; - particleSpeedSpread = 5; - particleSize = 5; - particleSizeSpread = 5; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - - [POOFflash] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=shot; - - colorMap = 0.9 0.4 0.4 0.01 0.4 0.4 0.4 0.01 0.0 0.0 0.0 0.0; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 0; - emitRotSpread = 1; - - sizeGrowth = 1.3; - sizeMod = 0.8; - - airdrag = 0.6; - particleLife = 15; - particleLifeSpread = 5; - numParticles = 1; - particleSpeed = 0; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - air=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/salvage.lua b/Gamedata/explosions/salvage.lua index 53e092698..53445792b 100644 --- a/Gamedata/explosions/salvage.lua +++ b/Gamedata/explosions/salvage.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/scavengers/generic-scavenger-explosion-purple.lua b/Gamedata/explosions/scavengers/generic-scavenger-explosion-purple.lua new file mode 100644 index 000000000..580393fd4 --- /dev/null +++ b/Gamedata/explosions/scavengers/generic-scavenger-explosion-purple.lua @@ -0,0 +1,960 @@ +-- genericscavengerbuildingexplosion-small-purple +-- genericscavengerbuildingexplosion-large-purple +-- genericscavengerbuildingexplosion-medium-purple +-- genericscavengerbuildingexplosion-huge-purple + +return { + ["genericscavengerbuildingexplosion-small-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:scavenger_lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 0.5, + flashalpha = 0.6, + flashsize = 200, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r0.5, 0.1 r1, r-3 r0.5]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericscavengerbuildingexplosion-large-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:scavenger_lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 2, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 2, + flashalpha = 0.6, + flashsize = 600, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r2, 0.1 r1, r-3 r2]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericscavengerbuildingexplosion-medium-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:scavenger_lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 1, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 1, + flashalpha = 0.6, + flashsize = 400, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r1, 0.1 r1, r-3 r1]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + + ["genericscavengerbuildingexplosion-huge-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 18, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:scavenger_lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[200]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 8, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.6, + flashsize = 800, + ground = true, + ttl = 200, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + + smoke = { + air = true, + count = 8, + ground = true, + water = true, + underwater = true, + properties = { + agespeed = 0.01, + alwaysvisible = true, + color = 0.1, + pos = [[r-60 r60, 24, r-60 r60]], + size = 10, + sizeexpansion = 0.6, + speed = [[r-3 r3, 0.1 r1, r-3 r3]], + startsize = 10, + }, + }, + + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.25 0.25 0.5 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 160, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 14, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 16, + particlelife = 10, + particlelife = 10, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 26, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 40, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + unitpoofs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.11 0 0.29 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.05, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 48, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/scavengers/generic-scavenger-helper-explosions.lua b/Gamedata/explosions/scavengers/generic-scavenger-helper-explosions.lua new file mode 100644 index 000000000..5c71e3a7e --- /dev/null +++ b/Gamedata/explosions/scavengers/generic-scavenger-helper-explosions.lua @@ -0,0 +1,47 @@ +-- scavenger_lightning_stormbolt + +return { + ["scavenger_lightning_stormbolt"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.3, + flashsize = 46, + ttl = 3, + color = { + [1] = 1, + [2] = 1, + [3] = 1, + }, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 1 1 1 0.01 0.5 0 0.5 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 20, + particlespeed = 0.01, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[lightbw]], + }, + }, + }, +} + diff --git a/Gamedata/explosions/scavengers/generic-scavenger-projectile-cegs.lua b/Gamedata/explosions/scavengers/generic-scavenger-projectile-cegs.lua new file mode 100644 index 000000000..48b553551 --- /dev/null +++ b/Gamedata/explosions/scavengers/generic-scavenger-projectile-cegs.lua @@ -0,0 +1,33 @@ +return { + ["scavengercegtag"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = true, + colormap = [[0.5 0.25 0.5 0.05 0.25 0.25 0.25 0.05 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 15, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, +} \ No newline at end of file diff --git a/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-lightning.lua b/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-lightning.lua new file mode 100644 index 000000000..05e49a2e5 --- /dev/null +++ b/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-lightning.lua @@ -0,0 +1,397 @@ +-- genericscavengershellexplosion-medium-lightning +-- genericscavengershellexplosion-small-lightning +-- genericscavengershellexplosion-large-lightning + +return { + ["genericscavengershellexplosion-medium-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 10, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericscavengershellexplosion-small-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 5, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + + ["genericscavengershellexplosion-large-lightning"] = { + blueelectricityspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.03 0.5 0.5 0.9 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 10, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[whitelightb]], + useairlos = false, + }, + }, + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 10, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_stormbolt]], + pos = [[-100 r200, 1, -100 r200]], + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[1 1 1 0.05 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 20, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[brightblueexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-purple.lua b/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-purple.lua new file mode 100644 index 000000000..5ed7fc8f4 --- /dev/null +++ b/Gamedata/explosions/scavengers/generic-scavenger-shell-explosion-purple.lua @@ -0,0 +1,529 @@ +-- genericscavengershellexplosion-medium-purple +-- genericscavengershellexplosion-small-purple +-- genericscavengershellexplosion-large-purple + +return { + ["genericscavengershellexplosion-medium-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 8, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 4, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 6, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 100, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 60, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 5, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 8, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + + ["genericscavengershellexplosion-small-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 2, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 3, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 3, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 30, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 3, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 10, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + + ["genericscavengershellexplosion-large-purple"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 12, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + + -- put this next to groundflash + explosionwave = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.10999999940395 0 0.28999999165535 0.05 0 0 0 0.0]], -- same as groundflash colors + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 0, 0]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = [[20]], -- same as groundflash ttl + particlelifespread = 0, + particlesize = 6, -- groundflash flashsize 25 = 1, so if flashsize is 200, particlesize here would be 8 + particlesizespread = 1, + particlespeed = [[8]], + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 12, -- same as groundflash circlegrowth + sizemod = 1.0, + texture = [[explosionwave]], + }, + }, + + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 12, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 20, + water = true, + underwater = true, + color = { + [1] = 0.50999999940395, + [2] = 0, + [3] = 0.68999999165535, + }, + }, + kickedupdirt = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.25 0.20 0.10 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + kickedupwater = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + alwaysvisible = true, + colormap = [[0.7 0.7 0.9 0.35 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 120, + particlelife = 2, + particlelifespread = 30, + particlesize = 2, + particlesizespread = 1, + particlespeed = 10, + particlespeedspread = 6, + pos = [[0, 1, 0]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[wake]], + }, + }, + orangeexplosionspikes = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.7 0.8 0.9 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 0, + particlespeed = 12, + particlespeedspread = 2, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + underwater = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 20, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 30, + speed = [[0, 1 0, 0]], + texture = [[purplenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/scavengers/scaspawn-greentrail.lua b/Gamedata/explosions/scavengers/scaspawn-greentrail.lua new file mode 100644 index 000000000..89e0dbeb2 --- /dev/null +++ b/Gamedata/explosions/scavengers/scaspawn-greentrail.lua @@ -0,0 +1,207 @@ +-- Spawntrail for Scavenger Droppods + +return { + ["scaspawn-greentrail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0.00 1.00 0.00 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 15.5, + sizegrowth = [[0.2 r0.3]], + ttl = 1, + }, + }, + fireglow = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.00 1.00 0.00 0.01 0 0 0 0.01]], + directional = false, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0.1, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.00 0.80 0.00 0.1 0.00 0.50 0.00 0.05 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 1, + particlelife = 40, + particlelifespread = 15, + particlesize = 15, + particlesizespread = 12, + particlespeed = 0.25, + particlespeedspread = 1.3, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.00 1.00 0.00 0.15 0.00 1.00 0.00 0.1 0.00 1.00 0.00 0.15 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.75, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 4, + particlesizespread = 6, + particlespeed = 0.4, + particlespeedspread = 3, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + trail = { + + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0 0 0 0.01 0.00 0.70 0.00 0.10 0.00 0.60 0.00 0.08 0.00 0.50 0.00 0.05 0.00 0.40 0.00 0.04 0.00 0.15 0.00 0.02 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -20, + sidetexture = [[smoketrail]], + size = 2.0, + sizegrowth = 0.05, + ttl = 40, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.00 1.00 0.00 0.05 0.00 0.90 0.00 0.66 0.00 0.75 0.00 0.56 0.00 0.60 0.00 0.44 0.00 0.45 0.00 0.28 0.00 0.30 0.00 0.13 0.00 0.15 0.00 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, -0.06, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.00 1.00 0.00 0.8 0.00 1.00 0.00 0.9 0.00 1.00 0.00 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 2, + ground = true, + water = true, + properties = { + alpha = 0.6, + alphadecay = 0.08, + color = [[0.00 1.00 0.00]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 2, + width = 9, + }, + }, + }, + +} diff --git a/Gamedata/explosions/scavengers/scaspawn-trail.lua b/Gamedata/explosions/scavengers/scaspawn-trail.lua new file mode 100644 index 000000000..8b93b6890 --- /dev/null +++ b/Gamedata/explosions/scavengers/scaspawn-trail.lua @@ -0,0 +1,207 @@ +-- Spawntrail for Scavenger Droppods + +return { + ["scaspawn-trail"] = { + usedefaultexplosions = false, + engine = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[none]], + length = [[-15 r3.5]], + sidetexture = [[muzzleside]], + size = 15.5, + sizegrowth = [[0.2 r0.3]], + ttl = 1, + }, + }, + fireglow = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.85 0.05 1.0 0.01 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 40, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 20, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.75 0.08 1.0 0.1 0.45 0.04 0.6 0.1 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 15, + particlesize = 19, + particlesizespread = 14, + particlespeed = 0.25, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.1 1.0 0.15 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.15 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.8, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 7, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + trail = { + + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysVisible = true, + colormap = [[0 0 0 0.01 0.035 0.025 0.015 0.10 0.035 0.025 0.015 0.08 0.035 0.025 0.015 0.05 0.035 0.025 0.015 0.04 0.035 0.025 0.015 0.02 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[trans]], + length = -20, + sidetexture = [[smoketrail]], + size = 2.0, + sizegrowth = 0.05, + ttl = 40, + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.006 0.006 0.006 0.05 0.05 0.04 0.033 0.66 0.04 0.038 0.034 0.56 0.04 0.036 0.032 0.44 0.025 0.025 0.025 0.28 0.014 0.014 0.014 0.13 0.006 0.006 0.006 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, -0.02, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.03, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + spikes = { + air = true, + class = [[explspike]], + count = 2, + ground = true, + water = true, + properties = { + alpha = 0.6, + alphadecay = 0.08, + color = [[1.0, 0.5, 0.2]], + dir = [[-10 r20,-10 r20,-10 r20]], + length = 2, + width = 9, + }, + }, + }, + +} \ No newline at end of file diff --git a/Gamedata/explosions/scavengers/scav-effects.lua b/Gamedata/explosions/scavengers/scav-effects.lua new file mode 100644 index 000000000..b53813763 --- /dev/null +++ b/Gamedata/explosions/scavengers/scav-effects.lua @@ -0,0 +1,812 @@ +-- Effects for Scavengers + +return { + ["scavradiation"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.96, + colormap = [[0 0 0 0.0 0.30 0.016 0.6 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.035, 0]], + numparticles = 6, + particlelife = 180, + particlelifespread = 120, + particlesize = 150, + particlesizespread = 450, + particlespeed = 6.5, + particlespeedspread = 4.5, + pos = [[-200 r900, -50 r50, -200 r900]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff]], + alwaysvisible = true, + }, + }, + }, + ["scav_commander_explosion"] = { + centerflare = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 10, + heatfalloff = 1.2, + maxheat = 14, + pos = [[r-2 r2, 10, r-2 r2]], + size = 4.8, + sizegrowth = 14, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + groundflash_small = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.4 0 0 0 0.01]], + size = 200, + sizegrowth = -1.5, + ttl = 26, + texture = [[groundflash]], + }, + }, + groundflash_large = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.175 0 0 0 0.01]], + size = 250, + sizegrowth = -1.5, + ttl = 26, + texture = [[groundflash]], + }, + }, + groundflash_white = { + class = [[CSimpleGroundFlash]], + count = 1, + air = true, + ground = true, + water = false, + underwater = false, + properties = { + colormap = [[0.6 0.15 1 0.77 0 0 0 0.01]], + size = 190, + sizegrowth = 0, + ttl = 7, + texture = [[groundflash]], + }, + }, + pop1 = { + class=[[explo]], + air=1, + water=1, + ground=1, + count=2, + properties ={ + alwaysVisible=1, + texture=[[explo]], + heat = 10, + maxheat = 10, + heatFalloff = 1.1, + size = 18, + sizeGrowth = 20, + pos = [[r-10 r10, 20, r-10 r10]], + speed=[[0, 0, 0]], + }, + }, + explosion = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.87, + colormap = [[0.6 0.15 1 0.11 0.5 0.12 0.9 0.08 0.35 0.05 0.66 0.033 0.27 0.03 0.55 0.011 0 0 0 0]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1.1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 15, + particlelife = 2.3, + particlelifespread = 15, + particlesize = 16.5, + particlesizespread = 16, + particlespeed = 6.8, + particlespeedspread = 5.3, + pos = [[0, 2, 0]], + sizegrowth = 0.4, + sizemod = 1, + texture = [[flashside2]], + useairlos = false, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.88, + colormap = [[1 0.85 0.6 0.22 1 0.63 0.3 0.12 1 0.52 0.2 0.06 0 0 0 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, -0.011, 0]], + numparticles = 5, + particlelife = 11.6, + particlelifespread = 4.5, + particlesize = 6.5, + particlesizespread = 1.6, + particlespeed = 4.75, + particlespeedspread = 0.8, + pos = [[0, 0, 0]], + sizegrowth = 2.2, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + innersmoke = { + class = [[CSimpleParticleSystem]], + water=0, + air=1, + ground=1, + count=1, + properties = { + airdrag=0.80, + alwaysVisible = 0, + sizeGrowth = 0.66, + sizeMod = 1, + pos = [[r-1 r2, 0, r-1 r2]], + emitRot=33, + emitRotSpread=50, + emitVector = [[0, 1, 0]], + gravity = [[0, 0.02, 0]], + colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture=[[graysmoke]], + particleLife=35, + particleLifeSpread=80, + numparticles=7, + particleSpeed=7, + particleSpeedSpread=9, + particleSize=14, + particleSizeSpread=23, + directional=0, + }, + }, + outersmoke = { + class = [[CSimpleParticleSystem]], + water=0, + air=1, + ground=1, + count=1, + properties = { + airdrag=0.7, + alwaysVisible = 0, + sizeGrowth = 0.35, + sizeMod = 1, + pos = [[r-1 r2, 0, r-1 r2]], + emitRot=33, + emitRotSpread=50, + emitVector = [[0, 1, 0]], + gravity = [[0, -0.02, 0]], + colormap=[[1 0.66 0.4 0.45 0.3 0.2 0.13 0.4 0.18 0.15 0.11 0.35 0.13 0.12 0.1 0.32 0.11 0.1 0.093 0.25 0.063 0.062 0.058 0.17 0 0 0 0.01]], + Texture=[[graysmoke]], + particleLife=25, + particleLifeSpread=60, + numparticles=4, + particleSpeed=5, + particleSpeedSpread=8, + particleSize=31, + particleSizeSpread=23, + directional=0, + }, + }, + sparks = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.85, + colormap = [[0.6 0.15 1 0.017 0.4 0.05 0.8 0.011 0 0 0 0]], + directional = true, + emitrot = 30, + emitrotspread = 40, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 7, + particlelife = 14, + particlelifespread = 18, + particlesize = 44, + particlesizespread = 38, + particlespeed = 19.5, + particlespeedspread = 11.4, + pos = [[0, 4, 0]], + sizegrowth = 1, + sizemod = 0.78, + texture = [[gunshotxl]], + useairlos = false, + }, + }, + shockwave = { + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + air = true, + properties = { + alpha = 0.6, + ttl = 11, + expansionSpeed = 12, + color = [[0.6, 0.15, 1]], + --alwaysvisible = true, + }, + }, + dirt = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + unit = false, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 15, + emitrotspread = 36, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 9, + particlelife = 32, + particlelifespread = 7, + particlesize = 1.95, + particlesizespread = -1.4, + particlespeed = 3.3, + particlespeedspread = 3, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + dirt2 = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = false, + unit = false, + nounit = true, + water = false, + air = false, + underwater = false, + properties = { + airdrag = 1, + colormap = [[0.04 0.03 0.01 0 0.1 0.07 0.033 0.66 0.1 0.07 0.033 0.58 0.1 0.07 0.033 0.5 0.1 0.07 0.033 0.4 0 0 0 0 ]], + directional = true, + emitrot = 1, + emitrotspread = 13, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.33, 0]], + numparticles = 5, + particlelife = 35, + particlelifespread = 8, + particlesize = 1.9, + particlesizespread = -1.4, + particlespeed = 3.6, + particlespeedspread = 3.4, + pos = [[0, 6, 0]], + sizegrowth = -0.01, + sizemod = 1, + texture = [[bigexplosmoke]], + useairlos = false, + }, + }, + shard1 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2.0, + particlesizespread = 2.3, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard1]], + useairlos = false, + }, + }, + shard2 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r2]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard2]], + useairlos = false, + }, + }, + shard3 = { + class = [[CSimpleParticleSystem]], + count = 1, + unit = true, + nounit = false, + underwater = false, + properties = { + airdrag = 0.93, + colormap = [[1 0.55 0.45 1 0.55 0.44 0.38 1 0.36 0.34 0.33 1 0 0 0 0.01]], + directional = true, + emitrot = 35, + emitrotspread = 30, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.3, 0]], + numparticles = [[1 r1.5]], + particlelife = 36, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2.35, + particlespeed = 2.5, + particlespeedspread = 4, + pos = [[0, 2, 0]], + sizegrowth = 0, + sizemod = 1, + texture = [[shard3]], + useairlos = false, + }, + }, + clouddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.025 0.02 0.02 0.033 0.06 0.055 0.055 0.072 0.043 0.04 0.04 0.055 0.0238 0.022 0.022 0.03 0 0 0 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 4, + emitvector = [[0.5, 1, 0.5]], + gravity = [[0, 0.025, 0]], + numparticles = 2, + particlelife = 75, + particlelifespread = 120, + particlesize = 66, + particlesizespread = 44, + particlespeed = 1.2, + particlespeedspread = 2.5, + pos = [[0, 4, 0]], + sizegrowth = 0.18, + sizemod = 1.0, + texture = [[bigexplosmoke]], + }, + }, + outerflash = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + heat = 14, + heatfalloff = 1.1, + maxheat = 40, + pos = [[r-2 r2, 4, r-2 r2]], + size = 17, + sizegrowth = 1.1, + speed = [[0, 1 0, 0]], + texture = [[orangenovaexplo]], + }, + }, + }, + ["scavradiation-beacon"] = { + usedefaultexplosions = false, + grounddust = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + unit = false, + properties = { + airdrag = 0.95, + colormap = [[0 0 0 0.0 0.40 0.020 0.8 0.18 0.14 0.007 0.37 0.09 0 0 0 0.0]], + directional = false, + emitrot = 90, + emitrotspread = 60, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.035, 0]], + numparticles = 3, + particlelife = 140, + particlelifespread = 100, + particlesize = 50, + particlesizespread = 125, + particlespeed = 4.5, + particlespeedspread = 3.5, + pos = [[0 r150, 100 r50, 0 r150]], + sizegrowth = 0.3, + sizemod = 1, + texture = [[smoke_puff]], + useairlos = true, + --alwaysvisible = true, + }, + }, + }, + ["scavradiation-lightning"] = { + usedefaultexplosions = false, + electricstorm = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + delay = [[10 r200]], + explosiongenerator = [[custom:lightning_storm_scav]], + pos = [[-50 r100, 20, -50 r100]], + }, + }, + electricstormxl = { + air = true, + class = [[CExpGenSpawner]], + count = 1, + ground = true, + water = false, + underwater = false, + properties = { + delay = [[50 r120]], + explosiongenerator = [[custom:lightning_stormflares_scav]], + pos = [[-50 r250, 50 r25, -50 r250]], + }, + }, + }, + ["lightning_storm_scav"] = { + groundflash = { + circlealpha = 1, + circlegrowth = 0, + flashalpha = 0.17, + flashsize = 40, + ttl = 3, + color = { + [1] = 0.66, + [2] = 0.66, + [3] = 1, + }, + alwaysvisible = true, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.05 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 5, + particlesize = 96, + particlesizespread = 100, + particlespeed = 0.06, + particlespeedspread = 0, + pos = [[-10 r10, 1.0, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + alwaysvisible = true, + }, + }, + }, + ["lightning_stormflares_scav"] = { + groundflash = { + circlealpha = 0.9, + circlegrowth = -0.05, + flashalpha = 0.80, + flashsize = 300, + ttl = 80, + color = { + [1] = 0.4, + [2] = 0.1, + [3] = 0.8, + }, + alwaysvisible = true, + }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 0.92, + colormap = [[0 0 0 0.01 0.3 0.05 0.6 0.025 0.45 0.1 0.8 0.01 0.3 0.05 0.6 0.005 0 0 0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0.4, 0]], + numparticles = 2, + particlelife = 33, + particlelifespread = 45, + particlesize = 16, + particlesizespread = 200, + particlespeed = 0.12, + particlespeedspread = 0.32, + pos = [[-10 r25, 1.0, -10 r25]], + sizegrowth = -0.4, + sizemod = 1.0, + texture = [[flare1]], + alwaysvisible = true, + }, + }, + }, + ["scav-damage"] = { + usedefaultexplosions = false, + -- engine = { + -- air = true, + -- class = [[CBitmapMuzzleFlame]], + -- count = 1, + -- ground = true, + -- underwater = 1, + -- water = true, + -- properties = { + -- alwaysVisible = true, + -- colormap = [[1 0.7 0.4 0.01 1.0 0.6 0.2 0.01 1.0 0.4 0.1 0.01 0 0 0 0.01]], + -- dir = [[dir]], + -- frontoffset = 0, + -- fronttexture = [[none]], + -- length = [[-15 r3.5]], + -- sidetexture = [[muzzleside]], + -- size = 15.5, + -- sizegrowth = [[0.2 r0.3]], + -- ttl = 1, + -- }, + -- }, + lightningballs = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + underwater = true, + properties = { + airdrag = 1, + colormap = [[0 0 0 0.01 0.66 0.66 1 0.10 0.66 0.66 1 0.01 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 120, + emitvector = [[1, 1, 1]], + gravity = [[0, 0, 0]], + numparticles = 1, + particlelife = 3, + particlelifespread = 5, + particlesize = 13, + particlesizespread = 40, + particlespeed = 0.04, + particlespeedspread = 0, + pos = [[-10 r10, -25, -10 r10]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[whitelightb]], + }, + }, + fireglow = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 1, + colormap = [[0.9 0.15 1.0 0.5 0 0 0 0.01]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0.0, 0.0, 0.0]], + gravity = [[0.0, 0, 0.0]], + numparticles = 1, + particlelife = 2, + particlelifespread = 1, + particlesize = 20, + particlesizespread = 12, + particlespeed = 0, + particlespeedspread = 0, + pos = [[0.0, 0, 0.0]], + sizegrowth = -0.5, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + exhale = { + + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.15 1.0 0.3 0.6 0.06 0.8 0.2 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.2, 0]], + numparticles = 2, + particlelife = 40, + particlelifespread = 15, + particlesize = 11, + particlesizespread = 14, + particlespeed = 0.25, + particlespeedspread = 1.2, + pos = [[0, 1, 0]], + sizegrowth = -0.2, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + exhale2 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + alwaysVisible = true, + airdrag = 0.87, + colormap = [[0.8 0.1 1.0 0.25 0.55 0.06 0.7 0.1 0.028 0.005 0.04 0.25 0.0 0.0 0.0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.5, 0]], + numparticles = 2, + particlelife = 30, + particlelifespread = 15, + particlesize = 6, + particlesizespread = 6, + particlespeed = 0.25, + particlespeedspread = 1.9, + pos = [[0, 1, 0]], + sizegrowth = -0.07, + sizemod = 1.0, + texture = [[smoke-chickens]], + }, + }, + smoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.92, + colormap = [[0.012 0.012 0.012 0.05 0.10 0.08 0.066 0.66 0.08 0.076 0.086 0.56 0.08 0.076 0.084 0.44 0.05 0.05 0.05 0.28 0.028 0.028 0.028 0.13 0.012 0.012 0.012 0.05 0 0 0 0.01]], + directional = true, + emitrot = -180, + emitrotspread = 7, + emitvector = [[dir]], + gravity = [[0.0, 0.02, 0.0]], + numparticles = [[1.5 r1]], + particlelife = 15, + particlelifespread = 40, + particlesize = 4.6, + particlesizespread = 6.2, + particlespeed = 1.5, + particlespeedspread = 2.5, + pos = [[-15 r30, -15 r30, -15 r30]], + sizegrowth = 0.32, + sizemod = 1, + texture = [[smoke]], + useairlos = true, + }, + }, + dustparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = true, + water = true, + properties = { + airdrag = 0.77, + colormap = [[0.85 0.66 0.4 0.8 1 0.74 0.48 0.9 0.75 0.45 0.25 0.5 0 0 0 0.01]], + directional = true, + emitrot = 80, + emitrotspread = 15, + emitvector = [[dir]], + gravity = [[0, -0.011, 0]], + numparticles = 1, + particlelife = 9, + particlelifespread = 6, + particlesize = 4, + particlesizespread = 0.8, + particlespeed = 0.05, + particlespeedspread = 0.6, + pos = [[0, 0, 0]], + sizegrowth = 0.06, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + +} \ No newline at end of file diff --git a/Gamedata/explosions/shells.lua b/Gamedata/explosions/shells.lua new file mode 100644 index 000000000..2b5dda7fe --- /dev/null +++ b/Gamedata/explosions/shells.lua @@ -0,0 +1,35 @@ +-- shells + +return { + ["shells"] = { + shells = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 10, + emitvector = [[dir]], + gravity = [[0, -0.5, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[shell]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/shells.tdf b/Gamedata/explosions/shells.tdf deleted file mode 100644 index 96d552857..000000000 --- a/Gamedata/explosions/shells.tdf +++ /dev/null @@ -1,32 +0,0 @@ -[shells] -{ - [shells] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, -0.5, 0; - colorMap=1 1 1 1 1 1 1 1; - Texture=shell; - airdrag=0.97; - particleLife=30; - particleLifeSpread=0; - numParticles=1; - particleSpeed=4; - particleSpeedSpread=0; - particleSize=4; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=10; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/shotgun.lua b/Gamedata/explosions/shotgun.lua new file mode 100644 index 000000000..8297d2c18 --- /dev/null +++ b/Gamedata/explosions/shotgun.lua @@ -0,0 +1,35 @@ +-- shotgunspray + +return { + ["shotgunspray"] = { + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[1.0 0.7 0.0 0.0 1.0 0.7 0.0 0.01]], + directional = true, + emitrot = 3, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 1, + particlesizespread = 0, + particlespeed = 20, + particlespeedspread = 10, + pos = [[0, 0, 0]], + sizegrowth = 1, + sizemod = 1, + texture = [[gunshot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/shotgun.tdf b/Gamedata/explosions/shotgun.tdf deleted file mode 100644 index 2fa659a78..000000000 --- a/Gamedata/explosions/shotgun.tdf +++ /dev/null @@ -1,39 +0,0 @@ -[shotgunspray] -{ - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=gunshot; - - colorMap = 1.0 0.7 0.0 0.0 1.0 0.7 0.0 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 3; - emitRotSpread = 1; - - sizeGrowth = 1; - sizeMod = 1; - - airdrag = 1; - - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 20; - particleSpeedSpread = 10; - particleSize = 1; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/shotgunImpact.tdf b/Gamedata/explosions/shotgunImpact.tdf deleted file mode 100644 index 747aee2ee..000000000 --- a/Gamedata/explosions/shotgunImpact.tdf +++ /dev/null @@ -1,79 +0,0 @@ -[shotgunImpact] -{ - - [pillar] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 15; - maxheat = 15; - heatFalloff = 2.5; - - size = 35; - sizeGrowth = -1; - - pos = 0,1, 0; - speed=0, 0, 0; - } - air=1; - count=3; - } - - [smoke] - { - [properties] - { - alwaysVisible=1; - color = 0.3; - ageSpeed=0.15; - - size = 45; - sizeGrowth = 0; - - pos = 0,-1 i4,0; - speed=0, 5, 0; - } - air=1; - ground=1; - count=2; - } - - [dirt01] - { - class=dirt; - - [properties] - { - alwaysVisible=1; - size=10; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed=r1.5 r-1.5, 4.7, r1.5 r-1.5; - pos=r-5 r5, 0, r-5 r5; - } - ground=1; - count=3; - } - - [dirt02] - { - class=dirt; - - [properties] - { - alwaysVisible=1; - size=33; - color=0.8, 0.8, 1.0; - alphaFalloff=2; - speed=r1.5 r-1.5, 4.7, r1.5 r-1.5; - pos=r-5 r5, 0, r-5 r5; - } - water=1; - count=4; - } - -} \ No newline at end of file diff --git a/Gamedata/explosions/shotgunimpact.lua b/Gamedata/explosions/shotgunimpact.lua new file mode 100644 index 000000000..c2fac2ca0 --- /dev/null +++ b/Gamedata/explosions/shotgunimpact.lua @@ -0,0 +1,64 @@ +-- shotgunimpact + +return { + ["shotgunimpact"] = { + dirt01 = { + class = [[dirt]], + count = 3, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 10, + speed = [[r1.5 r-1.5, 4.7, r1.5 r-1.5]], + }, + }, + dirt02 = { + class = [[dirt]], + count = 4, + water = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.8, 0.8, 1.0]], + pos = [[r-5 r5, 0, r-5 r5]], + size = 33, + speed = [[r1.5 r-1.5, 4.7, r1.5 r-1.5]], + }, + }, + pillar = { + air = true, + class = [[heatcloud]], + count = 3, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 2.5, + maxheat = 15, + pos = [[0,1, 0]], + size = 35, + sizegrowth = -1, + speed = [[0, 0, 0]], + texture = [[flare]], + }, + }, + smoke = { + air = true, + count = 2, + ground = true, + properties = { + agespeed = 0.15, + alwaysvisible = true, + color = 0.3, + pos = [[0,-1 i4,0]], + size = 45, + sizegrowth = 0, + speed = [[0, 5, 0]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/silvershells.lua b/Gamedata/explosions/silvershells.lua new file mode 100644 index 000000000..720141429 --- /dev/null +++ b/Gamedata/explosions/silvershells.lua @@ -0,0 +1,35 @@ +-- silvershells + +return { + ["silvershells"] = { + shells = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.97, + colormap = [[1 1 1 1 1 1 1 1]], + directional = true, + emitrot = 0, + emitrotspread = 10, + emitvector = [[dir]], + gravity = [[0, -0.5, 0]], + numparticles = 1, + particlelife = 30, + particlelifespread = 0, + particlesize = 4, + particlesizespread = 0, + particlespeed = 4, + particlespeedspread = 0, + pos = [[0, 0, 0]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[silvershell]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/silvershells.tdf b/Gamedata/explosions/silvershells.tdf deleted file mode 100644 index e793ac63c..000000000 --- a/Gamedata/explosions/silvershells.tdf +++ /dev/null @@ -1,32 +0,0 @@ -[silvershells] -{ - [shells] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0; - sizeMod=1.0; - pos=0, 0, 0; - emitVector=dir; - gravity=0, -0.5, 0; - colorMap=1 1 1 1 1 1 1 1; - Texture=silvershell; - airdrag=0.97; - particleLife=30; - particleLifeSpread=0; - numParticles=1; - particleSpeed=4; - particleSpeedSpread=0; - particleSize=4; - particleSizeSpread=0; - emitRot=0; - emitRotSpread=10; - directional=1; - } - air=1; - water=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/skyhatelaser.lua b/Gamedata/explosions/skyhatelaser.lua new file mode 100644 index 000000000..8664a829b --- /dev/null +++ b/Gamedata/explosions/skyhatelaser.lua @@ -0,0 +1,36 @@ +-- skyhatelaser + +return { + ["skyhatelaser"] = { + dirtg = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + --alwaysvisible = true, + colormap = [[0.75 0 0 0.1 0.75 0 0 0.1 0.75 0 0 0.1 0.75 0 0 0.1 0.5 0.5 0.5 0.1 0 0 0 0.0]], + directional = true, + emitrot = 0, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 1, 0]], + numparticles = 1, + particlelife = 60, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 10, + particlespeed = 5, + particlespeedspread = 0, + pos = [[r-0.5 r0.5, 1 r2, r-0.5 r0.5]], + sizegrowth = 1.5, + sizemod = 1.0, + texture = [[laser]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/skyhatelaser.tdf b/Gamedata/explosions/skyhatelaser.tdf deleted file mode 100644 index 5be077b6b..000000000 --- a/Gamedata/explosions/skyhatelaser.tdf +++ /dev/null @@ -1,41 +0,0 @@ -[skyhatelaser] -{ - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=laser; - sizeGrowth=1.5; - sizeMod=1.0; - - pos = r-0.5 r0.5, 1 r2, r-0.5 r0.5; - emitVector = 0, 1, 0; - gravity = 0, 1, 0; - - colorMap = 0.75 0 0 0.1 0.75 0 0 0.1 0.75 0 0 0.1 0.75 0 0 0.1 0.5 0.5 0.5 0.1 0 0 0 0.0; - airdrag = 0.8; - - particleLife=60; - particleLifeSpread=0; - - numParticles=1; - - particleSpeed=5; - particleSpeedSpread=0; - particleSize=5; - particleSizeSpread=10; - - emitRot=0; - emitRotSpread=0; - - directional=1; - useAirLos=0; - } - ground=1; - air=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/smallunitdead.lua b/Gamedata/explosions/smallunitdead.lua new file mode 100644 index 000000000..9871922a5 --- /dev/null +++ b/Gamedata/explosions/smallunitdead.lua @@ -0,0 +1,129 @@ +-- smallunitdead + +return { + ["smallunitdead"] = { + dirt = { + count = 4, + ground = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + explosionsphere = { + air = true, + class = [[CSpherePartSpawner]], + count = 1, + ground = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[1, 0.3, 0]], + expansionspeed = [[10 r3]], + ttl = 11, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.5, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/smallunitdead.tdf b/Gamedata/explosions/smallunitdead.tdf deleted file mode 100644 index 38aa69cc0..000000000 --- a/Gamedata/explosions/smallunitdead.tdf +++ /dev/null @@ -1,155 +0,0 @@ -[smallunitdead] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.5, 0.1; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=11; - alpha=0.4; - expansionSpeed=10 r3; - color=1, 0.3, 0; - } - ground=1; - air=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - ground=1; - count=4; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/snipercooloff.lua b/Gamedata/explosions/snipercooloff.lua new file mode 100644 index 000000000..15354c459 --- /dev/null +++ b/Gamedata/explosions/snipercooloff.lua @@ -0,0 +1,116 @@ +-- snipercooloff + +return { + ["snipercooloff"] = { + greytowhitepuff = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1, + colormap = [[0.2 0.2 0.2 0.6 0.5 0.5 0.5 0.5 0 0 0 0.01]], + directional = true, + emitrot = 1, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0, .0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 3, + pos = [[0.0, 1, 0.0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + heatparticles = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.5, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 10, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + whiteparticles = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.5, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -1, 0]], + numparticles = 1, + particlelife = 5, + particlelifespread = 10, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 0, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + whitepuff = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 1, + colormap = [[1 1 1 0.5 0 0 0 0.01]], + directional = true, + emitrot = 1, + emitrotspread = 5, + emitvector = [[dir]], + gravity = [[0.0, 0, .0]], + numparticles = 1, + particlelife = 8, + particlelifespread = 0, + particlesize = 2, + particlesizespread = 2, + particlespeed = 0, + particlespeedspread = 3, + pos = [[0.0, 1, 0.0]], + sizegrowth = 1, + sizemod = 1, + texture = [[dirt]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/snipercooloff.tdf b/Gamedata/explosions/snipercooloff.tdf deleted file mode 100644 index d6a596851..000000000 --- a/Gamedata/explosions/snipercooloff.tdf +++ /dev/null @@ -1,154 +0,0 @@ -[snipercooloff] -{ - [whitepuff] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=1; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = dir; - gravity = 0.0, 0, .0; - - colorMap = 1 1 1 0.5 0 0 0 0.01; - airdrag = 1; - - particleLife=8; - particleLifeSpread=0; - - numParticles=1; - - particleSpeed=0; - particleSpeedSpread=3; - particleSize=2; - particleSizeSpread=2; - - emitRot=1; - emitRotSpread=5; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [whiteparticles] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=0; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -1, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.5; - - particleLife=5; - particleLifeSpread=10; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=1; - particleSizeSpread=1; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [greytowhitepuff] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=dirt; - sizeGrowth=1; - sizeMod=1; - - pos = 0.0, 1, 0.0; - emitVector = dir; - gravity = 0.0, 0, .0; - - colorMap = 0.2 0.2 0.2 0.6 0.5 0.5 0.5 0.5 0 0 0 0.01; - airdrag = 1; - - particleLife=8; - particleLifeSpread=0; - - numParticles=1; - - particleSpeed=0; - particleSpeedSpread=3; - particleSize=2; - particleSizeSpread=2; - - emitRot=1; - emitRotSpread=5; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - count=1; - } - - [heatparticles] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=0; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -1, 0; - - colorMap = 1 1 1 0.01 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.5; - - particleLife=5; - particleLifeSpread=10; - - numParticles=1; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=1; - particleSizeSpread=1; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - air=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/sparkleblue.lua b/Gamedata/explosions/sparkleblue.lua index 2af27fdff..4d28208ae 100644 --- a/Gamedata/explosions/sparkleblue.lua +++ b/Gamedata/explosions/sparkleblue.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/sparklegreen.lua b/Gamedata/explosions/sparklegreen.lua index 29bd149dd..f5615e66b 100644 --- a/Gamedata/explosions/sparklegreen.lua +++ b/Gamedata/explosions/sparklegreen.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/sparklegreenplus10energy.lua b/Gamedata/explosions/sparklegreenplus10energy.lua index d06131dde..d68bc3b86 100644 --- a/Gamedata/explosions/sparklegreenplus10energy.lua +++ b/Gamedata/explosions/sparklegreenplus10energy.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/sparklegreenplus5.lua b/Gamedata/explosions/sparklegreenplus5.lua index ab0e1e8b9..e68e0c153 100644 --- a/Gamedata/explosions/sparklegreenplus5.lua +++ b/Gamedata/explosions/sparklegreenplus5.lua @@ -20,7 +20,7 @@ return { }, groundflash = { air = true, - alwaysvisible = true, + alwaysvisible = false, circlealpha = 0.0, circlegrowth = 8, flashalpha = 0.9, @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, @@ -90,6 +90,7 @@ return { class = [[CSimpleParticleSystem]], properties = { + alwaysvisible = false, sizeGrowth = 0, sizeMod = 1, pos = [[0, 20, 0]], diff --git a/Gamedata/explosions/sparkleorange.lua b/Gamedata/explosions/sparkleorange.lua index fc3a7206a..604c5b3f9 100644 --- a/Gamedata/explosions/sparkleorange.lua +++ b/Gamedata/explosions/sparkleorange.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/sparkleorangeplus1drone.lua b/Gamedata/explosions/sparkleorangeplus1drone.lua index 854746761..a9101464f 100644 --- a/Gamedata/explosions/sparkleorangeplus1drone.lua +++ b/Gamedata/explosions/sparkleorangeplus1drone.lua @@ -20,7 +20,7 @@ return { }, groundflash = { air = true, - alwaysvisible = true, + alwaysvisible = false, circlealpha = 0.0, circlegrowth = 8, flashalpha = 0.9, @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, @@ -90,6 +90,7 @@ return { class = [[CSimpleParticleSystem]], properties = { + alwaysvisible = false, sizeGrowth = 0, sizeMod = 1, pos = [[0, 20, 0]], diff --git a/Gamedata/explosions/sparklered.lua b/Gamedata/explosions/sparklered.lua index 5048cb573..23d290ddb 100644 --- a/Gamedata/explosions/sparklered.lua +++ b/Gamedata/explosions/sparklered.lua @@ -58,7 +58,7 @@ return { pos = [[0, 2, 0]], sizegrowth = 0.8, sizemod = 1.0, - texture = [[randdots]], + texture = [[randomdots]], useairlos = false, }, }, diff --git a/Gamedata/explosions/storagelightning.lua b/Gamedata/explosions/storagelightning.lua new file mode 100644 index 000000000..7c423ca65 --- /dev/null +++ b/Gamedata/explosions/storagelightning.lua @@ -0,0 +1,27 @@ +-- storagelightning + +return { + ["storagelightning"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01 0 0 0 0.01]], + dir = [[0, 0, 1]], + frontoffset = 0.05, + fronttexture = [[empty]], + length = 70, + sidetexture = [[shot]], + size = 20, + sizegrowth = 2, + ttl = 2, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/storagelightning.tdf b/Gamedata/explosions/storagelightning.tdf deleted file mode 100644 index 34b787aea..000000000 --- a/Gamedata/explosions/storagelightning.tdf +++ /dev/null @@ -1,25 +0,0 @@ -[storagelightning] -{ - [BitmapMuzzleFlame] - { - class = CBitmapMuzzleFlame; - - [properties] - { - dir = 0, 0, 1; - colorMap= 0.7 0.8 0.9 0.01 0.2 0.5 0.9 0.01 0 0 0 0.01; - size=20; - length=70; - sizeGrowth=2; - ttl=2; - frontOffset=0.05; - sideTexture=shot; - frontTexture=empty; - } - water=1; - air=1; - underwater=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/stormcloud.lua b/Gamedata/explosions/stormcloud.lua new file mode 100644 index 000000000..94c1daf17 --- /dev/null +++ b/Gamedata/explosions/stormcloud.lua @@ -0,0 +1,35 @@ +-- stormcloud + +return { + ["stormcloud"] = { + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 1.0, + colormap = [[0.3 0.3 0.3 0.5 0 0 0 0.3]], + directional = true, + emitrot = 90, + emitrotspread = 25, + emitvector = [[0, 0, 0]], + gravity = [[r-0.05 r0.05, 0 r0.05, r-0.05 r0.05]], + numparticles = 2, + particlelife = 20, + particlelifespread = 40, + particlesize = 10, + particlesizespread = 10, + particlespeed = 3, + particlespeedspread = 10, + pos = [[r-1 r1, r-1 r1, r-1 r1]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[bigexplosmoke]], + useairlos = true, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/stormcloud.tdf b/Gamedata/explosions/stormcloud.tdf deleted file mode 100644 index 67cad32dd..000000000 --- a/Gamedata/explosions/stormcloud.tdf +++ /dev/null @@ -1,33 +0,0 @@ -[stormcloud] -{ - - [POOF01] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.8; - sizeMod=1.0; - pos = r-1 r1, r-1 r1, r-1 r1; - emitVector=0, 0, 0; - gravity=r-0.05 r0.05, 0 r0.05, r-0.05 r0.05; - colorMap= 0.3 0.3 0.3 0.5 0 0 0 0.3; - Texture=bigexplosmoke; - airdrag=1.0; - particleLife=20; - particleLifeSpread=40; - numParticles=2; - particleSpeed=3; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=10; - emitRot=90; - emitRotSpread=25; - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/explosions/torpedoexplosion.lua b/Gamedata/explosions/torpedoexplosion.lua new file mode 100644 index 000000000..0886c1ee7 --- /dev/null +++ b/Gamedata/explosions/torpedoexplosion.lua @@ -0,0 +1,160 @@ +-- torpedoexplosion + +return { + ["torpedoexplosion"] = { + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 2, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.1, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + underwater = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 3, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.1, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + explosionsphere = { + class = [[CSpherePartSpawner]], + count = 1, + underwater = 1, + water = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.5, 0.5, 0.9]], + expansionspeed = [[10 r3]], + ttl = 14, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + underwater = 1, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.1]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 3, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + underwater = 1, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.5 0.8 0.9 0.04 0.0 0.5 0.9 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 5, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + underwater = 1, + water = true, + properties = { + alwaysvisible = true, + heat = 3, + heatfalloff = 1.1, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 5, + speed = [[0, 1 0, 0]], + texture = [[PlasmaHeatDDB]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/torpedoexplosion.tdf b/Gamedata/explosions/torpedoexplosion.tdf deleted file mode 100644 index 60fe1f1f8..000000000 --- a/Gamedata/explosions/torpedoexplosion.tdf +++ /dev/null @@ -1,199 +0,0 @@ -[torpedoexplosion] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=3; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.1; - - } - air=1; - water=1; - underwater=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=14; - alpha=0.4; - expansionSpeed=10 r3; - color=0.5, 0.5, 0.9; - } - water=1; - underwater=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=PlasmaHeatDDB; - heat = 3; - maxheat = 10; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 5; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - underwater=1; - ground=1; - count=2; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1 1 1 0.01 0.5 0.8 0.9 0.04 0.0 0.5 0.9 0.01 0.1 0.1 0.5 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 5; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - underwater=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.1; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=2; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - underwater=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.1; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=3; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - underwater=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - underwater=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/torpedotrail.lua b/Gamedata/explosions/torpedotrail.lua new file mode 100644 index 000000000..3344d2035 --- /dev/null +++ b/Gamedata/explosions/torpedotrail.lua @@ -0,0 +1,173 @@ +-- torpedotrail +-- torpedotrailsmall +-- torpedotrailuwturret + +return { + ["torpedotrail"] = { + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = false, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 4, + particlesize = 2, + particlesizespread = 10, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.8, + texture = [[randomdots]], + useairlos = true, + }, + }, + }, + + ["torpedotrailsmall"] = { + groundflash = { + circlealpha = 0.1, + circlegrowth = 3, + flashalpha = 1, + flashsize = 12, + ttl = 8, + color = { + [1] = 0, + [2] = 0.10000000149012, + [3] = 0.80000001192093, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = false, + colormap = [[0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[gunshot]], + useairlos = false, + }, + }, + smokeandfire = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.70, + alwaysvisible = false, + colormap = [[0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0.0, 1, 0.0]], + gravity = [[0.0, 0.0, 0.0]], + numparticles = 3, + particlelife = 50, + particlelifespread = 4, + particlesize = 1, + particlesizespread = 40, + particlespeed = 0, + particlespeedspread = 2, + pos = [[0.0, 1, 0.0]], + sizegrowth = -0.2, + sizemod = 0.9, + texture = [[randomdots]], + useairlos = true, + }, + }, + }, + + ["torpedotrailuwturret"] = { + coreflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 2, + particlelife = 20, + particlelifespread = 0, + particlesize = 1, + particlesizespread = 1, + particlespeed = 1, + particlespeedspread = 1, + pos = [[0, 1, 0]], + sizegrowth = 0.50, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + exhale = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + airdrag = 0.87, + colormap = [[0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01]], + directional = false, + emitrot = 80, + emitrotspread = 5, + emitvector = [[0, 1, 0]], + gravity = [[0, 0.1, 0]], + numparticles = 4, + particlelife = 30, + particlelifespread = 15, + particlesize = 2, + particlesizespread = 1, + particlespeed = 2, + particlespeedspread = 2, + pos = [[0, 1, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[randomdots]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/torpedotrail.tdf b/Gamedata/explosions/torpedotrail.tdf deleted file mode 100644 index d70d91088..000000000 --- a/Gamedata/explosions/torpedotrail.tdf +++ /dev/null @@ -1,219 +0,0 @@ -[torpedotrail] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=randdots; - sizeGrowth=-0.2; - sizeMod=0.8; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=25; - particleLifeSpread=4; - - numParticles=10; - - particleSpeed=2; - particleSpeedSpread=2; - particleSize=2; - particleSizeSpread=10; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - air=1; - ground=1; - count=1; - } -} - -[torpedotrailsmall] -{ - - [smokeandfire] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=randdots; - sizeGrowth=-0.2; - sizeMod=0.9; - - pos = 0.0, 1, 0.0; - emitVector = 0.0, 1, 0.0; - gravity = 0.0, 0.0, 0.0; - - colorMap = 0.1 0.1 0.1 0.01 0.0 0.3 0.5 0.05 0.1 0.1 0.5 1.0 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.01; - airdrag = 0.70; - - particleLife=50; - particleLifeSpread=4; - - numParticles=3; - - particleSpeed=0; - particleSpeedSpread=2; - particleSize=1; - particleSizeSpread=40; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - ground=1; - count=1; - water=1; - underwater=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=0; - Texture=gunshot; - - colorMap = 0.4 0.5 0.9 0.04 0.1 0.4 0.9 0.01 0.1 0.1 0.5 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 10; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - water=1; - underwater=1; - } - - - [groundflash] - { - flashSize = 12; - flashAlpha = 1; - circleGrowth = 3; - circleAlpha = 0.1; - ttl = 8; - color = 0.0, 0.1, 0.8; - } -} - -[torpedotrailuwturret] -{ - - [coreflame] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=0.50; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=randdots; - airdrag=0.87; - colorMap=0.8 0.8 0.8 0.01 0.8 0.8 0.5 0.05 0.1 0.1 0.5 1.0; - - particleLifeSpread=0; - particleSpeedSpread=1; - particleSizeSpread=1; - - particleLife=20; - numParticles=2; - particleSpeed=1; - particleSize=1; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - - } - air=1; - water=1; - underwater=1; - ground=1; - count=1; - } - - [exhale] - { - class=CSimpleParticleSystem; - [properties] - { - sizeGrowth=1; - sizeMod=1.0; - pos=0, 1, 0; - gravity=0, 0.1, 0; - - - Texture=randdots; - airdrag=0.87; - colorMap=0.2 0.2 0.5 0.1 0.15 0.15 0.15 0.05 0.0 0.0 0.0 0.01; - - particleLifeSpread=15; - particleSpeedSpread=2; - particleSizeSpread=1; - - particleLife=30; - numParticles=4; - particleSpeed=2; - particleSize=2; - - - emitVector=0, 1, 0; - emitRot=80; - emitRotSpread=5; - directional=0; - - } - air=1; - water=1; - underwater=1; - ground=1; - count=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/unit muzzle flash.lua b/Gamedata/explosions/unit muzzle flash.lua new file mode 100644 index 000000000..38e036316 --- /dev/null +++ b/Gamedata/explosions/unit muzzle flash.lua @@ -0,0 +1,724 @@ +-- alienburst +-- urcmplasma +-- gdhcannon +-- gdmarty +-- hellfireflare +-- rocketlaunchback +-- urcmcannon +-- gdsarty +-- gdharty +-- emgcannon +-- urcscannon +-- rocketlaunchsam +-- gdhion +-- gunshipcannon +-- gdscannon +-- urchplasma +-- rocketlaunch +-- rocketlaunchmed +-- gdmcannon +-- gdsflak +-- urcmortor +-- rocketlaunchhev +-- gdminigun +-- gdsion +-- urcsplasma +-- gdmion +-- gdmflak + +return { + ["alienburst"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.0 0.3 0.9 0.01 0.0 0.1 0.9 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[beamrifletip]], + length = 30, + sidetexture = [[pulseshot]], + size = 20, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["urcmplasma"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.2 1 0.2 0.01 0.2 1 0.4 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash3]], + length = 23, + sidetexture = [[shot]], + size = 17, + sizegrowth = -1, + ttl = 10, + }, + }, + }, + + ["gdhcannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.4 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 60, + sidetexture = [[shotgunside]], + size = 18, + sizegrowth = -1, + ttl = 1, + }, + }, + exhaustsmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.8 0.6 0.01 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.2 0 0 0 0.001 0 0 0 0.001]], + directional = false, + emitrot = 0, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0.05 r-0.1, 0.05 r-0.1, 0.05 r-0.1]], + numparticles = 3, + particlelife = 62, + particlelifespread = 0, + particlesize = 6, + particlesizespread = 2, + particlespeed = -5, + particlespeedspread = -2, + pos = [[0, 1, 3]], + sizegrowth = 0.05, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + front_muzzlesmoke = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[1 0.8 0.6 0.01 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.2 0 0 0 0.001 0 0 0 0.001]], + directional = false, + emitrot = 0, + emitrotspread = 10, + emitvector = [[dir]], + gravity = [[0, 0.05, 0]], + numparticles = 4, + particlelife = 70, + particlelifespread = 5, + particlesize = 6, + particlesizespread = 0.6, + particlespeed = 2, + particlespeedspread = 6, + pos = [[0, 1, 3]], + sizegrowth = 0.5, + sizemod = 1.0, + texture = [[smoke]], + }, + }, + }, + + ["gdmarty"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 44, + sidetexture = [[shotgunside]], + size = 22, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["hellfireflare"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.1 0.7 1 0.1 1 0.2 0.01 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 28, + sidetexture = [[shotgunside]], + size = 5, + sizegrowth = -1, + ttl = 1, + }, + }, + }, + + ["rocketlaunchback"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 10, + emitrotspread = 20, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 12, + particlelifespread = 4, + particlesize = 3, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.3, + sizemod = 1.00, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + + ["urcmcannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 35, + sidetexture = [[shotgunside]], + size = 15, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gdsarty"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 40, + sidetexture = [[shotgunside]], + size = 18, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gdharty"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 50, + sidetexture = [[shotgunside]], + size = 25, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["emgcannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 28, + sidetexture = [[shotgunside]], + size = 5, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["urcscannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 28, + sidetexture = [[shotgunside]], + size = 12, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["rocketlaunchsam"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 15, + particlelifespread = 2, + particlesize = 3, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.1, + sizemod = 1.00, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + + ["gdhion"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 50, + sidetexture = [[shotgunside]], + size = 40, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gunshipcannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 28, + sidetexture = [[shotgunside]], + size = 12, + sizegrowth = -1, + ttl = 1, + }, + }, + }, + + ["gdscannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 28, + sidetexture = [[shotgunside]], + size = 12, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["urchplasma"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.2 1 0.2 0.01 0.2 1 0.7 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash3]], + length = 28, + sidetexture = [[shot]], + size = 20, + sizegrowth = -1, + ttl = 10, + }, + }, + }, + + ["rocketlaunch"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 10, + particlelifespread = 2, + particlesize = 2, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.1, + sizemod = 1.00, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + + ["rocketlaunchmed"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 12, + particlelifespread = 3, + particlesize = 3, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.1, + sizemod = 1.00, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + + ["gdmcannon"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.7 0.3 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 34, + sidetexture = [[shotgunside]], + size = 16, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gdsflak"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.4 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash2]], + length = 20, + sidetexture = [[shotgunside]], + size = 10, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["urcmortor"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.5 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 36, + sidetexture = [[shotgunside]], + size = 20, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["rocketlaunchhev"] = { + poofdots = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + colormap = [[0.4 0.4 0.4 0.5 0.4 0.4 0.4 0.3 0.0 0.0 0.0 0.0]], + directional = false, + emitrot = 0, + emitrotspread = 6, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 16, + particlelife = 14, + particlelifespread = 3, + particlesize = 4, + particlesizespread = 3, + particlespeed = 0, + particlespeedspread = 5, + pos = [[0, 0, 0]], + sizegrowth = 0.1, + sizemod = 1.00, + texture = [[dirt]], + useairlos = false, + }, + }, + }, + + ["gdminigun"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.8 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash1]], + length = 20, + sidetexture = [[shot]], + size = 8, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gdsion"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 30, + sidetexture = [[shotgunside]], + size = 20, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["urcsplasma"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.2 1 0.2 0.01 0.2 1 0.3 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash3]], + length = 18, + sidetexture = [[shot]], + size = 13, + sizegrowth = -1, + ttl = 10, + }, + }, + }, + + ["gdmion"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[0.5 0.0 0.75 0.01 0.5 0.0 0.6 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[shotgunflare]], + length = 40, + sidetexture = [[shotgunside]], + size = 30, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + + ["gdmflak"] = { + bitmapmuzzleflame = { + air = true, + class = [[CBitmapMuzzleFlame]], + count = 1, + ground = true, + underwater = 1, + water = true, + properties = { + colormap = [[1 0.4 0.1 0.01 1 0.2 0.1 0.01 0 0 0 0.01]], + dir = [[dir]], + frontoffset = 0, + fronttexture = [[flash2]], + length = 24, + sidetexture = [[shotgunside]], + size = 11, + sizegrowth = -1, + ttl = 15, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/unitrupture.lua b/Gamedata/explosions/unitrupture.lua new file mode 100644 index 000000000..92cc2fde2 --- /dev/null +++ b/Gamedata/explosions/unitrupture.lua @@ -0,0 +1,107 @@ +-- unitrupture + +return { + ["unitrupture"] = { + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 8, + particlesizespread = 8, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 50, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.5, + alwaysvisible = true, + colormap = [[1 1 1 0.01 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 5, + emitrotspread = 1, + emitvector = [[dir]], + gravity = [[0, 0, 0]], + numparticles = 2, + particlelife = 10, + particlelifespread = 5, + particlesize = 10, + particlesizespread = 2, + particlespeed = 15, + particlespeedspread = 1, + pos = [[0, 0, 0]], + sizegrowth = 3, + sizemod = 1, + texture = [[flashside1]], + useairlos = false, + }, + }, + searingflame = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + colormap = [[1 1 1 0.01 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[dir]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 5, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 0.5, + texture = [[shot]], + useairlos = false, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/unitrupture.tdf b/Gamedata/explosions/unitrupture.tdf deleted file mode 100644 index 01fb7f776..000000000 --- a/Gamedata/explosions/unitrupture.tdf +++ /dev/null @@ -1,131 +0,0 @@ -[unitrupture] -{ - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 1 1 1 0.01 0.9 0.8 0.7 0.01 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 0, 0; - gravity = 0, 0, 0; - emitVector = dir; - emitRot = 5; - emitRotSpread = 1; - - sizeGrowth = 3; - sizeMod = 1; - - airdrag = 0.5; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 2; - particleSpeed = 15; - particleSpeedSpread = 1; - particleSize = 10; - particleSizeSpread = 2; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=8; - particleSizeSpread=8; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - [searingflame] - { - class=CSimpleParticleSystem; - - [properties] - { - Texture=shot; - - colorMap = 1 1 1 0.01 0.9 0.5 0.4 0.04 0.9 0.4 0.1 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = dir; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 0.5; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 5; - numParticles = 8; - particleSpeed = 5; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 50; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/vert_explosion.lua b/Gamedata/explosions/vert_explosion.lua new file mode 100644 index 000000000..ffa3094dd --- /dev/null +++ b/Gamedata/explosions/vert_explosion.lua @@ -0,0 +1,105 @@ +-- vert_explosion + +return { + ["vert_explosion"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.9, + circlegrowth = 25, + flashalpha = 0.9, + flashsize = 500, + ground = true, + ttl = 30, + water = true, + color = { + [1] = 1, + [2] = 0.10000000149012, + [3] = 0, + }, + }, + pillar0 = { + air = true, + class = [[heatcloud]], + count = 8, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 15, + heatfalloff = 1.5, + maxheat = 15, + pos = [[0,-100 i18, 0]], + size = 90, + sizegrowth = -11, + speed = [[0, 25, 0]], + texture = [[bigexplo]], + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 8, + particlelife = 15, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 5, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 30, + sizegrowth = 10, + speed = [[0, 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + smoke = { + air = true, + count = 8, + ground = true, + water = true, + properties = { + agespeed = 0.02, + alwaysvisible = true, + color = 0.3, + pos = [[r-60 r60, 15, r-60 r60]], + size = 50, + sizeexpansion = 0.6, + sizegrowth = 15, + speed = [[r-3 r3, 2.5 r1.3, r-3 r3]], + startsize = 10, + }, + }, + }, + +} + diff --git a/Gamedata/explosions/verticalbomb.lua b/Gamedata/explosions/verticalbomb.lua new file mode 100644 index 000000000..006a30e70 --- /dev/null +++ b/Gamedata/explosions/verticalbomb.lua @@ -0,0 +1,225 @@ +-- verticalbomb + +return { + ["verticalbomb"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 1, 0]], + numparticles = 10, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 2, + particlespeedspread = 10, + pos = [[r-1 r1, 3, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 10, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + explosionsphere = { + class = [[CSpherePartSpawner]], + count = 1, + water = true, + properties = { + alpha = 0.4, + alwaysvisible = true, + color = [[0.5, 0.5, 0.9]], + expansionspeed = [[10 r3]], + ttl = 14, + }, + }, + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.5, 0.2]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 10, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 120, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 10, + particlelifespread = 0, + particlesize = 20, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside1]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/verticalbomb.tdf b/Gamedata/explosions/verticalbomb.tdf deleted file mode 100644 index ba1e15689..000000000 --- a/Gamedata/explosions/verticalbomb.tdf +++ /dev/null @@ -1,293 +0,0 @@ -[verticalbomb] -{ - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=10; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.5, 0.2; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [explosionsphere] - { - class=CSpherePartSpawner; - [properties] - { - alwaysVisible=1; - ttl=14; - alpha=0.4; - expansionSpeed=10 r3; - color=0.5, 0.5, 0.9; - } - water=1; - count=1; - } - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside1; - - colorMap = 0.9 0.8 0.7 0.04 0.9 0.5 0.2 0.01 0.5 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 10; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 20; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 3, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 1, 0; - - colorMap = 0.9 0.8 0.7 0.04 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=10; - - particleSpeed=2; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=10; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 120; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/vulcanhit.lua b/Gamedata/explosions/vulcanhit.lua new file mode 100644 index 000000000..8395b768a --- /dev/null +++ b/Gamedata/explosions/vulcanhit.lua @@ -0,0 +1,71 @@ +-- tracerpop + +return { + ["tracerpop"] = { + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.0, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 20, + ground = true, + ttl = 10, + water = true, + color = { + [1] = 1, + [2] = 0.10000000149012, + [3] = 0.60000002384186, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 5, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 3, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 15, + speed = [[0, 0, 0]], + texture = [[bluenovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/vulcanhit.tdf b/Gamedata/explosions/vulcanhit.tdf deleted file mode 100644 index 01bfcd5b3..000000000 --- a/Gamedata/explosions/vulcanhit.tdf +++ /dev/null @@ -1,81 +0,0 @@ -[tracerpop] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=bluenovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 3; - - size = 1; - sizeGrowth = 15; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 5; - particleSpeed = 16; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 10; - flashSize = 20; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.0; - - color = 1.0, 0.1, 0.6; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/warp.lua b/Gamedata/explosions/warp.lua new file mode 100644 index 000000000..f4d3028cf --- /dev/null +++ b/Gamedata/explosions/warp.lua @@ -0,0 +1,100 @@ +-- warp + +return { + ["warp"] = { + usedefaultexplosions = false, + dirt = { + air = true, + count = 4, + ground = true, + water = true, + properties = { + alphafalloff = 2, + alwaysvisible = true, + color = [[0.2, 0.1, 0.05]], + pos = [[r-10 r10, 0, r-10 r10]], + size = 20, + speed = [[r1.5 r-1.5, 2, r1.5 r-1.5]], + }, + }, + groundflash = { + circlealpha = .3, + circlegrowth = 12, + flashalpha = 1, + flashsize = 270, + ttl = 16, + color = { + [1] = 0, + [2] = 0.5, + [3] = 1, + }, + }, + poof00 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.05, 0]], + numparticles = 16, + particlelife = 5, + particlelifespread = 16, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 3, + pos = [[0, 2, 0]], + sizegrowth = 0.5, + sizemod = 1, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 24, + speed = [[0, 1 0, 0]], + texture = [[warp]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/warp.tdf b/Gamedata/explosions/warp.tdf deleted file mode 100644 index 6cc8bb9a7..000000000 --- a/Gamedata/explosions/warp.tdf +++ /dev/null @@ -1,118 +0,0 @@ -[WARP] -{ - - usedefaultexplosions=0; - - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=warp; - heat = 10; - maxheat = 15; - heatFalloff = 1; - - size = 1; - sizeGrowth = 24; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [POOF00] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 0.9 0.5 0.2 0.01 0.8 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.05, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.5; - sizeMod = 1; - - airdrag = 0.8; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 16; - particleSpeed = 10; - particleSpeedSpread = 3; - particleSize = 25; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [dirt] - { - [properties] - { - alwaysVisible=1; - size=20; - color=0.2, 0.1, 0.05; - alphaFalloff=2; - speed= r1.5 r-1.5, 2, r1.5 r-1.5; - pos=r-10 r10, 0, r-10 r10; - } - air=1; - water=1; - ground=1; - count=4; - } - - [groundflash] - { - flashSize = 270; // flash size - flashAlpha = 1; // initial alpha of the flash - circleGrowth = 12; // size increase/frame - circleAlpha = .3; // initial alpha of the ring - ttl = 16; // number of frames - color = 0, 0.5, 1; - } -} diff --git a/Gamedata/explosions/xamelimpact.lua b/Gamedata/explosions/xamelimpact.lua new file mode 100644 index 000000000..6f47374cc --- /dev/null +++ b/Gamedata/explosions/xamelimpact.lua @@ -0,0 +1,197 @@ +-- xamelimpact + +return { + ["xamelimpact"] = { + dirta = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 8, + particlelife = 25, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtg = { + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 20, + particlelife = 25, + particlelifespread = 5, + particlesize = 15, + particlesizespread = 5, + particlespeed = 10, + particlespeedspread = 1, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + dirtw1 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.9, + alwaysvisible = true, + colormap = [[0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.2, 0]], + numparticles = 18, + particlelife = 25, + particlelifespread = 10, + particlesize = 10, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = true, + }, + }, + dirtw2 = { + class = [[CSimpleParticleSystem]], + count = 1, + water = true, + properties = { + airdrag = 0.7, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0]], + directional = true, + emitrot = 90, + emitrotspread = 0, + emitvector = [[0, 1, 0]], + gravity = [[0, 0, 0]], + numparticles = 5, + particlelife = 15, + particlelifespread = 10, + particlesize = 15, + particlesizespread = 5, + particlespeed = 1, + particlespeedspread = 15, + pos = [[r-1 r1, 1, r-1 r1]], + sizegrowth = 1.2, + sizemod = 1.0, + texture = [[dirt]], + useairlos = true, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.6, + circlegrowth = 6, + flashalpha = 0.9, + flashsize = 150, + ground = true, + ttl = 13, + water = true, + color = { + [1] = 1, + [2] = 0.5, + [3] = 0, + }, + }, + poof1 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + water = true, + properties = { + airdrag = 0.8, + alwaysvisible = true, + colormap = [[0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01]], + directional = true, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.01, 0]], + numparticles = 8, + particlelife = 8, + particlelifespread = 0, + particlesize = 25, + particlesizespread = 0, + particlespeed = 10, + particlespeedspread = 5, + pos = [[0, 2, 0]], + sizegrowth = 1, + sizemod = 1.0, + texture = [[flashside2]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 2, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.1, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 20, + speed = [[0, 1 0, 0]], + texture = [[uglynovaexplo]], + }, + }, + pop2 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.3, + maxheat = 15, + pos = [[r-2 r2, 5, r-2 r2]], + size = 3, + sizegrowth = 25, + speed = [[0, 1 0, 0]], + texture = [[flare]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/xamelimpact.tdf b/Gamedata/explosions/xamelimpact.tdf deleted file mode 100644 index 70867b2d6..000000000 --- a/Gamedata/explosions/xamelimpact.tdf +++ /dev/null @@ -1,259 +0,0 @@ -[xamelImpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=uglynovaexplo; - heat = 10; - maxheat = 15; - heatFalloff = 1.1; - - size = 1; - sizeGrowth = 20; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=2; - } - - [pop2] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=flare; - heat = 10; - maxheat = 15; - heatFalloff = 1.3; - - size = 3; - sizeGrowth = 25; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 1 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - - [POOF1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=flashside2; - - colorMap = 0.9 0.8 0.7 0.03 0.9 0.5 0.2 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.01, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 1; - sizeMod = 1.0; - - airdrag = 0.8; - particleLife = 8; - particleLifeSpread = 0; - numParticles = 8; - particleSpeed = 10; - particleSpeedSpread = 5; - particleSize = 25; - particleSizeSpread = 0; - - directional = 1; - useAirLos = 0; - } - air=1; - ground=1; - water=1; - count=1; - } - - [dirtg] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.4 0.3 1.0 0 0 0 0.01; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=5; - - numParticles=20; - - particleSpeed=10; - particleSpeedSpread=1; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - ground=1; - count=1; - } - - - [dirta] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 0.1 0.1 0.1 1.0 0.5 0.5 0.5 1.0 0 0 0 0.0; - airdrag = 0.7; - - particleLife=25; - particleLifeSpread=10; - - numParticles=8; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - air=1; - count=1; - } - - [dirtw1] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, -0.2, 0; - - colorMap = 0.9 0.9 0.9 1.0 0.5 0.5 0.9 0.0; - airdrag = 0.9; - - particleLife=25; - particleLifeSpread=10; - - numParticles=18; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=10; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [dirtw2] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=dirt; - sizeGrowth=1.2; - sizeMod=1.0; - - pos = r-1 r1, 1, r-1 r1; - emitVector = 0, 1, 0; - gravity = 0, 0, 0; - - colorMap = 1.0 1.0 1.0 1.0 0.5 0.5 0.8 0.0; - airdrag = 0.7; - - particleLife=15; - particleLifeSpread=10; - - numParticles=5; - - particleSpeed=1; - particleSpeedSpread=15; - particleSize=15; - particleSizeSpread=5; - - emitRot=90; - emitRotSpread=0; - - directional=1; - useAirLos=1; - } - water=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 13; - flashSize = 150; - flashAlpha = 0.9; - - circleGrowth = 6; - circleAlpha = 0.6; - - color = 1, 0.5, 0; - - air=1; - ground=1; - water=1; - } -} diff --git a/Gamedata/explosions/zapImpact.tdf b/Gamedata/explosions/zapImpact.tdf deleted file mode 100644 index d11c1c68f..000000000 --- a/Gamedata/explosions/zapImpact.tdf +++ /dev/null @@ -1,100 +0,0 @@ -[zapImpact] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 1.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.5; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 8; - particleSpeed = 16; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } - - [groundflash] - { - alwaysVisible=1; - ttl = 17; - flashSize = 20; - flashAlpha = 0.9; - - circleGrowth = 8; - circleAlpha = 0.0; - - color = 1.0, 0.0, 0.5; - - air=1; - ground=1; - water=1; - } -} \ No newline at end of file diff --git a/Gamedata/explosions/zapimpact.lua b/Gamedata/explosions/zapimpact.lua new file mode 100644 index 000000000..d595b19a4 --- /dev/null +++ b/Gamedata/explosions/zapimpact.lua @@ -0,0 +1,86 @@ +-- zapimpact + +return { + ["zapimpact"] = { + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + groundflash = { + air = true, + alwaysvisible = true, + circlealpha = 0.0, + circlegrowth = 8, + flashalpha = 0.9, + flashsize = 20, + ground = true, + ttl = 17, + water = true, + color = { + [1] = 1, + [2] = 0, + [3] = 0.5, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/zapimpactsmall.lua b/Gamedata/explosions/zapimpactsmall.lua new file mode 100644 index 000000000..649bf0a10 --- /dev/null +++ b/Gamedata/explosions/zapimpactsmall.lua @@ -0,0 +1,70 @@ +-- zapimpactsmall + +return { + ["zapimpactsmall"] = { + explosionspikes = { + air = true, + class = [[explspike]], + count = 7, + ground = true, + water = true, + properties = { + alpha = 1, + alphadecay = 0.19, + alwaysvisible = true, + color = [[1, 0.3, 0.5]], + dir = [[-45 r90,-45 r90,-45 r90]], + length = 0.2, + width = 4, + }, + }, + poof01 = { + air = true, + class = [[CSimpleParticleSystem]], + count = 1, + ground = true, + properties = { + airdrag = 0.2, + alwaysvisible = true, + colormap = [[1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01]], + directional = false, + emitrot = 45, + emitrotspread = 32, + emitvector = [[0, 1, 0]], + gravity = [[0, -0.005, 0]], + numparticles = 8, + particlelife = 5, + particlelifespread = 16, + particlesize = 20, + particlesizespread = 0, + particlespeed = 16, + particlespeedspread = 1, + pos = [[0, 2, 0]], + sizegrowth = 0.8, + sizemod = 1.0, + texture = [[randomdots]], + useairlos = false, + }, + }, + pop1 = { + air = true, + class = [[heatcloud]], + count = 1, + ground = true, + water = true, + properties = { + alwaysvisible = true, + heat = 10, + heatfalloff = 1.8, + maxheat = 10, + pos = [[r-2 r2, 5, r-2 r2]], + size = 1, + sizegrowth = 16, + speed = [[0, 0, 0]], + texture = [[pinknovaexplo]], + }, + }, + }, + +} + diff --git a/Gamedata/explosions/zapimpactsmall.tdf b/Gamedata/explosions/zapimpactsmall.tdf deleted file mode 100644 index 1c9459fd0..000000000 --- a/Gamedata/explosions/zapimpactsmall.tdf +++ /dev/null @@ -1,83 +0,0 @@ -[zapImpactsmall] -{ - [pop1] - { - class=heatcloud; - - [properties] - { - alwaysVisible=1; - texture=pinknovaexplo; - heat = 10; - maxheat = 10; - heatFalloff = 1.8; - - size = 1; - sizeGrowth = 16; - - pos = r-2 r2, 5, r-2 r2; - speed=0, 0, 0; - } - air=1; - water=1; - ground=1; - count=1; - } - - [explosionspikes] - { - class=explspike; - [properties] - { - alwaysVisible=1; - dir=-45 r90,-45 r90,-45 r90; - width=4; - length=0.2; - alpha=1; - alphadecay=0.19; - color=1, 0.3, 0.5; - - } - air=1; - water=1; - ground=1; - count=7; - } - - [POOF01] - { - class=CSimpleParticleSystem; - - [properties] - { - alwaysVisible=1; - Texture=randdots; - - colorMap = 1.0 1.0 1.0 0.04 1.0 0.0 0.5 0.01 0.1 0.1 0.1 0.01; - - pos = 0, 2, 0; - gravity = 0, -0.005, 0; - emitVector = 0, 1, 0; - emitRot = 45; - emitRotSpread = 32; - - sizeGrowth = 0.8; - sizeMod = 1.0; - - airdrag = 0.2; - particleLife = 5; - particleLifeSpread = 16; - numParticles = 8; - particleSpeed = 16; - particleSpeedSpread = 1; - particleSize = 20; - particleSizeSpread = 0; - - directional = 0; - useAirLos = 0; - } - air=1; - ground=1; - count=1; - } -} diff --git a/Gamedata/featuredefs_post.lua b/Gamedata/featuredefs_post.lua index 761200113..d2617896d 100644 --- a/Gamedata/featuredefs_post.lua +++ b/Gamedata/featuredefs_post.lua @@ -19,37 +19,61 @@ local function istable(x) return (type(x) == 'table') end local function isnumber(x) return (type(x) == 'number') end local function isstring(x) return (type(x) == 'string') end local spGetModOptions = Spring.GetModOptions - -------------------------------------------------------------------------------- if spGetModOptions then for name, fd in pairs(FeatureDefs) do - if( - ( - tonumber(fd["footprintz"]) <= 2 - or tonumber(fd["footprintx"]) <= 2 + + if fd["footprintz"] == 0 or fd["footprintz"] == nil then + fd["footprintz"] = 1 + end + if fd["footprintx"] == 0 or fd["footprintx"] == nil then + fd["footprintx"] = 1 + end + + if fd["footprintz"] ~= nil and fd["footprintx"] ~= nil then + if tonumber(fd["footprintz"]) <= 8 + or tonumber(fd["footprintx"]) <= 8 or string.lower(fd["category"]) == "vegitation" - or string.lower(fd["category"]) == "vegetation" - ) - and (not fd["name"] or string.lower(fd["name"]) ~= "ammobox") - ) then - fd["blocking"] = false - if (not fd.customparams) then - fd.customparams = {} + or string.lower(fd["category"]) == "vegetation" then + + fd["blocking"] = false + if (not fd.customparams) then + fd.customparams = {} + end + + -- if (not fd.customparams.provide_cover) then + -- fd.customparams.provide_cover = 1 + -- end end - if (not fd.customparams.provide_cover) then - fd.customparams.provide_cover = 1 --- Spring.Echo("Feature["..name.."] is providing cover!") - end end -end - -for name, fd in pairs(FeatureDefs) do - if fd.name ~= "ammobox" then - fd.metal = 0 - fd.energy = 10 + + -- Set Reclaimtime that isn't insane. Default engine reclaimtime is (m+e) * 6 which is arbitrary as all hell. + if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then + fd.metal = 1 + end + if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then + fd.energy = 1 end + + local reclaimvalue = (tonumber(fd["metal"]) + tonumber(fd["energy"])) / 4 + + fd.reclaimtime = reclaimvalue + + -- Reset maximum feature values + -- if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then + -- fd.metal = 100 + -- end + -- if tonumber(fd["metal"]) > 100 then + -- fd.metal = 100 + -- end + -- if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then + -- fd.energy = 100 + -- end + -- if tonumber(fd["energy"]) > 1 then + -- fd.energy = 100 + -- end end diff --git a/Gamedata/icontypes.lua b/Gamedata/icontypes.lua index 5066d0be5..c84db57cc 100644 --- a/Gamedata/icontypes.lua +++ b/Gamedata/icontypes.lua @@ -2,7 +2,7 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- --- file: icontypes.lua +-- file: icontypes.lua -- brief: icontypes definitions -- -------------------------------------------------------------------------------- @@ -11,207 +11,557 @@ local icontypes = { default = { bitmap='icons/default.png', - size=1, - radiusadjust=3, - }, - - raider = { - bitmap='icons/raider.png', - size=1, - radiusadjust=3, - }, - - tankdestroyer = { - bitmap='icons/tankdestroyer.png', - size=1, - radiusadjust=3, - }, + size=1, + radiusadjust=3, + }, + + -- modifications by dmdr start here - assault = { - bitmap='icons/assault.png', - size=1, - radiusadjust=3, - }, + + engineer = { + bitmap='icons/dmdr_engi.png', + size=3, + radiusadjust=0, + }, - aa = { - bitmap='icons/aa.png', - size=1, - radiusadjust=3, - }, + orb = { + bitmap='icons/dmdr_orb.png', + size=3, + radiusadjust=0, + }, + + box = { + bitmap='icons/dmdr_box.png', + size=2, + radiusadjust=0, + }, + + boxsmall = { + bitmap='icons/dmdr_box.png', + size=1, + radiusadjust=0, + }, + + raider = { + bitmap='icons/dmdr_raider.png', + size=1.5, + radiusadjust=0, + }, + + krow = { + bitmap='icons/dmdr_end_krow.png', + size=3, + radiusadjust=0, + }, + + leveller = { + bitmap='icons/dmdr_end_lvlr.png', + size=3, + radiusadjust=0, + }, + + lacerator = { + bitmap='icons/dmdr_end_lacr.png', + size=3, + radiusadjust=0, + }, + + anarchid = { + bitmap='icons/dmdr_end_nrkd2.png', + size=3, + radiusadjust=0, + }, + + shield_lit = { + bitmap='icons/dmdr_shield_mobile.png', + size=2.5, + radiusadjust=0, + }, + + + riot_lit = { + bitmap='icons/dmdr_riot_lit.png', + size=2.2, + radiusadjust=0, + }, + + riot_arm = { + bitmap='icons/dmdr_riot_arm.png', + size=2.2, + radiusadjust=0, + }, + + arty_lit = { + bitmap='icons/dmdr_arty_lit.png', + size=2.2, + radiusadjust=0, + }, + + arty_arm = { + bitmap='icons/dmdr_arty_arm.png', + size=2.2, + radiusadjust=0, + }, + + td_arm_all = { + bitmap='icons/dmdr_td_ab.png', + size=2.2, + radiusadjust=0, + }, + + td_arm_lit = { + bitmap='icons/dmdr_td_al.png', + size=2.2, + radiusadjust=0, + }, + + td_arm_arm = { + bitmap='icons/dmdr_td_aa.png', + size=2.2, + radiusadjust=0, + }, + + td_lit_all = { + bitmap='icons/dmdr_td_lb.png', + size=2.2, + radiusadjust=0, + }, + + td_lit_lit = { + bitmap='icons/dmdr_td_ll.png', + size=2.2, + radiusadjust=0, + }, + + td_lit_arm = { + bitmap='icons/dmdr_td_la.png', + size=2.2, + radiusadjust=0, + }, + + mtd_lit_arm = { + bitmap='icons/dmdr_mtd_la.png', + size=2.2, + radiusadjust=0, + }, + + mtd_lit_all = { + bitmap='icons/dmdr_mtd_lb.png', + size=2.2, + radiusadjust=0, + }, + + mtd_arm_arm = { + bitmap='icons/dmdr_mtd_aa.png', + size=2.2, + radiusadjust=0, + }, + + scout = { + bitmap='icons/dmdr_air_sct.png', + size=1.5, + radiusadjust=0, + }, + + etransport = { + bitmap='icons/dmdr_tport.png', + size=2.5, + radiusadjust=0, + }, + + air_lit = { + bitmap='icons/dmdr_air_lit.png', + size=2.2, + radiusadjust=0, + }, + + air_arm = { + bitmap='icons/dmdr_air_arm.png', + size=2.2, + radiusadjust=0, + }, + + air_bomb = { + bitmap='icons/dmdr_air_bmb.png', + size=2.2, + radiusadjust=0, + }, + + drone = { + bitmap='icons/dmdr_air_all.png', + size=1, + radiusadjust=0, + }, + + turret_lit = { + bitmap='icons/defense.png', + size=2.2, + radiusadjust=0, + }, + + turret_arm = { + bitmap='icons/defense.png', + size=3, + radiusadjust=0, + }, + + turret_arty = { + bitmap='icons/trt_art.png', + size=3, + radiusadjust=0, + }, + + esilo = { + bitmap='icons/dmdr_nuke.png', + size=4, + radiusadjust=0, + }, + + radar = { + bitmap='icons/radar.png', + size=1, + radiusadjust=0, + }, + + radarjam = { + bitmap='icons/radarjam.png', + size=1, + radiusadjust=0, + }, + + storage = { + bitmap='icons/support.png', + size=1, + radiusadjust=3, + }, + + energy = { + bitmap='icons/dmdr_tech.png', + size=3, + radiusadjust=0, + }, + + generator = { + bitmap='icons/dmdr_energy.png', + size=2, + radiusadjust=3, + }, + + baseshield = { + bitmap='icons/dmdr_buckler.png', + size=3.5, + radiusadjust=0, + }, + + nukeshield = { + bitmap='icons/dmdr_shield_nuke.png', + size=3.5, + radiusadjust=0, + }, + + -- and end here + + eco = { + bitmap='icons/eco.png', + size=1, + radiusadjust=3, + }, + + air = { + bitmap='icons/air.png', + size=1, + radiusadjust=3, + }, + factory = { + bitmap='icons/factory.png', + size=1, + radiusadjust=3, + }, + + barricade = { + bitmap='icons/barricade.png', + size=1, + radiusadjust=3, + }, support = { - bitmap='icons/support.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/support.png', + size=1, + radiusadjust=3, + }, commander = { - bitmap='icons/commander.png', - size=3, - radiusadjust=3, - }, + bitmap='icons/commander.png', + size=1, + radiusadjust=3, + }, - engineer = { - bitmap='icons/engineer.png', - size=1, - radiusadjust=3, - }, ORB = { - bitmap='icons/orb.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/orb.png', + size=1, + radiusadjust=3, + }, + --------Zaals--------- + + -- land + zlightswarm = { + bitmap='icons/z/zswarm.png', + size=2.5, + radiusadjust=0 + }, + + zmedswarm = { + bitmap='icons/z/zmedswarm.png', + size=3, + radiusadjust=0 + }, + + zskirmisher = { + bitmap='icons/z/zskirmisher.png', + size=3, + radiusadjust=0 + }, + + zassault = { + bitmap='icons/z/zassault.png', + size=3.5, + radiusadjust=0 + }, + + zpyro = { + bitmap='icons/z/zpyro.png', + size=3, + radiusadjust=0 + }, + + zarty = { + bitmap='icons/z/zarty.png', + size=3.5, + radiusadjust=0 + }, + + zqueen = { + bitmap='icons/z/zqueen.png', + size=8, + radiusadjust=0 + }, + + -- air + zairscout = { + bitmap='icons/z/zairscout.png', + size=2, + radiusadjust=0 + }, + + zairtoairfighter = { + bitmap='icons/z/zairtoairfighter.png', + size=3.5, + radiusadjust=0 + }, + + zairtogroundfighter = { + bitmap='icons/z/zairtogroundfighter.png', + size=3.5, + radiusadjust=0 + }, + + zbomber = { + bitmap='icons/z/zbomber.png', + size=4, + radiusadjust=0 + }, + -- buildings + + + ---------------------- + + chicken = + { + bitmap="icons/chicken.png", + size=1.4, + }, + chickena = + { + bitmap="icons/chickena.png", + size=1.6, + }, + chickenf = { + bitmap="icons/chickenf.png", + size=1.6, + }, + chickens = + { + bitmap="icons/chickens.png", + size=1.5, + }, + chickenr = { + bitmap="icons/chickenr.png", + size=1.6, + }, + chickenq = { + bitmap="icons/chickenq.png", + size=3, + }, + chikenqueen = { + bitmap='icons/dmdr_end_nrkd2.png', + size=8, + }, + chickencommander = { + bitmap='icons/commander.png', + size=3, + }, + + --[[ all this stuff is redundant now, so for legibility I'm commenting it out (dmdr 271216) + + tankdestroyer = { + bitmap='icons/tankdestroyer.png', + size=1, + radiusadjust=3, + }, + + assault = { + bitmap='icons/assault.png', + size=1, + radiusadjust=3, + }, + + aa = { + bitmap='icons/aa.png', + size=1, + radiusadjust=3, + }, + + + etransport = { + bitmap='icons/support.png', + size=2.2, + radiusadjust=3, + }, + esilo = { - bitmap='icons/esilo.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/esilo.png', + size=1, + radiusadjust=3, + }, elrpc = { - bitmap='icons/elrpc.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/elrpc.png', + size=1, + radiusadjust=3, + }, hover = { - bitmap='icons/hover.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/hover.png', + size=1, + radiusadjust=3, + }, hoverraider = { - bitmap='icons/hoverraider.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/hoverraider.png', + size=1, + radiusadjust=3, + }, hovertankdestroyer = { - bitmap='icons/hovertankdestroyer.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/hovertankdestroyer.png', + size=1, + radiusadjust=3, + }, hoverassault = { - bitmap='icons/hoverassault.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/hoverassault.png', + size=1, + radiusadjust=3, + }, hoveraa = { - bitmap='icons/hoveraa.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/hoveraa.png', + size=1, + radiusadjust=3, + }, amphib = { - bitmap='icons/amphib.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/amphib.png', + size=1, + radiusadjust=3, + }, amphibraider = { - bitmap='icons/amphibraider.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/amphibraider.png', + size=1, + radiusadjust=3, + }, amphibtankdestroyer = { - bitmap='icons/amphibtankdestroyer.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/amphibtankdestroyer.png', + size=1, + radiusadjust=3, + }, amphibassault = { - bitmap='icons/amphibassault.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/amphibassault.png', + size=1, + radiusadjust=3, + }, amphibaa = { - bitmap='icons/amphibaa.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/amphibaa.png', + size=1, + radiusadjust=3, + }, allterr = { - bitmap='icons/allterr.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/allterr.png', + size=1, + radiusadjust=3, + }, allterrraider = { - bitmap='icons/raider.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/raider.png', + size=1, + radiusadjust=3, + }, allterrtankdestroyer = { - bitmap='icons/allterrtankdestroyer.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/allterrtankdestroyer.png', + size=1, + radiusadjust=3, + }, allterrassault = { - bitmap='icons/allterrassault.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/allterrassault.png', + size=1, + radiusadjust=3, + }, allterraa = { - bitmap='icons/allterraa.png', - size=1, - radiusadjust=3, - }, + bitmap='icons/allterraa.png', + size=1, + radiusadjust=3, + }, sub = { - bitmap='icons/sub.png', - size=1, - radiusadjust=3, - }, - - defense = { - bitmap='icons/defense.png', - size=1, - radiusadjust=3, - }, - eco = { - bitmap='icons/eco.png', - size=1, - radiusadjust=3, - }, - energy = { - bitmap='icons/ecoenergy.png', - size=2, - radiusadjust=3, - }, - air = { - bitmap='icons/air.png', - size=1, - radiusadjust=3, - }, - factory = { - bitmap='icons/factory.png', - size=1, - radiusadjust=3, - }, - radar = { - bitmap='icons/radar.png', - size=1, - radiusadjust=3, - }, - radarjam = { - bitmap='icons/radarjam.png', - size=1, - radiusadjust=3, - }, - barricade = { - bitmap='icons/barricade.png', - size=1, - radiusadjust=3, - }, - + bitmap='icons/sub.png', + size=1, + radiusadjust=3, + }, + + defense = { + bitmap='icons/defense.png', + size=1, + radiusadjust=3, + }, + + storage = { + bitmap='icons/storage.png', + size=1, + radiusadjust=3, + }, + + ]]-- + } -------------------------------------------------------------------------------- diff --git a/Gamedata/lOCKlUAui.TXT b/Gamedata/lOCKlUAui.TXT index 5ddc588c1..e69de29bb 100644 --- a/Gamedata/lOCKlUAui.TXT +++ b/Gamedata/lOCKlUAui.TXT @@ -1,3 +0,0 @@ -You can override CA's widget handler by creating camain.lua in your LuaUI -directory and changing "cawidgets.lua" to "widgets.lua", or by copying your -widget handler to cawidgets.lua. \ No newline at end of file diff --git a/Gamedata/modrules.lua b/Gamedata/modrules.lua index 9d6087148..9f1da3641 100644 --- a/Gamedata/modrules.lua +++ b/Gamedata/modrules.lua @@ -10,33 +10,34 @@ local modrules = { - -- system = { - -- pathFinderSystem = 1, - -- }, +-- system = { +-- pathFinderSystem = 1, -- QTPFS +-- }, movement = { allowAirPlanesToLeaveMap = true, -- defaults to true + allowAircraftToHitGround = false, allowPushingEnemyUnits = true, -- defaults to false allowCrushingAlliedUnits = false, -- defaults to false allowUnitCollisionDamage = false, -- defaults to false allowUnitCollisionOverlap = true, -- defaults to true -- this lets units clump close together when moving, after which they are pushed apart - allowGroundUnitGravity = false, + allowGroundUnitGravity = false, }, construction = { constructionDecay = true, -- defaults to true - constructionDecayTime = 0.01, -- defaults to 6.66 - constructionDecaySpeed = 0.01, -- defaults to 0.03 + constructionDecayTime = 10, -- defaults to 6.66 + constructionDecaySpeed = 1, -- defaults to 0.03 }, reclaim = { - multiReclaim = 1, -- defaults to 0 + multiReclaim = 0, -- defaults to 0 reclaimMethod = 0, -- defaults to 1 unitMethod = 0, -- defaults to 1 unitEnergyCostFactor = 0, -- defaults to 0 - unitEfficiency = 0, -- defaults to 1 + unitEfficiency = 1, -- defaults to 1 featureEnergyCostFactor = 0, -- defaults to 0 allowEnemies = false, -- defaults to true @@ -60,13 +61,12 @@ local modrules = { sensors = { - requireSonarUnderWater = true, -- defaults to true + requireSonarUnderWater = false, -- defaults to true los = { - losMipLevel = 3, -- defaults to 1 - losMul = 1, -- defaults to 1 - airMipLevel = 4, -- defaults to 2 - airMul = 1, -- defaults to 1 + losMipLevel = 1, -- defaults to 1 + airMipLevel = 1, -- defaults to 2 + radarMipLevel = 2, }, }, diff --git a/Gamedata/morph_defs.lua b/Gamedata/morph_defs.lua new file mode 100644 index 000000000..a888e8c9f --- /dev/null +++ b/Gamedata/morph_defs.lua @@ -0,0 +1,1050 @@ +--[[ Morph Definition File + +Morph parameters description +local morphDefs = { --beginig of morphDefs + unitname = { --unit being morphed + into = 'newunitname', --unit in that will morphing unit morph into + time = 12, --time required to complete morph process (in seconds) + --require = 'requnitname', --unit requnitname must be present in team for morphing to be enabled + energy = 10, --required metal for morphing process note: if you ommit M and/or E costs, morph costs the + energy = 10, --required energy for morphing process difference in costs between unitname and newunitname + xp = 0.07, --required experience for morphing process (will be deduced from unit xp after morph, default=0) + rank = 1, --required unit rank for morphing to be enabled, if ommited, morph doesn't require rank + tech = 2, --required tech level of a team for morphing to be enabled (1,2,3), if ommited, morph doesn't require tech + cmdname = 'Ascend', --if ommited will default to "Upgrade" + texture = 'MyIcon.dds', --if ommited will default to [newunitname] buildpic, textures should be in "LuaRules/Images/Morph" + text = 'Description', --if ommited will default to "Upgrade into a [newunitname]", else it's "Description" + --you may use "$$unitname" and "$$into" in 'text', both will be replaced with human readable unit names + }, +} --end of morphDefs +--]] +-------------------------------------------------------------------------------- + + +local devolution = (-1 > 0) + +local energyCost_ecommander = 100 +local timeToBuild_ecommander = energyCost_ecommander * 0.10 + +local energyCost_ecommanderhealer = 100 +local timeToBuild_ecommanderhealer = energyCost_ecommanderhealer * 0.10 + +local energyCost_ecommandercloak = 100 +local timeToBuild_ecommandercloak = energyCost_ecommandercloak * 0.10 + +local energyCost_ecommandershield = 100 +local timeToBuild_ecommandershield = energyCost_ecommandershield * 0.10 + +local energyCost_ecommanderbuild = 100 +local timeToBuild_ecommanderbuild = energyCost_ecommanderbuild * 0.10 + +local energyCost_ecommanderfactory = 100 +local timeToBuild_ecommanderfactory = energyCost_ecommanderfactory * 0.10 + +local energyCost_ecommanderbattle = 3000 +local timeToBuild_ecommanderbattle = energyCost_ecommanderbattle * 0.10 + +local energyCost_ecommandermeteor = 6000 +local timeToBuild_ecommandermeteor = energyCost_ecommandermeteor * 0.10 + +local energyCost_eradar2_up1 = 450 +local timeToBuild_eradar2_up1 = energyCost_eradar2_up1 * 0.10 + +local energyCost_factory_up1 = 600 +local timeToBuild_factory_up1 = energyCost_factory_up1 * 0.10 + +local energyCost_etech2 = 600 +local timeToBuild_etech2 = energyCost_etech2 * 0.10 + +local energyCost_etech3 = 2000 +local timeToBuild_etech3 = energyCost_etech3 * 0.10 + +local energyCost_zarmtech1 = 300 +local timeToBuild_zarmtech1 = energyCost_zarmtech1 * 0.10 + +local energyCost_zarmtech2 = 600 +local timeToBuild_zarmtech2 = energyCost_zarmtech2 * 0.10 + +local energyCost_zarmtech3 = 2000 +local timeToBuild_zarmtech3 = energyCost_zarmtech3 * 0.10 + +local energyCost_zespire4 = 200 +local timeToBuild_zespire4 = energyCost_zespire4 * 0.10 + +local energyCost_zespire5 = 200 +local timeToBuild_zespire5 = energyCost_zespire5 * 0.10 + +local energyCost_elightturret2 = 75 +local timeToBuild_elightturret2 = energyCost_elightturret2 * 0.10 + +local energyCost_eheavyturret2 = 125 +local timeToBuild_eheavyturret2 = energyCost_eheavyturret2 * 0.10 + +local energyCost_euwturret = 50 +local timeToBuild_euwturret = energyCost_euwturret * 0.10 + +local energyCost_eflakturret = 60 * 10 +local timeToBuild_eflakturret = energyCost_eflakturret / 10 + +-- energycost = time * rate +-- time = energycost / rate + +--Loz Commander Upgrades + +local energyCost_lozcommander_up1 = 60 * 10 +local timeToBuild_lozcommander_up1 = energyCost_lozcommander_up1 / 10 + +local energyCost_lozcommander_up2 = 180 * 25 +local timeToBuild_lozcommander_up2 = energyCost_lozcommander_up2 / 25 + +local energyCost_lozcommander_up3 = 300 * 50 +local timeToBuild_lozcommander_up3 = energyCost_lozcommander_up3 / 50 + +local energyCost_lozcommander_up4 = 480 * 100 +local timeToBuild_lozcommander_up4 = energyCost_lozcommander_up4 / 100 + +-- + +local energyCost_emetalextractor_up1 = 60 * 2 +local timeToBuild_emetalextractor_up1 = energyCost_emetalextractor_up1 / 2 + +local energyCost_emetalextractor_up2 = 300 * 25 +local timeToBuild_emetalextractor_up2 = energyCost_emetalextractor_up2 / 25 + +local energyCost_emetalextractor_up3 = 480 * 50 +local timeToBuild_emetalextractor_up3 = energyCost_emetalextractor_up3 / 50 + +local energyCost_zmex_up1 = 1200 +local timeToBuild_zmex_up1 = energyCost_zmex_up1 * 0.10 + +local energyCost_xmetalextractor = 1200 +local timeToBuild_xmetalextractor = energyCost_xmetalextractor * 0.10 + +local energyCost_eorb = 150 +local timeToBuild_eorb = energyCost_eorb * 0.10 + +local energyCost_eartyturret = 400 +local timeToBuild_eartyturret = energyCost_eartyturret * 0.10 + +local energyCost_ehbotturret = 0 +local timeToBuild_ehbotturret = 2 + +local energyCost_ehbot = 0 +local timeToBuild_ehbot = 10 + +local energyCost_eartytanksauration = 150 +local timeToBuild_eartytanksauration = energyCost_eartytanksauration * 0.10 + +local energyCost_kargannethturret = 0 +local timeToBuild_kargannethturret = 2 + +local energyCost_karganneth = 0 +local timeToBuild_karganneth = 10 + +local morphDefs = { + +--lozcommander + + lozcommander = { + { + into = 'lozcommander_up1', + time = timeToBuild_lozcommander_up1, + cmdname = [[Tech 1]], + energy = energyCost_lozcommander_up1, + metal = 0, + text = 'Evolve Tech 1 with upgraded weapons and armor', + }, + }, + + lozcommander_up1 = { + { + into = 'lozcommander_up2', + time = timeToBuild_lozcommander_up2, + cmdname = [[Tech 2]], + energy = energyCost_lozcommander_up2, + metal = 0, + text = 'Evolve Tech 2 with upgraded weapons and armor', + require = [[tech1]], + }, + }, + + lozcommander_up2 = { + { + into = 'lozcommander_up3', + time = timeToBuild_lozcommander_up3, + cmdname = [[Tech 3]], + energy = energyCost_lozcommander_up3, + metal = 0, + text = 'Evolve Tech 3 with upgraded weapons and armor', + require = [[tech2]], + }, + }, + + lozcommander_up3 = { + { + into = 'lozcommander_up4', + time = timeToBuild_lozcommander_up4, + cmdname = [[Tech 3 + BattleMech]], + energy = energyCost_lozcommander_up4, + metal = 0, + text = 'Evolve into a BattleMech with Devestating weapons and armor', + require = [[tech3]], + }, + }, + +-- + + + + + + ecommander = { + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer +Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + require = [[tech2]], + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + require = [[tech2]], + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + require = [[tech2]], + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower and larger build radius.', + require = [[tech2]], + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- require = [[tech2]], + -- }, + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded machinegun that does heavy damage to Light Units. No longer grants supply.', + require = [[tech2]], + }, + }, + + ecommandercloak = { + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer + Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower and larger build radius.', + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- }, + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded Beam Laser that does heavy damage to Light and Armored units. No longer grants supply.', + }, + }, + + ecommandershield = { + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer +Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower and larger build radius.', + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- }, + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded Beam Laser that does heavy damage to Light and Armored units. No longer grants supply.', + }, + }, + + ecommanderbuild = { + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer + Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- }, + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded Beam Laser that does heavy damage to Light and Armored units. No longer grants supply.', + }, + }, + + ecommanderfactory = { + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer + Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower and larger build radius.', + }, + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded Beam Laser that does heavy damage to Light and Armored units. No longer grants supply.', + }, + }, + ecommanderbattle = { + { + into = 'ecommandermeteor', + time = timeToBuild_ecommandermeteor, + cmdname = [[Meteor +Overseer]], + energy = energyCost_ecommandermeteor, + metal = 0, + text = 'Evolve into Meteor Overseer: Overseer can call down devastating meteor showers. !THIS CHANGE IS PERMANENT!', + require = [[tech3]], + }, + { + into = 'ecommanderhealer', + time = timeToBuild_ecommanderhealer, + cmdname = [[Healer +Overseer]], + energy = energyCost_ecommanderhealer, + metal = 0, + text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.', + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower.', + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- }, + }, + + ecommanderhealer = { + { + into = 'ecommanderbattle', + time = timeToBuild_ecommanderbattle, + cmdname = [[Battle +Overseer]], + energy = energyCost_ecommanderbattle, + metal = 0, + text = 'Evolve into Battle Overseer: Upgraded Beam Laser that does heavy damage to Light and Armored units. No longer grants supply.', + require = [[tech2]], + }, + { + into = 'ecommandercloak', + time = timeToBuild_ecommandercloak, + cmdname = [[Cloaking +Overseer]], + energy = energyCost_ecommandercloak, + metal = 0, + text = 'Evolve into Cloaking Overseer: Gains a large cloaking field which also cloaks the Overseer.', + }, + { + into = 'ecommandershield', + time = timeToBuild_ecommandershield, + cmdname = [[Shield +Overseer]], + energy = energyCost_ecommandershield, + metal = 0, + text = 'Evolve into Shielded Overseer: Gains a large shield which recharges quickly.', + }, + { + into = 'ecommanderbuild', + time = timeToBuild_ecommanderbuild, + cmdname = [[Builder +Overseer]], + energy = energyCost_ecommanderbuild, + metal = 0, + text = 'Evolve into Builder Overseer: Gains 16x buildpower.', + }, + -- { + -- into = 'ecommanderfactory', + -- time = timeToBuild_ecommanderfactory, + -- cmdname = [[Factory +-- Overseer]], + -- energy = energyCost_ecommanderfactory, + -- metal = 0, + -- text = 'Evolve into Factory Overseer: Gains the ability to build all raider, riot, and MBTs anywhere, gains 8x buildpower.', + -- }, + }, + + +---------------------------------------------------------- +---------------------------------------------------------- +--Radar + eradar2 = { + { + into = 'eradar2_up1', + --require = 'etech2', + time = timeToBuild_eradar2_up1, + cmdname = [[Evolve to Tech2]], + energy = energyCost_eradar2_up1, + metal = 0, + text = [[Increases Radar/Sensing Range]], + require = [[tech2]], + }, + }, + +---------------------------------------------------------- +---------------------------------------------------------- +--Economy + emetalextractor = { + { + into = 'emetalextractor_up1', + --require = 'etech2', + time = timeToBuild_emetalextractor_up1, + cmdname = [[Evolve 2x Income]], + energy = energyCost_emetalextractor_up1, + metal = 0, + text = [[x2 Metal Extraction rate]], + require = [[tech1]], + }, + }, + emetalextractor_up1 = { + { + into = 'emetalextractor_up2', + --require = 'etech2', + time = timeToBuild_emetalextractor_up2, + cmdname = [[Evolve 4x Income]], + energy = energyCost_emetalextractor_up2, + metal = 0, + text = [[x4 Metal Extraction rate]], + require = [[tech2]], + }, + }, + emetalextractor_up2 = { + { + into = 'emetalextractor_up3', + --require = 'etech2', + time = timeToBuild_emetalextractor_up3, + cmdname = [[Evolve 8x Income]], + energy = energyCost_emetalextractor_up3, + metal = 0, + text = [[x8 Metal Extraction rate]], + require = [[tech3]], + }, + }, + zmex = { + { + into = 'zmex_up3', + --require = 'etech2', + time = timeToBuild_zmex_up1, + cmdname = [[Evolve 2x Income]], + energy = energyCost_zmex_up1, + metal = 0, + text = [[x2 Metal Extraction rate]], + require = [[tech2]], + }, + }, +---------------------------------------------------------- +---------------------------------------------------------- +--Factories + +---------------------------------------------------------- +---------------------------------------------------------- + + elaserbattery = { + { + into = 'eflakturret', + time = timeToBuild_eflakturret, + cmdname = [[Evolve Flak Turret]], + energy = energyCost_eflakturret, + metal = 0, + text = [[Evolve Projectile Based Flak with more Range and AOE Damage]], + require = [[tech2]], + }, + }, + + -- elightturret2 = { + -- { + -- into = 'elightturret2_up1', + -- time = timeToBuild_elightturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_elightturret2, + -- metal = 0, + -- text = [[+20% damage/hp buff, +15% faster reload]], + -- require = [[tech1]], + -- }, + -- }, + -- elightturret2_up1 = { + -- { + -- into = 'elightturret2_up2', + -- time = timeToBuild_elightturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_elightturret2, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech2]], + -- }, + -- }, + -- elightturret2_up2 = { + -- { + -- into = 'elightturret2_up3', + -- time = timeToBuild_elightturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_elightturret2, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech3]], + -- }, + -- }, + + -- eheavyturret2 = { + -- { + -- into = 'eheavyturret2_up1', + -- time = timeToBuild_eheavyturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_eheavyturret2, + -- metal = 0, + -- text = [[+20% damage/hp buff, +15% faster reload]], + -- require = [[tech1]], + -- }, + -- }, + -- eheavyturret2_up1 = { + -- { + -- into = 'eheavyturret2_up2', + -- time = timeToBuild_eheavyturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_eheavyturret2, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech2]], + -- }, + -- }, + -- eheavyturret2_up2 = { + -- { + -- into = 'eheavyturret2_up3', + -- time = timeToBuild_eheavyturret2, + -- cmdname = [[Evolve]], + -- energy = energyCost_eheavyturret2, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech3]], + -- }, + -- }, + + -- euwturret = { + -- { + -- into = 'euwturret_up1', + -- time = timeToBuild_euwturret, + -- cmdname = [[Evolve]], + -- energy = energyCost_euwturret, + -- metal = 0, + -- text = [[+20% damage/hp buff, +15% faster reload]], + -- require = [[tech1]], + -- }, + -- }, + -- euwturret_up1 = { + -- { + -- into = 'euwturret_up2', + -- time = timeToBuild_euwturret, + -- cmdname = [[Evolve]], + -- energy = energyCost_euwturret, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech2]], + -- }, + -- }, + -- euwturret_up2 = { + -- { + -- into = 'euwturret_up3', + -- time = timeToBuild_euwturret, + -- cmdname = [[Evolve]], + -- energy = energyCost_euwturret, + -- metal = 0, + -- text = [[+15% damage/hp buff, +15% faster reload]], + -- require = [[tech3]], + -- }, + -- }, + +---------------------------------------------------------- +---------------------------------------------------------- + + ehbotengineer = { + { + into = 'ehbotengineer_turret', + time = timeToBuild_ehbotturret, + cmdname = [[Deploy]], + energy = energyCost_ehbotturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, + ehbotpeewee = { + { + into = 'ehbotpeewee_turret', + time = timeToBuild_ehbotturret, + cmdname = [[Deploy]], + energy = energyCost_ehbotturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, + ehbotthud = { + { + into = 'ehbotthud_turret', + time = timeToBuild_ehbotturret, + cmdname = [[Deploy]], + energy = energyCost_ehbotturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, + ehbotsniper = { + { + into = 'ehbotsniper_turret', + time = timeToBuild_ehbotturret, + cmdname = [[Deploy]], + energy = energyCost_ehbotturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, + ehbotrocko = { + { + into = 'ehbotrocko_turret', + time = timeToBuild_ehbotturret, + cmdname = [[Deploy]], + energy = energyCost_ehbotturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, + ehbotkarganneth = { + { + into = 'ehbotkarganneth_turret', + time = timeToBuild_kargannethturret, + cmdname = [[Deploy]], + energy = energyCost_kargannethturret, + metal = 0, + text = 'Evolve into a stationary turret that gains 25% range.', + }, + }, +-- And back again + ehbotengineer_turret = { + { + into = 'ehbotengineer', + time = timeToBuild_ehbot, + cmdname = [[Retract]], + energy = energyCost_ehbot, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + ehbotpeewee_turret = { + { + into = 'ehbotpeewee', + time = timeToBuild_ehbot, + cmdname = [[Retract]], + energy = energyCost_ehbot, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + ehbotthud_turret = { + { + into = 'ehbotthud', + time = timeToBuild_ehbot, + cmdname = [[Retract]], + energy = energyCost_ehbot, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + ehbotsniper_turret = { + { + into = 'ehbotsniper', + time = timeToBuild_ehbot, + cmdname = [[Retract]], + energy = energyCost_ehbot, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + ehbotrocko_turret = { + { + into = 'ehbotrocko', + time = timeToBuild_ehbot, + cmdname = [[Retract]], + energy = energyCost_ehbot, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + ehbotkarganneth_turret = { + { + into = 'ehbotkarganneth', + time = timeToBuild_karganneth, + cmdname = [[Retract]], + energy = energyCost_karganneth, + metal = 0, + text = 'Retract to mobile state.', + }, + }, + +---------------------------------------------------------- +---------------------------------------------------------- + + etech1 = { + { + into = 'etech2', + time = timeToBuild_etech2, + cmdname = [[Tech 2 +Evolution]], + energy = energyCost_etech2, + metal = 0, + text = 'Evolve into a Tech Level 2 Facility.', + }, + }, + etech2 = { + { + into = 'etech3', + time = timeToBuild_etech3, + cmdname = [[Tech 3 +Evolution]], + energy = energyCost_etech3, + metal = 0, + text = 'Evolve into a Tech Level 3 Facility.', + }, + }, + +---------------------------------------------------------- +---------------------------------------------------------- + + zarm = { + { + into = 'zarm_up1', + time = timeToBuild_zarmtech1, + cmdname = [[Evolve Tech 1]], + energy = energyCost_zarmtech1, + metal = 0, + text = 'Evolve Tech 1', + }, + }, + zarm_up1 = { + { + into = 'zarm_up2', + time = timeToBuild_zarmtech2, + cmdname = [[Evolve Tech 2]], + energy = energyCost_zarmtech2, + metal = 0, + text = 'Evolve Tech 2', + }, + }, + zarm_up2 = { + { + into = 'zarm_up3', + time = timeToBuild_zarmtech3, + cmdname = [[Evolve Tech 3]], + energy = energyCost_zarmtech3, + metal = 0, + text = 'Evolve Tech 3', + }, + }, +---------------------------------------------------------- +---------------------------------------------------------- + + zespire1 = { + { + into = 'zespire4', + time = timeToBuild_zespire4, + cmdname = [[Evolve]], + energy = energyCost_zespire4, + metal = 0, + require = [[tech2]], + text = 'Evolve into a Budding Energy Spire.', + }, + }, + zespire4 = { + { + into = 'zespire5', + time = timeToBuild_zespire5, + cmdname = [[Evolve]], + energy = energyCost_zespire5, + metal = 0, + require = [[tech3]], + text = 'Evolve into a Mature Energy Spire.', + }, + }, + +---------------------------------------------------------- +---------------------------------------------------------- + +---------------------------------------------------------- +---------------------------------------------------------- + + eartytank = { + { + into = 'eartytank_saturation', + --require = 'etech1', + time = timeToBuild_eartytanksauration, + cmdname = [[Evolve]], + energy = energyCost_eartytanksauration, + metal = 0, + text = [[HellFury Long-Range Saturation Artillery]], + require = [[tech2]], + }, + }, + +---------------------------------------------------------- +--Shotguns +---------------------------------------------------------- + + eriottank2 = { + { + into = 'eriottank2_shotgun', + --require = 'etech1', + time = 2, + cmdname = [[Evolve + Shotgun]], + energy = 0, + metal = 0, + text = [[Shotgun]], + require = [[tech1]], + }, + }, + + eallterrriot = { + { + into = 'eallterrriot_shotgun', + --require = 'etech1', + time = 2, + cmdname = [[Evolve + Shotgun]], + energy = 0, + metal = 0, + text = [[Shotgun]], + require = [[tech1]], + }, + }, + + eamphibriot = { + { + into = 'eamphibriot_shotgun', + --require = 'etech1', + time = 2, + cmdname = [[Evolve + Shotgun]], + energy = 0, + metal = 0, + text = [[Shotgun]], + require = [[tech1]], + }, + }, +} + +-- +-- Here's an example of why active configuration +-- scripts are better then static TDF files... +-- + +-- +-- devolution, babe (useful for testing) +-- +if (devolution) then + local devoDefs = {} + for src,data in pairs(morphDefs) do + devoDefs[data.into] = { into = src, time = 10, energy = 1, energy = 1 } + end + for src,data in pairs(devoDefs) do + morphDefs[src] = data + end +end + + +return morphDefs + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/Gamedata/movedefs.lua b/Gamedata/movedefs.lua index e99b72b82..9adc855cd 100644 --- a/Gamedata/movedefs.lua +++ b/Gamedata/movedefs.lua @@ -27,7 +27,7 @@ for _,mdef in pairs (moveDefine) do for tagName,tagVal in pairs (tagList) do tagName = string.lower(tagName) if( mdef[tagName] == nil and tagVal ~= 0 ) then - Spring.Echo("Warning! moveDef: " .. mdef["name"] .. ", assigning default value for missing tag " .. tagName .. "(" .. tagVal .. ")") + --Spring.Echo("Warning! moveDef: " .. mdef["name"] .. ", assigning default value for missing tag " .. tagName .. "(" .. tagVal .. ")") mdef[tagName] = tagVal end end diff --git a/Gamedata/movedefs_classes.lua b/Gamedata/movedefs_classes.lua index 0b707db50..6d483ccab 100644 --- a/Gamedata/movedefs_classes.lua +++ b/Gamedata/movedefs_classes.lua @@ -1,402 +1,671 @@ +if Spring.GetModOptions and Spring.GetModOptions().unitheat ~= nil then + unitHeat = Spring.GetModOptions().unitheat * 0.0042 +else + unitHeat = 0.0042 +end + +flowMappingToggle = true + +local genericDepthmodParams = { + minHeight = 0, + maxHeight = 25, + maxScale = 2, + quadraticCoeff = 0, + linearCoeff = 0, -- deprecates "depthMod" + constantCoeff = 2, +} + +local amphibDepthmodParams = { + minHeight = 0, + maxHeight = 25, + maxScale = 2, + quadraticCoeff = 0, + linearCoeff = 0, -- deprecates "depthMod" + constantCoeff = 2, +} + local moveDefs = { - TANK1 = { - footprintx=1, - footprintz=1, - maxslope=28, - maxwaterdepth=5000, - maxwaterslope=255, - badwaterslope=255, - crushstrength=0, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, - minwaterdepth=10, - heatmod=0.5, - slopemod=4, - heatmapping=false, - }, +--Hover-- HOVERTANK2 = { footprintx=2, footprintz=2, - maxslope=26, - maxwaterdepth=10, + maxslope=30, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - NORMALTANK2 = { - footprintx=2, - footprintz=2, - maxslope=26, - maxwaterdepth=10, - maxwaterslope=26, - badwaterslope=26, + HOVERTANK3 = { + footprintx=3, + footprintz=3, + maxslope=30, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - TANK2 = { - footprintx=2, - footprintz=2, - maxslope=28, - maxwaterdepth=5000, + HOVERTANK4 = { + footprintx=4, + footprintz=4, + maxslope=30, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.5, - quadraticCoeff = 0.1, - linearCoeff = 0.1, -- deprecates "depthMod" - constantCoeff = 1, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - - HOVERTANK3 = { - footprintx=3, - footprintz=3, - maxslope=26, - maxwaterdepth=10, + + HOVERTANK5 = { + footprintx=5, + footprintz=5, + maxslope=30, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - - TANK3 = { - footprintx=3, - footprintz=3, - maxslope=28, - maxwaterdepth=5000, + + HOVERTANK6 = { + footprintx=6, + footprintz=6, + maxslope=30, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - ALLTERRTANK3 = { - footprintx=3, - footprintz=3, - maxslope=90, - maxwaterdepth=10, - crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.5, - quadraticCoeff = 0.1, - linearCoeff = 0.1, -- deprecates "depthMod" - constantCoeff = 1, - }, + ORBHOVERTANK6 = { + footprintx=6, + footprintz=6, + maxslope=47, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - HOVERTANK4 = { - footprintx=4, - footprintz=4, - maxslope=26, - maxwaterdepth=10, +--End Hover-- + + +--hBot-- + + HOVERHBOT2 = { + footprintx=2, + footprintz=2, + maxslope=47, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, - slopemod=4, - heatmapping=false, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - TANK4 = { - footprintx=4, - footprintz=4, - maxslope=28, - maxwaterdepth=5000, + HOVERHBOT3 = { + footprintx=3, + footprintz=3, + maxslope=47, + maxwaterdepth=25, maxwaterslope=255, badwaterslope=255, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, - slopemod=4, - heatmapping=false, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - ALLTERRTANK4 = { + + HOVERHBOT4 = { footprintx=4, footprintz=4, - maxslope=90, - maxwaterdepth=10, - crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + maxslope=47, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + HOVERHBOT5 = { + footprintx=5, + footprintz=5, + maxslope=47, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + HOVERHBOT6 = { + footprintx=6, + footprintz=6, + maxslope=47, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + HOVERHBOT8 = { + footprintx=8, + footprintz=8, + maxslope=47, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, + slopemod=3, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + +--End hBot-- + + +--All Terrain-- + + ALLTERRTANK2 = { + footprintx=2, + footprintz=2, + maxslope=47, + maxwaterdepth=30, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - UBOAT4 = { - footprintx = 4, - footprintz = 4, - maxslope=60, - minwaterdepth = 30, - crushstrength = 20, - subMarine = 1, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + + ALLTERRTANK3 = { + footprintx=3, + footprintz=3, + maxslope=47, + maxwaterdepth=30, + crushstrength=20, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - HOVERTANK5 = { - footprintx=5, - footprintz=5, - maxslope=26, - maxwaterdepth=10, - maxwaterslope=255, - badwaterslope=255, + ALLTERRTANK4 = { + footprintx=4, + footprintz=4, + maxslope=47, + maxwaterdepth=30, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - + ALLTERRTANK5 = { footprintx=5, footprintz=5, - maxslope=90, - maxwaterdepth=10, - crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + maxslope=47, + maxwaterdepth=30, + crushstrength=20, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - HOVERTANK6 = { + ALLTERRTANK6 = { footprintx=6, footprintz=6, - maxslope=26, - maxwaterdepth=10, + maxslope=47, + maxwaterdepth=30, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + +--End All Terrain-- + + +--Amphibious-- + TANK1 = { + footprintx=1, + footprintz=1, + maxslope=30, + maxwaterdepth=5000, maxwaterslope=255, badwaterslope=255, + crushstrength=0, + depthModParams = amphibDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=2, + depthMod=0, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + NORMALTANK2 = { + footprintx=2, + footprintz=2, + maxslope=30, + maxwaterdepth=25, + maxwaterslope=26, + badwaterslope=26, crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = amphibDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - ALLTERRTANK6 = { - footprintx=6, - footprintz=6, - maxslope=90, - maxwaterdepth=10, - crushstrength=20, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + + TANK2 = { + footprintx=2, + footprintz=2, + maxslope=30, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = amphibDepthmodParams, minwaterdepth=10, - heatmod=0.5, - slopemod=4, - heatmapping=false, + heatmod=unitHeat, + slopemod=2, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, - COMMANDERTANK4 = { + + TANK3 = { + footprintx=3, + footprintz=3, + maxslope=30, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = amphibDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=2, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + TANK4 = { footprintx=4, footprintz=4, - maxslope=90, + maxslope=30, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, crushstrength=20, + depthModParams = amphibDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=2, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + TANK6 = { + footprintx=6, + footprintz=6, + maxslope=30, maxwaterdepth=5000, maxwaterslope=255, badwaterslope=255, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + crushstrength=20, + depthModParams = amphibDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, + slopemod=2, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + +--End Amphibious-- + + +--UBoat-- + + UBOAT4 = { + footprintx = 4, + footprintz = 4, + maxslope=60, + minwaterdepth = 30, + crushstrength = 20, + subMarine = 1, + depthModParams = amphibDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, + +--End UBoat-- + + +--Endbringers-- + EXPERIMENTALTANK10 = { footprintx=12, footprintz=12, - maxslope=28, + maxslope=30, maxwaterdepth=5000, maxwaterslope=255, badwaterslope=255, crushstrength=100, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, HOVERTANKEXPERIMENTAL9 = { footprintx=9, footprintz=9, - maxslope=26, - maxwaterdepth=20, + maxslope=30, + maxwaterdepth=30, crushstrength=100, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, EXPERIMENTALTANK12 = { footprintx=12, footprintz=12, - maxslope=90, + maxslope=47, maxwaterdepth=80, crushstrength=100, - depthModParams = { - minHeight = 0, - maxHeight = 5000, - maxScale = 1.1, - quadraticCoeff = 0.3, - linearCoeff = 0.3, -- deprecates "depthMod" - constantCoeff = 0.3, - }, + depthModParams = genericDepthmodParams, minwaterdepth=10, - heatmod=0.5, + heatmod=unitHeat, slopemod=4, - heatmapping=false, + allowRawMovement=true, + flowMapping=flowMappingToggle, }, + +--End Endbringers-- + + +--Commanders-- + + COMMANDERTANK4 = { + footprintx=4, + footprintz=4, + maxslope=47, + crushstrength=20, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + COMMANDERTANK6 = { + footprintx=6, + footprintz=6, + maxslope=47, + crushstrength=20, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + COMMANDERTANKAI4 = { + footprintx=4, + footprintz=4, + maxslope=30, + crushstrength=20, + maxwaterdepth=25, + maxwaterslope=255, + badwaterslope=255, + depthModParams = genericDepthmodParams, + minwaterdepth=10, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + +--End Commanders-- + + +--ZAAL-- + + ZAALQUEEN3 = { + footprintx=3, + footprintz=3, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT1 = { + footprintx=1, + footprintz=1, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT2 = { + footprintx=2, + footprintz=2, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT3 = { + footprintx=3, + footprintz=3, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT4 = { + footprintx=4, + footprintz=4, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT5 = { + footprintx=5, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + ZAALKBOT6 = { + footprintx=6, + footprintz=6, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + +--End ZAAL-- + +--Pattern-- + + PATTERNKBOT2 = { + footprintx=2, + footprintz=2, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + + PATTERNKBOT3 = { + footprintx=3, + footprintz=3, + maxslope=40, + maxwaterdepth=5000, + maxwaterslope=255, + badwaterslope=255, + crushstrength=20, + depthModParams = genericDepthmodParams, + minwaterdepth=0, + heatmod=unitHeat, + slopemod=4, + allowRawMovement=true, + flowMapping=flowMappingToggle, + }, + } -------------------------------------------------------------------------------- @@ -404,14 +673,21 @@ local moveDefs = { -- convert from map format to the expected array format -local moveDefsArray = {} +local array = {} local i = 1 for k,v in pairs(moveDefs) do - moveDefsArray[i] = v + v.heatmapping = false -- disable heatmapping + v.allowRawMovement = true + array[i] = v v.name = k i = i + 1 end -return moveDefsArray +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +return array + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Gamedata/movedefs_post.lua b/Gamedata/movedefs_post.lua index 2f603dd7d..82eb2c0c1 100644 --- a/Gamedata/movedefs_post.lua +++ b/Gamedata/movedefs_post.lua @@ -27,13 +27,13 @@ myMovDef = nil if ( MoveDefs[myMovDef][tagName] ~= nil ) then if ( ud[tagName] ~= nil and ud[tagName] ~= MoveDefs[myMovDef][tagName] ) then --Spring.Echo(tagName,ud[tagName],MoveDefs[myMovDef][tagName]) - Spring.Echo("Warning! Unit: " .. ud.name .." Unit tag: " .. tagName .. " (".. ud[tagName] .. ") conflicts movedata (" .. MoveDefs[myMovDef][tagName] .. ")") + --Spring.Echo("Warning! Unit: " .. ud.name .." Unit tag: " .. tagName .. " (".. ud[tagName] .. ") conflicts movedata (" .. MoveDefs[myMovDef][tagName] .. ")") ud[tagName] = MoveDefs[myMovDef][tagName] end end end else - Spring.Echo("Unit: " .. ud.name .. ", Missing move class def: \"" .. ud.movementclass .. "\"") + --Spring.Echo("Unit: " .. ud.name .. ", Missing move class def: \"" .. ud.movementclass .. "\"") end end diff --git a/Gamedata/particles.tdf b/Gamedata/particles.tdf deleted file mode 100644 index 993d22402..000000000 --- a/Gamedata/particles.tdf +++ /dev/null @@ -1,7 +0,0 @@ -[nanospray] -{ -allow_team_colours=1; -shownanoframe=1; -shownanospray=0; -nanocolor=0; -} diff --git a/Gamedata/post_save_to_customparams.lua b/Gamedata/post_save_to_customparams.lua new file mode 100644 index 000000000..2f1445303 --- /dev/null +++ b/Gamedata/post_save_to_customparams.lua @@ -0,0 +1,43 @@ +function table.val_to_str ( v ) + if "string" == type( v ) then + v = string.gsub( v, "\n", "\\n" ) + if string.match( string.gsub(v,"[^'\"]",""), '^"+$' ) then + return "'" .. v .. "'" + end + return '"' .. string.gsub(v,'"', '\\"' ) .. '"' + else + return "table" == type( v ) and table.tostring( v ) or + tostring( v ) + end +end + +function table.key_to_str ( k ) + if "string" == type( k ) and string.match( k, "^[_%a][_%a%d]*$" ) then + if k == "else" then k = "default" end -- handles deprecated ["else"] damage class + return string.lower(k) -- make all key values lower case + else + return "[" .. table.val_to_str( k ) .. "]" + end +end + +function table.tostring( tbl ) + local result, done = {}, {} + for k, v in ipairs( tbl ) do + table.insert( result, table.val_to_str( v ) ) + done[ k ] = true + end + for k, v in pairs( tbl ) do + if not done[ k ] then + table.insert( result, + table.key_to_str( k ) .. "=" .. table.val_to_str( v ) ) + end + end + return "{" .. table.concat( result, "," ) .. "}" +end + +function SaveDefToCustomParams(defType, name, def) + local def_string = table.tostring(def) + def.customparams = def.customparams or {} + def.customparams.__def = table.tostring(def) + Spring.Echo("saved " .. defType .. "." .. name .. " to customparams.__def as string") +end \ No newline at end of file diff --git a/Gamedata/resources.lua b/Gamedata/resources.lua index 4b9267a58..17a5fc46f 100644 --- a/Gamedata/resources.lua +++ b/Gamedata/resources.lua @@ -33,6 +33,17 @@ local resources = { muzzleside = 'default/muzzleside.tga', muzzlefront = 'default/muzzlefront.tga', largebeam = 'default/largelaserfalloff.tga', + -- Put these in "ProjectileTextures" + --Chicken Defense effects + uglynovaexplo='CC/uglynovaexplo.tga', + orangesmoke3='GPL/smoke_orange.png', + sporetrail='GPL/sporetrail.tga', + blooddrop='PD/blooddrop.tga', + bloodblast='PD/bloodblast.tga', + bloodsplat='PD/bloodsplat.tga', + blooddropwhite='PD/blooddropwhite.tga', + bloodblastwhite='PD/bloodblastwhite.tga', + null='PD/null.tga', }, } } diff --git a/Gamedata/scavengers/unitdef_changes.lua b/Gamedata/scavengers/unitdef_changes.lua new file mode 100644 index 000000000..5e1bb7081 --- /dev/null +++ b/Gamedata/scavengers/unitdef_changes.lua @@ -0,0 +1,924 @@ +-- (note that alldefs_post.lua is still ran afterwards if you change anything there) + +-- Special rules: +-- you only need to put the things you want changed in comparison with the regular unitdef. (use the same table structure) +-- since you cant actually remove parameters normally, it will do it when you set string: 'nil' as value +-- normally an empty table as value will be ignored when merging, but not here, it will overwrite what it had with an empty table + +customDefs = {} + + +local scavUnit = {} +for name,uDef in pairs(UnitDefs) do + scavUnit[#scavUnit+1] = name..'_scav' +end + +-- Use this commented out BAR part as example + + customDefs.ecommander = { + buildoptions = scavUnit, + workertime = 10, + repairspeed = 10, + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + customparams = { + providetech = [[tech0, tech1, tech2, tech3]], + }, + } + + customDefs.eamphibbuggybig = { + maxdamage = 2500, + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + weapondefs = { + lightbeamlaser = { + thickness = 20, + }, + }, + } + + + customDefs.eallterranarchid = { + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + } + + customDefs.eamphibleveler = { + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + } + + customDefs.ehbotkarganneth = { + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + } + + customDefs.ekrow = { + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + } + + customDefs.elacerator = { + explodeas = "mediumScavengerExplosionNuke", + selfdestructas = "mediumScavengerExplosionNuke", + } + + customDefs.eallterranarchidboss = { + explodeas = "bossScavengerExplosionNuke", + selfdestructas = "bossScavengerExplosionNuke", + } + + customDefs.eamphiblevelerboss = { + explodeas = "bossScavengerExplosionNuke", + selfdestructas = "bossScavengerExplosionNuke", + } + + customDefs.ehbotkargannethboss = { + explodeas = "bossScavengerExplosionNuke", + selfdestructas = "bossScavengerExplosionNuke", + } + + customDefs.ekrowboss = { + explodeas = "bossScavengerExplosionNuke", + selfdestructas = "bossScavengerExplosionNuke", + } + + customDefs.elaceratorboss = { + explodeas = "bossScavengerExplosionNuke", + selfdestructas = "bossScavengerExplosionNuke", + } + + + + + + + + + +-- Scav Commanders + +-- customDefs.corcom = { + -- autoheal = 15, + -- buildoptions = scavUnit, + -- builddistance = 1000, + -- cloakcost = 50, + -- cloakcostmoving = 100, + -- collisionvolumescales = "64 52 64", + -- explodeas = "bantha", + -- footprintx = 4, + -- footprintz = 4, + -- hidedamage = true, + -- idleautoheal = 20, + -- maxdamage = 4500, + -- maxvelocity = 2, + -- mincloakdistance = 20, + -- movementclass = "SCAVCOMMANDERKBOT", + -- showplayername = false, + -- stealth = false, + -- workertime = 1000, -- can get multiplied in unitdef_post + -- customparams = { + -- iscommander = 'nil', -- since you cant actually remove parameters normally, it will do it when you set string: 'nil' as value + -- }, + -- featuredefs = { + -- dead = { + -- resurrectable = 0, + -- metal = 1500, + -- }, + -- heap = { + -- resurrectable = 0, + -- metal = 750, + -- }, + -- }, + -- weapondefs = { + -- disintegrator = { + -- commandfire = false, + -- reloadtime = 10, + -- weaponvelocity = 350, + -- damage = { + -- default = 2250, + -- commanders = 225, + -- }, + -- }, + -- }, + -- -- Extra Shield + -- -- weapons = { + -- -- [4] = { + -- -- def = "REPULSOR1", + -- -- }, + -- -- }, +-- } + +-- customDefs.armcom = { + -- autoheal = 15, + -- buildoptions = scavUnit, + -- builddistance = 1000, + -- cloakcost = 50, + -- cloakcostmoving = 100, + -- collisionvolumescales = "64 52 64", + -- explodeas = "bantha", + -- footprintx = 4, + -- footprintz = 4, + -- hidedamage = true, + -- idleautoheal = 20, + -- maxdamage = 4500, + -- maxvelocity = 2, + -- mincloakdistance = 20, + -- movementclass = "SCAVCOMMANDERKBOT", + -- showplayername = false, + -- stealth = false, + -- workertime = 900, -- can get multiplied in unitdef_post + -- customparams = { + -- iscommander = 'nil', -- since you cant actually remove parameters normally, it will do it when you set string: 'nil' as value + -- }, + -- featuredefs = { + -- dead = { + -- resurrectable = 0, + -- metal = 1500, + -- }, + -- heap = { + -- resurrectable = 0, + -- metal = 750, + -- }, + -- }, + -- weapondefs = { + -- disintegrator = { + -- commandfire = false, + -- reloadtime = 10, + -- weaponvelocity = 350, + -- damage = { + -- default = 2250, + -- commanders = 225, + -- }, + -- }, + -- }, + -- -- Extra Shield + -- --weapons = { + -- -- [4] = { + -- -- def = "REPULSOR1", + -- -- }, + -- -- }, +-- } + +-- -- M/E storages T1 give rewarding amounts of metal / energy for reclaim + +-- customDefs.armmstor = { + -- explodeas = "decoycommander", + -- --buildcostmetal = 1500, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "3000 Metal Lootbox", + -- damage = 3000, + -- metal = 3000, --50% reduction for being scav? + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "1500 Metal Lootbox (Damaged)", + -- damage = 1500, + -- metal = 1500, --50% reduction for being scav? + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + +-- customDefs.armestor = { + -- explodeas = "decoycommander", + -- --buildcostenergy = 3000, + -- featuredefs = { + -- dead = { + -- category = "corpses", + -- collisionvolumescales = "26 26 26", + -- description = "6000 Energy Lootbox", + -- damage = 3000, + -- energy = 6000, --50% reduction for being scav? + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- -- customparams = { + -- -- normaltex = "unittextures/Core_normal.dds", + -- -- }, + -- }, + -- heap = { + -- category = "corpses", + -- collisionvolumescales = "26 26 26", + -- description = "3000 Energy Lootbox Damaged", + -- damage = 1500, + -- energy = 3000, --50% reduction for being scav? + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- -- customparams = { + -- -- normaltex = "unittextures/Core_normal.dds", + -- -- }, + -- }, + -- }, +-- } + +-- customDefs.cormstor = { + -- explodeas = "decoycommander", + -- --buildcostmetal = 1500, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "3000 Metal Lootbox", + -- damage = 3000, + -- metal = 3000, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "1500 Metal Lootbox Damaged", + -- damage = 1500, + -- metal = 1500, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + +-- customDefs.corestor = { + -- explodeas = "decoycommander", + -- --buildcostenergy = 3000, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "6000 Energy Lootbox", + -- damage = 3000, + -- energy = 6000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "3000 Energy Lootbox Damaged", + -- damage = 1500, + -- energy = 3000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- }, + -- }, +-- } + +-- -- M/E storages T2 give rewarding amounts of metal / energy for reclaim + +-- customDefs.armuwadvms = { + -- explodeas = "decoycommander", + -- --buildcostmetal = 5000, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "Big 10000 Metal Lootbox", + -- damage = 4500, + -- metal = 10000, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "Big 5000 Metal Lootbox Damaged", + -- damage = 2250, + -- metal = 5000, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + +-- customDefs.armuwadves = { + -- explodeas = "decoycommander", + -- --buildcostenergy = 20000, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "Big 10000 Energy Lootbox", + -- damage = 4500, + -- energy = 10000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "Big 5000 Energy Lootbox Damaged", + -- damage = 2250, + -- energy = 5000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + +-- customDefs.coruwadvms = { + -- explodeas = "decoycommander", + -- --buildcostmetal = 5000, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "Big 10000 Metal Lootbox", + -- damage = 4500, + -- metal = 10000, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "Big 5000 Metal Lootbox Damaged", + -- damage = 2250, + -- metal = 5000, --50% reduction for being scav + -- energy = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + +-- customDefs.coruwadves = { + -- explodeas = "decoycommander", + -- --buildcostenergy = 20000, + -- featuredefs = { + -- dead = { + -- category = "loot", + -- description = "Big 10000 Energy Lootbox", + -- damage = 4500, + -- energy = 10000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- heap = { + -- category = "loot", + -- description = "Big 5000 Energy Lootbox Damaged", + -- damage = 2250, + -- energy = 5000, --50% reduction for being scav + -- metal = 0, + -- object = "scavs/scavcrate.s3o", + -- resurrectable = 0, + -- smokeTime = 0, + -- }, + -- }, +-- } + + +-- ----CUSTOM UNITS--- + +-- -- Bladewing do damage instead of paralyzer +-- customDefs.corbw = { + -- weapondefs = { + -- bladewing_lyzer = { + -- paralyzer = false, + -- reloadtime = 0.1, + -- damage = { + -- default = 3, + -- }, + -- }, + -- }, +-- } + +-- -- Faster rockets with Accel - Lower DMG - higher pitched sound +-- customDefs.corstorm = { + -- weapondefs = { + -- core_kbot_rocket = { + -- soundstart = "rocklit1scav", + -- startvelocity = 64, + -- weaponacceleration = 480, + -- weaponvelocity = 380, + -- damage = { + -- default = 105, + -- subs = 5, + -- }, + -- }, + -- }, +-- } + +-- -- Faster rockets with Accel - Lower DMG - higher pitched sound +-- customDefs.armrock = { + -- weapondefs = { + -- arm_kbot_rocket = { + -- soundstart = "rocklit1scav", + -- startvelocity = 64, + -- weaponacceleration = 480, + -- weaponvelocity = 380, + -- damage = { + -- default = 105, + -- subs = 5, + -- }, + -- }, + -- }, +-- } + +-- -- Rapid Fire AK + Cloak +-- customDefs.corak = { + -- cloakcost = 3, + -- mincloakdistance = 144, + -- maxvelocity = 3, + -- weapondefs = { + -- gator_laser = { + -- beamtime = 0.13, + -- beamttl = 0, + -- reloadtime = 0.2, + -- soundstart = "lasrlit3scav", + -- damage = { + -- bombers = 1.6, + -- default = 20, + -- fighters = 1.6, + -- subs = 0.4, + -- vtol = 1.6, + -- }, + -- }, + -- }, +-- } + +-- -- Heavy Slow Fire Warrior + Cloak +-- customDefs.armwar = { + -- cloakcost = 3, + -- mincloakdistance = 144, + -- script = "scavs/ARMWARSCAV.cob", + -- weapondefs = { + -- armwar_laser = { + -- beamtime = 0.23, + -- energypershot = 60, + -- laserflaresize = 9.2, + -- reloadtime = 1.2, + -- soundstart = "lasrfir4scav", + -- targetborder = 0.2, + -- thickness = 2.5, + -- damage = { + -- bombers = 36, + -- default = 242, + -- fighters = 36, + -- subs = 48, + -- vtol = 36, + -- }, + -- }, + -- }, +-- } + +-- -- Cloaked Radar + +-- customDefs.armrad = { + -- cloakcost = 6, + -- mincloakdistance = 144, +-- } + +-- customDefs.armarad = { + -- cloakcost = 12, + -- mincloakdistance = 144, +-- } + +-- customDefs.corrad = { + -- cloakcost = 6, + -- mincloakdistance = 144, +-- } + +-- customDefs.corarad = { + -- cloakcost = 12, + -- mincloakdistance = 144, +-- } + + +-- -- Cloaked Jammers + +-- customDefs.armjamt = { + -- cloakcost = 10, + -- mincloakdistance = 144, +-- -- radardistancejam = 700, + -- sightdistance = 250, +-- } + +-- customDefs.armveil = { + -- cloakcost = 25, + -- mincloakdistance = 288, +-- -- radardistancejam = 900, + -- sightdistance = 310, +-- } + +-- customDefs.corjamt = { + -- cloakcost = 10, + -- mincloakdistance = 144, +-- -- radardistancejam = 700, + -- sightdistance = 250, +-- } + +-- customDefs.corshroud = { + -- cloakcost = 25, + -- mincloakdistance = 288, +-- -- radardistancejam = 900, + -- sightdistance = 310, +-- } + +-- -- Cloaked Constructors + +-- customDefs.correcl = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armrecl = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corck = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corcv = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.cormuskrat = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corack = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.coracv = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corca = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.coraca = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armck = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armcv = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armbeaver = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armack = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armacv = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armca = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armaca = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- -- Cloaked Radar/Jammer Units + +-- customDefs.armaser = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armmark = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armjam = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armseer = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corspec = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corvoyr = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.coreter = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corvrad = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + + +-- -- Cloaked Combat Units + +-- customDefs.corcrash = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.coraak = { + -- cloakcost = 6, + -- mincloakdistance = 144, +-- } + +-- customDefs.armjeth = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armaak = { + -- cloakcost = 6, + -- mincloakdistance = 144, +-- } + +-- customDefs.corgator = { + -- cloakcost = 6, + -- mincloakdistance = 144, +-- } + +-- customDefs.cortermite = { + -- cloakcost = 12, + -- mincloakdistance = 144, +-- } + +-- customDefs.cormando = { + -- cloakcost = 12, + -- mincloakdistance = 144, +-- } + +-- customDefs.corhrk = { + -- cloakcost = 12, + -- mincloakdistance = 160, +-- } + +-- customDefs.armzeus = { + -- cloakcost = 12, + -- mincloakdistance = 144, +-- } + +-- customDefs.corroach = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.armvader = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- -- Cloaked + Stealh Units + +-- customDefs.corkarg = { + -- cloakcost = 24, + -- stealth = true, + -- mincloakdistance = 144, +-- } + +-- customDefs.corroach = { + -- cloakcost = 3, + -- mincloakdistance = 144, +-- } + +-- customDefs.corsktl = { + -- cloakcost = 6, + -- stealth = true, + -- mincloakdistance = 144, +-- } + +-- -- Cloaked Defenses + +-- -- Faster LLT - unique sound - shorter beamtime +-- customDefs.corllt = { + -- cloakcost = 6, + -- mincloakdistance = 144, + -- weapondefs = { + -- core_lightlaser = { + -- beamtime = 0.08, + -- energypershot = 10, + -- reloadtime = 0.36, + -- soundstart = "lasrfir3scav", + -- damage = { + -- bombers = 3.75, + -- default = 105, + -- fighters = 3.75, + -- subs = 1.5, + -- vtol = 3.75, + -- }, + -- }, + -- }, +-- } + +-- -- Custom HLLT - low laser = faster - high laser is slower - unique sounds +-- customDefs.corhllt = { + -- cloakcost = 9, + -- mincloakdistance = 144, + -- weapondefs = { + -- hllt_bottom = { + -- beamtime = 0.07, + -- energypershot = 7.5, + -- reloadtime = 0.24, + -- soundstart = "lasrfir3scav", + -- damage = { + -- bombers = 2.5, + -- default = 70, + -- fighters = 2.5, + -- subs = 1, + -- vtol = 2.5, + -- }, + -- }, + -- hllt_top = { + -- beamtime = 0.28, + -- energypershot = 30, + -- reloadtime = 1.92, + -- soundstart = "lasrfir4scav", + -- thickness = 3, + -- damage = { + -- bombers = 20, + -- commanders = 400, + -- default = 300, + -- fighters = 20, + -- subs = 12, + -- vtol = 20, + -- }, + -- }, + -- }, + -- } + +-- customDefs.corhlt = { + -- cloakcost = 18, + -- mincloakdistance = 288, +-- } + +-- customDefs.armhlt = { + -- cloakcost = 18, + -- mincloakdistance = 288, +-- } + +-- -- Faster LLT - unique sound - shorter beamtime +-- customDefs.armllt = { + -- cloakcost = 6, + -- mincloakdistance = 144, + -- weapondefs = { + -- arm_lightlaser = { + -- beamtime = 0.08, + -- energypershot = 10, + -- reloadtime = 0.36, + -- soundstart = "lasrfir3scav", + -- damage = { + -- bombers = 3.75, + -- default = 105, + -- fighters = 3.75, + -- subs = 1.5, + -- vtol = 3.75, + -- }, + -- }, + + -- }, +-- } + +-- --Custom Nanoturrets - 25% more range +-- customDefs.armnanotc = { + -- cloakcost = 6, + -- mincloakdistance = 144, + -- builddistance = 500, +-- } + +-- customDefs.cornanotc = { + -- cloakcost = 6, + -- mincloakdistance = 144, + -- builddistance = 500, +-- } + +-- customDefs.corsilo = { + -- cloakcost = 100, + -- mincloakdistance = 144, +-- } + +-- customDefs.armsilo = { + -- cloakcost = 100, + -- mincloakdistance = 144, +-- } + +-- -- customDefs.armbeamer = { +-- -- cloakcost = 6, +-- -- mincloakdistance = 144, +-- -- } + +-- customDefs.corvipe = { + -- cloakcost = 20, + -- mincloakdistance = 288, +-- } + +-- customDefs.cortoast = { + -- cloakcost = 20, + -- mincloakdistance = 288, +-- } + +-- customDefs.corint = { + -- cloakcost = 75, + -- mincloakdistance = 432, +-- } + +-- customDefs.cordoom = { + -- cloakcost = 50, + -- mincloakdistance = 432, +-- } + +-- customDefs.armrectr = { + -- workertime = 400, -- can get multiplied in unitdef_post +-- } + +-- customDefs.cornecro = { + -- workertime = 400, -- can get multiplied in unitdef_post +-- } diff --git a/Gamedata/scavengers/unitdef_post.lua b/Gamedata/scavengers/unitdef_post.lua new file mode 100644 index 000000000..800a32600 --- /dev/null +++ b/Gamedata/scavengers/unitdef_post.lua @@ -0,0 +1,173 @@ +-- this file gets included in alldefs_post.lua + +local scavUnit = {} +for name,uDef in pairs(UnitDefs) do + scavUnit[#scavUnit+1] = name..'_scav' +end + +local rana = math.random(3,1000) +local ranb = math.random(2,a) +local ranc = math.random(1,b) + + + +function scav_Udef_Post(name, uDef) + if not uDef.customparams then + uDef.customparams = {} + end + + if not uDef.customParams then + uDef.customParams = {} + end + ----------------- EVO stuff + + if uDef.customParams then + --uDef.customParams.ProvideTech = [[tech0, tech1, tech2, tech3]] + uDef.customparams.supply_granted = 1 + uDef.customparams.supply_cost = 0 + end + ----------------- End of EVO stuff + + + + -- add unit category + uDef.category = uDef.category..' SCAVENGER' + + -- add model vertex displacement + + --local udefVertDisp = uDef.customparams.vertdisp1 or 0 + --uDef.customparams.vertdisp = 2.0 * udefVertDisp + uDef.customparams.healthlookmod = 0.40 + + -- make barrelshot purple + + if uDef.sfxtypes then + -- make barrelshot purple + -- if uDef.sfxtypes.explosiongenerators then + -- for k,v in pairs(uDef.sfxtypes.explosiongenerators) do + -- if string.find(v, 'barrelshot') then + -- uDef.sfxtypes.explosiongenerators[k] = v..'-purple' + -- end + -- end + -- end + -- make deathcegs purple + -- if uDef.sfxtypes.pieceexplosiongenerators then + -- for k,v in pairs(uDef.sfxtypes.pieceexplosiongenerators) do + -- if string.find(v, 'deathceg') then + -- uDef.sfxtypes.pieceexplosiongenerators[k] = v..'-purple' + -- end + -- end + -- end + end + -- make unit explosion purple + if uDef.explodeas and uDef.explodeas ~= "bossScavengerExplosionNuke" and uDef.explodeas ~= "mediumScavengerExplosionNuke" then + uDef.explodeas = "mediumScavengerExplosionGeneric" + end + if uDef.selfdestructas and uDef.selfdestructas ~= "bossScavengerExplosionNuke" and uDef.selfdestructas ~= "mediumScavengerExplosionNuke" then + uDef.selfdestructas = "mediumScavengerExplosionGeneric" + end + + -- replace buillists with _scav units + if uDef.buildoptions then + for k, v in pairs(uDef.buildoptions) do + if UnitDefs[v..'_scav'] then + uDef.buildoptions[k] = v..'_scav' + end + end + end + + -- add Scavenger name prefix to wrecks + if uDef.featuredefs then + if uDef.featuredefs.dead then + if uDef.featuredefs.dead.description then + uDef.featuredefs.dead.description = "Scavenger "..uDef.featuredefs.dead.description + end + -- if uDef.featuredefs.dead.metal then + -- uDef.featuredefs.dead.metal = math.ceil(uDef.featuredefs.dead.metal*0.5) + -- end + end + if uDef.featuredefs.heap then + if uDef.featuredefs.heap.description then + uDef.featuredefs.heap.description = "Scavenger "..uDef.featuredefs.heap.description + end + -- if uDef.featuredefs.heap.metal then + -- uDef.featuredefs.heap.metal = math.ceil(uDef.featuredefs.heap.metal*0.5) + -- end + end + end + + -- add Scavenger name prefix to units + if uDef.name then + uDef.name = "Scavenger "..uDef.name + end + + + + if uDef.buildcostenergy then + uDef.buildcostenergy = math.ceil(uDef.buildcostenergy*2) + end + + if uDef.buildcostmetal then + uDef.buildcostmetal = math.ceil(uDef.buildcostmetal*2) + end + + if uDef.energymake then + uDef.energymake = math.ceil(uDef.energymake*2) + end + + if uDef.metalmake then + uDef.metalmake = math.ceil(uDef.metalmake*2) + end + + if uDef.maxdamage then + uDef.maxdamage = math.ceil(uDef.maxdamage*1) + end + + if uDef.maxvelocity then + uDef.maxvelocity = uDef.maxvelocity*0.5 + end + + if uDef.maxreversevelocity then + uDef.maxreversevelocity = uDef.maxreversevelocity*0.1 + end + + if uDef.sightdistance then + uDef.sightdistance = math.ceil(uDef.sightdistance*1.5) + end + + if uDef.radardistancejam then + uDef.radardistancejam = math.ceil(uDef.radardistancejam*1.5) + end + + if uDef.maxdamage then + uDef.autoheal = math.ceil(math.sqrt(uDef.maxdamage/60)) + uDef.idleautoheal = math.ceil(math.sqrt(uDef.maxdamage/60)) + else + uDef.autoheal = 3 + uDef.idleautoheal = 3 + end + + if uDef.turnrate then + uDef.turnrate = uDef.turnrate*0.1 + end + + if uDef.turninplaceanglelimit then + uDef.turninplaceanglelimit = 360 + end + + -- don't let players get scav constructors + if uDef.buildoptions then + uDef.capturable = false + if uDef.featuredefs then + if uDef.featuredefs.dead then + uDef.featuredefs.dead.resurrectable = 0 + end + if uDef.featuredefs.heap then + uDef.featuredefs.heap.resurrectable = 0 + end + end + end + + return uDef + +end diff --git a/Gamedata/scavengers/weapondef_post.lua b/Gamedata/scavengers/weapondef_post.lua new file mode 100644 index 000000000..60444f7b4 --- /dev/null +++ b/Gamedata/scavengers/weapondef_post.lua @@ -0,0 +1,60 @@ +-- this file gets included in alldefs_post.lua +function convertToPurple(value) + value = string.gsub(value, '-red', '-purple') + value = string.gsub(value, '-green', '-purple') + value = string.gsub(value, '-blue', '-purple') + value = string.gsub(value, '-yellow', '-purple') + return value +end + +local function split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results +end + +function scav_Wdef_Post(name, wDef) + if wDef.weapontype == "Cannon" then + --Spring.Echo(wDef.name,wDef.weapontype) + wDef.rgbcolor = {0.96, 0.42, 1} + if wDef.explosiongenerator then + --wDef.explosiongenerator = "custom:genericscavengershellexplosion-medium-purple" + end + if wDef.cegtag then + wDef.cegtag = "scavengercegtag" + end + elseif wDef.weapontype == "MissileLauncher" or wDef.weapontype == "StarburstLauncher" then + if wDef.explosiongenerator then + --wDef.explosiongenerator = "custom:genericscavengershellexplosion-medium-purple" + end + if wDef.cegtag then + wDef.cegtag = "scavengercegtag" + end + elseif wDef.weapontype == "LightningCannon" then + wDef.rgbcolor = {0.95, 0.32, 1} + wDef.customparams.expl_light_color = {0.95, 0.32, 1} + wDef.customparams.light_color = {0.95, 0.32, 1} + --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode + --wDef.customparams.expl_light_color = {0.95, 0.0, 1} Damgam Candy mode + --wDef.customparams.light_color = {0.95, 0.0, 1} Damgam Candy mode + --wDef.explosiongenerator = "custom:genericscavengershellexplosion-medium-lightning" + elseif wDef.weapontype == "BeamLaser" or wDef.weapontype == "LaserCannon" or wDef.weapontype == "DGun" then + wDef.rgbcolor = {0.95, 0.32, 1} + --wDef.rgbcolor = {0.95, 0.0, 1} Damgam Candy mode + wDef.rgbcolor2 = {1, 0.8, 1} + end + -- make lighting purple (sort of: by switching around the rgb values) + if wDef.customparams then + for k, v in pairs(wDef.customparams) do + if type(v) == 'string' and string.find(k, 'light_color') then + local colors = split(v, ' ') + if colors[1] and colors[3] and colors[1] == '1' then + wDef.customparams[k] = colors[2]..' '..colors[3]..' '..colors[1] + end + end + end + end + return wDef +end diff --git a/Gamedata/sidedata.lua b/Gamedata/sidedata.lua index 20657e971..e4d29534e 100644 --- a/Gamedata/sidedata.lua +++ b/Gamedata/sidedata.lua @@ -1,7 +1,49 @@ local sideData = { + -- [1] = { + -- name = 'Ateran', + -- startunit = 'ecommander', + -- startunitai = 'ecommanderai', + -- uiSets = { + -- Main = {0.40, 0.20, 0.70, 1}, + -- Trim = {1.00, 0.80, 0.00, 1}, + -- Rank = {1.00, 0.90, 0.50, 1}, + -- }, + -- }, + -- [2] = { + -- name = 'Zaal', + -- startunit = 'zarm', + -- startunitai = 'zarm', + -- uiSets = { + -- Main = {0.40, 0.20, 0.70, 1}, + -- Trim = {1.00, 0.80, 0.00, 1}, + -- Rank = {1.00, 0.90, 0.50, 1}, + -- }, + -- }, + -- [3] = { + -- name = 'Pattern', + -- startunit = 'xcommander', + -- startunitai = 'xcommander', + -- uiSets = { + -- Main = {0.40, 0.20, 0.70, 1}, + -- Trim = {1.00, 0.80, 0.00, 1}, + -- Rank = {1.00, 0.90, 0.50, 1}, + -- }, + -- }, + [1] = { - name = 'Outer_Colonies', - startunit = 'ecommander', + name = 'Federation of Kala', + startunit = 'fedcommander', + startunitai = 'fedcommanderai', + uiSets = { + Main = {0.40, 0.20, 0.70, 1}, + Trim = {1.00, 0.80, 0.00, 1}, + Rank = {1.00, 0.90, 0.50, 1}, + }, + }, + [2] = { + name = 'Loz Alliance', + startunit = 'fedcommander', + startunitai = 'fedcommanderai', uiSets = { Main = {0.40, 0.20, 0.70, 1}, Trim = {1.00, 0.80, 0.00, 1}, diff --git a/Gamedata/sounds.lua b/Gamedata/sounds.lua index 052791f5b..9a3f5ba0f 100644 --- a/Gamedata/sounds.lua +++ b/Gamedata/sounds.lua @@ -3,24 +3,167 @@ local Sounds = { SoundItems = { + build = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/miscfx/buildstart.wav", + --gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 1, + }, + buildmechanical = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/miscfx/buildstart-mechanical.wav", + --gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 1, + }, + buildmechanical1 = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/miscfx/buildstart-nano.wav", + --gainmod = 0.35, + --pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 1, + }, + + airraider = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/weapons/tmediumtankfire.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 4, + }, + + riottankshotgun = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/weapons/bruisercannon.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 8, + }, + + ehbotpeeweeshotgun = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/weapons/shotgun-reload.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 16, + }, + + pdfire = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/weapons/pointdefensefire.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 8, + }, + + artyweaponhit = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/explosions/artyhit.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 1, + }, + + nukeartyweaponhit = { + --- new since 89.0 + --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + file = "sounds/explosions/nukeartyhit.wav", + gainmod = 0.35, + pitchmod = 0.05, + --pitch = 0.7, + in3d = true, + maxconcurrent = 1, + }, + + ack = { + --- always play on the front speaker(s) + file = "sounds/ui/ack.wav", + in3d = true, + maxconcurrent = 1, + gainmod = 0, + pitchmod = 0, + }, + + dothis = { + --- always play on the front speaker(s) + file = "sounds/acknowledgements/dothis.wav", + in3d = true, + maxconcurrent = 1, + gainmod = 0, + pitchmod = 0, + }, + IncomingChat = { --- always play on the front speaker(s) - file = "sounds/beep4.wav", + file = "sounds/ui/beep4.wav", in3d = "false", maxconcurrent = 1, }, +--------------------------------------------------- +--Unit Selections---------------------------------- +--------------------------------------------------- + + UnitSelect = { + --- always play on the front speaker(s) + file = "sounds/miscfx/unitselect.wav", + in3d = true, + maxconcurrent = 1, + }, + + EngineIdle = { + --- always play on the front speaker(s) + file = "sounds/unitselections/engineidle.wav", + in3d = true, + maxconcurrent = 1, + }, + + + + BugSelect = { + --- always play on the front speaker(s) + file = "sounds/ui/zaal/bugselect.wav", + in3d = true, + maxconcurrent = 1, + }, + MultiSelect = { --- always play on the front speaker(s) - file = "sounds/button9.wav", - in3d = "false", + file = "sounds/ui/button9.wav", + in3d = true, maxconcurrent = 1, + gain = 0.25, }, MapPoint = { --- respect where the point was set, but don't attuenuate in distace --- also, when moving the camera, don't pitch it - file = "sounds/beep6.wav", + file = "sounds/ui/beep6.wav", rolloff = 0, dopplerscale = 0, maxconcurrent = 1, @@ -28,111 +171,178 @@ local Sounds = { factory = { --- always play on the front speaker(s) - file = "sounds/gdfactoryselect.wav", + file = "sounds/miscfx/gdfactoryselect.wav", in3d = "false", maxconcurrent = 1, }, energy = { --- always play on the front speaker(s) - file = "sounds/gdenergy.wav", + file = "sounds/miscfx/gdenergy.wav", in3d = "false", maxconcurrent = 1, }, mex = { --- always play on the front speaker(s) - file = "sounds/gdmex.wav", + file = "sounds/miscfx/gdmex.wav", in3d = "false", maxconcurrent = 1, }, radar = { --- always play on the front speaker(s) - file = "sounds/unitselect.wav", + file = "sounds/miscfx/unitselect.wav", in3d = "false", maxconcurrent = 1, }, mobileunit = { --- always play on the front speaker(s) - file = "sounds/unitselect.wav", + file = "sounds/miscfx/unitselect.wav", in3d = "false", maxconcurrent = 1, }, turret = { --- always play on the front speaker(s) - file = "sounds/turretselect.wav", + file = "sounds/miscfx/turretselect.wav", in3d = "false", maxconcurrent = 1, }, - ExampleSound = { + healing = { + --- always play on the front speaker(s) + file = "sounds/miscfx/heal.wav", + in3d = "true", + maxconcurrent = 1, + }, + + --ExampleSound = { --- some things you can do with this file --- can be either ogg or wav - file = "somedir/subdir/soundfile.ogg", + -- file = "somedir/subdir/soundfile.ogg", --- loudness, > 1 is louder, < 1 is more quiet, you will most likely not set it to 0 - gain = 1, + -- gain = 1, --- > 1 -> high pitched, < 1 lowered - pitch = 1, + -- pitch = 1, --- If > 0.0 then this adds a random amount to gain each time the sound is played. --- Clamped between 0.0 and 1.0. The result is in the range [(gain * (1 + gainMod)), (gain * (1 - gainMod))]. - gainmod = 0.0, + -- gainmod = 0.0, --- If > 0.0 then this adds a random amount to pitch each time the sound is played. --- Clamped between 0.0 and 1.0. The result is in the range [(pitch * (1 + pitchMod)), (pitch * (1 - pitchMod))]. - pitchmod = 0.0, + -- pitchmod = 0.0, --- how unit / camera speed affects the sound, to exagerate it, use values > 1 --- dopplerscale = 0 completely disables the effect - dopplerscale = 1, + -- dopplerscale = 1, --- when lots of sounds are played, sounds with lwoer priority are more likely to get cut off --- priority > 0 will never be cut of (priorities can be negative) - priority = 0, + -- priority = 0, --- this sound will not be played more than 16 times at a time - maxconcurrent = 16, + -- maxconcurrent = 16, --- cutoff distance - maxdist = 20000, + -- maxdist = 20000, --- how fast it becomes more quiet in the distance (0 means aleays the same loudness regardless of dist) - rolloff = 1, + -- rolloff = 1, --- non-3d sounds do always came out of the front-speakers (or the center one) --- 3d sounds are, well, in 3d - in3d = true, + -- in3d = true, --- you can loop it for X miliseconds - looptime = 0, - }, + -- looptime = 0, + --}, - default = { - --- new since 89.0 - --- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) - --gainmod = 0.35, - --pitchmod = 0.3, - --pitch = 0.7, - --in3d = true, - }, + --default = { + -- new since 89.0 + -- you can overwrite the fallback profile here (used when no corresponding SoundItem is defined for a sound) + -- gainmod = 0.35, + -- pitchmod = 0.05, + -- pitch = 0.7, + -- in3d = true, + --}, }, } -local files = VFS.DirList("sounds/unitdeath/") +-- local files = VFS.DirList("sounds/deathsounds/generic/") +-- local t = Sounds.SoundItems +-- for i=1,#files do + -- local fileName = files[i] + -- t[fileName] = { + -- file = fileName; + -- pitchmod = 0.3; + ----gainmod = 0.2; + -- maxconcurrent = 16; + -- rolloff = 2, + -- dopplerscale = 2, + -- in3d = true, + -- } +-- end + +-- local files = VFS.DirList("sounds/explosions/") +-- local t = Sounds.SoundItems +-- for i=1,#files do + -- local fileName = files[i] + -- t[fileName] = { + -- file = fileName; + -- pitchmod = 0.3; + ----gainmod = 0.2; + -- maxconcurrent = 16; + -- rolloff = 2, + -- dopplerscale = 2, + -- in3d = true, + -- } +-- end + +-- local files = VFS.DirList("sounds/deathsounds/nuke/") +-- local t = Sounds.SoundItems +-- for i=1,#files do + -- local fileName = files[i] + -- t[fileName] = { + -- file = fileName; + -- pitchmod = 0.3; + ----gainmod = 0.2; + -- maxconcurrent = 16; + -- rolloff = 2, + -- dopplerscale = 2, + -- in3d = true, + -- } +-- end + +-- local files = VFS.DirList("sounds/weapons/") +-- local t = Sounds.SoundItems +-- for i=1,#files do + -- local fileName = files[i] + -- t[fileName] = { + -- file = fileName; + -- pitchmod = 0.2; + ----gainmod = 0.2; + -- maxconcurrent = 16; + -- rolloff = 2, + -- dopplerscale = 1.5, + -- in3d = true, + -- } +-- end + +local files = VFS.DirList("sounds/selfdcountdown/") local t = Sounds.SoundItems for i=1,#files do local fileName = files[i] t[fileName] = { file = fileName; - pitchmod = 0.3; - gainmod = 0.2; - maxconcurrent = 8; + pitchmod = 0; + gainmod = 0; + maxconcurrent = 1; } end diff --git a/Gamedata/taptools.lua b/Gamedata/taptools.lua new file mode 100644 index 000000000..a89b06333 --- /dev/null +++ b/Gamedata/taptools.lua @@ -0,0 +1,688 @@ +--============================== +--== TAPrime HELPER FUNCTIONS == +--============================== +--shard_include("luarules/gadgets/ai/ba/commonfunctions.lua") -- doesn' work here +VFS.Include("LuaRules/colors.h.lua") + +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc +local spEditUnitCmdDesc = Spring.EditUnitCmdDesc +local spGetUnitPosition = Spring.GetUnitPosition +local spMarkerAddPoint = Spring.MarkerAddPoint +local spMarkerErasePosition = Spring.MarkerErasePosition + +function isbool(x) return (type(x) == 'boolean') end +function istable(x) return (type(x) == 'table') end +function isnumber(x) return (type(x) == 'number') end +function isstring(x) return (type(x) == 'string') end + +function sqrDistance(x1,z1,x2,z2) + local dx,dz = x1-x2,z1-z2 + return (dx*dx)+(dz*dz) +end + +function tobool(val) + local t = type(val) + if (t == 'nil') then + return false + elseif (t == 'boolean') then + return val + elseif (t == 'number') then + return (val ~= 0) + elseif (t == 'string') then + return ((val ~= '0') and (val ~= 'false')) + end + return false +end + +-- Counts how many fields (not elements, use # for that) are there in table T +function tablelength(T) + local count = 0 + for _ in pairs(T) do count = count + 1 end + return count +end + +-- Fast/Concise Remove from ipairs: (http://lua-users.org/lists/lua-l/2013-11/msg00031.html) +function ipairs_remove(t, value) + if not t or not value then + return end + local index = 1 + local size = #t + while index <= size do + if t[index] == value then -- if found searched value + t[index] = t[size] -- replace it with last item + t[size] = nil -- then remove last item. #count still works properly. + size = size - 1 + else + index = index + 1 end + end +end + +function ipairs_removeIdx(t, index) + local size = #t + t[index] = t[size] -- replace it with last item + t[size] = nil -- then remove last item. #count still works properly. +end + +-- Used to remove an element from an itable where the inner param 'element' equals to a certain value +function ipairs_removeByElement(table, elementId, value) + for _, v in ipairs(table) do + if v[elementId] == value then + ipairs_remove(table, v) + end + end +end + +-- Returns the index (if found) or nil if not found +function ipairs_containsElement(table, elementId, value) + for k, v in ipairs(table) do + if v[elementId] == value then + return k + end + end + return nil +end + +-- Returns the key (if found) or nil if not found +function pairs_containsElement(table, elementId, value) + for k, v in pairs(table) do + if v[elementId] == value then + return k + end + end + return nil +end + +function ipairs_len(table) + local numItems = 0 + for k, v in ipairs(table) do + numItems = numItems + 1 + end + return numItems +end + +function pairs_len(table) + -- Alert: Line below prevent errors, but it won't be obvious to the caller if the table is nil + if table == nil or not istable(table) then + return 0 end + local numItems = 0 + for _, v in pairs(table) do + if v then + numItems = numItems + 1 + end + end + return numItems +end + +-- Debug function to list all keys in a given table +function DebugTableKeys(table) + local keys = "" + for key, _ in pairs(table) do + keys = keys .. key .. " " + end + Spring.Echo("Table keys: " .. keys) +end + +-- Debug table keys and values, up to three nested levels +function DebugTable(tbl) + --Spring.Echo(" Debug Table: ") + for k, v in pairsByKeys(tbl) do + local str + if type(v) == "table" then + str = "{" + for k2, v2 in pairsByKeys(v) do + str = str .. k2 + if type(v2) == "table" then + str = str .. "{" + for k3, v3 in pairsByKeys(v2) do + if type(v3) == "table" then + str = str .. k3 .. "={}, " + else + str = str .. k3 .. "=" .. tostring(v3) .. ", " + end + end + str = str .. "}" + else + str = str .. tostring(v2) + end + end + str = str .. "}" + else + str = tostring(v) + end + Spring.Echo(tostring(k), str) + end +end + +-- Debug ipairs containing table keys and values, up to three nested levels +function DebugiTable(tbl) + --Spring.Echo("Debugitable") + if type(tbl) == 'table' then + local s = '{ ' + for k,v in pairs(tbl) do + if type(k) ~= 'number' then k = '"'..k..'"' end + s = s .. '['..k..'] = ' .. DebugiTable(v) .. ',' + end + return s .. '} ' + else + return tostring(tbl) + end +end + +-- Returns true if a table (tab) contains a certain value (searchVal) +function ipairs_contains (tab, searchVal) + for _,value in ipairs(tab) do + if value == searchVal then + return true + end + end + return false +end + +-- Returns a key-sorted iterator which may be traversed by, eg: +-- for name, line in pairsByKeys(lines) do print(name, line) end +-- takes: table, order function; returns: iterator +function pairsByKeys (t, f) + local iter = function () end + if not t then + return iter end + local a = {} + for n in pairs(t) do + table.insert(a, n) end + table.sort(a, f) + local i = 0 -- iterator variable + iter = function () -- iterator function + i = i + 1 + if a[i] == nil then + return nil + else + return a[i], t[a[i]] end + end + return iter +end + +-- Returns a key-sorted iterator which may be traversed by, eg: +-- for name, line in pairsByKeys(lines) do print(name, line) end +-- takes: table, order function; returns: iterator +function ipairsByKeys (t, f) + local iter = function () end + if not t then + return iter end + local a = {} + for n in ipairs(t) do + table.insert(a, n) end + table.sort(a, f) + local i = 0 -- iterator variable + iter = function () -- iterator function + i = i + 1 + if a[i] == nil then + return nil + else + return a[i], t[a[i]] end + end + return iter +end + +local newlineChar = "\b" --was: \011 (FF) - "vertical tab" char, to allow proper parsing from spreadsheets +local tabChar = "\t" --This can be replaced by another tabulation char if desired + +-- Returns a string from any value, including tables +-- takes: type (any), strings (separator, newline, original text, open sign, close sign), int (indentLevel); +-- returns: string +function tostringplus(t, indent, sep, nl, text, osign, csign) + if t == nil then + return "" + end + if indent == nil then + indent = "" + end + if sep == nil then + sep = "=" + end + if nl == nil then + nl = ","..newlineChar + end + if text == nil then + text = "" + end + if osign == nil then + osign = "{"..newlineChar + end + if csign == nil then + csign = "}" -- comma is added automatically by the overarching routine + end + + if type(t) == "string" then + text = '"'..t..'"' + else + if type(t) == "table" then + local outerind = indent + text = text..osign + + indent = indent .. tabChar + for k,v in pairs(t) do + if type(k) == "number" then + --iPairs don't need the explicit index + text = text..indent..tostringplus(v, indent) --, sep, nl, text, osign, csign, indent) + .. nl + else + text = text..indent..tostring(k, indent) --, sep, nl, text, osign, csign, indent) + -- TODO: the first 'sep' below shouldn't be added after a 'close sign' + .. sep ..tostringplus(v, indent) --, sep, nl, text, osign, csign, indent) + .. nl + end + end + + text = text..outerind..csign + else + text = text..tostring(t) + end + end + + return text +end + +--// Converters a quotes-enclosed table into a lua table. Used for customParams encoded tables +--function str2table(s) +-- local exps, res = {}, {} +-- local function save(v) +-- exps[#exps + 1] = v +-- return ('\0'):rep(#exps) +-- end +-- s = s:gsub('%b{}', function(s) return save{str2table(s:sub(2, -2))} end) -- arrays +-- s = s:gsub('"(.-)"', save) -- strings +-- s = s:gsub('%-?%d+', function(s) return save(tonumber(s)) end) -- integer numbers +-- for k in s:gmatch'%z+' do +-- res[#res + 1] = exps[#k] +-- end +-- return (table.unpack or unpack)(res) +--end + +-- [WIP], doesn't work with backspace chars properly +function str2table(input) + local function is_digit(c) + return c >= '0' and c <= '9' + end + --input = tostring(input) + if not input then + return end + if isstring(input) then + input = string.gsub(input, "%[%[", "'") + input = string.gsub(input, "%]%]", "'") + input = string.gsub(input, "\"", "'") + input = string.gsub(input, "\b", "") --backspace char, used in the data spreadsheet + --Spring.Echo("Formatted string: "..input) + end + if type(input) == 'string' then + local data = input + local pos = 0 + function input(undo) + if undo then + pos = pos - 1 + else + pos = pos + 1 + return string.sub(data, pos, pos) + end + end + end + local c + repeat + c = input() + until c ~= ' ' and c ~= ',' + if c == "'" then + local s = '' + repeat + c = input() + if c == "'" then + return s + end + s = s..c + until c == '' + elseif c == '-' or is_digit(c) then + local s = c + repeat + c = input() + local d = is_digit(c) + if d then + s = s..c + end + until not d + input(true) + return tonumber(s) + elseif c == '{' then + local arr = {} + local elem + repeat + elem = str2table(input) + table.insert(arr, elem) + until not elem + return arr + end +end + +--//////////////////////// +--// MATH FUNCTIONS +--//////////////////////// + +function inverselerp(a, b, t) + --return t / (a + b) || deprecated, was used by los scaler + + return (t - a) / (b - a) +end + +function lerp(a, b, t) + return a + (b - a) * t +end + +function minmax(n, min, max) + if n > max then + n = max end + if n < min then + n = min end + return n +end + +--//////////////////////// +--// UPGRADE FUNCTIONS +--//////////////////////// + +function HasTech(prereq, teamID) + if prereq == "" or prereq == nil then + return true end + return GG.TechCheck(prereq, teamID) +end + +--//////////////////////// +--// LUA UI FUNCTIONS +--//////////////////////// + +--Adds or updates the command-button +function AddUpdateCommand(unitID, cmdDesc, block) + local CurrentCmdDescId = spFindUnitCmdDesc(unitID, cmdDesc.id) + cmdDesc.disabled = block or false + + if not CurrentCmdDescId then + spInsertUnitCmdDesc(unitID, cmdDesc.id, cmdDesc) + else + spEditUnitCmdDesc(unitID, cmdDesc.id, cmdDesc) + end +end + +-- BlockCmdID(.., ..) or BlockCmdID(.., .., false) +function SetCmdIDEnable(unitID, cmdID, block, orgTooltip, suffix) + if not isnumber(cmdID) then + return + end + local cmdDescId = spFindUnitCmdDesc(unitID, cmdID) + if not cmdDescId then + return end + + local disable = (block == true or block == nil) -- default: disabled (blocked) + local cmdArray = { disabled = disable } + + if disable and suffix then + cmdArray.tooltip = orgTooltip.."\n\n"..RedStr..suffix + else + cmdArray.tooltip = orgTooltip + end + + --Spring.Echo(cmdID.." Disabled: "..tostring(disable)) + spEditUnitCmdDesc(unitID, cmdDescId, cmdArray) +end + +function BlockCmdID(unitID, cmdID, orgTooltip, suffix) + SetCmdIDEnable(unitID, cmdID, true, orgTooltip, suffix) +end + +function UnblockCmdID(unitID, cmdID, orgTooltip, suffix) + SetCmdIDEnable(unitID, cmdID, false, orgTooltip) +end + + +function LocalAlert(unitID, msg) + local x, y, z = spGetUnitPosition(unitID) --x and z on map floor, y is height + spMarkerAddPoint(x,y,z,msg,true) + spMarkerErasePosition(x,y,z) +end + +function IsValidUnit(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + if unitDefID and Spring.ValidUnitID(unitID) then + return true + end + return false +end + +function DistanceToPoint(unitID, px,py,pz) + if not Spring.ValidUnitID(unitID) then return end + if not px or not pz then return end + + local ux, uy, uz = spGetUnitPosition(unitID) + local dx, dy ,dz = ux - px, uy - py, uz - pz + local dist = dx * dx + dy * dy + dz * dz + return dist +end + + +function Distance2D(unitID, px, pz) + if not Spring.ValidUnitID(unitID) then + return end + if not px or not pz then + Spring.Echo(" Invalid px or pz") + return end + + local ux, _, uz = spGetUnitPosition(unitID) + local dx, dz = ux - px, uz - pz + local dist = dx * dx + dz * dz + return dist +end + +--function indent(i, str) +-- local result = "" +-- if str == nil then +-- str = "\t" +-- end +-- if i == 0 then +-- result = "" +-- else +-- for i = 1, i do +-- result = result .. str +-- end +-- end +-- return result +--end + +------------------------------------------------------------------------------------- +--- ZeroK Utilities +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +--local buildTimes = {} +--local variableCostUnit = { +-- [UnitDefNames["terraunit"].id] = true +--} +--local isCommander = {} +-- +--for i = 1, #UnitDefs do +-- local ud = UnitDefs[i] +-- buildTimes[i] = ud.buildTime +-- if ud.customParams.level or ud.customParams.dynamic_comm then +-- variableCostUnit[i] = true +-- isCommander[i] = true +-- end +--end +-- +--------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------- +--local function GetGridTooltip(unitID) +-- local gridCurrent = Spring.GetUnitRulesParam(unitID, "OD_gridCurrent") +-- if not gridCurrent then return end +-- +-- local windStr = "" +-- local minWind = Spring.GetUnitRulesParam(unitID, "minWind") +-- if minWind then +-- windStr = "\n" .. WG.Translate("interface", "wind_range") .. " " .. math.round(minWind, 1) .. " - " .. math.round(Spring.GetGameRulesParam("WindMax") or 2.5, 1) +-- end +-- +-- if gridCurrent < 0 then +-- return WG.Translate("interface", "disabled_no_grid") .. windStr +-- end +-- local gridMaximum = Spring.GetUnitRulesParam(unitID, "OD_gridMaximum") or 0 +-- local gridMetal = Spring.GetUnitRulesParam(unitID, "OD_gridMetal") or 0 +-- +-- return WG.Translate("interface", "grid") .. ": " .. math.round(gridCurrent,2) .. "/" .. math.round(gridMaximum,2) .. " E => " .. math.round(gridMetal,2) .. " M " .. windStr +--end +-- +--local function GetMexTooltip(unitID) +-- local metalMult = Spring.GetUnitRulesParam(unitID, "overdrive_proportion") +-- if not metalMult then return end +-- +-- local currentIncome = Spring.GetUnitRulesParam(unitID, "current_metalIncome") +-- local mexIncome = Spring.GetUnitRulesParam(unitID, "mexIncome") or 0 +-- local baseFactor = Spring.GetUnitRulesParam(unitID, "resourceGenerationFactor") or 1 +-- +-- if currentIncome == 0 then +-- return WG.Translate("interface", "disabled_base_metal") .. ": " .. math.round(mexIncome,2) +-- end +-- +-- return WG.Translate("interface", "income") .. ": " .. math.round(mexIncome*baseFactor,2) .. " + " .. math.round(metalMult*100) .. "% " .. WG.Translate("interface", "overdrive") +--end +-- +--local function GetTerraformTooltip(unitID) +-- local spent = Spring.GetUnitRulesParam(unitID, "terraform_spent") +-- if not spent then return end +-- +-- return WG.Translate("interface", "terraform") .. " - " .. WG.Translate("interface", "estimated_cost") .. ": " .. math.floor(spent) .. " / " .. math.floor(Spring.GetUnitRulesParam(unitID, "terraform_estimate") or 0) +--end +-- +--local function GetZenithTooltip (unitID) +-- local meteorsControlled = Spring.GetUnitRulesParam(unitID, "meteorsControlled") +-- if not meteorsControlled then return end +-- +-- return (WG.Translate("units", "zenith.description") or "Meteor Controller") .. " - " .. (WG.Translate("interface", "meteors_controlled") or "Meteors controlled") .. " " .. (meteorsControlled or "0") .. "/500" +--end +-- +--local function GetAvatarTooltip(unitID) +-- local commOwner = Spring.GetUnitRulesParam(unitID, "commander_owner") +-- if not commOwner then return end +-- return commOwner or "" +--end +-- +--local function GetCustomTooltip (unitID) +-- return GetGridTooltip(unitID) +-- or GetMexTooltip(unitID) +-- or GetTerraformTooltip(unitID) +-- or GetZenithTooltip(unitID) +-- or GetAvatarTooltip(unitID) +--end +-- +--function Spring.Utilities.GetHumanName(ud, unitID) +-- if not ud then +-- return "" +-- end +-- +-- if unitID then +-- local name = Spring.GetUnitRulesParam(unitID, "comm_name") +-- if name then +-- local level = Spring.GetUnitRulesParam(unitID, "comm_level") +-- if level then +-- return name .. " " .. WG.Translate("interface", "lvl") .. " " .. (level + 1) +-- else +-- return name +-- end +-- end +-- end +-- +-- local name_override = ud.customParams.statsname or ud.name +-- return WG.Translate ("units", name_override .. ".name") or ud.humanName +--end +-- +--function Spring.Utilities.GetDescription(ud, unitID) +-- if not ud then +-- return "" +-- end +-- +-- local name_override = ud.customParams.statsname or ud.name +-- local desc = WG.Translate ("units", name_override .. ".description") or ud.tooltip +-- if Spring.ValidUnitID(unitID) then +-- local customTooltip = GetCustomTooltip(unitID) +-- if customTooltip then +-- return customTooltip +-- end +-- +-- local buildPower = Spring.GetUnitRulesParam(unitID, "buildpower_mult") +-- if buildPower then +-- buildPower = buildPower*10 +-- desc = desc .. ", " .. WG.Translate("interface", "builds_at") .. " " .. buildPower .. " m/s" +-- end +-- end +-- return desc +--end +-- +--function Spring.Utilities.GetHelptext(ud, unitID) +-- local name_override = ud.customParams.statsname or ud.name +-- return WG.Translate ("units", name_override .. ".helptext") or WG.Translate("interface", "no_helptext") +--end +-- +--function Spring.Utilities.GetUnitHeight(ud) +-- local customHeight = ud.customParams.custom_height +-- return (customHeight and tonumber(customHeight)) or ud.height +--end +-- +--------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------- +-- +--function Spring.Utilities.GetUnitCost(unitID, unitDefID) +-- unitDefID = unitDefID or Spring.GetUnitDefID(unitID) +-- if unitID and variableCostUnit[unitDefID] then +-- local realCost = Spring.GetUnitRulesParam(unitID, "comm_cost") or Spring.GetUnitRulesParam(unitID, "terraform_estimate") +-- if realCost then +-- return realCost +-- end +-- end +-- if unitDefID and buildTimes[unitDefID] then +-- return buildTimes[unitDefID] +-- end +-- return 50 +--end +-- +--function Spring.Utilities.GetUnitCanBuild(unitID, unitDefID) +-- unitDefID = unitDefID or Spring.GetUnitDefID(unitID) +-- if not unitDefID then +-- return 0 +-- end +-- local ud = UnitDefs[unitDefID] +-- local buildPower = (ud and ((ud.customParams.nobuildpower and 0) or ud.buildSpeed)) or 0 +-- return buildPower > 0 +--end +-- +--function Spring.Utilities.GetUnitBuildSpeed(unitID, unitDefID) +-- unitDefID = unitDefID or Spring.GetUnitDefID(unitID) +-- if not unitDefID then +-- return 0 +-- end +-- local ud = UnitDefs[unitDefID] +-- local buildPower = (ud and ((ud.customParams.nobuildpower and 0) or ud.buildSpeed)) or 0 +-- if unitID then +-- local mult = Spring.GetUnitRulesParam(unitID, "buildpower_mult") +-- if mult then +-- return mult * buildPower +-- end +-- end +-- return buildPower +--end +-- +--function Spring.Utilities.UnitEcho(unitID, st) +-- st = st or unitID +-- if Spring.ValidUnitID(unitID) then +-- local x,y,z = Spring.GetUnitPosition(unitID) +-- Spring.MarkerAddPoint(x,y,z, st) +-- else +-- Spring.Echo("Invalid unitID") +-- Spring.Echo(unitID) +-- Spring.Echo(st) +-- end +--end + +--local a = { "armflash", { name = "Flash", side = "Arm", description = "Fast Assault Tank", acceleration = 0.06, activatewhenbuilt = false, airsightdistance = 0, airstrafe = false, autoheal = 0, bankscale = 0, blocking = false, bmcode = 0, brakerate = 0.1, buildangle = 0, buildcostmetal = 250, buildcostenergy = 5000, builddistance = 0, builder = false, buildinggrounddecaldecayspeed = 0, buildinggrounddecalsizex = 0, buildinggrounddecalsizey = 0, buildoptions = {}, buildpic = "ARMFLASH.DDS", buildtime = 7500, canassist = false, canattack = false, canbeassisted = true, cancapture = false, cancloak = false, candgun = false, canfly = false, canguard = false, canmanualfire = false, canmove = true, canpatrol = false, canreclaim = false, canrepair = false, canrepeat = false, canrestore = false, canresurrect = false, canstop = 0, cansubmerge = false, cantbetransported = false, capturable = true, capturespeed = 0, category = "ALL TANK MOBILE WEAPON NOTSUB NOTSHIP NOTAIR SURFACE", cloakcost = 0, cloakcostmoving = 0, collide = false, collision = false, collisionvolumeoffsets = "0 0 -1", collisionvolumescales = "24 9 31", collisionvolumetype = "Box", commander = false, corpse = "armflash_dead", cruisealt = 0, crushresistance = 300, damagemodifier = 0, energymake = 0, energypershot = 0, energystorage = 0, energyuse = 0, explodeas = "BIG_UNITEX", extractsmetal = 0, featuredefs = { heap = { footprintx = 2, description = "Flash Heap", resurrectable = 0, hitdensity = 100, blocking = false, collisionvolumescales = "35.0 4.0 6.0", damage = 193, featurereclamate = "SMUDGE01", seqnamereclamate = "TREE1RECLAMATE", collisionvolumetype = "cylY", reclaimable = true, world = "All Worlds", footprintz = 2, object = "2X2C", height = 4, category = "heaps", energy = 0, metal = 28, }, dead = { footprintx = 2, description = "Flash Wreckage", featuredead = "armflash_heap", hitdensity = 100, blocking = true, collisionvolumescales = "20.3918304443 9.5 30.2260284424", damage = 396, featurereclamate = "SMUDGE01", seqnamereclamate = "TREE1RECLAMATE", collisionvolumetype = "Box", world = "All Worlds", reclaimable = true, object = "ARMFLASH_DEAD", footprintz = 2, collisionvolumeoffsets = "0.0750198364258 0.20984 -0.70206451416", height = 20, category = "corpses", energy = 0, metal = 71, }, }, floater = false, footprintx = 3, footprintz = 3, hidedamage = false, hightrajectory = 0, hoverattack = false, idleautoheal = 5, idletime = 1800, initcloaked = false, isairbase = false, isfeature = false, istargetingupgrade = false, leavetracks = true, levelground = false, loadingradius = 0, mass = 1500, maxdamage = 598, maxpitch = 0, maxrepairspeed = 0, maxslope = 10, maxvelocity = 5.8, maxwaterdepth = 12, metalmake = 0, metalstorage = 0, mincloakdistance = 0, minwaterdepth = 0, movementclass = "TANK3", mygravity = 0, noautofire = 0, nochasecategory = "VTOL", norestrict = 0, objectname = "ARMFLASH", onoffable = false, pushresistant = false, radardistance = 0, radardistancejam = 0, radius = 0, reclaimable = false, releaseheld = false, repairable = false, seismicdistance = 0, seismicsignature = 0, selfdestructas = "BIG_UNIT", sfxtypes = {}, showplayername = false, sightdistance = 508, smoothanim = 0, sonardistance = 0, sonarstealth = false, sounds = { ok = { "tarmmove", }, count = { "count6", "count5", "count4", "count3", "count2", "count1", }, canceldestruct = "cancel2", cant = { "cantdo4", }, select = { "tarmsel", }, underattack = "warning1", }, stealth = false, terraformspeed = 0, tidalgenerator = 0, trackoffset = 5, trackstrength = 4, trackstretch = 0, tracktype = "StdTank", trackwidth = 22, transportbyenemy = false, transportcapacity = 0, transportmass = 0, transportsize = 0, transportunloadmethod = 0, turninplace = 0, turninplaceanglelimit = 140, turninplacespeedlimit = 2.37599993, turnrate = 592, unloadspread = 0, upright = false, usebuildinggrounddecal = false, usepiececollisionvolumes = 0, waterline = 0, weapondefs = { emgx = { rgbcolor = "1 1 1", impulsefactor = 0.123, areaofeffect = 8, explosiongenerator = "custom:EMG_HIT", avoidfeature = false, intensity = 0.8, thickness = 1.5, corethickness = 0.7, duration = 0.03, size = 2.25, weaponvelocity = 1000, cratermult = 0, craterareaofeffect = 0, craterboost = 0, soundhitwetvolume = 0.5, soundstart = "flashemg", turret = true, tolerance = 5000, weapontype = "LaserCannon", name = "flash", sprayangle = 10, accuracy = 0, burst = 3, burstrate = 0.1, range = 430, damage = { default = 20, }, reloadtime = 0.4, predictboost = 3, weapontimer = 0.1, soundhitwet = "splshbig", noselfdamage = true, impulseboost = 0.123, }, emgxaa = { rgbcolor = "1 1 1", impulsefactor = 0.123, areaofeffect = 8, explosiongenerator = "custom:EMG_HIT", avoidfeature = false, intensity = 0.8, thickness = 1.5, corethickness = 0.7, duration = 0.03, size = 2.25, weaponvelocity = 1000, cratermult = 0, craterareaofeffect = 0, craterboost = 0, soundhitwetvolume = 0.5, soundstart = "flashemg", turret = true, tolerance = 5000, weapontype = "LaserCannon", name = "flashaa", sprayangle = 10, accuracy = 0, burst = 3, burstrate = 0.1, range = 480, damage = { default = 12, }, reloadtime = 0.4, predictboost = 3, weapontimer = 0.1, soundhitwet = "splshbig", noselfdamage = true, impulseboost = 0.123, cylindertargeting = 0.5, targetMoveError = 0.1,}, }, weapons ={ { onlytargetcategory = "SURFACE", badtargetcategory = "TANK", name ="armflash_emgx", },{ onlytargetcategory = "VTOL", badtargetcategory = "SCOUT", name ="armflash_emgxaa", },}, windgenerator = 0, workertime = 0, reclaimspeed= 0, customparams ={tier = 0, tedclass = "vehicle", func ="aiv", requiretech = "KbotLab", morphdef ={ into = 'armyork', cmdname = [[Panther]], text = 'Morph to Phalanx', require = 'Tech2',}, maxrange = 420, }, }} + diff --git a/Gamedata/unitdefs_post.lua b/Gamedata/unitdefs_post.lua index f120266de..ffca6f5f4 100644 --- a/Gamedata/unitdefs_post.lua +++ b/Gamedata/unitdefs_post.lua @@ -1,202 +1,82 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local modOptions -if (Spring.GetModOptions) then - modOptions = Spring.GetModOptions() -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Utility --- - -local function tobool(val) - local t = type(val) - if (t == 'nil') then - return false - elseif (t == 'boolean') then - return val - elseif (t == 'number') then - return (val ~= 0) - elseif (t == 'string') then - return ((val ~= '0') and (val ~= 'false')) - end - return false +-- Evolution RTS does not use unitdefs_post, see alldefs_post.lua +-- basically, DONT TOUCH this! + + +-- see alldefs.lua for documentation +-- load the games _Post functions for defs, and find out if saving to custom params is wanted +VFS.Include("gamedata/alldefs_post.lua") +-- load functionality for saving to custom params +VFS.Include("gamedata/post_save_to_customparams.lua") + +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy end - -local function disableunits(unitlist) - for name, ud in pairs(UnitDefs) do - if (ud.buildoptions) then - for _, toremovename in ipairs(unitlist) do - for index, unitname in pairs(ud.buildoptions) do - if (unitname == toremovename) then - table.remove(ud.buildoptions, index) - end +-- special tablemerge: +-- converts value string 'nil' to an actual nil +-- normally an empty table as value will be ignored when merging, but not here, it will overwrite what it had with an empty table +function tableMergeSpecial(t1, t2) + for k,v in pairs(t2) do + if type(v) == "table" then + if next(v) == nil then + t1[k] = v + else + if type(t1[k] or false) == "table" then + tableMergeSpecial(t1[k] or {}, t2[k] or {}) + else + t1[k] = v + end + end + else + t1[k] = v end - end end - end + return t1 end --------------------------------------------------------------------------------- --- Gameplay Speed (Classic RTS Mode) -- --------------------------------------------------------------------------------- -if modOptions and tobool(modOptions.gameplayspeed == "normal") then - for id,unitDef in pairs(UnitDefs) do --- Spring.Echo(unitDef.buildcostmetal) - unitDef.buildtime = unitDef.buildcostmetal - end - for name, unitDef in pairs(UnitDefs) do - if unitDef.unitname == "ecommander" then --- Spring.Echo(unitDef.unitname) - unitDef.workertime = unitDef.workertime * 2 - end - end -end +-- create scavenger units +VFS.Include("gamedata/scavengers/unitdef_changes.lua") +local scavengerUnitDefs = {} -if modOptions and tobool(modOptions.gameplayspeed == "fast") then - for id,unitDef in pairs(UnitDefs) do --- Spring.Echo(unitDef.buildcostmetal) - unitDef.buildtime = unitDef.buildcostmetal / 2 - end - for name, unitDef in pairs(UnitDefs) do - if unitDef.unitname == "ecommander" then --- Spring.Echo(unitDef.unitname) - unitDef.workertime = unitDef.workertime * 2 +for name,uDef in pairs(UnitDefs) do + local faction = string.sub(name, 1, 3) + if not string.find(name, '_scav') then + if customDefs[name] ~= nil then + scavengerUnitDefs[name..'_scav'] = tableMergeSpecial(deepcopy(uDef), deepcopy(customDefs[name])) + else + scavengerUnitDefs[name..'_scav'] = deepcopy(uDef) end end end - -if modOptions and tobool(modOptions.gameplayspeed == "faster") then - for id,unitDef in pairs(UnitDefs) do --- Spring.Echo(unitDef.buildcostmetal) - unitDef.buildtime = unitDef.buildcostmetal / 4 - end +for name,ud in pairs(scavengerUnitDefs) do + UnitDefs[name] = ud end -if modOptions then - if modOptions.gameplayspeed == nil then - Spring.Echo("Gameplay Speed is set to fastest") - else - Spring.Echo("Gameplay Speed is set to " .. modOptions.gameplayspeed) +-- handle unitdefs and the weapons they contain +for name,ud in pairs(UnitDefs) do + UnitDef_Post(name,ud) + if ud.weapondefs then + for wname,wd in pairs(ud.weapondefs) do + WeaponDef_Post(wname,wd) end -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- 3dbuildrange for all none plane builders --- ---[[ -for name, ud in pairs(UnitDefs) do - if (tobool(ud.isBuilder) and not tobool(ud.canfly)) then - ud.buildrange3d = true - end -end ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- turn off unit collision check for planes --- - -for name, ud in pairs(UnitDefs) do - if (tobool(ud.canfly) and not tobool(ud.istransport)) then - ud.collide = false + end + + --ud.acceleration = 0.75 + --ud.turnrate = 800 + + if SaveDefsToCustomParams then + SaveDefToCustomParams("UnitDefs", name, ud) end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Calculate mincloakdistance based on unit footprint size --- - -local sqrt = math.sqrt - -for name, ud in pairs(UnitDefs) do - if (not ud.mincloakdistance) then - local fx = ud.footprintx and tonumber(ud.footprintx) or 1 - local fz = ud.footprintz and tonumber(ud.footprintz) or 1 - local radius = 8 * sqrt((fx * fx) + (fz * fz)) - ud.mincloakdistance = (radius + 48) - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Spring Kludge Removal --- -for name, ud in pairs(UnitDefs) do - ud.activateWhenBuilt = true -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Festive units mod option (CarRepairer's WIP) --- ---[[ -if modOptions and tobool(modOptions.xmasunits) then - for name, ud in pairs(UnitDefs) do - local unitname = ud.unitname - if unitname == "armcom" or unitname == "armcomlite" then - --ud.object = - elseif unitname == "armdrag" or unitname == "cordrag" then - ud.objectname = "christmastree_dt.S3O" - ud.featuredefs.dead.object = "christmastree_dt.S3O" - - elseif unitname == "armthund" or unitname == "corshad" then - ud.weapondefs.armbomb.model = "present_bomb1.s3o" - elseif unitname == "armpnix" then - ud.weapondefs.armadvbomb.model = "present_bomb2.s3o" - elseif unitname == "armcybr" then - ud.weapondefs.arm_pidr.model = "present_bomb3.s3o" - elseif unitname == "corhurc" then - ud.weapondefs.coradvbomb.model = "present_bomb2.s3o" - elseif unitname == "corclog" then - ud.objectname = "core_christmas_clogger.s3o" - ud.featuredefs.dead.object = "christmastree_dt.S3O" - end - - end --for -end ---]] - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- fix customParams table --- ---[[ -for name, ud in pairs(UnitDefs) do - if (ud.customparams and not ud.customParams) then - ud.customParams = ud.customparams - ud.customparams = nil - end -end ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---Recursive Table Reader - - -- local function recursiveTableReader(currTable, dashes) - -- dashes = dashes .. " " - -- if type(currTable) == 'table' then - -- for k,v in pairs(currTable) do - -- if (v ~= nil) then - -- Spring.Echo(dashes .. "[" .. k .. "]") - -- recursiveTableReader(v, dashes) - -- end - -- end - -- else - -- if (currTable ~= nil) then - -- Spring.Echo(dashes .. tostring(currTable) ) - -- end - -- end - -- end - -- recursiveTableReader(UnitDefs, "DEF ") \ No newline at end of file +end \ No newline at end of file diff --git a/Gamedata/unitdefs_pre.lua b/Gamedata/unitdefs_pre.lua new file mode 100644 index 000000000..523989096 --- /dev/null +++ b/Gamedata/unitdefs_pre.lua @@ -0,0 +1,483 @@ +Shared.buildList = { + [[ehbotfac]], + [[eminifac]], + [[ebasefactory]], + [[eamphibfac]], + [[eairplant]], + [[etech1]], + [[emetalextractor]], + [[esolar2]], + [[egeothermal]], + [[efusion2]], + [[estorage]], + [[eradar2]], + [[ejammer2]], + [[ekmar]], + [[emine]], + [[elightturret2]], + [[eheavyturret2]], + [[elaserbattery]], + [[eartyturret]], + -- [[euwturret]], + [[eshieldgen]], + [[esilo]], + [[escoutdrone]], + [[ehbotengineer]], + [[eorb]], + [[eamphibleveler]], + [[ehbotkarganneth]], + [[eallterranarchid]], + [[elacerator]], + [[ekrow]], + -- [[ecommander]], +} + +Shared.buildListFed = { + [[f1landfac]], + [[eairplant]], + [[etech1]], + [[emetalextractor]], + [[esolar2]], + [[egeothermal]], + [[efusion2]], + [[estorage]], + [[eradar2]], + [[ejammer2]], + [[ekmar]], + [[emine]], + [[elightturret2]], + [[eheavyturret2]], + [[elaserbattery]], + [[eartyturret]], + -- [[euwturret]], + [[eshieldgen]], + [[esilo]], + [[escoutdrone]], + [[fedengineer]], + [[fedorb]], + [[ehbotkarganneth]], + [[eallterranarchid]], + [[ekrow]], + -- [[ecommander]], +} + +Shared.buildListLoz = { + [[f2landfac]], + [[eairplant]], + [[etech1]], + [[emetalextractor]], + [[esolar2]], + [[egeothermal]], + [[efusion2]], + [[estorage]], + [[eradar2]], + [[ejammer2]], + [[ekmar]], + [[emine]], + [[elightturret2]], + [[eheavyturret2]], + [[elaserbattery]], + [[eartyturret]], + -- [[euwturret]], + [[eshieldgen]], + [[esilo]], + [[escoutdrone]], + [[lozengineer]], + [[lozorb]], + [[eamphibleveler]], + [[elacerator]], + [[ekrow]], + -- [[ecommander]], +} + +Shared.fedOrb = { + [[fedorb]], + [[fedengineer]], +} + +Shared.lozOrb = { + [[lozorb]], + [[lozengineer]], +} + +Shared.buildListeCommanderFactory = { + [[ehbotengineer]], + [[eorb]], + [[escoutdrone]], + [[ebox]], + [[ehbotfac]], + [[eminifac]], + [[ebasefactory]], + [[eamphibfac]], + [[eairplant]], + [[ehbotpeewee]], + [[ehbotthud]], + [[ehbotsniper]], + [[eallterrlight]], + [[eallterrriot_shotgun]], + [[eallterrheavy]], + [[elighttank3]], + [[eriottank2_shotgun]], + [[eheavytank3]], + [[eamphibbuggy]], + [[eamphibriot_shotgun]], + [[eamphibmedtank]], + [[efighter]], + [[egunship2]], + [[ebomber]], + [[eamphibleveler]], + [[ehbotkarganneth]], + [[eallterranarchid]], + [[elacerator]], + [[ekrow]], +} + +Shared.buildListZaal = { + [[zlightswarm]], + [[zmedswarm]], + [[zskirmisher]], + [[zpyro]], + [[zassault]], + [[zarty]], + [[zqueen]], + [[zairscout]], + [[zairtoairfighter]], + [[zairtogroundfighter]], + [[zairbomber]], +} + +Shared.buildListZaalConstructor = { + [[zconstructor]], + [[ztenticle]], + [[zhatch]], + [[zmex]], + [[zespire1]], + [[ztiberium]], +} + +Shared.buildListZaalArm = { + [[zconstructor]], +} + +Shared.buildListZaalTumor = { + [[ztumor]], +} + +local turrets = { + [[ehbotpeewee_turret]], + [[ehbotthud_turret]], + [[ehbotsniper_turret]], + [[ehbotrocko_turret]], +} + +Shared.buildListTurret = {} +for i = 1, #Shared.buildList do + Shared.buildListTurret[i] = Shared.buildList[i] +end +for i = 1, #turrets do + Shared.buildListTurret[#Shared.buildListTurret + 1] = turrets[i] +end + +local factory = { + [[ehbotfac]], + [[eminifac]], + [[ebasefactory]], + [[eamphibfac]], + [[eairplant]], + [[ehbotpeewee]], + [[ehbotthud]], + [[ehbotsniper]], + [[eallterrlight]], + [[eallterrriot_shotgun]], + [[eallterrheavy]], + [[elighttank3]], + [[eriottank2_shotgun]], + [[eheavytank3]], + [[eamphibbuggy]], + [[eamphibriot_shotgun]], + [[eamphibmedtank]], + [[efighter]], + [[egunship2]], + [[ebomber]], + [[eamphibleveler]], + [[ehbotkarganneth]], + [[eallterranarchid]], + [[elacerator]], + [[ekrow]], +} + +Shared.buildListFactory = {} +for i = 1, #Shared.buildList do + Shared.buildListFactory[i] = Shared.buildList[i] +end +for i = 1, #factory do + Shared.buildListFactory[#Shared.buildListFactory + 1] = factory[i] +end + +-- Shared.buildListAIOverseer = { + -- ------------- Basic + -- [[ehbotfac]], + -- [[eminifac]], + -- [[ebasefactory]], + -- [[eamphibfac]], + -- [[eairplant]], + -- [[etech1]], + -- [[emetalextractor]], + -- [[esolar2]], + -- [[egeothermal]], + -- [[efusion2]], + -- [[estorage]], + -- [[eradar2]], + -- [[ejammer2]], + -- [[ekmar]], + -- [[emine]], + -- [[elightturret2]], + -- [[eheavyturret2]], + -- [[elaserbattery]], + -- [[eartyturret]], + -- -- [[euwturret]], + -- [[eshieldgen]], + -- [[esilo]], + -- [[escoutdrone]], + -- [[ebox]], + -- [[ehbotengineer]], + -- [[eorb]], + -- -- [[ecommander]], +-- } + +----------------------------- +----------------------------- +--Buildlists for factories + +Shared.buildListf1landfac = { + [[eallterrlight]], + [[ehbotpeewee]], + [[eallterrriot_shotgun]], + [[ehbotthud]], + [[eallterrassault]], + [[eallterrshield]], + [[eallterrmed]], + [[ehbotsniper]], + [[eallterrheavy]], + [[ehbotrocko]], + [[fedengineer]], + [[eorb]], + +} + +Shared.buildListf2landfac = { + [[eamphibbuggy]], + [[elighttank3]], + [[eriottank2_shotgun]], + [[eamphibneedle]], + [[eartytank]], + [[ebox]], + [[eamphibmedtank]], + [[eheavytank3]], + [[eamphibrock]], + [[emissiletank]], + [[lozengineer]], + [[eorb]], +} + +Shared.buildListHoverFactory = { + [[elighttank3]], + [[eriottank2_shotgun]], + [[eheavytank3]], + [[emissiletank]], + [[eartytank]], + [[elacerator]], +} + +Shared.buildListHoverFactory_up1 = { + [[elighttank3_up1]], + [[eriottank2_up1]], + [[eheavytank3_up1]], + [[emissiletank_up1]], + [[eartytank_up1]], + [[elacerator_up1]], +} + +Shared.buildListHoverFactory_up2 = { + [[elighttank3_up2]], + [[eriottank2_up2]], + [[eheavytank3_up2]], + [[emissiletank_up2]], + [[eartytank_up2]], + [[elacerator_up2]], +} + +Shared.buildListHoverFactory_up3 = { + [[elighttank3_up3]], + [[eriottank2_up3]], + [[eheavytank3_up3]], + [[emissiletank_up3]], + [[eartytank_up3]], + [[elacerator_up3]], +} + +-- +-- + +Shared.buildListAmphibFactory = { + [[eamphibbuggy]], + [[eamphibriot_shotgun]], + [[eamphibneedle]], + [[eamphibmedtank]], + [[eamphibrock]], + [[eamphibarty]], + [[eamphibleveler]], +} + +Shared.buildListAmphibFactory_up1 = { + [[eamphibbuggy_up1]], + [[eamphibriot_up1]], + [[eamphibneedle_up1]], + [[eamphibmedtank_up1]], + [[eamphibrock_up1]], + [[eamphibarty_up1]], + [[eamphibleveler_up1]], +} + +Shared.buildListAmphibFactory_up2 = { + [[eamphibbuggy_up2]], + [[eamphibriot_up2]], + [[eamphibneedle_up2]], + [[eamphibmedtank_up2]], + [[eamphibrock_up2]], + [[eamphibarty_up2]], + [[eamphibleveler_up2]], +} + +Shared.buildListAmphibFactory_up3 = { + [[eamphibbuggy_up3]], + [[eamphibriot_up3]], + [[eamphibneedle_up3]], + [[eamphibmedtank_up3]], + [[eamphibrock_up3]], + [[eamphibarty_up3]], + [[eamphibleveler_up3]], +} + +-- +-- + +Shared.buildListAllTerrainFactory = { + [[eallterrlight]], + [[eallterrriot_shotgun]], + [[eallterrmed]], + [[eallterrheavy]], + [[eallterrassault]], + [[eallterrshield]], + [[eallterranarchid]], +} + +Shared.buildListAllTerrainFactory_up1 = { + [[eallterrlight_up1]], + [[eallterrriot_up1]], + [[eallterrmed_up1]], + [[eallterrheavy_up1]], + [[eallterrassault_up1]], + [[eallterrshield_up1]], + [[eallterranarchid_up1]], +} + +Shared.buildListAllTerrainFactory_up2 = { + [[eallterrlight_up2]], + [[eallterrriot_up2]], + [[eallterrmed_up2]], + [[eallterrheavy_up2]], + [[eallterrassault_up2]], + [[eallterrshield_up2]], + [[eallterranarchid_up2]], +} + +Shared.buildListAllTerrainFactory_up3 = { + [[eallterrlight_up3]], + [[eallterrriot_up3]], + [[eallterrmed_up3]], + [[eallterrheavy_up3]], + [[eallterrassault_up3]], + [[eallterrshield_up3]], + [[eallterranarchid_up3]], +} +-- +-- +Shared.buildListAirPlant = { + -- [[edrone]], + [[efighter]], + [[egunship2]], + [[ebomber]], + [[eairemp]], + [[etransport]], + [[ekrow]], +} +Shared.buildListAirPlant_up1 = { + -- [[edrone_up1]], + [[efighter_up1]], + [[egunship2_up1]], + [[ebomber_up1]], + [[eairemp_up1]], + [[etransport_up1]], + [[ekrow_up1]], +} +Shared.buildListAirPlant_up2 = { + -- [[edrone_up2]], + [[efighter_up2]], + [[egunship2_up2]], + [[ebomber_up2]], + [[eairemp_up2]], + [[etransport_up2]], + [[ekrow_up2]], +} +Shared.buildListAirPlant_up3 = { + -- [[edrone_up3]], + [[efighter_up3]], + [[egunship2_up3]], + [[ebomber_up3]], + [[eairemp_up3]], + [[etransport_up3]], + [[ekrow_up3]], +} +-- +-- +Shared.buildListHbotFactory = { + [[ehbotpeewee]], + [[ehbotthud]], + [[ehbotsniper]], + [[ehbotrocko]], + [[ehbotkarganneth]], +} +Shared.buildListHbotFactory_up1 = { + [[ehbotpeewee_up1]], + [[ehbotthud_up1]], + [[ehbotsniper_up1]], + [[ehbotrocko_up1]], + [[ehbotkarganneth_up1]], +} +Shared.buildListHbotFactory_up2 = { + [[ehbotpeewee_up2]], + [[ehbotthud_up2]], + [[ehbotsniper_up2]], + [[ehbotrocko_up2]], + [[ehbotkarganneth_up2]], +} +Shared.buildListHbotFactory_up3 = { + [[ehbotpeewee_up3]], + [[ehbotthud_up3]], + [[ehbotsniper_up3]], + [[ehbotrocko_up3]], + [[ehbotkarganneth_up3]], +} + +----------------------------- +----------------------------- +--Buildlists for T3/Experimentals + +Shared.buildListT3 = { + [[eamphibleveler]], + [[ehbotkarganneth]], + [[eallterranarchid]], + [[elacerator]], + [[ekrow]], +} \ No newline at end of file diff --git a/Gamedata/weapondefs_post.lua b/Gamedata/weapondefs_post.lua index 64288c8c8..aff60f3fd 100644 --- a/Gamedata/weapondefs_post.lua +++ b/Gamedata/weapondefs_post.lua @@ -1,129 +1,41 @@ - --------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --- --- file: weapondefs_post.lua --- brief: weaponDef post processing --- author: Dave Rodgers --- --- Copyright (C) 2008. --- Licensed under the terms of the GNU GPL, v2 or later. --- +-- Default Engine Weapon Definitions Post-processing -------------------------------------------------------------------------------- +-- BA stores weapondefs in the unitdef files +-- Here we load those defs into the WeaponDefs table +-- Then we call alldefs_post.lua, in which post processing of defs should take place +-- basically, DONT TOUCH this! -------------------------------------------------------------------------------- --- --- Per-unitDef weaponDefs --- + +-- see alldefs.lua for documentation +-- load the games _Post functions for defs, and find out if saving to custom params is wanted +VFS.Include("gamedata/alldefs_post.lua") +-- load functionality for saving to custom params +VFS.Include("gamedata/post_save_to_customparams.lua") + local function isbool(x) return (type(x) == 'boolean') end local function istable(x) return (type(x) == 'table') end local function isnumber(x) return (type(x) == 'number') end local function isstring(x) return (type(x) == 'string') end -local damageClasses = VFS.Include("gamedata/configs/damageTypes.lua") -local damageTypes = damageClasses.damageTypes -local defaultClass = damageClasses.default - local function tobool(val) - local t = type(val) - if (t == 'nil') then - return false - elseif (t == 'boolean') then - return val - elseif (t == 'number') then - return (val ~= 0) - elseif (t == 'string') then - return ((val ~= '0') and (val ~= 'false')) - end - return false -end - --------------------------------------------------------------------------------- - -local function BackwardCompability(wdName,wd) - -- weapon reloadTime and stockpileTime were seperated in 77b1 - if (tobool(wd.stockpile) and (wd.stockpiletime==nil)) then - wd.stockpiletime = wd.reloadtime - wd.reloadtime = 2 -- 2 seconds - end - - -- auto detect ota weapontypes - if (wd.weapontype==nil) then - local rendertype = tonumber(wd.rendertype) or 0 - if (tobool(wd.dropped)) then - wd.weapontype = "AircraftBomb"; - elseif (tobool(wd.vlaunch)) then - wd.weapontype = "StarburstLauncher"; - elseif (tobool(wd.beamlaser)) then - wd.weapontype = "BeamLaser"; - elseif (tobool(wd.isshield)) then - wd.weapontype = "Shield"; - elseif (tobool(wd.waterweapon)) then - wd.weapontype = "TorpedoLauncher"; - elseif (wdName:lower():find("disintegrator",1,true)) then - wd.weaponType = "DGun" - elseif (tobool(wd.lineofsight)) then - if (rendertype==7) then - wd.weapontype = "LightningCannon"; - - -- swta fix (outdated?) - elseif (wd.model and wd.model:lower():find("laser",1,true)) then - wd.weapontype = "LaserCannon"; - - elseif (tobool(wd.beamweapon)) then - wd.weapontype = "LaserCannon"; - elseif (tobool(wd.smoketrail)) then - wd.weapontype = "MissileLauncher"; - elseif (rendertype==4 and tonumber(wd.color)==2) then - wd.weapontype = "EmgCannon"; - elseif (rendertype==5) then - wd.weapontype = "Flame"; - --elseif(rendertype==1) then - -- wd.weapontype = "MissileLauncher"; - else - wd.weapontype = "Cannon"; - end - else - wd.weapontype = "Cannon"; - end - end - - weapondamage = tonumber(wd.damage.default) - if (weapondamage > 0) then - if (wd.customparams) then - local damagetypelower - if wd.customparams.damagetype ~=nil then - damagetypelower = string.lower(wd.customparams.damagetype) - end - if damagetypelower == '' or damagetypelower == nil then - damagetypelower = defaultClass - end - --Spring.Echo(damagetypelower) - --Spring.Echo(" ") - if damageTypes[damagetypelower] then - for armorClass, armorMultiplier in pairs(damageTypes[damagetypelower]) do - --Spring.Echo(wd.name, armorClass, weapondamage*armorMultiplier ) - wd.damage[armorClass] = weapondamage*armorMultiplier - end - else - Spring.Echo("!!WARNING!! Invalid damagetype: " .. damagetypelower) - end - end + local t = type(val) + if (t == 'nil') then + return false + elseif (t == 'boolean') then + return val + elseif (t == 'number') then + return (val ~= 0) + elseif (t == 'string') then + return ((val ~= '0') and (val ~= 'false')) end - --Spring.Echo("_________") - --Spring.Echo(wdName, wd.name) - --for damageClass, damageValue in pairs(wd.damage)do - -- Spring.Echo(damageClass, damageValue) - --end - -- - if (tobool(wd.ballistic) or tobool(wd.dropped)) then - wd.gravityaffected = true - end + return false end -------------------------------------------------------------------------------- -local function ProcessUnitDef(udName, ud) +local function ExtractWeaponDefs(udName, ud) local wds = ud.weapondefs if (not istable(wds)) then @@ -135,7 +47,12 @@ local function ProcessUnitDef(udName, ud) if (isstring(wdName) and istable(wd)) then local fullName = udName .. '_' .. wdName WeaponDefs[fullName] = wd - wd.filename = ud.filename + + WeaponDef_Post(fullName, wd) + + if SaveDefsToCustomParams then + MarkDefOmittedInCustomParams("WeaponDefs", fullName, wd) + end end end @@ -163,46 +80,35 @@ local function ProcessUnitDef(udName, ud) local fullName = udName .. '_' .. ud.explodeas if (WeaponDefs[fullName]) then ud.explodeas = fullName - else - --You're full of shit, fuck off! This echo should be boiled alive, shot, stabbed, the boiled alive again just to make sure! Spring.Echo("Explosion def (weapon) does not exist for", udName) end end if (isstring(ud.selfdestructas)) then local fullName = udName .. '_' .. ud.selfdestructas if (WeaponDefs[fullName]) then ud.selfdestructas = fullName - else - --You're full of shit, fuck off! This echo should be boiled alive, shot, stabbed, the boiled alive again just to make sure! Spring.Echo("Self-Destruct def (weapon) does not exist for", udName) end - end + end end -------------------------------------------------------------------------------- -local function ProcessWeaponDef(wdName, wd) - -- backward compability - BackwardCompability(wdName,wd) -end --------------------------------------------------------------------------------- - --- Process the unitDefs +-- handle standalone weapondefs +for name,wd in pairs(WeaponDefs) do + WeaponDef_Post(name,wd) + + if SaveDefsToCustomParams then + SaveDefToCustomParams("WeaponDefs", name, wd) + end +end + +-- extract weapondefs from the unitdefs local UnitDefs = DEFS.unitDefs - -for udName, ud in pairs(UnitDefs) do +for udName,ud in pairs(UnitDefs) do if (isstring(udName) and istable(ud)) then - ProcessUnitDef(udName, ud) - end -end - - -for wdName, wd in pairs(WeaponDefs) do - if (isstring(wdName) and istable(wd)) then - ProcessWeaponDef(wdName, wd) + ExtractWeaponDefs(udName, ud) end end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - +-- apply mod options that need _post +ModOptions_Post(UnitDefs, WeaponDefs) \ No newline at end of file diff --git a/LGPL-3.0.txt b/LGPL-3.0.txt new file mode 100644 index 000000000..0a041280b --- /dev/null +++ b/LGPL-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/LuaAI.lua b/LuaAI.lua index ca939c526..1fedaf087 100644 --- a/LuaAI.lua +++ b/LuaAI.lua @@ -8,26 +8,34 @@ -- return { - { - name = 'Survival Spawner: Very Easy', - desc = 'Beginner Games' - }, - { - name = 'Survival Spawner: Easy', - desc = 'Normal Games' - }, - { - name = 'Survival Spawner: Normal', - desc = 'Average Games' - }, - { - name = 'Survival Spawner: Hard', - desc = 'Large Games' - }, - { - name = 'Survival Spawner: Very Hard', - desc = 'Hardcore Games' - }, + -- { + -- name = 'DAI', + -- desc = 'Shard by AF for Spring Lua', + -- }, + { + name = 'ScavengersAI', + desc = 'scavs', + }, + { + name = 'Sandbox', + desc = 'Does absolutely Nothing', + }, + { + name = 'SimpleAI', + desc = 'EasyAI (Simple)', + }, + { + name = 'SimpleCheaterAI', + desc = 'EasyAI (Cheater)', + }, + { + name = 'SimpleDefenderAI', + desc = 'EasyAI (Defender)', + }, + { + name = 'SimpleConstructorAI', + desc = 'EasyAI (Constructor)', + }, } diff --git a/LuaIntro/Addons/bg_logo.lua b/LuaIntro/Addons/bg_logo.lua new file mode 100644 index 000000000..394904bc0 --- /dev/null +++ b/LuaIntro/Addons/bg_logo.lua @@ -0,0 +1,418 @@ + +if addon.InGetInfo then + return { + name = "SpringLogo", + desc = "", + author = "jK", + date = "2012", + license = "GPL2", + layer = 1, + depend = {"LoadProgress"}, + enabled = not true, + } +end + +------------------------------------------ + +local a = 0 +local b = 0 + + +local function DrawQuad(x, y, size) + gl.Vertex(x - size, y - size, 0) + gl.Vertex(x - size, y + size, 0) + gl.Vertex(x + size, y + size, 0) + gl.Vertex(x + size, y - size, 0) +end + + + + +local shader = gl.CreateShader({ + uniform = { + }, + + vertex = [[ + varying vec3 normal; + varying vec4 color; + varying vec3 color2; + varying vec4 spos; + varying vec4 mpos; + varying float mirror; + + void main() + { + mirror = gl_FogCoord; + color = gl_Color; + color2 = gl_SecondaryColor.rgb; + normal = gl_NormalMatrix * gl_Normal; + spos = gl_ModelViewMatrix * gl_Vertex; + mpos = gl_ModelViewMatrix * (gl_Vertex * vec4(1.0,1.0,mirror,1.0) - vec4(0.0,0.0,-2.0 * step(0.5, -mirror),0.0)); + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + } + ]], + + fragment = [[ + varying vec3 normal; + varying vec4 color; + varying vec3 color2; + varying vec4 spos; + varying vec4 mpos; + varying float mirror; + + float sqlength(vec3 v) + { + return dot(v,v); + } + + void main() + { + vec3 light = normalize(spos - gl_LightSource[0].position.xyz); + vec3 n = normalize(normal); + + float ambient = 0.45; + float diffuse = max(0.0, dot(n,light)); + + vec3 light2 = normalize(spos - gl_LightSource[1].position.xyz); + float diffuse2 = sqlength(spos - gl_LightSource[1].position.xyz) * 2.5; + diffuse2 = 1.0 - min(1.0, diffuse2); + //diffuse2 *= max(0.0, dot(n,light2)); + + vec3 light2Pos = gl_LightSource[2].position.xyz; + vec3 light2Dir = normalize(light2Pos - spos); + vec3 r = reflect(-light2Dir, n); + vec3 v = -normalize(spos); + + float specular1 = 0.75 * pow(max(0.0, dot(r, v)), 1.3); + float specular2 = 0.80 * pow(max(0.0, dot(r, v)), 4.0); + float specular3 = 0.40 * pow(max(0.0, dot(r, v)), 7.0); + + gl_FragColor.a = 1.0; + gl_FragColor.rgb = color.rgb * (ambient + diffuse); + + gl_FragColor.rgb += color.rrr * vec3(1.2, 0.0, 0.0) * diffuse2; + gl_FragColor.rgb += color.rrr * 0.65 * vec3(0.0, 0.9, 0.9) * pow(diffuse2, 1.5); + + gl_FragColor.rgb += color.bbb * 0.1 * vec3(0.5, 0.5, 1.5) * diffuse2; + gl_FragColor.rgb += color.bbb * 0.5 * vec3(0.5, 0.5, 1.0) * pow(diffuse2, 1.5); + + gl_FragColor.rgb += color.rgb * vec3(1.0, 1.0, 0.5) * 1.5 * specular1; + gl_FragColor.rgb += vec3(1.0, 1.0, 0.7) * (specular2 + specular3); + gl_FragColor.rgb += color2; //shiness + + // sun coloring + float cubeCenterDist = length(mpos.xyz - gl_LightSource[3].position.xyz); + gl_FragColor.rgb += step(0.1,color.rrr) * vec3(1.0, 1.0, 0.0) * smoothstep(1.2, 0.1, cubeCenterDist * 2.4); + gl_FragColor.rgb -= step(0.1,color2.rrr) * vec3(0.0, 0.0, 0.5) * smoothstep(0.7, 1.6, cubeCenterDist * 2.6); + + if (mirror < 0.0) { + //FIXME + float depth = dot(spos, gl_LightSource[4].position.xyz); + float a = clamp(depth * 3.0, 0.0, 1.0); + gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(1.0), a); + } + + // gamma + //gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(1.0 / 0.9)); + } + ]], +}) + +--Spring.Echo(gl.GetShaderLog()) + + + + + + + + + +function SIGN(x) + return ((x >= 0) and 1) or -1 +end + +function EvalSuperEllipse(t1,t2,p1,p2) + local ct1 = math.cos(t1); + local ct2 = math.cos(t2); + local st1 = math.sin(t1); + local st2 = math.sin(t2); + + local tmp = SIGN(ct1) * math.pow(math.abs(ct1),p1); + local x = tmp * SIGN(ct2) * math.pow(math.abs(ct2),p2); + local y = SIGN(st1) * math.pow(math.abs(st1),p1); + local z = tmp * SIGN(st2) * math.pow(math.abs(st2),p2); + + return x,y,z +end + +function CalcNormal(px,py,pz, p1x,p1y,p1z, p2x,p2y,p2z) + local pax = p1x - px; + local pay = p1y - py; + local paz = p1z - pz; + local pbx = p2x - px; + local pby = p2y - py; + local pbz = p2z - pz; + local nx = pay * pbz - paz * pby; + local ny = paz * pbx - pax * pbz; + local nz = pax * pby - pay * pbx; + local l = math.sqrt(nx*nx + ny*ny + nz*nz); + + if (l == 0) then + return 0, 1, 0; + end + return nx/l, ny/l, nz/l; +end + +function CreateSuperEllipse(power1,power2,n) + --http://paulbourke.net/geometry/superellipse/ + local PID2 = math.pi / 2 + local TWOPI = 2 * math.pi + local delta = 0.01 * TWOPI / n; + local j = 0 + while (j < n/2) do + local theta1 = (j * TWOPI / n) - PID2; + local theta2 = ((j + 1) * TWOPI / n) - PID2; + + gl.BeginEnd(GL.TRIANGLE_STRIP, function() + local i = 0 + while (i <= n) do + local theta3 = i * TWOPI / n; + + if (j == n/2 - 1) then + local px,py,pz = EvalSuperEllipse(theta2 , 0 , power1, power2); + local p1x,p1y,p1z = EvalSuperEllipse(theta2 , 0 + delta, power1, power2); + local p2x,p2y,p2z = EvalSuperEllipse(theta2 + delta, 0 + delta, power1, power2); + local nx,ny,nz = CalcNormal(p1x,p1y,p1z, px,py,pz, p2x,p2y,p2z); + gl.Normal(nx,ny,nz); + gl.TexCoord(i/n,2*(j+1)/n); + gl.Vertex(px,py,pz); + else + local px,py,pz = EvalSuperEllipse(theta2 , theta3 , power1, power2); + local p1x,p1y,p1z = EvalSuperEllipse(theta2 + delta, theta3 , power1, power2); + local p2x,p2y,p2z = EvalSuperEllipse(theta2 , theta3 + delta, power1, power2); + local nx,ny,nz = CalcNormal(p1x,p1y,p1z, px,py,pz, p2x,p2y,p2z); + gl.Normal(nx,ny,nz); + gl.TexCoord(i/n,2*(j+1)/n); + gl.Vertex(px,py,pz); + end + + if (j == 0) then + local px,py,pz = EvalSuperEllipse(theta1 , 0 , power1, power2); + local p1x,p1y,p1z = EvalSuperEllipse(theta1 , 0 + delta, power1, power2); + local p2x,p2y,p2z = EvalSuperEllipse(theta1 + delta, 0 + delta, power1, power2); + local nx,ny,nz = CalcNormal(p1x,p1y,p1z, px,py,pz, p2x,p2y,p2z); + gl.Normal(nx,ny,nz); + gl.TexCoord(i/n,2*j/n); + gl.Vertex(px,py,pz); + else + local px,py,pz = EvalSuperEllipse(theta1 , theta3 , power1, power2); + local p1x,p1y,p1z = EvalSuperEllipse(theta1 + delta, theta3 , power1, power2); + local p2x,p2y,p2z = EvalSuperEllipse(theta1 , theta3 + delta, power1, power2); + local nx,ny,nz = CalcNormal(p1x,p1y,p1z, px,py,pz, p2x,p2y,p2z); + gl.Normal(nx,ny,nz); + gl.TexCoord(i/n,2*j/n); + gl.Vertex(px,py,pz); + end + + i = i + 1 + end + end) + j = j + 1 + end +end + +function blend(x1,x2,a) + return a * x2 + (1 - a) * x1 +end + + +function GetSunVertex(r,theta) + local a = math.pi / 10 + + local theta1 = math.floor(theta / a) * a + local theta2 = theta1 + a + + local s = (theta - theta1) / (theta2 - theta1) + --local s = (theta % a) / a + s = math.min(1, math.max(0, s)) + + local u = math.floor(theta / a) % 2 + local r1 = (u >= 1.0) and 1 or 0 + local r2 = (u <= 0.5) and 1 or 0 + + local t1x = r * (r1 * 0.4 + 0.6) * math.cos(theta1) + local t1y = r * (r1 * 0.4 + 0.6) * math.sin(theta1) + local t2x = r * (r2 * 0.4 + 0.6) * math.cos(theta2) + local t2y = r * (r2 * 0.4 + 0.6) * math.sin(theta2) + + return blend(t1x, t2x, s), -blend(t1y, t2y, s) +end + + +function DrawSun() + local n = 150 + local TWOPI = 2 * math.pi + gl.BeginEnd(GL.TRIANGLE_STRIP, function() + gl.Normal(0, -1, 0); + local i = 0 + while (i <= n) do + local theta = i * TWOPI / n; + local r = 0.8 + + if (theta == TWOPI) then + gl.Normal(0, 0, -1); + gl.Vertex(r * 0.5 * math.cos(math.pi - (theta - math.pi)), 1.15, -r * 0.5 * math.sin(math.pi - (theta - math.pi))); + gl.Vertex(r * 0.5 * math.cos(math.pi - (theta - math.pi)), 0.80, -r * 0.5 * math.sin(math.pi - (theta - math.pi))); + end + + if (theta <= math.pi)or(theta == TWOPI) then + local vx, vy = GetSunVertex(r, theta) + + --gl.Color(s, 0, 0, 1); + if (theta == TWOPI)or(theta == math.pi) then + gl.Normal(0, 0, -1); + else + local vxp1, vyp1 = GetSunVertex(r, theta + 0.0001 * math.pi) + local vxm1, vym1 = GetSunVertex(r, theta - 0.0001 * math.pi) + local nxp1,nyp1,nzp1 = CalcNormal(vxp1,0,vyp1, vx,0,vy, vx,1,vy); + local nxm1,nym1,nzm1 = CalcNormal(vxm1,0,vym1, vx,1,vy, vx,0,vy); + local nx,ny,nz = nxp1 + nxm1, nyp1 + nym1, nzp1 + nzm1 + gl.Normal(nx,ny,nz); + end + gl.Vertex(vx, 1.15, vy); + gl.Vertex(vx, 0.80, vy); + end + + if (theta >= math.pi)and(theta ~= TWOPI) then + if (theta == math.pi) then + gl.Normal(0, 0, -1); + else + gl.Normal(math.cos(theta), 0, math.sin(theta)); + end + gl.Vertex(r * 0.5 * math.cos(math.pi - (theta - math.pi)), 1.15, -r * 0.5 * math.sin(math.pi - (theta - math.pi))); + gl.Vertex(r * 0.5 * math.cos(math.pi - (theta - math.pi)), 0.80, -r * 0.5 * math.sin(math.pi - (theta - math.pi))); + end + + i = i + 1 + end + end) + + gl.BeginEnd(GL.TRIANGLE_STRIP, function() + gl.Normal(0, -1, 0); + + local i = 0 + while (i <= n/2) do + local theta = i * TWOPI / n; + local r = 0.8 + + if (theta <= math.pi) then + local vx, vy = GetSunVertex(r, theta) + gl.Vertex(vx, 1.15, vy); + end + + gl.Vertex(r * 0.5 * math.cos(theta), 1.15, -r * 0.5 * math.sin(theta)); + i = i + 1 + end + end) +end + + + +local cube_dl + + +function DrawLogo() + if (cube_dl) then + gl.CallList(cube_dl) + return + end + + cube_dl = gl.CreateList(function() + gl.PushMatrix() + gl.SecondaryColor(0, 0, 0) --// shiness + local b = 1.0 + gl.Color(b*18/255, b*30/255, b*80/255, 1) + CreateSuperEllipse(0.16, 0.16, 50) + + gl.Translate(0, 0.17, 0) + gl.Scale(0.85,0.85,0.85) + gl.Color(112/255, 32/255, 24/255, 1) + CreateSuperEllipse(0.09, 0.09, 50) + + gl.Culling(false) + + --gl.Translate(0, -0.14, 0.22) + gl.Translate(0, -0.097, 0.22) + local t = 0.3 + gl.Color(1*t, 1*t, 0.7*t, 1) + t = 1.00 + gl.SecondaryColor(1*t, 1*t, 0.45*t) + DrawSun() + gl.SecondaryColor(1, 1, 1) + gl.PopMatrix() + end) +end + + + + +function addon.DrawLoadScreen() + local loadProgress = SG.GetLoadProgress() + + --b = math.min(b + 0.0005, 1.0) + a = (a + 0.001) + b = math.sin(a) * 20.0 + --b = math.sin(a) * 180.0 + + local vsx, vsy = gl.GetViewSizes() + + gl.MatrixMode(GL.PROJECTION) + gl.PushMatrix() + gl.LoadIdentity() + local fH = math.tan( 45 / 360 * math.pi ) * 1; + local fW = fH * (vsx/vsy); + gl.Frustum(-fW, fW, -fH, fH, 1, 5) + + gl.MatrixMode(GL.MODELVIEW) + gl.PushMatrix() + gl.LoadIdentity() + + gl.Translate(0,0,-2) + gl.Scale(1/3,1/3,1/3) + + --gl.MatrixMode(GL.TEXTURE) + --gl.LoadIdentity() + + gl.Rotate((b*0.1)+10, 1,0,0) + gl.Rotate(b+5, 0,1,0) + gl.Rotate(90, 1,0,0) + + --Note, lightPos is automatically multiplied with _current_ ModelViewMatrix!!! + gl.Light(0, GL.POSITION, -4, 4, -4, 1) + gl.Light(1, GL.POSITION, -0.25, 2, -0.6, 1) + gl.Light(2, GL.POSITION, -20, 1, -15, 1) + gl.Light(3, GL.POSITION, 0, 0, 0, 1) + gl.Light(4, GL.POSITION, 0, 0, 1, 0) + + gl.UseShader(shader) + gl.Culling(GL.FRONT) + gl.DepthTest(true) + gl.DepthMask(true) + + gl.FogCoord(1) + DrawLogo() + + gl.FogCoord(-1) + gl.Translate(0,0,2) + gl.Culling(GL.BACK) + gl.Scale(1,1,-1) + DrawLogo() + + gl.DepthTest(false) + gl.UseShader(0) + gl.MatrixMode(GL.PROJECTION) + gl.PopMatrix() + gl.MatrixMode(GL.MODELVIEW) + gl.PopMatrix() +end diff --git a/LuaIntro/Addons/bg_texture.lua b/LuaIntro/Addons/bg_texture.lua new file mode 100644 index 000000000..33fee7aeb --- /dev/null +++ b/LuaIntro/Addons/bg_texture.lua @@ -0,0 +1,55 @@ + +if addon.InGetInfo then + return { + name = "LoadTexture", + desc = "", + author = "jK", + date = "2012", + license = "GPL2", + layer = 2, + depend = {"LoadProgress"}, + enabled = true, + } +end + +------------------------------------------ +math.randomseed(os.time()) +local loadscreens = VFS.DirList("bitmaps/loadpictures/") +local backgroundTexture = loadscreens[ math.random(#loadscreens) ] +local aspectRatio + + +function addon.DrawLoadScreen() + local loadProgress = SG.GetLoadProgress() + + if not aspectRatio then + local texInfo = gl.TextureInfo(backgroundTexture) + if not texInfo then return end + aspectRatio = texInfo.xsize / texInfo.ysize + end + + local vsx, vsy = gl.GetViewSizes() + local screenAspectRatio = vsx / vsy + + local xDiv = 0 + local yDiv = 0 + local ratioComp = screenAspectRatio / aspectRatio + + if (ratioComp > 1) then + xDiv = (1 - (1 / ratioComp)) * 0.5; + elseif (math.abs(ratioComp - 1) < 0) then + else + yDiv = (1 - ratioComp) * 0.5; + end + + -- background + --fade in: gl.Color(1,1,1,1 - (1 - loadProgress)^5) + gl.Color(1,1,1,1) + gl.Texture(backgroundTexture) + gl.TexRect(0+xDiv,0+yDiv,1-xDiv,1-yDiv) + gl.Texture(false) +end + +function addon.Shutdown() + gl.DeleteTexture(backgroundTexture) +end diff --git a/LuaIntro/Addons/main.lua b/LuaIntro/Addons/main.lua index 08386bb20..93ce6e62c 100644 --- a/LuaIntro/Addons/main.lua +++ b/LuaIntro/Addons/main.lua @@ -1,209 +1,396 @@ + if addon.InGetInfo then return { - name = "LoadScreen", - desc = "", - author = "Smoth", - date = "2013", - license = "PD", + name = "Main", + desc = "displays a simplae loadbar", + author = "jK", + date = "2012,2013", + license = "GPL2", layer = 0, + depend = {"LoadProgress"}, enabled = true, } end +local defaultFont = 'JosefinSans-SemiBold.ttf' +local fontfile = 'luaui/fonts/'..Spring.GetConfigString("ui_font", defaultFont) +if not VFS.FileExists(fontfile) then + Spring.SetConfigString('ui_font', defaultFont) + fontfile = 'luaui/fonts/'..defaultFont +end +local defaultFont2 = 'JosefinSans-Bold.ttf' +local fontfile2 = 'luaui/fonts/'..Spring.GetConfigString("ui_font2", defaultFont2) +if not VFS.FileExists(fontfile2) then + Spring.SetConfigString('ui_font2', defaultFont2) + fontfile2 = 'luaui/fonts/'..defaultFont2 +end ------------------------------------------ + +local showTips = true +if (Spring.GetConfigInt("LoadscreenTips",1) or 1) == 0 then + showTips = false +end + +local lastLoadMessage = "" + +function addon.LoadProgress(message, replaceLastLine) + lastLoadMessage = message +end + ------------------------------------------ --- load configurations -local loadScreenSettings = "gamedata/configs/loadscreens.lua" -local loadscreens = VFS.FileExists(loadScreenSettings) and VFS.Include(loadScreenSettings) - --- for random selection -local loadScreenCount = #loadscreens -local currentSelection = 0 - --- defaults -local toolsettings = { - tipText = "text", - tipTextColor = {1.0,1.0,1.0,1.0}, - tipWindowColor = {0.0,0.0,0.0,0.0}, - tipWindowWidth = "40%", - tipImage = "", - tipFontSize = 25, - toolAlign = "center", - mapHeight = "80%", - mapWidth = "100%", - mapfontSize = 25, - fontShadow = true, - outlineColor = {0,0,0,1}, - backgroundImage1 = "", - backgroundImage2 = "", - backgroundColor = {1.0,1.0,1.0,1.0}, - } - -function addon.Initialize() - - Spring.Echo(os.time()) - local waffles = math.fmod (os.time(),100) - for i=0, waffles do - currentSelection = math.random(1,loadScreenCount) - - Spring.Echo(waffles, "currentSelection", currentSelection) - end +-- Random tips we can show +local titleColor = "\255\215\255\215" +local contentColor = "\255\255\255\255" +local tips = { - for k,v in pairs(loadscreens[currentSelection])do - toolsettings[k] = v - Spring.Echo(k,v) - end + -- Zopto + "loadingpics/theenigmatng.png "..titleColor.."The Enigma TNG\n"..contentColor.."He is the creator of most of the music in the game, so go check him out!", + + -- Suppy Boi + + + -- Damgam + "loadingpics/dreamstatelogic.png "..titleColor.."Dreamstate Logic\n"..contentColor.."Composer of a many ambient tracks used ingame, check out his music on Soundcloud!", + "Press Enter to Chat, Use Alt+Enter to Team Chat, Use Ctrl+Enter to Global Chat", + + -- Koyote - local Chili = SG.Chili +} - if (not Chili) then - addon.Remove() - return - end +-- Random unit descriptions we can show +local titleColor = "\255\215\255\215" +local contentColor = "\255\255\255\255" +local unit_descs = { + + "elightturret2.png "..titleColor.."Pincushion\n"..contentColor.."Only you can prevent tech rushes (by building a Pincushion in your base)!", + "ehbotpeewee.png "..titleColor.."A.K. (H-Bot Raider)\n"..contentColor.."H-Bots can traverse any terrain, but they have two giant weaknesses... They are terrible in close quarter combat, and they are extremely vulnerable to artillery. Use cloaked All-Terrains to get in close, or use artillery to zone them out.", + "elighttank3.png "..titleColor.."Kite (Hovertank Raider)\n"..contentColor.."Hovertanks are all around good units with a lot of excellent variety, however, they lack some of the more specialized abilities of the other techs.", + "eallterrlight.png "..titleColor.."Recluse (All-Terrain Raider)\n"..contentColor.."All-Terrains have some of the most specialized units in the game. All All-Terrain units can cloak. Cloaking is ESSENTIAL to ensure that your units get the first shot. This can be the difference between winning or losing a battle.", + "eamphibbuggy.png "..titleColor.."Snake (Amphibious Raider\n"..contentColor.."Amphibious units are fast (even faster underwater!), extremely high damage, but suffer in terms of armor and range. Use them to hit fast and hard. Then back away before your opponent can do any real damage and hit is undefended flank!", + "emetalextractor.png "..titleColor.."Metal Extractor\n"..contentColor.."Make sure to evolve your Metal Extractors so that you can continually increase your income", + "esolar2.png "..titleColor.."Fission Energy Generator\n"..contentColor.."Make sure to keep building energy production as your tech progresses. At each tech, the energy cost for units and buildings increases.", + + -- Zopto + "ecommander.png "..titleColor.."Overseer\n"..contentColor.."Don't forget to evolve your overseer, different upgrades can be helpful!", + "ehbotpeewee.png "..titleColor.."H-Bots\n"..contentColor.."While h-bots have long range, no h-bot units are armored.", + "eallterrlight.png "..titleColor.."All Terrain Units\n"..contentColor.."Despite the designation 'All-terrain', All-Terrain units cannot traverse deep water.", + "emetalextractor.png "..titleColor.."Metal\n"..contentColor.."Don't forget to evolve your metal extractors to get more metal!", + "estorage.png "..titleColor.."Supply\n"..contentColor.."In order to increase your army supply cap, build more supply depots.", + "ehbotengineer.png "..titleColor.."Lifter\n"..contentColor.."Just like normal h-bots, the lifter can deploy as well.", + "eorb.png "..titleColor.."O.R.B.\n"..contentColor.."If you have a surplus of metal and can't find a way to use it, evolve your orbs or build more of them.", + "ebasefactory.png "..titleColor.."Factories\n"..contentColor.."Evolve your factories, upgraded units will give you the upper hand in battle.", + "ekrow.png "..titleColor.."Endbringers\n"..contentColor.."While Endbringers are strong, don't send them out on their own to fight entire armies.", + "eartyturret.png "..titleColor.."Lobster\n"..contentColor.."If you really want to make your opponent hate you, evolve the lobster.", + "eallterrshield.png "..titleColor.."Widow\n"..contentColor.."Even though widows have a shield, don't expect them to soak up all the damage for you.", + "emine.png "..titleColor.."Mines\n"..contentColor.."In the early game, mines can be used as a simple and cheap defense.", + "eshieldgen.png "..titleColor.."Anti-Nuke\n"..contentColor.."Don't forget to build an anti-nuke platform before it's too late.", + "esilo.png "..titleColor.."Nuke Silo\n"..contentColor.."Remember that if a nuclear missile silo is destroyed, the nuclear core inside it will detonate as well. Take care to place them well away from anything important.", - local img_background1 = Chili.Image:New{ - name = "pl_backgroundimage1"; - parent = Chili.Screen0; - file = toolsettings["backgroundImage1"]; - y = "0%"; - x = "0%", - height = "100%"; - width = "100%"; - keepAspect = false; - } + -- Suppy Boi + "eartytank.png "..titleColor.."Artillery\n"..contentColor.."Always try to include some of artillery units into your army. The sight distance can be a huge help.", + "eartytank.png "..titleColor.."Artillery\n"..contentColor.."Try to keep your artillery behind your main battle tanks.", + "emetalextractor.png "..titleColor.."Metal\n"..contentColor.."Evolved metal extractors use energy, so when evolving to a higher tier, be sure to plan ahead for the increased energy consumption.", + "eamphibmedtank.png "..titleColor.."Amphibious Units\n"..contentColor.."While Amphibious units are fast, nimble, and deal great damage, this comes at the cost of having little to no armor.", +} + +local quotes = { + {"Zopto is to lol as carbon is to life", "Dr.Hamster"}, + {"Build 1 more Mex than the other guy.", "KoyoteKamper"}, + {"...As Chobby will come after Half Life 3...", "Damgam"}, + {"Damgam: Can you remind me why we disabled Communism?\n Forboding Angel: Because people don't like to share? lol xD\n Damgam: Tfw my question and your answer works for both ingame communism and real communism", "Damgam & Forboding Angel"}, - local img_background2 = Chili.Image:New{ - name = "pl_backgroundimage2"; - parent = Chili.Screen0; - file = toolsettings["backgroundImage2"]; - y = "0%"; - x = "0%", - height = "100%"; - width = "100%"; - } - - local wnd_background = Chili.Window:New{ - name = "pl_background", - parent = Chili.Screen0; - y = "0%"; - width = "100%"; - height = "100%"; - draggable = false; - resizable = false; - color = toolsettings["backgroundColor"]; - padding = {0,0,0,0}; - } +} + + +-- Since math.random is not random and always the same, we save a counter to a file and use that. +filename = "LuaUI/Config/randomseed.data" +k = os.time() % 1500 +if VFS.FileExists(filename) then + k = VFS.LoadFile(filename) +end +k = tonumber(k) + 1 +local file = assert(io.open(filename,'w'), "Unable to save latest randomseed from "..filename) + file:write(k) + file:close() +file = nil + +local random_tip_or_desc = unit_descs[((k/2) % #unit_descs) + 1] +if k%2 == 1 then + random_tip_or_desc = tips[((math.ceil(k/2)) % #tips) + 1] +elseif k%3 == 2 then + random_tip_or_desc = quotes[((math.ceil(k/3)) % #quotes) + 1] +end + +local loadedFontSize = 70 +local font = gl.LoadFont(fontfile, 70, 22, 1.15) + +local engineVersion = 100 -- just filled this in here incorrectly but old engines arent used anyway +if Engine and Engine.version then + local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results + end + engineVersion = Split(Engine.version, '-') + if engineVersion[2] ~= nil and engineVersion[3] ~= nil then + engineVersion = tonumber(string.gsub(engineVersion[1], '%.', '')..engineVersion[2]) + else + engineVersion = tonumber(Engine.version) + end +elseif Game and Game.version then + engineVersion = tonumber(Game.version) +end + +function DrawRectRound(px,py,sx,sy,cs) + + --local csx = cs + --local csy = cs + --if sx-px < (cs*2) then + -- csx = (sx-px)/2 + -- if csx < 0 then csx = 0 end + --end + --if sy-py < (cs*2) then + -- csy = (sy-py)/2 + -- if csy < 0 then csy = 0 end + --end + --cs = math.min(cs, csy) + + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) - local wnd_minimap = Chili.Window:New{ - name = "pl_window", - parent = Chili.Screen0; - y = "0%"; - width = "30%"; - height = "40%"; - draggable = false; - resizable = false; - color = {1,1,1,0}; - children = { - Chili.Label:New{ - caption = "Current Map:\n" .. Game.mapName; - fontSize = toolsettings["mapfontSize"]; - fontShadow = toolsettings["fontShadow"]; - textColor = toolsettings["tipTextColor"]; - font = { - outlineColor = toolsettings["outlineColor"]; - }; - autosize = false; - height = "20%"; - width = "100%"; - valign = "top"; - }, - Chili.Image:New{ - file = "$minimap"; - y = "20%"; - x = "0%", - height = toolsettings["mapHeight"]; - width = toolsettings["mapWidth"]; - }, - } - } + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) - local wnd_tip = Chili.Window:New{ - name = "tooltip picture"; - parent = Chili.Screen0; - x = "30%"; - y = "00%"; - width = "70%"; - height = "100%"; - --autosize = true; - draggable = false; - resizable = false; - color = {1,1,1,0}; - children = { - Chili.Image:New{ - file = toolsettings["tipImage"]; - x = "0%"; - height = "80%"; - width = "100%"; - }, - } - } + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset - local wnd_image = Chili.Window:New{ - name = "tooltip"; - parent = Chili.Screen0; - x = "5%"; - y = "40%"; - width = toolsettings["tipWindowWidth"]; - height = "50%"; - --autosize = true; - draggable = false; - resizable = false; - valign = "top"; - color = toolsettings["tipWindowColor"]; - children = { - Chili.Label:New{ - caption = toolsettings["tipText"]; - fontSize = toolsettings["tipFontSize"]; - fontShadow = toolsettings["fontShadow"]; - outline = true, - textColor = toolsettings["tipTextColor"]; - font = { - outlineColor = toolsettings["outlineColor"]; - }; - autosize = false; - height = "100%"; - width = "100%"; - }, - } - } + -- top left + --if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- top right + --if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + --if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + --if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + --local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) - bar_loading = Chili.Progressbar:New{ - parent = wnd_background; - color = {1.0,0.0,0.0,0.6}; - backgroundColor = toolsettings["tipTextColor"]; - - height = "5%"; - width = "80%"; - x = "10%"; - y = "85%"; - fontsize = 25; - -- skinName = "Gtechbar"; - } - img_background1:SetLayer(9001) - img_background1:SetLayer(9000) + gl.Texture(":n:luaui/Images/bgcorner.png") + --gl.Texture(":n:luaui/Images/bgcorner.png") + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +function gradienth(px,py,sx,sy, c1,c2) + gl.Color(c1) + gl.Vertex(sx, sy, 0) + gl.Vertex(sx, py, 0) + gl.Color(c2) + gl.Vertex(px, py, 0) + gl.Vertex(px, sy, 0) +end + + +local lastLoadMessage = "" +local lastProgress = {0, 0} + +local progressByLastLine = { + ["Parsing Map Information"] = {0, 20}, + ["Loading Weapon Definitions"] = {10, 50}, + ["Loading LuaRules"] = {40, 80}, + ["Loading LuaUI"] = {70, 95}, + ["Finalizing"] = {100, 100} +} +for name,val in pairs(progressByLastLine) do + progressByLastLine[name] = {val[1]*0.01, val[2]*0.01} +end + +function addon.LoadProgress(message, replaceLastLine) + lastLoadMessage = message + if message:find("Path") then -- pathing has no rigid messages so cant use the table + lastProgress = {0.8, 1.0} + end + lastProgress = progressByLastLine[message] or lastProgress end function addon.DrawLoadScreen() - local progress = SG.GetLoadProgress() - - bar_loading:SetValue(progress*100) - if progress* 100 == 100 then - bar_loading:SetCaption("Loaded! Game starting shortly...") + local loadProgress = SG.GetLoadProgress() + if loadProgress == 0 then + loadProgress = lastProgress[1] else - bar_loading:SetCaption("Loading") + loadProgress = math.min(math.max(loadProgress, lastProgress[1]), lastProgress[2]) + end + + local vsx, vsy = gl.GetViewSizes() + + -- draw progressbar + local hbw = 3.5/vsx + local vbw = 3.5/vsy + local hsw = 0.2 + local vsw = 0.2 + local yPos = 0.125 --0.054 + local yPosTips = yPos + 0.1245 + local loadvalue = 0.2 + (math.max(0, loadProgress) * 0.6) + + if not showTips then + yPos = 0.165 + yPosTips = yPos + end + + --bar bg + local paddingH = 0.004 + local paddingW = paddingH * (vsy/vsx) + gl.Color(0.085,0.085,0.085,0.925) + RectRound(0.2-paddingW,yPos-0.05-paddingH,0.8+paddingW,yPosTips+paddingH,0.007) + + gl.Color(0,0,0,0.75) + RectRound(0.2-paddingW,yPos-0.05-paddingH,0.8+paddingW,yPos+paddingH,0.007) + + if loadvalue > 0.215 then + -- loadvalue + gl.Color(0.4-(loadProgress/7),loadProgress*0.4,0,0.4) + RectRound(0.2,yPos-0.05,loadvalue,yPos,0.0055) + + -- loadvalue gradient + gl.Texture(false) + gl.BeginEnd(GL.QUADS, gradienth, 0.2,yPos-0.05,loadvalue,yPos, {1-(loadProgress/3)+0.2,loadProgress+0.2,0+0.08,0.14}, {0,0,0,0.14}) + + -- loadvalue inner glow + gl.Color(1-(loadProgress/3.5)+0.15,loadProgress+0.15,0+0.05,0.04) + gl.Texture(":n:luaui/Images/barglow-center.png") + gl.TexRect(0.2,yPos-0.05,loadvalue,yPos) + + -- loadvalue glow + local glowSize = 0.06 + gl.Color(1-(loadProgress/3)+0.15,loadProgress+0.15,0+0.05,0.1) + gl.Texture(":n:luaui/Images/barglow-center.png") + gl.TexRect(0.2, yPos-0.05-glowSize, loadvalue, yPos+glowSize) + + gl.Texture(":n:luaui/Images/barglow-edge.png") + gl.TexRect(0.2-(glowSize*1.3), yPos-0.05-glowSize, 0.2, yPos+glowSize) + gl.TexRect(loadvalue+(glowSize*1.3), yPos-0.05-glowSize, loadvalue, yPos+glowSize) + end + + -- progressbar text + gl.PushMatrix() + gl.Scale(1/vsx,1/vsy,1) + local barTextSize = vsy * 0.026 + + --font:Print(lastLoadMessage, vsx * 0.5, vsy * 0.3, 50, "sc") + --font:Print(Game.gameName, vsx * 0.5, vsy * 0.95, vsy * 0.07, "sca") + font:Print(lastLoadMessage, vsx * 0.21, vsy * (yPos-0.017), barTextSize * 0.67, "oa") + if loadProgress>0 then + font:Print(("%.0f%%"):format(loadProgress * 100), vsx * 0.5, vsy * (yPos-0.0325), barTextSize, "oc") + else + font:Print("Loading...", vsx * 0.5, vsy * (yPos-0.031), barTextSize, "oc") + end + gl.PopMatrix() + + + if showTips then + -- In this format, there can be an optional image before the tip/description. + -- Any image ends in .dss, so if such a text piece is found, we extract that and show it as an image. + local text_to_show = random_tip_or_desc + yPos = yPosTips + if random_tip_or_desc[2] then + text_to_show = random_tip_or_desc[1] + else + i, j = string.find(random_tip_or_desc, ".png") + end + local numLines = 1 + local image_text = nil + local fontSize = barTextSize * 0.77 + local image_size = 0.0485 + local height = 0.123 + + if i ~= nil then + text_to_show = string.sub(text_to_show, j+2) + local maxWidth = ((0.58-image_size-0.012) * vsx) * (loadedFontSize/fontSize) + text_to_show, numLines = font:WrapText(text_to_show, maxWidth) + else + local maxWidth = (0.585 * vsx) * (loadedFontSize/fontSize) + text_to_show, numLines = font:WrapText(text_to_show, maxWidth) + end + + -- Tip/unit description + -- Background + --gl.Color(1,1,1,0.033) + --RectRound(0.2,yPos-height,0.8,yPos,0.005) + + -- Text + gl.PushMatrix() + gl.Scale(1/vsx,1/vsy,1) + + if i ~= nil then + image_text = string.sub(random_tip_or_desc, 0, j) + gl.Texture(":n:unitpics/" .. image_text) + gl.Color(1.0,1.0,1.0,0.8) + gl.TexRect(vsx * 0.21, (vsy*(yPos-0.015))-(vsx*image_size), vsx*(0.21+image_size), vsy*(yPos-0.015),false,false) + font:Print(text_to_show, vsx * (0.21+image_size+0.012) , vsy * (yPos-0.0175), fontSize, "oa") + else + font:Print(text_to_show, vsx * 0.21, vsy * (yPos-0.0175), fontSize, "oa") + end + + if random_tip_or_desc[2] then + font:Print('\255\255\222\155'..random_tip_or_desc[2], vsx * 0.79, (vsy * ((yPos-0.0175)-height)) +(fontSize*2.66) , fontSize, "oar") + end + gl.PopMatrix() end end + +function addon.MousePress(...) + --Spring.Echo(...) +end + + function addon.Shutdown() + gl.DeleteFont(font) end \ No newline at end of file diff --git a/LuaIntro/Addons/music.lua b/LuaIntro/Addons/music.lua new file mode 100644 index 000000000..3fd5cf5fb --- /dev/null +++ b/LuaIntro/Addons/music.lua @@ -0,0 +1,42 @@ + +if addon.InGetInfo then + return { + name = "Music", + desc = "plays music", + author = "jK", + date = "2012,2013", + license = "GPL2", + layer = 0, + depend = {"LoadProgress"}, + enabled = true, + } +end + +------------------------------------------ +math.randomseed( os.time() - os.clock() * 1000 ) +math.random() math.random() math.random() +local music_volume_set = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 or 0.2 +Spring.SetSoundStreamVolume(music_volume_set) +local r = math.random(0,2) + +if r == 0 then + musicfiles = VFS.DirList("LuaUI/Widgets_Evo/Music/loading", "*.ogg") +else + musicfiles = VFS.DirList("LuaUI/Widgets_Evo/Music/war", "*.ogg") +end + +if (#musicfiles > 0) then + Spring.PlaySoundStream(musicfiles[math.random(1,#musicfiles)], music_volume_set) + Spring.SetSoundStreamVolume(music_volume_set) +end + + +--function addon.DrawLoadScreen() + --Spring.SetSoundStreamVolume(100) +--end + + +function addon.Shutdown() + --Spring.StopSoundStream() + --Spring.SetSoundStreamVolume(0.5) +end diff --git a/LuaIntro/chili/README b/LuaIntro/chili/README deleted file mode 100644 index 65d49808d..000000000 --- a/LuaIntro/chili/README +++ /dev/null @@ -1,3 +0,0 @@ -Chili GUI - -A lua written GUI for Spring. diff --git a/LuaIntro/chili/api_chili.lua b/LuaIntro/chili/api_chili.lua deleted file mode 100644 index cf8d63830..000000000 --- a/LuaIntro/chili/api_chili.lua +++ /dev/null @@ -1,192 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Chili Framework", - desc = "Hot GUI Framework", - author = "jK", - date = "WIP", - license = "GPLv2", - version = "2.1", - layer = -1000, - enabled = true, -- loaded by default? - handler = true, - api = true, - hidden = true, - } -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Chili -local screen0 -local th -local tk -local tf - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Chili's location - -local function GetDirectory(filepath) - return filepath and filepath:gsub("(.*/)(.*)", "%1") -end - -assert(debug) -local source = debug and debug.getinfo(1).source -local DIR = GetDirectory(source) or ((LUA_DIRNAME or LUAUI_DIRNAME) .."Widgets/") -CHILI_DIRNAME = DIR .. "chili/" - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - Chili = VFS.Include(CHILI_DIRNAME .. "core.lua", nil, VFS.RAW_FIRST) - - screen0 = Chili.Screen:New{} - th = Chili.TextureHandler - tk = Chili.TaskHandler - tf = Chili.FontHandler - - --// Export Widget Globals - WG.Chili = Chili - WG.Chili.Screen0 = screen0 - - --// do this after the export to the WG table! - --// because other widgets use it with `parent=Chili.Screen0`, - --// but chili itself doesn't handle wrapped tables correctly (yet) - screen0 = Chili.DebugHandler.SafeWrap(screen0) -end - -function widget:Shutdown() - --table.clear(Chili) the Chili table also is the global of the widget so it contains a lot more than chili's controls (pairs,select,...) - WG.Chili = nil -end - -function widget:Dispose() - screen0:Dispose() -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:DrawScreen() - gl.Color(1,1,1,1) - if (not screen0:IsEmpty()) then - gl.PushMatrix() - local vsx,vsy = gl.GetViewSizes() - gl.Translate(0,vsy,0) - gl.Scale(1,-1,1) - screen0:Draw() - gl.PopMatrix() - end - gl.Color(1,1,1,1) -end - - -function widget:DrawLoadScreen() - gl.Color(1,1,1,1) - if (not screen0:IsEmpty()) then - gl.PushMatrix() - local vsx,vsy = gl.GetViewSizes() - gl.Scale(1/vsx,1/vsy,1) - gl.Translate(0,vsy,0) - gl.Scale(1,-1,1) - screen0:Draw() - gl.PopMatrix() - end - gl.Color(1,1,1,1) -end - - -function widget:TweakDrawScreen() - gl.Color(1,1,1,1) - if (not screen0:IsEmpty()) then - gl.PushMatrix() - local vsx,vsy = gl.GetViewSizes() - gl.Translate(0,vsy,0) - gl.Scale(1,-1,1) - screen0:TweakDraw() - gl.PopMatrix() - end - gl.Color(1,1,1,1) -end - - -function widget:DrawGenesis() - gl.Color(1,1,1,1) - tf.Update() - th.Update() - tk.Update() - gl.Color(1,1,1,1) -end - - -function widget:IsAbove(x,y) - return screen0:IsAbove(x,y) -end - - -local mods = {} -function widget:MousePress(x,y,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; - - return screen0:MouseDown(x,y,button,mods) -end - - -function widget:MouseRelease(x,y,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; - - return screen0:MouseUp(x,y,button,mods) -end - - -function widget:MouseMove(x,y,dx,dy,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; - - return screen0:MouseMove(x,y,dx,dy,button,mods) -end - - -function widget:MouseWheel(up,value) - local x,y = Spring.GetMouseState() - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; - - return screen0:MouseWheel(x,y,up,value,mods) -end - - -local keyPressed = true -function widget:KeyPress(key, mods, isRepeat, label, unicode) - keyPressed = screen0:KeyPress(key, mods, isRepeat, label, unicode) - return keyPressed -end - - -function widget:KeyRelease() - local _keyPressed = keyPressed - keyPressed = false - return _keyPressed -- block engine actions when we processed it -end - - -function widget:ViewResize(vsx, vsy) - screen0:Resize(vsx, vsy) -end - -widget.TweakIsAbove = widget.IsAbove -widget.TweakMousePress = widget.MousePress -widget.TweakMouseRelease = widget.MouseRelease -widget.TweakMouseMove = widget.MouseMove -widget.TweakMouseWheel = widget.MouseWheel - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaIntro/chili/chili/README b/LuaIntro/chili/chili/README deleted file mode 100644 index 3942fc40d..000000000 --- a/LuaIntro/chili/chili/README +++ /dev/null @@ -1,20 +0,0 @@ -object -|_screen -|_control - |_window - |_button - |_image - |_checkbox - |_label - |_textbox - |_trackbar - |_colorbars - - |_scrollpanel - - |_selectionbox - - |_layoutpanel - |_imagelistview - |_grid - |_stackpanel \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/README b/LuaIntro/chili/chili/controls/README deleted file mode 100644 index 1aac8414a..000000000 --- a/LuaIntro/chili/chili/controls/README +++ /dev/null @@ -1,22 +0,0 @@ -object -|_font -|_screen -|_control - |_button - |_image - |_checkbox - |_colorbars - |_label - |_layoutpanel - |_imagelistview - |_grid - |_stackpanel - |_treeview - |_panel - |_progressbar - |_scrollpanel - |_textbox - |_trackbar - |_treeview - (|_treeviewnode) - |_window \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/button.lua b/LuaIntro/chili/chili/controls/button.lua deleted file mode 100644 index 769607fab..000000000 --- a/LuaIntro/chili/chili/controls/button.lua +++ /dev/null @@ -1,49 +0,0 @@ ---//============================================================================= - -Button = Control:Inherit{ - classname= "button", - caption = 'button', - defaultWidth = 70, - defaultHeight = 20, -} - -local this = Button -local inherited = this.inherited - ---//============================================================================= - -function Button:SetCaption(caption) - if (self.caption == caption) then return end - self.caption = caption - self:Invalidate() -end - ---//============================================================================= - -function Button:DrawControl() - --// gets overriden by the skin/theme -end - ---//============================================================================= - -function Button:HitTest(x,y) - return self -end - -function Button:MouseDown(...) - self.state.pressed = true - inherited.MouseDown(self, ...) - self:Invalidate() - return self -end - -function Button:MouseUp(...) - if (self.state.pressed) then - self.state.pressed = false - inherited.MouseUp(self, ...) - self:Invalidate() - return self - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/checkbox.lua b/LuaIntro/chili/chili/controls/checkbox.lua deleted file mode 100644 index 174781a88..000000000 --- a/LuaIntro/chili/chili/controls/checkbox.lua +++ /dev/null @@ -1,56 +0,0 @@ ---//============================================================================= - -Checkbox = Control:Inherit{ - classname = "checkbox", - checked = true, - caption = "text", - textalign = "left", - boxalign = "right", - boxsize = 10, - - textColor = {0,0,0,1}, - - defaultWidth = 70, - defaultHeight = 18, - - OnChange = {} -} - -local this = Checkbox -local inherited = this.inherited - ---//============================================================================= - -function Checkbox:New(obj) - obj = inherited.New(self,obj) - obj.state.checked = obj.checked - return obj -end - ---//============================================================================= - -function Checkbox:Toggle() - self:CallListeners(self.OnChange,not self.checked) - self.checked = not self.checked - self.state.checked = self.checked - self:Invalidate() -end - ---//============================================================================= - -function Checkbox:DrawControl() - --// gets overriden by the skin/theme -end - ---//============================================================================= - -function Checkbox:HitTest() - return self -end - -function Checkbox:MouseDown() - self:Toggle() - return self -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/colorbars.lua b/LuaIntro/chili/chili/controls/colorbars.lua deleted file mode 100644 index 6cb890044..000000000 --- a/LuaIntro/chili/chili/controls/colorbars.lua +++ /dev/null @@ -1,94 +0,0 @@ ---//============================================================================= - -Colorbars = Control:Inherit{ - classname = "colorbars", - color = {1,1,1,1}, - - defaultWidth = 100, - defaultHeight = 20, - - OnChange = {}, -} - -local this = Colorbars -local inherited = this.inherited - ---//============================================================================= - -function Colorbars:SetColor(c) - self:CallListeners(self.OnChange,c) - self.value = c - self:Invalidate() -end - ---//============================================================================= - -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_LINES = GL.LINES -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glTranslate = gl.Translate -local glVertex = gl.Vertex -local glRect = gl.Rect -local glColor = gl.Color -local glBeginEnd = gl.BeginEnd - -function Colorbars:DrawControl() - local barswidth = self.width - (self.height + 4) - - local color = self.color - local step = self.height/7 - - --bars - local rX1,rY1,rX2,rY2 = 0,0*step,color[1]*barswidth,1*step - local gX1,gY1,gX2,gY2 = 0,2*step,color[2]*barswidth,3*step - local bX1,bY1,bX2,bY2 = 0,4*step,color[3]*barswidth,5*step - local aX1,aY1,aX2,aY2 = 0,6*step,(color[4] or 1)*barswidth,7*step - - glColor(1,0,0,1) - glRect(rX1,rY1,rX2,rY2) - - glColor(0,1,0,1) - glRect(gX1,gY1,gX2,gY2) - - glColor(0,0,1,1) - glRect(bX1,bY1,bX2,bY2) - - glColor(1,1,1,1) - glRect(aX1,aY1,aX2,aY2) - - glColor(self.color) - glRect(barswidth + 2,self.height,self.width - 2,0) - - gl.BeginEnd(GL.TRIANGLE_STRIP, theme.DrawBorder_, barswidth + 2,0,self.width - barswidth - 4,self.height, 1, self.borderColor, self.borderColor2) -end - ---//============================================================================= - -function Colorbars:HitTest() - return self -end - -function Colorbars:MouseDown(x,y) - local step = self.height/7 - local yp = y/step - local r = yp%2 - local barswidth = self.width - (self.height + 4) - - if (x<=barswidth)and(r<=1) then - local barIdx = (yp-r)/2 + 1 - local newvalue = x/barswidth - if (newvalue>1) then newvalue=1 elseif (newvalue<0) then newvalue=0 end - self.color[barIdx] = newvalue - self:SetColor(self.color) - return self - end -end - -function Colorbars:MouseMove(x,y,dx,dy,button) - if (button==1) then - return self:MouseDown(x,y) - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/combobox.lua b/LuaIntro/chili/chili/controls/combobox.lua deleted file mode 100644 index 894ec5055..000000000 --- a/LuaIntro/chili/chili/controls/combobox.lua +++ /dev/null @@ -1,117 +0,0 @@ ---//============================================================================= -ComboBox = Button:Inherit{ - classname = "combobox", - caption = 'combobox', - defaultWidth = 70, - defaultHeight = 20, - items = { "items" }, - selected = 1, - OnSelect = {}, -} - -local ComboBoxWindow = Window:Inherit{classname = "combobox_window", resizable = false, draggable = false, } -local ComboBoxScrollPanel = ScrollPanel:Inherit{classname = "combobox_scrollpanel", horizontalScrollBar = false, } -local ComboBoxStackPanel = StackPanel:Inherit{classname = "combobox_stackpanel", autosize = true, resizeItems = false, borderThickness = 0, padding = {0,0,0,0}, itemPadding = {0,0,0,0}, itemMargin = {0,0,0,0}, } -local ComboBoxItem = Button:Inherit{classname = "combobox_item"} - -local this = ComboBox -local inherited = this.inherited - -function ComboBox:New(obj) - obj = inherited.New(self,obj) - obj:Select(obj.selected or 1) - return obj -end - -function ComboBox:Select(itemIdx) - if (type(itemIdx)=="number") then - if not self.items[itemIdx] then - return - end - self.selected = itemIdx - self.caption = self.items[itemIdx] - self:CallListeners(self.OnSelect, itemIdx, true) - self:Invalidate() - end - --FIXME add Select(name) -end - -function ComboBox:_CloseWindow() - if self._dropDownWindow then - self._dropDownWindow:Dispose() - self._dropDownWindow = nil - end - if (self.state.pressed) then - self.state.pressed = false - self:Invalidate() - return self - end -end - -function ComboBox:FocusUpdate() - if not self.state.focused then - self:_CloseWindow() - end -end - -function ComboBox:MouseDown(...) - self.state.pressed = true - if not self._dropDownWindow then - local sx,sy = self:LocalToScreen(0,0) - - local labels = {} - local labelHeight = 20 - for i = 1, #self.items do - local newBtn = ComboBoxItem:New { - caption = self.items[i], - width = '100%', - height = labelHeight, - state = {focused = (i == self.selected), selected = (i == self.selected)}, - OnMouseUp = { function() - self:Select(i) - self:_CloseWindow() - end } - } - labels[#labels+1] = newBtn - end - - local height = math.min(200, labelHeight * #labels) - - local screen = self:FindParent("screen") - local y = sy + self.height - if y + height > screen.height then - y = sy - height - end - - self._dropDownWindow = ComboBoxWindow:New{ - parent = screen, - width = self.width, - height = height, - x = sx, - y = y, - children = { - ComboBoxScrollPanel:New{ - width = "100%", - height = "100%", - children = { - ComboBoxStackPanel:New{ - width = '100%', - children = labels, - }, - }, - } - } - } - else - self:_CloseWindow() - end - - self:Invalidate() - return self -end - -function ComboBox:MouseUp(...) - self:Invalidate() - return self - -- this exists to override Button:MouseUp so it doesn't modify .state.pressed -end diff --git a/LuaIntro/chili/chili/controls/control.lua b/LuaIntro/chili/chili/controls/control.lua deleted file mode 100644 index f0b362c14..000000000 --- a/LuaIntro/chili/chili/controls/control.lua +++ /dev/null @@ -1,1438 +0,0 @@ ---//============================================================================= - -Control = Object:Inherit{ - classname = 'control', - padding = {5, 5, 5, 5}, - borderThickness = 1.5, - borderColor = {1.0, 1.0, 1.0, 0.6}, - borderColor2 = {0.0, 0.0, 0.0, 0.8}, - backgroundColor = {0.8, 0.8, 1.0, 0.4}, - focusColor = {0.2, 0.2, 1.0, 0.6}, - - autosize = false, - savespace = true, --// iff autosize==true, it shrinks the control to the minimum needed space, if disabled autosize _normally_ only enlarges the control - resizeGripSize = {11, 11}, - dragGripSize = {10, 10}, - - dragUseGrip = false, - draggable = false, - resizable = false, - tweakDragUseGrip = false, - tweakDraggable = false, - tweakResizable = false, - - minWidth = 10, - minHeight = 10, - maxWidth = 1e9, - maxHeight = 1e9, - - fixedRatio = false, - tooltip = nil, --// JUST TEXT - - font = { - font = "FreeSansBold.otf", - size = 14, - shadow = false, - outline = false, - outlineWidth = 3, - outlineWeight = 3, - color = {1,1,1,1}, - outlineColor = {0,0,0,1}, - autoOutlineColor = true, - }, - - state = { - focused = false, - hovered = false, - checked = false, - selected = false, --FIXME implement - pressed = false, - enabled = true, --FIXME implement - }, - - skin = nil, - skinName = nil, - - drawcontrolv2 = nil, --// disable backward support with old DrawControl gl state (with 2.1 self.xy translation isn't needed anymore) - - OnResize = {}, -} - -local this = Control -local inherited = this.inherited - ---//============================================================================= - -function Control:New(obj) - --// backward compability - BackwardCompa(obj) - - if obj.DrawControl then - obj._hasCustomDrawControl = true - end - - --// load the skin for this control - obj.classname = self.classname - theme.LoadThemeDefaults(obj) - SkinHandler.LoadSkin(obj, self) - - --// we want to initialize the children ourself (see downwards) - local cn = obj.children - obj.children = nil - - obj = inherited.New(self,obj) - - if obj._hasCustomDrawControl then - if not obj.drawcontrolv2 then - local w = obj._widget or {whInfo = { name = "unknown" } } - local fmtStr = [[You are using a custom %s::DrawControl in widget "%s". - Please note that with Chili 2.1 the (self.x, self.y) translation is moved a level up and does not need to be done in DrawControl anymore. - When you adjusted your code set `drawcontrolv2 = true` in the respective control to disable this message.]] - Spring.Log("Chili", "warning", fmtStr:format(obj.name, w.whInfo.name)) - else - obj._hasCustomDrawControl = false - end - end - - local p = obj.padding - if (obj.clientWidth) then - obj.width = obj.clientWidth + p[1] + p[3] - end - if (obj.clientHeight) then - obj.height = obj.clientHeight + p[2] + p[4] - end - - --// create font - obj.font = Font:New(obj.font) - obj.font:SetParent(obj) - - obj:DetectRelativeBounds() - obj:AlignControl() - - --// add children after UpdateClientArea! (so relative width/height can be applied correctly) - if (cn) then - for i=1,#cn do - obj:AddChild(cn[i], true) - end - end - - return obj -end - - -function Control:Dispose(...) - gl.DeleteList(self._all_dlist) - self._all_dlist = nil - - gl.DeleteList(self._children_dlist) - self._children_dlist = nil - - gl.DeleteList(self._own_dlist) - self._own_dlist = nil - - gl.DeleteTexture(self._tex_all) - self._tex_all = nil - gl.DeleteTexture(self._tex_children) - self._tex_children = nil - - if gl.DeleteFBO then - gl.DeleteRBO(self._stencil_all) - self._stencil_all = nil - gl.DeleteRBO(self._stencil_children) - self._stencil_children = nil - gl.DeleteFBO(self._fbo_all) - self._fbo_all = nil - gl.DeleteFBO(self._fbo_children) - self._fbo_children = nil - end - - inherited.Dispose(self,...) - self.font:SetParent() -end - ---//============================================================================= - -function Control:SetParent(obj) - inherited.SetParent(self,obj) - self:RequestRealign() -end - -function Control:AddChild(obj, dontUpdate) - inherited.AddChild(self,obj) - if (not dontUpdate) then - self:RequestRealign() - end -end - -function Control:RemoveChild(obj) - local found = inherited.RemoveChild(self,obj) - if (found) then - self:RequestRealign() - end - return found -end - ---//============================================================================= - -function Control:_GetMaxChildConstraints(child) - return 0, 0, self.clientWidth, self.clientHeight -end - - -function Control:DetectRelativeBounds() - --// we need min 2 x-dim coords to define a rect! - local numconstraints = 0 - if (self.x) then - numconstraints = numconstraints + 1 - end - if (self.right) then - numconstraints = numconstraints + 1 - end - if (self.width) then - numconstraints = numconstraints + 1 - end - if (numconstraints<2) then - if (numconstraints==0) then - self.x = 0 - self.width = self.defaultWidth or 0 - else - if (self.width) then - self.x = 0 - else - self.width = self.defaultWidth or 0 - end - end - end - - --// we need min 2 y-dim coords to define a rect! - numconstraints = 0 - if (self.y) then - numconstraints = numconstraints + 1 - end - if (self.bottom) then - numconstraints = numconstraints + 1 - end - if (self.height) then - numconstraints = numconstraints + 1 - end - if (numconstraints<2) then - if (numconstraints==0) then - self.y = 0 - self.height = self.defaultHeight or 0 - else - if (self.height) then - self.y = 0 - else - self.height = self.defaultHeight or 0 - end - end - end - - --// check which constraints are relative - self._givenBounds = { - left = self.x, - top = self.y, - width = self.width, - height = self.height, - right = self.right, - bottom = self.bottom, - } - local rb = { - left = IsRelativeCoord(self.x) and self.x, - top = IsRelativeCoord(self.y) and self.y, - width = IsRelativeCoord(self.width) and self.width, - height = IsRelativeCoord(self.height) and self.height, - right = self.right, - bottom = self.bottom, - } - self._relativeBounds = rb - self._isRelative = (rb.left or rb.top or rb.width or rb.height or rb.right or rb.bottom)and(true) - - --// initialize relative constraints with 0 - self.x = ((not rb.left) and self.x) or 0 - self.y = ((not rb.top) and self.y) or 0 - self.width = ((not rb.width) and self.width) or 0 - self.height = ((not rb.height) and self.height) or 0 - --self.right = (type(self.right)=='number')and(self.right>0)and(self.right) or 0 - --self.bottom = (type(self.bottom)=='number')and(self.bottom>0)and(self.bottom) or 0 -end - - -function Control:GetRelativeBox(savespace) - local t = {self.x, self.y, self.width, self.height} - if (savespace) then - t = {0,0,self.minWidth,self.minHeight} - end - - if (not self._isRelative) then - return t - end - - local p = self.parent - if (not p) then - return t - end - - --// FIXME use pl & pt too!!! - local pl,pt,pw,ph = p:_GetMaxChildConstraints(self) - - local givBounds = self._givenBounds - local relBounds = self._relativeBounds - local left = self.x - local top = self.y - local width = (savespace and self.minWidth) or self.width - local height = (savespace and self.minHeight) or self.height - - --// ProcessRelativeCoord is defined in util.lua - if (relBounds.left) then - left = ProcessRelativeCoord(relBounds.left, pw) - end - if (relBounds.top) then - top = ProcessRelativeCoord(relBounds.top, ph) - end - if (relBounds.width) then - width = ProcessRelativeCoord(relBounds.width, pw) - end - if (relBounds.height) then - height = ProcessRelativeCoord(relBounds.height, ph) - end - - if (relBounds.right) then - if (not givBounds.left) then - left = pw - width - ProcessRelativeCoord(relBounds.right, pw) - else - width = pw - left - ProcessRelativeCoord(relBounds.right, pw) - end - end - if (relBounds.bottom) then - if (not givBounds.top) then - top = ph - height - ProcessRelativeCoord(relBounds.bottom, ph) - else - height = ph - top - ProcessRelativeCoord(relBounds.bottom, ph) - end - end - - return {left, top, width, height} -end - - ---//============================================================================= - -function Control:UpdateClientArea(dontRedraw) - local padding = self.padding - - self.clientWidth = self.width - padding[1] - padding[3] - self.clientHeight = self.height - padding[2] - padding[4] - - self.clientArea = { - padding[1], - padding[2], - self.clientWidth, - self.clientHeight - } - - if (self.parent)and(self.parent:InheritsFrom('control')) then - --FIXME sometimes this makes self:RequestRealign() redundant! try to reduce the Align() calls somehow - self.parent:RequestRealign() - end - if (self.width ~= self._oldwidth_uca)or(self.height ~= self._oldheight_uca) then - self:RequestRealign() - self._oldwidth_uca = self.width - self._oldheight_uca = self.height - end - - if not dontRedraw then self:Invalidate() end --FIXME only when RTT! - self:CallListeners(self.OnResize) --FIXME more arguments and filter unchanged resizes -end - - -function Control:AlignControl() - local newBox = self:GetRelativeBox() - self:_UpdateConstraints(newBox[1], newBox[2], newBox[3], newBox[4]) -end - - -function Control:RequestRealign(savespace) - if (not self._inRealign) then - self._realignRequested = true - self.__savespace = savespace - self:RequestUpdate() - end -end - - -function Control:DisableRealign() - self._realignDisabled = (self._realignDisabled or 0) + 1 -end - - -function Control:EnableRealign() - self._realignDisabled = ((self._realignDisabled or 0)>1 and self._realignDisabled - 1) or nil - if (self._realignRequested) then - self:Realign() - self._realignRequested = nil - end -end - - -function Control:Realign(savespace) - if (not self._realignDisabled) then - if (not self._inRealign) then - self._savespace = savespace or self.savespace - self._inRealign = true - self:AlignControl() --FIXME still needed? - local childrenAligned = self:UpdateLayout() - self._realignRequested = nil - if (not childrenAligned) then - self:RealignChildren() - end - self._inRealign = nil - self._savespace = nil - end - else - self:RequestRealign(savespace) - end -end - - -function Control:UpdateLayout() - if (self.autosize) then - self:RealignChildren(true) - - local neededWidth, neededHeight = self:GetChildrenMinimumExtents() - - local relativeBox = self:GetRelativeBox(self._savespace or self.savespace) - neededWidth = math.max(relativeBox[3], neededWidth) - neededHeight = math.max(relativeBox[4], neededHeight) - - neededWidth = neededWidth - self.padding[1] - self.padding[3] - neededHeight = neededHeight - self.padding[2] - self.padding[4] - - if (self.debug) then - local cminextW, cminextH = self:GetChildrenMinimumExtents() - Spring.Echo("Control:UpdateLayout", self.name, - "GetChildrenMinimumExtents", cminextW, cminextH, - "GetRelativeBox", relativeBox[3], relativeBox[4], - "savespace", self._savespace) - end - - self:Resize(neededWidth, neededHeight, true, true) - self:RealignChildren() - self:AlignControl() --FIXME done twice!!! (1st in Realign) - return true - end -end - - -function Control:RealignChildren(savespace) - self:CallChildren("Realign", savespace) -end - ---//============================================================================= - -function Control:SetPos(x, y, w, h, clientArea, dontUpdateRelative) - local changed = false - local redraw = false - - --//FIXME add an API for relative constraints changes - if (x)and(type(x) == "number") then - if (self.x ~= x) then - self.x = x - changed = true - end - if (not dontUpdateRelative) then - if (self._relativeBounds.left ~= x) then - self._relativeBounds.left = false - self._givenBounds.left = x - self._relativeBounds.right = false - self._givenBounds.right = false - changed = true - end - end - end - - if (y)and(type(y) == "number") then - if (self.y ~= y) then - self.y = y - changed = true - end - if (not dontUpdateRelative) then - if (self._relativeBounds.top ~= y) then - self._relativeBounds.top = false - self._givenBounds.top = y - self._relativeBounds.bottom = false - self._givenBounds.bottom = false - changed = true - end - end - end - - - if (w)and(type(w) == "number") then - w = (clientArea)and(w+self.padding[1]+self.padding[3]) or (w) - w = math.max( w, self.minWidth ) - w = math.min( w, self.maxWidth ) - if (self.width ~= w) then - self.width = w - changed = true - redraw = true - end - if (not dontUpdateRelative) then - if (self._relativeBounds.width ~= w) then - self._relativeBounds.width = IsRelativeCoord(w) and w - self._givenBounds.width = w - changed = true - redraw = true - end - end - end - - if (h)and(type(h) == "number") then - h = (clientArea)and(h+self.padding[2]+self.padding[4]) or (h) - h = math.max( h, self.minHeight ) - h = math.min( h, self.maxHeight ) - if (self.height ~= h) then - self.height = h - changed = true - redraw = true - end - if (not dontUpdateRelative) then - if (self._relativeBounds.height ~= h) then - self._relativeBounds.height = IsRelativeCoord(h) and h - self._givenBounds.height = h - changed = true - redraw = true - end - end - end - - if (changed)or(not self.clientArea) then - self:UpdateClientArea(not redraw) - end -end - - -function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) - local changed = false - local redraw = false - - --//FIXME add an API for relative constraints changes - if x then - if (not IsRelativeCoord(x)) then - if (self.x ~= x) then - self.x = x - changed = true - end - end - if (not dontUpdateRelative) then - if (self._relativeBounds.left ~= x) then - self._relativeBounds.left = IsRelativeCoord(x) and x - self._givenBounds.left = x - changed = true - end - end - end - - if y then - if (not IsRelativeCoord(y)) then - if (self.y ~= y) then - self.y = y - changed = true - end - end - if (not dontUpdateRelative) then - if (self._relativeBounds.top ~= y) then - self._relativeBounds.top = IsRelativeCoord(y) and y - self._givenBounds.top = y - changed = true - end - end - end - - - if w then - if (not IsRelativeCoord(w)) then - w = (clientArea)and(w+self.padding[1]+self.padding[3]) or (w) - w = math.max( w, self.minWidth ) - w = math.min( w, self.maxWidth ) - if (self.width ~= w) then - self.width = w - changed = true - redraw = true - end - end - if (not dontUpdateRelative) then - if (self._relativeBounds.width ~= w) then - self._relativeBounds.width = IsRelativeCoord(w) and w - self._givenBounds.width = w - changed = true - redraw = true - end - end - end - - if h then - if (not IsRelativeCoord(h)) then - h = (clientArea)and(h+self.padding[2]+self.padding[4]) or (h) - h = math.max( h, self.minHeight ) - h = math.min( h, self.maxHeight ) - if (self.height ~= h) then - self.height = h - changed = true - redraw = true - end - end - if (not dontUpdateRelative) then - if (self._relativeBounds.height ~= h) then - self._relativeBounds.height = IsRelativeCoord(h) and h - self._givenBounds.height = h - changed = true - redraw = true - end - end - end - - if (changed)or(not self.clientArea) then - self:UpdateClientArea(not redraw) - end -end - -function Control:Resize(w, h, clientArea, dontUpdateRelative) - self:SetPosRelative(nil, nil, w, h, clientArea, dontUpdateRelative) -end - - -function Control:_UpdateConstraints(x, y, w, h) - --// internal used - self:SetPos(x, y, w, h, false, true) -end - - ---//============================================================================= - -function Control:GetMinimumExtents() - local maxRight, maxBottom = 0,0 - if (self.autosize) then - --// FIXME handle me correctly!!! (:= do the parent offset) - maxRight, maxBottom = self:GetChildrenMinimumExtents() - end - - if (not self._isRelative) then - local right = self.x + self.width - local bottom = self.y + self.height - - maxRight = math.max(maxRight, right) - maxBottom = math.max(maxBottom, bottom) - else - local cgb = self._givenBounds - local crb = self._relativeBounds - - local left, width, right = 0,0,0 - if (not crb.width) then if (self.autosize) then width = self.width or 0 else width = cgb.width or 0 end end - if (not crb.left) then left = cgb.left or 0 end - if (not IsRelativeCoord(crb.right)) then right = crb.right or 0 end - local totalWidth = left + width + right - - local top, height, bottom = 0,0,0 - if (not crb.height) then height = cgb.height or 0 end - if (not crb.top) then top = cgb.top or 0 end - if (not IsRelativeCoord(crb.bottom)) then bottomt = crb.bottom or 0 end - local totalHeight = top + height + bottom - ---[[ - if (crb.width) then width = cgb.width or 0 end - if (crb.left) then left = cgb.left or 0 end - if (IsRelativeCoord(cgb.right)) then right = cgb.right or 0 end - - ... ---]] - - totalWidth = math.max(totalWidth, self.minWidth) - totalHeight = math.max(totalHeight, self.minHeight) - - totalWidth = math.min(totalWidth, self.maxWidth) - totalHeight = math.min(totalHeight, self.maxHeight) - - maxRight = math.max(maxRight, totalWidth) - maxBottom = math.max(maxBottom, totalHeight) - end - - return maxRight, maxBottom -end - - -function Control:GetChildrenMinimumExtents() - local minWidth = 0 - local minHeight = 0 - - local cn = self.children - for i=1,#cn do - local c = cn[i] - if (c.GetMinimumExtents) then - local width, height = c:GetMinimumExtents() - minWidth = math.max(minWidth, width) - minHeight = math.max(minHeight, height) - end - end - - if (minWidth + minHeight > 0) then - local padding = self.padding - minWidth = minWidth + padding[1] + padding[3] - minHeight = minHeight + padding[2] + padding[4] - end - - return minWidth, minHeight -end - - - -function Control:GetCurrentExtents() - local minLeft, minTop, maxRight, maxBottom = self:GetChildrenCurrentExtents() - - local left = self.x - local top = self.y - local right = self.x + self.width - local bottom = self.y + self.height - - if (left < minLeft) then minLeft = left end - if (top < minTop ) then minTop = top end - - if (right > maxRight) then maxRight = right end - if (bottom > maxBottom) then maxBottom = bottom end - - return minLeft, minTop, maxRight, maxBottom -end - - -function Control:GetChildrenCurrentExtents() - local minLeft = 0 - local minTop = 0 - local maxRight = 0 - local maxBottom = 0 - - local cn = self.children - for i=1,#cn do - local c = cn[i] - if (c.GetCurrentExtents) then - local left, top, right, bottom = c:GetCurrentExtents() - minLeft = math.min(minLeft, left) - minTop = math.min(minTop, top) - maxRight = math.max(maxRight, right) - maxBottom = math.max(maxBottom, bottom) - end - end - - return minLeft, minTop, maxRight, maxBottom -end - ---//============================================================================= - -function Control:StartResizing(x,y) - --//FIXME the x,y aren't needed check how drag is handled! - self.resizing = { - mouse = {x, y}, - size = {self.width, self.height}, - pos = {self.x, self.y}, - } -end - - -function Control:StopResizing(x,y) - self.resizing = false -end - - -function Control:StartDragging(x,y) - self.dragging = true -end - - -function Control:StopDragging(x,y) - self.dragging = false -end - ---//============================================================================= - -function Control:LocalToClient(x,y) - local ca = self.clientArea - return x - ca[1], y - ca[2] -end - - -function Control:ClientToLocal(x,y) - local ca = self.clientArea - return x + ca[1], y + ca[2] -end - - -function Control:ParentToClient(x,y) - local ca = self.clientArea - return x - self.x - ca[1], y - self.y - ca[2] -end - - -function Control:ClientToParent(x,y) - local ca = self.clientArea - return x + self.x + ca[1], y + self.y + ca[2] -end - - -function Control:InClientArea(x,y) - local clientArea = self.clientArea - return x>=clientArea[1] and y>=clientArea[2] and - x<=clientArea[1]+clientArea[3] and y<=clientArea[2]+clientArea[4] -end - ---//============================================================================= - -function Control:Invalidate() - self._needRedraw = true - self._needRedrawSelf = nil - self:RequestUpdate() -end - -function Control:InvalidateSelf() - self._needRedraw = true - self._needRedrawSelf = true - self:RequestUpdate() -end - ---//============================================================================= - -function Control:InstantUpdate() - if self:IsInView() then - if self._needRedraw then - self:Update() - else - self._in_update = true - self:_UpdateChildrenDList() - self:_UpdateAllDList() - self._in_update = false - end - end -end - - -function Control:Update() - if self._realignRequested then - self:Realign(self.__savespace) - self._realignRequested = false - end - - if self._needRedraw then - if self:IsInView() then - self._in_update = true - self:_UpdateOwnDList() - if not self._needRedrawSelf then self:_UpdateChildrenDList() end - self:_UpdateAllDList() - self._in_update = false - - self._needRedraw = false - self._needRedrawSelf = false - self._redrawSelfCounter = (self._redrawSelfCounter or 0) + 1 - end - end -end - - ---//============================================================================= - -function Control:_CheckIfRTTisAppreciated() - if self._cantUseRTT then - return false - end - - if self:InheritsFrom("window") then - if self._usingRTT then - return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.2) - else - return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.1) - end - else - if (self._redrawCounter or 0) > 300 then - return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.03) - end - end -end - - -function Control:_UpdateOwnDList() - if not self.parent then return end - if not self:IsInView() then return end - - self:CallChildren('_UpdateOwnDList') - - gl.DeleteList(self._own_dlist) - --self._own_dlist = nil - --self._own_dlist = gl.CreateList(self.DrawControl, self) -end - - -function Control:_UpdateChildrenDList() - if not self.parent then return end - if not self:IsInView() then return end - - if self:InheritsFrom("scrollpanel") and not self._cantUseRTT then - local contentX,contentY,contentWidth,contentHeight = unpack4(self.contentArea) - self:CreateViewTexture("children", contentWidth, contentHeight, self.DrawChildrenForList, self, true) - end -end - - -function Control:_UpdateAllDList() - if not self.parent then return end - if not self:IsInView() then return end - - local RTT = self:_CheckIfRTTisAppreciated() - - if RTT then - self._usingRTT = true - self:CreateViewTexture("all", self.width, self.height, self.DrawForList, self) - else - local suffix_name = "all" - local texname = "_tex_" .. suffix_name - local texStencilName = "_stencil_" .. suffix_name - local fboName = "_fbo_" .. suffix_name - local texw = "_texw_" .. suffix_name - local texh = "_texh_" .. suffix_name - gl.DeleteFBO(self[fboName]) - gl.DeleteTexture(self[texname]) - gl.DeleteRBO(self[texStencilName]) - self[texStencilName] = nil - self[texname] = nil - self[fboName] = nil - self[texw] = nil - self[texh] = nil - self._usingRTT = false - end - - --gl.DeleteList(self._all_dlist) - --self._all_dlist = gl.CreateList(self.DrawForList,self) - - if (self.parent)and(not self.parent._needRedraw)and(self.parent._UpdateAllDList) then - TaskHandler.RequestInstantUpdate(self.parent) - end -end - - - -function Control:_SetupRTT(fnc, self_, drawInContentRect, ...) - gl.Clear(GL.COLOR_BUFFER_BIT, 0,0,0,1) - gl.Clear(GL.STENCIL_BUFFER_BIT, 0) - - --// no need to push/pop cause gl.ActiveFBO already does so - gl.MatrixMode(GL.MODELVIEW) - gl.Translate(-1,1,0) - if not drawInContentRect then - gl.Scale(2/self.width, -2/self.height, 1) - gl.Translate(-self.x, -self.y, 0) - else - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - local contentX,contentY,contentWidth,contentHeight = unpack4(self.contentArea) - gl.Scale(2/contentWidth, -2/contentHeight, 1) - gl.Translate(-(clientX - self.scrollPosX), -(clientY - self.scrollPosY), 0) - end - - gl.Color(1,1,1,1) - gl.AlphaTest(false) - gl.StencilTest(true) - gl.StencilFunc(GL.EQUAL, 0, 0xFF) - gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) - - gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) - fnc(self_, ...) - --- --//Render a red quad to indicate that RTT is used for the respective control --- gl.Color(1,0,0,0.5) --- if not drawInContentRect then --- gl.Rect(self.x,self.y,self.x+50,self.y+50) --- else --- gl.Rect(0,0,50,50) --- end --- gl.Color(1,1,1,1) - - gl.Blending("reset") - - gl.StencilTest(false) -end - - -function Control:CreateViewTexture(suffix_name, width, height, fnc, ...) - if not gl.CreateFBO or not gl.BlendFuncSeparate then - self._cantUseRTT = true - self._usingRTT = false - return - end - - local texname = "_tex_" .. suffix_name - local texw = "_texw_" .. suffix_name - local texh = "_texh_" .. suffix_name - local texStencilName = "_stencil_" .. suffix_name - local fboName = "_fbo_" .. suffix_name - - local fbo = self[fboName] or gl.CreateFBO() - local texColor = self[texname] - local texStencil = self[texStencilName] - - if (width ~= self[texw])or(height ~= self[texh]) then - self[texw] = width - self[texh] = height - fbo.color0 = nil - fbo.stencil = nil - gl.DeleteTexture(texColor) - gl.DeleteRBO(texStencil) - - texColor = gl.CreateTexture(width, height, { - min_filter = GL.NEAREST, - mag_filter = GL.NEAREST, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - border = false, - }) - texStencil = gl.CreateRBO(width, height, { - format = GL_DEPTH24_STENCIL8, - }) - - fbo.color0 = texColor - fbo.stencil = texStencil - end - - if (not (fbo and texColor and texStencil))or(not gl.IsValidFBO(fbo)) then - gl.DeleteFBO(fbo) - gl.DeleteTexture(texColor) - gl.DeleteRBO(texStencil) - self[texw] = nil - self[texh] = nil - self[texStencilName] = nil - self[texname] = nil - self[fboName] = nil - self._cantUseRTT = true - self._usingRTT = false - return - end - - EnterRTT() - self._inrtt = true - gl.ActiveFBO(fbo, true, Control._SetupRTT, self, fnc, ...) - self._inrtt = false - LeaveRTT() - - self[texname] = texColor - self[texStencilName] = texStencil - self[fboName] = fbo -end - ---//============================================================================= - - -function Control:_DrawInClientArea(fnc,...) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - - gl.PushMatrix() - gl.Translate(clientX, clientY, 0) - - local sx,sy = self:LocalToScreen(clientX,clientY) - sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) - PushLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) - - fnc(...) - - PopLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) - gl.PopMatrix() -end - - -function Control:IsInView() - if UnlinkSafe(self.parent) then - return self.parent:IsRectInView(self.x, self.y, self.width, self.height) - end - return false -end - - -function Control:IsChildInView(child) - return self:IsRectInView(child.x, child.y, child.width, child.height) -end - - -function Control:IsRectInView(x,y,w,h) - if (not self.parent) then - return false - end - - local rect1 = {x,y,w,h} - local rect2 = {0,0,self.clientArea[3],self.clientArea[4]} - local inview = AreRectsOverlapping(rect1,rect2) - - if not(inview) then - return false - end - - local px,py = self:ClientToParent(x,y) - return (self.parent):IsRectInView(px,py,w,h) -end - - -function Control:_DrawChildrenInClientArea(event) - self:_DrawInClientArea(self.CallChildrenInverseCheckFunc, self, self.IsChildInView, event or 'Draw') -end - - -function Control:_DrawChildrenInClientAreaWithoutViewCheck(event) - self:_DrawInClientArea(self.CallChildrenInverse, self, event or 'Draw') -end - - ---//============================================================================= - ---//FIXME move resize and drag to Window class!!!! -function Control:DrawBackground() - --// gets overriden by the skin/theme -end - -function Control:DrawDragGrip() - --// gets overriden by the skin/theme -end - -function Control:DrawResizeGrip() - --// gets overriden by the skin/theme -end - -function Control:DrawBorder() - --// gets overriden by the skin/theme ?????? -end - - -function Control:DrawGrips() -- FIXME this thing is a hack, fix it - todo ideally make grips appear only when mouse hovering over it - local drawResizeGrip = self.resizable - local drawDragGrip = self.draggable and self.dragUseGrip - --[[if IsTweakMode() then - drawResizeGrip = drawResizeGrip or self.tweakResizable - drawDragGrip = (self.tweakDraggable and self.tweakDragUseGrip) - end--]] - - if drawResizeGrip then - self:DrawResizeGrip() - end - if drawDragGrip then - self:DrawDragGrip() - end -end - - -function Control:DrawControl() - self:DrawBackground() - self:DrawBorder() -end - - -function Control:DrawForList() - self._redrawCounter = (self._redrawCounter or 0) + 1 - if (not self._in_update and not self._usingRTT and self:_CheckIfRTTisAppreciated()) then self:InvalidateSelf() end - - if (self._tex_all and not self._inrtt) then - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - gl.BlendFuncSeparate(GL.ONE, GL.SRC_ALPHA, GL.ZERO, GL.SRC_ALPHA) - gl.Color(1,1,1,1) - gl.Texture(0, self._tex_all) - gl.TexRect(0, 0, self.width, self.height) - gl.Texture(0, false) - gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) - gl.PopMatrix() - return - elseif (self._all_dlist) then - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - gl.CallList(self._all_dlist); - gl.PopMatrix() - return - end - - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - - if (self._own_dlist) then - gl.CallList(self._own_dlist) - else - if self._hasCustomDrawControl then - gl.Translate(-self.x, -self.y, 0) - self:DrawControl() - gl.Translate(self.x, self.y, 0) - else - self:DrawControl() - end - end - - if (self._tex_children) then - gl.BlendFuncSeparate(GL.ONE, GL.SRC_ALPHA, GL.ZERO, GL.SRC_ALPHA) - gl.Color(1,1,1,1) - gl.Texture(0, self._tex_children) - local contX,contY,contWidth,contHeight = unpack4(self.contentArea) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - local x = clientX - local y = clientY - local s = self.scrollPosX / contWidth - local t = 1 - self.scrollPosY / contHeight - local u = s + clientWidth / contWidth - local v = t - clientHeight / contHeight - gl.TexRect(x, y, x + clientWidth, y + clientHeight, s, t, u, v) - gl.Texture(0, false) - gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) - elseif (self._children_dlist) then - self:_DrawInClientArea(gl.CallList, self._children_dlist) - else - self:DrawChildrenForList() - end - - if (self.DrawControlPostChildren) then - self:DrawControlPostChildren() - end - - self:DrawGrips() - gl.PopMatrix() -end - - -function Control:Draw() - self._redrawCounter = (self._redrawCounter or 0) + 1 - if (not self._in_update and not self._usingRTT and self:_CheckIfRTTisAppreciated()) then self:InvalidateSelf() end - - if (self._tex_all) then - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - gl.BlendFunc(GL.ONE, GL.SRC_ALPHA) - gl.Color(1,1,1,1) - gl.Texture(0, self._tex_all) - gl.TexRect(0, 0, self.width, self.height) - gl.Texture(0, false) - gl.Blending("reset") - gl.PopMatrix() - return - elseif (self._all_dlist) then - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - gl.CallList(self._all_dlist); - gl.PopMatrix() - return - end - - gl.PushMatrix() - gl.Translate(self.x, self.y, 0) - - if (self._own_dlist) then - gl.CallList(self._own_dlist) - else - if self._hasCustomDrawControl then - gl.Translate(-self.x, -self.y, 0) - self:DrawControl() - gl.Translate(self.x, self.y, 0) - else - self:DrawControl() - end - end - - if (self._children_dlist) then - self:_DrawInClientArea(gl.CallList, self._children_dlist) - else - self:DrawChildren(); - end - - if (self.DrawControlPostChildren) then - self:DrawControlPostChildren(); - end - - self:DrawGrips(); - gl.PopMatrix() -end - - -function Control:TweakDraw() - if (next(self.children)) then - self:_DrawChildrenInClientArea('TweakDraw') - end -end - - -function Control:DrawChildren() - if (next(self.children)) then - self:_DrawChildrenInClientArea('Draw') - end -end - - -function Control:DrawChildrenForList() - if (next(self.children)) then - self:_DrawChildrenInClientAreaWithoutViewCheck('DrawForList') - end -end - ---//============================================================================= - -local function InLocalRect(cx,cy,w,h) - return (cx>=0)and(cy>=0)and(cx<=w)and(cy<=h) -end - - -function Control:HitTest(x,y) - if (not self.disableChildrenHitTest) then - if self:InClientArea(x,y) then - local cax,cay = self:LocalToClient(x,y) - local children = self.children - for i=1,#children do - local c = children[i] - if (c) then - local cx,cy = c:ParentToLocal(cax,cay) - if InLocalRect(cx,cy,c.width,c.height) then - local obj = c:HitTest(cx,cy) - if (obj) then - return obj - end - end - end - end - end - end - - if (self.NCHitTest) then - local nchit = self:NCHitTest(x,y) - if (nchit) then - return nchit - end - end - - if - self.tooltip - or (#self.OnMouseDown > 0) - or (#self.OnMouseUp > 0) - or (#self.OnClick > 0) - or (#self.OnDblClick > 0) - or (#self.OnMouseMove > 0) - or (#self.OnMouseWheel > 0) - then - return self - end - - return false -end - - -function Control:MouseDown(x, y, ...) - if (self.NCMouseDown) then - local result = self:NCMouseDown(x, y) - if (result) then - return result - end - end - - if (not self.disableChildrenHitTest) then - if self:InClientArea(x,y) then - local cx,cy = self:LocalToClient(x,y) - local obj = inherited.MouseDown(self, cx, cy, ...) - if (obj) then - return obj - end - end - end - - if (self.NCMouseDownPostChildren) then - local result = self:NCMouseDownPostChildren(x, y) - if (result) then - return result - end - end -end - - -function Control:MouseMove(x, y, dx, dy, ...) - if self.dragging then - self:SetPos(self.x + dx, self.y + dy) - return self - - elseif self.resizing then - local oldState = self.resizing - local deltaMousePosX = x - oldState.mouse[1] - local deltaMousePosY = y - oldState.mouse[2] - - local w = math.max( - self.minWidth, - oldState.size[1] + deltaMousePosX - ) - local h = math.max( - self.minHeight, - oldState.size[2] + deltaMousePosY - ) - - if self.fixedRatio == true then - local ratioyx = self.height/self.width - local ratioxy = self.width/self.height - local oldSize = oldState.size - local oldxy = oldSize[1]/oldSize[2] - local oldyx = oldSize[2]/oldSize[1] - if (ratioxy-oldxy < ratioyx-oldyx) then - w = h*oldxy - else - h = w*oldyx - end - end - - self:SetPos(nil,nil,w,h) - return self - end - - local cx,cy = self:LocalToClient(x,y) - return inherited.MouseMove(self, cx, cy, dx, dy, ...) -end - - -function Control:MouseUp(x, y, ...) - self.resizing = nil - self.dragging = nil - local cx,cy = self:LocalToClient(x,y) - return inherited.MouseUp(self, cx, cy, ...) -end - - -function Control:MouseClick(x, y, ...) - local cx,cy = self:LocalToClient(x,y) - return inherited.MouseClick(self, cx, cy, ...) -end - - -function Control:MouseDblClick(x, y, ...) - local cx,cy = self:LocalToClient(x,y) - return inherited.MouseDblClick(self, cx, cy, ...) -end - - -function Control:MouseWheel(x, y, ...) - local cx,cy = self:LocalToClient(x,y) - return inherited.MouseWheel(self, cx, cy, ...) -end - - -function Control:KeyPress(...) - return inherited.KeyPress(self, ...) -end - - -function Control:FocusUpdate(...) - self:InvalidateSelf() - return inherited.FocusUpdate(self, ...) -end - - -function Control:MouseOver(...) - inherited.MouseOver(self, ...) - self.state.hovered = true - self:InvalidateSelf() -end - - -function Control:MouseOut(...) - inherited.MouseOut(self, ...) - self.state.hovered = false - self:InvalidateSelf() -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/editbox.lua b/LuaIntro/chili/chili/controls/editbox.lua deleted file mode 100644 index 9deb973a8..000000000 --- a/LuaIntro/chili/chili/controls/editbox.lua +++ /dev/null @@ -1,179 +0,0 @@ ---//============================================================================= -include("keysym.h.lua") - -EditBox = Control:Inherit{ - classname= "editbox", - - defaultWidth = 70, - defaultHeight = 20, - - padding = {3,3,3,3}, - - cursorColor = {0,0,1,0.7}, - - align = "left", - valign = "linecenter", - - text = "", - cursor = 1, - offset = 1, -} - -local this = EditBox -local inherited = this.inherited - ---//============================================================================= - -function EditBox:New(obj) - obj = inherited.New(self,obj) - obj._interactedTime = Spring.GetTimer() - obj:SetText(obj.text) - obj:RequestUpdate() - return obj -end - -function EditBox:HitTest(x,y) - return self -end - ---//============================================================================= - -function EditBox:SetText(newtext) - if (self.text == newtext) then return end - self.text = newtext - self.cursor = 1 - self.offset = 1 - self:UpdateLayout() - self:Invalidate() -end - - -function EditBox:UpdateLayout() - local font = self.font - - --FIXME - if (self.autosize) then - local w = font:GetTextWidth(self.text); - local h, d, numLines = font:GetTextHeight(self.text); - - if (self.autoObeyLineHeight) then - h = math.ceil(numLines * font:GetLineHeight()) - else - h = math.ceil(h-d) - end - - local x = self.x - local y = self.y - - if self.valign == "center" then - y = math.round(y + (self.height - h) * 0.5) - elseif self.valign == "bottom" then - y = y + self.height - h - elseif self.valign == "top" then - else - end - - if self.align == "left" then - elseif self.align == "right" then - x = x + self.width - w - elseif self.align == "center" then - x = math.round(x + (self.width - w) * 0.5) - end - - w = w + self.padding[1] + self.padding[3] - h = h + self.padding[2] + self.padding[4] - - self:_UpdateConstraints(x,y,w,h) - end - -end - ---//============================================================================= - -function EditBox:Update(...) - --FIXME add special UpdateFocus event? - - --// redraw every few frames for blinking cursor - inherited.Update(self, ...) - - if self.state.focused then - self:RequestUpdate() - if (os.clock() >= (self._nextCursorRedraw or -math.huge)) then - self._nextCursorRedraw = os.clock() + 0.1 --10FPS - self:Invalidate() - end - end -end - - -function EditBox:MouseDown(x, y, ...) - local clientX = self.clientArea[1] - self.cursor = #self.text + 1 -- at end of text - for i = self.offset, #self.text do - local tmp = self.text:sub(self.offset, i) - if self.font:GetTextWidth(tmp) > (x - clientX) then - self.cursor = i - break - end - end - self._interactedTime = Spring.GetTimer() - inherited.MouseDown(self, x, y, ...) - self:Invalidate() - return self -end - -function EditBox:MouseUp(...) - inherited.MouseUp(self, ...) - self:Invalidate() - return self -end - -function EditBox:KeyPress(key, mods, isRepeat, label, unicode, ...) - local cp = self.cursor - local txt = self.text - if key == KEYSYMS.RETURN then - return false - elseif key == KEYSYMS.BACKSPACE then - if #txt > 0 and cp > 1 then - self.cursor = cp - 1 - self.text = txt:sub(1, cp - 2) .. txt:sub(cp, #txt) - end - elseif key == KEYSYMS.DELETE then - if #txt > 0 and cp <= #txt then - self.text = txt:sub(1, cp - 1) .. txt:sub(cp + 1, #txt) - end - elseif key == KEYSYMS.LEFT then - if cp > 1 then - self.cursor = cp - 1 - end - elseif key == KEYSYMS.RIGHT then - if cp <= #txt then - self.cursor = cp + 1 - end - elseif key == KEYSYMS.HOME then - self.cursor = 1 - elseif key == KEYSYMS.END then - self.cursor = #txt + 1 - else - local char = nil - local success, char = pcall(string.char, unicode) - if success then - success = not char:find("%c") - end - if not success then - char = nil - end - if char then - self.text = txt:sub(1, cp - 1) .. char .. txt:sub(cp, #txt) - self.cursor = cp + 1 - else - return false - end - end - self._interactedTime = Spring.GetTimer() - inherited.KeyPress(self, key, mods, isRepeat, label, unicode, ...) - self:UpdateLayout() - self:Invalidate() - return self -end ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/font.lua b/LuaIntro/chili/chili/controls/font.lua deleted file mode 100644 index 6dfcce0e5..000000000 --- a/LuaIntro/chili/chili/controls/font.lua +++ /dev/null @@ -1,293 +0,0 @@ ---//============================================================================= - -Font = Object:Inherit{ - classname = 'font', - - font = "FreeSansBold.otf", - size = 12, - outlineWidth = 3, - outlineWeight = 3, - - shadow = false, - outline = false, - color = {1,1,1,1}, - outlineColor = {0,0,0,1}, - autoOutlineColor = true, -} - -local this = Font -local inherited = this.inherited - ---//============================================================================= - -function Font:New(obj) - obj = inherited.New(self,obj) - - --// Load the font - obj:_LoadFont() - - return obj -end - - -function Font:Dispose(...) - if (not self.disposed) then - FontHandler.UnloadFont(self._font) - end - inherited.Dispose(self,...) -end - ---//============================================================================= - -function Font:_LoadFont() - local oldfont = self._font - self._font = FontHandler.LoadFont(self.font,self.size,self.outlineWidth,self.outlineWeight) - --// do this after LoadFont because it can happen that LoadFont returns the same font again - --// but if we Unload our old one before, the gc could collect it before, so the engine would have to reload it again - FontHandler.UnloadFont(oldfont) -end - ---//============================================================================= - -local function NotEqual(v1, v2) - local t1 = type(v1) - local t2 = type(v2) - - if (t1 ~= t2) then - return true - end - - local isindexable = (t=="table")or(t=="metatable")or(t=="userdata") - if (not isindexable) then - return (t1 ~= t2) - end - - for i,v in pairs(v1) do - if (v ~= v2[i]) then - return true - end - end - for i,v in pairs(v2) do - if (v ~= v1[i]) then - return true - end - end -end - - -do - --// Create some Set... methods (e.g. SetColor, SetSize, SetFont, ...) - - local params = { - font = true, - size = true, - outlineWidth = true, - outlineWeight = true, - shadow = false, - outline = false, - color = false, - outlineColor = false, - autoOutlineColor = false, - } - - for param,recreateFont in pairs(params) do - local paramWithUpperCase = param:gsub("^%l", string.upper) - local funcname = "Set" .. paramWithUpperCase - - Font[funcname] = function(self,value,...) - local t = type(value) - - local oldValue = self[param] - - if (t == "table") then - self[param] = table.shallowcopy(value) - else - local to = type(self[param]) - if (to == "table") then - --// this allows :SetColor(r,g,b,a) and :SetColor({r,g,b,a}) - local newtable = {value,...} - table.merge(newtable,self[param]) - self[param] = newtable - else - self[param] = value - end - end - - local p = self.parent - if (recreateFont) then - self:_LoadFont() - if (p) then - p:RequestRealign() - end - else - if (p)and NotEqual(oldValue, self[param]) then - p:Invalidate() - end - end - end - end - - params = nil -end - ---//============================================================================= - -function Font:GetLineHeight(size) - return self._font.lineheight * (size or self.size) -end - -function Font:GetAscenderHeight(size) - local font = self._font - return (font.lineheight + font.descender) * (size or self.size) -end - -function Font:GetTextWidth(text, size) - return (self._font):GetTextWidth(text) * (size or self.size) -end - -function Font:GetTextHeight(text, size) - if (not size) then size = self.size end - local h,descender,numlines = (self._font):GetTextHeight(text) - return h*size, descender*size, numlines -end - -function Font:WrapText(text, width, height, size) - if (not size) then size = self.size end - if (height < 1.5 * self._font.lineheight)or(width < size) then - return text --//workaround for a bug in <=80.5.2 - end - return (self._font):WrapText(text,width,height,size) -end - ---//============================================================================= - -function Font:AdjustPosToAlignment(x, y, width, height, align, valign) - local extra = '' - - if self.shadow then - width = width - 1 - self.size * 0.1 - height = height - 1 - self.size * 0.1 - elseif self.outline then - width = width - 1 - self.size * self.outlineWidth - height = height - 1 - self.size * self.outlineWidth - end - - --// vertical alignment - if valign == "center" then - y = y + height/2 - extra = 'v' - elseif valign == "top" then - extra = 't' - elseif valign == "bottom" then - y = y + height - extra = 'b' - elseif valign == "linecenter" then - y = y + (height / 2) + (1 + self._font.descender) * self.size / 2 - extra = 'x' - else - --// ascender - extra = 'a' - end - --FIXME add baseline 'd' - - --// horizontal alignment - if align == "left" then - --do nothing - elseif align == "center" then - x = x + width/2 - extra = extra .. 'c' - elseif align == "right" then - x = x + width - extra = extra .. 'r' - end - - return x,y,extra -end - -local function _GetExtra(align, valign) - local extra = '' - - --// vertical alignment - if valign == "center" then - extra = 'v' - elseif valign == "top" then - extra = 't' - elseif valign == "bottom" then - extra = 'b' - else - --// ascender - extra = 'a' - end - - --// horizontal alignment - if align == "left" then - --do nothing - elseif align == "center" then - extra = extra .. 'c' - elseif align == "right" then - extra = extra .. 'r' - end - - return extra -end - ---//============================================================================= - -function Font:_DrawText(text, x, y, extra) - local font = self._font - - gl.PushAttrib(GL.COLOR_BUFFER_BIT) - gl.PushMatrix() - gl.Scale(1,-1,1) - font:Begin() - if AreInRTT() then - gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) - end - font:SetTextColor(self.color) - font:SetOutlineColor(self.outlineColor) - font:SetAutoOutlineColor(self.autoOutlineColor) - font:Print(text, x, -y, self.size, extra) - font:End() - gl.PopMatrix() - gl.PopAttrib() -end - - -function Font:Draw(text, x, y, align, valign) - if (not text) then - return - end - - local extra = _GetExtra(align, valign) - if self.outline then - extra = extra .. 'o' - elseif self.shadow then - extra = extra .. 's' - end - - self:_DrawText(text, x, y, extra) -end - - -function Font:DrawInBox(text, x, y, w, h, align, valign) - if (not text) then - return - end - - local x,y,extra = self:AdjustPosToAlignment(x, y, w, h, align, valign) - - if self.outline then - extra = extra .. 'o' - elseif self.shadow then - extra = extra .. 's' - end - - y = y + 1 --// FIXME: if this isn't done some chars as 'R' get truncated at the top - - self:_DrawText(text, x, y, extra) -end - -Font.Print = Font.Draw -Font.PrintInBox = Font.DrawInBox - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/grid.lua b/LuaIntro/chili/chili/controls/grid.lua deleted file mode 100644 index ad95bdb22..000000000 --- a/LuaIntro/chili/chili/controls/grid.lua +++ /dev/null @@ -1,8 +0,0 @@ -Grid = LayoutPanel:Inherit{ - classname = "grid", - resizeItems = true, - itemPadding = {0, 0, 0, 0}, -} - -local this = Grid -local inherited = this.inherited \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/image.lua b/LuaIntro/chili/chili/controls/image.lua deleted file mode 100644 index 8181c9069..000000000 --- a/LuaIntro/chili/chili/controls/image.lua +++ /dev/null @@ -1,109 +0,0 @@ ---//============================================================================= - -Image = Button:Inherit{ - classname= "image", - - defaultWidth = 64, - defaultHeight = 64, - padding = {0,0,0,0}, - color = {1,1,1,1}, - - file = nil, - file2 = nil, - - flip = true; - flip2 = true; - - keepAspect = true; - - OnClick = {}, -} - - -local this = Image -local inherited = this.inherited - ---//============================================================================= - -local function _DrawTextureAspect(x,y,w,h ,tw,th, flipy) - local twa = w/tw - local tha = h/th - - local aspect = 1 - if (twa < tha) then - aspect = twa - y = y + h*0.5 - th*aspect*0.5 - h = th*aspect - else - aspect = tha - x = x + w*0.5 - tw*aspect*0.5 - w = tw*aspect - end - - local right = math.ceil(x+w) - local bottom = math.ceil(y+h) - x = math.ceil(x) - y = math.ceil(y) - - gl.TexRect(x,y,right,bottom,false,flipy) -end - -function Image:DrawControl() - if (not (self.file or self.file2)) then return end - gl.Color(self.color) - - if (self.keepAspect) then - if (self.file2) then - TextureHandler.LoadTexture(0,self.file2,self) - local texInfo = gl.TextureInfo(self.file2) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(0,0,self.width,self.height, tw,th, self.flip2) - end - if (self.file) then - TextureHandler.LoadTexture(0,self.file,self) - local texInfo = gl.TextureInfo(self.file) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(0,0,self.width,self.height, tw,th, self.flip) - end - else - if (self.file2) then - TextureHandler.LoadTexture(0,self.file2,self) - gl.TexRect(0,0,self.width,self.height,false,self.flip2) - end - if (self.file) then - TextureHandler.LoadTexture(0,self.file,self) - gl.TexRect(0,0,self.width,self.height,false,self.flip) - end - end - gl.Texture(0,false) -end - ---//============================================================================= - -function Image:IsActive() - local onclick = self.OnClick - if (onclick and onclick[1]) then - return true - end -end - -function Image:HitTest() - --FIXME check if there are any eventhandlers linked (OnClick,OnMouseUp,...) - return self:IsActive() and self -end - -function Image:MouseDown(...) - --// we don't use `this` here because it would call the eventhandler of the button class, - --// which always returns true, but we just want to do so if a calllistener handled the event - return Control.MouseDown(self, ...) or self:IsActive() and self -end - -function Image:MouseUp(...) - return Control.MouseUp(self, ...) or self:IsActive() and self -end - -function Image:MouseClick(...) - return Control.MouseClick(self, ...) or self:IsActive() and self -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/imagelistview.lua b/LuaIntro/chili/chili/controls/imagelistview.lua deleted file mode 100644 index 44c5aedf6..000000000 --- a/LuaIntro/chili/chili/controls/imagelistview.lua +++ /dev/null @@ -1,280 +0,0 @@ ---//============================================================================= - -ImageListView = LayoutPanel:Inherit{ - classname = "imagelistview", - - autosize = true, - - autoArrangeH = false, - autoArrangeV = false, - centerItems = false, - - iconX = 64, - iconY = 64, - - itemMargin = {1, 1, 1, 1}, - - selectable = true, - multiSelect = true, - - items = {}, - - dir = '', - - OnDirChange = {}, -} - -local this = ImageListView -local inherited = this.inherited - ---//============================================================================= - -local image_exts = {'.jpg','.bmp','.png','.tga','.dds','.ico','.gif','.psd','.tif'} --'.psp' - ---//============================================================================= - -function ImageListView:New(obj) - obj = inherited.New(self,obj) - obj:SetDir(obj.dir) - return obj -end - ---//============================================================================= - -local function GetParentDir(dir) - dir = dir:gsub("\\", "/") - local lastChar = dir:sub(-1) - if (lastChar == "/") then - dir = dir:sub(1,-2) - end - local pos,b,e,match,init,n = 1,1,1,1,0,0 - repeat - pos,init,n = b,init+1,n+1 - b,init,match = dir:find("/",init,true) - until (not b) - if (n==1) then - return '' - else - return dir:sub(1,pos) - end -end - - -local function ExtractFileName(filepath) - filepath = filepath:gsub("\\", "/") - local lastChar = filepath:sub(-1) - if (lastChar == "/") then - filepath = filepath:sub(1,-2) - end - local pos,b,e,match,init,n = 1,1,1,1,0,0 - repeat - pos,init,n = b,init+1,n+1 - b,init,match = filepath:find("/",init,true) - until (not b) - if (n==1) then - return filepath - else - return filepath:sub(pos+1) - end -end - - -local function ExtractDir(filepath) - filepath = filepath:gsub("\\", "/") - local lastChar = filepath:sub(-1) - if (lastChar == "/") then - filepath = filepath:sub(1,-2) - end - local pos,b,e,match,init,n = 1,1,1,1,0,0 - repeat - pos,init,n = b,init+1,n+1 - b,init,match = filepath:find("/",init,true) - until (not b) - if (n==1) then - return filepath - else - return filepath:sub(1,pos) - end -end - ---//============================================================================= - -function ImageListView:_AddFile(name,imagefile) - self:AddChild( LayoutPanel:New{ - width = self.iconX+10, - height = self.iconY+20, - padding = {0,0,0,0}, - itemPadding = {0,0,0,0}, - itemMargin = {0,0,0,0}, - rows = 2, - columns = 1, - - children = { - Image:New{ - width = self.iconX, - height = self.iconY, - passive = true, - file = ':clr' .. self.iconX .. ',' .. self.iconY .. ':' .. imagefile, - }, - Label:New{ - width = self.iconX+10, - height = 20, - align = 'center', - autosize = false, - caption = name, - }, - }, - }) -end - - -function ImageListView:ScanDir() - local files = VFS.DirList(self.dir) - local dirs = VFS.SubDirs(self.dir) - local imageFiles = {} - for i=1,#files do - local f = files[i] - local ext = (f:GetExt() or ""):lower() - if (table.ifind(image_exts,ext))then - imageFiles[#imageFiles+1]=f - end - end - - self._dirsNum = #dirs - self._dirList = dirs - - local n = 1 - local items = self.items - items[n] = '..' - n = n+1 - - for i=1,#dirs do - items[n],n=dirs[i],n+1 - end - for i=1,#imageFiles do - items[n],n=imageFiles[i],n+1 - end - if (#items>n-1) then - for i=n,#items do - items[i] = nil - end - end - - self:DisableRealign() - --// clear old - self:ClearChildren() - - --// add ".." - self:_AddFile('..',self.imageFolderUp) - - --// add dirs at top - for i=1,#dirs do - self:_AddFile(ExtractFileName(dirs[i]),self.imageFolder) - end - - --// add files - for i=1,#imageFiles do - self:_AddFile(ExtractFileName(imageFiles[i]),imageFiles[i]) - end - self:EnableRealign() -end - - -function ImageListView:SetDir(directory) - self:DeselectAll() - self.dir = directory - self:ScanDir() - - self:CallListeners(self.OnDirChange, directory) - - if (self.parent) then - self.parent:RequestRealign() - else - self:UpdateLayout() - self:Invalidate() - end -end - - -function ImageListView:GotoFile(filepath) - local dir = ExtractDir(filepath) - local file = ExtractFileName(filepath) - self.dir = dir - self:ScanDir() - self:Select(file) - - if (self.parent) then - if (self.parent.classname == "scrollpanel") then - local x,y,w,h = self:GetItemXY(next(self.selectedItems)) - self.parent:SetScrollPos(x+w*0.5, y+h*0.5, true) - end - - self.parent:RequestRealign() - else - self:UpdateLayout() - self:Invalidate() - end -end - ---//============================================================================= - -function ImageListView:Select(item) - if (type(item)=="number") then - self:SelectItem(item) - else - local items = self.items - for i=1,#items do - if (ExtractFileName(items[i])==item) then - self:SelectItem(i) - return - end - end - self:SelectItem(1) - end -end - ---//============================================================================= - -function ImageListView:DrawItemBkGnd(index) - local cell = self._cells[index] - local itemPadding = self.itemPadding - - if (self.selectedItems[index]) then - self:DrawItemBackground(cell[1] - itemPadding[1],cell[2] - itemPadding[2],cell[3] + itemPadding[1] + itemPadding[3],cell[4] + itemPadding[2] + itemPadding[4],"selected") - else - self:DrawItemBackground(cell[1] - itemPadding[1],cell[2] - itemPadding[2],cell[3] + itemPadding[1] + itemPadding[3],cell[4] + itemPadding[2] + itemPadding[4],"normal") - end -end - ---//============================================================================= - -function ImageListView:HitTest(x,y) - local cx,cy = self:LocalToClient(x,y) - local obj = inherited.HitTest(self,cx,cy) - if (obj) then return obj end - local itemIdx = self:GetItemIndexAt(cx,cy) - return (itemIdx>=0) and self -end - - -function ImageListView:MouseDblClick(x,y) - local cx,cy = self:LocalToClient(x,y) - local itemIdx = self:GetItemIndexAt(cx,cy) - - if (itemIdx<0) then return end - - if (itemIdx==1) then - self:SetDir(GetParentDir(self.dir)) - return self - end - - if (itemIdx<=self._dirsNum+1) then - self:SetDir(self._dirList[itemIdx-1]) - return self - else - self:CallListeners(self.OnDblClickItem, self.items[itemIdx], itemIdx) - return self - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/label.lua b/LuaIntro/chili/chili/controls/label.lua deleted file mode 100644 index 5aa47e323..000000000 --- a/LuaIntro/chili/chili/controls/label.lua +++ /dev/null @@ -1,104 +0,0 @@ ---//============================================================================= - -Label = Control:Inherit{ - classname= "label", - - defaultWidth = 70, - defaultHeight = 20, - - padding = {0,0,0,0}, - - autosize = true, - autoObeyLineHeight = true, --// (needs autosize) if true, autosize will obey the lineHeight (-> texts with the same line count will have the same height) - - align = "left", - valign = "linecenter", --// usefull too "ascender" - caption = "no text", -} - -local this = Label -local inherited = this.inherited - ---//============================================================================= - -function Label:New(obj) - obj = inherited.New(self,obj) - obj:SetCaption(obj.caption) - return obj -end - ---//============================================================================= - -function Label:SetCaption(newcaption) - if (self.caption == newcaption) then return end - self.caption = newcaption - self:UpdateLayout() - self:Invalidate() -end - - -function Label:UpdateLayout() - local font = self.font - - if (self.autosize) then - self._caption = self.caption - local w = font:GetTextWidth(self.caption); - local h, d, numLines = font:GetTextHeight(self.caption); - - h = h + 1 - if (self.autoObeyLineHeight) then - h = math.ceil(numLines * font:GetLineHeight()) - else - h = math.ceil(h-d) - end - - if font.shadow then - w = w + 2 + font.size * 0.1 - h = h + 2 + font.size * 0.1 - elseif font.outline then - w = w + 2 + font.size * font.outlineWidth - h = h + 2 + font.size * font.outlineWidth - end - - local x = self.x - local y = self.y - - if self.valign == "center" then - y = math.round(y + (self.height - h) * 0.5) - elseif self.valign == "bottom" then - y = y + self.height - h - elseif self.valign == "top" then - else - end - - if self.align == "left" then - elseif self.align == "right" then - x = x + self.width - w - elseif self.align == "center" then - x = math.round(x + (self.width - w) * 0.5) - end - - self:_UpdateConstraints(x,y,w,h) - else - self._caption = font:WrapText(self.caption, self.width, self.height) - end - -end - ---//============================================================================= - -function Label:DrawControl() - local font = self.font - font:DrawInBox(self._caption,0,0,self.width,self.height,self.align,self.valign) - - if (self.debug) then - gl.Color(0,1,0,0.5) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) - gl.LineWidth(2) - gl.Rect(0,0,self.width,self.height) - gl.LineWidth(1) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/layoutpanel.lua b/LuaIntro/chili/chili/controls/layoutpanel.lua deleted file mode 100644 index 2deda4a48..000000000 --- a/LuaIntro/chili/chili/controls/layoutpanel.lua +++ /dev/null @@ -1,962 +0,0 @@ ---//============================================================================= ---// This control is the base of any auto-layout panel, this includes: ---// grid, stackpanel, tables, itemlistview, listbox, radiogroups, ... ---// ---// Internal all childrens/items are handled via cells, which can be ---// freely aligned (table-grid, free movable like in imagelistviews, ...). ---// ---// Also most subclasses should use an items table to create their child ---// objects, so the user just define the captions, filenames, ... instead ---// of creating checkboxes, images, ... directly. ---// This doesn't affect simple containers like grids & stackcontrols, which ---// don't create any controls themselves (instead they just align their children). - -LayoutPanel = Control:Inherit{ - classname = "layoutpanel", - - itemMargin = {5, 5, 5, 5}, - itemPadding = {5, 5, 5, 5}, - minItemWidth = 1, - maxItemWidth = 0, - minItemHeight = 1, - maxItemHeight = 0, - - autosize = false, - - rows = nil, - columns = nil, - orientation = "horizontal", --// "horizontal" or "vertical" - autoArrangeH = false, --FIXME rename - autoArrangeV = false, --FIXME rename - grid = false, --FIXME not implemented yet // if true, each row should have the same number of columns (table layout) - resizeItems = false, - centerItems = true, - - --[[ takes weights into account when resizing items (instead of same size for all) - - e.g. "component1.weight = 1, component2.weight = 2" => component2 will be 2 times larger than component1 - - if all components have same weight -> same layout as without weightedResize - - default value is 1 (nil interpreted as 1) - ]] - weightedResize = false, - - selectable = false, - multiSelect = true, - selectedItems = {}, - - OnSelectItem = {}, - OnDrawItem = {}, --FIXME - OnDblClickItem = {}, - - _rows = nil, - _columns = nil, - _cells = nil, -} - -local this = LayoutPanel -local inherited = this.inherited - ---//============================================================================= - -function LayoutPanel:New(obj) - obj = inherited.New(self,obj) - if (obj.selectable) then - obj.selectedItems = {[1]=true} - end - return obj -end - ---//============================================================================= - -function LayoutPanel:SetOrientation(orientation) - self.orientation = orientation - inherited.UpdateClientArea(self) -end - ---//============================================================================= - -local tsort = table.sort - ---//============================================================================= - -local function compareSizes(a,b) - return a[2] < b[2] -end - -function LayoutPanel:_JustCenterItemsH(startCell,endCell,freeSpace) - local _cells = self._cells - local perItemAlloc = freeSpace / ((endCell - startCell) + 1) - local n=0 - - for i=startCell,endCell do - local cell = _cells[i] - --if (self.orientation == "horizontal") then - cell[1] = cell[1] + n * perItemAlloc - cell[3] = cell[3] + perItemAlloc - --else - -- cell[2] = cell[2] + n * perItemHalfAlloc - -- cell[4] = cell[4] + perItemHalfAlloc - --end - n = n+1 - end -end - -function LayoutPanel:_JustCenterItemsV(startCell,endCell,freeSpace) - local _cells = self._cells - local perItemAlloc = freeSpace / ((endCell - startCell) + 1) - local n=0 - - for i=startCell,endCell do - local cell = _cells[i] - --if (self.orientation == "horizontal") then - cell[2] = cell[2] + n * perItemAlloc - cell[4] = cell[4] + perItemAlloc - --else - -- cell[1] = cell[1] + n * perItemHalfAlloc - -- cell[3] = cell[3] + perItemHalfAlloc - --end - n = n+1 - end -end - - -function LayoutPanel:_EnlargeToLineHeight(startCell, endCell, lineHeight) - local _cells = self._cells - local _cellPaddings = self._cellPaddings - - for i=startCell,endCell do - local cell = _cells[i] - local padding = _cellPaddings[i] - --if (self.orientation == "horizontal") then - cell[4] = lineHeight - padding[2] - padding[4] - --else - -- cell[3] = lineHeight - --end - end -end - - -function LayoutPanel:_AutoArrangeAbscissa(startCell,endCell,freeSpace) - if (startCell > endCell) then - return - end - - if (not self.autoArrangeH) then - if (self.centerItems) then - self:_JustCenterItemsH(startCell,endCell,freeSpace) - end - return - end - - local _cells = self._cells - - if (startCell == endCell) then - local cell = self._cells[startCell] - if (self.orientation == "horizontal") then - cell[1] = cell[1] + freeSpace/2 - else - cell[2] = cell[2] + freeSpace/2 - end - return - end - - --// create a sorted table with the cell sizes - local cellSizesCount = 0 - local cellSizes = {} - for i=startCell,endCell do - cellSizesCount = cellSizesCount + 1 - if (self.orientation == "horizontal") then - cellSizes[cellSizesCount] = {i,_cells[i][3]} - else - cellSizes[cellSizesCount] = {i,_cells[i][4]} - end - end - tsort(cellSizes,compareSizes) - - --// upto this index all cells have the same size (in the cellSizes table) - local sameSizeIdx = 1 - local shortestCellSize = cellSizes[1][2] - - while (freeSpace>0)and(sameSizeIdx= cellSizesCount) then - nextCellSize = self.maxItemWidth --FIXME orientation - else - nextCellSize = cellSizes[sameSizeIdx+1][2] - end - - - --// try to fillup the shorest cells to the 2. shortest cellsize (so we can repeat the process on n+1 cells) - --// (if all/multiple cells have the same size share the freespace between them) - local spaceToAlloc = shortestCellSize - nextCellSize - if (spaceToAlloc > freeSpace) then - spaceToAlloc = freeSpace - freeSpace = 0 - else - freeSpace = freeSpace - spaceToAlloc - end - local perItemAlloc = (spaceToAlloc / sameSizeIdx) - - - --// set the cellsizes/share the free space between cells - for i=1,sameSizeIdx do - local celli = cellSizes[i] - celli[2] = celli[2] + perItemAlloc --FIXME orientation - - local cell = _cells[ celli[1] ] - cell[3] = cell[3] + perItemAlloc --FIXME orientation - - --// adjust the top/left startcoord of all following cells (in the line) - for j=celli[1]+1,endCell do - local cell = _cells[j] - cell[1] = cell[1] + perItemAlloc --FIXME orientation - end - end - - shortestCellSize = nextCellSize - end -end - - -function LayoutPanel:_AutoArrangeOrdinate(freeSpace) - if (not self.autoArrangeV) then - if (self.centerItems) then - local startCell = 1 - local endCell = 1 - for i=2,#self._lines do - endCell = self._lines[i] - 1 - self:_JustCenterItemsV(startCell,endCell,freeSpace) - startCell = endCell + 1 - end - end - return - end - - local _lines = self._lines - local _cells = self._cells - - --// create a sorted table with the line sizes - local lineSizes = {} - for i=1,#_lines do - local first_cell_in_line = _cells[ _lines[i] ] - if (self.orientation == "horizontal") then --FIXME - lineSizes[i] = {i,first_cell_in_line[4]} - else - lineSizes[i] = {i,first_cell_in_line[3]} - end - end - tsort(lineSizes,compareSizes) - local lineSizesCount = #lineSizes - - --// upto this index all cells have the same size (in the cellSizes table) - local sameSizeIdx = 1 - local shortestLineSize = lineSizes[1][2] - - while (freeSpace>0)and(sameSizeIdx= lineSizesCount) then - nextLineSize = self.maxItemHeight --FIXME orientation - else - nextLineSize = lineSizes[sameSizeIdx+1][2] - end - - - --// try to fillup the shorest lines to the 2. shortest linesize (so we can repeat the process on n+1 lines) - --// (if all/multiple have the same size share the freespace between them) - local spaceToAlloc = shortestLineSize - nextLineSize - if (spaceToAlloc > freeSpace) then - spaceToAlloc = freeSpace - freeSpace = 0 - else - freeSpace = freeSpace - spaceToAlloc - end - local perItemAlloc = (spaceToAlloc / sameSizeIdx) - - - --// set the linesizes - for i=1,sameSizeIdx do - local linei = lineSizes[i] - linei[2] = linei[2] + perItemAlloc --FIXME orientation - - --// adjust the top/left startcoord of all following lines (in the line) - local nextLineIdx = linei[1]+1 - local nextLine = ((nextLineIdx <= #_lines) and _lines[ nextLineIdx ]) or #_cells+1 - for j=_lines[ linei[1] ],nextLine-1 do - local cell = _cells[j] - cell[4] = cell[4] + perItemAlloc --FIXME orientation - end - for j=nextLine,#_cells do - local cell = _cells[j] - cell[2] = cell[2] + perItemAlloc --FIXME orientation - end - end - - shortestLineSize = nextLineSize - end -end - ---//============================================================================= - -function LayoutPanel:GetMaxWeight() - --// calculate max weights for each column and row - local mweightx = {} - local mweighty = {} - - local cn = self.children - - local dir1,dir2 - if (self.orientation == "vertical") then - dir1,dir2 = self._columns,self._rows - else - dir1,dir2 = self._rows,self._columns - end - - local n,x,y = 1 - for i=1, dir1 do - for j=1, dir2 do - local child = cn[n] - if not child then break end - - if (self.orientation == "vertical") then - x,y = i,j - else - x,y = j,i - end - - local we = child.weight or 1 - if ((mweightx[x] or 0.001) < we) then - mweightx[x] = we - end - if ((mweighty[y] or 0.001) < we) then - mweighty[y] = we - end - n = n + 1 - end - end - - local weightx = table.sum(mweightx) - local weighty = table.sum(mweighty) - return mweightx,mweighty,weightx, weighty -end - - -function LayoutPanel:_GetMaxChildConstraints(child) - local children = self.children - - if (self._cells and not self._inUpdateLayout) then - for i=1, #children do - if CompareLinks(children[i], child) then - local cell = self._cells[i] - if (cell) then - return unpack4(cell) - end - end - end - end - - local itemPadding = self.itemPadding - local margin = child.margin or self.itemMargin - local maxChildWidth = -margin[1] - itemPadding[1] + self.clientWidth - itemPadding[3] - margin[3] - local maxChildHeight = -margin[2] - itemPadding[2] + self.clientHeight - itemPadding[4] - margin[4] - return margin[1] + itemPadding[1], margin[2] + itemPadding[2], maxChildWidth, maxChildHeight -end - ---//============================================================================= - -function LayoutPanel:GetMinimumExtents() ---[[ - local old = self.autosize - self.autosize = false - local right, bottom = inherited.GetMinimumExtents(self) - self.autosize = old - - return right, bottom ---]] - if (not self.autosize) then - local right = self.x + self.width - local bottom = self.y + self.height - - return right, bottom - else ---FIXME!!! - local right = self.x + self.width - local bottom = self.y + self.height - - return right, bottom - end -end - ---//============================================================================= ---// Note: there are two different layput functions depending on resizeItems - -function LayoutPanel:_LayoutChildrenResizeItems() - local cn = self.children - local cn_count = #cn - - --FIXME take minWidth/height maxWidth/Height into account! (and try to reach a 1:1 pixel ratio) - if self.columns and self.rows then - self._columns = self.columns - self._rows = self.rows - elseif (not self.columns) and self.rows then - self._columns = math.ceil(cn_count/self.rows) - self._rows = self.rows - elseif (not self.rows) and self.columns then - self._columns = self.columns - self._rows = math.ceil(cn_count/self.columns) - else - local size = math.ceil(cn_count^0.5) - self._columns = size - self._rows = math.ceil(cn_count/size) - end - - local childWidth = self.clientArea[3]/self._columns - local childHeight = self.clientArea[4]/self._rows - local childPosx = 0 - local childPosy = 0 - - self._cells = {} - local _cells = self._cells - - local weightsx,weightsy, maxweightx, maxweighty - if (self.weightedResize) then - weightsx,weightsy, maxweightx, maxweighty = self:GetMaxWeight() - --// special setup for weightedResize - childWidth = 0 - childHeight = 0 - end - - local dir1,dir2 - if (self.orientation == "vertical") then - dir1,dir2 = self._columns,self._rows - else - dir1,dir2 = self._rows,self._columns - end - - local n,x,y = 1 - for i=1, dir1 do - for j=1, dir2 do - local child = cn[n] - if not child then break end - local margin = child.margin or self.itemMargin - - if (self.orientation == "vertical") then - x,y = i,j - else - x,y = j,i - end - - if (self.weightedResize) then - --// weighted Position - if dir1 == 1 then - childPosx = 0 - else - childPosx = childPosx + childWidth - end - if dir2 == 1 then - childPosy = 0 - else - childPosy = childPosy + childHeight - end - childWidth = (self.clientArea[3]) * weightsx[x]/maxweightx - childHeight = (self.clientArea[4]) * weightsy[y]/maxweighty - else - --// position without weightedResize - childPosx = childWidth * (x-1) - childPosy = childHeight * (y-1) - end - - - local childBox = { - childPosx + margin[1], - childPosy + margin[2], - childWidth - margin[1] - margin[3], - childHeight - margin[2] - margin[4] - } - child:_UpdateConstraints(unpack4(childBox)) - _cells[n] = childBox - n = n+1 - end - end -end - - -function LayoutPanel:_LayoutChildren() - local cn = self.children - local cn_count = #cn - - self._lines = {1} - local _lines = self._lines - self._cells = {} - local _cells = self._cells - self._cellPaddings = {} - local _cellPaddings = self._cellPaddings - - local itemMargin = self.itemMargin - local itemPadding = self.itemPadding - - local cur_x,cur_y = 0,0 - local curLine, curLineSize = 1,self.minItemHeight - local totalChildWidth,totalChildHeight = 0 - local lineHeights = {} - local lineWidths = {} - - --// Handle orientations - local X,Y,W,H = "x","y","width","height" - local LEFT,TOP,RIGHT,BOTTOM = 1,2,3,4 - local WIDTH, HEIGHT = 3,4 - local minItemWidth, minItemHeight = self.minItemWidth, self.minItemHeight - local clientAreaWidth,clientAreaHeight = self.clientArea[3],self.clientArea[4] - - --// FIXME: finish me (use those vars in the loops below!) ---[[ - if (self.orientation ~= "horizontal") then - X,Y,W,H = "y","x","height","width" - LEFT,TOP,RIGHT,BOTTOM = 2,1,4,3 - WIDTH, HEIGHT = 4,3 - curLineSize = minItemWidth - minItemWidth, minItemHeight = minItemHeight, minItemWidth - clientAreaWidth,clientAreaHeight = clientAreaHeight, clientAreaWidth - end ---]] - ---[[FIXME breaks ListImageView! - if (self.autosize) then - local maxChildWidth = minItemWidth - for i=1, cn_count do - local child = cn[i] - - local childWidth = math.max(child[W], minItemWidth) - if (child.GetMinimumExtents) then - local extents = {child:GetMinimumExtents()} - childWidth = math.max(extents[LEFT], childWidth) - end - - maxChildWidth = math.max(childWidth, maxChildWidth) - end - totalMaxChildWidth = itemPadding[LEFT] + maxChildWidth + itemPadding[RIGHT] - - if (self.orientation == "horizontal") then - self:Resize(nil, totalMaxChildWidth, true, true) - clientAreaWidth,clientAreaHeight = self.clientArea[4],self.clientArea[3] - else - self:Resize(totalMaxChildWidth, nil, true, true) - clientAreaWidth,clientAreaHeight = self.clientArea[3],self.clientArea[4] - end - end ---]] - - for i=1, cn_count do - local child = cn[i] - if not child then break end - local margin = child.margin or itemMargin - - local childWidth = math.max(child[W],minItemWidth) - local childHeight = math.max(child[H],minItemHeight) - - local itemMarginL = margin[LEFT] - local itemMarginT = (curLine > 1) and margin[TOP] or 0 - local itemMarginR = margin[RIGHT] - local itemMarginB = (i < cn_count) and margin[BOTTOM] or 0 - - totalChildWidth = margin[LEFT] + itemPadding[LEFT] + childWidth + itemPadding[RIGHT] + margin[RIGHT] --// FIXME add margin just for non-border controls - totalChildHeight = itemMarginT + itemPadding[TOP] + childHeight + itemPadding[BOTTOM] + itemMarginB - - local cell_top = cur_y + itemPadding[TOP] + itemMarginT - local cell_left = cur_x + itemPadding[LEFT] + itemMarginL - local cell_width = childWidth - local cell_height = childHeight - - cur_x = cur_x + totalChildWidth - - if - (i>1)and - (self.columns and (((i - 1) % self.columns) < 1))or - ((not self.columns) and (cur_x > clientAreaWidth)) - then - lineHeights[curLine] = curLineSize - lineWidths[curLine] = cur_x - totalChildWidth - - --// start a new line - cur_x = totalChildWidth - cur_y = cur_y + curLineSize - - curLine = curLine+1 - curLineSize = math.max(minItemHeight, totalChildHeight) - cell_top = cur_y + itemMarginT + itemPadding[TOP] - cell_left = itemMarginL + itemPadding[LEFT] - _lines[curLine] = i - end - - _cells[i] = {cell_left, cell_top, cell_width, cell_height} - _cellPaddings[i] = {itemMarginL + itemPadding[LEFT], itemMarginT + itemPadding[TOP], itemMarginR + itemPadding[RIGHT], itemMarginB + itemPadding[BOTTOM]} - - if (totalChildHeight > curLineSize) then - curLineSize = totalChildHeight - end - end - - lineHeights[curLine] = curLineSize - lineWidths[curLine] = cur_x - - --// Move cur_y to the bottom of the new ClientArea/ContentArea - cur_y = cur_y + curLineSize - - --// Share remaining free space between items - if (self.centerItems or self.autoArrangeH or self.autoArrangeV) then - for i=1,#lineWidths do - local startcell = _lines[i] - local endcell = (_lines[i+1] or (#cn+1)) - 1 - local freespace = clientAreaWidth - lineWidths[i] - self:_AutoArrangeAbscissa(startcell, endcell, freespace) - end - - for i=1,#lineHeights do - local lineHeight = lineHeights[i] - local startcell = _lines[i] - local endcell = (_lines[i+1] or (#cn+1)) - 1 - self:_EnlargeToLineHeight(startcell, endcell, lineHeight) - end - self:_AutoArrangeOrdinate(clientAreaHeight - cur_y) - end - - --// Resize the LayoutPanel if needed - --FIXME do this in resize too! - if (self.autosize) then - --if (self.orientation == "horizontal") then - self:Resize(nil, cur_y, true, true) - --else - -- self:Resize(nil, cur_y, true, true) - --end - elseif (cur_y > clientAreaHeight) then - --Spring.Echo(debug.traceback()) - end - - --// Update the Children constraints - for i=1, cn_count do - local child = cn[i] - if not child then break end - - local cell = _cells[i] - local cposx,cposy = cell[LEFT],cell[TOP] - if (self.centerItems) then - cposx = cposx + (cell[WIDTH] - child[W]) * 0.5 - cposy = cposy + (cell[HEIGHT] - child[H]) * 0.5 - end - - --if (self.orientation == "horizontal") then - --FIXME use child:Resize or something like that - child:_UpdateConstraints(cposx,cposy) - --else - -- child:_UpdateConstraints(cposy,cposx) - --end - end -end - - ---//============================================================================= - -function LayoutPanel:UpdateLayout() - if (not self.children[1]) then ---FIXME redundant? - if (self.autosize) then - if (self.orientation == "horizontal") then - self:Resize(0, nil, false) - else - self:Resize(nil, 0, false) - end - end - return - end - - self._inUpdateLayout = true - - self:RealignChildren() - - --FIXME add check if any item.width > maxItemWidth (+Height) & add a new autosize tag for it - - if (self.resizeItems) then - self:_LayoutChildrenResizeItems() - else - self:_LayoutChildren() - end - - self._inUpdateLayout = false - - self:RealignChildren() --FIXME split SetPos from AlignControl!!! - - return true -end - ---//============================================================================= - -function LayoutPanel:DrawBackground() -end - - -function LayoutPanel:DrawItemBkGnd(index) -end - - -function LayoutPanel:DrawControl() - self:DrawBackground(self) -end - - -function LayoutPanel:DrawChildren() - local cn = self.children - if (not cn[1]) then return end - - gl.PushMatrix() - gl.Translate(self.clientArea[1], self.clientArea[2], 0) - for i=1,#cn do - self:DrawItemBkGnd(i) - end - if (self.debug) then - gl.Color(1,0,0,0.5) - for i=1,#self._cells do - local x,y,w,h = unpack4(self._cells[i]) - gl.Rect(x,y,x+w,y+h) - end - end - gl.PopMatrix() - - self:_DrawChildrenInClientArea('Draw') -end - - -function LayoutPanel:DrawChildrenForList() - local cn = self.children - if (not cn[1]) then return end - - if (self.debug) then - gl.Color(0,1,0,0.5) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) - gl.LineWidth(2) - gl.Rect(0, 0, self.width, self.height) - gl.LineWidth(1) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) - end - - gl.PushMatrix() - gl.Translate(self.clientArea[1], self.clientArea[2], 0) - for i=1,#cn do - self:DrawItemBkGnd(i) - end - if (self.debug) then - gl.Color(1,0,0,0.5) - for i=1,#self._cells do - local x,y,w,h = unpack4(self._cells[i]) - gl.Rect(x,y,x+w,y+h) - end - end - gl.PopMatrix() - - self:_DrawChildrenInClientArea('DrawForList') -end - ---//============================================================================= - -function LayoutPanel:GetItemIndexAt(cx,cy) - local cells = self._cells - local itemPadding = self.itemPadding - for i=1,#cells do - local cell = cells[i] - local cellbox = ExpandRect(cell,itemPadding) - if (InRect(cellbox, cx,cy)) then - return i - end - end - return -1 -end - - -function LayoutPanel:GetItemXY(itemIdx) - local cell = self._cells[itemIdx] - if (cell) then - return unpack4(cell) - end -end - ---//============================================================================= - -function LayoutPanel:MultiRectSelect(item1,item2,append) - --// note: this functions does NOT update self._lastSelected! - - --// select all items in the convex hull of those 2 items - local cells = self._cells - local itemPadding = self.itemPadding - - local cell1,cell2 = cells[item1],cells[item2] - - local convexHull = { - math.min(cell1[1],cell2[1]), - math.min(cell1[2],cell2[2]), - } - convexHull[3] = math.max(cell1[1]+cell1[3],cell2[1]+cell2[3]) - convexHull[1] - convexHull[4] = math.max(cell1[2]+cell1[4],cell2[2]+cell2[4]) - convexHull[2] - - local newSelected = self.selectedItems - if (not append) then - newSelected = {} - end - - for i=1,#cells do - local cell = cells[i] - local cellbox = ExpandRect(cell,itemPadding) - if (AreRectsOverlapping(convexHull,cellbox)) then - newSelected[i] = true - end - end - - if (not append) then - local oldSelected = self.selectedItems - self.selectedItems = newSelected - for itemIdx,selected in pairs(oldSelected) do - if (selected)and(not newSelected[itemIdx]) then - self:CallListeners(self.OnSelectItem, itemIdx, false) - end - end - for itemIdx,selected in pairs(newSelected) do - if (selected)and(not oldSelected[itemIdx]) then - self:CallListeners(self.OnSelectItem, itemIdx, true) - end - end - end - - self:Invalidate() -end - - -function LayoutPanel:ToggleItem(itemIdx) - local newstate = not self.selectedItems[itemIdx] - self.selectedItems[itemIdx] = newstate - self._lastSelected = itemIdx - self:CallListeners(self.OnSelectItem, itemIdx, newstate) - self:Invalidate() -end - - -function LayoutPanel:SelectItem(itemIdx, append) - if (self.selectedItems[itemIdx]) then - return - end - - if (append) then - self.selectedItems[itemIdx] = true - else - local oldItems = self.selectedItems - self.selectedItems = {[itemIdx]=true} - for oldItemIdx in pairs(oldItems) do - if (oldItemIdx ~= itemIdx) then - self:CallListeners(self.OnSelectItem, oldItemIdx, false) - end - end - end - self._lastSelected = itemIdx - self:CallListeners(self.OnSelectItem, itemIdx, true) - self:Invalidate() -end - - -function LayoutPanel:DeselectItem(itemIdx) - if (not self.selectedItems[itemIdx]) then - return - end - - self.selectedItems[itemIdx] = false - self._lastSelected = itemIdx - self:CallListeners(self.OnSelectItem, itemIdx, false) - self:Invalidate() -end - - -function LayoutPanel:SelectAll() - for i=1,#self.children do - self:SelectItem(i, append) - end -end - - -function LayoutPanel:DeselectAll() - for idx in pairs(self.selectedItems) do - self:DeselectItem(idx) - end -end - - ---//============================================================================= - -function LayoutPanel:MouseDown(x,y,button,mods) - local clickedChild = inherited.MouseDown(self,x,y,button,mods) - if (clickedChild) then - return clickedChild - end - - if (not self.selectable) then return end - - --//FIXME HitTest just returns true when we hover a children -> this won't get called when you hit on in empty space! - if (button==3) then - self:DeselectAll() - return self - end - - local cx,cy = self:LocalToClient(x,y) - local itemIdx = self:GetItemIndexAt(cx,cy) - - if (itemIdx>0) then - if (self.multiSelect) then - if (mods.shift and mods.ctrl) then - self:MultiRectSelect(itemIdx,self._lastSelected or 1, true) - elseif (mods.shift) then - self:MultiRectSelect(itemIdx,self._lastSelected or 1) - elseif (mods.ctrl) then - self:ToggleItem(itemIdx) - else - self:SelectItem(itemIdx) - end - else - self:SelectItem(itemIdx) - end - - return self - end -end - - -function LayoutPanel:MouseDblClick(x,y,button,mods) - local clickedChild = inherited.MouseDown(self,x,y,button,mods) - if (clickedChild) then - return clickedChild - end - - if (not self.selectable) then return end - - local cx,cy = self:LocalToClient(x,y) - local itemIdx = self:GetItemIndexAt(cx,cy) - - if (itemIdx>0) then - self:CallListeners(self.OnDblClickItem, itemIdx) - return self - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/line.lua b/LuaIntro/chili/chili/controls/line.lua deleted file mode 100644 index a54f6379e..000000000 --- a/LuaIntro/chili/chili/controls/line.lua +++ /dev/null @@ -1,14 +0,0 @@ ---//============================================================================= - -Line = Control:Inherit{ - classname= "line", - caption = 'line', - defaultWidth = 100, - defaultHeight = 1, - style = "horizontal", -} - -local this = Line -local inherited = this.inherited - ---//============================================================================= \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/multiprogressbar.lua b/LuaIntro/chili/chili/controls/multiprogressbar.lua deleted file mode 100644 index 83f552591..000000000 --- a/LuaIntro/chili/chili/controls/multiprogressbar.lua +++ /dev/null @@ -1,160 +0,0 @@ ---//============================================================================= - -Multiprogressbar = Control:Inherit{ - classname = "multiprogressbar", - - defaultWidth = 90, - defaultHeight = 20, - - padding = {0,0,0,0}, - drawBorder = false, - borderColor = {1,0,0,1}, - orientation = "horizontal", - reverse = false, -- draw in reversed orientation - - scaleFunction = nil, --- function that can be used to rescale graph - takes 0-1 and must return 0-1 - - - bars = { -- list of bar components to display - { - color1 = {1,0,1,1}, - color2 = {0.7,0,0.7,1}, - percent = 0.2, - texture = nil, -- texture file name - s = 1, -- tex coords - t = 1, - tileSize = nil, -- if set then main axis texture coord = width / tileSize - }, - - } -} - -local this = Multiprogressbar -local inherited = this.inherited - ---//============================================================================= - -local glVertex = gl.Vertex -local glColor = gl.Color -local glBeginEnd = gl.BeginEnd - -local function drawBox(x,y,w,h) - glVertex(x,y) - glVertex(x+w,y) - glVertex(x+w,y+h) - glVertex(x,y+h) -end - -local function drawBarH(x,y,w,h,color1, color2) - glColor(color1) - glVertex(x,y) - glVertex(x+w,y) - glColor(color2) - glVertex(x+w,y+h) - glVertex(x,y+h) -end - -local function drawBarV(x,y,w,h,color1, color2) - glColor(color1) - glVertex(x,y) - glVertex(x,y+h) - glColor(color2) - glVertex(x+w,y+h) - glVertex(x+w,y) -end - - -function Multiprogressbar:DrawControl() - local percentDone = 0 - local efp - - - if (self.scaleFunction ~= nil) then -- if using non linear scale fix the bar - local totalPercent = 0 - for _,b in ipairs(self.bars) do - totalPercent = totalPercent + (b.percent or 0) - end - - local resize = self.scaleFunction(totalPercent) / totalPercent - for _,b in ipairs(self.bars) do - b._drawPercent = b.percent * resize - end - else - for _,b in ipairs(self.bars) do - b._drawPercent = b.percent - end - end - - - if (self.orientation=="horizontal") then - for _,b in ipairs(self.bars) do - if b._drawPercent > 0 then - if (self.reverse) then - efp = 1 - percentDone - b._drawPercent - else - efp = percentDone - end - if (b.color1 ~= nil) then - glBeginEnd(GL.QUADS, drawBarH, efp * self.width, 0, self.width * b._drawPercent, self.height, b.color1, b.color2) - end - percentDone = percentDone + b._drawPercent - - if b.texture then - TextureHandler.LoadTexture(b.texture,self) - glColor(1,1,1,1) - - local bs = b.s - if (b.tileSize) then - bs = self.width * b._drawPercent / b.tileSize - end - gl.TexRect(efp * self.width, 0, (efp + b._drawPercent) * self.width, self.height, 0,0,bs,b.t) - gl.Texture(false) - end - end - end - - else - for _,b in ipairs(self.bars) do - if b._drawPercent > 0 then - if (self.reverse) then - efp = 1 - percentDone - b._drawPercent - else - efp = percentDone - end - - if (b.color1 ~= nil) then glBeginEnd(GL.QUADS, drawBarV, 0, efp * self.height, self.width, self.height * b._drawPercent, b.color1, b.color2) end - - percentDone = percentDone + b._drawPercent - - if b.texture then - TextureHandler.LoadTexture(b.texture,self) - glColor(1,1,1,1) - - local bt = b.t - if (b.tileSize) then - bt = self.height * b._drawPercent / b.tileSize - end - gl.TexRect(0, efp * self.height, self.width, (efp + b._drawPercent) * self.height, 0,0,b.s,bt) - gl.Texture(false) - end - end - end - end - - - - if self.drawBorder then - glColor(self.borderColor) - glBeginEnd(GL.LINE_LOOP, drawBox, 0, 0, self.width, self.height) - end - -end - ---//============================================================================= - -function Multiprogressbar:HitTest() - return self -end - - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/object.lua b/LuaIntro/chili/chili/controls/object.lua deleted file mode 100644 index 3320d0bd0..000000000 --- a/LuaIntro/chili/chili/controls/object.lua +++ /dev/null @@ -1,906 +0,0 @@ ---//============================================================================= - -Object = { - classname = 'object', - --x = 0, - --y = 0, - --width = 10, - --height = 10, - defaultWidth = 10, --FIXME really needed? - defaultHeight = 10, - - visible = true, - --hidden = false, --// synonym for above - - preserveChildrenOrder = false, --// if false adding/removing children is much faster, but also the order (in the .children array) isn't reliable anymore - - children = {}, - children_hidden = {}, - childrenByName = CreateWeakTable(), - - OnDispose = {}, - OnClick = {}, - OnDblClick = {}, - OnMouseDown = {}, - OnMouseUp = {}, - OnMouseMove = {}, - OnMouseWheel = {}, - OnMouseOver = {}, - OnMouseOut = {}, - OnKeyPress = {}, - OnFocusUpdate = {}, - - disableChildrenHitTest = false, --// if set childrens are not clickable/draggable etc - their mouse events are not processed -} - -do - local __lowerkeys = {} - Object.__lowerkeys = __lowerkeys - for i,v in pairs(Object) do - if (type(i)=="string") then - __lowerkeys[i:lower()] = i - end - end -end - -local this = Object -local inherited = this.inherited - ---//============================================================================= ---// used to generate unique objects names - -local cic = {} -local function GetUniqueId(classname) - local ci = cic[classname] or 0 - cic[classname] = ci + 1 - return ci -end - ---//============================================================================= - -function Object:New(obj) - obj = obj or {} - - --// check if the user made some lower-/uppercase failures - for i,v in pairs(obj) do - if (not self[i])and(isstring(i)) then - local correctName = self.__lowerkeys[i:lower()] - if (correctName)and(obj[correctName] == nil) then - obj[correctName] = v - end - end - end - - --// give name - if (not obj.name) then - obj.name = self.classname .. GetUniqueId(self.classname) - end - - --// make an instance - for i,v in pairs(self) do --// `self` means the class here and not the instance! - if (i ~= "inherited") then - local t = type(v) - local ot = type(obj[i]) - if (t=="table")or(t=="metatable") then - if (ot == "nil") then - obj[i] = {}; - ot = "table"; - end - if (ot ~= "table")and(ot ~= "metatable") then - Spring.Echo("Chili: " .. obj.name .. ": Wrong param type given to " .. i .. ": got " .. ot .. " expected table.") - obj[i] = {} - end - - table.merge(obj[i],v) - if (t=="metatable") then - setmetatable(obj[i], getmetatable(v)) - end - elseif (ot == "nil") then - obj[i] = v - end - end - end - setmetatable(obj,{__index = self}) - - --// auto dispose remaining Dlists etc. when garbage collector frees this object - local hobj = MakeHardLink(obj) - - --// handle children & parent - local parent = obj.parent - if (parent) then - obj.parent = nil - --// note: we are using the hardlink here, - --// else the link could get gc'ed and dispose our object - parent:AddChild(hobj) - end - local cn = obj.children - obj.children = {} - for i=1,#cn do - obj:AddChild(cn[i],true) - end - - --// sets obj._widget - DebugHandler:RegisterObject(obj) - - return hobj -end - - --- calling this releases unmanaged resources like display lists and disposes of the object --- children are disposed too --- todo: use scream, in case the user forgets --- nil -> nil -function Object:Dispose(_internal) - if (not self.disposed) then - - --// check if the control is still referenced (if so it would indicate a bug in chili's gc) - if _internal then - if self._hlinks and next(self._hlinks) then - local hlinks_cnt = table.size(self._hlinks) - local i,v = next(self._hlinks) - if hlinks_cnt > 1 or (v ~= self) then --// check if user called Dispose() directly - Spring.Echo(("Chili: tried to dispose \"%s\"! It's still referenced %i times!"):format(self.name, hlinks_cnt)) - end - end - end - - self:CallListeners(self.OnDispose) - - self.disposed = true - - TaskHandler.RemoveObject(self) - --DebugHandler:UnregisterObject(self) --// not needed - - if (UnlinkSafe(self.parent)) then - self.parent:RemoveChild(self) - end - self:SetParent(nil) - self:ClearChildren() - end -end - - -function Object:AutoDispose() - self:Dispose(true) -end - - -function Object:Clone() - local newinst = {} - -- FIXME - return newinst -end - - -function Object:Inherit(class) - class.inherited = self - - for i,v in pairs(self) do - if (class[i] == nil)and(i ~= "inherited")and(i ~= "__lowerkeys") then - t = type(v) - if (t == "table") --[[or(t=="metatable")--]] then - class[i] = table.shallowcopy(v) - else - class[i] = v - end - end - end - - local __lowerkeys = {} - class.__lowerkeys = __lowerkeys - for i,v in pairs(class) do - if (type(i)=="string") then - __lowerkeys[i:lower()] = i - end - end - - --setmetatable(class,{__index=self}) - - --// backward compability with old DrawControl gl state (change was done with v2.1) - local w = DebugHandler.GetWidgetOrigin() - if (w ~= widget)and(w ~= Chili) then - class._hasCustomDrawControl = true - end - - return class -end - ---//============================================================================= - -function Object:SetParent(obj) - obj = UnlinkSafe(obj) - local typ = type(obj) - - if (typ ~= "table") then - self.parent = nil - return - end - - self.parent = MakeWeakLink(obj, self.parent) - - self:Invalidate() -end - - -function Object:AddChild(obj, dontUpdate) - local objDirect = UnlinkSafe(obj) - - if (self.children[objDirect]) then - Spring.Echo(("Chili: tried to add multiple times \"%s\" to \"%s\"!"):format(obj.name, self.name)) - return - end - - local hobj = MakeHardLink(objDirect) - - if (obj.name) then - if (self.childrenByName[obj.name]) then - error(("Chili: There is already a control with the name `%s` in `%s`!"):format(obj.name, self.name)) - return - end - self.childrenByName[obj.name] = hobj - end - - if UnlinkSafe(obj.parent) then - obj.parent:RemoveChild(obj) - end - obj:SetParent(self) - - local children = self.children - local i = #children+1 - children[i] = objDirect - children[hobj] = i - children[objDirect] = i - self:Invalidate() -end - - -function Object:RemoveChild(child) - if not isindexable(child) then - return child - end - - if CompareLinks(child.parent,self) then - child:SetParent(nil) - end - - local childDirect = UnlinkSafe(child) - - if (self.children_hidden[childDirect]) then - self.children_hidden[childDirect] = nil - return true - end - - if (not self.children[childDirect]) then - --Spring.Echo(("Chili: tried remove none child \"%s\" from \"%s\"!"):format(child.name, self.name)) - --Spring.Echo(DebugHandler.Stacktrace()) - return false - end - - if (child.name) then - self.childrenByName[child.name] = nil - end - - for i,v in pairs(self.children) do - if CompareLinks(childDirect,i) then - self.children[i] = nil - end - end - - local children = self.children - local cn = #children - for i=1,cn do - if CompareLinks(childDirect,children[i]) then - if (self.preserveChildrenOrder) then - --// slow - table.remove(children, i) - else - --// fast - children[i] = children[cn] - children[cn] = nil - end - - children[child] = nil --FIXME (unused/unuseful?) - children[childDirect] = nil - - self:Invalidate() - return true - end - end - return false -end - - -function Object:ClearChildren() - --// make it faster - local old = self.preserveChildrenOrder - self.preserveChildrenOrder = false - - --// remove all children - for i=1,#self.children_hidden do - self:ShowChild(self.children_hidden[i]) - end - - for i=#self.children,1,-1 do - self:RemoveChild(self.children[i]) - end - - --// restore old state - self.preserveChildrenOrder = old -end - - -function Object:IsEmpty() - return (not self.children[1]) -end - ---//============================================================================= - -function Object:HideChild(obj) - --FIXME cause of performance reasons it would be usefull to use the direct object, but then we need to cache the link somewhere to avoid the auto calling of dispose - local objDirect = UnlinkSafe(obj) - - if (not self.children[objDirect]) then - --if (self.debug) then - Spring.Echo("Chili: tried to hide a non-child (".. (obj.name or "") ..")") - --end - return - end - - if (self.children_hidden[objDirect]) then - --if (self.debug) then - Spring.Echo("Chili: tried to hide the same child multiple times (".. (obj.name or "") ..")") - --end - return - end - - local hobj = MakeHardLink(objDirect) - local pos = {hobj, 0, nil, nil} - - local children = self.children - local cn = #children - for i=1,cn+1 do - if CompareLinks(objDirect,children[i]) then - pos = {hobj, i, MakeWeakLink(children[i-1]), MakeWeakLink(children[i+1])} - break - end - end - - self:RemoveChild(obj) - self.children_hidden[objDirect] = pos - obj.parent = self -end - - -function Object:ShowChild(obj) - --FIXME cause of performance reasons it would be usefull to use the direct object, but then we need to cache the link somewhere to avoid the auto calling of dispose - local objDirect = UnlinkSafe(obj) - - if (not self.children_hidden[objDirect]) then - --if (self.debug) then - Spring.Echo("Chili: tried to show a non-child (".. (obj.name or "") ..")") - --end - return - end - - if (self.children[objDirect]) then - --if (self.debug) then - Spring.Echo("Chili: tried to show the same child multiple times (".. (obj.name or "") ..")") - --end - return - end - - local params = self.children_hidden[objDirect] - self.children_hidden[objDirect] = nil - - local children = self.children - local cn = #children - - if (params[3]) then - for i=1,cn do - if CompareLinks(params[3],children[i]) then - self:AddChild(obj) - self:SetChildLayer(obj,i+1) - return true - end - end - end - - self:AddChild(obj) - self:SetChildLayer(obj,params[2]) - return true -end - - -function Object:SetVisibility(visible) - if (visible) then - self.parent:ShowChild(self) - else - self.parent:HideChild(self) - end - self.visible = visible - self.hidden = not visible -end - - -function Object:Hide() - self:SetVisibility(false) -end - - -function Object:Show() - self:SetVisibility(true) -end - - -function Object:ToggleVisibility() - self:SetVisibility(not self.visible) -end - ---//============================================================================= - -function Object:SetChildLayer(child,layer) - child = UnlinkSafe(child) - local children = self.children - - layer = math.min(layer, #children) - - --// it isn't at the same pos anymore, search it! - for i=1,#children do - if CompareLinks(children[i], child) then - table.remove(children,i) - break - end - end - table.insert(children,layer,child) - self:Invalidate() -end - - -function Object:SetLayer(layer) - if (self.parent) then - (self.parent):SetChildLayer(self, layer) - end -end - - -function Object:BringToFront() - self:SetLayer(1) -end - ---//============================================================================= - -function Object:InheritsFrom(classname) - if (self.classname == classname) then - return true - elseif not self.inherited then - return false - else - return self.inherited.InheritsFrom(self.inherited,classname) - end -end - ---//============================================================================= - -function Object:GetChildByName(name) - local cn = self.children - for i=1,#cn do - if (name == cn[i].name) then - return cn[i] - end - end - - for c in pairs(self.children_hidden) do - if (name == c.name) then - return MakeWeakLink(c) - end - end -end - ---// Backward-Compability -Object.GetChild = Object.GetChildByName - - ---// Resursive search to find an object by its name -function Object:GetObjectByName(name) - local r = self.childrenByName[name] - if r then return r end - - for i=1,#self.children do - local c = self.children[i] - if (name == c.name) then - return c - else - local result = c:GetObjectByName(name) - if (result) then - return result - end - end - end - - for c in pairs(self.children_hidden) do - if (name == c.name) then - return MakeWeakLink(c) - else - local result = c:GetObjectByName(name) - if (result) then - return result - end - end - end -end - - ---// Climbs the family tree and returns the first parent that satisfies a ---// predicate function or inherites the given class. ---// Returns nil if not found. -function Object:FindParent(predicate) - if not self.parent then - return -- not parent with such class name found, return nil - elseif (type(predicate) == "string" and (self.parent):InheritsFrom(predicate)) or - (type(predicate) == "function" and predicate(self.parent)) then - return self.parent - else - return self.parent:FindParent(predicate) - end -end - - -function Object:IsDescendantOf(object, _already_unlinked) - if (not _already_unlinked) then - object = UnlinkSafe(object) - end - if (UnlinkSafe(self) == object) then - return true - end - if (self.parent) then - return (self.parent):IsDescendantOf(object, true) - end - return false -end - - -function Object:IsAncestorOf(object, _level, _already_unlinked) - _level = _level or 1 - - if (not _already_unlinked) then - object = UnlinkSafe(object) - end - - local children = self.children - - for i=1,#children do - if (children[i] == object) then - return true, _level - end - end - - _level = _level + 1 - for i=1,#children do - local c = children[i] - local res,lvl = c:IsAncestorOf(object, _level, true) - if (res) then - return true, lvl - end - end - - return false -end - ---//============================================================================= - -function Object:CallListeners(listeners, ...) - for i=1,#listeners do - local eventListener = listeners[i] - if eventListener(self, ...) then - return true - end - end -end - - -function Object:CallListenersInverse(listeners, ...) - for i=#listeners,1,-1 do - local eventListener = listeners[i] - if eventListener(self, ...) then - return true - end - end -end - - -function Object:CallChildren(eventname, ...) - local children = self.children - for i=1,#children do - local child = children[i] - if (child) then - local obj = child[eventname](child, ...) - if (obj) then - return obj - end - end - end -end - - -function Object:CallChildrenInverse(eventname, ...) - local children = self.children - for i=#children,1,-1 do - local child = children[i] - if (child) then - local obj = child[eventname](child, ...) - if (obj) then - return obj - end - end - end -end - - -function Object:CallChildrenInverseCheckFunc(checkfunc,eventname, ...) - local children = self.children - for i=#children,1,-1 do - local child = children[i] - if (child)and(checkfunc(self,child)) then - local obj = child[eventname](child, ...) - if (obj) then - return obj - end - end - end -end - - -local function InLocalRect(cx,cy,w,h) - return (cx>=0)and(cy>=0)and(cx<=w)and(cy<=h) -end - - -function Object:CallChildrenHT(eventname, x, y, ...) - if self.disableChildrenHitTest then - return nil - end - local children = self.children - for i=1,#children do - local c = children[i] - if (c) then - local cx,cy = c:ParentToLocal(x,y) - if InLocalRect(cx,cy,c.width,c.height) and c:HitTest(cx,cy) then - local obj = c[eventname](c, cx, cy, ...) - if (obj) then - return obj - end - end - end - end -end - - -function Object:CallChildrenHTWeak(eventname, x, y, ...) - if self.disableChildrenHitTest then - return nil - end - local children = self.children - for i=1,#children do - local c = children[i] - if (c) then - local cx,cy = c:ParentToLocal(x,y) - if InLocalRect(cx,cy,c.width,c.height) then - local obj = c[eventname](c, cx, cy, ...) - if (obj) then - return obj - end - end - end - end -end - ---//============================================================================= - -function Object:RequestUpdate() - --// we have something todo in Update - --// so we register this object in the taskhandler - TaskHandler.RequestUpdate(self) -end - - -function Object:Invalidate() - --FIXME should be Control only -end - - -function Object:Draw() - self:CallChildrenInverse('Draw') -end - - -function Object:TweakDraw() - self:CallChildrenInverse('TweakDraw') -end - ---//============================================================================= - -function Object:LocalToParent(x,y) - return x + self.x, y + self.y -end - - -function Object:ParentToLocal(x,y) - return x - self.x, y - self.y -end - - -Object.ParentToClient = Object.ParentToLocal -Object.ClientToParent = Object.LocalToParent - - -function Object:LocalToClient(x,y) - return x,y -end - - -function Object:LocalToScreen(x,y) - if (not self.parent) then - return x,y - end - --Spring.Echo((not self.parent) and debug.traceback()) - return (self.parent):ClientToScreen(self:LocalToParent(x,y)) -end - - -function Object:ClientToScreen(x,y) - if (not self.parent) then - return self:ClientToParent(x,y) - end - return (self.parent):ClientToScreen(self:ClientToParent(x,y)) -end - - -function Object:ScreenToLocal(x,y) - if (not self.parent) then - return self:ParentToLocal(x,y) - end - return self:ParentToLocal((self.parent):ScreenToClient(x,y)) -end - - -function Object:ScreenToClient(x,y) - if (not self.parent) then - return self:ParentToClient(x,y) - end - return self:ParentToClient((self.parent):ScreenToClient(x,y)) -end - - -function Object:LocalToObject(x, y, obj) - if CompareLinks(self,obj) then - return x, y - end - if (not self.parent) then - return -1,-1 - end - x, y = self:LocalToParent(x, y) - return self.parent:LocalToObject(x, y, obj) -end - ---//============================================================================= - -function Object:_GetMaxChildConstraints(child) - return 0, 0, self.width, self.height -end - ---//============================================================================= - - -function Object:HitTest(x,y) - if not self.disableChildrenHitTest then - local children = self.children - for i=1,#children do - local c = children[i] - if (c) then - local cx,cy = c:ParentToLocal(x,y) - if InLocalRect(cx,cy,c.width,c.height) then - local obj = c:HitTest(cx,cy) - if (obj) then - return obj - end - end - end - end - end - - return false -end - - -function Object:IsAbove(x, y, ...) - return self:HitTest(x,y) -end - - -function Object:MouseMove(...) - if (self:CallListeners(self.OnMouseMove, ...)) then - return self - end - - return self:CallChildrenHT('MouseMove', ...) -end - - -function Object:MouseDown(...) - if (self:CallListeners(self.OnMouseDown, ...)) then - return self - end - - return self:CallChildrenHT('MouseDown', ...) -end - - -function Object:MouseUp(...) - if (self:CallListeners(self.OnMouseUp, ...)) then - return self - end - - return self:CallChildrenHT('MouseUp', ...) -end - - -function Object:MouseClick(...) - if (self:CallListeners(self.OnClick, ...)) then - return self - end - - return self:CallChildrenHT('MouseClick', ...) -end - - -function Object:MouseDblClick(...) - if (self:CallListeners(self.OnDblClick, ...)) then - return self - end - - return self:CallChildrenHT('MouseDblClick', ...) -end - - -function Object:MouseWheel(...) - if (self:CallListeners(self.OnMouseWheel, ...)) then - return self - end - - return self:CallChildrenHTWeak('MouseWheel', ...) -end - - -function Object:MouseOver(...) - if (self:CallListeners(self.OnMouseOver, ...)) then - return self - end -end - - -function Object:MouseOut(...) - if (self:CallListeners(self.OnMouseOut, ...)) then - return self - end -end - - -function Object:KeyPress(...) - if (self:CallListeners(self.OnKeyPress, ...)) then - return self - end - - return false -end - - -function Object:FocusUpdate(...) - if (self:CallListeners(self.OnFocusUpdate, ...)) then - return self - end - - return false -end - ---//============================================================================= - diff --git a/LuaIntro/chili/chili/controls/panel.lua b/LuaIntro/chili/chili/controls/panel.lua deleted file mode 100644 index 8d5e319e7..000000000 --- a/LuaIntro/chili/chili/controls/panel.lua +++ /dev/null @@ -1,12 +0,0 @@ ---//============================================================================= - -Panel = Control:Inherit{ - classname= "panel", - defaultWidth = 100, - defaultHeight = 100, -} - -local this = Panel -local inherited = this.inherited - ---//============================================================================= \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/progressbar.lua b/LuaIntro/chili/chili/controls/progressbar.lua deleted file mode 100644 index ad722c729..000000000 --- a/LuaIntro/chili/chili/controls/progressbar.lua +++ /dev/null @@ -1,116 +0,0 @@ ---//============================================================================= - -Progressbar = Control:Inherit{ - classname = "progressbar", - - defaultWidth = 90, - defaultHeight = 20, - - min = 0, - max = 100, - value = 100, - - caption = "", - - color = {0,0,1,1}, - backgroundColor = {1,1,1,1}, - - OnChange = {}, -} - -local this = Progressbar -local inherited = this.inherited - ---//============================================================================= - -function Progressbar:New(obj) - obj = inherited.New(self,obj) - obj:SetMinMax(obj.min,obj.max) - obj:SetValue(obj.value) - return obj -end - ---//============================================================================= - -function Progressbar:_Clamp(v) - if (self.minself.max) then - v = self.max - end - else - if (v>self.min) then - v = self.min - elseif (v= 0) then - local scale = self.width / (self.max-self.min) - font:Print(0, scale * (0 - self.min), 0, "center", "ascender") - end - - font:Print(self.min, 0, 0, "left", "ascender") - font:Print("+"..self.max, self.width, 0, "right", "ascender") -end - ---//============================================================================= - -function Scale:HitTest() - return false -end - - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/screen.lua b/LuaIntro/chili/chili/controls/screen.lua deleted file mode 100644 index 5a040c5b5..000000000 --- a/LuaIntro/chili/chili/controls/screen.lua +++ /dev/null @@ -1,274 +0,0 @@ -Screen = Object:Inherit{ ---Screen = Control:Inherit{ - classname = 'screen', - x = 0, - y = 0, - width = 0, - height = 0, - - preserveChildrenOrder = true, - - activeControl = nil, - focusedControl = nil, - hoveredControl = nil, - currentTooltip = nil, - _lastHoveredControl = nil, - - _lastClicked = Spring.GetTimer(), - _lastClickedX = 0, - _lastClickedY = 0, -} - -local this = Screen -local inherited = this.inherited - ---//============================================================================= - -function Screen:New(obj) - local vsx,vsy = gl.GetViewSizes() - if ((obj.width or -1) <= 0) then - obj.width = vsx - end - if ((obj.height or -1) <= 0) then - obj.height = vsy - end - - obj = inherited.New(self,obj) - - TaskHandler.RequestGlobalDispose(obj) - obj:RequestUpdate() - - return obj -end - - -function Screen:OnGlobalDispose(obj) - if CompareLinks(self.activeControl, obj) then - self.activeControl = nil - end - - if CompareLinks(self.hoveredControl, obj) then - self.hoveredControl = nil - end - - if CompareLinks(self._lastHoveredControl, obj) then - self._lastHoveredControl = nil - end - - if CompareLinks(self.focusedControl, obj) then - self.focusedControl = nil - end -end - ---//============================================================================= - ---FIXME add new coordspace Device (which does y-invert) - -function Screen:ParentToLocal(x,y) - return x, y -end - - -function Screen:LocalToParent(x,y) - return x, y -end - - -function Screen:LocalToScreen(x,y) - return x, y -end - - -function Screen:ScreenToLocal(x,y) - return x, y -end - - -function Screen:ScreenToClient(x,y) - return x, y -end - - -function Screen:ClientToScreen(x,y) - return x, y -end - - -function Screen:IsRectInView(x,y,w,h) - return - (x <= self.width) and - (x + w >= 0) and - (y <= self.height) and - (y + h >= 0) -end - - ---//============================================================================= - -function Screen:Resize(w,h) - self.width = w - self.height = h - self:CallChildren("RequestRealign") -end - - ---//============================================================================= - -function Screen:Update(...) - --//FIXME create a passive MouseMove event and use it instead? - self:RequestUpdate() - local hoveredControl = UnlinkSafe(self.hoveredControl) - local activeControl = UnlinkSafe(self.activeControl) - if hoveredControl and (not activeControl) then - local x, y = Spring.GetMouseState() - y = select(2,gl.GetViewSizes()) - y - local cx,cy = hoveredControl:ScreenToLocal(x, y) - hoveredControl:MouseMove(cx, cy, 0, 0) - end -end - - -function Screen:IsAbove(x,y,...) - local activeControl = UnlinkSafe(self.activeControl) - if activeControl then - return true - end - - y = select(2,gl.GetViewSizes()) - y - local hoveredControl = inherited.IsAbove(self,x,y,...) - - --// tooltip - if not CompareLinks(hoveredControl, self._lastHoveredControl) then - if self._lastHoveredControl then - self._lastHoveredControl:MouseOut() - end - if hoveredControl then - hoveredControl:MouseOver() - end - - self.hoveredControl = MakeWeakLink(hoveredControl, self.hoveredControl) - if (hoveredControl) then - local control = hoveredControl - --// find tooltip in hovered control or its parents - while (not control.tooltip)and(control.parent) do - control = control.parent - end - self.currentTooltip = control.tooltip - else - self.currentTooltip = nil - end - self._lastHoveredControl = self.hoveredControl - elseif (self._lastHoveredControl) then - self.currentTooltip = self._lastHoveredControl.tooltip - end - - return (not not hoveredControl) -end - - -function Screen:MouseDown(x,y,...) - y = select(2,gl.GetViewSizes()) - y - - local activeControl = inherited.MouseDown(self,x,y,...) - self.activeControl = MakeWeakLink(activeControl, self.activeControl) - if not CompareLinks(self.activeControl, self.focusedControl) then - local focusedControl = UnlinkSafe(self.focusedControl) - if focusedControl then - focusedControl.state.focused = false - focusedControl:FocusUpdate() --rename FocusLost() - end - self.focusedControl = nil - if self.activeControl then - self.focusedControl = MakeWeakLink(activeControl, self.focusedControl) - self.focusedControl.state.focused = true - self.focusedControl:FocusUpdate() --rename FocusGain() - end - end - return (not not activeControl) -end - - -function Screen:MouseUp(x,y,...) - y = select(2,gl.GetViewSizes()) - y - - local activeControl = UnlinkSafe(self.activeControl) - if activeControl then - local cx,cy = activeControl:ScreenToLocal(x,y) - local now = Spring.GetTimer() - local obj - - local hoveredControl = inherited.IsAbove(self,x,y,...) - - if CompareLinks(hoveredControl, activeControl) then - --//FIXME send this to controls too, when they didn't `return self` in MouseDown! - if (math.abs(x - self._lastClickedX)<3) and - (math.abs(y - self._lastClickedY)<3) and - (Spring.DiffTimers(now,self._lastClicked) < 0.45 ) --FIXME 0.45 := doubleClick time (use spring config?) - then - obj = activeControl:MouseDblClick(cx,cy,...) - end - if (obj == nil) then - obj = activeControl:MouseClick(cx,cy,...) - end - end - self._lastClicked = now - self._lastClickedX = x - self._lastClickedY = y - - obj = activeControl:MouseUp(cx,cy,...) or obj - self.activeControl = nil - return (not not obj) - else - return (not not inherited.MouseUp(self,x,y,...)) - end -end - - -function Screen:MouseMove(x,y,dx,dy,...) - y = select(2,gl.GetViewSizes()) - y - local activeControl = UnlinkSafe(self.activeControl) - if activeControl then - local cx,cy = activeControl:ScreenToLocal(x,y) - local obj = activeControl:MouseMove(cx,cy,dx,-dy,...) - if (obj==false) then - self.activeControl = nil - elseif (not not obj)and(obj ~= activeControl) then - self.activeControl = MakeWeakLink(obj, self.activeControl) - return true - else - return true - end - end - - return (not not inherited.MouseMove(self,x,y,dx,-dy,...)) -end - - -function Screen:MouseWheel(x,y,...) - y = select(2,gl.GetViewSizes()) - y - local activeControl = UnlinkSafe(self.activeControl) - if activeControl then - local cx,cy = activeControl:ScreenToLocal(x,y) - local obj = activeControl:MouseWheel(cx,cy,...) - if (obj==false) then - self.activeControl = nil - elseif (not not obj)and(obj ~= activeControl) then - self.activeControl = MakeWeakLink(obj, self.activeControl) - return true - else - return true - end - end - - return (not not inherited.MouseWheel(self,x,y,...)) -end - -function Screen:KeyPress(...) - local focusedControl = UnlinkSafe(self.focusedControl) - if focusedControl then - return (not not focusedControl:KeyPress(...)) - end - return (not not inherited:KeyPress(...)) -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/scrollpanel.lua b/LuaIntro/chili/chili/controls/scrollpanel.lua deleted file mode 100644 index 213a6047b..000000000 --- a/LuaIntro/chili/chili/controls/scrollpanel.lua +++ /dev/null @@ -1,374 +0,0 @@ ---//============================================================================= - -ScrollPanel = Control:Inherit{ - classname = "scrollpanel", - padding = {0,0,0,0}, - backgroundColor = {0,0,0,0}, - scrollbarSize = 12, - scrollPosX = 0, - scrollPosY = 0, - verticalScrollbar = true, - horizontalScrollbar = true, - verticalSmartScroll = false, --// if control is scrolled to bottom, keep scroll when layout changes - smoothScroll = true, - smoothScrollTime = 0.7, --// in seconds - ignoreMouseWheel = false, -} - -local this = ScrollPanel -local inherited = this.inherited - ---//============================================================================= - -local function smoothstep(x) - return x*x*(3 - 2*x) -end - ---//============================================================================= - -function ScrollPanel:SetScrollPos(x,y,inview,smoothscroll) - local dosmooth = self.smoothScroll and (smoothscroll or (smoothscroll == nil)) - if dosmooth then - self._oldScrollPosX = self.scrollPosX - self._oldScrollPosY = self.scrollPosY - end - - if (x) then - if (inview) then - x = x - self.clientArea[3] * 0.5 - end - self.scrollPosX = x - if (self.contentArea) then - self.scrollPosX = clamp(0, self.contentArea[3] - self.clientArea[3], self.scrollPosX) - end - end - if (y) then - if (inview) then - y = y - self.clientArea[4] * 0.5 - end - self.scrollPosY = y - if (self.contentArea) then - self.scrollPosY = clamp(0, self.contentArea[4] - self.clientArea[4], self.scrollPosY) - end - end - - if dosmooth then - if (self._oldScrollPosX ~= self.scrollPosX)or(self._oldScrollPosY ~= self.scrollPosY) then - self._smoothScrollEnd = Spring.GetTimer() - self._newScrollPosX = self.scrollPosX - self._newScrollPosY = self.scrollPosY - self.scrollPosX = self._oldScrollPosX - self.scrollPosY = self._oldScrollPosY - end - end - - self:InvalidateSelf() -end - - -function ScrollPanel:Update(...) - local trans = 1 - if self.smoothScroll and self._smoothScrollEnd then - local trans = Spring.DiffTimers(Spring.GetTimer(), self._smoothScrollEnd) - trans = trans / self.smoothScrollTime - - if (trans >= 1) then - self.scrollPosX = self._newScrollPosX - self.scrollPosY = self._newScrollPosY - self._smoothScrollEnd = nil - else - for n=1,3 do trans = smoothstep(trans) end - self.scrollPosX = self._oldScrollPosX * (1 - trans) + self._newScrollPosX * trans - self.scrollPosY = self._oldScrollPosY * (1 - trans) + self._newScrollPosY * trans - self:InvalidateSelf() - end - end - - inherited.Update(self, ...) -end - ---//============================================================================= - -function ScrollPanel:LocalToClient(x,y) - local ca = self.clientArea - return x - ca[1] + self.scrollPosX, y - ca[2] + self.scrollPosY -end - - -function ScrollPanel:ClientToLocal(x,y) - local ca = self.clientArea - return x + ca[1] - self.scrollPosX, y + ca[2] - self.scrollPosY -end - - -function ScrollPanel:ParentToClient(x,y) - local ca = self.clientArea - return x - self.x - ca[1] + self.scrollPosX, y - self.y - ca[2] + self.scrollPosY -end - - -function ScrollPanel:ClientToParent(x,y) - local ca = self.clientArea - return x + self.x + ca[1] - self.scrollPosX, y + self.y + ca[2] - self.scrollPosY -end - ---//============================================================================= - -function ScrollPanel:GetCurrentExtents() - local left = self.x - local top = self.y - local right = self.x + self.width - local bottom = self.y + self.height - - if (left < minLeft) then minLeft = left end - if (top < minTop ) then minTop = top end - - if (right > maxRight) then maxRight = right end - if (bottom > maxBottom) then maxBottom = bottom end - - return minLeft, minTop, maxRight, maxBottom -end - ---//============================================================================= - -function ScrollPanel:_DetermineContentArea() - local minLeft, minTop, maxRight, maxBottom = self:GetChildrenCurrentExtents() - - self.contentArea = { - 0, - 0, - maxRight, - maxBottom, - } - - local contentArea = self.contentArea - local clientArea = self.clientArea - - if (self.verticalScrollbar) then - if (contentArea[4]>clientArea[4]) then - if (not self._vscrollbar) then - self.padding[3] = self.padding[3] + self.scrollbarSize - end - self._vscrollbar = true - else - if (self._vscrollbar) then - self.padding[3] = self.padding[3] - self.scrollbarSize - end - self._vscrollbar = false - end - end - - if (self.horizontalScrollbar) then - if (contentArea[3]>clientArea[3]) then - if (not self._hscrollbar) then - self.padding[4] = self.padding[4] + self.scrollbarSize - end - self._hscrollbar = true - else - if (self._hscrollbar) then - self.padding[4] = self.padding[4] - self.scrollbarSize - end - self._hscrollbar = false - end - end - - self:UpdateClientArea() - - local contentArea = self.contentArea - local clientArea = self.clientArea - if (contentArea[4] < clientArea[4]) then - contentArea[4] = clientArea[4] - end - if (contentArea[3] < clientArea[3]) then - contentArea[3] = clientArea[3] - end -end - ---//============================================================================= - - -function ScrollPanel:UpdateLayout() - --self:_DetermineContentArea() - self:RealignChildren() - local before = ((self._vscrollbar and 1) or 0) + ((self._hscrollbar and 2) or 0) - self:_DetermineContentArea() - local now = ((self._vscrollbar and 1) or 0) + ((self._hscrollbar and 2) or 0) - if (before ~= now) then - self:RealignChildren() - end - - self.scrollPosX = clamp(0, self.contentArea[3] - self.clientArea[3], self.scrollPosX) - - local oldClamp = self.clampY or 0 - self.clampY = self.contentArea[4] - self.clientArea[4] - - if self.verticalSmartScroll and self.scrollPosY >= oldClamp then - self.scrollPosY = self.clampY - else - self.scrollPosY = clamp(0, self.clampY, self.scrollPosY) - end - - return true; -end - ---//============================================================================= - - -function ScrollPanel:IsRectInView(x,y,w,h) - if (not self.parent) then - return false - end - - if self._inrtt then - return true - end - - --//FIXME 1. don't create tables 2. merge somehow into Control:IsRectInView - local cx = x - self.scrollPosX - local cy = y - self.scrollPosY - - local rect1 = {cx,cy,w,h} - local rect2 = {0,0,self.clientArea[3],self.clientArea[4]} - local inview = AreRectsOverlapping(rect1,rect2) - - if not(inview) then - return false - end - - local px,py = self:ClientToParent(x,y) - return (self.parent):IsRectInView(px,py,w,h) -end - - ---//============================================================================= - -function ScrollPanel:DrawControl() - --// gets overriden by the skin/theme -end - - -function ScrollPanel:_DrawInClientArea(fnc,...) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - - gl.PushMatrix() - gl.Translate(clientX - self.scrollPosX, clientY - self.scrollPosY, 0) - - local sx,sy = self:LocalToScreen(clientX,clientY) - sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) - PushLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) - - fnc(...) - - PopLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) - gl.PopMatrix() -end - - ---//============================================================================= - -function ScrollPanel:IsAboveHScrollbars(x,y) - if (not self._hscrollbar) then return false end - return y >= (self.height - self.scrollbarSize) --FIXME -end - - -function ScrollPanel:IsAboveVScrollbars(x,y) - if (not self._vscrollbar) then return false end - return x >= (self.width - self.scrollbarSize) --FIXME -end - - -function ScrollPanel:HitTest(x, y) - if self:IsAboveVScrollbars(x,y) then - return self - end - if self:IsAboveHScrollbars(x,y) then - return self - end - - return inherited.HitTest(self, x, y) -end - - -function ScrollPanel:MouseDown(x, y, ...) - if self:IsAboveVScrollbars(x,y) then - self._vscrolling = true - local clientArea = self.clientArea - local cy = y - clientArea[2] - self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) - return self - end - if self:IsAboveHScrollbars(x,y) then - self._hscrolling = true - local clientArea = self.clientArea - local cx = x - clientArea[1] - self:SetScrollPos(nil, (cx/clientArea[3])*self.contentArea[3], true, false) - return self - end - - return inherited.MouseDown(self, x, y, ...) -end - - -function ScrollPanel:MouseMove(x, y, dx, dy, ...) - if self._vscrolling then - local clientArea = self.clientArea - local cy = y - clientArea[2] - self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) - return self - end - if self._hscrolling then - local clientArea = self.clientArea - local cx = x - clientArea[1] - self:SetScrollPos(nil, (cx/clientArea[3])*self.contentArea[3], true, false) - return self - end - - local old = (self._hHovered and 1 or 0) + (self._vHovered and 2 or 0) - self._hHovered = self:IsAboveHScrollbars(x,y) - self._vHovered = self:IsAboveVScrollbars(x,y) - local new = (self._hHovered and 1 or 0) + (self._vHovered and 2 or 0) - if (new ~= old) then - self:InvalidateSelf() - end - - return inherited.MouseMove(self, x, y, dx, dy, ...) -end - - -function ScrollPanel:MouseUp(x, y, ...) - if self._vscrolling then - self._vscrolling = nil - local clientArea = self.clientArea - local cy = y - clientArea[2] - self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) - return self - end - if self._hscrolling then - self._hscrolling = nil - local clientArea = self.clientArea - local cx = x - clientArea[1] - self:SetScrollPos(nil, (cx/clientArea[3])*self.contentArea[3], true, false) - return self - end - - return inherited.MouseUp(self, x, y, ...) -end - - -function ScrollPanel:MouseWheel(x, y, up, value, ...) - if self._vscrollbar and not self.ignoreMouseWheel then - self:SetScrollPos(nil, self.scrollPosY - value*30, false, false) - return self - end - - return inherited.MouseWheel(self, x, y, up, value, ...) -end - - -function ScrollPanel:MouseOut(...) - inherited.MouseOut(self, ...) - self._hHovered = false - self._vHovered = false - self:InvalidateSelf() -end diff --git a/LuaIntro/chili/chili/controls/stackpanel.lua b/LuaIntro/chili/chili/controls/stackpanel.lua deleted file mode 100644 index c36f0fd80..000000000 --- a/LuaIntro/chili/chili/controls/stackpanel.lua +++ /dev/null @@ -1,38 +0,0 @@ ---//============================================================================= - -StackPanel = LayoutPanel:Inherit{ - classname = "stackpanel", - orientation = "vertical", - resizeItems = true, - itemPadding = {0, 0, 0, 0}, - itemMargin = {5, 5, 5, 5}, -} - -local this = StackPanel -local inherited = this.inherited - ---//============================================================================= - -function StackPanel:New(obj) - if (obj.orientation=="horizontal") then - obj.rows,obj.columns = 1,nil - else - obj.rows,obj.columns = nil,1 - end - obj = inherited.New(self,obj) - return obj -end - ---//============================================================================= - -function StackPanel:SetOrientation(orientation) - if (orientation == "horizontal") then - self.rows,self.columns = 1,nil - else - self.rows,self.columns = nil,1 - end - - inherited.SetOrientation(self,orientation) -end - ---//============================================================================= \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/tabbar.lua b/LuaIntro/chili/chili/controls/tabbar.lua deleted file mode 100644 index 18cc20bae..000000000 --- a/LuaIntro/chili/chili/controls/tabbar.lua +++ /dev/null @@ -1,80 +0,0 @@ ---//============================================================================= - -TabBar = LayoutPanel:Inherit{ - classname = "tabbar", - orientation = "horizontal", - resizeItems = false, - centerItems = false, - padding = {0, 0, 0, 0}, - itemPadding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - minItemWidth = 70, - minItemHeight = 20, - tabs = {}, - selected = nil, - OnChange = {}, -} - -local this = TabBar -local inherited = this.inherited - ---//============================================================================= - -function TabBar:New(obj) - obj = inherited.New(self,obj) - if (obj.tabs) then - for i=1,#obj.tabs do - obj:AddChild( - TabBarItem:New{caption = obj.tabs[i], defaultWidth = obj.minItemWidth, defaultHeight = obj.minItemHeight} --FIXME inherit font too - ) - end - end - - if not obj.children[1] then - obj:AddChild( - TabBarItem:New{caption = "tab"} - ) - end - - obj:Select(obj.selected) - - return obj -end - ---//============================================================================= - -function TabBar:SetOrientation(orientation) - inherited.SetOrientation(self,orientation) -end - ---//============================================================================= - -function TabBar:Select(tabname) - for i=1,#self.children do - local c = self.children[i] - if c.caption == tabname then - if self.selected_obj then - self.selected_obj.state.selected = false - self.selected_obj:Invalidate() - end - c.state.selected = true - self.selected_obj = c - c:Invalidate() - self:CallListeners(self.OnChange, tabname) - return true - end - end - - if not self.selected_obj then - local c = self.children[1] - c.state.selected = true - self.selected_obj = c - self.selected_obj:Invalidate() - self:CallListeners(self.OnChange, c.caption) - end - - return false -end - - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/tabbaritem.lua b/LuaIntro/chili/chili/controls/tabbaritem.lua deleted file mode 100644 index b3a58e99e..000000000 --- a/LuaIntro/chili/chili/controls/tabbaritem.lua +++ /dev/null @@ -1,30 +0,0 @@ ---//============================================================================= - -TabBarItem = Button:Inherit{ - classname= "tabbaritem", - caption = 'tab', - height = "100%", -} - -local this = TabBarItem -local inherited = this.inherited - ---//============================================================================= - -function TabBarItem:SetCaption(caption) - --FIXME inform parent - if (self.caption == caption) then return end - self.caption = caption - self:Invalidate() -end - ---//============================================================================= - -function TabBarItem:MouseDown(...) - if not self.parent then return end - self.parent:Select(self.caption) - inherited.MouseDown(self, ...) - return self -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/textbox.lua b/LuaIntro/chili/chili/controls/textbox.lua deleted file mode 100644 index b8789f72a..000000000 --- a/LuaIntro/chili/chili/controls/textbox.lua +++ /dev/null @@ -1,101 +0,0 @@ -TextBox = Control:Inherit{ - classname = "textbox", - - padding = {0,0,0,0}, - - text = "line1\nline2", - autoHeight = true, --// sets height to text size, useful for embedding in scrollboxes - autoObeyLineHeight = true, --// (needs autoHeight) if true, autoHeight will obey the lineHeight (-> texts with the same line count will have the same height) - fontsize = 12, - - _lines = {}, -} - -local this = TextBox -local inherited = this.inherited - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function TextBox:SetText(t) - self.text = t - self:RequestRealign() -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function Split(s, separator) - local results = {} - for part in s:gmatch("[^"..separator.."]+") do - results[#results + 1] = part - end - return results -end - --- remove first n elemets from t, return them -local function Take(t, n) - local removed = {} - for i=1, n do - removed[#removed+1] = table.remove(t, 1) - end - return removed -end - --- appends t1 to t2 in-place -local function Append(t1, t2) - local l = #t1 - for i = 1, #t2 do - t1[i + l] = t2[i] - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function TextBox:UpdateLayout() - local font = self.font - local padding = self.padding - local width = self.width - padding[1] - padding[3] - local height = self.height - padding[2] - padding[4] - if self.autoHeight then - height = 1e9 - end - - self._wrappedText = font:WrapText(self.text, width, height) - - if self.autoHeight then - local textHeight,textDescender,numLines = font:GetTextHeight(self._wrappedText) - textHeight = textHeight-textDescender - - if (self.autoObeyLineHeight) then - if (numLines>1) then - textHeight = numLines * font:GetLineHeight() - else - --// AscenderHeight = LineHeight w/o such deep chars as 'g','p',... - textHeight = math.min( math.max(textHeight, font:GetAscenderHeight()), font:GetLineHeight()) - end - end - - self:Resize(nil, textHeight, true, true) - end -end - - -function TextBox:DrawControl() - local paddx, paddy = unpack4(self.clientArea) - local x = paddx - local y = paddy - - local font = self.font - font:Draw(self._wrappedText, x, y) - - if (self.debug) then - gl.Color(0,1,0,0.5) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) - gl.LineWidth(2) - gl.Rect(0,0,self.width,self.height) - gl.LineWidth(1) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) - end -end diff --git a/LuaIntro/chili/chili/controls/trackbar.lua b/LuaIntro/chili/chili/controls/trackbar.lua deleted file mode 100644 index 2b2340436..000000000 --- a/LuaIntro/chili/chili/controls/trackbar.lua +++ /dev/null @@ -1,151 +0,0 @@ ---//============================================================================= - -Trackbar = Control:Inherit{ - classname = "trackbar", - value = 50, - min = 0, - max = 100, - step = 1, - useValueTooltip = nil, - - defaultWidth = 90, - defaultHeight = 20, - - hitpadding = {0, 0, 0, 0}, - - OnChange = {}, -} - -local this = Trackbar -local inherited = this.inherited - ---//============================================================================= - -local function FormatNum(num) - if (num == 0) then - return "0" - else - local strFormat = string.format - local absNum = math.abs(num) - if (absNum < 0.01) then - return strFormat("%.3f", num) - elseif (absNum < 1) then - return strFormat("%.2f", num) - elseif (absNum < 10) then - return strFormat("%.1f", num) - else - return strFormat("%.0f", num) - end - end -end - - -function Trackbar:New(obj) - obj = inherited.New(self,obj) - - if ((not obj.tooltip) or (obj.tooltip == '')) and (useValueTooltip ~= false) then - obj.useValueTooltip = true - end - - obj:SetMinMax(obj.min,obj.max) - obj:SetValue(obj.value) - - return obj -end - ---//============================================================================= - -function Trackbar:_Clamp(v) - if (self.minself.max) then - v = self.max - end - else - if (v>self.min) then - v = self.min - elseif (vself.width-pr) then - return 1 - end - - local cx = x - pl - local barWidth = self.width - (pl + pr) - - return (cx/barWidth) - else - return (self.value-self.min)/(self.max-self.min) - end -end - ---//============================================================================= - -function Trackbar:SetMinMax(min,max) - self.min = tonumber(min) or 0 - self.max = tonumber(max) or 1 - self:SetValue(self.value) -end - - -function Trackbar:SetValue(v) - if type(v) ~= "number" then - Spring.Echo("Chili: wrong param to Trackbar:SetValue(number v)") - return - end - local r = v % self.step - if (r > 0.5*self.step) then - v = v + self.step - r - else - v = v - r - end - v = self:_Clamp(v) - local oldvalue = self.value - self.value = v - if self.useValueTooltip then - self.tooltip = "Current: "..FormatNum(self.value) - end - self:CallListeners(self.OnChange,v,oldvalue) - self:Invalidate() -end - ---//============================================================================= - -function Trackbar:DrawControl() -end - ---//============================================================================= - -function Trackbar:HitTest() - return self -end - -function Trackbar:MouseDown(x,y) - local percent = self:_GetPercent(x,y) - self:SetValue(self.min + percent*(self.max-self.min)) - return self -end - -function Trackbar:MouseMove(x,y,dx,dy,button) - if (button==1) then - local percent = self:_GetPercent(x,y) - self:SetValue(self.min + percent*(self.max-self.min)) - return self - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/controls/treeview.lua b/LuaIntro/chili/chili/controls/treeview.lua deleted file mode 100644 index 223a12388..000000000 --- a/LuaIntro/chili/chili/controls/treeview.lua +++ /dev/null @@ -1,114 +0,0 @@ ---//============================================================================= - -TreeView = Control:Inherit{ - classname = "treeview", - - autosize = true, - - minItemHeight = 16, - - defaultWidth = "100%", - defaultHeight = "100%", - - selected = 1, - root = nil, - nodes = {}, - - defaultExpanded = false, - - OnSelectNode = {}, -} - -local this = TreeView -local inherited = this.inherited - ---//============================================================================= - -local function ParseInitTable(node, nodes) - local lastnode = node - for i=1,#nodes do - local data = nodes[i] - if (type(data)=="table") then - ParseInitTable(lastnode, data) - else - lastnode = node:Add(data) - end - end -end - - -function TreeView:New(obj) - local nodes = obj.nodes - if (nodes) then - obj.children = {} - end - - obj = inherited.New(self,obj) - - obj.root = TreeViewNode:New{treeview = obj, root = true; minHeight = obj.minItemHeight; expanded = obj.defaultExpanded} - if (nodes) then - ParseInitTable(obj.root, nodes) - end - obj:AddChild(obj.root) - - obj:UpdateLayout() - - local sel = obj.selected - obj.selected = false - if ((sel or 0)>0) then - obj:Select(sel) - end - - return obj -end - ---//============================================================================= - -function TreeView:GetNodeByCaption(caption) - return self.root:GetNodeByCaption(caption) -end - - -function TreeView:GetNodeByIndex(index) - local result = self.root:GetNodeByIndex(index, 0) - return (not IsNumber(result)) and result -end - ---//============================================================================= - -function TreeView:Select(item) - local obj = UnlinkSafe(item) - - if (type(item) == "number") then - obj = self:GetNodeByIndex(item) - end - - if (obj and obj:InheritsFrom("treeviewnode")) then - local oldSelected = self.selected - self.selected = MakeWeakLink(obj) - self.selected:Invalidate() - if (oldSelected) then - oldSelected:Invalidate() - end - - obj:CallListeners(obj.OnSelectChange, true) - if (oldSelected) then oldSelected:CallListeners(oldSelected.OnSelectChange, false) end - self:CallListeners(self.OnSelectNode, self.selected, oldSelected) - end -end - ---//============================================================================= - -function TreeView:UpdateLayout() - local c = self.root - c:_UpdateConstraints(0, 0, self.clientWidth) - c:Realign() - - if (self.autosize) then - self:Resize(nil, c.height, true, true) - end - - return true -end - ---//============================================================================= \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/treeviewnode.lua b/LuaIntro/chili/chili/controls/treeviewnode.lua deleted file mode 100644 index 81a1bb2c1..000000000 --- a/LuaIntro/chili/chili/controls/treeviewnode.lua +++ /dev/null @@ -1,376 +0,0 @@ ---//============================================================================= - -TreeViewNode = Control:Inherit{ - classname = "treeviewnode", - - padding = {16,0,0,0}, - - autosize = true, - caption = "node", - expanded = true, - - root = false, - nodes = {}, - - treeview = nil, - - _nodes_hidden = {}, - - OnSelectChange = {}, - OnCollapse = {}, - OnExpand = {}, - OnDraw = {}, -} - -local this = TreeViewNode -local inherited = this.inherited - ---//============================================================================= - -function TreeViewNode:New(obj) - if (obj.root) then - obj.padding = {0,0,0,0} - end - - assert(obj.treeview) - obj.treeview = MakeWeakLink(obj.treeview) - obj = inherited.New(self,obj) - return obj -end - - -function TreeViewNode:SetParent(obj) - obj = UnlinkSafe(obj) - local typ = type(obj) - - if (typ ~= "table") then - self.treeview = nil --FIXME code below in this file doesn't check for nil! - end - - inherited.SetParent(self, obj) -end - - -function TreeViewNode:AddChild(obj, isNode) - if (isNode~=false) then - self.nodes[#self.nodes+1] = MakeWeakLink(obj) - end - if self.parent and self.parent.RequestRealign then self.parent:RequestRealign() end - return inherited.AddChild(self,obj) -end - - -function TreeViewNode:RemoveChild(obj) - local result = inherited.RemoveChild(self,obj) - - local nodes = self.nodes - for i=1,#nodes do - if CompareLinks(nodes[i],obj) then - table.remove(nodes, i) - return result - end - end - - return result -end - - -function TreeViewNode:ClearChildren() - local caption - if not(self.root) then - caption = self.children[1] - self.children[1] = self.children[#self.children] - self.children[#self.children] = nil - end - - local collapsed = not self.expanded - self:Expand() - inherited.ClearChildren(self) - if (collapsed) then self:Collapse() end - - if not(self.root) then - self.children[1] = caption - end -end - -TreeViewNode.Clear = TreeViewNode.ClearChildren - ---//============================================================================= - -function TreeViewNode:Add(item) - local newnode - if (type(item) == "string") then - local lbl = TextBox:New{text = item; width = "100%"; padding = {2,3,2,2}; minHeight = self.minHeight;} - newnode = TreeViewNode:New{caption = item; treeview = self.treeview; minHeight = self.minHeight; expanded = self.expanded;} - newnode:AddChild(lbl, false) - self:AddChild(newnode) - elseif (IsObject(item)) then - newnode = TreeViewNode:New{caption = ""; treeview = self.treeview; minHeight = self.minHeight; expanded = self.expanded;} - newnode:AddChild(item, false) - self:AddChild(newnode) - end - return newnode -end - - -function TreeViewNode:Select() - if (self.root)or(not self.treeview) then - return - end - - if (not CompareLinks(self.treeview.selected,self)) then - --// treeview itself calls node:OnSelectChange ! - self.treeview:Select(self) - end -end - - -function TreeViewNode:Toggle() - if (self.root)or(not self.treeview) then - return - end - - if (self.expanded) then - self:Collapse() - else - self:Expand() - end -end - - -function TreeViewNode:Expand() - if (self.root)or(not self.treeview) then - return - end - - self:CallListeners(self.OnExpand) - self.expanded = true - self.treeview:RequestRealign() - - for i=#self._nodes_hidden, 1, -1 do - local c = self._nodes_hidden[i] - self.children[#self.children + 1] = c - end - - for i=#self._nodes_hidden, 1, -1 do - self._nodes_hidden[i] = nil - end -end - - -function TreeViewNode:Collapse() - if (self.root)or(not self.treeview) then - return - end - - self:CallListeners(self.OnCollapse) - self.expanded = false - self.treeview:RequestRealign() - - for i=#self.children, 2, -1 do - local c = self.children[i] - self.children[i] = nil - self._nodes_hidden[#self._nodes_hidden + 1] = c - end -end - ---//============================================================================= - -function TreeViewNode:GetNodeByCaption(caption) - for i=1,#self.nodes do - local n = self.nodes[i] - if (n.caption == caption) then - return n - end - - local result = n:GetNodeByCaption(caption) - if (result) then - return result - end - end -end - -function TreeViewNode:GetNodeByIndex(index, _i) - for i=1,#self.nodes do - _i = _i + 1 - if (_i == index) then - return self.nodes[i] - end - - local result = self.nodes[i]:GetNodeByIndex(index, _i) - if (IsNumber(result)) then - _i = result - else - return result - end - end - - return _i -end - ---//============================================================================= - -function TreeViewNode:UpdateLayout() - local clientWidth = self.clientWidth - local children = self.children - - if (not self.expanded)and(not self.root) then - if (children[1]) then - local c = children[1] - c:_UpdateConstraints(0, 0, clientWidth) - c:Realign() - self:Resize(nil, c.height, true, true) - else - self:Resize(nil, 10, true, true) - end - - return true - end - - - local y = 0 - for i=1, #children do - local c = children[i] - c:_UpdateConstraints(0, y, clientWidth) - c:Realign() - y = y + c.height - end - - self:Resize(nil, y, true, true) - return true -end - ---//============================================================================= - -function TreeViewNode:_InNodeButton(x,y) - if (self.root) then - return false - end - - if (x>=self.padding[1]) then - return false - end - - local nodeTop = (self.children[1].height - self.padding[1])*0.5 - return (nodeTop<=y)and(y-nodeTop fail - if (self:_InNodeButton(x,y)) then - return self - end - - if (x>=self.padding[1])then - --[[ FIXME inherited.MouseDown should be executed before Select()! - local obj = inherited.MouseDown(self, x, y, ...) - return obj - --]] - - if (y < self.padding[2]+self.children[1].height) then - self:Select() - end - - local obj = inherited.MouseDown(self, x, y, ...) - return obj - end -end - - -function TreeViewNode:MouseClick(x,y, ...) - if (self.root) then - return inherited.MouseClick(self, x, y, ...) - end - - if (self:_InNodeButton(x,y)) then - self:Toggle() - return self - end - - local obj = inherited.MouseClick(self, x, y, ...) - return obj -end - - -function TreeViewNode:MouseDblClick(x,y, ...) ---//FIXME doesn't get called, related to the FIXME above! - if (self.root) then - return inherited.MouseDblClick(self, x, y, ...) - end - - local obj = inherited.MouseDblClick(self, x, y, ...) - if (not obj) then - self:Toggle() - obj = self - end - - return obj -end - ---//============================================================================= - -function TreeViewNode:DrawNode() - if (self.treeview) then - self.treeview.DrawNode(self) - end -end - - -function TreeViewNode:DrawNodeTree() - if (self.treeview) then - self.treeview.DrawNodeTree(self) - end -end - - -function TreeViewNode:DrawControl() - if (self.root) then - return - end - - local dontDraw = self:CallListeners(self.OnDraw, self) - if (not dontDraw) then - self:DrawNode() - end - self:DrawNodeTree() -end - - -function TreeViewNode:DrawChildren() - if not (self.expanded or self.root) then - self:_DrawInClientArea(self.children[1].Draw,self.children[1]) - return - end - - if (next(self.children)) then - self:_DrawChildrenInClientArea('Draw') - end -end - - -function TreeViewNode:DrawChildrenForList() - if not (self.expanded or self.root) then - self:_DrawInClientArea(self.children[1].DrawForList,self.children[1]) - return - end - - if (next(self.children)) then - self:_DrawChildrenInClientArea('DrawForList') - end -end - ---//============================================================================= \ No newline at end of file diff --git a/LuaIntro/chili/chili/controls/window.lua b/LuaIntro/chili/chili/controls/window.lua deleted file mode 100644 index 90cf4cc95..000000000 --- a/LuaIntro/chili/chili/controls/window.lua +++ /dev/null @@ -1,66 +0,0 @@ -Window = Control:Inherit{ - classname = 'window', - resizable = true, - draggable = true, - - minWidth = 50, - minHeight = 50, - defaultWidth = 400, - defaultHeight = 300, -} - -local this = Window -local inherited = this.inherited - ---//============================================================================= ---[[ -function Window:UpdateClientArea() - inherited.UpdateClientArea(self) - - if (not WG['blur_api']) then return end - - if (self.blurId) then - WG['blur_api'].RemoveBlurRect(self.blurId) - end - - local screeny = select(2,gl.GetViewSizes()) - self.y - - self.blurId = WG['blur_api'].InsertBlurRect(self.x,screeny,self.x+self.width,screeny-self.height) -end ---]] ---//============================================================================= - -function Window:New(obj) - obj = inherited.New(self,obj) - obj:BringToFront() - return obj -end - -function Window:DrawControl() - --// gets overriden by the skin/theme -end - -function Window:MouseDown(...) - self:BringToFront() - return inherited.MouseDown(self,...) -end - -VFS.Include(CHILI_DIRNAME .. "headers/skinutils.lua", nil, VFS.RAW_FIRST) - -function Window:TweakDraw() - gl.Color(0.6,1,0.6,0.65) - - local w = self.width - local h = self.height - - if (self.resizable or self.tweakResizable) then - TextureHandler.LoadTexture(0,"LuaUI/Widgets/chili/skins/default/tweak_overlay_resizable.png",self) - else - TextureHandler.LoadTexture(0,"LuaUI/Widgets/chili/skins/default/tweak_overlay.png",self) - end - local texInfo = gl.TextureInfo("LuaUI/Widgets/chili/skins/default/tweak_overlay.png") or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.x,self.y,w,h, 31,31,31,31, tw,th, 0) - gl.Texture(0,false) -end diff --git a/LuaIntro/chili/chili/core.lua b/LuaIntro/chili/chili/core.lua deleted file mode 100644 index 4a74ae02f..000000000 --- a/LuaIntro/chili/chili/core.lua +++ /dev/null @@ -1,61 +0,0 @@ -local includes = { - --"headers/autolocalizer.lua", - "headers/util.lua", - "headers/links.lua", - "headers/backwardcompability.lua", - - "handlers/debughandler.lua", - "handlers/taskhandler.lua", - "handlers/skinhandler.lua", - "handlers/themehandler.lua", - "handlers/fonthandler.lua", - "handlers/texturehandler.lua", - - "controls/object.lua", - "controls/font.lua", - "controls/control.lua", - "controls/screen.lua", - "controls/window.lua", - "controls/label.lua", - "controls/button.lua", - "controls/textbox.lua", - "controls/checkbox.lua", - "controls/trackbar.lua", - "controls/colorbars.lua", - "controls/scrollpanel.lua", - "controls/image.lua", - "controls/textbox.lua", - "controls/layoutpanel.lua", - "controls/grid.lua", - "controls/stackpanel.lua", - "controls/imagelistview.lua", - "controls/progressbar.lua", - "controls/multiprogressbar.lua", - "controls/scale.lua", - "controls/panel.lua", - "controls/treeviewnode.lua", - "controls/treeview.lua", - "controls/editbox.lua", - "controls/line.lua", - "controls/combobox.lua", - "controls/tabbaritem.lua", - "controls/tabbar.lua", -} - -local Chili = widget - -Chili.CHILI_DIRNAME = CHILI_DIRNAME or (LUAUI_DIRNAME .. "Widgets/chili/") -Chili.SKIN_DIRNAME = SKIN_DIRNAME or (CHILI_DIRNAME .. "skins/") - -if (-1>0) then - Chili = {} - -- make the table strict - VFS.Include(Chili.CHILI_DIRNAME .. "headers/strict.lua")(Chili, widget) -end - -for _, file in ipairs(includes) do - VFS.Include(Chili.CHILI_DIRNAME .. file, Chili, VFS.RAW_FIRST) -end - - -return Chili diff --git a/LuaIntro/chili/chili/handlers/debughandler.lua b/LuaIntro/chili/chili/handlers/debughandler.lua deleted file mode 100644 index f80cda651..000000000 --- a/LuaIntro/chili/chili/handlers/debughandler.lua +++ /dev/null @@ -1,443 +0,0 @@ ---//============================================================================= ---// Chili DebugHandler ---//============================================================================= - ---// todo: ---// * use the custom errorhandler for any widget->chili interaction, ---// atm if a widget calls mybutton:SetCaption() the widgethandler errorhandler is used, ---// but this one uses pcall and so it can't generate a stacktrace, which makes debugging ---// nearly impossible (cuz the error mostly occurs in a ver low level chili object as `Font`). ---// So any :New{} should in thoery return a wrapped table to the widgets, I already tried ---// to wrap the whole WG.Chili namespace (check the `SafeWrap` function beneath), but my tests ---// ended in crashes in chili, cuz such wrapped tables ended in chili itself ---// (chili should only use links and direct ones, but never wrapped tables) - - -DebugHandler = {} - ---//============================================================================= ---// List of all chili object for easy debugging - ---// DebugHandler.objectsOwnedByWidgets[widget][n] = owned_object ---// hint: because the per-widget table is a weaktable you still need to use pairs() to iterate it! -DebugHandler.objectsOwnedByWidgets = {} -setmetatable(DebugHandler.objectsOwnedByWidgets, { - __mode="k", - __index=function(t,i) - local st = {}; - setmetatable(st,{__mode="v"}); - if (not i) then - Spring.Echo("WAAA",debug.traceback()) - end - t[i] = st; - return st; - end, -}) - ---// holds all created chili objects (uses a weaktable to do so) ---// hint: because it is a weaktable you still need to use pairs() to iterate it! -DebugHandler.allObjects = {} -setmetatable(DebugHandler.allObjects, { - __mode="v", -}) - - ---//============================================================================= ---// Chili ErrorHandler ---// ---// Chili is a framework, so many widgets move parts of their code into its ---// thread. If now a widget error happens, it could be shown as chili errors and ---// the widgethandler would unload chili instead of the causing widget. ---// ---// Now this errorhandler removes the widget itself (and its owned chili objects) ---// w/o crashing the whole framework. - -DebugHandler.maxStackLength = 7 -DebugHandler.maxChiliErrors = 5 -local numChiliErrors = 0 -local lastError = 0 - -local function ChiliErrorHandler(msg,...) - local control - local _i = 2 --// 1 is this function, so skip it - repeat - if (not debug.getinfo(_i)) then - break - end - - local i = 1 - repeat - local name,value = debug.getlocal(_i, i) - if (not name) then - break - end - if (name == "self") then - if (value._widget ~= widget) then --// ignore controls owned by Chili Framework! - control = value - end - end - - i = i + 1 - until(control) - - _i = _i + 1 - until(control) - - - if (control) then - local w = control._widget - if isindexable(w) then - local wname = (w.whInfo and w.whInfo.name) or "unknown" - Spring.Log("Chili", "error", ("in `%s`:%s : %s"):format(wname, control.name, msg)) - Spring.Log("Chili", "error", DebugHandler.Stacktrace()) - - --// this also unloads all owned chili objects - Spring.Log("Chili", "error", "Removed widget: " .. wname) - widgetHandler:RemoveWidget(w) - else - Spring.Log("Chili", "error", ("in `%s` (couldn't detect the owner widget): %s"):format(control.name, msg)) - Spring.Log("Chili", "error", DebugHandler.Stacktrace()) - control:Dispose() - end - else - --// error in Chili itself - Spring.Log("Chili", "error", ("%s"):format(msg)) - Spring.Log("Chili", "error", DebugHandler.Stacktrace()) - - if (os.clock() - lastError < 5) then - numChiliErrors = numChiliErrors + 1 - else - numChiliErrors = 1 - end - lastError = os.clock() - - --// unload Chili to avoid error spam - if (numChiliErrors>=DebugHandler.maxChiliErrors) then - Spring.Log("Chili", "error", "Removed widget: " .. widget.whInfo.name) - widgetHandler:RemoveWidget(widget) - end - end -end -DebugHandler.ChiliErrorHandler = ChiliErrorHandler - - ---//============================================================================= ---// Stacktrace - -function DebugHandler.Stacktrace() - local self_src = debug.getinfo(1).short_src - - local trace = {"stacktrace:"} - local _i = 3 - repeat - local info = debug.getinfo(_i) - if (not info) then break end - - --// we remove any occurence of the debughandler in the stacktrace (it's useless for debugging) - if (info.short_src ~= self_src) - and(info.name ~= "SafeCall") - and(info.name ~= "cdxpcall") - and(info.name ~= "cdCreateList") - then - local curLine = info.currentline - if (curLine<0) then - curLine = "" - else - curLine = ":" .. curLine - end - if (info.name) then - if (info.name=="") then - trace[#trace+1] = ("%s%s: in [?]"):format(info.short_src,curLine) - else - trace[#trace+1] = ("%s%s: in %s"):format(info.short_src,curLine,info.name) - end - else - trace[#trace+1] = ("%s%s"):format(info.short_src,curLine) - end - end - - _i = _i + 1 - until(false) - - if ((#trace-1) > DebugHandler.maxStackLength) then - local i = 1 + math.ceil(DebugHandler.maxStackLength/2)+1 - local tail = (DebugHandler.maxStackLength - i) - local j = #trace - tail - trace[i] = ("... (%i calls)"):format(#trace - (i + tail)) - for n=1,tail do - trace[i+n] = trace[j+n] - end - for i=1+DebugHandler.maxStackLength+1, #trace do - trace[i] = nil - end - end - - return table.concat(trace,"\n\t") -end - - ---//============================================================================= ---// Define some helper functions needed for xpcall - ---// we do this so we can identify it in Stacktrace() (cd = chili debug) -local cdxpcall = xpcall - -local sharedEnv = {_f = nil} -local setArgsFuncs = {} -local callFuncs = {} -do - local function CreateNewHelpers(_,n) - local t0 = {} - local t1 = {} - local t2 = {} - for i=1,n do - t0[i] = "a" .. i - t1[i] = "arg" .. i - t2[i] = "a" .. i .. "=arg" .. i - end - local varargs = table.concat(t0, ", ") - local arglist = table.concat(t1, ",") - local setargs = table.concat(t2, "; ") - - local src = ([[local %s; - local setargs = function(%s) %s; end; - local call = function() return _f(%s); end - return setargs,call - ]]):format(varargs, arglist, setargs, varargs) - - local setargsfunc,callfunc = assert(loadstring(src))() - setfenv(setargsfunc,sharedEnv) - setfenv(callfunc,sharedEnv) - rawset(setArgsFuncs, n, setargsfunc) - rawset(callFuncs, n, callfunc) - return setargsfunc - end - setmetatable(setArgsFuncs, {__index = CreateNewHelpers}) - setmetatable(callFuncs, {__index = CreateNewHelpers}) -end - - -local function GetResults(status,...) - if (status) then - return ... - else - return nil - end -end - - -local function xpcall_va(func, ...) - local n = select("#", ...) - if (n == 0) then - return GetResults(cdxpcall(func,ChiliErrorHandler)) - else - sharedEnv._f = func - setArgsFuncs[n](...) - return GetResults(cdxpcall(callFuncs[n],ChiliErrorHandler)) - end -end - - ---//============================================================================= ---// Define Chili.SafeCall - -DebugHandler.SafeCall = xpcall_va -SafeCall = xpcall_va --// external code should access it via Chili.SafeCall() - - ---//============================================================================= ---// Use our errorhandler in gl.CreateList - -local orig_gl = gl -local cdCreateList = gl.CreateList -gl = {} -setmetatable(gl,{__index=function(t,i) t[i] = orig_gl[i]; return t[i]; end}) --// use metatable to copy table entries on-demand -gl.CreateList = function(...) - return cdCreateList(xpcall_va, ...) -end - - - ---//============================================================================= ---// Chili.DebugHandler.SafeWrap ---// usage: ---// used for WG.Chili & screen0 to make any calling to them safe ---// how: ---// it wraps a table, so any calling to a function in it (or ones of its subtables) ---// uses automatically the Chili internal error handler ---// note: ---// it doesn't auto wrap th return values of such functions (for performance reasons) - - -local function IndexWrappedTable(t,i) - local v_orig = t.__orig[i] - - local v - if (isindexable(v_orig)) then - --Spring.Echo("wrap table", i) - v = DebugHandler.SafeWrap(v_orig); - t[i] = v; - elseif (isfunc(v_orig)) then - --Spring.Echo("wrap func", i) - v = function(self,...) - if (isindexable(self))and(self.__orig) then - self = self.__orig - end - return DebugHandler.SafeWrap(xpcall_va(v_orig,self,...)); - end; - t[i] = v; - else - v = v_orig; - --t[i] = v; don't cache values (else they wouldn't update when they got in the original table) - end - return v; -end - -local function HasSubFunctions(t) - if (not istable(t)) then - return true - end - for i,v in pairs(t) do - if (isfunc(v)) then - return true - elseif (isindexable(v)) then - local r = HasSubFunctions(v) - if (r) then return true end - end - end - return false -end - -local function IndexWrappedLink(link,i) - local t = link() - local v_orig = t[i] - --local t_wrap = getmetatable(link)._wrap - - local v = v_orig; - if (isindexable(v_orig)) then - -- Spring.Echo("wrap table", i,HasSubFunctions(v_orig)) - -- if (HasSubFunctions(v_orig)) then - -- v = DebugHandler.SafeWrap(v_orig); - -- t_wrap[i] = v; - -- end - elseif (isfunc(v_orig)) then - --Spring.Echo("wrap func", i) - v = function(self,...) - if (isindexable(self))and(self.__orig) then - self = self.__orig - end - return xpcall_va(v_orig,self,...); - --return DebugHandler.SafeWrap(xpcall_va(v_orig,self,...)); - end; - --t_wrap[i] = v; - end - return v; -end - -local safewrap_meta = { - __index = IndexWrappedTable -} - -function DebugHandler.SafeWrap(t_orig,...) - if isindexable(t_orig) then - local meta = getmetatable(t_orig) - if (meta)and(meta._islink) then - meta._wrap = {} - meta[meta._wrap] = true - meta.__index = IndexWrappedLink - return t_orig - else - local t = {__orig = t_orig} - setmetatable(t, safewrap_meta) - return t - end - else - return t_orig,... - end -end - - ---//============================================================================= ---// When a Widget gets removed destroy all its owned chili object, too - -local origRemoveWidget = widgetHandler.RemoveWidget -widgetHandler.RemoveWidget = function(self,widget,...) - local ownedObjects = DebugHandler.objectsOwnedByWidgets[widget] - for k,obj in pairs(ownedObjects) do - obj:Dispose() - ownedObjects[k] = nil - end - - origRemoveWidget(self,widget,...) -end - - ---//============================================================================= ---// Check the stack for any indication for an user widget ---// so we can remove all owned chili object when the widget crashes/unloads ---// (also useful for a lot of other debugging purposes) - -function DebugHandler.GetWidgetOrigin(_i) - local chiliwidget = widget - _i = _i or 4 --// 1:=this function, 2:=RegisterObject, 3:=class:New{}, 4:=user widget? - repeat - --// CHECK STACK - local info = debug.getinfo(_i,"f") - if (not info) then - return - end - - --// CHECK ENVIROMENT - if (info.func) then - local _G = debug.getfenv(info.func) - if (_G.widget)and(_G.widget~=chiliwidget)and(_G.widget.GetInfo) then - --Spring.Echo("env widget found", _G.widget:GetInfo().name) - return _G.widget - end - end - - --// CHECK LOCALS - local i=1 - repeat - local name,value = debug.getlocal(_i, i) - if (not name) then - break - end - if (name == "widget")and(value.GetInfo) then - --Spring.Echo("local widget found", value:GetInfo().name) - return value - else - --// this code gets triggered when a chili control creates another one - --// (the new control should then inherit the widget origin) - local typ = type(value) - if (typ=="table")or(typ=="metatable")or(typ=="userdata") then - if (typ._widget)and(typ._widget.GetInfo) then - --Spring.Echo("local2 widget found", typ._widget:GetInfo().name) - return typ._widget - end - end - end - i = i + 1 - until(false) - - _i = _i + 1 - until(false) -end - - ---//============================================================================= ---// gets called by Chili.Object:New{} - -function DebugHandler:RegisterObject(obj) - local w = self.GetWidgetOrigin() - if (w) then - obj._widget = w - local t = self.objectsOwnedByWidgets[w] - t[#t+1] = obj - end - local ta = self.allObjects - ta[#ta+1] = obj - --// hint: both tables above are weaktables, so we don't need a UnregisterObject! -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/handlers/fonthandler.lua b/LuaIntro/chili/chili/handlers/fonthandler.lua deleted file mode 100644 index 3a03c5bdc..000000000 --- a/LuaIntro/chili/chili/handlers/fonthandler.lua +++ /dev/null @@ -1,84 +0,0 @@ ---//============================================================================= ---// FontSystem - -FontHandler = {} - - ---//============================================================================= ---// cache loaded fonts - -local loadedFonts = {} -local refCounts = {} - ---// maximum fontsize difference ---// when we don't find the wanted font rendered with the wanted fontsize ---// (in respect to this threshold) then recreate a new one -local fontsize_threshold = 2 - ---//============================================================================= ---// Destroy - -FontHandler._scream = Script.CreateScream() -FontHandler._scream.func = function() - for i=1,#loadedFonts do - gl.DeleteFont(loadedFonts[i]) - end - loadedFonts = {} -end - - -local n = 0 -function FontHandler.Update() - n = n + 1 - if (n <= 100) then - return - end - n = 0 - - local last_idx = #loadedFonts - for i=last_idx, 1, -1 do - if (refCounts[i] <= 0) then - --// the font isn't in use anymore, free it - gl.DeleteFont(loadedFonts[i]) - loadedFonts[i] = loadedFonts[last_idx] - loadedFonts[last_idx] = nil - refCounts[i] = refCounts[last_idx] - refCounts[last_idx] = nil - last_idx = last_idx - 1 - end - end -end - ---//============================================================================= ---// API - -function FontHandler.UnloadFont(font) - for i=1,#loadedFonts do - local font2 = loadedFonts[i] - if (font == font2) then - refCounts[i] = refCounts[i] - 1 - return - end - end -end - -function FontHandler.LoadFont(fontname,size,outwidth,outweight) - for i=1,#loadedFonts do - local font = loadedFonts[i] - if - ((font.path == fontname)or(font.path == 'fonts/'..fontname)) - and(font.size - size >= 0) and (font.size - size <= fontsize_threshold) - and((not outwidth)or(font.outlinewidth == outwidth)) - and((not outweight)or(font.outlineweight == outweight)) - then - refCounts[i] = refCounts[i] + 1 - return font - end - end - - local idx = #loadedFonts+1 - local font = gl.LoadFont(fontname,size,outwidth,outweight) - loadedFonts[idx] = font - refCounts[idx] = 1 - return font -end \ No newline at end of file diff --git a/LuaIntro/chili/chili/handlers/skinhandler.lua b/LuaIntro/chili/chili/handlers/skinhandler.lua deleted file mode 100644 index 9fdc70be7..000000000 --- a/LuaIntro/chili/chili/handlers/skinhandler.lua +++ /dev/null @@ -1,177 +0,0 @@ ---//============================================================================= ---// Theme - -SkinHandler = {} - ---//============================================================================= ---// load shared skin utils - -local SkinUtilsEnv = {} -setmetatable(SkinUtilsEnv,{__index = getfenv()}) -VFS.Include(CHILI_DIRNAME .. "headers/skinutils.lua", SkinUtilsEnv) - ---//============================================================================= ---// translates the skin's FileNames to the correct FilePaths ---// (skins just define the name not the path!) - -local function SplitImageOptions(str) - local options, str2 = str:match "^(:.*:)(.*)" - if (options) then - return options, str2 - else - return "", str - end -end - -local function TranslateFilePaths(skinConfig, dirs) - for i,v in pairs(skinConfig) do - if (i == "info") then - --// nothing - elseif istable(v) then - TranslateFilePaths(v, dirs) - elseif isstring(v) then - local opt, fileName = SplitImageOptions(v) - - for _,dir in ipairs(dirs) do - local filePath = dir .. fileName - if VFS.FileExists(filePath) then - skinConfig[i] = opt .. filePath - break - end - end - - end - end -end - ---//============================================================================= ---// load all skins - -knownSkins = {} -SkinHandler.knownSkins = knownSkins - -local n = 1 -local skinDirs = VFS.SubDirs(SKIN_DIRNAME , "*", VFS.RAW_FIRST) -for i,dir in ipairs(skinDirs) do - local skinCfgFile = dir .. 'skin.lua' - - if (VFS.FileExists(skinCfgFile, VFS.RAW_FIRST)) then - - --// use a custom enviroment (safety + auto loads skin utils) - local senv = {SKINDIR = dir} - setmetatable(senv,{__index = SkinUtilsEnv}) - - --// load the skin - local skinConfig = VFS.Include(skinCfgFile,senv, VFS.RAW_FIRST) - if (skinConfig)and(type(skinConfig)=="table")and(type(skinConfig.info)=="table") then - skinConfig.info.dir = dir - SkinHandler.knownSkins[n] = skinConfig - SkinHandler.knownSkins[skinConfig.info.name:lower()] = skinConfig - n = n + 1 - end - end -end - ---//FIXME handle multiple-dependencies correctly! (atm it just works with 1 level!) ---// translate filepaths and handle dependencies -for i,skinConfig in ipairs(SkinHandler.knownSkins) do - local dirs = { skinConfig.info.dir } - - --// translate skinName -> skinDir and remove broken dependencies - local brokenDependencies = {} - for i,dependSkinName in ipairs(skinConfig.info.depend or {}) do - local dependSkin = SkinHandler.knownSkins[dependSkinName:lower()] - if (dependSkin) then - dirs[#dirs+1] = dependSkin.info.dir - table.merge(skinConfig, dependSkin) - else - Spring.Echo("Chili: Skin " .. skinConfig.info.name .. " depends on an unknown skin named " .. dependSkinName .. ".") - end - end - - --// add the default skindir to the end - dirs[#dirs+1] = SKIN_DIRNAME .. 'default/' - - --// finally translate all paths - TranslateFilePaths(skinConfig, dirs) -end - ---//============================================================================= ---// Internal - -local function GetSkin(skinname) - return SkinHandler.knownSkins[tostring(skinname):lower()] -end - -SkinHandler.defaultSkin = GetSkin('default') - ---//============================================================================= ---// API - -function SkinHandler.IsValidSkin(skinname) - return (not not GetSkin(skinname)) -end - - -function SkinHandler.GetSkinInfo() - local sk = GetSkin(skinname) - if (sk) then - return table.shallowcopy(sk.info) - end - return {} -end - - -function SkinHandler.GetAvailableSkins() - local skins = {} - local knownSkins = SkinHandler.knownSkins - for i=1,#knownSkins do - skins[i] = knownSkins[i].info.name - end - return skins -end - - -local function MergeProperties(obj, skin, classname) - local skinclass = skin[classname] - if not skinclass then return end - BackwardCompa(skinclass) - table.merge(obj, skinclass) - MergeProperties(obj, skin, skinclass.clone) -end - - -function SkinHandler.LoadSkin(control, class) - local skin = GetSkin(control.skinName) - local defskin = SkinHandler.defaultSkin - - local found = false - local inherited = class.inherited - local classname = control.classname - repeat - --FIXME scan whole `depend` table - - if (skin) then - --if (skin[classname]) then - MergeProperties(control, skin, classname) -- per-class defaults - MergeProperties(control, skin, "general") - if (skin[classname]) then - found = true - end - end - - - if (defskin[classname]) then - MergeProperties(control, defskin, classname) -- per-class defaults - MergeProperties(control, defskin, "general") - found = true - end - - if inherited then - classname = inherited.classname - inherited = inherited.inherited - else - found = true - end - until (found) -end \ No newline at end of file diff --git a/LuaIntro/chili/chili/handlers/taskhandler.lua b/LuaIntro/chili/chili/handlers/taskhandler.lua deleted file mode 100644 index c817bcca7..000000000 --- a/LuaIntro/chili/chili/handlers/taskhandler.lua +++ /dev/null @@ -1,120 +0,0 @@ ---//============================================================================= ---// TaskHandler - -TaskHandler = {} - ---// type1: use use 2 tables so we can iterate and update at the same time -local objects = {} -local objects2 = {} -local objectsCount = 0 - ---// type2 -local objectsInAnInstant = {} -local objectsInAnInstant2 = {} -local objectsInAnInstantCount = 0 - ---// make it a weak table (values) -do - local m = {__mode = "v"} - setmetatable(objects, m) - setmetatable(objects2, m) - setmetatable(objectsInAnInstant, m) - setmetatable(objectsInAnInstant2, m) -end - ---//============================================================================= - ---// Global Event for when an object gets destructed -local globalDisposeListeners = {} -setmetatable(globalDisposeListeners, {__mode = "k"}) - -local function CallListenersByKey(listeners, ...) - for obj in pairs(listeners) do - obj:OnGlobalDispose(...); - end -end - - -function TaskHandler.RequestGlobalDispose(obj) - globalDisposeListeners[obj] = true -end - ---//============================================================================= - -function TaskHandler.RequestUpdate(obj) - obj = UnlinkSafe(obj) - if (not obj.__inUpdateQueue) then - obj.__inUpdateQueue = true - objectsCount = objectsCount + 1 - objects[objectsCount] = obj - end -end - - -function TaskHandler.RemoveObject(obj) - obj = UnlinkSafe(obj) - - CallListenersByKey(globalDisposeListeners, obj) - - if (obj.__inUpdateQueue) then - obj.__inUpdateQueue = false - for i=1,objectsCount do - if (objects[i]==obj) then - objects[i] = objects[objectsCount] - objects[objectsCount] = nil - objectsCount = objectsCount - 1 - return true - end - end - return false - end -end - - -function TaskHandler.RequestInstantUpdate(obj) - obj = UnlinkSafe(obj) - if (not obj.__inUpdateQueue) then - obj.__inUpdateQueue = true - objectsInAnInstantCount = objectsInAnInstantCount + 1 - objectsInAnInstant[objectsInAnInstantCount] = obj - end -end - ---//============================================================================= - -function TaskHandler.Update() - --// type1: run it for all current tasks - local cnt = objectsCount - objectsCount = 0 --// clear the array, so all objects needs to reinsert themselves when they want to get called again - objects,objects2 = objects2,objects - for i=1,cnt do - local obj = objects2[i] - if (obj)and(not obj.disposed) then - obj.__inUpdateQueue = false - local Update = obj.Update - if (Update) then - SafeCall(Update, obj) - end - end - end - - --// type2: endless loop until job is done - local runCounter = 0 - while (objectsInAnInstantCount > 0) do - local cnt = objectsInAnInstantCount - objectsInAnInstantCount = 0 - objectsInAnInstant,objectsInAnInstant2 = objectsInAnInstant2,objectsInAnInstant - for i=1,cnt do - local obj = objectsInAnInstant2[i] - if (obj)and(not obj.disposed) then - obj.__inUpdateQueue = false - local InstantUpdate = obj.InstantUpdate - if (InstantUpdate) then - SafeCall(InstantUpdate, obj) - end - end - end - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/handlers/texturehandler.lua b/LuaIntro/chili/chili/handlers/texturehandler.lua deleted file mode 100644 index 86d6e218b..000000000 --- a/LuaIntro/chili/chili/handlers/texturehandler.lua +++ /dev/null @@ -1,158 +0,0 @@ ---//============================================================================= ---// - -TextureHandler = {} - - ---//============================================================================= ---//TWEAKING - -local timeLimit = 0.2/15 --//time per second / desiredFPS - - ---//============================================================================= ---// SpeedUp - -local next = next -local spGetTimer = Spring.GetTimer -local spDiffTimers = Spring.DiffTimers -local glActiveTexture = gl.ActiveTexture -local glCallList = gl.CallList - -local weakMetaTable = {__mode="k"} - - ---//============================================================================= ---// local - -local loaded = {} -local requested = {} - -local placeholderFilename = theme.skin.icons.imageplaceholder -local placeholderDL = gl.CreateList(gl.Texture,CHILI_DIRNAME .. "skins/default/empty.png") ---local placeholderDL = gl.CreateList(gl.Texture,placeholderFilename) - -local function AddRequest(filename,obj) - local req = requested - if (req[filename]) then - local t = req[filename] - t[obj] = true - else - req[filename] = setmetatable({[obj]=true}, weakMetaTable) - end -end - - ---//============================================================================= ---// Destroy - -TextureHandler._scream = Script.CreateScream() -TextureHandler._scream.func = function() - requested = {} - for filename,tex in pairs(loaded) do - gl.DeleteList(tex.dl) - gl.DeleteTexture(filename) - end - loaded = {} -end - - ---//============================================================================= ---// - -function TextureHandler.LoadTexture(arg1,arg2,arg3) - local activeTexID,filename,obj - if (type(arg1)=='number') then - activeTexID = arg1 - filename = arg2 - obj = arg3 - else - activeTexID = 0 - filename = arg1 - obj = arg2 - end - - local tex = loaded[filename] - if (not tex) then - AddRequest(filename,obj) - glActiveTexture(activeTexID,glCallList,placeholderDL) - else - glActiveTexture(activeTexID,glCallList,tex.dl) - end -end - - -function TextureHandler.DeleteTexture(filename) - local tex = loaded[filename] - if (tex) then - tex.references = tex.references - 1 - if (tex.references==0) then - gl.DeleteList(tex.dl) - gl.DeleteTexture(filename) - loaded[filename] = nil - end - end -end - - ---//============================================================================= ---// - -local usedTime = 0 -local lastCall = spGetTimer() -local nullInfo = {xsize=0} - - -function TextureHandler.Update() - if (not next(requested)) then return end - - if (usedTime>0) then - thisCall = spGetTimer() - - usedTime = usedTime - spDiffTimers(thisCall,lastCall) - lastCall = thisCall - - if (usedTime<0) then usedTime = 0 end - end - - local broken = {} - local timerStart = spGetTimer() - local finished = false - while (usedTime < timeLimit)and(not finished) do - local filename,objs = next(requested) - - if (filename) then - gl.Texture(filename) - gl.Texture(false) - - if (gl.TextureInfo(filename) or nullInfo).xsize > 0 then - local texture = {} - texture.dl = gl.CreateList(gl.Texture,filename) - loaded[filename] = texture - - for obj in pairs(objs) do - obj:Invalidate() - texture.references = (texture.references or 0) + 1 - end - else - broken[filename] = objs - end - - requested[filename] = nil - - local timerEnd = spGetTimer() - usedTime = usedTime + spDiffTimers(timerEnd,timerStart) - timerStart = timerEnd - else - finished = true - end - end - - for i,v in pairs(broken) do - requested[i] = v - end - - lastCall = spGetTimer() -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/handlers/themehandler.lua b/LuaIntro/chili/chili/handlers/themehandler.lua deleted file mode 100644 index 2c72f4537..000000000 --- a/LuaIntro/chili/chili/handlers/themehandler.lua +++ /dev/null @@ -1,5 +0,0 @@ ---//============================================================================= ---// Theme Handler - ---// TODO: WRITE ME -VFS.Include(CHILI_DIRNAME .. "themes/theme.lua", nil, VFS.RAW_FIRST) diff --git a/LuaIntro/chili/chili/headers/autolocalizer.lua b/LuaIntro/chili/chili/headers/autolocalizer.lua deleted file mode 100644 index 1120498d7..000000000 --- a/LuaIntro/chili/chili/headers/autolocalizer.lua +++ /dev/null @@ -1,189 +0,0 @@ ---------------------------------------------------------------------------- --- --- Lua Namespace Localizer --- --- author: jK (2009) --- --- License: GPLv2 --- --- Info: --- overrides VFS.Include with a function that autolocalize the used namespaces --- - --- Settings -local maxLocals = 50 - -local namespaces = { - {"Spring.MoveCtrl", "mc"}, - {"Spring", "sp"}, - {"Script", "sc"}, - {"gl", "gl"}, - {"GL", "GL_"}, - {"math", ""}, - {"CMD", "CMD_"}, - {"CMDTYPE", "CMDTYPE_"}, - {"Game", "Game"}, - {"table", "tb"}, -} - - ---//TODO -local globalFuncs = { - "pairs", - "ipairs", - "select", - "unpack", - "UnitDefs", - "UnitDefNames", - "FeatureDefs", - "WeaponDefs", -} - ---------------------------------------------------------------------------- --- - -if (Spring.GetConfigInt("AutoLocalizeLua", 1) == 0) then - return -end - ---------------------------------------------------------------------------- --- - -local used_funcs = {} -local numLocals = 0 - -local function CreateLocal(prefix) - local _G = getfenv() - return function(fnc_prefix,fnc_name) - local longname = fnc_prefix .. "." .. fnc_name - local shortname = prefix..fnc_name - - --// if it's not in the current global namespace (perhaps it gets added later?) - --// then don't localize it - local gn = _G[fnc_prefix] - if (type(gn)~="table")or(not gn[fnc_name]) then - return longname - end - - if (used_funcs[longname]) then - return shortname - else - if (numLocals40) then - filename = filename:sub(-40) - end - - repeat - str2 = LocalizeString(str) - - chunk, err = loadstring(str2, filename) - - if (not chunk) then - if (err:find("has more than %d+ upvalues")) then - maxLocals = maxLocals - 10 - end - error(err) - end - - until (chunk)or(maxLocals==0) - - maxLocals = oldMaxLocals - - return chunk,str2 -end - - -function VFS.Include(filename, enviroment, mode) - local str = LoadFileSafe(filename, mode) - - if (not str) then - return - end - - if (not enviroment) then - local status - status,enviroment = pcall(getfenv,3) - if (not status) then - status,enviroment = pcall(getfenv,2) - if (not status) then - enviroment = getfenv() - end - end - end - - local chunk = MyLoadString(str, filename) - setfenv(chunk, enviroment) - - return chunk() -end - - -function VFS.LoadFile(filename, mode) - local str = LoadFileSafe(filename, mode) - - if (str)and(filename:find(".lua", 1, true)) then - _,str = MyLoadString(str, filename) - end - - return str -end \ No newline at end of file diff --git a/LuaIntro/chili/chili/headers/backwardcompability.lua b/LuaIntro/chili/chili/headers/backwardcompability.lua deleted file mode 100644 index c5d2cce6c..000000000 --- a/LuaIntro/chili/chili/headers/backwardcompability.lua +++ /dev/null @@ -1,19 +0,0 @@ ---//============================================================================= ---// - -function BackwardCompa(obj) - obj.font = obj.font or {} - obj.font.outline = obj.font.outline or obj.fontOutline - obj.font.color = obj.font.color or obj.captionColor - obj.font.color = obj.font.color or obj.textColor - obj.font.size = obj.font.size or obj.fontSize - obj.font.size = obj.font.size or obj.fontsize - obj.font.shadow = obj.font.shadow or obj.fontShadow - obj.bolderColor = obj.borderColor or obj.borderColor1 - obj.fontOutline = nil - obj.textColor = nil - obj.captionColor = nil - obj.fontSize = nil - obj.fontsize = nil - obj.fontShadow = nil -end diff --git a/LuaIntro/chili/chili/headers/links.lua b/LuaIntro/chili/chili/headers/links.lua deleted file mode 100644 index 5d83b8da1..000000000 --- a/LuaIntro/chili/chili/headers/links.lua +++ /dev/null @@ -1,110 +0,0 @@ ---//============================================================================= ---// SHORT INFO WHY WE DO THIS: ---// Cause of the reference based system in lua we can't ---// destroy objects yourself, instead we have to tell ---// the GarbageCollector somehow that an object isn't ---// in use anymore. ---// Now we have a quite complex class system in Chili ---// with parent and children links between objects. Those ---// circles make it normally impossible for the GC to ---// detect if an object (and all its children) can be ---// destructed. ---// This is the point where so called WeakLinks come ---// into play. Instead of saving direct references to the ---// objects in the parent field, we created a weaktable ---// (use google, if you aren't familiar with this name) ---// which directs to the parent-object. So now the link ---// between children and its parent is 'weak' (the GC can ---// catch the parent), and the link between the parent ---// and its children is 'hard', so the GC won't catch the ---// children as long as there is a parent object. ---//============================================================================= - -local wmeta = {__mode = "v"} -local newproxy = newproxy or getfenv(0).newproxy - -function MakeWeakLink(obj,wlink) - --// 2nd argument is optional, if it's given it will reuse the given link (-> less garbage) - - obj = UnlinkSafe(obj) --// unlink hard-/weak-links -> faster (else it would have to go through multiple metatables) - - if (not isindexable(obj)) then - return obj - end - - local mtab - if (type(wlink) == "userdata") then - mtab = getmetatable(wlink) - end - if (not mtab) then - wlink = newproxy(true) - mtab = getmetatable(wlink) - setmetatable(mtab, wmeta) - end - local getRealObject = function() return mtab._obj end --// note: we are using mtab._obj here, so it is a weaklink -> it can return nil! - mtab._islink = true - mtab._isweak = true - mtab._obj = obj - mtab.__index = obj - mtab.__newindex = obj - mtab.__call = getRealObject --// values are weak, so we need to make it gc-safe - mtab[getRealObject] = true --// and buffer it in a key, too - - if (not obj._wlinks) then - local t = {} - setmetatable(t,{__mode="v"}) - obj._wlinks = t - end - obj._wlinks[#obj._wlinks+1] = wlink - - return wlink -end - - -function MakeHardLink(obj,gc) - obj = UnlinkSafe(obj) --// unlink hard-/weak-links -> faster (else it would have to go through multiple metatables) - - if (not isindexable(obj)) then - return obj - end - - local hlink = newproxy(true) - local mtab = getmetatable(hlink) - mtab._islink = true - mtab._ishard = true - mtab._obj = obj - mtab.__gc = gc or function() if not obj._hlinks or not next(obj._hlinks) then obj:AutoDispose() end end - mtab.__index = obj - mtab.__newindex = obj - mtab.__call = function() return mtab._obj end - - if (not obj._hlinks) then - local t = {} - setmetatable(t,{__mode="v"}) - obj._hlinks = t - end - obj._hlinks[#obj._hlinks+1] = hlink - - return hlink -end - - -function UnlinkSafe(link) - local link = link - while (type(link) == "userdata") do - link = link() - end - return link -end - - -function CompareLinks(link1,link2) - return UnlinkSafe(link1) == UnlinkSafe(link2) -end - - -function CheckWeakLink(link) - return (type(link) == "userdata") and link() -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/headers/skinutils.lua b/LuaIntro/chili/chili/headers/skinutils.lua deleted file mode 100644 index 2ee44e1f3..000000000 --- a/LuaIntro/chili/chili/headers/skinutils.lua +++ /dev/null @@ -1,1077 +0,0 @@ ---//============================================================================= ---// - -function _DrawTextureAspect(x,y,w,h ,tw,th) - local twa = w/tw - local tha = h/th - - local aspect = 1 - if (twa < tha) then - aspect = twa - y = y + h*0.5 - th*aspect*0.5 - h = th*aspect - else - aspect = tha - x = x + w*0.5 - tw*aspect*0.5 - w = tw*aspect - end - - local right = math.ceil(x+w) - local bottom = math.ceil(y+h) - x = math.ceil(x) - y = math.ceil(y) - - gl.TexRect(x,y,right,bottom,false,true) -end -local _DrawTextureAspect = _DrawTextureAspect - - -function _DrawTiledTexture(x,y,w,h, skLeft,skTop,skRight,skBottom, texw,texh, texIndex) - texIndex = texIndex or 0 - - local txLeft = skLeft/texw - local txTop = skTop/texh - local txRight = skRight/texw - local txBottom = skBottom/texh - - --//scale down the texture if we don't have enough space - - local scaleY = h/(skTop+skBottom) - local scaleX = w/(skLeft+skRight) - local scale = (scaleX < scaleY) and scaleX or scaleY - if (scale<1) then - skTop = skTop * scale - skBottom = skBottom * scale - skLeft = skLeft * scale - skRight = skRight * scale - end - - --//topleft - gl.MultiTexCoord(texIndex,0,0) - gl.Vertex(x, y) - - gl.MultiTexCoord(texIndex,0,txTop) - gl.Vertex(x, y+skTop) - gl.MultiTexCoord(texIndex,txLeft,0) - gl.Vertex(x+skLeft, y) - gl.MultiTexCoord(texIndex,txLeft,txTop) - gl.Vertex(x+skLeft, y+skTop) - - --//topcenter - gl.MultiTexCoord(texIndex,1-txRight,0) - gl.Vertex(x+w-skRight, y) - gl.MultiTexCoord(texIndex,1-txRight,txTop) - gl.Vertex(x+w-skRight, y+skTop) - - --//topright - gl.MultiTexCoord(texIndex,1,0) - gl.Vertex(x+w, y) - gl.MultiTexCoord(texIndex,1,txTop) - gl.Vertex(x+w, y+skTop) - - --//right center - gl.MultiTexCoord(texIndex,1,1-txBottom) - gl.Vertex(x+w, y+h-skBottom) --//degenerate - gl.MultiTexCoord(texIndex,1-txRight,txTop) - gl.Vertex(x+w-skRight, y+skTop) - gl.MultiTexCoord(texIndex,1-txRight,1-txBottom) - gl.Vertex(x+w-skRight, y+h-skBottom) - - --//background - gl.MultiTexCoord(texIndex,txLeft,txTop) - gl.Vertex(x+skLeft, y+skTop) - gl.MultiTexCoord(texIndex,txLeft,1-txBottom) - gl.Vertex(x+skLeft, y+h-skBottom) - - --//left center - gl.MultiTexCoord(texIndex,0,txTop) - gl.Vertex(x, y+skTop) - gl.MultiTexCoord(texIndex,0,1-txBottom) - gl.Vertex(x, y+h-skBottom) - - --//bottom right - gl.MultiTexCoord(texIndex,0,1) - gl.Vertex(x, y+h) --//degenerate - gl.MultiTexCoord(texIndex,txLeft,1-txBottom) - gl.Vertex(x+skLeft, y+h-skBottom) - gl.MultiTexCoord(texIndex,txLeft,1) - gl.Vertex(x+skLeft, y+h) - - --//bottom center - gl.MultiTexCoord(texIndex,1-txRight,1-txBottom) - gl.Vertex(x+w-skRight, y+h-skBottom) - gl.MultiTexCoord(texIndex,1-txRight,1) - gl.Vertex(x+w-skRight, y+h) - - --//bottom right - gl.MultiTexCoord(texIndex,1,1-txBottom) - gl.Vertex(x+w, y+h-skBottom) - gl.MultiTexCoord(texIndex,1,1) - gl.Vertex(x+w, y+h) -end -local _DrawTiledTexture = _DrawTiledTexture - - -function _DrawTiledBorder(x,y,w,h, skLeft,skTop,skRight,skBottom, texw,texh, texIndex) - texIndex = texIndex or 0 - - local txLeft = skLeft/texw - local txTop = skTop/texh - local txRight = skRight/texw - local txBottom = skBottom/texh - - --//scale down the texture if we don't have enough space - local scaleY = h/(skTop+skBottom) - local scaleX = w/(skLeft+skRight) - local scale = (scaleX < scaleY) and scaleX or scaleY - if (scale<1) then - skTop = skTop * scale - skBottom = skBottom * scale - skLeft = skLeft * scale - skRight = skRight * scale - end - - --//topleft - gl.MultiTexCoord(texIndex,0,0) - gl.Vertex(x, y) - gl.MultiTexCoord(texIndex,0,txTop) - gl.Vertex(x, y+skTop) - gl.MultiTexCoord(texIndex,txLeft,0) - gl.Vertex(x+skLeft, y) - gl.MultiTexCoord(texIndex,txLeft,txTop) - gl.Vertex(x+skLeft, y+skTop) - - --//topcenter - gl.MultiTexCoord(texIndex,1-txRight,0) - gl.Vertex(x+w-skRight, y) - gl.MultiTexCoord(texIndex,1-txRight,txTop) - gl.Vertex(x+w-skRight, y+skTop) - - --//topright - gl.MultiTexCoord(texIndex,1,0) - gl.Vertex(x+w, y) - gl.MultiTexCoord(texIndex,1,txTop) - gl.Vertex(x+w, y+skTop) - - --//right center - gl.Vertex(x+w, y+skTop) --//degenerate - gl.MultiTexCoord(texIndex,1-txRight,txTop) - gl.Vertex(x+w-skRight, y+skTop) - gl.MultiTexCoord(texIndex,1,1-txBottom) - gl.Vertex(x+w, y+h-skBottom) - gl.MultiTexCoord(texIndex,1-txRight,1-txBottom) - gl.Vertex(x+w-skRight, y+h-skBottom) - - --//bottom right - gl.MultiTexCoord(texIndex,1,1) - gl.Vertex(x+w, y+h) - gl.MultiTexCoord(texIndex,1-txRight,1) - gl.Vertex(x+w-skRight, y+h) - - --//bottom center - gl.Vertex(x+w-skRight, y+h) --//degenerate - gl.MultiTexCoord(texIndex,1-txRight,1-txBottom) - gl.Vertex(x+w-skRight, y+h-skBottom) - gl.MultiTexCoord(texIndex,txLeft,1) - gl.Vertex(x+skLeft, y+h) - gl.MultiTexCoord(texIndex,txLeft,1-txBottom) - gl.Vertex(x+skLeft, y+h-skBottom) - - --//bottom left - gl.MultiTexCoord(texIndex,0,1) - gl.Vertex(x, y+h) - gl.MultiTexCoord(texIndex,0,1-txBottom) - gl.Vertex(x, y+h-skBottom) - - --//left center - gl.Vertex(x, y+h-skBottom) --//degenerate - gl.MultiTexCoord(texIndex,0,txTop) - gl.Vertex(x, y+skTop) - gl.MultiTexCoord(texIndex,txLeft,1-txBottom) - gl.Vertex(x+skLeft, y+h-skBottom) - gl.MultiTexCoord(texIndex,txLeft,txTop) - gl.Vertex(x+skLeft, y+skTop) -end -local _DrawTiledBorder = _DrawTiledBorder - - -local function _DrawDragGrip(obj) - local x = 13 - local y = 8 - local w = obj.dragGripSize[1] - local h = obj.dragGripSize[2] - - gl.Color(0.8,0.8,0.8,0.9) - gl.Vertex(x, y + h*0.5) - gl.Vertex(x + w*0.5, y) - gl.Vertex(x + w*0.5, y + h*0.5) - - gl.Color(0.3,0.3,0.3,0.9) - gl.Vertex(x + w*0.5, y + h*0.5) - gl.Vertex(x + w*0.5, y) - gl.Vertex(x + w, y + h*0.5) - - gl.Vertex(x + w*0.5, y + h) - gl.Vertex(x, y + h*0.5) - gl.Vertex(x + w*0.5, y + h*0.5) - - gl.Color(0.1,0.1,0.1,0.9) - gl.Vertex(x + w*0.5, y + h) - gl.Vertex(x + w*0.5, y + h*0.5) - gl.Vertex(x + w, y + h*0.5) -end - - -local function _DrawResizeGrip(obj) - if (obj.resizable) then - local x = 0 - local y = 0 - - local resizeBox = GetRelativeObjBox(obj,obj.boxes.resize) - - x = x-1 - y = y-1 - gl.Color(1,1,1,0.2) - gl.Vertex(x + resizeBox[1], y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2]) - - gl.Vertex(x + resizeBox[1] + math.ceil((resizeBox[3] - resizeBox[1])*0.33), y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2] + math.ceil((resizeBox[4] - resizeBox[2])*0.33)) - - gl.Vertex(x + resizeBox[1] + math.ceil((resizeBox[3] - resizeBox[1])*0.66), y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2] + math.ceil((resizeBox[4] - resizeBox[2])*0.66)) - - x = x+1 - y = y+1 - gl.Color(0.1, 0.1, 0.1, 0.9) - gl.Vertex(x + resizeBox[1], y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2]) - - gl.Vertex(x + resizeBox[1] + math.ceil((resizeBox[3] - resizeBox[1])*0.33), y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2] + math.ceil((resizeBox[4] - resizeBox[2])*0.33)) - - gl.Vertex(x + resizeBox[1] + math.ceil((resizeBox[3] - resizeBox[1])*0.66), y + resizeBox[4]) - gl.Vertex(x + resizeBox[3], y + resizeBox[2] + math.ceil((resizeBox[4] - resizeBox[2])*0.66)) - end -end - -local function _DrawCursor(x, y, w, h) - gl.Vertex(x, y) - gl.Vertex(x, y + h) - gl.Vertex(x + w, y) - gl.Vertex(x + w, y + h) -end - - ---//============================================================================= ---// - -function DrawWindow(obj) - local w = obj.width - local h = obj.height - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - local c = obj.color - if (c) then - gl.Color(c) - else - gl.Color(1,1,1,1) - end - TextureHandler.LoadTexture(0,obj.TileImage,obj) - local texInfo = gl.TextureInfo(obj.TileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th) - gl.Texture(0,false) - - if (obj.caption) then - obj.font:Print(obj.caption, w*0.5, 9, "center") - end -end - ---//============================================================================= ---// - -function DrawButton(obj) - if obj.debug then Spring.Echo("DrawButton", obj.name, obj.state.pressed) end - - local w = obj.width - local h = obj.height - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - local bgcolor = obj.backgroundColor - if (obj.state.pressed) then - bgcolor = mulColor(bgcolor, 0.4) - elseif (obj.state.hovered) --[[ or (obj.state.focused)]] then - bgcolor = obj.focusColor - --bgcolor = mixColors(bgcolor, obj.focusColor, 0.5) - end - gl.Color(bgcolor) - - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - local fgcolor = obj.borderColor - if (obj.state.pressed) then - fgcolor = mulColor(fgcolor, 0.4) - elseif (obj.state.hovered) --[[ or (obj.state.focused)]] then - fgcolor = obj.focusColor - end - gl.Color(fgcolor) - - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) - - if (obj.caption) then - obj.font:Print(obj.caption, w*0.5, h*0.5, "center", "center") - end -end - - -function DrawComboBox(self) - DrawButton(self) - - if (self.state.pressed) then - gl.Color(self.focusColor) - else - gl.Color(1,1,1,1) - end - TextureHandler.LoadTexture(0,self.TileImageArrow,self) - local texInfo = gl.TextureInfo(self.TileImageArrow) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.width - self.padding[3], 0, self.padding[3], self.height, tw,th) - gl.Texture(0,false) -end - - -function DrawEditBox(obj) - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - gl.Color(obj.backgroundColor) - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, 0, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) - --gl.Texture(0,false) - - if obj.state.focused or obj.state.hovered then - gl.Color(obj.focusColor) - else - gl.Color(obj.borderColor) - end - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, 0, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) - gl.Texture(0,false) - - if (obj.text) then - if (obj.offset > obj.cursor) then - obj.offset = obj.cursor - end - - local clientX,clientY,clientWidth,clientHeight = unpack4(obj.clientArea) - - --// make cursor pos always visible (when text is longer than editbox!) - repeat - local txt = obj.text:sub(obj.offset, obj.cursor) - local wt = obj.font:GetTextWidth(txt) - if (wt <= clientWidth) then - break - end - if (obj.offset >= obj.cursor) then - break - end - obj.offset = obj.offset + 1 - until (false) - - local txt = obj.text:sub(obj.offset) - - --// strip part at the end that exceeds the editbox - local lsize = math.max(0, obj.font:WrapText(txt, clientWidth, clientHeight):len() - 3) -- find a good start (3 dots at end if stripped) - while (lsize <= txt:len()) do - local wt = obj.font:GetTextWidth(txt:sub(1, lsize)) - if (wt > clientWidth) then - break - end - lsize = lsize + 1 - end - txt = txt:sub(1, lsize - 1) - - gl.Color(1,1,1,1) - obj.font:DrawInBox(txt, clientX, clientY, clientWidth, clientHeight, obj.align, obj.valign) - - if obj.state.focused then - local cursorTxt = obj.text:sub(obj.offset, obj.cursor - 1) - local cursorX = obj.font:GetTextWidth(cursorTxt) - - local dt = Spring.DiffTimers(Spring.GetTimer(), obj._interactedTime) - local as = math.sin(dt * 8); - local ac = math.cos(dt * 8); - if (as < 0) then as = 0 end - if (ac < 0) then ac = 0 end - local alpha = as + ac - if (alpha > 1) then alpha = 1 end - alpha = 0.8 * alpha - - local cc = obj.cursorColor - gl.Color(cc[1], cc[2], cc[3], cc[4] * alpha) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawCursor, cursorX + clientX - 1, clientY, 3, clientHeight) - end - end -end - ---//============================================================================= ---// - -function DrawPanel(obj) - local w = obj.width - local h = obj.height - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - gl.Color(obj.backgroundColor) - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - gl.Color(obj.borderColor) - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) -end - ---//============================================================================= ---// - -function DrawItemBkGnd(obj,x,y,w,h,state) - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - if (state=="selected") then - gl.Color(obj.colorBK_selected) - else - gl.Color(obj.colorBK) - end - TextureHandler.LoadTexture(0,obj.imageBK,obj) - local texInfo = gl.TextureInfo(obj.imageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - if (state=="selected") then - gl.Color(obj.colorFG_selected) - else - gl.Color(obj.colorFG) - end - TextureHandler.LoadTexture(0,obj.imageFG,obj) - local texInfo = gl.TextureInfo(obj.imageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) -end - ---//============================================================================= ---// - -function DrawScrollPanelBorder(self) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - local contX,contY,contWidth,contHeight = unpack4(self.contentArea) - - do - TextureHandler.LoadTexture(0,self.BorderTileImage,self) - local texInfo = gl.TextureInfo(self.BorderTileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - local skLeft,skTop,skRight,skBottom = unpack4(self.bordertiles) - - local width = self.width - local height = self.height - if (self._vscrollbar) then - width = width - self.scrollbarSize - 1 - end - if (self._hscrollbar) then - height = height - self.scrollbarSize - 1 - end - - gl.Color(self.borderColor) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledBorder, 0,0,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) - end -end - ---//============================================================================= ---// - -function DrawScrollPanel(obj) - local clientX,clientY,clientWidth,clientHeight = unpack4(obj.clientArea) - local contX,contY,contWidth,contHeight = unpack4(obj.contentArea) - - if (obj.BackgroundTileImage) then - TextureHandler.LoadTexture(0,obj.BackgroundTileImage,obj) - local texInfo = gl.TextureInfo(obj.BackgroundTileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - local skLeft,skTop,skRight,skBottom = unpack4(obj.bkgndtiles) - - local width = obj.width - local height = obj.height - if (obj._vscrollbar) then - width = width - obj.scrollbarSize - 1 - end - if (obj._hscrollbar) then - height = height - obj.scrollbarSize - 1 - end - - gl.Color(obj.backgroundColor) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) - end - - if obj._vscrollbar then - local x = obj.width - obj.scrollbarSize - local y = 0 - local w = obj.scrollbarSize - local h = obj.height --FIXME what if hscrollbar is visible - if (obj._hscrollbar) then - h = h - obj.scrollbarSize - end - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - TextureHandler.LoadTexture(0,obj.TileImage,obj) - local texInfo = gl.TextureInfo(obj.TileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - if obj._vscrolling or obj._vHovered then - gl.Color(obj.KnobColorSelected) - else - gl.Color(1,1,1,1) - end - - TextureHandler.LoadTexture(0,obj.KnobTileImage,obj) - texInfo = gl.TextureInfo(obj.KnobTileImage) or {xsize=1, ysize=1} - tw,th = texInfo.xsize, texInfo.ysize - - skLeft,skTop,skRight,skBottom = unpack4(obj.KnobTiles) - - local pos = obj.scrollPosY / contHeight - local visible = clientHeight / contHeight - local gripy = math.floor(y + h * pos) + 0.5 - local griph = math.floor(h * visible) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,gripy,obj.scrollbarSize,griph, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - gl.Color(1,1,1,1) - end - - if obj._hscrollbar then - gl.Color(1,1,1,1) - - local x = 0 - local y = obj.height - obj.scrollbarSize - local w = obj.width - local h = obj.scrollbarSize - if (obj._vscrollbar) then - w = w - obj.scrollbarSize - end - - local skLeft,skTop,skRight,skBottom = unpack4(obj.htiles) - - TextureHandler.LoadTexture(0,obj.HTileImage,obj) - local texInfo = gl.TextureInfo(obj.HTileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - if obj._hscrolling or obj._hHovered then - gl.Color(obj.KnobColorSelected) - else - gl.Color(1,1,1,1) - end - - TextureHandler.LoadTexture(0,obj.HKnobTileImage,obj) - texInfo = gl.TextureInfo(obj.HKnobTileImage) or {xsize=1, ysize=1} - tw,th = texInfo.xsize, texInfo.ysize - - skLeft,skTop,skRight,skBottom = unpack4(obj.HKnobTiles) - - local pos = obj.scrollPosX / contWidth - local visible = clientWidth / contWidth - local gripx = math.floor(x + w * pos) + 0.5 - local gripw = math.floor(w * visible) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, gripx,y,gripw,obj.scrollbarSize, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - end - - gl.Texture(0,false) -end - ---//============================================================================= ---// - -function DrawCheckbox(obj) - local boxSize = obj.boxsize - - local x = obj.width - boxSize - local y = obj.height*0.5 - boxSize*0.5 - local w = boxSize - local h = boxSize - - local tx = 0 - local ty = obj.height * 0.5 --// verticale center - - if obj.boxalign == "left" then - x = 0 - tx = boxSize + 2 - end - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - - if (obj.state.hovered) then - gl.Color(obj.focusColor) - else - gl.Color(1,1,1,1) - end - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - if (obj.state.checked) then - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - end - gl.Texture(0,false) - - gl.Color(1,1,1,1) - if (obj.caption) then - obj.font:Print(obj.caption, tx, ty, nil, "center") - end -end - ---//============================================================================= ---// - -function DrawProgressbar(obj) - local w = obj.width - local h = obj.height - - local percent = (obj.value-obj.min)/(obj.max-obj.min) - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - gl.Color(obj.backgroundColor) - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - gl.Color(obj.color) - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.ClipPlane(1, -1,0,0, w*percent) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.ClipPlane(1, false) - gl.Texture(0,false) - - if (obj.caption) then - (obj.font):Print(obj.caption, w*0.5, h*0.5, "center", "center") - end -end - ---//============================================================================= ---// - -function DrawTrackbar(self) - local percent = self:_GetPercent() - local w = self.width - local h = self.height - - local skLeft,skTop,skRight,skBottom = unpack4(self.tiles) - local pdLeft,pdTop,pdRight,pdBottom = unpack4(self.hitpadding) - - gl.Color(1,1,1,1) - - TextureHandler.LoadTexture(0,self.TileImage,self) - local texInfo = gl.TextureInfo(self.TileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - - TextureHandler.LoadTexture(0,self.StepImage,self) - local texInfo = gl.TextureInfo(self.StepImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - --// scale the thumb down if we don't have enough space - if (th>h) then - tw = math.ceil(tw*(h/th)) - th = h - end - if (tw>w) then - th = math.ceil(th*(w/tw)) - tw = w - end - - local barWidth = w - (pdLeft + pdRight) - local stepWidth = barWidth / ((self.max - self.min)/self.step) - - if ((self.max - self.min)/self.step)<20 then - local newStepWidth = stepWidth - if (newStepWidth<20) then - newStepWidth = stepWidth*2 - end - if (newStepWidth<20) then - newStepWidth = stepWidth*5 - end - if (newStepWidth<20) then - newStepWidth = stepWidth*10 - end - stepWidth = newStepWidth - - local my = h*0.5 - local mx = pdLeft+stepWidth - while (mx<(pdLeft+barWidth)) do - gl.TexRect(math.ceil(mx-tw*0.5),math.ceil(my-th*0.5),math.ceil(mx+tw*0.5),math.ceil(my+th*0.5),false,true) - mx = mx+stepWidth - end - end - - if (self.state.hovered) then - gl.Color(self.focusColor) - else - gl.Color(1,1,1,1) - end - - TextureHandler.LoadTexture(0,self.ThumbImage,self) - local texInfo = gl.TextureInfo(self.ThumbImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - --// scale the thumb down if we don't have enough space - tw = math.ceil(tw * (h / th)) - th = h - - local barWidth = w - (pdLeft + pdRight) - local mx = pdLeft + barWidth * percent - local my = h * 0.5 - mx = math.floor(mx - tw * 0.5) - my = math.floor(my - th * 0.5) - gl.TexRect(mx, my, mx + tw, my + th, false, true) - - gl.Texture(0,false) -end - ---//============================================================================= ---// - -function DrawTreeviewNode(self) - if CompareLinks(self.treeview.selected,self) then - local x = self.clientArea[1] - local y = 0 - local w = self.children[1].width - local h = self.clientArea[2] + self.children[1].height - - local skLeft,skTop,skRight,skBottom = unpack4(self.treeview.tiles) - - gl.Color(1,1,1,1) - TextureHandler.LoadTexture(0,self.treeview.ImageNodeSelected,self) - local texInfo = gl.TextureInfo(self.treeview.ImageNodeSelected) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) - end -end - - -local function _DrawLineV(x, y1, y2, width, next_func, ...) - gl.Vertex(x-width*0.5, y1) - gl.Vertex(x+width*0.5, y1) - gl.Vertex(x-width*0.5, y2) - - gl.Vertex(x+width*0.5, y1) - gl.Vertex(x-width*0.5, y2) - gl.Vertex(x+width*0.5, y2) - - if (next_func) then - next_func(...) - end -end - - -local function _DrawLineH(x1, x2, y, width, next_func, ...) - gl.Vertex(x1, y-width*0.5) - gl.Vertex(x1, y+width*0.5) - gl.Vertex(x2, y-width*0.5) - - gl.Vertex(x1, y+width*0.5) - gl.Vertex(x2, y-width*0.5) - gl.Vertex(x2, y+width*0.5) - - if (next_func) then - next_func(...) - end -end - - -function DrawTreeviewNodeTree(self) - local x1 = math.ceil(self.padding[1]*0.5) - local x2 = self.padding[1] - local y1 = 0 - local y2 = self.height - local y3 = self.padding[2] + math.ceil(self.children[1].height*0.5) - - if (self.parent)and(CompareLinks(self,self.parent.nodes[#self.parent.nodes])) then - y2 = y3 - end - - gl.Color(self.treeview.treeColor) - gl.BeginEnd(GL.TRIANGLES, _DrawLineV, x1-0.5, y1, y2, 1, _DrawLineH, x1, x2, y3-0.5, 1) - - if (not self.nodes[1]) then - return - end - - gl.Color(1,1,1,1) - local image = self.ImageExpanded or self.treeview.ImageExpanded - if (not self.expanded) then - image = self.ImageCollapsed or self.treeview.ImageCollapsed - end - - TextureHandler.LoadTexture(0, image, self) - local texInfo = gl.TextureInfo(image) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - _DrawTextureAspect(0,0,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) - gl.Texture(0,false) -end - - ---//============================================================================= ---// - -function DrawLine(self) - gl.Color(self.borderColor) - - if (self.style:find("^v")) then - local skLeft,skTop,skRight,skBottom = unpack4(self.tilesV) - TextureHandler.LoadTexture(0,self.TileImageV,self) - local texInfo = gl.TextureInfo(self.TileImageV) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.width * 0.5 - 2, 0, 4, self.height, skLeft,skTop,skRight,skBottom, tw,th, 0) - else - local skLeft,skTop,skRight,skBottom = unpack4(self.tiles) - TextureHandler.LoadTexture(0,self.TileImage,self) - local texInfo = gl.TextureInfo(self.TileImage) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, self.height * 0.5 - 2, self.width, 4, skLeft,skTop,skRight,skBottom, tw,th, 0) - end - - gl.Texture(0,false) - - if (self.debug) then - gl.Color(0,1,0,0.5) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) - gl.LineWidth(2) - gl.Rect(0,0,self.width,self.height) - gl.LineWidth(1) - gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) - end -end ---//============================================================================= ---// - -function DrawTabBarItem(obj) - local w = obj.width - local h = obj.height - - local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) - - if (obj.state.pressed) then - gl.Color(mulColor(obj.backgroundColor,0.4)) - elseif (obj.state.hovered) then - gl.Color(obj.focusColor) - elseif (obj.state.selected) then - gl.Color(obj.focusColor) - else - gl.Color(obj.backgroundColor) - end - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) - local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - - if (obj.state.pressed) then - gl.Color(0.6,0.6,0.6,1) --FIXME - elseif (obj.state.selected) then - gl.Color(obj.focusColor) - else - gl.Color(obj.borderColor) - end - - TextureHandler.LoadTexture(0,obj.TileImageFG,obj) - local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - gl.Texture(0,false) - - if (obj.caption) then - local cx,cy,cw,ch = unpack4(obj.clientArea) - obj.font:DrawInBox(obj.caption, cx, cy, cw, ch, "center", "center") - end -end - ---//============================================================================= ---// - -function DrawDragGrip(obj) - gl.BeginEnd(GL.TRIANGLES, _DrawDragGrip, obj) -end - - -function DrawResizeGrip(obj) - gl.BeginEnd(GL.LINES, _DrawResizeGrip, obj) -end - ---//============================================================================= ---// HitTest helpers - -function _ProcessRelative(code, total) - --// FIXME: duplicated in control.lua! - if (type(code) == "string") then - local percent = tonumber(code:sub(1,-2)) or 0 - if (percent<0) then - percent = 0 - elseif (percent>100) then - percent = 100 - end - return math.floor(total * percent) - elseif (code<0) then - return math.floor(total + code) - else - return math.floor(code) - end -end - - -function GetRelativeObjBox(obj,boxrelative) - return { - _ProcessRelative(boxrelative[1], obj.width), - _ProcessRelative(boxrelative[2], obj.height), - _ProcessRelative(boxrelative[3], obj.width), - _ProcessRelative(boxrelative[4], obj.height) - } -end - - ---//============================================================================= ---// - -function NCHitTestWithPadding(obj,mx,my) - local hp = obj.hitpadding - local x = hp[1] - local y = hp[2] - local w = obj.width - hp[1] - hp[3] - local h = obj.height - hp[2] - hp[4] - - --// early out - if (not InRect({x,y,w,h},mx,my)) then - return false - end - - local resizable = obj.resizable - local draggable = obj.draggable - local dragUseGrip = obj.dragUseGrip - if IsTweakMode() then - resizable = resizable or obj.tweakResizable - draggable = draggable or obj.tweakDraggable - dragUseGrip = draggable and obj.tweakDragUseGrip - end - - if (resizable) then - local resizeBox = GetRelativeObjBox(obj,obj.boxes.resize) - if (InRect(resizeBox,mx,my)) then - return obj - end - end - - if (dragUseGrip) then - local dragBox = GetRelativeObjBox(obj,obj.boxes.drag) - if (InRect(dragBox,mx,my)) then - return obj - end - elseif (draggable) then - return obj - end -end - -function WindowNCMouseDown(obj,x,y) - local resizable = obj.resizable - local draggable = obj.draggable - local dragUseGrip = obj.dragUseGrip - if IsTweakMode() then - resizable = resizable or obj.tweakResizable - draggable = draggable or obj.tweakDraggable - dragUseGrip = draggable and obj.tweakDragUseGrip - end - - if (resizable) then - local resizeBox = GetRelativeObjBox(obj,obj.boxes.resize) - if (InRect(resizeBox,x,y)) then - obj:StartResizing(x,y) - return obj - end - end - - if (dragUseGrip) then - local dragBox = GetRelativeObjBox(obj,obj.boxes.drag) - if (InRect(dragBox,x,y)) then - obj:StartDragging() - return obj - end - end -end - -function WindowNCMouseDownPostChildren(obj,x,y) - local draggable = obj.draggable - local dragUseGrip = obj.dragUseGrip - if IsTweakMode() then - draggable = draggable or obj.tweakDraggable - dragUseGrip = draggable and obj.tweakDragUseGrip - end - - if (draggable and not dragUseGrip) then - obj:StartDragging() - return obj - end -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/headers/strict.lua b/LuaIntro/chili/chili/headers/strict.lua deleted file mode 100644 index 5a48ed243..000000000 --- a/LuaIntro/chili/chili/headers/strict.lua +++ /dev/null @@ -1,25 +0,0 @@ --- --- strict.lua --- checks uses of undeclared global variables --- All global variables must be 'declared' through a regular assignment --- (even assigning nil will do) in a main chunk before being used --- anywhere or assigned to inside a function. --- - --- backup table works like a normal __index table -local function MakeStrict(env, backup) - local mt = getmetatable(env) - if mt == nil then - mt = {} - setmetatable(env, mt) - end - - mt.__index = function (t, n) - if (backup[n]==nil) then - error("variable '"..n.."' is not declared (strict mode)", 2) - end - return backup[n] - end -end - -return MakeStrict diff --git a/LuaIntro/chili/chili/headers/util.lua b/LuaIntro/chili/chili/headers/util.lua deleted file mode 100644 index 6bb42bded..000000000 --- a/LuaIntro/chili/chili/headers/util.lua +++ /dev/null @@ -1,510 +0,0 @@ ---//============================================================================= - -function IsTweakMode() - return widgetHandler.tweakMode -end - ---//============================================================================= - ---// some needed gl constants -GL_DEPTH24_STENCIL8 = 0x88F0 -GL_KEEP = 0x1E00 -GL_INCR_WRAP = 0x8507 -GL_DECR_WRAP = 0x8508 - ---//============================================================================= - -function unpack4(t) - return t[1], t[2], t[3], t[4] -end - -function clamp(min,max,num) - if (nummax) then - return max - end - return num -end - -function ExpandRect(rect,margin) - return { - rect[1] - margin[1], --//left - rect[2] - margin[2], --//top - rect[3] + margin[1] + margin[3], --//width - rect[4] + margin[2] + margin[4], --//height - } -end - -function InRect(rect,x,y) - return x>=rect[1] and y>=rect[2] and - x<=rect[1]+rect[3] and y<=rect[2]+rect[4] -end - -function ProcessRelativeCoord(code, total) - local num = tonumber(code) - - if (type(code) == "string") then - local percent = tonumber(code:sub(1,-2)) or 0 - if (percent<0) then - percent = 0 - elseif (percent>100) then - percent = 100 - end - return math.floor(total * percent/100) - elseif (num)and((1/num)<0) then - return math.floor(total + num) - else - return math.floor(num or 0) - end -end - -function IsRelativeCoord(code) - local num = tonumber(code) - - if (type(code) == "string") then - return true - elseif (num)and((1/num)<0) then - return true - else - return false - end -end - -function IsRelativeCoordType(code) - local num = tonumber(code) - - if (type(code) == "string") then - return "relative" - elseif (num)and((1/num)<0) then - return "negative" - else - return "default" - end -end - ---//============================================================================= - -function IsObject(v) - return ((type(v)=="metatable")or(type(v)=="userdata")) and(v.classname) -end - - -function IsNumber(v) - return (type(v)=="number") -end - -function isnumber(v) - return (type(v)=="number") -end - -function istable(v) - return (type(v)=="table") -end - -function isstring(v) - return (type(v)=="string") -end - -function isindexable(v) - local t = type(v) - return (t=="table")or(t=="metatable")or(t=="userdata") -end - -function isfunc(v) - return (type(v)=="function") -end - ---//============================================================================= - -local curScissor = {1,1,1e9,1e9} -local stack = {curScissor} -local stackN = 1 - -local pool = {} -local function GetVector4() - if not pool[1] then - return {0,0,0,0} - end - local t = pool[#pool] - pool[#pool] = nil - return t -end -local function FreeVector4(t) - pool[#pool + 1] = t -end - -local function PushScissor(_,x,y,w,h) - local right = x+w - local bottom = y+h - if (right > curScissor[3]) then - right = curScissor[3] - end - if (bottom > curScissor[4]) then - bottom = curScissor[4] - end - if (x < curScissor[1]) then - x = curScissor[1] - end - if (y < curScissor[2]) then - y = curScissor[2] - end - curScissor = {x,y,right,bottom} - --curScissor = GetVector4() - --curScissor[1] = x; curScissor[2] = y; curScissor[3] = right; curScissor[4] = bottom; - stackN = stackN + 1 - stack[stackN] = curScissor - - gl.Scissor(x,y,right - x,bottom - y) -end - - -local function PopScissor() - --FreeVector4(stack[stackN]) - stack[stackN] = nil - stackN = stackN - 1 - curScissor = stack[stackN] - if (stackN == 1) then - gl.Scissor(false) - else - local x,y, right,bottom = unpack4(curScissor) - gl.Scissor(x,y,right - x,bottom - y) - end -end - - - -local function PushStencilMask(obj, x,y,w,h) - obj._stencilMask = (obj.parent._stencilMask or 0) + 1 - if (obj._stencilMask > 255) then - obj._stencilMask = 0 - end - - gl.ColorMask(false) - - gl.StencilFunc(GL.ALWAYS, 0, 0xFF) - gl.StencilOp(GL_KEEP, GL_INCR_WRAP, GL_INCR_WRAP) - - if not obj.scrollPosY then - gl.Rect(0, 0, w, h) - else - local contentX,contentY,contentWidth,contentHeight = unpack4(obj.contentArea) - gl.Rect(0, 0, contentWidth,contentHeight) - end - - gl.ColorMask(true) - gl.StencilFunc(GL.EQUAL, obj._stencilMask, 0xFF) - gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) -end - -local function PopStencilMask(obj, x,y,w,h) - gl.ColorMask(false) - - gl.StencilFunc(GL.ALWAYS, 0, 0xFF) - gl.StencilOp(GL_KEEP, GL_DECR_WRAP, GL_DECR_WRAP) - - if not obj.scrollPosY then - gl.Rect(0, 0, w, h) - else - local contentX,contentY,contentWidth,contentHeight = unpack4(obj.contentArea) - gl.Rect(0, 0, contentWidth,contentHeight) - end - - gl.ColorMask(true) - gl.StencilFunc(GL.EQUAL, obj.parent._stencilMask or 0, 0xFF) - gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) - --gl.StencilTest(false) - - obj._stencilMask = nil -end - - -local inRTT = false - -function EnterRTT() - inRTT = true -end - -function LeaveRTT() - inRTT = false -end - -function AreInRTT() - return inRTT -end - - -function PushLimitRenderRegion(...) - if inRTT then - PushStencilMask(...) - else - PushScissor(...) - end -end - -function PopLimitRenderRegion(...) - if inRTT then - PopStencilMask(...) - else - PopScissor(...) - end -end - - ---//============================================================================= - -function AreRectsOverlapping(rect1,rect2) - return - (rect1[1] <= rect2[1] + rect2[3]) and - (rect1[1] + rect1[3] >= rect2[1]) and - (rect1[2] <= rect2[2] + rect2[4]) and - (rect1[2] + rect1[4] >= rect2[2]) -end - ---//============================================================================= - -local oldPrint = print -function print(...) - oldPrint(...) - io.flush() -end - ---//============================================================================= - -function _ParseColorArgs(r,g,b,a) - local t = type(r) - - if (t == "table") then - return r - else - return {r,g,b,a} - end -end - ---//============================================================================= - -function string:findlast(str) - local i - local j = 0 - repeat - i = j - j = self:find(str,i+1,true) - until (not j) - return i -end - -function string:GetExt() - local i = self:findlast('.') - if (i) then - return self:sub(i) - end -end - ---//============================================================================= - -local type = type -local pairs = pairs - -function table:clear() - for i,_ in pairs(self) do - self[i] = nil - end -end - -function table:map(fun) - local newTable = {} - for key, value in pairs(self) do - newTable[key] = fun(key, value) - end - return newTable -end - -function table:shallowcopy() - local newTable = {} - for k, v in pairs(self) do - newTable[k] = v - end - return newTable -end - -function table:arrayshallowcopy() - local newArray = {} - for i=1, #self do - newArray[i] = self[i] - end - return newTable -end - -function table:arrayappend(t) - for i=1, #t do - self[#self+1] = t[i] - end -end - -function table:arraymap(fun) - for i=1, #self do - newTable[i] = fun(self[i]) - end -end - -function table:fold(fun, state) - for key, value in pairs(self) do - fun(state, key, value) - end -end - -function table:arrayreduce(fun) - local state = self[1] - for i=2, #self do - state = fun(state , self[i]) - end - return state -end - --- removes and returns element from array --- array, T element -> T element -function table:arrayremovefirst(element) - for i=1, #self do - if self[i] == element then - return self:remove(i) - end - end -end - -function table:ifind(element) - for i=1, #self do - if self[i] == element then - return i - end - end - return false -end - -function table:sum() - local r = 0 - for i=1, #self do - r = r + self[i] - end - return r -end - -function table:merge(table2) - for i,v in pairs(table2) do - if (type(v)=='table') then - local sv = type(self[i]) - if (sv == 'table')or(sv == 'nil') then - if (sv == 'nil') then self[i] = {} end - table.merge(self[i],v) - end - elseif (self[i] == nil) then - self[i] = v - end - end -end - -function table:iequal(table2) - for i,v in pairs(self) do - if (table2[i] ~= v) then - return false - end - end - - for i,v in pairs(table2) do - if (self[i] ~= v) then - return false - end - end - - return true -end - -function table:iequal(table2) - local length = #self - if (length ~= #table2) then - return false - end - - for i=1,length do - if (self[i] ~= table2[i]) then - return false - end - end - - return true -end - -function table:size() - local cnt = 0 - for _ in pairs(self) do - cnt = cnt + 1 - end - return cnt -end - ---//============================================================================= - -local weak_meta = {__mode='v'} -function CreateWeakTable() - local m = {} - setmetatable(m, weak_meta) - return m -end - ---//============================================================================= - -function math.round(num,idp) - if (not idp) then - return math.floor(num+.5) - else - return ("%." .. idp .. "f"):format(num) - --local mult = 10^(idp or 0) - --return math.floor(num * mult + 0.5) / mult - end -end - ---//============================================================================= - -function InvertColor(c) - return {1 - c[1], 1 - c[2], 1 - c[3], c[4]} -end - -function math.mix(x, y, a) - return y * a + x * (1 - a) -end - -function mulColor(c, s) - return {s * c[1], s * c[2], s * c[3], c[4]} -end - -function mulColors(c1, c2) - return {c1[1] * c2[1], c1[2] * c2[2], c1[3] * c2[3], c1[4] * c2[4]} -end - -function mixColors(c1, c2, a) - return { - math.mix(c1[1], c2[1], a), - math.mix(c1[2], c2[2], a), - math.mix(c1[3], c2[3], a), - math.mix(c1[4], c2[4], a) - } -end - -function color2incolor(r,g,b,a) - if type(r) == 'table' then - r,g,b,a = unpack4(r) - end - - local inColor = '\255\255\255\255' - if r then - inColor = string.char(255, r*255, g*255, b*255) - end - return inColor -end - -function incolor2color(inColor) - local a = 255 - local r,g,b = inColor:sub(2,4):byte(1,3) - return r/255, g/255, b/255, a/255 -end - ---//============================================================================= diff --git a/LuaIntro/chili/chili/skins/DarkGlass/combobox_wnd.png b/LuaIntro/chili/chili/skins/DarkGlass/combobox_wnd.png deleted file mode 100644 index 6bed10b2f..000000000 Binary files a/LuaIntro/chili/chili/skins/DarkGlass/combobox_wnd.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/DarkGlass/glass.psp b/LuaIntro/chili/chili/skins/DarkGlass/glass.psp deleted file mode 100644 index 2d4ed180d..000000000 Binary files a/LuaIntro/chili/chili/skins/DarkGlass/glass.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/DarkGlass/glass_.png b/LuaIntro/chili/chili/skins/DarkGlass/glass_.png deleted file mode 100644 index a7bc9d113..000000000 Binary files a/LuaIntro/chili/chili/skins/DarkGlass/glass_.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/DarkGlass/skin.lua b/LuaIntro/chili/chili/skins/DarkGlass/skin.lua deleted file mode 100644 index 57a1b30ea..000000000 --- a/LuaIntro/chili/chili/skins/DarkGlass/skin.lua +++ /dev/null @@ -1,54 +0,0 @@ ---//============================================================================= ---// GlassSkin - -local skin = { - info = { - name = "DarkGlass", - version = "0.11", - author = "jK", - - depend = { - "Glass", - }, - } -} - ---//============================================================================= ---// - -skin.general = { - textColor = {1,1,1,1}, -} - -skin.window = { - TileImage = ":cl:glass_.png", - tiles = {22, 24, 22, 23}, --// tile widths: left,top,right,bottom - padding = {14, 23, 14, 14}, - hitpadding = {10, 4, 10, 10}, - - captionColor = {1, 1, 1, 0.55}, - - boxes = { - resize = {-25, -25, -14, -14}, - drag = {0, 0, "100%", 24}, - }, - - NCHitTest = NCHitTestWithPadding, - NCMouseDown = WindowNCMouseDown, - NCMouseDownPostChildren = WindowNCMouseDownPostChildren, - - DrawControl = DrawWindow, - DrawDragGrip = DrawDragGrip, - DrawResizeGrip = DrawResizeGrip, -} - -skin.combobox_window = { - clone = "window"; - TileImage = ":cl:combobox_wnd.png", - padding = {4, 3, 3, 4}; -} - ---//============================================================================= ---// - -return skin diff --git a/LuaIntro/chili/chili/skins/Glass/checkbox.png b/LuaIntro/chili/chili/skins/Glass/checkbox.png deleted file mode 100644 index 813eb2cec..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/checkbox.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/combobox_wnd.png b/LuaIntro/chili/chili/skins/Glass/combobox_wnd.png deleted file mode 100644 index 3a9bbf05d..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/combobox_wnd.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/glassBK.png b/LuaIntro/chili/chili/skins/Glass/glassBK.png deleted file mode 100644 index 085ceb481..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/glassBK.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/glassFG.png b/LuaIntro/chili/chili/skins/Glass/glassFG.png deleted file mode 100644 index 3fd25571a..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/glassFG.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/panel.png b/LuaIntro/chili/chili/skins/Glass/panel.png deleted file mode 100644 index c93428d92..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/panel.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/panel_.png b/LuaIntro/chili/chili/skins/Glass/panel_.png deleted file mode 100644 index d8ebfc0a9..000000000 Binary files a/LuaIntro/chili/chili/skins/Glass/panel_.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Glass/skin.lua b/LuaIntro/chili/chili/skins/Glass/skin.lua deleted file mode 100644 index 9d94ba951..000000000 --- a/LuaIntro/chili/chili/skins/Glass/skin.lua +++ /dev/null @@ -1,228 +0,0 @@ ---//============================================================================= ---// GlassSkin - -local skin = { - info = { - name = "Glass", - version = "0.2", - author = "jK", - } -} - ---//============================================================================= ---// - -skin.general = { - --font = "FreeSansBold.ttf", - fontsize = 13, - textColor = {0.1,0.1,0.1,1}, - focusColor = {0.35, 0.35, 1.0, 0.9}, - borderColor = {1.0, 1.0, 1.0, 1.0}, - - --padding = {5, 5, 5, 5}, --// padding: left, top, right, bottom - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - - font = { - outlineColor = {0.2,0.2,0.2,0.3}, - --autoOutlineColor = false, - --shadow = true, - }, -} - -skin.icons = { - imageplaceholder = ":cl:placeholder.png", -} - -skin.button = { - TileImageFG = ":cl:glassFG.png", - TileImageBK = ":cl:glassBK.png", - tiles = {17,15,17,20}, - - textColor = {1,1,1,1}, - - padding = {12, 12, 12, 12}, - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - - DrawControl = DrawButton, -} - - -skin.combobox = { - TileImageFG = ":cl:glassFG.png", - TileImageBK = ":cl:glassBK.png", - TileImageArrow = ":cl:combobox_ctrl_arrow.png", - tiles = {17,15,17,20}, - padding = {10, 10, 26, 10}, - - textColor = {1,1,1,1}, - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - - DrawControl = DrawComboBox, -} - - -skin.combobox_window = { - clone = "window"; - TileImage = ":cl:combobox_wnd.png", - padding = {4, 3, 3, 4}; -} - - -skin.combobox_scrollpanel = { - clone = "scrollpanel"; - borderColor = {1, 1, 1, 0}; - padding = {0, 0, 0, 0}; -} - - -skin.combobox_item = { - clone = "button"; -} - - -skin.editbox = { - textColor = {1.0, 1.0, 1.0, 1.0}, - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - cursorColor = {0.35, 0.35, 1.0, 0.9}, -} - -skin.checkbox = { - TileImageFG = ":cl:checkbox_arrow.png", - TileImageBK = ":cl:checkbox.png", - tiles = {3,3,3,3}, - boxsize = 13, - - DrawControl = DrawCheckbox, -} - - -skin.imagelistview = { - imageFolder = "folder.png", - imageFolderUp = "folder_up.png", - - --DrawControl = DrawBackground, - - colorFG = {0.75,0.75,0.75,0.65}, - colorFG_selected = {1,1,1,0.65}, - imageFG = ":cl:itemlistview_item_fg.png", - - colorBK = {0.5, 0.5, 0.5, 0.1}, - colorBK_selected = {0.35,0.35,1,0.9}, - imageBK = ":cl:glassBK.png", - - tiles = {17,15,17,20}, - - DrawItemBackground = DrawItemBkGnd, -} ---[[ -skin.imagelistviewitem = { - imageFG = ":cl:glassFG.png", - imageBK = ":cl:glassBK.png", - tiles = {17,15,17,20}, - - padding = {12, 12, 12, 12}, - - DrawSelectionItemBkGnd = DrawSelectionItemBkGnd, -} ---]] - -skin.panel = { - TileImageFG = ":cl:glassFG.png", - TileImageBK = ":cl:glassBK.png", - tiles = {17,15,17,20}, - - DrawControl = DrawPanel, -} - -skin.progressbar = { - TileImageFG = ":cl:progressbar_full.png", - TileImageBK = ":cl:progressbar_empty.png", - tiles = {3,3,3,3}, - - DrawControl = DrawProgressbar, -} - -skin.scrollpanel = { - BorderTileImage = ":cl:panel.png", - bordertiles = {14,10,14,8}, - - TileImage = ":cl:scrollbar.png", - tiles = {6,3,6,3}, - KnobTileImage = ":cl:scrollbar_knob.png", - KnobTiles = {6,7,6,7}, - - HTileImage = ":cl:hscrollbar.png", - htiles = {3,6,3,6}, - HKnobTileImage = ":cl:scrollbar_knob.png", - HKnobTiles = {6,7,6,9}, - - KnobColorSelected = {0.35, 0.35, 1.0, 0.9}, - - padding = {1,1,1,1}, - - scrollbarSize = 11, - DrawControl = DrawScrollPanel, - DrawControlPostChildren = DrawScrollPanelBorder, -} - -skin.trackbar = { - TileImage = ":cl:trackbar.png", - tiles = {6, 3, 6, 3}, --// tile widths: left,top,right,bottom - - ThumbImage = ":cl:trackbar_thumb.png", - StepImage = ":cl:trackbar_step.png", - - hitpadding = {4, 4, 4, 4}, - - DrawControl = DrawTrackbar, -} - -skin.treeview = { - ImageNodeSelected = ":cl:node_selected.png", - tiles = {10,9,10,22}, - - ImageExpanded = ":cl:treeview_node_expanded.png", - ImageCollapsed = ":cl:treeview_node_collapsed.png", - treeColor = {0,0,0,0.4}, - - DrawNode = DrawTreeviewNode, - DrawNodeTree = DrawTreeviewNodeTree, -} - -skin.window = { - TileImage = ":cl:glass.png", - tiles = {22, 24, 22, 23}, --// tile widths: left,top,right,bottom - padding = {14, 23, 14, 14}, - hitpadding = {10, 4, 10, 10}, - - captionColor = {0, 0, 0, 0.55}, - - boxes = { - resize = {-25, -25, -14, -14}, - drag = {0, 0, "100%", 24}, - }, - - NCHitTest = NCHitTestWithPadding, - NCMouseDown = WindowNCMouseDown, - NCMouseDownPostChildren = WindowNCMouseDownPostChildren, - - DrawControl = DrawWindow, - DrawDragGrip = DrawDragGrip, - DrawResizeGrip = DrawResizeGrip, -} - -skin.line = { - TileImage = ":cl:glass_line.png", - tiles = {0, 0, 0, 0}, - TileImageV = ":cl:glass_line_vert.png", - tilesV = {0, 0, 0, 0}, - DrawControl = DrawLine, -} - -skin.control = skin.general - - ---//============================================================================= ---// - -return skin diff --git a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl.png b/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl.png deleted file mode 100644 index ace4e7f7a..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_arrow.png b/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_arrow.png deleted file mode 100644 index 1bcf02e90..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_arrow.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_fg.png b/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_fg.png deleted file mode 100644 index 170e6ccd9..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/combobox_ctrl_fg.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/combobox_wnd.png b/LuaIntro/chili/chili/skins/Robocracy/combobox_wnd.png deleted file mode 100644 index a4c712bad..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/combobox_wnd.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/empty.png b/LuaIntro/chili/chili/skins/Robocracy/empty.png deleted file mode 100644 index 687adc453..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/empty.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/fonts/README b/LuaIntro/chili/chili/skins/Robocracy/fonts/README deleted file mode 100644 index 15603deac..000000000 --- a/LuaIntro/chili/chili/skins/Robocracy/fonts/README +++ /dev/null @@ -1,7 +0,0 @@ - -The included font "Nimbus Sans L" with the filename "n019003l.pfb", -located next to this README, is retrieved from the Gentoo portage -(media-fonts/urw-fonts) including their modifications. -It is licensed under GPL with an addition as discribed in README.gentoo. - -Thanks to URW for releasing the font(s) under it. diff --git a/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo b/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo deleted file mode 100644 index e05577db9..000000000 --- a/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo +++ /dev/null @@ -1,51 +0,0 @@ -Cyrillized free URW fonts. - -These fonts were made from the free URW fonts distributed with ghostcript. -There are NO changes in the latin part of them (I hope). -Cyrillic glyphs were added by copying suitable latin ones -and painting oulines of unique cyrillic glyphs in same style as the others. -For all modification pfaedit was used. -The license for result is (of course) same as for original fonts, -i.e. GPL with an exception that you can put these fonts in your own non-GPLed -documents. (Looks like LGPL from my point of view =). - -The "sources" of these fonts in the native pfaedit format are available -at ftp://ftp.gnome.ru/fonts/sources - -The great font editor pfaedit is available at http://pfaedit.sf.net. -That page also includes some links to fonts created by -George Williams -- the author of pfaedit. - -Acknowledgements: -I would like to thank George Williams, the pfaedit's author and developer. -He is the most bug-reporter/feature-requester friendly developer -I ever saw in my not so short life. At some moment in the future -I must write a book about him: "George Williams and my best experience -in bug-reporting." George also greatly helped me bug-hunting these fonts, -explained to me some very important things about fonts and font design, -quickly adopted pfaedit to my needs (or pointed me to The Right Place in -documentation where I found better way of doing things). - -I would like to thank Alexey Novodvorsky (aka AEN), who -pointed me to pfaedit and George Williams' fonts, explained -The Task to me. He is also one of the main participators in the -development of Sysiphus -- free repository of free software. -I didn't loose my time for compiling/installing and supporting -my linux box coz I used the result of Sysiphus developers' works. - -I would like to thank Sergey Vlasov, who tested these fonts and reported -about bugs. Also he help me to make some bug-reports to George about -pfaedit bugs. - -I would like Dmitry 40in, who did big QA for some font outlines, drawn some glyphs, -and explain some The Truths for me. - -I would like to thank Vlad Harchev (aka hvv), who -proofread this text for me. - -Also I have to thank RMS for GPL and URW for releasing the fonts -under it. - -Thank you very much! -Valek Filippov frob@df.ru -(C)opyLeft 2001 \ No newline at end of file diff --git a/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo.tweaks b/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo.tweaks deleted file mode 100644 index 9fa761ac8..000000000 --- a/LuaIntro/chili/chili/skins/Robocracy/fonts/README.gentoo.tweaks +++ /dev/null @@ -1,38 +0,0 @@ -Nimbus Sans L Regular, Nimbus Mono L Regular, Nimbus Mono L Oblique -all come from a more recent version of the cyrillic URW fonts. - -The hints on Nimbus Sans Regular have been modified in the -following ways: - -25 June 2002 - - - Added ghost hint to the top of 4 to keep it from being - taller than the other digits. - - Reduced the width of the left stem hint for H to 83 - (probably no real differences) - - Changed the StemSnapV values from [78 85 94] to [78 83 92] - (and fixed up StdVW accordingly) - This corresponds to the values in the font (which are 83/93 - for lower case and upper case stems) better and makes - the width-88 stems on M and N snap to to upper case - widths not lower-case widths. - -29 June 2002 - - - Removed odd vertical stem hints (width of horizontal - stems) from f, F, t, E, yen sign, fi ligature, - fl ligature, AE ligature, R, Lstroke, OE ligature, - lstroke, E" variants, t, variants, Eth, Dstoke, etc. - - Fixed hints on 1 to be two ghost hints instead of one - hint the height of the font - - fix bottom stem of u to have integer coordinates - - fixed hints on | - - fixed hints on inverted exclamation mark - -The hints on Nimbus Mono L Oblique have been modified in the -following ways: - - - Removed vertical stem hints from horizontal serifs on - roman characters. - -Owen Taylor diff --git a/LuaIntro/chili/chili/skins/Robocracy/fonts/n019003l.pfb b/LuaIntro/chili/chili/skins/Robocracy/fonts/n019003l.pfb deleted file mode 100644 index c2a9e8610..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/fonts/n019003l.pfb and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/glassBk.png b/LuaIntro/chili/chili/skins/Robocracy/glassBk.png deleted file mode 100644 index 085ceb481..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/glassBk.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/glassFG.png b/LuaIntro/chili/chili/skins/Robocracy/glassFG.png deleted file mode 100644 index 3fd25571a..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/glassFG.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/node_selected.png b/LuaIntro/chili/chili/skins/Robocracy/node_selected.png deleted file mode 100644 index 11933fb53..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/node_selected.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/node_selected.psp b/LuaIntro/chili/chili/skins/Robocracy/node_selected.psp deleted file mode 100644 index 0b73a32a6..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/node_selected.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/node_selected_bw.png b/LuaIntro/chili/chili/skins/Robocracy/node_selected_bw.png deleted file mode 100644 index 05c6e1e19..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/node_selected_bw.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/panel2.png b/LuaIntro/chili/chili/skins/Robocracy/panel2.png deleted file mode 100644 index ed0d0cb5c..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/panel2.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/panel2.psp b/LuaIntro/chili/chili/skins/Robocracy/panel2.psp deleted file mode 100644 index 522a27f7b..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/panel2.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/panel2_bg.png b/LuaIntro/chili/chili/skins/Robocracy/panel2_bg.png deleted file mode 100644 index fbc92dd9c..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/panel2_bg.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/panel2_border.png b/LuaIntro/chili/chili/skins/Robocracy/panel2_border.png deleted file mode 100644 index 5ab682014..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/panel2_border.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/skin.lua b/LuaIntro/chili/chili/skins/Robocracy/skin.lua deleted file mode 100644 index 0e44f931a..000000000 --- a/LuaIntro/chili/chili/skins/Robocracy/skin.lua +++ /dev/null @@ -1,262 +0,0 @@ ---//============================================================================= ---// Skin - -local skin = { - info = { - name = "Robocracy", - version = "0.3", - author = "jK", - } -} - ---//============================================================================= ---// - -skin.general = { - focusColor = {1.0, 0.7, 0.1, 0.8}, - borderColor = {1.0, 1.0, 1.0, 1.0}, - - font = { - font = SKINDIR .. "fonts/n019003l.pfb", - color = {1,1,1,1}, - outlineColor = {0.05,0.05,0.05,0.9}, - outline = false, - shadow = true, - size = 14, - }, - - --padding = {5, 5, 5, 5}, --// padding: left, top, right, bottom -} - - -skin.icons = { - imageplaceholder = ":cl:placeholder.png", -} - -skin.button = { - TileImageBK = ":cl:tech_button_bk.png", - TileImageFG = ":cl:tech_button_fg.png", - tiles = {22, 22, 22, 22}, --// tile widths: left,top,right,bottom - padding = {10, 10, 10, 10}, - - backgroundColor = {1, 1, 1, 0.7}, - borderColor = {1,1,1,0}, - - DrawControl = DrawButton, -} - -skin.combobox = { - TileImageBK = ":cl:combobox_ctrl.png", - TileImageFG = ":cl:combobox_ctrl_fg.png", - TileImageArrow = ":cl:combobox_ctrl_arrow.png", - tiles = {22, 22, 48, 22}, - padding = {10, 10, 24, 10}, - - backgroundColor = {1, 1, 1, 0.7}, - borderColor = {1,1,1,0}, - - DrawControl = DrawComboBox, -} - - -skin.combobox_window = { - clone = "window"; - TileImage = ":cl:combobox_wnd.png"; - tiles = {10, 10, 10, 10}; - padding = {4, 3, 3, 4}; -} - - -skin.combobox_scrollpanel = { - clone = "scrollpanel"; - borderColor = {1, 1, 1, 0}; - padding = {0, 0, 0, 0}; -} - - -skin.combobox_item = { - clone = "button"; - borderColor = {1, 1, 1, 0}; -} - - -skin.checkbox = { - TileImageFG = ":cl:tech_checkbox_checked.png", - TileImageBK = ":cl:tech_checkbox_unchecked.png", - tiles = {3,3,3,3}, - boxsize = 13, - - DrawControl = DrawCheckbox, -} - -skin.editbox = { - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - cursorColor = {1.0, 0.7, 0.1, 0.8}, - - TileImageBK = ":cl:panel2_bg.png", - TileImageFG = ":cl:panel2_border.png", - tiles = {14,14,14,14}, - - DrawControl = DrawEditBox, -} - -skin.imagelistview = { - imageFolder = "folder.png", - imageFolderUp = "folder_up.png", - - --DrawControl = DrawBackground, - - colorBK = {1,1,1,0.3}, - colorBK_selected = {1,0.7,0.1,0.8}, - - colorFG = {0, 0, 0, 0}, - colorFG_selected = {1,1,1,1}, - - imageBK = ":cl:node_selected_bw.png", - imageFG = ":cl:node_selected.png", - tiles = {9, 9, 9, 9}, - - DrawItemBackground = DrawItemBkGnd, -} ---[[ -skin.imagelistviewitem = { - imageFG = ":cl:glassFG.png", - imageBK = ":cl:glassBK.png", - tiles = {17,15,17,20}, - - padding = {12, 12, 12, 12}, - - DrawSelectionItemBkGnd = DrawSelectionItemBkGnd, -} ---]] - -skin.panel = { - TileImageBK = ":cl:tech_button.png", - TileImageFG = ":cl:empty.png", - tiles = {22, 22, 22, 22}, - - DrawControl = DrawPanel, -} - -skin.progressbar = { - TileImageFG = ":cl:tech_progressbar_full.png", - TileImageBK = ":cl:tech_progressbar_empty.png", - tiles = {10, 10, 10, 10}, - - font = { - shadow = true, - }, - - backgroundColor = {1,1,1,1}, - - DrawControl = DrawProgressbar, -} - -skin.scrollpanel = { - BorderTileImage = ":cl:panel2_border.png", - bordertiles = {14,14,14,14}, - - BackgroundTileImage = ":cl:panel2_bg.png", - bkgndtiles = {14,14,14,14}, - - TileImage = ":cl:tech_scrollbar.png", - tiles = {7,7,7,7}, - KnobTileImage = ":cl:tech_scrollbar_knob.png", - KnobTiles = {6,8,6,8}, - - HTileImage = ":cl:tech_scrollbar.png", - htiles = {7,7,7,7}, - HKnobTileImage = ":cl:tech_scrollbar_knob.png", - HKnobTiles = {6,8,6,8}, - - KnobColorSelected = {1,0.7,0.1,0.8}, - - padding = {5, 5, 5, 0}, - - scrollbarSize = 11, - DrawControl = DrawScrollPanel, - DrawControlPostChildren = DrawScrollPanelBorder, -} - -skin.trackbar = { - TileImage = ":cn:trackbar.png", - tiles = {10, 14, 10, 14}, --// tile widths: left,top,right,bottom - - ThumbImage = ":cl:trackbar_thumb.png", - StepImage = ":cl:trackbar_step.png", - - hitpadding = {4, 4, 5, 4}, - - DrawControl = DrawTrackbar, -} - -skin.treeview = { - --ImageNode = ":cl:node.png", - ImageNodeSelected = ":cl:node_selected.png", - tiles = {9, 9, 9, 9}, - - ImageExpanded = ":cl:treeview_node_expanded.png", - ImageCollapsed = ":cl:treeview_node_collapsed.png", - treeColor = {1,1,1,0.1}, - - DrawNode = DrawTreeviewNode, - DrawNodeTree = DrawTreeviewNodeTree, -} - -skin.window = { - TileImage = ":c:tech_dragwindow.png", - --TileImage = ":cl:tech_window.png", - --TileImage = ":cl:window_tooltip.png", - --tiles = {25, 25, 25, 25}, --// tile widths: left,top,right,bottom - tiles = {62, 62, 62, 62}, --// tile widths: left,top,right,bottom - padding = {13, 13, 13, 13}, - hitpadding = {4, 4, 4, 4}, - - captionColor = {1, 1, 1, 0.45}, - - backgroundColor = {0.1, 0.1, 0.1, 0.7}, - - boxes = { - resize = {-21, -21, -10, -10}, - drag = {0, 0, "100%", 10}, - }, - - NCHitTest = NCHitTestWithPadding, - NCMouseDown = WindowNCMouseDown, - NCMouseDownPostChildren = WindowNCMouseDownPostChildren, - - DrawControl = DrawWindow, - DrawDragGrip = function() end, - DrawResizeGrip = DrawResizeGrip, -} - -skin.line = { - TileImage = ":cl:tech_line.png", - tiles = {0, 0, 0, 0}, - TileImageV = ":cl:tech_line_vert.png", - tilesV = {0, 0, 0, 0}, - DrawControl = DrawLine, -} - -skin.tabbar = { - padding = {3, 1, 1, 0}, -} - -skin.tabbaritem = { - TileImageBK = ":cl:tech_tabbaritem_bk.png", - TileImageFG = ":cl:tech_tabbaritem_fg.png", - tiles = {10, 10, 10, 0}, --// tile widths: left,top,right,bottom - padding = {5, 3, 3, 2}, - backgroundColor = {1, 1, 1, 1.0}, - - DrawControl = DrawTabBarItem, -} - - -skin.control = skin.general - - ---//============================================================================= ---// - -return skin diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_button.png b/LuaIntro/chili/chili/skins/Robocracy/tech_button.png deleted file mode 100644 index b13b95451..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_button.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_button.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_button.psp deleted file mode 100644 index ac80fca92..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_button.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_button_bk.png b/LuaIntro/chili/chili/skins/Robocracy/tech_button_bk.png deleted file mode 100644 index 4ccf16d3b..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_button_bk.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_button_fg.png b/LuaIntro/chili/chili/skins/Robocracy/tech_button_fg.png deleted file mode 100644 index 9dece4652..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_button_fg.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_buttonbk.png b/LuaIntro/chili/chili/skins/Robocracy/tech_buttonbk.png deleted file mode 100644 index 9d2332fa9..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_buttonbk.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox.psp deleted file mode 100644 index 5209c5faf..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_checked.png b/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_checked.png deleted file mode 100644 index a96e6055b..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_checked.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_unchecked.png b/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_unchecked.png deleted file mode 100644 index 4ac39bfe8..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_checkbox_unchecked.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.png b/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.png deleted file mode 100644 index 5815ad5d0..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.psp deleted file mode 100644 index ee06d6362..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_dragwindow.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_line.png b/LuaIntro/chili/chili/skins/Robocracy/tech_line.png deleted file mode 100644 index 6b61f09be..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_line.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_line_vert.png b/LuaIntro/chili/chili/skins/Robocracy/tech_line_vert.png deleted file mode 100644 index 6d835251e..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_line_vert.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar.psp deleted file mode 100644 index baf72ecc1..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_empty.png b/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_empty.png deleted file mode 100644 index 0e7936056..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_empty.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_full.png b/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_full.png deleted file mode 100644 index 0e276bcd0..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_progressbar_full.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.png b/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.png deleted file mode 100644 index 89820d1c9..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.psp deleted file mode 100644 index ab3a0f730..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.png b/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.png deleted file mode 100644 index c73b19f2d..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.psp deleted file mode 100644 index 10f5064ca..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_scrollbar_knob.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem.png b/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem.png deleted file mode 100644 index 1f3127920..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_bk.png b/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_bk.png deleted file mode 100644 index 92cb1c182..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_bk.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_fg.png b/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_fg.png deleted file mode 100644 index c0de9653f..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_tabbaritem_fg.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_window.png b/LuaIntro/chili/chili/skins/Robocracy/tech_window.png deleted file mode 100644 index a15982d96..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_window.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/tech_window.psp b/LuaIntro/chili/chili/skins/Robocracy/tech_window.psp deleted file mode 100644 index af5a05263..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/tech_window.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/trackbar.png b/LuaIntro/chili/chili/skins/Robocracy/trackbar.png deleted file mode 100644 index 447619f10..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/trackbar.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/trackbar_step.png b/LuaIntro/chili/chili/skins/Robocracy/trackbar_step.png deleted file mode 100644 index bbd8b6ec2..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/trackbar_step.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/trackbar_thumb.png b/LuaIntro/chili/chili/skins/Robocracy/trackbar_thumb.png deleted file mode 100644 index 70937c061..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/trackbar_thumb.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_collapsed.png b/LuaIntro/chili/chili/skins/Robocracy/treeview_node_collapsed.png deleted file mode 100644 index f1b7cceec..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_collapsed.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded.png b/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded.png deleted file mode 100644 index 0f93d46d6..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded_bw.png b/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded_bw.png deleted file mode 100644 index 2ed00e649..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/treeview_node_expanded_bw.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.png b/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.png deleted file mode 100644 index 7d8b1b4f5..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.psp b/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.psp deleted file mode 100644 index 2426bcb68..000000000 Binary files a/LuaIntro/chili/chili/skins/Robocracy/window_tooltip.psp and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/empty.png b/LuaIntro/chili/chili/skins/default/empty.png deleted file mode 100644 index 18d49877d..000000000 Binary files a/LuaIntro/chili/chili/skins/default/empty.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/folder.png b/LuaIntro/chili/chili/skins/default/folder.png deleted file mode 100644 index dc2765613..000000000 Binary files a/LuaIntro/chili/chili/skins/default/folder.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/folder_up.png b/LuaIntro/chili/chili/skins/default/folder_up.png deleted file mode 100644 index 593874761..000000000 Binary files a/LuaIntro/chili/chili/skins/default/folder_up.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/placeholder.png b/LuaIntro/chili/chili/skins/default/placeholder.png deleted file mode 100644 index 31d788ef9..000000000 Binary files a/LuaIntro/chili/chili/skins/default/placeholder.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/skin.lua b/LuaIntro/chili/chili/skins/default/skin.lua deleted file mode 100644 index 831d378d4..000000000 --- a/LuaIntro/chili/chili/skins/default/skin.lua +++ /dev/null @@ -1,721 +0,0 @@ ---//============================================================================= ---// default - -local skin = { - info = { - name = "default", - version = "0.1", - author = "jK", - } -} - ---//============================================================================= ---// Render Helpers - -local function _DrawBorder(x,y,w,h,bt,color1,color2) - gl.Color(color1) - gl.Vertex(x, y+h) - gl.Vertex(x+bt, y+h-bt) - gl.Vertex(x, y) - gl.Vertex(x+bt, y) - gl.Vertex(x+bt, y) - gl.Vertex(x+bt, y+bt) - gl.Vertex(x+w, y) - gl.Vertex(x+w-bt,y+bt) - - gl.Color(color2) - gl.Vertex(x+w-bt,y+bt) - gl.Vertex(x+w, y) - gl.Vertex(x+w-bt,y+h) - gl.Vertex(x+w, y+h) - gl.Vertex(x+w-bt,y+h-bt) - gl.Vertex(x+w-bt,y+h) - gl.Vertex(x+bt, y+h-bt) - gl.Vertex(x+bt, y+h) - gl.Vertex(x, y+h) -end - - -local function _DrawCheck(rect) - local x,y,w,h = rect[1],rect[2],rect[3],rect[4] - gl.Vertex(x+w*0.25, y+h*0.5) - gl.Vertex(x+w*0.125,y+h*0.625) - gl.Vertex(x+w*0.375,y+h*0.625) - gl.Vertex(x+w*0.375,y+h*0.875) - gl.Vertex(x+w*0.75, y+h*0.25) - gl.Vertex(x+w*0.875,y+h*0.375) -end - - -local function _DrawHLine(x,y,w,bt,color1,color2) - gl.Color(color1) - gl.Vertex(x, y) - gl.Vertex(x, y+bt) - gl.Vertex(x+w, y) - gl.Vertex(x+w, y+bt) - - gl.Color(color2) - gl.Vertex(x+w, y+bt) - gl.Vertex(x+w, y+2*bt) - gl.Vertex(x, y+bt) - gl.Vertex(x, y+2*bt) -end - - -local function _DrawVLine(x,y,h,bt,color1,color2) - gl.Color(color1) - gl.Vertex(x, y) - gl.Vertex(x+bt, y) - gl.Vertex(x, y+h) - gl.Vertex(x+bt, y+h) - - gl.Color(color2) - gl.Vertex(x+bt, y+h) - gl.Vertex(x+2*bt,y+h) - gl.Vertex(x+bt, y) - gl.Vertex(x+2*bt,y) -end - - -local function _DrawDragGrip(obj) - local x = obj.borderThickness + 1 - local y = obj.borderThickness + 1 - local w = obj.dragGripSize[1] - local h = obj.dragGripSize[2] - - gl.Color(0.8,0.8,0.8,0.9) - gl.Vertex(x, y + h*0.5) - gl.Vertex(x + w*0.5, y) - gl.Vertex(x + w*0.5, y + h*0.5) - - gl.Color(0.3,0.3,0.3,0.9) - gl.Vertex(x + w*0.5, y + h*0.5) - gl.Vertex(x + w*0.5, y) - gl.Vertex(x + w, y + h*0.5) - - gl.Vertex(x + w*0.5, y + h) - gl.Vertex(x, y + h*0.5) - gl.Vertex(x + w*0.5, y + h*0.5) - - gl.Color(0.1,0.1,0.1,0.9) - gl.Vertex(x + w*0.5, y + h) - gl.Vertex(x + w*0.5, y + h*0.5) - gl.Vertex(x + w, y + h*0.5) -end - - -local function _DrawResizeGrip(obj) - local resizable = obj.resizable - if IsTweakMode() then - resizable = resizable or obj.tweakResizable - end - - if (resizable) then - local x = obj.width - obj.padding[3] --obj.borderThickness - 1 - local y = obj.height - obj.padding[4] --obj.borderThickness - 1 - local w = obj.resizeGripSize[1] - local h = obj.resizeGripSize[2] - - x = x-1 - y = y-1 - gl.Color(1,1,1,0.2) - gl.Vertex(x - w, y) - gl.Vertex(x, y - h) - - gl.Vertex(x - math.floor(w*0.66), y) - gl.Vertex(x, y - math.floor(h*0.66)) - - gl.Vertex(x - math.floor(w*0.33), y) - gl.Vertex(x, y - math.floor(h*0.33)) - - x = x+1 - y = y+1 - gl.Color(0.1, 0.1, 0.1, 0.9) - gl.Vertex(x - w, y) - gl.Vertex(x, y - h) - - gl.Vertex(x - math.floor(w*0.66), y) - gl.Vertex(x, y - math.floor(h*0.66)) - - gl.Vertex(x - math.floor(w*0.33), y) - gl.Vertex(x, y - math.floor(h*0.33)) - end -end - - ---//============================================================================= ---// - -function DrawBorder(obj,state) - local x = 0 - local y = 0 - local w = obj.width - local h = obj.height - local bt = obj.borderThickness - - gl.Color((state.pressed and obj.borderColor2) or obj.borderColor) - gl.Vertex(x, y+h) - gl.Vertex(x+bt, y+h-bt) - gl.Vertex(x, y) - gl.Vertex(x+bt, y) - gl.Vertex(x+bt, y) - gl.Vertex(x+bt, y+bt) - gl.Vertex(x+w, y) - gl.Vertex(x+w-bt,y+bt) - - gl.Color((state.pressed and obj.borderColor) or obj.borderColor2) - gl.Vertex(x+w-bt,y+bt) - gl.Vertex(x+w, y) - gl.Vertex(x+w-bt,y+h) - gl.Vertex(x+w, y+h) - gl.Vertex(x+w-bt,y+h-bt) - gl.Vertex(x+w-bt,y+h) - gl.Vertex(x+bt, y+h-bt) - gl.Vertex(x+bt, y+h) - gl.Vertex(x, y+h) -end - - -function DrawBackground(obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj) -end - - -function _DrawScrollbar(obj, type, x,y,w,h, pos, visiblePercent, state) - gl.Color(obj.backgroundColor) - gl.Rect(x,y,x+w,y+h) - - if (type=='horizontal') then - local gripx,gripw = x+w*pos, w*visiblePercent - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, gripx,y,gripw,h, 1, obj.borderColor, obj.borderColor2) - else - local gripy,griph = y+h*pos, h*visiblePercent - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, x,gripy,w,griph, 1, obj.borderColor, obj.borderColor2) - end -end - - -function _DrawBackground(obj) - local x = 0 - local y = 0 - local w = obj.width - local h = obj.height - - gl.Color(obj.backgroundColor) - gl.Vertex(x, y) - gl.Vertex(x, y+h) - gl.Vertex(x+w, y) - gl.Vertex(x+w, y+h) -end - - -function _DrawTabBackground(obj) - local x = 0 - local y = 0 - local w = obj.width - local h = obj.height - local bt= 2 - - gl.Color(obj.backgroundColor) - gl.Vertex(x+bt, y+bt) - gl.Vertex(x+bt, y+h) - gl.Vertex(x+w-bt, y+bt) - gl.Vertex(x+w-bt, y+h) -end - - -local function _DrawTabBorder(obj, state) - local x = 0 - local y = 0 - local w = obj.width - local h = obj.height - local bt= 2 - - gl.Color(obj.borderColor) - gl.Vertex(x, y+h) - gl.Vertex(x+bt, y+h) - gl.Vertex(x, y+bt) - gl.Vertex(x+bt, y+bt) - gl.Vertex(x+bt, y) - gl.Vertex(x+w-bt, y+bt) - gl.Vertex(x+w-bt, y) - - gl.Color(obj.borderColor2) - gl.Vertex(x+w-bt, y) - gl.Vertex(x+w-bt, y+bt) - gl.Vertex(x+w, y+bt) - gl.Vertex(x+w-bt, y+h) - gl.Vertex(x+w, y+h) -end - - ---//============================================================================= ---// Control Renderer - -function DrawWindow(obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj, obj.state) - gl.BeginEnd(GL.TRIANGLE_STRIP, DrawBorder, obj, obj.state) -end - - -function DrawButton(obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj, obj.state) - gl.BeginEnd(GL.TRIANGLE_STRIP, DrawBorder, obj, obj.state) - - if (obj.caption) then - local w = obj.width - local h = obj.height - - obj.font:Print(obj.caption, w*0.5, h*0.5, "center", "center") - end -end - -function _DrawTriangle(obj) - local w = obj.width - local x = 0 - local y = 0 - local w = obj.width - local h = obj.height - local bt = obj.borderThickness - - local tw = 10 - gl.Color(obj.focusColor) - gl.Vertex(x + w - tw*1.5, y + (h - tw) * 0.5) - gl.Vertex(x + w - tw*0.5, y + (h - tw) * 0.5) - gl.Vertex(x + w - tw, y + tw + (h - tw) * 0.5) -end - - -function DrawComboBox(obj) - DrawButton(obj) - --draw triangle that indicates this is a combobox - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTriangle, obj) -end - -function DrawCursor(x, y, w, h) - gl.Vertex(x, y) - gl.Vertex(x, y + h) - gl.Vertex(x + w, y) - gl.Vertex(x + w, y + h) -end - - -function DrawEditBox(obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj, obj.state) - if obj.state.focused then - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0, 0, obj.width, obj.height, obj.borderThickness, obj.focusColor, obj.focusColor) - else - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0, 0, obj.width, obj.height, obj.borderThickness, obj.borderColor2, obj.borderColor) - end - - if (obj.text) then - if (obj.offset > obj.cursor) then - obj.offset = obj.cursor - end - - local clientX,clientY,clientWidth,clientHeight = unpack4(obj.clientArea) - - --// make cursor pos always visible (when text is longer than editbox!) - repeat - local txt = obj.text:sub(obj.offset, obj.cursor) - local wt = obj.font:GetTextWidth(txt) - if (wt <= clientWidth) then - break - end - if (obj.offset >= obj.cursor) then - break - end - obj.offset = obj.offset + 1 - until (false) - - local txt = obj.text:sub(obj.offset) - - --// strip part at the end that exceeds the editbox - local lsize = math.max(0, obj.font:WrapText(txt, clientWidth, clientHeight):len() - 3) -- find a good start (3 dots at end if stripped) - while (lsize <= txt:len()) do - local wt = obj.font:GetTextWidth(txt:sub(1, lsize)) - if (wt > clientWidth) then - break - end - lsize = lsize + 1 - end - txt = txt:sub(1, lsize - 1) - - gl.Color(1,1,1,1) - obj.font:DrawInBox(txt, clientX, clientY, clientWidth, clientHeight, obj.align, obj.valign) - - if obj.state.focused then - local cursorTxt = obj.text:sub(obj.offset, obj.cursor - 1) - local cursorX = obj.font:GetTextWidth(cursorTxt) - - local dt = Spring.DiffTimers(Spring.GetTimer(), obj._interactedTime) - local as = math.sin(dt * 8); - local ac = math.cos(dt * 8); - if (as < 0) then as = 0 end - if (ac < 0) then ac = 0 end - local alpha = as + ac - if (alpha > 1) then alpha = 1 end - alpha = 0.8 * alpha - - local cc = obj.cursorColor - gl.Color(cc[1], cc[2], cc[3], cc[4] * alpha) - gl.BeginEnd(GL.TRIANGLE_STRIP, DrawCursor, cursorX + clientX - 1, clientY, 3, clientHeight) - end - end -end - - -function DrawPanel(obj) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj, obj.state) - gl.BeginEnd(GL.TRIANGLE_STRIP, DrawBorder, obj, obj.state) -end - - -function DrawItemBkGnd(obj,x,y,w,h,state) - if (state=="selected") then - gl.Color(0.15,0.15,0.9,1) - else - gl.Color({0.8, 0.8, 1, 0.45}) - end - gl.Rect(x,y,x+w,y+h) - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, x,y,w,h, 1, obj.borderColor, obj.borderColor2) -end - - -function DrawScrollPanel(obj) - local clientX,clientY,clientWidth,clientHeight = unpack4(obj.clientArea) - local contX,contY,contWidth,contHeight = unpack4(obj.contentArea) - - gl.PushMatrix() - gl.Translate(clientX, clientY,0) - - if obj._vscrollbar and (contHeight > 0) then - local height = (not obj._hscrollbar and obj.height) or (obj.height - obj.scrollbarSize) - _DrawScrollbar(obj, 'vertical', obj.width - obj.scrollbarSize, 0, obj.scrollbarSize, height, - obj.scrollPosY/contHeight, clientHeight/contHeight) - end - if obj._hscrollbar and (contWidth > 0) then - local width = (not obj._vscrollbar and obj.width) or (obj.width - obj.scrollbarSize) - _DrawScrollbar(obj, 'horizontal', 0, obj.height - obj.scrollbarSize, width, obj.scrollbarSize, - obj.scrollPosX/contWidth, clientWidth/contWidth) - end - - gl.PopMatrix() -end - - -function DrawTrackbar(obj) - local percent = (obj.value-obj.min)/(obj.max-obj.min) - local w = obj.width - local h = obj.height - - gl.Color(0,0,0,1) - gl.Rect(0,h*0.5,w,h*0.5+1) - - local vc = h*0.5 --//verticale center - local pos = percent*w - - gl.Rect(pos-2,vc-h*0.5,pos+2,vc+h*0.5) -end - - -function DrawCheckbox(obj) - local vc = obj.height*0.5 --//verticale center - local tx = 0 - local ty = vc - - gl.PushMatrix() - gl.Translate(0,0,0) - - obj.font:Print(obj.caption, tx, ty, "left", "center") - - local box = obj.boxsize - local rect = {obj.width-box,obj.height*0.5-box*0.5,box,box} - - gl.Color(obj.backgroundColor) - gl.Rect(rect[1]+1,rect[2]+1,rect[1]+1+rect[3]-2,rect[2]+1+rect[4]-2) - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, rect[1],rect[2],rect[3],rect[4], 1, obj.borderColor, obj.borderColor2) - - if (obj.state.checked) then - gl.BeginEnd(GL.TRIANGLE_STRIP,_DrawCheck,rect) - end - - gl.PopMatrix() -end - - -function DrawColorbars(obj) - gl.PushMatrix() - gl.Translate(0,0,0) - - local barswidth = obj.width - (obj.height + 4) - - local color = obj.color - local step = obj.height/7 - - --bars - local rX1,rY1,rX2,rY2 = 0,0*step,color[1]*barswidth,1*step - local gX1,gY1,gX2,gY2 = 0,2*step,color[2]*barswidth,3*step - local bX1,bY1,bX2,bY2 = 0,4*step,color[3]*barswidth,5*step - local aX1,aY1,aX2,aY2 = 0,6*step,(color[4] or 1)*barswidth,7*step - - gl.Color(1,0,0,1) - gl.Rect(rX1,rY1,rX2,rY2) - - gl.Color(0,1,0,1) - gl.Rect(gX1,gY1,gX2,gY2) - - gl.Color(0,0,1,1) - gl.Rect(bX1,bY1,bX2,bY2) - - gl.Color(1,1,1,1) - gl.Rect(aX1,aY1,aX2,aY2) - - gl.Color(color) - gl.Rect(barswidth + 2,obj.height,obj.width - 2,0) - - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, barswidth + 2,0,obj.width - barswidth - 4,obj.height, 1, obj.borderColor, obj.borderColor2) - - gl.PopMatrix() -end - -function DrawLine(self) - if (self.style:find("^v")) then - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawVLine, self.width * 0.5, 0, self.height, 1, self.borderColor, self.borderColor2) - else - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawHLine, 0, self.height * 0.5, self.width, 1, self.borderColor, self.borderColor2) - end -end - - -function DrawDragGrip(obj) - gl.BeginEnd(GL.TRIANGLES, _DrawDragGrip, obj) -end - - -function DrawResizeGrip(obj) - gl.BeginEnd(GL.LINES, _DrawResizeGrip, obj) -end - - -local darkBlue = {0.0,0.0,0.6,0.9} -function DrawTreeviewNode(self) - if CompareLinks(self.treeview.selected,self) then - local x = self.clientArea[1] - local y = 0 - local w = self.children[1].width - local h = self.clientArea[2] + self.children[1].height - - gl.Color(0.1,0.1,1,0.55) - gl.Rect(0,0,w,h) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0,0,w,h, 1, darkBlue, darkBlue) - end -end - - -local function _DrawLineV(x, y1, y2, width, next_func, ...) - gl.Vertex(x-width*0.5, y1) - gl.Vertex(x+width*0.5, y1) - gl.Vertex(x-width*0.5, y2) - - gl.Vertex(x+width*0.5, y1) - gl.Vertex(x-width*0.5, y2) - gl.Vertex(x+width*0.5, y2) - - if (next_func) then - next_func(...) - end -end - - -local function _DrawLineH(x1, x2, y, width, next_func, ...) - gl.Vertex(x1, y-width*0.5) - gl.Vertex(x1, y+width*0.5) - gl.Vertex(x2, y-width*0.5) - - gl.Vertex(x1, y+width*0.5) - gl.Vertex(x2, y-width*0.5) - gl.Vertex(x2, y+width*0.5) - - if (next_func) then - next_func(...) - end -end - - -function DrawTreeviewNodeTree(self) - local x1 = math.ceil(self.padding[1]*0.5) - local x2 = self.padding[1] - local y1 = 0 - local y2 = self.height - local y3 = self.padding[2] + math.ceil(self.children[1].height*0.5) - - if (self.parent)and(CompareLinks(self,self.parent.nodes[#self.parent.nodes])) then - y2 = y3 - end - - gl.Color(self.treeview.treeColor) - gl.BeginEnd(GL.TRIANGLES, _DrawLineV, x1-0.5, y1, y2, 1, _DrawLineH, x1, x2, y3-0.5, 1) - - if (not self.nodes[1]) then - return - end - - gl.Color(1,1,1,1) - local image = self.ImageExpanded or self.treeview.ImageExpanded - if (not self.expanded) then - image = self.ImageCollapsed or self.treeview.ImageCollapsed - end - - TextureHandler.LoadTexture(0, image, self) - local texInfo = gl.TextureInfo(image) or {xsize=1, ysize=1} - local tw,th = texInfo.xsize, texInfo.ysize - - _DrawTextureAspect(0,0,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) - gl.Texture(0,false) -end - ---//============================================================================= ---// - -function DrawTabBarItem(self) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTabBackground, self, self.state) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTabBorder, self, self.state) - - if self.caption then - local w = self.width - local h = self.height - local bt= 2 - - local oldColor = self.font.color - if self.state.selected then - self.font:SetColor(self.focusColor) - end - self.font:Print(self.caption, w*0.5, bt+h*0.5, "center", "center") - if self.state.selected then - self.font:SetColor(oldColor) - end - end -end - ---//============================================================================= ---// - -skin.general = { - --font = "FreeSansBold.ttf", - textColor = {0,0,0,1}, - - font = { - outlineColor = {0,0,0,0.5}, - outline = false, - size = 13, - }, - - --padding = {5, 5, 5, 5}, --// padding: left, top, right, bottom - borderThickness = 1.5, - borderColor = {1,1,1,0.6}, - borderColor2 = {0,0,0,0.8}, - backgroundColor = {0.8, 0.8, 1, 0.4}, -} - -skin.colorbars = { - DrawControl = DrawColorbars, -} - -skin.icons = { - imageplaceholder = ":cl:placeholder.png", -} - -skin.image = { -} - -skin.button = { - DrawControl = DrawButton, -} - -skin.checkbox = { - DrawControl = DrawCheckbox, -} - -skin.imagelistview = { - imageFolder = "folder.png", - imageFolderUp = "folder_up.png", - - DrawItemBackground = DrawItemBkGnd, -} ---[[ -skin.imagelistviewitem = { - padding = {12, 12, 12, 12}, - - DrawSelectionItemBkGnd = DrawSelectionItemBkGnd, -} ---]] - -skin.panel = { - DrawControl = DrawPanel, -} - -skin.scrollpanel = { - DrawControl = DrawScrollPanel, -} - -skin.trackbar = { - DrawControl = DrawTrackbar, -} - -skin.treeview = { - ImageExpanded = ":cl:treeview_node_expanded.png", - ImageCollapsed = ":cl:treeview_node_collapsed.png", - treeColor = {0,0,0,0.6}, - - minItemHeight = 16, - - DrawNode = DrawTreeviewNode, - DrawNodeTree = DrawTreeviewNodeTree, -} - -skin.window = { - DrawControl = DrawWindow, - DrawDragGrip = DrawDragGrip, - DrawResizeGrip = DrawResizeGrip, - - hitpadding = {4, 4, 4, 4}, - boxes = { - resize = {-21, -21, -10, -10}, - drag = {0, 0, "100%", 10}, - }, - NCHitTest = NCHitTestWithPadding, - NCMouseDown = WindowNCMouseDown, - NCMouseDownPostChildren = WindowNCMouseDownPostChildren, -} - -skin.editbox = { - DrawControl = DrawEditBox, - backgroundColor = {1, 1, 1, 0.9}, -} - -skin.combobox = { - DrawControl = DrawComboBox, -} - -skin.line = { - DrawControl = DrawLine, -} - -skin.tabbaritem = { - borderColor = {1.0, 1.0, 1.0, 0.8}, - borderColor2 = {0.0, 0.0, 0.0, 0.8}, - backgroundColor = {0.8, 0.8, 1.0, 0.7}, - textColor = {0.1, 0.1, 0.1, 1.0}, - DrawControl = DrawTabBarItem, -} - -skin.control = skin.general - - ---//============================================================================= ---// - -return skin diff --git a/LuaIntro/chili/chili/skins/default/treeview_node_collapsed.png b/LuaIntro/chili/chili/skins/default/treeview_node_collapsed.png deleted file mode 100644 index fd3174a33..000000000 Binary files a/LuaIntro/chili/chili/skins/default/treeview_node_collapsed.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/treeview_node_expanded.png b/LuaIntro/chili/chili/skins/default/treeview_node_expanded.png deleted file mode 100644 index cc82b7e42..000000000 Binary files a/LuaIntro/chili/chili/skins/default/treeview_node_expanded.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/tweak_overlay.png b/LuaIntro/chili/chili/skins/default/tweak_overlay.png deleted file mode 100644 index 83fb280a6..000000000 Binary files a/LuaIntro/chili/chili/skins/default/tweak_overlay.png and /dev/null differ diff --git a/LuaIntro/chili/chili/skins/default/tweak_overlay_resizable.png b/LuaIntro/chili/chili/skins/default/tweak_overlay_resizable.png deleted file mode 100644 index ac0e1b240..000000000 Binary files a/LuaIntro/chili/chili/skins/default/tweak_overlay_resizable.png and /dev/null differ diff --git a/LuaIntro/chili/chili/themes/theme.lua b/LuaIntro/chili/chili/themes/theme.lua deleted file mode 100644 index a0c9ae761..000000000 --- a/LuaIntro/chili/chili/themes/theme.lua +++ /dev/null @@ -1,60 +0,0 @@ ---//============================================================================= ---// Theme - -theme = {} - -theme.name = "default" - - ---//============================================================================= ---// Define default skins - -local defaultSkin = "Robocracy" ---local defaultSkin = "DarkGlass" - -theme.skin = { - general = { - skinName = defaultSkin, - }, - - imagelistview = { - -- imageFolder = "luaui/images/folder.png", - -- imageFolderUp = "luaui/images/folder_up.png", - }, - - icons = { - -- imageplaceholder = "luaui/images/placeholder.png", - }, -} - - ---//============================================================================= ---// Theme - -function theme.GetDefaultSkin(class) - local skinName - - repeat - skinName = theme.skin[class.classname].skinName - class = class.inherited ---FIXME check if the skin contains the current control class! if not use inherit the theme table before doing so in the skin - until ((skinName)and(SkinHandler.IsValidSkin(skinName)))or(not class); - - if (not skinName)or(not SkinHandler.IsValidSkin(skinName)) then - skinName = theme.skin.general.skinName - end - - if (not skinName)or(not SkinHandler.IsValidSkin(skinName)) then - skinName = "default" - end - - return skinName -end - - -function theme.LoadThemeDefaults(control) - if (theme.skin[control.classname]) - then table.merge(control,theme.skin[control.classname]) end -- per-class defaults - table.merge(control,theme.skin.general) -end - diff --git a/LuaIntro/chili/chili/todo.txt b/LuaIntro/chili/chili/todo.txt deleted file mode 100644 index 776cfaaaf..000000000 --- a/LuaIntro/chili/chili/todo.txt +++ /dev/null @@ -1,13 +0,0 @@ -- fix fixedRatio 1 pixel jumping - -- check all listeners if they use chili objects (doing so might break the garbage collection), if so replace them with weaklinks (debug.getupvalue & debug.setupvalue) - -- self:Resize(), OnResize -- RenderToTexture -- masks for HitTest (depending on linked textures-> alpha channel) -- more different window controls -> background textures -- use matrices for clientspace transformations -- theme & layout handler - -controls: -- combobox \ No newline at end of file diff --git a/LuaIntro/chili/dbg_chili_inspector.lua b/LuaIntro/chili/dbg_chili_inspector.lua deleted file mode 100644 index 1f1f01e71..000000000 --- a/LuaIntro/chili/dbg_chili_inspector.lua +++ /dev/null @@ -1,167 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "ChiliInspector", - desc = "", - author = "", - date = "2013", - license = "GPLv2", - layer = 3, - enabled = false -- loaded by default? - } -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Chili -local window0 -local tree0 -local label0 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function GetBooleanStr(b) - return (b and "true") or "false" -end - -local function trace(children, node, level, max_level) - if not node then return end - if (level or 0) > (max_level or math.huge) then return end - for i=1,#children do - local obj = children[i] - if obj and (obj.name ~= "wnd_inspector") then - local caption = ("%s: %s (redrawn: %i/%i)"):format(obj.classname, obj.name, obj._redrawSelfCounter or 0, obj._redrawCounter or 0) - local nodec = node:Add(caption) - trace(obj.children, nodec, (level or 0) + 1, max_level) - end - end -end - - -local function traceLost(node) - - for i,obj in pairs(Chili.DebugHandler.allObjects) do - if obj.name ~= "wnd_inspector" then - if (not obj.parent)and(not obj:InheritsFrom("screen")) then - local caption = ("%s: %s (redrawn: %i; disposed: %s)"):format(obj.classname, obj.name, obj._redrawCounter or 0, GetBooleanStr(obj.disposed)) - local nodec = node:Add(caption) - trace(obj.children, nodec, 1, 1) - end - end - end -end - - -local function tracePerWidget(node) - collectgarbage("collect") - for w,t in pairs(Chili.DebugHandler.objectsOwnedByWidgets) do - if (w.whInfo.name ~= widget.whInfo.name) then - local caption = ("%s"):format(w.whInfo.name) - local nodec = node:Add(caption) - for i,obj in pairs(t) do - local caption = ("%s: %s (redrawn: %i)"):format(obj.classname, obj.name, obj._redrawCounter or 0) - local nodec2 = nodec:Add(caption) - end - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - Chili = WG.Chili - - if (not Chili) then - widgetHandler:RemoveWidget() - return - end - - window0 = Chili.Window:New{ - name = "wnd_inspector", - caption = "Chili Inspector", - x = 1200, - y = 250, - width = 400, - height = 400, - parent = Chili.Screen0, - - children = { - Chili.Label:New{ - name = "lbl_inspector_memusage", - x=0, right = 50, - y=0, bottom=-25, - align = "right", valign = "bottom", - caption = "Lua MemUsage: 0MB", - - }, - Chili.Button:New{ - right = 0, width = 50, - y=5, bottom=-25, - caption="gc", - OnMouseUp = {function() collectgarbage("collect") end}, - }, - Chili.ScrollPanel:New{ - x=0, right=0, - y=25, bottom=20, - children = { - Chili.TreeView:New{ - name = "tree_inspector"; - width="100%"; - height="100%"; - }, - }, - }, - Chili.StackPanel:New{ - x=0, right=0, - y=-20, bottom=0, - orientation = "horizontal", - padding = {0,0,0,0}, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - children = { - Chili.Button:New{ - caption="visible objects", - OnMouseUp = {function() tree0.root:Clear(); trace(Chili.Screen0.children, tree0.root) end}, - }, - Chili.Button:New{ - caption="lost objects", - OnMouseUp = {function() tree0.root:Clear(); traceLost(tree0.root) end}, - }, - Chili.Button:New{ - caption="per widget", - OnMouseUp = {function() tree0.root:Clear(); tracePerWidget(tree0.root) end}, - }, - }, - }, - }, - } - - tree0 = window0:GetObjectByName("tree_inspector") - label0 = window0:GetObjectByName("lbl_inspector_memusage") - - trace(Chili.Screen0.children, tree0.root) -end - -function widget:Shutdown() - if (window0) then - window0:Dispose() - end -end - -local next = -math.huge -function widget:Update() - if (os.clock() <= next) then - return - end - next = os.clock() + 3 - - local curUsage, gcLimit = gcinfo() - local caption = ("Lua MemUsage: %.2fMB"):format(curUsage / 1024) - label0:SetCaption(caption) -end diff --git a/LuaIntro/chili/dbg_chili_profiler.lua b/LuaIntro/chili/dbg_chili_profiler.lua deleted file mode 100644 index 949918444..000000000 --- a/LuaIntro/chili/dbg_chili_profiler.lua +++ /dev/null @@ -1,169 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "ChiliProfiler", - desc = "", - author = "", - date = "2013", - license = "GPLv2", - layer = 2, - enabled = false -- loaded by default? - } -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local window0 -local tree0 -local label0 -local Chili -local profiling = false - -local sample_tree = {} -local samples = 0 - -local min_usage = 0.01 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local n = 0 -local s = 0 -local function trace(event, line) - n = n + 1 - if (n < 25) then - return - end - n = 0 - - samples = samples + 1 - - s = s + 1 - if (s > 10) then - label0:SetCaption("Samples: " .. samples) - s = 0 - end - - local j = 2 - local i = 666 - local top = true - - local alreadySampled = {} - - while (i) do - repeat - i = debug.getinfo(j, "nS") - j = j + 1 - if (not i) then return end - until not((not i.name) or i.what == "C" or i.what == "main" or i.source:find("\n") or i.source:find("(tail call)")) - - local s = i.source or "???" - local n = i.name or "???" - local l = i.linedefined or "???" - n = ("%s (line: %s)"):format(n, l) - - local sampleName = ("%s%s%s"):format(s, n, l) - if not alreadySampled[sampleName] then - alreadySampled[sampleName] = true - - sample_tree[s] = sample_tree[s] or {} - sample_tree[s][n] = sample_tree[s][n] or {0,0} - sample_tree[s][n][1] = sample_tree[s][n][1] + 1 - if top and (j - 1 == 2) then - sample_tree[s][n][2] = sample_tree[s][n][2] + 1 - top = false - end - end - end -end - -local function rendertree() - tree0.root:ClearChildren() - for s,t in pairs(sample_tree) do - local node_file - for f,c in pairs(t) do - if (c[1]/samples > min_usage)or(c[2]/samples > min_usage) then - local cap = ("%.1f%% (%.1f%%): %s"):format(100 * (c[1]/samples), 100 * (c[2]/samples), f) - if not(node_file) then node_file = tree0.root:Add(s) end - local nf = node_file:Add(cap) - end - end - end -end - -local function AddProfiler() - if profiling then return end - profiling = true - debug.sethook(trace, "l", 16000000) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - Chili = WG.Chili - - if (not Chili) then - widgetHandler:RemoveWidget() - return - end - - window0 = Chili.Window:New{ - name = "wnd_profiler", - caption = "Profiler"; - x = 200, - y = 450, - width = 400, - height = 400, - parent = Chili.Screen0, - layer = 1, - - children = { - Chili.Label:New{ - name = "lbl_profiler_samples", - x=0, right=0, - y=0, bottom=-20, - align = "right", valign = "bottom", - caption = "Samples: 0", - }, - Chili.ScrollPanel:New{ - x=0, right=0, - y=20, bottom=20, - children = { - Chili.TreeView:New{ - name = "tree_profiler", - x=0, right=0, - y=0, bottom=0, - defaultExpanded = true, - }, - }, - }, - Chili.Button:New{ - x=0, right="50%", - y=-20, bottom=0, - caption="start", - OnMouseUp = {AddProfiler}, - }, - Chili.Button:New{ - x="50%", right=0, - y=-20, bottom=0, - caption = "stop", - OnMouseUp = {function() debug.sethook( nil ); profiling = false; rendertree() end}, - }, - }, - } - - tree0 = window0:GetObjectByName("tree_profiler") - label0 = window0:GetObjectByName("lbl_profiler_samples") -end - -function widget:Shutdown() - debug.sethook( nil ) - if (window0) then - window0:Dispose() - end -end diff --git a/LuaIntro/chili/gui_chili_docking.lua b/LuaIntro/chili/gui_chili_docking.lua deleted file mode 100644 index 08becba7e..000000000 --- a/LuaIntro/chili/gui_chili_docking.lua +++ /dev/null @@ -1,509 +0,0 @@ -function widget:GetInfo() - return { - name = "Chili Docking", - desc = "Provides docking and position saving for chili windows", - author = "Licho, jK", - date = "2010, 2013", - license = "GNU GPL, v2 or later", - layer = 50, - experimental = false, - enabled = true -- loaded by default? - } -end - - -local Chili - -local forceUpdate = false -options_path = 'Settings/Interface/Docking' -options_order = { 'dockEnabled', 'dockThreshold', } -options = { - dockThreshold = { - name = "Docking distance", - type = 'number', - advanced = true, - value = 10, - min=1,max=50,step=1, - OnChange = {function() - forceUpdate = true - end }, - }, - - dockEnabled = { - name = 'Use docking', - advanced = false, - type = 'bool', - value = true, - desc = 'Dock windows to screen edges and each other to prevent overlaps', - }, -} - - - -local lastPos = {} -- "window name" indexed array of {x,y,x2,y2} -local settings = {} -- "window name" indexed array of {x,y,w,h} -local buttons = {} -- "window name" indexed array of minimize buttons - - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget() - return - end - - -- setup Chili - Chili = WG.Chili -end - -local frameCounter = 0 - - - --- returns snap orientation of box A compared to box B and distance of their edges - orientation = L/R/T/D and distance of snap -local function GetBoxRelation(boxa, boxb) - local mpah = 0 -- midposition a horizontal - local mpbh = 0 - local mpav = 0 - local mpbv = 0 - - local snaph, snapv - - if not (boxa[2] > boxb[4] or boxa[4] < boxb[2]) then -- "vertical collision" they are either to left or to right - mpah = (boxa[3] + boxa[1])/2 -- gets midpos - mpbh = (boxb[3] + boxb[1])/2 - snaph = true - end - - if not (boxa[1] > boxb[3] or boxa[3] Chili.Screen0.width) then return end - if newAxis == 'R' and (winPos[1] + dist < 0 or winPos[3] + dist > Chili.Screen0.width) then return end - if newAxis == 'T' and (winPos[2] - dist < 0 or winPos[4] - dist > Chili.Screen0.height) then return end - if newAxis == 'D' and (winPos[2] + dist < 0 or winPos[4] + dist > Chili.Screen0.height) then return end - minDist = dist - minAxis = newAxis - end - end - - CheckAxis(winPos[1], 'L') - CheckAxis(winPos[2], 'T') - CheckAxis(Chili.Screen0.width - winPos[3], 'R') - CheckAxis(Chili.Screen0.height - winPos[4], 'D') - if (minDist < dockDist and minDist ~= 0) then - return minAxis, minDist -- screen edges have priority ,dont check anything else - end - - for w, dp in pairs(dockWindows) do - if win ~= w then - local a, d = GetBoxRelation(winPos, dp) - if a ~= nil then - CheckAxis(d, a) - end - end - end - - - if minDist < dockDist and minDist ~= 0 then - return minAxis, minDist - else - return nil, nil - end -end - - --- snaps box data with axis and distance -local function SnapBox(wp, a,d) - if a == 'L' then - wp[1] = wp[1] - d - wp[3] = wp[3] - d - elseif a== 'R' then - wp[1] = wp[1] + d - wp[3] = wp[3] + d - elseif a== 'T' then - wp[2] = wp[2] - d - wp[4] = wp[4] - d - elseif a== 'D' then - wp[2] = wp[2] + d - wp[4] = wp[4] + d - end -end - - -local lastCount = 0 -local lastWidth = 0 -local lastHeight= 0 - -local function GetButtonPos(win) - local size = 5 -- button thickness - local mindist = win.x*5000 + win.height - local mode = 'L' - - local dist = win.y*5000 + win.width - if dist < mindist then - mindist = dist - mode = 'T' - end - - dist = (Chili.Screen0.width - win.x - win.width)*5000 + win.height - if dist < mindist then - mindist = dist - mode = 'R' - end - - dist = (Chili.Screen0.height - win.y - win.height)*5000 + win.width - if dist < mindist then - mindist = dist - mode = 'B' - end - - - if mode == 'L' then - return {x=win.x-3, y= win.y, width = size, height = win.height} - elseif mode =='T' then - return {x=win.x, y= win.y-3, width = win.width, height = size} - elseif mode =='R' then - return {x=win.x + win.width - size-3, y= win.y, width = size, height = win.height} - elseif mode=='B' then - return {x=win.x, y= win.y + win.height - size-3, width = win.width, height = size} - end -end - - -local function GetEdgePositions(win) - local pw = win.parent.width - local ph = win.parent.height - - local distLeft = win.x / pw - local distTop = win.y / ph - local distRight = (pw - (win.x + win.width )) / pw - local distBottom = (ph - (win.y + win.height)) / ph - - local edgePos = {distLeft, distTop, win.width / pw, win.height / ph} - if (distRight < distLeft) then - edgePos[1] = tostring(-distRight) -- tostring to preserve "-0", as number it would become +0 - end - if (distBottom < distTop) then - edgePos[2] = tostring(-distBottom) - end - - return edgePos -end - - -local function ApplySavedSettingToWindow(win) - local settingsPos = settings[win.name] - if not settingsPos then - -- we don't have settings stored for new window - return - end - - local pw = (win.parent and win.parent.width ) or Chili.Screen0.width - local ph = (win.parent and win.parent.height) or Chili.Screen0.height - - do - local w = settingsPos[3] * pw - local h = settingsPos[4] * ph - - if win.fixedRatio then - local limit = 0 - if (w > h) then limit = w else limit = h end - if (win.width > win.height) then - w = limit - h = limit * (win.height/win.width) - else - h = limit - w = limit * (win.width/win.height) - end - end - if win.resizable or win.tweakResizable then - win:Resize(w, h) - end - end - - do - win.x = nil - win.y = nil - if (1 / settingsPos[1]) > 0 then - win.x = settingsPos[1] * pw - else - win.right = -settingsPos[1] * pw - end - if (1 / settingsPos[2]) > 0 then - win.y = settingsPos[2] * ph - else - win.bottom = -settingsPos[2] * ph - end - win:DetectRelativeBounds() - win:AlignControl() - end -end - - -local function MinimizeDispose(obj) - buttons[obj.name]:Dispose() - buttons[obj.name] = nil -end - - -local function MinimizeResize(obj) - local pos = GetButtonPos(obj) - buttons[obj.name]:SetPos(pos.x, pos.y, pos.width, pos.height) -end - - -local function HandleMinimizeBar(objs) - -- BUTTONS to minimize stuff - for name, win in pairs(objs) do - if win.minimizable then - local button = buttons[name] - - if not button then - button = Chili.Button:New{ - x = win.x, y = win.y; width=50; height=20; - caption = ''; - dockable = false; - tooltip = 'Minimize ' .. win.name; - backgroundColor = {0,1,0,1}; - parent = Chili.Screen0; - OnClick = { - function(self) - if win.visible then - self.tooltip = 'Expand ' .. win.name - self.backgroundColor={1,0,0,1} - if not win.selfImplementedMinimizable then - win:Hide() - else - win.selfImplementedMinimizable(false) - end - else - self.tooltip = 'Minimize ' .. win.name - self.backgroundColor={0,1,0,1} - if not win.selfImplementedMinimizable then - win:Show() - else - win.selfImplementedMinimizable(true) - end - end - end - } - } - buttons[name] = button - button:BringToFront() - - win.OnDispose[#win.OnDispose + 1] = MinimizeDispose - win.OnResize[#win.OnResize + 1] = MinimizeResize - end - end - end -end - - -local function sign(x) - if (x==0) then - return 0 - elseif (x>0) then - return 1 - else - return -1 - end -end - - -local function DockResize(obj) - local collideWindows = {} - for _, win in ipairs(obj.parent.children) do - if win.collide or win.dockable then - collideWindows[win] = {win.x, win.y, win.x + win.width, win.y + win.height} - end - end - - local wp = {obj.x, obj.y, obj.x + obj.width, obj.y + obj.height} - local dp = {obj.x, obj.y, obj.x + obj.width, obj.y + obj.height} - local lp = lastPos[obj.name] - - -- dock windows - repeat - local numTries = 5 - local clipDirs = {} - repeat - local a,d = GetClosestAxis(dp, collideWindows, obj) - if a then - SnapBox(dp,a,d) - clipDirs[a] = true - end - numTries = numTries - 1 - until (not a) or numTries == 0 - - if (dp[1] == obj.x) and (dp[2] == obj.y) then - break - end - - if (obj.dragging) then - if clipDirs["L"] and (sign(wp[1] - lp[1]) > 0) then - break - end - if clipDirs["R"] and (sign(wp[1] - lp[1]) < 0) then - break - end - if clipDirs["T"] and (sign(wp[2] - lp[2]) > 0) then - break - end - if clipDirs["D"] and (sign(wp[2] - lp[2]) < 0) then - break - end - - --//FIXME this is a workaround OnResize get strange calls that are filtered with this - if sign(wp[1] - lp[1]) == 0 then - break - end - if sign(wp[2] - lp[2]) == 0 then - break - end - elseif (resizing) then - --FIXME - end - - obj:SetPos(dp[1], dp[2]) - break - until true - - local winPos = { obj.x, obj.y, obj.x + obj.width, obj.y + obj.height } - lastPos[obj.name] = winPos - settings[obj.name] = GetEdgePositions(obj) -end - - -function widget:DrawScreen() - frameCounter = frameCounter + 1 - if (frameCounter % 88 ~= 87) and (#Chili.Screen0.children == lastCount) then return end - lastCount = #Chili.Screen0.children - - if (Chili.Screen0.width ~= lastWidth or Chili.Screen0.height ~= lastHeight) then - forceUpdate = true - lastWidth = Chili.Screen0.width - lastHeight = Chili.Screen0.height - end - - local newWindow = true - - local bynames = {} - for _, win in ipairs(Chili.Screen0.children) do - if win.dockable then - bynames[win.name] = win - local lastWinPos = lastPos[win.name] - if (not lastWinPos)or(forceUpdate) then -- new window appeared - newWindow = true - ApplySavedSettingToWindow(win) - if not options.dockEnabled.value then - lastPos[win.name] = { win.x, win.y, win.x + win.width, win.y + win.height } - end - win.OnResize[#win.OnResize + 1] = DockResize - end - end - end - - if forceUpdate or (newWindow and options.dockEnabled.value) then - forceUpdate = false - local dockWindows = {} - local collideWindows = {} - for _, win in ipairs(Chili.Screen0.children) do - if - win.dockable and win.dragging --or (win.custom_freshlyMoved) --FIXME - then - dockWindows[win] = {win.x, win.y, win.x + win.width, win.y + win.height} - end - - if win.collide or win.dockable then - collideWindows[win] = {win.x, win.y, win.x + win.width, win.y + win.height} - end - end - - -- dock windows - local mc = 2 - repeat - for win, wp in pairs(dockWindows) do - local numTries = 5 - repeat - local a,d = GetClosestAxis(wp, collideWindows, win) - if a then - SnapBox(wp,a,d) - end - numTries = numTries - 1 - until (not a) or numTries == 0 - - win:SetPos(wp[1], wp[2]) - end - - mc = mc -1 - until mc == 0 - - for win in pairs(dockWindows) do - local winPos = { win.x, win.y, win.x + win.width, win.y + win.height } - lastPos[win.name] = winPos - settings[win.name] = GetEdgePositions(win) - end - end - - HandleMinimizeBar(bynames) - - windowMoved = false -end - - -function widget:SetConfigData(data) - settings = data -end - - -function widget:GetConfigData() - return settings -end diff --git a/LuaIntro/chili/gui_chiliguidemo.lua b/LuaIntro/chili/gui_chiliguidemo.lua deleted file mode 100644 index 5271feb49..000000000 --- a/LuaIntro/chili/gui_chiliguidemo.lua +++ /dev/null @@ -1,365 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "chiliGUIDemo", - desc = "GUI demo for robocracy", - author = "quantum", - date = "WIP", - license = "WIP", - layer = 1, - enabled = false -- loaded by default? - } -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- gui elements -local window0 -local window01 -local gridWindow0 -local gridWindow1 -local windowImageList -local window1 -local window2 -local window3 - -function widget:Initialize() - Chili = WG.Chili - - local function ToggleOrientation(self) - local panel = self:FindParent"layoutpanel" - panel.orientation = ((panel.orientation == "horizontal") and "vertical") or "horizontal" - panel:UpdateClientArea() - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local testText = - [[Bolivians are voting in a referendum on a new constitution that President Evo Morales says will empower the country's indigenous majority. - -The changes also include strengthening state control of Bolivia's natural resources, and no longer recognising Catholicism as the official religion. - -The constitution is widely expected to be approved. -Mr Morales, an Aymara Indian, has pursued political reform but has met fierce resistance from some sectors. -Opponents concentrated in Bolivia's eastern provinces, which hold rich gas deposits, argue that the new constitution would create two classes of citizenship - putting indigenous people ahead of others. - -The wrangling has spilled over into, at times, deadly violence. At least 30 peasant farmers were ambushed and killed on their way home from a pro-government rally in a northern region in September. - -President Morales has said the new constitution will pave the way for correcting the historic inequalities of Bolivian society, where the economic elite is largely of European descent. -]] - - local testText2 = - "\255\001\255\250Bolivians\b are voting in a referendum on a \255\255\255\000new\b constitution " - - local testText3 = - [[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod]] - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local cs = { - Chili.Button:New{ - x = 20, - y = 20, - }, - Chili.Label:New{ - x = 20, - y = 50, - caption= 'FOOBAR', - }, - Chili.ScrollPanel:New{ - backgroundColor = {0,0,0,0.5}, - children = { - Chili.Button:New{caption="foo", width = 100, height = 100}, - } - }, - Chili.Checkbox:New{ - x = 20, - y = 70, - caption = 'foo', - }, - Chili.Trackbar:New{ - x = 20, - y = 90, - }, - Chili.Colorbars:New{ - x = 20, - y = 120, - }, - Chili.ComboBox:New{items = { "opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8", "opt9", "opt10", "opt11", "opt12", }}, - } - - window0 = Chili.Window:New{ - x = 200, - y = 450, - width = 200, - height = 200, - parent = Chili.Screen0, - - children = { - Chili.StackPanel:New{ - height = "100%"; - width = "100%"; - weightedResize = true; - children = { - Chili.Button:New{caption="height: 70%", weight = 7; width = "90%"}, - Chili.Button:New{caption="height: 30%", weight = 3}, - }; - } - }, - } - - local btn0 = Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me1", - } - btn0:Dispose() - - -- we need a container that supports margin if the control inside uses margins - window01 = Chili.Window:New{ - x = 200, - y = 200, - clientWidth = 200, - clientHeight = 200, - parent = Chili.Screen0, - } - - local panel1 = Chili.StackPanel:New{ - width = 200, - height = 200, - --resizeItems = false, - x=0, right=0, - y=0, bottom=0, - margin = {10, 10, 10, 10}, - parent = window01, - children = cs, - } - - local gridControl = Chili.Grid:New{ - name = 'foogrid', - width = 200, - height = 200, - children = { - Chili.Button:New{backgroundColor = {0,0.6,0,1}, textColor = {1,1,1,1}, caption = "Toggle", OnMouseUp = {ToggleOrientation}}, - Chili.Button:New{caption = "2"}, - Chili.Button:New{caption = "3"}, - Chili.Button:New{caption = "4", margin = {10, 10, 10, 10}}, - Chili.Button:New{caption = "5"}, - Chili.Button:New{caption = "6"}, - Chili.Button:New{caption = "7"}, - } - } - - gridWindow0 = Chili.Window:New{ - parent = Chili.Screen0, - x = 450, - y = 450, - clientWidth = 200, - clientHeight = 200, - children = { - gridControl - }, - } - - gridWindow1 = Chili.Window:New{ - parent = Chili.Screen0, - x = 650, - y = 750, - clientWidth = 200, - clientHeight = 200, - children = { - Chili.Button:New{right=0, bottom=0, caption = "2", OnClick={function() - --gridWindow1:GetObjectByName("tree_inspector") - end}}, - Chili.TextBox:New{x=0, right=0, y=0, text = testText2}, - Chili.EditBox:New{width = 200, y = 40, --[[autosize = true,]] text = testText3}, - Chili.ComboBox:New{right = 10, x = 0, y = 90, items = { "opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8", "opt9", "opt10", "opt11", "opt12", }}, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me2", - x="5%", y=70, - width = "90%", - OnClick = {function(self) self:Dispose() end}, - }, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me3", - x="5%", y=90, - width = "90%", - }, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me4", - x=0, y=120, - }, - }, - } - gridWindow1:GetObjectByName("btn_dispose_me4"):Dispose() - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - windowImageList = Chili.Window:New{ - x = 700, - y = 200, - clientWidth = 410, - clientHeight = 400, - parent = Chili.Screen0, - } - - local control = Chili.ScrollPanel:New{ - x=0, right=0, - y=0, bottom=0, - parent = windowImageList, - children = { - --Button:New{width = 410, height = 400, anchors = {top=true,left=true,bottom=true,right=true}}, - Chili.ImageListView:New{ - name = "MyImageListView", - x=0, right=0, - y=0, bottom=0, - dir = "LuaUI/Images/", - OnSelectItem = { - function(obj,itemIdx,selected) - Spring.Echo("image selected ",itemIdx,selected) - end, - }, - OnDblClickItem = { - function(obj,itemIdx) - Spring.Echo("image dblclicked ",itemIdx) - end, - }, - OnDirChange = { - function(obj,itemIdx) - if obj.parent and obj.parent:InheritsFrom("scrollpanel") then - obj.parent:SetScrollPos(0,0) - end - end, - } - } - } - } - - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - window1 = Chili.Window:New{ - x = 450, - y = 200, - clientWidth = 200, - clientHeight = 200, - resizable = true, - draggable = true, - parent = Chili.Screen0, - dockable = true, - children = { - Chili.ScrollPanel:New{ - width = 200, - height = 200, - x=0, right=0, - y=0, bottom=0, - horizontalScrollbar = false, - children = { - Chili.TextBox:New{width = 200, x=0, right=0, y=0, bottom=0, text = testText} - }, - }, - } - } - - window2 = Chili.Window:New{ - x = 900, - y = 650, - width = 200, - height = 200, - parent = Chili.Screen0, - dockable = true, - - children = { - Chili.TabBar:New{ - x=0, right=0, - y=0, height=20, - minItemWidth = 50, - tabs = {"tab1", "tab2", "tab3",}, - }, - Chili.ScrollPanel:New{ - x=0, right=0, - y=30, bottom=0, - children = { - Chili.TreeView:New{ - x=0, right=0, - y=0, bottom=0, - defaultExpanded = true, - nodes = { - "foo", - { "bar" }, - "do", - { "re", {"mi"} }, - "la", - { "le", "lu" }, - }, - }, - }, - }, - }, - } - - local warnDispose = function(self) - local ref = 0 - for i,v in pairs(self._hlinks) do - ref = ref + 1 - end - Spring.Echo("Warning object disposed!", self.classname, self.name, ref) - end - - window3 = Chili.Window:New{ - caption = "autosize test", - x = 1200, - y = 650, - width = 200, - height = 200, - parent = Chili.Screen0, - autosize = true, - savespace = true, - --debug = true, - - children = { - Chili.Button:New{name = "btn_0", y = 20, width = 120, caption = "dispose btns below", OnClick = {function(self) - local btna = window3:GetObjectByName("btn_a"); - local btnb = window3:GetObjectByName("btn_b"); - window3:RemoveChild(btna); - window3:RemoveChild(btnb); - end}}, - Chili.Button:New{name = "btn_a", y = 50, width = 120, caption = "autosize", OnDispose = {warnDispose}, OnClick = {function(self) window3:GetObjectByName("btn_a"):ToggleVisibility(); window3:GetObjectByName("btn_b"):ToggleVisibility(); end}}, - Chili.Button:New{name = "btn_b", y = 80, width = 120, caption = "autosize", OnDispose = {warnDispose}, OnClick = {function(self) window3:GetObjectByName("btn_a"):ToggleVisibility(); window3:GetObjectByName("btn_b"):ToggleVisibility(); end}}, - }, - } - - window3:GetObjectByName("btn_b"):Hide() --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -end --Initialize - - -function widget:Update() - local btn = gridWindow1:GetObjectByName("btn_dispose_me3") - btn:Dispose() - widgetHandler:RemoveCallIn("Update") -end - - -function widget:Shutdown() - window0:Dispose() - window01:Dispose() - gridWindow0:Dispose() - gridWindow1:Dispose() - windowImageList:Dispose() - window1:Dispose() - window2:Dispose() - window3:Dispose() -end - diff --git a/LuaIntro/config.lua b/LuaIntro/config.lua new file mode 100644 index 000000000..d0bbda505 --- /dev/null +++ b/LuaIntro/config.lua @@ -0,0 +1,62 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: config.lua +-- brief: configfile for handler.lua +-- author: jK +-- +-- Copyright (C) 2011-2013. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--// randomize each run +math.randomseed(os.time()) + +--// 0: disabled +--// 1: enabled, but can be overriden by widget.GetInfo().unsafe +--// 2: always enabled +SAFEWRAP = 1 +SAFEDRAW = false --// requires SAFEWRAP to work + +--// +VFSMODE = VFS.RAW_FIRST + +--// when false, the handler will `compress` some output (e.g. list of started widgets) +handler.verbose = false or true + + +if LUA_NAME == "LuaUI" then + --// Config & Widget Locations + ORDER_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.modShortName .. '_order.lua' + CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.modShortName .. '_data.lua' + KNOWN_FILENAME = LUAUI_DIRNAME .. 'Config/' .. Game.modShortName .. '_known.lua' + + ADDON_DIRS = { + LUA_DIRNAME .. 'Addons/'; + LUA_DIRNAME .. 'Widgets_Evo/'; + LUA_DIRNAME .. 'SystemAddons/'; + LUA_DIRNAME .. 'SystemWidgets/'; + LUA_DIRNAME .. 'chili/'; + } + + --// Create the "LuaUI/Config" directory + Spring.CreateDir(LUAUI_DIRNAME .. 'Config') + + handler:Load(LUAUI_DIRNAME .. "SystemWidgets/BlockUserWidgets.lua" --[[, VFS.ZIP]]) +else + AddonNames = handler.AddonName .. "s/" + + ADDON_DIRS = { + LUA_DIRNAME .. 'Addons/'; + LUA_DIRNAME .. AddonNames; + LUA_DIRNAME .. 'SystemAddons/'; + LUA_DIRNAME .. 'System' .. AddonNames; + LUA_DIRNAME .. 'chili/'; + } +end + +--// ZK related +--// cache the results of time intensive funcs +include("Utilities/cache.lua", handler.EG) diff --git a/LuaIntro/main.lua b/LuaIntro/main.lua new file mode 100644 index 000000000..10f074ff0 --- /dev/null +++ b/LuaIntro/main.lua @@ -0,0 +1,61 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: main.lua +-- brief: the entry point from LuaUI +-- author: jK +-- +-- Copyright (C) 2011-2013. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +LUA_NAME = Script.GetName() +LUA_DIRNAME = Script.GetName() .. "/" +LUA_VERSION = Script.GetName() .. " v1.0" + +_G[("%s_DIRNAME"):format(LUA_NAME:upper())] = LUA_DIRNAME -- creates LUAUI_DIRNAME +_G[("%s_VERSION"):format(LUA_NAME:upper())] = LUA_VERSION -- creates LUAUI_VERSION + +VFS.DEF_MODE = VFS.RAW_FIRST + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- +-- Initialize the Lua LogSection (else messages with level "info" wouldn't been shown) +-- + +if Spring.SetLogSectionFilterLevel then + Spring.SetLogSectionFilterLevel(LUA_NAME, "info") +else + -- backward compability + local origSpringLog = Spring.Log + + Spring.Log = function(name, level, ...) + if (type(level) == "string")and(level == "info") then + --Spring.Echo(("[%s]"):format(name), ...) + else + origSpringLog(name, level, ...) + end + end +end + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- +-- Load +-- + +VFS.Include("LuaHandler/Utilities/utils.lua", nil, VFS.DEF_MODE) + +--// the addon handler +include "LuaHandler/handler.lua" + +--// print Lua & LuaUI version +Spring.Log(LUA_NAME, "info", LUA_VERSION .. " (" .. _VERSION .. ")") + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v16.lua b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v16.lua new file mode 100644 index 000000000..092bdd47a --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v16.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 2671, y = 0, z = 1738}, + [2] = {x = 595, y = 0, z = 4285}, + [3] = {x = 7418, y = 0, z = 4024}, + [4] = {x = 5480, y = 0, z = 6551}, + [5] = {x = 1127, y = 0, z = 5704}, + [6] = {x = 6982, y = 0, z = 2431}, + [7] = {x = 4146, y = 0, z = 4163}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v17.lua b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v17.lua new file mode 100644 index 000000000..092bdd47a --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v17.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 2671, y = 0, z = 1738}, + [2] = {x = 595, y = 0, z = 4285}, + [3] = {x = 7418, y = 0, z = 4024}, + [4] = {x = 5480, y = 0, z = 6551}, + [5] = {x = 1127, y = 0, z = 5704}, + [6] = {x = 6982, y = 0, z = 2431}, + [7] = {x = 4146, y = 0, z = 4163}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v18.lua b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v18.lua new file mode 100644 index 000000000..092bdd47a --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Akilon Wastelands - v18.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 2671, y = 0, z = 1738}, + [2] = {x = 595, y = 0, z = 4285}, + [3] = {x = 7418, y = 0, z = 4024}, + [4] = {x = 5480, y = 0, z = 6551}, + [5] = {x = 1127, y = 0, z = 5704}, + [6] = {x = 6982, y = 0, z = 2431}, + [7] = {x = 4146, y = 0, z = 4163}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v03.lua b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v03.lua new file mode 100644 index 000000000..3dbec6ff0 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v03.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4245, y = 0, z = 4278}, + [2] = {x = 3478, y = 0, z = 2400}, + [3] = {x = 5202, y = 0, z = 5808}, + [4] = {x = 2217, y = 0, z = 5821}, + [5] = {x = 6222, y = 0, z = 2318}, + [6] = {x = 7150, y = 0, z = 1508}, + [7] = {x = 1103, y = 0, z = 6693}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v04.lua b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v04.lua new file mode 100644 index 000000000..3dbec6ff0 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v04.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4245, y = 0, z = 4278}, + [2] = {x = 3478, y = 0, z = 2400}, + [3] = {x = 5202, y = 0, z = 5808}, + [4] = {x = 2217, y = 0, z = 5821}, + [5] = {x = 6222, y = 0, z = 2318}, + [6] = {x = 7150, y = 0, z = 1508}, + [7] = {x = 1103, y = 0, z = 6693}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v05.lua b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v05.lua new file mode 100644 index 000000000..3dbec6ff0 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Archers Battlefield - v05.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4245, y = 0, z = 4278}, + [2] = {x = 3478, y = 0, z = 2400}, + [3] = {x = 5202, y = 0, z = 5808}, + [4] = {x = 2217, y = 0, z = 5821}, + [5] = {x = 6222, y = 0, z = 2318}, + [6] = {x = 7150, y = 0, z = 1508}, + [7] = {x = 1103, y = 0, z = 6693}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v03.lua b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v03.lua new file mode 100644 index 000000000..fdd9a0eb4 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v03.lua @@ -0,0 +1,9 @@ +return { + points = { + [1] = {x = 6907, y = 0, z = 1914}, + [2] = {x = 1135, y = 0, z = 6546}, + [3] = {x = 4439, y = 0, z = 6463}, + [4] = {x = 3687, y = 0, z = 1798}, + [5] = {x = 4101, y = 0, z = 4165}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v04.lua b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v04.lua new file mode 100644 index 000000000..b6d87161b --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v04.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 6907, y = 0, z = 1914}, + [2] = {x = 1135, y = 0, z = 6546}, + [3] = {x = 4439, y = 0, z = 6463}, + [4] = {x = 3687, y = 0, z = 1798}, + [5] = {x = 4101, y = 0, z = 4165}, + [6] = {x = 1830, y = 0, z = 4036}, + [7] = {x = 6448, y = 0, z = 3651}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v05.lua b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v05.lua new file mode 100644 index 000000000..b6d87161b --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Battle for Planet XIV - v05.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 6907, y = 0, z = 1914}, + [2] = {x = 1135, y = 0, z = 6546}, + [3] = {x = 4439, y = 0, z = 6463}, + [4] = {x = 3687, y = 0, z = 1798}, + [5] = {x = 4101, y = 0, z = 4165}, + [6] = {x = 1830, y = 0, z = 4036}, + [7] = {x = 6448, y = 0, z = 3651}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v05.lua b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v05.lua new file mode 100644 index 000000000..606c7ee5e --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v05.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1856, y = 0, z = 3953}, + [2] = {x = 1223, y = 0, z = 5879}, + [3] = {x = 2116, y = 0, z = 6874}, + [4] = {x = 6418, y = 0, z = 4304}, + [5] = {x = 5950, y = 0, z = 1022}, + [6] = {x = 6966, y = 0, z = 2122}, + [7] = {x = 4380, y = 0, z = 4243}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v06.lua b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v06.lua new file mode 100644 index 000000000..606c7ee5e --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v06.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1856, y = 0, z = 3953}, + [2] = {x = 1223, y = 0, z = 5879}, + [3] = {x = 2116, y = 0, z = 6874}, + [4] = {x = 6418, y = 0, z = 4304}, + [5] = {x = 5950, y = 0, z = 1022}, + [6] = {x = 6966, y = 0, z = 2122}, + [7] = {x = 4380, y = 0, z = 4243}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v07.lua b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v07.lua new file mode 100644 index 000000000..606c7ee5e --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Fetid Marsh - v07.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1856, y = 0, z = 3953}, + [2] = {x = 1223, y = 0, z = 5879}, + [3] = {x = 2116, y = 0, z = 6874}, + [4] = {x = 6418, y = 0, z = 4304}, + [5] = {x = 5950, y = 0, z = 1022}, + [6] = {x = 6966, y = 0, z = 2122}, + [7] = {x = 4380, y = 0, z = 4243}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_HighGround - v01.lua b/LuaRules/Configs/ControlPoints/cv_HighGround - v01.lua new file mode 100644 index 000000000..7c5e26e2c --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_HighGround - v01.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4096, y = 0, z = 829}, + [2] = {x = 763, y = 0, z = 4089}, + [3] = {x = 4082, y = 0, z = 7166}, + [4] = {x = 7205, y = 0, z = 4090}, + [5] = {x = 5123, y = 0, z = 4354}, + [6] = {x = 4096, y = 0, z = 3840}, + [7] = {x = 3074, y = 0, z = 4354}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_HighGround - v03.lua b/LuaRules/Configs/ControlPoints/cv_HighGround - v03.lua new file mode 100644 index 000000000..7c5e26e2c --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_HighGround - v03.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4096, y = 0, z = 829}, + [2] = {x = 763, y = 0, z = 4089}, + [3] = {x = 4082, y = 0, z = 7166}, + [4] = {x = 7205, y = 0, z = 4090}, + [5] = {x = 5123, y = 0, z = 4354}, + [6] = {x = 4096, y = 0, z = 3840}, + [7] = {x = 3074, y = 0, z = 4354}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Iammas Prime - v01.lua b/LuaRules/Configs/ControlPoints/cv_Iammas Prime - v01.lua new file mode 100644 index 000000000..68dd1c7a0 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Iammas Prime - v01.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 4608, y = 0, z = 3048}, + [2] = {x = 4265, y = 0, z = 1350}, + [3] = {x = 4950, y = 0, z = 4786}, + [4] = {x = 6641, y = 0, z = 858}, + [5] = {x = 2574, y = 0, z = 5271}, + [6] = {x = 2219, y = 0, z = 498}, + [7] = {x = 6993, y = 0, z = 5616}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v01.lua b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v01.lua new file mode 100644 index 000000000..24e0fa065 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v01.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1466, y = 0, z = 4071}, + [2] = {x = 4104, y = 0, z = 1450}, + [3] = {x = 6742, y = 0, z = 4087}, + [4] = {x = 4116, y = 0, z = 6733}, + [5] = {x = 4717, y = 0, z = 3516}, + [6] = {x = 3236, y = 0, z = 3669}, + [7] = {x = 4234, y = 0, z = 4954}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v02.lua b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v02.lua new file mode 100644 index 000000000..24e0fa065 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v02.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1466, y = 0, z = 4071}, + [2] = {x = 4104, y = 0, z = 1450}, + [3] = {x = 6742, y = 0, z = 4087}, + [4] = {x = 4116, y = 0, z = 6733}, + [5] = {x = 4717, y = 0, z = 3516}, + [6] = {x = 3236, y = 0, z = 3669}, + [7] = {x = 4234, y = 0, z = 4954}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v03.lua b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v03.lua new file mode 100644 index 000000000..24e0fa065 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v03.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1466, y = 0, z = 4071}, + [2] = {x = 4104, y = 0, z = 1450}, + [3] = {x = 6742, y = 0, z = 4087}, + [4] = {x = 4116, y = 0, z = 6733}, + [5] = {x = 4717, y = 0, z = 3516}, + [6] = {x = 3236, y = 0, z = 3669}, + [7] = {x = 4234, y = 0, z = 4954}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v04.lua b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v04.lua new file mode 100644 index 000000000..24e0fa065 --- /dev/null +++ b/LuaRules/Configs/ControlPoints/cv_Volcanic Basin - v04.lua @@ -0,0 +1,11 @@ +return { + points = { + [1] = {x = 1466, y = 0, z = 4071}, + [2] = {x = 4104, y = 0, z = 1450}, + [3] = {x = 6742, y = 0, z = 4087}, + [4] = {x = 4116, y = 0, z = 6733}, + [5] = {x = 4717, y = 0, z = 3516}, + [6] = {x = 3236, y = 0, z = 3669}, + [7] = {x = 4234, y = 0, z = 4954}, + }, +} \ No newline at end of file diff --git a/LuaRules/Configs/MetalSpots/BlackStar.lua b/LuaRules/Configs/MetalSpots/BlackStar.lua deleted file mode 100644 index 90a9f1212..000000000 --- a/LuaRules/Configs/MetalSpots/BlackStar.lua +++ /dev/null @@ -1,54 +0,0 @@ -return { - spots = { - [1] = {x = 4365, z = 1180, metal = 2.0}, - [2] = {x = 4160, z = 950, metal = 2.0}, - [3] = {x = 3982, z = 1270, metal = 2.0}, - [4] = {x = 7195, z = 3418, metal = 2.0}, - [5] = {x = 6913, z = 3153, metal = 2.0}, - [6] = {x = 6941, z = 3528, metal = 2.0}, - [7] = {x = 5665, z = 6307, metal = 2.0}, - [8] = {x = 5708, z = 6642, metal = 2.0}, - [9] = {x = 5991, z = 6545, metal = 2.0}, - [10] = {x = 2119, z = 6294, metal = 2.0}, - [11] = {x = 2396, z = 6563, metal = 2.0}, - [12] = {x = 2105, z = 6637, metal = 2.0}, - [13] = {x = 828, z = 3198, metal = 2.0}, - [14] = {x = 911, z = 3553, metal = 2.0}, - [15] = {x = 1118, z = 3309, metal = 2.0}, - [16] = {x = 1685, z = 1304, metal = 2.0}, - [17] = {x = 1958, z = 1081, metal = 2.0}, - [18] = {x = 6047, z = 1164, metal = 2.0}, - [19] = {x = 6447, z = 1490, metal = 2.0}, - [20] = {x = 7617, z = 4822, metal = 2.0}, - [21] = {x = 7404, z = 5422, metal = 2.0}, - [22] = {x = 4344, z = 7450, metal = 2.0}, - [23] = {x = 3725, z = 7494, metal = 2.0}, - [24] = {x = 716, z = 5422, metal = 2.0}, - [25] = {x = 543, z = 4955, metal = 2.0}, - [26] = {x = 3146, z = 3026, metal = 2.0}, - [27] = {x = 3574, z = 2758, metal = 2.0}, - [28] = {x = 4757, z = 3021, metal = 2.0}, - [29] = {x = 5036, z = 3221, metal = 2.0}, - [30] = {x = 2763, z = 4258, metal = 2.0}, - [31] = {x = 2847, z = 4517, metal = 2.0}, - [32] = {x = 3853, z = 5325, metal = 2.0}, - [33] = {x = 4283, z = 5329, metal = 2.0}, - [34] = {x = 5235, z = 4658, metal = 2.0}, - [35] = {x = 5442, z = 4191, metal = 2.0}, - [36] = {x = 4678, z = 4884, metal = 2.0}, - [37] = {x = 4670, z = 4675, metal = 2.0}, - [38] = {x = 4526, z = 4855, metal = 2.0}, - [39] = {x = 3581, z = 4901, metal = 2.0}, - [40] = {x = 3412, z = 4917, metal = 2.0}, - [41] = {x = 3429, z = 4738, metal = 2.0}, - [42] = {x = 3090, z = 3855, metal = 2.0}, - [43] = {x = 3007, z = 3716, metal = 2.0}, - [44] = {x = 3176, z = 3620, metal = 2.0}, - [45] = {x = 4884, z = 3655, metal = 2.0}, - [46] = {x = 5038, z = 3716, metal = 2.0}, - [47] = {x = 4954, z = 3889, metal = 2.0}, - [48] = {x = 4186, z = 3246, metal = 2.0}, - [49] = {x = 3907, z = 3176, metal = 2.0}, - [50] = {x = 4075, z = 3054, metal = 2.0}, - }, -} \ No newline at end of file diff --git a/LuaRules/Configs/MetalSpots/EvoRTS - Altored Divide - v10.lua b/LuaRules/Configs/MetalSpots/EvoRTS - Altored Divide - v10.lua deleted file mode 100644 index 9dfea8d3f..000000000 --- a/LuaRules/Configs/MetalSpots/EvoRTS - Altored Divide - v10.lua +++ /dev/null @@ -1,93 +0,0 @@ -return { - spots = { - {x = 855, z = 977, metal = 2.0}, - {x = 1044, z = 937, metal = 2.0}, - {x = 1128, z = 1135, metal = 2.0}, - {x = 857, z = 1218, metal = 2.0}, - {x = 984, z = 1679, metal = 2.0}, - {x = 2413, z = 713, metal = 2.0}, - {x = 2222, z = 960, metal = 2.0}, - {x = 2443, z = 1146, metal = 2.0}, - {x = 2681, z = 896, metal = 2.0}, - {x = 3985, z = 663, metal = 2.0}, - {x = 4271, z = 552, metal = 2.0}, - {x = 4390, z = 890, metal = 2.0}, - {x = 4005, z = 1011, metal = 2.0}, - {x = 5930, z = 495, metal = 2.0}, - {x = 6241, z = 567, metal = 2.0}, - {x = 6070, z = 772, metal = 2.0}, - {x = 5583, z = 856, metal = 2.0}, - {x = 4967, z = 1647, metal = 2.0}, - {x = 3107, z = 2360, metal = 2.0}, - {x = 2359, z = 2408, metal = 2.0}, - {x = 7122, z = 866, metal = 2.0}, - {x = 7390, z = 813, metal = 2.0}, - {x = 7543, z = 977, metal = 2.0}, - {x = 7421, z = 1202, metal = 2.0}, - {x = 6469, z = 1703, metal = 2.0}, - {x = 7962, z = 2170, metal = 2.0}, - {x = 6404, z = 2801, metal = 2.0}, - {x = 6634, z = 3047, metal = 2.0}, - {x = 5939, z = 3101, metal = 2.0}, - {x = 6088, z = 3077, metal = 2.0}, - {x = 5600, z = 2780, metal = 2.0}, - {x = 4740, z = 2807, metal = 2.0}, - {x = 4188, z = 2989, metal = 2.0}, - {x = 4016, z = 3106, metal = 2.0}, - {x = 98, z = 2867, metal = 2.0}, - {x = 383, z = 2941, metal = 2.0}, - {x = 1212, z = 3434, metal = 2.0}, - {x = 1891, z = 3723, metal = 2.0}, - {x = 430, z = 3761, metal = 2.0}, - {x = 968, z = 4325, metal = 2.0}, - {x = 1337, z = 4513, metal = 2.0}, - {x = 1511, z = 4449, metal = 2.0}, - {x = 2779, z = 3825, metal = 2.0}, - {x = 3128, z = 3966, metal = 2.0}, - {x = 3206, z = 4148, metal = 2.0}, - {x = 4573, z = 4138, metal = 2.0}, - {x = 4618, z = 4368, metal = 2.0}, - {x = 4831, z = 4402, metal = 2.0}, - {x = 7637, z = 3833, metal = 2.0}, - {x = 7515, z = 4053, metal = 2.0}, - {x = 7480, z = 4358, metal = 2.0}, - {x = 6628, z = 4239, metal = 2.0}, - {x = 6413, z = 4146, metal = 2.0}, - {x = 6266, z = 4332, metal = 2.0}, - {x = 7438, z = 4908, metal = 2.0}, - {x = 7019, z = 5031, metal = 2.0}, - {x = 7759, z = 5357, metal = 2.0}, - {x = 3907, z = 5163, metal = 2.0}, - {x = 3598, z = 5221, metal = 2.0}, - {x = 3254, z = 5268, metal = 2.0}, - {x = 2697, z = 5192, metal = 2.0}, - {x = 2210, z = 4740, metal = 2.0}, - {x = 2229, z = 4569, metal = 2.0}, - {x = 1703, z = 6499, metal = 2.0}, - {x = 404, z = 5887, metal = 2.0}, - {x = 422, z = 7014, metal = 2.0}, - {x = 173, z = 7317, metal = 2.0}, - {x = 832, z = 7091, metal = 2.0}, - {x = 763, z = 7393, metal = 2.0}, - {x = 1879, z = 7118, metal = 2.0}, - {x = 2200, z = 7170, metal = 2.0}, - {x = 2257, z = 7441, metal = 2.0}, - {x = 1738, z = 7434, metal = 2.0}, - {x = 3838, z = 6456, metal = 2.0}, - {x = 3978, z = 7331, metal = 2.0}, - {x = 3773, z = 7568, metal = 2.0}, - {x = 4150, z = 7851, metal = 2.0}, - {x = 4458, z = 7249, metal = 2.0}, - {x = 5381, z = 7000, metal = 2.0}, - {x = 5204, z = 7488, metal = 2.0}, - {x = 5786, z = 6932, metal = 2.0}, - {x = 5934, z = 7329, metal = 2.0}, - {x = 5150, z = 5925, metal = 2.0}, - {x = 5838, z = 5883, metal = 2.0}, - {x = 7950, z = 6495, metal = 2.0}, - {x = 7782, z = 7202, metal = 2.0}, - {x = 7339, z = 7235, metal = 2.0}, - {x = 7119, z = 7132, metal = 2.0}, - {x = 7135, z = 6799, metal = 2.0}, - }, -} \ No newline at end of file diff --git a/LuaRules/Configs/MetalSpots/EvoRTS - Glacier Pass - v12.lua b/LuaRules/Configs/MetalSpots/EvoRTS - Glacier Pass - v12.lua deleted file mode 100644 index 524bf43eb..000000000 --- a/LuaRules/Configs/MetalSpots/EvoRTS - Glacier Pass - v12.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - spots = { - [1] = {x = 566, z = 373, metal = 2.0}, - [2] = {x = 941, z = 379, metal = 2.0}, - [3] = {x = 736, z = 669, metal = 2.0}, - [4] = {x = 2709, z = 1234, metal = 2.0}, - [5] = {x = 628, z = 1758, metal = 2.0}, - [6] = {x = 619, z = 2707, metal = 2.0}, - [7] = {x = 192, z = 3036, metal = 2.0}, - [8] = {x = 688, z = 3393, metal = 2.0}, - [9] = {x = 2293, z = 2797, metal = 2.0}, - [10] = {x = 3267, z = 3213, metal = 2.0}, - [11] = {x = 3086, z = 4223, metal = 2.0}, - [12] = {x = 4177, z = 319, metal = 2.0}, - [13] = {x = 4712, z = 1475, metal = 2.0}, - [14] = {x = 5252, z = 1495, metal = 2.0}, - [15] = {x = 5026, z = 1904, metal = 2.0}, - [16] = {x = 5485, z = 373, metal = 2.0}, - [17] = {x = 6405, z = 190, metal = 2.0}, - [18] = {x = 6865, z = 224, metal = 2.0}, - [19] = {x = 6610, z = 492, metal = 2.0}, - [20] = {x = 7824, z = 382, metal = 2.0}, - [21] = {x = 6980, z = 1958, metal = 2.0}, - [22] = {x = 6663, z = 2819, metal = 2.0}, - [23] = {x = 7813, z = 2422, metal = 2.0}, - [24] = {x = 7458, z = 3051, metal = 2.0}, - [25] = {x = 4732, z = 3495, metal = 2.0}, - [26] = {x = 4838, z = 4383, metal = 2.0}, - [27] = {x = 5208, z = 5314, metal = 2.0}, - [28] = {x = 507, z = 4557, metal = 2.0}, - [29] = {x = 1233, z = 4807, metal = 2.0}, - [30] = {x = 2180, z = 4961, metal = 2.0}, - [31] = {x = 1994, z = 6424, metal = 2.0}, - [32] = {x = 259, z = 6481, metal = 2.0}, - [33] = {x = 121, z = 5340, metal = 2.0}, - [34] = {x = 737, z = 7673, metal = 2.0}, - [35] = {x = 489, z = 8021, metal = 2.0}, - [36] = {x = 1054, z = 7969, metal = 2.0}, - [37] = {x = 2322, z = 7900, metal = 2.0}, - [38] = {x = 3389, z = 7877, metal = 2.0}, - [39] = {x = 4449, z = 6196, metal = 2.0}, - [40] = {x = 4067, z = 6762, metal = 2.0}, - [41] = {x = 4726, z = 6777, metal = 2.0}, - [42] = {x = 5781, z = 7156, metal = 2.0}, - [43] = {x = 6287, z = 7761, metal = 2.0}, - [44] = {x = 5987, z = 8042, metal = 2.0}, - [45] = {x = 6486, z = 8083, metal = 2.0}, - [46] = {x = 7077, z = 6904, metal = 2.0}, - [47] = {x = 7623, z = 5538, metal = 2.0}, - [48] = {x = 6992, z = 5154, metal = 2.0}, - [49] = {x = 8048, z = 4972, metal = 2.0}, - }, -} \ No newline at end of file diff --git a/LuaRules/Configs/MetalSpots/defaultLayout.lua b/LuaRules/Configs/MetalSpots/defaultLayout.lua new file mode 100644 index 000000000..283af030a --- /dev/null +++ b/LuaRules/Configs/MetalSpots/defaultLayout.lua @@ -0,0 +1,362 @@ +--math.randomseed(Game.GameID) -- This only works in 104+ +math.random(); math.random(); math.random() +local mapx, mapz = Game.mapSizeX * 0.5, Game.mapSizeZ * 0.5 + +-- Lets sq root the map size into a digestable number for later. We're doing some math here to account for the fact that spring does not work with add numbers. Only even ones. So, for that reason we cant to get the square root in numbers that comport to how we normally thing about maps. For example, a 16 x 16 map sqrt is 256, so that is our basis. + +local mapWidthX = (Game.mapSizeX * 2) / 1024 +local mapLengthZ = (Game.mapSizeZ * 2) / 1024 +local mapSQRT = mapWidthX * mapLengthZ + +-- Params +local size = math.max(mapx, mapz) + +-- +Spring.Echo("[Default Mex Layout] Map size is: " .. size) +Spring.Echo("[Default Mex Layout] Map square root size is: " .. mapSQRT) +local count = #Spring.GetTeamList() - 1 +local allycount = #Spring.GetAllyTeamList() - 1 +-- for i = 1, #players do + -- local playerID = players[i] + -- if not select(3, Spring.GetPlayerInfo(playerID)) then + -- count = count + 1 + -- end +-- end +Spring.SetGameRulesParam("peopleCount", count) + +teamIDCount = Spring.GetGameRulesParam("peopleCount") + +Spring.Echo("[Default Mex Layout] Number of teamIDs in this match: " .. teamIDCount) +-- + +local placeMexesInWater = Spring.GetModOptions().allowmexesinwater or "disabled" +local maxMexElevationDiff = tonumber(Spring.GetModOptions().maximummexelevationdifference) or 50 +local mexSpotsPerSideMultiplier = tonumber(Spring.GetModOptions().mexspotspersidemultiplier) or 100 +local mexRandomLayout = Spring.GetModOptions().mexrandomlayout or "standard" + if allycount > 2 then + mexRandomLayout = "legacy1" + end +local dynamicMexOutput = Spring.GetModOptions().dynamicmexoutput or "disabled" + +if placeMexesInWater == "enabled" or placeMexesInWater == "" or placeMexesInWater == nil then -- This is just an oshitifukedup protection + allowMexesInWater = true +elseif placeMexesInWater == "disabled" then + allowMexesInWater = false +end + +if maxMexElevationDiff == nil then -- This is just an oshitifukedup protection + maxMexElevationDiff = 50 +end + +if mexSpotsPerSideMultiplier == nil then -- This is just an oshitifukedup protection + mexSpotsPerSideMultiplier = 100 +end + +if mexRandomLayout == "" or mexRandomLayout == nil then -- This is just an oshitifukedup protection + mexRandomLayout = "standard" +end + +if dynamicMexOutput == "" or dynamicMexOutput == nil then -- This is just an oshitifukedup protection + dynamicMexOutput = "disabled" +end + +Spring.Echo("[Default Mex Layout] Can we put mexes in water?") +Spring.Echo(allowMexesInWater) + +local sGetGroundHeight = Spring.GetGroundHeight +local mexSideHalved = 70 -- mex is a square of side 140 units +local slopeCheckMinDistance = 35 +local function checkSlope(x, z, tolerance, allowWater) + local heightMap = {} + local leng = 0 + for i = -mexSideHalved, mexSideHalved, slopeCheckMinDistance do + for j = -mexSideHalved, mexSideHalved, slopeCheckMinDistance do + leng = leng + 1 + heightMap[leng] = sGetGroundHeight(x + i, z + j) + end + end + local highest = math.max(unpack(heightMap)) + local lowest = math.min(unpack(heightMap)) + local result = highest - lowest + return result <= tolerance and (allowWater or lowest > 0) +end + +local function mathRound(x) + return math.floor(x + 0.5) +end +local function f(x) + result = 0 + if x < 0.6 then result = 0.5 + math.pow((0.6 - x) / 0.6, 2) * 1.5 + elseif x < 0.8 then result = (x - 0.6) / 0.4 + 0.5 + elseif x <= 1 then result = 1 end + if dynamicMexOutput == "disabled" then + return 1 + else + return mathRound(result / 0.05) * 0.05 + end +end +local function makePositionsRandomMirrored(sizeX, sizeY, padding, pointRadius, extraSeparationBetweenPoints, howManyTriesBeforeGiveUp, numPointsPerSide, includeCentre, method, allowWater) + --[[ + method 1: object rotated 180 degrees around centre to produce image + method 2: object mirrored around horizontal line passing through centre to produce image + method 3: object mirrored around vertical line passing through centre to produce image + method 4: object mirrored around diagonal line going from NE to SW to produce image + method 5: object mirrored around diagonal line going from NW to SE to produce image + ]] + local positions = {} + --positions[1] = {x = padding, z = padding} + --positions[2] = {x = sizeX - padding, z = sizeY - padding} + if includeCentre then positions[#positions + 1] = {x = sizeX * 0.5, z = sizeY * 0.5} end + for i = 1, numPointsPerSide do + local newPoint = {0, 0} + local done = false + local numIterations = 0 + local minSeparation = pointRadius * 2 + extraSeparationBetweenPoints + while not done and numIterations < howManyTriesBeforeGiveUp do + numIterations = numIterations + 1 + done = true + if method == 6 then + newPoint[1] = padding + math.random() * (sizeX *0.5 - padding * 2) + newPoint[2] = padding + math.random() * (sizeY *0.5 - padding * 2) + else + newPoint[1] = padding + math.random() * (sizeX - padding * 2) + newPoint[2] = padding + math.random() * (sizeY - padding * 2) + end + if method == 1 then + newPoint[3] = sizeX - newPoint[1] + newPoint[4] = sizeY - newPoint[2] + elseif method == 2 then + newPoint[3] = newPoint[1] + newPoint[4] = sizeY - newPoint[2] + elseif method == 3 then + newPoint[3] = sizeX - newPoint[1] + newPoint[4] = newPoint[2] + elseif method == 4 then + newPoint[3] = sizeX - newPoint[2] + newPoint[4] = sizeY - newPoint[1] + elseif method == 5 then + newPoint[3] = newPoint[2] + newPoint[4] = newPoint[1] + elseif method == 6 then + newPoint[3] = newPoint[1] + newPoint[4] = sizeY - newPoint[2] + newPoint[5] = sizeX - newPoint[1] + newPoint[6] = newPoint[2] + newPoint[7] = sizeX - newPoint[1] + newPoint[8] = sizeY - newPoint[2] + end + -- check slope of new point and mirror + done = checkSlope(newPoint[1], newPoint[2], maxMexElevationDiff, allowWater) + done = done and checkSlope(newPoint[3], newPoint[4], maxMexElevationDiff, allowWater) + for j = 1, #positions do + -- check new point vs existing points + local dx = newPoint[1] - positions[j].x + local dy = newPoint[2] - positions[j].z + if dx * dx + dy * dy < minSeparation * minSeparation then + done = false + --positions[j][4], positions[j][5], logCollisions = positions[j][4] - 48, positions[j][5] - 48, logCollisions + 1 + break + end + -- check mirror of new point vs existing points + dx = newPoint[3] - positions[j].x + dy = newPoint[4] - positions[j].z + if dx * dx + dy * dy < minSeparation * minSeparation then + done = false + --positions[j][4], positions[j][5], logCollisions = positions[j][4] - 48, positions[j][5] - 48, logCollisions + 1 + break + end + end + -- check new point vs mirror of new point + local dx = newPoint[1] - newPoint[3] + local dy = newPoint[2] - newPoint[4] + if dx * dx + dy * dy < minSeparation * minSeparation then + done = false + --logCollisions = logCollisions + 1 + end + end + if numIterations == howManyTriesBeforeGiveUp then logFailures = logFailures + 1 end + positions[#positions + 1] = {x = newPoint[1], z = newPoint[2]} + positions[#positions + 1] = {x = newPoint[3], z = newPoint[4]} + if newPoint[5] then + positions[#positions + 1] = {x = newPoint[5], z = newPoint[6]} + end + if newPoint[7] then + positions[#positions + 1] = {x = newPoint[7], z = newPoint[8]} + end + end + --table.remove(positions, 1) + --table.remove(positions, 1) + + local ratioX, ratioY = 1, 1 + if sizeX > sizeY then ratioY = sizeX / sizeY + elseif sizeY > sizeX then ratioX = sizeY / sizeX end + local sizeMax = math.max(sizeX, sizeY) + if teamIDCount < 2 then + metalMultiplier = 2 + elseif teamIDCount > 8 then + metalMultiplier = 8 + else + metalMultiplier = teamIDCount + end + for i = 1, #positions do + local dx = sizeMax * 0.5 - positions[i].x * ratioX + local dy = sizeMax * 0.5 - positions[i].z * ratioY + local r = math.sqrt(dx * dx + dy * dy) + positions[i].metal = f(r / (sizeX * math.sqrt(2) * (metalMultiplier * 0.5))) + end + + return positions +end + +if mexRandomLayout == "legacy1" then + -- most normal layout + -- max metal ~49.1 + -- Max spots 56 + randomMirrored = false + r = {0.25, 0.5, 0.75, 0.95} + pointsPerLayer = {10, 11, 15, 20} + angleOffset = {math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4} + pointsBetweenVertices = {0, 0, 0, 0} + --m = {2, 1.66, 1.33, 1.5} +end + +if mexRandomLayout == "legacy2" then +-- Bit more random/clustered +-- max metal ~50 +-- Max spots 56 + randomMirrored = false + r = {0.15, 0.33, 0.5, 0.75, 0.85, 0.95} + pointsPerLayer = {3, 6, 8, 10, 14, 15} + angleOffset = {math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4} + pointsBetweenVertices = {0, 0, 0, 0, 0, 0} + --m = {2, 1.75, 1.50, 1.33, 1.25, 2} +end + +if mexRandomLayout == "legacy3" then +-- The Pitchfork +-- max metal ~51.1 +-- Max spots 94 + randomMirrored = false + r = {0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95} + pointsPerLayer = {3,5,3,9,3,11,13,7,19,21} + angleOffset = {math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4, math.pi / 4} + pointsBetweenVertices = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + --m = {2, 1.9, 1.7, 1.5, 1.4, 1, 1.1, 1.25, 1.4, 1.5} +end + +if mexRandomLayout == "legacy4" then + randomMirrored = false + r = {0.25, 0.5, 0.85} + pointsPerLayer = {3, 4, 8} + angleOffset = {-math.pi / 2, 0, math.pi / 8} + pointsBetweenVertices = {1, 0, 2} + --m = {1, 1, 1} +end + +if mexRandomLayout == "standard" then + + mexSpotsPerSide = 12 + + if mapSQRT <= 144 then -- An exception for 12x12 and smaller maps + mexSpotsPerSide = mexSpotsPerSide * 0.5 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + if mapSQRT > 144 and mapSQRT <= 196 then -- An exception for 14x14 maps + mexSpotsPerSide = mexSpotsPerSide * 0.75 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + if mapSQRT > 196 and mapSQRT <= 256 then -- An exception for 16x16 maps + mexSpotsPerSide = mexSpotsPerSide * 1 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + if mapSQRT > 256 and mapSQRT <= 400 then -- An exception for 20x20 maps + mexSpotsPerSide = mexSpotsPerSide * 1.5 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + if mapSQRT > 400 and mapSQRT <= 576 then -- An exception for 24x24 maps + mexSpotsPerSide = mexSpotsPerSide * 1.75 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + if mapSQRT > 576 then -- An exception for 28x28 maps + mexSpotsPerSide = mexSpotsPerSide * 2 + Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).") + end + + randomMirrored = true + padding = 100 + pointRadius = 100 -- TODO: change this into how big a metal circle is + extraSeparationBetweenPoints = 50 + howManyTriesBeforeGiveUp = 100 + numPointsPerSide = mexSpotsPerSide * (mexSpotsPerSideMultiplier * 0.01) + includeCentre = false + method = 6 + allowWater = allowMexesInWater + --metalPerPoint = 1 +end + +if mexRandomLayout == "ffa" then + local numVertices = teamIDCount + if teamIDCount <= 2 then numVertices = 3 end -- can't have a polygon with less than 3 sides + randomMirrored = false + r = {0.12, 0.25, 0.50, 0.75, 0.88, 0.88, 0.88} + pointsPerLayer = {numVertices, numVertices, numVertices, numVertices, numVertices, numVertices, numVertices} + local theta = -math.pi / 2 + local offset = math.pi / 14 + angleOffset = {theta, theta, theta, theta, theta, theta - offset, theta + offset} + pointsBetweenVertices = {0, 0, 1, 0, 0, 0, 0} + --m = {2, 1.66, 1.33, 1.25, 1, 1.5, 2} +end + +if r and not m then + m = {} + for i = 1, #r do + m[i] = f(r[i]) + end +end + +-- +local results = {} +if not randomMirrored then + local lengResults = 1 + local ratioX, ratioZ = 1, 1 + if mapx > mapz then + ratioZ = mapz / mapx + elseif mapz > mapx then + ratioX = mapx / mapz + end + for i = 1, #pointsPerLayer do + + local angle = angleOffset[i] + math.pi * 2 * 1 / pointsPerLayer[i] + local currX, currZ = mapx + r[i] * math.cos(angle) * size * ratioX, mapz + r[i] * math.sin(angle) * size * ratioZ + + for j = 2, pointsPerLayer[i] + 1 do + results[lengResults] = {x = currX, z = currZ, metal = m[i]} + lengResults = lengResults + 1 + + angle = angleOffset[i] + math.pi * 2 * j / pointsPerLayer[i] + nextX, nextZ = mapx + r[i] * math.cos(angle) * size * ratioX, mapz + r[i] * math.sin(angle) * size * ratioZ + + local numParts = pointsBetweenVertices[i] + 1 + for k = 1, pointsBetweenVertices[i] do + results[lengResults] = { + x = currX * (numParts - k) / numParts + nextX * k / numParts, + z = currZ * (numParts - k) / numParts + nextZ * k / numParts, + metal = m[i] + } + lengResults = lengResults + 1 + end + currX, currZ = nextX, nextZ + end + end +else + results = makePositionsRandomMirrored(Game.mapSizeX, Game.mapSizeZ, padding, pointRadius, extraSeparationBetweenPoints, howManyTriesBeforeGiveUp, numPointsPerSide, includeCentre, method, allowWater) +end + +return { + spots = results, +} diff --git a/LuaRules/Configs/MetalSpots/example.lua b/LuaRules/Configs/MetalSpots/example.lua new file mode 100644 index 000000000..73bc3218d --- /dev/null +++ b/LuaRules/Configs/MetalSpots/example.lua @@ -0,0 +1,44 @@ +-- Basic mexes. + +local spots = { + {x = 12, z = 55, metal = 2}, + {x = 34, z = 55, metal = 2}, + {x = 67, z = 55, metal = 2}, + {x = 89, z = 55, metal = 2}, +} + +-- Extra mexes added for 5v5+ games +local extraSpots = { + {x = 23, z = 55, metal = 2}, + {x = 78, z = 55, metal = 2}, +} + +if #Spring.GetTeamList() > 10 then + for i = 1, #extraSpots do + table.insert (spots, extraSpots[i]) + end +end + +-- Mirror the mexes symmetrically on the other half of the map +for i = 1, #spots do + local spot = spots[i] + local mirroredSpot = { + x = Game.mapSizeX - spot.x, + z = spot.z, + metal = spot.metal, + } + spots[#spots + 1] = mirroredSpot +end + +-- If a mapoption is set, add a supermex in the middle with dynamic income based on player count +if Spring.GetMapOptions().supermex then + spots[#spots + 1] = { + x = Game.mapSizeX / 2, + z = Game.mapSizeZ / 2, + metal = 3 + #Spring.GetTeamList(), + } +end + +return { + spots = spots, +} diff --git a/LuaRules/Configs/UnitMaterials/0_flags.lua b/LuaRules/Configs/UnitMaterials/0_flags.lua deleted file mode 100644 index 5d21bba75..000000000 --- a/LuaRules/Configs/UnitMaterials/0_flags.lua +++ /dev/null @@ -1,110 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local GADGET_DIR = "LuaRules/Configs/" - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local pieceDLs = {} - -local function UnitCreated(unitID, material, materialID) - local pieceMap = Spring.GetUnitPieceMap(unitID) - local flagPieces = {"gbrflag", "gerflag", "usflag", "rusflag"} - - for i=1,#flagPieces do - local pieceID = pieceMap[ flagPieces[i] ] - if (pieceID) then - local dl = pieceDLs[i] - if (not dl) then - dl = gl.CreateList(function() - gl.MultiTexCoord(4,100) - gl.UnitPiece(unitID, pieceID) - gl.MultiTexCoord(4,0) - end) - pieceDLs[i] = dl - end - Spring.UnitRendering.SetPieceList(unitID,materialID,pieceID,dl) - end - end -end - - -local function DrawUnit(unitID, material) - gl.Uniform(material.frameLoc, (Spring.GetGameFrame() + Spring.GetFrameTimeOffset())/10) - - --// engine should still draw it (we just set the uniforms for the shader) - return false -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local materials = { - flagShader = { - shaderDefinitions = { - "#define use_perspective_correct_shadows", - "#define use_normalmapping", - }, - shaderPlugins = { - VERTEX_GLOBAL_NAMESPACE = [[ - uniform float frame2; - ]], - VERTEX_PRE_TRANSFORM = [[ - if (gl_MultiTexCoord4.x > 10.0) { - float a; - vec3 n = vec3(0.0); - - a = (vertex.x * 0.5 + frame2); - vertex.z += 1.35 * sin(a) * max(vertex.x, -1.0); - n += vec3(-1.0, 0.0, cos(a)) * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - a = (vertex.x * 0.5 + frame2 + vertex.y * 0.5); - vertex.z += 0.2 * sin(a) * max(vertex.x, -1.0); - n += vec3(-1.0, 0.0, cos(a)) * 0.13 * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - a = (vertex.x * 0.5 + frame2 - 0.33); - vertex.y += 0.8 * sin(a) * max(vertex.x, -1.0); - n += vec3(0.0, cos(a), -1.0) * 0.8 * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - normal = normalize(mix(normal,n,0.65)); - } - ]], - }, - shader = include(GADGET_DIR .. "UnitMaterials/Shaders/default.lua"), - force = true, - usecamera = false, - culling = GL.BACK, - texunits = { - [0] = '%%UNITDEFID:0', - [1] = '%%UNITDEFID:1', - [2] = '$shadow', - [3] = '$specular', - [4] = '$reflection', - [5] = 'unittextures/Flags_normals.dds', - }, - UnitCreated = UnitCreated, - DrawUnit = DrawUnit, - }, -} - - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- affected unitdefs - -local unitMaterials = {} - -unitMaterials.flag = { - "flagShader", -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return materials, unitMaterials - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Configs/UnitMaterials/1_normalmapping.lua b/LuaRules/Configs/UnitMaterials/1_normalmapping.lua deleted file mode 100644 index b70439933..000000000 --- a/LuaRules/Configs/UnitMaterials/1_normalmapping.lua +++ /dev/null @@ -1,153 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local GetGameFrame=Spring.GetGameFrame -local GetUnitHealth=Spring.GetUnitHealth -local modulo=math.fmod -local glUniform=gl.Uniform -local sine =math.sin -local maximum=math.max - -local GADGET_DIR = "LuaRules/Configs/" -local function DrawUnit(unitID, material) - glUniform(material.frameLoc, maximum(0,sine(modulo(unitID,10)+GetGameFrame()/(modulo(unitID,7)+6)))) - health,maxhealth=GetUnitHealth(unitID) - glUniform(material.healthLoc, 2*maximum(0, (-2*health)/(maxhealth)+1) )--inverse of health, 0 if health is 100%-50%, goes to 1 by 0 health - - - --// engine should still draw it (we just set the uniforms for the shader) - return false -end -local materials = { - normalMappedS3o = { - shaderDefinitions = { - "#define use_perspective_correct_shadows", - "#define use_normalmapping", - --"#define flip_normalmap", - }, - shader = include(GADGET_DIR .. "UnitMaterials/Shaders/default.lua"), - usecamera = false, - culling = GL.BACK, - texunits = { - [0] = '%%UNITDEFID:0', - [1] = '%%UNITDEFID:1', - [2] = '$shadow', - [3] = '$specular', - [4] = '$reflection', - [5] = '%normalstex', - }, - DrawUnit = DrawUnit, - }, -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Automated normalmap detection - -local unitMaterials = {} - - - -local function FindNormalmap(tex1, tex2) - local normalstex - - --// check if there is a corresponding _normals.dds file - if (VFS.FileExists(tex1)) then - local basefilename = tex1:gsub("%....","") - --[[if (tonumber(basefilename:sub(-1,-1))) then - basefilename = basefilename:sub(1,-2) - end]]-- -- This code removes trailing numbers, but many S44 units end in a number, e.g. SU-76 - if (basefilename:sub(-1,-1) == "_") then - basefilename = basefilename:sub(1,-2) - end - normalstex = basefilename .. "_normals.dds" - if (not VFS.FileExists(normalstex)) then - normalstex = nil - end - end --if FileExists - - --[[if (not normalstex) and tex2 and (VFS.FileExists(tex2)) then - local basefilename = tex2:gsub("%....","") - if (tonumber(basefilename:sub(-1,-1))) then - basefilename = basefilename:sub(1,-2) - end - if (basefilename:sub(-1,-1) == "_") then - basefilename = basefilename:sub(1,-2) - end - normalstex = basefilename .. "_normals.dds" - if (not VFS.FileExists(normalstex)) then - normalstex = nil - end - end --if FileExists ]] -- disable tex2 detection for S44 - - return normalstex -end - - - -for i=1,#UnitDefs do - local udef = UnitDefs[i] - - if (udef.customParams.normalstex and VFS.FileExists(udef.customParams.normalstex)) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = udef.customParams.normalstex} - - elseif (udef.model.type == "s3o") then - local modelpath = udef.model.path - if (modelpath) then - --// udef.model.textures is empty at gamestart, so read the texture filenames from the s3o directly - - local rawstr = VFS.LoadFile(modelpath) - local header = rawstr:sub(1,60) - local texPtrs = VFS.UnpackU32(header, 45, 2) - local tex1,tex2 - if (texPtrs[2] > 0) - then tex2 = "unittextures/" .. rawstr:sub(texPtrs[2]+1, rawstr:len()-1) - else texPtrs[2] = rawstr:len() end - if (texPtrs[1] > 0) - then tex1 = "unittextures/" .. rawstr:sub(texPtrs[1]+1, texPtrs[2]-1) end - - -- output units without tex2 - --[[if not tex2 then - Spring.Echo("CustomUnitShaders: " .. udef.name .. " no tex2") - end]] - - local normalstex = FindNormalmap(tex1,tex2) - if (normalstex and not unitMaterials[udef.name]) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = normalstex} - end - end --if model - - elseif (udef.model.type == "obj") then - local modelinfopath = udef.model.path - if (modelinfopath) then - modelinfopath = modelinfopath .. ".lua" - - if (VFS.FileExists(modelinfopath)) then - local infoTbl = Include(modelinfopath) - if (infoTbl) then - local tex1 = "unittextures/" .. (infoTbl.tex1 or "") - local tex2 = "unittextures/" .. (infoTbl.tex2 or "") - - -- output units without tex2 - --[[if not tex2 then - Spring.Echo("CustomUnitShaders: " .. udef.name .. " no tex2") - end]] - - local normalstex = FindNormalmap(tex1,tex2) - if (normalstex and not unitMaterials[udef.name]) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = normalstex} - end - end - end - end - - end --elseif -end --for - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return materials, unitMaterials - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Configs/UnitMaterials/Shaders/default.lua b/LuaRules/Configs/UnitMaterials/Shaders/default.lua deleted file mode 100644 index cc921f7be..000000000 --- a/LuaRules/Configs/UnitMaterials/Shaders/default.lua +++ /dev/null @@ -1,186 +0,0 @@ -return { - vertex = [[ -//#define use_normalmapping -//#define flip_normalmap -//#define use_shadows - - %%VERTEX_GLOBAL_NAMESPACE%% - - uniform mat4 camera; //ViewMatrix (gl_ModelViewMatrix is ModelMatrix!) - //uniform mat4 cameraInv; - uniform vec3 cameraPos; - uniform vec3 sunPos; - uniform vec3 sunDiffuse; - uniform vec3 sunAmbient; - //uniform float frameLoc; - #ifdef use_shadows - uniform mat4 shadowMatrix; - varying vec4 shadowpos; - #ifndef use_perspective_correct_shadows - uniform vec4 shadowParams; - #endif - #endif - - varying vec3 cameraDir; - varying vec3 teamColor; - //varying float fogFactor; - - #ifdef use_normalmapping - varying vec3 t; - varying vec3 b; - varying vec3 n; - #else - varying vec3 normalv; - #endif - - void main(void) - { - vec4 vertex = gl_Vertex; - vec3 normal = gl_Normal; - // vertex.xyz+=normal*40*frameLoc; - - %%VERTEX_PRE_TRANSFORM%% - - #ifdef use_normalmapping - vec3 tangent = gl_MultiTexCoord5.xyz; - vec3 bitangent = gl_MultiTexCoord6.xyz; - t = gl_NormalMatrix * tangent; - b = gl_NormalMatrix * bitangent; - n = gl_NormalMatrix * normal; - #else - normalv = gl_NormalMatrix * normal; - #endif - - vec4 worldPos = gl_ModelViewMatrix * vertex; - gl_Position = gl_ProjectionMatrix * (camera * worldPos); - cameraDir = worldPos.xyz - cameraPos; - - #ifdef use_shadows - shadowpos = shadowMatrix * worldPos; - #ifndef use_perspective_correct_shadows - shadowpos.st = shadowpos.st * (inversesqrt(abs(shadowpos.st) + shadowParams.z) + shadowParams.w) + shadowParams.xy; - #endif - #endif - - gl_TexCoord[0].st = gl_MultiTexCoord0.st; - teamColor = gl_TextureEnvColor[0].rgb; - - //float fogCoord = length(gl_Position.xyz); - //fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start) - //fogFactor = clamp(fogFactor, 0.0, 1.0); - - %%VERTEX_POST_TRANSFORM%% - } - ]], - fragment = [[ -//#define use_normalmapping -//#define flip_normalmap -//#define use_shadows - - %%FRAGMENT_GLOBAL_NAMESPACE%% - - uniform sampler2D textureS3o1; - uniform sampler2D textureS3o2; - uniform samplerCube specularTex; - uniform samplerCube reflectTex; - - uniform vec3 sunPos; // is sunDir! - uniform vec3 sunDiffuse; - uniform vec3 sunAmbient; - uniform float frameLoc; - uniform float healthLoc; - - #ifdef use_shadows - #ifdef use_perspective_correct_shadows - uniform vec4 shadowParams; - #endif - varying vec4 shadowpos; - uniform sampler2DShadow shadowTex; - uniform float shadowDensity; - #endif - - varying vec3 teamColor; - varying vec3 cameraDir; - //varying float fogFactor; - - #ifdef use_normalmapping - varying vec3 t; - varying vec3 b; - varying vec3 n; - uniform sampler2D normalMap; - #else - varying vec3 normalv; - #endif - - void main(void) - { - %%FRAGMENT_PRE_SHADING%% - - #ifdef use_normalmapping - vec2 tc = gl_TexCoord[0].st; - #ifdef flip_normalmap - tc.t = 1.0 - tc.t; - #endif - vec4 normaltex=texture2D(normalMap, tc); - vec3 nvTS = normalize(normaltex.xyz - 0.5); - vec3 normal = normalize(mat3(t,b,n) * nvTS); - #else - vec3 normal = normalize(normalv); - #endif - float a = max( dot(normal, sunPos), 0.0); - vec3 light = a * sunDiffuse + sunAmbient; - - vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st); - - vec3 reflectDir = reflect(cameraDir, normal); - vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.b * 4.0; - vec3 reflection = textureCube(reflectTex, reflectDir).rgb; - - #ifdef use_shadows - vec4 shadowTC = shadowpos; - #ifdef use_perspective_correct_shadows - shadowTC.st = shadowTC.st * (inversesqrt( abs(shadowTC.st) + shadowParams.z) + shadowParams.w) + shadowParams.xy; - #endif - float shadow = shadow2DProj(shadowTex, shadowTC).r; - shadow = 1.0 - (1.0 - shadow) * shadowDensity; - light = mix(sunAmbient, light, shadow); - specular *= shadow; - #endif - - reflection = mix(light, reflection, extraColor.g); // reflection - reflection += extraColor.rrr*frameLoc; // self-illum - - gl_FragColor = texture2D(textureS3o1, gl_TexCoord[0].st); - gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor - gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular; - gl_FragColor.a = extraColor.a; - gl_FragColor.rgb = gl_FragColor.rgb +gl_FragColor.rgb*(normaltex.a-0.5)*healthLoc; - //gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog - //gl_FragColor.a = teamColor.a; // far fading - //gl_FragColor.rgb = normal; - //gl_FragColor.g=frameLoc; - %%FRAGMENT_POST_SHADING%% - } - ]], - uniformInt = { - textureS3o1 = 0, - textureS3o2 = 1, - shadowTex = 2, - specularTex = 3, - reflectTex = 4, - normalMap = 5, - --detailMap = 6, - }, - uniform = { - sunPos = {gl.GetSun("pos")}, - sunAmbient = {gl.GetSun("ambient" ,"unit")}, - sunDiffuse = {gl.GetSun("diffuse" ,"unit")}, - shadowDensity = {gl.GetSun("shadowDensity" ,"unit")}, - shadowParams = {gl.GetShadowMapParams()}, - -- frameLoc = {math.random()}, --!bingo! - frameLoc = {math.sin(Spring.GetGameFrame()/3.0)}, - }, - uniformMatrix = { - shadowMatrix = {gl.GetMatrixData("shadow")}, - }, -} diff --git a/LuaRules/Configs/cloak_shield_defs.lua b/LuaRules/Configs/cloak_shield_defs.lua index 7a0341ee8..4e9899543 100644 --- a/LuaRules/Configs/cloak_shield_defs.lua +++ b/LuaRules/Configs/cloak_shield_defs.lua @@ -1,10 +1,3 @@ --- $Id: cloak_shield_defs.lua 4643 2009-05-22 05:52:27Z carrepairer $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---Modified by Evil4Zerggin - --- -- Cloak Levels -- -- 0: disabled @@ -12,100 +5,45 @@ -- 2: conditionally enabled, does no use energy -- 3: enabled, unless stunned -- 4: always enabled --- - --- decloakDistance: Units cloaked by the cloaker have this decloakdistance. Use false to use the unit's own decloak distance (typically 0) - - -local function JammerAlign(defName) - local ud = UnitDefNames[defName] - if (ud == nil) then return 0 end - local jamRad = ud.jammerRadius - return 64 * math.floor(jamRad / 64) -end - -local function GetUnitDecloakDistance(defName) - local ud = UnitDefNames[defName] - if (ud == nil) then return 0 end - local decloakDist = ud.decloakDistance - return 64 * math.floor(decloakDist / 64) -end - -local cloakShieldDefs = { - ejammer2 = { - init = false, - draw = true, - energy = 5, - maxrad = JammerAlign('ejammer2'), - growRate = 512, - shrinkRate = 2048, - selfCloak = false, - decloakDistance = 500, - }, - - eallterrshield = { - init = true, - draw = true, - energy = 5, - maxrad = 150, - growRate = 512, - shrinkRate = 2048, - selfCloak = false, - decloakDistance = 150, - }, -} --- reads from customParams and copies to cloakShieldDefs as appropriate - needed for procedurally generated comms --- as always, need better way to handle if upgrades are desired! -local presets = { - module_cloakfield = { - init = true, - draw = true, - energy = 12, - maxrad = 350, - growRate = 512, - shrinkRate = 2048, - selfCloak = true, - decloakDistance = 300, - }, -} +local uncloakables = {} -for name, ud in pairs(UnitDefNames) do - if ud.customParams.cloakshield_preset then - cloakShieldDefs[name] = Spring.Utilities.CopyTable(presets[ud.customParams.cloakshield_preset]) +for k, v in pairs(UnitDefNames) do + if (v.customParams.cannotcloak) then + uncloakables[k] = true end end -if (Spring.IsDevLuaEnabled()) then - for name, ud in pairs(UnitDefNames) do - if (cloakShieldDefs[name] == nil) then - cloakShieldDefs[name] = { - init = false, - energy = 1024, --v.metalCost / 10, - draw = true, - minrad = 50, - maxrad = 256, - growRate = 256, - shrinkRate = 1024, - selfCloak = false, - decloakDistance = false, - level = 4, - } - end - end -end - -local uncloakables = {} - -for k,v in pairs(UnitDefNames) do - if (v.customParams.cannotcloak) then - uncloakables[k] = true - end +local cloakShieldDefs = {} + +for name, ud in pairs (UnitDefNames) do + local cp = ud.customParams + if cp.area_cloak and (cp.area_cloak ~= "0") then + cloakShieldDefs[name] = {} + + cloakShieldDefs[name].energy = tonumber (cp.area_cloak_upkeep) + cloakShieldDefs[name].maxrad = tonumber (cp.area_cloak_radius) + + cloakShieldDefs[name].growRate = tonumber (cp.area_cloak_grow_rate) + cloakShieldDefs[name].shrinkRate = tonumber (cp.area_cloak_shrink_rate) + cloakShieldDefs[name].decloakDistance = tonumber (cp.area_cloak_decloak_distance) + + cloakShieldDefs[name].init = (cp.area_cloak_init ~= "0") + cloakShieldDefs[name].draw = (cp.area_cloak_draw ~= "0") + cloakShieldDefs[name].selfCloak = (cp.area_cloak_self ~= "0") + + local exception = {} + if cloakShieldDefs[name].decloakDistance then + for _, eud in pairs (UnitDefs) do + if eud.decloakDistance < cloakShieldDefs[name].decloakDistance then + exception[eud.id] = true + end + end + end + cloakShieldDefs[name].radiusException = exception + end end -return cloakShieldDefs, uncloakables - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +return cloakShieldDefs, uncloakables \ No newline at end of file diff --git a/LuaRules/Configs/cob_buttons.lua b/LuaRules/Configs/cob_buttons.lua deleted file mode 100644 index deb20aa3d..000000000 --- a/LuaRules/Configs/cob_buttons.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - - egunship2 = { - { - name = "Weapon type", - tooltip = "Switch between air to ground missiles and torpedos", - cob = "WeaponType", -- only this is required - type = CMDTYPE.ICON_MODE, - params = {'1', 'Missile', 'Torpedo'}, - }, - }, - - eriottank2 = { - { - name = "Weapon type", - tooltip = "Switch between EMP cannon and Shotgun Blast", - cob = "WeaponType", -- only this is required - type = CMDTYPE.ICON_MODE, - params = {'1', 'EMP', 'Shotgun'}, - }, - }, - - eamphibriot = { - { - name = "Weapon type", - tooltip = "Switch between EMP cannon and Shotgun Blast", - cob = "WeaponType", -- only this is required - type = CMDTYPE.ICON_MODE, - params = {'1', 'EMP', 'Shotgun'}, - }, - }, - - eallterrriot = { - { - name = "Weapon type", - tooltip = "Switch between EMP cannon and Shotgun Blast", - cob = "WeaponType", -- only this is required - type = CMDTYPE.ICON_MODE, - params = {'1', 'EMP', 'Shotgun'}, - }, - }, - - eamphibrock = { - { - name = "Weapon type", - tooltip = "Switch between EMP cannon and Shotgun Blast", - cob = "WeaponType", -- only this is required - type = CMDTYPE.ICON_MODE, - params = {'1', 'Single', 'Salvo'}, - }, - }, - -} \ No newline at end of file diff --git a/LuaRules/Configs/constants.lua b/LuaRules/Configs/constants.lua index 7b0ea0735..eea5e9c79 100644 --- a/LuaRules/Configs/constants.lua +++ b/LuaRules/Configs/constants.lua @@ -1 +1,2 @@ -HIDDEN_STORAGE = 10000 -- hidden storage: it will spend all energy above (storage - hidden_storage) \ No newline at end of file +HIDDEN_STORAGE = 10000 -- hidden storage: it will spend all energy above (storage - hidden_storage) +TEAM_SLOWUPDATE_RATE = 30 \ No newline at end of file diff --git a/LuaRules/Configs/cv_modOptions.lua b/LuaRules/Configs/cv_modOptions.lua new file mode 100644 index 000000000..9bc66c413 --- /dev/null +++ b/LuaRules/Configs/cv_modOptions.lua @@ -0,0 +1,85 @@ +cvMode = Spring.GetModOptions().scoremode + +--Is CV Enabled when you launch spring.exe directly? +if cvMode == nil then + cvMode = "disabled" +end + +-- CV Enabled/Disabled Controls +if cvMode == "disabled" then + return false +end + +------------------------------------------------------- +-- Use a building mask for Control Points? +--If this is set to false, then any unit will be buildable in the control point +useBuildingMask = true +------------------------------------------------------- + +captureRadius = tonumber(Spring.GetModOptions().captureradius) -- Radius around a point in which to capture it +if captureRadius == nil then + captureRadius = 500 +end + +captureTime = tonumber(Spring.GetModOptions().capturetime) -- Time to capture a point +if captureTime == nil then + captureTime = 30 +end + +captureBonus = tonumber(Spring.GetModOptions().capturebonus) -- speedup from adding more units +if captureBonus == nil then + captureBonus = 0.05 +else + captureBonus = captureBonus * 0.01 +end + +decapSpeed = tonumber(Spring.GetModOptions().decapspeed) -- speed multiplier for neutralizing an enemy point +if decapSpeed == nil then + decapSpeed = 3 +end + +dominationScore = tonumber(Spring.GetModOptions().dominationscore) +if dominationScore == nil then + dominationScore = 1000 +end + +dominationScoreTime = tonumber(Spring.GetModOptions().dominationscoretime) -- Time needed holding all points to score in multi domination +if dominationScoreTime == nil then + dominationScoreTime = 30 +end + +usemapconfig = Spring.GetModOptions().usemapconfig +if usemapconfig == nil then + usemapconfig = "disabled" +end + +limitScore = tonumber(Spring.GetModOptions().limitscore) +if limitScore == nil then + limitScore = 3500 +end + +-- These are together because they cover the same area (resourcing) +metalPerPoint = tonumber(Spring.GetModOptions().metalperpoint) +if metalPerPoint == nil then + metalPerPoint = 0 +end + +energyPerPoint = tonumber(Spring.GetModOptions().energyperpoint) +if energyPerPoint == nil then + energyPerPoint = 0 +end + +numberOfControlPoints = tonumber(Spring.GetModOptions().numberofcontrolpoints) +if numberOfControlPoints == nil then + numberOfControlPoints = 7 +end + +startTime = tonumber(Spring.GetModOptions().starttime) -- The time when capturing can start +if startTime == nil then + startTime = 180 +end + +tugofWarModifier = tonumber(Spring.GetModOptions().tugofwarmodifier) -- Radius around a point in which to capture it +if tugofWarModifier == nil then + tugofWarModifier = 2 +end \ No newline at end of file diff --git a/LuaRules/Configs/cv_nonCapturingUnits.lua b/LuaRules/Configs/cv_nonCapturingUnits.lua new file mode 100644 index 000000000..d9d54ea88 --- /dev/null +++ b/LuaRules/Configs/cv_nonCapturingUnits.lua @@ -0,0 +1,24 @@ +local nonCapturingUnits = { + "eairengineer", + "efighter", + "efighter_up1", + "efighter_up2", + "efighter_up3", + --"escout", + "egunship2", + "egunship2_up1", + "egunship2_up2", + "egunship2_up3", + "etransport", + "etransport_up1", + "etransport_up2", + "etransport_up3", + "edrone", + "ebomber", + "ebomber_up1", + "ebomber_up2", + "ebomber_up3", + --"escout", +} + +return nonCapturingUnits diff --git a/LuaRules/Configs/death_messages.lua b/LuaRules/Configs/death_messages.lua new file mode 100644 index 000000000..9ed6751f1 --- /dev/null +++ b/LuaRules/Configs/death_messages.lua @@ -0,0 +1,836 @@ +allyTeamDeathMessages = { + --ated + "XX has been obliterated", + "XX has been liquidated", + "XX has been eradicated", + "XX has been terminated", + "XX has been fumigated", + "XX has been castrated", + "XX has been expatriated", + "XX has been annihilated", + "XX has been exterminated", + "XX has been incapacitated", + "XX has been co-immunoprecipitated", + "XX has been deliminated", + "XX has been devastated", + "XX has been dishabilitated", + "XX has been eliminated", + "XX has been annihilated", + "XX has been dominated", + "XX has been deactivated", + "XX has been deprecated", + "XX has been incinerated", + "XX has been decapitated", + "XX has been floccinaucinihilipilificated", + + --ized + "XX has been hospitalized", + "XX has been crystalized", + "XX has been brutalized", + "XX has been caramelized", + "XX has been metabolized", + "XX has been destabilized", + "XX has been immobilized", + "XX has been oxidized", + "XX has been minimized", + "XX has been neutralized", + "XX has been fossilized", + "XX has been vulcanized", + "XX has been exorcized", + "XX has been pulverized", + "XX has been amortized", + "XX has been vaporized", + + --lled + "XX has been steamrolled", + "XX has been levelled", + "XX has been uninstalled", + "XX has been chargrilled", + "XX has been cudgelled", + "XX has been cancelled", + "XX has been anulled", + "XX has been jackrolled", + "XX has been mothballed", + "XX has been bedevilled", + "XX has been expelled", + "XX has been disembowelled", + "XX has been killed", + "XX has been unravelled", + + --oned + "XX has been bludgeoned", + "XX has been unbuttoned", + "XX has been imprisoned", + "XX has been outreasoned", + "XX has been chaperoned", + "XX has been dethroned", + "XX has been harpooned", + "XX has been stoned", + "XX has been poisoned", + "XX has been unreckoned", + "XX has been doggoned", + "XX has been gudgeoned", + "XX has been picarooned", + "XX has been dragooned", + "XX has been pensioned", + "XX has been sectioned", + +} + +teamDeathMessages = { + + "XX was exported to pdf", + "XX suffered an unmitigated disaster", + "XX should have stayed in bed", + "XX has bowed out", + "XX is singing with the choir invisible", + "XX has entered purgatory", + "XX has gone to a better place", + "XX has been shown the door", + "XX exits stage left", + "XX has left the scene", + "XX has gone to robot heaven", + "XX has left the building", + "XX is no longer with us", + "XX lost their mojo", + "XX was unworthy of continued existence", + "XX made like cheap pants, and split", + "XX made like a mankini, and split", + "XX couldn't even handle a few Kites", + "XX has been played out", + "XX has been conquered", + "XX is toast", + "XX is done for", + "XX has succumbed", + "XX was helpless before the onslaught", + "XX has been damaged beyond repair", + "XX has been slain", + "XX was outclassed", + "XX got taken down", + "XX got taken out", + "XX is defeated", + "XX fell short", + "XX fell flat", + "XX fizzled out", + "XX was brought to ruin", + "XX was cut short", + "XX had a major malfunction", + "XX claims they accidentally self-destructed", + "XX failed", + "XX suffered a quantum-phase-inducer-photon-interchange-conduit-warp-resonance-integrity-breach-failure-cascade-pulse", + "XX didn't build enough Generators", + "XX was careless", + "XX has been ousted", + "XX was forfeit", + "XX flatlined", + "XX lost their marbles", + "XX blew a fuse", + "XX has been officially owned", + "XX shall plague the land no more", + "XX spoke softly, but forgot their big stick", + "XX couldn't resist pushing the red button", + "XX was cast down", + "XX lived up to its reputation", + "XX played too much Zero-K", + "XX got whipped", + "XX didn't have the guts", + "XX is at one with the Force", + "XX kicked the bucket", + "XX was snuffed out", + "XX crumbled", + "XX has expired", + "XX bit the dust", + "XX bought the farm", + "XX is pushing up the daisies", + "XX was sent back to their manufacturer", + "XX didn't wear their protective goggles", + "XX fought to the bitter end", + "XX had better things to do", + "XX didn't see that one coming", + "XX will not buy this record, it is scratched", + "XX forgot to check their horoscope", + "XX was resolute to the end", + "XX was rendered inert", + "XX was stomped to a fine paste", + "XX passed its expiration date", + "XX has been discontinued", + "XX crashed out", + "XX forgot to pay their protection money", + "XX got taken to the mattresses", + "XX got whacked", + "XX didn't fully close the microwave", + "XX choked on a gerbil", + "XX got a terminal case of rust", + "XX was converted to nuclear waste", + "XX has been burned for witchery", + "XX was gunned down by angry circus people", + "XX drowned in a toilet", + "XX has been decommissioned", + "XX won't be bothering you anymore, m'ame", + "XX forgot to turn off the gas", + "XX found out baths and toasters don't mix", + "XX was eaten by zombies", + "XX thought the Backstreet Boys are cool", + "XX inspired a new 'Warning' label", + "XX will fight another day", + "XX was defeated, but the soul still burns", + "XX was beamed up", + "XX reached the end of their rope", + "XX checked out", + "XX croaked", + "XX has crossed the great divide", + "XX has been disassembled", + "XX paid the debt we all must pay", + "XX was gibbed", + "XX will go home feet first", + "XX is goin' to a dance pawty wit' Gawd!", + "XX got their just reward", + "XX went on to the bonus round", + "XX is mortally challenged", + "XX lost alignment", + "XX kicked the oxygen habit", + "XX got knocked off", + "XX is living-impaired", + "XX mailed in its warranty card", + "XX has passed on", + "XX got pasted", + "XX is permanently out of print", + "XX needs toner", + "XX pulled the plug", + "XX got smeared", + "XX will sleep with the fishes", + "XX is slowly cooling to room temperature", + "XX took a dirt nap", + "XX was taken out of production", + "XX got toasted", + "XX walked the plank", + "XX is worm food", + "XX met their end", + "XX followed the white rabbit", + "XX is, uh, just resting", + "XX is pining for the fjords", + "XX moved into upper management", + "XX remaindered", + "XX is dead, Jim", + "XX disappeared up its own chutney channel", + "XX left nothing behind", + "XX is deader than a Doodoos dodos", + "XX collapsed like a flan in a cupboard", + "XX is waiting for the worms", + "XX needs medical attention", + "XX needed a sick note", + "XX segfaulted", + "XX exploded", + "XX will be back", + "XX is gone but not forgotten", + "XX needed more beans", + "XX fell into the fiery pits of Mount Doom", + "XX won't be respawning", + "XX is with us in spirit", + "XX rode on into the sunset", + "XX was covered in honey and buried deep underground", + "XX will sleep it off", + "XX passed into folklore", + "XX flit its aged frame", + "XX slipped on a banana skin", + "XX was crushed by a falling piano", + "XX died in a fire", + "XX was uninsured", + "XX believes in resurrection", + "XX was blown up by the vogons", + "XX, I am your father!", + "XX breathed it's last", + "XX should eat more spinach", + "XX went back into the closet", + "XX was too young to die", + "XX is just a small town girl, living in a looonely wooorld", + "XX took a midnight train, going anywhere", + "XX has gone to Amarillo", + "XX is hugging its pillow", + "XX was buried at sea", + "XX lives in a blue house with a blue window", + "XX is looking for answers from the great beyond", + "XX ran out of batteries", + "XX was hung, drawn and quartered", + "XX serves as an example to the rest", + "XX is gone for good", + "XX needs more practice", + "XX is gone with the wind", + "XX did not get U.N. approval", + "XX is buying a stairway to heaven", + "XX is just another brick in the wall", + "XX was drinking whisky and rye, singing ...", + "XX is never going to dance again", + "XX is easy come, easy go", + "XX was loyal to the true emperor, Marcus Aurelius", + "And like that, XX was gone", + "XX passed into the realm of monsters and legends", + "The light still burns for XX, but there is nobody home", + "XX tottered over the brink", + "XX is as real in memory as was in flesh", + "XX should have used the shark repellent bat spray", + "XX lost its life in the line of duty", + "XX. That is all.", + "XX will be sent a receipt", + "XX was just a story", + "XX is in a cold grave, under the deep deep sea", + "XX left behind small sticky traces", + "XX will be restored from a backup", + "Blamelist: XX", + "XX just needed more love", + "XX will be composted", + "XX reached the final frontier", + "XX was a little short for a stormtrooper", + "XX should watch the replay", + "XX phoned home", + "XX was dependent on the kindness of strangers", + "XX dreamed a dream in times gone by", + "XX had a dream", + "XX just didn't want to live any more", + "Houston, XX has a problem", + "XX wasn't in Kansas anymore", + "XX loved the smell of Napalm in the morning", + "Frankly, my dear, XX doesn't give a damn", + "XX sees dead people", + "XX lost its life but not its freedom", + "XX must remember that through all history, truth and love have always won", + "XX passed through nature to eternity", + "XX is dust on the wind", + "XX was ravaged by viking invaders", + "XX was printed on recycled paper", + "XX will be recycled", + "XX is now open to constructive criticism", + "XX has only itself to blame", + "XX will be sent on a training course", + "XX will now describe what went wrong:", + "XX would like to discuss this", + "XX knows what went wrong", + "XX will be reimplemented in lua", + "XX got a special death message", + "XX was swiftly and painlessly destroyed", + "XX had it coming", + "XX needed repair", + "XX needed a resource bonus", + "XX died slowly and painfully", + "XX will be back for Christmas", + "XX went into hibernation", + "XX has been cremated", + "XX was a war hero", + "XX should try playing with both hands", + "XX soiled itself", + "XX went to infinity and beyond", + "XX had everything under control", + "XX went and got itself killed, again", + "XX seems to be dead", + "XX died a hero's death", + "XX is dead as a doornail", + "XX did the Texas cakewalk", + "XX went west, where the sky is blue", + "XX will sleep in the sky", + "XX has gone to meet its maker", + "XX popped its clogs", + "XX fell on its sword", + "XX couldn't stand the heat", + "XX upped it", + "XX is wearing a pine overcoat", + "XX is six foot under", + "XX shuffled off it's mortal coil", + "XX wears pants for no man", + "XX runs from no man", + "XX made the ultimate sacrifice", + "XX went to the big DSD in the sky", + "XX died with its boots on", + "XX answered the final summons", + "XX went beyond the veil", + "XX came to a sticky end", + "XX fell off its perch", + "XX is just resting after a long squawk", + "XX is stone dead", + "XX was cut out in little stars", + "XX got slippered", + "XX got bitten by zombies", + "XX was abducted by martians and internally probed", + "XX was stomped on by angry kangaroos", + "XX ran out of antibiotics", + "XX needed tighter financial regulation", + "XX curled up and died", + "XX has been dismantled", + "XX was sent back for repairs", + "XX was reduced to rubble", + "XX is writing its memoirs", + "XX is out cold", + "XX was hit for six", + "XX reached pensionable age", + "XX should try performance enhancing supplements", + "XX fell off its horse", + "XX was tarred and feathered", + "XX was an evolutionary dead end", + "XX went down faster than the Titanic", + "XX was hunted to extinction", + "XX was ground up and fed to cattle", + "XX was not fit for further existence", + "XX has been scraped off the bottom of the barrel", + "XX is dancing in the rain", + "XX won't cause any more trouble", + "XX entered into a permanent economic downturn", + "XX was stretchered off the battlefield", + "XX lived fast and died young", + "XX will see you in Hell", + "XX ran out of steam", + "XX was put out to pasture", + "XX was sent on gardening leave", + "XX took early retirement", + "XX got a red card", + "XX tested positive for banned substances", + "XX got taken up the Khyber pass", + "XX left its heart in San Francisco", + "XX willll alwayyyys love yooouuuu", + "XX won't look back in anger", + "XX was way past its bedtime", + "XX was torn down to make way for overflow parking", + "XX has been sent to the recycle bin", + "XX has no need of further assistance", + "XX died of plague", + "XX went the way of the dinosaurs", + "XX was torn to shreds", + "Come in XX, your time is up", + "XX was walking in the air", + "XX was destroyed in a fire", + "XX needed better nourishment", + "XX rode away in a chariot of fire", + "XX faced the final curtain", + "XX reached the bottom of the bottle", + "The greatest trick XX ever played was convincing the world it didn't exist", + "XX got torn apart by rabid pumas", + "XX was retired from active service", + "XX longs for peace and harmony", + "Warning: Do not try XX at home", + "XX was covered with tuna and thrown into a pit of hungry kittens", + "XX got trampled by cows", + "XX died from a combination of indigestion and uncontrollable laughter", + "XX has an advanced case of Boogie Fever", + "XX was crushed under a falling sequoia", + "XX was optimized out by the compiler", + "XX was pecked to death by cassowarys", + "XX was struck by a falling coconut", + "XX was felled by a beaver", + "XX was sawn in half by an inexperienced magician", + "XX fell off a ladder", + "XX discovered the perils of mortality", + "XX will always have Paris", + "Hasta la vista, XX", + "XX knows ever'thing there is to know 'bout the shrimpin' bidness", + "XX did that on purpose", + "XX lived by the sword and got shot", + "XX is electroencephalographically challenged", + "XX is diagonally parked in a parallel universe", + "XX left its body to science", + "XX ate a hostess cake and got the cream filling", + "XX got man gravy all over its panty biscuits", + "XX has a magic wand up its Harry Potter", + "XX was poisoned, shot in the head, bludgeoned, castrated and then thrown into a river", + "XX drowned in molasses", + "XX was struck by a flying lawnmower", + "XX got buttered", + "XX surrendered its mysteries to Zoidberg", + "XX should have read the manual", + "XX got killed by creepers", + "Sweet dreams are made of XX", + "XX can see St Peter waving", + "XX came from the stairhead, bearing a bowl of lather", + "XX was loose stool water", + "XX was handcuffed, blindfolded and fired into the sun", + "XX has been broken down and sold for scrap", + "XX picked the wrong faction", + "XX laboured against its own cure", + "XX was wrapped in bandages, soaked in brandy and burned alive", + "XX did not expect the Spanish Inquisition", + "XX fell overboard", + "XX was killed by a falling tortoise", + "XX jumped into a volcano", + "XX fell into a bath of flouroantimonic acid", + "XX didn't pass quality control", + "XX couldn't counter the five-point-palm-exploding-heart technique", + "XX flew a kite in a thunderstorm", + "XX built its house on sand", + "The big bad wolf huffed and he puffed and he blew XX away", + "XX was reserved for the majority leader and his designee", + "XX was swept over the great waterfall at the end of the world", + "XX can now be crossed off the list of endangered species", + "XX had a banking collapse", + "XX was taken away in a van", + "XX set its Thetan free", + "XX felt the wrath of Kanayamahiko", + "XX was destroyed with fire and brimstone", + "XX went to a placid island of ignorance in the midst of the black seas of infinity", + "XX felt the call of Cthulhu", + "XX was eaten by the very hungry caterpillar", + "XX lacked the will of the warrior", + "XX has lost its sheep and doesn't know where to find them", + "XX followed a trail of candy into the deep dark forest", + "XX fell down a disused mineshaft", + "XX was struck by an iceberg", + "XX went up the brown coloured creek and merrily discarded its one and only paddle", + "XX was collapsed to a point by the Ricci flow", + "XX converged to minus infinity", + "XX was not uniformly integrable", + "XX failed the Weierstrass M-test", + "XX was one egg short of a dozen", + "XX needed more hamsters", + "XX needed to build more parks and raise taxes", + "XX got tasered", + "XX tried to cross the Ford river and its oxen died", + "XX put the 'grrr' into swinger baby! Yeah!", + "XX was travelling through Dallas in an open-topped limousine", + "XX had a beef train shunted into its tuna station", + "XX is a lumberjack and he's ok", + "XX got rogered by a Hippo", + "XX should have taken the blue pill", + "XX will be placed in solitary confinement", + "XX would like some sodium thiopental, please", + "XX impaled itself on a curling iron", + "XX fell into a vat of steaming porridge", + "XX was wearing the wrong trousers", + "XX took a long walk on a short pier", + "All the King's horses and all the King's men couldn't put XX together again", + "XX got ketchup on its fur burger", + "XX couldn't keep its pecker up", + "XX wants to be a man, mancub", + "XX fell into a vat of toxic waste", + "XX wore a spacesuit filled with angry bees", + "XX was smashed up by a sonically created power yeti", + "XX fell into a wood-chipper", + "XX accidentally turned a children's book into three three-hour-long movies", + "It is pitch black. XX was eaten by a grue.", + "XX ate all the pies", + "XX trod on a mine", + "XX was relieved of its duty", + "XX went permanently afk", + "XX did it in the library with Colonel Mustard", + "XX will be donated to charity", + "XX was struck by a projectile cowpat", + "XX fell into a crevasse", + "XX was cut into small pieces and encased in concrete", + "XX flew low over power lines", + "XX fell down a rabbit hole", + "XX got its meat skewer stuck in a toaster", + "XX got slapped around with a large peewee", + "XX was reclassified as an apology", + "XX turned into a pumpkin and two mice", + "XX sat around eating risotto and drinking Chateau du Chasselas", + "XX solemnly promises never to do that again", + "XX will be put in a cat-basket and sent to the edge of the universe", + "XX wagged its tail and rang the bell", + "The part of XX was played by Sean Bean", + "XX needs new underwear", + "XX did a whoopsie", + "Once again, the devil vomits in XX's kettle", + "XX was wetter than a haddock's bathing costume", + "XX wants to be Switzerland next time", + "XX was clobbered around the ears with some old slippers", + "XX needs more air in its tyres", + "XX needs to be turned off and on again", + "XX took its toy back to the carpet", + "XX tossed its cookies", + "XX got its badoodle stuck in a cord-wangler", + "XX was shaken, not stirred", + "XX danced with the devil in the pale moonlight", + "XX sucked all the marrow out and choked on the bone", + "XX needed a vacation", + "XX was a smelly pirate hooker", + "XX loved lamp", + "XX was not so think as you drunk I am", + "XX flew the blue lady of the skies into the sunset", + "XX opened the pod bay doors", + "Here's looking at you, XX", + "XX found a cause worth dying for", + "XX can check out any time it likes but it can never leave", + "XX didn't last forever, like cold November rain", + "XX's heart will go onnnn annnd onnnnn", + "XX was a cold and broken Hallelujah", + "XX kissed the sky", + "XX thought it could tell blue skies from pain", + "XX would rather be a hammer than a nail", + "XX was on a whiskey diet", + "XX was full of misery, loneliness and suffering - and it's all over much too soon", + "XX is not the messiah, XX is a very naughty boy!", + "Do, or do not. There is no XX!", + "XX did not waste its last days trying to prolong them", + "Once XX has been eliminated, the remainder, however improbable, must be the truth", + "XX should stop posting naked pictures of itself on the internet", + "XX dug a hole and jumped into it", + "XX flew a commercial aeroplane into a tall building", + "XX went over the Niagara Falls in a steamboat", + "XX was eaten by a hungry streptococcus", + "XX was first against the wall when the revolution came", + "XX lost its flower at the tender age of fifteen", + "XX contained traces of horse DNA", + "XX expected, got nil", + "XX put its pants on its head and stuck two pencils up its nose", + "XX will be returned to sender", + "XX donated itself to charity", + "XX came. XX saw. XX died really horribly.", + "XX bought the farm, a country house, stables, an outdoor toilet, tree-lined driveway and half of Wiltshire.", + "XX played chess with the grim reaper and came second", + "The fat lady finished singing for XX and went home", + "XX found that death was only a lesson in ones own limitations", + "XX entered into the afterlife of recrimination", + "XX is a nullptr", + "XX suffered a fate worse than a fate worse than death", + "XX will spend the rest of the war teaching home economics", + "XX needs to re-install Windows", + "XX ran out of juice", + "Why does it always rain on XX?", + "XX was pushing an elephant up the stairs", + "XX wouldn't believe its wireless radio", + "XX looked back in anger", + "XX lives in a house, a very big house in the country", + "XX was the story of a charmless man", + "XX ran to the hills", + "XX is just a teenage dirtbag, baby", + "XX claims it had the sun in its eyes", + "XX took off its gloves and walked slowly back to the pavilion", + "XX took a headbutt to the groin", + "XX was shut down by the authorities", + "XX killed Kenny", + "XX was a failed experiment in gene therapy", + "XX was a waste of time, space, oxygen and fuel", + "XX ate its last waterbiscuit", + "XX was torn apart by angry weasels", + "XX didn't want to play this silly game anyway", + "There's a XX, waiting in the sky", + "Ground control to XX: your circuits gone, there's something wrong", + "XX put Basil in the ratatouille", + "XX was duck without orange or cherries", + "XX rubbed itself out", + "XX was a highway to the danger zone", + "XX put out on the first date", + "XX plunged into a canyon", + "XX would like to know how to rotate buildings", + "XX needs more cowbell", + "XX has a mouse but it doesn't have a house", + "XX went down in a blaze of glory", + "XX needs some tissues", + "XX could make a fortune just laying on its back", + "XX was sent to landfill", + "XX is biodegradable", + "XX fell off its ninja rope into the water", + "XX is a bell end", + "XX will be court-martialled for this", + "XX was jellied", + "XX believes in angels", + "XX was evicted from the Big Brother household", + "XX was the weakest link, goodbye", + "XX remembered it was a womble", + "XX was struck by the dreaded batter pudding hurler of Bexhill-on-sea", + "XX was punched up the conk", + "XX has the Spon Plague", + "XX did a barrel roll", + "XX was ridden by the valkyries", + "XX was dropped into a pit of boiling tar", + "XX spent too long standing under a loose stalactite", + "XX was guillotined", + "XX ate too many Easter eggs", + "XX got whopped", + "XX was covered in barbecue sauce and served up at a Hillybilly Ho-down", + "XX violated GPL", + "XX had a God delusion", + "XX had a mid-life crisis", + "XX will be put up for auction", + "XX has pneumonoultramicroscopicsilicovolcanoconiosis", + "XX is having lobster thermidor aux crevettes, with a mornay sauce garnished with truffle pate, brandy and a fried egg on top and spam", + "XX died while balls deep in a squealing hog, firing a shotgun into the air", + "XX will clean up the chunks of dead prostitute", + "XX acted out one too many lumberjack fantasies", + "XX drowned in a pool of childrens tears", + "XX was too busy perming its ears", + "XX jumped under a fleet of oncoming buses", + "XX painted matchstalk men and matchstalk cats and dogs", + "XX went the same way as FPS mode", + "XX didn't control the spice, or the dune", + "Thank you XX! But our Princess is in another castle!", + "The right XX in the wrong place can make all the difference in the world", + "Boomshakalaka!", + "XX is the second biggest monkey head I have ever seen!", + "XX must construct additional pylons", + "XX reticulated its spline", + "All your XX are belong to us", + "XX was almost a Jill sandwich", + "XX prepared for unforeseen consequences", + "XX was all outta gum", + "Give it to XX baby, uhuh, uhuh", + "XX cannot DGun inside an enemy startbox", + "A problem has been detected and XX has been shut down to prevent damage to your computer", + "Shoot all the blue jays you want, if you can hit em, but remember that it's a sin to kill a XX", + "XX is no hot-house flower, but a wild plant, born of a wet night, born of an hour of sunshine", + "XX ran with scissors", + "XX screamed in agony as the potato slid deeper", + "XX left behind a small damp patch", + "XX had its clock cleaned", + "XX tossed its caber", + "XX gave its dog a bone", + "XX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE", + "How to rotate XX?", + "The name's XX, James XX", + "XX claims it was shooting blanks", + "XX stole Christmas", + "XX sniffed too many Naegleria Fowleri", + "XX was mauled by rabid badgers", + "XX had its face melted", + "XX talked about Fight Club", + "XX stopped worrying and loved the bomb", + "XX said hello to my little friend", + "XX coulda had class, coulda been a contender, coulda been somebody", + "XX will never let go, Jack", + "Let's talk about XX", + "XX flew home in a wooden box", + "XX don't need no stinking badges!", + "XX is like a box of chocolates", + "XX hopped on the last rattler", + "XX joined the great majority", + "XX pegged out", + "XX rode the pale horse", + "XX went Tango Uniform", + "XX took the last train to glory", + "XX went bung", + "XX wrote its own lobby protocol", + "XX went pear shaped", + "XX went arse over elbow", + "XX had a knuckle sandwich", + "XX was made redundant", + "XX was snookered", + "XX went to see a man about a dog", + "XX only lived once", + "XX sank without trace", + "XX smoked its kipper", + "XX got its coat", + "XX mailed itself home", + "XX assumed responsibility", + "XX answered the final call", + "XX basted the formaldehyde turkey", + "XX lay down under the cement tree", + "XX climbed the golden stairs", + "XX crossed the Styx", + "XX curled up its toes", + "XX sowed the Elysian fields", + "XX hopped its twig", + "XX went to the necrophiliac singles bar", + "XX picked up its harp", + "XX had a retroactive abortion", + "XX was struck out by the big blue pencil", + "XX was declared insolvent", + "XX don't kill people, wabbits do", + "XX destroyed its own evidence", + "XX was rejected with resubmission", + "XX obtained a compensated pass", + "XX has just been erased", + "XX has had it with these motherf***king snakes on this motherf***king plane", + "XX bet on black", + "XX ain't got time to bleed", + "XX filled its hands", + "XX took Senator Trent to the bloody bank", + "XX called this a knife", + "XX thanked Bluestone", + "XX ate its vegetables", + "Let's face it, this is not the worst thing you've caught XX doing", + "XX made its contribution to birth control", + "XX was discharged", + "XX was terminated", + "XX was fresh out of Chlorine", + "XX is just gonna stand there and bleed", + "XX democratically voted against paying its own debts", + "XX took its final shower", + "XX turned over to the dark side", + "XX can into relevance", + "XX was fifty shades of fucked-up, Anastasia", + "XX was a bright cold day in April", + "XX was a queer, sultry summer", + "XX, light of my life, fear of my loins", + "XX was eloquently, lovingly and pugnaciously drunk", + "XX was one of the reasons the Chinese never invented custard", + "XX used to be Snow White", + "XX should have built more advanced fusion reactors", + "XX fell asleep in the bath", + "XX accidentally shot down a civilian airliner", + "XX ran itself over", + "XX got bottled", + "XX dug its own grave", + "XX can has pototoes for its obey", + "XX dribbled its way to oblivion", + "XX was the last Mohican", + "XX lived in the gaps between the stories", + "XX watches the slow dance of the infinite stars", + "XX wants to hear Toot Toot Tootsie", + "XX was Spartacus", + "Mrs Robinson you're trying to seduce XX, aren't you?", + "XX is not bad, just drawn that way", + "XX took to the skies", + "XX retired hurt", + "XX paid $1.35m for work carried out nine years ago under an oral contract, and was banned from all related activity for eight years", + "XX is the president of everybody", + "XX was a fixed function pipeline", + "XX has a ticket to the moon", + "XX slipped through the hourglass", + "XX violated Turkish airspace", + "XX was nine sheets to the wind", + "XX saw its last sunrise", + "XX got battered", + "XX stole Christmas", + "XX was just faking", + "XX really tied the room together", + "XX put Baby in a corner", + "XX used Subionic's script", + "XX played it cool", + "XX never meant any of this", + "XX devaluated", + "XX made mistakes", + "XX looked the other way", + "XX doesn't agree with the balance", + "XX was fatefull", + "XX doesn't accept reality", + "XX doesn't accept virtual reality", + "XX storms out", + "XX hit by a turtle when it was small", + "XX didn't build enough A.Fus.", + "XX had parachute failure", + "XX thought it was superman and jumped from a high place", + "XX killed John Wick's dog", + "XX teched in 1v1", + "XX tried so hard and got so far but in the end it doesn't even matter", + "XX should have used its brain", + "XX committed suicide", + "XX wasted its last hour to play Balanced Annihilation", + "XX will rest in peace", + "XX cut wrong cable of bomb", + "XX killed by Bugs Bunny in XX season", + "XX spent its ninth live", + "XX tried to swim in lava", + "XX has converted by an enemy monk", + "XX rushed enemy with villagers", + "XX ate mint candy over diet cola", + "XX was at wrong place in wrong time", + "XX slept on rails", + "XX was at World Trade Center", + "XX tried to get into Area 51", + "XX kidnapped by aliens", + "XX doesn't drink coffee it takes tea my dear", + "We will see XX in another life. In heaven where we never say goodbye.", + "XX didn't check the road before crossing", + "XX couldn't wake up from its last sleep", + "XX slept with the fishes", + "More tea XX?", + "XX didn't forgive itself", + "XX killed by grievers", + "And The Loser of the Year Award goes to XX!", + "All the pain XX had is ended", + "XX wanted to do like Bear Grylls but failed tragically", + "XX got its bungee cord broken", + "Fossils of XX has found in a 1 million year old rock", +} + + + + + + + diff --git a/LuaRules/Configs/icon_generator.lua b/LuaRules/Configs/icon_generator.lua index 046d70685..6fe3dfac2 100644 --- a/LuaRules/Configs/icon_generator.lua +++ b/LuaRules/Configs/icon_generator.lua @@ -188,7 +188,7 @@ backgrounds = { --//empty := empty model (used for fake units in CA) --//attempts := number of tries to scale the model to fit in the icon -defaults = {border=0.05, angle=45, rot="right", clamp=-10000, scale=2, empty=false, attempts=10, wait=300, zoom=1.0, offset={0,0,0},}; +defaults = {border=0.05, angle=30, rot="right", clamp=-10000, scale=2, empty=false, attempts=10, wait=300, zoom=1.0, offset={0,0,0},}; ----------------------------------------------------------------------- diff --git a/LuaRules/Configs/lups_napalm_fxs.lua b/LuaRules/Configs/lups_napalm_fxs.lua new file mode 100644 index 000000000..1d733f274 --- /dev/null +++ b/LuaRules/Configs/lups_napalm_fxs.lua @@ -0,0 +1,120 @@ +local napalm = { + default = { + colormap = { {0, 0, 0, 0.01}, {0.75, 0.75, 0.9, 0.02}, {0.45, 0.2, 0.3, 0.1}, {0.4, 0.16, 0.1, 0.12}, {0.3, 0.15, 0.01, 0.15}, {0.3, 0.15, 0.01, 0.15}, {0.3, 0.15, 0.01, 0.15}, {0.1, 0.035, 0.01, 0.15}, {0, 0, 0, 0.01} }, + count = 4, + life = 175, + lifeSpread = 40, + delay = 0, + delaySpread = 0, + emitVector = {0,1,0}, + emitRotSpread = 90, + force = {0,0.3,0}, + + partpos = "r*sin(alpha),0,r*cos(alpha) | r=rand()*15, alpha=rand()*2*pi", + + rotSpeed = 0.25, + rotSpeedSpread = -0.5, + rotSpread = 360, + rotExp = 1.5, + + speed = 0.225, + speedSpread = 0.05, + speedExp = 7, + + size = 40, + sizeSpread = 10, + sizeGrowth = 0.15, + sizeExp = 2.5, + + layer = 1, + texture = "bitmaps/GPL/flame.png", + }, + firewalker = { + count = 400, + partpos = "r*sin(alpha),-60+2*r,r*cos(alpha) | r=rand()*75, alpha=rand()*2*pi", + delay = 0, + delaySpread = 390, + }, +} +local heat = { + default = { + count = 1, + emitVector = {0,1,0}, + emitRotSpread = 60, + force = {0,0.5,0}, + + life = 270, + lifeSpread = 70, + + speed = 0.25, + speedSpread = 0.25, + speedExp = 7, + + size = 100, + sizeSpread = 40, + sizeGrowth = 0.3, + sizeExp = 2.5, + + strength = 0.75, + scale = 5.0, + animSpeed = 0.25, + heat = 6.5, + + texture = 'bitmaps/GPL/Lups/mynoise2.png', + }, + firewalker = { + life = 1600, + size = 350, + lifeSpread = 300, + speed = 0.025, + speedSpread = 0.01, + sizeGrowth = 0.06, + }, +} + + + +local function CopyTable(tableToCopy, deep) + local copy = {} + for key, value in pairs(tableToCopy) do + if (deep and type(value) == "table") then + copy[key] = CopyTable(value, true) + else + copy[key] = value + end + end + return copy +end + + +local function MergeTable(primary, secondary, deep) + local new = CopyTable(primary, deep) + for i, v in pairs(secondary) do + -- key not used in primary, assign it the value at same key in secondary + if not new[i] then + if (deep and type(v) == "table") then + new[i] = CopyTable(v, true) + else + new[i] = v + end + -- values at key in both primary and secondary are tables, merge those + elseif type(new[i]) == "table" and type(v) == "table" then + new[i] = MergeTable(new[i], v, deep) + end + end + return new +end + + +for name,def in pairs(napalm) do + if name ~= "default" then + napalm[name] = MergeTable(def,napalm.default,true) + end +end +for name,def in pairs(heat) do + if name ~= "default" then + heat[name] = MergeTable(def,heat.default,true) + end +end + +return napalm, heat diff --git a/LuaRules/Configs/lups_projectile_fxs.lua b/LuaRules/Configs/lups_projectile_fxs.lua new file mode 100644 index 000000000..605dc645c --- /dev/null +++ b/LuaRules/Configs/lups_projectile_fxs.lua @@ -0,0 +1,109 @@ + +local fx = { + flame_heat = { + class = 'JitterParticles2', + colormap = { {1,1,1,1},{1,1,1,1} }, + count = 6, + life = 24, + delaySpread = 25, + force = {0,1.5,0}, + --forceExp = 0.2, + + emitRotSpread= 10, + + speed = 10, + speedSpread = 0, + speedExp = 1.5, + + size = 15, + sizeGrowth = 5.0, + + scale = 1.5, + strength = 1.0, + heat = 2, + }, + + flame1 = { + class = 'SimpleParticles2', + colormap = { {1, 1, 1, 0.01}, + {1, 1, 1, 0.01}, + {0.75, 0.5, 0.5, 0.01}, + {0.35, 0.15, 0.15, 0.25}, + {0.1, 0.035, 0.01, 0.2}, + {0, 0, 0, 0.01} }, + count = 4, + life = 24, + delaySpread = 25, + + force = {0,1,0}, + --forceExp = 0.2, + + emitRotSpread= 8, + + rotSpeed = 1, + rotSpread = 360, + rotExp = 9, + + --speed = 10, + --speedSpread = 0, + --speedExp = 1.5, + + size = 2, + sizeGrowth = 4.0, + sizeExp = 0.7, + + --texture = "bitmaps/smoke/smoke06.tga", + texture = altFlameTexture and "bitmaps/GPL/flame_alt.png" or "bitmaps/GPL/flame.png", + }, + + flame2 = { + class = 'SimpleParticles2', + colormap = { {1, 1, 1, 0.01}, {0, 0, 0, 0.01} }, + count = 20, + --delay = 20, + life = 6, + lifeSpread = 20, + delaySpread = 15, + + force = {0,1,0}, + --forceExp = 0.2, + + emitRotSpread= 3, + + rotSpeed = 1, + rotSpread = 360, + rotExp = 9, + + --speed = 10, + --speedSpread = 0, + + size = 2, + sizeGrowth = 4.0, + sizeExp = 0.65, + + --texture = "bitmaps/smoke/smoke06.tga", + texture = altFlameTexture and "bitmaps/GPL/flame_alt.png" or "bitmaps/GPL/flame.png", + }, +} + + +local tbl = { + --[[ + corpyro_flamethrower = { + {class = "JitterParticles2", options = fx.flame_heat}, + {class = "SimpleParticles2", options = fx.flame1}, + {class = "SimpleParticles2", options = fx.flame2}, + }, + ]]-- +} +local tbl2 = {} + +for weaponName, data in pairs(tbl) do + local weaponDef = WeaponDefNames[weaponName] or {} + local weaponID = weaponDef.id + if weaponID then + tbl2[weaponID] = data + end +end + +return tbl2 diff --git a/LuaRules/Configs/lups_shield_fxs.lua b/LuaRules/Configs/lups_shield_fxs.lua new file mode 100644 index 000000000..7629edfea --- /dev/null +++ b/LuaRules/Configs/lups_shield_fxs.lua @@ -0,0 +1,100 @@ +local ShieldSphereBase = { + layer = -34, + life = 10000, + size = 350, + radius = 350, + colormap1 = {{0.1, 0.1, 1, 0.1}, {1, 0.1, 0.1, 0.05}}, + colormap2 = {{0.2, 0.9, 1, 0.0}, {1, 0.9, 0.2, 0.0}}, + repeatEffect = true, + drawBack = 0.7, +} + +local SEARCH_SMALL = { + {0, 0}, + {1, 0}, + {-1, 0}, + {0, 1}, + {0, -1}, +} + +local SEARCH_MULT = 1 +local SEARCH_BASE = 16 +local DIAG = 1/math.sqrt(2) + +local SEARCH_LARGE = { + {0, 0}, + {1, 0}, + {-1, 0}, + {0, 1}, + {0, -1}, + {DIAG, DIAG}, + {-DIAG, DIAG}, + {DIAG, -DIAG}, + {-DIAG, -DIAG}, +} +local searchSizes = {} + +local shieldUnitDefs = {} +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + + if ud.customParams.shield_radius then + local radius = tonumber(ud.customParams.shield_radius) + Spring.Echo(ud.name, radius) + if not searchSizes[radius] then + local searchType = (radius > 250 and SEARCH_LARGE) or SEARCH_SMALL + local search = {} + for i = 1, #searchType do + search[i] = {SEARCH_MULT*(radius + SEARCH_BASE)*searchType[i][1], SEARCH_MULT*(radius + SEARCH_BASE)*searchType[i][2]} + end + searchSizes[radius] = search + end + + local myShield = Spring.Utilities.CopyTable(ShieldSphereBase, true) + if radius > 250 then + myShield.shieldSize = "large" + myShield.drawBack = 0.6 + myShield.drawBackMargin = 3 + myShield.margin = 1.35 + myShield.hitResposeMult = 0.6 + myShield.colormap1[1][4] = 0.1 + myShield.colormap1[2][4] = 0.1 + else + myShield.shieldSize = "small" + myShield.drawBack = 0.9 + myShield.drawBackMargin = 1.9 + myShield.margin = 1.2 + myShield.colormap1[1][4] = 0.22 + myShield.colormap1[2][4] = 0.22 + myShield.hitResposeMult = 1 + end + myShield.size = radius + myShield.radius = radius + myShield.pos = {0, tonumber(ud.customParams.shield_emit_height) or 0, tonumber(ud.customParams.shield_emit_offset) or 0} + + local strengthMult = tonumber(ud.customParams.shield_color_mult) + if strengthMult then + myShield.colormap1[1][4] = strengthMult*myShield.colormap1[1][4] + myShield.colormap1[2][4] = strengthMult*myShield.colormap1[2][4] + end + + local fxTable = { + {class = 'ShieldSphereColor', options = myShield}, + } + + if string.find(ud.name, "chicken_") then + myShield.colormap1 = {{0.3, 0.9, 0.2, 1.2}, {0.6, 0.4, 0.1, 1.2}} -- Note that alpha is multiplied by 0.26 + myShield.hitResposeMult = 0 + myShield.texture = "bitmaps/GPL/bubbleShield.png" + fxTable[1].class = "ShieldSphereColorFallback" + end + + shieldUnitDefs[unitDefID] = { + fx = fxTable, + search = searchSizes[radius], + shieldCapacity = tonumber(ud.customParams.shield_power), + } + end +end + +return shieldUnitDefs diff --git a/LuaRules/Configs/morph_defs.lua b/LuaRules/Configs/morph_defs.lua deleted file mode 100644 index 18c5209db..000000000 --- a/LuaRules/Configs/morph_defs.lua +++ /dev/null @@ -1,46 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -local devolution = (-1 > 0) - - -local morphDefs = { - - -- Constructors - - esubplane = { - into = 'esubmarine', - tech = 0, - time = 0, - }, - esubmarine = { - into = 'esubplane', - tech = 0, - time = 0, - }, -} - --- --- Here's an example of why active configuration --- scripts are better then static TDF files... --- - --- --- devolution, babe (useful for testing) --- -if (devolution) then - local devoDefs = {} - for src,data in pairs(morphDefs) do - devoDefs[data.into] = { into = src, time = 10, metal = 1, energy = 1 } - end - for src,data in pairs(devoDefs) do - morphDefs[src] = data - end -end - - -return morphDefs - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Configs/spawn_defs.lua b/LuaRules/Configs/spawn_defs.lua new file mode 100644 index 000000000..e4b70bd55 --- /dev/null +++ b/LuaRules/Configs/spawn_defs.lua @@ -0,0 +1,422 @@ +queenChoice = Spring.GetModOptions().mo_queendifficulty or "automatic" +Spring.Echo(queenChoice) +if queenChoice == "automatic" or queenChoice == nil then + local teams = Spring.GetTeamList() + for i =1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI == "Chicken: Very Easy" then + queenName = "ve_chickenq" + elseif luaAI == "Chicken: Easy" then + queenName = "e_chickenq" + elseif luaAI == "Chicken: Normal" then + queenName = "n_chickenq" + elseif luaAI == "Chicken: Hard" then + queenName = "h_chickenq" + elseif luaAI == "Chicken: Very Hard" then + queenName = "vh_chickenq" + elseif luaAI == "Chicken: Epic!" then + queenName = "epic_chickenq" + elseif luaAI == "Chicken: Custom" then + queenName = "n_chickenq" + elseif luaAI == "Chicken: Survival" then + queenName = "n_chickenq" + end + end +else + queenName = Spring.GetModOptions().mo_queendifficulty or "n_chickenq" +end + +Spring.Echo(queenName) + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +maxChicken = tonumber(Spring.GetModOptions().mo_maxchicken) or 400 +maxBurrows = 20 +gracePeriod = tonumber(Spring.GetModOptions().mo_graceperiod) or 160 -- no chicken spawn in this period, seconds +queenTime = (Spring.GetModOptions().mo_queentime or 40) * 60 -- time at which the queen appears, seconds +addQueenAnger = tonumber(Spring.GetModOptions().mo_queenanger) or 1 +burrowSpawnType = Spring.GetModOptions().mo_chickenstart or "avoid" +spawnSquare = 90 -- size of the chicken spawn square centered on the burrow +spawnSquareIncrement = 2 -- square size increase for each unit spawned +burrowName = "roost" -- burrow unit name +maxAge = 300 -- default chicken die at this age, seconds +burrowDef = UnitDefNames[burrowName].id +defenderChance = 0.375 -- probability of spawning a single turret +maxTurrets = 3 -- Max Turrets per burrow +queenSpawnMult = 1 -- how many times bigger is a queen hatch than a normal burrow hatch +burrowSpawnRate = 60 +chickenSpawnRate = 59 +minBaseDistance = 600 +maxBaseDistance = 7200 +chickensPerPlayer = 8 +spawnChance = 0.5 +bonusTurret = "chickend1" -- Turret that gets spawned when a burrow dies +angerBonus = 0.25 +expStep = 0.0625 +lobberEMPTime = 4 +damageMod = 1 +waves = {} +newWaveSquad = {} + +maxAges = {} +maxAges["chicken1"] = 240 +maxAges["chicken1b"] = 240 +maxAges["chicken1c"] = 240 +maxAges["chicken_dodo1"] = 120 +maxAges["chicken_dodo2"] = 120 +maxAges["chickena2"] = 500 +maxAges["chickena2b"] = 500 +maxAges["chickenh4"] = 120 +maxAges["chickenh1"] = 240 +maxAges["chickenh1b"] = 200 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function Copy(original) + local copy = {} + for k, v in pairs(original) do + if (type(v) == "table") then + copy[k] = Copy(v) + else + copy[k] = v + end + end + return copy +end + +local function addWave(wave, unitList) + if not waves[wave] then waves[wave] = {} end + table.insert(waves[wave], unitList) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local chickenTypes = { + ve_chickenq = true, + e_chickenq = true, + n_chickenq = true, + h_chickenq = true, + vh_chickenq = true, + epic_chickenq = true, + chicken1 = true, + chicken1b = true, + chicken1c = true, + chicken1d = true, + chicken1x = true, + chicken1y = true, + chicken1z = true, + chicken2 = true, + chicken2b = true, + chickena1 = true, + chickena1b = true, + chickena1c = true, + chickena2 = true, + chickena2b = true, + chickens1 = true, + chickens2 = true, + chicken_dodo1 = true, + chicken_dodo2 = true, + chickenf1 = true, + chickenf1b = true, + chickenf2 = true, + chickenc1 = true, + chickenc2 = true, + chickenc3 = true, + chickenc3b = true, + chickenc3c = true, + chickenr1 = true, + chickenr2 = true, + chickenr3 = true, + chickenh1 = true, + chickenh1b = true, + chickenh2 = true, + chickenh3 = true, + chickenh4 = true, + chickenh5 = true, + chickenw1 = true, + chickenw1b = true, + chickenw1c = true, + chickenw1d = true, + chickenw2 = true, + chickens3 = true, + chickenp1 = true, +} + +local defenders = { + chickend1 = true, +} + +addWave(1,{"3 chicken1"}) +addWave(1,{"3 chicken1c"}) +addWave(1,{"1 chicken1", "1 chicken1b", "1 chicken1c", "1 chickenh1"}) +addWave(1,{"1 chicken1", "1 chicken1b", "1 chicken1c", "1 chicken1d"}) +addWave(1,{"3 chicken1d", "1 chickenh1"}) +addWave(1,{"1 chicken1", "1 chicken1b", "1 chicken1c", "1 chicken1d"}) +addWave(1,{"2 chicken1b", "1 chickenh1b"}) +addWave(1,{"2 chicken1c", "1 chickena1"}) + +newWaveSquad[2] = {"7 chicken1", "6 chicken1b", "5 chicken1c", "4 chicken1d"} +addWave(2,{"5 chicken1", "4 chicken1b", "3 chicken1c", "2 chicken1d"}) +addWave(2,{"2 chicken1", "3 chicken1b", "4 chicken1c", "5 chicken1d"}) +addWave(2,{"3 chicken1", "3 chicken1b", "3 chicken1c", "3 chicken1d"}) +addWave(2,{"1 chicken1x", "1 chicken1y", "1 chicken1z"}) +addWave(2,{"5 chicken1b", "1 chickenf2"}) +addWave(2,{"6 chicken1c"}) +addWave(2,{"3 chicken1", "1 chickena1b", "1 chickenh1"}) +addWave(2,{"1 chickena1", "1 chickena1c", "1 chickenw1b"}) +addWave(2,{"1 chickena1b", "1 chickena1c", "1 chickenw1", "1 chickens1"}) +addWave(2,{"4 chicken1d", "1 chickens1"}) +addWave(2,{"4 chicken1", "1 chickena1"}) +addWave(2,{"3 chicken1", "1 chickenh1", "1 chickenh1b"}) + +newWaveSquad[3] = {"7 chicken1", "8 chicken1b", "9 chicken1c", "10 chicken1d"} +addWave(3,{"1 chickena1", "2 chickena1b", "1 chickena1c", "2 chickenh1"}) +addWave(3,{"1 chickena1", "1 chickena1b", "2 chickena1c"}) +addWave(3,{"1 chickena1", "1 chickena1b", "1 chickena1c", "1 chickenc3"}) +addWave(3,{"1 chickenc3", "1 chickenc3b", "1 chickenc3c", "2 chicken1"}) +addWave(3,{"1 chickena1", "1 chickena1b", "1 chickens1", "1 chicken1x", "1 chicken1y", "1 chicken1z"}) +addWave(3,{"1 chickena1b", "1 chickena1c", "1 chickenh1", "1 chickenh1b", "3 chicken1b"}) +addWave(3,{"1 chickena1", "1 chickena1b", "1 chickenf2", "3 chicken1c"}) +addWave(3,{"1 chickena1", "1 chickena1c", "1 chickens1", "3 chicken1d"}) +addWave(3,{"3 chicken1y", "2 chickena1", "1 chickenh1", "1 chickenw1", "1 chickens1"}) +addWave(3,{"2 chickena1b", "1 chickenw1d", "1 chickens1"}) + +newWaveSquad[4] = {"1 chickenh5", "9 chickenh1", "9 chickenh1b"} +addWave(4,{"1 chickena1", "1 chickena1b", "1 chickena1c", "1 chickenh1", "1 chickenh1b"}) +addWave(4,{"4 chicken1x", "3 chicken1y", "2 chicken1z", "1 chickenh1"}) +addWave(4,{"2 chicken1x", "3 chicken1y", "4 chicken1z", "1 chickenh1"}) +addWave(4,{"3 chickenc3", "1 chickena1"}) +addWave(4,{"3 chickenc3b", "1 chickens3"}) +addWave(4,{"3 chickenc3c", "1 chickens1"}) +addWave(4,{"3 chickenw1", "1 chicken_dodo1"}) +addWave(4,{"3 chickens1", "1 chickenf2"}) + +newWaveSquad[5] = {"11 chickens1", "2 chickenw2"} +addWave(5,{"6 chicken1x", "2 chickens1", "1 chicken_dodo1"}) +addWave(5,{"6 chickens1", "1 chickenw1"}) +addWave(5,{"5 chickens1", "1 chickena1b"}) +addWave(5,{"4 chickens1", "1 chickena1", "1 chickenf2"}) +addWave(5,{"3 chickens1", "1 chickena1c", "2 chickenc3"}) +addWave(5,{"3 chickens1", "1 chickenh1", "1 chickenh1b"}) +addWave(5,{"1 chickena1", "1 chickena1b", "1 chickena1c", "1 chickenw1b"}) +addWave(5,{"5 chicken1y", "1 chicken_dodo1", "3 chickenh1"}) +addWave(5,{"6 chicken1z", "1 chickenw1c", "1 chickenw1d"}) +addWave(5,{"3 chickens1", "1 chickenp1"}) +addWave(5,{"1 chickenp1", "1 chicken_dodo1", "3 chickenh1b"}) +addWave(5,{"1 chickenc3", "2 chickenc3b", "2 chickenc3b"}) +addWave(5,{"3 chickens3"}) + +newWaveSquad[6] = {"1 chickenh5", "1 chicken_dodo2", "7 chickenp1"} +addWave(6,{"1 chicken_dodo1", "3 chickenp1", "1 chickenf2"}) +addWave(6,{"1 chicken_dodo1", "3 chickenc3", "3 chickenc3b", "3 chickenc3c"}) +addWave(6,{"1 chicken_dodo1", "4 chickenp1", "1 chickens3"}) +addWave(6,{"1 chicken_dodo1", "4 chickenp1"}) +addWave(6,{"1 chicken_dodo1", "2 chickenp1", "1 chickenh1", "1 chickenh1b"}) +addWave(6,{"1 chicken_dodo1", "2 chickenp1", "1 chickenw1b", "1 chickenf2", "1 chickenw1"}) +addWave(6,{"2 chicken_dodo1", "1 chickenp1", "2 chickenc1"}) +addWave(6,{"2 chicken_dodo1", "1 chickena1", "1 chickena1b", "3 chickena1c", "1 chickenw1b"}) +addWave(6,{"2 chicken_dodo1", "5 chickens1", "1 chickenw2", "1 chickens3"}) +addWave(6,{"2 chicken_dodo1", "3 chicken1x", "1 chickenf1", "3 chicken2"}) +addWave(6,{"2 chicken_dodo1", "1 chickenp1", "1 chickenc1", "1 chickens1", "1 chickena1b", "1 chickenh1"}) +addWave(6,{"3 chicken_dodo1", "5 chickenh1", "1 chickens3"}) +addWave(6,{"4 chicken_dodo1", "1 chickenf1", "1 chickenw2"}) + +newWaveSquad[7] = {"1 chickenr1", "1 chickenh5", "12 chickenw2", "1 chickenf1", "1 chickenf1b"} +addWave(7,{"2 chickenw2", "1 chickenw1b", "1 chickenw1c", "1 chickens3"}) +addWave(7,{"1 chickenw1", "2 chickenw2", "1 chickenw1d", "1 chicken_dodo1"}) +addWave(7,{"1 chickenw1", "2 chickenw2", "1 chickenw1d", "1 chickens3"}) +addWave(7,{"1 chickenw1b", "1 chickenw1c", "2 chickenw2"}) +addWave(7,{"2 chickenw1", "3 chickenw1b", "1 chicken_dodo1"}) +addWave(7,{"2 chickenw1c", "2 chickenw1d"}) +addWave(7,{"1 chickenf1b", "2 chickens3"}) +addWave(7,{"2 chickenf1", "1 chickens3", "1 chicken_dodo1"}) +addWave(7,{"2 chickenf1", "1 chicken_dodo1", "1 chickens3"}) +addWave(7,{"2 chickenf1", "1 chicken_dodo1", "1 chickenf1b"}) +addWave(7,{"5 chickens3"}) +addWave(7,{"5 chickenw2"}) + +newWaveSquad[8] = {"1 chickenh5", "6 chickenc1", "2 chickenh2"} +addWave(8,{"2 chickenc1", "1 chickenw2", "1 chickenw1b", "1 chickenw1c", "1 chickenw1d"}) +addWave(8,{"2 chickenc1", "1 chickenr1", "3 chicken_dodo1"}) +addWave(8,{"2 chickenc1", "2 chickenf1", "1 chickenw2", "1 chickenw1d"}) +addWave(8,{"2 chickenc1", "1 chickenf1b", "2 chickenw2", "2 chickenw1b"}) +addWave(8,{"3 chickenc1", "4 chickenh1", "3 chickenf2"}) +addWave(8,{"3 chickenc1", "1 chickena1", "2 chickena1b", "1 chickena1c", "1 chicken_dodo1"}) +addWave(8,{"3 chickenc1", "4 chicken_dodo1"}) +addWave(8,{"3 chickenc1", "1 chickens1", "1 chickens2","2 chickenp1", "2 chickenh1b"}) +addWave(8,{"4 chickenc1", "1 chickenf1b", "1 chicken_dodo1"}) +addWave(8,{"4 chickenc1", "3 chicken_dodo1", "1 chickenh2"}) +addWave(8,{"2 chickena1", "1 chickena1b", "1 chickena1c", "1 chickena2", "1 chickenr1", "3 chickenf2"}) +addWave(8,{"6 chickens1", "1 chickens2"}) +addWave(8,{"5 chickenp1", "2 chickenh1", "2 chickenh1b"}) +addWave(8,{"4 chickenc3", "4 chickenc3b", "4 chickenc3c"}) +addWave(8,{"9 chicken2", "1 chicken_dodo2"}) + +newWaveSquad[9] = {"1 chickenh5", "5 chickens2", "10 chicken2"} +addWave(9,{"3 chickenf1", "1 chicken_dodo1", "1 chickena2", "1 chickenh1", "1 chickenw1b", "1 chicken2"}) +addWave(9,{"1 chickenr1", "2 chickenf1b", "2 chicken_dodo1", "1 chickenh1b", "1 chicken2"}) +addWave(9,{"1 chickenf1", "1 chickenf1b", "3 chicken_dodo1", "1 chickena2b", "1 chickenh1", "1 chickenh2"}) +addWave(9,{"1 chickenr1", "3 chickenc1", "1 chickenh1b", "1 chicken2"}) +addWave(9,{"3 chickenc1", "1 chicken_dodo2", "1 chickens2", "1 chickenh1", "1 chickenw1d", "1 chicken2"}) +addWave(9,{"2 chickenr1", "3 chickenc1", "1 chickenh1b", "1 chicken2"}) +addWave(9,{"1 chickenw1", "2 chickenw1b", "2 chickenw2", "1 chickenw1d", "2 chicken_dodo1", "1 chickens2", "1 chickenh1", "1 chicken2"}) +addWave(9,{"1 chickenr1", "6 chickenp1", "4 chickenh1b", "1 chicken2"}) +addWave(9,{"2 chickena1", "2 chickena1b", "2 chickena1c", "4 chickenh1", "1 chickenh1", "1 chickenw1", "1 chicken2"}) +addWave(9,{"1 chickenr1", "1 chickens2", "4 chickenh1b", "1 chicken2"}) +addWave(9,{"6 chicken2", "3 chickenh1", "1 chickenw2", "1 chickenf2"}) + +newWaveSquad[10] = {"2 chickenh5", "13 chicken2b", "1 chickenh2", "1 chickena2", "1 chickena2b"} +addWave(10,{"7 chicken2b", "1 chickens2", "2 chickenh1"}) +addWave(10,{"5 chicken2b", "1 chickena2", "1 chickenh1"}) +addWave(10,{"4 chicken2", "1 chickens2", "2 chickenh1b"}) +addWave(10,{"3 chicken2", "1 chickena2b", "1 chickenh1b"}) +addWave(10,{"3 chicken2b", "1 chickenh2", "2 chickenh1"}) +addWave(10,{"4 chicken2b", "1 chickenh5", "1 chickenh1"}) +addWave(10,{"7 chicken2", "1 chickenh2", "2 chickenh1b"}) +addWave(10,{"6 chicken2", "1 chicken_dodo2", "1 chickenr1"}) +addWave(10,{"1 chickenc2", "4 chickenc1", "1 chickenf1"}) +addWave(10,{"4 chickens3", "4 chickenw2", "1 chickenf1b"}) +addWave(10,{"6 chickenp1", "2 chickenh1b", "2 chickenh1"}) + +newWaveSquad[11] = {"4 chickenh2", "4 chickenh1", "4 chickenh1b"} +addWave(11,{"3 chickenh1","2 chickenh1b","1 chickenh2","2 chickenh3", "1 chickenc2", "1 chickenw2"}) +addWave(11,{"2 chickenh1","3 chickenh1b","1 chickenh2","2 chickenh3", "1 chickenc2", "1 chickenw2"}) +addWave(11,{"2 chickenh1","2 chickenh1b","1 chickenh2","2 chickenh3", "1 chickenc2", "1 chickenw2"}) +addWave(11,{"2 chickenh1","2 chickenh1b","1 chickenh2","2 chickenh3", "1 chickens2"}) +addWave(11,{"2 chickenh1","2 chickenh1b","1 chickenh2","2 chickenh3", "1 chickens2"}) +addWave(11,{"2 chickenh1","2 chickenh1b","1 chickenh2","2 chickenh3", "1 chickens2"}) +addWave(11,{"3 chickenc2"}) +addWave(11,{"3 chickenw1","3 chickenw1b", "3 chickenw1c", "3 chickenw1d"}) +addWave(11,{"3 chickens2"}) +addWave(11,{"1 chickena2", "2 chickenw2"}) +addWave(11,{"7 chickenw2"}) + +VERYEASY = "Chicken: Very Easy" +EASY = "Chicken: Easy" +NORMAL = "Chicken: Normal" +HARD = "Chicken: Hard" +VERYHARD = "Chicken: Very Hard" +EPIC = "Chicken: Epic!" +CUSTOM = "Chicken: Custom" +SURVIVAL = "Chicken: Survival" + +difficulties = { + [VERYEASY] = { + chickenSpawnRate = 100, + burrowSpawnRate = 120, + queenSpawnMult = 0, + angerBonus = 0.05, + expStep = 0, + lobberEMPTime = 0, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 7, + spawnChance = 0.25, + damageMod = 0.25, + }, + [EASY] = { + chickenSpawnRate = 100, + burrowSpawnRate = 120, + queenSpawnMult = 0, + angerBonus = 0.075, + expStep = 0.09375, + lobberEMPTime = 2.5, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 7, + spawnChance = 0.33, + damageMod = 0.5, + }, + + [NORMAL] = { + chickenSpawnRate = 80, + burrowSpawnRate = 105, + queenSpawnMult = 1, + angerBonus = 0.10, + expStep = 0.125, + lobberEMPTime = 4, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 9, + spawnChance = 0.4, + damageMod = 1, + }, + + [HARD] = { + chickenSpawnRate = 70, + burrowSpawnRate = 60, + queenSpawnMult = 1, + angerBonus = 0.125, + expStep = 0.25, + lobberEMPTime = 5, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 14, + spawnChance = 0.5, + damageMod = 1.1, + }, + + [VERYHARD] = { + chickenSpawnRate = 45, + burrowSpawnRate = 40, + queenSpawnMult = 3, + angerBonus = 0.15, + expStep = 0.4, + lobberEMPTime = 7.5, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 18, + spawnChance = 0.6, + damageMod = 1.25, + }, + [EPIC] = { + chickenSpawnRate = 120, + burrowSpawnRate = 30, + queenSpawnMult = 3, + angerBonus = 0.5, + expStep = 0.5, + lobberEMPTime = 10, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 50, + spawnChance = 0.75, + damageMod = 2, + }, + + [CUSTOM] = { + chickenSpawnRate = tonumber(Spring.GetModOptions().mo_custom_chickenspawn), + burrowSpawnRate = tonumber(Spring.GetModOptions().mo_custom_burrowspawn), + queenSpawnMult = tonumber(Spring.GetModOptions().mo_custom_queenspawnmult), + angerBonus = tonumber(Spring.GetModOptions().mo_custom_angerbonus), + expStep = (tonumber(Spring.GetModOptions().mo_custom_expstep) or 0.6) * -1, + lobberEMPTime = tonumber(Spring.GetModOptions().mo_custom_lobberemp), + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = tonumber(Spring.GetModOptions().mo_custom_minchicken), + spawnChance = (tonumber(Spring.GetModOptions().mo_custom_spawnchance) or 50) / 100, + damageMod = (tonumber(Spring.GetModOptions().mo_custom_damagemod) or 100) / 100, + }, + + [SURVIVAL] = { + chickenSpawnRate = 80, + burrowSpawnRate = 105, + queenSpawnMult = 1, + angerBonus = 0.1, + expStep = 0.125, + lobberEMPTime = 4, + chickenTypes = Copy(chickenTypes), + defenders = Copy(defenders), + chickensPerPlayer = 9, + spawnChance = 0.4, + damageMod = 1, + }, +} + + + +defaultDifficulty = 'Chicken: Custom' + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/AILoader.lua b/LuaRules/Gadgets/AILoader.lua new file mode 100644 index 000000000..59f450da4 --- /dev/null +++ b/LuaRules/Gadgets/AILoader.lua @@ -0,0 +1,308 @@ +function gadget:GetInfo() + return { + name = "ShardLua", + desc = "Shard by AF for Spring Lua", + author = "eronoobos, based on gadget by raaar, and original AI by AF", + date = "April 2016", + license = "GPL", + layer = 999999, + enabled = true, + } +end + +local teams = Spring.GetTeamList() +for i =1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI ~= "" then + if luaAI == "DAI" then + shardEnabled = true + end + end +end + +if shardEnabled == true then + Spring.Echo("[AI Loader] ShardLua bot Activated!") +else + Spring.Echo("[AI Loader] ShardLua bot Deactivated!") + return false +end + +local teams = Spring.GetTeamList() + +-- globals +ShardSpringLua = true -- this is the AI Boot gadget, so we're in Spring Lua +VFS.Include("luarules/gadgets/ai/boot.lua") + +-- fake os object +--os = shard_include("spring_lua/fakeos") + +-- missing math function +function math.mod(number1, number2) + return number1 % number2 +end +math.fmod = math.mod + +-- Shard object +Shard = shard_include("spring_lua/shard") +Shard.AIs = {} +Shard.AIsByTeamID = {} +local AIs = Shard.AIs + +-- fake api object +--api = shard_include("spring_lua/fakeapi") + +-- localization +local spEcho = Spring.Echo +local spGetTeamList = Spring.GetTeamList +local spGetTeamInfo = Spring.GetTeamInfo +local spGetTeamLuaAI = Spring.GetTeamLuaAI +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetTeamStartPosition = Spring.GetTeamStartPosition +local spGetTeamUnits = Spring.GetTeamUnits +local spGetAllUnits = Spring.GetAllUnits +local spGetUnitTeam = Spring.GetUnitTeam + +local function prepareTheAI(thisAI) + if not thisAI.modules then thisAI:Init() end + ai = thisAI + game = thisAI.game + map = thisAI.map +end + +--SYNCED CODE +if (gadgetHandler:IsSyncedCode()) then + +function gadget:Initialize() + GG.AiHelpers.Start() + local numberOfmFAITeams = 0 + local teamList = spGetTeamList() + spEcho( "k9: ailoader gadget go!") + + for i=1,#teamList do + local id = teamList[i] + local _,_,_,isAI,side,allyId = spGetTeamInfo(id) + + --spEcho("Player " .. teamList[i] .. " is " .. side .. " AI=" .. tostring(isAI)) + + ---- adding AI + spEcho( "K9: Is AI?") + if (isAI) then + spEcho( "K9: IT IS AI") + local aiInfo = spGetTeamLuaAI(id) + if (type(aiInfo) == "string") and (string.sub(aiInfo,1,8) == "DAI") then + numberOfmFAITeams = numberOfmFAITeams + 1 + spEcho("Moomin Player " .. teamList[i] .. " is " .. aiInfo) + -- add AI object + thisAI = ShardAI() + thisAI.id = id + thisAI.allyId = allyId + -- thisAI:Init() + AIs[#AIs+1] = thisAI + Shard.AIsByTeamID[id] = thisAI + else + spEcho("Player " .. teamList[i] .. " is another type of lua AI!") + end + else + spEcho( "K9: IS NOT AI!?") + end + end + + -- add allied teams for each AI + for _,thisAI in ipairs(AIs) do + alliedTeamIds = {} + enemyTeamIds = {} + for i=1,#teamList do + if (spAreTeamsAllied(thisAI.id,teamList[i])) then + alliedTeamIds[teamList[i]] = true + else + enemyTeamIds[teamList[i]] = true + end + end + -- spEcho("AI "..thisAI.id.." : allies="..#alliedTeamIds.." enemies="..#enemyTeamIds) + thisAI.alliedTeamIds = alliedTeamIds + thisAI.enemyTeamIds = enemyTeamIds + thisAI.ownUnitIds = thisAI.ownUnitIds or {} + thisAI.friendlyUnitIds = thisAI.friendlyUnitIds or {} + thisAI.alliedUnitIds = thisAI.alliedUnitIds or {} + thisAI.enemyUnitIds = thisAI.enemyUnitIds or {} + end + + -- catch up to started game + if Spring.GetGameFrame() > 1 then + self:GameStart() + -- catch up to current units + for _,uId in ipairs(spGetAllUnits()) do + self:UnitCreated(uId, Spring.GetUnitDefID(uId), Spring.GetUnitTeam(uId)) + self:UnitFinished(uId, Spring.GetUnitDefID(uId), Spring.GetUnitTeam(uId)) + end + end +end + +function gadget:GameStart() + -- Initialise AIs + for _,thisAI in ipairs(AIs) do + local _,_,_,isAI,side = spGetTeamInfo(thisAI.id) + thisAI.side = side + local x,y,z = spGetTeamStartPosition(thisAI.id) + thisAI.startPos = {x,y,z} + if not thisAI.modules then thisAI:Init() end + end +end + + +function gadget:GameFrame(n) + + -- for each AI... + for _,thisAI in ipairs(AIs) do + + -- update sets of unit ids : own, friendlies, enemies + -- run AI game frame update handlers + prepareTheAI(thisAI) + thisAI:Update() + end +end + + +function gadget:UnitCreated(unitId, unitDefId, teamId, builderId) + -- for each AI... + local unit = Shard:shardify_unit(unitId) + for _,thisAI in ipairs(AIs) do + if (spGetUnitTeam(unitId) == thisAI.id) then + thisAI.ownUnitIds[unitId] = true + thisAI.friendlyUnitIds[unitId] = true + elseif (thisAI.alliedTeamIds[spGetUnitTeam(unitId)] or spGetUnitTeam(unitId) == thisAI.id) then + thisAI.alliedUnitIds[unitId] = true + thisAI.friendlyUnitIds[unitId] = true + else + thisAI.enemyUnitIds[unitId] = true + end + + if Spring.GetUnitTeam(unitId) == thisAI.id then + prepareTheAI(thisAI) + thisAI:UnitCreated(unit) + end + -- thisAI:UnitCreated(unitId, unitDefId, teamId, builderId) + end +end + +function gadget:UnitDestroyed(unitId, unitDefId, teamId, attackerId, attackerDefId, attackerTeamId) + -- for each AI... + local unit = Shard:shardify_unit(unitId) + if unit then + for _,thisAI in ipairs(AIs) do + prepareTheAI(thisAI) + thisAI:UnitDead(unit) + thisAI.ownUnitIds[unitId] = nil + thisAI.friendlyUnitIds[unitId] = nil + thisAI.alliedUnitIds[unitId] = nil + thisAI.enemyUnitIds[unitId] = nil + -- thisAI:UnitDestroyed(unitId, unitDefId, teamId, attackerId, attackerDefId, attackerTeamId) + end + Shard:unshardify_unit(self.engineUnit) + end +end + + +function gadget:UnitDamaged(unitId, unitDefId, unitTeamId, damage, paralyzer, weaponDefId, projectileId, attackerId, attackerDefId, attackerTeamId) + -- for each AI... + local unit = Shard:shardify_unit(unitId) + if unit then + local attackerUnit = Shard:shardify_unit(attackerId) + local damageObj = Shard:shardify_damage(damage, weaponDefId, paralyzer) + for _,thisAI in ipairs(AIs) do + prepareTheAI(thisAI) + thisAI:UnitDamaged(unit, attackerUnit, damageObj) + -- thisAI:UnitDamaged(unitId, unitDefId, unitTeamId, attackerId, attackerDefId, attackerTeamId) + end + end +end + +function gadget:UnitIdle(unitId, unitDefId, teamId) + -- for each AI... + local unit = Shard:shardify_unit(unitId) + if unit then + for _,thisAI in ipairs(AIs) do + prepareTheAI(thisAI) + thisAI:UnitIdle(unit) + -- thisAI:UnitIdle(unitId, unitDefId, teamId) + end + end +end + + +function gadget:UnitFinished(unitId, unitDefId, teamId) + -- for each AI... + local unit = Shard:shardify_unit(unitId) + if unit then + for _,thisAI in ipairs(AIs) do + -- thisAI:UnitFinished(unitId, unitDefId, teamId) + prepareTheAI(thisAI) + thisAI:UnitBuilt(unit) + end + end +end + +function gadget:UnitTaken(unitId, unitDefId, teamId, newTeamId) + local unit = Shard:shardify_unit(unitId) + if unit then + for _,thisAI in ipairs(AIs) do + prepareTheAI(thisAI) + -- thisAI:UnitTaken(unitId, unitDefId, teamId, newTeamId) + thisAI:UnitDead(unit) + end + end +end + +function gadget:UnitGiven(unitId, unitDefId, teamId, oldTeamId) + local unit = Shard:shardify_unit(unitId) + if unit then + for _,thisAI in ipairs(AIs) do + prepareTheAI(thisAI) + -- thisAI:UnitCreated(unitId, unitDefId, teamId, oldTeamId) + thisAI:UnitCreated(unit) + end + end +end + +function gadget:FeatureDestroyed(featureID) + Shard:unshardify_feature(featureID) +end + +function gadget:GameID(gameID) + if Shard then + Shard.gameID = gameID + local rseed = 0 + local unpacked = VFS.UnpackU8(gameID, 1, string.len(gameID)) + for i, part in ipairs(unpacked) do + -- local mult = 256 ^ (#unpacked-i) + -- rseed = rseed + (part*mult) + rseed = rseed + part + end + -- Spring.Echo("randomseed", rseed) + Shard.randomseed = rseed + end +end + +--UNSYNCED CODE +else + + function gadget:Initialize() + Spring.Echo("Shard AI unsync gadget init") + gadgetHandler:AddSyncAction("shard_debug_position", handleShardDebugPosEvent) + end + + function gadget:Shutdown() + Spring.Echo("Shard AI unsync gadget shutdown") + gadgetHandler:RemoveSyncAction("shard_debug_position") + end + + function handleShardDebugPosEvent(_,x,z,col) + -- Spring.Echo("handleShardDebugPosEvent 1") + if Script.LuaUI("shard_debug_position") then + Spring.Echo("handleShardDebugPosEvent 2") + Script.LuaUI.shard_debug_position(x,z,col) + Spring.Echo("handleShardDebugPosEvent 3") + end + end + +end diff --git a/LuaRules/Gadgets/Better_Ranged_Counted_Multi_Tech.lua b/LuaRules/Gadgets/Better_Ranged_Counted_Multi_Tech.lua index 112b27a23..6b22e9ec2 100644 --- a/LuaRules/Gadgets/Better_Ranged_Counted_Multi_Tech.lua +++ b/LuaRules/Gadgets/Better_Ranged_Counted_Multi_Tech.lua @@ -905,7 +905,7 @@ if (gadgetHandler:IsSyncedCode()) then end local ICanHaz = CheckCmd(cmd,team,x,y,z) if not ICanHaz then - -- Spring.PlaySoundFile("sounds/moarpower.wav", 1, x, y, z) + -- Spring.PlaySoundFile("sounds/ui/moarpower.wav", 1, x, y, z) Spring.SpawnCEG("moarpower", x, y, z) end return ICanHaz @@ -920,7 +920,7 @@ if (gadgetHandler:IsSyncedCode()) then CanIHaz = CheckCmd(-ud,team,isBuilder) end if not CanIHaz then - -- Spring.PlaySoundFile("sounds/moarpower.wav", 5, x, y, z) + -- Spring.PlaySoundFile("sounds/ui/moarpower.wav", 5, x, y, z) end return CanIHaz end @@ -1014,24 +1014,31 @@ if (gadgetHandler:IsSyncedCode()) then else--unsynced local DrawWorldTimer = nil + local Tech + function gadget:GameFrame(frame) + if frame%19==17 then + Tech = SYNCED.Tech + end + end + function gadget:DrawWorld() - if Spring.IsGUIHidden() or not SYNCED.Tech then + if Spring.IsGUIHidden() or not Tech then return end local _,cmd=Spring.GetActiveCommand() -- Placing a unit or giving an order requiring ranged tech - if SYNCED.Tech.AccessionTable[cmd] then - for _,tech in spairs(SYNCED.Tech.AccessionTable[cmd]) do - if SYNCED.Tech.TechTable[tech.tech].Ranged then + if Tech.AccessionTable[cmd] then + for _,tech in spairs(Tech.AccessionTable[cmd]) do + if Tech.TechTable[tech.tech].Ranged then DrawWorldTimer=DrawWorldTimer or Spring.GetTimer() local cm=math.abs(((Spring.DiffTimers(Spring.GetTimer(),DrawWorldTimer)/.78)%2)-1) RangedProviders={} - for _,id in sipairs(SYNCED.Tech.TechTable[tech.tech].ProvidedBy) do - if SYNCED.Tech.ProviderTable[id][tech.tech].range then + for _,id in sipairs(Tech.TechTable[tech.tech].ProvidedBy) do + if Tech.ProviderTable[id][tech.tech].range then table.insert(RangedProviders,id) end end @@ -1039,7 +1046,7 @@ else--unsynced local x,y,z=Spring.GetUnitPosition(u) gl.Color(cm,cm,cm,1) gl.LineWidth(3) - gl.DrawGroundCircle(x,y,z,SYNCED.Tech.ProviderTable[Spring.GetUnitDefID(u)][tech.tech].range,24) + gl.DrawGroundCircle(x,y,z,Tech.ProviderTable[Spring.GetUnitDefID(u)][tech.tech].range,24) gl.Color(1,1,1,1) gl.LineWidth(1) end @@ -1055,7 +1062,7 @@ else--unsynced table.insert(units,id) end for _,u in ipairs(units) do - local ptrange=SYNCED.Tech.ProviderRangeByIDs[Spring.GetUnitDefID(u)] + local ptrange=Tech.ProviderRangeByIDs[Spring.GetUnitDefID(u)] if ptrange then local x,y,z=Spring.GetUnitPosition(u) gl.Color(0,0.2,1,1) @@ -1067,7 +1074,7 @@ else--unsynced -- Placing a unit providing ranged tech if cmd and cmd<0 then - local ptrange=SYNCED.Tech.ProviderRangeByIDs[-cmd] + local ptrange=Tech.ProviderRangeByIDs[-cmd] if ptrange then local mx,my=Spring.GetMouseState() local _,pos=Spring.TraceScreenRay(mx,my,true,true) diff --git a/LuaRules/Gadgets/ColorWars.lua b/LuaRules/Gadgets/ColorWars.lua deleted file mode 100644 index 9c9490fde..000000000 --- a/LuaRules/Gadgets/ColorWars.lua +++ /dev/null @@ -1,547 +0,0 @@ - -function gadget:GetInfo() - return { - name = "Color Wars!", - desc = "Self-replicating blocks filling the map", - author = "zwzsg", - date = "15 may 2009", - license = "Public Domain", - layer = 0, - enabled = true - } -end - -function CopyTable(src) - local dest = {} - for k,e in pairs(src) do - dest[k] = e - end - return dest -end - -if (gadgetHandler:IsSyncedCode()) then ---SYNCED - -local BuildTestUnit=UnitDefNames.eaaturret.id -local DoomsSecond = nil -- Time before everything turns to block, in seconds -local Phase = 0 -- 0,1,2,3,4 -local ActiveBlocks = {} -local BlockCountPerTeam = {} -local FullBlocks = {} -local BlockTable={} -- 0 if free, {..} if seeded with a block that will spawn later, or with a fully bloomed block, or with a block that couldn't bloom due to unbuildable terrain -local MaxBlockCount = nil - -local function isUnitComplete(UnitID) - local health,maxHealth,paralyzeDamage,captureProgress,buildProgress=Spring.GetUnitHealth(UnitID) - if buildProgress and buildProgress>=1 then - return true - else - return false - end -end - -local function CmdEditCW(Cmd,Line,WordList,Player) - if not Spring.IsCheatingEnabled() then - Spring.SendMessageToPlayer(Player,"Cheat must be enabled.") - return true - end - if Phase~=0 then - Spring.SendMessageToPlayer(Player,"Too late! Color Wars already started.") - return true - end - local words={} - local str=Line - local op=nil - local spacers={" ","\t",":",",","'","\"","/","\\"} - local function isSpacer(s) - for _,spacer in ipairs(spacers) do - if spacer==s then - return true - end - end - return false - end - while string.len(str)>0 do - local cursor1=1 - while isSpacer(string.sub(str,cursor1,cursor1)) and cursor1<=string.len(str) do - cursor1=cursor1+1 - end - local cursor2=cursor1 - while cursor2<=string.len(str) and not isSpacer(string.sub(str,cursor2,cursor2)) do - if string.sub(str,cursor2,cursor2)=="+" then - op=op and 1*op or 1 - cursor1=cursor1+1 - cursor2=cursor1 - elseif string.sub(str,cursor2,cursor2)=="-" then - op=op and -1*op or -1 - cursor1=cursor1+1 - cursor2=cursor1 - else - cursor2=cursor2+1 - end - end - if cursor10 and (h.." hr ") or "")..(m>0 and (m.." min ") or "")..(s>0 and (s.." sec") or "")..((h==0 and m==0 and s==0) and "zero" or "") - if op and DoomsSecond then - if Spring.GetGameSeconds()0 and (not op or op>=0) then - Spring.SendMessage("Setting Color Wars countdown to "..txt) - DoomsSecond=Spring.GetGameSeconds()+t - else - Spring.SendMessage("Disabling Color Wars") - DoomsSecond=nil - if _G.ColorWars then - _G.ColorWars=nil - end - end - end - return true - else - Spring.SendMessageToPlayer(Player,"Bad syntax in cw command. Use something like:") - Spring.SendMessageToPlayer(Player,"/luarules cw 2.5 Set to two minutes and a half") - Spring.SendMessageToPlayer(Player,"/luarules cw -0'30 Substract thirty seconds") - Spring.SendMessageToPlayer(Player,"/luarules cw +3 45 Add three minutes forty five seconds") - Spring.SendMessageToPlayer(Player,"/luarules cw 1:15:00 Set to one hour and a quarter") - end -end - -local function SetupCmdEditCW() - local cmd,func,help - cmd = "cw" - func = CmdEditCW - help = " Edit Color Wars timer. Separate hours/minutes/seconds with space,tab,comma,colon, etc.. Prefix with + - or nothing." - gadgetHandler:AddChatAction("cw",func,help) - Script.AddActionFallback(cmd..' ',help) -end - -function gadget:Initialize() - if Spring.GetModOptions==nil or (tonumber(Spring.GetModOptions()["colorwars"] or 0) or 0)==0 then - -- gadgetHandler:RemoveGadget() -- Somewhat too early, and not doing it anyway in case command to set it is used in midgame - -- return - else - DoomsSecond = 60*tonumber(Spring.GetModOptions()["colorwars"]) -- Let the ModOption value be in minutes - end - SetupCmdEditCW() -end - -function gadget:GameStart() -end - -local function SeedBlock(BlockType,team,x,z,When) - local Birthday=When+Spring.GetGameFrame() - local i,j = math.floor(x/32),math.floor(z/32) - if type(BlockTable[i][j])~="number" then - if BlockTable[i][j].Birthday>Birthday then - BlockTable[i][j].BlockType=BlockType - BlockTable[i][j].team=team - BlockTable[i][j].Birthday=Birthday - return true - end - return false - end - BlockTable[i][j]={BlockType=BlockType,team=team,x=x,z=z,Birthday=Birthday} - table.insert(ActiveBlocks,BlockTable[i][j]) - return true -end - - -function gadget:GameFrame(frame) - - -- Phase 0: Wait till doom - if Phase==0 then - if not DoomsSecond then - -- gadgetHandler:RemoveGadget() -- Not doing it in case command to set it is used in midgame - return - end - if Spring.GetGameSeconds()>DoomsSecond then - Phase=1 - end - - -- Phase 1: Turn all units into blocks - elseif Phase==1 then - -- Initialise BlockTable - for i=-1,0+Game.mapSizeX/32 do - BlockTable[i]={} - for j=-1,0+Game.mapSizeZ/32 do - BlockTable[i][j]=0 - end - end - -- Initial blocks seeding - for _,TeamID in ipairs(Spring.GetTeamList()) do - local BlockType = 4 -- make something here if only for if hidden races get unhidden - local _,_,_,_,faction,_=Spring.GetTeamInfo(TeamID) - faction=string.lower(faction) - if faction=="system" or faction=="experiment" then - BlockType=4--QuadBlock - elseif faction=="hacker" or faction=="hackerold" or faction=="arm" then - BlockType=3--TriBlock - elseif faction=="network" or faction=="touhou" or faction=="core" then - BlockType=6--HexaBlock - end - for _,UnitID in ipairs(Spring.GetTeamUnits(TeamID)) do - local x,y,z=Spring.GetUnitPosition(UnitID) - local UnitDef=UnitDefs[Spring.GetUnitDefID(UnitID)] - local xMin=math.max(0,math.floor(x-UnitDef.xsize*4)) - local xMax=math.min(Game.mapSizeX,math.ceil(x+UnitDef.xsize*4)) - local zMin=math.max(0,math.floor(z-UnitDef.zsize*4)) - local zMax=math.min(Game.mapSizeZ,math.ceil(z+UnitDef.zsize*4)) - if true or BlockType==4 then - for x=xMin,xMax do - for z=zMin,zMax do - if x%32==16 and z%32==16 then - SeedBlock(BlockType,TeamID,x,z,1) - end - end - end - end - Spring.MoveCtrl.Enable(UnitID) - Spring.MoveCtrl.SetNoBlocking(UnitID,true) - end - end - Phase=2 - - -- Phase 2: Blocks expansion - elseif Phase==2 and frame%10==0 then - for _,b in ipairs(ActiveBlocks) do - if frame>=b.Birthday then - local bt1,bt2=Spring.TestBuildOrder(BuildTestUnit,b.x,0,b.z,0) - if bt1==2 and not bt2 then - table.insert(FullBlocks,{BlockType=b.BlockType,team=b.team,x=b.x,y=Spring.GetGroundHeight(b.x,b.z),z=b.z}) - BlockCountPerTeam[b.team]=1+(BlockCountPerTeam[b.team] or 0) - SeedBlock(b.BlockType,b.team,b.x,b.z-32,20) - SeedBlock(b.BlockType,b.team,b.x,b.z+32,20) - SeedBlock(b.BlockType,b.team,b.x-32,b.z,20) - SeedBlock(b.BlockType,b.team,b.x+32,b.z,20) - SeedBlock(b.BlockType,b.team,b.x-32,b.z-32,30) - SeedBlock(b.BlockType,b.team,b.x-32,b.z+32,30) - SeedBlock(b.BlockType,b.team,b.x+32,b.z-32,30) - SeedBlock(b.BlockType,b.team,b.x+32,b.z+32,30) - --end - --else - --BlockTable[math.floor(b.x/32)][math.floor(b.z/32)]=0 -- Would Remove the ActiveBlocks[_] as well - end - end - end - for k=#ActiveBlocks,1,-1 do - if frame>=ActiveBlocks[k].Birthday then - table.remove(ActiveBlocks,k) - end - end - if #ActiveBlocks==0 then - Phase=3 - end - - -- Phase 3: Map filled: Count blocks - elseif Phase==3 then - for _,t in ipairs(Spring.GetTeamList()) do - MaxBlockCount=math.max(MaxBlockCount or 0,BlockCountPerTeam[t] or 0) - end - for _,t in ipairs(Spring.GetTeamList()) do - if (BlockCountPerTeam[t] or 0)<(MaxBlockCount or 1) then - for _,u in ipairs(Spring.GetTeamUnits(t)) do - Spring.DestroyUnit(u,true,false) - end - else - local names=nil - for _,pid in ipairs(Spring.GetPlayerList(t,true)) do - names=(names and names.."," or "").."" - end - Spring.SendMessage("Team"..t.."("..(names and names or "")..") won "..gadget:GetInfo().name) - end - end - Phase=4 - end - - _G.ColorWars={DoomsSecond=DoomsSecond,BlockCountPerTeam=BlockCountPerTeam,Phase=Phase,MaxBlockCount=MaxBlockCount,FullBlocks=FullBlocks,SizeFullBlocks=#FullBlocks} - -end - - -else ---UNSYNCED - -VFS.Include("LuaRules/Gadgets/libs/ColorConversion.lua",nil) - -local BlockDisplayLists = {} -local LastBlockNbr = 0 -local ModulatedTeamColors={} - -local EchoLines = 0 -local function LimitedEcho(txt) - if EchoLines then - Spring.Echo(txt) - EchoLines=EchoLines+1 - if(EchoLines>300) then - Spring.Echo("Enough text, stopping logging") - EchoLines=false - end - end -end - -local function PartialBlocksVertices(n1,n2) - for n=n1,n2 do - b=SYNCED.ColorWars.FullBlocks[n] - local tc=ModulatedTeamColors[b.team] - --local tc={Spring.GetTeamColor(b.team)} - gl.Color(tc[1],tc[2],tc[3],1) - local x,y,z=b.x,b.y,b.z - --LimitedEcho("Adding block n="..n.." @ x,y,z="..math.floor(x/32)..","..math.floor(y/32)..","..math.floor(z/32)) - -- Top face - gl.TexCoord(0.5,0) - gl.Vertex(x-16,y+24,z-16) - gl.TexCoord(0.5,0.5) - gl.Vertex(x-16,y+24,z+16) - gl.TexCoord(1,0.5) - gl.Vertex(x+16,y+24,z+16) - gl.TexCoord(1,0) - gl.Vertex(x+16,y+24,z-16) - -- South face - gl.TexCoord(0,0) - gl.Vertex(x-16,y+24,z+16) - gl.TexCoord(0,1) - gl.Vertex(x-16,y-40,z+16) - gl.TexCoord(0.5,1) - gl.Vertex(x+16,y-40,z+16) - gl.TexCoord(0.5,0) - gl.Vertex(x+16,y+24,z+16) - -- North face - gl.TexCoord(0,0) - gl.Vertex(x-16,y+24,z-16) - gl.TexCoord(0,1) - gl.Vertex(x-16,y-40,z-16) - gl.TexCoord(0.5,1) - gl.Vertex(x+16,y-40,z-16) - gl.TexCoord(0.5,0) - gl.Vertex(x+16,y+24,z-16) - -- East face - gl.TexCoord(0,0) - gl.Vertex(x+16,y+24,z-16) - gl.TexCoord(0,1) - gl.Vertex(x+16,y-40,z-16) - gl.TexCoord(0.5,1) - gl.Vertex(x+16,y-40,z+16) - gl.TexCoord(0.5,0) - gl.Vertex(x+16,y+24,z+16) - -- West face - gl.TexCoord(0,0) - gl.Vertex(x-16,y+24,z-16) - gl.TexCoord(0,1) - gl.Vertex(x-16,y-40,z-16) - gl.TexCoord(0.5,1) - gl.Vertex(x-16,y-40,z+16) - gl.TexCoord(0.5,0) - gl.Vertex(x-16,y+24,z+16) - end -end - -local function DrawNewBlocks() - gl.PushAttrib(GL.ALL_ATTRIB_BITS) - gl.DepthTest(true) - gl.DepthMask(true) - gl.Texture(":a:UnitTextures/GreyBlock.png") - gl.BeginEnd(GL.QUADS,PartialBlocksVertices,LastBlockNbr+1,SYNCED.ColorWars.SizeFullBlocks) - gl.Texture(false) - gl.DepthMask(false) - gl.DepthTest(false) - gl.Color(1,1,1,1) - -- Note: Leaving DepthTest to false, - -- or even using gl.ResetState() - -- Makes the water plane gets drawn over the land - -- So I save and restore all those OpenGL states with PushAttrib/PopAttrib - gl.PopAttrib() -end - -local function ReDrawBlocks() - for DispLst in ipairs(BlockDisplayLists) do - gl.CallList(DispLst) - end -end - -function gadget:DrawWorldPreUnit() - if SYNCED.ColorWars then - if SYNCED.ColorWars.SizeFullBlocks>LastBlockNbr then - --LimitedEcho("New blocks detected! SYNCED.ColorWars.SizeFullBlocks="..SYNCED.ColorWars.SizeFullBlocks) - -- Modulating blocks team colors according to number of updates - for _,t in ipairs(Spring.GetTeamList()) do - local tc={Spring.GetTeamColor(t)} - local h,s,l=HSLfromRGB(255*tc[1],255*tc[2],255*tc[3]) - l=64+math.abs((127+#BlockDisplayLists*17)%256-128) - local r,g,b=RGBfromHSL(h,s,l) - ModulatedTeamColors[t]={r/255,g/255,b/255,1} - end - -- Making the display list of newly added blocks - local NewBlockDisplayList=gl.CreateList(DrawNewBlocks) - table.insert(BlockDisplayLists,NewBlockDisplayList) - LastBlockNbr=SYNCED.ColorWars.SizeFullBlocks - end - -- Drawing all the blocks from their display list - ReDrawBlocks() - end -end - -local CountDown={} - -function gadget:DrawScreenEffects(vsx, vsy) - CountDown.Show=false - if SYNCED.ColorWars and not Spring.IsGUIHidden() then - CountDown.xSize = CountDown.xSize or vsy*0.1 - CountDown.ySize = CountDown.ySize or vsy*0.05 - CountDown.xPos = math.min(vsx-CountDown.xSize/3,math.max(0-2*CountDown.xSize/3,CountDown.xPos or vsx*0.007)) - CountDown.yPos = math.min(vsy-CountDown.ySize/3,math.max(0-2*CountDown.ySize/3,CountDown.yPos or vsy*0.13)) - local TextWidthFixHack = 1 - if tonumber(string.sub(Game.version,1,4))<=0.785 and string.sub(Game.version,1,5)~="0.78+" then - TextWidthFixHack = (vsx/vsy)*(4/3) - end - if SYNCED.ColorWars.Phase>=2 and SYNCED.ColorWars.BlockCountPerTeam then - local cut=0 - local MaxCountTxtxSize=0 - for _,t in ipairs(Spring.GetTeamList()) do - local count=SYNCED.ColorWars.BlockCountPerTeam[t] - if count then - CountDown.Show=true - local CountTxt=count..(SYNCED.ColorWars.Phase<4 and "" or (count>=SYNCED.ColorWars.MaxBlockCount and " Winner!" or " Loser")) - local tc={Spring.GetTeamColor(t)} - gl.Color(tc[1],tc[2],tc[3],1) - gl.Text(CountTxt,CountDown.xPos,CountDown.yPos-cut*CountDown.ySize,CountDown.ySize,"n") - cut=cut+1 - MaxCountTxtxSize=math.max(MaxCountTxtxSize,gl.GetTextWidth(CountTxt)) - end - end - gl.Color(1,1,1,1) - CountDown.xSize = CountDown.ySize*TextWidthFixHack*MaxCountTxtxSize - elseif SYNCED.ColorWars.DoomsSecond and not Spring.IsGUIHidden() then - CountDown.Show=true - local t=math.floor(SYNCED.ColorWars.DoomsSecond-Spring.GetGameSeconds()) - local h=math.floor(t/3600) - local m=math.floor((t%3600)/60) - local s=t%60 - CountDown.Txt=(t<0 and "Over!" or ((h>0 and h..":" or "")..(m>0 and ((h>0 and m<10) and "0" or "")..m..":" or (h==0 and "" or "00:"))..((s>9 or (m==0 and h==0)) and "" or "0")..s)) - CountDown.xSize = CountDown.ySize*TextWidthFixHack*gl.GetTextWidth(CountDown.Txt) - gl.Color(1,1,1,1) - gl.Text(CountDown.Txt,CountDown.xPos,CountDown.yPos,CountDown.ySize,"o") - end - end -end - -function gadget:MouseMove(x,y,dx,dy,button) - if CountDown.Show and CountDown.Tweaking then - if CountDown.Tweaking>=2 then -- resize bar - if CountDown.Tweaking%2==1 then - CountDown.xPos=CountDown.xPos+dx - CountDown.xSize=math.max(9,CountDown.xSize-dx) - else - CountDown.xSize=math.max(9,CountDown.xSize+dx) - end - if math.floor(CountDown.Tweaking/2)%2==0 then - CountDown.yPos=CountDown.yPos+dy - CountDown.ySize=math.max(9,CountDown.ySize-dy) - else - CountDown.ySize=math.max(9,CountDown.ySize+dy) - end - else -- move bar - CountDown.xPos=CountDown.xPos+dx - CountDown.yPos=CountDown.yPos+dy - end - end -end - -function gadget:MousePress(x,y,button) - if CountDown.Show and x>CountDown.xPos and y>CountDown.yPos and xCountDown.xPos+CountDown.xSize-CountDown.xSize/4) and (yCountDown.yPos+CountDown.ySize-CountDown.ySize/4) then - CountDown.Tweaking=2 -- resize bar - if xCountDown.xPos and y>CountDown.yPos and x=1 then - return true - else - return false - end - end - return true - end - - - local function IsItOccupied(u1) - local ux1,_,uz1=Spring.GetUnitPosition(u1) - local ud1=UnitDefs[Spring.GetUnitDefID(u1)] - local usx1,usz1=ud1.xsize*8-4,ud1.zsize*8-4 - for _,u2 in ipairs(Spring.GetAllUnits()) do - local ud2=UnitDefs[Spring.GetUnitDefID(u2)] - if ud2.canMove==false or (ud2.speed or 0)<1 then - local ux2,_,uz2=Spring.GetUnitPosition(u2) - local usx2,usz2=ud2.xsize*8,ud2.zsize*8 - if math.abs(ux2 - ux1)=1 then - return true - else - return false - end - end - - - local function SaveRegenData(team) - local function AddOrder(q,id,params,options) - table.insert(q,{id=id,params=params,options=options}) - end - local function AddStateOrder(q,id,param) - table.insert(q,{id=id,params={param},options={}}) - end - local function AddQueue(q,queue) - local OrdersOnUnits={ - [CMD.ATTACK]=true, - [CMD.GUARD]=true, - [CMD.RECLAIM]=true, - [CMD.REPAIR]=true, - [CMD.CAPTURE]=true, - [CMD.LOAD_UNITS]=true, - [CMD.LOAD_ONTO]=true, - [CMD.UNLOAD_UNITS]=true, - [CMD.DEATHWAIT]=true, - } - for _,o in ipairs(queue) do - local id=o.id - local params={} - local options={} - local shifted=false - for _,param in ipairs(o.params) do - table.insert(params,param) - end - for _,option in ipairs(o.options) do - table.insert(options,option) - if option=="shift" then - shifted=true - end - end - if not shifted then - table.insert(options,"shift") - end - if #o.params==1 and OrdersOnUnits[o.id] and Spring.ValidUnitID(o.params[1]) then - id=CMD_IF_UNIT_IN_AREA - local TargetType=Spring.GetUnitDefID(o.params[1]) - local x,y,z=Spring.GetUnitPosition(o.params[1]) - params={o.id,TargetType,x,y,z,128,1} - -- order to redo, unitdef to look for, center, radius, blocking order - -- blocking = wait until there's a unit to guard/attack/etc.. - end - table.insert(q,{id=id,params=params,options=options}) - end - end - local _,_,_,_,_,_,CustomTeamOptions=Spring.GetTeamInfo(team) - if (string.lower(Spring.GetTeamLuaAI(team))==string.lower(gadget:GetInfo().name)) or - (CustomTeamOptions and CustomTeamOptions["aioverride"] and string.lower(CustomTeamOptions["aioverride"])==string.lower(gadget:GetInfo().name)) then - local UnitsWithOrders={} - for _,u in ipairs(Spring.GetTeamUnits(team)) do - local udid=Spring.GetUnitDefID(u) - local ud=UnitDefs[Spring.GetUnitDefID(u)] - local heading=Spring.GetUnitHeading(u) - local buildfacing=Spring.GetUnitBuildFacing(u) - local x,_,z=Spring.GetUnitPosition(u) - local states=Spring.GetUnitStates(u) - local q={} - -- Add extra orders to restore unit states - AddStateOrder(q,CMD.FIRE_STATE,states["firestate"]) - AddStateOrder(q,CMD.MOVE_STATE,states["movestate"]) - if states["cloak"]~=ud.startCloaked then - AddStateOrder(q,CMD.CLOAK,states["cloak"] and 1 or 0) - end - if states["active"]~=ud.activateWhenBuilt then - AddStateOrder(q,CMD.ONOFF,states["active"] and 1 or 0) - end - if (states["trajectory"] and 1 or 0)~=ud.highTrajectoryType then - AddStateOrder(q,CMD.TRAJECTORY,states["trajectory"] and 1 or 0) - end - -- Could add here restoration of autoland, autorepairlevel, loopbackattack states - -- New Worm state - if Spring.GetUnitRulesParam(u,"autohold") then - AddStateOrder(q,CMD_AUTOHOLD,Spring.GetUnitRulesParam(u,"autohold")>=1 and 1 or 0) - end - -- Old Worm and Old Bug state - if Spring.GetUnitRulesParam(u,"burrow") then - AddStateOrder(q,CMD_BURROW,Spring.GetUnitRulesParam(u,"burrow")>=1 and 1 or 0) - end - if states["repeat"] then - AddStateOrder(q,CMD_REPEAT,nil) - end - AddQueue(q,Spring.GetFactoryCommands(u) or {}) - AddQueue(q,Spring.GetUnitCommands(u) or {}) - for _,b in ipairs(Spring.GetFullBuildQueue(u) or {}) do - local unitDefID,count = next(b,nil) - for c=1,count,1 do - AddOrder(q,-unitDefID,{},{}) - end - end - -- Some units shan't be regenerated - if StoreIt(u,ud.id,x,z) then - table.insert(UnitsWithOrders,{status=6,name=ud.name,id=u,x=x,z=z,heading=heading,buildfacing=buildfacing,orders=q}) - end - end - table.sort( - UnitsWithOrders, - function(a,b) - return UnitDefNames[a.name].health>UnitDefNames[b.name].health - end - ) - RegenData[team]=UnitsWithOrders - end - end - - - - --function gadget:Initialize() - --end - - - function gadget:GameStart() - for _,team in ipairs(Spring.GetTeamList()) do - local _,_,_,_,_,_,CustomTeamOptions=Spring.GetTeamInfo(team) - if (string.lower(Spring.GetTeamLuaAI(team))==string.lower(gadget:GetInfo().name)) or - (CustomTeamOptions and CustomTeamOptions["aioverride"] and string.lower(CustomTeamOptions["aioverride"])==string.lower(gadget:GetInfo().name)) then - RegenData[team]={RegenAI=true} - end - end - end - - - - local function Regen(frame,uwoi,uwo,team) - if uwo.status==1 or uwo.status==7 then -- If unit was merely queued or destroyed for morphing - if RegenData[team][uwoi].timer+30*300 then - -- CanBuildIt=true - --end - local bdbo=UnitDefs[Spring.GetUnitDefID(b)].buildOptions - if bdbo and #bdbo>=1 then - local CanBuildIt=false - for _,buildable in ipairs(bdbo) do - if udid==buildable then - --Spring.SendMessageToTeam(team,UnitDefs[Spring.GetUnitDefID(b)].name.." has "..uwo.name.." in buildmenu") - CanBuildIt=true - break - end - end - if CanBuildIt and isUnitComplete(b) and - #(Spring.GetUnitCommands(b) or {})==0 and - #(Spring.GetCommandQueue(b) or {})==0 and - #(Spring.GetFactoryCommands(b) or {})==0 and - ((not dispatchTimer[b]) or (Spring.GetGameSeconds()>dispatchCoolDown+dispatchTimer[b])) then - local bx,_,bz=Spring.GetUnitPosition(b) - local d=(bx-uwo.x)^2+(bz-uwo.z)^2 - if not BuilderID or didleTimer[u]+maxIdleTime then - --BufferizePacket(u) - local closestID,closestDist = nil,nil - for _,tp in ipairs(Spring.GetTeamUnitsByDefs(Spring.GetUnitTeam(u),{teleporter})) do - if not closestID or Spring.GetUnitSeparation(u,tp)0.5 and RegenData[team] then - - end - end - - - function gadget:UnitDestroyed(u,ud,team,atk,atkd,atkteam) - if dispatchTimer[u] then - dispatchTimer[u]=nil - end - if idleTimer[u] then - idleTimer[u]=nil - end - for _,rgteam in ipairs(Spring.GetTeamList()) do - if RegenData[rgteam] then - for uwoi,uwo in ipairs(RegenData[rgteam]) do - if uwo.id==u then - if atk==ud and (UnitDefs[ud].name=="exploit" or UnitDefs[ud].name=="bug") then - RegenData[rgteam][uwoi].status=7 -- should be morphing and come back as a UnitCreated with a new ID - RegenData[rgteam][uwoi].timer=Spring.GetGameFrame() - else - RegenData[rgteam][uwoi].status=0 - --Spring.SendMessageToTeam(rgteam,"Lost a "..uwo.name) - end - end - end - end - end - end - - - function gadget:UnitTaken(u,ud,team,newteam) - if RegenData[team] then - if not Spring.AreTeamsAllied(team,newteam) then -- If the new owner is not allied with the AI - for uwoi,uwo in ipairs(RegenData[team]) do - if uwo.id==u then - RegenData[team][uwoi].status=0 - end - end - end - end - end - - - function gadget:UnitCreated(u,ud,team) - if RegenData[team] then - local WannabeIdx=nil - local WannabeDist=nil - for uwoi,uwo in ipairs(RegenData[team]) do - if (uwo.status==1 and uwo.name==UnitDefs[ud].name) - --or (uwo.status==0 and uwo.name==UnitDefs[ud].name and uwo.name=="packet") - --or (uwo.status==7 and (uwo.name=="bug" or uwo.name=="exploit") and (UnitDefs[ud].name=="bug" or UnitDefs[ud].name=="exploit")) - then - local x,_,z=Spring.GetUnitPosition(u) - local d=(x-uwo.x)^2+(z-uwo.z)^2 - if (not WannabeIdx) or d=1 or WannabeDist<28^2) then - --Spring.SendMessageToTeam(team,"New "..uwo.name.." found!") - RegenData[team][uwoi].id=u - RegenData[team][uwoi].status=2 -- under construction - if isUnitComplete(u) then - RegenData[team][uwoi].status=3 - end - end - end - end - - --function gadget:UnitFinished(u,ud,team) - --end - - -else ---UNSYNCED - -end diff --git a/LuaRules/Gadgets/activity_broadcast.lua b/LuaRules/Gadgets/activity_broadcast.lua new file mode 100644 index 000000000..6c9c9ee8c --- /dev/null +++ b/LuaRules/Gadgets/activity_broadcast.lua @@ -0,0 +1,108 @@ + +function gadget:GetInfo() + return { + name = "Activity Broadcast", + desc = "Checks if there is keyboard/mouse activity or camera changes", + author = "Floris", + date = "July,2016", + layer = 0, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-- config +-------------------------------------------------------------------------------- + +local sendPacketEvery = 2 + +-------------------------------------------------------------------------------- +-- synced +-------------------------------------------------------------------------------- +if gadgetHandler:IsSyncedCode() then + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationActivity = validation + + function gadget:RecvLuaMsg(msg, playerID) + if msg:sub(1,1)=="^" and msg:sub(2,3)==validation then + SendToUnsynced("activityBroadcast",playerID) + return true + end + end + +else + -------------------------------------------------------------------------------- + -- unsynced + -------------------------------------------------------------------------------- + + local GetMouseState = Spring.GetMouseState + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetCameraState = Spring.GetCameraState + + local activity = false + local old_mx,old_my = 0,0 + local updateTimer = 0 + local prevCameraState = GetCameraState() + local validation = SYNCED.validationActivity + + function gadget:Initialize() + gadgetHandler:AddSyncAction("activityBroadcast", handleActivityEvent) + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("activityBroadcast") + end + + function handleActivityEvent(_,playerID) + if Script.LuaUI("ActivityEvent") then + Script.LuaUI.ActivityEvent(playerID) + end + end + + function gadget:Update() + updateTimer = updateTimer + GetLastUpdateSeconds() + if updateTimer > sendPacketEvery then + -- mouse + local mx,my = GetMouseState() + if mx ~= old_mx or my ~= old_my then + old_mx,old_my = mx,my + activity = true + end + -- camera + local cameraState = GetCameraState() + if not activity then + for i,stateindex in pairs(cameraState) do + if stateindex ~= prevCameraState[i] then + activity = true + break + end + end + end + prevCameraState = cameraState + + if activity then + SendLuaRulesMsg("^"..validation) + end + activity = false + updateTimer = 0 + end + end + + function gadget:KeyPress(key, mods, isRepeat) + activity = true + end + +end + diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/attackerbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackerbehaviour.lua new file mode 100644 index 000000000..661697139 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackerbehaviour.lua @@ -0,0 +1,167 @@ +shard_include( "attackers" ) + +local SpGetUnitNearestEnemy = Spring.GetUnitNearestEnemy + +function IsAttacker(unit) + for i,name in ipairs(attackerlist) do + if name == unit:Internal():Name() then + return true + end + end + return false +end + +AttackerBehaviour = class(Behaviour) + +function AttackerBehaviour:Init() + --self.ai.game:SendToConsole("attacker!") + --self.game:AddMarker({ x = startPosx, y = startPosy, z = startPosz }, "my start position") + CMD.MOVE_STATE = 50 +end + +function AttackerBehaviour:Update() + local unitID = self.unit:Internal().id + -- Spring.Echo(unitID) + local myRange = Spring.GetUnitMaxRange(unitID) + local closestUnit = Spring.GetUnitNearestEnemy(unitID, myRange) + local allyTeamID = self.ai.allyId + if Spring.GetGameFrame() % 15 == 4 then + if closestUnit and (Spring.IsUnitInLos(closestUnit, allyTeamID)) then + local enemyRange = Spring.GetUnitMaxRange(closestUnit) + if myRange > enemyRange then + local ex,ey,ez = Spring.GetUnitPosition(closestUnit) + local ux,uy,uz = Spring.GetUnitPosition(unitID) + local pointDis = Spring.GetUnitSeparation(unitID,closestUnit) + local dis = 120 + local f = dis/pointDis + if (pointDis+dis > Spring.GetUnitMaxRange(unitID)) then + f = (Spring.GetUnitMaxRange(unitID)-pointDis)/pointDis + end + local cx = ux+(ux-ex)*f + local cy = uy + local cz = uz+(uz-ez)*f + self.unit:Internal():ExecuteCustomCommand(CMD.MOVE, {cx, cy, cz}) + end + end + end +end + +function AttackerBehaviour:OwnerBuilt() + self.ai.attackhandler:AddRecruit(self) + self.unit:Internal():ExecuteCustomCommand(CMD.MOVE_STATE, { 2 }, {}) + self.attacking = true + self.active = true +end + + +function AttackerBehaviour:OwnerDead() + self.ai.attackhandler:RemoveRecruit(self) +end + +function AttackerBehaviour:OwnerIdle() + self.attacking = true + self.active = true + self.ai.attackhandler:AddRecruit(self) +end + +function AttackerBehaviour:AttackCell(cell) + local unit = self.unit:Internal() + local unitID = unit.id + local teamID = ai.id + local r = math.random(0,1000) + if r == 0 then + local ec = Spring.GetTeamResources(ai.id, "energy") + if ec > 100 then + Spring.GiveOrderToUnit(unitID, 31337, {}, {}) + end + end + --attack + if unitID%60 == Spring.GetGameFrame()%60 then + local currenthealth = unit:GetHealth() + local maxhealth = unit:GetMaxHealth() + local startPosx, startPosy, startPosz = Spring.GetTeamStartPosition(self.ai.id) + local startBoxMinX, startBoxMinZ, startBoxMaxX, startBoxMaxZ = Spring.GetAllyTeamStartBox(self.ai.allyId) + local ec, es = Spring.GetTeamResources(ai.id, "energy") + local closestUnit = Spring.GetUnitNearestEnemy(unitID, 50000, false) + local ex,ey,ez = Spring.GetUnitPosition(closestUnit) + local enemyDis = Spring.GetUnitSeparation(unitID,closestUnit) + if (currenthealth >= maxhealth or currenthealth > 3000) and closestUnit then + if enemyDis < 1500 then + Spring.GiveOrderToUnit(unitID, CMD.CLOAK, { 1 }, {}) + else + Spring.GiveOrderToUnit(unitID, CMD.CLOAK, { 0 }, {}) + end + + p = api.Position() + p.x = ex + p.z = ez + p.y = ey + self.target = p + self.attacking = true + self.ai.attackhandler:AddRecruit(self) + if self.active then + self.unit:Internal():MoveAndFire(self.target) + else + self.unit:ElectBehaviour() + end + --retreat + else + local nanotcx, nanotcy, nanotcz = GG.GetClosestNanoTC(unitID) + if enemyDis < 1500 then + Spring.GiveOrderToUnit(unitID, CMD.CLOAK, { 1 }, {}) + else + Spring.GiveOrderToUnit(unitID, CMD.CLOAK, { 0 }, {}) + end + if nanotcx and nanotcy and nanotcz then + p = api.Position() + p.x, p.y, p.z = nanotcx, nanotcy, nanotcz + elseif startBoxMinX == 0 and startBoxMinZ == 0 and startBoxMaxZ == Game.mapSizeZ and startBoxMaxX == Game.mapSizeX then + p = api.Position() + p.x = startPosx + p.z = startPosz + p.y = 0 + else + p = api.Position() + p.x = math.random(startBoxMinX, startBoxMaxX) + p.z = math.random(startBoxMinZ, startBoxMaxZ) + p.y = 0 + end + + self.target = p + self.attacking = false + self.ai.attackhandler:AddRecruit(self) + if self.active then + self.unit:Internal():Move(self.target) + else + self.unit:ElectBehaviour() + end + end + end +end + +function AttackerBehaviour:Priority() + if not self.attacking then + return 0 + else + return 100 + end +end + +function AttackerBehaviour:Activate() + self.active = true + if self.target then + self.unit:Internal():MoveAndFire(self.target) + self.target = nil + self.ai.attackhandler:AddRecruit(self) + else + self.ai.attackhandler:AddRecruit(self) + end +end + + +function AttackerBehaviour:OwnerDied() + self.ai.attackhandler:RemoveRecruit(self) + self.attacking = nil + self.active = nil + self.unit = nil +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/attackers.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackers.lua new file mode 100644 index 000000000..fb7e301b1 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackers.lua @@ -0,0 +1,253 @@ +--[[ +Attackers! +]]-- + +attackerlist = { + ------------- Morphs + ---Buildings, just to make them upgrade + "emetalextractor", + "emetalextractor_up1", + "emetalextractor_up2", + "etech1", + "etech2", + ---Amphibs + "eamphibriot_shotgun", + "eamphibriot_shotgun_up1", + "eamphibriot_shotgun_up2", + "eamphibriot_shotgun_up3", + ---AllTerr + "eallterrriot_shotgun", + "eallterrriot_shotgun_up1", + "eallterrriot_shotgun_up2", + "eallterrriot_shotgun_up3", + ---Hbots + "ehbotpeewee_turret", + "ehbotpeewee_turret_up1", + "ehbotpeewee_turret_up2", + "ehbotpeewee_turret_up3", + "ehbotrocko_turret", + "ehbotrocko_turret_up1", + "ehbotrocko_turret_up2", + "ehbotrocko_turret_up3", + "ehbotsniper_turret", + "ehbotsniper_turret_up1", + "ehbotsniper_turret_up2", + "ehbotsniper_turret_up3", + "ehbotthud_turret", + "ehbotthud_turret_up1", + "ehbotthud_turret_up2", + "ehbotthud_turret_up3", + "ehbotkarganneth_turret", + "ehbotkarganneth_turret_up1", + "ehbotkarganneth_turret_up2", + "ehbotkarganneth_turret_up3", + ---Hover + "eriottank2_shotgun", + "eriottank2_shotgun_up1", + "eriottank2_shotgun_up2", + "eriottank2_shotgun_up3", + "eartytank_saturation", + "eartytank_saturation_up1", + "eartytank_saturation_up2", + "eartytank_saturation_up3", + + ------------- Endbringers + "eallterranarchid", + "eallterranarchid_up1", + "eallterranarchid_up2", + "eallterranarchid_up3", + "eamphibleveler", + "eamphibleveler_up1", + "eamphibleveler_up2", + "eamphibleveler_up3", + "elacerator", + "elacerator_up1", + "elacerator_up2", + "elacerator_up3", + "ekrow", + "ekrow_up1", + "ekrow_up2", + "ekrow_up3", + "ehbotkarganneth", + "ehbotkarganneth_up1", + "ehbotkarganneth_up2", + "ehbotkarganneth_up3", + + ------------- Basic + "escoutdrone", + "eairemp", + "eraider", + "edrone", + "elighttank3", + "eamphibbuggy", + "eallterrlight", + "efighter", + "ebomber", + "egunship2", + "emissiletank", + "eartytank", + "eamphibrock", + "eamphibarty", + "eamphibneedle", + "emediumtank3", + "eheavytank3", + "eamphibmedtank", + "eallterrmed", + "eallterrheavy", + "eallterrassault", + "eriottank2", + "eamphibriot", + "eallterrriot", + "edrone", + "ehbotpeewee", + "ehbotrocko", + "ehbotsniper", + "ehbotthud", + "ebox", + "eorbai", + "eaimexer", + "escout", + "eallterrshield", + + -------------- Upgrade 1 + "eraider_up1", + "eairemp_up1", + "edrone_up1", + "elighttank3_up1", + "eamphibbuggy_up1", + "eallterrlight_up1", + "efighter_up1", + "ebomber_up1", + "egunship2_up1", + "emissiletank_up1", + "eartytank_up1", + "eamphibrock_up1", + "eamphibarty_up1", + "eamphibneedle_up1", + "emediumtank3_up1", + "eheavytank3_up1", + "eamphibmedtank_up1", + "eallterrmed_up1", + "eallterrheavy_up1", + "eallterrassault_up1", + "eriottank2_up1", + "eamphibriot_up1", + "eallterrriot_up1", + "ehbotpeewee_up1", + "ehbotrocko_up1", + "ehbotsniper_up1", + "ehbotthud_up1", + "escout_up1", + "eallterrshield_up1", + + --------------- Upgrade 2 + "eraider_up2", + "eairemp_up2", + "edrone_up2", + "elighttank3_up2", + "eamphibbuggy_up2", + "eallterrlight_up2", + "efighter_up2", + "ebomber_up2", + "egunship2_up2", + "emissiletank_up2", + "eartytank_up2", + "eamphibrock_up2", + "eamphibarty_up2", + "eamphibneedle_up2", + "emediumtank3_up2", + "eheavytank3_up2", + "eamphibmedtank_up2", + "eallterrmed_up2", + "eallterrheavy_up2", + "eallterrassault_up2", + "eriottank2_up2", + "eamphibriot_up2", + "eallterrriot_up2", + "ehbotpeewee_up2", + "ehbotrocko_up2", + "ehbotsniper_up2", + "ehbotthud_up2", + "escout_up2", + "eallterrshield_up2", + + ----------------------------- Upgrade 3 + "eraider_up3", + "eairemp_up3", + "edrone_up3", + "elighttank3_up3", + "eamphibbuggy_up3", + "eallterrlight_up3", + "efighter_up3", + "ebomber_up3", + "egunship2_up3", + "emissiletank_up3", + "eartytank_up3", + "eamphibrock_up3", + "eamphibarty_up3", + "eamphibneedle_up3", + "emediumtank3_up3", + "eheavytank3_up3", + "eamphibmedtank_up3", + "eallterrmed_up3", + "eallterrheavy_up3", + "eallterrassault_up3", + "eriottank2_up3", + "eamphibriot_up3", + "eallterrriot_up3", + "ehbotpeewee_up3", + "ehbotrocko_up3", + "ehbotsniper_up3", + "ehbotthud_up3", + "escout_up3", + "eallterrshield_up3", + + ---------------------------- Chickens + "chicken_dodo1", + "chicken_dodo2", + "chicken1", + "chicken1b", + "chicken1c", + "chicken1x", + "chicken1y", + "chicken1z", + "chicken2", + "chicken2b", + "chickena1", + "chickena1b", + "chickena1c", + "chickena2", + "chickena2b", + "chickenc1", + "chickenc2", + "chickenc3", + "chickenc3b", + "chickenc3c", + "chickenf1", + "chickenf1b", + "chickenh1", + "chickenh1b", + "chickenh2", + "chickenh3", + "chickenh4", + "chickenh5", + "chickenp1", + "chickenr1", + "chickenr2", + "chickenr3", + "chickens1", + "chickens2", + "chickens3", + "chickenw1", + "chickenw1b", + "chickenw1c", + "chickenw1d", + "chickenw2", + "e_chickenq", + "epic_chickenq", + "h_chickenq", + "n_chickenq", + "ve_chickenq", + "vh_chickenq", + "roost", +} diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/attackhandler.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackhandler.lua new file mode 100644 index 000000000..d20a82abf --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/attackhandler.lua @@ -0,0 +1,183 @@ +AttackHandler = class(Module) + +function AttackHandler:Name() + return "AttackHandler" +end + +function AttackHandler:internalName() + return "attackhandler" +end + +function AttackHandler:Init() + self.recruits = {} + self.counter = 1 +end + +function AttackHandler:Update() +-- stagger targetting if multiple shards are in the game + local f = self.game:Frame() + self.game:GetTeamID() + if math.mod(f,1) == 0 then + self:DoTargetting() + end +end + +function AttackHandler:UnitDead(engineunit) + if engineunit:Team() == self.game:GetTeamID() then + --self.counter = self.counter - 0.2 + --self.counter = math.max(self.counter,8) + -- try and clean up dead recruits where possible + for i,v in ipairs(self.recruits) do + if v.engineID == engineunit:ID() then + table.remove(self.recruits,i) + break + end + end + end +end + +function AttackHandler:DoTargetting() + if #self.recruits > self.counter then + for i,recruit in ipairs(self.recruits) do + recruit:AttackCell(bestCell) + end + --[[ try and catch invalid recruits and remove them, then reevaluate + local nrecruits = {} + for i,v in ipairs(self.recruits) do + if v.unit ~= nil then + table.insert(nrecruits,v) + break + end + end + self.recruits = nrecruits + if #nrecruits > self.counter then + + else + return + end + + -- find somewhere to attack + local cells = {} + local celllist = {} + local mapdimensions = self.game.map:MapDimensions() + --enemies = game:GetEnemies() + local enemies = self.game:GetEnemies() + + if enemies and #enemies > 0 then + -- figure out where all the enemies are! + for i=1,#enemies do + local e = enemies[i] + + if e ~= nil then + pos = e:GetPosition() + px = pos.x - math.fmod(pos.x,400) + pz = pos.z - math.fmod(pos.z,400) + px = px/400 + pz = pz/400 + if cells[px] == nil then + cells[px] = {} + end + if cells[px][pz] == nil then + local newcell = { count = 0, posx = 0,posz=0,} + cells[px][pz] = newcell + table.insert(celllist,newcell) + end + cell = cells[px][pz] + cell.count = cell.count + self:ScoreUnit(e) + + -- we dont want to target the center of the cell encase its a ledge with nothing + -- on it etc so target this units position instead + cell.posx = pos.x + cell.posz = pos.z + + -- @TODO: The unit chosen may not be the best unit to target, ideally pick the + -- one closest to the average location of all units in that grid + end + + end + + local bestCell = nil + -- now find the smallest nonvacant cell to go lynch! + for i=1,#celllist do + local cell = celllist[i] + if bestCell == nil then + bestCell = cell + else + if cell.count < bestCell.count then + bestCell = cell + end + end + end + + -- if we have a cell then lets go attack it! + if bestCell ~= nil then + for i,recruit in ipairs(self.recruits) do + recruit:AttackCell(bestCell) + end + + --self.counter = self.counter + 0.2 + --self.counter = math.min(self.counter,20) + + -- remove all our recruits! + --self.recruits = {} + end + end + ]]-- + -- cleanup + cellist = nil + cells = nil + mapdimensions = nil + + end + +end + +function AttackHandler:IsRecruit(attkbehaviour) + for i,v in ipairs(self.recruits) do + if v.engineID == attkbehaviour.engineID then + return true + end + end + return false +end + +function AttackHandler:AddRecruit(attkbehaviour) + if attkbehaviour.unit == nil then + self.game:SendToConsole( "null unit in attack beh found ") + return + end + if not self:IsRecruit(attkbehaviour) then + table.insert(self.recruits,attkbehaviour) + end +end + +function AttackHandler:RemoveRecruit(attkbehaviour) + for i,v in ipairs(self.recruits) do + if v.engineID == attkbehaviour.engineID then + table.remove(self.recruits,i) + return true + end + end + return false +end + +-- How much is this unit worth? +-- +-- Idea: add a table with hardcoded values, +-- and use said values if a units found in +-- that table to highlight strategic value +function AttackHandler:ScoreUnit(unit) + local value = 1 + --[[ + if unit:CanMove() then + if unit:CanBuild() then + value = value + 1 + end + else + value = value + 2 + if unit:CanBuild() then + value = value + 2 + end + end + --]] + return value +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/autoreclaimbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/autoreclaimbehaviour.lua new file mode 100644 index 000000000..566f37476 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/autoreclaimbehaviour.lua @@ -0,0 +1,44 @@ +AutoReclaimBehaviour = class(Behaviour) + +function AutoReclaimBehaviour:Init() + -- + self.active = false +end + +function AutoReclaimBehaviour:UnitCreated(unit) +end + +function AutoReclaimBehaviour:UnitIdle(unit) + if unit:Internal():ID() == self.unit:Internal():ID() then + if self:IsActive() then + self.unit:ElectBehaviour() + end + end + +end + +function AutoReclaimBehaviour:Update() + --self.game:GetMapFeatures() +end + +function AutoReclaimBehaviour:Activate() + self.active = true + local fcount = self.game.map:GetMapFeatures(self.unit:Internal():GetPosition(),200) + self.unit:Internal():AreaReclaim(self.unit:Internal():GetPosition(),500) +end + +function AutoReclaimBehaviour:Deactivate() + self.active = false +end + +function AutoReclaimBehaviour:Priority() + --if self.build == true then + -- return 100 + --end + --return 0 + return 49 + self.game.map:GetMapFeatures(self.unit:Internal():GetPosition(),500) +end + +function AutoReclaimBehaviour:UnitDead(unit) + -- +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/behaviours.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/behaviours.lua new file mode 100644 index 000000000..138a84cd9 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/behaviours.lua @@ -0,0 +1,127 @@ + +controlPoints = Spring.GetModOptions().scoremode + +if controlPoints == nil then + controlPoints = "disabled" +end + +if controlPoints == "disabled" then + shard_include( "taskqueues" ) + shard_include( "taskqueuebehaviour" ) + shard_include( "attackerbehaviour" ) + shard_include( "bootbehaviour" ) + --shard_include( "morphbehaviour" ) + --shard_include( "engineerturretbehaviour" ) + else + shard_include( "taskqueues" ) + shard_include( "taskqueuebehaviour" ) + shard_include( "attackerbehaviour" ) + shard_include( "bootbehaviour" ) + shard_include( "capturerbehaviour" ) + --shard_include( "morphbehaviour" ) + --shard_include( "engineerturretbehaviour" ) +end + +--shard_include "capturerbehaviour" +--require "missingfactorybehaviour" +--require "autoreclaimbehaviour" +--shard_include "lowenergybehaviour" +--require "factoryregisterbehaviour" + +behaviours = { + eorb = { + TaskQueueBehaviour, + }, + eorb_up1 = { + TaskQueueBehaviour, + }, + eorb_up2 = { + TaskQueueBehaviour, + }, + eorb_up3 = { + TaskQueueBehaviour, + }, + ebasefactory = { + TaskQueueBehaviour, + --FactoryRegisterBehaviour, + }, + eairplant = { + TaskQueueBehaviour, + --FactoryRegisterBehaviour, + }, + eamphibfac = { + TaskQueueBehaviour, + --FactoryRegisterBehaviour, + }, + eminifac = { + TaskQueueBehaviour, + --FactoryRegisterBehaviour, + }, + ecommanderbattleai = { + TaskQueueBehaviour, + --LowEnergyBehaviour, + --EngineerTurretBehaviour, + }, + eengineer5 = { + TaskQueueBehaviour, + --MissingFactoryBehaviour, + --EngineerTurretBehaviour, + --LowEnergyBehaviour, + }, + eamphibengineer = { + TaskQueueBehaviour, + --MissingFactoryBehaviour, + --EngineerTurretBehaviour, + --LowEnergyBehaviour, + }, + eairengineer = { + TaskQueueBehaviour, + --MissingFactoryBehaviour, + --EngineerTurretBehaviour, + --LowEnergyBehaviour, + }, + eallterrengineer = { + TaskQueueBehaviour, + --MissingFactoryBehaviour, + --EngineerTurretBehaviour, + --LowEnergyBehaviour, + }, + --eaimexer = { + --EngineerTurretBehaviour, + --}, +} + +function defaultBehaviours(unit) + b = {} + + u = unit:Internal() + --table.insert(b,MorphBehaviour) + if u:CanBuild() then + table.insert(b,TaskQueueBehaviour) + if u:CanMove() then + local utype = game:GetTypeByName("ebasefactory") + if u:CanBuild(utype) then + table.insert(b,MissingFactoryBehaviour) + end + utype = game:GetTypeByName("elightturret2") + if u:CanBuild(utype) then + table.insert(b,EngineerTurretBehaviour) + end + end + else + if controlPoints == "disabled" then + if IsAttacker(unit) then + table.insert(b,AttackerBehaviour) + end + else + if IsAttacker(unit) then + table.insert(b,AttackerBehaviour) + end + if IsCapturer(unit) then + table.insert(b,CapturerBehaviour) + end + end + end + + return b +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/capturerbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/capturerbehaviour.lua new file mode 100644 index 000000000..91d11b0d3 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/capturerbehaviour.lua @@ -0,0 +1,76 @@ +function IsCapturer(unit) + local noncapturelist = {} + if ShardSpringLua then + if Script.LuaRules('NonCapturingUnits') then + noncapturelist = Script.LuaRules.NonCapturingUnits() or {} + end + end + for i = 1, #noncapturelist do + local name = noncapturelist[i] + if name == unit:Internal():Name() then + return false + end + end + return true +end + +CapturerBehaviour = class(Behaviour) + +local function RandomAway(pos, dist, angle) + angle = angle or math.random() * math.pi * 2 + local away = api.Position() + away.x = pos.x + dist * math.cos(angle) + away.z = pos.z - dist * math.sin(angle) + away.y = pos.y + 0 + return away +end + +function CapturerBehaviour:Init() + self.arePoints = self.ai.controlpointhandler:ArePoints() + if self.ai.controlpointhandler:CaptureRadius() == nil then + return false + end + self.maxDist = math.ceil( self.ai.controlpointhandler:CaptureRadius() * 0.9 ) + self.minDist = math.ceil( self.maxDist / 3 ) +end + +function CapturerBehaviour:UnitIdle(unit) + if not self.active then return end + if unit.engineID == self.unit.engineID then + self:GoForth() + end +end + +function CapturerBehaviour:Update() + if not self.active then return end + if not self.nextCheck or self.game:Frame() == self.nextCheck then + self:GoForth() + end +end + +function CapturerBehaviour:Priority() + if self.arePoints then + return 40 + else + return 0 + end +end + +function CapturerBehaviour:Activate() + self.active = true +end + +function CapturerBehaviour:Deactivate() + self.active = false +end + +function CapturerBehaviour:GoForth() + local upos = self.unit:Internal():GetPosition() + local point = self.ai.controlpointhandler:ClosestUncapturedPoint(upos) + if point and point ~= self.currentPoint then + local movePos = RandomAway( point, math.random(self.minDist,self.maxDist) ) + self.unit:Internal():Move(movePos) + self.currentPoint = point + end + self.nextCheck = self.game:Frame() + math.random(60, 90) +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/engineerturretbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/engineerturretbehaviour.lua new file mode 100644 index 000000000..35fbc4bbc --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/engineerturretbehaviour.lua @@ -0,0 +1,66 @@ +EngineerTurretBehaviour = class(Behaviour) + +function EngineerTurretBehaviour:Init() + -- + self.active = true + self.underfire = false +end + +function EngineerTurretBehaviour:UnitCreated(unit) +end + +function EngineerTurretBehaviour:UnitIdle(unit) + if unit:Internal():ID() == self.unit:Internal():ID() then + if self:IsActive() then + self.unit:ElectBehaviour() + end + end + +end + +function EngineerTurretBehaviour:Update() + -- +end + +function EngineerTurretBehaviour:Activate() + self.underfire = false + + local s = self.unit:Internal():Build("emine") + if s then + self.active = true + else + self.unit:ElectBehaviour() + end +end + +function EngineerTurretBehaviour:Deactivate() + self.underfire = false + + local s = self.unit:Internal():Build("emine") + if s then + self.active = true + else + self.unit:ElectBehaviour() + end +end + +function EngineerTurretBehaviour:Priority() + if self.underfire == true then + return 150 + end + return 0 +end + +function EngineerTurretBehaviour:UnitDead(unit) + -- +end + +function EngineerTurretBehaviour:UnitDamaged(unit,attacker) + if unit:Internal():ID() == self.unit:Internal():ID() then + if not self:IsActive() then + self.underfire = true + self.unit:ElectBehaviour() + end + end +end + diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/factoryregisterbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/factoryregisterbehaviour.lua new file mode 100644 index 000000000..b9dfe15fe --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/factoryregisterbehaviour.lua @@ -0,0 +1,40 @@ +FactoryRegisterBehaviour = class(Behaviour) + +function FactoryRegisterBehaviour:Init() + -- +end + +function FactoryRegisterBehaviour:UnitFinished(unit) + if ai.factories ~= nil then + ai.factories = ai.factories + 1 + else + ai.factories = 1 + end +end + +function FactoryRegisterBehaviour:UnitIdle(unit) + +end + +function FactoryRegisterBehaviour:Update() + -- +end + +function FactoryRegisterBehaviour:Activate() + self.unit:ElectBehaviour() +end + +function FactoryRegisterBehaviour:Deactivate() +end + +function FactoryRegisterBehaviour:Priority() + return 0 +end + +function FactoryRegisterBehaviour:UnitDead(unit) + if ai.factories ~= nil then + ai.factories = ai.factories - 1 + else + ai.factories = 0 + end +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/lowenergybehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/lowenergybehaviour.lua new file mode 100644 index 000000000..f6a69710e --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/lowenergybehaviour.lua @@ -0,0 +1,73 @@ +LowEnergyBehaviour = class(Behaviour) + +function LowEnergyBehaviour:Init() + -- + self.active = false + self.underfire = false +end + +function LowEnergyBehaviour:UnitCreated(unit) +end + +function LowEnergyBehaviour:UnitIdle(unit) + if unit:Internal():ID() == self.unit:Internal():ID() then + + if not self:IsActive() then + res = game:GetResourceByName("energy") + if res == nil then + game:SendToConsole("res == nil in LowEnergyBehaviour") + else + if res.reserves == 0 then + self.underfire = true + self.unit:ElectBehaviour() + end + end + else + self.underfire = false + self.unit:ElectBehaviour() + end + + end + if unit:Internal():ID() == self.unit:Internal():ID() then + if self:IsActive() then + self.unit:ElectBehaviour() + end + end + +end + +function LowEnergyBehaviour:Update() + -- +end + +function LowEnergyBehaviour:Activate() + self.underfire = false + + local s = self.unit:Internal():Build("emediumgen") + if s then + self.active = true + else + self.unit:ElectBehaviour() + end +end + +function LowEnergyBehaviour:Deactivate() + self.active = false + self.underfire = false +end + +function LowEnergyBehaviour:Priority() + if self.underfire == true then + return 110 + end + return 0 +end + +function LowEnergyBehaviour:UnitDead(unit) + -- +end + +function LowEnergyBehaviour:UnitDamaged(unit,attacker) + +end + diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/missingfactorybehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/missingfactorybehaviour.lua new file mode 100644 index 000000000..a31dfb2c2 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/missingfactorybehaviour.lua @@ -0,0 +1,59 @@ +MissingFactoryBehaviour = class(Behaviour) + +function MissingFactoryBehaviour:Init() + -- + self.active = false + self.building = false + self.build = false +end + +function MissingFactoryBehaviour:UnitCreated(unit) +end + +function MissingFactoryBehaviour:UnitIdle(unit) + if unit:Internal():ID() == self.unit:Internal():ID() then + self.building = false + if self:IsActive() then + self.unit:ElectBehaviour() + end + end +end + +function MissingFactoryBehaviour:Update() + -- +end + +function MissingFactoryBehaviour:Activate() + self.build = false + + local s = self.unit:Internal():Build("ebasefactory") + if s then + self.active = true + self.building = true + else + self.unit:ElectBehaviour() + end +end + +function MissingFactoryBehaviour:Deactivate() + self.active = false + self.building = false + self.build = false +end + +function MissingFactoryBehaviour:Priority() + if self.build == true then + return 100 + end + return 0 +end + +function MissingFactoryBehaviour:UnitDead(unit) + if unit:Internal():Name() == "ebasefactory" then + self.build = true + --game:SendToConsole("missingfactory activated") + elseif unit:Internal():Name() == "ebasefactory" then + self.build = true + --game:SendToConsole("missingfactory activated") + end +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/modules.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/modules.lua new file mode 100644 index 000000000..9494de96b --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/modules.lua @@ -0,0 +1,35 @@ + +controlPoints = Spring.GetModOptions().scoremode + +if controlPoints == nil then + controlPoints = "disabled" +end + +if controlPoints == "disabled" then + shard_include( "spothandler" ) + shard_include( "unithandler" ) + shard_include( "attackhandler" ) + shard_include( "placementhandler" ) + shard_include( "sleep" ) + + modules = { UnitHandler, AttackHandler, MetalSpotHandler, PlacementHandler, Sleep } +else + shard_include( "spothandler" ) + shard_include( "controlpointhandler" ) + shard_include( "unithandler" ) + shard_include( "attackhandler" ) + shard_include( "placementhandler" ) + shard_include( "sleep" ) + + modules = { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, PlacementHandler, Sleep } +end + + +--shard_include( "spothandler" ) +--shard_include( "controlpointhandler" ) +--shard_include( "unithandler" ) +--shard_include( "attackhandler" ) +--shard_include( "sleep" ) + +--modules = { UnitHandler, AttackHandler, MetalSpotHandler, Sleep } +--modules = { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, Sleep } diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/placementhandler.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/placementhandler.lua new file mode 100644 index 000000000..db85fd6c3 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/placementhandler.lua @@ -0,0 +1,300 @@ +PlacementHandler = class(Module) + +function PlacementHandler:Name() + return "PlacementHandler" +end + +function PlacementHandler:internalName() + return "placementhandler" +end + +function PlacementHandler:Init() + self.jobs = {} + self.spacing_spiral = self:GenerateSpiral( 5, 5 ) +end + +--[[ +Usage: + +function onSuccess( job, pos ) + -- build something I guess +end +function onFail( job ) + -- nowhere to place it, do something else then? +end +local unittype = ... +local job = { + start_position=[1,2,3], + max_radius=500, + onSuccess=onSuccess, + onFail=onFail, + unittype=unittype, + cleanup_on_unit_death=builderID +} +local success = ai.placementhandler.NewJob( job ) +if success then + -- the job has been schedule, do whatever else we need to do in parallel + -- when a position has been found, it will call the callback function we passed it + -- in the future a promise will be returned letting us define what happens +else + -- there was something wrong with our job and the system rejected it + -- the programmer should probably check all the values that went into the job were set and valid +end + +]] + + +function PlacementHandler:NewJob( details ) + --[[ + local default = { + start_position, + unittype, + placement_tests: [], + max_radius=, + onSuccess=onSuccess, + onFail=onFail, + increment=8 + cleanup_on_unit_death + } + ]]-- + if details["start_position"] == nil then + return false + end + if details["unittype"] == nil then + return false + end + if details["max_radius"] == nil then + details.max_radius = 1500 + end + if details["increment"] == nil then + details.increment = 16 + end + if details.increment < 16 then + details.increment = 16 + end + details.status = 'new' + details.step = 1 + + -- figure out the spiral search pattern necessary + local max_width = details.max_radius * 2 + local spiral_width = max_width/details.increment + details.spiral = self:GenerateSpiral(spiral_width, spiral_width ) + + table.insert( self.jobs, details ) + + -- for now it's using a completion handler, which is a function + -- passed along that it will call when it's finished, but tbh I'd + -- prefer to return some sort of promise structure + return true +end + + +function PlacementHandler:Update() + --[[ + + We need to run through our jobs, but we also need to make sure of several things: + + - when a placement job finishes, we stop processing until the next frame + - that each job only gets a limited amount of time to run + - that the algorithm can run bit by bit over several frames + + To this end, each iteration of the search is self contained. This way we can + progress 5 or 6 steps along the algorithm for each job, making sure we don't + spend too long searching and lag the game out. + + As a bonus, this opens up the future for scheduling and collaborative searches. + It also allows us to cancel and pause searches. + + For our situation, we're going to allot a time budget for each job, and a + time budget for each frame. During this time, we can only work on a job for + so long. If it's a fast CPU we can do more iterations in that time. It also + means we can only work on so many jobs per frame. This way we get the top + of the queue done sooner, so we don't get bogged down in an ever growing queue. + + A bonus of this, is that quick jobs will finish earlier, allowing work to be + done on an extra job. Another side of this is that if the cpu is busy with + stuff, we might have to finish early. I envisage Shard should take time + measurements for the entire frame to make sure that modules such as this + one can give themselves smaller budgets when under load + ]] + + -- exit early if there are no jobs + if #self.jobs == 0 then + return + end + + self:RunIterations() + self:CleanupJobs() +end + +function PlacementHandler:RunIterations() + for i,j in ipairs(self.jobs) do + if j.status ~= 'cleanup' then + local job = self.jobs[i] + self:RunJobIterations( job ) + end + end +end + +function PlacementHandler:RunJobIterations( job ) + local stillGotTime = 4 --500 + -- given this particular job, lets give it a time budget and do as many + -- iterations as we can + while ( stillGotTime > 0 ) and ( job.status ~= 'cleanup' ) do + self:IterateJob( job ) + stillGotTime = stillGotTime - 1 + end +end + +function PlacementHandler:IterateJob( job ) + -- setup this run + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + return + end + job.status = 'running' + local step = job.step + local spos = job.spiral[step] + local pos = { + x=spos.x * job.increment + job.start_position.x, + y=job.start_position.y, + z=spos.y * job.increment + job.start_position.z + } + + -- test this particular step of the spiral + local buildable = self:CanBuildAt(job.unittype, pos ) + if buildable then + -- we found a place! + job.result = pos + job.status = 'cleanup' + SendToUnsynced("shard_debug_position",pos.x,pos.z,"final_choice") + job.onSuccess( job, pos ) + end + + job.step = job.step + 1 + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + end +end + +function PlacementHandler:CanBuildAt( unittype, pos ) + local buildable = self.ai.map:CanBuildHere( unittype, pos ) + if not buildable then + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_bad") + return false + end + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_good") + + + local fixed_spacing = 48 + + --avoiding metal spots( Work in Progress ) + --[[ + local spotPositions = self.game.map:GetMetalSpots() + local spotCount = self.game.map:SpotCount() + for i = 1,spotCount do + metalspot = spotPositions[i] + end + --]] + + --checking for unit positions + local spGetUnitsInRectangle = Spring.GetUnitsInRectangle + local radius = 125 + local units_found = spGetUnitsInRectangle(pos.x - radius, pos.z - radius, pos.x + radius, pos.z + radius) + if #units_found > 0 then + --for i = 1,#units_found do + --local unitID = units_found[i] + --if not UnitDefs[Spring.GetUnitDefID(unitID)].canmove then + --end + --end + return false + end + + -- check spacing + -- we're going to do this in a hacky way for now until a blocking + -- map and footprints are added to the shard API, but on the other + -- hand it's simple + + -- what we're going to do is enforce a standardised minimum + -- spacing, and check above below left and right of the position + -- to check, by shifting the position by a set amount and checking + -- that position + + for i,j in ipairs(self.spacing_spiral) do + testpos = { x=pos.x + ( j.x * fixed_spacing ), y=pos.y, z= pos.z + ( j.x * fixed_spacing ) } + if not self:CanBuildHere( unittype, testpos ) then + return false + end + end + + return true +end + +function PlacementHandler:CanBuildHere(unittype, testpos ) + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + return true +end + +function PlacementHandler:CleanupJobs() + -- try and clean up dead recruits where possible + for i,j in ipairs(self.jobs) do + if j.status == 'cleanup' then + local job = self.jobs[i] + table.remove( self.jobs, i ) + return + end + end +end + +--[[ +Some jobs are tied to units being alive. This could be because +it's the building the job was intended for. Eitherway, if that +unit dies then the associated job is unnecessary, and needs to +be cleaned up to save cpu +]] +function PlacementHandler:UnitDead(engineunit) + for i,j in ipairs(self.jobs) do + if j['cleanup_on_unit_death'] ~= nil then + if j.cleanup_on_unit_death == engineunit:ID() then + j.status = 'cleanup' + end + end + end +end + + +function PlacementHandler:GenerateSpiral( width, height) + local x = 0 + local y = 0 + local dx = 0 + local dy = -1 + local t = math.max(width,height) + local maxI = t*t; + local result = {} + for i=0, maxI do + if ((-width/2 <= x) and (x <= width/2) and (-height/2 <= y) and (y <= height/2)) then + table.insert( result, {x=x,y=y} ) + end + if ( ( x == y ) or ( ( x < 0 ) and ( x == -y ) ) or ( (x > 0) and ( x == 1-y ) ) ) then + t = dx + dx = dy * -1 + dy = t + end + x = x + dx + y = y + dy + end + return result +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/spothandler.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/spothandler.lua new file mode 100644 index 000000000..6305a1fe4 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/spothandler.lua @@ -0,0 +1,40 @@ +MetalSpotHandler = class(Module) + + +function MetalSpotHandler:Name() + return "MetalSpotHandler" +end + +function MetalSpotHandler:internalName() + return "metalspothandler" +end + +function MetalSpotHandler:Init() + --self.spots = game.map:GetMetalSpots() + self.spots = GG.metalSpots +end + +function distance(pos1,pos2) + local xd = pos1.x-pos2.x + local yd = pos1.z-pos2.z + dist = math.sqrt(xd*xd + yd*yd) + return dist +end + +function MetalSpotHandler:ClosestFreeSpot(unittype,position) + local pos = nil + local bestDistance = 50000 + + spotCount = self.game.map:SpotCount() + for i,v in ipairs(self.spots) do + local p = v + local dist = distance(position,p) + if dist < bestDistance then + if self.game.map:CanBuildHere(unittype,p) then + bestDistance = dist + pos = p + end + end + end + return pos +end diff --git a/LuaRules/Gadgets/ai/EvoRTS -- backup/taskqueues.lua b/LuaRules/Gadgets/ai/EvoRTS -- backup/taskqueues.lua new file mode 100644 index 000000000..431cf1baf --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS -- backup/taskqueues.lua @@ -0,0 +1,934 @@ +--[[ +Task Queues! +]]-- + +math.randomseed( os.time() ) +math.random(); math.random(); math.random() + +--------------------------------------------- Functions for AI +local aiDifficulty = Spring.GetModOptions().aidifficulty +local aiUnits = Spring.GetModOptions().aiunits +local aiNukes = Spring.GetModOptions().ainukes +local aiDebug = Spring.GetModOptions().aidebug +local spGetTeamUnitsSorted = Spring.GetTeamUnitsSorted +local spGetUnitDefID = Spring.GetUnitDefID +local spGetTeamResources = Spring.GetTeamResources +local spGetTeamUnitDefCount = Spring.GetTeamUnitDefCount +local spGetTeamInfo = Spring.GetTeamInfo +local spGetTeamStartPosition = Spring.GetTeamStartPosition +local spGetAllyTeamStartBox = Spring.GetAllyTeamStartBox +local liftersqueued = 0 +--Spring.GetGameSeconds() -- checking gametime + +if aiDebug == nil then + aiDebug = "enabled" +end + +if aiUnits == nil then + aiUnits = "enabled" +end + +if aiUnits == nil then + aiUnits = "enabled" +end + +if aiNukes == nil then + aiNukes = "enabled" +end + +if aiDifficulty == nil then + aiDifficulty = "easy" +end + +local WaitRNG = math.random(0,500) +---------------------------------------------------------------- LIFTER QUEUES + + --function MoveToStartLocation( taskqueuebehaviour ) + + --local startxmin, startzmin, startxmax, startzmax = spGetAllyTeamStartBox(ai.allyId) + --local px = math.random(startxmin, startxmax) + --local pz = math.random(startzmin, startzmax) + --local py = 0 + + --Spring.Echo([[AI startxmin ]] .. startxmin .. [[ ]]) + --Spring.Echo([[AI startzmin ]] .. startzmin .. [[ ]]) + --Spring.Echo([[AI startxmax ]] .. startxmax .. [[ ]]) + --Spring.Echo([[AI startzmax ]] .. startzmax .. [[ ]]) + + --local spawnposx, _, spawnposz = spGetTeamStartPosition(ai.id) + --local sx = spawnposx + --local sz = spawnposz + + --Spring.Echo([[AI spawnx ]] .. sx .. [[ ]]) + --Spring.Echo([[AI spawnz ]] .. sz .. [[ ]]) + + --mx = sx - px + --mz = sz - pz + --my = 0 + + --local x = px + --local z = pz + --local y = py + + --Spring.Echo([[AI startlocationx ]] .. mx .. [[ ]]) + --Spring.Echo([[AI startlocationz ]] .. mz .. [[ ]]) + + --Spring.Echo([[AI ID ]] .. ai.id .. [[ ]]) + --Spring.Echo([[AI allyID ]] .. ai.allyId .. [[ ]]) + --return action = "move", position = {x = px, y = py, z = pz}, +--end + + function BuildMex() + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local aimexamount = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.emetalextractor.id) + if mc >= ms - ms*0.10 then + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + if GG.TechCheck("tech1", ai.id) == false and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up1" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up2" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true then + return "eorb_up3" + end + end + else + if aimexamount * 15 <= Spring.GetGameSeconds() then + return "emetalextractor" + else + return "ebomb" + end + end +end + + + function RandomLift() + --Locals + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es = Spring.GetTeamResources(ai.id, "energy") + local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") + local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") + local unitcount = Spring.GetTeamUnitCount(ai.id) + + --DEBUG LOG + if aiDebug == "enabled" then + Spring.Echo([[Shard Debug Log]]) + Spring.Echo([[--Units:]]) + Spring.Echo([[AI have ]] .. unitcount .. [[ units!]]) + Spring.Echo([[--Resources:]]) + Spring.Echo([[AI is using ]] .. su ..[[/]] .. sm .. [[ supply!]]) + Spring.Echo([[AI have ]] .. math.ceil(mc) ..[[/]] .. ms .. [[ metal and ]] .. math.ceil(ec) .. [[/]] .. es .. [[ energy!]]) + Spring.Echo([[AI Metal Income is ]] .. mi.. [[ / -]] .. me ) + Spring.Echo(GG.TechCheck("endbringer", ai.id) ) + else + end + --Spring.SendMessageToPlayer(0, "Hello World!") + ------- Tech 0 - Very Early Game + + if ec <= 50 and GG.TechCheck("tech1", ai.id) == true then + if GG.TechCheck("tech3", ai.id) == true then + return "efusion2" + elseif GG.TechCheck("tech2", ai.id) == true then + return "egeothermal" + else + return "esolar2" + end + elseif mc >= ms - ms*0.10 then + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + if GG.TechCheck("tech1", ai.id) == false and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up1" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up2" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true then + return "eorb_up3" + end + end + elseif es < Spring.GetGameSeconds()*0.5 then + return "estorage" + elseif su >= sm-20 and sm ~= 400 then + return "estorage" + + elseif GG.TechCheck("tech1", ai.id) == false and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.etech1.id) == 0 then + return "etech1" + + else + if GG.TechCheck("tech1", ai.id) == false and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + local r = math.random(0,1) + if r == 0 then + return "emine" + else + return "eturretlightai" + end + + ------- Reached Tech 1 + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + if ec <= 50 then + return "esolar2" + else + local r = math.random(0,2) + local aar = math.random(0,5) + if aar > 0 then + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai" + end + else + return "elaserbattery" + end + end + + ------- Reached Tech 2 MK 2 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + if ec <= 50 then + return "egeothermal" + else + local r2 = math.random(0,20) + local aar = math.random(0,5) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai" + elseif r == 3 then + return "eturretheavyai" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,1) + if r == 0 then + return "eshieldgen" + else + return "ekmar" + end + else + return "elaserbattery" + end + end + + ------- Reached Tech 3 MK 3 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() <= 1500 then + if ec <= 50 then + return "efusion2" + else + local r2 = math.random(0,10) + local aar = math.random(0,5) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai" + elseif r == 3 then + return "eturretheavyai" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,3) + if r == 0 then + return "eshieldgen" + elseif r == 1 then + return "eartyturret_up3" + elseif r == 2 then + return "esiloai" + elseif r == 3 then + return "ekmar" + end + else + return "elaserbattery" + end + end + + ------- Reached MK 4 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() > 1500 then + if ec <= 50 then + return "efusion2" + else + local r2 = math.random(0,5) + local aar = math.random(0,10) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai_up3" + elseif r == 3 then + return "eturretheavyai_up3" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,3) + if r == 0 then + return "eshieldgen" + elseif r == 1 then + return "eartyturret_up3" + elseif r == 2 then + return "esiloai" + elseif r == 3 then + return "ekmar" + end + else + return "elaserbattery" + end + end + end + end +end + +function RandomOverseer() + --Locals + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es = Spring.GetTeamResources(ai.id, "energy") + local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") + local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") + local unitcount = Spring.GetTeamUnitCount(ai.id) + + --DEBUG LOG + if aiDebug == "enabled" then + Spring.Echo([[Shard Debug Log]]) + Spring.Echo([[--Units:]]) + Spring.Echo([[AI have ]] .. unitcount .. [[ units!]]) + Spring.Echo([[--Resources:]]) + Spring.Echo([[AI is using ]] .. su ..[[/]] .. sm .. [[ supply!]]) + Spring.Echo([[AI have ]] .. math.ceil(mc) ..[[/]] .. ms .. [[ metal and ]] .. math.ceil(ec) .. [[/]] .. es .. [[ energy!]]) + else + end + + + + ------- Tech 0 - Very Early Game + if ec <= 50 and GG.TechCheck("tech1", ai.id) == true then + if GG.TechCheck("tech3", ai.id) == true then + return "efusion2" + elseif GG.TechCheck("tech2", ai.id) == true then + return "egeothermal" + else + return "esolar2" + end + elseif mc >= ms - ms*0.20 then + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + if GG.TechCheck("tech1", ai.id) == false and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up1" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up2" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true then + return "eorb_up3" + end + end + elseif GG.TechCheck("tech1", ai.id) == false and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.etech1.id) == 0 then + return "etech1" + + elseif es < Spring.GetGameSeconds()*0.5 then + return "estorage" + else + if Spring.GetGameSeconds() <= 90 then + local r = math.random(0,1) + if mc <= 10 or mi*2 <= me then + return "emetalextractor" + elseif r == 0 then + return "emine" + else + return "eturretlightai" + end + + ------- Reached Tech 1 + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + if ec <= 50 then + return "esolar2" + else + local r = math.random(0,2) + local aar = math.random(0,10) + if aar > 0 then + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai" + end + else + return "elaserbattery" + end + end + + ------- Reached Tech 2 MK 2 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + if ec <= 50 then + return "egeothermal" + else + local r2 = math.random(0,20) + local aar = math.random(0,10) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai" + elseif r == 3 then + return "eturretheavyai" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,1) + if r == 0 then + return "eshieldgen" + else + return "ekmar" + end + else + return "elaserbattery" + end + end + + ------- Reached Tech 3 MK 3 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() <= 1500 then + if ec <= 50 then + return "efusion2" + else + local r2 = math.random(0,15) + local aar = math.random(0,10) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai_up3" + elseif r == 3 then + return "eturretheavyai_up3" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,3) + if r == 0 then + return "eshieldgen" + elseif r == 1 then + return "eartyturret_up3" + elseif r == 2 then + return "esiloai" + elseif r == 3 then + return "ekmar" + end + else + return "elaserbattery" + end + end + + ------- Reached MK 4 + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() > 1500 then + if ec <= 50 then + return "efusion2" + else + local r2 = math.random(0,5) + local aar = math.random(0,10) + if r2 > 0 and aar > 0 then + local r = math.random(0,4) + if r == 0 then + return "emine" + elseif r == 1 then + return "eradar2" + elseif r == 2 then + return "eturretlightai_up3" + elseif r == 3 then + return "eturretheavyai_up3" + elseif r == 4 then + return "ejammerai" + end + elseif r2 == 0 then + local r = math.random(0,3) + if r == 0 then + return "eshieldgen" + elseif r == 1 then + return "eartyturret_up3" + elseif r == 2 then + return "esiloai" + elseif r == 3 then + return "ekmar" + end + else + return "elaserbattery" + end + end + end + end +end + +function RandomUnit() + --Locals + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es = Spring.GetTeamResources(ai.id, "energy") + local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") + local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") + local unitcount = Spring.GetTeamUnitCount(ai.id) + + --DEBUG LOG + if aiDebug == "enabled" then + Spring.Echo([[Shard Debug Log]]) + Spring.Echo([[--Units:]]) + Spring.Echo([[AI have ]] .. unitcount .. [[ units!]]) + Spring.Echo([[--Resources:]]) + Spring.Echo([[AI is using ]] .. su ..[[/]] .. sm .. [[ supply!]]) + Spring.Echo([[AI have ]] .. math.ceil(mc) ..[[/]] .. ms .. [[ metal and ]] .. math.ceil(ec) .. [[/]] .. es .. [[ energy!]]) + else + end + + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id) < 4 then + return "elifterai" + elseif su <= sm-20 and GG.TechCheck("tech1", ai.id) == true then + + if GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then ------- Reached Tech 1 + + local r = math.random(0,12) + if r == 0 then + return "eallterrlight" + elseif r == 1 then + return "eallterrassault" + elseif r == 2 then + return "elighttank3" + elseif r == 3 then + return "eartytank" + elseif r == 4 then + return "escoutdrone" + elseif r == 5 then + return "eamphibarty" + elseif r == 6 then + return "eamphibriot" + elseif r == 7 then + return "eamphibbuggy" + elseif r == 8 then + return "ehbotpeewee" + elseif r == 9 then + return "eriottank2" + elseif r == 10 then + return "eamphibneedle" + elseif r == 11 then + return "eallterrriot" + elseif r == 12 then + return "ehbotthud" + end + + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then ------- Reached Tech 2 MK 2 + + local r = math.random(0,9) + if r == 0 then + return "eheavytank3_up1" + elseif r == 1 then + return "ehbotrocko_up1" + elseif r == 2 then + return "eallterrmed_up1" + elseif r == 3 then + return "eallterrheavy_up1" + elseif r == 4 then + return "egunship2_up1" + elseif r == 5 then + return "ebomber_up1" + elseif r == 6 then + return "efighter_up1" + elseif r == 7 then + return "eamphibrock_up1" + elseif r == 8 then + return "emissiletank_up1" + elseif r == 9 then + return "eamphibmedtank_up1" + end + + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() <= 1300 then ------- Reached Tech 3 MK 3 + local r2 = math.random(0,50) + if r2 ~= 0 then + local r = math.random(0,10) + if r == 0 then + return "eheavytank3_up2" + elseif r == 1 then + return "ehbotrocko_up2" + elseif r == 2 then + return "eallterrmed_up2" + elseif r == 3 then + return "eallterrheavy_up2" + elseif r == 4 then + return "egunship2_up2" + elseif r == 5 then + return "ebomber_up2" + elseif r == 6 then + return "efighter_up2" + elseif r == 7 then + return "eairemp_up2" + elseif r == 8 then + return "eamphibrock_up2" + elseif r == 9 then + return "emissiletank_up2" + elseif r == 10 then + return "eamphibmedtank_up2" + end + elseif r2 == 0 then + if GG.TechCheck("endbringer", ai.id) == true then + local r = math.random(0,4) + if r == 0 then + return "eamphibleveler_up2" + elseif r == 1 then + return "eallterranarchid_up2" + elseif r == 2 then + return "elacerator_up2" + elseif r == 3 then + return "ekrow_up2" + elseif r == 4 then + return "ehbotkarganneth_up2" + end + else + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + return "eorb_up2" + end + end + end + + elseif GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true and Spring.GetGameSeconds() > 1300 then ------- Reached MK 4 + + local r2 = math.random(0,50) + if r2 ~= 0 then + local r = math.random(0,8) + if r == 0 then + return "eheavytank3_up3" + elseif r == 1 then + return "ehbotrocko_up3" + elseif r == 2 then + return "eallterrmed_up3" + elseif r == 3 then + return "eallterrheavy_up3" + elseif r == 4 then + return "egunship2_up3" + elseif r == 5 then + return "eairemp_up3" + elseif r == 6 then + return "eamphibrock_up3" + elseif r == 7 then + return "emissiletank_up3" + elseif r == 8 then + return "eamphibmedtank_up3" + end + elseif r2 == 0 then + if GG.TechCheck("endbringer", ai.id) == true then + local r = math.random(0,4) + if r == 0 then + return "eamphibleveler_up3" + elseif r == 1 then + return "eallterranarchid_up3" + elseif r == 2 then + return "elacerator_up3" + elseif r == 3 then + return "ekrow_up3" + elseif r == 4 then + return "ehbotkarganneth_up3" + end + else + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + return "eorb_up3" + end + end + end + end + else + if es < Spring.GetGameSeconds()*0.5 then + return "estorage" + elseif mc >= ms - ms*0.20 then + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elifterai.id)*60 < Spring.GetGameSeconds() then + return "elifterai" + else + if GG.TechCheck("tech1", ai.id) == false and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == false and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up1" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == false then + return "eorb_up2" + elseif GG.TechCheck("tech1", ai.id) == true and GG.TechCheck("tech2", ai.id) == true and GG.TechCheck("tech3", ai.id) == true then + return "eorb_up3" + end + end + elseif Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.emine.id) > Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretlightai.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretlightai_up3.id) and GG.TechCheck("tech1", ai.id) then + if Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretlightai.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretlightai_up3.id) > Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretheavyai.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eturretheavyai_up3.id) and GG.TechCheck("tech2", ai.id) then + if GG.TechCheck("tech3", ai.id) then + return "eturretheavyai_up3" + else + return "eturretheavyai" + end + else + if GG.TechCheck("tech3", ai.id) then + return "eturretlightai_up3" + else + return "eturretlightai" + end + end + else + local r = math.random(0,5) + if r == 0 then + return "emine" + elseif r == 1 then + return "escoutdrone" + else + return "ebomb" + end + end + end + end + +function BuildTechLab() + if not GG.TechCheck("tech1", ai.id) and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.etech1.id) == 0 then + return "etech1" + else + return "emine" + end +end + + + +---------------------------------------------------------------- QUEUES + + + +local idlelist = { + { action = "wait", frames = 3000}, +} + +local assistqueue = { + { action = "patrolrelative", position = {x = 100, y = 0, z = 100} }, +} + +local overseerlistfirst = { + "emetalextractor", + "emetalextractor", + "emetalextractor", + "elifterai", + "eorb", + "elifterai", + "eorb", + "elifterai", + "eorb", + "eturretlightai", + "elifterai", + "eturretlightai", + BuildTechLab, + "elifterai", + "eorb", + "eorb", + "eturretlightai", + "elifterai", +} + +local overseerorders = { + RandomOverseer, + RandomOverseer, + RandomOverseer, + RandomOverseer, + BuildTechLab, + "elifterai", +} + +local lifterlist = { + RandomUnit, + RandomUnit, + RandomUnit, + BuildMex, + RandomLift, +} + +local lifterareamex = { + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", + "emetalextractor", +} + +local unitsqueue = { + RandomUnit, +} +----------------------------------------------------- +--local factory = { +--} + +--local airplant = { +--} + +--local amphibfactory = { +--} + +--local allterrfactory = { +-- + +--local orbs = { + --{ action = "moverelative", position = {x = math.random(-200, 200), y = math.random(-200, 200), z = math.random(-200, 200)} }, + --{ action = "moverelative", position = {x = math.random(-200, 200), y = math.random(-200, 200), z = math.random(-200, 200)} }, + --{ action = "moverelative", position = {x = math.random(-200, 200), y = math.random(-200, 200), z = math.random(-200, 200)} }, + --{ action = "moverelative", position = {x = math.random(-200, 200), y = math.random(-200, 200), z = math.random(-200, 200)} }, +--} + + +local function overseerqueue() + if ai.engineerfirst == true then + return overseerorders + else + ai.engineerfirst = true + return overseerlistfirst + end +end + +local function lifterqueue() + if liftersqueued > 2 then + liftersqueued = liftersqueued - 0.02 + return lifterlist + else + liftersqueued = liftersqueued + 1 + return lifterareamex + end +end + +taskqueues = { + --builders + ecommanderbattleai = overseerqueue, + elifterai = lifterqueue, + eunitfactoryai = unitsqueue, + eorb = assistqueue, + eorb_up1 = assistqueue, + eorb_up2 = assistqueue, + eorb_up3 = assistqueue, +} +---------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS/aimodehandler.lua b/LuaRules/Gadgets/ai/EvoRTS/aimodehandler.lua new file mode 100644 index 000000000..76c69f276 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/aimodehandler.lua @@ -0,0 +1,76 @@ +AiModeHandler = class(Module) + +function AiModeHandler:Name() + return "AiModeHandler" +end + +function AiModeHandler:internalName() + return "aimodehandler" +end + +local UDC = function(teamID, DefID) + return #Spring.GetTeamUnitsByDefs(ai.id, DefID) +end +local UDN = UnitDefNames +--local advBuilders = {UDN.armacv.id, UDN.armack.id, UDN.armaca.id, UDN.coracv.id, UDN.corack.id, UDN.coraca.id} +local modenames = {"balanced", "t1", "tech"} +function AiModeHandler:Init() + self.resources = {metal = {}, energy = {}} + for res, tab in pairs(self.resources) do + local c, s, p, i, e = Spring.GetTeamResources(self.ai.id, res) + self.resources[res] = {c = c, s = s, p = p, i = i, e = e} + end + math.randomseed( os.time() + self.ai.id ) + math.random(); math.random(); math.random() + --self:PickASide(math.random(1,6)) + --self:CreateWantedTechTree(math.random(1,12),math.random(1,12)) + --local count = #Spring.GetTeamList(self.ai.allyId) + --if count and count > 1 then + --self:Mode(math.random(1,count)%3 + 1) + --else + self:Mode(1) + --end +end + +function AiModeHandler:Update() + local frame = Spring.GetGameFrame() + if frame%15 == self.ai.id%15 then + for res, tab in pairs(self.resources) do + local c, s, p, i, e = Spring.GetTeamResources(self.ai.id, res) + if Spring.GetTeamRulesParam(self.ai.id,'mmUse') and tonumber(Spring.GetTeamRulesParam(self.ai.id,'mmUse')) then + e = e - tonumber(Spring.GetTeamRulesParam(self.ai.id,'mmUse')) + end + self.resources[res] = {c = c, s = s, p = p, i = i, e = e} + end + end +end + + +function AiModeHandler:Mode(i) + self.perraider = 30 + self.perskirmer = 40 + self.nodefenderscounter = math.random(1200,2400) + self.noregroupcounter = self.nodefenderscounter + math.random(600,1200) +end + +-- function AiModeHandler:PickASide(i) + -- if i == 1 then + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommanderbattleai.id) + -- self.faction = "OC" + -- elseif i == 2 then + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommanderbuildai.id) + -- self.faction = "OC" + -- elseif i == 3 then + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommandercloakai.id) + -- self.faction = "OC" + -- elseif i == 4 then + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommanderfactoryai.id) + -- self.faction = "OC" + -- elseif i == 5 then + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommandershieldai.id) + -- self.faction = "OC" + -- else + -- Spring.SetTeamRulesParam(self.ai.id, "startUnit", UnitDefNames.ecommanderhealerai.id) + -- self.faction = "OC" + -- end +-- end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS/attackerbehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS/attackerbehaviour.lua new file mode 100644 index 000000000..10e0b8fec --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/attackerbehaviour.lua @@ -0,0 +1,315 @@ +shard_include( "attackers" ) + + +-- speedups +local SpGetGameFrame = Spring.GetGameFrame +local SpGetUnitPosition = Spring.GetUnitPosition +local SpGetUnitSeparation = Spring.GetUnitSeparation +local SpGetUnitVelocity = Spring.GetUnitVelocity +local SpGetUnitMaxRange = Spring.GetUnitMaxRange +local SpValidUnitID = Spring.ValidUnitID +local SpGetUnitCurrentBuildPower = Spring.GetUnitCurrentBuildPower +local SpGetUnitNearestEnemy = Spring.GetUnitNearestEnemy +local Echo = Spring.Echo +------ + + +function IsAttacker(unit) + for i,name in ipairs(attackerlist) do + if name == unit:Internal():Name() then + return true + end + end + return false +end + +AttackerBehaviour = class(Behaviour) + +function AttackerBehaviour:Init() + --self.ai.game:SendToConsole("attacker!") + --self.game:AddMarker({ x = startPosx, y = startPosy, z = startPosz }, "my start position") + CMD.MOVE_STATE = 50 + CMD.FIRE_STATE = 45 +end + +local function Distance(x1,z1, x2,z2) + local vectx = x2 - x1 + local vectz = z2 - z1 + local dis = math.sqrt(vectx^2+vectz^2) + return dis +end + +function AttackerBehaviour:Update() + if not self.active then -- do not even attempt anything if the unit is inactive... + return + end + if not self.unitID then + self.unitID = self.unit:Internal().id + end + if not self.AggFactor then + self.AggFactor = self.ai.attackhandler:GetAggressiveness(self) + end + if not self.type then + self.type = self.ai.attackhandler:GetRole(self) + end + local frame = SpGetGameFrame() + if (frame%450 == self.unitID%450) or self.myRange == nil then --refresh "myRange" casually because it can change with experience + local unitID = self.unit:Internal().id + local unitDefID = Spring.GetUnitDefID(unitID) + if UnitDefs[unitDefID].customParams.retreatrangedai then + --Spring.Echo("ORB RANGE!") + self.myRange = tonumber(UnitDefs[unitDefID].customParams.retreatrangedai) + else + --Spring.Echo("NORMAL RANGE!") + self.myRange = SpGetUnitMaxRange(self.unitID) + end + end + if (frame%90 == self.unitID%90) then -- a unit on map stays 'visible' for max 3s, this also reduces lag + local nearestVisibleAcrossMap = SpGetUnitNearestEnemy(self.unitID, self.AggFactor*self.myRange) + if nearestVisibleAcrossMap and (GG.AiHelpers.VisibilityCheck.IsUnitVisible(nearestVisibleAcrossMap, self.ai.id)) then + self.nearestVisibleAcrossMap = nearestVisibleAcrossMap + end + end + if (frame%45 == self.unitID%45) then -- a unit in range stays 'visible' for max 1.5s, this also reduces lag + local nearestVisibleInRange = SpGetUnitNearestEnemy(self.unitID, 2*self.myRange) + local closestVisible = nearestVisibleInRange and GG.AiHelpers.VisibilityCheck.IsUnitVisible(nearestVisibleInRange, self.ai.id) + if nearestVisibleInRange and closestVisible then + self.nearestVisibleInRange = nearestVisibleInRange + self.enemyRange = SpGetUnitMaxRange(nearestVisibleInRange) + end + end + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + local distance = (nearestEnemy and SpGetUnitSeparation(self.unitID, nearestEnemy)) or 300 + local refreshRate = math.max(math.floor(((distance*0.5 or 250)/10)),10) + if self.unitID%refreshRate == frame%refreshRate then + self:AttackCell(self.type, self.nearestVisibleAcrossMap, self.nearestVisibleInRange, self.enemyRange) + end +end + +function AttackerBehaviour:OwnerBuilt() + --Echo("registered unit construction") + self.unit:Internal():ExecuteCustomCommand(CMD.MOVE_STATE, { 2 }, {}) + self.unit:Internal():ExecuteCustomCommand(CMD.FIRE_STATE, { 2 }, {}) + self.unit:Internal():ExecuteCustomCommand(37382, { 1 }, {}) + self.unit:Internal():ExecuteCustomCommand(34569, { 1 }, {}) + self.attacking = true + self.active = true + self.unitID = self.unit:Internal().id + self.AggFactor = self.ai.attackhandler:GetAggressiveness(self) + self.type = self.ai.attackhandler:GetRole(self) + self.repairThisUnit = false +end + +function AttackerBehaviour:OwnerDead() +end + +function AttackerBehaviour:OwnerIdle() + self.attacking = true + self.active = true +end + +function AttackerBehaviour:AttackCell(type, nearestVisibleAcrossMap, nearestVisibleInRange, enemyRange) + --Echo("trying to get attack position") + local p + local unit = self.unit:Internal() + local unitID = unit.id + local teamID = ai.id + local unitDefID = Spring.GetUnitDefID(unitID) + --local unitCanMove = UnitDefs[unitDefID].canMove + local mc, ms = Spring.GetTeamResources(teamID, "metal") + local ec, es = Spring.GetTeamResources(teamID, "energy") + local r = math.random(0,20) + local currenthealth = unit:GetHealth() + local maxhealth = unit:GetMaxHealth() + if currenthealth < maxhealth*0.99 and currenthealth < 5000 then + self.repairThisUnit = true + elseif currenthealth >= maxhealth*0.99 then + self.repairThisUnit = false + end + if r == 0 and string.find(UnitDefs[unitDefID].name, "eartytank") then + self.unit:Internal():EZMorph() + elseif r == 0 and string.find(UnitDefs[unitDefID].name, "riot") then + self.unit:Internal():EZMorph() + elseif r < 10 and string.find(UnitDefs[unitDefID].name, "eartyturret") then + self.unit:Internal():EZMorph() + return + elseif string.find(UnitDefs[unitDefID].name, "ehbot") and not string.find(UnitDefs[unitDefID].name, "turret") then + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + local EnemyDefID = Spring.GetUnitDefID(nearestEnemy) + local nearestEnemyDistance = SpGetUnitSeparation(self.unitID,nearestEnemy) + if nearestEnemyDistance < self.myRange*1.30 and self.repairThisUnit == false then + if UnitDefs[EnemyDefID].customParams and UnitDefs[EnemyDefID].customParams.armortype ~= "building" then + self.unit:Internal():EZMorph() + end + end + elseif string.find(UnitDefs[unitDefID].name, "ehbot") and string.find(UnitDefs[unitDefID].name, "turret") then + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + local EnemyDefID = Spring.GetUnitDefID(nearestEnemy) + local nearestEnemyDistance = SpGetUnitSeparation(self.unitID,nearestEnemy) + if nearestEnemyDistance >= self.myRange+50 or self.repairThisUnit == true or (UnitDefs[EnemyDefID].customParams and UnitDefs[EnemyDefID].customParams.armortype == "building") then + self.unit:Internal():EZMorph() + end + elseif (UnitDefs[unitDefID].name == "etech1" or UnitDefs[unitDefID].name == "etech2") then + self.unit:Internal():EZMorph() + return + elseif string.find(UnitDefs[unitDefID].name, "eorb") and ec > es*0.98 then + self.unit:Internal():EZMorph() + elseif (string.find(UnitDefs[unitDefID].name, "emetalextractor") or string.find(UnitDefs[unitDefID].name, "xmetalextractor")) and ec > es*0.98 then + self.unit:Internal():EZMorph() + return + end + if string.find(UnitDefs[unitDefID].name, "eallterr") then + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + local nearestEnemyDistance = SpGetUnitSeparation(self.unitID,nearestEnemy) + if nearestEnemyDistance < 2000 then + self.unit:Internal():ExecuteCustomCommand(37382, { 1 }, {}) + else + self.unit:Internal():ExecuteCustomCommand(37382, { 0 }, {}) + end + end + -- Retreating so we have less data process/only what matters + if self.repairThisUnit then + --Echo("trying to retreat") + local nanotcx, nanotcy, nanotcz = GG.AiHelpers.NanoTC.GetClosestNanoTC(self.unitID) + if nanotcx and nanotcy and nanotcz then + p = api.Position() + p.x, p.y, p.z = nanotcx, nanotcy, nanotcz + else + p = self.ai.attackhandler.commpos + end + self.target = p + self.attacking = false + if self.active and self.target then + self.unit:Internal():Move(self.target) + return + else + self.repairThisUnit = false + end + end + + local utype = self.game:GetTypeByName(unit:Name()) + local attacker = (type == "attacker") + + -- nil/invalid checks + if nearestVisibleInRange and (not SpValidUnitID(nearestVisibleInRange)) then + nearestVisibleInRange = nil + self.nearestVisibleInRange = nil + end + if nearestVisibleAcrossMap and (not SpValidUnitID(nearestVisibleAcrossMap)) then + nearestVisibleAcrossMap = nil + self.nearestVisibleAcrossMap = nil + end + + if not self.repairThisUnit and nearestVisibleInRange and (not utype:CanFly() == true) then -- process cases where there isn't any visible nearestVisibleInRange first + --Echo("trying to attack nearby enemy") + local ex,ey,ez = SpGetUnitPosition(nearestVisibleInRange) + local ux,uy,uz = SpGetUnitPosition(self.unitID) + local pointDis = SpGetUnitSeparation(self.unitID,nearestVisibleInRange) + local dis = 120 + local f = dis/pointDis + local wantedRange + if self.myRange and enemyRange and self.myRange >= enemyRange and enemyRange > 50 then -- we skirm here + wantedRange = self.myRange + else -- randomize wantedRange between 25-75% of myRange + wantedRange = math.random(self.myRange*0.70, self.myRange*0.80) + end + -- offset upos randomly so it moves a bit while keeping distance + local dx, _, dz, dw = SpGetUnitVelocity(self.unitID) -- attempt to not always queue awful turns + local modifier = "ctrl" + ux = ux + math.random (-80,80) + uy = uy + uz = uz + math.random (-80,80) + if wantedRange <= pointDis then + modifier = nil -- Do not try to move backwards if attempting to get closer to target + end + -- here we find the goal position + if (pointDis+dis > wantedRange) then + f = (wantedRange-pointDis)/pointDis + end + local cx = ux+(ux-ex)*f + local cy = uy + local cz = uz+(uz-ez)*f + if unit:Name() == "eorb" or unit:Name() == "eorb_up1" or unit:Name() == "eorb_up2" or unit:Name() == "eorb_up3" then + if SpGetUnitCurrentBuildPower(unit.id) == 0 then -- if currently IDLE + self.unit:Internal():ExecuteCustomCommand(CMD.FIGHT, {cx, cy, cz}, {modifier}) + end + else + --Echo("attacking nearby enemy") + self.unit:Internal():ExecuteCustomCommand(CMD.MOVE, {cx, cy, cz}, {modifier}) + end + return + end + + -- We have processed units that had to retreat and units that had visible enemies within 2* their range + -- what are left are units with no visible enemies within 2*maxRange (no radar/los/prevLOS buildings) + local enemyposx, enemyposy, enemyposz + if not self.repairThisUnit and nearestVisibleAcrossMap then + --Echo("Attacking nearest enemy on map") + enemyposx, enemyposy, enemyposz = SpGetUnitPosition(nearestVisibleAcrossMap) -- visible on map + elseif not self.repairThisUnit then + --Echo("IDFK what i'm doing with my life") + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + if nearestEnemy then + enemyposx, enemyposy, enemyposz = SpGetUnitPosition(nearestEnemy) + end + --local cms = self.ai.attackhandler.targetMexes[(self.unitID%5)+1] + --if cms then -- there is an enemy metal spot + --enemyposx, enemyposy, enemyposz = cms.x, cms.y, cms.z + --else -- there is nothing to target + --return + --end + end + + p = api.Position() + if p == nil then + return + end + p.x = enemyposx + math.random(-math.sqrt(2)/2*self.myRange*0.90, math.sqrt(2)/2*self.myRange*0.90) or 0 + p.z = enemyposz + math.random(-math.sqrt(2)/2*self.myRange*0.90, math.sqrt(2)/2*self.myRange*0.90) or 0 + p.y = enemyposy or 0 + self.target = p + self.attacking = true + if unit:Name() == "eorb" or unit:Name() == "eorb_up1" or unit:Name() == "eorb_up2" or unit:Name() == "eorb_up3" then + if SpGetUnitCurrentBuildPower(unit.id) == 0 then -- if currently IDLE then + unit:MoveAndPatrol(self.target) + end + return + else + if (utype:CanFly() == true) and not (unit:Name() ~= "escoutdrone" or unit:Name() ~= "zairscout") then + local nearestEnemy = SpGetUnitNearestEnemy(self.unitID, 30000, false) + if nearestEnemy then + --Echo("I'm battle aircraft and i'm attacking") + unit:Attack(nearestEnemy) + end + else + --Echo("I'm anything else and i'm attacking") + unit:MoveAndFire(self.target) + end + return + end +end + + +function AttackerBehaviour:Priority() + if not self.attacking then + return 0 + else + return 100 + end +end + +function AttackerBehaviour:Activate() + self.active = true + if self.target then + self.unit:Internal():MoveAndFire(self.target) + self.target = nil + else + end +end + + +function AttackerBehaviour:OwnerDied() + self.attacking = nil + self.active = nil + self.unit = nil +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS/attackers.lua b/LuaRules/Gadgets/ai/EvoRTS/attackers.lua new file mode 100644 index 000000000..03e7ac25a --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/attackers.lua @@ -0,0 +1,276 @@ +--[[ +Attackers! +]]-- + +attackerlist = { + ------------- Morphs + ---Buildings, just to make them upgrade + "emetalextractor", + "emetalextractor_up1", + "emetalextractor_up2", + "etech1", + "etech2", + ---Amphibs + "eamphibriot_shotgun", + "eamphibriot_shotgun_up1", + "eamphibriot_shotgun_up2", + "eamphibriot_shotgun_up3", + ---AllTerr + "eallterrriot_shotgun", + "eallterrriot_shotgun_up1", + "eallterrriot_shotgun_up2", + "eallterrriot_shotgun_up3", + ---Hbots + "ehbotpeewee_turret", + "ehbotpeewee_turret_up1", + "ehbotpeewee_turret_up2", + "ehbotpeewee_turret_up3", + "ehbotrocko_turret", + "ehbotrocko_turret_up1", + "ehbotrocko_turret_up2", + "ehbotrocko_turret_up3", + "ehbotsniper_turret", + "ehbotsniper_turret_up1", + "ehbotsniper_turret_up2", + "ehbotsniper_turret_up3", + "ehbotthud_turret", + "ehbotthud_turret_up1", + "ehbotthud_turret_up2", + "ehbotthud_turret_up3", + "ehbotkarganneth_turret", + "ehbotkarganneth_turret_up1", + "ehbotkarganneth_turret_up2", + "ehbotkarganneth_turret_up3", + ---Hover + "eriottank2_shotgun", + "eriottank2_shotgun_up1", + "eriottank2_shotgun_up2", + "eriottank2_shotgun_up3", + "eartytank_saturation", + "eartytank_saturation_up1", + "eartytank_saturation_up2", + "eartytank_saturation_up3", + + ------------- Endbringers + "eallterranarchid", + "eallterranarchid_up1", + "eallterranarchid_up2", + "eallterranarchid_up3", + "eamphibleveler", + "eamphibleveler_up1", + "eamphibleveler_up2", + "eamphibleveler_up3", + "elacerator", + "elacerator_up1", + "elacerator_up2", + "elacerator_up3", + "ekrow", + "ekrow_up1", + "ekrow_up2", + "ekrow_up3", + "ehbotkarganneth", + "ehbotkarganneth_up1", + "ehbotkarganneth_up2", + "ehbotkarganneth_up3", + + ------------- Basic + "escoutdrone", + "eairemp", + "eraider", + "edrone", + "elighttank3", + "eamphibbuggy", + "eallterrlight", + "efighter", + "ebomber", + "egunship2", + "emissiletank", + "eartytank", + "eamphibrock", + "eamphibarty", + "eamphibneedle", + "emediumtank3", + "eheavytank3", + "eamphibmedtank", + "eallterrmed", + "eallterrheavy", + "eallterrassault", + "eriottank2", + "eamphibriot", + "eallterrriot", + "edrone", + "ehbotpeewee", + "ehbotrocko", + "ehbotsniper", + "ehbotthud", + "ebox", + "eorbai", + "eaimexer", + "escout", + "eallterrshield", + + -------------- Upgrade 1 + "eraider_up1", + "eairemp_up1", + "edrone_up1", + "elighttank3_up1", + "eamphibbuggy_up1", + "eallterrlight_up1", + "efighter_up1", + "ebomber_up1", + "egunship2_up1", + "emissiletank_up1", + "eartytank_up1", + "eamphibrock_up1", + "eamphibarty_up1", + "eamphibneedle_up1", + "emediumtank3_up1", + "eheavytank3_up1", + "eamphibmedtank_up1", + "eallterrmed_up1", + "eallterrheavy_up1", + "eallterrassault_up1", + "eriottank2_up1", + "eamphibriot_up1", + "eallterrriot_up1", + "ehbotpeewee_up1", + "ehbotrocko_up1", + "ehbotsniper_up1", + "ehbotthud_up1", + "escout_up1", + "eallterrshield_up1", + + --------------- Upgrade 2 + "eraider_up2", + "eairemp_up2", + "edrone_up2", + "elighttank3_up2", + "eamphibbuggy_up2", + "eallterrlight_up2", + "efighter_up2", + "ebomber_up2", + "egunship2_up2", + "emissiletank_up2", + "eartytank_up2", + "eamphibrock_up2", + "eamphibarty_up2", + "eamphibneedle_up2", + "emediumtank3_up2", + "eheavytank3_up2", + "eamphibmedtank_up2", + "eallterrmed_up2", + "eallterrheavy_up2", + "eallterrassault_up2", + "eriottank2_up2", + "eamphibriot_up2", + "eallterrriot_up2", + "ehbotpeewee_up2", + "ehbotrocko_up2", + "ehbotsniper_up2", + "ehbotthud_up2", + "escout_up2", + "eallterrshield_up2", + + ----------------------------- Upgrade 3 + "eraider_up3", + "eairemp_up3", + "edrone_up3", + "elighttank3_up3", + "eamphibbuggy_up3", + "eallterrlight_up3", + "efighter_up3", + "ebomber_up3", + "egunship2_up3", + "emissiletank_up3", + "eartytank_up3", + "eamphibrock_up3", + "eamphibarty_up3", + "eamphibneedle_up3", + "emediumtank3_up3", + "eheavytank3_up3", + "eamphibmedtank_up3", + "eallterrmed_up3", + "eallterrheavy_up3", + "eallterrassault_up3", + "eriottank2_up3", + "eamphibriot_up3", + "eallterrriot_up3", + "ehbotpeewee_up3", + "ehbotrocko_up3", + "ehbotsniper_up3", + "ehbotthud_up3", + "escout_up3", + "eallterrshield_up3", + + ---------------------------- Chickens + "chicken_dodo1", + "chicken_dodo2", + "chicken1", + "chicken1b", + "chicken1c", + "chicken1x", + "chicken1y", + "chicken1z", + "chicken2", + "chicken2b", + "chickena1", + "chickena1b", + "chickena1c", + "chickena2", + "chickena2b", + "chickenc1", + "chickenc2", + "chickenc3", + "chickenc3b", + "chickenc3c", + "chickenf1", + "chickenf1b", + "chickenh1", + "chickenh1b", + "chickenh2", + "chickenh3", + "chickenh4", + "chickenh5", + "chickenp1", + "chickenr1", + "chickenr2", + "chickenr3", + "chickens1", + "chickens2", + "chickens3", + "chickenw1", + "chickenw1b", + "chickenw1c", + "chickenw1d", + "chickenw2", + "e_chickenq", + "epic_chickenq", + "h_chickenq", + "n_chickenq", + "ve_chickenq", + "vh_chickenq", + "roost", + --------------------- Zaals + "zairscout", + "zairtoairfighter", + "zairtogroundfighter", + "zarty", + "zkamikaze", + "zlightswarm", + "zmedswarm", + "zpyro", + "zqueen", + "zskirmisher", + "zassault", + "zairbomber", + + -------------------- Pattern + "xmetalextractor", + "xcrasher", + "xflea", + "xhammer", + "xrocko", + "xskulk", + "xwarrior", + +} diff --git a/LuaRules/Gadgets/ai/EvoRTS/attackhandler.lua b/LuaRules/Gadgets/ai/EvoRTS/attackhandler.lua new file mode 100644 index 000000000..eadc3b7c3 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/attackhandler.lua @@ -0,0 +1,94 @@ +AttackHandler = class(Module) + +function AttackHandler:Name() + return "AttackHandler" +end + +function AttackHandler:internalName() + return "attackhandler" +end + +function AttackHandler:Init() + self.recruits = {attackers = {}, defenders = {}} + self.counter = 1 + self.ratio = 10 +end + +function AttackHandler:Update() + local frame = Spring.GetGameFrame() + if frame%30 == 0 then -- Refresh commander position + local x,y,z + local comms = Spring.GetTeamUnitsByDefs(self.ai.id, {UnitDefNames.ecommanderbattleai.id}) + if comms[1] then + x,y,z = Spring.GetUnitPosition(comms[1]) + self.commpos = {x = x, y = y, z = z} + end + end + if frame%3000 == 0 then -- Generate random mexpositions + local positions = self:PickRandomPositionsOnMap() + local targets = {} + for ct, position in pairs(positions) do + targets[ct] = self.ai.metalspothandler:ClosestEnemySpot(self.game:GetTypeByName("eorb") , {x = position[1], y = Spring.GetGroundHeight(position[1], position[2]),z = position[2]} ) + end + self.targetMexes = targets + end + +end + +function AttackHandler:GetAggressiveness(atkbehaviour) + return (math.random(2, 5)) +end + +function AttackHandler:GetRole(atkbehaviour) + return ("attacker") +end + +function AttackHandler:PickRandomPositionsOnMap() + local pos = {{math.random(0,Game.mapSizeX), math.random(0,Game.mapSizeZ)},{math.random(0,Game.mapSizeX), math.random(0,Game.mapSizeZ)},{math.random(0,Game.mapSizeX), math.random(0,Game.mapSizeZ)},{math.random(0,Game.mapSizeX), math.random(0,Game.mapSizeZ)},{math.random(0,Game.mapSizeX), math.random(0,Game.mapSizeZ)}} + return pos +end + +function AttackHandler:UnitDead(engineunit) + +end + +function AttackHandler:DoTargetting() +end + +function AttackHandler:DoTargettingOld() + +end + +function AttackHandler:IsRecruit(attkbehaviour) + +end + +function AttackHandler:AddRecruit(attkbehaviour) + +end + +function AttackHandler:RemoveRecruit(attkbehaviour) + +end + +-- How much is this unit worth? +-- +-- Idea: add a table with hardcoded values, +-- and use said values if a units found in +-- that table to highlight strategic value +function AttackHandler:ScoreUnit(unit) + local value = 1 + --[[ + if unit:CanMove() then + if unit:CanBuild() then + value = value + 1 + end + else + value = value + 2 + if unit:CanBuild() then + value = value + 2 + end + end + --]] + return value +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/behaviours.lua b/LuaRules/Gadgets/ai/EvoRTS/behaviours.lua new file mode 100644 index 000000000..983f5fdf4 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/behaviours.lua @@ -0,0 +1,197 @@ + +controlPoints = Spring.GetModOptions().scoremode + +if controlPoints == nil then + controlPoints = "disabled" +end + +if controlPoints == "disabled" then + shard_include( "taskqueues" ) + shard_include( "taskqueuebehaviour" ) + shard_include( "attackerbehaviour" ) + shard_include( "bootbehaviour" ) + shard_include( "nukebehaviour" ) + --shard_include( "morphbehaviour" ) + --shard_include( "engineerturretbehaviour" ) + else + shard_include( "taskqueues" ) + shard_include( "taskqueuebehaviour" ) + shard_include( "attackerbehaviour" ) + shard_include( "bootbehaviour" ) + shard_include( "capturerbehaviour" ) + shard_include( "nukebehaviour" ) + --shard_include( "morphbehaviour" ) + --shard_include( "engineerturretbehaviour" ) +end + +behaviours = { + xklab = { + TaskQueueBehaviour, + }, + zarm = { + TaskQueueBehaviour, + }, + zespire1 = { + TaskQueueBehaviour, + }, + zespire4 = { + TaskQueueBehaviour, + }, + zhive = { + TaskQueueBehaviour, + }, + esilo = { + NukeBehaviour, + }, + eorb = { + AttackerBehaviour, + }, + eorb_up1 = { + AttackerBehaviour, + }, + eorb_up2 = { + AttackerBehaviour, + }, + eorb_up3 = { + AttackerBehaviour, + }, + + ebasefactory = { + TaskQueueBehaviour, + }, + eairplant = { + TaskQueueBehaviour, + }, + eamphibfac = { + TaskQueueBehaviour, + }, + eminifac = { + TaskQueueBehaviour, + }, + ehbotfac = { + TaskQueueBehaviour, + }, + ebasefactory_up1 = { + TaskQueueBehaviour, + }, + eairplant_up1 = { + TaskQueueBehaviour, + }, + eamphibfac_up1 = { + TaskQueueBehaviour, + }, + eminifac_up1 = { + TaskQueueBehaviour, + }, + ehbotfac_up1 = { + TaskQueueBehaviour, + }, + ebasefactory_up2 = { + TaskQueueBehaviour, + }, + eairplant_up2 = { + TaskQueueBehaviour, + }, + eamphibfac_up2 = { + TaskQueueBehaviour, + }, + eminifac_up2 = { + TaskQueueBehaviour, + }, + ehbotfac_up2 = { + TaskQueueBehaviour, + }, + ebasefactory_up3 = { + TaskQueueBehaviour, + }, + eairplant_up3 = { + TaskQueueBehaviour, + }, + eamphibfac_up3 = { + TaskQueueBehaviour, + }, + eminifac_up3 = { + TaskQueueBehaviour, + }, + ehbotfac_up3 = { + TaskQueueBehaviour, + }, + + eartyturret = { + AttackerBehaviour, + }, + eartyturret_up1 = { + AttackerBehaviour, + }, + eartyturret_up2 = { + AttackerBehaviour, + }, + eartyturret_up3 = { + AttackerBehaviour, + }, + + ecommanderbattleai = { + TaskQueueBehaviour, + }, + + eengineer5 = { + TaskQueueBehaviour, + }, + + eamphibengineer = { + TaskQueueBehaviour, + }, + + eairengineer = { + TaskQueueBehaviour, + }, + + eallterrengineer = { + TaskQueueBehaviour, + }, + --eaimexer = { + --EngineerTurretBehaviour, + --}, + + -- zlightswarm = { + -- AttackerBehaviour, + -- }, + -- zairscout = { + -- AttackerBehaviour, + -- }, +} + +function defaultBehaviours(unit) + b = {} + + u = unit:Internal() + --table.insert(b,MorphBehaviour) + if u:CanBuild() then + table.insert(b,TaskQueueBehaviour) + if u:CanMove() then + local utype = game:GetTypeByName("ebasefactory") + if u:CanBuild(utype) then + table.insert(b,MissingFactoryBehaviour) + end + utype = game:GetTypeByName("elightturret2") + if u:CanBuild(utype) then + table.insert(b,EngineerTurretBehaviour) + end + end + else + if controlPoints == "disabled" then + if IsAttacker(unit) then + table.insert(b,AttackerBehaviour) + end + else + if IsAttacker(unit) then + table.insert(b,AttackerBehaviour) + end + if IsCapturer(unit) then + table.insert(b,CapturerBehaviour) + end + end + end + + return b +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS/geohandler.lua b/LuaRules/Gadgets/ai/EvoRTS/geohandler.lua new file mode 100644 index 000000000..136fe2246 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/geohandler.lua @@ -0,0 +1,48 @@ +GeoSpotHandler = class(Module) + + +function GeoSpotHandler:Name() + return "GeoSpotHandler" +end + +function GeoSpotHandler:internalName() + return "geospothandler" +end + +function GeoSpotHandler:Init() + self.geos = self.game.map:GetGeoSpots() +end + +function distance(pos1,pos2) + local xd = pos1.x-pos2.x + local zd = pos1.z-pos2.z + local yd = pos1.y-pos2.y + if yd < 0 then + yd = -yd + end + dist = math.sqrt(xd*xd + zd*zd + yd*yd*yd) + return dist +end + +function GeoSpotHandler:ClosestFreeGeo(unittype,position, maxdis) + local pos = nil + local bestDistance = maxdis or 10000 + geoCount = self.game.map:GeoCount() + for i,v in ipairs(self.geos) do + local p = v + local dist = distance(position,p) + if dist < bestDistance then + if self.game.map:CanBuildHere(unittype,p) then + --checking for unit positions + local spGetUnitsInRectangle = Spring.GetUnitsInRectangle + local radius = 100 + local units_found = spGetUnitsInRectangle(p.x - radius, p.z - radius, p.x + radius, p.z + radius) + if #units_found == 0 then + bestDistance = dist + pos = p + end + end + end + end + return pos +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/modules.lua b/LuaRules/Gadgets/ai/EvoRTS/modules.lua new file mode 100644 index 000000000..3a0c12216 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/modules.lua @@ -0,0 +1,13 @@ +shard_include( "spothandler" ) +shard_include( "controlpointhandler" ) +shard_include( "unithandler" ) +shard_include( "attackhandler" ) +shard_include( "geohandler" ) +-- shard_include( "placementhandler" ) +shard_include( "newplacementhandler" ) +shard_include( "requestshandler" ) +shard_include( "sleep" ) +shard_include( "triggerhandler" ) +shard_include( "aimodehandler" ) + +modules = { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, GeoSpotHandler, NewPlacementHandler, RequestsHandler, Sleep, TriggerHandler, AiModeHandler, } diff --git a/LuaRules/Gadgets/ai/EvoRTS/newplacementhandler.lua b/LuaRules/Gadgets/ai/EvoRTS/newplacementhandler.lua new file mode 100644 index 000000000..e252261d8 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/newplacementhandler.lua @@ -0,0 +1,285 @@ +NewPlacementHandler = class(Module) + +function NewPlacementHandler:Name() + return "NewPlacementHandler" +end + +function NewPlacementHandler:internalName() + return "newplacementhandler" +end + +function NewPlacementHandler:GetIDBuildable(id, cellsize, buildtype) + return GG.AiHelpers.NewPlacementHandler.GetIDBuildable(id,cellsize,buildtype) +end + +function NewPlacementHandler:GetPosFromID(id) + return GG.AiHelpers.NewPlacementHandler.GetPosFromID(id) +end + +function NewPlacementHandler:GetIDFromPos(x, z, cellsize) + return GG.AiHelpers.NewPlacementHandler.GetIDFromPos(x,z,cellsize) +end + +function NewPlacementHandler:ClosePosition(x,z, cellsize,spacing) + GG.AiHelpers.NewPlacementHandler.ClosePosition(x,z, cellsize, spacing) +end + +function NewPlacementHandler:FreePosition(x,z,cellsize,spacing) + GG.AiHelpers.NewPlacementHandler.FreePosition(x,z,cellsize,spacing) +end + +function generateSpiral() + local retTable = {} + local attempt = 0 + local ct = 0 + while attempt < 50 do + attempt = attempt + 1 + for v = -attempt, attempt do + for h = -attempt, attempt do + if math.abs(v) == attempt or math.abs(h) == attempt then + ct = ct + 1 + retTable[ct] = {v, h} + end + end + end + end + return retTable +end + +function NewPlacementHandler:UnitIdle(unit) + local unitDefID = UnitDefNames[unit:Name()].id + local defs = UnitDefs[unitDefID] + if defs then + if defs.canBuild == true then + local unitID = unit.id + if self.plansbyunitID[unitID] then + for planID, plan in pairs(self.plansbyunitID[unitID]) do + self:ClearPlan(planID) + local pos = self:GetPosFromID(planID) + local spacing = self:GetMinimalSpacing(self.game:GetTypeByName(def.name)) + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + self:FreePosition(pos.x, pos.z, cellsize, spacing) + end + end + end + end +end + +function NewPlacementHandler:Init() + self.plans = {} + self.plansbyunitID = {} + self.plansbyunitDefID = {} + mapwidth = math.max(Game.mapSizeX, Game.mapSizeZ) + if not spiral then + spiral = generateSpiral() + end + for i, spot in pairs(self.ai.metalspothandler.spots) do + self:ClosePosition(spot.x, spot.z, 32, 80) -- close mex positions (they might get freed during a scan though) + end +end + +function NewPlacementHandler:GetClosestBuildPosition(x, z, cellsize, buildtype) + local ID = self:GetIDFromPos(x, z, cellsize) + local POS = self:GetPosFromID(ID) + local x, z = POS.x, POS.z + local attempt = 0 + local pos + buildable = self:GetIDBuildable(ID, cellsize, buildtype) + if buildable == true then bestID = ID end + while buildable ~= true and attempt <= 10000 do + attempt = attempt + 1 + v = spiral[attempt][1] + h = spiral[attempt][2] + local id = ID + (v*cellsize*mapwidth) + (h*cellsize) + if self:GetIDBuildable(id, cellsize, buildtype) == true then + buildable = true + bestID = id + end + end + if bestID then + pos = NewPlacementHandler:GetPosFromID(bestID, cellsize) + pos.x = pos.x + cellsize/2 + pos.z = pos.z + cellsize/2 + pos.y = Spring.GetGroundHeight(pos.x, pos.z) + end + return pos +end + +function NewPlacementHandler:UnitDead(unit) + local unitDefID = UnitDefNames[unit:Name()].id + local defs = UnitDefs[unitDefID] + if defs then + if defs.isBuilding or string.find(defs.name, "nanotc") or string.find(defs.name, "zarm") then + local pos = unit:GetPosition() + local spacing = self:GetMinimalSpacing(unit:Type()) + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + self:FreePosition(pos.x, pos.z, cellsize, spacing) + elseif defs.canBuild == true then + local unitID = unit.id + if self.plansbyunitID[unitID] then + for planID, plan in pairs(self.plansbyunitID[unitID]) do + self:ClearPlan(planID) + local pos = self:GetPosFromID(planID) + local spacing = self:GetMinimalSpacing(self.game:GetTypeByName(def.name)) + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + self:FreePosition(pos.x, pos.z, cellsize, spacing) + end + end + end + end +end + +function NewPlacementHandler:UnitCreated(unit) -- Clear plan but leave position closed, unitDead will clear it + local unitDefID = UnitDefNames[unit:Name()].id + local defs = UnitDefs[unitDefID] + if defs then + if defs.isBuilding or string.find(defs.name, "nanotc") or string.find(defs.name, "zarm") then + local pos = unit:GetPosition() + local spacing = self:GetMinimalSpacing(unit:Type()) + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + local planID = self:GetIDFromPos(pos.x, pos.z, cellsize) + self:ClearPlan(planID) + end + end +end + +function NewPlacementHandler:ClearPlan(planID) + if self.plans[planID] then + local unitID = self.plans[planID].unitID + local unitDefID = self.plans[planID].unitDefID + self.plans[planID] = nil + self.plansbyunitDefID[unitDefID][planID] = nil + self.plansbyunitID[unitID][planID] = nil + end +end + +function NewPlacementHandler:CreateNewPlan(unit, utype, p) + local defs = UnitDefs[utype.id] + local Building = (defs.isBuilding == true or string.find(defs.name, "nanotc") or string.find(defs.name, "zarm")) + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + local buildtype = "ground" + p = self:GetClosestBuildPosition(p.x, p.z, cellsize, buildtype) + if p and p.x and p.y and p.z then + local facing = self:GetFacing(p) + if facing == 0 or facing == 2 then + p.x = p.x - (p.x%16) + (defs.xsize*4 % 16) + p.z = p.z - (p.z%16) + (defs.zsize*4 % 16) + else + p.x = p.x - (p.x%16) + (defs.zsize*4 % 16) + p.z = p.z - (p.z%16) + (defs.xsize*4 % 16) + end + if Spring.TestBuildOrder(utype.id, p.x,p.y,p.z, "s") == 0 then + return + end + if Building then -- filter out mobile units built from mobile engineers, these will only need a buildposition, no planning + self:ClosePosition(p.x, p.z, cellsize, self:GetMinimalSpacing(utype)) + local newplan = {unitID = unit.id, unitDefID = utype.id, p = { x= p.x, y = p.y, z = p.z}} + local planID = self:GetIDFromPos(p.x, p.z, cellsize) + newplan["planID"] = planID + self.plans[planID] = newplan + self.plansbyunitID[unit.id] = self.plansbyunitID[unit.id] or {} + self.plansbyunitID[unit.id][planID] = newplan + self.plansbyunitDefID[utype.id] = self.plansbyunitDefID[utype.id] or {} + self.plansbyunitDefID[utype.id][planID] = newplan + end + return p, facing + end + return +end + +function NewPlacementHandler:CreateNewPlanNoSearch(unit, utype, p) + local defs = UnitDefs[utype.id] + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + local buildtype = "ground" + if p and p.x and p.y and p.z then + local facing = self:GetFacing(p) + if facing == 0 or facing == 2 then + p.x = p.x - (p.x%16) + (defs.xsize*4 % 16) + p.z = p.z - (p.z%16) + (defs.zsize*4 % 16) + else + p.x = p.x - (p.x%16) + (defs.zsize*4 % 16) + p.z = p.z - (p.z%16) + (defs.xsize*4 % 16) + end + self:ClosePosition(p.x, p.z, cellsize, self:GetMinimalSpacing(utype)) + local newplan = {unitID = unit.id, unitDefID = utype.id, p = { x= p.x, y = p.y, z = p.z}} + local planID = self:GetIDFromPos(p.x, p.z, cellsize) + newplan["planID"] = planID + self.plans[planID] = newplan + self.plansbyunitID[unit.id] = self.plansbyunitID[unit.id] or {} + self.plansbyunitID[unit.id][planID] = newplan + self.plansbyunitDefID[utype.id] = self.plansbyunitDefID[utype.id] or {} + self.plansbyunitDefID[utype.id][planID] = newplan + return p, facing + end + return +end + +function NewPlacementHandler:GetFacing(p) + local x = p.x + local z = p.z + if math.abs(Game.mapSizeX - 2*x) > math.abs(Game.mapSizeZ - 2*z) then + if (2*x>Game.mapSizeX) then + facing=3 + else + facing=1 + end + else + if (2*z>Game.mapSizeZ) then + facing=2 + else + facing=0 + end + end + return facing +end + +function NewPlacementHandler:GetExistingPlansByUType(utype) + local planned = {} + if self.plansbyunitDefID[utype.id] then + local planned = {} + for planID, plan in pairs(self.plansbyunitDefID[utype.id]) do + planned[planID] = plan + end + end + return planned +end + +function NewPlacementHandler:GetExistingPlansByUnitDefID(unitDefID) + local planned = {} + if self.plansbyunitDefID[unitDefID] then + for planID, plan in pairs(self.plansbyunitDefID[unitDefID]) do + planned[planID] = plan + end + end + return planned +end + +function NewPlacementHandler:GetExistingPlansByUnit(unit) + local planned = {} + if self.plansbyunitID[unit.id] then + local planned = {} + for planID, plan in pairs(self.plansbyunitDefID[unit.id]) do + planned[planID] = plan + end + end + return planned +end + +function NewPlacementHandler:GetMinimalSpacing(utype) + if string.find(UnitDefs[utype.id].name, "zarm") then + return 300 + elseif string.find(UnitDefs[utype.id].name, "zhive") then + return 0 + elseif string.find(UnitDefs[utype.id].name, "zespire") then + local r = math.random(10,80) + return r + elseif string.find(UnitDefs[utype.id].name, "emine") then + return 0 + elseif string.find(UnitDefs[utype.id].name, "eminifac") or string.find(UnitDefs[utype.id].name, "eamphibfac") or string.find(UnitDefs[utype.id].name, "ehbotfac") or string.find(UnitDefs[utype.id].name, "ebasefactory") then + return 120 + elseif UnitDefs[utype.id].canMove == true then + return 0 + else + return 40 + end +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/nukebehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS/nukebehaviour.lua new file mode 100644 index 000000000..ad862cda8 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/nukebehaviour.lua @@ -0,0 +1,44 @@ + +NukeBehaviour = class(Behaviour) + +function NukeBehaviour:Init() +end + +function NukeBehaviour:Update() + if Spring.GetGameFrame() % 120 == 0 then + if not self.target then + self.target = GG.AiHelpers.TargetsOfInterest.Nuke(self.ai.id) + end + if self.target then + if not Spring.ValidUnitID(self.target) then + self.target = nil + self.unit:Internal():ExecuteCustomCommand(CMD.STOP, {}, {}) + else + local x,y,z = Spring.GetUnitPosition(self.target) + self.unit:Internal():ExecuteCustomCommand(CMD.ATTACK, {x,y,z}, {}) + end + end + end +end + +function NukeBehaviour:OwnerBuilt() + +end + +function NukeBehaviour:OwnerDead() + +end + +function NukeBehaviour:Priority() + return 100 +end + +function NukeBehaviour:Activate() + self.active = true +end + + +function NukeBehaviour:OwnerDied() + self.active = nil + self.unit = nil +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/placementhandler.lua b/LuaRules/Gadgets/ai/EvoRTS/placementhandler.lua new file mode 100644 index 000000000..db85fd6c3 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/placementhandler.lua @@ -0,0 +1,300 @@ +PlacementHandler = class(Module) + +function PlacementHandler:Name() + return "PlacementHandler" +end + +function PlacementHandler:internalName() + return "placementhandler" +end + +function PlacementHandler:Init() + self.jobs = {} + self.spacing_spiral = self:GenerateSpiral( 5, 5 ) +end + +--[[ +Usage: + +function onSuccess( job, pos ) + -- build something I guess +end +function onFail( job ) + -- nowhere to place it, do something else then? +end +local unittype = ... +local job = { + start_position=[1,2,3], + max_radius=500, + onSuccess=onSuccess, + onFail=onFail, + unittype=unittype, + cleanup_on_unit_death=builderID +} +local success = ai.placementhandler.NewJob( job ) +if success then + -- the job has been schedule, do whatever else we need to do in parallel + -- when a position has been found, it will call the callback function we passed it + -- in the future a promise will be returned letting us define what happens +else + -- there was something wrong with our job and the system rejected it + -- the programmer should probably check all the values that went into the job were set and valid +end + +]] + + +function PlacementHandler:NewJob( details ) + --[[ + local default = { + start_position, + unittype, + placement_tests: [], + max_radius=, + onSuccess=onSuccess, + onFail=onFail, + increment=8 + cleanup_on_unit_death + } + ]]-- + if details["start_position"] == nil then + return false + end + if details["unittype"] == nil then + return false + end + if details["max_radius"] == nil then + details.max_radius = 1500 + end + if details["increment"] == nil then + details.increment = 16 + end + if details.increment < 16 then + details.increment = 16 + end + details.status = 'new' + details.step = 1 + + -- figure out the spiral search pattern necessary + local max_width = details.max_radius * 2 + local spiral_width = max_width/details.increment + details.spiral = self:GenerateSpiral(spiral_width, spiral_width ) + + table.insert( self.jobs, details ) + + -- for now it's using a completion handler, which is a function + -- passed along that it will call when it's finished, but tbh I'd + -- prefer to return some sort of promise structure + return true +end + + +function PlacementHandler:Update() + --[[ + + We need to run through our jobs, but we also need to make sure of several things: + + - when a placement job finishes, we stop processing until the next frame + - that each job only gets a limited amount of time to run + - that the algorithm can run bit by bit over several frames + + To this end, each iteration of the search is self contained. This way we can + progress 5 or 6 steps along the algorithm for each job, making sure we don't + spend too long searching and lag the game out. + + As a bonus, this opens up the future for scheduling and collaborative searches. + It also allows us to cancel and pause searches. + + For our situation, we're going to allot a time budget for each job, and a + time budget for each frame. During this time, we can only work on a job for + so long. If it's a fast CPU we can do more iterations in that time. It also + means we can only work on so many jobs per frame. This way we get the top + of the queue done sooner, so we don't get bogged down in an ever growing queue. + + A bonus of this, is that quick jobs will finish earlier, allowing work to be + done on an extra job. Another side of this is that if the cpu is busy with + stuff, we might have to finish early. I envisage Shard should take time + measurements for the entire frame to make sure that modules such as this + one can give themselves smaller budgets when under load + ]] + + -- exit early if there are no jobs + if #self.jobs == 0 then + return + end + + self:RunIterations() + self:CleanupJobs() +end + +function PlacementHandler:RunIterations() + for i,j in ipairs(self.jobs) do + if j.status ~= 'cleanup' then + local job = self.jobs[i] + self:RunJobIterations( job ) + end + end +end + +function PlacementHandler:RunJobIterations( job ) + local stillGotTime = 4 --500 + -- given this particular job, lets give it a time budget and do as many + -- iterations as we can + while ( stillGotTime > 0 ) and ( job.status ~= 'cleanup' ) do + self:IterateJob( job ) + stillGotTime = stillGotTime - 1 + end +end + +function PlacementHandler:IterateJob( job ) + -- setup this run + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + return + end + job.status = 'running' + local step = job.step + local spos = job.spiral[step] + local pos = { + x=spos.x * job.increment + job.start_position.x, + y=job.start_position.y, + z=spos.y * job.increment + job.start_position.z + } + + -- test this particular step of the spiral + local buildable = self:CanBuildAt(job.unittype, pos ) + if buildable then + -- we found a place! + job.result = pos + job.status = 'cleanup' + SendToUnsynced("shard_debug_position",pos.x,pos.z,"final_choice") + job.onSuccess( job, pos ) + end + + job.step = job.step + 1 + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + end +end + +function PlacementHandler:CanBuildAt( unittype, pos ) + local buildable = self.ai.map:CanBuildHere( unittype, pos ) + if not buildable then + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_bad") + return false + end + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_good") + + + local fixed_spacing = 48 + + --avoiding metal spots( Work in Progress ) + --[[ + local spotPositions = self.game.map:GetMetalSpots() + local spotCount = self.game.map:SpotCount() + for i = 1,spotCount do + metalspot = spotPositions[i] + end + --]] + + --checking for unit positions + local spGetUnitsInRectangle = Spring.GetUnitsInRectangle + local radius = 125 + local units_found = spGetUnitsInRectangle(pos.x - radius, pos.z - radius, pos.x + radius, pos.z + radius) + if #units_found > 0 then + --for i = 1,#units_found do + --local unitID = units_found[i] + --if not UnitDefs[Spring.GetUnitDefID(unitID)].canmove then + --end + --end + return false + end + + -- check spacing + -- we're going to do this in a hacky way for now until a blocking + -- map and footprints are added to the shard API, but on the other + -- hand it's simple + + -- what we're going to do is enforce a standardised minimum + -- spacing, and check above below left and right of the position + -- to check, by shifting the position by a set amount and checking + -- that position + + for i,j in ipairs(self.spacing_spiral) do + testpos = { x=pos.x + ( j.x * fixed_spacing ), y=pos.y, z= pos.z + ( j.x * fixed_spacing ) } + if not self:CanBuildHere( unittype, testpos ) then + return false + end + end + + return true +end + +function PlacementHandler:CanBuildHere(unittype, testpos ) + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + return true +end + +function PlacementHandler:CleanupJobs() + -- try and clean up dead recruits where possible + for i,j in ipairs(self.jobs) do + if j.status == 'cleanup' then + local job = self.jobs[i] + table.remove( self.jobs, i ) + return + end + end +end + +--[[ +Some jobs are tied to units being alive. This could be because +it's the building the job was intended for. Eitherway, if that +unit dies then the associated job is unnecessary, and needs to +be cleaned up to save cpu +]] +function PlacementHandler:UnitDead(engineunit) + for i,j in ipairs(self.jobs) do + if j['cleanup_on_unit_death'] ~= nil then + if j.cleanup_on_unit_death == engineunit:ID() then + j.status = 'cleanup' + end + end + end +end + + +function PlacementHandler:GenerateSpiral( width, height) + local x = 0 + local y = 0 + local dx = 0 + local dy = -1 + local t = math.max(width,height) + local maxI = t*t; + local result = {} + for i=0, maxI do + if ((-width/2 <= x) and (x <= width/2) and (-height/2 <= y) and (y <= height/2)) then + table.insert( result, {x=x,y=y} ) + end + if ( ( x == y ) or ( ( x < 0 ) and ( x == -y ) ) or ( (x > 0) and ( x == 1-y ) ) ) then + t = dx + dx = dy * -1 + dy = t + end + x = x + dx + y = y + dy + end + return result +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/EvoRTS/requestshandler.lua b/LuaRules/Gadgets/ai/EvoRTS/requestshandler.lua new file mode 100644 index 000000000..5d4957b40 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/requestshandler.lua @@ -0,0 +1,66 @@ +RequestsHandler = class(Module) + +function RequestsHandler:Name() + return "RequestsHandler" +end + +function RequestsHandler:internalName() + return "requestshandler" +end + +function RequestsHandler:Init() + self.requests = {} +end + +local UDC = Spring.GetTeamUnitDefCount +local UDN = UnitDefNames + +function RequestsHandler:Update() + +end + +function RequestsHandler:AddRequest(priority, requestedTask, commrequired) + if commrequired == true then + requestedTask.needCom = true + end + if not self.requests[1] then + self.requests[1] = requestedTask + return + end + if priority == true then + for i = #self.requests,1, -1 do + if self.requests[i] then + self.requests[i + 1] = self.requests[i] + end + end + self.requests[1] = requestedTask + else + self.requests[#self.requests+1] = requestedTask + end + -- if priority == true and commrequired == true then + -- local comms = Spring.GetTeamUnitsByDefs(self.ai.id, {UnitDefNames.ecommanderbattleai.id}) + -- for ct, unitID in pairs(comms) do + -- Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, {}) + -- end + -- end +end + +function RequestsHandler:RemoveRequest(n) + for i = n, #self.requests - 1 do + self.requests[i] = self.requests[i + 1] + end + self.requests[#self.requests] = nil +end + +function RequestsHandler:GetRequestedTask(unit) + if self.requests[1] then + if self.requests[1].needCom == true and (not (unit:Name() == "ecommanderbattleai")) then + return {action = "nexttask"} + end + local task = self.requests[1] + self:RemoveRequest(1) + return task + else + return {action = "nexttask"} + end +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/spothandler.lua b/LuaRules/Gadgets/ai/EvoRTS/spothandler.lua new file mode 100644 index 000000000..e447a6d54 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/spothandler.lua @@ -0,0 +1,228 @@ +MetalSpotHandler = class(Module) + + +function MetalSpotHandler:Name() + return "MetalSpotHandler" +end + +function MetalSpotHandler:internalName() + return "metalspothandler" +end + +function MetalSpotHandler:Init() + self.spots = self.game.map:GetMetalSpots() +end + +------------------------------------------------------------ +-- Config +------------------------------------------------------------ +local gridSize = 16 -- Resolution of metal map +local buildGridSize = 8 -- Resolution of build positions + +------------------------------------------------------------ +-- Speedups +------------------------------------------------------------ +local min, max = math.min, math.max +local floor, ceil = math.floor, math.ceil +local sqrt = math.sqrt +local huge = math.huge + +local spGetGroundInfo = Spring.GetGroundInfo +local spGetGroundHeight = Spring.GetGroundHeight +local spTestBuildOrder = Spring.TestBuildOrder +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local extractorRadius = Game.extractorRadius +local extractorRadiusSqr = extractorRadius * extractorRadius + +local buildmapSizeX = Game.mapSizeX - buildGridSize +local buildmapSizeZ = Game.mapSizeZ - buildGridSize +local buildmapStartX = buildGridSize +local buildmapStartZ = buildGridSize + +local metalmapSizeX = Game.mapSizeX - 1.5 * gridSize +local metalmapSizeZ = Game.mapSizeZ - 1.5 * gridSize +local metalmapStartX = 1.5 * gridSize +local metalmapStartZ = 1.5 * gridSize + + +function GetMexPositions(spot, uDefID, facing, testBuild) + + local positions = {} + + local xoff, zoff + local uDef = UnitDefs[uDefID] + if facing == 0 or facing == 2 then + xoff = (4 * uDef.xsize) % 16 + zoff = (4 * uDef.zsize) % 16 + else + xoff = (4 * uDef.zsize) % 16 + zoff = (4 * uDef.xsize) % 16 + end + + if not spot.validLeft then + GetValidStrips(spot) + end + + local validLeft = spot.validLeft + local validRight = spot.validRight + for z, vLeft in pairs(validLeft) do + if z % 16 == zoff then + for x = gridSize * ceil((vLeft + xoff) / gridSize) - xoff, + gridSize * floor((validRight[z] + xoff) / gridSize) - xoff, + gridSize do + local y = spGetGroundHeight(x, z) + if not (testBuild and spTestBuildOrder(uDefID, x, y, z, facing) == 0) then + positions[#positions + 1] = {x, y, z} + end + end + end + end + + return positions +end + +function GetValidStrips(spot) + spot.left = {} + spot.right = {} + spot.minX = spot.x - 16 + spot.minZ = spot.z - 16 + spot.maxX = spot.x + 16 + spot.maxZ = spot.z + 16 + + for iz = spot.minZ, spot.maxZ do + spot.left[iz] = spot.minX + spot.right[iz] = spot.maxX + end + + + local sMinZ, sMaxZ = spot.minZ, spot.maxZ + local sLeft, sRight = spot.left, spot.right + + local validLeft = {} + local validRight = {} + + local maxZOffset = buildGridSize * ceil(extractorRadius / buildGridSize - 1) + for mz = max(sMaxZ - maxZOffset, buildmapStartZ), min(sMinZ + maxZOffset, buildmapSizeZ), buildGridSize do + local vLeft, vRight = buildmapStartX, buildmapSizeX + for sz = sMinZ, sMaxZ, gridSize do + local dz = sz - mz + local maxXOffset = buildGridSize * ceil(sqrt(extractorRadiusSqr - dz * dz) / buildGridSize - 1) -- Test for metal being included is dist < extractorRadius + local left, right = sRight[sz] - maxXOffset, sLeft[sz] + maxXOffset + if left > vLeft then vLeft = left end + if right < vRight then vRight = right end + end + validLeft[mz] = vLeft + validRight[mz] = vRight + end + + spot.validLeft = validLeft + spot.validRight = validRight +end + +function IsMexPositionValid(spot, x, z) + + if z <= spot.maxZ - extractorRadius or + z >= spot.minZ + extractorRadius then -- Test for metal being included is dist < extractorRadius + return false + end + + local sLeft, sRight = spot.left, spot.right + for sz = spot.minZ, spot.maxZ, gridSize do + local dz = sz - z + local maxXOffset = sqrt(extractorRadiusSqr - dz * dz) -- Test for metal being included is dist < extractorRadius + if x <= sRight[sz] - maxXOffset or + x >= sLeft[sz] + maxXOffset then + return false + end + end + + return true +end + + +function distance(pos1,pos2) + local xd = pos1.x-pos2.x + local zd = pos1.z-pos2.z + local yd = 0 + if yd < 0 then + yd = -yd + end + dist = math.sqrt(xd*xd + zd*zd + yd*yd*yd) + return dist +end + +function NoMex(x,z, batchextracts,teamID) -- Is there any better mex at this location (returns false if there is) + local mexesatspot = Spring.GetUnitsInCylinder(x,z,128) + for ct, uid in pairs(mexesatspot) do + if (string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "emetalextractor") or string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "xmetalextractor") or string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "zmex")) and (teamID and Spring.AreTeamsAllied(Spring.GetUnitTeam(uid), teamID)) then + return false + end + end + return true +end + +function EnemyMex(x,z, batchextracts,teamID) -- Is there any better mex at this location (returns false if there is) + local mexesatspot = Spring.GetUnitsInCylinder(x,z,128) + for ct, uid in pairs(mexesatspot) do + if (string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "emetalextractor") or string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "xmetalextractor") or string.find(UnitDefs[Spring.GetUnitDefID(uid)].name, "zmex")) and (teamID and not Spring.AreTeamsAllied(Spring.GetUnitTeam(uid), teamID)) then + return true + end + end + return false +end + +function MetalSpotHandler:ClosestFreeSpot(unittype,position,maxdis) + local pos = nil + local bestDistance = maxdis or 100000 + spotCount = self.game.map:SpotCount() + local teamID = self.ai.id + for i,v in ipairs(self.spots) do + local p = v + local dist = distance(position,p) + if NoMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "emetalextractor"), teamID) or NoMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "xmetalextractor"), teamID) or NoMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zhive"), teamID) or NoMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zhatch"), teamID) or NoMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zlair"), teamID) then + if EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "emetalextractor"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "xmetalextractor"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zmex"), teamID) == false then + if dist < bestDistance then + bestDistance = dist + pos = p + end + end + end + end + return pos +end + +function MetalSpotHandler:ClosestEnemySpot(unittype,position) + local pos = nil + local bestDistance = 100000 + spotCount = self.game.map:SpotCount() + local teamID = self.ai.id + for i,v in ipairs(self.spots) do + local p = v + local dist = distance(position,p) + if EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "emetalextractor"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "xmetalextractor"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zhive"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zhatch"), teamID) or EnemyMex(p.x, p.z, string.find(UnitDefs[unittype.id].name, "zlair"), teamID) then + if dist < bestDistance then + bestDistance = dist + pos = p + end + end + end + return pos +end + +function MetalSpotHandler:GetClosestMexPosition(spot, x, z, uDefID, facing) + x, z = spot.x, spot.z + local bestPos + local bestDist = math.huge + local positions = GetMexPositions(spot, uDefID, facing, true) + for i = 1, #positions do + local pos = positions[i] + local dx, dz = x - pos[1], z - pos[3] + local dist = dx*dx + dz*dz + if dist < bestDist then + bestPos = pos + bestDist = dist + end + end + if bestPos then bestPos = {x = bestPos[1], y = bestPos[2], z = bestPos[3]} end + return bestPos +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/taskqueuebehaviour.lua b/LuaRules/Gadgets/ai/EvoRTS/taskqueuebehaviour.lua new file mode 100644 index 000000000..26c4a7301 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/taskqueuebehaviour.lua @@ -0,0 +1,436 @@ +TaskQueueBehaviour = class(Behaviour) + +function TaskQueueBehaviour:Init() + self.active = false + u = self.unit + u = u:Internal() + self.name = u:Name() + self.countdown = 0 + if self:HasQueues() then + self.queue = self:GetQueue() + end + + self.waiting = {} + self:OnToNextTask() + self.ImBusy = 0 +end + +function dump(o) + if type(o) == 'table' then + local s = '{ ' + for k,v in pairs(o) do + if type(k) ~= 'number' then + k = '"'..k..'"' + end + s = s .. '['..k..'] = ' .. dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end + +function TaskQueueBehaviour:HasQueues() + return (taskqueues[self.name] ~= nil) +end + +function TaskQueueBehaviour:OwnerBuilt(unit) + if not self:IsActive() then + return + end + self:OnToNextTask() +end + +function TaskQueueBehaviour:OwnerIdle(unit) + if not self:IsActive() then + return + end + self.countdown = 0 + self:OnToNextTask() +end + +function TaskQueueBehaviour:OwnerMoveFailed(unit) + if not self:IsActive() then + return + end + self:OwnerIdle(unit) +end + +function TaskQueueBehaviour:OwnerDead() + if self.waiting ~= nil then + for k,v in pairs(self.waiting) do + self.ai.modules.sleep.Kill(self.waiting[k]) + end + end + self.waiting = nil + self.unit = nil +end + +function TaskQueueBehaviour:GetQueue() + q = taskqueues[self.name] + if type(q) == "function" then + q = q(self, self.ai, self.unit) + end + return q +end +function TaskQueueBehaviour:CanQueueNextTask() + local unitID = self.unit:Internal().id + --- must: already have 1 queue (not override default behaviour) + --- Have less than 2 queues (not cancel the next buildings + --- Have "secured" the cur spot it has to build on (not cancel 1st in queue to start 2nd in queue == is currently building + --- We check curqueuelength == 1 + --- Unit is not a factory + local notfactory = self.unit:Internal():Type():IsFactory() ~= true + local notprogressing = self.progress ~= true -- Not already progressing in queue + local curqueuelength = #(Spring.GetCommandQueue(unitID,2)) + local building = Spring.GetUnitIsBuilding(unitID) + -- we check cur buildspeed/power ~= 0 + if curqueuelength <= 0 and building and notprogressing and notfactory then + return true + else + return + end +end + +function TaskQueueBehaviour:IsRunningAQueue() + if Spring.GetCommandQueue(self.unit:Internal().id,0) > 0 then + return true + else + return false + end +end + +function TaskQueueBehaviour:IsBusy() + if Spring.GetUnitCurrentBuildPower(self.unit:Internal().id) == 0 then + return false + else + return true + end +end + +function TaskQueueBehaviour:CompareWithOldPos() + local result = false + local x,y,z = Spring.GetUnitPosition(self.unit:Internal().id) + if self.oldPos then + if math.sqrt((x-self.oldPos.x)^2+(y-self.oldPos.y)^2+(z-self.oldPos.z)^2) < 16 then + result = true + else + result = false + end + end + self.oldPos = {x = x, y = y, z = z} + return result +end + +function TaskQueueBehaviour:Update() + if Spring.GetGameFrame()%30 and Spring.GetGameFrame() > 30 then + if self:IsBusy() then + self.ImBusy = 15 + elseif not self:IsBusy() and self.ImBusy > 0 then + self.ImBusy = self.ImBusy - 1 + end + end + if Spring.GetGameFrame()%600 == self.unit:Internal().id%600 and Spring.GetGameFrame() > 600 then + if (not self.unit:Internal():Type():IsFactory()) then + if self:IsRunningAQueue() and (not self:IsBusy()) and self.ImBusy == 0 and self:CompareWithOldPos() then -- check stucked cons + --self.ai.newplacementhandler:UnitIdle(self.unit:Internal()) + self.unit:Internal():ExecuteCustomCommand(CMD.STOP, {}, {}) --> Triggers UnitIdle -> Next Task + elseif (not self:IsRunningAQueue()) and (not self:IsBusy()) and self.ImBusy == 0 then + --self.ai.newplacementhandler:UnitIdle(self.unit:Internal()) + self.unit:Internal():ExecuteCustomCommand(CMD.STOP, {}, {}) --> Triggers UnitIdle -> Next Task + self:CompareWithOldPos() + else + self:CompareWithOldPos() -- still register current position + end + end + end + if not self:IsActive() then + self:DebugPoint("nothing") + return + end + local f = self.game:Frame() + if f%15 == self.unit:Internal().id%15 then + if self:CanQueueNextTask() then + self.progress = true + end + end + if self.progress == true then + if self.countdown > 14 then + self:ProgressQueue() + else + if self.countdown == nil then + self.countdown = 1 + else + self.countdown = self.countdown + 1 + end + end + end +end + +TaskQueueWakeup = class(function(a,tqb) + a.tqb = tqb +end) +function TaskQueueWakeup:wakeup() + self.tqb:ProgressQueue() +end + +function TaskQueueBehaviour:ProgressQueue() + unit = self.unit:Internal() + if self:IsWaitingForPosition() then + self:DebugPoint("waiting") + return + end + if self.queue == nil then + if self:HasQueues() then + self.queue = self:GetQueue() + else + self:DebugPoint("nothing") + return + end + end + self.countdown = 0 + self.progress = false + + if self.queue == nil then + self.game:SendToConsole("Warning: A "..self.name.." unit, has an empty task queue") + self:OnToNextTask() + self:DebugPoint("nothing") + return + end + local idx, val = next(self.queue,self.idx) + self.idx = idx + if idx == nil then + self:DebugPoint("nothing") + self.queue = self:GetQueue(name) + self:OnToNextTask() + return + end + + local utype = nil + local value = val + if type(val) == "function" then + value = val(self, self.ai, unit) + end + if value == "next" then + self:DebugPoint("nothing") + self:OnToNextTask() + return + end + if type(val) == "table" then + self:HandleActionTask( value ) + return + end + if type(value) == "table" then + self:HandleActionTask( value ) + return + end + + success = self:TryToBuild( value ) + if success ~= true then + self:DebugPoint("nothing") + self:OnToNextTask() + return + end +end + +function TaskQueueBehaviour:TryToBuild( unit_name, pos ) + --Spring.Echo(unit_name) + utype = self.game:GetTypeByName(unit_name) + if not utype then + self.game:SendToConsole("Cannot build:"..unit_name..", could not grab the unit type from the engine") + return false + end + if unit:CanBuild(utype) ~= true then + return false + end + local success = false + if utype:Extractor() then + success = self:BuildExtractor(utype) + elseif utype:Geothermal() then + success = self:BuildGeo(utype) + elseif unit:Type():IsFactory() then + success = self.unit:Internal():Build(utype) + else + success = self:BuildOnMap(utype,pos) + end + return success +end + +function TaskQueueBehaviour:HandleActionTask( task ) + local action = task.action + if action == "nexttask" then + self:OnToNextTask() + elseif action == "ezmorph" then + --Spring.Echo("Trying to EZMorph "..self.unit:Internal().id) + self.unit:Internal():EZMorph() + self:OnToNextTask() + elseif action == "wait" then + if task.frames == "infinite" then + return + end + t = TaskQueueWakeup(self) + tqb = self + local wakeup = function() + tqb:ProgressQueue() + end + self.ai.sleep:Wait( wakeup, task.frames) + elseif action == "command" then + if task.params then + self.unit:Internal():ExecuteCustomCommand(task.params.cmdID, task.params.cmdParams, task.params.cmdOptions) + end + elseif UnitDefNames[action] and task.pos then + if not task.pos.x then + task.pos = nil + end + self:TryToBuild(action, task.pos) + elseif action == "move" then + self.unit:Internal():Move(task.position) + elseif action == "moverelative" then + local upos = unit:GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():Move(newpos) + elseif action == "fight" then + self.unit:Internal():MoveAndFire(task.position) + elseif action == "fightrelative" then + local upos = self.unit:Internal():GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():MoveAndFire(newpos) + elseif action == "patrol" then + self.unit:Internal():MoveAndPatrol(task.position) + elseif action == "patrolrelative" then + local upos = self.unit:Internal():GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():MoveAndPatrol(newpos) + else + self.game:SendToConsole("Error: Unknown action task "..value.." given to a "..self.name) + self:DebugPoint("nothing") + self:OnToNextTask() + end +end + +function onsuccess( job, pos ) + job.tqb:OnBuildingPlacementSuccess( job, pos ) +end + +function onfail( job ) + job.tqb:OnBuildingPlacementFailure( job ) +end + +function TaskQueueBehaviour:IsWaitingForPosition() + return self.placementInProgress +end + + +function TaskQueueBehaviour:BeginWaitingForPosition() + self.placementInProgress = true +end + +function TaskQueueBehaviour:StopWaitingForPosition() + self.placementInProgress = false +end + +function TaskQueueBehaviour:BuildOnMap(utype,pos) + unit = self.unit:Internal() + local facing = 0 + if pos then + pos, facing = self.ai.newplacementhandler:CreateNewPlan(unit, utype, pos) + else + pos = unit:GetPosition() + pos, facing = self.ai.newplacementhandler:CreateNewPlan(unit, utype, pos) + end + job = { + start_position=pos, + max_radius=1500, + onSuccess=onsuccess, + onFail=onfail, + unittype=utype, + cleanup_on_unit_death=self.unit.engineID, + tqb=self + } + if pos then + self:OnBuildingPlacementSuccess( job, pos, facing ) + return true + else + self:OnBuildingPlacementFailure( job, pos ) + return false + end +end + +function TaskQueueBehaviour:BuildGeo(utype) + -- find a free spot! + unit = self.unit:Internal() + local facing = 0 + p = unit:GetPosition() + p = self.ai.geospothandler:ClosestFreeGeo(utype,p,2500) + if p == nil or self.game.map:CanBuildHere(utype,p) ~= true then + self:OnToNextTask() + return false + end + p, facing = self.ai.newplacementhandler:CreateNewPlanNoSearch(unit,utype,p) + return self.unit:Internal():Build(utype,p,facing,{"shift"}) +end + +function TaskQueueBehaviour:BuildExtractor(utype) + -- find a free spot! + unit = self.unit:Internal() + local p = unit:GetPosition() + local up = p + local facing = 0 + p = self.ai.metalspothandler:ClosestFreeSpot(utype,p) + if not p then + self:OnToNextTask() + return false + end + p, facing = self.ai.newplacementhandler:CreateNewPlanNoSearch(unit,utype,p) + return self.unit:Internal():Build(utype,p,facing,{"shift"}) +end + +function TaskQueueBehaviour:OnToNextTask() + self.progress = true +end + +function TaskQueueBehaviour:IsDoingSomething() + return ( self.progress == false ) +end + +function TaskQueueBehaviour:OnBuildingPlacementSuccess( job, pos, facing ) + self:StopWaitingForPosition() + local p = dump( pos ) + local success self.unit:Internal():Build( job.unittype, pos, facing,{"shift"}) + --if success == false then + --self:OnToNextTask() + --end +end + +function TaskQueueBehaviour:OnBuildingPlacementFailure( job ) + self:StopWaitingForPosition() + self:OnToNextTask() +end + +function TaskQueueBehaviour:Activate() + self.progress = true + self.active = true +end + +function TaskQueueBehaviour:Deactivate() + self.active = false +end + +function TaskQueueBehaviour:Priority() + return 50 +end + +function TaskQueueBehaviour:DebugPoint( type ) + local unit = self.unit:Internal() + local p = unit:GetPosition() + SendToUnsynced("shard_debug_position",p.x,p.z,type) +end diff --git a/LuaRules/Gadgets/ai/EvoRTS/taskqueues.lua b/LuaRules/Gadgets/ai/EvoRTS/taskqueues.lua new file mode 100644 index 000000000..427ba18c5 --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/taskqueues.lua @@ -0,0 +1,1376 @@ +--[[ +Task Queues! +]]-- + +math.randomseed( os.time() ) +math.random(); math.random(); math.random() + +--------------------------------------------- Functions for AI +local aiDebug = Spring.GetModOptions().aidebug +local spGetTeamUnitsSorted = Spring.GetTeamUnitsSorted +local spGetUnitDefID = Spring.GetUnitDefID +local spGetTeamResources = Spring.GetTeamResources +local spGetTeamUnitDefCount = Spring.GetTeamUnitDefCount +local spGetTeamInfo = Spring.GetTeamInfo +local spGetTeamStartPosition = Spring.GetTeamStartPosition +local spGetAllyTeamStartBox = Spring.GetAllyTeamStartBox +local liftersqueued = 0 +local skip = {action = "nexttask"} +local MaximumSupply = tonumber(Spring.GetModOptions().supplycap) +if MaximumSupply == nil then + MaximumSupply = 400 +end +--Spring.GetGameSeconds() -- checking gametime + +local UDC = Spring.GetTeamUnitDefCount +local UDN = UnitDefNames +---------------------------------------------------------------------- + +local unitoptions = {} +local options = {} +local skip = {action = "nexttask"} +local assistaround = { action = "fightrelative", position = {x = 0, y = 0, z = 0} } +local patrolaround = { action = "patrolrelative", position = {x = 1, y = 0, z = 1} } +local ezMorph = {action = "ezmorph"} + +-------------------------------------------------------------------------------------------- +--------------------------------------- Main Functions ------------------------------------- +-------------------------------------------------------------------------------------------- + +---- UNIT COUNTS --- + +function GetArtileryUnits(tqb,ai,unit) + local list = { + UDN.eartytank.id, UDN.eartytank_up1.id, UDN.eartytank_up2.id, UDN.eartytank_up3.id, + UDN.eartytank_saturation.id, UDN.eartytank_saturation_up1.id, UDN.eartytank_saturation_up2.id, UDN.eartytank_saturation_up3.id, + UDN.eamphibarty.id, UDN.eamphibarty_up1.id, UDN.eamphibarty_up2.id, UDN.eamphibarty_up3.id, + UDN.eallterrassault.id, UDN.eallterrassault_up1.id, UDN.eallterrassault_up2.id, UDN.eallterrassault_up3.id, + UDN.xklab.id, + } + local units = Spring.GetTeamUnitsByDefs(ai.id, list) + return #units +end + +function GetFacs(tqb,ai,unit) + local list = { + UDN.eairplant.id, UDN.eairplant_up1.id, UDN.eairplant_up2.id, UDN.eairplant_up3.id, + UDN.eminifac.id, UDN.eminifac_up1.id, UDN.eminifac_up2.id, UDN.eminifac_up3.id, + UDN.eamphibfac.id, UDN.eamphibfac_up1.id, UDN.eamphibfac_up2.id, UDN.eamphibfac_up3.id, + UDN.ehbotfac.id, UDN.ehbotfac_up1.id, UDN.ehbotfac_up2.id, UDN.ehbotfac_up3.id, + UDN.ebasefactory.id, UDN.ebasefactory_up1.id, UDN.ebasefactory_up2.id, UDN.ebasefactory_up3.id, + UDN.xklab.id, + } + local units = Spring.GetTeamUnitsByDefs(ai.id, list) + return #units +end + +function GetPlannedFacs(tqb, ai, unit) + local list = { + UDN.eairplant.id, UDN.eairplant_up1.id, UDN.eairplant_up2.id, UDN.eairplant_up3.id, + UDN.eminifac.id, UDN.eminifac_up1.id, UDN.eminifac_up2.id, UDN.eminifac_up3.id, + UDN.eamphibfac.id, UDN.eamphibfac_up1.id, UDN.eamphibfac_up2.id, UDN.eamphibfac_up3.id, + UDN.ehbotfac.id, UDN.ehbotfac_up1.id, UDN.ehbotfac_up2.id, UDN.ehbotfac_up3.id, + UDN.ebasefactory.id, UDN.ebasefactory_up1.id, UDN.ebasefactory_up2.id, UDN.ebasefactory_up3.id, + UDN.xklab.id, + } + local total = 0 + for ct, unitDefID in pairs(list) do + local planned = ai.newplacementhandler:GetExistingPlansByUnitDefID(unitDefID) + for planID, plan in pairs(planned) do + total = total + 1 + end + end + return total +end + +function GetPlannedAndUnfinishedFacs(tqb,ai,unit) + local list = { + UDN.eairplant.id, UDN.eairplant_up1.id, UDN.eairplant_up2.id, UDN.eairplant_up3.id, + UDN.eminifac.id, UDN.eminifac_up1.id, UDN.eminifac_up2.id, UDN.eminifac_up3.id, + UDN.eamphibfac.id, UDN.eamphibfac_up1.id, UDN.eamphibfac_up2.id, UDN.eamphibfac_up3.id, + UDN.ehbotfac.id, UDN.ehbotfac_up1.id, UDN.ehbotfac_up2.id, UDN.ehbotfac_up3.id, + UDN.ebasefactory.id, UDN.ebasefactory_up1.id, UDN.ebasefactory_up2.id, UDN.ebasefactory_up3.id, + UDN.xklab.id, + } + local count = 0 + for ct, unitDefID in pairs(list) do + count = count + UUDC(UnitDefs[unitDefID].name, ai.id) + end + count = count + GetPlannedFacs(tqb, ai, unit) + return count +end + +function AllFacs(tqb, ai, unit) + return GetFacs(tqb,ai,unit) + GetPlannedFacs(tqb, ai, unit) +end + + +function GetType(tqb,ai,unit,list) + local units = Spring.GetTeamUnitsByDefs(ai.id, list) + return #units +end + +function GetPlannedType(tqb, ai, unit,list) + local total = 0 + for ct, unitDefID in pairs(list) do + local planned = ai.newplacementhandler:GetExistingPlansByUnitDefID(unitDefID) + for planID, plan in pairs(planned) do + total = total + 1 + end + end + return total +end + +function GetPlannedAndUnfinishedType(tqb,ai,unit,list) + local count = 0 + for ct, unitDefID in pairs(list) do + count = count + UUDC(UnitDefs[unitDefID].name, ai.id) + end + count = count + GetPlannedType(tqb, ai, unit,list) + return count +end + +function AllType(tqb, ai, unit, list) + return GetType(tqb,ai,unit,list) + GetPlannedType(tqb, ai, unit, list) +end + + +function UUDC(unitName, teamID) -- Unfinished UnitDef Count + local count = 0 + if UnitDefNames[unitName] then + local tableUnits = Spring.GetTeamUnitsByDefs(teamID, UnitDefNames[unitName].id) + for k, v in pairs(tableUnits) do + local _,_,_,_,bp = Spring.GetUnitHealth(v) + if bp < 1 then + count = count + 1 + end + end + end + return count +end + +function MoveToRandomStartBoxLocation(tqb, ai, unit) + local _,_,_,_,_,MyAllyTeam = Spring.GetTeamInfo(ai.id) + local startxmin, startzmin, startxmax, startzmax = spGetAllyTeamStartBox(MyAllyTeam) + local mx = Game.mapSizeX + local mz = Game.mapSizeZ + if startxmax == mx and startzmax == mz and startxmin == 0 and startzmin == 0 then + return skip + else + px = math.random(startxmin, startxmax) + pz = math.random(startzmin, startzmax) + py = Spring.GetGroundHeight(px, pz) + end + if py <= 0 then + return skip + end + return {action = "move", position = {x = px, y = py, z = pz}} +end + +---- FIND BEST --- +function FindBest(unitoptions,ai) + if unitoptions and unitoptions[1] then + local effect = {} + local randomization = 1 + local randomunit = {} + for n, unitName in pairs(unitoptions) do + local cost = UnitDefs[UnitDefNames[unitName].id].energyCost + UnitDefs[UnitDefNames[unitName].id].metalCost + local avgkilled_cost = GG.AiHelpers.UnitInfo(ai.id, UnitDefNames[unitName].id) and GG.AiHelpers.UnitInfo(ai.id, UnitDefNames[unitName].id).avgkilled_cost or 200 --start at 200 so that costly units aren't made from the start + effect[unitName] = math.max(math.floor((avgkilled_cost/cost)^4*10),1) + for i = randomization, randomization + effect[unitName] do + randomunit[i] = unitName + end + randomization = randomization + effect[unitName] + end + if randomization < 1 then + return skip + end + return randomunit[math.random(1,randomization)] + else + return unitoptions[math.random(1,#unitoptions)] + end +end +--------------- + +---------------------------------------------------------------- BUILD FUNCTIONS +--------------------------------------STRUCTURES + +function BuildTechFacility(tqb, ai, unit) + --Spring.Echo([[Build Tech Facility]]) + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + elseif not GG.TechCheck("tech1", ai.id) and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.etech1.id) == 0 then + return "etech1" + else + return skip + end +end + +function BuildFactory(tqb, ai, unit) + --Spring.Echo([[Build Factory]]) + local count = GetFacs(tqb,ai,unit) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + elseif count < Spring.GetGameSeconds()*0.00332 then + if count > 0 and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up1.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up2.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up3.id) < 1 then + return "eairplant" + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"eairplant", "eminifac", "eamphibfac", "ehbotfac", "ebasefactory",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eminifac", "eamphibfac", "ehbotfac", "ebasefactory",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildMex(tqb, ai, unit) + --Spring.Echo([[Build Mex]]) + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + else + return "emetalextractor" + end +end + +function BuildEnergy(tqb, ai, unit) + --Spring.Echo([[Build Energy]]) + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + else + local r = math.random(0,20) + if ei <= ee or r == 0 then + if GG.TechCheck("tech3", ai.id) then + return "efusion2" + elseif GG.TechCheck("tech2", ai.id) then + return "egeothermal" + elseif GG.TechCheck("tech1", ai.id) then + return "esolar2" + elseif GG.TechCheck("tech0", ai.id) then + return "esolar2" + end + else + return skip + end + end +end + +function BuildSupply(tqb, ai, unit) + --Spring.Echo([[Build Supply]]) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") + local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + elseif su < sm - 20 and sm ~= MaximumSupply then + return "estorage" + elseif ms < Spring.GetGameSeconds() and ms < 1000 then + return "estorage" + else + return skip + end +end + +function BuildTurret(tqb, ai, unit) + --Spring.Echo([[Build Turret]]) + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + local r = math.random(0,1) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + elseif r == 0 then + local LT = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elightturret2.id) + local AAT = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.elaserbattery.id) + if GG.TechCheck("tech2", ai.id) then + local HT = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eheavyturret2.id) + if AAT*5 < LT and AAT*5 < HT then + return "elaserbattery" + elseif HT < LT then + return "eheavyturret2" + else + return "elightturret2" + end + elseif AAT*10 < LT and GG.TechCheck("tech1", ai.id) then + return "elaserbattery" + else + return "elightturret2" + end + else + return skip + end +end + +function BuildEngineers(tqb, ai, unit) + --Spring.Echo([[Build Engineers]]) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + else + local GetORBs = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eorb.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eorb_up1.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eorb_up2.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eorb_up3.id) + 1 + local rORB = math.random(0, GetORBs) + if rORB == 0 then + return "eorb" + else + return skip + end + end +end + +function BuildSupport(tqb, ai, unit) + --Spring.Echo([[Build Support]]) + local GetLifters = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.ehbotengineer.id) + 1 + local rLifter = math.random(0, GetLifters*2) + if GetLifters < 4 or rLifter == 0 then + return "ehbotengineer" + else + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,20) + if r == 0 then + local unitoptions = {"emine", "escoutdrone", "eradar2", "ebox", "ejammer2", "eshieldgen", "ekmar", "esilo", "eartyturret",} + return unitoptions[math.random(1,#unitoptions)] + else + local unitoptions = {"emine", "escoutdrone", "eradar2", "ebox", "ejammer2",} + return unitoptions[math.random(1,#unitoptions)] + end + elseif GG.TechCheck("tech2", ai.id) then + local r = math.random(0,30) + if r == 0 then + local unitoptions = {"emine", "escoutdrone", "eradar2", "ebox", "ejammer2", "eshieldgen", "ekmar",} + return unitoptions[math.random(1,#unitoptions)] + else + local unitoptions = {"emine", "escoutdrone", "eradar2", "ebox", "ejammer2",} + return unitoptions[math.random(1,#unitoptions)] + end + elseif GG.TechCheck("tech1", ai.id) then + local unitoptions = {"emine", "escoutdrone", "eradar2", "ebox",} + return unitoptions[math.random(1,#unitoptions)] + else + local unitoptions = {"emine", "escoutdrone",} + return unitoptions[math.random(1,#unitoptions)] + end + end +end + +--------------------------------------------UNITS +---Air +function BuildAirUP0(tqb, ai, unit) + if GG.TechCheck("tech3", ai.id) then + local unitoptions = {"efighter", "egunship2", "ebomber", "eairemp",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"efighter", "egunship2", "ebomber",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildAirUP1(tqb, ai, unit) + if GG.TechCheck("tech3", ai.id) then + local unitoptions = {"efighter_up1", "egunship2_up1", "ebomber_up1", "eairemp_up1",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"efighter_up1", "egunship2_up1", "ebomber_up1",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildAirUP2(tqb, ai, unit) + if GG.TechCheck("tech3", ai.id) then + local unitoptions = {"efighter_up2", "egunship2_up2", "ebomber_up2", "eairemp_up2",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"efighter_up2", "egunship2_up2", "ebomber_up2",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildAirUP3(tqb, ai, unit) + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,100) + if r == 0 then + return "ekrow_up3" + else + local unitoptions = {"efighter_up3", "egunship2_up3", "ebomber_up3", "eairemp_up3",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"efighter_up3", "egunship2_up3", "ebomber_up3",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +----AllTer + +function BuildAllTerUP0(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault", "eallterrheavy", "eallterrlight", "eallterrmed", "eallterrriot", "eallterrshield",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrheavy", "eallterrlight", "eallterrmed", "eallterrriot", "eallterrshield",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault", "eallterrlight", "eallterrriot", "eallterrshield",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrlight", "eallterrriot", "eallterrshield",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAllTerUP1(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up1", "eallterrheavy_up1", "eallterrlight_up1", "eallterrmed_up1", "eallterrriot_up1", "eallterrshield_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrheavy_up1", "eallterrlight_up1", "eallterrmed_up1", "eallterrriot_up1", "eallterrshield_up1",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up1", "eallterrlight_up1", "eallterrriot_up1", "eallterrshield_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrlight_up1", "eallterrriot_up1", "eallterrshield_up1",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAllTerUP2(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up2", "eallterrheavy_up2", "eallterrlight_up2", "eallterrmed_up2", "eallterrriot_up2", "eallterrshield_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrheavy_up2", "eallterrlight_up2", "eallterrmed_up2", "eallterrriot_up2", "eallterrshield_up2",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up2", "eallterrlight_up2", "eallterrriot_up2", "eallterrshield_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrlight_up2", "eallterrriot_up2", "eallterrshield_up2",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAllTerUP3(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,100) + if r == 0 then + return "eallterranarchid_up3" + else + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up3", "eallterrheavy_up3", "eallterrlight_up3", "eallterrmed_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrheavy_up3", "eallterrlight_up3", "eallterrmed_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + end + end + elseif GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up3", "eallterrheavy_up3", "eallterrlight_up3", "eallterrmed_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrheavy_up3", "eallterrlight_up3", "eallterrmed_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eallterrassault_up3", "eallterrlight_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eallterrlight_up3", "eallterrriot_up3", "eallterrshield_up3",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +----Amphib + +function BuildAmphibUP0(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty", "eamphibbuggy", "eamphibmedtank", "eamphibneedle", "eamphibrock",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy", "eamphibmedtank", "eamphibneedle", "eamphibrock",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty", "eamphibbuggy", "eamphibneedle",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy", "eamphibneedle",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAmphibUP1(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up1", "eamphibbuggy_up1", "eamphibmedtank_up1", "eamphibneedle_up1", "eamphibrock_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up1", "eamphibmedtank_up1", "eamphibneedle_up1", "eamphibrock_up1",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up1", "eamphibbuggy_up1", "eamphibneedle_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up1", "eamphibneedle_up1",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAmphibUP2(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up2", "eamphibbuggy_up2", "eamphibmedtank_up2", "eamphibneedle_up2", "eamphibrock_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up2", "eamphibmedtank_up2", "eamphibneedle_up2", "eamphibrock_up2",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up2", "eamphibbuggy_up2", "eamphibneedle_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up2", "eamphibneedle_up2",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildAmphibUP3(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,100) + if r == 0 then + return "eamphibleveler_up3" + else + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up3", "eamphibbuggy_up3", "eamphibmedtank_up3", "eamphibneedle_up3", "eamphibrock_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up3", "eamphibmedtank_up3", "eamphibneedle_up3", "eamphibrock_up3",} + return FindBest(unitoptions, ai) + end + end + elseif GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up3", "eamphibbuggy_up3", "eamphibmedtank_up3", "eamphibneedle_up3", "eamphibrock_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up3", "eamphibmedtank_up3", "eamphibneedle_up3", "eamphibrock_up3",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eamphibarty_up3", "eamphibbuggy_up3", "eamphibneedle_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eamphibbuggy_up3", "eamphibneedle_up3",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +----Hbot + +function BuildHbotUP0(tqb, ai, unit) + if GG.TechCheck("tech2", ai.id) then + local unitoptions = {"ehbotpeewee", "ehbotrocko", "ehbotsniper", "ehbotthud",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech1", ai.id) then + local unitoptions = {"ehbotpeewee", "ehbotthud",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildHbotUP1(tqb, ai, unit) + if GG.TechCheck("tech2", ai.id) then + local unitoptions = {"ehbotpeewee_up1", "ehbotrocko_up1", "ehbotsniper_up1", "ehbotthud_up1",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech1", ai.id) then + local unitoptions = {"ehbotpeewee_up1", "ehbotthud_up1",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildHbotUP2(tqb, ai, unit) + if GG.TechCheck("tech2", ai.id) then + local unitoptions = {"ehbotpeewee_up2", "ehbotrocko_up2", "ehbotsniper_up2", "ehbotthud_up2",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech1", ai.id) then + local unitoptions = {"ehbotpeewee_up2", "ehbotthud_up2",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +function BuildHbotUP3(tqb, ai, unit) + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,100) + if r == 0 then + return "ehbotkarganneth_up3" + else + local unitoptions = {"ehbotpeewee_up3", "ehbotrocko_up3", "ehbotsniper_up3", "ehbotthud_up3",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech2", ai.id) then + local unitoptions = {"ehbotpeewee_up3", "ehbotrocko_up3", "ehbotsniper_up3", "ehbotthud_up3",} + return FindBest(unitoptions, ai) + elseif GG.TechCheck("tech1", ai.id) then + local unitoptions = {"ehbotpeewee_up3", "ehbotthud_up3",} + return FindBest(unitoptions, ai) + else + return skip + end +end + +----Hover + +function BuildHoverUP0(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank", "eheavytank3", "elighttank3", "emissiletank", "eriottank2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eheavytank3", "elighttank3", "emissiletank", "eriottank2",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank", "elighttank3", "eriottank2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"elighttank3", "eriottank2",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildHoverUP1(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up1", "eheavytank3_up1", "elighttank3_up1", "emissiletank_up1", "eriottank2_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eheavytank3_up1", "elighttank3_up1", "emissiletank_up1", "eriottank2_up1",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up1", "elighttank3_up1", "eriottank2_up1",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"elighttank3_up1", "eriottank2_up1",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildHoverUP2(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up2", "eheavytank3_up2", "elighttank3_up2", "emissiletank_up2", "eriottank2_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eheavytank3_up2", "elighttank3_up2", "emissiletank_up2", "eriottank2_up2",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up2", "elighttank3_up2", "eriottank2_up2",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"elighttank3_up2", "eriottank2_up2",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +function BuildHoverUP3(tqb, ai, unit) + local ArtyCount = GetArtileryUnits(tqb,ai,unit) + if GG.TechCheck("tech3", ai.id) then + local r = math.random(0,100) + if r == 0 then + return "elacerator_up3" + else + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up3", "eheavytank3_up3", "elighttank3_up3", "emissiletank_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eheavytank3_up3", "elighttank3_up3", "emissiletank_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + end + end + elseif GG.TechCheck("tech2", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up3", "eheavytank3_up3", "elighttank3_up3", "emissiletank_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"eheavytank3_up3", "elighttank3_up3", "emissiletank_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + end + elseif GG.TechCheck("tech1", ai.id) then + local rArty = math.random(0, ArtyCount + 1) + if rArty <= 5 then + local unitoptions = {"eartytank_up3", "elighttank3_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + else + local unitoptions = {"elighttank3_up3", "eriottank2_up3",} + return FindBest(unitoptions, ai) + end + else + return skip + end +end + +---------------------------------------------------------------- QUEUES +---Air +local AirFactoryQueueUP0 = { + ezMorph, + BuildAirUP0, +} + +-- local AirFactoryQueueUP1 = { + -- ezMorph, + -- BuildAirUP1, +-- } + +-- local AirFactoryQueueUP2 = { + -- ezMorph, + -- BuildAirUP2, +-- } + +-- local AirFactoryQueueUP3 = { + -- ezMorph, + -- BuildAirUP3, +-- } + +---AllTer +local AllTerFactoryQueueUP0 = { + ezMorph, + BuildAllTerUP0, +} + +-- local AllTerFactoryQueueUP1 = { + -- ezMorph, + -- BuildAllTerUP1, +-- } + +-- local AllTerFactoryQueueUP2 = { + -- ezMorph, + -- BuildAllTerUP2, +-- } + +-- local AllTerFactoryQueueUP3 = { + -- ezMorph, + -- BuildAllTerUP3, +-- } + +---Amphib +local AmphibFactoryQueueUP0 = { + ezMorph, + BuildAmphibUP0, +} + +-- local AmphibFactoryQueueUP1 = { + -- ezMorph, + -- BuildAmphibUP1, +-- } + +-- local AmphibFactoryQueueUP2 = { + -- ezMorph, + -- BuildAmphibUP2, +-- } + +-- local AmphibFactoryQueueUP3 = { + -- ezMorph, + -- BuildAmphibUP3, +-- } + +---Hbot +local HbotFactoryQueueUP0 = { + ezMorph, + BuildHbotUP0, +} + +-- local HbotFactoryQueueUP1 = { + -- ezMorph, + -- BuildHbotUP1, +-- } + +-- local HbotFactoryQueueUP2 = { + -- ezMorph, + -- BuildHbotUP2, +-- } + +-- local HbotFactoryQueueUP3 = { + -- ezMorph, + -- BuildHbotUP3, +-- } + +---Hover +local HoverFactoryQueueUP0 = { + ezMorph, + BuildHoverUP0, +} + +-- local HoverFactoryQueueUP1 = { + -- ezMorph, + -- BuildHoverUP1, +-- } + +-- local HoverFactoryQueueUP2 = { + -- ezMorph, + -- BuildHoverUP2, +-- } + +-- local HoverFactoryQueueUP3 = { + -- ezMorph, + -- BuildHoverUP3, +-- } + +local overseerlistfirst = { + BuildEngineers, + BuildTurret, + BuildEngineers, + BuildEngineers, + BuildEngineers, + BuildEngineers, + BuildEngineers, + BuildTurret, +} + +local overseerorders = { + BuildFactory, + BuildTechFacility, + BuildEnergy, + BuildTurret, + MoveToRandomStartBoxLocation, +} + +local lifterlist = { + BuildFactory, + BuildMex, + BuildTurret, + MoveToRandomStartBoxLocation, + BuildFactory, + BuildEnergy, + BuildSupply, + BuildTurret, + BuildEngineers, + BuildSupport, + BuildMex, + BuildTurret, + BuildEnergy, + BuildSupply, + BuildEngineers, + BuildSupport, +} + +local lifterareamex = { + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + "emetalextractor", + BuildTurret, + MoveToRandomStartBoxLocation, +} + +----------------------------------------------------- + +local function overseerqueue() + if ai.engineerfirst == true then + return overseerorders + else + ai.engineerfirst = true + return overseerlistfirst + end +end + +local function lifterqueue() + if liftersqueued > 2 then + liftersqueued = liftersqueued - 0.30 + return lifterlist + else + liftersqueued = liftersqueued + 1 + return lifterareamex + end +end + +------------------------------------------------- ZAAAAAAAAAAAAAALS +function GetZaalSpawners(tqb,ai,unit) + local list = { + UDN.zhatch.id, UDN.zhatch_up1.id, UDN.zhatch_up2.id + } + local units = Spring.GetTeamUnitsByDefs(ai.id, list) + return #units +end + +local function ZaalMorph(tqb, ai, unit) + return ezMorph +end + + +local function ZaalUnitLists(tqb, ai, unit) + local r = math.random(0,10) + local scouts = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.zairscout.id) + local r2 = math.random(0,scouts + 1) + + if r2 == 0 then + return "zairscout" + end + + if GG.TechCheck("tech3", ai.id) then + local queens = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.zqueen.id) + if queens == 0 then + return "zqueen" + end + + if r <= 3 then + return "zlightswarm" + else + local options = {"zlightswarm", "zmedswarm", "zairtoairfighter", "zpyro","zairbomber", "zairtogroundfighter", "zarty", "zassault", "zkamikaze", "zskirmisher",} + return FindBest(options, ai) + end + + elseif GG.TechCheck("tech2", ai.id) then + + if r <= 6 then + return "zlightswarm" + else + local options = {"zlightswarm", "zmedswarm", "zairtoairfighter", "zpyro", "zairbomber", "zskirmisher",} + return FindBest(options, ai) + end + + elseif GG.TechCheck("tech1", ai.id) then + + if r <= 9 then + return "zlightswarm" + else + local options = {"zlightswarm", "zpyro", "zmedswarm",} + return FindBest(options, ai) + end + + end +end + + +-- local function ZaalBuild(tqb, ai, unit) + -- local SpawnerCount = GetZaalSpawners(tqb,ai,unit) + -- --local r = math.random(0,SpawnerCount + 1) + -- local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + -- local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") or 0 + -- local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") or 0 + -- if SpawnerCount < 1 then + -- return "zhatch" + -- elseif ec <= es*0.5 and GG.TechCheck("tech1", ai.id) then + -- return "zespire1" + -- elseif su > sm - 20 and sm ~= MaximumSupply then + -- return "ztiberium" + -- else + -- return "zhatch" + -- end +-- end + +local function ZaalBuildHatch(tqb, ai, unit) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local SpawnerCount = GetZaalSpawners(tqb,ai,unit) + Spring.Echo("Hatchtime!") + if ei <= 20 then + Spring.Echo("Hatchtime: Energy is less than 20!") + return "zespire1" + elseif SpawnerCount < 1 then + Spring.Echo("Hatchtime: Spawnercount is less than 1!") + return "zhatch" + elseif mi >= mp then + Spring.Echo("Hatchtime: Metalincome amount is greater than metal pull!") + return "ztenticle" + else + Spring.Echo("Hatchtime: Fuckit, let's build a mex!") + return "zmex" + end +end + +local function ZaalBuildMetal(tqb, ai, unit) + Spring.Echo("Metaltime!") + Spring.Echo("Metaltime: Let's make a mex!") + return "zmex" +end + +local function ZaalBuildEnergy(tqb, ai, unit) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local SpawnerCount = GetZaalSpawners(tqb,ai,unit) + Spring.Echo("Energytime!") + if ei <= 20 then + Spring.Echo("Energytime: Energy is less than 20!") + return "zespire1" + elseif ec <= es*0.7 then + Spring.Echo("Energytime: Energy current is less than or equal to 70% of energy storage!") + return "zespire1" + elseif ec <= es*0.8 and mc <= ms*0.8 then + Spring.Echo("Energytime: Energy current is less than or equal to 80% of energy storage and metal current is less than or equal to 80% of metal storage!") + if SpawnerCount < 1 then + Spring.Echo("Energytime: Spawnercount is less than 1!") + return "zhatch" + else + Spring.Echo("Energytime: Fuckit, let's make a tenticle!") + return "ztenticle" + end + elseif mi >= mp then + Spring.Echo("Hatchtime: Metalincome amount is greater than metal pull!") + return "ztenticle" + else + Spring.Echo("Energytime: Fuckit, let's make a mex!") + return "zmex" + end +end + +local function ZaalBuildSupply(tqb, ai, unit) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + local su = Spring.GetTeamRulesParam(ai.id, "supplyUsed") or 0 + local sm = Spring.GetTeamRulesParam(ai.id, "supplyMax") or 0 + Spring.Echo("Supplytime!") + local SpawnerCount = GetZaalSpawners(tqb,ai,unit) + if ei <= 20 then + Spring.Echo("Supplytime: Energy income is less than 20!") + return "zespire1" + elseif SpawnerCount < 1 then + Spring.Echo("Supplytime: Spawner count is less than 1!") + return "zhatch" + elseif su > sm - 35 and sm ~= MaximumSupply then + Spring.Echo("Supplytime: Supply used is greater than supply max - 35 and supplymax is not equal to maximum supply!") + return "ztiberium" + elseif mi >= mp then + Spring.Echo("Hatchtime: Metalincome amount is greater than metal pull!") + return "ztenticle" + else + Spring.Echo("Supplytime: Fuckit, let's make a mex!") + return "zmex" + end +end + +local ZaalHive1 = { + ZaalUnitLists, + ZaalMorph, +} + +local ZaalHive2 = { + ZaalUnitLists, + ZaalMorph, +} + +local ZaalHive3 = { + ZaalUnitLists, +} + +local ZaalArm = { + "ztenticle", + ZaalBuildMetal, + ZaalBuildSupply, + ZaalBuildEnergy, + ZaalBuildHatch, + ZaalBuildMetal, + ZaalBuildSupply, + ZaalBuildEnergy, + ZaalBuildMetal, + ZaalBuildSupply, + ZaalBuildEnergy, + ZaalBuildMetal, + ZaalBuildSupply, + ZaalBuildEnergy, + ZaalBuildMetal, + ZaalBuildSupply, + ZaalBuildEnergy, + ZaalBuildMetal, +} + +local ZaalEspire = { + ZaalMorph, +} + +local ZaalTenticle = { + assistaround, +} + +-- Pattern + +local function PatternNeedFactory(tqb, ai, unit) + local count = GetFacs(tqb,ai,unit) + local mc, ms, mp, mi, me = Spring.GetTeamResources(ai.id, "metal") + if count < Spring.GetGameSeconds()*0.00332 then + -- if count > 0 and Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up1.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up2.id) + Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.eairplant_up3.id) < 1 then + -- return "eairplant" + -- if GG.TechCheck("tech2", ai.id) then + -- local unitoptions = {"eairplant", "eminifac", "eamphibfac", "ehbotfac", "ebasefactory",} + -- return FindBest(unitoptions, ai) + return "xklab" + -- else + -- local unitoptions = {"eminifac", "eamphibfac", "ehbotfac", "ebasefactory",} + -- return FindBest(unitoptions, ai) + -- end + else + return skip + end +end + +local function PatternNeedEnergy(tqb, ai, unit) + local GetConstructors = Spring.GetTeamUnitDefCount(ai.id, UnitDefNames.xkconstructor.id) + 1 + local rConstructors = math.random(0, GetConstructors*2) + if GetConstructors < 4 or rConstructors == 0 then + return "xkconstructor" + end + local ec, es, ep, ei, ee = Spring.GetTeamResources(ai.id, "energy") + if ei <= ee then + return "xsolar" + else + return skip + end +end + +local function PatternKLabOrder(tqb, ai, unit) + local options = {"xcrasher","xflea","xhammer","xrocko","xskulk","xwarrior",} + return FindBest(options, ai) +end + + + +local PatternCommanderFirst = { + "xmetalextractor", + "xsolar", + "xklab", +} + +local PatternCommander = { + PatternNeedFactory, + PatternNeedEnergy, + "xllt", + MoveToRandomStartBoxLocation, +} + +local PatternMexer = { + "xmetalextractor", + "xmetalextractor", + "xmetalextractor", + "xllt", + MoveToRandomStartBoxLocation, +} + +local PatternEco = { + "xsolar", + "xsolar", + PatternNeedEnergy, + PatternNeedEnergy, + "xstorage", + PatternNeedFactory, + "xllt", + MoveToRandomStartBoxLocation, +} + +local PatternKLab = { + PatternKLabOrder, +} + + + + +local function xcommanderqueue() + if ai.engineerfirst == true then + return PatternCommander + else + ai.engineerfirst = true + return PatternCommanderFirst + end +end + +local function xk1constructor() + if ai.xengineersqueued == nil then + ai.xengineersqueued = 0 + end + if ai.xengineersqueued > 2 then + ai.xengineersqueued = ai.xengineersqueued - 0.5 + return PatternEco + else + ai.xengineersqueued = ai.xengineersqueued + 1 + return PatternMexer + end +end + + +taskqueues = { + --builders + ecommanderbattleai = overseerqueue, + ecommanderbuildai = overseerqueue, + ecommandercloakai = overseerqueue, + ecommanderfactoryai = overseerqueue, + ecommanderhealerai = overseerqueue, + ecommandershieldai = overseerqueue, + ehbotengineer = lifterqueue, + eairplant = AirFactoryQueueUP0, + eairplant_up1 = AirFactoryQueueUP1, + eairplant_up2 = AirFactoryQueueUP2, + eairplant_up3 = AirFactoryQueueUP3, + eminifac = AllTerFactoryQueueUP0, + eminifac_up1 = AllTerFactoryQueueUP1, + eminifac_up2 = AllTerFactoryQueueUP2, + eminifac_up3 = AllTerFactoryQueueUP3, + eamphibfac = AmphibFactoryQueueUP0, + eamphibfac_up1 = AmphibFactoryQueueUP1, + eamphibfac_up2 = AmphibFactoryQueueUP2, + eamphibfac_up3 = AmphibFactoryQueueUP3, + ehbotfac = HbotFactoryQueueUP0, + ehbotfac_up1 = HbotFactoryQueueUP1, + ehbotfac_up2 = HbotFactoryQueueUP2, + ehbotfac_up3 = HbotFactoryQueueUP3, + ebasefactory = HoverFactoryQueueUP0, + ebasefactory_up1 = HoverFactoryQueueUP1, + ebasefactory_up2 = HoverFactoryQueueUP2, + ebasefactory_up3 = HoverFactoryQueueUP3, + zarm = ZaalArm, + zhatch_up2 = ZaalHive3, + zhatch = ZaalHive1, + zhatch_up1 = ZaalHive2, + zmex = ZaalEspire, + zmex_up1 = ZaalEspire, + zmex_up2 = ZaalEspire, + zespire1 = ZaalEspire, + zespire4 = ZaalEspire, + xcommander = xcommanderqueue, + xkconstructor = xk1constructor, + xklab = PatternKLab, + ztenticle = ZaalTenticle, +} +---------------------------------------------------------- diff --git a/LuaRules/Gadgets/ai/EvoRTS/triggerhandler.lua b/LuaRules/Gadgets/ai/EvoRTS/triggerhandler.lua new file mode 100644 index 000000000..da06c904d --- /dev/null +++ b/LuaRules/Gadgets/ai/EvoRTS/triggerhandler.lua @@ -0,0 +1,40 @@ +TriggerHandler = class(Module) + +function TriggerHandler:Name() + return "TriggerHandler" +end + +function TriggerHandler:internalName() + return "triggerhandler" +end + +function TriggerHandler:Init() + +end + +function TriggerHandler:Update() + local frame = Spring.GetGameFrame() + if frame%300 == (self.ai.id*15) then + local x,y,z + local comms = Spring.GetTeamUnitsByDefs(self.ai.id, {UnitDefNames.zarm.id, UnitDefNames.ecommanderbattleai.id, UnitDefNames.ecommanderhealerai.id, UnitDefNames.ecommanderbuildai.id, UnitDefNames.ecommandershieldai.id, UnitDefNames.ecommandercloakai.id, UnitDefNames.ecommanderfactoryai.id }) + if comms[1] then + x,y,z = Spring.GetUnitPosition(comms[1]) + self.commpos = {x = x, y = y, z = z} + local CommSurrounding = Spring.GetUnitsInCylinder(self.commpos.x, self.commpos.z, 1200) + for ct, uid in pairs(CommSurrounding) do + if not Spring.GetUnitNeutral(uid) and not Spring.GetUnitIsBuilding(uid) and not Spring.AreTeamsAllied(Spring.GetUnitTeam(uid), self.ai.id) then + ax,ay,az = Spring.GetUnitPosition(uid) + self.CommAttackerPos = {x = ax, y = ay, z = az} + self.CommInDanger = true + break + else + self.CommAttackerPos = nil + self.CommInDanger = false + end + end + else + self.CommAttackerPos = nil + self.CommInDanger = false + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/ai.lua b/LuaRules/Gadgets/ai/ai.lua new file mode 100644 index 000000000..fae4edccd --- /dev/null +++ b/LuaRules/Gadgets/ai/ai.lua @@ -0,0 +1,145 @@ +ShardAI = class(AIBase) + +function ShardAI:Init() + self.api = shard_include("preload/api") + self.game = self.api.game + self.map = self.api.map + self.game.ai = self + self.map.ai = self + self.game.map = self.map + self.game:SendToConsole("Shard by AF - playing: "..self.game:GameName().." on: "..self.map:MapName()) + + shard_include("behaviourfactory") + shard_include("unit") + shard_include("modules") + + self.modules = {} + if next(modules) ~= nil then + for i,m in ipairs(modules) do + newmodule = m() + self.game:SendToConsole("adding "..newmodule:Name().." module") + local internalname = newmodule:internalName() + self[internalname] = newmodule + table.insert(self.modules,newmodule) + newmodule:SetAI(self) + newmodule:Init() + end + end +end + +function ShardAI:Update() + if self.gameend == true then + return + end + for i,m in ipairs(self.modules) do + if m == nil then + self.game:SendToConsole("nil module!") + else + m:Update() + end + end +end + +function ShardAI:GameMessage(text) + if self.gameend == true then + return + end + for i,m in ipairs(self.modules) do + if m == nil then + self.game:SendToConsole("nil module!") + else + m:GameMessage(text) + end + end +end + +function ShardAI:UnitCreated(engineunit) + if self.gameend == true then + return + end + if engineunit == nil then + self.game:SendToConsole("shard found nil engineunit") + return + end + for i,m in ipairs(self.modules) do + m:UnitCreated(engineunit) + end +end + +function ShardAI:UnitBuilt(engineunit) + if self.gameend == true then + return + end + if engineunit == nil then + self.game:SendToConsole("shard-warning: unitbuilt engineunit nil ") + return + end + for i,m in ipairs(self.modules) do + m:UnitBuilt(engineunit) + end +end + +function ShardAI:UnitDead(engineunit) + if self.gameend == true then + return + end + if engineunit == nil then + return + end + for i,m in ipairs(self.modules) do + m:UnitDead(engineunit) + end +end + +function ShardAI:UnitIdle(engineunit) + if self.gameend == true then + return + end + if engineunit == nil then + self.game:SendToConsole("shard-warning: idle engineunit nil") + return + end + + for i,m in ipairs(self.modules) do + m:UnitIdle(engineunit) + end +end + +function ShardAI:UnitDamaged(engineunit,engineattacker,enginedamage) + if self.gameend == true then + return + end + if engineunit == nil then + return + end + -- self.game:SendToConsole("UnitDamage for " .. enginedamage:Damage()) + for i,m in ipairs(self.modules) do + m:UnitDamaged(engineunit,engineattacker,enginedamage) + end +end + +function ShardAI:UnitMoveFailed(engineunit) + if self.gameend == true then + return + end + if engineunit == nil then + return + end + for i,m in ipairs(self.modules) do + m:UnitMoveFailed(engineunit) + end +end + +function ShardAI:GameEnd() + self.gameend = true + for i,m in ipairs(self.modules) do + m:GameEnd() + end +end + +function ShardAI:AddModule( newmodule ) + local internalname = newmodule:internalName() + self[internalname] = newmodule + table.insert(self.modules,newmodule) + newmodule:Init() +end diff --git a/LuaRules/Gadgets/ai/attackerbehaviour.lua b/LuaRules/Gadgets/ai/attackerbehaviour.lua new file mode 100644 index 000000000..f86d00d2d --- /dev/null +++ b/LuaRules/Gadgets/ai/attackerbehaviour.lua @@ -0,0 +1,71 @@ +shard_include( "attackers" ) + +function IsAttacker(unit) + for i,name in ipairs(attackerlist) do + if name == unit:Internal():Name() then + return true + end + end + return false +end + +AttackerBehaviour = class(Behaviour) + +function AttackerBehaviour:Init() + --self.ai.game:SendToConsole("attacker!") +end + +function AttackerBehaviour:OwnerBuilt() + self.attacking = false + self.ai.attackhandler:AddRecruit(self) +end + + +function AttackerBehaviour:OwnerDead() + self.ai.attackhandler:RemoveRecruit(self) +end + +function AttackerBehaviour:OwnerIdle() + self.attacking = false + self.ai.attackhandler:AddRecruit(self) +end + +function AttackerBehaviour:AttackCell(cell) + p = api.Position() + p.x = cell.posx + p.z = cell.posz + p.y = 0 + self.target = p + self.attacking = true + if self.active then + self.unit:Internal():MoveAndFire(self.target) + else + self.unit:ElectBehaviour() + end +end + +function AttackerBehaviour:Priority() + if not self.attacking then + return 0 + else + return 100 + end +end + +function AttackerBehaviour:Activate() + self.active = true + if self.target then + self.unit:Internal():MoveAndFire(self.target) + self.target = nil + else + self.ai.attackhandler:AddRecruit(self) + end +end + + +function AttackerBehaviour:OwnerDied() + self.ai.attackhandler:RemoveRecruit(self) + self.attacking = nil + self.active = nil + self.unit = nil +end diff --git a/LuaRules/Gadgets/ai/attackers.lua b/LuaRules/Gadgets/ai/attackers.lua new file mode 100644 index 000000000..6cde8ed8c --- /dev/null +++ b/LuaRules/Gadgets/ai/attackers.lua @@ -0,0 +1,13 @@ +--[[ +Attackers! +]]-- + +attackerlist = { + "corak", + "armpw", + "corgator", + "corthud", + "corkrog", + "armham", + "corraid", +} diff --git a/LuaRules/Gadgets/ai/attackhandler.lua b/LuaRules/Gadgets/ai/attackhandler.lua new file mode 100644 index 000000000..0b5a874a4 --- /dev/null +++ b/LuaRules/Gadgets/ai/attackhandler.lua @@ -0,0 +1,179 @@ +AttackHandler = class(Module) + +function AttackHandler:Name() + return "AttackHandler" +end + +function AttackHandler:internalName() + return "attackhandler" +end + +function AttackHandler:Init() + self.recruits = {} + self.counter = 8 +end + +function AttackHandler:Update() +-- stagger targetting if multiple shards are in the game + local f = self.game:Frame() + self.game:GetTeamID() + if math.fmod(f,15) == 0 then + self:DoTargetting() + end +end + +function AttackHandler:UnitDead(engineunit) + if engineunit:Team() == self.game:GetTeamID() then + self.counter = self.counter - 0.2 + self.counter = math.max(self.counter,8) + -- try and clean up dead recruits where possible + for i,v in ipairs(self.recruits) do + if v.engineID == engineunit:ID() then + table.remove(self.recruits,i) + break + end + end + end +end + +function AttackHandler:DoTargetting() + if #self.recruits > self.counter then + + --[[ try and catch invalid recruits and remove them, then reevaluate + local nrecruits = {} + for i,v in ipairs(self.recruits) do + if v.unit ~= nil then + table.insert(nrecruits,v) + break + end + end + self.recruits = nrecruits + if #nrecruits > self.counter then + + else + return + end]]-- + + -- find somewhere to attack + local cells = {} + local celllist = {} + local mapdimensions = self.game.map:MapDimensions() + --enemies = game:GetEnemies() + local enemies = self.game:GetEnemies() + + if enemies and #enemies > 0 then + -- figure out where all the enemies are! + for i=1,#enemies do + local e = enemies[i] + + if e ~= nil then + pos = e:GetPosition() + px = pos.x - math.fmod(pos.x,400) + pz = pos.z - math.fmod(pos.z,400) + px = px/400 + pz = pz/400 + if cells[px] == nil then + cells[px] = {} + end + if cells[px][pz] == nil then + local newcell = { count = 0, posx = 0,posz=0,} + cells[px][pz] = newcell + table.insert(celllist,newcell) + end + cell = cells[px][pz] + cell.count = cell.count + self:ScoreUnit(e) + + -- we dont want to target the center of the cell encase its a ledge with nothing + -- on it etc so target this units position instead + cell.posx = pos.x + cell.posz = pos.z + + -- @TODO: The unit chosen may not be the best unit to target, ideally pick the + -- one closest to the average location of all units in that grid + end + + end + + local bestCell = nil + -- now find the smallest nonvacant cell to go lynch! + for i=1,#celllist do + local cell = celllist[i] + if bestCell == nil then + bestCell = cell + else + if cell.count < bestCell.count then + bestCell = cell + end + end + end + + -- if we have a cell then lets go attack it! + if bestCell ~= nil then + for i,recruit in ipairs(self.recruits) do + recruit:AttackCell(bestCell) + end + + self.counter = self.counter + 0.2 + self.counter = math.min(self.counter,20) + + -- remove all our recruits! + self.recruits = {} + end + end + + -- cleanup + cellist = nil + cells = nil + mapdimensions = nil + + end +end + +function AttackHandler:IsRecruit(attkbehaviour) + for i,v in ipairs(self.recruits) do + if v.engineID == attkbehaviour.engineID then + return true + end + end + return false +end + +function AttackHandler:AddRecruit(attkbehaviour) + if attkbehaviour.unit == nil then + self.game:SendToConsole( "null unit in attack beh found ") + return + end + if not self:IsRecruit(attkbehaviour) then + table.insert(self.recruits,attkbehaviour) + end +end + +function AttackHandler:RemoveRecruit(attkbehaviour) + for i,v in ipairs(self.recruits) do + if v.engineID == attkbehaviour.engineID then + table.remove(self.recruits,i) + return true + end + end + return false +end + +-- How much is this unit worth? +-- +-- Idea: add a table with hardcoded values, +-- and use said values if a units found in +-- that table to highlight strategic value +function AttackHandler:ScoreUnit(unit) + local value = 1 + + if unit:CanMove() then + if unit:CanBuild() then + value = value + 1 + end + else + value = value + 1 + if unit:CanBuild() then + value = value + 1 + end + end + return value +end diff --git a/LuaRules/Gadgets/ai/behaviour.lua b/LuaRules/Gadgets/ai/behaviour.lua new file mode 100644 index 000000000..e87a93468 --- /dev/null +++ b/LuaRules/Gadgets/ai/behaviour.lua @@ -0,0 +1,116 @@ +Behaviour = class(AIBase) + +function Behaviour:init() + self.active = false + self.priority = 0 +end + +function Behaviour:Init() +end + +function Behaviour:Update() +end + +function Behaviour:GameEnd() +end + +function Behaviour:UnitCreated(unit) +end + +function Behaviour:UnitBuilt(unit) +end + +function Behaviour:OwnerBuilt() +end + +function Behaviour:UnitDead(unit) +end + +function Behaviour:OwnerDead() +end + +function Behaviour:UnitDamaged(unit,attacker,damage) +end + +function Behaviour:OwnerDamaged(attacker,damage) +end + +function Behaviour:UnitIdle(unit) +end + +function Behaviour:OwnerIdle() +end + +function Behaviour:UnitMoveFailed(unit) + self:UnitIdle(unit) +end + +function Behaviour:OwnerMoveFailed() + self:OwnerIdle() +end + +function Behaviour:SetUnit(unit) + self.unit = unit + self.engineID = unit.engineID +end + +function Behaviour:SetAI(ai) + self.ai = ai + self.game = ai.game + self.map = ai.map +end + + +function Behaviour:IsActive() + return self.active +end + +-- yields control of the unit, note that this may not result in deactivation, +-- there may be no other behaviours to take control +function Behaviour:YieldControlOfUnit() + self.unit:ElectBehaviour() +end + +function Behaviour:RequestControlOfUnit() + self.unit:ElectBehaviour() +end + +function Behaviour:SetPriority(new_priority) + self.priority = new_priority +end + +function Behaviour:PreActivate() + self.active = true +end + +function Behaviour:Activate() +end + +function Behaviour:PreDeactivate() + self.active = false +end + +function Behaviour:Deactivate() +end + +function Behaviour:Priority() + return self.priority +end + +function Behaviour:RecalculatePriority() + self:SetPriority(0) +end + +function Behaviour:IsActive() + return self.active +end + +function Behaviour:Name() + return 'Behaviour' +end + +function Behaviour:EchoDebug(...) + if self.DebugEnabled then + self.game:SendToConsole(self.game:GetTeamID(), self:Name(), self.unit:Internal():Name(), self.unit:Internal():ID(), ...) + end +end diff --git a/LuaRules/Gadgets/ai/behaviourfactory.lua b/LuaRules/Gadgets/ai/behaviourfactory.lua new file mode 100644 index 000000000..a22b55e0b --- /dev/null +++ b/LuaRules/Gadgets/ai/behaviourfactory.lua @@ -0,0 +1,28 @@ +shard_include( "behaviour" ) +BehaviourFactory = class(AIBase) + +shard_include( "behaviours" ) +function BehaviourFactory:Init() + -- +end + +function BehaviourFactory:AddBehaviours(unit) + if unit == nil then + self.game:SendToConsole("Warning: Shard BehaviourFactory:AddBehaviours was asked to provide behaviours to a nil unit") + return + end + -- add behaviours here + -- unit:AddBehaviour(behaviour) + local b = behaviours[unit:Internal():Name()] + if b == nil then + b = defaultBehaviours(unit, ai) + end + for i,behaviour in ipairs(b) do + t = behaviour() + t:SetAI(ai) + t:SetUnit(unit) + t:Init() + unit:AddBehaviour(t) + end +end + diff --git a/LuaRules/Gadgets/ai/behaviours.lua b/LuaRules/Gadgets/ai/behaviours.lua new file mode 100644 index 000000000..898237c35 --- /dev/null +++ b/LuaRules/Gadgets/ai/behaviours.lua @@ -0,0 +1,28 @@ + +shard_include( "taskqueues" ) +shard_include( "taskqueuebehaviour" ) +shard_include( "attackerbehaviour" ) +shard_include( "pointcapturerbehaviour" ) +shard_include( "bootbehaviour" ) + +behaviours = { } + +function defaultBehaviours(unit, ai) + b = {} + if unit == nil then + return b + end + u = unit:Internal() + table.insert(b, BootBehaviour ) + if u:CanBuild() then + table.insert(b,TaskQueueBehaviour) + else + if IsPointCapturer(unit, ai) then + table.insert(b,PointCapturerBehaviour) + end + if IsAttacker(unit) then + table.insert(b,AttackerBehaviour) + end + end + return b +end diff --git a/LuaRules/Gadgets/ai/boot.lua b/LuaRules/Gadgets/ai/boot.lua new file mode 100644 index 000000000..8440516dd --- /dev/null +++ b/LuaRules/Gadgets/ai/boot.lua @@ -0,0 +1,21 @@ +-- @TODO: Move top level logic out of ai.lua into here, and then make it load environment specific boot.lua files + +if ShardSpringLua then + VFS.Include( "luarules/gadgets/ai/preload/spring_lua/boot.lua" ) +elseif game_engine then + require "spring_cpp/boot" +else + require "preload/shard_null/boot" +end + +shard_include( "ai" ) + +-- create and use an AI +if ShardSpringLua then + return ShardAI() +elseif game_engine then + ai = ShardAI() +else + ai = ShardAI() + ai:Init() +end diff --git a/LuaRules/Gadgets/ai/bootbehaviour.lua b/LuaRules/Gadgets/ai/bootbehaviour.lua new file mode 100644 index 000000000..ac6c2568f --- /dev/null +++ b/LuaRules/Gadgets/ai/bootbehaviour.lua @@ -0,0 +1,78 @@ +-- An initial boot behaviour that takes over a unit initially, +-- makes it wait 3-4 seconds idle after it's been built, then +-- releases control +-- +-- This helps prevent units in factories from immediatley building +-- things or doing stuff before they've left the factory and +-- blocking the factory from building the next unit + +BootBehaviour = class(Behaviour) + +local CMD_MOVE_STATE = 50 +local MOVESTATE_HOLDPOS = 0 + +function BootBehaviour:Init() + self.waiting = true + local u = self.unit:Internal() + self.id = u:ID() + self.name = u:Name() + self.canmove = u:CanMove() + self.finished = false + if u:Type():IsFactory() then + self.count = 0 + else + self.count = 150 + end +end + +function BootBehaviour:OwnerBuilt() + self.finished = true +end + +function BootBehaviour:Update() + if self.waiting == false then + return + end + if self.finished then + self.count = self.count - 1 + if self.count < 1 then + self.waiting = false + self.unit:ElectBehaviour() + end + end +end + +function BootBehaviour:Activate() + self.active = true +end + +function BootBehaviour:Deactivate() + self.active = false +end + +function BootBehaviour:Priority() + -- don't apply to starting units + if self.game:Frame() < 10 then + return 0 + end + + -- don't apply to structures + if self.canmove == false then + return 0 + end + if self.waiting then + return 500 + else + return 0 + end +end + +-- set to hold position while being repaired after resurrect +function BootBehaviour:SetMoveState() + local thisUnit = self.unit + if thisUnit then + local floats = api.vectorFloat() + floats:push_back(MOVESTATE_HOLDPOS) + thisUnit:Internal():ExecuteCustomCommand(CMD_MOVE_STATE, floats) + end +end diff --git a/LuaRules/Gadgets/ai/capturerbehaviour.lua b/LuaRules/Gadgets/ai/capturerbehaviour.lua new file mode 100644 index 000000000..196d8840f --- /dev/null +++ b/LuaRules/Gadgets/ai/capturerbehaviour.lua @@ -0,0 +1,68 @@ +function IsCapturer(unit, ai) + local noncapturelist = ai.game:NonCapturingUnits() + for i = 1, #noncapturelist do + local name = noncapturelist[i] + if name == unit:Internal():Name() then + return false + end + end + return true +end + +CapturerBehaviour = class(Behaviour) + +local function RandomAway(pos, dist, angle) + angle = angle or math.random() * math.pi * 2 + local away = api.Position() + away.x = pos.x + dist * math.cos(angle) + away.z = pos.z - dist * math.sin(angle) + away.y = pos.y + 0 + return away +end + +function CapturerBehaviour:Init() + self.arePoints = self.map:AreControlPoints() + self.maxDist = math.ceil( self.game:CaptureRadius() * 0.9 ) + self.minDist = math.ceil( self.maxDist / 3 ) +end + +function CapturerBehaviour:UnitIdle(unit) + if not self.active then return end + if unit.engineID == self.unit.engineID then + self:GoForth() + end +end + +function CapturerBehaviour:Update() + if not self.active then return end + if not self.nextCheck or self.game:Frame() == self.nextCheck then + self:GoForth() + end +end + +function CapturerBehaviour:Priority() + if self.arePoints then + return 40 + else + return 0 + end +end + +function CapturerBehaviour:Activate() + self.active = true +end + +function CapturerBehaviour:Deactivate() + self.active = false +end + +function CapturerBehaviour:GoForth() + local upos = self.unit:Internal():GetPosition() + local point = self.ai.controlpointhandler:ClosestUncapturedPoint(upos) + if point and point ~= self.currentPoint then + local movePos = RandomAway( point, math.random(self.minDist,self.maxDist) ) + self.unit:Internal():Move(movePos) + self.currentPoint = point + end + self.nextCheck = self.game:Frame() + math.random(60, 90) +end diff --git a/LuaRules/Gadgets/ai/controlpointhandler.lua b/LuaRules/Gadgets/ai/controlpointhandler.lua new file mode 100644 index 000000000..553d235c4 --- /dev/null +++ b/LuaRules/Gadgets/ai/controlpointhandler.lua @@ -0,0 +1,39 @@ +ControlPointHandler = class(Module) + +function ControlPointHandler:Name() + return "ControlPointHandler" +end + +function ControlPointHandler:internalName() + return "controlpointhandler" +end + +local function distance(pos1,pos2) + local xd = pos1.x-pos2.x + local yd = pos1.z-pos2.z + local dist = math.sqrt(xd*xd + yd*yd) + return dist +end + +function ControlPointHandler:Init() + self.ally = self.ai.allyId +end + +function ControlPointHandler:ClosestUncapturedPoint(position) + local pos + local bestDistance + local points = self.map:GetControlPoints() + for i = 1, #points do + local point = points[i] + local pointAlly = point:GetOwner() + if pointAlly ~= self.ally then + local pointPos = point:GetPosition() + local dist = distance(position, pointPos) + if not bestDistance or dist < bestDistance then + bestDistance = dist + pos = pointPos + end + end + end + return pos +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/modules.lua b/LuaRules/Gadgets/ai/modules.lua new file mode 100644 index 000000000..247804c70 --- /dev/null +++ b/LuaRules/Gadgets/ai/modules.lua @@ -0,0 +1,8 @@ +shard_include( "spothandler" ) +shard_include( "controlpointhandler" ) +shard_include( "unithandler" ) +shard_include( "attackhandler" ) +shard_include( "placementhandler" ) +shard_include( "sleep" ) + +modules = { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, PlacementHandler, Sleep } diff --git a/LuaRules/Gadgets/ai/nullbehaviour.lua b/LuaRules/Gadgets/ai/nullbehaviour.lua new file mode 100644 index 000000000..f826fb52a --- /dev/null +++ b/LuaRules/Gadgets/ai/nullbehaviour.lua @@ -0,0 +1,22 @@ +NullBehaviour = class(Behaviour) + +-- this gets called when the unit is idle, which means we finished our +-- stop command, yield control. This probably won't work though because +-- it's a stop command +function NullBehaviour:OwnerIdle() + if self:IsActive() then + self:YieldControl() + end +end + +function NullBehaviour:Priority() + return 0 +end + +function NullBehaviour:Activate() + -- normally we would issue a command here, then when finished, + -- the behaviour would give up control of the unit + + -- but this is a null behaviour, we'll just tell the unit to stop + self.unit:Internal():Stop() +end diff --git a/LuaRules/Gadgets/ai/nullmodule.lua b/LuaRules/Gadgets/ai/nullmodule.lua new file mode 100644 index 000000000..754aaa3b2 --- /dev/null +++ b/LuaRules/Gadgets/ai/nullmodule.lua @@ -0,0 +1,17 @@ +NullModule = class(Module) + +function NullModule:Name() + return "Null Module" -- a nice developer friendly response +end + +function NullModule:internalName() + return "nullmodule" -- ai.nullmodule +end + +function NullModule:Init() + -- we should setup some variables here +end + +function NullModule:Update() + -- nothing much to do is there +end diff --git a/LuaRules/Gadgets/ai/placementhandler.lua b/LuaRules/Gadgets/ai/placementhandler.lua new file mode 100644 index 000000000..ce89da9fa --- /dev/null +++ b/LuaRules/Gadgets/ai/placementhandler.lua @@ -0,0 +1,371 @@ +PlacementHandler = class(Module) + +function PlacementHandler:Name() + return "PlacementHandler" +end + +function PlacementHandler:internalName() + return "placementhandler" +end + +function PlacementHandler:Init() + self.jobs = {} +end + +function snap_to_grid( pos , gridsize ) + pos.x = pos.x - (pos.x % gridsize ) + pos.z = pos.z - (pos.z % gridsize ) + return pos +end + +--[[ +Usage: + +function onSuccess( job, pos ) + -- build something I guess +end +function onFail( job ) + -- nowhere to place it, do something else then? +end +local unittype = ... +local job = { + start_position=[1,2,3], + max_radius=500, + onSuccess=onSuccess, + onFail=onFail, + unittype=unittype, + cleanup_on_unit_death=builderID +} +local success = ai.placementhandler.NewJob( job ) +if success then + -- the job has been schedule, do whatever else we need to do in parallel + -- when a position has been found, it will call the callback function we passed it + -- in the future a promise will be returned letting us define what happens +else + -- there was something wrong with our job and the system rejected it + -- the programmer should probably check all the values that went into the job were set and valid +end + +]] + + +function PlacementHandler:NewJob( details ) + --[[ + local default = { + start_position, + unittype, + placement_tests: [], + max_radius=, + onSuccess=onSuccess, + onFail=onFail, + increment=8 + cleanup_on_unit_death + } + ]]-- + if details["start_position"] == nil then + return false + end + if details["unittype"] == nil then + return false + end + if details["max_radius"] == nil then + details.max_radius = 1500 + end + if details["increment"] == nil then + details.increment = 16 + end + if details.increment < 16 then + details.increment = 16 + end + details.status = 'new' + details.step = 1 + + -- snap the position to a 16x16 grid for consistency + details.start_position = snap_to_grid( start_position, 16 ) + + -- figure out the spiral search pattern necessary + local max_width = details.max_radius * 2 + local spiral_width = max_width/details.increment + details.spiral = self:GenerateSpiral(spiral_width, spiral_width ) + + table.insert( self.jobs, details ) + + -- for now it's using a completion handler, which is a function + -- passed along that it will call when it's finished, but tbh I'd + -- prefer to return some sort of promise structure + return true +end + + +function PlacementHandler:Update() + --[[ + + We need to run through our jobs, but we also need to make sure of several things: + + - when a placement job finishes, we stop processing until the next frame + - that each job only gets a limited amount of time to run + - that the algorithm can run bit by bit over several frames + + To this end, each iteration of the search is self contained. This way we can + progress 5 or 6 steps along the algorithm for each job, making sure we don't + spend too long searching and lag the game out. + + As a bonus, this opens up the future for scheduling and collaborative searches. + It also allows us to cancel and pause searches. + + For our situation, we're going to allot a time budget for each job, and a + time budget for each frame. During this time, we can only work on a job for + so long. If it's a fast CPU we can do more iterations in that time. It also + means we can only work on so many jobs per frame. This way we get the top + of the queue done sooner, so we don't get bogged down in an ever growing queue. + + A bonus of this, is that quick jobs will finish earlier, allowing work to be + done on an extra job. Another side of this is that if the cpu is busy with + stuff, we might have to finish early. I envisage Shard should take time + measurements for the entire frame to make sure that modules such as this + one can give themselves smaller budgets when under load + ]] + + -- exit early if there are no jobs + if #self.jobs == 0 then + return + end + + self:RunIterations() + self:CleanupJobs() +end + +function PlacementHandler:RunIterations() + for i,j in ipairs(self.jobs) do + if j.status ~= 'cleanup' then + local job = self.jobs[i] + self:RunJobIterations( job ) + end + end +end + +function PlacementHandler:RunJobIterations( job ) + local stillGotTime = 4 --500 + -- given this particular job, lets give it a time budget and do as many + -- iterations as we can + while ( stillGotTime > 0 ) and ( job.status ~= 'cleanup' ) do + self:IterateJob( job ) + stillGotTime = stillGotTime - 1 + end +end + +function PlacementHandler:IterateJob( job ) + -- setup this run + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + return + end + job.status = 'running' + local step = job.step + local spos = job.spiral[step] + local pos = { x=0,y=0,z=0} + pos.x = spos.x * job.increment + job.start_position.x + pos.z = spos.y * job.increment + job.start_position.z + pos.y = job.start_position.y + + -- test this particular step of the spiral + local buildable = self:CanBuildAt(job.unittype, pos ) + if buildable then + -- we found a place! + job.result = pos + job.status = 'cleanup' + SendToUnsynced("shard_debug_position",pos.x,pos.z,"final_choice") + job.onSuccess( job, pos ) + end + + job.step = job.step + 1 + if job.step > #job.spiral then + -- we reached the end of the search pattern, we failed to + -- find a location, tell the requested and end the job + job.onFail( job ) + job.status = 'cleanup' + job.result = false + end +end + +function PlacementHandler:CanBuildAt( unittype, pos ) + local buildable = self.ai.map:CanBuildHere( unittype, pos ) + if not buildable then + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_bad") + return false + end + SendToUnsynced("shard_debug_position",pos.x,pos.z,"main_good") + + -- check spacing + -- we're going to do this in a hacky way for now until a blocking + -- map and footprints are added to the shard API, but on the other + -- hand it's simple + + -- what we're going to do is enforce a standardised minimum + -- spacing, and check above below left and right of the position + -- to check, by shifting the position by a set amount and checking + -- that position + + local fixed_spacing = 80 + + -- North + local testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z - fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if false == buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- North East + local testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z - fixed_spacing + testpos.x = testpos.x + fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if false == buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- North West + local testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z - fixed_spacing + testpos.x = testpos.x - fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if false == buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- South + testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z + fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- South East + testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z + fixed_spacing + testpos.x = testpos.x + fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- South West + testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.z = testpos.z + fixed_spacing + testpos.x = testpos.x - fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- East + testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.x = testpos.x + fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + -- West + testpos = { x=pos.x, y=pos.y, z= pos.z } + testpos.x = testpos.x - fixed_spacing + buildable = self.ai.map:CanBuildHere( unittype, testpos ) + if not buildable then + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_bad") + return false + end + SendToUnsynced("shard_debug_position",testpos.x,testpos.z,"secondary_good") + + return true +end + +function is_not_cleanup( job ) + if job.status ~= 'cleanup' then + return true + end + return false +end + +-- filter(function, table) +-- e.g: filter(is_even, {1,2,3,4}) -> {2,4} +function filter(func, tbl) + local newtbl= {} + for i,v in pairs(tbl) do + if func(v) then + newtbl[i]=v + end + end + return newtbl +end + +function PlacementHandler:CleanupJobs() + -- try and clean up dead recruits where possible + --self.jobs = filter( is_not_cleanup, self.jobs ) + for i,j in ipairs(self.jobs) do + if j.status == 'cleanup' then + local job = self.jobs[i] + table.remove( self.jobs, i ) + return + end + end +end + +--[[ +Some jobs are tied to units being alive. This could be because +it's the building the job was intended for. Eitherway, if that +unit dies then the associated job is unnecessary, and needs to +be cleaned up to save cpu +]] +function PlacementHandler:UnitDead(engineunit) + for i,j in ipairs(self.jobs) do + if j['cleanup_on_unit_death'] ~= nil then + if j.cleanup_on_unit_death == engineunit:ID() then + j.status = 'cleanup' + end + end + end +end + + +function PlacementHandler:GenerateSpiral( width, height) + local x = 0 + local y = 0 + local dx = 0 + local dy = -1 + local t = math.max(width,height) + local maxI = t*t; + local result = {} + for i=0, maxI do + if ((-width/2 <= x) and (x <= width/2) and (-height/2 <= y) and (y <= height/2)) then + table.insert( result, {x=x,y=y} ) + end + if ( ( x == y ) or ( ( x < 0 ) and ( x == -y ) ) or ( (x > 0) and ( x == 1-y ) ) ) then + t = dx + dx = dy * -1 + dy = t + end + x = x + dx + y = y + dy + end + return result +end diff --git a/LuaRules/Gadgets/ai/pointcapturerbehaviour.lua b/LuaRules/Gadgets/ai/pointcapturerbehaviour.lua new file mode 100644 index 000000000..6b2c6883e --- /dev/null +++ b/LuaRules/Gadgets/ai/pointcapturerbehaviour.lua @@ -0,0 +1,68 @@ +function IsPointCapturer(unit, ai) + local noncapturelist = ai.game:ControlPointNonCapturingUnits() + for i = 1, #noncapturelist do + local name = noncapturelist[i] + if name == unit:Internal():Name() then + return false + end + end + return true +end + +PointCapturerBehaviour = class(Behaviour) + +local function RandomAway(pos, dist, angle) + angle = angle or math.random() * math.pi * 2 + local away = api.Position() + away.x = pos.x + dist * math.cos(angle) + away.z = pos.z - dist * math.sin(angle) + away.y = pos.y + 0 + return away +end + +function PointCapturerBehaviour:Init() + self.arePoints = self.game:UsesControlPoints() + self.maxDist = math.ceil( self.game:ControlPointCaptureRadius() * 0.9 ) + self.minDist = math.ceil( self.maxDist / 3 ) +end + +function PointCapturerBehaviour:UnitIdle(unit) + if not self.active then return end + if unit.engineID == self.unit.engineID then + self:GoForth() + end +end + +function PointCapturerBehaviour:Update() + if not self.active then return end + if not self.nextCheck or self.game:Frame() == self.nextCheck then + self:GoForth() + end +end + +function PointCapturerBehaviour:Priority() + if self.arePoints then + return 40 + else + return 0 + end +end + +function PointCapturerBehaviour:Activate() + self.active = true +end + +function PointCapturerBehaviour:Deactivate() + self.active = false +end + +function PointCapturerBehaviour:GoForth() + local upos = self.unit:Internal():GetPosition() + local point = self.ai.controlpointhandler:ClosestUncapturedPoint(upos) + if point and point ~= self.currentPoint then + local movePos = RandomAway( point, math.random(self.minDist,self.maxDist) ) + self.unit:Internal():Move(movePos) + self.currentPoint = point + end + self.nextCheck = self.game:Frame() + math.random(60, 90) +end diff --git a/LuaRules/Gadgets/ai/preload/aibase.lua b/LuaRules/Gadgets/ai/preload/aibase.lua new file mode 100644 index 000000000..4633b714d --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/aibase.lua @@ -0,0 +1,46 @@ + +AIBase = class(function(a) + -- +end) + + +function AIBase:Init() +end + +function AIBase:Update() +end + +function AIBase:GameEnd() +end + +function AIBase:GameMessage(text) +end + +function AIBase:UnitCreated(engineunit) +end + +function AIBase:UnitBuilt(engineunit) +end + +function AIBase:UnitGiven(engineunit) + self:UnitCreated(engineunit) + self:UnitBuilt(engineunit) +end + + +function AIBase:UnitDead(engineunit) +end + +function AIBase:UnitIdle(engineunit) +end + +function AIBase:UnitDamaged(engineunit,enginedamage) +end +function AIBase:UnitMoveFailed(engineunit) +end + +function AIBase:SetAI(ai) + self.ai = ai + self.game = ai.game + self.map = ai.map +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/api.lua b/LuaRules/Gadgets/ai/preload/api.lua new file mode 100644 index 000000000..ab647139b --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/api.lua @@ -0,0 +1,108 @@ +-- Humongous proxy class +-- Created by Tom J Nowell 2010 +-- Shard AI + +-- currently included from inside the main AI object during initialisation +local api = {} +if ShardSpringLua then + -- it's a LuaAI inside a game archive! + api.game = shard_include "spring_lua/game" + api.map = shard_include "spring_lua/map" +elseif game_engine then + -- it's a native AI! + api.game = shard_include "spring_cpp/game" + api.map = shard_include "spring_cpp/map" +else + -- who knows! Load a Null non-op API + api.game = shard_include "preload/shard_null/game" + api.map = shard_include "preload/shard_null/map" +end + +return api + +--} +--[[ +{, + +IUnit/ engine unit objects + int ID() + int Team() + std::string Name() + + bool IsAlive() + + bool IsCloaked() + + void Forget() // makes the interface forget about this unit and cleanup + bool Forgotten() // for interface/debugging use + + IUnitType* Type() -- not implemented, use game:GetTypeByName + + bool CanMove() + bool CanDeploy() + bool CanBuild() + bool IsBeingBuilt() + + bool CanAssistBuilding(IUnit* unit) + + bool CanMoveWhenDeployed() + bool CanFireWhenDeployed() + bool CanBuildWhenDeployed() + bool CanBuildWhenNotDeployed() + + void Stop() + void Move(Position p) + void MoveAndFire(Position p) + + bool Build(IUnitType* t) + bool Build(std::string typeName) + bool Build(std::string typeName, Position p) + bool Build(IUnitType* t, Position p) + + bool AreaReclaim(Position p, double radius) + bool Reclaim(IMapFeature* mapFeature) + bool Reclaim(IUnit* unit) + bool Attack(IUnit* unit) + bool Repair(IUnit* unit) + bool MorphInto(IUnitType* t) + + Position GetPosition() + float GetHealth() + float GetMaxHealth() + + int WeaponCount() + float MaxWeaponsRange() + + bool CanBuild(IUnitType* t) + + SResourceTransfer GetResourceUsage(int idx) + + void ExecuteCustomCommand(int cmdId, std::vector params_list, short options = 0, int timeOut = INT_MAX) + + UnitType{ + function Name() -- returns a string e.g. 'corcom' + + function CanDeploy() -- returns boolean + function CanMoveWhenDeployed() -- returns boolean + function CanFireWhenDeployed() -- returns boolean + function CanBuildWhenDeployed() -- returns boolean + function CanBuildWhenNotDeployed() -- returns boolean + + function Extractor() -- returns boolean + + function GetMaxHealth() -- returns a float + + function WeaponCount() -- returns integer + }, + MapFeature { + function ID() + function Name() + function GetPosition() + }, + Position { + x,y,z + }, + +} + +return infos]]-- diff --git a/LuaRules/Gadgets/ai/preload/class.lua b/LuaRules/Gadgets/ai/preload/class.lua new file mode 100644 index 000000000..259ea50b3 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/class.lua @@ -0,0 +1,84 @@ +-- class.lua +-- Compatible with Lua 5.1 (not 5.0). +function class(base, init) + local c = {} -- a new class instance + if not init and type(base) == 'function' then + init = base + base = nil + elseif type(base) == 'table' then + -- our new class is a shallow copy of the base class! + for i,v in pairs(base) do + c[i] = v + end + c._base = base + end + -- the class will be the metatable for all its objects, + -- and they will look up their methods in it. + c.__index = c + + -- expose a constructor which can be called by () + local mt = {} + mt.__call = function(class_tbl, ...) + local obj = {} + setmetatable(obj,c) + if init then + init(obj,...) + else + -- make sure that any stuff from the base class is initialized! + if base and base.init then + base.init(obj, ...) + end + end + return obj + end + c.init = init + c.is_a = function(self, klass) + local m = getmetatable(self) + while m do + if m == klass then return true end + m = m._base + end + return false + end + setmetatable(c, mt) + return c +end + +function table_print (tt, indent, done) + done = done or {} + indent = indent or 0 + if type(tt) == "table" then + local sb = {} + for key, value in pairs (tt) do + table.insert(sb, string.rep (" ", indent)) -- indent it + if type (value) == "table" and not done [value] then + done [value] = true + table.insert(sb, "{\n"); + table.insert(sb, table_print (value, indent + 2, done)) + table.insert(sb, string.rep (" ", indent)) -- indent it + table.insert(sb, "}\n"); + elseif "number" == type(key) then + table.insert(sb, string.format("\"%s\"\n", tostring(value))) + else + table.insert(sb, string.format( + "%s = \"%s\"\n", tostring (key), tostring(value))) + end + end + return table.concat(sb) + else + return tt .. "\n" + end +end + +function to_string( tbl ) + if "nil" == type( tbl ) then + return tostring(nil) + elseif "table" == type( tbl ) then + return table_print(tbl) + elseif "string" == type( tbl ) then + return tbl + else + return tostring(tbl) + end +end + diff --git a/LuaRules/Gadgets/ai/preload/hooks.lua b/LuaRules/Gadgets/ai/preload/hooks.lua new file mode 100644 index 000000000..8d177f7f7 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/hooks.lua @@ -0,0 +1,43 @@ + +hooks = {} +fselfs = {} + +function add_hook(hookname,f,fself) + if hooks[hookname] == nil then + hooks[hookname] = {} + end + hooks[hookname][f] = true + if fself ~= nil then + fselfs[f] = fself + end +end + +function remove_hook(hookname, f) + if hooks[hookname] == nil then + hooks[hookname] = {} + end + hooks[hookname][f] = nil + fselfs[f] = nil +end + +function remove_hooks(hookname) + if hooks[hookname] ~= nil then + for k,v in pairs(hooks[hookname]) do + remove_hook(k,fselfs[k]) + end + hooks[hookname] = nil + end +end + +function do_hook(hookname,data) + if hooks[hookname] ~= nil then + for k,v in pairs(hooks[hookname]) do + local s = fselfs[k] + if s == nil then + k(data) + else + k(s,data) + end + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/module.lua b/LuaRules/Gadgets/ai/preload/module.lua new file mode 100644 index 000000000..ffd0b9651 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/module.lua @@ -0,0 +1,15 @@ +Module = class(AIBase) + +function Module:Name() + return "no name defined" +end + +function Module:internalName() + return "module" +end + +function Module:EchoDebug(...) + if self.DebugEnabled then + self.game:SendToConsole(self.game:GetTeamID(), self:Name(), ...) + end +end diff --git a/LuaRules/Gadgets/ai/preload/shard_null/boot.lua b/LuaRules/Gadgets/ai/preload/shard_null/boot.lua new file mode 100644 index 000000000..288485b22 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/shard_null/boot.lua @@ -0,0 +1,16 @@ + + +function shard_include( file ) + if type(file) ~= 'string' then + return nil + end + return require( file ) +end + +-- load null objects +require "preload/hooks" +require "preload/class" +require "preload/aibase" +require "preload/module" +shard_include "preload/shard_null/unit" +shard_include "preload/shard_null/unittype" \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/shard_null/game.lua b/LuaRules/Gadgets/ai/preload/shard_null/game.lua new file mode 100644 index 000000000..11e96aa46 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/shard_null/game.lua @@ -0,0 +1,100 @@ +local game = {} +--game_engine + +-- prints 'message' to ingame chat console +function game:SendToConsole(...) + print( ... ) + return true +end + +function game:Frame() -- returns int/game frame number + return 0 +end + +function game:Test() -- debug + print( "Testing API" ) + return true +end + +function game:IsPaused() -- if the game is paused, returns true + return true +end + +function game:GetTypeByName(typename) -- returns unittype + return nil +end + +function game:ConfigFolderPath() -- returns string with path to the folder + return "luarules/gadgets/ai/" .. self:GameName() .. "/" + -- return game_engine:ConfigFolderPath() +end + +function game:ReadFile(filename) -- returns string with file contents + return '' -- @TODO: Implement core lua IO +end + +function game:FileExists(filename) -- returns boolean + return false -- @TODO: Implement core lua IO +end + +function game:GetTeamID() + return 0 +end + +function game:GetEnemies() + return {} +end + +function game:GetUnits() + return {} +end + +function game:GetFriendlies() + return {} +end + +function game:GameName() -- returns the shortname of this game + return "nullgame" +end + +function game:AddMarker(position,label) -- adds a marker + return false +end + +function game:SendToContent(stringvar) -- returns a string passed from any lua gadgets + return false +end + +function game:GetResource(idx) -- returns a Resource object + return Shard:shardify_resource({currentLevel=0, storage=0, pull=0, income=0, expense=0, share=0, sent=0, received=0}) +end + +function game:GetResourceCount() -- return the number of resources + return 0 +end + +function game:GetResourceByName(name) -- returns a Resource object, takes the name of the resource + return Shard:shardify_resource({currentLevel=0, storage=0, pull=0, income=0, expense=0, share=0, sent=0, received=0}) +end + +function game:GetUnitByID( unit_id ) -- returns a Shard unit when given an engine unit ID number + return +end + +function game:GetResources() -- returns a table of Resource objects, takes the name of the resource + return {} +end + +function game:UsesControlPoints() + return false +end + +function game:ControlPointCaptureRadius() + return 0 +end + +function game:ControlPointNonCapturingUnits() + return {} +end + +return game diff --git a/LuaRules/Gadgets/ai/preload/shard_null/map.lua b/LuaRules/Gadgets/ai/preload/shard_null/map.lua new file mode 100644 index 000000000..488c69026 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/shard_null/map.lua @@ -0,0 +1,168 @@ +local map = {} + + -- function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) + -- function map:CanBuildHere(unittype,position) + -- function map:GetMapFeatures() + -- function map:GetMapFeaturesAt(position,radius) + -- function map:SpotCount() + -- function map:GetSpot(idx) + -- function map:GetMetalSpots() + -- function map:MapDimensions() + -- function map:MapName() + -- function map:AverageWind() + -- function map:MinimumWindSpeed() + -- function map:MaximumWindSpeed() + -- function map:TidalStrength() + -- function map:MaximumHeight() + -- function map:MinimumHeight() + +-- ################### + +function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) -- returns Position + return false +end + +function map:CanBuildHere(unittype,position) -- returns boolean + return false +end + +function map:GetMapFeatures() + + return {} +end + +function map:GetMapFeaturesAt(position,radius) + return {} +end + +function map:SpotCount() -- returns the nubmer of metal spots + return 0 +end + +function map:GetSpot(idx) -- returns a Position for the given spot + return nil +end + +function map:GetMetalSpots() -- returns a table of spot positions + -- + return {} +end + +function map:GeoCount() -- returns the nubmer of metal spots + return 0 +end + +function map:GetGeo(idx) -- returns a Position for the given spot + return nil +end + +function map:GetGeoSpots() -- returns a table of spot positions + -- + return {} +end + +function map:GetControlPoints() + -- not sure this can be implemented in the Spring C++ AI interface + return {} +end + +function map:AreControlPoints() + -- not sure this can be implemented in the Spring C++ AI interface + return false +end + +function map:MapDimensions() -- returns a Position holding the dimensions of the map + local m = game_engine:Map() + return m:MapDimensions() +end + +function map:MapName() -- returns the name of this map + return "None" +end + +function map:AverageWind() -- returns (minwind+maxwind)/2 + return 1 +end + + +function map:MinimumWindSpeed() -- returns minimum windspeed + return 0 +end + +function map:MaximumWindSpeed() -- returns maximum wind speed + return 1 +end + +function map:MaximumHeight() -- returns maximum map height + return 1 +end + +function map:MinimumHeight() -- returns minimum map height + return 0 +end + +function map:TidalStrength() -- returns tidal strength + return 0 +end + +-- DRAWING FUNCTIONS + +local function dataToString(...) + local data = {...} + local str = '' + for i = 1, #data do + local d = data[i] + str = str .. '|' .. tostring(d) + end + return str +end + +local function SendToUnsynced(command, ...) + -- +end + +function map:DrawRectangle(pos1, pos2, color, label, filled, channel) + -- +end + +function map:EraseRectangle(pos1, pos2, color, label, filled, channel) + -- +end + +function map:DrawCircle(pos, radius, color, label, filled, channel) + -- +end + +function map:EraseCircle(pos, radius, color, label, filled, channel) + -- +end + +function map:DrawLine(pos1, pos2, color, label, arrow, channel) + -- +end + +function map:EraseLine(pos1, pos2, color, label, arrow, channel) + -- +end + +function map:DrawPoint(pos, color, label, channel) + -- +end + +function map:ErasePoint(pos, color, label, channel) + -- +end + +function map:EraseAll(channel) + -- +end + +function map:DisplayDrawings(onOff) + -- +end + +-- END DRAWING FUNCTIONS + + -- game.map = map + +return map \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/shard_null/unit.lua b/LuaRules/Gadgets/ai/preload/shard_null/unit.lua new file mode 100644 index 000000000..f2f2d8c7b --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/shard_null/unit.lua @@ -0,0 +1,324 @@ + +ShardUnit = class(function(a, id) + a.id = id + a.className = "unit" + a.type = nil +end) + +function ShardUnit:Unit_to_id( unit ) + local gid = unit + if type( unit ) == 'table' then + if unit['id'] ~= nil then + gid = unit.id + else + -- error! + return false + end + end + return gid +end + +function ShardUnit:ID() + return self.id +end + +function ShardUnit:Team() + return 1 +end + +function ShardUnit:Radius() + return 10 +end + +function ShardUnit:AllyTeam() + return 1 +end + +function ShardUnit:Neutral() + return false +end + +function ShardUnit:Stunned() + return false +end + +function ShardUnit:Name() + return 'nullunit' +end + + +function ShardUnit:IsAlive() + return true +end + + +function ShardUnit:IsCloaked() + return self:Cloaked() +end + +function ShardUnit:Cloaked() + return false +end + + +function ShardUnit:CurrentStockpile() + return 0 +end + + +function ShardUnit:Type() + return nil +end + + +function ShardUnit:CanMove() + return self:Type():CanMove() +end + + +function ShardUnit:CanDeploy() + return self:Type():CanDeploy() +end + +function ShardUnit:CanMorph() + return self:Type():CanMorph() +end + +function ShardUnit:IsBeingBuilt() + return false +end + +function ShardUnit:IsMorphing() + return false +end + + +function ShardUnit:CanAssistBuilding( unit )-- IUnit* unit) -- the unit that is under construction to help with + return true -- not sure when this would not be true in Spring + -- return false +end + + +function ShardUnit:CanMoveWhenDeployed() + -- what does deployed mean in the case of Spring? + return false +end + + +function ShardUnit:CanFireWhenDeployed() + return false +end + +function ShardUnit:CanMorphWhenDeployed() + return false +end + +function ShardUnit:CanBuildWhenDeployed() + return false +end + + +function ShardUnit:CanBuildWhenNotDeployed() + return false +end + +function ShardUnit:Stop() + return true +end + +function ShardUnit:Stockpile() + return true +end + +function ShardUnit:SelfDestruct() + return true +end + +function ShardUnit:Cloak() + return true +end + +function ShardUnit:UnCloak() + return true +end + +function ShardUnit:TurnOn() + return true +end + +function ShardUnit:TurnOff() + return true +end + +function ShardUnit:Guard( unit ) + return true +end + +function ShardUnit:Repair( unit ) + return true +end + +function ShardUnit:DGun(p) + return self:AltAttack( p ) +end + +function ShardUnit:ManualFire(p) + return true +end + +function ShardUnit:Move(p) + return true +end + +function ShardUnit:AttackMove(p) + return self:MoveAndFire(p) +end + +function ShardUnit:MoveAndFire(p) + return true +end + +function ShardUnit:Patrol(p) + return self:MoveAndPatrol(p) +end + +function ShardUnit:MoveAndPatrol(p) + return true +end + +function ShardUnit:Build(t, p) + return true +end + + +function ShardUnit:Reclaim( thing ) + return true +end + +function ShardUnit:AreaReclaim( p, radius ) + return true +end + + +function ShardUnit:Ressurect( thing ) + return true +end + +function ShardUnit:AreaResurrect( p, radius ) + return true +end + +function ShardUnit:Attack( unit ) + return true +end + +function ShardUnit:AreaAttack(p,radius) + return true +end + +function ShardUnit:Repair( unit ) + return true +end + +function ShardUnit:AreaRepair( p, radius ) + return true +end + +function ShardUnit:RestoreTerrain( p, radius ) + return true +end + +function ShardUnit:Capture( unit ) + return true +end + +function ShardUnit:AreaCapture( p, radius ) + return true +end + +function ShardUnit:MorphInto( type ) + return true +end + +function ShardUnit:HoldFire() + return true +end + +function ShardUnit:ReturnFire() + return true +end + +function ShardUnit:FireAtWill() + return true +end + +function ShardUnit:HoldPosition() + return true +end + +function ShardUnit:Manoeuvre() + return true +end + +function ShardUnit:Roam() + return true +end + +function ShardUnit:GetPosition() + return nil +end + + +function ShardUnit:GetHealth() + return 1 +end + + +function ShardUnit:GetMaxHealth() + return 1 +end + +function ShardUnit:ParalysisDamage() + return 0 +end + +function ShardUnit:CaptureProgress() + return 0 +end + +function ShardUnit:BuildProgress() + return 0 +end + + +function ShardUnit:WeaponCount() + return 0 +end + + +function ShardUnit:MaxWeaponsRange() + return 0 +end + + +function ShardUnit:CanBuild( type ) + return false +end + + +function ShardUnit:GetResourceUsage( idx ) + return nil +end + + +function ShardUnit:ExecuteCustomCommand( cmdId, params_list, options, timeOut ) + return nil +end + +function ShardUnit:DrawHighlight( color, label, channel ) + return nil +end + +function ShardUnit:EraseHighlight( color, label, channel ) + return nil +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/shard_null/unittype.lua b/LuaRules/Gadgets/ai/preload/shard_null/unittype.lua new file mode 100644 index 000000000..973259a7b --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/shard_null/unittype.lua @@ -0,0 +1,8 @@ +ShardUnitType = class(function(a, id) + a.id = id + a.def = { id=id} +end) + +function ShardUnitType:ID() + return self.id +end diff --git a/LuaRules/Gadgets/ai/preload/spring_cpp/boot.lua b/LuaRules/Gadgets/ai/preload/spring_cpp/boot.lua new file mode 100644 index 000000000..777c0ac00 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_cpp/boot.lua @@ -0,0 +1,34 @@ +-- initial setup of things + +function shard_include( file ) + if type(file) ~= 'string' then + return nil + end + local gameName = game_engine:GameName() + local ok1 + local mod1 + if gameName == 'BAR' then + ok1, mod1 = pcall( require, "BA/"..file ) + else + ok1, mod1 = pcall( require, gameName.."/"..file ) + end + if ok1 then + return mod1 + else + local ok2, mod2 = pcall( require, file ) + if ok2 then + return mod2 + else + game_engine:SendToConsole("require can't load " .. game_engine:GameName().."/"..file .. " error: " .. mod1) + game_engine:SendToConsole("require can't load " .. file .. " error: " .. mod2) + end + end +end + +shard_include "hooks" +shard_include "class" +shard_include "aibase" +shard_include "module" + +shard_include "preload/spring_cpp/unit" +shard_include "preload/spring_cpp/unittype" \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_cpp/game.lua b/LuaRules/Gadgets/ai/preload/spring_cpp/game.lua new file mode 100644 index 000000000..7454160e7 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_cpp/game.lua @@ -0,0 +1,162 @@ +local game = {} + --game_engine + + -- prints 'message' to ingame chat console + function game:SendToConsole(...) + local str = "" + local parts = {...} + for i = 1, #parts do + local part = parts[i] + str = str .. tostring(part) + if i < #parts then str = str .. ", " end + end + return game_engine:SendToConsole(str) + end + + function game:Frame() -- returns int/game frame number + return game_engine:Frame() -- Shard AI API + end + + function game:Test() -- debug + return game_engine:Test() + end + + function game:IsPaused() -- if the game is paused, returns true + -- + return game_engine:IsPaused() + end + + function game:GetTypeByName(typename) -- returns unittype + -- + return game_engine:GetTypeByName(typename) + end + + + function game:ConfigFolderPath() -- returns string with path to the folder + -- + return game_engine:ConfigFolderPath() + end + + function game:ReadFile(filename) -- returns string with file contents + -- + return game_engine:ReadFile(filename) + end + + function game:FileExists(filename) -- returns boolean + -- + return game_engine:FileExists(filename) + end + + function game:GetTeamID() -- returns boolean + -- + return game_engine:GetTeamID() + end + + function game:GetEnemies() + local has_enemies = game_engine:HasEnemies() + if has_enemies ~= true then + return nil + else + local ev = game_engine:GetEnemies() + local e = {} + local i = 0 + while i < ev:size() do + table.insert(e,ev[i]) + i = i + 1 + end + ev = nil + return e + end + end + + function game:GetUnits() + local fv = game_engine:GetUnits() + local f = {} + local i = 0 + while i < fv:size() do + table.insert(f,fv[i]) + i = i + 1 + end + fv = nil + return f + end + + function game:GetFriendlies() + local has_friendlies = game_engine:HasFriendlies() + if has_friendlies ~= true then + return nil + else + local fv = game_engine:GetFriendlies() + local f = {} + local i = 0 + while i < fv:size() do + table.insert(f,fv[i]) + i = i + 1 + end + fv = nil + return f + end + end + + function game:GameName() -- returns the shortname of this game + -- + return game_engine:GameName() + end + + function game:AddMarker(position,label) -- adds a marker + -- + return game_engine:AddMarker(position,label) + end + + function game:SendToContent(stringvar) -- returns a string passed from any lua gadgets + -- + return game_engine:SendToContent(stringvar) + end + + function game:GetResource(idx) -- returns a Resource object + return game_engine:GetResource(idx) + end + + function game:GetResourceCount() -- return the number of resources + return game_engine:GetResourceCount() + end + + function game:GetResourceByName(name) -- returns a Resource object, takes the name of the resource + return game_engine:GetResourceByName(name) + end + + function game:GetUnitByID( unit_id ) -- returns a Shard unit when given an engine unit ID number + return game_engine:getUnitByID( unit_id ) + end + + function game:GetResources() -- returns a table of Resource objects, takes the name of the resource + local rcount = game_engine:GetResourceCount() + if(rcount > 0) then + + local resources = {} + + for i = 0,rcount do + local res = game:GetResource(i) + if res.name ~= "" then + resources[res.name] = res + end + end + return resources + else + return nil + end + end + + function game:UsesControlPoints() + return map:AreControlPoints() + end + + function game:ControlPointCaptureRadius() + return 500 + end + + function game:ControlPointNonCapturingUnits() + return {} + end + +return game \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_cpp/map.lua b/LuaRules/Gadgets/ai/preload/spring_cpp/map.lua new file mode 100644 index 000000000..9f37a92fd --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_cpp/map.lua @@ -0,0 +1,240 @@ +local map = {} + + -- function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) + -- function map:CanBuildHere(unittype,position) + -- function map:GetMapFeatures() + -- function map:GetMapFeaturesAt(position,radius) + -- function map:SpotCount() + -- function map:GetSpot(idx) + -- function map:GetMetalSpots() + -- function map:MapDimensions() + -- function map:MapName() + -- function map:AverageWind() + -- function map:MinimumWindSpeed() + -- function map:MaximumWindSpeed() + -- function map:TidalStrength() + -- function map:MaximumHeight() + -- function map:MinimumHeight() + +-- ################### + +function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) -- returns Position + -- + return game_engine:Map():FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) +end + +function map:CanBuildHere(unittype,position) -- returns boolean + -- + return game_engine:Map():CanBuildHere(unittype,position) +end + +function map:GetMapFeatures() + local fv = game_engine:Map():GetMapFeatures() + local f = {} + local i = 0 + while i < fv:size() do + table.insert(f,fv[i]) + i = i + 1 + end + fv = nil + return f +end + +function map:GetMapFeaturesAt(position,radius) + local m = game_engine:Map() + local fv = m:GetMapFeaturesAt(position,radius) + local f = {} + local i = 0 + while i < fv:size() do + table.insert(f,fv[i]) + i = i + 1 + end + fv = nil + return f +end + +function map:SpotCount() -- returns the nubmer of metal spots + local m = game_engine:Map() + return m:SpotCount() +end + +function map:GetSpot(idx) -- returns a Position for the given spot + local m = game_engine:Map() + return m:GetSpot(idx) +end + +function map:GetMetalSpots() -- returns a table of spot positions + -- + local m = game_engine:Map() + local fv = game_engine:Map():GetMetalSpots() + local count = m:SpotCount() + local f = {} + local i = 0 + while i < count do + table.insert( f, m:GetSpot(i) ) + i = i + 1 + end + --fv = nil + return f +end + +function map:GeoCount() -- returns the nubmer of metal spots + local m = game_engine:Map() + return m:GeoCount() +end + +function map:GetGeo(idx) -- returns a Position for the given spot + local m = game_engine:Map() + return m:GetGeo(idx) +end + +function map:GetMetalSpots() -- returns a table of spot positions + -- + local m = game_engine:Map() + local fv = game_engine:Map():GetGeoSpots() + local count = m:GeoCount() + local f = {} + local i = 0 + while i < count do + table.insert( f, m:GetGeo(i) ) + i = i + 1 + end + --fv = nil + return f +end + +function map:GetControlPoints() + -- not sure this can be implemented in the Spring C++ AI interface + return {} +end + +function map:AreControlPoints() + -- not sure this can be implemented in the Spring C++ AI interface + return false +end + +function map:MapDimensions() -- returns a Position holding the dimensions of the map + local m = game_engine:Map() + return m:MapDimensions() +end + +function map:MapName() -- returns the name of this map + local m = game_engine:Map() + return m:MapName() +end + +function map:AverageWind() -- returns (minwind+maxwind)/2 + local m = game_engine:Map() + return m:AverageWind() +end + + +function map:MinimumWindSpeed() -- returns minimum windspeed + local m = game_engine:Map() + return m:MinimumWindSpeed() +end + +function map:MaximumWindSpeed() -- returns maximum wind speed + local m = game_engine:Map() + return m:MaximumWindSpeed() +end + +function map:MaximumHeight() -- returns maximum map height + local m = game_engine:Map() + return m:MaximumHeight() +end + +function map:MinimumHeight() -- returns minimum map height + local m = game_engine:Map() + return m:MinimumHeight() +end + +function map:TidalStrength() -- returns tidal strength + local m = game_engine:Map() + return m:TidalStrength() +end + +-- DRAWING FUNCTIONS + +local function dataToString(...) + local data = {...} + local str = '' + for i = 1, #data do + local d = data[i] + str = str .. '|' .. tostring(d) + end + return str +end + +local function SendToUnsynced(command, ...) + -- game_engine:SendToContent(command .. dataToString(...)) + local buff = io.open('sharddrawbuffer', 'a') + if buff then + buff:write(command .. dataToString(...) .. "\n") + buff:close() + end +end + +function map:DrawRectangle(pos1, pos2, color, label, filled, channel) + channel = channel or 1 + color = color or {} + -- game:SendToContent('ShardDrawAddRectangle' .. dataToString(pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel)) + SendToUnsynced('ShardDrawAddRectangle', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:EraseRectangle(pos1, pos2, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseRectangle', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:DrawCircle(pos, radius, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddCircle', pos.x, pos.z, radius, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:EraseCircle(pos, radius, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseCircle', pos.x, pos.z, radius, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:DrawLine(pos1, pos2, color, label, arrow, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddLine', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, arrow, self.ai.game:GetTeamID(), channel) +end + +function map:EraseLine(pos1, pos2, color, label, arrow, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseLine', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, arrow, self.ai.game:GetTeamID(), channel) +end + +function map:DrawPoint(pos, color, label, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddPoint', pos.x, pos.z, color[1], color[2], color[3], color[4], label, self.ai.game:GetTeamID(), channel) +end + +function map:ErasePoint(pos, color, label, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawErasePoint', pos.x, pos.z, color[1], color[2], color[3], color[4], label, self.ai.game:GetTeamID(), channel) +end + +function map:EraseAll(channel) + channel = channel or 1 + SendToUnsynced('ShardDrawClearShapes', self.ai.game:GetTeamID(), channel) +end + +function map:DisplayDrawings(onOff) + SendToUnsynced('ShardDrawDisplay', onOff) +end + +-- END DRAWING FUNCTIONS + + -- game.map = map + +return map \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_cpp/unit.lua b/LuaRules/Gadgets/ai/preload/spring_cpp/unit.lua new file mode 100644 index 000000000..935075459 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_cpp/unit.lua @@ -0,0 +1,3 @@ +function shardify_unit( unit ) + return unit +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_cpp/unittype.lua b/LuaRules/Gadgets/ai/preload/spring_cpp/unittype.lua new file mode 100644 index 000000000..6307c474b --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_cpp/unittype.lua @@ -0,0 +1,3 @@ +function shardify_unittype( unittype ) + return unittype +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/.directory b/LuaRules/Gadgets/ai/preload/spring_lua/.directory new file mode 100644 index 000000000..d692d9f1f --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/.directory @@ -0,0 +1,6 @@ +[Dolphin] +Timestamp=2017,5,10,23,26,28 +Version=3 + +[Settings] +HiddenFilesShown=true diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/boot.lua b/LuaRules/Gadgets/ai/preload/spring_lua/boot.lua new file mode 100644 index 000000000..1b14cc033 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/boot.lua @@ -0,0 +1,39 @@ +-- initial setup of things + +function shard_include( file ) + if type(file) ~= 'string' then + return nil + end + subdir = Game.gameShortName + if Game.gameShortName == "BAR" then + -- AI for BA / BAR is (atm) the same + subdir = "BA" + end + + local gameFile = "luarules/gadgets/ai/" .. subdir .. "/" .. file .. ".lua" + local baseFile = "luarules/gadgets/ai/" .. file .. ".lua" + local preloadFile = "luarules/gadgets/ai/preload/" .. file .. ".lua" + if VFS.FileExists(gameFile) then + -- Spring.Echo("got gameFile", gameFile) + return VFS.Include(gameFile) + elseif VFS.FileExists(baseFile) then + -- Spring.Echo("got baseFile", baseFile) + return VFS.Include(baseFile) + elseif VFS.FileExists(preloadFile) then + -- Spring.Echo("got preloadFile", preloadFile) + return VFS.Include(preloadFile) + end +end + +shard_include "preload/spring_lua/shard" +os = shard_include "preload/spring_lua/fakeos" +api = shard_include "preload/spring_lua/fakeapi" +shard_include "preload/hooks" +shard_include "preload/class" +shard_include "preload/aibase" +shard_include "preload/module" +shard_include "preload/spring_lua/unit" +shard_include "preload/spring_lua/unittype" +shard_include "preload/spring_lua/damage" +shard_include "preload/spring_lua/feature" +shard_include "preload/spring_lua/controlpoint" diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/controlpoint.lua b/LuaRules/Gadgets/ai/preload/spring_lua/controlpoint.lua new file mode 100644 index 000000000..28a62d427 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/controlpoint.lua @@ -0,0 +1,29 @@ + +ShardSpringControlPoint = class(function(a) + -- +end) + + +function ShardSpringControlPoint:Init( rawPoint, id ) + self.rawPoint = rawPoint + self.position = {x=rawPoint.x, y=rawPoint.y, z=rawPoint.z} + self.id = id +end + +function ShardSpringControlPoint:ID() + return self.id +end + +function ShardSpringControlPoint:GetPosition() + return self.position +end + +function ShardSpringControlPoint:GetOwner() + return self.rawPoint.owner + -- local rawPoints = {} + -- if Script.LuaRules('ControlPoints') then + -- rawPoints = Script.LuaRules.ControlPoints() or {} + -- end + -- local rawPoint = rawPoints[self.id] + -- return rawPoint.owner +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/damage.lua b/LuaRules/Gadgets/ai/preload/spring_lua/damage.lua new file mode 100644 index 000000000..6d6aca004 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/damage.lua @@ -0,0 +1,46 @@ +ShardSpringDamage = class(function(a) + -- +end) + +local spGetGameFrame = Spring.GetGameFrame +local spGetProjectileDirection = Spring.GetProjectileDirection + +function ShardSpringDamage:Init( damage, weaponDefID, paralyzer, projectileID, engineAttacker ) + self.damage = damage + self.weaponDefID = weaponDefID + self.paralyzer = paralyzer + self.projectileID = projectileID + self.attacker = engineAttacker + self.gameframe = spGetGameFrame() + if projectileID then + local dx, dy, dz = spGetProjectileDirection(projectileID) + self.direction = {x=dx, y=dy, z=dz} + end + self.damageType = weaponDefID + if weaponDefID then + local weaponDef = WeaponDefs[weaponDefID] + if weaponDef then + self.weaponType = weaponDef.name + end + end +end + +function ShardSpringDamage:Damage() + return self.damage +end + +function ShardSpringDamage:Attacker() + return self.attacker +end + +function ShardSpringDamage:Direction() + return self.direction +end + +function ShardSpringDamage:DamageType() + return self.damageType +end + +function ShardSpringDamage:WeaponType() + return self.weaponType +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/fakeapi.lua b/LuaRules/Gadgets/ai/preload/spring_lua/fakeapi.lua new file mode 100644 index 000000000..4007ee91b --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/fakeapi.lua @@ -0,0 +1,15 @@ +local api = {} + +function api.Position() + return { x=0, y=0, z=0 } +end + +function api.vectorFloat() + local floats = { values = {} } + function floats:push_back(value) + self.values[#self.values+1] = value + end + return floats +end + +return api \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/fakeos.lua b/LuaRules/Gadgets/ai/preload/spring_lua/fakeos.lua new file mode 100644 index 000000000..efbdddf2c --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/fakeos.lua @@ -0,0 +1,10 @@ +-- because often os.time is used to seed randomseed + +local fakeos = {} + +function fakeos.time() + if not Shard then return 1 end + return Shard.randomseed or 1 +end + +return fakeos \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/feature.lua b/LuaRules/Gadgets/ai/preload/spring_lua/feature.lua new file mode 100644 index 000000000..5fe2331f4 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/feature.lua @@ -0,0 +1,25 @@ + +ShardSpringFeature = class(function(a) + -- +end) + + +function ShardSpringFeature:Init( id ) + self.id = id + self.defID = Spring.GetFeatureDefID(id) + self.def = FeatureDefs[self.defID] + self.name = self.def.name +end + +function ShardSpringFeature:ID() + return self.id +end + +function ShardSpringFeature:Name() + return self.name +end + +function ShardSpringFeature:GetPosition() + local x, y, z = Spring.GetFeaturePosition(self.id) + return {x=x, y=y, z=z} +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/game.lua b/LuaRules/Gadgets/ai/preload/spring_lua/game.lua new file mode 100644 index 000000000..f097d302f --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/game.lua @@ -0,0 +1,153 @@ +local game = {} + --game_engine + + -- prints 'message' to ingame chat console + function game:SendToConsole(...) + Spring.Echo( ... ) + return true + end + + function game:Frame() -- returns int/game frame number + return Spring.GetGameFrame() -- Spring Gadget API + end + + function game:Test() -- debug + Spring.Echo( "Testing API" ) + return true + end + + function game:IsPaused() -- if the game is paused, returns true + local _, _, paused = Spring.GetGameSpeed() + return paused + end + + function game:GetTypeByName(typename) -- returns unittype + if not UnitDefNames[typename] then + Spring.Echo( 'shard: debug: could not find "'..typename..'" in UnitDefNames' ) + return nil + end + local def = UnitDefNames[typename] + return Shard:shardify_unittype(def.id) + end + + + function game:ConfigFolderPath() -- returns string with path to the folder + return "luarules/gadgets/ai/" .. self:GameName() .. "/" + -- return game_engine:ConfigFolderPath() + end + + function game:ReadFile(filename) -- returns string with file contents + return VFS.LoadFile( filename ) + end + + function game:FileExists(filename) -- returns boolean + return VFS.FileExists( filename ) + end + + function game:GetTeamID() + return self.ai.id + -- return Spring.GetMyTeamID() + end + + function game:GetEnemies() + local ev = self.ai.enemyUnitIds + if not ev then return {} end + local e = {} + for uID, _ in pairs(ev) do + e[#e+1] = Shard:shardify_unit(uID) + end + return e + end + + function game:GetUnits() + local uv = self.ai.ownUnitIds + if not uv then return {} end + local u = {} + for uID, _ in pairs(uv) do + u[#u+1] = Shard:shardify_unit(uID) + end + return u + end + + function game:GetFriendlies() + local fv = self.ai.friendlyUnitIds + if not fv then return {} end + local f = {} + for uID, _ in pairs(fv) do + f[#f+1] = Shard:shardify_unit(uID) + end + return f + end + + function game:GameName() -- returns the shortname of this game + return Game.gameShortName + end + + function game:AddMarker(position,label) -- adds a marker + Spring.MarkerAddPoint( position.x, position.y, position.z, label ) + return true + end + + function game:SendToContent(stringvar) -- returns a string passed from any lua gadgets + -- doesn't make a lot of sense if we're already in the lua environment, needs discussin + return false --game_engine:SendToContent(stringvar) + end + + function game:GetResource(idx) -- returns a Resource object + local currentLevel, storage, pull, income, expense, share, sent, received = Spring.GetTeamResources(self.ai.id, Shard.resourceIds[idx]) + return Shard:shardify_resource({currentLevel=currentLevel, storage=storage, pull=pull, income=income, expense=expense, share=share, sent=sent, received=received}) + end + + function game:GetResourceCount() -- return the number of resources + return 2 --game_engine:GetResourceCount() + end + + function game:GetResourceByName(name) -- returns a Resource object, takes the name of the resource + name = string.lower(name) + local currentLevel, storage, pull, income, expense, share, sent, received = Spring.GetTeamResources(self.ai.id, name) + return Shard:shardify_resource({currentLevel=currentLevel, storage=storage, pull=pull, income=income, expense=expense, share=share, sent=sent, received=received}) + end + + function game:GetUnitByID( unit_id ) -- returns a Shard unit when given an engine unit ID number + return Shard:shardify_unit( unit_id ) + end + + function game:GetResources() -- returns a table of Resource objects, takes the name of the resource + return { self:GetResource(1), self:GetResource(2) } + + --[[local rcount = game_engine:GetResourceCount() + if(rcount > 0) then + + local resources = {} + + for i = 0,rcount do + local res = game:GetResource(i) + if res.name ~= "" then + resources[res.name] = res + end + end + return resources + else + return nil + end]]-- + end + + function game:UsesControlPoints() + return self.ai.map:AreControlPoints() + end + + function game:ControlPointCaptureRadius() + if Script.LuaRules('CaptureRadius') then + return Script.LuaRules.CaptureRadius() or 500 + end + return 500 + end + + function game:ControlPointNonCapturingUnits() + if Script.LuaRules('NonCapturingUnits') then + return Script.LuaRules.NonCapturingUnits() or {} + end + return {} + end + +return game \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/geo.lua b/LuaRules/Gadgets/ai/preload/spring_lua/geo.lua new file mode 100644 index 000000000..89910e9a9 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/geo.lua @@ -0,0 +1,18 @@ +local function GetGeos() + local geos = {} + local i = 1 + for ct, featureID in pairs(Spring.GetAllFeatures()) do + local featureDefID = Spring.GetFeatureDefID(featureID) + if FeatureDefs[featureDefID].geoThermal == true then + local x, y, z = Spring.GetFeaturePosition(featureID) + local spot = {x = x, z = z, y = Spring.GetGroundHeight(x,z)} + geos[i] = spot + i = i + 1 + end + end + return geos +end + +local spots = GetGeos() + +return spots diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/map.lua b/LuaRules/Gadgets/ai/preload/spring_lua/map.lua new file mode 100644 index 000000000..0bea72ed4 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/map.lua @@ -0,0 +1,245 @@ +local map = {} +map.spots = shard_include("spring_lua/metal") +map.geos = shard_include("spring_lua/geo") + -- function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) + -- function map:CanBuildHere(unittype,position) + -- function map:GetMapFeatures() + -- function map:GetMapFeaturesAt(position,radius) + -- function map:SpotCount() + -- function map:GetSpot(idx) + -- function map:GetMetalSpots() + -- function map:MapDimensions() + -- function map:MapName() + -- function map:AverageWind() + -- function map:MinimumWindSpeed() + -- function map:MaximumWindSpeed() + -- function map:TidalStrength() + -- function map:MaximumHeight() + -- function map:MinimumHeight() + +-- ################### + +function map:FindClosestBuildSite(unittype, builderpos, searchradius, minimumdistance, validFunction) -- returns Position + -- validFunction takes a position and returns a position or nil if the position is not valid + validFunction = validFunction or function (position) return position end + searchradius = searchradius or 500 + minimumdistance = minimumdistance or 50 + local twicePi = math.pi * 2 + local angleIncMult = twicePi / minimumdistance + local bx, bz = builderpos.x, builderpos.z + local maxX, maxZ = Game.mapSizeX, Game.mapSizeZ + for radius = 50, searchradius, minimumdistance do + local angleInc = radius * twicePi * angleIncMult + local initAngle = math.random() * twicePi + for angle = initAngle, initAngle+twicePi, angleInc do + local realAngle = angle+0 + if realAngle > twicePi then realAngle = realAngle - twicePi end + local dx, dz = radius*math.cos(angle), radius*math.sin(angle) + local x, z = bx+dx, bz+dz + if x < 0 then x = 0 elseif x > maxX then x = maxX end + if z < 0 then z = 0 elseif z > maxZ then z = maxZ end + local y = Spring.GetGroundHeight(x,z) + local buildable, position = self:CanBuildHere(unittype, {x=x, y=y, z=z}) + if buildable then + position = validFunction(position) + if position then return position end + end + end + end + local lastDitch, lastDitchPos = self:CanBuildHere(unittype, builderpos) + if lastDitch then + lastDitchPos = validFunction(lastDitchPos) + if lastDitchPos then return lastDitchPos end + end +end + +function map:CanBuildHere(unittype,position) -- returns boolean + local newX, newY, newZ = Spring.Pos2BuildPos(unittype:ID(), position.x, position.y, position.z) + local blocked = Spring.TestBuildOrder(unittype:ID(), newX, newY, newZ, 1) == 0 + -- Spring.Echo(unittype:Name(), newX, newY, newZ, blocked) + return ( not blocked ), {x=newX, y=newY, z=newZ} +end + +function map:GetMapFeatures() + local fv = Spring.GetAllFeatures() + if not fv then return {} end + local f = {} + for _, fID in pairs(fv) do + f[#f+1] = Shard:shardify_feature(fID) + end + return f +end + +function map:GetMapFeaturesAt(position,radius) + local fv = Spring.GetFeaturesInSphere(position.x, position.y, position.z, radius) + if not fv then return {} end + local f = {} + for _, fID in pairs(fv) do + f[#f+1] = Shard:shardify_feature(fID) + end + return f +end + +function map:SpotCount() -- returns the nubmer of metal spots + return #self.spots +end + +function map:GetSpot(idx) -- returns a Position for the given spot + return self.spots[idx] +end + +function map:GetMetalSpots() -- returns a table of spot positions + local fv = self.spots + local count = self:SpotCount() + local f = {} + local i = 0 + while i < count do + table.insert( f, fv[i] ) + i = i + 1 + end + return f +end + +function map:GeoCount() -- returns the nubmer of metal spots + return #self.geos +end + +function map:GetGeo(idx) + return self.geos[idx] +end + +function map:GetGeoSpots() -- returns a table of spot positions + local fv = self.geos + local count = self:GeoCount() + local f = {} + local i = 0 + while i < count do + table.insert( f, fv[i] ) + i = i + 1 + end + return f +end + +function map:GetControlPoints() + if self.controlPoints then return self.controlPoints end + self.controlPoints = {} + if Script.LuaRules('ControlPoints') then + local rawPoints = Script.LuaRules.ControlPoints() or {} + for id = 1, #rawPoints do + local rawPoint = rawPoints[id] + local cp = ShardSpringControlPoint() + cp:Init(rawPoint, id) + self.controlPoints[id] = cp + end + end + return self.controlPoints +end + +function map:AreControlPoints() + local points = self:GetControlPoints() + return #points > 0 +end + +function map:MapDimensions() -- returns a Position holding the dimensions of the map + return { + x = Game.mapSizeX / 8, + z = Game.mapSizeZ / 8, + y = 0 + } +end + +function map:MapName() -- returns the name of this map + return Game.mapName +end + +function map:AverageWind() -- returns (minwind+maxwind)/2 + return ( Game.windMin + (Game.windMax - Game.windMin)/2 ) +end + + +function map:MinimumWindSpeed() -- returns minimum windspeed + return Game.windMin +end + +function map:MaximumWindSpeed() -- returns maximum wind speed + return Game.windMax +end + +function map:MaximumHeight() -- returns maximum map height + local minHeight, maxHeight = Spring.GetGroundExtremes() + return maxHeight +end + +function map:MinimumHeight() -- returns minimum map height + local minHeight, maxHeight = Spring.GetGroundExtremes() + return minHeight +end + + +function map:TidalStrength() -- returns tidal strength + return Game.tidal +end + +-- DRAWING FUNCTIONS + +function map:DrawRectangle(pos1, pos2, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddRectangle', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:EraseRectangle(pos1, pos2, color, label, filled, channel) + channel = channel or 1 + color = color or {} + return SendToUnsynced('ShardDrawEraseRectangle', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:DrawCircle(pos, radius, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddCircle', pos.x, pos.z, radius, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:EraseCircle(pos, radius, color, label, filled, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseCircle', pos.x, pos.z, radius, color[1], color[2], color[3], color[4], label, filled, self.ai.game:GetTeamID(), channel) +end + +function map:DrawLine(pos1, pos2, color, label, arrow, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddLine', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, arrow, self.ai.game:GetTeamID(), channel) +end + +function map:EraseLine(pos1, pos2, color, label, arrow, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseLine', pos1.x, pos1.z, pos2.x, pos2.z, color[1], color[2], color[3], color[4], label, arrow, self.ai.game:GetTeamID(), channel) +end + +function map:DrawPoint(pos, color, label, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddPoint', pos.x, pos.z, color[1], color[2], color[3], color[4], label, self.ai.game:GetTeamID(), channel) +end + +function map:ErasePoint(pos, color, label, channel) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawErasePoint', pos.x, pos.z, color[1], color[2], color[3], color[4], label, self.ai.game:GetTeamID(), channel) +end + +function map:EraseAll(channel) + channel = channel or 1 + SendToUnsynced('ShardDrawClearShapes', self.ai.game:GetTeamID(), channel) +end + +function map:DisplayDrawings(onOff) + SendToUnsynced('ShardDrawDisplay', onOff) +end + +-- END DRAWING FUNCTIONS + + -- game.map = map +return map \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/metal.lua b/LuaRules/Gadgets/ai/preload/spring_lua/metal.lua new file mode 100644 index 000000000..f64fc745d --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/metal.lua @@ -0,0 +1,7 @@ +local function GetSpots() + return GG.metalSpots +end + +local spots = GetSpots() + +return spots \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/shard.lua b/LuaRules/Gadgets/ai/preload/spring_lua/shard.lua new file mode 100644 index 000000000..40985b988 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/shard.lua @@ -0,0 +1,69 @@ +local Shard = {} + +Shard.resourceIds = { "metal", "energy" } +Shard.resourceKeyAliases = { + currentLevel = "reserves", + storage = "capacity", + expense = "usage", +} +Shard.unitsByID = {} +Shard.unittypesByID = {} +Shard.featuresByID = {} + +function Shard:shardify_resource(luaResource) + local shardResource = {} + for key, value in pairs(luaResource) do + local newKey = self.resourceKeyAliases[key] or key + shardResource[newKey] = value + end + return shardResource +end + +function Shard:shardify_unit( unitID ) + if not unitID then return end + if not self.unitsByID[unitID] then + local unit = ShardUnit( unitID ) + self.unitsByID[unitID] = unit + end + return self.unitsByID[unitID] +end + +function Shard:unshardify_unit( unitID ) + if not unitID then return end + self.unitsByID[unitID] = nil +end + +function Shard:shardify_unittype( unitDefID ) + if not unitDefID then + Spring.Echo( 'shard: error: shardify_unittype recieved "'..unitDefID..'" of type "'.. type(unitDefID).. '" ' ) + return nil + end + if not self.unittypesByID[unitDefID] then + local unittype = ShardUnitType(unitDefID) + self.unittypesByID[unitDefID] = unittype + end + return self.unittypesByID[unitDefID] +end + +function Shard:shardify_damage( damage, weaponDefID, paralyzer, projectileID, engineAttacker ) + local sharddamage = ShardSpringDamage() + sharddamage:Init(damage, weaponDefID, paralyzer, projectileID, engineAttacker) + return sharddamage +end + +function Shard:shardify_feature( featureID ) + if not featureID then return end + if not self.featuresByID[featureID] then + local shardfeature = ShardSpringFeature() + shardfeature:Init(featureID) + self.featuresByID[featureID] = shardfeature + end + return self.featuresByID[featureID] +end + +function Shard:unshardify_feature( featureID ) + if not featureID then return end + self.featuresByID[featureID] = nil +end + +return Shard \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/unit.lua b/LuaRules/Gadgets/ai/preload/spring_lua/unit.lua new file mode 100644 index 000000000..862a64f97 --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/unit.lua @@ -0,0 +1,484 @@ + +ShardUnit = class(function(a, id) + a.id = id + a.className = "unit" + local udefid = Spring.GetUnitDefID(id) + a.type = ShardUnitType(udefid) +end) + +function ShardUnit:Unit_to_id( unit ) + local gid = unit + if type( unit ) == 'table' then + if unit['id'] ~= nil then + gid = unit.id + else + -- error! + return false + end + end + return gid +end + +function ShardUnit:ID() + return self.id +end + +function ShardUnit:Team() + return Spring.GetUnitTeam(self.id) +end + +function ShardUnit:Radius() + return Spring.GetUnitRadius(self.id) +end + +function ShardUnit:AllyTeam() + return Spring.GetUnitAllyTeam(self.id) +end + +function ShardUnit:Neutral() + return Spring.GetUnitNeutral(self.id) +end + +function ShardUnit:Stunned() + local stunned_or_inbuild, stunned, inbuild = Spring.GetUnitIsStunned(self.id) + return stunned +end + +function ShardUnit:Name() + return self.type:Name() +end + + +function ShardUnit:IsAlive() + return not Spring.GetUnitIsDead(self.id) +end + + +function ShardUnit:IsCloaked() + return self:Cloaked() +end + +function ShardUnit:Cloaked() + return Spring.GetUnitIsCloaked(self.id) +end + + +function ShardUnit:CurrentStockpile() + local numStockpiled, numStockpileQued, buildPercent = Spring.GetUnitStockpile(self.id) + return numStockpiled +end + + +function ShardUnit:Type() + return self.type +end + + +function ShardUnit:CanMove() + return self:Type():CanMove() +end + + +function ShardUnit:CanDeploy() + return self:Type():CanDeploy() +end + +function ShardUnit:CanMorph() + return self:Type():CanMorph() +end + +function ShardUnit:IsBeingBuilt() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return buildProgress < 1 +end + +function ShardUnit:IsMorphing() + return false +end + + +function ShardUnit:CanAssistBuilding( unit )-- IUnit* unit) -- the unit that is under construction to help with + return true -- not sure when this would not be true in Spring + -- return false +end + + +function ShardUnit:CanMoveWhenDeployed() + -- what does deployed mean in the case of Spring? + return false +end + + +function ShardUnit:CanFireWhenDeployed() + return false +end + +function ShardUnit:CanMorphWhenDeployed() + return false +end + +function ShardUnit:CanBuildWhenDeployed() + return false +end + + +function ShardUnit:CanBuildWhenNotDeployed() + return false +end + +function ShardUnit:Stop() + Spring.GiveOrderToUnit( self.id, CMD.STOP, {}, {} ) + return true +end + +function ShardUnit:Stockpile() + Spring.GiveOrderToUnit( self.id, CMD.STOCKPILE, {}, {} ) + return true +end + +function ShardUnit:SelfDestruct() + Spring.GiveOrderToUnit( self.id, CMD.SELFD, {}, {} ) + return true +end + +function ShardUnit:Cloak() + Spring.GiveOrderToUnit( self.id, CMD.CLOAK, { 1 }, {} ) + return true +end + +function ShardUnit:UnCloak() + Spring.GiveOrderToUnit( self.id, CMD.CLOAK, { 0 }, {} ) + return true +end + +function ShardUnit:TurnOn() + Spring.GiveOrderToUnit( self.id, CMD.ONOFF, { 1 }, {} ) + return true +end + +function ShardUnit:TurnOff() + Spring.GiveOrderToUnit( self.id, CMD.ONOFF, { 0 }, {} ) + return true +end + +function ShardUnit:Guard( unit ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.GUARD, { gid }, {} ) + return true +end + +function ShardUnit:Repair( unit ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.REPAIR, { gid }, {} ) + return true +end + +function ShardUnit:DGun(p) + return self:AltAttack( p ) +end + +function ShardUnit:ManualFire(p) + Spring.GiveOrderToUnit( self.id, CMD.DGUN, { p.x, p.y, p.z }, {} ) + return true +end + +function ShardUnit:Move(p) + Spring.GiveOrderToUnit( self.id, CMD.MOVE, { p.x, p.y, p.z }, {} ) + return true +end + +function ShardUnit:AttackMove(p) + return self:MoveAndFire(p) +end + +function ShardUnit:MoveAndFire(p) + Spring.GiveOrderToUnit( self.id, CMD.FIGHT, { p.x, p.y, p.z }, {} ) + return true +end + +function ShardUnit:Patrol(p) + return self:MoveAndPatrol(p) +end + +function ShardUnit:MoveAndPatrol(p) + Spring.GiveOrderToUnit( self.id, CMD.PATROL, { p.x, p.y, p.z }, {} ) + return true +end + +function ShardUnit:Build(t, p, f, opts) -- IUnitType* + if type(t) == "string" then + -- local ai = Shard.AIs[1] + -- t = ai.game:GetTypeByName(t) + t = game:GetTypeByName(t) + end + opts = opts or {} + f = f or 0 + if not p then p = self:GetPosition() end + Spring.GiveOrderToUnit( self.id, -t:ID(), { p.x, p.y, p.z, f}, opts ) + return true +end + + +function ShardUnit:Reclaim( thing )--IMapFeature* mapFeature) + if not thing then return end + local gid = self:Unit_to_id( unit ) + if thing.className == "feature" then + Spring.GiveOrderToUnit( self.id, CMD.RECLAIM, { gid + Game.maxUnits }, {} ) + elseif thing.className == "unit" then + Spring.GiveOrderToUnit( self.id, CMD.RECLAIM, { gid }, {} ) + end + return true +end + +function ShardUnit:AreaReclaim( p, radius )--Position p, double radius) + Spring.GiveOrderToUnit( self.id, CMD.RECLAIM, { p.x, p.y, p.z, radius }, {} ) + return true +end + + +function ShardUnit:Ressurect( thing )--IMapFeature* mapFeature) + if not thing then return end + local gid = self:Unit_to_id( unit ) + if thing.className == "feature" then + Spring.GiveOrderToUnit( self.id, CMD.RESURRECT, { gid + Game.maxUnits }, {} ) + elseif thing.className == "unit" then + Spring.GiveOrderToUnit( self.id, CMD.RESURRECT, { gid }, {} ) + end + return true +end + +function ShardUnit:AreaRESURRECT( p, radius )--Position p, double radius) + Spring.GiveOrderToUnit( self.id, CMD.RESURRECT, { p.x, p.y, p.z, radius }, {} ) + return true +end + +function ShardUnit:Attack( unit ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.ATTACK, { gid }, {} ) + return true +end + +function ShardUnit:AreaAttack(p,radius) + Spring.GiveOrderToUnit( self.id, CMD.AREA_ATTACK, { p.x, p.y, p.z, radius }, {} ) + return true +end + +function ShardUnit:Repair( unit ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.REPAIR, { gid }, {} ) + return true +end + +function ShardUnit:AreaRepair( p, radius ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.REPAIR, { p.x, p.y, p.z, radius }, {} ) + return true +end + +function ShardUnit:RestoreTerrain( p, radius ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.RESTORE, { p.x, p.y, p.z, radius }, {} ) + return true +end + +function ShardUnit:Capture( unit ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.CAPTURE, { gid }, {} ) + return true +end + +function ShardUnit:AreaCapture( p, radius ) + local gid = self:Unit_to_id( unit ) + Spring.GiveOrderToUnit( self.id, CMD.CAPTURE, { p.x, p.y, p.z, radius }, {} ) + return true +end + +function ShardUnit:MorphInto( type ) + Spring.GiveOrderToUnit( self.id, CMD.MORPH, { self.id }, {} ) + return true +end + +function ShardUnit:EZMorph() + Spring.GiveOrderToUnit( self.id, 31337, {}, {} ) + return true +end + +function ShardUnit:HoldFire() + Spring.GiveOrderToUnit( self.id, CMD.FIRE_STATE, { 0 }, {} ) + return true +end + +function ShardUnit:ReturnFire() + Spring.GiveOrderToUnit( self.id, CMD.FIRE_STATE, { 1 }, {} ) + return true +end + +function ShardUnit:FireAtWill() + Spring.GiveOrderToUnit( self.id, CMD.FIRE_STATE, { 2 }, {} ) + return true +end + +function ShardUnit:HoldPosition() + Spring.GiveOrderToUnit( self.id, CMD.MOVE_STATE, { 0 }, {} ) + return true +end + +function ShardUnit:Manoeuvre() + Spring.GiveOrderToUnit( self.id, CMD.MOVE_STATE, { 1 }, {} ) + return true +end + +function ShardUnit:Roam() + Spring.GiveOrderToUnit( self.id, CMD.MOVE_STATE, { 2 }, {} ) + return true +end + +function ShardUnit:GetPosition() + local bpx, bpy, bpz = Spring.GetUnitPosition(self.id) + if not bpx then + Spring.Echo(self:Name(), self.id, "nil position") + return + end + return { + x=bpx, + y=bpy, + z=bpz, + } +end + + +function ShardUnit:GetHealth() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return health +end + + +function ShardUnit:GetMaxHealth() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return maxHealth +end + +function ShardUnit:ParalysisDamage() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return paralyzeDamage +end + +function ShardUnit:CaptureProgress() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return captureProgress +end + +function ShardUnit:BuildProgress() + local health, maxHealth, paralyzeDamage, captureProgress, buildProgress = Spring.GetUnitHealth( self.id ) + return buildProgress +end + + +function ShardUnit:WeaponCount() + return self:Type():WeaponCount() +end + + +function ShardUnit:MaxWeaponsRange() + return Spring.GetUnitMaxRange(self.id) +end + + +function ShardUnit:CanBuild( type ) + return self:Type():CanBuild(type) +end + + +function ShardUnit:GetResourceUsage( idx ) + local metalMake, metalUse, energyMake, energyUse = Spring.GetUnitResources(self.id) + local SResourceTransfer = { gameframe = Spring.GameFrame(), rate = 1 } + if Shard.resourceIds[idx] == "metal" then + SResourceTransfer.generation = metalMake + SResourceTransfer.consumption = metalUse + elseif Shard.resourceIds[idx] == "energy" then + SResourceTransfer.generation = energyMake + SResourceTransfer.consumption = energyUse + end + return SResourceTransfer +end + + +function ShardUnit:ExecuteCustomCommand( cmdId, params_list, options, timeOut ) + params_list = params_list or {} + options = options or {} + if params_list and params_list.push_back then + -- handle fake vectorFloat object + params_list = params_list.values + end + Spring.GiveOrderToUnit(self.id, cmdId, params_list, options) + return 0 +end + +function ShardUnit:DrawHighlight( color, label, channel ) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawAddUnit', self.id, color[1], color[2], color[3], color[4], label, ai.game:GetTeamID(), channel) +end + +function ShardUnit:EraseHighlight( color, label, channel ) + channel = channel or 1 + color = color or {} + SendToUnsynced('ShardDrawEraseUnit', self.id, color[1], color[2], color[3], color[4], label, ai.game:GetTeamID(), channel) +end + +--[[ +IUnit/ engine unit objects + int ID() + int Team() + std::string Name() + + bool IsAlive() + + bool IsCloaked() + + void Forget() // makes the interface forget about this unit and cleanup + bool Forgotten() // for interface/debugging use + + IUnitType* Type() + + bool CanMove() + bool CanDeploy() + bool CanBuild() + bool IsBeingBuilt() + + bool CanAssistBuilding(IUnit* unit) + + bool CanMoveWhenDeployed() + bool CanFireWhenDeployed() + bool CanBuildWhenDeployed() + bool CanBuildWhenNotDeployed() + + void Stop() + void Move(Position p) + void MoveAndFire(Position p) + + bool Build(IUnitType* t) + bool Build(std::string typeName) + bool Build(std::string typeName, Position p) + bool Build(IUnitType* t, Position p) + + bool AreaReclaim(Position p, double radius) + bool Reclaim(IMapFeature* mapFeature) + bool Reclaim(IUnit* unit) + bool Attack(IUnit* unit) + bool Repair(IUnit* unit) + bool MorphInto(IUnitType* t) + + Position GetPosition() + float GetHealth() + float GetMaxHealth() + + int WeaponCount() + float MaxWeaponsRange() + + bool CanBuild(IUnitType* t) + + SResourceTransfer GetResourceUsage(int idx) + + void ExecuteCustomCommand(int cmdId, std::vector params_list, short options = 0, int timeOut = INT_MAX) +--]] diff --git a/LuaRules/Gadgets/ai/preload/spring_lua/unittype.lua b/LuaRules/Gadgets/ai/preload/spring_lua/unittype.lua new file mode 100644 index 000000000..5421ccdbe --- /dev/null +++ b/LuaRules/Gadgets/ai/preload/spring_lua/unittype.lua @@ -0,0 +1,296 @@ + +ShardUnitType = class(function(a, id) + a.id = id + a.def = UnitDefs[id] +end) + +function ShardUnitType:ID() + return self.id +end + +function ShardUnitType:Name() + return self.def.name +end + +function ShardUnitType:HumanName() + return self.def.humanName +end + +function ShardUnitType:Description() + return self.def.tooltip +end + +function ShardUnitType:Source() + return self.def +end + +function ShardUnitType:IsBuilder() + return self.def.isBuilder +end + +function ShardUnitType:BuildRange() + return self.def.buildDistance +end + +function ShardUnitType:CanMove() + return self.def.canMove +end + +function ShardUnitType:CanDeploy() + -- what does deploy mean for Spring? + return false +end + +function ShardUnitType:CanMorph() + -- what does deploy mean for Spring? + return false +end + +function ShardUnitType:IsFactory() + -- what does deploy mean for Spring? + return self.def.isFactory +end + +function ShardUnitType:CanBuild(type) + if not type then + return self.def.buildOptions and #self.def.buildOptions > 0 + end + -- Spring.Echo(self.def.name, "can build?", type, type:Name()) + if not self.canBuildType then + self.canBuildType = {} + -- Spring.Echo(self.def.name, "build options", self.def.buildOptions) + for _, defID in pairs(self.def.buildOptions) do + self.canBuildType[defID] = true + end + end + return self.canBuildType[type:ID()] +end + +function ShardUnitType:WeaponCount() + return #self.def.weapons -- test this. not sure the weapons table will give its length by the # operator +end + +function ShardUnitType:Extractor() + if self.def.name == "xmetalextractor" or self.def.name == "xmetalextractormoho" or string.find(self.def.name, "zmex") then + return true + elseif self.def.customParams.metal_extractor then + return true + end +end + +function ShardUnitType:Geothermal() + return self.def.needGeo +end + +function ShardUnitType:ExtractorEfficiency() + return self.def.extractsMetal +end + + +function ShardUnitType:CanAttack() + return self.def.canAttack +end + +function ShardUnitType:CanCloak() + return self.def.canCloak +end + +function ShardUnitType:CanAttackMove() + return self:CanFight() +end + +function ShardUnitType:CanFight() + return self.def.canFight +end + +function ShardUnitType:CanPatrol() + return self.def.canPatrol +end + +function ShardUnitType:CanGuard() + return self.def.canGuard +end + +function ShardUnitType:CanCloak() + return self.def.canCloak +end + +function ShardUnitType:CanSelfDestruct() + return self.def.canSelfDestruct +end + +function ShardUnitType:CanCloak() + return self.def.canCloak +end + +function ShardUnitType:CanRestore() + return self.def.canRestore +end + +function ShardUnitType:CanRepair() + return self.def.canCloak +end + +function ShardUnitType:CanReclaim() + return self.def.canReclaim +end + +function ShardUnitType:CanResurrect() + return self.def.canResurrect +end + +function ShardUnitType:CanCapture() + return self.def.canCloak +end + +function ShardUnitType:CanAssist() + return self.def.canAssist +end + +function ShardUnitType:CanBeAssisted() + return self.def.canBeAssisted +end + +function ShardUnitType:CanSelfRepair() + return self.def.canSelfRepair +end + +function ShardUnitType:IsAirbase() + return self.def.isAirbase +end + +function ShardUnitType:CanHover() + return self.def.canHover +end + +function ShardUnitType:CanFly() + return self.def.canFly +end + +function ShardUnitType:CanSubmerge() + return self.def.canSubmerge +end + +function ShardUnitType:CanBeTransported() + return not self.def.cantBeTransported +end + +function ShardUnitType:CanKamikaze() + return self.def.canKamikaze +end + +function ShardUnitType:OnOffable() + return self.def.onOffable +end + +function ShardUnitType:HasStealth() + return self.def.stealth +end + +function ShardUnitType:HasSonarStealth() + return self.def.sonarStealth +end + +function ShardUnitType:LosRadius() + return self.def.losRadius +end + +function ShardUnitType:RadarRadius() + return self.def.radarRadius +end + +function ShardUnitType:SonarRadius() + return self.def.sonarDistance +end + +function ShardUnitType:SeismicRadius() + return self.def.seismicRadius +end + +function ShardUnitType:CanManualFire() + return self.def.canManualFire +end + +function ShardUnitType:isFeatureOnBuilt() + return self.def.isFeature +end + +function ShardUnitType:TargetingPriority() + return self.def.power -- buildCostMetal + (buildCostEnergy / 60.0) in spring engine +end + +function ShardUnitType:BuildOptionsByName() + return self.def.buildOptions +end + +function ShardUnitType:Repairable() + return self.def.repairable +end + +function ShardUnitType:Capturable() + return self.def.capturable +end + +function ShardUnitType:ReclaimSpeed() + return self.def.reclaimSpeed +end + +function ShardUnitType:RepairSpeed() + return self.def.repairSpeed +end + +function ShardUnitType:MaxRepairSpeed() + return self.def.maxRepairSpeed +end + +function ShardUnitType:ResurrectSpeed() + return self.def.resurrectSpeed +end + +function ShardUnitType:CaptureSpeed() + return self.def.captureSpeed +end + +function ShardUnitType:TerraformSpeed() + return self.def.terraformSpeed +end + +function ShardUnitType:FootprintX() + return self.def.footprintX +end + +function ShardUnitType:FootprintZ() + return self.def.footprintZ +end + +function ShardUnitType:maxVelocity() + return self.def.speed +end + +function ShardUnitType:MaxAcceleration() + return self.def.maxAcc +end + +function ShardUnitType:MaxDeceleration() + return self.def.maxDec +end + +function ShardUnitType:BuildSpeed() + return self.def.buildSpeed -- Time to build = (buildTime / buildspeed) * 32 +end + +function ShardUnitType:BuildTime() + return self.def.buildTime -- Time to build = (buildTime / buildspeed) * 32 +end + +function ShardUnitType:BuildCostMetal() + return self.def.buildCostMetal +end + +function ShardUnitType:BuildCostEnergy() + return self.def.buildCostEnergy +end + +function ShardUnitType:Health() + return self.def.health +end diff --git a/LuaRules/Gadgets/ai/sleep.lua b/LuaRules/Gadgets/ai/sleep.lua new file mode 100644 index 000000000..890542a70 --- /dev/null +++ b/LuaRules/Gadgets/ai/sleep.lua @@ -0,0 +1,86 @@ +Sleep = class(Module) + +function Sleep:Name() + return "Sleep" +end + +function Sleep:internalName() + return "sleep" +end + +function Sleep:Init() + self.sleeping = {} +end + +function Sleep:GetSleeper(key) + for i = 1, #self.sleeping do + local sleeper = self.sleeping[i] + if sleeper.key == key then + return sleeper + end + end + local sleeper = { key = key, frames = 0 } + self.sleeping[#self.sleeping+1] = sleeper + return sleeper +end + +function Sleep:Update() + local done = {} + local count = 0 + for i = 1, #self.sleeping do + local sleeper = self.sleeping[i] + local frames = sleeper.frames + if (frames-1) < 1 then + -- limit the number of things woken up each frame to 50 + if #done < 50 then + self:Wakeup(sleeper) + table.insert(done,sleeper.key) + end + end + sleeper.frames = frames -1 + end + for i=1,#done do + self:Kill(done[i]) + end + count = nil + done = nil +end + +-- Pass in a function to be called in the future, +-- and how many frames to wait. Note that if the AI is busy, +-- there may be minor delays of several frames +function Sleep:Wait(functor, frames) + if functor == nil then + self.game:SendToConsole("error: functor == nil in Sleep:Wait ") + else + local sleeper = self:GetSleeper(functor) + sleeper.frames = frames + end +end + +function Sleep:Wakeup(sleeper) + if sleeper == nil then + self.game:SendToConsole("key == nil in Sleep:Wakeup()") + return + end + local key = sleeper.key + if type(key) == "table" then + if key.wakeup ~= nil then + key:wakeup() + else + self.game:SendToConsole("key:wakeup == nil in Sleep:Wakeup") + end + else + key() + end +end + +function Sleep:Kill(key) + for i = #self.sleeping, 1, -1 do + local sleeper = self.sleeping[i] + if sleeper.key == key then + table.remove(self.sleeping, i) + -- return + end + end +end diff --git a/LuaRules/Gadgets/ai/spothandler.lua b/LuaRules/Gadgets/ai/spothandler.lua new file mode 100644 index 000000000..8ece7162e --- /dev/null +++ b/LuaRules/Gadgets/ai/spothandler.lua @@ -0,0 +1,39 @@ +MetalSpotHandler = class(Module) + + +function MetalSpotHandler:Name() + return "MetalSpotHandler" +end + +function MetalSpotHandler:internalName() + return "metalspothandler" +end + +function MetalSpotHandler:Init() + self.spots = self.game.map:GetMetalSpots() +end + +function distance(pos1,pos2) + local xd = pos1.x-pos2.x + local yd = pos1.z-pos2.z + dist = math.sqrt(xd*xd + yd*yd) + return dist +end + +function MetalSpotHandler:ClosestFreeSpot(unittype,position) + local pos = nil + local bestDistance = 10000 + + spotCount = self.game.map:SpotCount() + for i,v in ipairs(self.spots) do + local p = v + local dist = distance(position,p) + if dist < bestDistance then + if self.game.map:CanBuildHere(unittype,p) then + bestDistance = dist + pos = p + end + end + end + return pos +end diff --git a/LuaRules/Gadgets/ai/taskqueuebehaviour.lua b/LuaRules/Gadgets/ai/taskqueuebehaviour.lua new file mode 100644 index 000000000..44944cc3c --- /dev/null +++ b/LuaRules/Gadgets/ai/taskqueuebehaviour.lua @@ -0,0 +1,314 @@ +TaskQueueBehaviour = class(Behaviour) + +function TaskQueueBehaviour:Init() + self.active = false + u = self.unit + u = u:Internal() + self.name = u:Name() + self.countdown = 0 + if self:HasQueues() then + self.queue = self:GetQueue() + end + + self.waiting = {} + self:OnToNextTask() + +end + +function dump(o) + if type(o) == 'table' then + local s = '{ ' + for k,v in pairs(o) do + if type(k) ~= 'number' then + k = '"'..k..'"' + end + s = s .. '['..k..'] = ' .. dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end + +function TaskQueueBehaviour:HasQueues() + return (taskqueues[self.name] ~= nil) +end + +function TaskQueueBehaviour:OwnerBuilt(unit) + if not self:IsActive() then + return + end + self:OnToNextTask() +end + +function TaskQueueBehaviour:OwnerIdle(unit) + if not self:IsActive() then + return + end + self.countdown = 0 + self:OnToNextTask() +end + +function TaskQueueBehaviour:OwnerMoveFailed(unit) + if not self:IsActive() then + return + end + self:OwnerIdle(unit) +end + +function TaskQueueBehaviour:OwnerDead() + if self.waiting ~= nil then + for k,v in pairs(self.waiting) do + self.ai.modules.sleep.Kill(self.waiting[k]) + end + end + self.waiting = nil + self.unit = nil +end + +function TaskQueueBehaviour:GetQueue() + q = taskqueues[self.name] + if type(q) == "function" then + q = q(self) + end + return q +end + +function TaskQueueBehaviour:Update() + if not self:IsActive() then + self:DebugPoint("nothing") + return + end + local f = self.game:Frame() + if self.progress == true then + if self.countdown > 14 then + self:ProgressQueue() + else + if self.countdown == nil then + self.countdown = 1 + else + self.countdown = self.countdown + 1 + end + end + end +end + +TaskQueueWakeup = class(function(a,tqb) + a.tqb = tqb +end) +function TaskQueueWakeup:wakeup() + self.tqb:ProgressQueue() +end + +function TaskQueueBehaviour:ProgressQueue() + unit = self.unit:Internal() + if self:IsWaitingForPosition() then + self:DebugPoint("waiting") + return + end + if self.queue == nil then + if self:HasQueues() then + self.queue = self:GetQueue() + else + self:DebugPoint("nothing") + return + end + end + self.countdown = 0 + self.progress = false + + if self.queue == nil then + self.game:SendToConsole("Warning: A "..self.name.." unit, has an empty task queue") + self:OnToNextTask() + self:DebugPoint("nothing") + return + end + local idx, val = next(self.queue,self.idx) + self.idx = idx + if idx == nil then + self:DebugPoint("nothing") + self.queue = self:GetQueue(name) + self:OnToNextTask() + return + end + + local utype = nil + local value = val + if type(val) == "function" then + value = val(self, self.ai, unit) + end + if value == "next" then + self:DebugPoint("nothing") + self:OnToNextTask() + return + end + if type(val) == "table" then + self:HandleActionTask( value ) + return + end + + success = self:TryToBuild( value ) + if success ~= true then + self:DebugPoint("nothing") + self:OnToNextTask() + return + end +end + +function TaskQueueBehaviour:TryToBuild( unit_name ) + utype = self.game:GetTypeByName(unit_name) + if not utype then + self.game:SendToConsole("Cannot build:"..unit_name..", could not grab the unit type from the engine") + return false + end + if unit:CanBuild(utype) ~= true then + return false + end + local success = false + if utype:Extractor() then + success = self:BuildExtractor(utype) + elseif utype:Geothermal() then + success = self:BuildGeothermal(utype) + elseif unit:Type():IsFactory() then + success = self.unit:Internal():Build(utype) + else + success = self:BuildOnMap(utype) + end + return success +end + +function TaskQueueBehaviour:HandleActionTask( task ) + local action = task.action + if action == "wait" then + t = TaskQueueWakeup(self) + tqb = self + self.ai.sleep:Wait({ wakeup = function() tqb:ProgressQueue() end, },task.frames) + elseif action == "move" then + self.unit:Internal():Move(task.position) + elseif action == "moverelative" then + local upos = unit:GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():Move(newpos) + elseif action == "fight" then + self.unit:Internal():MoveAndFire(task.position) + elseif action == "fightrelative" then + local upos = self.unit:Internal():GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():MoveAndFire(newpos) + elseif action == "patrol" then + self.unit:Internal():MoveAndPatrol(task.position) + elseif action == "patrolrelative" then + local upos = self.unit:Internal():GetPosition() + local newpos = api.Position() + newpos.x = upos.x + task.position.x + newpos.y = upos.y + task.position.y + newpos.z = upos.z + task.position.z + self.unit:Internal():MoveAndPatrol(newpos) + else + self.game:SendToConsole("Error: Unknown action task "..value.." given to a "..self.name) + self:DebugPoint("nothing") + self:OnToNextTask() + end +end + +function onsuccess( job, pos ) + job.tqb:OnBuildingPlacementSuccess( job, pos ) +end + +function onfail( job ) + job.tqb:OnBuildingPlacementFailure( job ) +end + +function TaskQueueBehaviour:IsWaitingForPosition() + return self.placementInProgress +end + + +function TaskQueueBehaviour:BeginWaitingForPosition() + self.placementInProgress = true +end + +function TaskQueueBehaviour:StopWaitingForPosition() + self.placementInProgress = false +end + +function TaskQueueBehaviour:BuildOnMap(utype) + --p = self.map:FindClosestBuildSite(utype, unit:GetPosition()) + --self.progress = not self.unit:Internal():Build(utype,p) + unit = self.unit:Internal() + + local job = { + start_position=unit:GetPosition(), + max_radius=1500, + onSuccess=onsuccess, + onFail=onfail, + unittype=utype, + cleanup_on_unit_death=self.unit.engineID, + tqb=self + } + local success = self.ai.placementhandler:NewJob( job ) + if success ~= true then + self:StopWaitingForPosition() + return false + end + self:BeginWaitingForPosition() + return true +end + +function TaskQueueBehaviour:BuildExtractor(utype) + -- find a free spot! + unit = self.unit:Internal() + p = unit:GetPosition() + p = self.ai.metalspothandler:ClosestFreeSpot(utype,p) + if p == nil then + return false + end + return self.unit:Internal():Build(utype,p) +end + +function TaskQueueBehaviour:OnToNextTask() + self.progress = true +end + +function TaskQueueBehaviour:IsDoingSomething() + return ( self.progress == false ) +end + +function TaskQueueBehaviour:OnBuildingPlacementSuccess( job, pos ) + self:StopWaitingForPosition() + local p = dump( pos ) + local success self.unit:Internal():Build( job.unittype, pos ) + if success == false then + self:OnToNextTask() + end +end + +function TaskQueueBehaviour:OnBuildingPlacementFailure( job ) + self:StopWaitingForPosition() + self:OnToNextTask() +end + +function TaskQueueBehaviour:Activate() + self.progress = true + self.active = true +end + +function TaskQueueBehaviour:Deactivate() + self.active = false +end + +function TaskQueueBehaviour:Priority() + return 50 +end + +function TaskQueueBehaviour:DebugPoint( type ) + local unit = self.unit:Internal() + local p = unit:GetPosition() + SendToUnsynced("shard_debug_position",p.x,p.z,type) +end diff --git a/LuaRules/Gadgets/ai/taskqueues.lua b/LuaRules/Gadgets/ai/taskqueues.lua new file mode 100644 index 000000000..e39bcee03 --- /dev/null +++ b/LuaRules/Gadgets/ai/taskqueues.lua @@ -0,0 +1,171 @@ +--[[ + Task Queues! +]]-- + +math.randomseed( os.time() ) +math.random(); math.random(); math.random() + +function CoreWindSolar( taskqueuebehaviour ) + if taskqueuebehaviour.ai.map:AverageWind() > 10 then + return "corwind" + else + return "corsolar" + end +end +function randomLab( taskqueuebehaviour ) + local r = math.random(0,2) + if r == 0 then + return "corlab" + elseif r == 1 then + return "corvp" + else + return "corap" + end +end + +local corecommanderlist = { + CoreWindSolar, + "cormex", + CoreWindSolar, + "cormex", + "cormex", + randomLab, + "corllt", + "corrad", + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + "cormex", + "cormex", + "cormex", + "corllt", + CoreWindSolar, +} +local coreconstructionkbot = { + CoreWindSolar, + "cormex", + CoreWindSolar, + "cormex", + "cormex", + "corllt", + "corrad", + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + CoreWindSolar, + "cormex", + "cormex", + "cormex", + "corllt", + CoreWindSolar, +} + +local armcommander = { + "armsolar", + "armmex", + "armsolar", + "armmex", + "armmex", + "armlab", + "armllt", + "armrad", + "armsolar", + "armsolar", + "armsolar", + "armsolar", + "armmex", + "armsolar", + "armmex", + "armmex", + "armllt", + "armlab", + "armrad", + "armsolar", + "armsolar", + "armsolar", +} + +local armconstructionkbot = { + "armsolar", + "armmex", + "armsolar", + "armmex", + "armmex", + "armlab", + "armllt", + "armrad", + "armsolar", + "armsolar", + "armsolar", + "armsolar", + "armmex", + "armsolar", + "armmex", + "armmex", + "armllt", + "armlab", + "armrad", + "armsolar", + "armsolar", + "armsolar", +} + +local corekbotlab = { + "corck", + "corck", + "corck", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", + "corak", +} + +local armkbotlab = { + "armck", + "armck", + "armck", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", + "armpw", +} +taskqueues = { + -- unittype = tasklist, + corcom = corecommanderlist, + -- we can assign 1 list, to multiple unit types, here a construction kbot (corck) gets the construction kbot tasklist, but then we assign it to the construction vehicle too (corcv)) + corck = coreconstructionkbot, + corcv = coreconstructionkbot, + armcom = armcommander, + armck = armconstructionkbot, + corlab = corekbotlab, + armlab = armkbotlab, +} diff --git a/LuaRules/Gadgets/ai/test.lua b/LuaRules/Gadgets/ai/test.lua new file mode 100644 index 000000000..5b1c42ade --- /dev/null +++ b/LuaRules/Gadgets/ai/test.lua @@ -0,0 +1,19 @@ +function dump(o) + if type(o) == 'table' then + local s = '{ ' + for k,v in pairs(o) do + if type(k) ~= 'number' then k = '"'..k..'"' end + s = s .. '['..k..'] = ' .. dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end +require "boot" +shard_include "ai" +ai = ShardAI() +ai:Init() +u = UnitHandler() + +u:SetAI(ai) \ No newline at end of file diff --git a/LuaRules/Gadgets/ai/unit.lua b/LuaRules/Gadgets/ai/unit.lua new file mode 100644 index 000000000..a00946134 --- /dev/null +++ b/LuaRules/Gadgets/ai/unit.lua @@ -0,0 +1,150 @@ +Unit = class(AIBase) + +function Unit:SetEngineRepresentation(engineUnit) + self.engineUnit = engineUnit + self.engineID = engineUnit:ID() +end + +function Unit:Internal() + return self.engineUnit +end + +function Unit:Init() + if self.engineUnit == nil then + self.game:SendToConsole("Warning: Shard Unit:Init nil engineUnit?!") + end + self.behaviours = {} +end + +function Unit:Update() + if self.behaviours == nil then + self.behaviours = {} + end + for k,v in pairs(self.behaviours) do + v:Update() + end +end + +function Unit:GameEnd() + for k,v in pairs(self.behaviours) do + v:GameEnd() + end +end + +function Unit:UnitCreated(unit) + if unit.engineID == self.engineID then + return + end + for k,v in pairs(self.behaviours) do + v:UnitCreated(unit) + end +end + +function Unit:UnitBuilt(unit) + if unit.engineID == self.engineID then + self:ElectBehaviour() + for k,v in pairs(self.behaviours) do + v:OwnerBuilt() + end + else + for k,v in pairs(self.behaviours) do + v:UnitBuilt(unit) + end + end +end + +function Unit:UnitDead(unit) + + if unit.engineID == self.engineID then + if self.behaviours then + -- game:SendToConsole("unit died, removing behaviours", self.engineID, self:Internal():Name()) + for k,v in pairs(self.behaviours) do + self.behaviours[k]:OwnerDead() + self.behaviours[k] = nil + end + self.behaviours = nil + end + self.engineUnit = nil + else + for k,v in pairs(self.behaviours) do + v:UnitDead(unit) + end + end +end + + +function Unit:UnitDamaged(unit,attacker,damage) + if unit.engineID == self.engineID then + for k,v in pairs(self.behaviours) do + v:OwnerDamaged(attacker,damage) + end + else + for k,v in pairs(self.behaviours) do + v:UnitDamaged(unit,attacker,damage) + end + end +end + +function Unit:UnitIdle(unit) + if unit.engineID == self.engineID then + for k,v in pairs(self.behaviours) do + v:OwnerIdle() + end + else + for k,v in pairs(self.behaviours) do + v:UnitIdle(unit) + end + end +end + +function Unit:UnitMoveFailed(unit) + if unit.engineID == self.engineID then + for k,v in pairs(self.behaviours) do + v:OwnerMoveFailed() + end + else + for k,v in pairs(self.behaviours) do + v:UnitMoveFailed(unit) + end + end +end + +function Unit:AddBehaviour(behaviour) + table.insert(self.behaviours,behaviour) +end + +function Unit:ActiveBehaviour() + return self.activebeh +end + +function Unit:ElectBehaviour() + if self.behaviours == nil then --probably we are dead. + return + end + local bestbeh = nil + local bestscore = -1 + if #self.behaviours > 0 then + for k,v in pairs(self.behaviours) do + if bestbeh == nil then + bestbeh = v + bestscore = v:Priority() + else + local score = v:Priority() + if score > bestscore then + bestscore = score + bestbeh = v + end + end + end + + if self.activebeh ~= bestbeh then + if self.activebeh ~= nil then + self.activebeh:PreDeactivate() + self.activebeh:Deactivate() + end + self.activebeh = bestbeh + self.activebeh:PreActivate() + self.activebeh:Activate() + end + end +end diff --git a/LuaRules/Gadgets/ai/unithandler.lua b/LuaRules/Gadgets/ai/unithandler.lua new file mode 100644 index 000000000..7ce3e7496 --- /dev/null +++ b/LuaRules/Gadgets/ai/unithandler.lua @@ -0,0 +1,145 @@ +UnitHandler = class(Module) + +local inactive = { + estorage = true, + emine = true, + efusion2 = true, + egeothermal = true, + eheavyturret2 = true, + ejammer2 = true, + ekmar = true, + elaserbattery = true, + elightturret2 = true, + emediumgen = true, + eradar2 = true, + eshieldgen = true, + esolar2 = true, +} + +function UnitHandler:Name() + return "UnitHandler" +end + +function UnitHandler:internalName() + return "unithandler" +end + +function UnitHandler:Init() + self.units = {} + self.myActiveUnits = {} + self.myInactiveUnits = {} + self.reallyActuallyDead = {} + self.behaviourFactory = BehaviourFactory() + self.behaviourFactory:SetAI(self.ai) + self.behaviourFactory:Init() +end + +function UnitHandler:Update() + for k,v in pairs(self.myActiveUnits) do + if ShardSpringLua then + local ux, uy, uz = Spring.GetUnitPosition(v:Internal():ID()) + if not ux then + -- game:SendToConsole(self.ai.id, "nil unit position", v:Internal():ID(), v:Internal():Name(), k) + self.myActiveUnits[k] = nil + v = nil + end + end + if v then + v:Update() + end + end + for uID, frame in pairs(self.reallyActuallyDead) do + if self.game:Frame() > frame + 1800 then + self.reallyActuallyDead[uID] = nil + end + end +end + +function UnitHandler:GameEnd() + for k,v in pairs(self.myActiveUnits) do + v:GameEnd() + end +end + +function UnitHandler:UnitCreated(engineUnit) + local u = self:AIRepresentation(engineUnit) + for k,v in pairs(self.myActiveUnits) do + v:UnitCreated(u) + end +end + +function UnitHandler:UnitBuilt(engineUnit) + local u = self:AIRepresentation(engineUnit) + if u ~= nil then + for k,v in pairs(self.myActiveUnits) do + v:UnitBuilt(u) + end + end +end + +function UnitHandler:UnitDead(engineUnit) + local u = self:AIRepresentation(engineUnit) + if u ~= nil then + for k,v in pairs(self.myActiveUnits) do + v:UnitDead(u) + end + end + -- game:SendToConsole(self.ai.id, "removing unit from unithandler tables", engineUnit:ID(), engineUnit:Name()) + self.units[engineUnit:ID()] = nil + self.myActiveUnits[engineUnit:ID()] = nil + self.myInactiveUnits[engineUnit:ID()] = nil + self.reallyActuallyDead[engineUnit:ID()] = self.game:Frame() +end + +function UnitHandler:UnitDamaged(engineUnit,engineAttacker,damage) + local u = self:AIRepresentation(engineUnit) + -- local a = self:AIRepresentation(engineAttacker) + for k,v in pairs(self.myActiveUnits) do + v:UnitDamaged(u,engineAttacker,damage) + end +end + +function UnitHandler:AIRepresentation(engineUnit) + if engineUnit == nil then + return nil + end + if self.reallyActuallyDead[engineUnit:ID()] then + -- self.game:SendToConsole(self.ai.id, "unit already died, not representing unit", engineUnit:ID(), engineUnit:Name()) + return nil + end + local ux, uy, uz = engineUnit:GetPosition() + if not ux then + -- self.game:SendToConsole(self.ai.id, "nil engineUnit position, not representing unit", engineUnit:ID(), engineUnit:Name()) + return nil + end + local unittable = self.units + local u = unittable[engineUnit:ID()] + if u == nil then + -- self.game:SendToConsole(self.ai.id, "adding unit to unithandler tables", engineUnit:ID(), engineUnit:Name()) + u = Unit() + u:SetAI( self.ai ) + self.units[engineUnit:ID()] = u + + u:SetEngineRepresentation(engineUnit) + u:Init() + if engineUnit:Team() == self.game:GetTeamID() then + if inactive[engineUnit:Name()] then + self.myInactiveUnits[engineUnit:ID()] = u + else + -- game:SendToConsole(self.ai.id, "giving my unit behaviours", engineUnit:ID(), engineUnit:Name()) + self.behaviourFactory:AddBehaviours(u) + self.myActiveUnits[engineUnit:ID()] = u + end + end + end + return u +end + +function UnitHandler:UnitIdle(engineUnit) + local u = self:AIRepresentation(engineUnit) + if u ~= nil then + for k,v in pairs(self.units) do + v:UnitIdle(u) + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai_helpers.lua b/LuaRules/Gadgets/ai_helpers.lua new file mode 100644 index 000000000..0a3c38f7c --- /dev/null +++ b/LuaRules/Gadgets/ai_helpers.lua @@ -0,0 +1,468 @@ +function gadget:GetInfo() + return { + name = "Ai Helpers", + desc = "Used for AI scripts", + author = "Doo", + date = "August 2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end + +if gadgetHandler:IsSyncedCode() then + +GG.AiHelpers = {} + +-------------------------------- +-- NewPlacementHandler Helper -- +-------------------------------- +GG.AiHelpers.NewPlacementHandler = {} + +GG.AiHelpers.Start = function() + enabled = true + gadget:Initialize() +end + +local mapwidth = math.max(Game.mapSizeX, Game.mapSizeZ) +local celltoscan = celltoscan or {} +local defidpersizetype = defidpersizetype or {} +local cells = cells or {} + +GG.AiHelpers.NewPlacementHandler.GetPosFromID = function(id) + local z = id%mapwidth + local x = (id - z)/mapwidth + return {x = x, z = z} +end + +GG.AiHelpers.NewPlacementHandler.GetIDFromPos = function(x, z, cellsize) + return (x - x%cellsize) * mapwidth + (z - z%cellsize) +end + +GG.AiHelpers.NewPlacementHandler.GetIDBuildable = function(id, cellsize, buildtype) + if cellsize == 112 then cellsize = 128 end + return cells[cellsize][buildtype][id] +end + +GG.AiHelpers.NewPlacementHandler.ClosePosition = function(x,z, cellsize,spacing) + local id1 = GG.AiHelpers.NewPlacementHandler.GetIDFromPos(x,z,cellsize) + local pos = GG.AiHelpers.NewPlacementHandler.GetPosFromID(id1) + local x, z = pos.x, pos.z + for v = x-spacing, x+spacing+cellsize-1, 8 do + for h = z-spacing, z+spacing+cellsize-1, 8 do + for size, cell in pairs(cells) do + local id = GG.AiHelpers.NewPlacementHandler.GetIDFromPos(v,h,size) + gadget:SetCellValue(id, size, "ground", false) + end + end + end +end + +GG.AiHelpers.NewPlacementHandler.FreePosition = function(x,z,cellsize,spacing) + local id1 = GG.AiHelpers.NewPlacementHandler.GetIDFromPos(x,z,cellsize) + local pos = GG.AiHelpers.NewPlacementHandler.GetPosFromID(id1) + local x, z = pos.x, pos.z + for v = x - spacing, x + spacing + cellsize-1, 8 do + for h = z - spacing, z + spacing + cellsize - 1 ,8 do + gadget:ScanCell(GG.AiHelpers.NewPlacementHandler.GetIDFromPos(x,z,8)) + end + end +end + +---------------------------- +--Retreat Positions Helper-- +---------------------------- +GG.AiHelpers.NanoTC = {} +local isNanoTC = {} +local NanoTC = {} +local ClosestNanoTC = {} + +for unitDefID, defs in pairs(UnitDefs) do + if string.find(defs.name, "ecommander") or string.find(defs.name, "zarm") then + isNanoTC[unitDefID] = true + end +end + +GG.AiHelpers.NanoTC.GetClosestNanoTC = function (unitID) + local bestx, besty, bestz + local teamID = Spring.GetUnitTeam(unitID) + local ux, uy, uz = Spring.GetUnitPosition(unitID) + local bestID + local mindis = math.huge + local x, y, z = math.floor(ux/256), math.floor(uy/256), math.floor(uz/256) + if ClosestNanoTC and ClosestNanoTC[teamID] and ClosestNanoTC[teamID][x] and ClosestNanoTC[teamID][x][z] and Spring.ValidUnitID(ClosestNanoTC[teamID][x][z]) then + bestID = ClosestNanoTC[teamID][x][z] + elseif NanoTC and NanoTC[teamID] then + for uid, pos in pairs (NanoTC[teamID]) do + local gx, gy, gz = pos[1], pos[2], pos[3] + local dis = gadget:Distance(ux, uz, gx, gz) + if dis< mindis then + mindis = dis + bestID = uid + if not ClosestNanoTC then ClosestNanoTC = {} end + if not ClosestNanoTC[teamID] then ClosestNanoTC[teamID] = {} end + if not ClosestNanoTC[teamID][x] then ClosestNanoTC[teamID][x] = {} end + ClosestNanoTC[teamID][x][z] = uid + end + end + end + if bestID then + bestx, besty, bestz = Spring.GetUnitPosition(bestID) + end + return bestx, besty, bestz +end +------------- +--Unit Info-- +------------- + +GG.AiHelpers.UnitInfo = {} +local info = {} + +GG.AiHelpers.UnitInfo = function(teamID, unitDefID) + return info[teamID] and info[teamID][unitDefID] or nil +end + +-------------------------- +--Unit Visibility Checks-- +-------------------------- +GG.AiHelpers.VisibilityCheck = {} +local SeenBuildings = {} + +GG.AiHelpers.VisibilityCheck.IsUnitVisible = function(unitID, teamID) + local _,_,_,_,_,allyTeamID = Spring.GetTeamInfo(teamID) + if SeenBuildings[teamID] and SeenBuildings[teamID][unitID] then + return true + elseif Spring.IsUnitInLos(unitID, allyTeamID) or Spring.IsUnitInRadar(unitID, allyTeamID) then + return true + end + return false +end + +----------------------- +--Targets Of Interest-- +----------------------- + +local Interest = { + ecommander = true, + ecommanderbattle = true, + ecommanderbuild = true, + ecommandercloak = true, + ecommanderfactory = true, + ecommandermeteor = true, + ecommandershield = true, + ecommanderhealerai = true, + ecommanderbattleai = true, + ecommanderbuildai = true, + ecommandercloakai = true, + ecommanderfactoryai = true, + ecommandermeteorai = true, + ecommandershieldai = true, + eairplant = true, + eairplant_up1 = true, + eairplant_up2 = true, + eairplant_up3 = true, + eminifac = true, + eminifac_up1 = true, + eminifac_up2 = true, + eminifac_up3 = true, + eamphibfac = true, + eamphibfac_up1 = true, + eamphibfac_up2 = true, + eamphibfac_up3 = true, + ehbotfac = true, + ehbotfac_up1 = true, + ehbotfac_up2 = true, + ehbotfac_up3 = true, + efusion2 = true, + esilo = true, + etech1 = true, + etech2 = true, + etech3 = true, + eartyturret = true, + eartyturret_up1 = true, + eartyturret_up2 = true, + eartyturret_up3 = true, + ekmar = true, + zarm = true, +} + +GG.AiHelpers.TargetsOfInterest = {} +local TargetsOfInterest = {} +local function IsAntiNukeCovered(unitID, attackerTeamID) + local x,y,z = Spring.GetUnitPosition(unitID) + if not x and z then + TargetsOfInterest[attackerTeamID][unitID] = nil + return true + end + local unitsNear = Spring.GetUnitsInCylinder(x,z,2000) + for ct, id in pairs(unitsNear) do + if (UnitDefs[Spring.GetUnitDefID(id)].name == "eshieldgen") and (not Spring.AreTeamsAllied(Spring.GetUnitTeam(id), attackerTeamID)) then + if SeenBuildings[attackerTeamID][unitID] then + return true + end + end + end + return false +end + +local function IsInAttackRange(unitID, attackerID) + local weapons = UnitDefs[Spring.GetUnitDefID(attackerID)].weapons + local x, y, z = Spring.GetUnitPosition(unitID) + for i,_ in pairs(weapons) do + if (Spring.GetUnitWeaponTestTarget(attackerID, i, x, y, z) and Spring.GetUnitWeaponTestRange(attackerID, i, x, y, z) and Spring.GetUnitWeaponHaveFreeLineOfFire(attackerID, i, x, y, z)) then + return true + end + end + return false +end + + +GG.AiHelpers.TargetsOfInterest.BombingRun = function(teamID) + if not TargetsOfInterest[teamID] then return end + local target + for unitID, isTarget in pairs(TargetsOfInterest[teamID]) do + target = unitID + break + end + if target then + return target + else + return nil + end +end + +GG.AiHelpers.TargetsOfInterest.Nuke = function(teamID) + if not TargetsOfInterest[teamID] then return end + local target + for unitID, isTarget in pairs(TargetsOfInterest[teamID]) do + if (not IsAntiNukeCovered(unitID, teamID)) then + target = unitID + break + end + end + if target then + return target + else + for unitID, isTarget in pairs(TargetsOfInterest[teamID]) do + if math.random(1,30) == 1 then + target = unitID + break + end + end + end + if target then + return target + else + return nil + end +end + +GG.AiHelpers.TargetsOfInterest.LongRangeWeapon = function(attackerID, teamID) + if not TargetsOfInterest[teamID] then return end + local target + local targetpos + local ct = 0 + for unitID, isTarget in pairs(TargetsOfInterest[teamID]) do + if (IsInAttackRange(unitID, attackerID)) then + target = unitID + break + end + end + if target then + return target + else + return nil + end +end + +GG.AiHelpers.TargetsOfInterest.GetTarget = function(teamID) + if not TargetsOfInterest[teamID] then return end + local target + local targetpos + local ct = 0 + for unitID, isTarget in pairs(TargetsOfInterest[teamID]) do + if math.random(1,20) == 1 then + target = unitID + break + end + end + if target then + local x, y, z = Spring.GetUnitPosition(target) + targetpos = {x = x, y = y, z = z} + end + return targetpos +end + + + +------------------------- +--Gadget Core Functions-- +------------------------- + + function gadget:Distance(x1,z1, x2,z2) + local vectx = x2 - x1 + local vectz = z2 - z1 + local dis = math.sqrt(vectx^2+vectz^2) + return dis + end + + function gadget:Initialize() + if enabled ~= true then return end + for unitDefID, defs in pairs(UnitDefs) do + if defs.isBuilding or string.find(defs.name, "eorb") then + local cellsize = math.max(defs.xsize, defs.zsize) * 8 + local buildtype = (defs.maxWaterDepth >= 0) and "ground" or "water" + if not cells[cellsize] then + cells[cellsize] = {} + defidpersizetype[cellsize] = {} + end + if not cells[cellsize][buildtype] then + defidpersizetype[cellsize][buildtype] = unitDefID + cells[cellsize][buildtype] = {} + for x = 0, Game.mapSizeX-1, cellsize do + for z = 0, Game.mapSizeZ-1, cellsize do + gadget:SetCellValue(GG.AiHelpers.NewPlacementHandler.GetIDFromPos(x, z, cellsize), cellsize, buildtype, (Spring.TestBuildOrder(unitDefID, x + cellsize/2, Spring.GetGroundHeight(x + cellsize/2, z+cellsize/2), z+cellsize/2, "s") >= 1 and Spring.TestBuildOrder(unitDefID, x + cellsize/2, Spring.GetGroundHeight(x + cellsize/2, z+cellsize/2), z+cellsize/2, "e") >= 1)) + end + end + end + end + end + + for ct, unitID in pairs(Spring.GetAllUnits()) do + local unitDefID = Spring.GetUnitDefID(unitID) + local unitTeam = Spring.GetUnitTeam(unitID) + gadget:UnitFinished(unitID, unitDefID, unitTeam) + end + end + + function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) + if enabled ~= true then return end + info[teamID] = info[teamID] or {} + info[teamID][unitDefID] = info[teamID][unitDefID] or {killed_cost=0,n=0, avgkilled_cost=0} + info[teamID][unitDefID].n = info[teamID][unitDefID].n + 1 + if info[teamID][unitDefID].n > 80 then + info[teamID][unitDefID].n = info[teamID][unitDefID].n - 1 + info[teamID][unitDefID].killed_cost = info[teamID][unitDefID].killed_cost - info[teamID][unitDefID].avgkilled_cost + if info[teamID][unitDefID].killed_cost <= 0 then info[teamID][unitDefID].killed_cost = 0 end + info[teamID][unitDefID].avgkilled_cost = info[teamID][unitDefID].killed_cost / info[teamID][unitDefID].n + end + end + + function gadget:UnitEnteredRadar(unitID, unitTeam, allyTeam, unitDefID) + if enabled ~= true then return end + local defs = UnitDefs[unitDefID] + if defs.isBuilding or string.find(defs.name, "eorb") then + for ct, id in pairs (Spring.GetTeamList(allyTeam)) do + if Interest[defs.name] == true and (not Spring.AreTeamsAllied(id, allyTeam)) then + TargetsOfInterest[id] = TargetsOfInterest[id] or {} + TargetsOfInterest[id][unitID] = true + end + SeenBuildings[id] = SeenBuildings[id] or {} + SeenBuildings[id][unitID] = true + end + end + end + + function gadget:UnitEnteredLos(unitID, unitTeam, allyTeam, unitDefID) + if enabled ~= true then return end + local defs = UnitDefs[unitDefID] + if defs.isBuilding or string.find(defs.name, "eorb") then + for ct, id in pairs (Spring.GetTeamList(allyTeam)) do + if Interest[defs.name] == true and (not Spring.AreTeamsAllied(id, unitTeam)) then + TargetsOfInterest[id] = TargetsOfInterest[id] or {} + TargetsOfInterest[id][unitID] = true + end + SeenBuildings[id] = SeenBuildings[id] or {} + SeenBuildings[id][unitID] = true + end + end + end + + function gadget:UnitFinished(unitID, unitDefID, unitTeam) + if enabled ~= true then return end + if isNanoTC[unitDefID] then + if not NanoTC[unitTeam] then NanoTC[unitTeam] = {} end + NanoTC[unitTeam][unitID] = {Spring.GetUnitPosition(unitID)} + gadget:UpdateClosestNanoTCTable(unitTeam) + end + end + + function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) + if enabled ~= true then return end + if not attackerDefID then return end + if not unitDefID then return end + if not info[attackerTeam] then return end + if not info[attackerTeam][attackerDefID] then return end + if not info[unitTeam] then return end + if not info[unitTeam][unitDefID] then return end + if Spring.AreTeamsAllied(unitTeam,attackerTeam) then return end + local h,maxh,_ = Spring.GetUnitHealth(unitID) + damage = math.min(h,damage) + if paralyzer then damage = damage * 0.2 end + if attackerDefID and attackerTeam then + local count = Spring.GetTeamUnitDefCount(attackerTeam, attackerDefID) + if count > 0 then + ratio2 = 30/count + else + ratio2 = 30 + end + end + local ratio = damage/maxh + local killed_m = UnitDefs[unitDefID].metalCost * ratio + local killed_e = UnitDefs[unitDefID].energyCost * ratio + info[attackerTeam][attackerDefID].killed_cost = info[attackerTeam][attackerDefID].killed_cost + killed_m + killed_e/60 + info[attackerTeam][attackerDefID].avgkilled_cost = info[attackerTeam][attackerDefID].killed_cost / info[attackerTeam][attackerDefID].n + end + + function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + if enabled ~= true then return end + if not NanoTC[unitTeam] then NanoTC[unitTeam] = {} end + NanoTC[unitTeam][unitID] = nil + gadget:UpdateClosestNanoTCTable(unitTeam) + for ct, id in pairs(Spring.GetTeamList()) do + if SeenBuildings[id] then + SeenBuildings[id][unitID] = nil + end + if TargetsOfInterest[id] then + TargetsOfInterest[id][unitID] = nil + end + end + end + + function gadget:UnitTaken(unitID, unitDefID, oldTeam, newTeam) + if enabled ~= true then return end + gadget:UnitDestroyed(unitID, unitDefID, oldTeam) + gadget:UnitFinished(unitID, unitDefID, newTeam) + end + + + function gadget:GameFrame(f) + if enabled ~= true then return end + for id, cell in pairs(celltoscan) do + if f%300 == id%300 then + for size, metatable in pairs(defidpersizetype) do + local pos = GG.AiHelpers.NewPlacementHandler.GetPosFromID(id) + for buildtype, unitDefID in pairs(metatable) do + gadget:SetCellValue(GG.AiHelpers.NewPlacementHandler.GetIDFromPos(pos.x, pos.z, size), size, buildtype,(Spring.TestBuildOrder(unitDefID, pos.x + size/2, Spring.GetGroundHeight(pos.x + size/2, pos.z+size/2), pos.z+size/2, "s") >= 1 and Spring.TestBuildOrder(unitDefID, pos.x + size/2, Spring.GetGroundHeight(pos.x + size/2, pos.z+size/2), pos.z+size/2, "e") >= 1)) + celltoscan[id] = nil + end + end + end + end + end + + function gadget:SetCellValue(id, size, buildtype, value) + cells[size][buildtype][id] = value + end + + function gadget:ScanCell(id) + celltoscan[id] = true + end + + function gadget:UpdateClosestNanoTCTable(teamID) + if teamID then + ClosestNanoTC[teamID] = nil + end + end + +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai_namer.lua b/LuaRules/Gadgets/ai_namer.lua new file mode 100644 index 000000000..ae7d6dd96 --- /dev/null +++ b/LuaRules/Gadgets/ai_namer.lua @@ -0,0 +1,399 @@ + + +function gadget:GetInfo() + return { + name = "AI namer", + desc = "Assignes names to AI teams", + author = "Floris", + date = "May 2018", + layer = 0, + enabled = true, + } +end + + +if gadgetHandler:IsSyncedCode() then + + local namelist = { +'Killertrainz', +'CRAZY POOCHES', +'Crazy Anti', +'Moon Man06Ox', +'FuckoffCupid', +'Anheuser', +'Jolly Roger', +'BelchMerchant', +'Leonidas', +'BigMacSandWitch', +'ZombiesChef', +'MasterKeef', +'Boomhauer', +'BigAssKiller', +'MustacheMopol', +'Captain Crunch', +'AncientPablo', +'Chewbacca', +'KingPopeye', +'ChubsChubs', +'PorkChopChop', +'ChumTheReaper', +'RufioRoofie', +'Rumplestiltskin', +'MexicanDjango', +'SpiderPig', +'FlandersFlannels', +'ShePoopie', +'FrodoSaggins', +'Frogger', +'GoochieGoonie', +'HilariousVader', +'ItalianGump', +'Weinerstein', +'HomerPoopson', +'WillyWizzer', +'AwesomeHobo', +'WarningLowBattery', +'Granny4theWIN', +'PookieChips', +'TheMustardCat', +'DnknDonuts', +'EdgarAllenPoo', +'PickingBoogers', +'BeanieWeenees', +'YOURnameHERE', +'MouseRatRockBand', +'TickleMeElmo', +'EatingHawaiianPizza', +'UnzippedStraw', +'VaguelyCynical', +'PervertPeewee', +'TubbyCandyHoarder', +'GotASegway', +'LookWhatICanDo', +'IPlayFarmHeroes', +'TwoandTwomakes5', +'TheBraveChicken', +'OneLoneClone', +'OneSmugPug', +'WindyGod', +'ElactixNova', +'ToxicCharger', +'SwiftSpeed', +'SwiftFox', +'MindBuggle', +'IonicHound', +'Global meltdown', +'LeSpank', +'Oceanstar11', +'Snowman', +'SinRostro', +'AfricaGalactic', +'TheDestroyer', +'MindController', +'ImagineYOU', +'SkyxQueen', +'Chadkitten', +'Stripyrex', +'TheNastyPasty', +'MurderSheWrote', +'Excalibur101', +'Jaredboom', +'Trickordie', +'Quickandsilver', +'Bangarmor', +'Need4andre', +'Jedterminator', +'Koolstack', +'Smartplatypus', +'TornadoSonic', +'VolcanicEruption', +'ApocalypseMan', +'SupraNova', +'Zombiesareback', +'GunDown', +'Bloodofraven', +'KnivesUinBack', +'Swords4aSAMURAI', +'Beastkiller', +'Naturalbornwinner', +'ChampOnTheGo', +'IamRage', +'ChaosMourn', +'RawrGuard', +'Angel123', +'CrazedMaaana', +'EraZorA', +'ManOntheJungle', +'FruzzerTrooper', +'FlominateDominion', +'MagicKen', +'FreeaakShow', +'TheIllusion', +'SniperGotYou', +'IAMTHEREAPER', +'RapidCrocs', +'Recoilboomerang0101', +'UnderMeYourDead', +'Dodger2point0', +'ChromeIsHere', +'RockYourDead', +'UnDeadAlive', +'PushingHeaven19', +'CreekSalvatore', +'IntoTheAbyss', +'Fighter0Jack', +'TheGreatAlex', +'ParanoiaSyndicate', +'TrumpOnTwos', +'WitchingHour', +'MondayGUNS', +'NinjaTrick', +'ShaolinKingFu', +'TheORacle', +'KitEnchanted', +'NoNoob', +'BeatMEdead', +'HelloCREEP', +'DieOrBye', +'Orbit1567', +'THEsun20', +'BlueTears', +'GameTruce76', +'Iamchaakra', +'BorgCollective', +'CullingCard', +'TheFinalCountdown', +'SeekNDstroy', +'Bulletz4Breakfast', +'BigDamnHero', +'LaidtoRest', +'IronMAN77', +'Xenomorphing', +'TylerDurden', +'PennywiseTheClown', +'BluntMachete', +'SniperLyfe', +'SilentWraith', +'BloodyAssault', +'FightClubAlum', +'KillSwitch', +'ExecuteElectrocute', +'BadBaneCat', +'IndominusRexxx', +'AzogtheDefiler', +'ALeperMessiah', +'ALtEREvil', +'AnimeReaper05', +'Apocalypse3434', +'ArcticBlade', +'AssassinReject', +'AtomicKnuckles', +'atomsmasher13', +'BaseKillerWolf', +'Beasthunt', +'BestGamerPeriod', +'BigBlueCheese', +'BigMastadon', +'BoooDave', +'BrooklynSpartan', +'Brownstone80', +'BulletStormSunday', +'Chuckatommy', +'ColdSystem', +'ComeSweetDeath', +'ConmanCometh', +'CosmicFunkSquad', +'CuddlyPervert', +'CunningLynguist', +'Daemonocracy', +'DeadMonkeyz', +'Devilsreject7', +'Easy R1der', +'EliteCommandoV3', +'ElitistBastard', +'EvilTrance', +'FarewellToKings', +'FearlessScorpio', +'FutureZombie', +'Hardly Danger', +'HomelessPower', +'IceColdCash', +'IllegalPete', +'SoulessImperator', +'JediAnnihilator', +'KindaHomicidal', +'KlownFaceKilla', +'kronosaurus', +'LawOfTheStreets', +'LtCommanderWorf', +'MaliciousMutant', +'ManBEarPiG1019', +'MassiveVoid', +'MortalMonkey', +'MostHaunted', +'MrVengeance81', +'Nanosoldier123', +'NeptunePirate', +'PFCbulletsponge', +'PheonixAlcander', +'PiddleMinger', +'PocketMobsters', +'ProteusZero', +'RainbowSeven', +'Reanimator', +'RecoveryShinobi', +'Red Testament', +'Savage Palooka', +'Secret System', +'SweDishMaid', +'ThePenetrator', +'TheGreatWisecow', +'TheJDM Monkey', +'TheNameless24', +'ThePhoenix1906', +'TheRealSkywolf', +'TheSwissNavy', +'Combustion', +'SerratedHeadJuicer', +'DemonDean', +'BadCastiel', +'SabertoothHook', +'UnanimousSniper', +'UnseenWarfare', +'Ninjasharkman', +'ShittinBullets89', +'TornadoArtillery', +'TheRedShadow', +'RedAllegiance', +'SLEEPING GlANT', +'SeeUInTheFuture', +'SereneSavage', +'Shadowkiller98', +'ShOcKw4vE', +'SONOFJIGSAW', +'Spawn99', +'SnappingCobra', +'SomewhatDamaged', +'SweetAngryJesus', +'Time2KillSum1', +'HellTransporter', +'LucifersVeins', +'FlameThrower', +'PoisonMarket', +'Popups4Life', +'PornoDetective', +'SavageStreak', +'Saves7heDay', +'ArtilleryHotline', +'TheDreamingVoid', +'Redviper101', +'Sarcasticfolly', +'RandomPolishGuy', +'TheGamingGod1', +'PortableRedRhinoArtillery', +'ZombiesNightOut', +'IFillCoffins', +'StinkpotForHire', +'HarmonicDeath', +'RedLiquidShrapnel', +'DesertHope', +'HurtSlinger', +'TriggermanJoe', +'ExplodingArtillery', +'DeathGiveaway', +'ExplodingSpleen', +'BrutalHopeShooter', +'OmegaFirearm', +'SilverStoneGunner', +'CaptainRedWater', +'RodOfMoses', +'SolarPhantom', +'NoBodyWho', +'WhoWasThat', +'NoEscape', +'Alpha007', +'FearMe0917', +'MasterBeast', +'CableNutx', +'PonyCloud', +'Unicorns25', +'xOGirlmania', +'GirlClubs', +'ShotHottie', +'MsPiggysRevenge', +'CutiePatootie', +'BlueberryMuffins', +'SexyShooter', +'LadyStepMurder', +'IKissedCupid', +'RomanticTorpedo', +'HottieHottieMuffins', +'PinkPristineArtillery', +'MadBabyMaker', +'PistolPrincess', +'SuperGurl3000', +'GlitterGunner', +'PurpleBunnySlippers', +'ImTheBirthdayGirl', +'SmittenKitten66', +'SniperPrincess', +'TiaraONtop', +'GunnerrGurrl', +'SevenofNine', +'CandyStripper', +'SmokinHotChick', +'BitchWhoDontMiss', +'LilianaVess', +'Forboding Angel', +'Unforboding Angel', +'notDamgam', +'YourMom', +'Boi', +'Uncommon Player', +'Random Bot 1', +'RoboDestroyer69', +'Hi', +'YouAreDead', +'Scary le Poo', +'DooDoo', +'Zoptop', +'LeaveBAAloneNoob', +'BattleRoyalePro', +'SuppyBoi', +'HungryHamster', +'Nani', +'Hello World', + } + local namelistChicken = namelist + + local takenNames = {} + local takenNamesChicken = {} + + function getName(teamID, chicken) + local aiName + if chicken then + aiName = namelistChicken[math.random(1,#namelistChicken)] + else + aiName = namelist[math.random(1,#namelist)] + end + if chicken and takenNamesChicken[aiName] == nil then + takenNamesChicken[aiName] = teamID + return aiName + elseif not chicken and takenNames[aiName] == nil then + takenNames[aiName] = teamID + return aiName + else + return getName(teamID, chicken) + end + end + + function gadget:Initialize() + local t = Spring.GetTeamList() + for _,teamID in ipairs(t) do + if select(4,Spring.GetTeamInfo(teamID)) then -- is AI? + Spring.SetGameRulesParam('ainame_'..teamID, getName(teamID, string.find(Spring.GetTeamLuaAI(teamID) or '', "Chicken:"))) + end + end + gadgetHandler:RemoveGadget(self) + end +end diff --git a/LuaRules/Gadgets/ai_resource_multiplier.lua b/LuaRules/Gadgets/ai_resource_multiplier.lua new file mode 100644 index 000000000..9bde753eb --- /dev/null +++ b/LuaRules/Gadgets/ai_resource_multiplier.lua @@ -0,0 +1,173 @@ +function gadget:GetInfo() + return { + name = "AI Resource Multiplier", -- reclaim excluded + given units excluded + filters units with insignificant production + emp'd units still included + desc = "", + author = "Floris", + date = "September 2018", + license = "GPL", + layer = 1, + enabled = false + } +end + +local timedResBonusMultiplier = 0.00020 +local timedResBonusMultiplierMax = 2 + + +if (not gadgetHandler:IsSyncedCode()) then + return -- No Unsynced +end + +local aiResourceMultiplier = tonumber(Spring.GetModOptions().ai_incomemultiplier) or 1 + +if timedResBonusMultiplier == 0 and aiResourceMultiplier == 1 then + return +end + +local aiTeams = {} +local aiCount = 0 +for _,teamID in ipairs(Spring.GetTeamList()) do + if select(4,Spring.GetTeamInfo(teamID,false)) then -- is AI? + aiCount = aiCount + 1 + aiTeams[teamID] = { energy = 0, metal = 0, winds = 0, mexes = {} } + --aiCountEResMultiplier = aiCount*0.2 + 0.8 + --aiCountMResMultiplier = aiCount*0.1 + 0.9 + end +end +if aiCount == 0 then + return +end + +local ecoUnitsDefs = {} +local energyUnitDefs = {} +local windUnitDefs = {} +local metalUnitDefs = {} +local mexUnitDefs = {} +local aiGiftedUnits = {} +local newMexes = {} + +local spGetUnitResources = Spring.GetUnitResources + +function gadget:UnitGiven(uID, uDefID, uTeam) + if aiTeams[uTeam] and ecoUnitsDefs[uDefID] then + aiGiftedUnits[uID] = true + end +end + +function gadget:UnitFinished(uID, uDefID, uTeam, builderID) + if aiTeams[uTeam] and ecoUnitsDefs[uDefID] and not aiGiftedUnits[uID] then + if windUnitDefs[uDefID] then + aiTeams[uTeam].winds = aiTeams[uTeam].winds + 1 + end + if mexUnitDefs[uDefID] then + newMexes[uID] = {Spring.GetGameFrame() + 30, uTeam} -- unfortunately mex produces nothing yet so we have to scedule it + end + if energyUnitDefs[uDefID] then + aiTeams[uTeam].energy = aiTeams[uTeam].energy + energyUnitDefs[uDefID] + end + if metalUnitDefs[uDefID] then + aiTeams[uTeam].metal = aiTeams[uTeam].metal + metalUnitDefs[uDefID] + end + end +end + +function gadget:UnitDestroyed(uID, uDefID, uTeam) + if aiTeams[uTeam] and ecoUnitsDefs[uDefID] then + if aiGiftedUnits[uID] then + aiGiftedUnits[uID] = nil + else + if newMexes[uID] then + newMexes[uID] = nil + end + if windUnitDefs[uDefID] then + aiTeams[uTeam].winds = aiTeams[uTeam].winds - 1 + end + if mexUnitDefs[uDefID] and aiTeams[uTeam].mexes[uID] then + aiTeams[uTeam].metal = aiTeams[uTeam].metal - aiTeams[uTeam].mexes[uID] + aiTeams[uTeam].mexes[uID] = nil + end + if energyUnitDefs[uDefID] then + aiTeams[uTeam].energy = aiTeams[uTeam].energy - energyUnitDefs[uDefID] + end + if metalUnitDefs[uDefID] then + aiTeams[uTeam].metal = aiTeams[uTeam].metal - metalUnitDefs[uDefID] + end + end + end +end + +function gadget:Initialize() + for uDefID,def in ipairs(UnitDefs) do + if def.energyMake >= 10 then -- filter insignificant production to save some performance + energyUnitDefs[uDefID] = def.energyMake + ecoUnitsDefs[uDefID] = true + end + if def.energyUpkeep < 0 then + energyUnitDefs[uDefID] = -def.energyUpkeep + ecoUnitsDefs[uDefID] = true + end + if def.windGenerator > 0 then + windUnitDefs[uDefID] = true + ecoUnitsDefs[uDefID] = true + end + if def.metalMake >= 0.1 then -- filter insignificant production to save some performance + metalUnitDefs[uDefID] = def.metalMake + ecoUnitsDefs[uDefID] = true + end + if def.extractsMetal > 0 then + mexUnitDefs[uDefID] = def.extractsMetal + ecoUnitsDefs[uDefID] = true + end + if ecoUnitsDefs[uDefID] then + for teamID,_ in pairs(aiTeams) do + aiTeams[teamID][uDefID] = 0 + end + end + end + if Spring.GetGameFrame() > 0 then -- in case of a luarules reload + for teamID,_ in pairs(aiTeams) do + local teamUnits = Spring.GetTeamUnitsSorted(teamID) + for uDefID, units in pairs(teamUnits) do + if type(units) == 'table' then + for _, unitID in pairs(units) do + if select(5,Spring.GetUnitHealth(unitID)) >= 1 then + gadget:UnitFinished(unitID, uDefID, teamID) + end + end + end + end + end + end +end + + +function gadget:GameFrame(n) + + if n % 30 == 1 then + + -- a just finished mex doesnt produce metal yet so we sceduled it + for uID,params in pairs(newMexes) do + if n > params[1] then + aiTeams[params[2]].mexes[uID] = select(1,spGetUnitResources(uID)) + aiTeams[params[2]].metal = aiTeams[params[2]].metal + aiTeams[params[2]].mexes[uID] + newMexes[uID] = nil + end + end + + local timedResBonus = (n / 30) * timedResBonusMultiplier + if timedResBonus > timedResBonusMultiplierMax then + timedResBonus = timedResBonusMultiplierMax + end + + local currentWind = string.format('%.1f', select(4,Spring.GetWind())) + for TeamID, aiRes in pairs(aiTeams) do + local totalEnergy = aiRes.energy + (aiRes.winds * currentWind) + local totalMetal = aiRes.metal + + --Spring.Echo(totalEnergy..' + '..((totalEnergy * (aiResourceMultiplier + timedResBonus)) - totalEnergy)) + --Spring.Echo(totalMetal..' + '..((totalMetal * (aiResourceMultiplier + timedResBonus)) - totalMetal)) + Spring.AddTeamResource(TeamID,"e", (totalEnergy * (aiResourceMultiplier + timedResBonus)) - totalEnergy) + Spring.AddTeamResource(TeamID,"m", (totalMetal * (aiResourceMultiplier + timedResBonus)) - totalMetal) + end + end +end diff --git a/LuaRules/Gadgets/ai_scav_blueprint_generator.lua b/LuaRules/Gadgets/ai_scav_blueprint_generator.lua new file mode 100644 index 000000000..cfa2cc11b --- /dev/null +++ b/LuaRules/Gadgets/ai_scav_blueprint_generator.lua @@ -0,0 +1,92 @@ +function gadget:GetInfo() + return { + name = "Scavenger Blueprint Generator", + desc = "AAA", + author = "Damgam", + date = "2020", + license = "who cares?", + layer = 0, + enabled = true, --enabled by default + } +end + +centerposx = {} +centerposz = {} +centerposy = {} +blueprintposx = 0 +blueprintposz = 0 + +if gadgetHandler:IsSyncedCode() then + -- do gadgetry here + +else + function gadget:GotChatMsg(msg, playerID) + if msg == "scavblp" then + local selectedunits = Spring.GetSelectedUnits() + GetBlueprintCenter() + Spring.Echo(" ") + Spring.Echo("Constructor Blueprint: ") + for i = 1,#selectedunits do + GenerateBlueprint1(selectedunits[i]) + --Spring.Echo("UnitID"..i..": "..selectedunits[i]) + end + Spring.Echo(" ") + Spring.Echo("Spawner Blueprint: ") + for i = 1,#selectedunits do + GenerateBlueprint2(selectedunits[i]) + --Spring.Echo("UnitID"..i..": "..selectedunits[i]) + end + Spring.Echo(" ") + Spring.Echo("Useless Echos to make sure whole thing land in infolog: ") + Spring.Echo("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + Spring.Echo("i think that's enough... Blueprint Created") + ClearValues() + end + end + + function GenerateBlueprint1(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + local unitDefName = UnitDefs[unitDefID].name + local unitIDFacing = Spring.GetUnitBuildFacing(unitID) + local posx = math.ceil(centerposx[unitID]-blpcenterpositionx) + local posz = math.ceil(centerposz[unitID]-blpcenterpositionz) + local queuethisshit = [["shift"]] + + -- Spring.GiveOrderToUnit(scav, -(UDN.cornanotc_scav.id), {posx-96, posy, posz-48, 0}, {"shift"}) + Spring.Echo("Spring.GiveOrderToUnit(scav, -(UDN."..unitDefName.."_scav.id), {posx+("..posx.."), posy, posz+("..posz.."), "..unitIDFacing.."}, {"..queuethisshit.."})") + + end + function GenerateBlueprint2(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + local unitDefName = UnitDefs[unitDefID].name + local unitIDFacing = Spring.GetUnitBuildFacing(unitID) + local posx = math.ceil(centerposx[unitID]-blpcenterpositionx) + local posz = math.ceil(centerposz[unitID]-blpcenterpositionz) + local unitDefNameString = [["]] + + -- Spring.CreateUnit("corrad"..nameSuffix, posx, posy, posz, math.random(0,3),GaiaTeamID) + Spring.Echo("Spring.CreateUnit("..unitDefNameString..unitDefName..unitDefNameString.."..nameSuffix, posx+("..posx.."), posy, posz+("..posz.."), "..unitIDFacing..",GaiaTeamID)") + + end + + function GetBlueprintCenter() + local selectedunits = Spring.GetSelectedUnits() + for i = 1,#selectedunits do + local unit = selectedunits[i] + centerposx[unit], centerposy[unit], centerposz[unit] = Spring.GetUnitPosition(unit) + blueprintposx = blueprintposx + centerposx[unit] + blueprintposz = blueprintposz + centerposz[unit] + end + blpcenterpositionx = blueprintposx/#selectedunits + blpcenterpositionz = blueprintposz/#selectedunits + end + + function ClearValues() + blueprintposx = 0 + blueprintposz = 0 + centerposx = {} + centerposy = {} + centerposz = {} + end +end + diff --git a/LuaRules/Gadgets/ai_scav_loader.lua b/LuaRules/Gadgets/ai_scav_loader.lua new file mode 100644 index 000000000..a7644d947 --- /dev/null +++ b/LuaRules/Gadgets/ai_scav_loader.lua @@ -0,0 +1,130 @@ +local enabled = false +local scavengersEnabled = false +local teams = Spring.GetTeamList() +for i = 1,#teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 12) == 'ScavengersAI' then + scavengersAIEnabled = true + scavengerAITeamID = i - 1 + break + end +end +if scavengersAIEnabled or (Spring.GetModOptions and (tonumber(Spring.GetModOptions().scavengers) or 0) ~= 0) then + enabled = true +end + +function gadget:GetInfo() + return { + name = "loader for Scavenger mod", + desc = "123", + author = "Damgam", + date = "2019", + layer = -100, + enabled = enabled, + } +end + + +function gadget:GameOver() + gadgetHandler:RemoveGadget(self) +end + +if not gadgetHandler:IsSyncedCode() then + + local isSpec = Spring.GetSpectatingState() + local myTeamID = Spring.GetMyTeamID() + local myPlayerID = Spring.GetMyPlayerID() + local myAllyTeamID = Spring.GetMyAllyTeamID() + function gadget:PlayerChanged(playerID) + isSpec = Spring.GetSpectatingState() + myTeamID = Spring.GetMyTeamID() + myPlayerID = Spring.GetMyPlayerID() + myAllyTeamID = Spring.GetMyAllyTeamID() + end + + function SendMessage(_,msg) + if tonumber(Spring.GetConfigInt("scavmessages",1) or 1) == 1 then + if Script.LuaUI("GadgetAddMessage") then + Script.LuaUI.GadgetAddMessage(msg) + end + end + end + function SendNotification(_,msg) + if tonumber(Spring.GetConfigInt("scavmessages",1) or 1) == 1 then + if Script.LuaUI("EventBroadcast") then + Script.LuaUI.EventBroadcast("SoundEvents "..msg.." "..myPlayerID) + end + end + end + + local addedNotifications = false + function addNotifications() + if Script.LuaUI("AddNotification") then + addedNotifications = true + local unlisted = true -- prevent these notifications showing in the game settings notifications tab + + -- ID, file.wav, timeout time, exact duration of the .wav, written message, is unlisted? + Script.LuaUI.AddNotification('scav_scavcomdetected', 'scavengers/scavcomdetected.wav', 20, 1.87, "Scavenger commander detected.", unlisted) + Script.LuaUI.AddNotification('scav_unidentifiedObjectsDetected', 'scavengers/unidentifiedObjectsDetected.wav', 999999, 3.7, "Unidentified objects have been detected in the vicinity...", unlisted) + Script.LuaUI.AddNotification('scav_classifiedAsScavengers', 'scavengers/classifiedAsScavengers.wav', 999999, 3.87, "Unidentified objects are now classified as Scavengers.", unlisted) + Script.LuaUI.AddNotification('scav_scavadditionalcomdetected', 'scavengers/scavadditionalcomdetected.wav', 20, 3.14, "An additional Scavenger Commander detected.", unlisted) + Script.LuaUI.AddNotification('scav_scavanotherscavcomdetected', 'scavengers/scavanotherscavcomdetected.wav', 20, 3.3, "Another Scavenger Commander detected in the area.", unlisted) + Script.LuaUI.AddNotification('scav_scavnewcomentered', 'scavengers/scavnewcomentered.wav', 20, 2.94, "New Scavenger Commander entered this location.", unlisted) + Script.LuaUI.AddNotification('scav_scavcomspotted', 'scavengers/scavcomspotted.wav', 20, 2.82, "An extra Scavenger Commander has been spotted.", unlisted) + Script.LuaUI.AddNotification('scav_scavcomnewdetect', 'scavengers/scavcomnewdetect.wav', 20, 1.89, "New Scav Commander detected.", unlisted) + Script.LuaUI.AddNotification('scav_droppodsDetectedInArea', 'scavengers/droppodsDetectedInArea.wav', 20, 1.43, "Scavenger Droppods detected in the area.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinalattack', 'scavengers/scavfinalattack.wav', 20, 4.8, "Scavengers are unleashing all they have. Their final assault has started.", unlisted) + Script.LuaUI.AddNotification('scav_droppingUnits', 'scavengers/droppingUnits.wav', 20, 3.31, "Scavengers are dropping units in our area.", unlisted) + + Script.LuaUI.AddNotification('scav_scavfinalvictory', 'scavengers/scavfinalvictory.wav', 20, 10.5, "Good work commander. You survived all scavenger attacks. You are victorius! Celebrate and then try and annihilate them on the next map.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal12remain', 'scavengers/scavfinal12remain.wav', 20, 3.93, "12.5 minutes remaining. Still a long fight ahead.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal10remain', 'scavengers/scavfinal10remain.wav', 20, 1.49, "10 minutes remaining.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal09remain', 'scavengers/scavfinal09remain.wav', 20, 2.7, "9 minutes remaining. Hold your line.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal08remain', 'scavengers/scavfinal08remain.wav', 20, 1.43, "8 minutes remaining.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal07remain', 'scavengers/scavfinal07remain.wav', 20, 3.6, "Still 7 minutes remaining. Fight your way through them.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal06remain', 'scavengers/scavfinal06remain.wav', 20, 1.67, "6 minutes remaining.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal05remain', 'scavengers/scavfinal05remain.wav', 20, 1.47, "5 minutes remaining. You are almost there.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal04remain', 'scavengers/scavfinal04remain.wav', 20, 1.44, "Only 4 minutes remaining.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal03remain', 'scavengers/scavfinal03remain.wav', 20, 1.44, "3 minute mark.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal02remain', 'scavengers/scavfinal02remain.wav', 20, 1.82, "Only 2 minutes remaining.", unlisted) + Script.LuaUI.AddNotification('scav_scavfinal01remain', 'scavengers/scavfinal01remain.wav', 20, 1.43, "1 minute remaining.", unlisted) + + Script.LuaUI.AddNotification('scav_scavheavyairdetected', 'scavengers/scavheavyairdetected.wav', 20, 3, "", unlisted) -- "Danger... high tech aircraft detected." + Script.LuaUI.AddNotification('scav_scavbossdetected', 'scavengers/scavbossdetected.wav', 20, 8.45, "Critical danger! Scavengers have dropped a highly lethal boss unit in the area, destroy it before it reaches your base.", unlisted) + Script.LuaUI.AddNotification('scav_scavtech3', 'scavengers/scavtech3.wav', 20, 5.34, "", unlisted) + Script.LuaUI.AddNotification('scav_scavtech3b', 'scavengers/scavtech3b.wav', 20, 5.2, "", unlisted) + Script.LuaUI.AddNotification('scav_scavtech3c', 'scavengers/scavtech3c.wav', 20, 5.14, "", unlisted) + Script.LuaUI.AddNotification('scav_scavtech3d', 'scavengers/scavtech3d.wav', 20, 4.67, "", unlisted) + Script.LuaUI.AddNotification('scav_scavtech3e', 'scavengers/scavtech3e.wav', 20, 3.18, "", unlisted) + Script.LuaUI.AddNotification('scav_scavheavyshipsdetected', 'scavengers/scavheavyshipsdetected.wav', 20, 3.28, "Alert. Heavy ships detected in the area.", unlisted) + --Script.LuaUI.AddNotification('scav_', 'scavengers/.wav', 20, 3, "", unlisted) + + end + end + + function gadget:Initialize() + gadgetHandler:AddSyncAction("SendMessage", SendMessage) + gadgetHandler:AddSyncAction("SendNotification", SendNotification) + + addNotifications() + end + + function gadget:Update() + if not addedNotifications then + addNotifications() + end + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("SendMessage") + gadgetHandler:RemoveSyncAction("SendNotification") + end + + +else + + if enabled then + VFS.Include('luarules/gadgets/scavengers/boot.lua') + end + +end \ No newline at end of file diff --git a/LuaRules/Gadgets/ai_simpleai.lua b/LuaRules/Gadgets/ai_simpleai.lua new file mode 100644 index 000000000..7ab3bca34 --- /dev/null +++ b/LuaRules/Gadgets/ai_simpleai.lua @@ -0,0 +1,670 @@ +local enabled = false +local teams = Spring.GetTeamList() +local SimpleAITeamIDs = {} +local SimpleAITeamIDsCount = 0 +local SimpleCheaterAITeamIDs = {} +local SimpleCheaterAITeamIDsCount = 0 +local UDN = UnitDefNames +local wind = Game.windMax +local mapsizeX = Game.mapSizeX +local mapsizeZ = Game.mapSizeZ + +local gameShortName = Game.gameShortName + +-- team locals +SimpleFactoriesCount = {} +SimpleFactories = {} +SimpleT1Mexes = {} +SimpleFactoryDelay = {} + +for i = 1, #teams do + local teamID = teams[i] + local luaAI = Spring.GetTeamLuaAI(teamID) + if luaAI and luaAI ~= "" and (string.sub(luaAI, 1, 8) == 'SimpleAI' or string.sub(luaAI, 1, 15) == 'SimpleCheaterAI' or string.sub(luaAI, 1, 16) == 'SimpleDefenderAI' or string.sub(luaAI, 1, 19) == 'SimpleConstructorAI') then + enabled = true + SimpleAITeamIDsCount = SimpleAITeamIDsCount + 1 + SimpleAITeamIDs[SimpleAITeamIDsCount] = teamID + + SimpleFactoriesCount[teamID] = 0 + SimpleFactories[teamID] = {} + SimpleT1Mexes[teamID] = 0 + SimpleFactoryDelay[teamID] = 0 + + if string.sub(luaAI, 1, 15) == 'SimpleCheaterAI' or string.sub(luaAI, 1, 16) == 'SimpleDefenderAI' or string.sub(luaAI, 1, 19) == 'SimpleConstructorAI' then + SimpleCheaterAITeamIDsCount = SimpleCheaterAITeamIDsCount + 1 + SimpleCheaterAITeamIDs[SimpleCheaterAITeamIDsCount] = teamID + end + end +end + +function gadget:GetInfo() + return { + name = "SimpleAI", + desc = "123", + author = "Damgam", + date = "2020", + layer = -100, + enabled = enabled, + } +end + +-------- lists +BadUnitsList = {} +if gameShortName == "BYAR" then + BadUnitsList = { + -- transports + "armthovr", + "corthovr", + "armatlas", + "armtship", + "corvalk", + "cortship", + "armdfly", + "corseah", + "corint", + + -- stockpilers + "armscab", + "armemp", + "armjuno", + "armamd", + "armmercury", + "armsilo", + "armcarry", + "corfmd", + "corjuno", + "corscreamer", + "corsilo", + "cortron", + "corcarry", + "cormabm", + + -- minelayers + "armmlv", + "cormlv", + + -- depth charge launchers + "armdl", + "cordl", + + -- walls + "armdrag", + "cordrag", + } +end + +if gameShortName == "EvoRTS" then + BadUnitsList = {} +end + +local BadUnitDefs = {} +local SimpleCommanderDefs = {} +local SimpleFactoriesDefs = {} +local SimpleConstructorDefs = {} +local SimpleExtractorDefs = {} +local SimpleGeneratorDefs = {} +local SimpleConverterDefs = {} +local SimpleTurretDefs = {} +local SimpleUndefinedBuildingDefs = {} +local SimpleUndefinedUnitDefs = {} + +for unitDefID, unitDef in pairs(UnitDefs) do + BadUnitDef = false + for a = 1,#BadUnitsList do + if BadUnitsList[a] == unitDef.name then + BadUnitDef = true + break + else + BadUnitDef = false + end + end + if BadUnitDef == false then + if unitDef.name == "armcom" or unitDef.name == "corcom" or unitDef.name == "armdecom" or unitDef.name == "cordecom" then + SimpleCommanderDefs[#SimpleCommanderDefs + 1] = unitDefID + elseif unitDef.isFactory and #unitDef.buildOptions > 0 then + SimpleFactoriesDefs[#SimpleFactoriesDefs + 1] = unitDefID + elseif unitDef.canMove and unitDef.isBuilder and #unitDef.buildOptions > 0 then + SimpleConstructorDefs[#SimpleConstructorDefs + 1] = unitDefID + elseif unitDef.extractsMetal > 0 or (unitDef.customParams and unitDef.customParams.metal_extractor) then + SimpleExtractorDefs[#SimpleExtractorDefs + 1] = unitDefID + elseif (unitDef.energyMake > 19 and (not unitDef.energyUpkeep or unitDef.energyUpkeep < 10)) or (unitDef.windGenerator > 0 and wind > 10) or unitDef.tidalGenerator > 0 or (unitDef.customParams and unitDef.customParams.solar) then + SimpleGeneratorDefs[#SimpleGeneratorDefs + 1] = unitDefID + elseif unitDef.customParams and unitDef.customParams.energyconv_capacity and unitDef.customParams.energyconv_efficiency then + SimpleConverterDefs[#SimpleConverterDefs + 1] = unitDefID + elseif unitDef.isBuilding and #unitDef.weapons > 0 then + SimpleTurretDefs[#SimpleTurretDefs + 1] = unitDefID + + + elseif not unitDef.canMove then + SimpleUndefinedBuildingDefs[#SimpleUndefinedBuildingDefs + 1] = unitDefID + else + SimpleUndefinedUnitDefs[#SimpleUndefinedUnitDefs + 1] = unitDefID + end + end +end + +-------- functions + +local function SimpleGetClosestMexSpot(x, z) + local bestSpot + local bestDist = math.huge + local metalSpots = GG.metalSpots + if metalSpots then + for i = 1, #metalSpots do + local spot = metalSpots[i] + local dx, dz = x - spot.x, z - spot.z + local dist = dx * dx + dz * dz + local units = Spring.GetUnitsInCylinder(spot.x, spot.z, 128) + --local height = Spring.GetGroundHeight(spot.x, spot.z) + if dist < bestDist and #units == 0 then + --and height > 0 then + bestSpot = spot + bestDist = dist + end + end + end + return bestSpot +end + +local function SimpleBuildOrder(cUnitID, building) + searchRange = 0 + for b2 = 1,20 do + searchRange = searchRange + 300 + local team = Spring.GetUnitTeam(cUnitID) + local cunitposx, _, cunitposz = Spring.GetUnitPosition(cUnitID) + local units = Spring.GetUnitsInCylinder(cunitposx, cunitposz, searchRange, team) + if #units > 1 then + local buildnear = units[math.random(1, #units)] + local refDefID = Spring.GetUnitDefID(buildnear) + local isBuilding = UnitDefs[refDefID].isBuilding + local isCommander = (UnitDefs[refDefID].name == "armcom" or UnitDefs[refDefID].name == "corcom") + local isExtractor = UnitDefs[refDefID].extractsMetal > 0 + if (isBuilding or isCommander) then-- and not isExtractor then + local refx, refy, refz = Spring.GetUnitPosition(buildnear) + local reffootx = UnitDefs[refDefID].xsize * 8 + local reffootz = UnitDefs[refDefID].zsize * 8 + local spacing = math.random(64, 128) + local testspacing = spacing * 0.75 + local buildingDefID = building + local r = math.random(0, 3) + if r == 0 then + local bposx = refx + local bposz = refz + reffootz + spacing + local bposy = Spring.GetGroundHeight(bposx, bposz)--+100 + local testpos = Spring.TestBuildOrder(buildingDefID, bposx, bposy, bposz, r) + local nearbyunits = Spring.GetUnitsInRectangle(bposx - testspacing, bposz - testspacing, bposx + testspacing, bposz + testspacing) + if testpos == 2 and #nearbyunits <= 0 then + Spring.GiveOrderToUnit(cUnitID, -buildingDefID, { bposx, bposy, bposz, r }, { "shift" }) + break + end + elseif r == 1 then + local bposx = refx + reffootx + spacing + local bposz = refz + local bposy = Spring.GetGroundHeight(bposx, bposz)--+100 + local testpos = Spring.TestBuildOrder(buildingDefID, bposx, bposy, bposz, r) + local nearbyunits = Spring.GetUnitsInRectangle(bposx - testspacing, bposz - testspacing, bposx + testspacing, bposz + testspacing) + if testpos == 2 and #nearbyunits <= 0 then + Spring.GiveOrderToUnit(cUnitID, -buildingDefID, { bposx, bposy, bposz, r }, { "shift" }) + break + end + elseif r == 2 then + local bposx = refx + local bposz = refz - reffootz - spacing + local bposy = Spring.GetGroundHeight(bposx, bposz)--+100 + local testpos = Spring.TestBuildOrder(buildingDefID, bposx, bposy, bposz, r) + local nearbyunits = Spring.GetUnitsInRectangle(bposx - testspacing, bposz - testspacing, bposx + testspacing, bposz + testspacing) + if testpos == 2 and #nearbyunits <= 0 then + Spring.GiveOrderToUnit(cUnitID, -buildingDefID, { bposx, bposy, bposz, r }, { "shift" }) + break + end + elseif r == 3 then + local bposx = refx - reffootx - spacing + local bposz = refz + local bposy = Spring.GetGroundHeight(bposx, bposz)--+100 + local testpos = Spring.TestBuildOrder(buildingDefID, bposx, bposy, bposz, r) + local nearbyunits = Spring.GetUnitsInRectangle(bposx - testspacing, bposz - testspacing, bposx + testspacing, bposz + testspacing) + if testpos == 2 and #nearbyunits <= 0 then + Spring.GiveOrderToUnit(cUnitID, -buildingDefID, { bposx, bposy, bposz, r }, { "shift" }) + break + end + end + end + --local buildingDefID = UnitDefNames.building.id + --local testpos = Spring.TestBuildOrder(buildingDefID, bposx, bposy, bposz, facing) + end + end +end + +local function SimpleConstructionProjectSelection(unitID, unitDefID, unitName, unitTeam, allyTeamID, units, allunits, type) + success = false + + local mcurrent, mstorage, _, mincome, mexpense = Spring.GetTeamResources(unitTeam, "metal") + local ecurrent, estorage, _, eincome, eexpense = Spring.GetTeamResources(unitTeam, "energy") + local unitposx, unitposy, unitposz = Spring.GetUnitPosition(unitID) + + local unitCommands = Spring.GetCommandQueue(unitID, 0) + local buildOptions = UnitDefs[unitDefID].buildOptions + -- Builders + for b1 = 1,10 do + if type == "Builder" or type == "Commander" then + SimpleFactoryDelay[unitTeam] = SimpleFactoryDelay[unitTeam]-1 + local r = math.random(0, 20) + local mexspotpos = SimpleGetClosestMexSpot(unitposx, unitposz) + if (mexspotpos and SimpleT1Mexes[unitTeam] < 3) and type == "Commander" then + local project = SimpleExtractorDefs[math.random(1, #SimpleExtractorDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + Spring.GiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) + --Spring.Echo("Success! Project Type: Extractor.") + success = true + break + end + end + elseif ecurrent < estorage * 0.75 or r == 0 then + local project = SimpleGeneratorDefs[math.random(1, #SimpleGeneratorDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Generator.") + success = true + break + end + end + + elseif mcurrent < mstorage * 0.30 or r == 1 then + -- if type == "Commander" then + -- for t = 1,10 do + -- local targetUnit = units[math.random(1,#units)] + -- if UnitDefs[Spring.GetUnitDefID(targetUnit)].isBuilding == true then + -- local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + -- Spring.GiveOrderToUnit(unitID, CMD.MOVE, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, { "shift", "alt", "ctrl" }) + -- success = true + -- break + -- end + -- end + -- elseif + if (not mexspotpos) and (ecurrent > estorage * 0.85 or r == 1) then + local project = SimpleConverterDefs[math.random(1, #SimpleConverterDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Converter.") + success = true + break + end + end + elseif mexspotpos then + local project = SimpleExtractorDefs[math.random(1, #SimpleExtractorDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + Spring.GiveOrderToUnit(unitID, -project, { mexspotpos.x, mexspotpos.y, mexspotpos.z, 0 }, { "shift" }) + --Spring.Echo("Success! Project Type: Extractor.") + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x+100, mexspotpos.y, mexspotpos.z, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x-100, mexspotpos.y, mexspotpos.z, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x, mexspotpos.y, mexspotpos.z-100, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x, mexspotpos.y, mexspotpos.z-100, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x+100, mexspotpos.y, mexspotpos.z+100, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x-100, mexspotpos.y, mexspotpos.z+100, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x+100, mexspotpos.y, mexspotpos.z-100, math.random(0,3) }, { "shift" }) + break + end + end + for i3 = 1,50 do + local projectturret = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + if buildOptions[i3] == projectturret then + Spring.GiveOrderToUnit(unitID, -projectturret, { mexspotpos.x-100, mexspotpos.y, mexspotpos.z-100, math.random(0,3) }, { "shift" }) + break + end + end + success = true + break + end + end + + end + elseif r == 2 or r == 3 or r == 4 or r == 5 then + local project = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Turret.") + success = true + break + end + end + elseif SimpleFactoriesCount[unitTeam] < 1 or ((mcurrent > mstorage * 0.75 and ecurrent > estorage * 0.75) and SimpleFactoryDelay[unitTeam] <= 0) then + local project = SimpleFactoriesDefs[math.random(1, #SimpleFactoriesDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project and (not SimpleFactories[unitTeam][project]) then + SimpleBuildOrder(unitID, project) + SimpleFactoryDelay[unitTeam] = 30 + --Spring.Echo("Success! Project Type: Factory.") + success = true + break + end + end + elseif r == 11 then + for t = 1,10 do + local targetUnit = units[math.random(1,#units)] + if UnitDefs[Spring.GetUnitDefID(targetUnit)].isBuilding == true then + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, { "shift", "alt", "ctrl" }) + success = true + break + end + end + elseif r == 12 and type ~= "Commander" then + local mapcenterX = mapsizeX/2 + local mapcenterZ = mapsizeZ/2 + local mapcenterY = Spring.GetGroundHeight(mapcenterX, mapcenterZ) + local mapdiagonal = math.ceil(math.sqrt((mapsizeX*mapsizeX)+(mapsizeZ*mapsizeZ))) + Spring.GiveOrderToUnit(unitID, CMD.RECLAIM,{mapcenterX+math.random(-100,100),mapcenterY,mapcenterZ+math.random(-100,100),mapdiagonal}, 0) + success = true + elseif r == 13 and type ~= "Commander" then + local mapcenterX = mapsizeX/2 + local mapcenterZ = mapsizeZ/2 + local mapcenterY = Spring.GetGroundHeight(mapcenterX, mapcenterZ) + local mapdiagonal = math.ceil(math.sqrt((mapsizeX*mapsizeX)+(mapsizeZ*mapsizeZ))) + Spring.GiveOrderToUnit(unitID, CMD.REPAIR,{mapcenterX+math.random(-100,100),mapcenterY,mapcenterZ+math.random(-100,100),mapdiagonal}, 0) + success = true + else + local r2 = math.random(0, 1) + if r2 == 0 then + local project = SimpleUndefinedBuildingDefs[math.random(1, #SimpleUndefinedBuildingDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Other.") + success = true + break + end + end + else + local project = SimpleTurretDefs[math.random(1, #SimpleTurretDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + SimpleBuildOrder(unitID, project) + --Spring.Echo("Success! Project Type: Turret.") + success = true + break + end + end + end + end + elseif type == "Factory" then + if #Spring.GetFullBuildQueue(unitID, 0) < 5 then + local r = math.random(0, 5) + local luaAI = Spring.GetTeamLuaAI(unitTeam) + if r == 0 or string.sub(luaAI, 1, 19) == 'SimpleConstructorAI' then + local project = SimpleConstructorDefs[math.random(1, #SimpleConstructorDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + local x, y, z = Spring.GetUnitPosition(unitID) + Spring.GiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) + --Spring.Echo("Success! Project Type: Constructor.") + success = true + break + end + end + else + local project = SimpleUndefinedUnitDefs[math.random(1, #SimpleUndefinedUnitDefs)] + for i2 = 1,#buildOptions do + if buildOptions[i2] == project then + local x, y, z = Spring.GetUnitPosition(unitID) + Spring.GiveOrderToUnit(unitID, -project, { x, y, z, 0 }, 0) + --Spring.Echo("Success! Project Type: Unit.") + success = true + break + end + end + end + else + success = true + end + end + if success == true then + break + end + end +end + +function gadget:GameOver() + gadgetHandler:RemoveGadget(self) +end + +if gadgetHandler:IsSyncedCode() then + + function gadget:GameFrame(n) + if n % 15 == 0 then + for i = 1, SimpleAITeamIDsCount do + if n%(15*SimpleAITeamIDsCount) == 15*(i-1) then + local teamID = SimpleAITeamIDs[i] + local _, _, isDead, _, faction, allyTeamID = Spring.GetTeamInfo(teamID) + local mcurrent, mstorage, _, mincome, mexpense = Spring.GetTeamResources(teamID, "metal") + local ecurrent, estorage, _, eincome, eexpense = Spring.GetTeamResources(teamID, "energy") + for j = 1, #SimpleCheaterAITeamIDs do + if teamID == SimpleCheaterAITeamIDs[j] then + -- --cheats + if mcurrent < mstorage * 0.20 then + Spring.SetTeamResource(teamID, "m", mstorage * 0.25) + end + if ecurrent < estorage * 0.20 then + Spring.SetTeamResource(teamID, "e", estorage * 0.25) + end + end + end + + local units = Spring.GetTeamUnits(teamID) + local allunits = Spring.GetAllUnits() + for k = 1, #units do + local unitID = units[k] + local unitDefID = Spring.GetUnitDefID(unitID) + local unitName = UnitDefs[unitDefID].name + local unitTeam = teamID + local unitHealth, unitMaxHealth, _, _, unitBuildProgress = Spring.GetUnitHealth(unitID) + local unitMaxRange = Spring.GetUnitMaxRange(unitID) + local unitCommands = Spring.GetCommandQueue(unitID, 0) + local unitposx, unitposy, unitposz = Spring.GetUnitPosition(unitID) + --Spring.Echo(faction) + + --if faction == "arm" then + + -- builders + for u = 1, #SimpleCommanderDefs do + if unitDefID == SimpleCommanderDefs[u] then + local nearestEnemyCloak = Spring.GetUnitNearestEnemy(unitID, 2000, false) + if nearestEnemyCloak and ecurrent > 1000 then + Spring.GiveOrderToUnit(unitID, 37382, {1}, 0) + else + Spring.GiveOrderToUnit(unitID, 37382, {0}, 0) + end + + + local nearestEnemy = Spring.GetUnitNearestEnemy(unitID, 250, true) + local unitHealthPercentage = (unitHealth/unitMaxHealth)*100 + + if nearestEnemy and unitHealthPercentage > 30 then + if ecurrent < estorage*0.9 then + Spring.SetTeamResource(teamID, "e", estorage*0.9) + end + Spring.GiveOrderToUnit(unitID, CMD.DGUN, {nearestEnemy}, 0) + local nearestEnemies = Spring.GetUnitsInCylinder(unitposx, unitposz, 300) + for x = 1,#nearestEnemies do + local enemy = nearestEnemies[x] + if Spring.GetUnitTeam(enemy) == Spring.GetUnitTeam(nearestEnemy) and enemy ~= nearestEnemy then + Spring.GiveOrderToUnit(unitID, CMD.DGUN, {enemy}, {"shift"}) + end + end + Spring.GiveOrderToUnit(unitID, CMD.MOVE, {unitposx, unitposy, unitposz}, {"shift"}) + elseif nearestEnemy then + for x = 1,10 do + local targetUnit = units[math.random(1,#units)] + if UnitDefs[Spring.GetUnitDefID(targetUnit)].isBuilding == true then + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, 0) + break + end + end + end + end + end + + for u = 1, #SimpleConstructorDefs do + if unitDefID == SimpleConstructorDefs[u] then + local unitHealthPercentage = (unitHealth/unitMaxHealth)*100 + local nearestEnemy = Spring.GetUnitNearestEnemy(unitID, 500, true) + if nearestEnemy and unitHealthPercentage > 90 then + Spring.GiveOrderToUnit(unitID, CMD.RECLAIM, {nearestEnemy}, 0) + elseif nearestEnemy then + for x = 1,100 do + local targetUnit = units[math.random(1,#units)] + if UnitDefs[Spring.GetUnitDefID(targetUnit)].isBuilding == true then + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + Spring.GiveOrderToUnit(unitID, CMD.MOVE, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, 0) + break + end + end + end + end + end + + if unitCommands == 0 then + for u = 1, #SimpleConstructorDefs do + if unitDefID == SimpleConstructorDefs[u] then + SimpleConstructionProjectSelection(unitID, unitDefID, unitName, unitTeam, allyTeamID, units, allunits, "Builder") + break + end + end + for u = 1, #SimpleCommanderDefs do + if unitDefID == SimpleCommanderDefs[u] then + SimpleConstructionProjectSelection(unitID, unitDefID, unitName, unitTeam, allyTeamID, units, allunits, "Commander") + break + end + end + + for u = 1, #SimpleFactoriesDefs do + if unitDefID == SimpleFactoriesDefs[u] then + SimpleConstructionProjectSelection(unitID, unitDefID, unitName, unitTeam, allyTeamID, units, allunits, "Factory") + break + end + end + + -- army + + for u = 1, #SimpleUndefinedUnitDefs do + + if unitDefID == SimpleUndefinedUnitDefs[u] then + local luaAI = Spring.GetTeamLuaAI(teamID) + if string.sub(luaAI, 1, 16) == 'SimpleDefenderAI' then + for t = 1,10 do + local targetUnit = allunits[math.random(1,#allunits)] + if Spring.GetUnitAllyTeam(targetUnit) == allyTeamID then + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, { "shift", "alt", "ctrl" }) + break + end + end + else + local targetUnitNear = Spring.GetUnitNearestEnemy(unitID, 2000, false) + if targetUnitNear then + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnitNear) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, { "shift", "alt", "ctrl" }) + elseif n%3600 <= 15*SimpleAITeamIDsCount then + local targetUnit = Spring.GetUnitNearestEnemy(unitID, 999999, false) + local tUnitX, tUnitY, tUnitZ = Spring.GetUnitPosition(targetUnit) + Spring.GiveOrderToUnit(unitID, CMD.FIGHT, { tUnitX + math.random(-100, 100), tUnitY, tUnitZ + math.random(-100, 100) }, { "shift", "alt", "ctrl" }) + end + break + end + end + end + end + end + end + end + end + end + + function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) + local unitName = UnitDefs[unitDefID].name + for i = 1, SimpleAITeamIDsCount do + if SimpleAITeamIDs[i] == unitTeam then + for u = 1, #SimpleFactoriesDefs do + if unitDefID == SimpleFactoriesDefs[u] then + SimpleFactoriesCount[unitTeam] = SimpleFactoriesCount[unitTeam] + 1 + SimpleFactories[unitTeam][unitDefID] = true + break + end + end + for u = 1, #SimpleExtractorDefs do + if unitDefID == SimpleExtractorDefs[u] then + SimpleT1Mexes[unitTeam] = SimpleT1Mexes[unitTeam] + 1 + break + end + end + end + end + end + + function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) + local unitName = UnitDefs[unitDefID].name + for i = 1, SimpleAITeamIDsCount do + if SimpleAITeamIDs[i] == unitTeam then + for u = 1, #SimpleFactoriesDefs do + if unitDefID == SimpleFactoriesDefs[u] then + SimpleFactoriesCount[unitTeam] = SimpleFactoriesCount[unitTeam] - 1 + SimpleFactories[unitTeam][unitDefID] = nil + break + end + end + for u = 1, #SimpleExtractorDefs do + if unitDefID == SimpleExtractorDefs[u] then + SimpleT1Mexes[unitTeam] = SimpleT1Mexes[unitTeam] - 1 + break + end + end + end + end + end + + +end diff --git a/LuaRules/Gadgets/ai_supply_drops.lua b/LuaRules/Gadgets/ai_supply_drops.lua new file mode 100644 index 000000000..93f31f854 --- /dev/null +++ b/LuaRules/Gadgets/ai_supply_drops.lua @@ -0,0 +1,216 @@ +lootBoxSpawns = tonumber(Spring.GetModOptions().lootboxes) +if Spring.GetModOptions then + if lootBoxSpawns == nil or lootBoxSpawns == 1 then + lootboxSpawnEnabled = true + Spring.Echo("[Scavengers] Lootbox Spawns are Enabled") + elseif lootBoxSpawns == 0 then + lootboxSpawnEnabled = false + Spring.Echo("[Scavengers] Lootbox Spawns are Disabled") + end +else + lootboxSpawnEnabled = true + Spring.Echo("[Scavengers] Lootbox Spawns are Enabled") +end + +function gadget:GetInfo() + return { + name = "supply drops", + desc = "123", + author = "Damgam", + date = "2020", + layer = -100, + enabled = true, + } +end + +if (not gadgetHandler:IsSyncedCode()) then + return false +end + +local lootboxesListLow = { + "lootboxbronze", + "lootboxbronze", +} + +local lootboxesListMid = { + "lootboxbronze", + "lootboxbronze", + "lootboxsilver", +} + +local lootboxesListHigh = { + "lootboxbronze", + "lootboxbronze", + "lootboxbronze", + "lootboxsilver", + "lootboxsilver", + "lootboxsilver", + "lootboxgold", +} + +local lootboxesListTop = { + "lootboxsilver", + "lootboxsilver", + "lootboxsilver", + "lootboxsilver", + "lootboxsilver", + "lootboxgold", + "lootboxgold", + "lootboxgold", + "lootboxgold", + "lootboxplatinum", +} + + + + + + + +-- locals +local spGetUnitTeam = Spring.GetUnitTeam +local spNearestEnemy = Spring.GetUnitNearestEnemy +local spNearestAlly = Spring.GetUnitNearestAlly +local spSeparation = Spring.GetUnitSeparation +local spPosition = Spring.GetUnitPosition +local spTransfer = Spring.TransferUnit +local mapsizeX = Game.mapSizeX +local mapsizeZ = Game.mapSizeZ +local xBorder = math.floor(mapsizeX/5) +local zBorder = math.floor(mapsizeZ/5) +local math_random = math.random +local spGroundHeight = Spring.GetGroundHeight +local spGaiaTeam = Spring.GetGaiaTeamID() +local spCreateUnit = Spring.CreateUnit +local spGetCylinder = Spring.GetUnitsInCylinder + +local aliveLootboxes = {} +local aliveLootboxesCount = 0 + +local QueuedSpawns = {} +local QueuedSpawnsFrames = {} + + + + + + +-- functions + +local function QueueSpawn(unitName, posx, posy, posz, facing, team, frame) + local QueueSpawnCommand = {unitName, posx, posy, posz, facing, team} + local QueueFrame = frame + if #QueuedSpawnsFrames > 0 then + for i = 1, #QueuedSpawnsFrames do + local CurrentQueueFrame = QueuedSpawnsFrames[i] + if (not(CurrentQueueFrame < QueueFrame)) or i == #QueuedSpawnsFrames then + table.insert(QueuedSpawns, i, QueueSpawnCommand) + table.insert(QueuedSpawnsFrames, i, QueueFrame) + break + end + end + else + table.insert(QueuedSpawns, QueueSpawnCommand) + table.insert(QueuedSpawnsFrames, QueueFrame) + end +end + +local function SpawnFromQueue(n) + local QueuedSpawnsForNow = #QueuedSpawns + if QueuedSpawnsForNow > 0 then + for i = 1,QueuedSpawnsForNow do + if n == QueuedSpawnsFrames[1] then + local createSpawnCommand = QueuedSpawns[1] + spCreateUnit(QueuedSpawns[1][1],QueuedSpawns[1][2],QueuedSpawns[1][3],QueuedSpawns[1][4],QueuedSpawns[1][5],QueuedSpawns[1][6]) + table.remove(QueuedSpawns, 1) + table.remove(QueuedSpawnsFrames, 1) + else + break + end + end + end +end + + + + + + +-- callins + +function gadget:GameFrame(n) + if n > 1 then + SpawnFromQueue(n) + end + + if n%30 == 0 and n > 2 then + + if #aliveLootboxes > 0 then + for j = 1,#aliveLootboxes do + local unitID = aliveLootboxes[j] + local unitTeam = spGetUnitTeam(unitID) + local unitEnemy = spNearestEnemy(unitID, 384, false) + if unitEnemy then + local enemyTeam = spGetUnitTeam(unitEnemy) + --if enemyTeam ~= spGaiaTeam then + local posx, posy, posz = spPosition(unitID) + Spring.MarkerErasePosition(posx, posy, posz) + spTransfer(unitID, enemyTeam, false) + Spring.SetUnitNeutral(unitID, true) + --end + end + end + end + if math_random(0,300) == 0 and lootboxSpawnEnabled then + for k = 1,1000 do + local posx = math.floor(math_random(xBorder,mapsizeX-xBorder)/16)*16 + local posz = math.floor(math_random(zBorder,mapsizeZ-zBorder)/16)*16 + local posy = spGroundHeight(posx, posz) + local unitsCyl = spGetCylinder(posx, posz, 384) + if #unitsCyl == 0 then + --QueueSpawn("lootdroppod_gold", posx, posy, posz, math_random(0,3),spGaiaTeam, n) + --QueueSpawn(lootboxesList[math_random(1,#lootboxesList)], posx, posy, posz, math_random(0,3),spGaiaTeam, n+600) + if aliveLootboxesCount < 2 then + spCreateUnit(lootboxesListLow[math_random(1,#lootboxesListLow)], posx, posy, posz, math_random(0,3), spGaiaTeam) + --Spring.MarkerAddPoint(posx, posy, posz, "Resource Generator Detected", true) + elseif aliveLootboxesCount < 4 then + spCreateUnit(lootboxesListMid[math_random(1,#lootboxesListMid)], posx, posy, posz, math_random(0,3), spGaiaTeam) + --Spring.MarkerAddPoint(posx, posy, posz, "Resource Generator Detected", true) + elseif aliveLootboxesCount < 6 then + spCreateUnit(lootboxesListHigh[math_random(1,#lootboxesListHigh)], posx, posy, posz, math_random(0,3), spGaiaTeam) + --Spring.MarkerAddPoint(posx, posy, posz, "Resource Generator Detected", true) + else + spCreateUnit(lootboxesListTop[math_random(1,#lootboxesListTop)], posx, posy, posz, math_random(0,3), spGaiaTeam) + --Spring.MarkerAddPoint(posx, posy, posz, "Resource Generator Detected", true) + end + + break + end + end + end + end +end + + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + local unitName = UnitDefs[unitDefID].name + if string.find(unitName, "lootbox") then + table.insert(aliveLootboxes,unitID) + aliveLootboxesCount = aliveLootboxesCount + 1 + Spring.SetUnitNeutral(unitID, true) + end +end + + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + local unitName = UnitDefs[unitDefID].name + if string.find(unitName, "lootbox") then + for i = 1,#aliveLootboxes do + if unitID == aliveLootboxes[i] then + aliveLootboxesCount = aliveLootboxesCount - 1 + table.remove(aliveLootboxes,i) + break + end + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/api_custom_unit_shaders.lua b/LuaRules/Gadgets/api_custom_unit_shaders.lua new file mode 100644 index 000000000..7d8bfd450 --- /dev/null +++ b/LuaRules/Gadgets/api_custom_unit_shaders.lua @@ -0,0 +1,847 @@ +-- $Id$ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- author: jK +-- +-- Copyright (C) 2008,2009,2010. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "CustomUnitShaders", + desc = "allows to override the engine unit and feature shaders", + author = "jK, gajop", + date = "2008,2009,2010,2016", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Synced +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +if (gadgetHandler:IsSyncedCode()) then + return +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Unsynced +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if (not gl.CreateShader) then + return false +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +VFS.Include("luarules/utilities/unitrendering.lua", nil, VFS.ZIP) + +local LuaShader = VFS.Include("LuaRules/Gadgets/Include/LuaShader.lua") + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local MATERIALS_DIR = "ModelMaterials/" + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local shadows = false +local advShading = false +local normalmapping = (tonumber(Spring.GetConfigInt("NormalMapping",1) or 1) == 1) +local treewind = tonumber(Spring.GetConfigInt("TreeWind",1) or 1) == 1 +local sunChanged = false + +local idToDefID = {} + +local unitRendering = { + drawList = {}, + materialInfos = {}, + bufMaterials = {}, + materialDefs = {}, + loadedTextures = {}, + + ObjectDefNames = UnitDefNames, + + spGetAllObjects = Spring.GetAllUnits, + spGetObjectPieceList = Spring.GetUnitPieceList, + + spGetMaterial = Spring.UnitRendering.GetMaterial, + spSetMaterial = Spring.UnitRendering.SetMaterial, + spActivateMaterial = Spring.UnitRendering.ActivateMaterial, + spDeactivateMaterial = Spring.UnitRendering.DeactivateMaterial, + spSetObjectLuaDraw = Spring.UnitRendering.SetUnitLuaDraw, + spSetLODCount = Spring.UnitRendering.SetLODCount, + spSetPieceList = Spring.UnitRendering.SetPieceList, + + DrawObject = "DrawUnit", + ObjectCreated = "UnitCreated", + ObjectDestroyed = "UnitDestroyed", +} + +local featureRendering = { + drawList = {}, + materialInfos = {}, + bufMaterials = {}, + materialDefs = {}, + loadedTextures = {}, + + ObjectDefNames = FeatureDefNames, + + spGetAllObjects = Spring.GetAllFeatures, + spGetObjectPieceList = Spring.GetFeaturePieceList, + + spGetMaterial = Spring.FeatureRendering.GetMaterial, + spSetMaterial = Spring.FeatureRendering.SetMaterial, + spActivateMaterial = Spring.FeatureRendering.ActivateMaterial, + spDeactivateMaterial = Spring.FeatureRendering.DeactivateMaterial, + spSetObjectLuaDraw = Spring.FeatureRendering.SetFeatureLuaDraw, + spSetLODCount = Spring.FeatureRendering.SetLODCount, + spSetPieceList = Spring.FeatureRendering.SetPieceList, + + DrawObject = "DrawFeature", + ObjectCreated = "FeatureCreated", + ObjectDestroyed = "FeatureDestroyed", +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local _plugins = nil +local function InsertPlugin(str) + --str = str:upper() + return (_plugins and _plugins[str]) or "" +end + +local function CompileShader(shader, definitions, plugins, addName) + shader.vertexOrig = shader.vertex + shader.fragmentOrig = shader.fragment + shader.geometryOrig = shader.geometry + + --// insert small pieces of code named `plugins` + --// this way we can use a basic shader and add some simple vertex animations etc. + do + if (plugins) then + _plugins = plugins + end + + if (shader.vertex) + then shader.vertex = shader.vertex:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end + if (shader.fragment) + then shader.fragment = shader.fragment:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end + if (shader.geometry) + then shader.geometry = shader.geometry:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end + + _plugins = nil + end + + --// append definitions at top of the shader code + --// (this way we can modularize a shader and enable/disable features in it) + if (definitions or shadows) then + definitions = definitions or {} + hasVersion = false + for _, def in pairs(definitions) do + hasVersion = hasVersion or string.sub(def,1,string.len("#version")) == "#version" + end + if not hasVersion then + table.insert(definitions, 1, "#version 150 compatibility") + end + if (shadows) then + table.insert(definitions, "#define use_shadows") + end + definitions = table.concat(definitions, "\n") .. "\n" + if (shader.vertex) + then shader.vertex = definitions .. shader.vertex; end + if (shader.fragment) + then shader.fragment = definitions .. shader.fragment; end + if (shader.geometry) + then shader.geometry = definitions .. shader.geometry; end + end + + local luaShader = LuaShader(shader, "Custom Unit Shaders. " .. addName) + luaShader:Initialize() + + shader.vertex = shader.vertexOrig + shader.fragment = shader.fragmentOrig + shader.geometry = shader.geometryOrig + + return luaShader +end + + +local function _CompileMaterialShaders(rendering) + for matName, mat_src in pairs(rendering.materialDefs) do + if mat_src.shaderSource then + local luaShader = CompileShader(mat_src.shaderSource, mat_src.shaderDefinitions, mat_src.shaderPlugins, string.format("MatName: \"%s\"(%s)", matName, "Standard")) + + if luaShader then + if mat_src.standardShader then + if mat_src.standardShaderObj then + mat_src.standardShaderObj:Finalize() + else + gl.DeleteShader(mat_src.standardShader) + end + end + mat_src.standardShaderObj = luaShader + mat_src.standardShader = luaShader:GetHandle() + luaShader:SetUnknownUniformIgnore(true) + luaShader:ActivateWith( function() + mat_src.standardUniforms = { + cameraloc = luaShader:GetUniformLocation("camera"), + camerainvloc = luaShader:GetUniformLocation("cameraInv"), + cameraposloc = luaShader:GetUniformLocation("cameraPos"), + shadowmatrixloc = luaShader:GetUniformLocation("shadowMatrix"), + shadowparamsloc = luaShader:GetUniformLocation("shadowParams"), + sunposloc = luaShader:GetUniformLocation("sunPos"), + simframeloc = luaShader:GetUniformLocation("simFrame"), + } + end) + luaShader:SetActiveStateIgnore(true) + end + end + + if (mat_src.deferredSource) then + local luaShader = CompileShader(mat_src.deferredSource, mat_src.deferredDefinitions, mat_src.deferredPlugins, string.format("MatName: \"%s\"(%s)", matName, "Deferred")) + + if luaShader then + if mat_src.deferredShader then + if mat_src.deferredShaderObj then + mat_src.deferredShaderObj:Finalize() + else + gl.DeleteShader(mat_src.deferredShader) + end + end + mat_src.deferredShaderObj = luaShader + mat_src.deferredShader = luaShader:GetHandle() + luaShader:SetUnknownUniformIgnore(true) + luaShader:ActivateWith( function() + mat_src.deferredUniforms = { + cameraloc = luaShader:GetUniformLocation("camera"), + camerainvloc = luaShader:GetUniformLocation("cameraInv"), + cameraposloc = luaShader:GetUniformLocation("cameraPos"), + shadowmatrixloc = luaShader:GetUniformLocation("shadowMatrix"), + shadowparamsloc = luaShader:GetUniformLocation("shadowParams"), + sunposloc = luaShader:GetUniformLocation("sunPos"), + simframeloc = luaShader:GetUniformLocation("simFrame"), + } + end) + luaShader:SetActiveStateIgnore(true) + end + end + end +end + +local function CompileMaterialShaders() + _CompileMaterialShaders(unitRendering) + _CompileMaterialShaders(featureRendering) +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function GetObjectMaterial(rendering, objectDefID) + local mat = rendering.bufMaterials[objectDefID] + if mat then + return mat + end + + + local matInfo = rendering.materialInfos[objectDefID] + local mat = rendering.materialDefs[matInfo[1]] + + if type(objectDefID) == "number" then + -- Non-number objectDefIDs are default material overrides. They will have + -- their textures defined in the unit materials files. + matInfo.UNITDEFID = objectDefID + matInfo.FEATUREDEFID = -objectDefID + end + + --// find unitdef tex keyword and replace it + --// (a shader can be just for multiple unitdefs, so we support this keywords) + local texUnits = {} + for texid, tex in pairs(mat.texunits or {}) do + local tex_ = tex + for varname, value in pairs(matInfo) do + tex_ = tex_:gsub("%%"..tostring(varname),value) + end + texUnits[texid] = {tex=tex_, enable=false} + end + + --// materials don't load those textures themselves + if (texUnits[1]) then + local texdl = gl.CreateList(function() + for _,tex in pairs(texUnits) do + local prefix = tex.tex:sub(1,1) + if (prefix~="%") + and(prefix~="#") + and(prefix~="!") + and(prefix~="$") + then + gl.Texture(tex.tex) + rendering.loadedTextures[#rendering.loadedTextures+1] = tex.tex + end + end + end) + gl.DeleteList(texdl) + end + + local luaMat = rendering.spGetMaterial("opaque", { + standardshader = mat.standardShader, + deferredshader = mat.deferredShader, + + standarduniforms = mat.standardUniforms, + deferreduniforms = mat.deferredUniforms, + + usecamera = mat.usecamera, + culling = mat.culling, + texunits = texUnits, + prelist = mat.predl, + postlist = mat.postdl, + }) + + rendering.bufMaterials[objectDefID] = luaMat + + return luaMat +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function ResetUnit(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:RenderUnitDestroyed(unitID, unitDefID) + Spring.UnitRendering.DeactivateMaterial(unitID, 3) + if not select(3,Spring.GetUnitIsStunned(unitID)) then --// inbuild? + gadget:UnitFinished(unitID,unitDefID) + end +end + +local function ResetFeature(featureID) + gadget:FeatureDestroyed(featureID) + Spring.FeatureRendering.DeactivateMaterial(featureID, 3) + gadget:FeatureCreated(featureID) +end + +local function ToggleShadows() + shadows = Spring.HaveShadows() + + CompileMaterialShaders() + + unitRendering.bufMaterials = {} + local units = Spring.GetAllUnits() + for _, unitID in pairs(units) do + ResetUnit(unitID) + end + + featureRendering.bufMaterials = {} + local features = Spring.GetAllFeatures() + for _, featureID in pairs(features) do + ResetFeature(featureID) + end +end + + +local function ToggleAdvShading() + advShading = Spring.HaveAdvShading() + + if (not advShading) then + --// unload all materials + unitRendering.drawList = {} + local units = Spring.GetAllUnits() + for _,unitID in pairs(units) do + ResetUnit(unitID) + end + + featureRendering.drawList = {} + local features = Spring.GetAllFeatures() + for _, featureID in pairs(features) do + ResetFeature(featureID) + end + elseif (normalmapping) then + --// reinitializes all shaders + ToggleShadows() + end +end + + +local n = -1 +function gadget:Update() + if (n < Spring.GetDrawFrame()) then + n = Spring.GetDrawFrame() + Spring.GetFPS() + + if (advShading ~= Spring.HaveAdvShading()) then + ToggleAdvShading() + elseif advShading and normalmapping and shadows ~= Spring.HaveShadows() then + ToggleShadows() + end + end +end + + +function gadget:SunChanged() + sunChanged = true +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function GetShaderOverride(objectID, objectDefID) + if Spring.ValidUnitID(objectID) then + return Spring.GetUnitRulesParam(objectID, "comm_texture") + end + return false +end + +function ObjectFinished(rendering, objectID, objectDefID) + if not advShading then + return + end + + objectDefID = GetShaderOverride(objectID, objectDefID) or objectDefID + local objectMat = rendering.materialInfos[objectDefID] + if objectMat then + local mat = rendering.materialDefs[objectMat[1]] + if (normalmapping or mat.force) then + rendering.spActivateMaterial(objectID, 3) + rendering.spSetMaterial(objectID,3,"opaque", GetObjectMaterial(rendering, objectDefID)) + for pieceID in ipairs(rendering.spGetObjectPieceList(objectID) or {}) do + rendering.spSetPieceList(objectID, 3, pieceID) + end + local DrawObject = mat[rendering.DrawObject] + local ObjectCreated = mat[rendering.ObjectCreated] + if DrawObject then + rendering.spSetObjectLuaDraw(objectID, true) + rendering.drawList[objectID] = mat + end + if ObjectCreated then + ObjectCreated(objectID, mat, 3) + end + end + end +end + +function gadget:UnitFinished(unitID, unitDefID) + idToDefID[unitID] = unitDefID + ObjectFinished(unitRendering, unitID, unitDefID) +end + +function gadget:FeatureCreated(featureID) + idToDefID[-featureID] = Spring.GetFeatureDefID(featureID) + ObjectFinished(featureRendering, featureID, idToDefID[-featureID]) +end + +function ObjectDestroyed(rendering, objectID, objectDefID) + rendering.spDeactivateMaterial(objectID, 3) + + local mat = rendering.drawList[objectID] + if mat then + local _ObjectDestroyed = mat[rendering.ObjectDestroyed] + if _ObjectDestroyed then + _ObjectDestroyed(objectID, 3) + end + rendering.drawList[objectID] = nil + end +end + +function gadget:RenderUnitDestroyed(unitID, unitDefID) + idToDefID[unitID] = nil --not really required + ObjectDestroyed(unitRendering, unitID, unitDefID) +end + +function gadget:FeatureDestroyed(featureID) + idToDefID[featureID] = nil --not really required + ObjectDestroyed(featureRendering, featureID, Spring.GetFeatureDefID(featureID)) +end + +function gadget:DrawGenesis() + if sunChanged then + for _, mat in pairs(unitRendering.materialDefs) do + local SunChangedFunc = mat.SunChanged + + if SunChangedFunc then + if mat.standardShaderObj then + mat.standardShaderObj:ActivateWith( function () + SunChangedFunc(mat.standardShaderObj) + end) + end + if mat.deferredShaderObj then + mat.deferredShaderObj:ActivateWith( function () + SunChangedFunc(mat.deferredShaderObj) + end) + end + end + end + + for _, mat in pairs(featureRendering.materialDefs) do + local SunChangedFunc = mat.SunChanged + + if SunChangedFunc then + if mat.standardShaderObj then + mat.standardShaderObj:ActivateWith( function () + SunChangedFunc(mat.standardShaderObj) + end) + end + if mat.deferredShaderObj then + mat.deferredShaderObj:ActivateWith( function () + SunChangedFunc(mat.deferredShaderObj) + end) + end + end + end + + sunChanged = false + end +end + +local function DrawObject(rendering, objectID, objectDefID, drawMode) + local mat = rendering.drawList[objectID] + if not mat then + return + end + + local luaShaderObj = (drawMode == 5) and mat.deferredShaderObj or mat.standardShaderObj + local _DrawObject = mat[rendering.DrawObject] + if _DrawObject then + return _DrawObject(objectID, objectDefID, mat, drawMode, luaShaderObj) + end +end + +--------------------------- +-- DrawUnit(unitID,DrawMode) +-- With enum DrawMode { +-- notDrawing = 0, +-- normalDraw = 1, +-- shadowDraw = 2, +-- reflectionDraw = 3, +-- refractionDraw = 4, +-- gameDeferredDraw = 5, +-- }; +----------------- + +function gadget:DrawUnit(unitID, drawMode) + return DrawObject(unitRendering, unitID, idToDefID[unitID], drawMode) +end + +function gadget:DrawFeature(featureID, drawMode) + return DrawObject(featureRendering, featureID, idToDefID[-featureID], drawMode) +end +gadget.UnitReverseBuilt = gadget.RenderUnitDestroyed +gadget.UnitCloaked = gadget.RenderUnitDestroyed +gadget.UnitDecloaked = gadget.UnitFinished + + +-- NOTE: No feature equivalent (features can't change team) +function gadget:UnitGiven(unitID,...) + if not select(3, Spring.GetUnitIsStunned(unitID)) then + gadget:RenderUnitDestroyed(unitID, ...) + gadget:UnitFinished(unitID, ...) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function gadget:GameFrame() + for _, uid in ipairs(Spring.GetAllUnits()) do + if not select(3,Spring.GetUnitIsStunned(uid)) then --// inbuild? + gadget:UnitFinished(uid, Spring.GetUnitDefID(uid), Spring.GetUnitTeam(uid)) + end + end + for _, fid in ipairs(Spring.GetAllFeatures()) do + gadget:FeatureCreated(fid, Spring.GetFeatureDefID(fid), Spring.GetFeatureTeam(fid)) + end + gadgetHandler:RemoveCallIn('GameFrame') +end + + + + +--// Workaround: unsynced LuaRules doesn't receive Shutdown events +Shutdown = Script.CreateScream() + + +local function _CleanupTextures(rendering) + for i = 1, #rendering.loadedTextures do + gl.DeleteTexture(rendering.loadedTextures[i]) + end + for _, oid in ipairs(rendering.spGetAllObjects()) do + rendering.spSetLODCount(oid, 0) + end +end + + + + + + + + +Shutdown.func = function() + --// unload textures, so the user can do a `/luarules reload` to reload the normalmaps + _CleanupTextures(unitRendering) + _CleanupTextures(featureRendering) +end + + +local function _LoadMaterialConfigFiles(path) + local unitMaterialDefs = {} + local featureMaterialDefs = {} + + local files = VFS.DirList(path) + table.sort(files) + + for i = 1, #files do + local mats, unitMats = VFS.Include(files[i]) + + for k, v in pairs(mats) do + -- Spring.Echo(files[i],'is a feature?',v.feature) + local rendering + if v.feature then + rendering = featureRendering + else + rendering = unitRendering + end + if not rendering.materialDefs[k] then + rendering.materialDefs[k] = v + end + end + for k, v in pairs(unitMats) do + --// we check if the material is defined as a unit or as feature material (one namespace for both!!) + local materialDefs + if featureRendering.materialDefs[v[1]] then + materialDefs = featureMaterialDefs + else + materialDefs = unitMaterialDefs + end + if not materialDefs[k] then + materialDefs[k] = v + end + end + end + return unitMaterialDefs, featureMaterialDefs +end + +local function _ProcessMaterials(rendering, materialDefs) + local engineShaderTypes = {"3do", "s3o", "obj", "ass"} + for _, mat_src in pairs(rendering.materialDefs) do + -- mat_src = {shader = include(".../default.lua") or "s3o", ...} + if mat_src.shader ~= nil and engineShaderTypes[mat_src.shader] == nil then + mat_src.shaderSource = mat_src.shader + mat_src.shader = nil + end + if mat_src.deferred ~= nil and engineShaderTypes[mat_src.deferred] == nil then + mat_src.deferredSource = mat_src.deferred + mat_src.deferred = nil + end + end + + _CompileMaterialShaders(rendering) + + for objectName, materialInfo in pairs(materialDefs) do + if (type(materialInfo) ~= "table") then + materialInfo = {materialInfo} + end + rendering.materialInfos[(rendering.ObjectDefNames[objectName] or {id=-1}).id] = materialInfo + end +end + + +function ToggleTreeWind(_,newSetting,_, playerID) + if (playerID ~= Spring.GetMyPlayerID()) then + return + end + if newSetting and newSetting~="" then + treewind = (newSetting=="1") + elseif not newSetting or newSetting=="" then + treewind = not treewind + end + Spring.SetConfigInt("TreeWind", (treewind and 1) or 0) + if Spring.GetGameFrame() > 1000 then + Spring.Echo("TreeWind is " .. (treewind and "enabled" or "disabled")) + end + + --// unload normalmapped materials + local features = Spring.GetAllFeatures() + for _,featureID in pairs(features) do + local featureDefID = Spring.GetFeatureDefID(featureID) + local featureMat = featureRendering.materialInfos[featureDefID] + if (featureMat) then + gadget:FeatureDestroyed(featureID,featureDefID) + end + end + + -- reset + featureRendering.drawList = {} + featureRendering.materialInfos = {} + featureRendering.bufMaterials = {} + featureRendering.materialDefs = {} + featureRendering.loadedTextures = {} + + --// load the materials config files + local unitMaterialDefs, featureMaterialDefs = _LoadMaterialConfigFiles(MATERIALS_DIR) + _ProcessMaterials(featureRendering, featureMaterialDefs) + + local features = Spring.GetAllFeatures() + for _,featureID in pairs(features) do + local featureDefID = Spring.GetFeatureDefID(featureID) + local featureMat = featureRendering.materialInfos[featureDefID] + if (featureMat) then + gadget:FeatureCreated(featureID,featureDefID) + end + end +end + + +function ToggleNormalmapping(_,newSetting,_, playerID) + if (playerID ~= Spring.GetMyPlayerID()) then + return + end + + if newSetting and newSetting~="" then + normalmapping = (newSetting=="1") + elseif not newSetting or newSetting=="" then + normalmapping = not normalmapping + end + + Spring.SetConfigInt("NormalMapping", (normalmapping and 1) or 0) + Spring.Echo("normalmapping is " .. (normalmapping and "enabled" or "disabled")) + + --// unload normalmapped materials + local features = Spring.GetAllFeatures() + for _,featureID in pairs(features) do + local featureDefID = Spring.GetFeatureDefID(featureID) + local featureMat = featureRendering.materialInfos[featureDefID] + if (featureMat) then + local mat = featureRendering.materialDefs[featureMat[1]] + if (not mat.force) then + gadget:FeatureDestroyed(featureID,featureDefID) + end + end + end + --// unload normalmapped materials + local units = Spring.GetAllUnits() + for _,unitID in pairs(units) do + local unitDefID = Spring.GetUnitDefID(unitID) + local unitMat = unitRendering.materialInfos[unitDefID] + if (unitMat) then + local mat = unitRendering.materialDefs[unitMat[1]] + if (not mat.force) then + gadget:RenderUnitDestroyed(unitID,unitDefID) + end + end + end + + -- reset + unitRendering.drawList = {} + unitRendering.materialInfos = {} + unitRendering.bufMaterials = {} + unitRendering.materialDefs = {} + unitRendering.loadedTextures = {} + featureRendering.drawList = {} + featureRendering.materialInfos = {} + featureRendering.bufMaterials = {} + featureRendering.materialDefs = {} + featureRendering.loadedTextures = {} + + --// load the materials config files + local unitMaterialDefs, featureMaterialDefs = _LoadMaterialConfigFiles(MATERIALS_DIR) + _ProcessMaterials(unitRendering, unitMaterialDefs) + _ProcessMaterials(featureRendering, featureMaterialDefs) + + local features = Spring.GetAllFeatures() + for _,featureID in pairs(features) do + local featureDefID = Spring.GetFeatureDefID(featureID) + local featureMat = featureRendering.materialInfos[featureDefID] + if (featureMat) then + local mat = featureRendering.materialDefs[featureMat[1]] + if (not mat.force) then + gadget:FeatureCreated(featureID,featureDefID) + end + end + end + --// load normalmapped materials + local units = Spring.GetAllUnits() + for _,unitID in pairs(units) do + local unitDefID = Spring.GetUnitDefID(unitID) + local unitMat = unitRendering.materialInfos[unitDefID] + if (unitMat) then + local mat = unitRendering.materialDefs[unitMat[1]] + if (not mat.force) then + gadget:UnitFinished(unitID,unitDefID) + end + end + end +end + + +function gadget:Initialize() + --// check user configs + shadows = Spring.HaveShadows() + advShading = Spring.HaveAdvShading() + + --// load the materials config files + local unitMaterialDefs, featureMaterialDefs = _LoadMaterialConfigFiles(MATERIALS_DIR) + -- Spring.Echo('unitMaterialDefs',to_string(unitMaterialDefs)) + -- Spring.Echo('featureMaterialDefs',to_string(featureMaterialDefs)) + --// process the materials (compile shaders, load textures, ...) + _ProcessMaterials(unitRendering, unitMaterialDefs) + _ProcessMaterials(featureRendering, featureMaterialDefs) + + --// insert synced actions + + gadgetHandler:AddSyncAction("unitshaders_reverse", UnitReverseBuilt) + gadgetHandler:AddChatAction("normalmapping", ToggleNormalmapping) + gadgetHandler:AddChatAction("treewind", ToggleTreeWind) +end + +function to_string(data, indent) + local str = "" + + if(indent == nil) then + indent = 0 + end + + -- Check the type + if(type(data) == "string") then + str = str .. (" "):rep(indent) .. data .. "\n" + elseif(type(data) == "number") then + str = str .. (" "):rep(indent) .. data .. "\n" + elseif(type(data) == "boolean") then + if(data == true) then + str = str .. "true" + else + str = str .. "false" + end + elseif(type(data) == "table") then + local i, v + for i, v in pairs(data) do + -- Check for a table in a table + if(type(v) == "table") then + str = str .. (" "):rep(indent) .. i .. ":\n" + str = str .. to_string(v, indent + 2) + else + str = str .. (" "):rep(indent) .. i .. ": " .. to_string(v, 0) + end + end + elseif (data ==nil) then + str=str..'nil' + else + --print_debug(1, "Error: unknown data type: %s", type(data)) + str=str.. "Error: unknown data type:" .. type(data) + Spring.Echo('X data type') + end + + return str +end \ No newline at end of file diff --git a/LuaRules/Gadgets/api_subdir_gadgets.lua b/LuaRules/Gadgets/api_subdir_gadgets.lua index 8e540bc73..8e0325042 100644 --- a/LuaRules/Gadgets/api_subdir_gadgets.lua +++ b/LuaRules/Gadgets/api_subdir_gadgets.lua @@ -9,33 +9,36 @@ -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local SCRIPT_DIR = Script.GetName() .. '/' local GADGETS_DIR = SCRIPT_DIR .. 'Gadgets/' -local gh = gadgetHandler.gadgetHandler +local gh = gadgetHandler --// export GADGET_DIR, so gadgets can easily load e.g. config.lua --// from the same dir where the main.lua is placed local oldNewGadget = gh.NewGadget local curdir = "" gh.NewGadget = function(self,dir) - local gadget = oldNewGadget(self) - gadget.GADGET_DIR = curdir - return gadget + local gadget = oldNewGadget(self) + gadget.GADGET_DIR = curdir + return gadget end --// load all Gadgets/*/main.lua gadgets local subdirs = VFS.SubDirs(GADGETS_DIR) for i=1,#subdirs do - curdir = subdirs[i] - local gf = curdir .. "main.lua" - if (VFS.FileExists(gf)) then - local g = gh:LoadGadget(gf) - gh:InsertGadget(g) - local name = g.ghInfo.name - print(string.format("Loaded gadget: %-18s <%s>", name, gf)) - end + curdir = subdirs[i] + local gf = curdir .. "main.lua" + if (VFS.FileExists(gf)) then + local g = gh:LoadGadget(gf) + if g then + gh:InsertGadget(g) + local name = g.ghInfo.name + print(string.format("Loaded gadget: %-18s <%s>", name, gf)) + end + else + + end end --// reset diff --git a/LuaRules/Gadgets/awards.lua b/LuaRules/Gadgets/awards.lua deleted file mode 100644 index 28a7d1b9e..000000000 --- a/LuaRules/Gadgets/awards.lua +++ /dev/null @@ -1,750 +0,0 @@ -function gadget:GetInfo() - return { - name = "Awards", - desc = "Awards players at end of battle with shiny trophies.", - author = "CarRepairer", - date = "2008-10-15", - license = "GNU GPL, v2 or later", - layer = 1, - enabled = false -- loaded by default? - } -end - -local TESTMODE = false - -local echo = Spring.Echo - -local spGetAllyTeamList = Spring.GetAllyTeamList -local spIsGameOver = Spring.IsGameOver - -local gaiaTeamID = Spring.GetGaiaTeamID() - -local totalTeams = 0 -local totalTeamList = {} - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -if (gadgetHandler:IsSyncedCode()) then -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetGameSeconds = Spring.GetGameSeconds -local spGetTeamStatsHistory = Spring.GetTeamStatsHistory -local spGetUnitHealth = Spring.GetUnitHealth -local spGetAllUnits = Spring.GetAllUnits -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitExperience = Spring.GetUnitExperience - -local floor = math.floor - -local airDamageList = {} -local friendlyDamageList= {} -local damageList = {} -local empDamageList = {} -local fireDamageList = {} -local navyDamageList = {} -local nuxDamageList = {} -local defDamageList = {} -local t3DamageList = {} -local captureList = {} -local ouchDamageList = {} -local kamDamageList = {} - -local expUnitTeam, expUnitDefID, expUnitExp = 0,0,0 - - -local awardList = {} -local sentAwards = false -local teamCount = 0 - -local boats, t3Units = {}, {} ---[[ -local staticO_small = { - armemp=1, cortron=1, - armbrtha=1, corint=1, -} ---]] - -local staticO_big = { - elrpc=1, esilo=1, -} - -local kamikaze = { - ebomb=1, -} - -local flamerWeaponDefs = {} - -function comma_value(amount) - local formatted = amount .. '' - local k - while true do - formatted, k = formatted:gsub("^(-?%d+)(%d%d%d)", '%1,%2') - if (k==0) then - break - end - end - return formatted -end - -function getMeanDamageExcept(excludeTeam) - local mean = 0 - local count = 0 - for team,dmg in pairs(damageList) do - if team ~= excludeTeam - and dmg > 100 - then - mean = mean + dmg - count = count + 1 - end - end - return (count>0) and (mean/count) or 0 -end - -function getMaxVal(valList) - local winTeam, maxVal = false,0 - for team,val in pairs(valList) do - if val and val > maxVal then - winTeam = team - maxVal = val - end - end - return winTeam, floor(maxVal) -end - -function awardAward(team, awardType, record) - awardList[team][awardType] = record - - if TESTMODE then - for _,curTeam in pairs(totalTeamList) do - if curTeam ~= team then - awardList[curTeam][awardType] = nil - end - end - end -end - -function gadget:Initialize() - local tempTeamList = Spring.GetTeamList() - for _, team in ipairs(tempTeamList) do - --Spring.Echo('team', team) - if team ~= gaiaTeamID then - totalTeams = totalTeams + 1 - totalTeamList[team] = team - end - end - - for _,team in pairs(totalTeamList) do - airDamageList[team] = 0 - friendlyDamageList[team]= 0 - damageList[team] = 0 - empDamageList[team] = 0 - fireDamageList[team] = 0 - navyDamageList[team] = 0 - nuxDamageList[team] = 0 - defDamageList[team] = 0 - t3DamageList[team] = 0 - captureList[team] = 0 - ouchDamageList[team] = 0 - kamDamageList[team] = 0 - - awardList[team] = {} - - teamCount = teamCount + 1 - end - - local boatFacs = {'armsy', 'corsy', } --'armasy', 'corasy'} - for _, boatFac in pairs(boatFacs) do - local udBoatFac = UnitDefNames[boatFac] - if udBoatFac then - for _, boatDefID in pairs(udBoatFac.buildOptions) do - boats[boatDefID] = true - end - end - end - --[[ - local t3Facs = {'armshltx', 'corgant', } - for _, t3Fac in pairs(t3Facs) do - local udT3Fac = UnitDefNames[t3Fac] - for _, t3DefID in pairs(udT3Fac.buildOptions) do - t3Units[t3DefID] = true - end - end - --]] - for i=1,#WeaponDefs do - if (WeaponDefs[i].type=="Flame" or - WeaponDefs[i].fireStarter >=100 or - WeaponDefs[i].name:lower():find("flame")) then --// == flamethrower or napalm - - flamerWeaponDefs[i]=WeaponDefs[i].fireStarter - end - end - -end - -function gadget:UnitTaken(unitID, unitDefID, oldTeam, newTeam) - -- Units given to neutral? - if not spAreTeamsAllied(oldTeam,newTeam) and captureList[newTeam] then - local ud = UnitDefs[unitDefID] - local mCost = ud and ud.metalCost - captureList[newTeam] = captureList[newTeam] + mCost - end -end - -function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - local experience = spGetUnitExperience(unitID) - if experience > expUnitExp then - expUnitExp = experience - expUnitTeam = unitTeam - expUnitDefID = unitDefID - end -end - -function gadget:UnitDamaged(unitID, unitDefID, unitTeam, fullDamage, paralyzer, weaponID, - attackerID, attackerDefID, attackerTeam) - - if (not attackerTeam) - or (attackerTeam == unitTeam) - or (attackerTeam == gaiaTeamID) - or (unitTeam == gaiaTeamID) - then return end - - local hp = spGetUnitHealth(unitID) - local damage = (hp > 0) and fullDamage or fullDamage + hp - - if spAreTeamsAllied(attackerTeam, unitTeam) then - if not paralyzer then - friendlyDamageList[attackerTeam] = friendlyDamageList[attackerTeam] + damage - end - else - if paralyzer then - empDamageList[attackerTeam] = empDamageList[attackerTeam] + damage - else - damageList[attackerTeam] = damageList[attackerTeam] + damage - ouchDamageList[unitTeam] = ouchDamageList[unitTeam] + damage - local ad = UnitDefs[attackerDefID] - - if (flamerWeaponDefs[weaponID]) then - fireDamageList[attackerTeam] = fireDamageList[attackerTeam] + damage - end - - -- Static Weapons - if (not ad.canMove) then - - -- big weapons - if staticO_big[ad.name] then - nuxDamageList[attackerTeam] = nuxDamageList[attackerTeam] + damage - - - --elseif not staticO_small[ad.name] then - else - defDamageList[attackerTeam] = defDamageList[attackerTeam] + damage - - end - - elseif kamikaze[ad.name] then - kamDamageList[attackerTeam] = kamDamageList[attackerTeam] + damage - - elseif ad.canFly then - airDamageList[attackerTeam] = airDamageList[attackerTeam] + damage - - --elseif boats[attackerDefID] then - --navyDamageList[attackerTeam] = navyDamageList[attackerTeam] + damage - - --elseif t3Units[attackerDefID] then - --t3DamageList[attackerTeam] = t3DamageList[attackerTeam] + damage - - - end - end - end - -end - -function gadget:GameFrame(n) - if TESTMODE then - local frame32 = (n) % 32 - if (frame32 < 0.1) then - sentAwards = false - end - - else - if not spIsGameOver() then return end - end - - if not sentAwards then - - for _, unitID in ipairs(spGetAllUnits()) do - local teamID = spGetUnitTeam(unitID) - local unitDefID = spGetUnitDefID(unitID) - gadget:UnitDestroyed(unitID, unitDefID, teamID) - end - - local pwnTeam, maxDamage = getMaxVal(damageList) - local navyTeam, maxNavyDamage = getMaxVal(navyDamageList) - local airTeam, maxAirDamage = getMaxVal(airDamageList) - local nuxTeam, maxNuxDamage = getMaxVal(nuxDamageList) - local shellTeam,maxStaticDamage = getMaxVal(defDamageList) - local fireTeam, maxFireDamage = getMaxVal(fireDamageList) - local empTeam, maxEmpDamage = getMaxVal(empDamageList) - local t3Team, maxT3Damage = getMaxVal(t3DamageList) - local kamTeam, maxKamDamage = getMaxVal(kamDamageList) - - local ouchTeam, maxOuchDamage = getMaxVal(ouchDamageList) - - local capTeam, maxCap = getMaxVal(captureList) - - local friendTeam - local maxFriendlyDamageRatio = 0 - for team,dmg in pairs(friendlyDamageList) do - - local totalDamage = dmg+damageList[team] - local damageRatio = totalDamage>0 and dmg/totalDamage or 0 - - if damageRatio > maxFriendlyDamageRatio then - friendTeam = team - maxFriendlyDamageRatio = damageRatio - end - end - - - --test values - if TESTMODE then - local testteam = 0 - --[[ - pwnTeam, maxDamage = testteam+0 ,1 - navyTeam, maxNavyDamage = testteam+1 ,1 - t3Team, maxT3Damage = testteam+1 ,1 - capTeam, maxCap = testteam+0 ,2 - - expUnitTeam, expUnitExp = testteam+0 ,2.4444 - expUnitDefID = 35 - - airTeam, maxAirDamage = testteam+2 ,2 - nuxTeam, maxNuxDamage = testteam+0 ,333333333 - - shellTeam, maxStaticDamage = testteam+0 ,1 - mTeam, mMax = testteam+0 ,1 - eTeam, eMax = testteam+0 ,11111111 - friendTeam, maxFriendlyDamageRatio = testteam+0 ,0.5 - fireTeam, maxFireDamage = testteam+0 ,1 - empTeam, maxEmpDamage = testteam+0 ,1 - - pwnTeam, maxDamage = testteam ,1 - navyTeam, maxNavyDamage = testteam ,1 - airTeam, maxAirDamage = testteam ,1 - nuxTeam, maxNuxDamage = testteam ,1 - shellTeam, maxStaticDamage = testteam ,1 - friendTeam, maxFriendlyDamageRatio = testteam,1 - fireTeam, maxFireDamage = testteam ,1 - empTeam, maxEmpDamage = testteam ,1 - --]] - end - - --local easyFactor = 0.5 - --local veryEasyFactor = 0.3 - local minFriendRatio = 0.25 - - local ef_5 = 0.05 - local ef_10 = 0.1 - local ef_30 = 0.3 - local ef_50 = 0.5 - - if pwnTeam then - awardAward(pwnTeam, 'pwn', 'Damage dealt: '.. comma_value(maxDamage)) - end - --[[ - if navyTeam and maxNavyDamage > getMeanDamageExcept(navyTeam) then - awardAward(navyTeam, 'navy', 'Damage: '.. comma_value(maxNavyDamage)) - end - --]] - if airTeam and maxAirDamage > getMeanDamageExcept(airTeam) * ef_10 then - awardAward(airTeam, 'air', 'Damage: '.. comma_value(maxAirDamage)) - end - --[[ - if t3Team and maxT3Damage > getMeanDamageExcept(t3Team) then - awardAward(t3Team, 't3', 'Damage: '.. comma_value(maxT3Damage)) - end - --]] - if nuxTeam and maxNuxDamage > getMeanDamageExcept(nuxTeam) * ef_10 then - awardAward(nuxTeam, 'nux', 'Damage: '.. comma_value(maxNuxDamage)) - end - if shellTeam and maxStaticDamage > getMeanDamageExcept(shellTeam) * ef_10 then - awardAward(shellTeam, 'shell', 'Damage: '.. comma_value(maxStaticDamage)) - end - if kamTeam and maxKamDamage > getMeanDamageExcept(kamTeam) * ef_5 then - awardAward(kamTeam, 'kam', 'Damage: '.. comma_value(maxKamDamage)) - end - if fireTeam and maxFireDamage > getMeanDamageExcept(fireTeam) * ef_5 then - awardAward(fireTeam, 'fire', 'Damage: '.. comma_value(maxFireDamage)) - end - if empTeam and maxEmpDamage/10 > getMeanDamageExcept(empTeam) * ef_5 then - awardAward(empTeam, 'emp', 'Damage: '.. comma_value(maxEmpDamage)) - end - if capTeam and maxCap > 1000 then - awardAward(capTeam, 'cap', 'Captured value: '.. comma_value(maxCap)) - end - if friendTeam and maxFriendlyDamageRatio > minFriendRatio then - awardAward(friendTeam, 'friend', 'Damage inflicted on allies: '.. floor(maxFriendlyDamageRatio * 100) ..'%') - end - if ouchTeam then - awardAward(ouchTeam, 'ouch', 'Damage taken: '.. comma_value(maxOuchDamage)) - end - if expUnitExp >= 3.0 then - local vetName = UnitDefs[expUnitDefID] and UnitDefs[expUnitDefID].humanName - local expUnitExpRounded = ''..floor(expUnitExp * 10)/10 - expUnitExpRounded = expUnitExpRounded:sub(1,3) - awardAward(expUnitTeam, 'vet', vetName ..', '.. expUnitExpRounded ..' XP') - end - - _G.awardList = awardList - sentAwards = true - end -end - - -function gadget:GameOver() - SendToUnsynced("aw_GameOver") -end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -else -- UNSYNCED -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -local hostName = nil --planetwars hostname - -local spGetGameFrame = Spring.GetGameFrame -local spGetMouseState = Spring.GetMouseState -local spSendCommands = Spring.SendCommands - - -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glTexture = gl.Texture -local glTexRect = gl.TexRect -local glAlphaTest = gl.AlphaTest -local glTranslate = gl.Translate -local glColor = gl.Color -local glBeginEnd = gl.BeginEnd -local glVertex = gl.Vertex -local glScale = gl.Scale -local GL_QUADS = GL.QUADS ---local GL_GREATER = GL.GREATER - -LUAUI_DIRNAME = 'LuaUI/' -local fontHandler = loadstring(VFS.LoadFile(LUAUI_DIRNAME.."modfonts.lua", VFS.ZIP_FIRST))() -local fancyFont = LUAUI_DIRNAME.."Fonts/KOMTXT___16" -local smallFont = LUAUI_DIRNAME.."Fonts/FreeSansBold_16" - -local fhDraw = fontHandler.Draw -local fhDrawCentered = fontHandler.DrawCentered - -local caught, windowCaught, buttonHover -local showGameOverWin = true -local sentToPlanetWars = false - -local colSpacing = 250 -local bx, by = 100,100 -local margin = 10 -local tWidth,tHeight = 30,40 -local w, h = (colSpacing+margin)*3, 500 -local exitX1,exitY1,exitX2,exitY2 = w-260, h-40, w-10, h-10 - -local teamNames = {} -local teamColors = {} -local teamColorsDim = {} -local awardList - -local maxRow = 8 -local fontHeight = 16 - - -local awardDescs = -{ - pwn = 'Evolved Iammian Award', - navy = 'Fleet Admiral', - air = 'Airforce General', - nux = 'Apocalyptic Achievement Award', - friend = 'Friendly Fire Award', - shell = 'Turtle Shell Award', - fire = 'Weenie Roast', - emp = 'EMP Wizard', - t3 = 'Experimental Engineer', - cap = 'Capture Award', - vet = 'Decorated Veteran', - ouch = 'Big Purple Heart', - kam = 'Kamikaze Award', -} - -function gadget:Initialize() - if TESTMODE then - gadget:GameOver() - end - - local tempTeamList = Spring.GetTeamList() - for _, team in ipairs(tempTeamList) do - --Spring.Echo('team', team) - if team ~= gaiaTeamID then - totalTeams = totalTeams + 1 - totalTeamList[team] = team - end - end - - for _,team in pairs(totalTeamList) do - local _, leaderPlayerID = Spring.GetTeamInfo(team) - teamNames[team] = Spring.GetPlayerInfo(leaderPlayerID) - teamColors[team] = {Spring.GetTeamColor(team)} - teamColorsDim[team] = {teamColors[team][1], teamColors[team][2], teamColors[team][3], 0.5} - end - spSendCommands({'endgraph 0'}) - - -- planetwars init - local modOptions = Spring.GetModOptions() - if (modOptions) and modOptions.planetwars and modOptions.planetwars ~= '' then - local optionsRaw = modOptions.planetwars - optionsRaw = string.gsub(optionsRaw, '_', '=') - optionsRaw = Spring.Utilities.Base64Decode(optionsRaw) - options = assert(loadstring(optionsRaw))() - hostName = options.hostname - end - - gadgetHandler:AddSyncAction("aw_GameOver", gadget.GameOver) -end - -function gadget:GameOver() - - -- reassign colors in case they have been changed locally - for _,team in pairs(totalTeamList) do - teamColors[team] = {Spring.GetTeamColor(team)} - teamColorsDim[team] = {teamColors[team][1], teamColors[team][2], teamColors[team][3], 0.5} - end - - gadget.IsAbove = gadget.IsAbove_ - gadget.MouseMove = gadget.MouseMove_ - gadget.MousePress = gadget.MousePress_ - gadget.MouseRelease = gadget.MouseRelease_ - gadget.DrawScreen = gadget.DrawScreen_ - - function UC(name) - --// bug in gadgetHandler workaround - gadgetHandler:UpdateCallIn(name) - gadgetHandler:UpdateCallIn(name) - end - - UC("IsAbove") - UC("MouseMove") - UC("MousePress") - UC("MouseRelease") - UC("DrawScreen") -end - - -function gadget:IsAboveCloseButton(x,y) - return (x > bx+exitX1) and (x < bx+exitX2) and (y > by+exitY1) and (y < by+exitY2) -end - - -function gadget:IsAbove_(x,y) - local above = (x > bx) and (x < bx+w) and (y > by) and (y < by+h) - - if (above)and(self:IsAboveCloseButton(x,y)) then - buttonHover = true - else - buttonHover = false - end - - return above -end - - -function gadget:MousePress_(x,y,button) - if (button==1) then - if (self:IsAbove(x,y)) then - if (self:IsAboveCloseButton(x,y)) then - --// close button clicked - if showGameOverWin then - spSendCommands('endgraph 1') - else - spSendCommands('endgraph 0') - end - showGameOverWin = not showGameOverWin - return true - end - windowCaught = true - cx = x-bx - cy = y-by - caught = true - return true - end - end - return false -end - - -function gadget:MouseRelease_(x,y,button) - if (button==1) then - if (windowCaught) then - windowCaught = false - return true - else - return false - end - end - return false -end - - -function gadget:MouseMove_(x,y,button) - if (windowCaught) then - bx = x-cx - by = y-cy - return true - else - return false - end -end - - -function gadget:DrawScreen_() - - if (not awardList) and SYNCED.awardList then - awardList = SYNCED.awardList - end - - fontHandler.UseFont(smallFont) - glPushMatrix() - -- Main Box - glTranslate(bx,by, 0) - glColor(0.2, 0.2, 0.2, 0.4) - gl.Rect(0,0,w,h) - - -- Title - glColor(1, 1, 0, 0.8) - glPushMatrix() - glTranslate(colSpacing,h-fontHeight*2,0) - glScale(1.5, 1.5, 1.5) - fhDraw('Awards', 0,0) - glPopMatrix() - - -- Button - if buttonHover then - glColor(0.4, 0.4, 0.9, 0.85) - else - glColor(0.9, 0.9, 0.9, 0.85) - end - gl.Rect(exitX1,exitY1,exitX2,exitY2) - fhDrawCentered('Show/Hide Stats Window', (exitX1 + exitX2)/2,(exitY1 + exitY2)/2 - fontHeight/2) - - glTranslate(margin, h - (tHeight + margin)*2, 0) - local row, col = 0,0 - - if awardList then - - local teamCount = 0 - - for team,awards in spairs(awardList) do - - local awardCount = 0 - for awardType, record in spairs(awards) do - awardCount = awardCount + 1 - if not sentToPlanetWars and hostName ~= nil then - local planetWarsData = teamNames[team] ..' '.. awardType ..' '.. awardDescs[awardType] ..', '.. record - Spring.SendCommands("w "..hostName.." pwaward:".. planetWarsData) - Spring.Echo(planetWarsData) - end - end - - if awardCount > 0 then - teamCount = teamCount + 1 - - if row == maxRow-1 then - row = 0 - col = col + 1 - glTranslate(margin+colSpacing, (tHeight+margin)*(maxRow-1) , 0) - end - - glColor( teamColorsDim[team] ) - gl.Rect(0-margin/2, 0-margin/2, colSpacing-margin/2, tHeight+margin/2) - - glColor(1,1,1,1) - fhDraw(teamNames[team] , 0, fontHeight ) - - row = row + 1 - glTranslate( 0, 0 - (tHeight+margin), 0) - if row == maxRow then - row = 0 - col = col + 1 - glTranslate(margin+colSpacing, (tHeight+margin)*maxRow , 0) - end - - for awardType, record in spairs(awards) do - - glColor(teamColorsDim[team] ) - gl.Rect(0-margin/2, 0-margin/2, colSpacing-margin/2, tHeight+margin/2) - glColor(1,1,1,1) - - glPushMatrix() - - local border = 2 - glColor(0,0,0,1) - gl.Rect(0-border, 0-border, tWidth+border, tHeight+border) - glColor(1,1,1,1) - glTexture('LuaRules/Images/awards/trophy_'.. awardType ..'.png') - glTexRect(0, 0, tWidth, tHeight ) - - glTranslate(tWidth+margin,(fontHeight+margin),0) - glColor(1,1,0,1) - glPushMatrix() - if awardDescs[awardType]:len() > 35 then - glScale(0.6,1,1) - elseif awardDescs[awardType]:len() > 20 then - glScale(0.8,1,1) - end - --fhDraw(awardCount ..') '.. awardDescs[awardType], 0,0) - fhDraw(awardDescs[awardType], 0,0) - glPopMatrix() - - glTranslate(0,0-(fontHeight/2+margin),0) - glColor(1,1,1,1) - glPushMatrix() - if record:len() > 35 then - glScale(0.6,1,1) - elseif record:len() > 20 then - glScale(0.8,1,1) - end - - fhDraw(' '..record, 0,0) - glPopMatrix() - - glPopMatrix() - - row = row + 1 - glTranslate( 0, 0 - (tHeight+margin), 0) - if row == maxRow then - row = 0 - col = col + 1 - glTranslate(margin+colSpacing, (tHeight+margin)*maxRow , 0) - end - end - end --if at least 1 award - end - - sentToPlanetWars = true - end - glPopMatrix() - glColor(0,0,0,0) -end - -function gadget:ViewResize(vsx, vsy) - bx = vsx/2 - w/2 - by = vsy/2 - h/2 -end - -gadget:ViewResize(Spring.GetViewGeometry()) - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -end diff --git a/LuaRules/Gadgets/boxcollector.lua b/LuaRules/Gadgets/boxcollector.lua deleted file mode 100644 index b64ca9710..000000000 --- a/LuaRules/Gadgets/boxcollector.lua +++ /dev/null @@ -1,86 +0,0 @@ -function gadget:GetInfo() - return { - name = "Box collector", - desc = "removes box features and gives resources to collecting player", - author = "MrSpontaneous (ak Pasha Wrangell) with help from JK; fixed by lurker (Dylan Petonke)", - date = "Nov 11 2007", - license = "GPL", - layer = 1, - enabled = true - } -end - -if (gadgetHandler:IsSyncedCode()) then ----synced---- - - local Box="ammobox" - local BoxId - local BoxesOnMap={} - local unitInRange={} - local Resources={} - local SpawnCEG = Spring.SpawnCEG - - function gadget:Initialize() - BoxId = FeatureDefNames[Box].id - Spring.Echo(Box, BoxId) - ud = Spring.GetAllFeatures () - for n,u in pairs(ud) do - if Spring.GetFeatureDefID(u) == BoxId then - BoxesOnMap[u] = 1 - end - end - end - - function gadget:GameFrame(f) - if f%10 == 1 then - for box,b in pairs(BoxesOnMap) do - local x,y,z = Spring.GetFeaturePosition(box) - local unitsInRange = Spring.GetUnitsInSphere(x,y,z, 500)--at x , y , z with radius 200 - for _,unit in ipairs(unitsInRange) do - if UnitDefs[Spring.GetUnitDefID(unit)].customParams.cancollect and select(5, Spring.GetUnitHealth(unit)) == 1 then - local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(box) --- [1] is metal, [3] is energy - Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", remM) - Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", remE) - Spring.DestroyFeature(box) - local fx, fy, fz = Spring.GetFeaturePosition(box) - Spring.PlaySoundFile("sounds/boxcollection.wav", 1, fx, fy, fz) - SpawnCEG("sparklegreenplus5", fx, fy, fz) - BoxesOnMap[box] = nil - break - end - if UnitDefs[Spring.GetUnitDefID(unit)].customParams.dronespawner and select(5, Spring.GetUnitHealth(unit)) == 1 then - Spring.CreateUnit("edrone", x, y, z, 0, Spring.GetUnitTeam(unit)) - Spring.DestroyFeature(box) - local fx, fy, fz = Spring.GetFeaturePosition(box) - Spring.PlaySoundFile("sounds/dronespawner.wav", 1, fx, fy, fz) - SpawnCEG("sparkleorangeplus1drone", fx, fy, fz) - BoxesOnMap[box] = nil - break - end - -- if (UnitDefs[Spring.GetUnitDefID(unit)].customParams.amphibdronespawner) then - -- Spring.CreateUnit("eamphibdrone", x, y, z, 0, Spring.GetUnitTeam(unit)) - -- Spring.DestroyFeature(box) - -- local fx, fy, fz = Spring.GetFeaturePosition(box) - -- Spring.PlaySoundFile("sounds/boxcollection.wav", 1, fx, fy, fz) - -- SpawnCEG("sparklegreen", fx, fy, fz) - -- BoxesOnMap[box] = nil - -- break - -- end - end - end - end - end - - function gadget:FeatureDestroyed(featureID, _) - if (BoxesOnMap[featureID]) then - BoxesOnMap[featureID] = nil - end - end - - function gadget:FeatureCreated(featureID, allyTeam) - if (Spring.GetFeatureDefID(featureID) == BoxId) then - BoxesOnMap[featureID] = 1 - end - end - -end diff --git a/LuaRules/Gadgets/camera_lockcamera.lua b/LuaRules/Gadgets/camera_lockcamera.lua new file mode 100644 index 000000000..1f7573d65 --- /dev/null +++ b/LuaRules/Gadgets/camera_lockcamera.lua @@ -0,0 +1,340 @@ +local versionNumber = "v2.91" + +function gadget:GetInfo() + return { + name = "CameraBroadcast", + desc = "sends your camera to others", + author = "Evil4Zerggin", + date = "16 January 2009", + license = "GNU LGPL, v2.1 or later", + layer = -5, + enabled = true + } +end + + +------------------------------------------------ +--config +------------------------------------------------ + +--broadcast + +local broadcastPeriod = 0.0833 --will send packet in this interval (s) + +------------------------------------------------ +--speedups +------------------------------------------------ +local GetCameraState = Spring.GetCameraState +local SetCameraState = Spring.SetCameraState +local GetCameraNames = Spring.GetCameraNames +local GetMouseState = Spring.GetMouseState +local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds +local GetMyPlayerID = Spring.GetMyPlayerID +local GetMyAllyTeamID = Spring.GetMyAllyTeamID +local GetSpectatingState = Spring.GetSpectatingState +local GetPlayerInfo = Spring.GetPlayerInfo + +local SendLuaRulesMsg = Spring.SendLuaRulesMsg + +local SendCommands = Spring.SendCommands + +local Echo = Spring.Echo +local strGMatch = string.gmatch +local strSub = string.sub +local strLen = string.len +local strByte = string.byte +local strChar = string.char + +local floor = math.floor +local ceil = math.ceil +local max = math.max +local min = math.min + + +local vfsPackU8 = VFS.PackU8 +local vfsPackF32 = VFS.PackF32 +local vfsUnpackU8 = VFS.UnpackU8 +local vfsUnpackF32 = VFS.UnpackF32 +local allowBroadcast = true + +------------------------------------------------ +--const +------------------------------------------------ +local PACKET_HEADER = "=" +local PACKET_HEADER_LENGTH = strLen(PACKET_HEADER) +if gadgetHandler:IsSyncedCode() then + + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationCam = validation + + function gadget:RecvLuaMsg(msg, playerID) + if strSub(msg, 1, PACKET_HEADER_LENGTH) ~= PACKET_HEADER or strSub(msg, 1+PACKET_HEADER_LENGTH, 1+PACKET_HEADER_LENGTH+1) ~= validation then + return + end + + SendToUnsynced("cameraBroadcast",playerID,msg) + return true + end +else + local totalTime = 0 + local timeSinceBroadcast = 0 + + local lastPacketSent + + local CAMERA_IDS = GetCameraNames() + local CAMERA_NAMES = {} + local CAMERA_STATE_FORMATS = {} + + local validation = SYNCED.validationCam + + ------------------------------------------------ + --H4X + ------------------------------------------------ + --[0, 254] -> char + local function CustomPackU8(num) + return strChar(num + 1) + end + + local function CustomUnpackU8(s, offset) + local byte = strByte(s, offset) + if byte then + return strByte(s, offset) - 1 + else + return nil + end + end + + --1 sign bit, 7 exponent bits, 8 mantissa bits, -64 bias, denorm, no infinities or NaNs, avoid zero bytes, big-Endian + local function CustomPackF16(num) + --vfsPack is little-Endian + local floatChars = vfsPackF32(num) + if not floatChars then return nil end + + local sign = 0 + local exponent = strByte(floatChars, 4) * 2 + local mantissa = strByte(floatChars, 3) * 2 + + local negative = exponent >= 256 + local exponentLSB = mantissa >= 256 + local mantissaLSB = strByte(floatChars, 2) >= 128 + + if negative then + sign = 128 + exponent = exponent - 256 + end + + if exponentLSB then + exponent = exponent - 126 + mantissa = mantissa - 256 + else + exponent = exponent - 127 + end + + if mantissaLSB then + mantissa = mantissa + 1 + end + + if exponent > 63 then + exponent = 63 + --largest representable number + mantissa = 255 + elseif exponent < -62 then + --denorm + mantissa = floor((256 + mantissa) * 2^(exponent + 62)) + --preserve zero-ness + if mantissa == 0 and num ~= 0 then + mantissa = 1 + end + exponent = -63 + end + + if mantissa ~= 255 then + mantissa = mantissa + 1 + end + + local byte1 = sign + exponent + 64 + local byte2 = mantissa + + return strChar(byte1, byte2) + end + + local function CustomUnpackF16(s, offset) + offset = offset or 1 + local byte1, byte2 = strByte(s, offset, offset + 1) + + if not (byte1 and byte2) then return nil end + + local sign = 1 + local exponent = byte1 + local mantissa = byte2 - 1 + local norm = 1 + + local negative = (byte1 >= 128) + + if negative then + exponent = exponent - 128 + sign = -1 + end + + if exponent == 1 then + exponent = 2 + norm = 0 + end + + local order = 2^(exponent - 64) + + return sign * order * (norm + mantissa / 256) + end + + ------------------------------------------------ + --packets + ------------------------------------------------ + + --does not allow spaces in keys; values are numbers + local function CameraStateToPacket(s) + + local name = s.name + local stateFormat = CAMERA_STATE_FORMATS[name] + local cameraID = CAMERA_IDS[name] + + if not stateFormat or not cameraID then return nil end + local result = PACKET_HEADER .. validation .. CustomPackU8(cameraID) .. CustomPackU8(s.mode) + + for i=1, #stateFormat do + local num = s[stateFormat[i]] + if not num then return end + result = result .. CustomPackF16(num) + end + + return result + end + + local function PacketToCameraState(p) + local offset = PACKET_HEADER_LENGTH + 1 + 2 + local cameraID = CustomUnpackU8(p, offset) + local mode = CustomUnpackU8(p, offset + 1) + local name = CAMERA_NAMES[cameraID] + local stateFormat = CAMERA_STATE_FORMATS[name] + if not (cameraID and mode and name and stateFormat) then + return nil + end + local result = { + name = name, + mode = mode, + } + + offset = offset + 2 + + for i=1, #stateFormat do + local num = CustomUnpackF16(p, offset) + + if not num then return nil end + + result[stateFormat[i]] = num + offset = offset + 2 + end + + return result + end + + + + ------------------------------------------------ + --callins + ------------------------------------------------ + + Echo(": Sorry for the camera switch spam, but this is the only reliable way to list camera states other than hardcoding them") + local prevCameraState = GetCameraState() + for name, num in pairs(CAMERA_IDS) do + CAMERA_NAMES[num] = name + SetCameraState({name=name,mode=num},0) + local packetFormat = {} + local packetFormatIndex = 1 + for stateindex in pairs(GetCameraState()) do + if stateindex ~= "mode" and stateindex ~= "name" then + packetFormat[packetFormatIndex] = stateindex + packetFormatIndex = packetFormatIndex +1 + end + end + CAMERA_STATE_FORMATS[name] = packetFormat + end + SetCameraState(prevCameraState,0) + --workaround a bug where minimap remains minimized because we switched to overview cam + SendCommands("minimap minimize") + + function gadget:Initialize() + gadgetHandler:AddSyncAction("cameraBroadcast", handleCameraBroadcastEvent) + end + + function gadget:Shutdown() + SendLuaRulesMsg(PACKET_HEADER) + gadgetHandler:RemoveSyncAction("cameraBroadcast") + end + + function handleCameraBroadcastEvent(_,playerID,msg) + local cameraState + --a packet consisting only of the header indicated that transmission has stopped + if msg ~= PACKET_HEADER then + cameraState = PacketToCameraState(msg) + if not cameraState then + Echo(": Bad packet recieved.") + return + end + end + --local myPlayerID = GetMyPlayerID() + --if myPlayerID == playerID then + -- return + --end + local spec, fullView = GetSpectatingState() + if not spec or not fullView then + local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID) + if targetSpec or allyTeamID ~= GetMyAllyTeamID() then + return + end + end + if Script.LuaUI("CameraBroadcastEvent") then + Script.LuaUI.CameraBroadcastEvent(playerID,cameraState) + end + end + + function gadget:Update() + if Spring.GetGameFrame() == 0 then + return + end + + local dt = GetLastUpdateSeconds() + totalTime = totalTime + dt + timeSinceBroadcast = timeSinceBroadcast + dt + if timeSinceBroadcast < broadcastPeriod then + return + end + + local state = GetCameraState() + local msg = CameraStateToPacket(state) + + if not msg then + Echo(": Error creating packet!") + return + end + + --don't send duplicates + if msg ~= lastPacketSent then + SendLuaRulesMsg(msg) + lastPacketSent = msg + end + + timeSinceBroadcast = timeSinceBroadcast - broadcastPeriod + end +end + diff --git a/LuaRules/Gadgets/chickens_unit_progenitor.lua b/LuaRules/Gadgets/chickens_unit_progenitor.lua deleted file mode 100644 index 9e9f82a28..000000000 --- a/LuaRules/Gadgets/chickens_unit_progenitor.lua +++ /dev/null @@ -1,94 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "ProgenitorSpawner", - desc = "Manages Splitting Chickens", - author = "TheFatController", - date = "05 November, 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (gadgetHandler:IsSyncedCode()) then - - local GetGameRulesParam = Spring.GetGameRulesParam - local GetUnitPosition = Spring.GetUnitPosition - local TestBuildOrder = Spring.TestBuildOrder - local GetGroundBlocked = Spring.GetGroundBlocked - local CreateUnit = Spring.CreateUnit - local GiveOrderToUnit = Spring.GiveOrderToUnit - -- local BOSS_WHITE1 = UnitDefNames["chickenh2"].id - -- local BOSS_WHITE2 = UnitDefNames["chickenh3"].id - - local spawnerConfig = include("gamedata/configs/survival_settings.lua") - - - local SMALLUNIT = UnitDefNames[spawnerConfig.smallUnit].id - local progList = {} - - local function getChickenSpawnLoc(unitID) - local x, z - local bx, by, bz = GetUnitPosition(unitID) - if (not bx or not by or not bz) then - return false - end - - local tries = 0 - local s = 64 - - repeat - x = math.random(bx - s, bx + s) - z = math.random(bz - s, bz + s) - s = s + 4 - tries = tries + 1 - until ((TestBuildOrder(SMALLUNIT, x, by, z, 1) == 2) and (not GetGroundBlocked(x, z))) - or (tries > 25) - return x, by, z - end - - local function spawnChicken(number, ownerID, unitName, unitTeam) - for i = 1,number,1 do - local x, y, z = getChickenSpawnLoc(ownerID) - if x then - local newChicken = CreateUnit(unitName, x,y,z, "n", unitTeam) - GiveOrderToUnit(newChicken, CMD.STOP, {}, {}) - end - end - end - - function gadget:GameFrame(n) - if n%350 == 0 then - for unitID, count in pairs(progList) do - if Spring.ValidUnitID(unitID) and (count > 0) then - spawnChicken(1, unitID, spawnerConfig.testUnit, Spring.GetUnitTeam(unitID)) - progList[unitID] = (count - 1) - else - progList[unitID] = nil - end - end - end - end - - function gadget:UnitCreated(unitID, unitDefID, unitTeam) - -- if (unitDefID == BOSS_WHITE1) then - -- progList[unitID] = 6 - -- end - end - - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - -- if (unitDefID == BOSS_WHITE1) then - -- progList[unitID] = nil - -- spawnChicken(2, unitID, "chickenh3", unitTeam) - -- elseif (unitDefID == BOSS_WHITE2) then - -- spawnChicken(2, unitID, "chickenh4", unitTeam) - -- end - end - -end \ No newline at end of file diff --git a/LuaRules/Gadgets/chickens_unit_set_neutral.lua b/LuaRules/Gadgets/chickens_unit_set_neutral.lua deleted file mode 100644 index a4f68cd3e..000000000 --- a/LuaRules/Gadgets/chickens_unit_set_neutral.lua +++ /dev/null @@ -1,67 +0,0 @@ -function gadget:GetInfo() - return { - name = "SetNeutral", - desc = "Sets Armoured Units to Neutral when closed", - author = "TheFatController", - date = "25 Nov 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (not gadgetHandler:IsSyncedCode()) then - return -end - -local spawnerConfig = include("gamedata/configs/survival_settings.lua") - -local GetUnitCOBValue = Spring.GetUnitCOBValue -local SetUnitNeutral = Spring.SetUnitNeutral -local GetUnitStates = Spring.GetUnitStates -local neutralUnits = {} -local armourTurrets = {} - -for k,_ in pairs (spawnerConfig.defenders) do - armourTurrets[UnitDefNames[k].id] = true -end - -local UPDATE = 30 -local timeCounter = 15 - -function gadget:GameFrame(n) - if (n >= timeCounter) then - timeCounter = (n + UPDATE) - for unitID,neutral in pairs(neutralUnits) do - local armoured = (GetUnitCOBValue(unitID, 20) > 0) - if neutral and (not armoured) then - SetUnitNeutral(unitID, false) - neutralUnits[unitID] = false - elseif (not neutral) and armoured then - SetUnitNeutral(unitID, true) - neutralUnits[unitID] = true - end - end - end -end - -function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - neutralUnits[unitID] = nil -end - -function gadget:UnitFinished(unitID, unitDefID, unitTeam) - if armourTurrets[unitDefID] then - if (GetUnitCOBValue(unitID, 20) == 1) then - SetUnitNeutral(unitID, true) - neutralUnits[unitID] = true - else - neutralUnits[unitID] = false - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/chickens_unit_spawner_defense.lua b/LuaRules/Gadgets/chickens_unit_spawner_defense.lua deleted file mode 100644 index 9504603fd..000000000 --- a/LuaRules/Gadgets/chickens_unit_spawner_defense.lua +++ /dev/null @@ -1,1255 +0,0 @@ -function gadget:GetInfo() - return { - name = "BA Chicken Spawner", - desc = "Spawns burrows and chickens", - author = "TheFatController, quantum", - date = "16 November, 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } -end - -if (gadgetHandler:IsSyncedCode()) then --- BEGIN SYNCED --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Speed-ups --- - - local GetUnitNeutral = Spring.GetUnitNeutral - local GetTeamList = Spring.GetTeamList - local GetTeamLuaAI = Spring.GetTeamLuaAI - local GetGaiaTeamID = Spring.GetGaiaTeamID - local SetGameRulesParam = Spring.SetGameRulesParam - local GetGameRulesParam = Spring.GetGameRulesParam - local GetTeamUnitsCounts = Spring.GetTeamUnitsCounts - local GetTeamUnitCount = Spring.GetTeamUnitCount - local GetGameSpeed = Spring.GetGameSpeed - local GetGameFrame = Spring.GetGameFrame - local GetPlayerList = Spring.GetPlayerList - local GetPlayerInfo = Spring.GetPlayerInfo - local GetGameSeconds = Spring.GetGameSeconds - local DestroyUnit = Spring.DestroyUnit - local GetTeamUnits = Spring.GetTeamUnits - local GetUnitsInCylinder = Spring.GetUnitsInCylinder - local GetUnitNearestEnemy = Spring.GetUnitNearestEnemy - local GetUnitPosition = Spring.GetUnitPosition - local GiveOrderToUnit = Spring.GiveOrderToUnit - local TestBuildOrder = Spring.TestBuildOrder - local GetGroundBlocked = Spring.GetGroundBlocked - local CreateUnit = Spring.CreateUnit - local SetUnitBlocking = Spring.SetUnitBlocking - local GetGroundHeight = Spring.GetGroundHeight - local GetUnitTeam = Spring.GetUnitTeam - local GetUnitHealth = Spring.GetUnitHealth - local GetUnitCommands = Spring.GetUnitCommands - local SetUnitExperience = Spring.SetUnitExperience - local GetUnitDefID = Spring.GetUnitDefID - local SetUnitHealth = Spring.SetUnitHealth - local GetUnitIsDead = Spring.GetUnitIsDead - local GetCommandQueue = Spring.GetCommandQueue - local spGetLocalTeamID = Spring.GetLocalTeamID - - local mRandom = math.random - local math = math - local Game = Game - local table = table - local ipairs = ipairs - local pairs = pairs - - local MAPSIZEX = Game.mapSizeX - local MAPSIZEZ = Game.mapSizeZ - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local queenLifePercent = 100 - local maxTries = 100 - local currentWave = 1 - local targetCache = 1 - local minBurrows = 1 - local timeOfLastSpawn = 0 - local timeOfLastFakeSpawn = 0 - local highTeam = 0 - local timeOfLastWave = 0 - local expMod = 0 - local burrowTarget = 0 - local qDamage = 0 - local lastTeamID = 0 - local targetCacheCount = 0 - local nextSquadSize = 0 - local chickenCount = 0 - local t = 0 - local timeCounter = 0 - local queenAnger = 0 - local bonusPoints = 0 - local burrowSpawnProgress = 0 - local queenMaxHP = 0 - local chickenDebtCount = 0 - local firstSpawn = true - local showScoresOnce = true - local gameOver = false - local qMove = false - local warningMessage = false - local computerTeams = {} - local humanTeams = {} - local disabledUnits = {} - local spawnQueue = {} - local idleOrderQueue = {} - local stunList = {} - local endScores = {} - local queenResistance = {} - local queenID - local chickenTeamID - local luaAI - local lsx1,lsz1,lsx2,lsz2 - local turrets = {} - local chickenBirths = {} - local failChickens = {} - local chickenTargets = {} - local burrows = {} - local AIfaction - - -- local EMP_GOO = {} - -- EMP_GOO[WeaponDefNames['chickenr1_goolauncher'].id] = WeaponDefNames['chickenr1_goolauncher'].damages[1] - -- EMP_GOO[WeaponDefNames['weaver_death'].id] = WeaponDefNames['weaver_death'].damages[1] - -- local LOBBER = UnitDefNames["chickenr1"].id - -- local JUNO = WeaponDefNames["juno_pulse"].id - -- local KROW_ID = UnitDefNames["corcrw"].id - -- local KROW_LASER = "krow_laser_index" - - local spawnerConfig = include("gamedata/configs/survival_settings.lua") - - local SMALL_UNIT = UnitDefNames[spawnerConfig.smallUnit].id - local MEDIUM_UNIT = UnitDefNames[spawnerConfig.mediumUnit].id - local LARGE_UNIT = UnitDefNames[spawnerConfig.largeUnit].id - local REFERENCE_UNIT = UnitDefNames[spawnerConfig.referenceUnit].id - - local modes = spawnerConfig.modes - - for i, v in ipairs(modes) do -- make it bi-directional - modes[v] = i - end - - local teams = GetTeamList() - local highestLevel = 0 - - - for _, teamID in ipairs(teams) do - local faction - Spring.Echo("-------------Survival Debug Messages---------------- ") - Spring.Echo("TEAM ",Spring.GetAIInfo(teamID)) - Spring.Echo("TEAM ",Spring.GetTeamInfo(teamID)) - Spring.Echo("---------------------------------------------------- ") - - if(GetTeamLuaAI(teamID) ~= "") then -- we found a lua ai, lets get his team! - _, _, _, _, hooffaction = Spring.GetTeamInfo(teamID) - AIfaction = hooffaction - Spring.Echo("AI FACTION: ") - Spring.Echo(hooffaction) - Spring.Echo(GetTeamLuaAI(teamID)) - end - - local teamLuaAI = GetTeamLuaAI(teamID) - if (teamLuaAI and teamLuaAI ~= "") then - local _,_,_,_,_,_,CustomTeamOptions=Spring.GetTeamInfo(teamID) - if (not CustomTeamOptions) or (not CustomTeamOptions["aioverride"]) then - luaAI = teamLuaAI - if (modes[teamLuaAI] > highestLevel) then - highestLevel = modes[teamLuaAI] - end - chickenTeamID = teamID - computerTeams[teamID] = true - else - humanTeams[teamID] = true -- chickens lua bots overriden also count as "humanTeams" - end - elseif teamID~=GetGaiaTeamID() then - humanTeams[teamID] = true -- bots not chickens also count as "humanTeams" - end - end - - luaAI = modes[highestLevel] - - Spring.Echo("Spring.GetModOptions()",#Spring.GetModOptions()) - Spring.Echo(chickenTeamID, "chickenTeamID","Spring.GetModOptions()",Spring.GetModOptions(), - "materialstorage", Spring.GetModOptions()["materialstorage"], - "StartMetal", Spring.GetModOptions()["startmetal"]) - - local gaiaTeamID = GetGaiaTeamID() - if not chickenTeamID then - if Spring.GetModOptions()["materialstorage"] == nil and - Spring.GetModOptions()["startmetal"] == nil then - chickenTeamID = gaiaTeamID - warningMessage = true - else -- no chickens, lets go! - return; - end - else - computerTeams[gaiaTeamID] = nil - end - - humanTeams[gaiaTeamID] = nil - - local gameMode = Spring.GetModOptions().comm - local placerMode = false - - if spawnerConfig.badModes[gameMode] then - return false - end - - Spring.Echo(chickenTeamID, Spring.GetModOptions()["materialstorage"] == nil and - Spring.GetModOptions()["startmetal"] == nil) - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Utility - -- - local function SetToList(set) - local list = {} - for k in pairs(set) do - table.insert(list, k) - end - return list - end - - local function SetCount(set) - local count = 0 - for k in pairs(set) do - count = count + 1 - end - return count - end - - function comma_value(amount) - local formatted = amount - while true do - formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') - if (k==0) then - break - end - end - return formatted - end - - local function getSqrDistance(x1,z1,x2,z2) - local dx,dz = x1-x2,z1-z2 - return (dx*dx)+(dz*dz) - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Difficulty - -- - if AIfaction == '' or AIfaction == nil then - local sidedata = VFS.Include("gamedata/sidedata.lua") - --default to first faction in list - AIfaction = string.lower(sidedata[1].name) - end - - Spring.Echo(AIfaction, " AIfaction") - VFS.Include("gamedata/configs/" .. AIfaction .. "_spawn_defs.lua") - - -- Spring.Echo("bonusTurret") - -- Spring.Echo(bonusTurret) - - local function SetGlobals(difficulty) - --Spring.Echo(difficulty) - for key, value in pairs(gadget.difficulties[difficulty]) do - gadget[key] = value - end - gadget.difficulties = nil - end - - SetGlobals(luaAI or defaultDifficulty) -- set difficulty - - local expIncrement = ((SetCount(humanTeams) * expStep) / queenTime) - if expStep < 0 then expIncrement = ((expStep * -1) / queenTime) end - local nextWave = ((queenTime / 8) / 60) - local gracePenalty = math.max(math.floor(((gracePeriod - 220) / burrowSpawnRate) + 0.5), 0) - chickensPerPlayer = (chickensPerPlayer * SetCount(humanTeams)) - maxBurrows = maxBurrows + math.floor(SetCount(humanTeams) * 1.334) - queenTime = (queenTime + gracePeriod) - chickenDebtCount = math.ceil((math.max((gracePeriod - 220),0) / 3)) - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Game Rules - -- - local UPDATE = 30 - - local unitCounts = {} - - local chickenDefTypes = {} - for unitName in pairs(chickenTypes) do - chickenDefTypes[UnitDefNames[unitName].id] = unitName - unitCounts[string.sub(unitName,1,-2)] = {count = 0, lastCount = 0} - end - - local defendersDefs = {} - for unitName in pairs(defenders) do - defendersDefs[UnitDefNames[unitName].id] = unitName - end - - local function SetupUnit(unitName) - SetGameRulesParam(unitName.."Count", 0) - SetGameRulesParam(unitName.."Kills", 0) - end - - SetGameRulesParam("queenTime", queenTime) - SetGameRulesParam("queenLife", queenLifePercent) - SetGameRulesParam("queenAnger", queenAnger) - SetGameRulesParam("gracePeriod", gracePeriod) - - for unitName in pairs(chickenTypes) do - SetupUnit(string.sub(unitName,1,-2)) - end - - for unitName in pairs(defenders) do - SetupUnit(string.sub(unitName,1,-2)) - end - - SetupUnit(burrowName) - - - local difficulty = modes[luaAI] or 3 - SetGameRulesParam("difficulty", difficulty) - - local function UpdateUnitCount() - local teamUnitCounts = GetTeamUnitsCounts(chickenTeamID) - local total = 0 - - for shortName in pairs(unitCounts) do - unitCounts[shortName].count = 0 - end - - for unitDefID, number in pairs(teamUnitCounts) do - if UnitDefs[unitDefID] then - local shortName = string.sub(UnitDefs[unitDefID].name,1,-2) - if unitCounts[shortName] then - unitCounts[shortName].count = unitCounts[shortName].count + number - end - end - end - - for shortName, counts in pairs(unitCounts) do - if (counts.count ~= counts.lastCount) then - SetGameRulesParam(shortName.."Count", counts.count) - counts.lastCount = counts.count - end - total = total + counts.count - end - - return total - end - - - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Clean up - -- - - local function KillOldChicken() - for unitID, birthDate in pairs(chickenBirths) do - local age = (t - birthDate) - if (age > maxAge) then - if (unitID ~= queenID) then - DestroyUnit(unitID) - chickenCount = chickenCount - 1 - chickenDebtCount = chickenDebtCount + 1 - end - end - end - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Game End Stuff - -- - - local function KillAllChicken() - local chickenUnits = GetTeamUnits(chickenTeamID) - for _, unitID in pairs(chickenUnits) do - if disabledUnits[unitID] then - DestroyUnit(unitID, false, true) - else - DestroyUnit(unitID, true) - end - end - end - - local function KillAllComputerUnits() - for teamID in pairs(computerTeams) do - local teamUnits = GetTeamUnits(teamID) - for _, unitID in pairs(teamUnits) do - if disabledUnits[unitID] then - DestroyUnit(unitID, false, true) - else - DestroyUnit(unitID, true) - end - end - end - end - - local function CalculateScores() - local totalDamage = 0 - local teamScores = {} - local totalScore = bonusPoints - for teamID in pairs(humanTeams) do - local foo = Spring.GetTeamStatsHistory(teamID,0,t) - teamScores[teamID] = foo[#foo].damageDealt - totalDamage = totalDamage + teamScores[teamID] - local teamUnits = GetTeamUnits(teamID) - for _, unitID in pairs(teamUnits) do - local defID = GetUnitDefID(unitID) - if defID then - totalScore = totalScore + UnitDefs[defID].metalCost - totalScore = totalScore + (UnitDefs[defID].energyCost / 50) - end - end - end - for teamID in pairs(humanTeams) do - teamScores[teamID] = (teamScores[teamID] / totalDamage) - teamScores[teamID] = math.ceil((totalScore * teamScores[teamID])) - if (teamID > highTeam) then - highTeam = teamID - end - end - highTeam = (highTeam + 1) - return teamScores - end - - local function DisplayScores(scoreList) - Spring.Echo(" ") - Spring.Echo("Team Scores") - Spring.Echo("-----------") - for i = 0,highTeam,1 do - if scoreList[i] then - local teamID = i - local teamScore = scoreList[i] - local playerList = Spring.GetPlayerList(teamID, false) - if playerList[1] then - Spring.SendMessage("Team" .. teamID .. " () - " .. comma_value(teamScore) .. " Points") - else - Spring.Echo("Team" .. teamID .. " (AI) - " .. comma_value(teamScore) .. " Points") - end - end - end - end - - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Spawn Dynamics - -- - - local function addChickenTarget(chickenID, targetID) - if (not targetID) or (GetUnitTeam(targetID) == chickenTeamID) or (GetUnitTeam(chickenID) ~= chickenTeamID) then - return - end - --debug--Spring.Echo(t .. " addChickenTarget " .. chickenID .. "," .. targetID) - if chickenTargets[chickenID] and chickenTargets[chickenTargets[chickenID]] then - chickenTargets[chickenTargets[chickenID]][chickenID] = nil - end - if (chickenTargets[targetID] == nil) then - chickenTargets[targetID] = {} - chickenTargets[targetID][chickenID] = targetID - chickenTargets[chickenID] = targetID - else - chickenTargets[targetID][chickenID] = targetID - chickenTargets[chickenID] = targetID - end - end - - local function AttackNearestEnemy(unitID, unitDefID, unitTeam) - local targetID = GetUnitNearestEnemy(unitID) - if (targetID) and (not GetUnitIsDead(targetID)) and (not GetUnitNeutral(targetID)) then - --debug--Spring.Echo(t .. " AttackNearestEnemy " .. unitID .. " -> " .. targetID) - local defID = GetUnitDefID(targetID) - if UnitDefs[defID] and (UnitDefs[defID].speed > 75) then - return false - end - local x,y,z = GetUnitPosition(targetID) - idleOrderQueue[unitID] = {cmd = CMD.FIGHT, params = {x,y,z}, opts = {}} - addChickenTarget(unitID, targetID) - return true - else - return false - end - end - - local function ChooseTarget() - local humanTeamList = SetToList(humanTeams) - if (#humanTeamList == 0) then - return {mRandom(1,MAPSIZEX-1),0,mRandom(1,MAPSIZEZ-1)} - end - local isDead - - if targetCache then - isDead = GetUnitIsDead(targetCache) - else -- targetcache is nil, so dead! - isDead = true - end - - if (targetCacheCount >= nextSquadSize) or isDead then - local tries = 0 - repeat - local teamID = humanTeamList[mRandom(#humanTeamList)] - if (teamID == lastTeamID) then - teamID = humanTeamList[mRandom(#humanTeamList)] - end - lastTeamID = teamID - local units = GetTeamUnits(teamID) - if units[2] then - targetCache = units[mRandom(1,#units)] - else - targetCache = units[1] - end - local slowunit = true - if tries < 5 then - if targetCache then - local defID = GetUnitDefID(targetCache) - if UnitDefs[defID] and (UnitDefs[defID].speed > 75) then - slowunit = false - end - end - end - tries = (tries + 1) - until targetCache and((not GetUnitIsDead(targetCache)) and (not GetUnitNeutral(targetCache)) and slowunit) or (tries > maxTries) - targetCacheCount = 0 - nextSquadSize = 6 + mRandom(0,4) - else - targetCacheCount = targetCacheCount + 1 - end - --debug--Spring.Echo(t .. " ChooseTarget " .. targetCache) - if targetCache then - --Spring.Echo(GetUnitPosition(targetCache)) - return {GetUnitPosition(targetCache)} - else - return {100,100,100} - end - end - - local function getChickenSpawnLoc(burrowID, size) - local x, y, z - local bx, by, bz = GetUnitPosition(burrowID) - if (not bx or not bz) then - return false - end - - local tries = 0 - local s = spawnSquare - - repeat - x = mRandom(bx - s, bx + s) - z = mRandom(bz - s, bz + s) - s = s + spawnSquareIncrement - tries = tries + 1 - if (x >= MAPSIZEX) then x = (MAPSIZEX - mRandom(1,40)) elseif (x <= 0) then x = mRandom(1,40) end - if (z >= MAPSIZEZ) then z = (MAPSIZEZ - mRandom(1,40)) elseif (z <= 0) then z = mRandom(1,40) end - until ((TestBuildOrder(size, x, by, z, 1) == 2) and (not GetGroundBlocked(x, z))) or (tries > maxTries) - - y = GetGroundHeight(x,z) - return x, y, z - - end - - - local function SpawnTurret(burrowID, turret) - - if (mRandom() > defenderChance) or (not turret) or (burrows[burrowID] >= maxTurrets) then - return - end - - local x, y, z - local bx, by, bz = GetUnitPosition(burrowID) - local tries = 0 - local s = spawnSquare - - repeat - x = mRandom(bx - s, bx + s) - z = mRandom(bz - s, bz + s) - s = s + spawnSquareIncrement - tries = tries + 1 - if (x >= MAPSIZEX) then x = (MAPSIZEX - mRandom(1,40)) elseif (x <= 0) then x = mRandom(1,40) end - if (z >= MAPSIZEZ) then z = (MAPSIZEZ - mRandom(1,40)) elseif (z <= 0) then z = mRandom(1,40) end - until (not GetGroundBlocked(x, z) or tries > maxTries) - - y = GetGroundHeight(x,z) - local unitID = CreateUnit(turret, x, y, z, "n", chickenTeamID) - idleOrderQueue[unitID] = {cmd = CMD.GUARD, params ={burrowID}, opts = {}} - SetUnitBlocking(unitID, false) - turrets[unitID] = {burrowID, t} - burrows[burrowID] = burrows[burrowID] + 1 - - end - - - local function SpawnBurrow(number) - - if (queenID) then - return - end - - local unitDefID = UnitDefNames[burrowName].id - - for i=1, (number or 1) do - local x, z - local tries = 0 - repeat - if (burrowSpawnType == "initialbox") then - x = mRandom(lsx1, lsx2) - z = mRandom(lsz1, lsz2) - elseif ((burrowSpawnType == "alwaysbox") and (tries < (maxTries / 2))) then - x = mRandom(lsx1, lsx2) - z = mRandom(lsz1, lsz2) - else - x = mRandom(spawnSquare, MAPSIZEX - spawnSquare) - z = mRandom(spawnSquare, MAPSIZEZ - spawnSquare) - end - - local y = GetGroundHeight(x, z) - tries = tries + 1 - local blocking = TestBuildOrder(REFERENCE_UNIT, x, y, z, 1) - if (blocking == 2) and (burrowSpawnType == "avoid") then - local proximity = GetUnitsInCylinder(x, z, minBaseDistance) - local vicinity = GetUnitsInCylinder(x, z, maxBaseDistance) - local humanUnitsInVicinity = false - local humanUnitsInProximity = false - for i=1,#vicinity,1 do - if (GetUnitTeam(vicinity[i]) ~= chickenTeamID) then - humanUnitsInVicinity = true - break - end - end - - for i=1,#proximity,1 do - if (GetUnitTeam(proximity[i]) ~= chickenTeamID) then - humanUnitsInProximity = true - break - end - end - - if (humanUnitsInProximity or not humanUnitsInVicinity) then - blocking = 1 - end - end - until (blocking == 2 or tries > maxTries) - - local unitID = CreateUnit(burrowName, x, 0, z, "n", chickenTeamID) - burrows[unitID] = 0 - SetUnitBlocking(unitID, false) - end - - end - - local function updateQueenLife() - if not queenID then return end - local curH, maxH = GetUnitHealth(queenID) - local lifeCheck = math.ceil(((curH/maxH)*100)-0.5) - if queenLifePercent ~= lifeCheck then - queenLifePercent = lifeCheck - SetGameRulesParam("queenLife", queenLifePercent) - end - end - - local function stunUnit(unitID, seconds) - seconds = (seconds * 30) - if stunList[unitID] then - seconds = math.max(stunList[unitID], seconds) - end - stunList[unitID] = seconds - SetUnitHealth(unitID, {paralyze=99999999}) - end - - local function SpawnQueen() - - local x, y, z - local tries = 0 - - repeat - x = mRandom(1, (MAPSIZEX-1)) - z = mRandom(1, (MAPSIZEZ-1)) - y = GetGroundHeight(x, z) - tries = tries + 1 - local blocking = TestBuildOrder(LARGE_UNIT, x, y, z, 1) - - local proximity = GetUnitsInCylinder(x, z, minBaseDistance) - local vicinity = GetUnitsInCylinder(x, z, maxBaseDistance) - local humanUnitsInVicinity = false - local humanUnitsInProximity = false - - for i=1,#vicinity,1 do - if (GetUnitTeam(vicinity[i]) ~= chickenTeamID) then - humanUnitsInVicinity = true - break - end - end - - for i=1,#proximity,1 do - if (GetUnitTeam(proximity[i]) ~= chickenTeamID) then - humanUnitsInProximity = true - break - end - end - - if (humanUnitsInProximity or not humanUnitsInVicinity) then - blocking = 1 - end - - until (blocking == 2 or tries > maxTries) - - return CreateUnit(queenName, x, y, z, "n", chickenTeamID) - - end - - - local function Wave() - --debug--Spring.Echo(t .. "Wave()") - - if gameOver then - return - end - - currentWave = math.min(math.ceil((((t-gracePeriod+queenAnger) / 60) / nextWave)), 8) - if currentWave > #waves then - currentWave = #waves - end - if queenID then - if queenSpawnMult > 0 then - for i = 1,queenSpawnMult,1 do - local squad = waves[9][mRandom(1,#waves[9])] - for i,sString in pairs(squad) do - local nEnd,_ = string.find(sString, " ") - local unitNumber = string.sub(sString,1,(nEnd-1)) - local chickenName = string.sub(sString,(nEnd+1)) - for i = 1,unitNumber,1 do - table.insert(spawnQueue, {burrow = queenID, unitName = chickenName, team = chickenTeamID}) - end - end - end - end - currentWave = 10 - end - - local cCount = 0 - for burrowID in pairs(burrows) do - if (t > (queenTime * 0.33)) then SpawnTurret(burrowID, bonusTurret) end - local squad = waves[currentWave][mRandom(1,#waves[currentWave])] - for i,sString in pairs(squad) do - local skipSpawn = false - if (cCount > chickensPerPlayer) and (mRandom() > spawnChance) then - skipSpawn = true - end - if skipSpawn and (chickenDebtCount > 0) and (mRandom() > 0.5) then - chickenDebtCount = (chickenDebtCount - 1) - skipSpawn = false - end - if not skipSpawn then - local nEnd,_ = string.find(sString, " ") - local unitNumber = string.sub(sString,1,(nEnd-1)) - local chickenName = string.sub(sString,(nEnd+1)) - for i = 1,unitNumber,1 do - table.insert(spawnQueue, {burrow = burrowID, unitName = chickenName, team = chickenTeamID}) - end - cCount = cCount + unitNumber - end - end - end - return cCount - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Get rid of the AI - -- - - local function DisableUnit(unitID) - Spring.MoveCtrl.Enable(unitID) - Spring.MoveCtrl.SetPosition(unitID, MAPSIZEX/2, 99999, MAPSIZEZ/2) - Spring.SetUnitStealth(unitID, true) - Spring.SetUnitNoDraw(unitID, true) - Spring.SetUnitNoSelect(unitID, true) - Spring.SetUnitNoMinimap(unitID, true) - Spring.SetUnitCloak(unitID, true) - SetUnitBlocking(unitID, false) - SetUnitHealth(unitID, {paralyze=99999999}) - disabledUnits[unitID] = true - end - - local function DisableComputerUnits() - for teamID in pairs(computerTeams) do - local teamUnits = GetTeamUnits(teamID) - for _, unitID in ipairs(teamUnits) do - DisableUnit(unitID) - end - end - end - - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - -- - -- Call-ins - -- - - function gadget:UnitMoveFailed(unitID, unitDefID, unitTeam) - if gameOver then - return - end - if (unitTeam ~= chickenTeamID) or (unitID == queenID) or idleOrderQueue[unitID] then - return - end - local px,py,pz = GetUnitPosition(unitID) - if failChickens[unitID] then - if (getSqrDistance(failChickens[unitID].x,failChickens[unitID].z,px,pz) < 5000) then - failChickens[unitID].count = failChickens[unitID].count + 1 - if (failChickens[unitID].count > 3) then - DestroyUnit(unitID, false, true) - chickenDebtCount = chickenDebtCount + 1 - chickenCount = chickenCount - 1 - return - end - else - failChickens[unitID].x = px - failChickens[unitID].z = pz - end - else - failChickens[unitID] = { x = px, z = pz, count = 1 } - end - if (mRandom(1,2) == 1) then - px = px + mRandom(50,100) - else - px = px - mRandom(50,100) - end - if (mRandom(1,2) == 1) then - pz = pz + mRandom(50,100) - else - pz = pz - mRandom(50,100) - end - idleOrderQueue[unitID] = {cmd = CMD.MOVE, params = {px,py,pz}, opts = {}} - end - - function gadget:UnitIdle(unitID, unitDefID, unitTeam) - if gameOver then - return - end - if (unitTeam == chickenTeamID) and (chickenDefTypes[unitDefID] or (unitID == queenID)) then - --debug--Spring.Echo(t .. " unitIdle " .. unitID) - if not AttackNearestEnemy(unitID, unitDefID, unitTeam) then - idleOrderQueue[unitID] = {cmd = CMD.FIGHT, params = ChooseTarget(), opts = {}} - if targetCache then - if GetUnitNeutral(targetCache) then - idleOrderQueue[unitID] = {cmd = CMD.ATTACK, params = {targetCache}, opts = {}} - end - addChickenTarget(unitID, targetCache) - end - end - end - end - - function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if chickenTargets[unitID] then - chickenTargets[unitID] = nil - end - end - - function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, - weaponID, attackerID, attackerDefID, attackerTeam) - - -- if EMP_GOO[weaponID] and (unitTeam ~= chickenTeamID) and (lobberEMPTime > 0) then - -- stunUnit(unitID, ((damage / EMP_GOO[weaponID]) * lobberEMPTime)) - -- end - - if chickenBirths[attackerID] then - chickenBirths[attackerID] = t - end - if failChickens[attackerID] then - failChickens[attackerID] = nil - end - if failChickens[unitID] then - failChickens[unitID] = nil - end - - -- if (unitDefID == LOBBER) then - -- local nSpawn = false - -- if ((GetUnitHealth(unitID) < 2475) and (damage < (2000 + mRandom(1,500)))) then nSpawn = true end - if ((weaponID == JUNO) and (mRandom(1,2) == 1)) then - nSpawn = true - end - - if (unitID == queenID) then - if paralyzer then - SetUnitHealth(unitID, {paralyze=0}) - return - end - if (weaponID == -1) and (damage > 25000) then - local qHealth = GetUnitHealth(unitID) - SetUnitHealth(unitID, (qHealth + damage - 25000)) - damage = 25000 - end - if attackerDefID then - if not queenResistance[weaponID] then - queenResistance[weaponID] = {} - queenResistance[weaponID].damage = damage - queenResistance[weaponID].notify = 0 - end - local resistPercent = (math.min(queenResistance[weaponID].damage/queenMaxHP, 0.75) + 0.2) - if resistPercent > 0.35 then - if queenResistance[weaponID].notify == 0 then - local weaponName - weaponName = WeaponDefs[weaponID].description - Spring.Echo("Battleship is becoming resistant to " .. UnitDefs[attackerDefID].humanName .. "'s attacks (" .. weaponName .. ")") - queenResistance[weaponID].notify = 1 - end - local qHealth = GetUnitHealth(unitID) - SetUnitHealth(unitID, (qHealth + (damage * resistPercent))) - damage = damage - (damage * resistPercent) - end - queenResistance[weaponID].damage = queenResistance[weaponID].damage + damage - end - qDamage = (qDamage + damage) - if (qDamage > (queenMaxHP/10)) then - if qMove then - idleOrderQueue[queenID] = {cmd = CMD.STOP, params = {}, opts = {}} - qMove = false - qDamage = 0 - mRandom(1,25000) - else - local cC = ChooseTarget() - local xQ, _, zQ = GetUnitPosition(queenID) - if cC then - local angle = math.atan2((cC[1]-xQ), (cC[3]-zQ)) - local dist = math.sqrt(((cC[1]-xQ)*(cC[1]-xQ))+((cC[3]-zQ)*(cC[3]-zQ))) * 0.75 - if (dist > 800) and (dist < 3000) then - GiveOrderToUnit(queenID, CMD.MOVE, {(xQ + (math.sin(angle) * dist)), cC[2], (zQ + (math.cos(angle) * dist))}, {}) - GiveOrderToUnit(queenID, CMD.FIGHT, cC, {"shift"}) - if targetCache then addChickenTarget(queenID, targetCache) end - qDamage = (0 - mRandom(1,25000)) - Wave() - qMove = true - else - idleOrderQueue[queenID] = {cmd = CMD.STOP, params = {}, opts = {}} - qDamage = 0 - Wave() - end - else - idleOrderQueue[queenID] = {cmd = CMD.STOP, params = {}, opts = {}} - qDamage = 0 - end - end - end - end - end - - function gadget:GameStart() - Spring.Echo("GameStart() chickenTeamID",chickenTeamID) - if warningMessage then - Spring.Echo("Warning: No Survival bot team available, adding a Survival bot") - Spring.Echo("(Assigning Survival bot Team to Gaia)") - Spring.SendCommands("endgraph 0") -- it's an ugly broken hack, but the only one I found - end - DisableComputerUnits() - if (burrowSpawnType == "initialbox") or (burrowSpawnType == "alwaysbox") then - local _,_,_,_,_,luaAllyID = Spring.GetTeamInfo(chickenTeamID) - if luaAllyID then - lsx1,lsz1,lsx2,lsz2 = Spring.GetAllyTeamStartBox(luaAllyID) - if (not lsx1) or (not lsz1) or (not lsx2) or (not lsz2) then - burrowSpawnType = "avoid" - Spring.Echo("No Survival mode start box available, Burrow Placement set to 'Avoid Players'") - elseif (lsx1 == 0) and (lsz1 == 0) and (lsx2 == Game.mapSizeX) and (lsz2 == Game.mapSizeX) then - burrowSpawnType = "avoid" - Spring.Echo("No Survival mode start box available, Burrow Placement set to 'Avoid Players'") - end - end - end - end - - function gadget:GameFrame(n) - - if gameOver then return end - - if (chickenCount < maxChicken) then - local i,defs = next(spawnQueue) - if i and defs then - local x, y, z = getChickenSpawnLoc(defs.burrow, SMALL_UNIT) - if x and y and z then - local myUnit = defs.unitName - if (chickenSwitches[difficulty] and chickenSwitches[difficulty][defs.unitName])then - myUnit = chickenSwitches[difficulty][defs.unitName] - end - local unitID = CreateUnit(myUnit, x,y,z, "n", defs.team) - if unitID then - SetUnitExperience(unitID, expMod) - idleOrderQueue[unitID] = {cmd = CMD.FIGHT, params = ChooseTarget(), opts = {}} - if targetCache then - if GetUnitNeutral(targetCache) then - idleOrderQueue[unitID] = {cmd = CMD.ATTACK, params = {targetCache}, opts = {}} - end - addChickenTarget(unitID, targetCache) - end - chickenBirths[unitID] = t - chickenCount = chickenCount + 1 - end - end - spawnQueue[i] = nil - end - end - - for unitID in pairs(stunList) do - stunList[unitID] = (stunList[unitID] - 1) - if (stunList[unitID] <= 0) then - SetUnitHealth(unitID, {paralyze=0}) - stunList[unitID] = nil - end - end - - if (n >= timeCounter) then - timeCounter = (n + UPDATE) - - t = GetGameSeconds() - KillOldChicken() - - if (t < gracePeriod) then return end - - expMod = (expMod + expIncrement) - - if next(idleOrderQueue) then - local processOrderQueue = {} - for unitID,order in pairs(idleOrderQueue) do - if GetUnitDefID(unitID) then - processOrderQueue[unitID] = order - end - end - idleOrderQueue = {} - for unitID,order in pairs(processOrderQueue) do - GiveOrderToUnit(unitID, order.cmd, order.params, order.opts) - GiveOrderToUnit(unitID, CMD.MOVE_STATE, { mRandom(0,2) }, {}) - end - end - - if (t >= (queenTime - queenAnger)) then - if (not queenID) and (not gameOver) then - queenID = SpawnQueen() - idleOrderQueue[queenID] = {cmd = CMD.STOP, params = {}, opts = {}} - _G.chickenEventArgs = {type="queen"} - SendToUnsynced("ChickenEvent") - _G.chickenEventArgs = nil - _,queenMaxHP = GetUnitHealth(queenID) - SetUnitExperience(queenID, (expMod*1.5)) - chickenSpawnRate = (chickenSpawnRate * 0.75) - end - updateQueenLife() - end - - local quicken = 0 - local burrowCount = SetCount(burrows) - - if (burrowTarget > 0) and (burrowTarget ~= burrowCount) then - quicken = (burrowSpawnRate * (1 - (burrowCount / burrowTarget))) - end - - local burrowSpawnTime = (burrowSpawnRate - quicken) - - if (burrowSpawnRate < (t - timeOfLastFakeSpawn) and burrowCount < maxBurrows) then - if firstSpawn then - minBurrows = SetCount(humanTeams) - local hteamID = next(humanTeams) - local ranCount = GetTeamUnitCount(hteamID) - for i = 1,ranCount,1 do - mRandom() - end - burrowTarget = math.min(math.ceil(minBurrows * 1.5) + gracePenalty, 40) - else - burrowTarget = burrowTarget + 1 - end - timeOfLastFakeSpawn = t - end - - if (burrowCount < minBurrows) or (burrowSpawnTime < (t - timeOfLastSpawn) and burrowCount < maxBurrows) then - if firstSpawn then - for i = 1,math.min(math.ceil((SetCount(humanTeams) * 1.5)) + gracePenalty, 40),1 do - SpawnBurrow() - end - timeOfLastWave = (t - (chickenSpawnRate - 6)) - firstSpawn = false - if (burrowSpawnType == "initialbox") then - burrowSpawnType = "avoid" - end - else - SpawnBurrow() - end - if (burrowCount >= minBurrows) then - timeOfLastSpawn = t - end - _G.chickenEventArgs = {type="burrowSpawn"} - SendToUnsynced("ChickenEvent") - _G.chickenEventArgs = nil - SetGameRulesParam("roostCount", SetCount(burrows)) - end - - if (burrowCount > 0) and (chickenSpawnRate < (t - timeOfLastWave)) then - local cCount = Wave() - if cCount and cCount > 0 and (not queenID) then - _G.chickenEventArgs = {type="wave", number=cCount, tech=currentWave} - SendToUnsynced("ChickenEvent") - _G.chickenEventArgs = nil - end - timeOfLastWave = t - end - chickenCount = UpdateUnitCount() - end - end - - function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - --debug--Spring.Echo(t .. " UnitDestroyed " .. unitID) - if gameOver then - return - end - - if chickenBirths[unitID] then - chickenBirths[unitID] = nil - end - - if turrets[unitID] then - turrets[unitID] = nil - end - - if idleOrderQueue[unitID] then - idleOrderQueue[unitID] = nil - end - - if failChickens[unitID] then - failChickens[unitID] = nil - end - - if chickenTargets[unitID] then - if (unitTeam ~= chickenTeamID) then - --debug--Spring.Echo(t .. " chickenTargets " .. unitID) - for chickenID in pairs(chickenTargets[unitID]) do - --debug--Spring.Echo(t .. " stopChicken " .. chickenID) - if GetUnitDefID(chickenID) then - idleOrderQueue[chickenID] = {cmd = CMD.STOP, params = {}, opts = {}} - end - end - elseif chickenTargets[chickenTargets[unitID]] then - chickenTargets[chickenTargets[unitID]][unitID] = nil - end - chickenTargets[unitID] = nil - end - - if (unitID == targetCache) then - targetCache = nil - targetCacheCount = math.huge - end - - if (unitTeam == chickenTeamID) and chickenDefTypes[unitDefID] then - local name = UnitDefs[unitDefID].name - if unitDefID ~= burrowDef then - name = string.sub(name,1,-2) - end - local kills = GetGameRulesParam(name.."Kills") - SetGameRulesParam(name.."Kills", kills + 1) - chickenCount = chickenCount - 1 - end - - if (unitID == queenID) then - queenID = nil - gameOver = true - endScores = CalculateScores() - endScores.type = "scores" - _G.chickenEventArgs = endScores - SendToUnsynced("ChickenEvent") - _G.chickenEventArgs = nil - KillAllComputerUnits() - KillAllChicken() - end - - if (unitDefID == burrowDef) and (not gameOver) then - - local kills = GetGameRulesParam(burrowName.."Kills") - SetGameRulesParam(burrowName.."Kills", kills + 1) - - burrows[unitID] = nil - if (addQueenAnger == 1) then - queenAnger = (queenAnger + angerBonus) - expMod = (expMod + (expIncrement * angerBonus)) - SetGameRulesParam("queenAnger", queenAnger) - bonusPoints = (bonusPoints + 2500) - end - - for i,defs in pairs(spawnQueue) do - if (defs.burrow == unitID) then - spawnQueue[i] = nil - end - end - - SetGameRulesParam("roostCount", SetCount(burrows)) - end - - end - - function gadget:TeamDied(teamID) - if humanTeams[teamID] then - if (minBurrows > 1) then - minBurrows = (minBurrows - 1) - end - end - humanTeams[teamID] = nil - computerTeams[teamID] = nil - if gameOver and showScoresOnce then - DisplayScores(endScores) - showScoresOnce = false - end - end - - function gadget:UnitTaken(unitID, unitDefID, oldTeam, newTeam) - if (oldTeam == chickenTeamID) then - DestroyUnit(unitID, true) - end - end - - function gadget:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) - if (newTeam == chickenTeamID) then - return false - else - return true - end - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- -else - -- END SYNCED - -- BEGIN UNSYNCED - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local Script = Script - local SYNCED = SYNCED - - function WrapToLuaUI() - if (Script.LuaUI('ChickenEvent')) then - local chickenEventArgs = {} - for k, v in spairs(SYNCED.chickenEventArgs) do - chickenEventArgs[k] = v - end - Script.LuaUI.ChickenEvent(chickenEventArgs) - end - end - - function gadget:Initialize() - gadgetHandler:AddSyncAction('ChickenEvent', WrapToLuaUI) - end - -end diff --git a/LuaRules/Gadgets/cmd_alliance_break.lua b/LuaRules/Gadgets/cmd_alliance_break.lua new file mode 100644 index 000000000..f74e43209 --- /dev/null +++ b/LuaRules/Gadgets/cmd_alliance_break.lua @@ -0,0 +1,157 @@ +function gadget:GetInfo() + return { + name = "Unally on demand", + desc = "Removes an alliance when a dynamic ally attemps to backstab", + author = "BD", + date = "-", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if (not gadgetHandler:IsSyncedCode()) then + return +end + +if Spring.GetModOptions() and tonumber(Spring.GetModOptions().fixedallies) and (tonumber(Spring.GetModOptions().fixedallies) ~= 0) then + return --no use if alliances are disabled +end + +local GetUnitDefID = Spring.GetUnitDefID +local AreTeamsAllied = Spring.AreTeamsAllied +local GetUnitsInSphere = Spring.GetUnitsInSphere +local GetUnitTeam = Spring.GetUnitTeam +local GetUnitAllyTeam = Spring.GetUnitAllyTeam +local GetTeamList = Spring.GetTeamList +local GetAllyTeamList = Spring.GetAllyTeamList +local GetUnitHealth = Spring.GetUnitHealth +local GetUnitsInCylinder = Spring.GetUnitsInCylinder +local SendMessageToTeam = Spring.SendMessageToTeam +local GetTeamInfo = Spring.GetTeamInfo +local GetPlayerInfo = Spring.GetPlayerInfo +local SetAlly = Spring.SetAlly +local ValidUnitID = Spring.ValidUnitID +local min = math.min + +local CMD_UNIT_SET_TARGET = 34923 +local CMD_UNIT_SET_TARGET_RECTANGLE = 34925 +local CMD_ATTACK = CMD.ATTACK +local CMD_LOOPBACKATTACK = CMD.LOOPBACKATTACK +local CMD_MANUALFIRE = CMD.MANUALFIRE + +local UPDATE_RATE = 3 --in times per second ( max one time per sim frame ) +local UPDATE_FRAMES = math.floor(Game.gameSpeed/UPDATE_RATE) + +local attackAOEs = {} +local attackDamages = {} +local allianceStatus = {} + + +for unitDefID, unitDef in pairs(UnitDefs) do + for weaponIndex, weaponProperties in pairs(unitDef.weapons) do + local weaponDef = WeaponDefs[weaponProperties.weaponDef] + if weaponDef.damageAreaOfEffect > (attackAOEs[unitDefID] or 0) then + attackAOEs[unitDefID] = weaponDef.damageAreaOfEffect + attackDamages[unitDefID] = weaponDef.damages + end + end +end + +function getTeamLeaderName(teamID) + return GetPlayerInfo(select(2,GetTeamInfo(teamID))) +end + +function gadget:GameFrame(n) + if n%UPDATE_FRAMES ~= 0 then + return + end + for _,allyTeamAID in pairs(GetAllyTeamList()) do + for _,allyTeamBID in pairs(GetAllyTeamList()) do + if allyTeamAID ~= allyTeamBID then + for _,teamAID in pairs(GetTeamList(allyTeamAID)) do + for _,teamBID in pairs(GetTeamList(allyTeamBID)) do + allianceStatus[teamAID] = allianceStatus[teamAID] or {} + allianceStatus[teamBID] = allianceStatus[teamBID] or {} + local AalliedToB = AreTeamsAllied(teamBID,teamAID) + local BalliedToA = AreTeamsAllied(teamAID,teamBID) + --if teamB's cached value is allied back with A, and new teamB's allied status is not allied, means the enemy broke alliance with us + if allianceStatus[teamBID][teamAID] and not BalliedToA then + if AalliedToB then + --if we're allied, break our alliance back + SetAlly(teamBID,teamAID,false) + SendMessageToTeam(teamAID,"Team " .. teamBID .. " (" .. getTeamLeaderName(teamBID) .. ") has unallied with you, breaking dynamic alliance.") + else + SendMessageToTeam(teamAID,"Team " .. teamBID .. " (" .. getTeamLeaderName(teamBID) .. ") broke his alliance with you.") + end + end + --if teamB wasn't allied with teamA, and now it is, inform teamA about the change + if not allianceStatus[teamBID][teamAID] and BalliedToA then + SendMessageToTeam(teamAID,"Team " .. teamBID .. " (" .. getTeamLeaderName(teamBID) .. ") has allied with you.") + end + allianceStatus[teamAID][teamBID] = AalliedToB + end + end + end + end + end +end + +function checkAndBreakAlliance(attackerTeam,targetTeam,attackerAllyTeam,targetAllyTeam) + if AreTeamsAllied(attackerTeam,targetTeam) and targetAllyTeam ~= attackerAllyTeam then + SetAlly(attackerTeam,targetTeam,false) + SendMessageToTeam(targetTeam,"Team " .. attackerTeam .. " (" .. getTeamLeaderName(attackerTeam) .. ") attempted to attack you, breaking dynamic alliance.") + return true + end +end + + +function gadget:UnitCommand(unitID, unitDefID, attackerTeam, cmdID, cmdParams, cmdOpts, cmdTag) + if #cmdParams == 1 and (cmdID == CMD_ATTACK or cmdID == CMD_LOOPBACKATTACK or cmdID == CMD_MANUALFIRE) then + local targetID = cmdParams[1] + if ValidUnitID(targetID) then + checkAndBreakAlliance(attackerTeam,GetUnitTeam(targetID),GetUnitAllyTeam(unitID),GetUnitAllyTeam(targetID)) + end + elseif #cmdParams >= 3 and (cmdID == CMD_ATTACK or cmdID == CMD_LOOPBACKATTACK or cmdID == CMD_SET_TARGET or cmdID == CMD_UNIT_SET_TARGET_RECTANGLE or cmdID == CMD_MANUALFIRE ) then + local attackAOE = attackAOEs[unitDefID] + if not attackAOE then + return + end + local targetAllyTeamIDs = {} + local attackerAllyTeam = GetUnitAllyTeam(unitID) + local totalDamageSum = 0 + local targetAllyTeamToTeam = {} + for _,targetID in pairs(GetUnitsInSphere(cmdParams[1],cmdParams[2],cmdParams[3],attackAOE)) do + local targetAllyTeam = GetUnitAllyTeam(targetID) + local targetDefID = GetUnitDefID(targetID) + local targetDef = UnitDefs[targetDefID] + local targetHp = GetUnitHealth(targetID) + local targetDamage = min(targetHp,attackDamages[unitDefID][targetDef.armorType]) + totalDamageSum = totalDamageSum + targetDamage + targetAllyTeamIDs[targetAllyTeam] = (targetAllyTeamIDs[targetAllyTeam] or 0) + targetDamage + end + --if an allyteam receives more damage than the others, and it's allied to the attacker, de-ally + for targetAllyTeam,damage in pairs(targetAllyTeamIDs) do + damage = damage / totalDamageSum + if damage > 0.5 then + for _,targetTeam in pairs(GetTeamList(targetAllyTeam)) do + checkAndBreakAlliance(attackerTeam,targetTeam,attackerAllyTeam,targetAllyTeam) + end + break + end + end + elseif #cmdParams == 4 and (cmdID == CMD_ATTACK or cmdID == CMD_LOOPBACKATTACK) then + local attackerAllyTeam = GetUnitAllyTeam(unitID) + for _,targetID in pairs(GetUnitsInCylinder(cmdParams[1],cmdParams[3],cmdParams[4])) do + checkAndBreakAlliance(attackerTeam,GetUnitTeam(targetID),attackerAllyTeam,GetUnitAllyTeam(targetID)) + end + end +end + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/cmd_areaguard.lua b/LuaRules/Gadgets/cmd_areaguard.lua index 05605f9ec..2fe5d628b 100644 --- a/LuaRules/Gadgets/cmd_areaguard.lua +++ b/LuaRules/Gadgets/cmd_areaguard.lua @@ -1 +1,183 @@ --------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "Area Guard", desc = "Replace Guard with Area Guard", author = "CarRepairer", date = "2013-06-12", license = "GNU GPL, v2 or later", layer = 0, enabled = true, } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- includes include "LuaRules/Configs/customcmds.h.lua" local echo = Spring.Echo -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- if gadgetHandler:IsSyncedCode() then -- SYNCED -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- vars local areaGuardCmd = { id = CMD_AREA_GUARD, name = "Guard2", action = "areaguard", cursor = 'Guard', type = CMDTYPE.ICON_UNIT_OR_AREA, tooltip = "Guard the unit or units", --hidden = true, } -------------------------------------------------------------------------------- -- functions local function DoAreaGuard( unitID, unitTeam, unitTeam, cmdParams, cmdOptions ) local cmdOptions2 = {} if (cmdOptions.shift) then table.insert(cmdOptions2, "shift") end if (cmdOptions.alt) then table.insert(cmdOptions2, "alt") end if (cmdOptions.ctrl) then table.insert(cmdOptions2, "ctrl") end if (cmdOptions.right) then table.insert(cmdOptions2, "right") end if #cmdParams == 1 then Spring.GiveOrderToUnit(unitID, CMD.GUARD, {cmdParams[1]}, cmdOptions2) return end if (not cmdOptions.shift) then Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, cmdOptions2) table.insert(cmdOptions2, "shift") end local alreadyGuarding = {} local cmdQueue = Spring.GetCommandQueue(unitID, -1); for _,cmd in ipairs(cmdQueue) do if cmd.id == CMD.GUARD and #cmd.params == 1 then alreadyGuarding[ cmd.params[1] ] = true end end local units = Spring.GetUnitsInSphere( unpack(cmdParams) ) for _,otherUnitID in ipairs( units ) do if otherUnitID ~= unitID and not alreadyGuarding[otherUnitID] then local teamID = Spring.GetUnitTeam(otherUnitID) if Spring.AreTeamsAllied( unitTeam, teamID ) then Spring.GiveOrderToUnit(unitID, CMD.GUARD, {otherUnitID}, cmdOptions2) end end end end -------------------------------------------------------------------------------- -- callins function gadget:UnitCreated(unitID, unitDefID, team) local cmdDescID = Spring.FindUnitCmdDesc(unitID, CMD.GUARD) if cmdDescID then local cmdArray = {hidden = true} Spring.EditUnitCmdDesc(unitID, cmdDescID, cmdArray) Spring.InsertUnitCmdDesc(unitID, 500, areaGuardCmd) end end function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) if cmdID == CMD_AREA_GUARD then DoAreaGuard( unitID, unitTeam, unitTeam, cmdParams, cmdOptions ) return false end return true end function gadget:Initialize() for _, unitID in ipairs(Spring.GetAllUnits()) do local unitDefID = Spring.GetUnitDefID(unitID) --local team = spGetUnitTeam(unitID) gadget:UnitCreated(unitID, unitDefID, team) end end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- else -- UNSYNCED ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- local function SelectedUnitCanRepair() -- cache this? local selUnits = Spring.GetSelectedUnits() if not selUnits[1] then return nil -- no selected units end local unitID, unitDefID local canRepair for i = 1, #selUnits do unitID = selUnits[i] unitDefID = Spring.GetUnitDefID(unitID) if not unitDefID then return end local ud = UnitDefs[unitDefID] if ud.canRepair then return true end end return false end -------------------------------------------------------------------------------- -- callins function gadget:DefaultCommand(type,id) --echo 'DefaultCommand' if type == 'unit' then local target_team = Spring.GetUnitTeam(id) if Spring.AreTeamsAllied( target_team, Spring.GetLocalTeamID() ) then if SelectedUnitCanRepair() then local hp, maxHp,_,_,buildProgress = Spring.GetUnitHealth(id) if not buildProgress or buildProgress < 1 or hp < maxHp then return -- let the default command be repair end end return CMD_AREA_GUARD end end end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Area Guard", + desc = "Replace Guard with Area Guard", + author = "CarRepairer", + date = "2013-06-12", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- includes + +include "LuaRules/Configs/customcmds.h.lua" + +local echo = Spring.Echo + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if gadgetHandler:IsSyncedCode() then -- SYNCED +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-------------------------------------------------------------------------------- +-- vars + + +local areaGuardCmd = { + id = CMD_AREA_GUARD, + name = [[Area +Guard]], + action = "areaguard", + cursor = 'Guard', + type = CMDTYPE.ICON_UNIT_OR_AREA, + tooltip = "Guard a single unit or multiple units in an area. Click once for guarding a single unit, click and drag to issue guard orders for all the units within the area.", + --hidden = true, +} + + +-------------------------------------------------------------------------------- +-- functions + +local function DoAreaGuard( unitID, unitTeam, unitTeam, cmdParams, cmdOptions ) + local cmdOptions2 = {} + if (cmdOptions.shift) then table.insert(cmdOptions2, "shift") end + if (cmdOptions.alt) then table.insert(cmdOptions2, "alt") end + if (cmdOptions.ctrl) then table.insert(cmdOptions2, "ctrl") end + if (cmdOptions.right) then table.insert(cmdOptions2, "right") end + + if #cmdParams == 1 then + Spring.GiveOrderToUnit(unitID, CMD.GUARD, {cmdParams[1]}, cmdOptions2) + return + end + + if (not cmdOptions.shift) then + Spring.GiveOrderToUnit(unitID, CMD.STOP, {}, cmdOptions2) + table.insert(cmdOptions2, "shift") + end + + local alreadyGuarding = {} + local cmdQueue = Spring.GetCommandQueue(unitID, -1); + for _,cmd in ipairs(cmdQueue) do + if cmd.id == CMD.GUARD and #cmd.params == 1 then + alreadyGuarding[ cmd.params[1] ] = true + end + end + + local units = Spring.GetUnitsInSphere( unpack(cmdParams) ) + for _,otherUnitID in ipairs( units ) do + if otherUnitID ~= unitID and not alreadyGuarding[otherUnitID] then + local teamID = Spring.GetUnitTeam(otherUnitID) + if Spring.AreTeamsAllied( unitTeam, teamID ) then + Spring.GiveOrderToUnit(unitID, CMD.GUARD, {otherUnitID}, cmdOptions2) + end + end + end + +end + + + +-------------------------------------------------------------------------------- +-- callins + + + +function gadget:UnitCreated(unitID, unitDefID, team) + local cmdDescID = Spring.FindUnitCmdDesc(unitID, CMD.GUARD) + if cmdDescID then + local cmdArray = {hidden = true} + Spring.EditUnitCmdDesc(unitID, cmdDescID, cmdArray) + Spring.InsertUnitCmdDesc(unitID, 500, areaGuardCmd) + end +end + +function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) + if cmdID == CMD_AREA_GUARD then + DoAreaGuard( unitID, unitTeam, unitTeam, cmdParams, cmdOptions ) + return false + end + + return true +end + +function gadget:Initialize() + for _, unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = Spring.GetUnitDefID(unitID) + --local team = spGetUnitTeam(unitID) + gadget:UnitCreated(unitID, unitDefID, team) + end +end + + + + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- +else -- UNSYNCED +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + + +local function SelectedUnitCanRepair() -- cache this? + local selUnits = Spring.GetSelectedUnits() + if not selUnits[1] then + return nil -- no selected units + end + local unitID, unitDefID + local canRepair + for i = 1, #selUnits do + unitID = selUnits[i] + unitDefID = Spring.GetUnitDefID(unitID) + if not unitDefID then + return + end + local ud = UnitDefs[unitDefID] + if ud.canRepair then + return true + end + end + return false +end + + + +-------------------------------------------------------------------------------- +-- callins + +--[[ +function gadget:DefaultCommand(type,id) + --echo 'DefaultCommand' + if type == 'unit' then + + local target_team = Spring.GetUnitTeam(id) + if Spring.AreTeamsAllied( target_team, Spring.GetLocalTeamID() ) then + if SelectedUnitCanRepair() then + local hp, maxHp,_,_,buildProgress = Spring.GetUnitHealth(id) + if not buildProgress or buildProgress < 1 or hp < maxHp then + return -- let the default command be repair + end + end + + return CMD_AREA_GUARD + end + end +end +]]-- + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- +end +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/cmd_get_player_data.lua b/LuaRules/Gadgets/cmd_get_player_data.lua new file mode 100644 index 000000000..b80bf1f3d --- /dev/null +++ b/LuaRules/Gadgets/cmd_get_player_data.lua @@ -0,0 +1,218 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Get Player Data", + desc = "", + author = "Floris", + date = "July 2018", + license = "GNU GPL, v2 or later", + layer = -math.huge, + enabled = true + } +end + +local authorized = { + ['[Evo]Forboding_Angel'] = true, + ["[teh]Flow"] = true, + ['Player'] = true, +} + +if (gadgetHandler:IsSyncedCode()) then + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + local validation = randomString(2) + _G.validationPlayerData = validation + + function gadget:RecvLuaMsg(msg, player) + if msg:sub(1,2)=="pd" and msg:sub(3,4)==validation then + local name = Spring.GetPlayerInfo(player) + local data = string.sub(msg, 6) + local playerallowed = string.sub(msg, 5, 5) + + SendToUnsynced("SendToWG", playerallowed..name..";"..data) + return true + end + end + +else + + local validation = SYNCED.validationPlayerData + + function gadget:Initialize() + gadgetHandler:AddSyncAction("SendToWG", SendToWG) + end + + function lines(str) + local t = {} + local function helper(line) table.insert(t, line) return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t + end + + function gadget:GotChatMsg(msg, player) + local myPlayerName,_,mySpec = Spring.GetPlayerInfo(player) + if not authorized[myPlayerName] then + return + end + if string.sub(msg,1,9) == "getconfig" then + local playerName = string.sub(msg, 11) + if playerName == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) then + local data = VFS.LoadFile("LuaUI/Config/BA.lua") + if data then + data = string.sub(data, 1, 200000) + local sendtoauthedplayer = '1' + Spring.SendLuaRulesMsg('pd'..validation..sendtoauthedplayer..'config;'..player..';'..VFS.ZlibCompress(data)) + end + end + elseif string.sub(msg,1,10) == "getinfolog" then + local playerName = string.sub(msg, 12) + if playerName == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) then + local userconfig + local data = '' + local skipline = false + local fileLines = lines(VFS.LoadFile("infolog.txt")) + for i, line in ipairs(fileLines) do + if not userconfig and string.find(line, '============== ==============') then + userconfig = '' + end + if not userconfigComplete then + if userconfig then + if string.find(line, '============== ==============') then + userconfig = userconfig .. '============== ==============\n' + userconfigComplete = true + else + userconfig = userconfig .. line .. '\n' + end + end + else + skipline = false + -- filter paths for privacy reasons + if string.find(line, 'Using read-') or + string.find(line, 'Scanning: ') or + string.find(line, 'Recording demo to: ') or + string.find(line, 'Loading StartScript from: ') or + string.find(line, 'Writing demo: ') or + string.find(line, 'command-line args: ') or + string.find(line, 'Using configuration source: ') + then + skipline = true + end + if not skipline then + data = data .. line .. '\n' + end + end + end + data = userconfig .. data + if data then + data = string.sub(data, 1, 250000) + local sendtoauthedplayer = '1' + Spring.SendLuaRulesMsg('pd'..validation..sendtoauthedplayer..'infolog;'..player..';'..VFS.ZlibCompress(data)) + end + end + elseif string.sub(msg,1,13) == 'getscreenshot' then + if not mySpec and myPlayerName ~= 'Player' then + Spring.SendMessageToPlayer(player, 'Taking screenshots is disabled when you are a player') + return + end + queueScreenShotWidth = 200 + queueScreenShotHeightBatch = 4 + + local playerName = string.sub(msg, 15) + if string.sub(msg,1,15) == 'getscreenshothq' then + queueScreenShotWidth = 300 + queueScreenShotHeightBatch = 3 + playerName = string.sub(msg, 17) + end + if string.sub(msg,1,15) == 'getscreenshotlq' then + queueScreenShotWidth = 140 + queueScreenShotHeightBatch = 5 + playerName = string.sub(msg, 17) + end + if playerName == select(1, Spring.GetPlayerInfo(Spring.GetMyPlayerID())) then + local vsx, vsy = Spring.GetViewGeometry() + queueScreenshot = true + queueScreenshotGameframe = Spring.GetGameFrame() + queueScreenShotHeight = math.floor(queueScreenShotWidth*(vsy/vsx)) + queueScreenShotStep = vsx/queueScreenShotWidth + queueScreenShotH = 0 + queueScreenShotHmax = queueScreenShotH + queueScreenShotHeightBatch + queueScreenShotPixels = {} + --queueScreenShotBroadcastDelay = 1 + queueScreenShotBroadcastChars = 0 + queueScreenShotCharsPerBroadcast = 7500 -- in practice this will be a bit higher because it finishes adding a whole row of pixels + end + end + end + + local sec = 0 + function gadget:Update(dt) + if queueScreenshot then + sec = sec + Spring.GetLastUpdateSeconds() + if sec > 0.03 then + sec = 0 + local r,g,b + while queueScreenShotH < queueScreenShotHmax do + queueScreenShotH = queueScreenShotH + 1 + for w=1, queueScreenShotWidth do + r,g,b = gl.ReadPixels(math.floor(queueScreenShotStep*(w-0.5)),math.floor(queueScreenShotStep*(queueScreenShotH-0.5)),1,1) + queueScreenShotBroadcastChars = queueScreenShotBroadcastChars + 3 + queueScreenShotPixels[#queueScreenShotPixels+1] = DEC_CHAR(r*94)..DEC_CHAR(g*94)..DEC_CHAR(b*94) + end + end + + queueScreenShotHmax = queueScreenShotHmax + queueScreenShotHeightBatch + if queueScreenShotHmax > queueScreenShotHeight then + queueScreenShotHmax = queueScreenShotHeight + end + if queueScreenShotBroadcastChars >= queueScreenShotCharsPerBroadcast or queueScreenShotH >= queueScreenShotHeight then + local finished = '0' + if queueScreenShotH >= queueScreenShotHeight then + finished = '1' + end + local data = finished .. ';' .. queueScreenShotWidth .. ';' .. queueScreenShotHeight .. ';' .. queueScreenshotGameframe .. ';' .. table.concat(queueScreenShotPixels) + local sendtoauthedplayer = '0' + Spring.SendLuaRulesMsg('pd'..validation..sendtoauthedplayer..'screenshot;'..VFS.ZlibCompress(data)) + queueScreenShotBroadcastChars = 0 + queueScreenShotPixels = {} + pixels = nil + data = nil + if finished == '1' then + queueScreenshot = nil + end + end + end + end + end + + function DEC_CHAR(IN) + local B,K,OUT,I,D=95,"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ !@#$%^&*()_+-=[]{};:,./<>?~|`'\"\\","",0 + while IN>0 do + I=I+1 + IN,D=math.floor(IN/B),math.modf(IN,B)+1 + OUT=string.sub(K,D,D)..OUT + end + if OUT == '' then OUT = '0' end -- somehow sometimes its empty + return OUT + end + + function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY + end + + function SendToWG(_,msg) + local myPlayerName,_,mySpec = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if Script.LuaUI("PlayerDataBroadcast") and (mySpec or myPlayerName == 'Player' or string.sub(msg,1,1) == '1') and authorized[myPlayerName] then + Script.LuaUI.PlayerDataBroadcast(myPlayerName, string.sub(msg, 2)) + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/cmd_luaui_reload.lua b/LuaRules/Gadgets/cmd_luaui_reload.lua new file mode 100644 index 000000000..fb9125283 --- /dev/null +++ b/LuaRules/Gadgets/cmd_luaui_reload.lua @@ -0,0 +1,36 @@ +function gadget:GetInfo() + return { + name = "LuaUI Reload", + desc = "Implements /luarules reloadluaui (because luaui cannot reload itself)", + author = "Bluestone", + date = "Feb 2015", + license = "Round Objects", + layer = 0, + enabled = true -- loaded by default? + } +end + +if (gadgetHandler:IsSyncedCode()) then + return +end + +function LuaUIReload(cmd, line, words, playerID) + if playerID and playerID==Spring.GetMyPlayerID() then + Spring.SendCommands("luaui reload") + end +end + + +function gadget:Initialize() + gadgetHandler:AddChatAction('reloadluaui', LuaUIReload, "") +end + +function gadget:Shutdown() + gadgetHandler:RemoveChatAction('reloadluaui') +end + + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/cmd_mouse_pos_broadcast.lua b/LuaRules/Gadgets/cmd_mouse_pos_broadcast.lua new file mode 100644 index 000000000..021d811a8 --- /dev/null +++ b/LuaRules/Gadgets/cmd_mouse_pos_broadcast.lua @@ -0,0 +1,197 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Cursor Broadcast", + desc = "Shows the mouse pos of allied players", + author = "jK,TheFatController", + date = "Apr,2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- configs + +local sendPacketEvery = 0.8 +local numMousePos = 2 --//num mouse pos in 1 packet + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- locals + +local GetMouseState = Spring.GetMouseState +local TraceScreenRay = Spring.TraceScreenRay +local SendLuaRulesMsg = Spring.SendLuaRulesMsg +local GetMyPlayerID = Spring.GetMyPlayerID +local GetSpectatingState= Spring.GetSpectatingState +local GetPlayerInfo = Spring.GetPlayerInfo +local GetLastUpdateSeconds= Spring.GetLastUpdateSeconds + + +local PackU16 = VFS.PackU16 +local UnpackU16 = VFS.UnpackU16 + +local floor = math.floor +local tanh = math.tanh +local abs = math.abs + + +-------------------------------------------------------------------------------- + +local updateTimer = 0 +local poshistory = {} + +local saveEach = sendPacketEvery/numMousePos +local updateTick = saveEach + + +local lastx,lastz = 0,0 +local n = 0 +local lastclick = 0 + +if gadgetHandler:IsSyncedCode() then + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationMouse = validation + + function gadget:RecvLuaMsg(msg, playerID) + if msg:sub(1,2)=="£" and msg:sub(3,4)==validation then + local xz = msg:sub(6) + local l = xz:len()*0.25 + if l == numMousePos then + for i=0,numMousePos-1 do + local x = UnpackU16(xz:sub(i*4+1,i*4+2)) + local z = UnpackU16(xz:sub(i*4+3,i*4+4)) + local click = msg:sub(4,4) == "1" + SendToUnsynced("mouseBroadcast",playerID,x,z,click) + end + end + return true + end + end +else + +-------------------------------------------------------------------------------- + +local myPlayerID = GetMyPlayerID() +local validation = SYNCED.validationMouse + +function gadget:Initialize() + gadgetHandler:AddSyncAction("mouseBroadcast", handleMousePosEvent) +end + +function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("mouseBroadcast") +end + +function handleMousePosEvent(_,playerID,x,z,click) + --here we receive mouse pos from other players and dispatch to luaui + local spec, fullView = GetSpectatingState() + if not spec or not fullView then + local _,_,_,_,myAllyTeamID = GetPlayerInfo(myPlayerID) + local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID) + if targetSpec or allyTeamID ~= myAllyTeamID then + return + end + end + if Script.LuaUI("MouseCursorEvent") then + Script.LuaUI.MouseCursorEvent(playerID,x,z,click) + end +end + +function gadget:Update() + updateTimer = updateTimer + GetLastUpdateSeconds() + + if updateTimer > updateTick then + local mx,my = GetMouseState() + local _,pos = TraceScreenRay(mx,my,true) + + if pos then + poshistory[n*2] = PackU16(floor(pos[1])) + poshistory[n*2+1] = PackU16(floor(pos[3])) + if n == numMousePos then + lastx,lastz = pos[1],pos[3] + end + n = n + 1 + end + + updateTick = updateTimer + saveEach + end + + if n > numMousePos then + n = 0 + updateTimer = 0 + updateTick = saveEach + + local posStr = "0" + + for i=numMousePos,1,-1 do + local xStr = poshistory[i*2] + local zStr = poshistory[i*2+1] + if xStr and zStr then + posStr = posStr .. xStr .. zStr + end + end + SendLuaRulesMsg("£" .. validation .. posStr) + + end +end + + +function gadget:MousePress(x,y,button) + if button == 2 then + return + end + local mx,my = GetMouseState() + local _,pos = TraceScreenRay(mx,my,true) + + if not pos then + return + end + if abs(pos[1] - lastx) > 300 or abs(pos[3] - lastz) > 300 then + for i=0,5 do + local posindex = i%2 == 0 and 1 or 3 + poshistory[i] = PackU16(floor(pos[posindex])) + end + lastx,lastz = pos[1],pos[3] + updateTick = saveEach + updateTimer = 0 + n = 0 + local posStr = "0" + for i=numMousePos,1,-1 do + local xStr = poshistory[i*2] + local zStr = poshistory[i*2+1] + if xStr and zStr then + posStr = posStr .. xStr .. zStr + end + end + SendLuaRulesMsg("£" .. validation .. posStr) + end +end + +end + diff --git a/LuaRules/Gadgets/cmd_remove_stop.lua b/LuaRules/Gadgets/cmd_remove_stop.lua new file mode 100644 index 000000000..1b13d5e91 --- /dev/null +++ b/LuaRules/Gadgets/cmd_remove_stop.lua @@ -0,0 +1,68 @@ +if not gadgetHandler:IsSyncedCode() then + return +end + +function gadget:GetInfo() + return { + name = "Remove Stop", + desc = "Removes stop from structures which have no need for the command.", + author = "GoogleFrog", + date = "3 April 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end + +local spRemoveUnitCmdDesc = Spring.RemoveUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local CMD_STOP = CMD.STOP + +local removeCommands = { + --CMD.WAIT, + CMD.STOP, + --CMD.REPEAT, +} + +local stopRemoveDefs = {} + +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + if ud.customParams and ud.customParams.removestop then + stopRemoveDefs[unitDefID] = true + end +end + +function gadget:AllowCommand_GetWantedCommand() + return {[CMD_STOP] = true} +end + +function gadget:AllowCommand_GetWantedUnitDefID() + return stopRemoveDefs +end + +function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + if (cmdID == CMD_STOP and stopRemoveDefs[unitDefID]) then + return false + end + return true +end + +function gadget:UnitCreated(unitID, unitDefID) + if stopRemoveDefs[unitDefID] then + for i = 1, #removeCommands do + local cmdDesc = spFindUnitCmdDesc(unitID, removeCommands[i]) + if cmdDesc then + spRemoveUnitCmdDesc(unitID, cmdDesc) + end + end + end +end + +function gadget:Initialize() + -- load active units + for _, unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/cmd_remove_wait.lua b/LuaRules/Gadgets/cmd_remove_wait.lua new file mode 100644 index 000000000..11b7d62de --- /dev/null +++ b/LuaRules/Gadgets/cmd_remove_wait.lua @@ -0,0 +1,68 @@ +if not gadgetHandler:IsSyncedCode() then + return +end + +function gadget:GetInfo() + return { + name = "Remove Wait", + desc = "Removes wait from structures which have no need for the command.", + author = "GoogleFrog", + date = "3 April 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } +end + +local spRemoveUnitCmdDesc = Spring.RemoveUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local CMD_WAIT = CMD.WAIT + +local removeCommands = { + CMD.WAIT, + --CMD.STOP, + --CMD.REPEAT, +} + +local waitRemoveDefs = {} + +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + if ud.customParams and ud.customParams.removewait then + waitRemoveDefs[unitDefID] = true + end +end + +function gadget:AllowCommand_GetWantedCommand() + return {[CMD_WAIT] = true} +end + +function gadget:AllowCommand_GetWantedUnitDefID() + return waitRemoveDefs +end + +function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + if (cmdID == CMD_WAIT and waitRemoveDefs[unitDefID]) then + return false + end + return true +end + +function gadget:UnitCreated(unitID, unitDefID) + if waitRemoveDefs[unitDefID] then + for i = 1, #removeCommands do + local cmdDesc = spFindUnitCmdDesc(unitID, removeCommands[i]) + if cmdDesc then + spRemoveUnitCmdDesc(unitID, cmdDesc) + end + end + end +end + +function gadget:Initialize() + -- load active units + for _, unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/cmd_selected_units.lua b/LuaRules/Gadgets/cmd_selected_units.lua new file mode 100644 index 000000000..de1fbd017 --- /dev/null +++ b/LuaRules/Gadgets/cmd_selected_units.lua @@ -0,0 +1,214 @@ + +function gadget:GetInfo() + return { + name = "Ally Selected Units", + desc = "sends your selected units to others", + author = "very_bad_soldier", + date = "August 1, 2008", + license = "GNU GPL v2", + layer = 0, + enabled = true + } +end + +local unitLimitPerFrame = 300 -- controls how many units will be send per frame +local fullSelectionUpdateInt = 0 -- refresh full selection info once in n seconds, 0 = disabled +local minZlibSize = 130 --minimum size threshold of msg to use zlib (msg smaller than this will not be compressed before sending) + +local HEADER_SEL_UNCOMPRESSED = "cosu" +local HEADER_SEL_COMPRESSED = "cosc" +local HEADER_LENGHT = string.len(HEADER_SEL_UNCOMPRESSED) + + + +if gadgetHandler:IsSyncedCode() then + function gadget:RecvLuaMsg(inMsg, playerID) + if inMsg:sub(1,HEADER_LENGHT)==HEADER_SEL_UNCOMPRESSED or inMsg:sub(1,HEADER_LENGHT)==HEADER_SEL_COMPRESSED then + SendToUnsynced("selectionUpdate",playerID,inMsg:sub(5),inMsg:sub(4,4) == "c") + return true + end + end +else + local floor = math.floor + local ZlibCompress = Spring.ZlibCompress + local ZlibDeCompress = Spring.ZlibDeCompress + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetSelectedUnits = Spring.GetSelectedUnits + local IsUnitSelected = Spring.IsUnitSelected + local GetSpectatingState = Spring.GetSpectatingState + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local GetPlayerInfo = Spring.GetPlayerInfo + local PackU16 = VFS.PackU16 + local UnpackU16 = VFS.UnpackU16 + + local myPlayerID = Spring.GetMyPlayerID() + + local time = 0 + local timeSeconds = 0 + local myLastSelectedUnits = {} + + + function gadget:Initialize() + gadgetHandler:AddSyncAction("selectionUpdate", handleSelectionUpdateEvent) + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("selectionUpdate") + end + + function handleSelectionUpdateEvent(_,playerID,msg,compressed) + local spec, fullView = GetSpectatingState() + if not spec or not fullView then + local _,_,_,_,myAllyTeamID = GetPlayerInfo(myPlayerID) + local _,_,targetSpec,_,allyTeamID = GetPlayerInfo(playerID) + if targetSpec or allyTeamID ~= myAllyTeamID then + return + end + end + + if compressed then --we have a compressed msg here + msg = ZlibDecompress( msg ) + end + + local counts = UnpackU16( msg, 1, 2 ) + if counts[1] == counts[2] and counts[1] == 0xffff then + --clear all + if Script.LuaUI("selectedUnitsClear") then + Script.LuaUI.selectedUnitsClear(playerID) + end + else + local addCount = counts[1] + local removeCount = counts[2] + + if removeCount > 0 and Script.LuaUI("selectedUnitsRemove") then + local remUnits = UnpackU16( msg, 5 + addCount * 2, removeCount ) + for i=1,removeCount do + Script.LuaUI.selectedUnitsRemove(playerID,remUnits[i]) + end + end + + if addCount > 0 and Script.LuaUI("selectedUnitsAdd") then + local addUnits = UnpackU16( msg, 5, addCount ) + for i=1,addCount do + Script.LuaUI.selectedUnitsAdd(playerID,addUnits[i]) + end + end + end + end + + function gadget:CommandsChanged( id, params, options ) + sendSelectedUnits() + end + + function gadget:UnitDestroyed(unitID, attacker ) + myLastSelectedUnits[ unitID ] = nil + end + + function gadget:Update() + local deltaTime = GetLastUpdateSeconds() + if time+deltaTime == time then + time = 0 --prevent floating point errors + end + time = time + deltaTime + + if timeSeconds == floor(time) then + return --only run on whole seconds + end + + timeSeconds = floor(time) + + if fullSelectionUpdateInt ~= 0 and timeSeconds%fullSelectionUpdateInt == 0 then + --its time for a full update + sendUnitsMsg(PackU16(0xffff) .. PackU16(0xffff)) + myLastSelectedUnits = {} + end + + sendSelectedUnits() + end + + --all values are 16bit + --FORMAT: uncompressed msg "cosu[addCount][removeCount]([unitIdToAdd]*)([unitIdToRemove]*)" + --FORMAT: compressed msg "cosc{[addCount][removeCount]([unitIdToAdd]*)([unitIdToRemove]*)}" the part in curly braces has to be zlib compressed + --FORMAT clear all: "cosu[0xffffff][0xffffff]" --magic value. impossible to have as normal message + + function sendFullRefresh() + + end + + function sendUnitsMsg( msg ) + local finalMsg = msg + local header = HEADER_SEL_UNCOMPRESSED + if ZlibCompress and msg:len() >= minZlibSize then + finalMsg = ZlibCompress( finalMsg ) + header = HEADER_SEL_COMPRESSED + end + + SendLuaRulesMsg( header .. finalMsg) + end + + function sendSelectedUnits() + local units = GetSelectedUnits() + + local partAdd = "" + local addCount = 0 + for i, unitId in pairs(units) do + --check if unit is new this time + if not myLastSelectedUnits[unitId] then + partAdd = partAdd .. PackU16(unitId) + myLastSelectedUnits[unitId] = true + addCount = addCount + 1 + + if addCount > unitLimitPerFrame then + break + end + end + end + + local remTab = {} --these units will be removed in the next step + local partRemove = "" + local remCount = 0 + for unitId, unit in pairs(myLastSelectedUnits) do + --check if unit is still selected + if not IsUnitSelected(unitId) then + partRemove = partRemove .. PackU16(unitId) + remTab[unitId] = true + remCount = remCount + 1 + + if (addCount + remCount) > unitLimitPerFrame then + break + end + end + end + + --remove not anymore selected units + for unitId, b in pairs(remTab) do + myLastSelectedUnits[unitId] = nil + end + + local msg = partAdd .. partRemove + if msg:len() > 1 then + local msgToSend = "" + if #units > 0 and ( addCount + remCount) > #units then + --its more efficient to clear all and then start from zero + --so: 1. Clear All + msgToSend = PackU16(0xffff) .. PackU16(0xffff) + sendUnitsMsg( msgToSend) + myLastSelectedUnits = {} + --2. do normal send + sendSelectedUnits() + else + if #units == 0 then + --send clear all message + msgToSend = PackU16(0xffff) .. PackU16(0xffff) + myLastSelectedUnits = {} + else + --send standard message + msgToSend = PackU16(addCount) .. PackU16(remCount) .. msg + + end + + sendUnitsMsg( msgToSend) + end + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/cmd_transports_instaload.lua b/LuaRules/Gadgets/cmd_transports_instaload.lua new file mode 100644 index 000000000..a9311ec69 --- /dev/null +++ b/LuaRules/Gadgets/cmd_transports_instaload.lua @@ -0,0 +1,555 @@ +function gadget:GetInfo() + return { + name = "Instant Unload", + desc = "Allows Flood load & unload", + author = "aZaremoth, unload support added by MaDDoX", + date = "March, 2015", + license = "Public Domain, or the least-restrictive license your country allows.", + layer = 1, + enabled = true, + } +end +------------------------------------------------------------------------ +include("LuaRules/Configs/customcmds.h.lua") +--- [Deprecated] new lua core is added) +--VFS.Include("LuaRules/Utilities/utilities_emul.lua") +--VFS.Include("LuaRules/Utilities/ClampPosition.lua") +VFS.Include("gamedata/taptools.lua") + + +if gadgetHandler:IsSyncedCode() then + +-------------------------------------------------------------------------------- +--region SYNCED +-------------------------------------------------------------------------------- + +--local GiveClampedOrderToUnit = Spring.Utilities.GiveClampedOrderToUnit +local CMD_INSERT = CMD.INSERT +local CMD_MOVE = CMD.MOVE +local CMD_REMOVE = CMD.REMOVE +local CMD_WAIT = CMD.WAIT +local CMD_STOP = CMD.STOP +local CMD_GUARD = CMD.GUARD +local CMD_LOAD_ONTO = CMD.LOAD_ONTO +local CMD_SET_WANTED_MAX_SPEED = CMD.SET_WANTED_MAX_SPEED -- 70 +local CMD_UNLOAD_UNIT = 81 --CMD.UNLOAD_UNIT --81 +local CMD_UNLOAD_UNITS = 80 --CMD.UNLOAD_UNITS --80 +local CMD_LOAD_UNITS = CMD.LOAD_UNITS +local CMD_OPT_INTERNAL = CMD.OPT_INTERNAL +local CMD_OPT_SHIFT = CMD.OPT_SHIFT + +local loadtheseunits = {} --// { [passengerUnitID] = transportID, ... } + --- Whenever an unload is registered, this table holds which transports are moving towards unload range +local transportstounload = {} --// { [transportID]={ x, y, z, r }, ... } || r == nil => unload click +local passengermovingtoload = {} +local transportmovingtoload = {} --// { [transportID]={{x, y, z, r, f}, ...} || f = frame after when it should be tracked + --- 'Assignable' changes after a load command is registered, transportcapacity only changes after actual loading +local currentassignablecapacity = {} --// { [transportID] = number, ...} should be made global in Initialize() +local currenttransportcapacity = {} +local unitisintransport = {} +local passengers = {} --// [transportID]={ passengerUID1 = true, passengerUID2 = true, ... } +local queueMovePassengers = {} --// { [unitID] = frame, ... } +local queuedMoveCommands = {} --// { unitID=unitID, shift=shift, pos={x,y,z}} + +local spGetAllUnits = Spring.GetAllUnits +local spGetGameFrame = Spring.GetGameFrame +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitMoveTypeData = Spring.GetUnitMoveTypeData +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder +local spUnitAttach = Spring.UnitAttach +local spUnitDetach = Spring.UnitDetach +local spUnitDetachFromAir = Spring.UnitDetachFromAir +local spSetUnitLoadingTransport = Spring.SetUnitLoadingTransport +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitsInCylinder = Spring.GetUnitsInCylinder + +local mcSetPosition = Spring.MoveCtrl.SetPosition +--local mcSetRotation = Spring.MoveCtrl.SetRotation +local mcDisable = Spring.MoveCtrl.Disable +local mcEnable = Spring.MoveCtrl.Enable + +local rand = math.random +local unloadScatterDist = 80 -- Max scatter move distance after unit is unloaded + +local function sqr (x) + return math.pow(x, 2) +end + +function gadget:Initialize() + _G.currentassignablecapacity = currentassignablecapacity --// making it global for unsynced access via SYNCED table + local allUnits = spGetAllUnits() + for i = 1, #allUnits do + local unitID = allUnits[i] + local unitDefID = spGetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end +end + +function gadget:UnitCreated(unitID, unitDefID) --, team, builderID + unitisintransport[unitID] = false + passengermovingtoload[unitID] = false + if not UnitDefs[unitDefID].isTransport then + --Spring.Echo(" Not a transport! ") + return end + local transportcapacity = tonumber(UnitDefs[unitDefID].transportCapacity) + if transportcapacity == nil then + transportcapacity = 0 + end + currenttransportcapacity[unitID] = transportcapacity + currentassignablecapacity[unitID] = transportcapacity + --_G.currentassignablecapacity = currentassignablecapacity + --Spring.Echo("Assignable capacity table count: "..pairs_len(currentassignablecapacity)) + transportmovingtoload[unitID] = nil +end + +-- Can this unit be transported? +local function canBeTransported(unitDefID) + return tobool(UnitDefs[unitDefID].cantBeTransported) == false +end + +-- Does this unit has available transport capacity? +local function hasAssignableCapacity(unitID) + --Spring.Echo("Current assignable capacity: ",tostring(currentassignablecapacity[unitID])) + return currentassignablecapacity[unitID] and tonumber(currentassignablecapacity[unitID]) > 0 +end + +local function hasCurrentCapacity(unitID) + return currenttransportcapacity[unitID] and tonumber(currenttransportcapacity[unitID]) > 0 +end + +local function CancelLoad(unitID) + for pUnitID, transporterID in pairs(loadtheseunits) do + if pUnitID == unitID -- passenger received STOP/MOVE + or transporterID == unitID then -- transporter received STOP/MOVE + currentassignablecapacity[transporterID] = currentassignablecapacity[transporterID] + 1 + -- Spring.Echo(currentassignablecapacity[transporterID]) + loadtheseunits[pUnitID] = nil + end + end +end + +function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) + local ud = UnitDefs[unitDefID] + local transportcapacity = ud.transportCapacity or 0 + local loadingradius = ud.loadingRadius + + --Spring.Echo("CMD ID: "..cmdID.." for unit: "..unitID) + + if transportstounload[unitID] ~= nil + and cmdID ~= CMD_SET_WANTED_MAX_SPEED and cmdID ~= 1 then -- 1 == CMD_INSERT (+others) + --Spring.Echo("Unload canceled by cmdID: "..cmdID) + transportstounload[unitID] = nil + --currentassignablecapacity[unitID] = currentassignablecapacity[unitID] + 1 + end + + --if cmdID ~= CMD_SET_WANTED_MAX_SPEED and cmdID ~= 1 then -- 1 == CMD_INSERT (+others) then + -- If transporter or unit to be loaded is moved or stop, cancel load + if cmdID == CMD_MOVE or cmdID == CMD_STOP then + --TODO: Fix this. It's a mess.. + --if loadtheseunits[unitID] ~= nil then + -- --Spring.Echo("Canceling passenger load of "..unitID) + -- CancelLoad(unitID) + --end + --if transportmovingtoload[unitID] then + -- if spGetGameFrame() > transportmovingtoload[unitID] then + -- --Spring.Echo("Canceling transporter load of "..unitID) + -- transportmovingtoload[unitID] = loadingradius --TODO: test; was nil + -- CancelLoad(unitID) + -- end + --end + end + + if cmdID == CMD_UNLOAD_UNITS or cmdID == CMD_UNLOAD_UNIT then + --Spring.Echo(DebugiTable(cmdParams)) + local x, y, z = cmdParams[1], cmdParams[2], cmdParams[3] -- x, y, z position of click + -- Set radius when cmdID == UNLOAD_UNITS (area unload) + transportstounload[unitID] = { x = x, y = y, z = z, r = (cmdID == CMD_UNLOAD_UNITS and cmdParams[4] or nil) } + --Spring.Echo("Added ttu: "..unitID) + return true + -- Any command issued between issue-unload and actual unload has to update currentassignablecapacity + end + + if cmdID == CMD_LOAD_ONTO then -- (76) LOAD ONTO a TRANSPORT, checks if can be transported + local transportID = cmdParams[1] --Spring.Echo("load command registered") + + if canBeTransported(unitDefID) and hasAssignableCapacity(transportID) + and not unitisintransport[unitID] and not loadtheseunits[unitID] then + Spring.GiveOrderToUnit(unitID, CMD_GUARD, {transportID}, {}) + loadtheseunits[unitID] = transportID + currentassignablecapacity[transportID] = currentassignablecapacity[transportID] - 1 + --Spring.Echo("Current assignable capacity: "..currentassignablecapacity[transportID]) + passengermovingtoload[unitID] = true + else + return false + end + end + + -- LOAD UNITS // check if it's a transporter + if cmdID == CMD_LOAD_UNITS and transportcapacity > 0 then --(75) + if hasCurrentCapacity(unitID) and hasAssignableCapacity(unitID) then + local MyTeam = spGetUnitTeam(unitID) + local movetype = (spGetUnitMoveTypeData(unitID)).name + local tx, ty, tz = spGetUnitPosition(unitID) -- transport position + local x = cmdParams[1] -- x is passenger's unitID if only oneclicked, or the x-position of center of the load circle + local y = cmdParams[2] -- y-position of center of the load circle + local z = cmdParams[3] -- z-position of center of the load circle + local r = cmdParams[4] -- radius of the load circle + --Spring.Echo("Load | Move Type: "..movetype) + ------------------------------------BUNKER---------------------------------------------------- + if movetype == [[static]] then --is it a bunker? + if (r == nil) then -------- load a single unit + local xUnitDefID = spGetUnitDefID(x) + local xTeam = spGetUnitTeam(x) + if canBeTransported(xUnitDefID) and xTeam == MyTeam + and currentassignablecapacity[unitID] > 0 and (unitisintransport[x] == false) + and (loadtheseunits[x] == nil) then + loadtheseunits[x] = unitID + currentassignablecapacity[unitID] = (currentassignablecapacity[unitID] - 1) + -- Spring.Echo(currentassigablecapacity[unitID]) + passengermovingtoload[x] = true + spGiveOrderToUnit(x, CMD_MOVE, {tx,ty,tz}, {}) + end + else -------- load multiple units + local UnitsAroundCommand = Spring.GetUnitsInCylinder(x,z,r) + for _,cUnitID in ipairs(UnitsAroundCommand) do -- check all units in transport pick-up >c 0) + and (unitisintransport[cUnitID] == false) + and (loadtheseunits[cUnitID] == nil) then + loadtheseunits[cUnitID] = unitID + currentassignablecapacity[unitID] = (currentassignablecapacity[unitID] - 1) + -- Spring.Echo(currentassigablecapacity[unitID]) + passengermovingtoload[cUnitID] = true + spGiveOrderToUnit(cUnitID, CMD_MOVE, {tx,ty,tz}, {}) + -- Spring.GiveOrderToUnit(unitID, CMD_WAIT, {}, {}) + end + end + end + end + ------------------------------------MOBILE---------------------------------------------------- + else + transportmovingtoload[unitID] = { x = x, y = y, z = z, r = r, f = spGetGameFrame()+1 } -- start tracking it in f frames + -- load single unit + if r == nil then + local xUnitDefID = spGetUnitDefID(x) + local xTeam = spGetUnitTeam(x) + if canBeTransported(xUnitDefID) + and xTeam == MyTeam and currentassignablecapacity[unitID] > 0 + and not unitisintransport[x] and loadtheseunits[x] == nil then + loadtheseunits[x] = unitID + currentassignablecapacity[unitID] = currentassignablecapacity[unitID] - 1 + --Spring.Echo("New current assignablecapacity: "..currentassignablecapacity[unitID]) + passengermovingtoload[x] = true + local px, py, pz = spGetUnitPosition(x) -- passenger position + queuedMoveCommands[#queuedMoveCommands+1] = { unitID=unitID, + shift=cmdOptions.shift, + pos={x=px,y=py,z=pz} + } + --if cmdOptions.shift then + -- spGiveOrderToUnit(unitID, CMD_INSERT, {-1, CMD_MOVE, CMD_OPT_INTERNAL, px,py,pz }, {"alt"} ) + --else + -- spGiveOrderToUnit(unitID, CMD_MOVE, {px,py,pz}, {}) + --end + end + else + -- load multiple units + local UnitsAroundCommand = spGetUnitsInCylinder(x,z,r) + --GiveOrderToUnit(unitID,CMD_INSERT,{-1,CMD_CAPTURE,CMD_OPT_INTERNAL+1,unitID2},{"alt"}); + --GiveOrderToUnit(unitID,CMD_INSERT,{cmd.tag,CMD_CAPTURE,CMD_OPT_INTERNAL+1,unitID2},{}); + --GiveOrderToUnit(unitID,CMD_INSERT,{0,CMD_STOP,0},{"alt"}); + queuedMoveCommands[#queuedMoveCommands+1] = { unitID=unitID, + --shift=cmdOptions.shift, + pos={x=x,y=y,z=z} + } + for _,cUnitID in ipairs(UnitsAroundCommand) do -- check all units in transport pick-up >c 0 + and not unitisintransport[cUnitID] + and not loadtheseunits[cUnitID] then + loadtheseunits[cUnitID] = unitID + currentassignablecapacity[unitID] = currentassignablecapacity[unitID] - 1 + -- Spring.Echo(currentassigablecapacity[unitID]) + passengermovingtoload[cUnitID] = true + spGiveOrderToUnit(unitID, CMD_REMOVE, {CMD_MOVE}, {"alt"}) + spGiveOrderToUnit(cUnitID, CMD_MOVE, {x,y,z}, {}) + end + end + end + end + end + return true + else + return false end + end + + return true + +end + +function gadget:UnitIdle(unitID, unitDefID, unitTeam) + for mpUnitID, _ in pairs(passengermovingtoload) do -- remove arrived passengers + if (unitID == mpUnitID) then + passengermovingtoload[mpUnitID] = false -- passenger arrived at pick-up point or was stopped + end + end + --local unloadData = transportstounload[unitID] -- = data.x, .y, .z + --if unloadData then + -- local sqrDistanceFromTarget = Distance2D(unitID, unloadData.x, unloadData.z) + -- Spring.Echo("Stuck transport dist from target: "..sqrDistanceFromTarget) + --end +end + +function gadget:UnitDestroyed(unitID, unitDefID, team, attacker) + local transporterID = loadtheseunits[unitID] + if transporterID then + currentassignablecapacity[transporterID] = (currentassignablecapacity[transporterID] + 1) -- remove dead unit from assigned units list + end + loadtheseunits[unitID] = nil + transportstounload[unitID] = nil + passengermovingtoload[unitID] = nil + for pUnitID, tunitID in pairs(loadtheseunits) do -- check if transporter was killed + if (unitID == tunitID) then + loadtheseunits[pUnitID] = nil + transportmovingtoload[unitID] = nil + end + end +end + +local function ShowUnit (unitID, enable) + Spring.SetUnitNoDraw (unitID, not enable) + Spring.SetUnitNoSelect (unitID, not enable) + Spring.SetUnitNoMinimap (unitID, not enable) + return +end + +function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) + ---- Let's ignore naval transports + --local transportuDef = UnitDefs[transportID] + --local minUnloadDistance = tonumber(transportuDef.customParams.minunloaddistance) + --if not minUnloadDistance or minUnloadDistance < 1 then + -- return + --end + unitisintransport[unitID] = true + if passengers[transportID] == nil then + passengers[transportID] = {} + end + passengers[transportID][unitID] = true + if currenttransportcapacity[transportID] then + currenttransportcapacity[transportID] = currenttransportcapacity[transportID] - 1 + else + --Spring.Echo("current transport capacity not initialized for "..transportID) + end +end + +function gadget:UnitUnloaded(unitID, unitDefID, unitTeam, transportID, transportTeam) + unitisintransport[unitID] = false + if passengers[transportID] then + passengers[transportID][unitID] = nil + end + --Spring.Echo("New count after unload: "..pairs_len(passengers[transportID]) or "nil") + if not currenttransportcapacity[transportID] or not currentassignablecapacity[transportID] then + return + end + currenttransportcapacity[transportID] = (currenttransportcapacity[transportID] + 1) + currentassignablecapacity[transportID] = (currentassignablecapacity[transportID] + 1) + + + local transportToUnload = transportstounload[transportID] --transport to unload + + if transportToUnload == nil then + return end + + --Spring.SetUnitPosition ( unitID, ttu.x, ttu.z ) + --Spring.Echo("Unload registered, assignable capacity: "..currentassignablecapacity[transportID]) + ShowUnit(unitID, false) + -- We have to punt the move control by 10 frames after unload, or else it twitches and fails. + -- PS.: This was found by shameless trial and error. No idea if it's an engine bug or expected behavior. + queueMovePassengers[#queueMovePassengers +1]={ unitID = unitID, frame = spGetGameFrame()+10, + clickPos = { x = transportToUnload.x, y = transportToUnload.y, z = transportToUnload.z, r = transportToUnload.r }} + -- If transport is empty now, nil it from table + if pairs_len(passengers[transportID]) <= 0 then + transportstounload[transportID] = nil end +end + +function gadget:GameFrame(f) + for i, data in ipairs(queueMovePassengers) do + local unitID = tonumber(data.unitID) + local frame = tonumber(data.frame) + local clickPos = data.clickPos + if f >= frame and IsValidUnit(unitID) then + local px, py, pz = spGetUnitPosition(unitID) + if px ~= nil and py ~= nil and pz ~= nil then + mcEnable(unitID) + -- Issue a move command instead of setting offset position directly (or units might get stuck) + mcSetPosition( unitID, px, clickPos.y, pz) -- clickPos.y || px + mcDisable(unitID) + spGiveOrderToUnit(unitID, CMD_MOVE, { px+ rand (-unloadScatterDist,unloadScatterDist), py, + pz + rand (-unloadScatterDist,unloadScatterDist) }, {}) + ShowUnit(unitID, true) + table.remove(queueMovePassengers, i) + end + end + end + -- Process Transports to Unload + if f % 2 < .1 then + --for unitID, data in pairs(transportstounload) do -- remove arrived passengers + -- local sqrDistanceFromTarget = Distance2D(unitID, data.x, data.z) + -- Spring.Echo("Distance 2D: "..tostring(sqrDistanceFromTarget) or "nil") + -- if (unitID == unitID and isnumber(sqrDistanceFromTarget) and sqrDistanceFromTarget < 160000) then + -- Spring.Echo("Transport "..mtUnitID.." arrived") + -- transportmovingtoload[mtUnitID] = nil -- transport arrived at pick-up point or was stopped + -- end + --end + for transpUID, data in pairs(transportstounload) do + local tx, ty, tz = spGetUnitPosition(transpUID) + local transportuDef = UnitDefs[spGetUnitDefID(transpUID)] + local sqrDistToTarget = Distance2D(transpUID, data.x, data.z) + --Spring.Echo("Distance 2D: "..tostring(sqrDistToTarget) or "nil") + if sqrDistToTarget < 6000 then + -- Re-issue unload command here, to prevent air transports getting stuck + spGiveOrderToUnit(transpUID, CMD_UNLOAD_UNIT, { data.x, data.y, data.z }, {}) + --local minUnloadDistance = tonumber(transportuDef.loadingRadius) / 2 or 150 + local minUnloadDistance = transportuDef.customParams.minunloaddistance + if (minUnloadDistance) then + local distance = math.sqrt(sqr(tx- data.x) + sqr(ty- data.y) + sqr(tz- data.z)) + --Spring.Echo("current/min: "..distance.." / "..minUnloadDistance) + if distance <= tonumber(minUnloadDistance) then + -- actually unload all (for now) units + if passengers[transpUID] and pairs_len(passengers[transpUID])>0 then + --table.insert(passengers[transportID], unitID) + for passengerUID in pairs(passengers[transpUID]) do + spSetUnitLoadingTransport(passengerUID, transpUID) --disable collision temporarily + if transportuDef.isAirUnit then + spUnitDetachFromAir(passengerUID) + else + spUnitDetach(passengerUID) + end + end + end + end + end + end + end + end + -- Process Units to be Loaded + if f % 32 > .1 then + for passengerUID, transpUID in pairs(loadtheseunits) do ----// { [passengerUnitID] = transportID, ... } + local x, y, z = spGetUnitPosition(transpUID) -- transport position + local transportuDef = UnitDefs[spGetUnitDefID(transpUID)] + --local transportcapacity = transportuDef.transportCapacity + local loadingradius = tonumber(transportuDef.loadingRadius) or 300 + local UnitsAroundTransport = spGetUnitsInCylinder(x,z,loadingradius) + for _, thisuID in ipairs(UnitsAroundTransport) do + local thisUDID = spGetUnitDefID(thisuID) + if thisuID == passengerUID and canBeTransported(thisUDID) then + -- Actually "load" the unit: + spSetUnitLoadingTransport(transpUID, thisuID) + spUnitAttach(transpUID, passengerUID, 0) -- Currently only attach to the 'root' object + loadtheseunits[passengerUID] = nil + local p_uID = UnitDefs[spGetUnitDefID(passengerUID)] + if (p_uID.repairSpeed > 0) then -- builder units will automatically repair the transport / bunker + spGiveOrderToUnit(passengerUID, CMD_GUARD, { transpUID }, {}) + end + end + end + -- check if passengers AND transport are still on the run, if not remove from pick-up list + local transporterID = loadtheseunits[passengerUID] + local assignablecapacity = currentassignablecapacity[transporterID] + if not passengermovingtoload[passengerUID] + and not transportmovingtoload[transporterID] + and assignablecapacity then + currentassignablecapacity[transporterID] = assignablecapacity + 1 + loadtheseunits[passengerUID] = nil + end + end + end + -- Process queued MoveCommands + for i, data in ipairs(queuedMoveCommands) do + local unitID = tonumber(data.unitID) + local shift = data.shift + local x,y,z = tonumber(data.pos.x), tonumber(data.pos.y), tonumber(data.pos.z) + if shift then + spGiveOrderToUnit(unitID, CMD_INSERT, {-1, CMD_MOVE, CMD_OPT_INTERNAL, x,y,z }, {"alt"} ) + else + spGiveOrderToUnit(unitID, CMD_MOVE, {x,y,z}, {}) + end + table.remove(queuedMoveCommands, i) + end +end + +-------------------------------------------------------------------------------- +--endregion END SYNCED +-------------------------------------------------------------------------------- +else +-------------------------------------------------------------------------------- +--region UNSYNCED +-------------------------------------------------------------------------------- + +local morphUnits + +local spGetGameFrame = Spring.GetGameFrame +local glBlending = gl.Blending +local glDepthTest = gl.DepthTest +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glBlending = gl.Blending +local glDepthTest = gl.DepthTest +local glBillboard = gl.Billboard +local glColor = gl.Color +local glText = gl.Text +local GL_LEQUAL = GL.LEQUAL +local GL_ONE = GL.ONE +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local spGetLocalTeamID = Spring.GetLocalTeamID +local spGetUnitTeam = Spring.GetUnitTeam +local GetSpectatingState = Spring.GetSpectatingState +local spGetUnitViewPosition = Spring.GetUnitViewPosition +local spIsUnitInView = Spring.IsUnitInView +local UItextColor = {1.0, 1.0, 0.6, 1.0} +local UItextSize = 14.0 + +local snext = snext + +--function gadget:DrawWorld() +-- if not snext(SYNCED.currentassignablecapacity) then +-- return --//no transports to draw +-- end +-- +-- glBlending(GL_SRC_ALPHA, GL_ONE) +-- glDepthTest(GL_LEQUAL) +-- +-- --- [BEGIN] Draw Transports current assignable capacity +-- --Spring.Echo("Len: "..pairs_len(SYNCED.currentassignablecapacity)) +-- local localTeam = spGetLocalTeamID() +-- for unitID, capacity in pairsByKeys(SYNCED.currentassignablecapacity) do +-- --local capacity = SYNCED.currentassignablecapacity[unitID] +-- if spIsUnitInView(unitID) and spGetUnitTeam(unitID) == localTeam then +-- local ux, uy, uz = spGetUnitViewPosition(unitID) +-- glPushMatrix() +-- glTranslate(ux, uy, uz) +-- glBillboard() +-- glColor(UItextColor) +-- glText("<" .. capacity..">", 20.0, -15.0, UItextSize, "cno") +-- glPopMatrix() +-- end +-- end +-- --- [END] Draw Transports current assignable capacity +-- +-- glDepthTest(false) +-- glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) +--end + +-------------------------------------------------------------------------------- +--endregion END UNSYNCED +-------------------------------------------------------------------------------- +end \ No newline at end of file diff --git a/LuaRules/Gadgets/customunitshaders/main.lua b/LuaRules/Gadgets/customunitshaders/main.lua deleted file mode 100644 index 487eb0a29..000000000 --- a/LuaRules/Gadgets/customunitshaders/main.lua +++ /dev/null @@ -1,474 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- author: jK --- --- Copyright (C) 2008,2009,2010. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "CustomUnitShaders", - desc = "allows to override the engine unit shader", - author = "jK", - date = "2008,2009,2010", - license = "GNU GPL, v2 or later", - layer = 1, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Synced --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -if (gadgetHandler:IsSyncedCode()) then - - function gadget:UnitFinished(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_finished", unitID, unitDefID,teamID) - end - - function gadget:UnitDestroyed(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_destroyed", unitID, unitDefID,teamID) - end - - function gadget:UnitReverseBuild(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_reverse", unitID, unitDefID,teamID) - end - - function gadget:UnitGiven(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_given", unitID, unitDefID,teamID) - end - - function gadget:UnitCloaked(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_cloak", unitID, unitDefID,teamID) - end - - function gadget:UnitDecloaked(unitID,unitDefID,teamID) - SendToUnsynced("unitshaders_decloak", unitID, unitDefID,teamID) - end - - --// block first try, so we have enough time to disable the lua UnitRendering - --// else the model would be invisible for 1 gameframe - local blockFirst = {} - function gadget:AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) - if (part < 0) then - local inbuild = not select(3,Spring.GetUnitIsStunned(unitID)) - if (not inbuild) then - gadget:UnitReverseBuild(unitID,unitDefID,Spring.GetUnitTeam(unitID)) - if (not blockFirst[unitID]) then - blockFirst[unitID] = true - return false - end - end - else - blockFirst[unitID] = nil - end - return true - end - - function gadget:GameFrame() - for i,uid in ipairs(Spring.GetAllUnits()) do - if not select(3,Spring.GetUnitIsStunned(uid)) then --// inbuild? - gadget:UnitFinished(uid,Spring.GetUnitDefID(uid),Spring.GetUnitTeam(uid)) - end - end - gadgetHandler:RemoveCallIn('GameFrame') - end - - return -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Unsynced --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (not gl.CreateShader) then - return false -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local shadows = false -local advShading = false -local normalmapping = false - -local drawUnitList = {} -local unitMaterialInfos,bufMaterials = {},{} -local materialDefs = {} -local loadedTextures = {} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local _plugins = nil -local function InsertPlugin(str) - --str = str:upper() - return (_plugins and _plugins[str]) or "" -end - - -local function CompileShader(shader, definitions, plugins) - shader.vertexOrig = shader.vertex - shader.fragmentOrig = shader.fragment - shader.geometryOrig = shader.geometry - - --// insert small pieces of code named `plugins` - --// this way we can use a basic shader and add some simple vertex animations etc. - do - if (plugins) then - _plugins = plugins - end - - if (shader.vertex) - then shader.vertex = shader.vertex:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end - if (shader.fragment) - then shader.fragment = shader.fragment:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end - if (shader.geometry) - then shader.geometry = shader.geometry:gsub("%%%%([%a_]+)%%%%", InsertPlugin); end - - _plugins = nil - end - - --// append definitions at top of the shader code - --// (this way we can modularize a shader and enable/disable features in it) - if (definitions or shadows) then - definitions = definitions or {} - definitions = table.concat(definitions, "\n") - if (shadows) then - definitions = definitions .. "\n" .. "#define use_shadows" .. "\n" - end - if (shader.vertex) - then shader.vertex = definitions .. shader.vertex; end - if (shader.fragment) - then shader.fragment = definitions .. shader.fragment; end - if (shader.geometry) - then shader.geometry = definitions .. shader.geometry; end - end - - local GLSLshader = gl.CreateShader(shader) - local errorLog = gl.GetShaderLog() - if (errorLog and errorLog~= "") then - Spring.Echo("Custom Unit Shaders:", errorLog) - end - - shader.vertex = shader.vertexOrig - shader.fragment = shader.fragmentOrig - shader.geometry = shader.geometryOrig - - return GLSLshader -end - - -local function CompileMaterialShaders() - for _,mat_src in pairs(materialDefs) do - if (mat_src.shaderSource) then - local GLSLshader = CompileShader(mat_src.shaderSource, mat_src.shaderDefinitions, mat_src.shaderPlugins) - - if (GLSLshader) then - if (mat_src.shader) then - gl.DeleteShader(mat_src.shader) - end - mat_src.shader = GLSLshader - mat_src.cameraLoc = gl.GetUniformLocation(GLSLshader,"camera") - mat_src.cameraInvLoc = gl.GetUniformLocation(GLSLshader,"cameraInv") - mat_src.cameraPosLoc = gl.GetUniformLocation(GLSLshader,"cameraPos") - mat_src.shadowMatrixLoc = gl.GetUniformLocation(GLSLshader,"shadowMatrix") - mat_src.shadowParamsLoc = gl.GetUniformLocation(GLSLshader,"shadowParams") - mat_src.sunLoc = gl.GetUniformLocation(GLSLshader,"sunPos") - mat_src.frameLoc = gl.GetUniformLocation(GLSLshader,"frame2") - mat_src.speedLoc = gl.GetUniformLocation(GLSLshader,"speed") - end - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function GetUnitMaterial(unitDefID) - local mat = bufMaterials[unitDefID] - if (mat) then - return mat - end - - local matInfo = unitMaterialInfos[unitDefID] - local mat = materialDefs[matInfo[1]] - - matInfo.UNITDEFID = unitDefID - - --// find unitdef tex keyword and replace it - --// (a shader can be just for multiple unitdefs, so we support this keywords) - local texUnits = {} - for texid,tex in pairs(mat.texunits or {}) do - local tex_ = tex - for varname,value in pairs(matInfo) do - tex_ = tex_:gsub("%%"..tostring(varname),value) - end - texUnits[texid] = {tex=tex_, enable=false} - end - - --// materials don't load those textures themselves - if (texUnits[1]) then - local texdl = gl.CreateList(function() - for _,tex in pairs(texUnits) do - local prefix = tex.tex:sub(1,1) - if (prefix~="%") - and(prefix~="#") - and(prefix~="!") - and(prefix~="$") - then - gl.Texture(tex.tex) - loadedTextures[#loadedTextures+1] = tex.tex - end - end - end) - gl.DeleteList(texdl) - end - - local luaMat = Spring.UnitRendering.GetMaterial("opaque",{ - shader = mat.shader, - cameraposloc = mat.cameraPosLoc, - cameraloc = mat.cameraLoc, - camerainvloc = mat.cameraInvLoc, - shadowloc = mat.shadowMatrixLoc, - shadowparamsloc = mat.shadowParamsLoc, - usecamera = mat.usecamera, - culling = mat.culling, - texunits = texUnits, - prelist = mat.predl, - postlist = mat.postdl, - }) - - bufMaterials[unitDefID] = luaMat - - return luaMat -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function ToggleShadows() - shadows = Spring.HaveShadows() - - CompileMaterialShaders() - - bufMaterials = {} - - local units = Spring.GetAllUnits() - for _,unitID in pairs(units) do - local unitDefID = Spring.GetUnitDefID(unitID) - local teamID = Spring.GetUnitTeam(unitID) - UnitDestroyed(nil,unitID) - Spring.UnitRendering.DeactivateMaterial(unitID,3) - if not select(3,Spring.GetUnitIsStunned(unitID)) then --// inbuild? - UnitFinished(nil,unitID,unitDefID,teamID) - end - end -end - - -function ToggleAdvShading() - advShading = Spring.HaveAdvShading() - - if (not advShading) then - --// unload all materials - drawUnitList = {} - - local units = Spring.GetAllUnits() - for _,unitID in pairs(units) do - Spring.UnitRendering.DeactivateMaterial(unitID,3) - end - elseif (normalmapping) then - --// reinitializes all shaders - ToggleShadows() - end -end - - -function ToggleNormalmapping(_,_,_, playerID) - if (playerID ~= Spring.GetMyPlayerID()) then - return - end - - normalmapping = not normalmapping - Spring.SetConfigInt("NormalMapping", (normalmapping and 1) or 0) - Spring.Echo("Set NormalMapping to " .. tostring((normalmapping and 1) or 0)) - - if (not normalmapping) then - --// unload normalmapped materials - local units = Spring.GetAllUnits() - for _,unitID in pairs(units) do - local unitDefID = Spring.GetUnitDefID(unitID) - local unitMat = unitMaterialInfos[unitDefID] - if (unitMat) then - local mat = materialDefs[unitMat[1]] - if (not mat.force) then - gadget:UnitDestroyed(unitID,unitDefID) - end - end - end - elseif (advShading) then - --// reinitializes all shaders - ToggleShadows() - end -end - - -local n = -1 -function gadget:Update() - if (n0) - - --// load the materials config files - local unitMaterialDefs = {} - do - local MATERIALS_DIR = GADGET_DIR .. "UnitMaterials/" - - local files = VFS.DirList(MATERIALS_DIR) - table.sort(files) - - for i=1,#files do - local mats, unitMats = VFS.Include(files[i]) - tmerge(materialDefs, mats) - tmerge(unitMaterialDefs, unitMats) - end - end - - --// process the materials (compile shaders, load textures, ...) - do - for _,mat_src in pairs(materialDefs) do - if (mat_src.shader)and - (mat_src.shader ~= "3do")and(mat_src.shader ~= "s3o") - then - mat_src.shaderSource = mat_src.shader - mat_src.shader = nil - end - end - - CompileMaterialShaders() - - for unitName,materialInfo in pairs(unitMaterialDefs) do - if (type(materialInfo) ~= "table") then - materialInfo = {materialInfo} - end - unitMaterialInfos[(UnitDefNames[unitName] or {id=-1}).id] = materialInfo - end - end - - --// insert synced actions - gadgetHandler:AddSyncAction("unitshaders_finished", UnitFinished) - gadgetHandler:AddSyncAction("unitshaders_destroyed", UnitDestroyed) - gadgetHandler:AddSyncAction("unitshaders_reverse", UnitReverseBuild) - gadgetHandler:AddSyncAction("unitshaders_given", UnitGiven) - gadgetHandler:AddSyncAction("unitshaders_cloak", UnitCloaked) - gadgetHandler:AddSyncAction("unitshaders_decloak", UnitDecloaked) - - gadgetHandler:AddChatAction("normalmapping", ToggleNormalmapping) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/customunitshaders/unitmaterials/0_angleshark.lua b/LuaRules/Gadgets/customunitshaders/unitmaterials/0_angleshark.lua deleted file mode 100644 index 49590b003..000000000 --- a/LuaRules/Gadgets/customunitshaders/unitmaterials/0_angleshark.lua +++ /dev/null @@ -1,67 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local unitInfo = {} - -local function DrawUnit(unitid, material, materialID) - local info = unitInfo[unitid] - if (not info) then - info = {dir=0, lx=0, lz=0} - unitInfo[unitid] = info - end - - local vx,vy,vz = Spring.GetUnitVelocity(unitid) - local speed = (vx*vx+vy*vy+vz*vz)^0.5 - - local curFrame = Spring.GetGameFrame() - if (info.n ~= curFrame) then - info.n = curFrame; - local lx = info.lx - local lz = info.lz - local dx,dy,dz = Spring.GetUnitDirection(unitid) - info.dir = info.dir*0.95 + (lx*dz - lz*dx) / ( (lx*lx+lz*lz)^0.5 + (dx*dx+dz*dz)^0.5 ); - info.lx,info.lz = dx,dz; - end - - gl.Uniform(material.frameLoc, Spring.GetGameFrame()%360) - gl.Uniform(material.speedLoc, info.dir,0,speed) - - return false --// engine should still draw it (we just set the uniforms for the shader) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local materials = { - shark = { - shader = include(GADGET_DIR .. "UnitMaterials/Shaders/shark.lua"), - force = true, --// always use the shader even when normalmapping is disabled - usecamera = false, - culling = GL.BACK, - texunits = { - [0] = '%%UNITDEFID:0', - [1] = '%%UNITDEFID:1', - [2] = '$shadow', - [3] = '$specular', - [4] = '$reflection', - }, - DrawUnit = DrawUnit - } -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- affected unitdefs - -local unitMaterials = { - angelshark = "shark", -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return materials, unitMaterials - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/customunitshaders/unitmaterials/0_flags.lua b/LuaRules/Gadgets/customunitshaders/unitmaterials/0_flags.lua deleted file mode 100644 index b5d12bea5..000000000 --- a/LuaRules/Gadgets/customunitshaders/unitmaterials/0_flags.lua +++ /dev/null @@ -1,105 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local pieceDLs = {} - -local function UnitCreated(unitID, material, materialID) - local pieceMap = Spring.GetUnitPieceMap(unitID) - local flagPieces = {"gbrflag", "gerflag", "usflag", "rusflag"} - - for i=1,#flagPieces do - local pieceID = pieceMap[ flagPieces[i] ] - if (pieceID) then - local dl = pieceDLs[i] - if (not dl) then - dl = gl.CreateList(function() - gl.MultiTexCoord(4,100) - gl.UnitPiece(unitID, pieceID) - gl.MultiTexCoord(4,0) - end) - pieceDLs[i] = dl - end - Spring.UnitRendering.SetPieceList(unitID,materialID,pieceID,dl) - end - end -end - - -local function DrawUnit(unitID, material) - gl.Uniform(material.frameLoc, (Spring.GetGameFrame() + Spring.GetFrameTimeOffset())/10) - - --// engine should still draw it (we just set the uniforms for the shader) - return false -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local materials = { - flagShader = { - shaderDefinitions = { - "#define use_perspective_correct_shadows", - "#define use_normalmapping", - }, - shaderPlugins = { - VERTEX_GLOBAL_NAMESPACE = [[ - uniform float frame2; - ]], - VERTEX_PRE_TRANSFORM = [[ - if (gl_MultiTexCoord4.x > 10.0) { - float a; - vec3 n = vec3(0.0); - - a = (vertex.x * 0.5 + frame2); - vertex.z += 1.35 * sin(a) * max(vertex.x, -1.0); - n += vec3(-1.0, 0.0, cos(a)) * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - a = (vertex.x * 0.5 + frame2 + vertex.y * 0.5); - vertex.z += 0.2 * sin(a) * max(vertex.x, -1.0); - n += vec3(-1.0, 0.0, cos(a)) * 0.13 * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - a = (vertex.x * 0.5 + frame2 - 0.33); - vertex.y += 0.8 * sin(a) * max(vertex.x, -1.0); - n += vec3(0.0, cos(a), -1.0) * 0.8 * max(vertex.x, -1.0) / sqrt(1.0+cos(a)*cos(a)); - - normal = normalize(mix(normal,n,0.65)); - } - ]], - }, - shader = include(GADGET_DIR .. "UnitMaterials/Shaders/default.lua"), - force = true, - usecamera = false, - culling = GL.BACK, - texunits = { - [0] = '%%UNITDEFID:0', - [1] = '%%UNITDEFID:1', - [2] = '$shadow', - [3] = '$specular', - [4] = '$reflection', - [5] = 'unittextures/Flags_normals.dds', - }, - UnitCreated = UnitCreated, - DrawUnit = DrawUnit, - }, -} - - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- affected unitdefs - -local unitMaterials = {} - -unitMaterials.flag = { - "flagShader", -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return materials, unitMaterials - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/customunitshaders/unitmaterials/1_normalmapping.lua b/LuaRules/Gadgets/customunitshaders/unitmaterials/1_normalmapping.lua deleted file mode 100644 index 0784c4db5..000000000 --- a/LuaRules/Gadgets/customunitshaders/unitmaterials/1_normalmapping.lua +++ /dev/null @@ -1,136 +0,0 @@ --- $Id$ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local materials = { - normalMappedS3o = { - shaderDefinitions = { - "#define use_perspective_correct_shadows", - "#define use_normalmapping", - --"#define flip_normalmap", - }, - shader = include(GADGET_DIR .. "UnitMaterials/Shaders/default.lua"), - usecamera = false, - culling = GL.BACK, - predl = nil, - postdl = nil, - texunits = { - [0] = '%%UNITDEFID:0', - [1] = '%%UNITDEFID:1', - [2] = '$shadow', - [3] = '$specular', - [4] = '$reflection', - [5] = '%normalstex', - }, - }, -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Automated normalmap detection - -local unitMaterials = {} - -local function FindNormalmap(tex1, tex2) - local normalstex - - --// check if there is a corresponding _normals.dds file - if (VFS.FileExists(tex1)) then - local basefilename = tex1:gsub("%....","") - if (tonumber(basefilename:sub(-1,-1))) then - basefilename = basefilename:sub(1,-2) - end - if (basefilename:sub(-1,-1) == "_") then - basefilename = basefilename:sub(1,-2) - end - normalstex = basefilename .. "_normals.dds" - if (not VFS.FileExists(normalstex)) then - normalstex = nil - end - end --if FileExists - - if (not normalstex) and tex2 and (VFS.FileExists(tex2)) then - local basefilename = tex2:gsub("%....","") - if (tonumber(basefilename:sub(-1,-1))) then - basefilename = basefilename:sub(1,-2) - end - if (basefilename:sub(-1,-1) == "_") then - basefilename = basefilename:sub(1,-2) - end - normalstex = basefilename .. "_normals.dds" - if (not VFS.FileExists(normalstex)) then - normalstex = nil - end - end - - return normalstex -end - - - -for i=1,#UnitDefs do - local udef = UnitDefs[i] - - if (udef.customParams.normalstex and VFS.FileExists(udef.customParams.normalstex)) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = udef.customParams.normalstex} - - elseif (udef.model.type == "s3o") then - local modelpath = udef.model.path - if (modelpath) then - --// udef.model.textures is empty at gamestart, so read the texture filenames from the s3o directly - - local rawstr = VFS.LoadFile(modelpath) - local header = rawstr:sub(1,60) - local texPtrs = VFS.UnpackU32(header, 45, 2) - local tex1,tex2 - if (texPtrs[2] > 0) - then tex2 = "unittextures/" .. rawstr:sub(texPtrs[2]+1, rawstr:len()-1) - else texPtrs[2] = rawstr:len() end - if (texPtrs[1] > 0) - then tex1 = "unittextures/" .. rawstr:sub(texPtrs[1]+1, texPtrs[2]-1) end - - -- output units without tex2 - if not tex2 then - Spring.Echo("CustomUnitShaders: " .. udef.name .. " no tex2") - end - - local normalstex = FindNormalmap(tex1,tex2) - if (normalstex and not unitMaterials[udef.name]) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = normalstex} - end - end --if model - - elseif (udef.model.type == "obj") then - local modelinfopath = udef.model.path - if (modelinfopath) then - modelinfopath = modelinfopath .. ".lua" - - if (VFS.FileExists(modelinfopath)) then - local infoTbl = Include(modelinfopath) - if (infoTbl) then - local tex1 = "unittextures/" .. (infoTbl.tex1 or "") - local tex2 = "unittextures/" .. (infoTbl.tex2 or "") - - -- output units without tex2 - if not tex2 then - Spring.Echo("CustomUnitShaders: " .. udef.name .. " no tex2") - end - - local normalstex = FindNormalmap(tex1,tex2) - if (normalstex and not unitMaterials[udef.name]) then - unitMaterials[udef.name] = {"normalMappedS3o", normalstex = normalstex} - end - end - end - end - - end --elseif -end --for - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return materials, unitMaterials - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/default.lua b/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/default.lua deleted file mode 100644 index 947e4849c..000000000 --- a/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/default.lua +++ /dev/null @@ -1,178 +0,0 @@ -return { - vertex = [[ -//#define use_normalmapping -//#define flip_normalmap -//#define use_shadows - - %%VERTEX_GLOBAL_NAMESPACE%% - - uniform mat4 camera; //ViewMatrix (gl_ModelViewMatrix is ModelMatrix!) - //uniform mat4 cameraInv; - uniform vec3 cameraPos; - uniform vec3 sunPos; - uniform vec3 sunDiffuse; - uniform vec3 sunAmbient; - #ifdef use_shadows - uniform mat4 shadowMatrix; - varying vec4 shadowpos; - #ifndef use_perspective_correct_shadows - uniform vec4 shadowParams; - #endif - #endif - - varying vec3 cameraDir; - varying vec3 teamColor; - //varying float fogFactor; - - #ifdef use_normalmapping - varying vec3 t; - varying vec3 b; - varying vec3 n; - #else - varying vec3 normalv; - #endif - - void main(void) - { - vec4 vertex = gl_Vertex; - vec3 normal = gl_Normal; - - %%VERTEX_PRE_TRANSFORM%% - - #ifdef use_normalmapping - vec3 tangent = gl_MultiTexCoord5.xyz; - vec3 bitangent = gl_MultiTexCoord6.xyz; - t = gl_NormalMatrix * tangent; - b = gl_NormalMatrix * bitangent; - n = gl_NormalMatrix * normal; - #else - normalv = gl_NormalMatrix * normal; - #endif - - vec4 worldPos = gl_ModelViewMatrix * vertex; - gl_Position = gl_ProjectionMatrix * (camera * worldPos); - cameraDir = worldPos.xyz - cameraPos; - - #ifdef use_shadows - shadowpos = shadowMatrix * worldPos; - #ifndef use_perspective_correct_shadows - shadowpos.st = shadowpos.st * (inversesqrt(abs(shadowpos.st) + shadowParams.z) + shadowParams.w) + shadowParams.xy; - #endif - #endif - - gl_TexCoord[0].st = gl_MultiTexCoord0.st; - teamColor = gl_TextureEnvColor[0].rgb; - - //float fogCoord = length(gl_Position.xyz); - //fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start) - //fogFactor = clamp(fogFactor, 0.0, 1.0); - - %%VERTEX_POST_TRANSFORM%% - } - ]], - fragment = [[ -//#define use_normalmapping -//#define flip_normalmap -//#define use_shadows - - %%FRAGMENT_GLOBAL_NAMESPACE%% - - uniform sampler2D textureS3o1; - uniform sampler2D textureS3o2; - uniform samplerCube specularTex; - uniform samplerCube reflectTex; - - uniform vec3 sunPos; // is sunDir! - uniform vec3 sunDiffuse; - uniform vec3 sunAmbient; - - #ifdef use_shadows - #ifdef use_perspective_correct_shadows - uniform vec4 shadowParams; - #endif - varying vec4 shadowpos; - uniform sampler2DShadow shadowTex; - uniform float shadowDensity; - #endif - - varying vec3 teamColor; - varying vec3 cameraDir; - //varying float fogFactor; - - #ifdef use_normalmapping - varying vec3 t; - varying vec3 b; - varying vec3 n; - uniform sampler2D normalMap; - #else - varying vec3 normalv; - #endif - - void main(void) - { - %%FRAGMENT_PRE_SHADING%% - - #ifdef use_normalmapping - vec2 tc = gl_TexCoord[0].st; - #ifdef flip_normalmap - tc.t = 1.0 - tc.t; - #endif - vec3 nvTS = normalize(texture2D(normalMap, tc).xyz - 0.5); - vec3 normal = normalize(mat3(t,b,n) * nvTS); - #else - vec3 normal = normalize(normalv); - #endif - float a = max( dot(normal, sunPos), 0.0); - vec3 light = a * sunDiffuse + sunAmbient; - - vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st); - - vec3 reflectDir = reflect(cameraDir, normal); - vec3 specular = textureCube(specularTex, reflectDir).rgb * extraColor.g * 4.0; - vec3 reflection = textureCube(reflectTex, reflectDir).rgb; - - #ifdef use_shadows - vec4 shadowTC = shadowpos; - #ifdef use_perspective_correct_shadows - shadowTC.st = shadowTC.st * (inversesqrt( abs(shadowTC.st) + shadowParams.z) + shadowParams.w) + shadowParams.xy; - #endif - float shadow = shadow2DProj(shadowTex, shadowTC).r; - shadow = 1.0 - (1.0 - shadow) * shadowDensity; - light = mix(sunAmbient, light, shadow); - specular *= shadow; - #endif - - reflection = mix(light, reflection, extraColor.g); // reflection - reflection += extraColor.rrr; // self-illum - - gl_FragColor = texture2D(textureS3o1, gl_TexCoord[0].st); - gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor.rgb, gl_FragColor.a); // teamcolor - gl_FragColor.rgb = gl_FragColor.rgb * reflection + specular; - gl_FragColor.a = extraColor.a; - //gl_FragColor.rgb = mix(gl_Fog.color.rgb, gl_FragColor.rgb, fogFactor); // fog - //gl_FragColor.a = teamColor.a; // far fading - //gl_FragColor.rgb = normal; - - %%FRAGMENT_POST_SHADING%% - } - ]], - uniformInt = { - textureS3o1 = 0, - textureS3o2 = 1, - shadowTex = 2, - specularTex = 3, - reflectTex = 4, - normalMap = 5, - --detailMap = 6, - }, - uniform = { - sunPos = {gl.GetSun("pos")}, - sunAmbient = {gl.GetSun("ambient" ,"unit")}, - sunDiffuse = {gl.GetSun("diffuse" ,"unit")}, - shadowDensity = {gl.GetSun("shadowDensity" ,"unit")}, - shadowParams = {gl.GetShadowMapParams()}, - }, - uniformMatrix = { - shadowMatrix = {gl.GetMatrixData("shadow")}, - }, -} \ No newline at end of file diff --git a/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/shark.lua b/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/shark.lua deleted file mode 100644 index e565158a3..000000000 --- a/LuaRules/Gadgets/customunitshaders/unitmaterials/shaders/shark.lua +++ /dev/null @@ -1,107 +0,0 @@ -return { - vertex = [[ -//#define use_shadow - uniform mat4 camera; //ViewMatrix (gl_ModelViewMatrix is ModelMatrix!) - uniform vec3 cameraPos; - uniform vec3 sunPos; - uniform vec3 sunDiffuse; - uniform vec3 sunAmbient; - #ifdef use_shadow - uniform mat4 shadowMatrix; - uniform vec4 shadowParams; - #endif - - uniform float frame2; - uniform vec3 speed; - - varying vec3 normal; - varying vec3 cameraDir; - varying vec3 teamColor; - varying vec3 light; - - - void main(void) - { - gl_TexCoord[0].st = gl_MultiTexCoord0.st; - - vec4 v = gl_Vertex; - v += (1.0 + speed.z) * smoothstep(0.0,-20.0,gl_Vertex.z) * vec4(sin(radians(frame2*10.0+gl_Vertex.z*5.0)),0.0,0.0,0.0); - v += (1.0 + speed.z) * smoothstep(0.0,15.0,abs(gl_Vertex.x)) * smoothstep(0.0,10.0,abs(gl_Vertex.z)) * vec4(0.0,sin(radians(frame2*15.0+gl_Vertex.z*19.0))*1.2,0.0,0.0); - - v += vec4(-speed.x*150.0,0.0,0.0,0.0) * pow((1.0-clamp((gl_Vertex.z+80.0)/100.0,0.0,1.0)),2.5); - - vec4 worldPos = gl_ModelViewMatrix * v; - - normal = normalize(gl_NormalMatrix * gl_Normal); - cameraDir = worldPos.xyz - cameraPos; - - teamColor = gl_TextureEnvColor[0].rgb; - - float a = max( dot(normal, sunPos), 0.0); - light = a * sunDiffuse + sunAmbient; - - #ifdef use_shadow - gl_TexCoord[1] = shadowMatrix * worldPos; - gl_TexCoord[1].st = gl_TexCoord[1].st * (inversesqrt( abs(gl_TexCoord[1].st) + shadowParams.z) + shadowParams.w) + shadowParams.xy; - #endif - - gl_Position = gl_ProjectionMatrix * camera * worldPos; - } - ]], - fragment = [[ -//#define use_shadow - uniform sampler2D textureS3o1; - uniform sampler2D textureS3o2; - uniform samplerCube specularMap; - - #ifdef use_shadow - uniform sampler2DShadow shadowMap; - uniform float shadowDensity; - uniform vec3 sunAmbient; - #endif - - varying vec3 normal; - varying vec3 cameraDir; - varying vec3 teamColor; - varying vec3 light; - - void main(void) - { - gl_FragColor = texture2D(textureS3o1, gl_TexCoord[0].st); - vec4 extraColor = texture2D(textureS3o2, gl_TexCoord[0].st); - - vec3 reflectDir = reflect(cameraDir, normalize(normal)); - vec3 specular = textureCube(specularMap, reflectDir).rgb; - - vec3 shade; - #ifdef use_shadow - float shadow = shadow2DProj(shadowMap, gl_TexCoord[1]).r; - shadow = 1.0 - (1.0 - shadow) * shadowDensity; - shade = mix(sunAmbient, light, shadow); - specular *= shadow; - #else - shade = light; - #endif - - gl_FragColor.rgb = mix(gl_FragColor.rgb, teamColor, gl_FragColor.a); //teamcolor - gl_FragColor.rgb = gl_FragColor.rgb * shade + specular; - gl_FragColor.a = extraColor.a; - } - ]], - uniformInt = { - textureS3o1 = 0, - textureS3o2 = 1, - shadowMap = 2, - specularMap = 3, - }, - uniform = { - sunPos = {gl.GetSun("pos")}, - sunAmbient = {gl.GetSun("ambient" ,"unit")}, - sunDiffuse = {gl.GetSun("diffuse" ,"unit")}, - shadowDensity = {gl.GetSun("shadowDensity" ,"unit")}, - shadowParams = {gl.GetShadowMapParams()}, - }, - uniformMatrix = { - shadowMatrix = {gl.GetMatrixData("shadow")}, - }, -} \ No newline at end of file diff --git a/LuaRules/Gadgets/dbg_buildicons_run.lua b/LuaRules/Gadgets/dbg_buildicons_run.lua new file mode 100644 index 000000000..6476f8732 --- /dev/null +++ b/LuaRules/Gadgets/dbg_buildicons_run.lua @@ -0,0 +1,55 @@ +function gadget:GetInfo() + return { + name = "Build Icons Slowy (/luarules buildiconslow)", + desc = "builds them all slow-like, 1 per minute for hours on end", + author = "Beherith", + date = "2015", + license = "Horses", + layer = 0, + enabled = true -- loaded by default? + } +end + +if (not gadgetHandler:IsSyncedCode()) then + return +end + +local startframe = 1000000000 +local index=1 +local unitnames={} +local timedelay=30*10 --yeah this crap takes 8 hours, for a total of 427 units :D + +function buildslowly() +Spring.Echo('building icons all slow-like') + startframe=Spring.GetGameFrame() +end + + +function gadget:Initialize() + gadgetHandler:AddChatAction('buildiconslow', buildslowly, "") + + for i,unitdefname in pairs(UnitDefNames) do + --Spring.Echo('unitdefname',i,unitdefname) + unitnames[#unitnames+1]=i + end + -- unitnames={ + -- "armah", + -- "armanni", + -- "armason", + -- "armawac", + -- } +end + +function gadget:GameFrame(n) + -- Spring.Echo(n,startframe,index) + if (n>startframe+timedelay*index and index <=#unitnames) then + -- Spring.Echo(" Drawing unit ",index,UnitDefNames[index]["name"]) + Spring.Echo(" Drawing unit ",index,unitnames[index]," out of ", #unitnames) + Spring.SendCommands("luarules buildicon "..unitnames[index]) + index=index+1 + end +end + +function gadget:Shutdown() + gadgetHandler:RemoveChatAction('buildiconslow') +end diff --git a/LuaRules/Gadgets/dbg_ceg_spawner.lua b/LuaRules/Gadgets/dbg_ceg_spawner.lua deleted file mode 100644 index 29670696f..000000000 --- a/LuaRules/Gadgets/dbg_ceg_spawner.lua +++ /dev/null @@ -1,59 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "CEG Spawner", - desc = 'Spawn CEGs', - author = "CarRepairer", - date = "2010-11-07", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local echo = Spring.Echo - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -local function explode(div,str) - if (div=='') then return false end - local pos,arr = 0,{} - -- for each divider found - for st,sp in function() return string.find(str,div,pos,true) end do - table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider - pos = sp + 1 -- Jump past current divider - end - table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider - return arr -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:RecvLuaMsg(msg, playerID) - if not Spring.IsCheatingEnabled() then return end - - local ceg_msg_prefix = "*" - local ceg_msg = (msg:find(ceg_msg_prefix,1,true)) - - if ceg_msg then - msg = msg:sub(2) - msg = explode('|', msg) - echo ('Spawning CEG', msg[1] ) - Spring.SpawnCEG( msg[1], --cegname - msg[2], msg[3], msg[4], --pos - msg[5], msg[6], msg[7], --dir - msg[8] --radius - ) - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/dbg_gadget_profiler.lua b/LuaRules/Gadgets/dbg_gadget_profiler.lua new file mode 100644 index 000000000..3618d34e2 --- /dev/null +++ b/LuaRules/Gadgets/dbg_gadget_profiler.lua @@ -0,0 +1,609 @@ +function gadget:GetInfo() +return { + name = "Gadget Profiler", + desc = "", + author = "jK, Bluestone", + date = "2007+", + license = "GNU GPL, v2 or later", + layer = math.huge, + handler = true, + enabled = true, +} +end + +-- use 'luarules profile' to switch on the profiler +-- future use of 'luarules profile' acts as a toggle to show/hide the on-screen profiling data (without touching the hooks) +-- use 'luarules kill_profiler' to switch off the profiler for *everyone* currently using it (and remove the hooks) + +-- the DrawScreen call of this profiler has a performance impact, but note that this profiler does not profile its own time/allocation loads + +-- if switched on during a multi-player game, and included within the game archive, the profiler will (also) have a very small performance impact on *all* players (-> synced callin hooks run in synced code!) +-- nobody will notice, but don't profile if you don't need too + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local usePrefixedNames = true + +local prefixedGnames = {} +local function ConstructPrefixedName (ghInfo) + local gadgetName = ghInfo.name + local baseName = ghInfo.basename + local _pos = baseName:find("_", 1) + local prefix = ((_pos and usePrefixedNames) and (baseName:sub(1, _pos-1)..": ") or "") + local prefixedGadgetName = "\255\200\200\200" .. prefix .. "\255\255\255\255" .. gadgetName + + prefixedGnames[gadgetName] = prefixedGadgetName + return prefixedGnames[gadgetName] +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local callinStats = {} +local callinStatsSYNCED = {} + +local spGetTimer = Spring.GetTimer +local spDiffTimers = Spring.DiffTimers +local spGetLuaMemUsage = Spring.GetLuaMemUsage +if spGetLuaMemUsage == nil then + spGetLuaMemUsage = function() return 0,0,0,0,0,0,0,0 end +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function ArrayInsert(t, f, g) + if (f) then + local layer = g.ghInfo.layer + local index = 1 + for i,v in ipairs(t) do + if (v == g) then + return -- already in the table + end + if (layer >= v.ghInfo.layer) then + index = i + 1 + end + end + table.insert(t, index, g) + end +end + +local function ArrayRemove(t, g) + for k,v in ipairs(t) do + if (v == g) then + table.remove(t, k) + -- break + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local Hook = function(g,name) return function(...) return g[name](...) end end -- place-holder +local oldUpdateGadgetCallIn + +local inHook = false +local listOfHooks = {} +setmetatable(listOfHooks, { __mode = 'k' }) + +local function IsHook(func) + return listOfHooks[func] +end + +if (gadgetHandler:IsSyncedCode()) then + Hook = function (g,name) + local gadgetName = g.ghInfo.name + local realFunc = g[name] + g['_old'..name] = realFunc + + if (gadgetName=="Gadget Profiler") then + return realFunc -- don't profile the profilers callins within synced (nothing to profile!) + end + + local hook_func = function(...) + if (inHook) then + return realFunc(...) + end + + local gname = prefixedGnames[gadgetName] or ConstructPrefixedName(g.ghInfo) + + inHook = true + SendToUnsynced("prf_started_from_synced", gname, name) + local results = {realFunc(...)} + SendToUnsynced("prf_finished_from_synced", gname, name) + inHook = false + return unpack(results) + end + + listOfHooks[hook_func] = true -- !!!note: using functions as keys is unsafe in synced code!!! + + return hook_func + end +else + Hook = function (g,name) + local gadgetName = g.ghInfo.name + local realFunc = g[name] + g['_old'..name] = realFunc + + if (gadgetName=="Gadget Profiler") then + return g['_old'..name] -- don't profile the profilers callins (it works, but it is better that our DrawScreen call is unoptimized and expensive anyway!) + end + + local gname = prefixedGnames[gadgetName] or ConstructPrefixedName(g.ghInfo) + + local gadgetCallinStats = callinStats[gname] or {} + callinStats[gname] = gadgetCallinStats + gadgetCallinStats[name] = gadgetCallinStats[name] or {0,0,0,0} + local c = gadgetCallinStats[name] + + local t,s + + local helper_func = function(...) + local dt = spDiffTimers(spGetTimer(),t) + local local_s,_,new_s,_ = spGetLuaMemUsage() + --Spring.Echo(gadgetName,name,"after",local_s,new_s, collectgarbage("count")) + local ds = new_s - s + c[1] = c[1] + dt + c[2] = c[2] + dt + c[3] = c[3] + ds + c[4] = c[4] + ds + inHook = nil + return ... + end + + local hook_func = function(...) + if (inHook) then + return realFunc(...) + end + + inHook = true + t = spGetTimer() + local local_s,_,new_s,_ = spGetLuaMemUsage() + s = new_s + --Spring.Echo(gadgetName,name,"before",local_s,new_s, collectgarbage("count")) + return helper_func(realFunc(...)) + end + + listOfHooks[hook_func] = true + + return hook_func + end +end + +local hookset = false + +local function StartHook(a,b,c,d) + if (hookset) then return false end + + hookset = true + Spring.Echo("start profiling (" .. (SendToUnsynced~=nil and "synced" or "unsynced") .. ")") + + local gh = gadgetHandler + + local CallInsList = {} + for name,e in pairs(gh) do + local i = name:find("List") + if (i)and(type(e)=="table") then + CallInsList[#CallInsList+1] = name:sub(1,i-1) + end + end + + --// hook all existing callins + for _,callin in ipairs(CallInsList) do + local callinGadgets = gh[callin .. "List"] + for _,g in ipairs(callinGadgets or {}) do + g[callin] = Hook(g,callin) + end + end + + Spring.Echo("hooked all callins") + + --// hook the UpdateCallin function + oldUpdateGadgetCallIn = gh.UpdateGadgetCallIn + gh.UpdateGadgetCallIn = function(self,name,g) + local listName = name .. 'List' + local ciList = self[listName] + if (ciList) then + local func = g[name] + if (type(func) == 'function') then + if (not IsHook(func)) then + g[name] = Hook(g,name) + end + ArrayInsert(ciList, func, g) + else + ArrayRemove(ciList, g) + end + self:UpdateCallIn(name) + else + print('UpdateGadgetCallIn: bad name: ' .. name) + end + end + + Spring.Echo("hooked UpdateCallin") + + if SendToUnsynced then + --Spring.Echo("sending start command to unsynced") + SendToUnsynced("Start_from_synced") + end + + return false -- allow the unsynced chataction to execute too +end + +function KillHook() + if not (hookset) then return true end + + Spring.Echo("stop profiling (" .. (SendToUnsynced~=nil and "synced" or "unsynced") .. ")") + + local gh = gadgetHandler + + local CallInsList = {} + for name,e in pairs(gh) do + local i = name:find("List") + if (i)and(type(e)=="table") then + CallInsList[#CallInsList+1] = name:sub(1,i-1) + end + end + + --// unhook all existing callins + for _,callin in ipairs(CallInsList) do + local callinGadgets = gh[callin .. "List"] + for _,g in ipairs(callinGadgets or {}) do + if (g["_old" .. callin]) then + g[callin] = g["_old" .. callin] + end + end + end + + Spring.Echo("unhooked all callins") + + --// unhook the UpdateCallin function + gh.UpdateGadgetCallIn = oldUpdateGadgetCallIn + + Spring.Echo("unhooked UpdateCallin") + + hookset = false + return false -- allow the unsynced chataction to execute too +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if (gadgetHandler:IsSyncedCode()) then +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:Initialize() + gadgetHandler.actionHandler.AddChatAction(gadget, 'profile', StartHook, " : starts the gadget profiler" ) -- first hook the synced callins, then synced will come back and tell us to (really) start + gadgetHandler.actionHandler.AddChatAction(gadget, 'kill_profiler', KillHook, " : kills the gadget profiler" ) -- removes the profiler for everyone currently running it +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +else +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local show = false +local startedProfiler = false +local validated = false + +local timersSynced = {} +local startTickTimer +local memUsageSynced = {} + +local function StartDrawCallin() -- when the profiler isn't running, the profiler gadget should have *no* draw callin + gadget.DrawScreen = gadget.DrawScreen_ + gadgetHandler:UpdateGadgetCallIn("DrawScreen", gadget) +end + +local function KillDrawCallin() + gadget.DrawScreen_ = gadget.DrawScreen + gadget.DrawScreen = nil + gadgetHandler:UpdateGadgetCallIn("DrawScreen", gadget) +end + +function SyncedCallinStarted(_,gname,cname) + timersSynced[#timersSynced+1] = spGetTimer() -- callins may call each other -> we need a FIFO queue + local _,_,s,_ = spGetLuaMemUsage() + memUsageSynced[#memUsageSynced+1] = s +end + +function SyncedCallinFinished(_,gname,cname) + local dt = spDiffTimers(spGetTimer(),timersSynced[#timersSynced]) + timersSynced[#timersSynced] = nil + local _,_,new_s,_ = spGetLuaMemUsage() + local ds = new_s - memUsageSynced[#memUsageSynced] + memUsageSynced[#memUsageSynced] = nil + + local gadgetCallinStats = callinStatsSYNCED[gname] or {} + callinStatsSYNCED[gname] = gadgetCallinStats + gadgetCallinStats[cname] = gadgetCallinStats[cname] or {0,0,0,0} + local c = gadgetCallinStats[cname] + + c[1] = c[1] + dt + c[2] = c[2] + dt + c[3] = c[3] + ds + c[4] = c[4] + ds +end + +function Start (_,_,_,pID,_) + if pID==Spring.GetMyPlayerID() or validated then + validated = true + + StartHook() -- the unsynced one! + startTickTimer = Spring.GetTimer() + + StartDrawCallin() + show = not show + + Spring.Echo("luarules profiler started (player " .. pID .. ")") + end +end + +function Kill (_,_,_,pID,_) + if validated then + KillDrawCallin() + KillHook() + + show = false + validated = false + + startTickTimer = nil + timersSynced = {} + memUsageSynced = {} + + Spring.Echo("luarules profiler killed (player " .. pID .. ")") + end +end + +function gadget:Initialize() + gadgetHandler.actionHandler.AddChatAction(gadget, "profile", Start) + gadgetHandler.actionHandler.AddChatAction(gadget, "kill_profiler", Kill) + + gadgetHandler.actionHandler.AddSyncAction(gadget, "prf_started_from_synced",SyncedCallinStarted) -- internal, not meant to be called by user + gadgetHandler.actionHandler.AddSyncAction(gadget, "prf_finished_from_synced",SyncedCallinFinished) -- internal, not meant to be called by user +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local tick = 0.2 +local averageTime = 2 + +local timeLoadAverages = {} +local spaceLoadAverages = {} +local redStrength = {} +local timeLoadAveragesSYNCED = {} +local spaceLoadAveragesSYNCED = {} +local redStrengthSYNCED = {} + +local lm,_,gm,_,um,_,sm,_ = spGetLuaMemUsage() + +local function CalcLoad(old_load, new_load, t) + return old_load*math.exp(-tick/t) + new_load*(1 - math.exp(-tick/t)) +end + +local totalLoads = {} +local allOverTimeSec = 0 -- currently unused + +local sortedList = {} +local sortedListSYNCED = {} +local function SortFunc(a,b) + return a.plainname < b.plainname +end + +local minPerc = 0.005 -- above this value, we fade in how red we mark a widget (/gadget) +local maxPerc = 0.02 -- above this value, we mark a widget as red +local minSpace = 10 -- Kb +local maxSpace = 100 + +local title_colour = "\255\160\255\160" +local totals_colour = "\255\200\200\255" + +local function ColourString(R,G,B) + R255 = math.floor(R*255) + G255 = math.floor(G*255) + B255 = math.floor(B*255) + if (R255%10 == 0) then R255 = R255+1 end + if (G255%10 == 0) then G255 = G255+1 end + if (B255%10 == 0) then B255 = B255+1 end + return "\255"..string.char(R255)..string.char(G255)..string.char(B255) +end + +function GetRedColourStrings(tTime, sLoad, name, redStr, deltaTime) + local u = math.exp(-deltaTime/5) --magic colour changing rate + + if tTime>maxPerc then tTime = maxPerc end + if tTimecmax_t) then + cmax_t = c[2] + cmaxname_t = cname + end + c[1] = 0 + + space = space + c[3] + if (c[4]>cmax_space) then + cmax_space = c[4] + cmaxname_space = cname + end + c[3] = 0 + end + + local relTime = 100 * t / deltaTime + timeLoadAvgs[gname] = CalcLoad(timeLoadAvgs[gname] or relTime, relTime, averageTime) + + local relSpace = space / deltaTime + spaceloadAvgs[gname] = CalcLoad(spaceloadAvgs[gname] or relSpace, relSpace, averageTime) + + allOverTimeSec = allOverTimeSec + t + + local tLoad = timeLoadAvgs[gname] + local sLoad = spaceloadAvgs[gname] + local tTime = t/deltaTime + + local tColourString, sColourString = GetRedColourStrings(tTime, sLoad, gname, redStr, deltaTime) + + sorted[n] = {plainname=gname, fullname=gname..' \255\200\200\200('..cmaxname_t..','..cmaxname_space..')', tLoad=tLoad, sLoad=sLoad, tTime=tTime, tColourString=tColourString, sColourString=sColourString} + allOverTime = allOverTime + tLoad + allOverSpace = allOverSpace + sLoad + + n = n + 1 + end + + table.sort(sorted,SortFunc) + + sorted.allOverTime = allOverTime + sorted.allOverSpace = allOverSpace + + return sorted +end + +local function DrawSortedList(list, name, x,y,j, fontSize,lineSpace,maxLines,colWidth,dataColWidth) + if #list==0 then return 0,0 end + + if j>=maxLines-5 then x = x - colWidth; j = 0; end + j = j + 1 + gl.Text(title_colour..name, x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + j = j + 2 + + for i=1,#list do + if j>=maxLines then x = x - colWidth; j = 0; end + local v = list[i] + local name = v.plainname + local gname = v.fullname + local tTime = v.tTime + local tLoad = v.tLoad + local sLoad = v.sLoad + local tColour = v.tColourString + local sColour = v.sColourString + + gl.Text(tColour .. ('%.2f%%'):format(tLoad), x, y-lineSpace*j, fontSize, "no") + gl.Text(sColour .. ('%.0f'):format(sLoad) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + gl.Text(gname, x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + + j = j + 1 + end + + gl.Text(totals_colour..('%.2f%%'):format(list.allOverTime), x, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.0f'):format(list.allOverSpace) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour.."totals ("..string.lower(name)..")", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + j = j + 1 + + return x,j +end + +function gadget:DrawScreen_() + if not (validated and show) then return end + + if not (next(callinStats)) and not (next(callinStatsSYNCED)) then + Spring.Echo("no data in profiler!") + return + end + + local deltaTime = Spring.DiffTimers(Spring.GetTimer(),startTickTimer) + if (deltaTime>=tick) then + startTickTimer = Spring.GetTimer() + + sortedList = ProcessCallinStats(callinStats, timeLoadAverages, spaceLoadAverages, redStrength, deltaTime) + sortedListSYNCED = ProcessCallinStats(callinStatsSYNCED, timeLoadAveragesSYNCED, spaceLoadAveragesSYNCED, redStrengthSYNCED, deltaTime) + + lm,_,gm,_,um,_,sm,_ = spGetLuaMemUsage() + end + + local vsx, vsy = gl.GetViewSizes() + + local fontSize = math.max(11,math.floor(vsy/90)) + local lineSpace = fontSize + 2 + + local dataColWidth = fontSize*5 + local colWidth = vsx*0.98/4 + + local x,y = vsx-colWidth, vsy*0.77 -- initial coord for writing + local maxLines = math.max(20,math.floor(y/lineSpace)-3) + local j = -1 --line number + + gl.Color(1,1,1,1) + gl.BeginText() + + x,j = DrawSortedList(sortedList, "UNSYNCED", x,y,j, fontSize,lineSpace,maxLines,colWidth,dataColWidth) + + if j>=maxLines-15 then x = x - colWidth; j = -1; end + + x,j = DrawSortedList(sortedListSYNCED, "SYNCED", x,y,j, fontSize,lineSpace,maxLines,colWidth,dataColWidth) + + if j>=maxLines-15 then x = x - colWidth; j = -1; end + + j = j + 1 + gl.Text(title_colour.."ALL", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + j = j + 1 + + j = j + 1 + gl.Text(totals_colour.."total percentage of running time spent in luarules callins", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.1f%%'):format((sortedList.allOverTime or 0)+(sortedListSYNCED.allOverTime or 0)), x+dataColWidth, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour.."total rate of mem allocation by luarules callins", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.0f'):format((sortedList.allOverSpace or 0)+(sortedListSYNCED.allOverSpace or 0)) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + + j = j + 2 + gl.Text(totals_colour..'total lua memory usage is '.. ('%.0f'):format(gm/1000) .. 'MB, of which:', x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*lm/gm) .. '% is from unsynced luarules', x, y-lineSpace*j, fontSize, "no") + --note: it's not currently possible to callout the footprint of (specifically) synced luarules + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*um/gm) .. '% is from unsynced states (luarules+luagaia+luaui)', x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*sm/gm) .. '% is from synced states (luarules+luagaia)', x, y-lineSpace*j, fontSize, "no") + + + j = j + 2 + gl.Text(title_colour.."All data excludes load from garbage collection & executing GL calls", x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(title_colour.."Callins in brackets are heaviest per gadget for (time,allocs)", x, y-lineSpace*j, fontSize, "no") + + j = j + 2 + gl.Text(title_colour.."Tick time: " .. tick .. "s", x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(title_colour.."Smoothing time: " .. averageTime .. "s", x, y-lineSpace*j, fontSize, "no") + + gl.EndText() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +end diff --git a/LuaRules/Gadgets/dbg_profiler.lua b/LuaRules/Gadgets/dbg_profiler.lua deleted file mode 100644 index 13abfb9b8..000000000 --- a/LuaRules/Gadgets/dbg_profiler.lua +++ /dev/null @@ -1,429 +0,0 @@ --- $Id: dbg_profiler.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "Profiler", - desc = "", - author = "jK", - date = "2007,2008,2009", - license = "GNU GPL, v2 or later", - layer = math.huge, - handler = true, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local callinTimes = {} -local callinTimesSYNCED = {} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local SCRIPT_DIR = Script.GetName() .. '/' - -local Hook = function(g,name) return function(...) return g[name](...) end end --//place holder - -local inHook = false -local listOfHooks = {} -setmetatable(listOfHooks, { __mode = 'k' }) - -local function IsHook(func) - return listOfHooks[func] -end - -if (gadgetHandler:IsSyncedCode()) then - Hook = function (g,name) - local origFunc = g[name] - - local hook_func = function(...) - if (inHook) then - return origFunc(...) - end - - inHook = true - SendToUnsynced("prf_started", g.ghInfo.name, name) - local results = {origFunc(...)} - SendToUnsynced("prf_finished", g.ghInfo.name, name) - inHook = false - return unpack(results) - end - - listOfHooks[hook_func] = true --note: using function in keys is unsafe in synced code!!! - - return hook_func - end -else - Hook = function (g,name) - local spGetTimer = Spring.GetTimer - local spDiffTimers = Spring.DiffTimers - local gadgetName = g.ghInfo.name - - local realFunc = g[name] - - if (gadgetName=="Profiler") then - return realFunc - end - local gadgetCallinTime = callinTimes[gadgetName] or {} - callinTimes[gadgetName] = gadgetCallinTime - gadgetCallinTime[name] = gadgetCallinTime[name] or {0,0} - local timeStats = gadgetCallinTime[name] - - local t - - local helper_func = function(...) - local dt = spDiffTimers(spGetTimer(),t) - timeStats[1] = timeStats[1] + dt - timeStats[2] = timeStats[2] + dt - inHook = nil - return ... - end - - local hook_func = function(...) - if (inHook) then - return realFunc(...) - end - - inHook = true - t = spGetTimer() - return helper_func(realFunc(...)) - end - - listOfHooks[hook_func] = true - - return hook_func - end -end - -local function ArrayInsert(t, f, g) - if (f) then - local layer = g.ghInfo.layer - local index = 1 - for i,v in ipairs(t) do - if (v == g) then - return -- already in the table - end - if (layer >= v.ghInfo.layer) then - index = i + 1 - end - end - table.insert(t, index, g) - end -end - - -local function ArrayRemove(t, g) - for k,v in ipairs(t) do - if (v == g) then - table.remove(t, k) - -- break - end - end -end - -local hookset = false - -local function StartHook() - if (hookset) then return end - hookset = true - Spring.Echo("start profiling") - - local gh = gadgetHandler - - local CallInsList = {} - for name,e in pairs(gh) do - local i = name:find("List") - if (i)and(type(e)=="table") then - CallInsList[#CallInsList+1] = name:sub(1,i-1) - end - end - - --// hook all existing callins - for _,callin in ipairs(CallInsList) do - local callinGadgets = gh[callin .. "List"] - for _,g in ipairs(callinGadgets or {}) do - g[callin] = Hook(g,callin) - end - end - - Spring.Echo("hooked all callins: OK") - - oldUpdateGadgetCallIn = gh.UpdateGadgetCallIn - gh.UpdateGadgetCallIn = function(self,name,g) - local listName = name .. 'List' - local ciList = self[listName] - if (ciList) then - local func = g[name] - if (type(func) == 'function') then - if (not IsHook(func)) then - g[name] = Hook(g,name) - end - ArrayInsert(ciList, func, g) - else - ArrayRemove(ciList, g) - end - self:UpdateCallIn(name) - else - print('UpdateGadgetCallIn: bad name: ' .. name) - end - end - - Spring.Echo("hooked UpdateCallin: OK") -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (gadgetHandler:IsSyncedCode()) then - - function gadget:Initialize() - gadgetHandler.actionHandler.AddChatAction(gadget, 'profile', StartHook, - " : starts the gadget profiler (for debugging issues)" - ) - --StartHook() - end - - --function gadget:Shutdown() - --end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- -else - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local startTimer - local startTimerSYNCED - local profile_unsynced = false - local profile_synced = false - - local function UpdateDrawCallin() - gadget.DrawScreen = gadget.DrawScreen_ - gadgetHandler:UpdateGadgetCallIn("DrawScreen", gadget) - end - - local function Start(cmd, msg, words, playerID) - if (Spring.GetLocalPlayerID() ~= playerID) then - return - end - - if (not profile_unsynced) then - UpdateDrawCallin() - UpdateDrawCallin() - startTimer = Spring.GetTimer() - StartHook() - profile_unsynced = true - end - end - local function StartSYNCED(cmd, msg, words, playerID) - if (Spring.GetLocalPlayerID() ~= playerID) then - return - end - - if (not profile_synced) then - startTimerSYNCED = Spring.GetTimer() - profile_synced = true - UpdateDrawCallin() - UpdateDrawCallin() - end - end - - local timers = {} - function SyncedCallinStarted(_,gname,cname) - local t = Spring.GetTimer() - timers[#timers+1] = t - end - - function SyncedCallinFinished(_,gname,cname) - local dt = Spring.DiffTimers(Spring.GetTimer(),timers[#timers]) - timers[#timers]=nil - - local gadgetCallinTime = callinTimesSYNCED[gname] or {} - callinTimesSYNCED[gname] = gadgetCallinTime - gadgetCallinTime[cname] = gadgetCallinTime[cname] or {0,0} - local timeStats = gadgetCallinTime[cname] - - timeStats[1] = timeStats[1] + dt - timeStats[2] = timeStats[2] + dt - end - - function gadget:Initialize() - gadgetHandler.actionHandler.AddSyncAction(gadget, "prf_started",SyncedCallinStarted) - gadgetHandler.actionHandler.AddSyncAction(gadget, "prf_finished",SyncedCallinFinished) - - gadgetHandler.actionHandler.AddChatAction(gadget, 'uprofile', Start, - " : starts the gadget profiler (for debugging issues)" - ) - gadgetHandler.actionHandler.AddChatAction(gadget, 'profile', StartSYNCED,"") - --StartHook() - end - -local tick = 0.1 -local averageTime = 5 -local loadAverages = {} - -local function CalcLoad(old_load, new_load, t) - return old_load*math.exp(-tick/t) + new_load*(1 - math.exp(-tick/t)) - --return (old_load-new_load)*math.exp(-tick/t) + new_load -end - -local maximum = 0 -local maximumSYNCED = 0 -local totalLoads = {} -local allOverTime = 0 -local allOverTimeSYNCED = 0 -local allOverTimeSec = 0 - -local sortedList = {} -local sortedListSYNCED = {} -local function SortFunc(a,b) - --if (a[2]==b[2]) then - return a[1]b[2] - --end -end - - function gadget:DrawScreen_() - if not (next(callinTimes)) then - return --// nothing to do - end - - if (profile_unsynced) then - local deltaTime = Spring.DiffTimers(Spring.GetTimer(),startTimer) - if (deltaTime>=tick) then - startTimer = Spring.GetTimer() - - totalLoads = {} - maximum = 0 - allOverTime = 0 - local n = 1 - for wname,callins in pairs(callinTimes) do - local total = 0 - local cmax = 0 - local cmaxname = "" - for cname,timeStats in pairs(callins) do - total = total + timeStats[1] - if (timeStats[2]>cmax) then - cmax = timeStats[2] - cmaxname = cname - end - timeStats[1] = 0 - end - - local load = 100*total/deltaTime - loadAverages[wname] = CalcLoad(loadAverages[wname] or load, load, averageTime) - - allOverTimeSec = allOverTimeSec + total - - local tLoad = loadAverages[wname] - sortedList[n] = {wname..'('..cmaxname..')',tLoad} - allOverTime = allOverTime + tLoad - if (maximum=tick) then - startTimerSYNCED = Spring.GetTimer() - - totalLoads = {} - maximumSYNCED = 0 - allOverTimeSYNCED = 0 - local n = 1 - for wname,callins in pairs(callinTimesSYNCED) do - local total = 0 - local cmax = 0 - local cmaxname = "" - for cname,timeStats in pairs(callins) do - total = total + timeStats[1] - if (timeStats[2]>cmax) then - cmax = timeStats[2] - cmaxname = cname - end - timeStats[1] = 0 - end - - local load = 100*total/deltaTimeSYNCED - loadAverages[wname] = CalcLoad(loadAverages[wname] or load, load, averageTime) - - allOverTimeSec = allOverTimeSec + total - - local tLoad = loadAverages[wname] - sortedListSYNCED[n] = {wname..'('..cmaxname..')',tLoad} - allOverTimeSYNCED = allOverTimeSYNCED + tLoad - if (maximumSYNCED maximum) and (maximumSYNCED) or (maximum) - - gl.Color(1,1,1,1) - gl.BeginText() - if (profile_unsynced) then - for i=1,#sortedList do - local v = sortedList[i] - local wname = v[1] - local tLoad = v[2] - if maximum > 0 then - gl.Rect(x+100-tLoad/maximum_*100, y+1-(12)*i, x+100, y+9-(12)*i) - end - gl.Text(wname, x+150, y+1-(12)*i, 10) - gl.Text(('%.3f%%'):format(tLoad), x+105, y+1-(12)*i, 10) - end - end - if (profile_synced) then - local j = #sortedList + 1 - - gl.Rect(x, y+5-(12)*j, x+230, y+4-(12)*j) - gl.Color(1,0,0) - gl.Text("SYNCED", x+115, y-3-(12)*j, 12, "nOc") - gl.Color(1,1,1,1) - j = j - - for i=1,#sortedListSYNCED do - local v = sortedListSYNCED[i] - local wname = v[1] - local tLoad = v[2] - if maximum > 0 then - gl.Rect(x+100-tLoad/maximum_*100, y+1-(12)*(j+i), x+100, y+9-(12)*(j+i)) - end - gl.Text(wname, x+150, y+1-(12)*(j+i), 10) - gl.Text(('%.3f%%'):format(tLoad), x+105, y+1-(12)*(j+i), 10) - end - end - local i = #sortedList + #sortedListSYNCED + 2 - gl.Text("\255\255\064\064total time", x+150, y-1-(12)*i, 10) - gl.Text("\255\255\064\064"..('%.3fs'):format(allOverTimeSec), x+105, y-1-(12)*i, 10) - i = i+1 - gl.Text("\255\255\064\064total FPS cost", x+150, y-1-(12)*i, 10) - gl.Text("\255\255\064\064"..('%.1f%%'):format(allOverTime+allOverTimeSYNCED), x+105, y-1-(12)*i, 10) - gl.EndText() - end - -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/Gadgets/engine_hotfixes.lua b/LuaRules/Gadgets/engine_hotfixes.lua index bd35b4527..0c0a41024 100644 --- a/LuaRules/Gadgets/engine_hotfixes.lua +++ b/LuaRules/Gadgets/engine_hotfixes.lua @@ -20,17 +20,27 @@ if gadgetHandler:IsSyncedCode() then -- Callins ---------------------------------------------------------------- ---Instagibb any features that are unlucky enough to be in the build radius of new construction projects + function gadget:UnitCreated(uID, uDefID, uTeam, bID) local uDef = UnitDefs[uDefID] + + --Fix for bad movement in 102 + --https://springrts.com/phpbb/viewtopic.php?f=12&t=34593 + local md = uDef.moveDef + if (md.type ~= nil) then -- all non-flying units + Spring.MoveCtrl.SetGroundMoveTypeData(uID, "turnAccel", uDef.turnRate) + end + + --Instagibb any features that are unlucky enough to be in the build radius of new construction projects if uDef.isBuilding or uDef.isFactory then + --Spring.Echo("Wheee it spins!") local ux, uy, uz = Spring.GetUnitPosition(uID) local xr, zr if Spring.GetUnitBuildFacing(uID) % 2 == 0 then - xr, zr = 4 * uDef.xsize, 4 * uDef.zsize - else - xr, zr = 4 * uDef.zsize, 4 * uDef.xsize + xr, zr = 5 * uDef.xsize, 5 * uDef.zsize + else + xr, zr = 5 * uDef.zsize, 5 * uDef.xsize end local features = Spring.GetFeaturesInRectangle(ux-xr, uz-zr, ux+xr, uz+zr) @@ -39,19 +49,23 @@ if gadgetHandler:IsSyncedCode() then local fDefID = Spring.GetFeatureDefID(fID) local fDef = FeatureDefs[fDefID] - if (not fDef.geoThermal) and (fDef.name ~= 'geovent') then + if (not fDef.geoThermal) and (fDef.name ~= 'geovent') + and (fDef.name ~= 'xelnotgawatchtower') + and (fDef.name ~= 'crystalring') + then local fx, fy, fz = Spring.GetFeaturePosition(fID) Spring.DestroyFeature(fID) Spring.SpawnCEG('sparklegreen', fx, fy, fz) - Spring.PlaySoundFile('sounds/reclaimed.wav', 1, fx, fy, fz) + Spring.PlaySoundFile('sounds/miscfx/reclaimed.wav', 1, fx, fy, fz) end end end end + --Remove damage hardcoded in the engine of gibbed pieces of units (hardcoded to 50 damage in engine) function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam) if weaponDefID == -1 then - return 0 + return 0, 0 end return damage end diff --git a/LuaRules/Gadgets/engine_taskbar_stuff.lua b/LuaRules/Gadgets/engine_taskbar_stuff.lua index 3b18aa012..9f9a2efee 100644 --- a/LuaRules/Gadgets/engine_taskbar_stuff.lua +++ b/LuaRules/Gadgets/engine_taskbar_stuff.lua @@ -27,6 +27,7 @@ local SetWMCaption = Spring.SetWMCaption or noFunc function gadget:Initialize() local name = Game.modName SetWMIcon("bitmaps/evologo.bmp") - SetWMCaption(name .. " (Spring " .. Game.version .. ")", name) + local engineVersion = (Game and Game.version) or (Engine and Engine.version) or "Engine version error" + SetWMCaption(name .. " (Spring " .. engineVersion .. ")", name) gadgetHandler:RemoveGadget() -end \ No newline at end of file +end diff --git a/LuaRules/Gadgets/factory_anti_slacker.lua b/LuaRules/Gadgets/factory_anti_slacker.lua new file mode 100644 index 000000000..4ac03af4f --- /dev/null +++ b/LuaRules/Gadgets/factory_anti_slacker.lua @@ -0,0 +1,54 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if not gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function gadget:GetInfo() + return { + name = "Factory Anti Slacker", + desc = "Inhibits factory blocking.", + author = "Licho, edited by KingRaptor", + date = "10.4.2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +local spGetUnitDefID = Spring.GetUnitDefID +local spGetGameFrame = Spring.GetGameFrame +local spSetUnitBlocking = Spring.SetUnitBlocking +local spGetUnitIsDead = Spring.GetUnitIsDead + +local noEject = { + -- [UnitDefNames["missilesilo"].id] = true, + -- [UnitDefNames["factoryship"].id] = true, + -- [UnitDefNames["factoryplane"].id] = true, + -- [UnitDefNames["factorygunship"].id] = true, +} +local ghostFrames = 360 --how long the unit will be ethereal + +local setBlocking = {} --indexed by gameframe, contains a subtable of unitIDs + +function gadget:GameFrame(n) + if setBlocking[n] then --restore blocking + for unitID, _ in pairs(setBlocking[n]) do + if not spGetUnitIsDead(unitID) then spSetUnitBlocking(unitID, true) end + end + setBlocking[n] = nil + end +end + +function gadget:UnitFromFactory(unitID, unitDefID, teamID, builderID, builderDefID) + if not noEject[builderDefID] then + --Spring.Echo("Ejecting unit") + local frame = spGetGameFrame() + ghostFrames + if not setBlocking[frame] then setBlocking[frame] = {} end + setBlocking[frame][unitID] = true + spSetUnitBlocking(unitID, false) + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/feature_energycore.lua b/LuaRules/Gadgets/feature_energycore.lua new file mode 100644 index 000000000..fc95293b4 --- /dev/null +++ b/LuaRules/Gadgets/feature_energycore.lua @@ -0,0 +1,25 @@ +function gadget:GetInfo() + return { + name = "Energy core handler", + desc = "", + author = "Floris", + date = "November 2017", + license = "", + layer = 0, + enabled = false -- loaded by default? + } +end + + +if (gadgetHandler:IsSyncedCode()) then + + local energycoreDefID = FeatureDefNames['ammobox'].id + + function gadget:FeatureCreated(featureID, allyTeamID) + if Spring.GetFeatureDefID(featureID) == energycoreDefID then + Spring.SetFeatureRotation(featureID,0,math.random()*360,0) + Spring.SetFeatureRotation(featureID,1,(math.random()-0.5)*320,0) + Spring.SetFeatureRotation(featureID,0,math.random()*360,1) + end + end +end diff --git a/LuaRules/Gadgets/fps_broadcast.lua b/LuaRules/Gadgets/fps_broadcast.lua new file mode 100644 index 000000000..f7128e6db --- /dev/null +++ b/LuaRules/Gadgets/fps_broadcast.lua @@ -0,0 +1,87 @@ + +function gadget:GetInfo() + return { + name = "FPS Broadcast", + desc = "Broadcasts FramesPerSecond", + author = "Floris", + date = "July,2016", + layer = 0, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-- config +-------------------------------------------------------------------------------- + +local sendPacketEvery = 2 + +-------------------------------------------------------------------------------- +-- synced +-------------------------------------------------------------------------------- +if gadgetHandler:IsSyncedCode() then + + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationFps = validation + + function gadget:RecvLuaMsg(msg, playerID) + if msg:sub(1,1)=="@" and msg:sub(2,3)==validation then + SendToUnsynced("fpsBroadcast",playerID,tonumber(msg:sub(4))) + return true + end + end + +else + -------------------------------------------------------------------------------- + -- unsynced + -------------------------------------------------------------------------------- + + local GetLastUpdateSeconds= Spring.GetLastUpdateSeconds + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local GetFPS = Spring.GetFPS + + local updateTimer = 0 + local avgFps = GetFPS() + local numframes = 0 + local validation = SYNCED.validationFps + + function gadget:Initialize() + gadgetHandler:AddSyncAction("fpsBroadcast", handleFpsEvent) + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("fpsBroadcast") + end + + function handleFpsEvent(_,playerID,fps) + if Script.LuaUI("FpsEvent") then + Script.LuaUI.FpsEvent(playerID,fps) + end + end + + function gadget:Update() + updateTimer = updateTimer + GetLastUpdateSeconds() + if numFrames == nil then numFrames = 0 end + numFrames = numFrames + 1 + avgFps = ((avgFps*(numFrames-1))+GetFPS()) / numFrames + if updateTimer > sendPacketEvery then + SendLuaRulesMsg("@"..validation..math.floor(avgFps+0.5)) + updateTimer = 0 + avgFps = 0 + numFrames = 0 + end + end + +end + diff --git a/LuaRules/Gadgets/game_autocolors.lua b/LuaRules/Gadgets/game_autocolors.lua new file mode 100644 index 000000000..e6f74ec65 --- /dev/null +++ b/LuaRules/Gadgets/game_autocolors.lua @@ -0,0 +1,372 @@ +if gadgetHandler:IsSyncedCode() then + return +end + +function gadget:GetInfo() + return { + name = "AutoColorPicker", + desc = "Automatically assigns colors to teams", + author = "Damgam", + date = "2021", + layer = -100, + enabled = true, + } +end + +local spGetTeamInfo = Spring.GetTeamInfo +local spGetTeamList = Spring.GetTeamList +local spGetAllyTeamList= Spring.GetAllyTeamList +local spGetMyTeamID = Spring.GetMyTeamID +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spSetTeamColor = Spring.SetTeamColor +local spGetTeamLuaAI = Spring.GetTeamLuaAI +local spGetGaiaTeamID = Spring.GetGaiaTeamID +local spGetSpectatingState = Spring.GetSpectatingState +local spGetConfigInt = Spring.GetConfigInt +local spGetLastUpdateSeconds = Spring.GetLastUpdateSeconds + +local myPlayerID = Spring.GetMyPlayerID() + + + +local ffaCounter = 0 +local allyCounter = 0 +local enemyCounter = 0 +local simpleColorsUpdateCounter = 0 + +SimpleColorsEnabled = Spring.GetConfigInt("simple_auto_colors", 0) -- Floris plz add option here +local DynamicTeamColorsEnabledModoption = (Spring.GetModOptions and Spring.GetModOptions().teamcolors_dynamic) or "enabled" +if DynamicTeamColorsEnabledModoption == "enabled" then + DynamicTeamColorsEnabled = true +else + DynamicTeamColorsEnabled = false +end +local AnonymousModeEnabledModoption = (Spring.GetModOptions and Spring.GetModOptions().teamcolors_anonymous_mode) or "disabled" +if AnonymousModeEnabledModoption == "enabled" then + AnonymousModeEnabled = true +else + AnonymousModeEnabled = false +end +local IconDevModeEnabledModoption = (Spring.GetModOptions and Spring.GetModOptions().teamcolors_icon_dev_mode) or "disabled" +if IconDevModeEnabledModoption == "disabled" then + IconDevModeEnabled = false +else + if IconDevModeEnabledModoption == "armblue" then + IconDevModeColor = {0, 80, 255} + elseif IconDevModeEnabledModoption == "corred" then + IconDevModeColor = {255, 16, 5} + elseif IconDevModeEnabledModoption == "scavpurp" then + IconDevModeColor = {97, 36, 97} + elseif IconDevModeEnabledModoption == "chickenorange" then + IconDevModeColor = {255, 125, 32} + elseif IconDevModeEnabledModoption == "gaiagray" then + IconDevModeColor = {127, 127, 127} + end + IconDevModeEnabled = true +end + +SimplePlayerColor = {0, 80, 255} -- Armada Blue +SimpleAllyColor = {0,255,0} -- Full Green +SimpleEnemyColor = {255, 16, 5} -- Cortex Red + +-- FFA +FFAColors = { + [1] = {82, 151, 255 }, -- Blue + [2] = {255, 0, 0 }, -- Red + [3] = {10, 232, 18 }, -- Green + [4] = {255, 232, 22 }, -- Yellow + [5] = {94, 9, 178 }, -- Purple + [6] = {255, 125, 32 }, -- Orange + [7] = {47, 66, 238 }, -- Darker Blue + [8] = {229, 18, 120 }, -- Pink + [9] = {191, 169, 255 }, -- Lavender + [10] ={255, 243, 135 }, -- Bleached Yellow + [11] ={0, 170, 99 }, -- Grass + [12] ={166, 14, 5 }, -- Blood + [13] ={178, 255, 227 }, -- Aqua + [14] ={251, 167, 120 }, -- Skin? lol + [15] ={8, 37, 190 }, -- Dark Blue + [16] ={118, 39, 6 }, -- Brown +} + + +AllyColors = { + [2] = { -- Two Teams + [1] = {0, 80, 255 }, -- Armada Blue + [2] = {10, 232, 18 }, -- Green + [3] = {147, 226, 251 }, -- Light Blue + [4] = {82, 151, 255 }, -- Darker Blue + [5] = {191, 169, 255 }, -- Lavender + [6] = {0, 170, 99 }, -- Grass + [7] = {117, 253, 147 }, -- Aqua Green + [8] = {8, 37, 190 }, -- Dark Blue + }, + [3] = { -- Three Teams + [1] = {82, 151, 255 }, + [2] = {47, 66, 238 }, + [3] = {147, 226, 251 }, + [4] = {8, 37, 190 }, + [5] = {35, 11, 129 }, + }, + [4] = { -- Four Teams + [1] = {82, 151, 255 }, + [2] = {47, 66, 238 }, + [3] = {147, 226, 251 }, + [4] = {8, 37, 190 }, + }, + [5] = { -- Five Teams + [1] = {82, 151, 255 }, + [2] = {47, 66, 238 }, + [3] = {147, 226, 251 }, + }, + [6] = { -- Six Teams + [1] = {82, 151, 255 }, + [2] = {47, 66, 238 }, + }, +} + +EnemyColors = { + [2] = { -- Two Teams + [1] = { + [1] = {200, 16, 5 }, -- Cortex Red + [2] = {255, 232, 22 }, -- Yellow + [3] = {255, 125, 32 }, -- Orange + [4] = {229, 18, 120 }, -- Pink + [5] = {255, 243, 135 }, -- Bleached Yellow + [6] = {166, 14, 5 }, -- Blood + [7] = {251, 167, 120 }, -- Skin? lol + [8] = {118, 39, 6 }, -- Brown + }, + }, + [3] = { -- Three Teams + [1] = { -- First Enemy Team + [1] = {231, 0, 0 }, + [2] = {255, 125, 32 }, + [3] = {255, 232, 22 }, + [4] = {166, 14, 5 }, + [5] = {118, 39, 6 }, + }, + [2] = { -- Second Enemy Team + [1] = {10, 232, 32 }, + [2] = {10, 142, 7 }, + [3] = {117, 253, 147 }, + [4] = {5, 84, 13 }, + [5] = {45, 57, 9 }, + }, + }, + [4] = { -- Four Teams + [1] = { -- First Enemy Team + [1] = {231, 0, 0 }, + [2] = {255, 125, 32 }, + [3] = {255, 232, 22 }, + [4] = {166, 14, 5 }, + }, + [2] = { -- Second Enemy Team + [1] = {10, 232, 32 }, + [2] = {10, 142, 7 }, + [3] = {117, 253, 147 }, + [4] = {5, 84, 13 }, + }, + [3] = { -- Third Enemy Team + [1] = {200, 102, 246 }, + [2] = {134, 10, 232 }, + [3] = {191, 169, 255 }, + [4] = {94, 9, 178 }, + }, + }, + [5] = { -- Five Teams + [1] = { -- First Enemy Team + [1] = {231, 0, 0 }, + [2] = {255, 125, 32 }, + [3] = {166, 14, 5 }, + }, + [2] = { -- Second Enemy Team + [1] = {10, 232, 32 }, + [2] = {10, 142, 7 }, + [3] = {117, 253, 147 }, + }, + [3] = { -- Third Enemy Team + [1] = {200, 102, 246 }, + [2] = {134, 10, 232 }, + [3] = {191, 169, 255 }, + }, + [4] = { -- Fourth Enemy Team + [1] = {255, 232, 22 }, + [2] = {191, 151, 8 }, + [3] = {255, 243, 135 }, + }, + }, + [6] = { -- Six Teams + [1] = { -- First Enemy Team + [1] = {231, 0, 0 }, + [2] = {166, 14, 5 }, + }, + [2] = { -- Second Enemy Team + [1] = {10, 232, 32 }, + [2] = {10, 142, 7 }, + }, + [3] = { -- Third Enemy Team + [1] = {200, 102, 246 }, + [2] = {134, 10, 232 }, + }, + [4] = { -- Fourth Enemy Team + [1] = {255, 232, 22 }, + [2] = {191, 151, 8 }, + }, + [5] = { -- Fifth Enemy Team + [1] = {255, 161, 73 }, + [2] = {222, 93, 0 }, + }, + }, +} + +ScavColor = {97, 36, 97} +GaiaColor = {127, 127, 127} + +local function MissingColorHandler(teamID, allyTeam) + local myTeam = spGetMyTeamID() + local myAllyTeam = spGetMyAllyTeamID() + if teamID == myTeam then + spSetTeamColor(teamID, SimplePlayerColor[1]/255, SimplePlayerColor[2]/255, SimplePlayerColor[3]/255) + elseif allyTeam == myAllyTeam then + spSetTeamColor(teamID, SimpleAllyColor[1]/255, SimpleAllyColor[2]/255, SimpleAllyColor[3]/255) + else + spSetTeamColor(teamID, SimpleEnemyColor[1]/255, SimpleEnemyColor[2]/255, SimpleEnemyColor[3]/255) + end +end + +local function EnemyColorHandler(teamID, allyTeam, allyTeamCount, myTeam, myAllyTeam) + if not EATeams[allyTeam] then + EATeams[allyTeam] = true + if EACountNumber then + EACount[allyTeam] = EACountNumber + 1 + EACountNumber = EACountNumber + 1 + else + EACount[allyTeam] = 1 + EACountNumber = 1 + end + EATeamsCount[allyTeam] = 0 + end + EATeamsCount[allyTeam] = EATeamsCount[allyTeam] + 1 + --Spring.Echo("allyTeamCount "..allyTeamCount) + --Spring.Echo("EACount[allyTeam] "..EACount[allyTeam]) + --Spring.Echo("EATeams[allyTeam] "..EATeams[allyTeam]) + --Spring.Echo("EATeamsCount[allyTeam] "..EATeamsCount[allyTeam]) + if EnemyColors[allyTeamCount] then + if EnemyColors[allyTeamCount][EACount[allyTeam]] then + if EnemyColors[allyTeamCount][EACount[allyTeam]][EATeamsCount[allyTeam]] then + spSetTeamColor( + teamID, + EnemyColors[allyTeamCount][EACount[allyTeam]][EATeamsCount[allyTeam]][1] /255, + EnemyColors[allyTeamCount][EACount[allyTeam]][EATeamsCount[allyTeam]][2] /255, + EnemyColors[allyTeamCount][EACount[allyTeam]][EATeamsCount[allyTeam]][3] /255 + ) + else + MissingColorHandler(teamID, allyTeam) + end + else + MissingColorHandler(teamID, allyTeam) + end + else + MissingColorHandler(teamID, allyTeam) + end + -- planned +end + +local function UpdatePlayerColors() + local teams = spGetTeamList() + local allyteams = spGetAllyTeamList() + local myTeam = spGetMyTeamID() + local myAllyTeam = spGetMyAllyTeamID() + local spectator = spGetSpectatingState() + EATeams = {} + EACount = {} + EATeamsCount = {} + for i = 1,#teams do + local teamID = teams[i] + local _, leader, isDead, isAiTeam, side, allyTeam, incomeMultiplier, customTeamKeys = spGetTeamInfo(teamID) + local luaAI = spGetTeamLuaAI(teamID) + if isAiTeam and (luaAI and (string.find(luaAI, "Scavenger"))) then + if string.find(luaAI, "Scavenger") then + spSetTeamColor(teamID, ScavColor[1]/255, ScavColor[2]/255, ScavColor[3]/255) + end + elseif spGetGaiaTeamID() == teamID then + spSetTeamColor(teamID, GaiaColor[1]/255, GaiaColor[2]/255, GaiaColor[3]/255) + else + if SimpleColorsEnabled == 1 then -- SimpleColors + MissingColorHandler(teamID, allyTeam) + elseif (AnonymousModeEnabled and allyTeam ~= myAllyTeam) and (not spectator) then + spSetTeamColor(teamID, SimpleEnemyColor[1]/255, SimpleEnemyColor[2]/255, SimpleEnemyColor[3]/255) + elseif #teams == #allyteams then -- FFA + ffaCounter = ffaCounter+1 + if AnonymousModeEnabled and teamID == myTeam and (not spectator) then + spSetTeamColor(teamID, SimplePlayerColor[1]/255, SimplePlayerColor[2]/255, SimplePlayerColor[3]/255) + elseif FFAColors[ffaCounter] then + spSetTeamColor(teamID, FFAColors[ffaCounter][1] /255, FFAColors[ffaCounter][2] /255, FFAColors[ffaCounter][3] /255) + else + MissingColorHandler(teamID, allyTeam) + end + else + if spectator or (not AnonymousModeEnabled and (not DynamicTeamColorsEnabled)) then + myTeam = 0 + myAllyTeam = 0 + end + if allyTeam == myAllyTeam then + allyCounter = allyCounter+1 + if AllyColors[#allyteams-1] then + if AllyColors[#allyteams-1][allyCounter] then + spSetTeamColor(teamID, AllyColors[#allyteams-1][allyCounter][1] /255, AllyColors[#allyteams-1][allyCounter][2] /255, AllyColors[#allyteams-1][allyCounter][3] /255) + else + MissingColorHandler(teamID, allyTeam) + end + else + MissingColorHandler(teamID, allyTeam) + end + else + EnemyColorHandler(teamID, allyTeam, #allyteams-1, myTeam, myAllyTeam) + end + end + end + if IconDevModeEnabled == true then + spSetTeamColor(teamID, IconDevModeColor[1] /255, IconDevModeColor[2] /255, IconDevModeColor[3] /255) + end + end + myTeam = nil + myAllyTeam = nil + ffaCounter = 0 + allyCounter = 0 + EATeams = nil + EACount = nil + EATeamsCount = nil + EACountNumber = nil +end + +function gadget:Initialize() + UpdatePlayerColors() +end + +function gadget:PlayerChanged(playerID) + if playerID == myPlayerID then + UpdatePlayerColors() + end +end + +function gadget:Update() + simpleColorsUpdateCounter = simpleColorsUpdateCounter + spGetLastUpdateSeconds() + if simpleColorsUpdateCounter > 1 then + simpleColorsUpdateCounter = 0 + local PreviousSimpleColorsEnabled = SimpleColorsEnabled + SimpleColorsEnabled = spGetConfigInt("simple_auto_colors", 0) + if PreviousSimpleColorsEnabled ~= SimpleColorsEnabled then + UpdatePlayerColors() + end + end + + if math.random(0,60) == 0 then + UpdatePlayerColors() + end +end + + + + diff --git a/LuaRules/Gadgets/game_boxcollector.lua b/LuaRules/Gadgets/game_boxcollector.lua new file mode 100644 index 000000000..07d448266 --- /dev/null +++ b/LuaRules/Gadgets/game_boxcollector.lua @@ -0,0 +1,217 @@ +function gadget:GetInfo() + return { + name = "Box collector", + desc = "removes box features and gives resources to collecting player", + author = "MrSpontaneous (ak Pasha Wrangell) with help from JK; fixed by lurker (Dylan Petonke)", + date = "Nov 11 2007", + license = "GPL", + layer = 1, + enabled = false + } +end + +if (gadgetHandler:IsSyncedCode()) then +---synced---- + + local Box="ammobox" + local chickenEgg="chicken_egg" + local chickenEggB="chicken_eggb" + local chickenEggC="chicken_eggc" + local chickenEggD="chicken_eggd" + local BoxId + local eggId + local eggIdB + local eggIdC + local eggIdD + local BoxesOnMap={} + local eggsOnMap={} + local eggsOnMapB={} + local eggsOnMapC={} + local eggsOnMapD={} + local unitInRange={} + local Resources={} + local SpawnCEG = Spring.SpawnCEG + + function gadget:Initialize() + BoxId = FeatureDefNames[Box].id + eggId = FeatureDefNames["chicken_egg"].id + eggIdB = FeatureDefNames["chicken_eggb"].id + eggIdC = FeatureDefNames["chicken_eggc"].id + eggIdD = FeatureDefNames["chicken_eggd"].id + --Spring.Echo(Box, BoxId) + + ud = Spring.GetAllFeatures () + for n,u in pairs(ud) do + if Spring.GetFeatureDefID(u) == BoxId then + BoxesOnMap[u] = 1 + end + if Spring.GetFeatureDefID(u) == eggId then + eggsOnMap[u] = 1 + end + if Spring.GetFeatureDefID(u) == eggIdB then + eggsOnMapB[u] = 1 + end + if Spring.GetFeatureDefID(u) == eggIdC then + eggsOnMapC[u] = 1 + end + if Spring.GetFeatureDefID(u) == eggIdD then + eggsOnMapD[u] = 1 + end + end + end + + function gadget:GameFrame(f) + --Spring.Echo(eggsOnMap) + if f%30 == 4 then + for box,b in pairs(BoxesOnMap) do + --Spring.Echo("Box") + --Spring.Echo(BoxesOnMap) + local x,y,z = Spring.GetFeaturePosition(box) + local unitsInRange = Spring.GetUnitsInSphere(x,y,z, 500)--at x , y , z with radius 200 + for _,unit in ipairs(unitsInRange) do + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycorecollect and select(5, Spring.GetUnitHealth(unit)) == 1 then + --local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(box) --- [1] is metal, [3] is energy + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", 5) + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", 5) + Spring.DestroyFeature(box) + local fx, fy, fz = Spring.GetFeaturePosition(box) + Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + SpawnCEG("sparklegreenplus5", fx, fy, fz) + BoxesOnMap[box] = nil + break + end + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycoredronespawner and select(5, Spring.GetUnitHealth(unit)) == 1 then + Spring.CreateUnit("edrone", x, y, z, 0, Spring.GetUnitTeam(unit)) + Spring.DestroyFeature(box) + local fx, fy, fz = Spring.GetFeaturePosition(box) + Spring.PlaySoundFile("sounds/miscfx/energycoredronespawner.wav", 1, fx, fy, fz) + SpawnCEG("sparkleorangeplus1drone", fx, fy, fz) + BoxesOnMap[box] = nil + break + end + -- if (UnitDefs[Spring.GetUnitDefID(unit)].customParams.amphibenergycoredronespawner) then + -- Spring.CreateUnit("eamphibdrone", x, y, z, 0, Spring.GetUnitTeam(unit)) + -- Spring.DestroyFeature(box) + -- local fx, fy, fz = Spring.GetFeaturePosition(box) + -- Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + -- SpawnCEG("sparklegreen", fx, fy, fz) + -- BoxesOnMap[box] = nil + -- break + -- end + end + end + for chickenEgg,b in pairs(eggsOnMap) do + --Spring.Echo("Egg") + --Spring.Echo(eggsOnMap) + local eggx,eggy,eggz = Spring.GetFeaturePosition(chickenEgg) + local unitsInRange = Spring.GetUnitsInSphere(eggx,eggy,eggz, 500)--at x , y , z with radius 200 + for _,unit in ipairs(unitsInRange) do + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycorecollect and select(5, Spring.GetUnitHealth(unit)) == 1 then + --local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(chickenEgg) --- [1] is metal, [3] is energy + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", 5) + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", 5) + Spring.DestroyFeature(chickenEgg) + local fx, fy, fz = Spring.GetFeaturePosition(chickenEgg) + Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + SpawnCEG("sparklegreenplus5", fx, fy, fz) + eggsOnMap[chickenEgg] = nil + break + end + end + end + for chickenEggB,b in pairs(eggsOnMapB) do + --Spring.Echo("Egg") + --Spring.Echo(eggsOnMap) + local eggx,eggy,eggz = Spring.GetFeaturePosition(chickenEggB) + local unitsInRange = Spring.GetUnitsInSphere(eggx,eggy,eggz, 500)--at x , y , z with radius 200 + for _,unit in ipairs(unitsInRange) do + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycorecollect and select(5, Spring.GetUnitHealth(unit)) == 1 then + --local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(chickenEggB) --- [1] is metal, [3] is energy + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", 5) + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", 5) + Spring.DestroyFeature(chickenEggB) + local fx, fy, fz = Spring.GetFeaturePosition(chickenEggB) + Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + SpawnCEG("sparklegreenplus5", fx, fy, fz) + eggsOnMapB[chickenEggB] = nil + break + end + end + end + for chickenEggC,b in pairs(eggsOnMapC) do + --Spring.Echo("Egg") + --Spring.Echo(eggsOnMap) + local eggx,eggy,eggz = Spring.GetFeaturePosition(chickenEggC) + local unitsInRange = Spring.GetUnitsInSphere(eggx,eggy,eggz, 500)--at x , y , z with radius 200 + for _,unit in ipairs(unitsInRange) do + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycorecollect and select(5, Spring.GetUnitHealth(unit)) == 1 then + --local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(chickenEggC) --- [1] is metal, [3] is energy + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", 5) + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", 5) + Spring.DestroyFeature(chickenEggC) + local fx, fy, fz = Spring.GetFeaturePosition(chickenEggC) + Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + SpawnCEG("sparklegreenplus5", fx, fy, fz) + eggsOnMapC[chickenEggC] = nil + break + end + end + end + for chickenEggD,b in pairs(eggsOnMapD) do + --Spring.Echo("Egg") + --Spring.Echo(eggsOnMap) + local eggx,eggy,eggz = Spring.GetFeaturePosition(chickenEggD) + local unitsInRange = Spring.GetUnitsInSphere(eggx,eggy,eggz, 500)--at x , y , z with radius 200 + for _,unit in ipairs(unitsInRange) do + if UnitDefs[Spring.GetUnitDefID(unit)].customParams.energycorecollect and select(5, Spring.GetUnitHealth(unit)) == 1 then + --local remM, maxM, remE, maxE, left = Spring.GetFeatureResources(chickenEggD) --- [1] is metal, [3] is energy + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "m", 5) + Spring.AddTeamResource(Spring.GetUnitTeam(unit) , "e", 5) + Spring.DestroyFeature(chickenEggD) + local fx, fy, fz = Spring.GetFeaturePosition(chickenEggD) + Spring.PlaySoundFile("sounds/miscfx/boxcollection.wav", 1, fx, fy, fz) + SpawnCEG("sparklegreenplus5", fx, fy, fz) + eggsOnMapD[chickenEggD] = nil + break + end + end + end + end + end + + function gadget:FeatureDestroyed(featureID, _) + if (BoxesOnMap[featureID]) then + BoxesOnMap[featureID] = nil + end + if (eggsOnMap[featureID]) then + eggsOnMap[featureID] = nil + end + if (eggsOnMapB[featureID]) then + eggsOnMapB[featureID] = nil + end + if (eggsOnMapC[featureID]) then + eggsOnMapC[featureID] = nil + end + if (eggsOnMapD[featureID]) then + eggsOnMapD[featureID] = nil + end + end + + function gadget:FeatureCreated(featureID, allyTeam) + if (Spring.GetFeatureDefID(featureID) == BoxId) then + BoxesOnMap[featureID] = 1 + end + if (Spring.GetFeatureDefID(featureID) == eggId) then + eggsOnMap[featureID] = 1 + end + if (Spring.GetFeatureDefID(featureID) == eggIdB) then + eggsOnMapB[featureID] = 1 + end + if (Spring.GetFeatureDefID(featureID) == eggIdC) then + eggsOnMapC[featureID] = 1 + end + if (Spring.GetFeatureDefID(featureID) == eggIdD) then + eggsOnMapD[featureID] = 1 + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/game_controlVictory.lua b/LuaRules/Gadgets/game_controlVictory.lua new file mode 100644 index 000000000..ac25a436f --- /dev/null +++ b/LuaRules/Gadgets/game_controlVictory.lua @@ -0,0 +1,1566 @@ +function gadget:GetInfo() + return { + name = "Control Victory", + desc = "Enables a victory through capture and hold", + author = "KDR_11k (David Becker), Smoth, Lurker, Forboding Angel, Floris", + date = "2008-03-22 -- Major update July 11th, 2016", + license = "Public Domain", + layer = 1, + enabled = true + } +end + +if Spring.GetModOptions() == nil or Spring.GetModOptions().scoremode == nil or Spring.GetModOptions().scoremode == "disabled" then + return +end + +--[[ +------------------- +Before implementing this gadget, read this!!! +This gadget relies on a few parts: +• control point config file which is located in luarules/configs/controlpoints/ , and it must have a filename of cv_.lua. So, in the case of a map named "Iammas Prime -" with a version of "v01", then the name of my file would be "cv_Iammas Prime - v01.lua". + PLEASE NOTE: If the map config file is not found and a capture mode is selected, the gadget will generate 7 points in a circle on the map automagically. + +• config placed in luarules/configs/ called cv_nonCapturingUnits.lua -- What units are barred form being able to capture control points? +• config placed in luarules/configs/ called cv_buildableUnits.lua -- What units can be built inside control points? + *-----------------* + EXTREMELY IMPORTANT! + In the "Buildable units"'s unitdefs, you need to add a building mask of 0. By default the building mask is 1. The control points use a building mask of 2. + Use the unitdef tag: + buildingMask = 0, + + BEWARE! Spring 103.0 allows for a bit field that works like this... 0 over 1, never 1 over 0. Normal ground is 1. Units are defaulted to 1. + + THE MASK CAN BE DISABLED OR ENABLED BY CHANGING THE VALUE IN cv_modOptions.lua!!! + *-----------------* +• config placed in luarules/configs/ called cv_modOptions.lua -- This controls options for when spring is launched and modoptions cannot be read +• modoptions + +The control point config is structured like this (cv_Iammas Prime - v01.lua): + +//// + +return { + points = { + [1] = {x = 4608, y = 0, z = 3048}, + [2] = {x = 4265, y = 0, z = 1350}, + [3] = {x = 4950, y = 0, z = 4786}, + [4] = {x = 6641, y = 0, z = 858}, + [5] = {x = 2574, y = 0, z = 5271}, + [6] = {x = 2219, y = 0, z = 498}, + [7] = {x = 6993, y = 0, z = 5616}, + }, +} + +//// + +The nonCapturingUnits.lua config file is structured like this: +These are units that are not allowed to capture points. + +//// + +local nonCapturingUnits = { + "eairengineer", + "efighter", + "egunship2", + "etransport", + "edrone", + "ebomber", +} + +return nonCapturingUnits + +//// +!!!!THIS IS NOW DEPRECATED IN LEIU OF BUILDINGMASK!!!! +The code has, however, been kept (commented out) in case other game developers end up having a use for it. + +The buildableUnits.lua config file is structured like this: +These are units that are allowed to be built within control points. + +//// + +local buildableUnits = { + "armamex", + "armmex", + "armmoho", + "armuwmex", + "armuwmme", + "corexp", + "cormex", + "cormexp", + "cormoho", + "coruwmex", + "coruwmme", +} + +return buildableUnits + +//// + +Here are all of the modoptions in a neat copy pastable form... Place these modoptions in modoptions.lua in your base game folder: + +//// +-- Control Victory Options + { + key = 'controlvictoryoptions', + name = 'Control Victory Options', + desc = 'Allows you to control at a granular level the individual options for Control Point Victory', + type = 'section', + }, + { + key="scoremode", + name="Scoring Mode (Control Victory Points)", + desc="Defines how the game is played", + type="list", + def="countdown", + section="controlvictoryoptions", + items={ + {key="disabled", name="Disabled", desc="Disable Control Points as a victory condition."}, + {key="countdown", name="Countdown", desc="A Control Point decreases all opponents' scores, zero means defeat."}, + {key="tugofwar", name="Tug of War", desc="A Control Point steals enemy score, zero means defeat."}, + {key="domination", name="Domination", desc="Holding all Control Points will grant 1000 score, first to reach the score limit wins."}, + } + }, + { + key = 'limitscore', + name = 'Total Score', + desc = 'Total score amount available.', + type = 'number', + section= 'controlvictoryoptions', + def = 2750, + min = 500, + max = 5000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = "numberofcontrolpoints", + name = "Set number of Control Points on the map", + desc = "Sets the number of control points on the map and scales the total score amount to match. Has no effect if Preset map configs are enabled.", + section= "controlvictoryoptions", + type="list", + def="7", + section= "controlvictoryoptions", + items={ + {key="7", name="7", desc=""}, + {key="13", name="13", desc=""}, + {key="19", name="19", desc=""}, + {key="25", name="25", desc=""}, + } + }, + { + key = "usemapconfig", + name = "Use preset map-specific Control Point locations?", + desc = "Should the control point config for this map be used instead of autogenerated control points?", + type="list", + def="disabled", + section= "controlvictoryoptions", + items={ + {key="disabled", name="Disabled", desc="This will tell the game to use autogenerated control points."}, + {key="enabled", name="Enabled", desc="This will tell the game to use preset map control points (Set via map config)."}, + } + }, + { + key = 'captureradius', + name = 'Capture Radius', + desc = 'Radius around a point in which to capture it.', + type = 'number', + section= 'controlvictoryoptions', + def = 500, + min = 250, + max = 1000, + step = 25, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'capturetime', + name = 'Capture Time', + desc = 'Time to capture a point.', + type = 'number', + section= 'controlvictoryoptions', + def = 30, + min = 1, + max = 60, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'capturebonus', + name = 'Capture Bonus', + desc = 'Percentage of how much faster capture takes place by adding more units.', + type = 'number', + section= 'controlvictoryoptions', + def = 5, + min = 1, + max = 100, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'decapspeed', + name = 'De-Cap Speed', + desc = 'Speed multiplier for neutralizing an enemy point.', + type = 'number', + section= 'controlvictoryoptions', + def = 2, + min = 1, + max = 3, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'starttime', + name = 'Start Time', + desc = 'The time when capturing can start.', + type = 'number', + section= 'controlvictoryoptions', + def = 0, + min = 0, + max = 300, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'metalperpoint', + name = 'Metal given to each player per captured point', + desc = 'Each player on an allyteam that has captured a point will receive this amount of resources per point captured per second', + type = 'number', + section= 'controlvictoryoptions', + def = 0, + min = 0, + max = 20, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'energyperpoint', + name = 'Energy given to each player per captured point', + desc = 'Each player on an allyteam that has captured a point will receive this amount of resources per point captured per second', + type = 'number', + section= 'controlvictoryoptions', + def = 0, + min = 0, + max = 20, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'dominationscoretime', + name = 'Domination Score Time', + desc = 'Time needed holding all points to score in multi domination.', + type = 'number', + section= 'controlvictoryoptions', + def = 30, + min = 1, + max = 60, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'tugofwarmodifier', + name = 'Tug of War Modifier', + desc = 'The amount of score transfered between opponents when points are captured is multiplied by this amount.', + type = 'number', + section= 'controlvictoryoptions', + def = 2, + min = 0, + max = 6, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'dominationscore', + name = 'Score awarded for Domination', + desc = 'The amount of score awarded when you have scored a domination.', + type = 'number', + section= 'controlvictoryoptions', + def = 1000, + min = 500, + max = 1000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, +-- End Control Victory Options +//// + + +That's all folks!!! +------------------- +]]-- + +nonCapturingUnits = VFS.Include"LuaRules/Configs/cv_nonCapturingUnits.lua" +--buildableUnits = VFS.Include"LuaRules/Configs/cv_buildableUnits.lua" + +--Make controlvictory exit if chickens are present + +local teams = Spring.GetTeamList() +for i =1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI ~= "" then + if luaAI == "Chicken: Very Easy" or + luaAI == "Chicken: Easy" or + luaAI == "Chicken: Normal" or + luaAI == "Chicken: Hard" or + luaAI == "Chicken: Very Hard" or + luaAI == "Chicken: Epic!" or + luaAI == "Chicken: Custom" or + luaAI == "Chicken: Survival" then + chickensEnabled = true + end + end +end + +if chickensEnabled == true then + Spring.Echo("[ControlVictory] Deactivated because Chickens are present!") + return false +end + +VFS.Include("LuaRules/Configs/cv_modOptions.lua") + +local moveSpeed =.5 +local buildingMask = 2 + +--Here we mitigate potential issues caused by wonky options settings + +if numberOfControlPoints == 13 then + limitScore = limitScore * 2 + captureRadius = captureRadius * 0.83 +end + +if numberOfControlPoints == 19 then + limitScore = limitScore * 3 + captureRadius = captureRadius * 0.66 +end + +if numberOfControlPoints == 25 then + limitScore = limitScore * 4 + captureRadius = captureRadius * 0.5 +end + +--Smaller than 250 gets really hard to see on the minimap +if captureRadius < 250 then + captureRadius = 250 +end + +--End Mitigation of wonky options settings + + +local allyTeamColorSets={} + +local scoreModes = { + disabled = 0, -- none (duh) + countdown = 1, -- A point decreases all opponents' scores, zero means defeat + tugofwar = 2, -- A point steals enemy score, zero means defeat + domination = 3, -- Holding all points will grant 100 score, first to reach the score limit wins +} +local scoreMode = scoreModes[Spring.GetModOptions().scoremode or "countdown"] + +--Lets add a pretty way to access scoremodes +if scoreMode == 0 then scoreModeAsString = "Disabled" end +if scoreMode == 1 then scoreModeAsString = "Countdown" end +if scoreMode == 2 then scoreModeAsString = "Tug of War" end +if scoreMode == 3 then scoreModeAsString = "Domination" end + + +Spring.Echo("[ControlVictory] Control Victory Scoring Mode: " .. cvMode) + +local gaia = Spring.GetGaiaTeamID() +local mapx, mapz = Game.mapSizeX, Game.mapSizeZ + +if (gadgetHandler:IsSyncedCode()) then + + -- SYNCED + + local points = {} + local score = {} + + local dom = { + dominator = nil, + dominationTime = nil, + } + + local function Loser(team) + if team == gaia then + return + end + for _, u in ipairs(Spring.GetAllUnits()) do + if team == Spring.GetUnitAllyTeam(u) then + Spring.DestroyUnit(u) + end + end + end + + local function Winner(team) + for _, a in ipairs(Spring.GetAllyTeamList()) do + if a ~= team and a ~= gaia then + Loser(a) + end + end + end + + -- functions to be registered as globals + + local function gControlPoints() + return points or {} + end + + local function gNonCapturingUnits() + return nonCapturingUnits or {} + end + + local function gBuildableUnits() + return buildableUnits or {} + end + + local function gCaptureRadius() + return captureRadius or 0 + end + + -- end global-registered functions + + function gadget:Initialize() + gadgetHandler:RegisterGlobal('ControlPoints', gControlPoints) + gadgetHandler:RegisterGlobal('NonCapturingUnits', gNonCapturingUnits) + gadgetHandler:RegisterGlobal('BuildableUnits', gBuildableUnits) + gadgetHandler:RegisterGlobal('CaptureRadius', gCaptureRadius) + for _, a in ipairs(Spring.GetAllyTeamList()) do + if scoreMode ~= 3 then + score[a] = limitScore + else + score[a] = 0 + end + end + score[gaia] = 0 +---------------------------------- + + + + if scoreModeAsString == "Domination" then + local angle = math.random() * math.pi * 2 + points = {} + for i=1,3 do + local angle = angle + i * math.pi * 1/1.5 + points[i] = { + x=mapx/2 + mapx * .12 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .12 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + else + if usemapconfig == "enabled" then + local configfile, _ = string.gsub(Game.mapName, ".smf$", ".lua") + configfile = "LuaRules/Configs/ControlPoints/cv_" .. configfile .. ".lua" + Spring.Echo("[ControlVictory] " .. configfile .. " -This is the name of the control victory configfile-") + if VFS.FileExists(configfile) and usemapconfig == "enabled" then + local config = VFS.Include(configfile) + points = config.points + for _, p in pairs(points) do + p.capture = 0 + end + moveSpeed = 0 + end + else + if numberOfControlPoints == 7 then + --Since no config file is found, we create 7 points spaced out in a circle on the map + local angle = math.random() * math.pi * 2 + points = {} + for i=2,7 do + local angle = angle + i * math.pi * 2/6 + points[i] = { + x=mapx/2 + mapx * .4 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .4 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + end + + if numberOfControlPoints == 13 then + local angle = math.random() * math.pi * 2 + points = {} + for i=2,7 do + local angle = angle + i * math.pi * 2/6 + points[i] = { + x=mapx/2 + mapx * .2 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .2 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=8,13 do + local angle = angle + i * math.pi * 2/6 + 9 + points[i] = { + x=mapx/2 + mapx * .4 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .4 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + end + + if numberOfControlPoints == 19 then + local angle = math.random() * math.pi * 2 + points = {} + for i=2,7 do + local angle = angle + i * math.pi * 2/6 + points[i] = { + x=mapx/2 + mapx * .18 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .18 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=8,13 do + local angle = angle + i * math.pi * 2/6 + 9 + points[i] = { + x=mapx/2 + mapx * .3 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .3 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=14,19 do + local angle = angle + i * math.pi * 2/6 + 18 + points[i] = { + x=mapx/2 + mapx * .4 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .4 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + end + + if numberOfControlPoints == 25 then + local angle = math.random() * math.pi * 2 + points = {} + for i=2,7 do + local angle = angle + i * math.pi * 2/6 + points[i] = { + x=mapx/2 + mapx * .16 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .16 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=8,13 do + local angle = angle + i * math.pi * 2/6 + 9 + points[i] = { + x=mapx/2 + mapx * .26 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .26 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=14,19 do + local angle = angle + i * math.pi * 2/6 + 20 + points[i] = { + x=mapx/2 + mapx * .29 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .29 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + + for i=20,25 do + local angle = angle + i * math.pi * 2/6 + 36 + points[i] = { + x=mapx/2 + mapx * .4 * math.sin(angle), + y=0, + z=mapz/2 + mapz * .4 * math.cos(angle), + --We can make them move around if we want to by uncommenting these lines and the ones below + --velx=moveSpeed * 10 * -1 * math.cos(angle), + --velz=moveSpeed * 10 * math.sin(angle), + owner=nil, + aggressor=nil, + capture=0, + } + end + end + end + + points[1] = { + x=mapx/2, + y=0, + z=mapz/2, + owner=nil, + aggressor=nil, + capture=0, + } + end + _G.points = points + _G.score = score + _G.dom = dom + + + -- Set building masks for control points + if useBuildingMask == true then + for _, capturePoint in pairs(points) do + local r = captureRadius + local mask = buildingMask + local r2 = r * r + local step = Game.squareSize * 2 + for z = 0, 2 * r, step do -- top to bottom diameter + local lineLength = math.sqrt(r2 - (r - z) ^ 2) + for x = -lineLength, lineLength, step do + local squareX, squareZ = (capturePoint.x + x)/step, (capturePoint.z + z - r)/step + if squareX > 0 and squareZ > 0 and squareX < Game.mapSizeX/step and squareZ < Game.mapSizeZ/step then + Spring.SetSquareBuildingMask(squareX, squareZ, mask) + --Spring.MarkerAddPoint((cx + x), 0, (cz + z - r)) + end + end + end + end + end + + end + + + + +------------- + function gadget:GameFrame(f) + -- This causes the points to move around, windows screensaver style :-) +--[[ for _,p in pairs(points) do + if p.velx then + p.velx = p.velx / moveSpeed + .03 * (0.5 - math.random()) + p.velz = p.velz / moveSpeed + .03 * (0.5 - math.random()) + local vel = (p.velx^2 + p.velz^2)^0.5 + local velmult = math.max(1 - .1^(math.max(1, math.min(3, math.log(vel / moveSpeed)))), (vel * 1^.01)^.99 / vel) * moveSpeed + p.velx = p.velx * velmult + p.velz = p.velz * velmult + if p.x + p.velx < captureRadius or p.x + p.velx > mapx - captureRadius then p.velx = -1 * p.velx end + if p.z + p.velz < captureRadius or p.z + p.velz > mapz - captureRadius then p.velz = -1 * p.velz end + p.x = p.x + p.velx + p.x = p.x + p.velx + p.z = p.z + p.velz + p.z = p.z + p.velz + end + end ]]-- + + if f % 30 <.1 and f / 30 > startTime then + local owned = {} + for _, allyTeamID in ipairs(Spring.GetAllyTeamList()) do + owned[allyTeamID] = 0 + end + for _, capturePoint in pairs(points) do + local aggressor = nil + local owner = capturePoint.owner + local count = 0 + for _, u in ipairs(Spring.GetUnitsInCylinder(capturePoint.x, capturePoint.z, captureRadius)) do + local validUnit = true + for _, i in ipairs (nonCapturingUnits) do + if UnitDefs[Spring.GetUnitDefID(u)].name == i then + validUnit = false + end + end + if validUnit then + local unitOwner = Spring.GetUnitAllyTeam(u) + if unitOwner ~= gaia then + --Spring.Echo(unitOwner) + if owner then + if owner == unitOwner then + count = 0 + break + else + count = count + 1 + end + else + if aggressor then + if aggressor == unitOwner then + count = count + 1 + else + aggressor = nil + break + end + else + aggressor = unitOwner + count = count + 1 + end + end + end + end + end + if owner then + if count > 0 then + capturePoint.aggressor = nil + capturePoint.capture = capturePoint.capture + (1 + captureBonus * (count - 1)) * decapSpeed + else + capturePoint.capture = capturePoint.capture - decapSpeed + if capturePoint.capture < 0 then + capturePoint.capture = 0 + end + end + elseif aggressor then + --Spring.Echo("capturePoint.aggressor", capturePoint.aggressor) + if capturePoint.aggressor == aggressor then + capturePoint.capture = capturePoint.capture + 1 + captureBonus * (count - 1) + else + capturePoint.aggressor = aggressor + capturePoint.capture = 1 + captureBonus * (count - 1) + end + end + if capturePoint.capture > captureTime then + capturePoint.owner = capturePoint.aggressor + capturePoint.capture = 0 + end + if capturePoint.owner then + --Spring.Echo(capturePoint.owner) + owned[capturePoint.owner] = owned[capturePoint.owner] + 1 + end + end + + -- resources granted to each play on an allyteam that captures a point + for _, allyTeamID in ipairs(Spring.GetAllyTeamList()) do + local ateams = Spring.GetTeamList(allyTeamID) + for i = 1, #ateams do + local metalPerPoint = Spring.GetModOptions().metalperpoint + local energyPerPoint = Spring.GetModOptions().energyperpoint + if Spring.GetModOptions().metalperpoint == nil then + metalPerPoint = 0 + end + if Spring.GetModOptions().energyPerPoint == nil then + energyPerPoint = 0 + end + Spring.AddTeamResource(ateams[i], "metal", owned[allyTeamID] * metalPerPoint) -- adjust the 5 + Spring.AddTeamResource(ateams[i], "energy", owned[allyTeamID] * energyPerPoint) -- adjust the 5 + end + end + + if scoreMode == 1 then -- Countdown + for owner, count in pairs(owned) do + for _, allyTeamID in ipairs(Spring.GetAllyTeamList()) do + if allyTeamID ~= owner and score[allyTeamID] > 0 then + score[allyTeamID] = score[allyTeamID] - count + end + end + end + for allyTeamID, teamScore in pairs(score) do + -- Spring.Echo("Team "..allyTeamID..": "..teamScores) + if teamScore <= 0 then + Loser(allyTeamID) + end + end + elseif scoreMode == 2 then -- Tug of War + for owner, count in pairs(owned) do + for _, a in ipairs(Spring.GetAllyTeamList()) do + if a ~= owner and score[a] > 0 then + score[a] = score[a] - count * tugofWarModifier + score[owner] = score[owner] + count * tugofWarModifier + end + end + end + for allyTeamID, teamScore in pairs(score) do + --Spring.Echo("Team "..allyTeamID..": "..teamScore) + if teamScore <= 0 then + Loser(allyTeamID) + end + end + elseif scoreMode == 3 then -- Domination + local prevDominator = dom.dominator + dom.dominator = nil + for owner, count in pairs(owned) do + if count == #points then + dom.dominator = owner + if prevDominator ~= owner or not dom.dominationTime then + dom.dominationTime = f + 30 * dominationScoreTime + Spring.Echo([[--------------------------------------------]]) + Spring.Echo([[A domination will be scored in 30 seconds!!!]]) + Spring.Echo([[--------------------------------------------]]) + end + break + end + end + if dom.dominator then + if dom.dominationTime <= f then + for _, capturePoint in pairs(points) do + capturePoint.owner = nil + capturePoint.capture = 0 + end + score[dom.dominator] = score[dom.dominator] + Spring.GetModOptions().dominationscore + if score[dom.dominator] >= limitScore then + Winner(dom.dominator) + Spring.Echo([[-------------------------------]]) + Spring.Echo([[A domination has been scored!!!]]) + Spring.Echo([[-------------------------------]]) + end + end + end + end + end + end + +-- Allow units listed in the buildableUnits config to be built in control points +-- This is deprecated in leiu of buildingMask + -- local allowedBuildableUnits = {} + -- for i = 1, #buildableUnits do + -- if UnitDefNames[buildableUnits[i]] then + -- allowedBuildableUnits[UnitDefNames[buildableUnits[i]].id] = true + -- end + -- end + + -- function gadget:AllowUnitCreation(unit, builder, team, x, y, z) + -- if allowedBuildableUnits[unit] then + -- return true + -- end + -- for _, p in pairs(points) do + -- if x and math.sqrt((x - p.x) * (x - p.x) + (z - p.z) * (z - p.z)) < captureRadius then + -- Spring.SendMessageToPlayer(team, "This unit is not allowed to be built in Control Points") + -- return false + -- end + -- end + -- return true + -- end + +else -- UNSYNCED + + local pieces = math.floor(captureRadius / 20) + local OPTIONS = { + circlePieces = pieces, + circlePieceDetail = math.floor(pieces/4), + circleSpaceUsage = 0.85, + circleInnerOffset = 0, + rotationSpeed = 0.3, + } + pieces = nil + + local exampleImage = ":n:LuaRules/Images/controlpoints.png" + local showGameModeInfo = true + + local scoreboardRelX = 0.75 + local scoreboardRelY = 0.7 + local scoreboardWidth = 100 + local scoreboardHeight = 100 + + local bgMargin = 6 + local closeButtonSize = 30 + local vsx, vsy = Spring.GetViewGeometry() + local uiScale = 1 + + local closeButtonSize = 30 + local screenHeight = 212-bgMargin-bgMargin + local screenWidth = 1050-bgMargin-bgMargin + local screenX = (vsx*0.5) - (screenWidth/2) + local screenY = (vsy*0.5) + (screenHeight/2) + local loadedFontSize = 32 + local font = gl.LoadFont("luaui/Fonts/JosefinSans-SemiBold.ttf", loadedFontSize, 16,2) + + local Text = gl.Text + local Color = gl.Color + local DrawGroundCircle = gl.DrawGroundCircle + local glLineWidth = gl.LineWidth + local PushMatrix = gl.PushMatrix + local PopMatrix = gl.PopMatrix + local Translate = gl.Translate + local BeginEnd = gl.BeginEnd + local CreateList = gl.CreateList + local CallList = gl.CallList + local Scale = gl.Scale + local Rotate = gl.Rotate + local Rect = gl.Rect + local Vertex = gl.Vertex + local Billboard = gl.Billboard + local QUADS = GL.QUADS + local TRIANGLE_FAN = GL.TRIANGLE_FAN + local PolygonOffset = gl.PolygonOffset + local playerListEntry = {} + local capturePoints = {} + local controlPointSolidList = {} + + local prevTimer = Spring.GetTimer() + local currentRotationAngle = 0 + + local ringThickness = 3.5 + local capturePieParts = 4 + math.floor(captureRadius / 8) + + local scoreMode = Spring.GetModOptions().scoremode or "countdown" + + ----------------------------------------------------------------------------------------- + -- creates initial player listing + ----------------------------------------------------------------------------------------- + local function CreatePlayerList() + local playerEntries = {} + for allyTeamID, teamScore in spairs(SYNCED.score) do + -- note to self, allyTeamID +1 = ally team number + if allyTeamID ~= gaia then + --does this allyteam have a table? if not, make one + if playerEntries[allyTeamID] == nil then + playerEntries[allyTeamID] = {} + -- Spring.Echo("creating allyTeamID table") + end + + for _,teamId in pairs(Spring.GetTeamList(allyTeamID))do + local playerList = Spring.GetPlayerList(teamId, true) + -- does this team have an entry? if not, make one! + if playerEntries[allyTeamID][teamId] == nil then + playerEntries[allyTeamID][teamId] = {} + -- Spring.Echo("creating team table") + end + local r, g, b = Spring.GetTeamColor(teamId) + local playerTeamColor = string.char("255",r*255,g*255,b*255) + for k,v in pairs(playerList)do + -- does this player have an entry? if not, make one! + if playerEntries[allyTeamID][teamId][v] == nil then + playerEntries[allyTeamID][teamId][v] = {} + -- Spring.Echo("creating player table") + end + + -- if Spring.Echo(playerEntries[allyTeamID][teamId][v]) then + -- Spring.Echo("waffles") + --end + playerEntries[allyTeamID][teamId][v]["name"] = Spring.GetPlayerInfo(v) + playerEntries[allyTeamID][teamId][v]["color"] = playerTeamColor + end -- end playerId + end -- end teamId + end -- allyTeamID + end -- gaia exclusion + return playerEntries + end + + local function DrawCircleLine(innersize, outersize) + BeginEnd(QUADS, function() + local detailPartWidth, a1,a2,a3,a4 + local width = OPTIONS.circleSpaceUsage + local detail = OPTIONS.circlePieceDetail + + local radstep = (2.0 * math.pi) / OPTIONS.circlePieces + for i = 1, OPTIONS.circlePieces do + for d = 1, detail do + + detailPartWidth = ((width / detail) * d) + a1 = ((i+detailPartWidth - (width / detail)) * radstep) + a2 = ((i+detailPartWidth) * radstep) + a3 = ((i+OPTIONS.circleInnerOffset+detailPartWidth - (width / detail)) * radstep) + a4 = ((i+OPTIONS.circleInnerOffset+detailPartWidth) * radstep) + + --outer (fadein) + Vertex(math.sin(a4)*innersize, 0, math.cos(a4)*innersize) + Vertex(math.sin(a3)*innersize, 0, math.cos(a3)*innersize) + --outer (fadeout) + Vertex(math.sin(a1)*outersize, 0, math.cos(a1)*outersize) + Vertex(math.sin(a2)*outersize, 0, math.cos(a2)*outersize) + end + end + end) + end + + function DrawCircleSolid(size, pieces, drawPieces, innercolor, outercolor, revert) + BeginEnd(TRIANGLE_FAN, function() + local radstep = (2.0 * math.pi) / pieces + local a1 + if (innercolor) then + Color(innercolor) + end + Vertex(0, 0, 0) + if (outercolor) then + Color(outercolor) + end + for i = 0, drawPieces do + if revert then + a1 = -(i * radstep) + else + a1 = (i * radstep) + end + Vertex(math.sin(a1)*size, 0, math.cos(a1)*size) + end + end) + end + + + local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + o = offset + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) + end + function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(":n:LuaRules/Images/bgcorner.png") + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) + end + + function viewResize(force) + vsx2,vsy2 = Spring.GetViewGeometry() + if force or vsx2 ~= vsy or vsx2 ~= vsy then + vsx,vsy = vsx2,vsy2 + uiScale = (0.75 + (vsx*vsy / 7500000)) + + screenX = (vsx*0.5) - (screenWidth/2) + screenY = (vsy*0.5) + (screenHeight/2) + + scoreboardX = (vsx * scoreboardRelX) - (((vsx/2) * (scoreboardRelX-0.5)) * (uiScale-1)) -- not acurate :( + scoreboardY = (vsy * scoreboardRelY) - (((vsy/2) * (scoreboardRelY-0.5)) * (uiScale-1)) -- not acurate :( + + if infoList then gl.DeleteList(infoList) end + infoList = CreateList(drawGameModeInfo) + end + end + + function gadget:Initialize() + playerListEntry = CreatePlayerList(playerEntries) + + viewResize(true) + + controlPointList = CreateList(DrawCircleLine, captureRadius-ringThickness, captureRadius) + if Spring.GetGameFrame() > 0 then + showGameModeInfo = false + end + + for i, capturePoint in spairs(SYNCED.points) do + if capturePoints[i] == nil then + capturePoints[i] = {} + capturePoints[i].color = {1,1,1} + capturePoints[i].aggressorColor = {1,1,1} + capturePoints[i].x = capturePoint.x + capturePoints[i].y = Spring.GetGroundHeight(capturePoint.x, capturePoint.z) + 2 + capturePoints[i].z = capturePoint.z + end + if capturePoint.owner and capturePoint.owner ~= gaia then + capturePoints[i].color[1],capturePoints[i].color[2],capturePoints[i].color[3] = Spring.GetTeamColor(Spring.GetTeamList(capturePoint.owner)[1]) + else + capturePoints[i].color = {1,1,1} + end + if capturePoint.aggressor and capturePoint.aggressor ~= gaia then + capturePoints[i].aggressorColor[1],capturePoints[i].aggressorColor[2],capturePoints[i].aggressorColor[3] = Spring.GetTeamColor(Spring.GetTeamList(capturePoint.aggressor)[1]) + else + capturePoints[i].aggressorColor = {1,1,1} + end + capturePoints[i].capture = capturePoint.capture + end + + end + + function gadget:DrawInMiniMap() + PushMatrix() + gl.LoadIdentity() + Translate(0, 1, 0) + Scale(1 / Game.mapSizeX, 1 / Game.mapSizeZ, 0) + Rotate(90, 1, 0, 0) + DrawPoints(true) + PopMatrix() + end + + function gadget:Update() + clockDifference = Spring.DiffTimers(Spring.GetTimer(), prevTimer) + prevTimer = Spring.GetTimer() + + -- animate rotation + if OPTIONS.rotationSpeed > 0 then + local angleDifference = (OPTIONS.rotationSpeed) * (clockDifference * 5) + currentRotationAngle = currentRotationAngle + (angleDifference*0.6) + if currentRotationAngle > 360 then + currentRotationAngle = currentRotationAngle - 360 + end + end + end + + function gadget:GameFrame() + + for i, capturePoint in spairs(SYNCED.points) do + if capturePoints[i] == nil then + capturePoints[i] = {} + capturePoints[i].color = {1,1,1} + capturePoints[i].aggressorColor = {1,1,1} + capturePoints[i].x = capturePoint.x + capturePoints[i].y = Spring.GetGroundHeight(capturePoint.x, capturePoint.z) + 2 + capturePoints[i].z = capturePoint.z + end + if capturePoint.owner and capturePoint.owner ~= gaia then + capturePoints[i].color[1],capturePoints[i].color[2],capturePoints[i].color[3] = Spring.GetTeamColor(Spring.GetTeamList(capturePoint.owner)[1]) + else + capturePoints[i].color = {1,1,1} + end + if capturePoint.aggressor and capturePoint.aggressor ~= gaia then + capturePoints[i].aggressorColor[1],capturePoints[i].aggressorColor[2],capturePoints[i].aggressorColor[3] = Spring.GetTeamColor(Spring.GetTeamList(capturePoint.aggressor)[1]) + else + capturePoints[i].aggressorColor = {1,1,1} + end + capturePoints[i].capture = capturePoint.capture + end + end + + function DrawPoints(simplified) + local capturedAlpha, capturingAlpha, prefix, parts + if simplified then -- for minimap + capturedAlpha = 0.7 + capturingAlpha = 0.85 + prefix = 'm_' -- so it uses different displaylists + parts = math.ceil((OPTIONS.circlePieces * OPTIONS.circlePieceDetail) / 5) + else + capturedAlpha = 0.7 + capturingAlpha = 0.85 + prefix = '' + parts = (OPTIONS.circlePieces * OPTIONS.circlePieceDetail) + end + for i,point in pairs(capturePoints) do + PushMatrix() + Translate(point.x, point.y, point.z) + -- owner circle backgroundcolor + if controlPointSolidList[prefix..point.color[1]..'_'..point.color[2]..'_'..point.color[3]] == nil then + controlPointSolidList[prefix..point.color[1]..'_'..point.color[2]..'_'..point.color[3]] = CreateList(DrawCircleSolid, captureRadius+ringThickness, parts, parts, {0,0,0,0}, {point.color[1], point.color[2], point.color[3], capturedAlpha}) + end + CallList(controlPointSolidList[prefix..point.color[1]..'_'..point.color[2]..'_'..point.color[3]]) + + -- captured percentage + if point.capture > 0 then + local revert = false + if point.aggressorColor[1]..'_'..point.aggressorColor[2]..'_'..point.aggressorColor[3] == '1_1_1' then + revert = true + end + local piesize = math.floor(((point.capture/captureTime) / (1/capturePieParts))+0.5) + if controlPointSolidList[prefix..point.aggressorColor[1]..'_'..point.aggressorColor[2]..'_'..point.aggressorColor[3]..'_'..piesize] == nil then + controlPointSolidList[prefix..point.aggressorColor[1]..'_'..point.aggressorColor[2]..'_'..point.aggressorColor[3]..'_'..piesize] = CreateList(DrawCircleSolid, (captureRadius-ringThickness*2), capturePieParts, piesize, {0,0,0,0}, {point.aggressorColor[1], point.aggressorColor[2], point.aggressorColor[3], capturingAlpha}, revert) + end + CallList(controlPointSolidList[prefix..point.aggressorColor[1]..'_'..point.aggressorColor[2]..'_'..point.aggressorColor[3]..'_'..piesize]) + end + if not simplified then -- not for minimap + --ring + Rotate(currentRotationAngle,0,1,0) + Color(1,1,1, 0.6) + CallList(controlPointList) + end + PopMatrix() + end + end + + function gadget:DrawWorldPreUnit() + PolygonOffset(-10000, -1) -- draw on top of water/map - sideeffect: will shine through terrain/mountains + DrawPoints(false) -- Todo: use DrawWorldPreUnit make it so that it colorizes the map/ground + PolygonOffset(false) + end + + + function gadget:GameStart() + --showGameModeInfo = false + end + + + function drawGameModeInfo() + + local white = "\255\255\255\255" + local offwhite = "\255\210\210\210" + local yellow = "\255\255\255\0" + local orange = "\255\255\135\0" + local green = "\255\0\255\0" + local red = "\255\255\0\0" + local skyblue = "\255\136\197\226" + + PushMatrix() + Translate(-(vsx * (uiScale-1))/2, -(vsy * (uiScale-1))/2, 0) + Scale(uiScale,uiScale,1) + local x = screenX --rightwards + local y = screenY --upwards + + -- background + Color(0,0,0,0.8) + RectRound(x-bgMargin,y-screenHeight-bgMargin,x+screenWidth+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + Color(0.33,0.33,0.33,0.15) + RectRound(x,y-screenHeight,x+screenWidth,y,6) + + -- close button + local size = closeButtonSize*0.7 + local width = size*0.055 + Color(1,1,1,1) + PushMatrix() + Translate(screenX+screenWidth-(closeButtonSize/2),screenY-(closeButtonSize/2),0) + gl.Rotate(-45,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(90,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + PopMatrix() + + -- title + local title = offwhite .. [[Area Capture Mode ]] .. yellow .. scoreModeAsString + local titleFontSize = 18 + Color(0,0,0,0.8) + titleRect = {x-bgMargin, y+bgMargin, x+(gl.GetTextWidth(title)*titleFontSize)+27-bgMargin, y+37} + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + + font:Begin() + font:SetTextColor(1,1,1,1) + font:SetOutlineColor(0,0,0,0.4) + font:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font:End() + + -- image of minimap showing controlpoints + local imageSize = 200 + Color(1,1,1,1) + gl.Texture(exampleImage) + gl.TexRect(x,y,x+imageSize,y-imageSize) + gl.Texture(false) + + -- textarea + + local infotext = offwhite .. [[Controlpoints are spread across the map. They can be captured by moving units into the circles. +Note that you can only build certain units inside them (e.g. Metal Extractors/Resource Node Generators). + +There are 3 modes (Current mode is ]] .. yellow .. scoreModeAsString .. offwhite .. [[): +- Countdown: Your score counts down until zero based upon how many points your enemy owns. +- Tug of War: Score is transferred between teams. Score transferred is multiplied by ]] .. yellow .. tugofWarModifier .. offwhite .. [[. +- Domination: Capture all controlpoints on the map for ]] .. yellow .. dominationScoreTime .. offwhite .. [[ seconds in order to gain ]] .. yellow .. dominationScore .. offwhite .. [[ score. Goal ]] .. yellow .. limitScore .. offwhite .. [[. + +You will also gain ]] .. white .. [[+]] .. skyblue .. metalPerPoint .. offwhite .. [[ metal and ]] .. white .. [[+]] .. yellow .. energyPerPoint .. offwhite ..[[ energy for each controlpoint you own. + +There are various options available in the lobby bsettings (use ]] .. yellow .. [[!list bsettings]] .. offwhite .. [[ in the lobby chat)]] + + Text(infotext, x+imageSize+15, y-25, 16, "no") + + PopMatrix() + end + + function drawMouseoverScoreboard() + PushMatrix() + Translate(-(vsx * (uiScale-1))/2, -(vsy * (uiScale-1))/2, 0) + Scale(uiScale,uiScale,1) + local x = scoreboardX --rightwards + local y = scoreboardY --upwards + local width = scoreboardWidth + local height = scoreboardHeight + local maxWidth = width + local maxHeight = height + + -- background + Color(0,0,0,0.8) + RectRound(x-bgMargin,y-height-bgMargin,x+width+bgMargin,y+bgMargin,8, 0,1,1,1) + + -- text + Text("\255\200\200\200Use middlemouse\nto drag this window", x+scoreboardWidth/2, y-(scoreboardHeight/2)+7, 14, "co") + + PopMatrix() + end + + + function drawScoreboard() + PushMatrix() + Translate(-(vsx * (uiScale-1))/2, -(vsy * (uiScale-1))/2, 0) + Scale(uiScale,uiScale,1) + local x = scoreboardX --rightwards + local y = scoreboardY --upwards + local width = scoreboardWidth + local height = scoreboardHeight + local maxWidth = width + local maxHeight = height + + -- background + Color(0,0,0,0.8) + RectRound(x-bgMargin,y-height-bgMargin,x+width+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + Color(0.33,0.33,0.33,0.15) + RectRound(x,y-height,x+width,y,6) + + -- title + local title = "\255\255\255\255"..scoreModeAsString + local titleFontSize = 18 + Color(0,0,0,0.8) + titleRect = {x-bgMargin, y+bgMargin, x+(gl.GetTextWidth(title)*titleFontSize)+27-bgMargin, y+37} + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + + font:Begin() + font:SetTextColor(1,1,1,1) + font:SetOutlineColor(0,0,0,0.4) + font:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font:End() + + local n = 1 + local dominator = SYNCED.dom.dominatorwa + local dominationTime = SYNCED.dom.dominationTime + local white = string.char("255","255","255","255") + local allyCounter = 0 + + -- for all the scores with a team. + for allyTeamID, allyScore in spairs(SYNCED.score) do + --Spring.Echo("at allied team ID", allyTeamID) + -- note to self, allyTeamID +1 = ally team number + local allyTeamMembers = Spring.GetTeamList(allyTeamID) + if allyTeamID ~= gaia and allyTeamMembers and (#allyTeamMembers > 0) then + local allyFound = false + local name = "Some Bot" + local team = allyTeamMembers[1] + + for _,teamId in pairs(Spring.GetTeamList(allyTeamID))do + --Spring.Echo("\tat team ID", teamId) + + local playerList = Spring.GetPlayerList(teamId) + --Spring.Echo("\t\t\tplayerList", #playerList) + for _,playerId in pairs(playerList)do + local _, _, spectator = Spring.GetPlayerInfo(playerId) + --Spring.Echo("\t\t\t\tplayer") + --Spring.Echo("allied team ID", allyTeamID, "\t", "team ID", teamId, Spring.GetPlayerInfo(playerId)) + --Spring.Echo(Spring.GetPlayerInfo(_, _, spectator)) + if not spectator and not allyFound then + name = Spring.GetPlayerInfo(playerId) + team = teamId + allyFound = true + end + end -- end playerId + end -- end teamId + + if allyFound == false then + if Spring.GetTeamLuaAI(team) == "" then + name = "Evil Machine" + else + name = Spring.GetTeamLuaAI(team) + end + --get AI info? + end + local r, g, b = Spring.GetTeamColor(team) + color = string.char("255",r*255,g*255,b*255) + Text(color .. name .. "'s team", x+10, y - 22 - (55 * allyCounter-1), 16, "lo") + Text(white .. "\255\200\200\200Score: \255\255\255\255" .. allyScore, x+10, y - 42 -(55 * allyCounter-1), 16, "lo") + + local textwidth = 20 + gl.GetTextWidth(name .. "'s team")*16 + if textwidth > maxWidth then + maxWidth = textwidth + end + maxHeight = 42 +(55 * allyCounter-1) + 13 + allyCounter = allyCounter + 1 + end -- not gaia + end -- end allyTeamID + + if dominator and dominationTime > Spring.GetGameFrame() then + -- Text( playerListEntry[dominator]["color"] .. "<" .. playerListEntry[dominator] .. "> will score a --Domination in " .. + -- math.floor((dominationTime - Spring.GetGameFrame()) / 30) .. + -- " seconds!", vsx *.5, vsy *.7, 24, "oc") + end + scoreboardWidth = maxWidth + scoreboardHeight = maxHeight + PopMatrix() + end + + function gadget:DrawScreen(vsx, vsy) + + viewResize() + + if showGameModeInfo then + if infoList == nil then infoList = CreateList(drawGameModeInfo) end + CallList(infoList) + end + + local frame = Spring.GetGameFrame() + if frame / 30 > startTime then + if controlPointPromptPlayed ~= true then + Spring.PlaySoundFile("sounds/ui/controlpointscanbecaptured.wav", 1) + Spring.Echo([[Control Points may now be captured!]]) + controlPointPromptPlayed = true + end + if scoreboardList == nil or frame%15==0 then + if scoreboardList ~= nil then + gl.DeleteList(scoreboardList) + end + scoreboardList = CreateList(drawScoreboard) + end + CallList(scoreboardList) + + local mx,my = Spring.GetMouseState() + local rectX1 = ((scoreboardX-bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY1 = ((scoreboardY+bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + local rectX2 = ((scoreboardX+scoreboardWidth+bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY2 = ((scoreboardY-scoreboardHeight-bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + if IsOnRect(mx, my, rectX1, rectY2, rectX2, rectY1) then + if mouseoverScoreboard == nil then + mouseoverScoreboard = true + if mouseoverScoreboardList ~= nil then + gl.DeleteList(mouseoverScoreboardList) + end + mouseoverScoreboardList = CreateList(drawMouseoverScoreboard) + end + else + mouseoverScoreboard = nil + end + if mouseoverScoreboard then + CallList(mouseoverScoreboardList) + end + else + Text("Capturing points begins in:", vsx - 280, vsy *.58, 18, "lo") + local timeleft = startTime - frame / 30 + timeleft = timeleft - timeleft % 1 + Text(timeleft .. " seconds", vsx - 280, vsy *.58 - 25, 18, "lo") + end + end + + + function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY + end + + + function gadget:MouseMove(x, y, dx, dy) + if draggingScoreboard then + scoreboardRelX = scoreboardRelX + (dx/vsx) + scoreboardRelY = scoreboardRelY + (dy/vsy) + if scoreboardList ~= nil then + gl.DeleteList(scoreboardList) + end + scoreboardList = CreateList(drawScoreboard) + + if mouseoverScoreboardList ~= nil then + gl.DeleteList(mouseoverScoreboardList) + end + mouseoverScoreboardList = CreateList(drawMouseoverScoreboard) + end + end + + function gadget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) + end + + function gadget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) + end + + function mouseEvent(x, y, button, release) + + if Spring.IsGUIHidden() then return false end + if release and draggingScoreboard ~= nil then + draggingScoreboard = nil + end + if not release and Spring.GetGameFrame() > 0 then + local rectX1 = ((scoreboardX-bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY1 = ((scoreboardY+bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + local rectX2 = ((scoreboardX+scoreboardWidth+bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY2 = ((scoreboardY-scoreboardHeight-bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + if button == 2 and IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + draggingScoreboard = true + return true + end + end + + if showGameModeInfo then + -- on window + local rectX1 = ((screenX-bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY1 = ((screenY+bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * uiScale) - ((vsx * (uiScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * uiScale) - ((vsy * (uiScale-1))/2) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + -- on close button + local brectX1 = rectX2 - ((closeButtonSize+bgMargin+bgMargin) * uiScale) + local brectY2 = rectY1 - ((closeButtonSize+bgMargin+bgMargin) * uiScale) + if IsOnRect(x, y, brectX1, brectY2, rectX2, rectY1) then + if release then + showGameModeInfo = false + end + return true + end + end + end + end + +end diff --git a/LuaRules/Gadgets/game_death_messages.lua b/LuaRules/Gadgets/game_death_messages.lua new file mode 100644 index 000000000..149a40e0e --- /dev/null +++ b/LuaRules/Gadgets/game_death_messages.lua @@ -0,0 +1,143 @@ +function gadget:GetInfo() + return { + name = "Death Messages", + desc = "Makes callins for death messages", + author = "Bluestone", + date = "Sept 2013", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +--This gadget makes callins for death messages accessible via Script.LuaRules +--The callins are called from within game_end + +--Each team can be part of precisely one death messages +--This death message can be either just for itself (if it resigns/etc) or as part of its allyteam message (if it is alive when its allyteam dies) +--Whichever call comes first will be the death message for that team + +-- synced only +if (not gadgetHandler:IsSyncedCode()) then + return false +end + +local slen = string.len +local ssub = string.sub +local sgsub = string.gsub + +local playerListByTeam = {} --loaded up at game start, doesn't include specs, doesn't change over time +local toMsg = {} +local msg + +--include the teamDeathMessages and allyTeamDeathMessages tables +--format is table[i]="deathmsg" +include("luarules/configs/death_messages.lua") +local numTeamDeathMsgs = #teamDeathMessages +local numAllyTeamDeathMsgs = #allyTeamDeathMessages +local msgColour = "\255\255\255\255" + +--construct death message for team +function TeamDeathMessage(teamID) + --choose msg + local n = math.random(numTeamDeathMsgs) + local msg = teamDeathMessages[n] + if msg == nil then + return "Team " .. teamID .. " got an error (no msg) instead of a death message!" + end + + local plList = playerListByTeam[teamID] + if plList == nil then + return --this team has already received a death message + end + + --fill in XX + local plNames = "" + for _,name in pairs(plList) do + plNames = plNames .. name .. ", " + end + if slen(plNames)-2 < 1 then + return "Team " .. teamID .. " got an error (no names) instead of a death message!" + end + plNames = ssub(plNames, 1, slen(plNames)-2) --remove final ", " + if plNames ~= "" then + plNames = " (" .. plNames .. ")" + end + local toCut = "XX" + local toPaste = "Team " .. teamID .. plNames + local msg,_ = sgsub(msg, toCut, toPaste) + + --send msg + msg = msgColour .. msg + Spring.SendMessage(msg) + + --remove names from playerListByTeam + playerListByTeam[teamID] = nil +end + +function AllyTeamDeathMessage(allyTeamID) + --choose msg + local n = math.random(numAllyTeamDeathMsgs) + local msg = allyTeamDeathMessages[n] + if msg == nil then + return "Allyteam " .. allyTeamID .. " got an error (no msg) instead of a death message!" + end + + --fill in XX + local teamList = Spring.GetTeamList(allyTeamID) + local plNames = "" + for _,teamID in pairs(teamList) do + local plList = playerListByTeam[teamID] + if plList ~= nil then --this team already received a death msg (and is dead), don't include it in the allyteam msg + for _,name in pairs(plList) do + plNames = plNames .. name .. ", " + end + playerListByTeam[teamID] = nil --don't let this team get any more death messages + end + end + if slen(plNames)-2 < 1 then + return "Allyteam " .. allyTeamID .. " got an error (no names) instead of a death message!" + end + plNames = ssub(plNames, 1, slen(plNames)-2) --remove final ", " + if plNames ~= "" then + plNames = " (" .. plNames .. ")" + end + local toCut = "XX" + local toPaste = "Allyteam " .. allyTeamID .. plNames + local msg,_ = sgsub(msg, toCut, toPaste) + + --send msg + msg = msgColour .. msg + Spring.SendMessage(msg) +end + +function gadget:Initialize() + --load a list of players for each team into playerListByTeam + local teamList = Spring.GetTeamList() + for _,teamID in pairs(teamList) do + local playerList = Spring.GetPlayerList(teamID) + local list = {} --without specs + for _,playerID in pairs(playerList) do + local name, _, isSpec = Spring.GetPlayerInfo(playerID) + if not isSpec then + table.insert(list, name) + end + end + playerListByTeam[teamID] = list + end + + --register functions so as they can be called from game_end (call as e.g. Script.LuaRules.TeamDeathMessage(teamID)) + gadgetHandler:RegisterGlobal('TeamDeathMessage', TeamDeathMessage) + gadgetHandler:RegisterGlobal('AllyTeamDeathMessage', AllyTeamDeathMessage) +end + +function gadget:Shutdown() + gadgetHandler:DeregisterGlobal('TeamDeathMessage') + gadgetHandler:DeregisterGlobal('AllyTeamDeathMessage') +end + + + + + + diff --git a/LuaRules/Gadgets/game_end.lua b/LuaRules/Gadgets/game_end.lua index 439d69c64..0f65d23ea 100644 --- a/LuaRules/Gadgets/game_end.lua +++ b/LuaRules/Gadgets/game_end.lua @@ -2,10 +2,10 @@ -------------------------------------------------------------------------------- -- -- file: game_end.lua --- brief: spawns start unit and sets storage levels +-- brief: handles trigger conditions for game over -- author: Andrea Piras -- --- Copyright (C) 2010,2011. +-- Copyright (C) 2010-2013. -- Licensed under the terms of the GNU GPL, v2 or later. -- -------------------------------------------------------------------------------- @@ -16,7 +16,7 @@ function gadget:GetInfo() name = "Game End", desc = "Handles team/allyteam deaths and declares gameover", author = "Andrea Piras", - date = "August, 2010", + date = "June, 2013", license = "GNU GPL, v2 or later", layer = 0, enabled = true -- loaded by default? @@ -31,106 +31,208 @@ if (not gadgetHandler:IsSyncedCode()) then return false end -local modOptions = Spring.GetModOptions() - --- teamDeathMode possible values: "none", "teamzerounits" , "allyzerounits" -local teamDeathMode = modOptions.teamdeathmode or "teamzerounits" +-- In this gadget, an allyteam is declared dead when it no longer has any units +-- Allyteam explosion when no coms are left (killing all remaining units of that allyteam) is implemented in teamcomends.lua -- sharedDynamicAllianceVictory is a C-like bool -local sharedDynamicAllianceVictory = tonumber(modOptions.shareddynamicalliancevictory) or 0 +local sharedDynamicAllianceVictory = tonumber(Spring.GetModOptions().shareddynamicalliancevictory) or 1 -- ignoreGaia is a C-like bool -local ignoreGaia = tonumber(modOptions.ignoregaiawinner) or 1 +local ignoreGaia = 1 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local gaiaTeamID = Spring.GetGaiaTeamID() -local spKillTeam = Spring.KillTeam -local spGetAllyTeamList = Spring.GetAllyTeamList -local spGetTeamList = Spring.GetTeamList -local spGetTeamInfo = Spring.GetTeamInfo -local spGameOver = Spring.GameOver -local spAreTeamsAllied = Spring.AreTeamsAllied +local KillTeam = Spring.KillTeam +local GetAllyTeamList = Spring.GetAllyTeamList +local GetTeamList = Spring.GetTeamList +local GetPlayerInfo = Spring.GetPlayerInfo +local GetPlayerList = Spring.GetPlayerList +local GetTeamInfo = Spring.GetTeamInfo +local GetTeamUnitCount = Spring.GetTeamUnitCount +local GetAIInfo = Spring.GetAIInfo +local GetTeamLuaAI = Spring.GetTeamLuaAI +local GameOver = Spring.GameOver +local AreTeamsAllied = Spring.AreTeamsAllied -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -local gaiaAllyTeamID -local allyTeams = spGetAllyTeamList() -local teamsUnitCount = {} -local allyTeamUnitCount = {} -local allyTeamAliveTeamsCount = {} +--allyTeamInfos structure: +-- allyTeamInfos = { +-- [allyTeamID] = { +-- teams = { +-- [teamID]= { +-- unitCount, +-- isGaia, +-- dead, +-- isAI, +-- isControlled, +-- players = { +-- [playerID] = isControlling +-- }, +-- }, +-- }, +-- unitCount, +-- isGaia, +-- dead, +-- }, +--} +local allyTeamInfos = {} local teamToAllyTeam = {} -local aliveAllyTeamCount = 0 -local killedAllyTeams = {} - +local playerIDtoAIs = {} +local playerQuitIsDead = true -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GameOver() -- remove ourself after successful game over - gadgetHandler:RemoveGadget() + gadgetHandler:RemoveGadget(self) +end + +function gadget:Initialize() + if tostring(Spring.GetModOptions().deathmode) == "neverend" then + gadgetHandler:RemoveGadget(self) + return + end + + local gaiaTeamID = Spring.GetGaiaTeamID() + local teamCount = 0 + for _,teamID in ipairs(GetTeamList()) do + if ignoreGaia ~= 1 or teamID ~= gaiaTeamID then + teamCount = teamCount + 1 + end + end + + if teamCount < 2 then -- sandbox mode ( possibly gaia + possibly one player) + gadgetHandler:RemoveGadget(self) + return + elseif teamCount == 2 then + playerQuitIsDead = false -- let player quit & rejoin in 1v1 + end + + -- at start, fill in the table of all alive allyteams + for _,allyTeamID in ipairs(GetAllyTeamList()) do + local allyTeamInfo = {} + allyTeamInfo.unitCount = 0 + allyTeamInfo.teams = {} + for _,teamID in ipairs(GetTeamList(allyTeamID)) do + teamToAllyTeam[teamID] = allyTeamID + local teamInfo = {} + teamInfo.players = {} + --is it engine ai? + teamInfo.isAI = select(4,GetTeamInfo(teamID)) + teamInfo.hasLeader = select(2,GetTeamInfo(teamID)) >= 0 + if teamInfo.isAI then + --store who hosts that engine ai + local AIHostPlayerID = select(3,GetAIInfo(teamID)) + playerIDtoAIs[AIHostPlayerID] = playerIDtoAIs[AIHostPlayerID] or {} + playerIDtoAIs[AIHostPlayerID][teamID] = allyTeamID + end + --is luaai + if GetTeamLuaAI(teamID) ~= "" then + teamInfo.isAI = true + teamInfo.isControlled = true + end + --is gaia + if teamID == gaiaTeamID then + allyTeamInfo.isGaia = true + teamInfo.isGaia = true + teamInfo.isControlled = true + end + teamInfo.unitCount = GetTeamUnitCount(teamID) + allyTeamInfo.unitCount = allyTeamInfo.unitCount + teamInfo.unitCount + allyTeamInfo.teams[teamID] = teamInfo + end + allyTeamInfos[allyTeamID] = allyTeamInfo + end + for _,playerID in ipairs(GetPlayerList()) do + CheckPlayer(playerID) + end end local function IsCandidateWinner(allyTeamID) - local isAlive = (killedAllyTeams[allyTeamID] ~= true) - local gaiaCheck = (ignoreGaia == 0) or (allyTeamID ~= gaiaAllyTeamID) - return isAlive and gaiaCheck + return not allyTeamInfos[allyTeamID].dead and (ignoreGaia == 0 or not allyTeamInfos[allyTeamID].isGaia) end local function CheckSingleAllyVictoryEnd() - if aliveAllyTeamCount ~= 1 then - return false - end - + local winnerCount = 0 + local candidateWinners = {} -- find the last remaining allyteam - for _,candidateWinner in ipairs(allyTeams) do - if IsCandidateWinner(candidateWinner) then - return {candidateWinner} + for allyTeamID in pairs(allyTeamInfos) do + if IsCandidateWinner(allyTeamID) then + winnerCount = winnerCount + 1 + candidateWinners[#candidateWinners+1] = allyTeamID end end - - return {} + if #candidateWinners > 1 then + return false + end + return candidateWinners end -local function AreAllyTeamsDoubleAllied( firstAllyTeamID, secondAllyTeamID ) +local function AreAllyTeamsDoubleAllied(firstAllyTeamID, secondAllyTeamID) -- we need to check for both directions of alliance - return spAreTeamsAllied( firstAllyTeamID, secondAllyTeamID ) and spAreTeamsAllied( secondAllyTeamID, firstAllyTeamID ) + for teamA in pairs(allyTeamInfos[firstAllyTeamID].teams) do + for teamB in pairs(allyTeamInfos[secondAllyTeamID].teams) do + if not AreTeamsAllied(teamA, teamB) or not AreTeamsAllied(teamB, teamA) then + return false + end + end + end + return true end local function CheckSharedAllyVictoryEnd() -- we have to cross check all the alliances local candidateWinners = {} local winnerCountSquared = 0 - for _,firstAllyTeamID in ipairs(allyTeams) do - if IsCandidateWinner(firstAllyTeamID) then - for _,secondAllyTeamID in ipairs(allyTeams) do - if IsCandidateWinner(secondAllyTeamID) and AreAllyTeamsDoubleAllied( firstAllyTeamID, secondAllyTeamID ) then + local aliveCount = 0 + for allyTeamA in pairs(allyTeamInfos) do + if IsCandidateWinner(allyTeamA) then + aliveCount = aliveCount + 1 + for allyTeamB in pairs(allyTeamInfos) do + if IsCandidateWinner(allyTeamB) and AreAllyTeamsDoubleAllied(allyTeamA, allyTeamB) then -- store both check directions -- since we're gonna check if we're allied against ourself, only secondAllyTeamID needs to be stored - candidateWinners[secondAllyTeamID] = true + candidateWinners[allyTeamB] = true winnerCountSquared = winnerCountSquared + 1 end end end end - if winnerCountSquared == (aliveAllyTeamCount*aliveAllyTeamCount) then - -- all the allyteams alive are bidirectionally allied against eachother, they are all winners - local winnersCorrectFormat = {} - for winner in pairs(candidateWinners) do - winnersCorrectFormat[#winnersCorrectFormat+1] = winner - end - return winnersCorrectFormat + if aliveCount*aliveCount ~= winnerCountSquared then + return false end + + -- all the allyteams alive are bidirectionally allied against eachother, they are all winners + local winnersCorrectFormat = {} + for winner in pairs(candidateWinners) do + winnersCorrectFormat[#winnersCorrectFormat+1] = winner + end + return winnersCorrectFormat - -- couldn't find any winner - return false end -local function CheckGameOver() + +local function UpdateAllyTeamIsDead(allyTeamID) + local allyTeamInfo = allyTeamInfos[allyTeamID] + local dead = true + for teamID,teamInfo in pairs(allyTeamInfo.teams) do + if not playerQuitIsDead then + dead = dead and (teamInfo.dead or not teamInfo.hasLeader ) + else + dead = dead and (teamInfo.dead or not teamInfo.isControlled ) + end + end + allyTeamInfos[allyTeamID].dead = dead +end + +function gadget:GameFrame() + for _,playerID in ipairs(GetPlayerList()) do + CheckPlayer(playerID) -- because not all events that we want to test call gadget:PlayerChanged (e.g. allying) + end local winners if sharedDynamicAllianceVictory == 0 then winners = CheckSingleAllyVictoryEnd() @@ -139,129 +241,80 @@ local function CheckGameOver() end if winners then - spGameOver(winners) + GameOver(winners) end end -local function KillTeamsZeroUnits() - -- kill all the teams that have zero units - for teamID, unitCount in pairs(teamsUnitCount) do - if unitCount == 0 then - spKillTeam( teamID ) - end - end -end -local function KillAllyTeamsZeroUnits() - -- kill all the allyteams that have zero units - for allyTeamID, unitCount in pairs(allyTeamUnitCount) do - if unitCount == 0 then - -- kill all the teams in the allyteam - local teamList = spGetTeamList(allyTeamID) - for _,teamID in ipairs(teamList) do - spKillTeam( teamID ) +function CheckPlayer(playerID) + local _,active,spectator,teamID = GetPlayerInfo(playerID) + local allyTeamID = teamToAllyTeam[teamID] + local teamInfo = allyTeamInfos[allyTeamID].teams[teamID] + teamInfo.players[playerID] = active and not spectator + teamInfo.hasLeader = select(2,GetTeamInfo(teamID)) >= 0 + if not teamInfo.hasLeader and not teamInfo.dead then + KillTeam(teamID) + Script.LuaRules.TeamDeathMessage(teamID) + end + if not teamInfo.isAI then + --if team isn't AI controlled, then we need to check if we have attached players + teamInfo.isControlled = false + for _,isControlling in pairs(teamInfo.players) do + if isControlling then + teamInfo.isControlled = true + break end end end -end - -local function KillResignedTeams() - -- Check for teams w/o leaders -> all players resigned & no AIs left in the team - -- Note: In the case a player drops he will still be the leader of the team! - -- So he can reconnect and take his units. - local teamList = Spring.GetTeamList() - for i=1, #teamList do - local teamID = teamList[i] - local leaderID = select(2, spGetTeamInfo(teamID)) - if (leaderID < 0) then - spKillTeam(teamID) - end + --if player is an AI controller, then mark all hosted AIs as uncontrolled + local AIHostList = playerIDtoAIs[playerID] or {} + for AITeam, AIAllyTeam in pairs(AIHostList) do + allyTeamInfos[AIAllyTeam].teams[AITeam].isControlled = active end + allyTeamInfos[allyTeamID].teams[teamID] = teamInfo + UpdateAllyTeamIsDead(allyTeamID) end -function gadget:GameFrame(frame) - -- only do a check in slowupdate - if (frame%16) == 0 then - CheckGameOver() - -- kill teams after checking for gameover to avoid to trigger instantly gameover - if teamDeathMode == "teamzerounits" then - KillTeamsZeroUnits() - elseif teamDeathMode == "allyzerounits" then - KillAllyTeamsZeroUnits() - end - KillResignedTeams() - end -end + function gadget:TeamDied(teamID) - teamsUnitCount[teamID] = nil local allyTeamID = teamToAllyTeam[teamID] - local aliveTeamCount = allyTeamAliveTeamsCount[allyTeamID] - if aliveTeamCount then - aliveTeamCount = aliveTeamCount - 1 - allyTeamAliveTeamsCount[allyTeamID] = aliveTeamCount - if aliveTeamCount <= 0 then - -- one allyteam just died - aliveAllyTeamCount = aliveAllyTeamCount - 1 - allyTeamUnitCount[allyTeamID] = nil - killedAllyTeams[allyTeamID] = true - end - end + local allyTeamInfo = allyTeamInfos[allyTeamID] + allyTeamInfo.teams[teamID].dead = true + allyTeamInfos[allyTeamID] = allyTeamInfo + UpdateAllyTeamIsDead(allyTeamID) + Script.LuaRules.TeamDeathMessage(teamID) end -function gadget:Initialize() - if teamDeathMode == "none" then - gadgetHandler:RemoveGadget() - end - - gaiaAllyTeamID = select(6, spGetTeamInfo(gaiaTeamID)) - - -- at start, fill in the table of all alive allyteams - for _,allyTeamID in ipairs(allyTeams) do - local teamList = spGetTeamList(allyTeamID) - local teamCount = 0 - for _,teamID in ipairs(teamList) do - teamToAllyTeam[teamID] = allyTeamID - if (ignoreGaia == 0) or (teamID ~= gaiaTeamID) then - teamCount = teamCount + 1 - end - end - allyTeamAliveTeamsCount[allyTeamID] = teamCount - if teamCount > 0 then - aliveAllyTeamCount = aliveAllyTeamCount + 1 - end - end -end - function gadget:UnitCreated(unitID, unitDefID, unitTeamID) - local teamUnitCount = teamsUnitCount[unitTeamID] or 0 - teamUnitCount = teamUnitCount + 1 - teamsUnitCount[unitTeamID] = teamUnitCount local allyTeamID = teamToAllyTeam[unitTeamID] - local allyUnitCount = allyTeamUnitCount[allyTeamID] or 0 - allyUnitCount = allyUnitCount + 1 - allyTeamUnitCount[allyTeamID] = allyUnitCount + local allyTeamInfo = allyTeamInfos[allyTeamID] + allyTeamInfo.teams[unitTeamID].unitCount = allyTeamInfo.teams[unitTeamID].unitCount + 1 + allyTeamInfo.unitCount = allyTeamInfo.unitCount + 1 + allyTeamInfos[allyTeamID] = allyTeamInfo end gadget.UnitGiven = gadget.UnitCreated gadget.UnitCaptured = gadget.UnitCreated function gadget:UnitDestroyed(unitID, unitDefID, unitTeamID) - if unitTeamID == gaiaTeamID and ignoreGaia ~= 0 then - -- skip gaia + local allyTeamID = teamToAllyTeam[unitTeamID] + local allyTeamInfo = allyTeamInfos[allyTeamID] + local teamUnitCount = allyTeamInfo.teams[unitTeamID].unitCount -1 + local allyTeamUnitCount = allyTeamInfo.unitCount - 1 + allyTeamInfo.teams[unitTeamID].unitCount = teamUnitCount + allyTeamInfo.unitCount = allyTeamUnitCount + allyTeamInfos[allyTeamID] = allyTeamInfo + if allyTeamInfo.isGaia and ignoreGaia == 1 then return end - local teamUnitCount = teamsUnitCount[unitTeamID] - if teamUnitCount then - teamUnitCount = teamUnitCount - 1 - teamsUnitCount[unitTeamID] = teamUnitCount - end - local allyTeamID = teamToAllyTeam[unitTeamID] - local allyUnitCount = allyTeamUnitCount[allyTeamID] - if allyUnitCount then - allyUnitCount = allyUnitCount - 1 - allyTeamUnitCount[allyTeamID] = allyUnitCount + + if allyTeamUnitCount == 0 then + Script.LuaRules.AllyTeamDeathMessage(allyTeamID) + for teamID in pairs(allyTeamInfo.teams) do + KillTeam(teamID) + end end end diff --git a/LuaRules/Gadgets/game_end_over.lua b/LuaRules/Gadgets/game_end_over.lua new file mode 100644 index 000000000..ca5bf9aba --- /dev/null +++ b/LuaRules/Gadgets/game_end_over.lua @@ -0,0 +1,450 @@ +function gadget:GetInfo() + return { + name = "Game Over", + desc = "GAME OVER!! (handles conditions thereof)", + author = "SirMaverick, Google Frog, KDR_11k, CarRepairer (unified by KingRaptor)", + date = "2009", + license = "GPL", + layer = 1, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-- End game if only one allyteam with players AND units is left. +-- An allyteam is counted as dead if none of +-- its active players have units left. +-------------------------------------------------------------------------------- + +if (gadgetHandler:IsSyncedCode()) then + +--if Spring.GetModOption("zkmode",false,nil) == nil then +-- Spring.Echo(" Testing mode. Gadget removed.") +-- return +--end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +local spGetTeamInfo = Spring.GetTeamInfo +local spGetTeamList = Spring.GetTeamList +local spGetTeamUnits = Spring.GetTeamUnits +local spDestroyUnit = Spring.DestroyUnit +local spGetAllUnits = Spring.GetAllUnits +local spGetAllyTeamList = Spring.GetAllyTeamList +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetPlayerList = Spring.GetPlayerList +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitIsStunned= Spring.GetUnitIsStunned +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spTransferUnit = Spring.TransferUnit +local spKillTeam = Spring.KillTeam +local spGameOver = Spring.GameOver + +local COMM_VALUE = 500 +local ECON_SUPREMACY_MULT = 25 + +-------------------------------------------------------------------------------- +-- vars +-------------------------------------------------------------------------------- +local gaiaTeamID = Spring.GetGaiaTeamID() +local gaiaAllyTeamID = select(6, Spring.GetTeamInfo(gaiaTeamID)) +local chickenAllyTeamID + +local aliveCount = {} +local aliveValue = {} +local destroyedAlliances = {} +local allianceToReveal + +local finishedUnits = {} -- this stores a list of all units that have ever been completed, so it can distinguish between incomplete and partly reclaimed units +local toDestroy = {} + +local modOptions = Spring.GetModOptions() or {} +local destroy_type = modOptions.defeatmode or 'destroy' +local commends = tobool(modOptions.commends) +local noElo = tobool(modOptions.noelo) + +local revealed = false +local gameover = false + +local nilUnitDef = {id=-1} +local function GetUnitDefIdByName(defName) + return (UnitDefNames[defName] or nilUnitDef).id +end + +local doesNotCountList = { + [GetUnitDefIdByName("emine")] = true, + [GetUnitDefIdByName("emineai")] = true, + [GetUnitDefIdByName("edrone")] = true, +} + +-- auto detection of doesnotcount units +for name, ud in pairs(UnitDefs) do + if (ud.customParams.dontcount) then + doesNotCountList[ud.id] = true + elseif (ud.isFeature) then + doesNotCountList[ud.id] = true + elseif (not ud.canAttack) and (not ud.speed) and (not ud.isFactory) then + doesNotCountList[ud.id] = true + end +end + +local commsAlive = {} +local allyTeams = spGetAllyTeamList() +for i=1,#allyTeams do + commsAlive[allyTeams[i]] = {} +end + +-------------------------------------------------------------------------------- +-- local funcs +-------------------------------------------------------------------------------- +local function GetTeamIsChicken(teamID) + local luaAI = Spring.GetTeamLuaAI(teamID) + if luaAI and string.find(string.lower(luaAI), "chicken") then + return true + end + return false +end + +local function CountAllianceUnits(allianceID) + local teamlist = spGetTeamList(allianceID) or {} + local count = 0 + for i=1,#teamlist do + local teamID = teamlist[i] + count = count + (aliveCount[teamID] or 0) + if (GG.waitingForComm or {})[teamID] then + count = count + 1 + end + end + return count +end + +local function CountAllianceValue(allianceID) + local teamlist = spGetTeamList(allianceID) or {} + local value = 0 + for i=1,#teamlist do + local teamID = teamlist[i] + value = value + (aliveValue[teamID] or 0) + if (GG.waitingForComm or {})[teamID] then + value = value + COMM_VALUE + end + end + return value +end + +local function HasNoComms(allianceID) + for unitID in pairs(commsAlive[allianceID]) do + return false + end + return true +end + +local function UnitWithinBounds(unitID) + local x, y, z = Spring.GetUnitPosition(unitID) + return (x > -500) and (x < Game.mapSizeX + 500) and (y > -1000) and (z > -500) and (z < Game.mapSizeZ + 500) +end + +-- if only one allyteam left, declare it the victor +local function CheckForVictory() + local allylist = spGetAllyTeamList() + local count = 0 + local lastAllyTeam + for _,a in pairs(allylist) do + if not destroyedAlliances[a] and (a ~= gaiaAllyTeamID) then + --Spring.Echo("Alliance " .. a .. " remains in the running") + count = count + 1 + lastAllyTeam = a + end + end + if count < 2 then + Spring.Echo(( (lastAllyTeam and ("Team " .. lastAllyTeam)) or "Nobody") .. " wins!") + spGameOver({lastAllyTeam}) + end +end + +local function RevealAllianceUnits(allianceID) + allianceToReveal = allianceID + local teamList = spGetTeamList(allianceID) + for i=1,#teamList do + local t = teamList[i] + local teamUnits = spGetTeamUnits(t) + for j=1,#teamUnits do + local u = teamUnits[j] + -- purge extra-map units + if not UnitWithinBounds(u) then + Spring.DestroyUnit(u) + else + Spring.SetUnitAlwaysVisible(u, true) + end + end + end +end + +-- purge the alliance! +local function DestroyAlliance(allianceID) + if not destroyedAlliances[allianceID] then + destroyedAlliances[allianceID] = true + local teamList = spGetTeamList(allianceID) + if teamList == nil then return end -- empty allyteam, don't bother + + if destroy_type == 'debug' then + Spring.Echo("Game Over: DEBUG") + Spring.Echo("Game Over: Allyteam " .. allianceID .. " has met the game over conditions.") + Spring.Echo("Game Over: If this is true, then please resign.") + return -- don't perform victory check + elseif destroy_type == 'destroy' then -- kaboom + Spring.Echo("Game Over: Destroying alliance " .. allianceID) + for i=1,#teamList do + local t = teamList[i] + local teamUnits = spGetTeamUnits(t) + for j=1,#teamUnits do + local u = teamUnits[j] + local pwUnits = (GG.PlanetWars or {}).unitsByID + if pwUnits and pwUnits[u] then + spTransferUnit(u, gaiaTeamID, true) -- don't blow up PW buildings + else + toDestroy[u] = true + end + end + spKillTeam(t) + end + elseif destroy_type == 'losecontrol' then -- no orders can be issued to team + Spring.Echo("Game Over: Destroying alliance " .. allianceID) + for i=1,#teamList do + spKillTeam(teamList[i]) + end + end + end + CheckForVictory() +end +GG.DestroyAlliance = DestroyAlliance + +local function AddAllianceUnit(u, ud, teamID) + local _, _, _, _, _, allianceID = spGetTeamInfo(teamID) + aliveCount[teamID] = aliveCount[teamID] + 1 + + aliveValue[teamID] = aliveValue[teamID] + UnitDefs[ud].metalCost + + --Spring.Echo("added alliance=" .. teamID, 'count='..aliveCount[allianceID]) + if UnitDefs[ud].customParams.commtype then + commsAlive[allianceID][u] = true + end +end + +local function RemoveAllianceUnit(u, ud, teamID) + local _, _, _, _, _, allianceID = spGetTeamInfo(teamID) + aliveCount[teamID] = aliveCount[teamID] - 1 + + aliveValue[teamID] = aliveValue[teamID] - UnitDefs[ud].metalCost + if aliveValue[teamID] < 0 then + aliveValue[teamID] = 0 + end + + --Spring.Echo("removed alliance=" .. teamID, 'count='..aliveCount[allianceID]) + if UnitDefs[ud].customParams.commtype then + commsAlive[allianceID][u] = nil + end + if ((CountAllianceUnits(allianceID) <= 0) or (commends and HasNoComms(allianceID))) and (allianceID ~= chickenAllyTeamID) then + Spring.Log(gadget:GetInfo().name, LOG.INFO, " Purging allyTeam " .. allianceID) + DestroyAlliance(allianceID) + end +end + +local function CompareArmyValues(ally1, ally2) + local value1, value2 = CountAllianceValue(ally1), CountAllianceValue(ally2) + if value1 > ECON_SUPREMACY_MULT*value2 then + return ally1 + elseif value2 > ECON_SUPREMACY_MULT*value1 then + return ally2 + end + return nil +end + +-- used during initialization +local function CheckAllUnits() + aliveCount = {} + local teams = spGetTeamList() + for i=1,#teams do + local teamID = teams[i] + if teamID ~= gaiaTeamID then + aliveCount[teamID] = 0 + end + end + local units = spGetAllUnits() + for i=1,#units do + local unitID = units[i] + local teamID = spGetUnitTeam(unitID) + local unitDefID = spGetUnitDefID(unitID) + gadget:UnitFinished(unitID, unitDefID, teamID) + end +end + +-- check for active players +local function ProcessLastAlly() + if Spring.IsCheatingEnabled() or destroy_type == 'debug' then + return + end + local allylist = spGetAllyTeamList() + local activeAllies = {} + local lastActive = nil + for i=1,#allylist do + repeat + local a = allylist[i] + if (a == gaiaAllyTeamID) then break end -- continue + if (destroyedAlliances[a]) then break end -- continue + local teamlist = spGetTeamList(a) + if (not teamlist) then break end -- continue + local activeTeams = 0 + for i=1,#teamlist do + local t = teamlist[i] + -- any team without units is dead to us; so only teams who are active AND have units matter + -- except chicken, who are alive even without units + local numAlive = aliveCount[t] + if #(Spring.GetTeamUnits(t)) == 0 then numAlive = 0 end + if (numAlive > 0) or (GG.waitingForComm or {})[t] or (GetTeamIsChicken(t)) then + local playerlist = spGetPlayerList(t, true) -- active players + if playerlist then + for j=1,#playerlist do + local _,active,spec = spGetPlayerInfo(playerlist[j]) + if active and not spec then + activeTeams = activeTeams + 1 + end + end + end + -- count AI teams as active + local _,_,_,isAiTeam = spGetTeamInfo(t) + if isAiTeam then + activeTeams = activeTeams + 1 + end + end + end + if activeTeams > 0 then + activeAllies[#activeAllies+1] = a + lastActive = a + end + until true + end -- for + + if #activeAllies == 2 then + if revealed then return end + if activeAllies[1] == chickenAllyTeamID or activeAllies[2] == chickenAllyTeamID then + return + end + -- run value comparison + local supreme = CompareArmyValues(activeAllies[1], activeAllies[2]) + if supreme then + Spring.Echo("AllyTeam " .. supreme .. " has an overwhelming numerical advantage!") + for i=1, #allylist do + local a = allylist[i] + if (a ~= supreme) and (a ~= gaiaAllyTeamID) then + RevealAllianceUnits(a) + revealed = true + end + end + end + elseif #activeAllies < 2 then + -- remove every unit except for last active alliance + for i=1, #allylist do + local a = allylist[i] + if (a ~= lastActive)and(a ~= gaiaAllyTeamID) then + DestroyAlliance(a) + end + end + end +end + +-------------------------------------------------------------------------------- +-- callins +-------------------------------------------------------------------------------- + +function gadget:UnitFinished(u, ud, team) + if (team ~= gaiaTeamID) + and(not doesNotCountList[ud]) + and(not finishedUnits[u]) + then + finishedUnits[u] = true + AddAllianceUnit(u, ud, team) + end +end + +function gadget:UnitCreated(u, ud, team) + if revealed then + local allyTeam = select(6, spGetTeamInfo(team)) + if allyTeam == allianceToReveal then + Spring.SetUnitAlwaysVisible(u, true) + end + end +end + +function gadget:UnitDestroyed(u, ud, team) + if (team ~= gaiaTeamID) + and(not doesNotCountList[ud]) + and finishedUnits[u] + then + finishedUnits[u] = nil + RemoveAllianceUnit(u, ud, team) + end + toDestroy[u] = nil +end + +-- note: Taken comes before Given +function gadget:UnitGiven(u, ud, newTeam, oldTeam) + if (newTeam ~= gaiaTeamID) + and(not doesNotCountList[ud]) + and(not select(3,spGetUnitIsStunned(u))) + then + AddAllianceUnit(u, ud, newTeam) + end +end + +function gadget:UnitTaken(u, ud, oldTeam, newTeam) + if (oldTeam ~= gaiaTeamID) + and(not doesNotCountList[ud]) + and(select(5,spGetUnitHealth(u))>=1) + then + RemoveAllianceUnit(u, ud, oldTeam) + end +end + +function gadget:Initialize() + local teams = spGetTeamList() + for i=1,#teams do + aliveValue[teams[i]] = 0 + if GetTeamIsChicken(teams[i]) then + Spring.Log(gadget:GetInfo().name, LOG.INFO, " Chicken team found") + chickenAllyTeamID = select(6, Spring.GetTeamInfo(teams[i])) + --break + end + end + + CheckAllUnits() + + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Game Over initialized") +end + +function gadget:GameFrame(n) + -- check for last ally: + -- end condition: only 1 ally with human players, no AIs in other ones + if (n % 45 == 0) then + for u in pairs(toDestroy) do + spDestroyUnit(u, true) + end + toDestroy = {} + if not gameover then + ProcessLastAlly() + end + end +end + +function gadget:GameOver() + gameover = true + if noElo then + Spring.SendCommands("wbynum 255 SPRINGIE:noElo") + end + Spring.Log(gadget:GetInfo().name, LOG.INFO, "GAME OVER!!") +end + +else -- UNSYNCED + +end diff --git a/LuaRules/Gadgets/game_end_team_com_ends.lua b/LuaRules/Gadgets/game_end_team_com_ends.lua new file mode 100644 index 000000000..20261a4f9 --- /dev/null +++ b/LuaRules/Gadgets/game_end_team_com_ends.lua @@ -0,0 +1,173 @@ +function gadget:GetInfo() + return { + name = "Team Com Ends", + desc = "Implements com ends for allyteams", + author = "KDR_11k (David Becker)", + date = "2008-02-04", + license = "Public domain", + layer = 1, + enabled = true + } +end + +-- this acts just like Com Ends except instead of killing a player's units when +-- his com dies it acts on an allyteam level, if all coms in an allyteam are dead +-- the allyteam is out + +deathMode = tonumber(Spring.GetModOptions().deathmode) -- Radius around a point in which to capture it +if deathMode == nil then + deathMode = "com" +end + +-- the deathmode modoption must be set to one of the following to enable this +local endmodes = { + com=true, +} + +if (gadgetHandler:IsSyncedCode()) then + +--SYNCED + +---STUFF FOR DEATH SOUNDS +local DeathSounds = VFS.DirList('sounds/deathsounds/generic', '*.wav') +------------------------- + +local destroyQueue = {} + +local destroyUnitQueue = {} + +local aliveCount = {} + +local isAlive = {} + +local GetTeamList=Spring.GetTeamList +local GetTeamUnits = Spring.GetTeamUnits +local GetUnitAllyTeam = Spring.GetUnitAllyTeam +local DestroyUnit=Spring.DestroyUnit +local GetUnitPosition = Spring.GetUnitPosition +local SpawnCEG = Spring.SpawnCEG + +local DISTANCE_LIMIT = (math.max(Game.mapSizeX,Game.mapSizeZ) * math.max(Game.mapSizeX,Game.mapSizeZ)) +local min = math.min +local deathWave = false +local deathTimeBoost = 1 + +local function getSqrDistance(x1,z1,x2,z2) + local dx,dz = x1-x2,z1-z2 + return (dx*dx)+(dz*dz) +end + +function gadget:Initialize() + --Spring.Echo("Deathmode is " .. deathMode) + if not endmodes[deathMode] then + gadgetHandler:RemoveGadget(self) -- in particular, this gadget is removed if deathmode is "killall" or "none" + end + for _,t in ipairs(Spring.GetAllyTeamList()) do + aliveCount[t] = 0 + end +end + +function gadget:GameFrame(t) + --Spring.Echo("Deathmode is " .. deathMode) + if t % 15 < 1 then + for at,defs in pairs(destroyQueue) do + if aliveCount[at] <= 0 then --safety check, triggers on transferring the last com otherwise + for _,team in ipairs(GetTeamList(at)) do + for _,unitID in ipairs(GetTeamUnits(team)) do + local x,y,z = GetUnitPosition(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + local deathTime = ((getSqrDistance(x,z,defs.x,defs.z) / DISTANCE_LIMIT) * 250) + if (destroyUnitQueue[unitID] == nil) then + destroyUnitQueue[unitID] = { + time = t + deathTime, + x = x, + y = y, + z = z, + spark = false + } + end + end + end + deathWave = true + end + --destroyQueue[at]=nil + end + end + + if (deathWave) and next(destroyUnitQueue) then + local dt = (t + deathTimeBoost) + for unitID, defs in pairs(destroyUnitQueue) do + if ((dt > (defs.time - 15)) and (defs.spark == false)) then + SpawnCEG("genericshellexplosion-huge-sparks-burn",defs.x,defs.y,defs.z,0,0,0) + destroyUnitQueue[unitID].spark = true + end + if (dt > defs.time) then + DestroyUnit(unitID, true) + destroyUnitQueue[unitID] = nil + local deathsound = DeathSounds[math.random(1, #DeathSounds)] + Spring.PlaySoundFile(deathsound, math.random(1,7), defs.x, defs.y, defs.z) + end + end + deathTimeBoost = deathTimeBoost * 1.01 + end + +end + +function gadget:UnitCreated(u, ud, team) + isAlive[u] = true + if UnitDefs[ud].customParams.iscommander then + local allyTeam = GetUnitAllyTeam(u) + aliveCount[allyTeam] = aliveCount[allyTeam] + 1 + end +end + +function gadget:UnitGiven(u, ud, team) + if UnitDefs[ud].customParams.iscommander then + local allyTeam = GetUnitAllyTeam(u) + aliveCount[allyTeam] = aliveCount[allyTeam] + 1 + end +end + +function gadget:UnitDestroyed(u, ud, team) + isAlive[u] = nil + if UnitDefs[ud].customParams.iscommander then + local allyTeam = GetUnitAllyTeam(u) + aliveCount[allyTeam] = aliveCount[allyTeam] - 1 + if aliveCount[allyTeam] <= 0 then + local x,y,z = Spring.GetUnitPosition(u) + destroyQueue[allyTeam] = {x = x, y = y, z = z} + end + end +end + +function gadget:UnitTaken(u, ud, team) + if isAlive[u] and UnitDefs[ud].customParams.iscommander then + local allyTeam = GetUnitAllyTeam(u) + aliveCount[allyTeam] = aliveCount[allyTeam] - 1 + if aliveCount[allyTeam] <= 0 then + local x,y,z = Spring.GetUnitPosition(u) + destroyQueue[allyTeam] = {x = x, y = y, z = z} + end + end +end + +function gadget:TeamDied(team) + local _,_,_,_,_,allyTeam = Spring.GetTeamInfo(team) + for _,unitID in ipairs(GetTeamUnits(team)) do + local unitDefID = Spring.GetUnitDefID(unitID) + if isAlive[unitID] and UnitDefs[unitDefID].customParams.iscommander then + local x,y,z = GetUnitPosition(unitID) + local deathsound = "sounds/explosions/explosion_enormous.wav" + Spring.PlaySoundFile(deathsound, 7, x, y, z) + DestroyUnit(unitID, true) + end + end +end + +else + +--UNSYNCED + +return false + +end diff --git a/LuaRules/Gadgets/game_featureReclaim.lua b/LuaRules/Gadgets/game_featureReclaim.lua index 30f1b703e..89fef9e13 100644 --- a/LuaRules/Gadgets/game_featureReclaim.lua +++ b/LuaRules/Gadgets/game_featureReclaim.lua @@ -6,7 +6,7 @@ function gadget:GetInfo() date = "December, 2008", license = "public domain", layer = 0, - enabled = true -- loaded by default? + enabled = false -- loaded by default? } end @@ -26,10 +26,10 @@ if gadgetHandler:IsSyncedCode() then reclaimLeft[featureID] = (reclaimLeft[featureID] or 0.1) + part if (reclaimLeft[featureID] <= 0) then Spring.DestroyFeature(featureID) - Spring.AddTeamResource(builderTeam, "e", 10) + --Spring.AddTeamResource(builderTeam, "e", 1) local fx, fy, fz = GetFeaturePosition(featureID) - Spring.PlaySoundFile("sounds/reclaimed.wav", 1, fx, fy, fz) - SpawnCEG("sparklegreenplus10energy", fx, fy, fz) + Spring.PlaySoundFile("sounds/miscfx/reclaimed.wav", 0.5, fx, fy, fz) + SpawnCEG("sparklegreen", fx, fy, fz) end return false end diff --git a/LuaRules/Gadgets/game_linearEdgeEffectiveness.lua b/LuaRules/Gadgets/game_linearEdgeEffectiveness.lua new file mode 100644 index 000000000..2a8a353f9 --- /dev/null +++ b/LuaRules/Gadgets/game_linearEdgeEffectiveness.lua @@ -0,0 +1,39 @@ +function gadget:GetInfo() + return { + name = "Linear EdgeEffectiveness", + desc = "Makes AOE damage fall off linearly between 0 and 1", + author = "Sprung", + date = "Does it matter?", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false -- loaded by default? + } +end +--[[ +function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID) + if weaponDefID <= 0 then + return damage -- environmental damage, no weapondef entry + end + + local weaponDef = WeaponDefs[weaponDefID] + local ee = weaponDef.edgeEffectiveness + if ee == 1 then + return damage -- already desired behaviour and would else crash due to div0 + end + + local baseDamage = weaponDef.damages[UnitDefs[unitDefID].armorType] + + local isArmored, armorMult = Spring.GetUnitArmored(unitID) + if isArmored then + if armorMult == 0 then + return 0 + end + baseDamage = baseDamage * armorMult + end + + local fraction = damage / baseDamage + local distance = (1 - fraction) / (1 - fraction*ee) + + return baseDamage * (1 - distance*(1 - ee)) +end +]]-- \ No newline at end of file diff --git a/LuaRules/Gadgets/game_prevent_excessive_share.lua b/LuaRules/Gadgets/game_prevent_excessive_share.lua new file mode 100644 index 000000000..0a0eb036e --- /dev/null +++ b/LuaRules/Gadgets/game_prevent_excessive_share.lua @@ -0,0 +1,52 @@ + +function gadget:GetInfo() + return { + name = 'Prevent Excessive Share', + desc = 'Prevents sharing more resources than the receiver can hold', + author = 'Niobium', + date = 'April 2012', + license = 'GNU GPL, v2 or later', + layer = 0, + enabled = true + } +end + +---------------------------------------------------------------- +-- Synced only +---------------------------------------------------------------- +if not gadgetHandler:IsSyncedCode() then + return false +end + +---------------------------------------------------------------- +-- Callins +---------------------------------------------------------------- +function gadget:AllowResourceTransfer(senderTeamId, receiverTeamId, resourceType, amount) + + -- Spring uses 'm' and 'e' instead of the full names that we need, so we need to convert the resourceType + -- We also check for 'metal' or 'energy' incase Spring decides to use those in a later version + local resourceName + if (resourceType == 'm') or (resourceType == 'metal') then + resourceName = 'metal' + elseif (resourceType == 'e') or (resourceType == 'energy') then + resourceName = 'energy' + else + -- We don't handle whatever this resource is, allow it + return true + end + + -- Calculate the maximum amount the receiver can receive + local rCur, rStor, rPull, rInc, rExp, rShare = Spring.GetTeamResources(receiverTeamId, resourceName) + local maxShare = rStor * rShare - rCur + + -- Is the sender trying to send more than the maximum? Block it, possibly sending a reduced amount instead + if amount > maxShare then + if maxShare > 0 then + Spring.ShareTeamResource(senderTeamId, receiverTeamId, resourceName, maxShare) + end + return false + end + + -- Allow anything we don't explictly block + return true +end diff --git a/LuaRules/Gadgets/game_resourceGifts.lua b/LuaRules/Gadgets/game_resourceGifts.lua new file mode 100644 index 000000000..215cb4ac1 --- /dev/null +++ b/LuaRules/Gadgets/game_resourceGifts.lua @@ -0,0 +1,186 @@ +function gadget:GetInfo() + return { + name = "Resource Gifts and Mex Income", + desc = "Adds 1/1 resource income so that I don't have to tie it to units anymore, controls extractor income", + author = "lurker (Dylan Petonke), Google Frog", + date = "Sept 8 2009", + license = "GPL", + layer = 1, + enabled = true + } +end + +local MEX_INCOME = 1 -- income of each mex +local modOptions = Spring.GetModOptions(); + +-- Give resources to teams +local baseIncome = Spring.GetModOptions().basicincome or 1 +local baseIncomeIncrease = Spring.GetModOptions().basicincomeincrease or 1 -- add this each 1cycle + +if Spring.GetModOptions().basicincomeinterval ~= nil then + baseIncomeIncreasePeriod = Spring.GetModOptions().basicincomeinterval*60*30 +else + baseIncomeIncreasePeriod = 2.5*60*30 -- x min * 60 s/min * 30 frame/s +end + +local maximumBaseIncome = Spring.GetModOptions().maxbasicincome or 10 + +if (not gadgetHandler:IsSyncedCode()) then + return -- No Unsynced +end + +--- Detect metal extractors, manual entering of mexes possible +local mexDefs = {} + +for i=1,#UnitDefs do + local udef = UnitDefs[i] + if (udef.extractsMetal > 0) then + mexDefs[i] = true + end +end + +-- Initialise ally teams +local allyTeamInfo = {} -- list of players and mexes on a team + +local allyTeamList = Spring.GetAllyTeamList() +local allyTeams = #allyTeamList +do + for i=1,allyTeams do + local allyTeamID = allyTeamList[i] + local teamList = Spring.GetTeamList(allyTeamID) + allyTeamInfo[allyTeamID] = { + teams = 0, + team = {}, + mexes = 0, + mex = {}, + mexIndex = {}, + } + for j=1,#teamList do + local teamID = teamList[j] + allyTeamInfo[allyTeamID].teams = allyTeamInfo[allyTeamID].teams + 1 + allyTeamInfo[allyTeamID].team[allyTeamInfo[allyTeamID].teams] = teamID + end + end +end + +local function addMex(unitID) + local allyTeam = allyTeamInfo[Spring.GetUnitAllyTeam(unitID)] + allyTeam.mexes = allyTeam.mexes + 1 + allyTeam.mex[allyTeam.mexes] = unitID + allyTeam.mexIndex[unitID] = allyTeam.mexes +end + +local function removeMex(unitID) + local allyTeam = allyTeamInfo[Spring.GetUnitAllyTeam(unitID)] + allyTeam[allyTeam.mexIndex[unitID]] = allyTeam[allyTeam.mexes] + allyTeam[allyTeam.mexes] = nil + allyTeam.mexIndex[unitID] = nil + allyTeam.mexes = allyTeam.mexes - 1 +end + +local function getMexIncomes() + + local income = {} + + for i=1,allyTeams do + local allyTeamID = allyTeamList[i] + local allyTeam = allyTeamInfo[allyTeamID] + local mexCount = 0 + for i = 1, allyTeam.mexes do + local unitID = allyTeam.mex[i] + local stunned_or_inbuld = Spring.GetUnitIsStunned(unitID) + if not stunned_or_inbuld then + mexCount = mexCount + 1 + end + end + income[allyTeamID] = MEX_INCOME*mexCount/allyTeam.teams + end + + return income +end + +function gadget:Initialize(n) + if ( Spring.GetModOptions().comm == "sandbox" or Spring.GetModOptions().comm == "feature" ) then + + for _,i in ipairs(Spring.GetTeamList()) do + Spring.SetTeamResource(i,"e",250) + Spring.SetTeamResource(i,"m",100) + end + end + + for _, unitID in ipairs(Spring.GetAllUnits()) do + if (mexDefs[unitDefID]) then + addMex(unitID) + end + end +end + +function gadget:GameFrame(n) + + -- Give resources to teams + if (n % baseIncomeIncreasePeriod) == 3 then +-- Spring.Echo("Time to increase income") +-- Spring.Echo("Old baseIncome") +-- Spring.Echo(baseIncome) +-- Spring.Echo("baseIncomeIncrease") +-- Spring.Echo(baseIncomeIncrease) + baseIncome = baseIncome + baseIncomeIncrease +-- Spring.Echo("New baseIncome") +-- Spring.Echo(baseIncome) + end + if Spring.GetModOptions().mincome ~= "disabled" then + if (n % 30) == 4 then + local mexIncome = getMexIncomes() + + for _,i in ipairs(Spring.GetTeamList()) do + local _,_,_,_,_,allyTeamID = Spring.GetTeamInfo(i) + if i ~= Spring.GetGaiaTeamID() then -- don't give free stuff to GAIA + Spring.AddTeamResource(i,"e",10) + end + if not (baseIncome >= tonumber(maximumBaseIncome)) then + Spring.AddTeamResource(i,"m",baseIncome + mexIncome[allyTeamID]) + else + Spring.AddTeamResource(i,"m",tonumber(maximumBaseIncome)) + end + -- Spring.Echo("Final baseIncome amount that is being run through AddTeamResource") + -- Spring.Echo(baseIncome) + -- Spring.Echo("DUN DUN DUN") + --end + end + end + end +end + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + if (mexDefs[unitDefID]) then + addMex(unitID) + end +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + if (mexDefs[unitDefID]) then + removeMex(unitID) + end +end + +function gadget:UnitGiven(unitID, unitDefID, teamID, oldTeamID) + local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID) + local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID) + + if (newAllyTeam ~= oldAllyTeam) then + if (mexDefs[unitDefID]) then + addMex(unitID) + end + end +end + +function gadget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) + local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID) + local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID) + + if (newAllyTeam ~= oldAllyTeam) then + if (mexDefs[unitDefID]) then + removeMex(unitID) + end + end +end diff --git a/LuaRules/Gadgets/game_spawn.lua b/LuaRules/Gadgets/game_spawn.lua index 22303177a..5c3bcbeed 100644 --- a/LuaRules/Gadgets/game_spawn.lua +++ b/LuaRules/Gadgets/game_spawn.lua @@ -34,30 +34,131 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +local aiStartUnits = { + ["fedcommander"] = { + "ecommanderbattleai", + -- "ecommanderbuildai", + -- "ecommandercloakai", + -- "ecommanderfactoryai", + -- "ecommandershieldai", + -- "ecommanderhealerai", + }, + ["lozcommander"] = { + "ecommanderbattleai", + -- "ecommanderbuildai", + -- "ecommandercloakai", + -- "ecommanderfactoryai", + -- "ecommandershieldai", + -- "ecommanderhealerai", + }, +} + +local factionDefComms = { + --[0] = "ecommander", + --[1] = "zarm", + --[2] = "xcommander",\ + + [0] = "fedcommander", + [1] = "lozcommander", +} + +local validStartComm = { + --[UnitDefNames["ecommander"].id] = true, + --[UnitDefNames["zarm"].id] = true, + --[UnitDefNames["xcommander"].id] = true, + [UnitDefNames["fedcommander"].id] = true, + [UnitDefNames["lozcommander"].id] = true, +} + +local ACCESS_LEVEL = { + -- pick one of the two below choose whether enemies can see faction choice + private = true, + -- public = true, +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + local modOptions = Spring.GetModOptions() +function IsTeamAI(teamID) + _, _, _, isAiTeam=Spring.GetTeamInfo(teamID) + return isAiTeam +end local function GetStartUnit(teamID) + local reqStartUnit = Spring.GetTeamRulesParam(teamID, "startUnit") + if reqStartUnit then + return UnitDefs[reqStartUnit].name + end + -- get the team startup info local side = select(5, Spring.GetTeamInfo(teamID)) local startUnit - if (side == "") then - -- startscript didn't specify a side for this team - local sidedata = Spring.GetSideData() - if (sidedata and #sidedata > 0) then - startUnit = sidedata[1 + teamID % #sidedata].startUnit + + if IsTeamAI(teamID) then + Spring.Echo ("Enemy is an AI so it gets an AI Specific Overseer!") + --local factionrandom = math.random(0,1) + math.random(); math.random(); math.random() + local sidedata = factionDefComms[math.random(0,1)] + if sidedata == nil then + Spring.Echo("[Game Spawn] AI Faction: nil") + else + Spring.Echo("[Game Spawn] AI Faction: " .. sidedata) end + + local aiCommData = aiStartUnits[sidedata] or {} + local aiCommIndex = math.random(1, #aiCommData) + startUnit = aiCommData[aiCommIndex] else - startUnit = Spring.GetSideData(side) + -- If a side isn't selected, flip a coin + if (side == "") then + local factionIndex = math.random(0, 1) + startUnit = factionDefComms[factionIndex] + else + startUnit = Spring.GetSideData(side) + end end + return startUnit end local function SpawnStartUnit(teamID) local startUnit = GetStartUnit(teamID) + if (startUnit and startUnit ~= "") then + + if startUnit == "fedcommander" then + playerFaction = "Federation of Kala" + elseif startUnit == "lozcommander" then + playerFaction = "Loz Alliance" + --elseif startUnit == "xcommander" then + -- playerFaction = "pattern" + elseif startUnit == nil then + playerFaction = "Script is Fucked" + else + playerFaction = startUnit + Spring.Echo("[Game Spawn] If you're seeing this message that means that the code which sets the player's faction is absolutely fucked somewhere. On the next line I will echo the playerFaction variable. If it says anything other than the factions listed above, at least it will provide a clue.") + Spring.Echo(playerFaction) + end + + + Spring.Echo("[Game Spawn] My starting faction is " .. playerFaction) + Spring.SetTeamRulesParam(teamID, "faction", playerFaction) + -- spawn the specified start unit local x,y,z = Spring.GetTeamStartPosition(teamID) + if IsTeamAI(teamID) then + local _,_,_,_,_,allyID = Spring.GetTeamInfo(teamID) + local startBoxXmin, startBoxZmin, startBoxXmax, startBoxZmax = Spring.GetAllyTeamStartBox(allyID) + local mx = Game.mapSizeX + local mz = Game.mapSizeZ + if not (startBoxXmin == 0 and startBoxZmin == 0 and startBoxXmax == mx and startBoxZmax == mz) then + math.random(); math.random(); math.random() + x = math.random(startBoxXmin, startBoxXmax) + z = math.random(startBoxZmin, startBoxZmax) + end + end -- snap to 16x16 grid x, z = 16*math.floor((x+8)/16), 16*math.floor((z+8)/16) y = Spring.GetGroundHeight(x, z) @@ -66,12 +167,23 @@ local function SpawnStartUnit(teamID) and ((x>Game.mapSizeX/2) and "west" or "east") or ((z>Game.mapSizeZ/2) and "north" or "south") local unitID = Spring.CreateUnit(startUnit, x, y, z, facing, teamID) +-- Fun times + if startUnit == "ecommander" then + --id1=Spring.CreateUnit("eorb", x+100, y+200, z, facing, teamID) + --id1=Spring.CreateUnit("eorb", x-100, y-200, z, facing, teamID) + --Spring.GiveOrderToUnit(id1,CMD.GUARD,{unitID}, {"shift"}) + end + if startUnit == "zarm" then + id1=Spring.CreateUnit("ztumor", x+100, y+200, z, facing, teamID) + id1=Spring.CreateUnit("ztumor", x-100, y-200, z, facing, teamID) + --Spring.GiveOrderToUnit(id1,CMD.GUARD,{unitID}, {"shift"}) + end end -- set start resources, either from mod options or custom team keys - local teamOptions = select(7, Spring.GetTeamInfo(teamID)) + local teamOptions = select(8, Spring.GetTeamInfo(teamID)) local m = teamOptions.startmetal or modOptions.startmetal or 100 - local e = teamOptions.startenergy or modOptions.startenergy or 250 + local e = teamOptions.startenergy or modOptions.startenergy or 100 -- using SetTeamResource to get rid of any existing resource without affecting stats -- using AddTeamResource to add starting resource and counting it as income @@ -79,7 +191,7 @@ local function SpawnStartUnit(teamID) -- remove the pre-existing storage -- must be done after the start unit is spawned, -- otherwise the starting resources are lost! - Spring.SetTeamResource(teamID, "ms", tonumber(m)) + Spring.SetTeamResource(teamID, "ms", tonumber(m)) --Use tonumber(m) to have it match the startmetal amounts Spring.SetTeamResource(teamID, "m", 0) Spring.AddTeamResource(teamID, "m", tonumber(m)) end @@ -87,10 +199,25 @@ local function SpawnStartUnit(teamID) -- remove the pre-existing storage -- must be done after the start unit is spawned, -- otherwise the starting resources are lost! - Spring.SetTeamResource(teamID, "es", tonumber(e)) + Spring.SetTeamResource(teamID, "es", tonumber(e)) --Use tonumber(e) to have it match the startenergy amounts Spring.SetTeamResource(teamID, "e", 0) Spring.AddTeamResource(teamID, "e", tonumber(e)) + end +end + +function gadget:RecvLuaMsg(msg, playerID) + if msg:find("\138") ~= 1 then + return + end + + local requestedCommDefID = tonumber(msg:sub(2) or "-1") + if not validStartComm[requestedCommDefID] then + return end + + local teamID = select(4, Spring.GetPlayerInfo(playerID, false)) + --Spring.Echo("Setting start unit for team", teamID, " to ", requestedCommDefID) + Spring.SetTeamRulesParam(teamID, "startUnit", requestedCommDefID, ACCESS_LEVEL) end @@ -110,4 +237,4 @@ function gadget:GameStart() SpawnStartUnit(teamID) end end -end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/geo_placement.xlua b/LuaRules/Gadgets/geo_placement.xlua new file mode 100644 index 000000000..a69bbb6ce --- /dev/null +++ b/LuaRules/Gadgets/geo_placement.xlua @@ -0,0 +1,62 @@ +function gadget:GetInfo() + return { + name = "LuaGeo", + desc = "Spawns GeoVents randomly on the map", + author = "Stowtemid, Forboding Angel", + date = "", + license = "PD", + layer = 0, + enabled = false -- loaded by default? + } +end + +if (Spring.GetGameFrame() >= 1) then + return false +end + +--math.randomseed(Game.GameID) -- This only works in 104+ +math.random(); math.random(); math.random() +local mapxFull, mapzFull = Game.mapSizeX, Game.mapSizeZ +local mapx, mapz = Game.mapSizeX, Game.mapSizeZ * 0.5 +local size = math.max(mapx, mapz) + +local numPointsPerSide = 8 +local rotation = 2 + +function makePositionsForGeoSpots(mapx, mapz, numPointsPerSide, rotation) + -- Constants + local distanceFromCorner = 0.15 + local width = 0.25 + local length = 0.6 + + local positions = {} + for i = 1, numPointsPerSide do + local x = (i - 1) / (numPointsPerSide - 1) -- if numPointsPerSide = 4, then x = 0, 0.33, 0.67, 1 + local newPoint = {0, 0} + if rotation < 2 then -- 0 or 1 + newPoint[1] = mapxFull * (distanceFromCorner + width * x * x) + newPoint[2] = mapzFull * (distanceFromCorner + length * x) + else -- 2 or 3 + newPoint[1] = mapxFull * (distanceFromCorner + length * x) + newPoint[2] = mapzFull * (distanceFromCorner + width * x * x) + end + if rotation % 2 == 1 then newPoint[2] = mapzFull - newPoint[2] end -- 1 or 3 + positions[#positions + 1] = {x = newPoint[1], z = newPoint[2]} + positions[#positions + 1] = {x = mapxFull - newPoint[1], z = mapzFull - newPoint[2]} + end + return positions +end + +local positions = makePositionsForGeoSpots(mapx, mapz, numPointsPerSide, rotation) + +if ( positions ) then + local gaiaID = Spring.GetGaiaTeamID() + Spring.Echo("[LuaGeo] I found positions for geovent feature placement!") + local length = #positions + for i = 1, length do + Spring.Echo("[LuaGeo] I'm trying to create a geovent feature at:") + Spring.Echo("[LuaGeo] x = " .. positions[i].x) + Spring.Echo("[LuaGeo] z = " .. positions[i].z) + Spring.CreateFeature('geovent', positions[i].x, Spring.GetGroundHeight(positions[i].x,positions[i].z)+5, positions[i].z, 1, gaiaID) + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/gfx_atlas_loader.lua b/LuaRules/Gadgets/gfx_atlas_loader.lua new file mode 100644 index 000000000..b9db97003 --- /dev/null +++ b/LuaRules/Gadgets/gfx_atlas_loader.lua @@ -0,0 +1,35 @@ + +function gadget:GetInfo() + return { + name = 'Lego Atlas Loader', + desc = 'Forces the Lego v2 atlas to be loaded', + author = 'Bluestone', + date = '', + license = 'GNU GPL v3', + layer = 0, + enabled = true, + } +end + +-- this is a bit of a hack! + +if gadgetHandler:IsSyncedCode() then return false end + +local n = 0 +local ATLASUNIT = UnitDefNames["ecommander"].id + +function gadget:DrawWorld() + n = n + 1 + + if n==1 then + gl.PushMatrix() + gl.Translate(-1000, -1000, -1000) + gl.UnitShape(ATLASUNIT, 0) + gl.PopMatrix() + end + + if n>1 then + gadgetHandler:RemoveGadget() + end + +end \ No newline at end of file diff --git a/LuaRules/Gadgets/gfx_explosion_lights.lua b/LuaRules/Gadgets/gfx_explosion_lights.lua new file mode 100644 index 000000000..88dad6971 --- /dev/null +++ b/LuaRules/Gadgets/gfx_explosion_lights.lua @@ -0,0 +1,103 @@ + +function gadget:GetInfo() + return { + name = "Explosion_lights", + desc = "", + author = "Floris", + date = "April 2017", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true + } +end + +-- exclude air (to prevent aa missiles that reach ground from having lights) +--local groundTypes = { +-- default = true, +-- commanders = true, +-- crawlingbombs = true, +-- platform = true, +-- heavyunits = true, +-- nanos = true, +-- shields = true, +-- scouts = true, +-- corvettes = true, +-- destroyers = true, +-- cruisers = true, +-- carriers = true, +-- battleships = true, +-- flagships = true +--} +--local skipAirWeapons = {} +--local groundDamage = false +--for weaponID, weaponDef in pairs(WeaponDefs) do +-- groundDamage = false +-- for type, damage in pairs(weaponDef.damages) do -- weaponDef.damages doesnt contain what i expected +-- Spring.Echo(type..' '..damage) +-- if groundTypes[type] ~= nil and damage > 0 then +-- groundDamage = true +-- break +-- end +-- end +-- if groundDamage == false then +-- skipAirWeapons[weaponID] = true +-- end +--end + +------------------------------------------------------------------------------- +-- Synced +------------------------------------------------------------------------------- + +if (gadgetHandler:IsSyncedCode()) then + + function gadget:Initialize() + for wdid, wd in pairs(WeaponDefs) do + if wd.type == "Flame" then + Script.SetWatchWeapon(wdid, true) -- watch weapon so explosion gets called for flame weapons + end + end + end + + function gadget:Explosion(weaponID, px, py, pz, ownerID) + SendToUnsynced("explosion_light", px, py, pz, weaponID, ownerID) + end + +else + +------------------------------------------------------------------------------- +-- Unsynced +------------------------------------------------------------------------------- + + local myAllyID = Spring.GetMyAllyTeamID() + + function gadget:PlayerChanged(playerID) + if (playerID == Spring.GetMyPlayerID()) then + myAllyID = Spring.GetMyAllyTeamID() + end + end + + local function SpawnExplosion(_,px,py,pz, weaponID, ownerID) + if Script.LuaUI("GadgetWeaponExplosion") then + if ownerID ~= nil then + local _, _, _, teamID, allyID = Spring.GetPlayerInfo(ownerID) + + if (Spring.GetUnitAllyTeam(ownerID) == myAllyID or Spring.IsPosInLos(px, py, pz, myAllyID)) then + --if skipAirWeapons[weaponID] == nil or py ~= Spring.GetGroundHeight(px, py) then + Script.LuaUI.GadgetWeaponExplosion(px, py, pz, weaponID, ownerID) + --end + end + else + -- dont know when this happens and if we should show the explosion... + Script.LuaUI.GadgetWeaponExplosion(px, py, pz, weaponID) + end + end + end + + function gadget:Initialize() + gadgetHandler:AddSyncAction("explosion_light", SpawnExplosion) + end + + function gadget:Shutdown() + gadgetHandler.RemoveSyncAction("explosion_light") + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/gpumem_broadcast.lua b/LuaRules/Gadgets/gpumem_broadcast.lua new file mode 100644 index 000000000..7a6bd98e2 --- /dev/null +++ b/LuaRules/Gadgets/gpumem_broadcast.lua @@ -0,0 +1,101 @@ +local engineVersion = 100 -- just filled this in here incorrectly but old engines arent used anyway +if Engine and Engine.version then + local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results + end + engineVersion = Split(Engine.version, '-') + if engineVersion[2] ~= nil and engineVersion[3] ~= nil then + engineVersion = tonumber(string.gsub(engineVersion[1], '%.', '')..engineVersion[2]) + else + engineVersion = tonumber(Engine.version) + end +elseif Game and Game.version then + engineVersion = tonumber(Game.version) +end + +if (engineVersion < 1000 and engineVersion >= 105) or engineVersion >= 10401138 then + + function gadget:GetInfo() + return { + name = "GPU mem Broadcast", + desc = "Broadcasts GPU mem usage", + author = "Floris", + date = "May 2018", + layer = 0, + enabled = true, + } + end + + -------------------------------------------------------------------------------- + -- config + -------------------------------------------------------------------------------- + + local sendPacketEvery = 15 + + -------------------------------------------------------------------------------- + -- synced + -------------------------------------------------------------------------------- + if gadgetHandler:IsSyncedCode() then + + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationGpuMem = validation + + function gadget:RecvLuaMsg(msg, playerID) + if msg:sub(1,1)=="@" and msg:sub(2,3)==validation then + SendToUnsynced("gpumemBroadcast",playerID,tonumber(msg:sub(4))) + return true + end + end + + else + -------------------------------------------------------------------------------- + -- unsynced + -------------------------------------------------------------------------------- + + local GetLastUpdateSeconds = Spring.GetLastUpdateSeconds + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local validation = SYNCED.validationGpuMem + local updateTimer = 0 + + function gadget:Initialize() + gadgetHandler:AddSyncAction("gpumemBroadcast", handleEvent) + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("gpumemBroadcast") + end + + function handleEvent(_,playerID,mem) + if Script.LuaUI("GpuMemEvent") then + Script.LuaUI.GpuMemEvent(playerID,mem) + end + end + + function gadget:Update() + updateTimer = updateTimer + GetLastUpdateSeconds() + if updateTimer > sendPacketEvery then + local used, max = Spring.GetVidMemUsage() + if type(used) == 'number' and used > 0 then + SendLuaRulesMsg("@"..validation..math.ceil((used/max)*100)) + updateTimer = 0 + end + end + end + + end +end diff --git a/LuaRules/Gadgets/hotfixes.lua b/LuaRules/Gadgets/hotfixes.lua deleted file mode 100644 index 05900c940..000000000 --- a/LuaRules/Gadgets/hotfixes.lua +++ /dev/null @@ -1,123 +0,0 @@ - -function gadget:GetInfo() - return { - name = "Lua hotfixes", - desc = "Patch up bugs in Spring's Lua and the Gadget Handler", - author = "zwzsg & lurker", - date = "23rd of January 2010", - license = "Public Domain", - layer = 2000, - enabled = true - } -end - - --- Patching the Gadget Handler, --- Making calling RemoveGadget in GameFrame or Update safe --- Previously, that could make other gadget skip that frame - -do - local gadgetHandler = getfenv(0).gadgetHandler - - if not gadgetHandler.gracefulRemove then - - gadgetHandler.gracefulRemove = true - - local RemoveGadget = gadgetHandler.RemoveGadget - local Update = gadgetHandler.Update - - function gadgetHandler:GameFrame(frameNum) - self.catchRemove = true - for _,g in ipairs(self.GameFrameList) do - g:GameFrame(frameNum) - end - self.catchRemove = false - if self.removeList then - for _,g in ipairs(self.removeList) do - self:RemoveGadget(g) - end - end - end - - function gadgetHandler:Update() - self.catchRemove = true - for _,g in ipairs(self.UpdateList) do - g:Update() - end - self.catchRemove = false - if self.removeList then - for _,g in ipairs(self.removeList) do - self:RemoveGadget(g) - end - end - end - - function gadgetHandler:RemoveGadget(gadget) - if self.catchRemove then - self.removeList = self.removeList or {} - self.removeList[#self.removeList + 1] = gadget - else - RemoveGadget(self, gadget) - end - end - - end - -end - - - - -if (gadgetHandler:IsSyncedCode()) then - --SYNCED - - if not getfenv(0).AllowUnsafeChanges then - getfenv(0).AllowUnsafeChanges = function(...) end - end - - if not Spring.CreateUnitRulesParam then - Spring.CreateUnitRulesParams = function(u,t) - if type(u)=="number" and type(t)=="table" and type(t[1])=="table" then - for k,v in pairs(t[1]) do - Spring.SetUnitRulesParam(u,k,v) - end - end - end - end - - function gadget:Initialize() - if (Spring.GetGameFrame() or 0)>0 then - local gadgetHandler = getfenv(0).gadgetHandler - Spring.Echo("gadgetHandler:GameStart()") - gadgetHandler:GameStart() - for _,unitID in ipairs(Spring.GetAllUnits()) do - local unitDefID, unitTeam, builderID = Spring.GetUnitDefID(unitID), Spring.GetUnitTeam(unitID), nil - gadgetHandler:UnitCreated(unitID, unitDefID, unitTeam, builderID) - Spring.Echo("gadgetHandler:UnitCreated(",unitID, unitDefID, unitTeam, builderID, ")") - if (select(5,Spring.GetUnitHealth(unitID)) or 0)>=1 then - Spring.Echo("gadgetHandler:UnitFinished(",unitID, unitDefID, unitTeam, ")") - gadgetHandler:UnitFinished(unitID, unitDefID, unitTeam) - end - end - end - end - -else - -- UNSYNCED - - -- Fix gl.Text y offset that changed between 0.80.0 and 0.80.1 - --if (tonumber(string.sub(Game.version,1,3) or 0) or 0)>=0.80 and (tonumber(string.sub(Game.version,6,6) or 0) or 0)>=1 then - -- local glText = gl.Text - -- gl.Text = function(text,x,y,size,options) - -- if (not size) or string.match(options,"[atvdb]") then - -- glText(text,x,y,size,options) - -- else - -- glText(text,x,y,size,"d"..(options or "")) - -- end - -- end - --end - -end - - - diff --git a/LuaRules/Gadgets/include/IterableMap.lua b/LuaRules/Gadgets/include/IterableMap.lua new file mode 100644 index 000000000..4b428faf2 --- /dev/null +++ b/LuaRules/Gadgets/include/IterableMap.lua @@ -0,0 +1,137 @@ +local IterableMap = {} + +function IterableMap.New() + + local indexByKey = {} + local dataByKey = {} + local indexMax = 0 + local unusedKey = 1 + local keyByIndex = {} + + local api = {} + + function api.GetUnusedKey() + while api.InMap(unusedKey) do + unusedKey = unusedKey + 1 + end + return unusedKey + end + + function api.Add(key, data) + if not key then + return + end + if indexByKey[key] then + -- Overwrites + dataByKey[key] = data + return + end + indexMax = indexMax + 1 + keyByIndex[indexMax] = key + dataByKey[key] = data + indexByKey[key] = indexMax + end + + function api.Remove(key) + if (not key) or (not indexByKey[key]) then + return + end + local myIndex = indexByKey[key] + local endKey = keyByIndex[indexMax] + + keyByIndex[myIndex] = endKey + indexByKey[endKey] = myIndex + keyByIndex[indexMax] = nil + indexByKey[key] = nil + dataByKey[key] = nil + indexMax = indexMax - 1 + end + + function api.ReplaceKey(oldKey, newKey) + if (not oldKey) or (not indexByKey[oldKey]) or indexByKey[newKey] then + return false + end + + keyByIndex[indexByKey[oldKey]] = newKey + indexByKey[newKey] = indexByKey[oldKey] + dataByKey[newKey] = dataByKey[oldKey] + + indexByKey[oldKey] = nil + dataByKey[oldKey] = nil + return true + end + + -- Get is also set in the case of tables because tables pass by reference + function api.Get(key) + return dataByKey[key] + end + + function api.Set(key, data) + if not indexByKey[key] then + Add(key, data) + else + dataByKey[key] = data + end + end + + function api.InMap(key) + return (indexByKey[key] and true) or false + end + + -- To use Iterator, write "for unitID, data in interableMap.Iterator() do" + -- This approach makes the garbage collector cry so try to use other methods + -- of iteration. + function api.Iterator() + local i = 0 + return function () + i = i + 1 + if i <= indexMax then + return keyByIndex[i], dataByKey[keyByIndex[i]] + end + end + end + + -- Does the function to every element of the map. A less barbaric method + -- of iteration. Recommended for cleanliness and speed. + -- Using the third argument, index, is a little evil because index should + -- be private. + function api.Apply(funcToApply, ...) + local i = 1 + while i <= indexMax do + local key = keyByIndex[i] + if funcToApply(key, dataByKey[key], i, ...) then + -- Return true to remove element + api.Remove(key) + else + i = i + 1 + end + end + end + + function api.ApplyNoArg(funcToApply) + local i = 1 + while i <= indexMax do + local key = keyByIndex[i] + if funcToApply(key, dataByKey[key], i) then + -- Return true to remove element + api.Remove(key) + else + i = i + 1 + end + end + end + + + -- This 'method' of iteration is for barbarians. Seems to have performance + -- similar to Apply. + function api.GetIndexMax() + return indexMax + end + function api.GetKeyByIndex(index) + return keyByIndex[index] + end + + return api +end + +return IterableMap \ No newline at end of file diff --git a/LuaRules/Gadgets/include/LuaShader.lua b/LuaRules/Gadgets/include/LuaShader.lua new file mode 100644 index 000000000..1501a513c --- /dev/null +++ b/LuaRules/Gadgets/include/LuaShader.lua @@ -0,0 +1,468 @@ +local UNIFORM_TYPE_MIXED = 0 -- includes arrays; float or int +local UNIFORM_TYPE_INT = 1 -- includes arrays +local UNIFORM_TYPE_FLOAT = 2 -- includes arrays +local UNIFORM_TYPE_FLOAT_MATRIX = 3 + +local glGetUniformLocation = gl.GetUniformLocation +local glUseShader = gl.UseShader +local glActiveShader = gl.ActiveShader +local glUniform = gl.Uniform +local glUniformInt = gl.UniformInt +local glUniformMatrix = gl.UniformMatrix +local glUniformArray = gl.UniformArray + +local function new(class, shaderParams, shaderName, logEntries) + local logEntriesSanitized + if type(logEntries) == "number" then + logEntriesSanitized = logEntries + else + logEntriesSanitized = 1 + end + + return setmetatable( + { + shaderName = shaderName or "Unnamed Shader", + shaderParams = shaderParams or {}, + logEntries = logEntriesSanitized, + logHash = {}, + shaderObj = nil, + active = false, + ignoreActive = false, + ignoreUnkUniform = false, + uniforms = {}, + }, class) +end + +local function IsGeometryShaderSupported() + return gl.HasExtension("GL_ARB_geometry_shader4") and (gl.SetShaderParameter ~= nil or gl.SetGeometryShaderParameter ~= nil) +end + +local function IsTesselationShaderSupported() + return gl.HasExtension("GL_ARB_tessellation_shader") and (gl.SetTesselationShaderParameter ~= nil) +end + +local function IsDeferredShadingEnabled() + return (Spring.GetConfigInt("AllowDeferredMapRendering") == 1) and (Spring.GetConfigInt("AllowDeferredModelRendering") == 1) and (Spring.GetConfigInt("AdvMapShading") == 1) +end + +local function GetAdvShadingActive() + local advUnitShading, advMapShading = Spring.HaveAdvShading() + if advMapShading == nil then + advMapShading = true + end --old engine + return advUnitShading and advMapShading +end + + +local LuaShader = setmetatable({}, { + __call = function(self, ...) return new(self, ...) end, + }) +LuaShader.__index = LuaShader +LuaShader.isGeometryShaderSupported = IsGeometryShaderSupported() +LuaShader.isTesselationShaderSupported = IsTesselationShaderSupported() +LuaShader.isDeferredShadingEnabled = IsDeferredShadingEnabled() +LuaShader.GetAdvShadingActive = GetAdvShadingActive + +-----------------============ Warnings & Error Gandling ============----------------- +function LuaShader:OutputLogEntry(text, isError) + local message + + local warnErr = (isError and "error") or "warning" + + message = string.format("LuaShader: [%s] shader %s(s):\n%s", self.shaderName, warnErr, text) + + if self.logHash[message] == nil then + self.logHash[message] = 0 + end + + if self.logHash[message] <= self.logEntries then + local newCnt = self.logHash[message] + 1 + self.logHash[message] = newCnt + if (newCnt == self.logEntries) then + message = message .. string.format("\nSupressing further %s of the same kind", warnErr) + end + Spring.Echo(message) + end +end + +function LuaShader:ShowWarning(text) + self:OutputLogEntry(text, false) +end + +function LuaShader:ShowError(text) + self:OutputLogEntry(text, true) +end + +-----------------============ Handle Ghetto Include<> ==============----------------- +local includeRegexps = { + '.-#include <(.-)>.-', + '.-#include \"(.-)\".-', + '.-#pragma(%s+)include <(.-)>.-', + '.-#pragma(%s+)include \"(.-)\".-', +} + +function LuaShader:HandleIncludes(shaderCode, shaderName) + local incFiles = {} + local t1 = Spring.GetTimer() + repeat + local incFile + local regEx + for _, rx in ipairs(includeRegexps) do + _, _, incFile = string.find(shaderCode, rx) + if incFile then + regEx = rx + break + end + end + + Spring.Echo(shaderName, incFile) + + if incFile then + shaderCode = string.gsub(shaderCode, regEx, '', 1) + table.insert(incFiles, incFile) + end + until (incFile == nil) + local t2 = Spring.GetTimer() + Spring.Echo(Spring.DiffTimers(t2, t1, true)) + + local includeText = "" + for _, incFile in ipairs(incFiles) do + if VFS.FileExists(incFile) then + includeText = includeText .. VFS.LoadFile(incFile) .. "\n" + else + self:ShowError(string.format("Attempt to execute %s with file that does not exist in VFS", incFile)) + return false + end + end + + if includeText ~= "" then + return includeText .. shaderCode + else + return shaderCode + end +end + +-----------------========= End of Handle Ghetto Include<> ==========----------------- + +-----------------============ General LuaShader methods ============----------------- +function LuaShader:Compile() + if not gl.CreateShader then + self:ShowError("GLSL Shaders are not supported by hardware or drivers") + return false + end + +-- LuaShader:HandleIncludes is too slow. Figure out faster way. +--[[ + for _, shaderType in ipairs({"vertex", "tcs", "tes", "geometry", "fragment"}) do + if self.shaderParams[shaderType] then + local newShaderCode = LuaShader:HandleIncludes(self.shaderParams[shaderType], self.shaderName) + if newShaderCode then + self.shaderParams[shaderType] = newShaderCode + end + end + end +]]-- + + self.shaderObj = gl.CreateShader(self.shaderParams) + local shaderObj = self.shaderObj + + local shLog = gl.GetShaderLog() or "" + + if not shaderObj then + self:ShowError(shLog) + return false + elseif (shLog ~= "") then + self:ShowWarning(shLog) + end + + local uniforms = self.uniforms + for idx, info in ipairs(gl.GetActiveUniforms(shaderObj)) do + local uniName = string.gsub(info.name, "%[0%]", "") -- change array[0] to array + uniforms[uniName] = { + location = glGetUniformLocation(shaderObj, uniName), + --type = info.type, + --size = info.size, + values = {}, + } + --Spring.Echo(uniName, uniforms[uniName].location, uniforms[uniName].type, uniforms[uniName].size) + --Spring.Echo(uniName, uniforms[uniName].location) + end + return true +end + +LuaShader.Initialize = LuaShader.Compile + +function LuaShader:GetHandle() + if self.shaderObj ~= nil then + return self.shaderObj + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()?", funcName)) + end +end + +function LuaShader:Delete() + if self.shaderObj ~= nil then + gl.DeleteShader(self.shaderObj) + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + end +end + +LuaShader.Finalize = LuaShader.Delete + +function LuaShader:Activate() + if self.shaderObj ~= nil then + self.active = true + return glUseShader(self.shaderObj) + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + return false + end +end + +function LuaShader:SetActiveStateIgnore(flag) + self.ignoreActive = flag +end + +function LuaShader:SetUnknownUniformIgnore(flag) + self.ignoreUnkUniform = flag +end + + +function LuaShader:ActivateWith(func, ...) + if self.shaderObj ~= nil then + self.active = true + glActiveShader(self.shaderObj, func, ...) + self.active = false + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + end +end + +function LuaShader:Deactivate() + self.active = false + glUseShader(0) +end +-----------------============ End of general LuaShader methods ============----------------- + + +-----------------============ Friend LuaShader functions ============----------------- +local function getUniformImpl(self, name) + local uniform = self.uniforms[name] + + if uniform and type(uniform) == "table" then + return uniform + elseif uniform == nil then --used for indexed elements. nil means not queried for location yet + local location = glGetUniformLocation(self.shaderObj, name) + if location and location > -1 then + self.uniforms[name] = { + location = location, + values = {}, + } + return self.uniforms[name] + else + self.uniforms[name] = false --checked dynamic uniform name and didn't find it + end + end + + -- (uniform == false) + return nil +end + +local function getUniform(self, name) + if not (self.active or self.ignoreActive) then + self:ShowError(string.format("Trying to set uniform [%s] on inactive shader object. Did you use :Activate() or :ActivateWith()?", name)) + return nil + end + local uniform = getUniformImpl(self, name) + if not (uniform ~= nil or self.ignoreUnkUniform) then + self:ShowWarning(string.format("Attempt to set uniform [%s], which does not exist in the compiled shader", name)) + return nil + end + return uniform +end + +local function isUpdateRequired(uniform, tbl) + if (#tbl == 1) and (type(tbl[1]) == "string") then --named matrix + return true --no need to update cache + end + + local update = false + local cachedValues = uniform.values + for i, val in ipairs(tbl) do + if cachedValues[i] ~= val then + cachedValues[i] = val --update cache + update = true + end + end + + return update +end +-----------------============ End of friend LuaShader functions ============----------------- + + +-----------------============ LuaShader uniform manipulation functions ============----------------- +-- TODO: do it safely with types, len, size check + +function LuaShader:GetUniformLocation(name) + return (getUniform(self, name) or {}).location or -1 +end + +--FLOAT UNIFORMS +local function setUniformAlwaysImpl(uniform, ...) + glUniform(uniform.location, ...) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformAlwaysImpl(uniform, ...) +end + +local function setUniformImpl(uniform, ...) + if isUpdateRequired(uniform, {...}) then + return setUniformAlwaysImpl(uniform, ...) + end + return true +end + +function LuaShader:SetUniform(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformImpl(uniform, ...) +end + +LuaShader.SetUniformFloat = LuaShader.SetUniform +LuaShader.SetUniformFloatAlways = LuaShader.SetUniformAlways + + +--INTEGER UNIFORMS +local function setUniformIntAlwaysImpl(uniform, ...) + glUniformInt(uniform.location, ...) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformIntAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntAlwaysImpl(uniform, ...) +end + +local function setUniformIntImpl(uniform, ...) + if isUpdateRequired(uniform, {...}) then + return setUniformIntAlwaysImpl(uniform, ...) + end + return true +end + +function LuaShader:SetUniformInt(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntImpl(uniform, ...) +end + + +--FLOAT ARRAY UNIFORMS +local function setUniformFloatArrayAlwaysImpl(uniform, tbl) + glUniformArray(uniform.location, UNIFORM_TYPE_FLOAT, tbl) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformFloatArrayAlways(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformFloatArrayAlwaysImpl(uniform, tbl) +end + +local function setUniformFloatArrayImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformFloatArrayAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformFloatArray(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformFloatArrayImpl(uniform, tbl) +end + + +--INT ARRAY UNIFORMS +local function setUniformIntArrayAlwaysImpl(uniform, tbl) + glUniformArray(uniform.location, UNIFORM_TYPE_INT, tbl) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformIntArrayAlways(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntArrayAlwaysImpl(uniform, tbl) +end + +local function setUniformIntArrayImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformIntArrayAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformIntArray(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntArrayImpl(uniform, tbl) +end + + +--MATRIX UNIFORMS +local function setUniformMatrixAlwaysImpl(uniform, tbl) + glUniformMatrix(uniform.location, unpack(tbl)) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformMatrixAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformMatrixAlwaysImpl(uniform, {...}) +end + +local function setUniformMatrixImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformMatrixAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformMatrix(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformMatrixImpl(uniform, {...}) +end +-----------------============ End of LuaShader uniform manipulation functions ============----------------- + +return LuaShader \ No newline at end of file diff --git a/LuaRules/Gadgets/lups_cloak_fx.lua b/LuaRules/Gadgets/lups_cloak_fx.lua new file mode 100644 index 000000000..f557a5209 --- /dev/null +++ b/LuaRules/Gadgets/lups_cloak_fx.lua @@ -0,0 +1,301 @@ +-- $Id: lups_manager.lua 3171 2008-11-06 09:06:29Z det $ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- author: jK +-- +-- Copyright (C) 2007,2008. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- UNSYNCED ONLY +if gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + + +function gadget:GetInfo() + return { + name = "Lups Cloak FX", + desc = "", + author = "jK", + date = "Apr, 2008", + license = "GNU GPL, v2 or later", + layer = 10, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- speed ups + some table functions +-- + +--local tinsert = table.insert +local tinsert = function(tab, insert) + tab[#tab+1] = insert +end + +local type = type +local pairs = pairs + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local Lups --// Lua Particle System +local particleIDs = {} +local initialized = false --// if LUPS isn't started yet, we try it once a gameframe later +local tryloading = 1 --// try to activate lups if it isn't found + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- «« some basic functions »» +-- + +local supportedFxs = {} +local function fxSupported(fxclass) + if (supportedFxs[fxclass]~=nil) then + return supportedFxs[fxclass] + else + supportedFxs[fxclass] = Lups.HasParticleClass(fxclass) + return supportedFxs[fxclass] + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- «« cloaked unit handling »» +-- + +local CloakedHitEffect = { class='UnitJitter',options={ life=50, pos={0,0,0}, enemyHit=true, repeatEffect=false} } +local CloakEffect = { + { class='UnitCloaker',options={ life=50 } }, + { class='UnitJitter',options={ delay=24, life=math.huge } }, + { class='Sound',options={ file="sounds/miscfx/cloak.wav",volume=0.25 } }, +} +local EnemyCloakEffect = { + { class='UnitCloaker',options={ life=20 } }, + { class='Sound',options={ file="sounds/miscfx/cloak.wav",volume=0.25 } }, +} + +local DecloakEffect = { + { class='UnitCloaker',options={ inverse=true, life=50 } }, + { class='UnitJitter',options={ life=24 } }, + { class='Sound',options={ file="sounds/miscfx/cloak.wav",volume=0.25 } }, +} +local EnemyDecloakEffect = { + { class='UnitCloaker',options={ inverse=true, life=60 } }, + { class='Sound',options={ file="sounds/miscfx/cloak.wav",volume=0.25 } }, +} + +--[[ Units are actually decloaked when damaged so this part is not required +local function UnitDamaged(_,unitID,unitDefID,teamID) + local allyTeamID = Spring.GetUnitAllyTeam(unitID) + + local LocalAllyTeamID + local _, specFullView = Spring.GetSpectatingState() + if (specFullView) then + LocalAllyTeamID = allyTeamID + else + LocalAllyTeamID = Spring.GetLocalAllyTeamID() + end + + if (Spring.GetUnitIsCloaked(unitID))and(allyTeamID~=LocalAllyTeamID) then + + if (particleIDs[unitID]) then + for _,fxID in ipairs(particleIDs[unitID]) do + Lups.RemoveParticles(fxID) + end + end + + particleIDs[unitID] = {} + CloakedHitEffect.options.unit = unitID + CloakedHitEffect.options.team = teamID + CloakedHitEffect.options.unitDefID = unitDefID + tinsert( particleIDs[unitID],Lups.AddParticles(CloakedHitEffect.class,CloakedHitEffect.options) ) + end +end +--]] + +function gadget:UnitCloaked(unitID,unitDefID,teamID) + local allyTeamID = Spring.GetUnitAllyTeam(unitID) + + local LocalAllyTeamID + local _, specFullView = Spring.GetSpectatingState() + if (specFullView) then + LocalAllyTeamID = allyTeamID + else + LocalAllyTeamID = Spring.GetLocalAllyTeamID() + end + + if (particleIDs[unitID]) then + for i=1,#particleIDs[unitID] do + Lups.RemoveParticles(particleIDs[unitID][i]) + end + end + particleIDs[unitID] = {} + if (LocalAllyTeamID==allyTeamID) then + if Lups then + for i=1,#CloakEffect do + local fx = CloakEffect[i] + fx.options.unit = unitID + fx.options.unitDefID = unitDefID + fx.options.team = teamID + fx.options.allyTeam = allyTeamID + tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) + end + end + else + if Lups then + for i=1,#EnemyCloakEffect do + local fx = EnemyCloakEffect[i] + fx.options.unit = unitID + fx.options.unitDefID = unitDefID + fx.options.team = teamID + fx.options.allyTeam = allyTeamID + tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) + end + end + end + +end + +function gadget:UnitDecloaked(unitID,unitDefID,teamID) + local allyTeamID = Spring.GetUnitAllyTeam(unitID) + + local LocalAllyTeamID + local _, specFullView = Spring.GetSpectatingState() + if (specFullView) then + LocalAllyTeamID = allyTeamID + else + LocalAllyTeamID = Spring.GetLocalAllyTeamID() + end + + if (particleIDs[unitID]) then + for i=1,#particleIDs[unitID] do + Lups.RemoveParticles(particleIDs[unitID][i]) + end + end + particleIDs[unitID] = {} + if (LocalAllyTeamID==allyTeamID) then + for i=1,#DecloakEffect do + local fx = DecloakEffect[i] + fx.options.unit = unitID + fx.options.unitDefID = unitDefID + fx.options.team = teamID + fx.options.allyTeam = allyTeamID + tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) + end + else + for i=1,#EnemyDecloakEffect do + local fx = EnemyDecloakEffect[i] + fx.options.unit = unitID + fx.options.unitDefID = unitDefID + fx.options.team = teamID + fx.options.allyTeam = allyTeamID + tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) + end + end +end + +function gadget:UnitGiven(unitID, unitDefID, teamID, oldTeamID) + if (Spring.GetUnitIsCloaked(unitID)) then + gadget:UnitCloaked(unitID,unitDefID,teamID) + end +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- «« Unit Destroyed handling »» +-- + +function gadget:UnitDestroyed(unitID,unitDefID) + if (particleIDs[unitID]) then + local effects = particleIDs[unitID] + for i=1,#effects do + Lups.RemoveParticles(effects[i]) + end + particleIDs[unitID] = nil + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:PlayerChanged(playerID) + if (playerID == Spring.GetMyPlayerID()) then + --// this should reset the cloak fx when becoming a spec + --gadget.Update = ReinitializeUnitFX + gadgetHandler:UpdateCallIn("Update") + end +end + +local function ReinitializeUnitFX() + --// clear old FXs + for _,unitFxIDs in pairs(particleIDs) do + for i=1,#unitFxIDs do + Lups.RemoveParticles(unitFxIDs[i]) + end + end + particleIDs = {} + + --// initialize effects for existing units + local allUnits = Spring.GetAllUnits(); + for i=1,#allUnits do + local unitID = allUnits[i] + if (Spring.GetUnitIsCloaked(unitID)) then + local unitDefID = Spring.GetUnitDefID(unitID) + local teamID = Spring.GetUnitTeam(unitID) + gadget:UnitCloaked(unitID,unitDefID,teamID) + end + end + + gadgetHandler:RemoveCallIn("Update") +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:Update() + if (Spring.GetGameFrame()<1) then + return + end + + Lups = GG['Lups'] + + if (Lups) then + initialized = true + else + return + end + + gadget.Update = ReinitializeUnitFX + gadgetHandler:UpdateCallIn("Update") +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:Shutdown() + + if (initialized) then + for _,unitFxIDs in pairs(particleIDs) do + for i=1,#unitFxIDs do + Lups.RemoveParticles(unitFxIDs[i]) + end + end + particleIDs = {} + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + diff --git a/LuaRules/Gadgets/lups_flame_jitter.lua b/LuaRules/Gadgets/lups_flame_jitter.lua index 6856238e2..01a0fab49 100644 --- a/LuaRules/Gadgets/lups_flame_jitter.lua +++ b/LuaRules/Gadgets/lups_flame_jitter.lua @@ -10,7 +10,7 @@ function gadget:GetInfo() date = "Apr, 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true, -- loaded by default? + enabled = false, -- loaded by default? } end @@ -84,8 +84,7 @@ else local posx,posy,posz, dirx,diry,dirz = Spring.GetUnitWeaponVectors(unitID,weapon) local wd = WeaponDefs[UnitDefs[unitDefID].weapons[weapon].weaponDef] - local weaponRange = wd.range*wd.duration - local weaponVelocity = wd.projectilespeed + local weaponRange = wd.range*wd.duration*15 local speedx,speedy,speedz = Spring.GetUnitVelocity(unitID) local partpos = "x*delay,y*delay,z*delay|x="..speedx..",y="..speedy..",z="..speedz @@ -96,7 +95,7 @@ else class = 'JitterParticles2', colormap = { {1,1,1,1},{1,1,1,1} }, count = 6, - life = weaponRange / 6, + life = weaponRange / 12, delaySpread = 25, force = {0,1.5,0}, --forceExp = 0.2, @@ -107,7 +106,7 @@ else emitVector = {dirx,diry,dirz}, emitRotSpread= 10, - speed = 7, + speed = 10, speedSpread = 0, speedExp = 1.5, @@ -120,6 +119,78 @@ else } particleCnt = particleCnt + 1 + particleList[particleCnt] = { + class = 'SimpleParticles2', + colormap = { {1, 1, 1, 0.01}, + {1, 1, 1, 0.01}, + {0.75, 0.5, 0.5, 0.01}, + {0.35, 0.15, 0.15, 0.25}, + {0.1, 0.035, 0.01, 0.2}, + {0, 0, 0, 0.01} }, + count = 4, + life = weaponRange / 12, + delaySpread = 25, + + force = {0,1,0}, + --forceExp = 0.2, + + partpos = partpos, + pos = {posx,posy,posz}, + + emitVector = {dirx,diry,dirz}, + emitRotSpread= 8, + + rotSpeed = 1, + rotSpread = 360, + rotExp = 9, + + speed = 10, + speedSpread = 0, + speedExp = 1.5, + + size = 2, + sizeGrowth = 4.0, + sizeExp = 0.7, + + --texture = "bitmaps/smoke/smoke06.tga", + texture = altFlameTexture and "bitmaps/GPL/flame_alt.png" or "bitmaps/GPL/flame.png", + } + particleCnt = particleCnt + 1 + + particleList[particleCnt] = { + class = 'SimpleParticles2', + colormap = { {1, 1, 1, 0.01}, {0, 0, 0, 0.01} }, + count = 20, + --delay = 20, + life = weaponRange / 48, + lifeSpread = 20, + delaySpread = 15, + + force = {0,1,0}, + --forceExp = 0.2, + + partpos = partpos, + pos = {posx,posy,posz}, + + emitVector = {dirx,diry,dirz}, + emitRotSpread= 3, + + rotSpeed = 1, + rotSpread = 360, + rotExp = 9, + + speed = 10, + speedSpread = 0, + + size = 2, + sizeGrowth = 4.0, + sizeExp = 0.65, + + --texture = "bitmaps/smoke/smoke06.tga", + texture = altFlameTexture and "bitmaps/GPL/flame_alt.png" or "bitmaps/GPL/flame.png", + } + particleCnt = particleCnt + 1 + end function GameFrame() diff --git a/LuaRules/Gadgets/lups_manager.lua b/LuaRules/Gadgets/lups_manager.lua deleted file mode 100644 index e50f42450..000000000 --- a/LuaRules/Gadgets/lups_manager.lua +++ /dev/null @@ -1,341 +0,0 @@ --- $Id: lups_manager.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- author: jK --- --- Copyright (C) 2007,2008. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function gadget:GetInfo() - return { - name = "LupsSyncedManager", - desc = "", - author = "jK", - date = "Apr, 2008", - license = "GNU GPL, v2 or later", - layer = 10, - enabled = true, - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- __ _ _ _ --- (_ \ / |\ | / |_ | \ --- __) | | \| \_ |_ |_/ --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (gadgetHandler:IsSyncedCode()) then - - local spGetUnitIsCloaked = Spring.GetUnitIsCloaked - function gadget:UnitDamaged(unitID,unitDefID,teamID) - if (spGetUnitIsCloaked(unitID)) then - SendToUnsynced("lups_unit_cloakeddamaged", unitID, unitDefID, teamID) - end - end - - function gadget:UnitDestroyed(unitID,unitDefID) - SendToUnsynced("lups_unit_destroyed", unitID, unitDefID) - end - - - function gadget:UnitCloaked(unitID,unitDefID,teamID) - SendToUnsynced("lups_unit_cloaked", unitID,unitDefID,teamID) - end - function gadget:UnitDecloaked(unitID,unitDefID,teamID) - SendToUnsynced("lups_unit_decloaked", unitID,unitDefID,teamID) - end - - function gadget:PlayerChanged(playerID) - SendToUnsynced("lups_player_changed", playerID) - end - -else - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- __ _ _ _ --- | | |\ | (_ \ / |\ | / |_ | \ --- |_| | \| __) | | \| \_ |_ |_/ --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- speed ups + some table functions --- - -local tinsert = table.insert -local type = type -local pairs = pairs - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Lups --// Lua Particle System -local particleIDs = {} -local initialized = false --// if LUPS isn't started yet, we try it once a gameframe later -local tryloading = 1 --// try to activate lups if it isn't found - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- «« some basic functions »» --- - -local supportedFxs = {} -local function fxSupported(fxclass) - if (supportedFxs[fxclass]~=nil) then - return supportedFxs[fxclass] - else - supportedFxs[fxclass] = Lups.HasParticleClass(fxclass) - return supportedFxs[fxclass] - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- «« cloaked unit handling »» --- - -local CloakedHitEffect = { class='UnitJitter',options={ life=50, pos={0,0,0}, enemyHit=true, repeatEffect=false} } -local CloakEffect = { - { class='UnitCloaker',options={ life=50 } }, - { class='UnitJitter',options={ delay=24, life=math.huge } }, - { class='Sound',options={ file="sounds/cloak.wav",volume=0.9 } }, -} -local EnemyCloakEffect = { - { class='UnitCloaker',options={ life=20 } }, - { class='Sound',options={ file="sounds/cloak.wav",volume=0.9 } }, -} - -local DecloakEffect = { - { class='UnitCloaker',options={ inverse=true, life=50 } }, - { class='UnitJitter',options={ life=24 } }, - { class='Sound',options={ file="sounds/cloak.wav",volume=0.9 } }, -} -local EnemyDecloakEffect = { - { class='UnitCloaker',options={ inverse=true, life=60 } }, - { class='Sound',options={ file="sounds/cloak.wav",volume=0.9 } }, -} - ---[[ -local function UnitDamaged(_,unitID,unitDefID,teamID) - local allyTeamID = Spring.GetUnitAllyTeam(unitID) - - local LocalAllyTeamID - local _, specFullView = Spring.GetSpectatingState() - if (specFullView) then - LocalAllyTeamID = allyTeamID - else - LocalAllyTeamID = Spring.GetLocalAllyTeamID() - end - - if (Spring.GetUnitIsCloaked(unitID))and(allyTeamID~=LocalAllyTeamID) then - - if (particleIDs[unitID]) then - for _,fxID in ipairs(particleIDs[unitID]) do - Lups.RemoveParticles(fxID) - end - end - - particleIDs[unitID] = {} - CloakedHitEffect.options.unit = unitID - CloakedHitEffect.options.team = teamID - CloakedHitEffect.options.unitDefID = unitDefID - tinsert( particleIDs[unitID],Lups.AddParticles(CloakedHitEffect.class,CloakedHitEffect.options) ) - end -end ---]] - -local function UnitCloaked(_,unitID,unitDefID,teamID) - local allyTeamID = Spring.GetUnitAllyTeam(unitID) - - local LocalAllyTeamID - local _, specFullView = Spring.GetSpectatingState() - if (specFullView) then - LocalAllyTeamID = allyTeamID - else - LocalAllyTeamID = Spring.GetLocalAllyTeamID() - end - - if (particleIDs[unitID]) then - for _,fxID in ipairs(particleIDs[unitID]) do - Lups.RemoveParticles(fxID) - end - end - particleIDs[unitID] = {} - if (LocalAllyTeamID==allyTeamID) then - for i=1,#CloakEffect do - local fx = CloakEffect[i] - fx.options.unit = unitID - fx.options.unitDefID = unitDefID - fx.options.team = teamID - fx.options.allyTeam = allyTeamID - tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) - end - else - for i=1,#EnemyCloakEffect do - local fx = EnemyCloakEffect[i] - fx.options.unit = unitID - fx.options.unitDefID = unitDefID - fx.options.team = teamID - fx.options.allyTeam = allyTeamID - tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) - end - end - -end - - -local function UnitDecloaked(_,unitID,unitDefID,teamID) - local allyTeamID = Spring.GetUnitAllyTeam(unitID) - - local LocalAllyTeamID - local _, specFullView = Spring.GetSpectatingState() - if (specFullView) then - LocalAllyTeamID = allyTeamID - else - LocalAllyTeamID = Spring.GetLocalAllyTeamID() - end - - if (particleIDs[unitID]) then - for _,fxID in ipairs(particleIDs[unitID]) do - Lups.RemoveParticles(fxID) - end - end - particleIDs[unitID] = {} - if (LocalAllyTeamID==allyTeamID) then - for i=1,#DecloakEffect do - local fx = DecloakEffect[i] - fx.options.unit = unitID - fx.options.unitDefID = unitDefID - fx.options.team = teamID - fx.options.allyTeam = allyTeamID - tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) - end - else - for i=1,#EnemyDecloakEffect do - local fx = EnemyDecloakEffect[i] - fx.options.unit = unitID - fx.options.unitDefID = unitDefID - fx.options.team = teamID - fx.options.allyTeam = allyTeamID - tinsert( particleIDs[unitID],Lups.AddParticles(fx.class,fx.options) ) - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- «« Unit Destroyed handling »» --- - -local function UnitDestroyed(_,unitID,unitDefID) - if (particleIDs[unitID]) then - local effects = particleIDs[unitID] - for i=1,#effects do - Lups.RemoveParticles(effects[i]) - end - particleIDs[unitID] = nil - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function PlayerChanged(_,playerID) - if (playerID == Spring.GetMyPlayerID()) then - --// this should reset the cloak fx when becoming a spec - --gadget.Update = ReinitializeUnitFX - gadgetHandler:UpdateCallIn("Update") - end -end - -local function ReinitializeUnitFX() - --// clear old FXs - for _,unitFxIDs in pairs(particleIDs) do - for _,fxID in ipairs(unitFxIDs) do - Lups.RemoveParticles(fxID) - end - end - particleIDs = {} - - --// initialize effects for existing units - local allUnits = Spring.GetAllUnits(); - for i=1,#allUnits do - local unitID = allUnits[i] - if (Spring.GetUnitIsCloaked(unitID)) then - local unitDefID = Spring.GetUnitDefID(unitID) - local teamID = Spring.GetUnitTeam(unitID) - UnitCloaked(nil,unitID,unitDefID,teamID) - end - end - - gadgetHandler:RemoveCallIn("Update") -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:Update() - if (Spring.GetGameFrame()<1) then - return - end - - Lups = GG['Lups'] - - if (Lups) then - --gadgetHandler:AddSyncAction("lups_unit_cloakeddamaged", UnitDamaged) - gadgetHandler:AddSyncAction("lups_unit_cloaked", UnitCloaked) - gadgetHandler:AddSyncAction("lups_unit_decloaked", UnitDecloaked) - gadgetHandler:AddSyncAction("lups_unit_destroyed", UnitDestroyed) - - gadgetHandler:AddSyncAction("lups_luaui", LupsLuaUI) - gadgetHandler:AddSyncAction("lups_unit_created", UnitCreated) - gadgetHandler:AddSyncAction("lups_player_changed", PlayerChanged) - - initialized=true - else - return - end - - gadget.Update = ReinitializeUnitFX - gadgetHandler:UpdateCallIn("Update") -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:Shutdown() - gadgetHandler:RemoveSyncAction("lups_unit_cloakeddamaged") - gadgetHandler:RemoveSyncAction("lups_unit_cloaked") - gadgetHandler:RemoveSyncAction("lups_unit_decloaked") - gadgetHandler:RemoveSyncAction("lups_unit_destroyed") - - gadgetHandler:RemoveSyncAction("lups_luaui") - gadgetHandler:RemoveSyncAction("lups_unit_created") - gadgetHandler:RemoveSyncAction("lups_player_changed") - - if (initialized) then - for _,unitFxIDs in pairs(particleIDs) do - for _,fxID in ipairs(unitFxIDs) do - Lups.RemoveParticles(fxID) - end - end - particleIDs = {} - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -end diff --git a/LuaRules/Gadgets/lups_nano_spray.lua b/LuaRules/Gadgets/lups_nano_spray.lua index 4f4bdcb91..479fdbd02 100644 --- a/LuaRules/Gadgets/lups_nano_spray.lua +++ b/LuaRules/Gadgets/lups_nano_spray.lua @@ -10,13 +10,13 @@ function gadget:GetInfo() date = "2008-2012", license = "GNU GPL, v2 or later", layer = 0, - enabled = not (Game.version:find('91.0') and (Game.version:find('91.0.1') == nil)) + enabled = true } end local spGetFactoryCommands = Spring.GetFactoryCommands -local spGetUnitCommands = Spring.GetUnitCommands +local spGetCommandQueue = Spring.GetCommandQueue local function GetCmdTag(unitID) local cmdTag = 0 @@ -28,7 +28,7 @@ local function GetCmdTag(unitID) end end if cmdTag == 0 then - local cmds = spGetUnitCommands(unitID,1) + local cmds = spGetCommandQueue(unitID,1) if (cmds) then local cmd = cmds[1] if cmd then @@ -45,26 +45,6 @@ end if (gadgetHandler:IsSyncedCode()) then ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- - local registeredBuilders = {} - function gadget:GameFrame(...) - SendToUnsynced("nano_GameFrame", ...) - end - - function gadget:UnitFinished(uid, udid) - if (UnitDefs[udid].isBuilder) and not registeredBuilders[uid] then - SendToUnsynced("nano_BuilderFinished", uid) - registeredBuilders[uid] = nil - end - end - - function gadget:UnitDestroyed(uid, udid) - if (UnitDefs[udid].isBuilder) and registeredBuilders[uid] then - SendToUnsynced("nano_BuilderDestroyed", uid) - registeredBuilders[uid] = nil - end - end - - --// bw-compability local alreadyWarned = 0 local function WarnDeprecated() @@ -212,7 +192,7 @@ end -- local nanoParticles = {} -local maxEngineParticles = Spring.GetConfigInt("MaxNanoParticles", 10000) +local maxEngineParticles = Spring.GetConfigInt("MaxNanoParticles", 25000) local function GetFaction(udid) --local udef_factions = UnitDefs[udid].factions or {} @@ -230,17 +210,27 @@ local factionsNanoFx = { streamSpeed = "limcount*0.05", }, ["default_high_quality"] = { - fxtype = "NanoParticles", - alpha = 0.27, - size = 6, - sizeSpread = 6, - sizeGrowth = 0.65, - rotSpeed = 0.1, - rotSpread = 360, - texture = "bitmaps/Other/Poof.png", - particles = 1.2, + fxtype = "NanoLasers", + alpha = "0.001", + corealpha = "0.2", + corethickness = "0.25", + streamThickness = "1", + streamSpeed = "1", }, - --[[arm = { + + -- ["default_high_quality"] = { + -- fxtype = "NanoParticles", + -- alpha = 0.50, + -- size = 6, + -- sizeSpread = 6, + -- sizeGrowth = 0.75, + -- rotSpeed = 0.1, + -- rotSpread = 360, + -- texture = "bitmaps/default/randdots.tga", + -- particles = 0.5, + -- }, + + arm = { fxtype = "NanoParticles", delaySpread = 30, size = 3, @@ -274,7 +264,7 @@ local factionsNanoFx = { corethickness = "limcount", streamThickness = "0.5+5*limcount", streamSpeed = "limcount*0.05", - },]]-- + }, } ------------------------------------------------------------------------------------- @@ -282,104 +272,106 @@ local factionsNanoFx = { local builders = {} - local function BuilderFinished(_,unitID) - builders[#builders+1] = unitID - end +local function BuilderFinished(unitID) + builders[#builders+1] = unitID +end - local function BuilderDestroyed(_,unitID) - for i=1,#builders do - if (builders[i] == unitID) then - builders[i] = builders[#builders] - end +local function BuilderDestroyed(unitID) + for i=1,#builders do + if (builders[i] == unitID) then + builders[i] = builders[#builders] end - builders[#builders] = nil end + builders[#builders] = nil +end - local function GameFrame(_,frame) - for i=1,#builders do - local unitID = builders[i] - if ((unitID + frame) % 30 < 1) then --// only update once per second - local strength = Spring.GetUnitCurrentBuildPower(unitID) or 0 -- * 16 - if (strength > 0) then - local type, target, isFeature = Spring.Utilities.GetUnitNanoTarget(unitID) - - if (target) then - local endpos - local radius = 30 - if (type=="restore") then - endpos = target - radius = target[4] - target = -1 - elseif (not isFeature) then - radius = (GetUnitRadius(target) or 1) * 0.80 - else - radius = (GetFeatureRadius(target) or 1) * 0.80 - end +function gadget:GameFrame(frame) + for i=1,#builders do + local unitID = builders[i] + if ((unitID + frame) % 30 < 1) then --// only update once per second + local strength = (Spring.GetUnitCurrentBuildPower(unitID) or 0)*(Spring.GetUnitRulesParam(unitID, "totalEconomyChange") or 1) -- * 16 + if (strength > 0) then + local type, target, isFeature = Spring.Utilities.GetUnitNanoTarget(unitID) + + if (target) then + local endpos + local radius = 30 + if (type=="restore") then + endpos = target + radius = target[4] + target = -1 + elseif (not isFeature) then + radius = (GetUnitRadius(target) or 1) * 0.80 + else + radius = (GetFeatureRadius(target) or 1) * 0.80 + end - local terraform = false - local inversed = false - if (type=="restore") then - terraform = true - elseif (type=="reclaim") then - inversed = true - end + local terraform = false + local inversed = false + if (type=="restore") then + terraform = true + elseif (type=="reclaim") then + inversed = true + end - --[[ - if (type=="reclaim") and (strength > 0) then - --// reclaim is done always at full speed - strength = 1 - end - ]]-- - - local cmdTag = GetCmdTag(unitID) - local teamID = Spring.GetUnitTeam(unitID) - local allyID = Spring.GetUnitAllyTeam(unitID) - local unitDefID = Spring.GetUnitDefID(unitID) - local faction = GetFaction(unitDefID) - local teamColor = {Spring.GetTeamColor(teamID)} - local nanoPieces = Spring.GetUnitNanoPieces(unitID) or {} - - for j=1,#nanoPieces do - local nanoPieceID = nanoPieces[j] - --local nanoPieceIDAlt = Spring.GetUnitScriptPiece(unitID, nanoPieceID) - --if (unitID+frame)%60 == 0 then - -- Spring.Echo("Nanopiece nums (output)", j, UnitDefs[unitDefID].name, nanoPieceID, nanoPieceIDAlt) - --end - - local nanoParams = { - targetID = target, - isFeature = isFeature, - unitpiece = nanoPieceID, - unitID = unitID, - unitDefID = unitDefID, - teamID = teamID, - allyID = allyID, - nanopiece = nanoPieceID, - targetpos = endpos, - count = strength * 30, - color = teamColor, - type = type, - targetradius = radius, - terraform = terraform, - inversed = inversed, - cmdTag = cmdTag, --//used to end the fx when the command is finished - life = 60, - } - - local nanoSettings = CopyMergeTables(factionsNanoFx[faction] or factionsNanoFx.default, nanoParams) - ExecuteLuaCode(nanoSettings) - - local fxType = nanoSettings.fxtype - if (not nanoParticles[unitID]) then nanoParticles[unitID] = {} end - local unitFxs = nanoParticles[unitID] + --[[ + if (type=="reclaim") and (strength > 0) then + --// reclaim is done always at full speed + strength = 1 + end + ]]-- + + local cmdTag = GetCmdTag(unitID) + local teamID = Spring.GetUnitTeam(unitID) + local allyID = Spring.GetUnitAllyTeam(unitID) + local unitDefID = Spring.GetUnitDefID(unitID) + local faction = GetFaction(unitDefID) + local teamColor = {Spring.GetTeamColor(teamID)} + local nanoPieces = Spring.GetUnitNanoPieces(unitID) or {} + + for j=1,#nanoPieces do + local nanoPieceID = nanoPieces[j] + --local nanoPieceIDAlt = Spring.GetUnitScriptPiece(unitID, nanoPieceID) + --if (unitID+frame)%60 == 0 then + -- Spring.Echo("Nanopiece nums (output)", j, UnitDefs[unitDefID].name, nanoPieceID, nanoPieceIDAlt) + --end + + local nanoParams = { + targetID = target, + isFeature = isFeature, + unitpiece = nanoPieceID, + unitID = unitID, + unitDefID = unitDefID, + teamID = teamID, + allyID = allyID, + nanopiece = nanoPieceID, + targetpos = endpos, + count = strength * 30, + color = teamColor, + type = type, + targetradius = radius, + terraform = terraform, + inversed = inversed, + cmdTag = cmdTag, --//used to end the fx when the command is finished + life = 60, + } + + local nanoSettings = CopyMergeTables(factionsNanoFx[faction] or factionsNanoFx.default, nanoParams) + ExecuteLuaCode(nanoSettings) + + local fxType = nanoSettings.fxtype + if (not nanoParticles[unitID]) then nanoParticles[unitID] = {} end + local unitFxs = nanoParticles[unitID] + if Lups then unitFxs[#unitFxs+1] = Lups.AddParticles(nanoSettings.fxtype,nanoSettings) end end end end + end - end --//for - end + end --//for +end ------------------------------------------------------------------------------------- @@ -439,21 +431,31 @@ function gadget:Update() end end +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +local registeredBuilders = {} - function gadget:Initialize() - gadgetHandler:AddSyncAction("nano_GameFrame", GameFrame) - gadgetHandler:AddSyncAction("nano_BuilderFinished", BuilderFinished) - gadgetHandler:AddSyncAction("nano_BuilderDestroyed", BuilderDestroyed) - --maxEngineParticles = Spring.GetConfigInt("MaxNanoParticles", 10000) - --Spring.SetConfigInt("MaxNanoParticles", 0) - end +function gadget:UnitFinished(uid, udid) + if (UnitDefs[udid].isBuilder) and not registeredBuilders[uid] then + BuilderFinished(uid) + registeredBuilders[uid] = nil + end +end - function gadget:Shutdown() - gadgetHandler:RemoveSyncAction("nano_GameFrame") - gadgetHandler:RemoveSyncAction("nano_BuilderFinished") - gadgetHandler:RemoveSyncAction("nano_BuilderDestroyed") - --Spring.SetConfigInt("MaxNanoParticles", maxEngineParticles) - end +function gadget:UnitDestroyed(uid, udid) + if (UnitDefs[udid].isBuilder) and registeredBuilders[uid] then + BuilderDestroyed(uid) + registeredBuilders[uid] = nil + end +end + +function gadget:Initialize() + for _,unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:UnitFinished(unitID, unitDefID) + end +end ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/lups_nano_spray_91.lua b/LuaRules/Gadgets/lups_nano_spray_91.lua deleted file mode 100644 index 4e80c9322..000000000 --- a/LuaRules/Gadgets/lups_nano_spray_91.lua +++ /dev/null @@ -1,468 +0,0 @@ --- $Id: lups_nano_spray.lua 3171 2008-11-06 09:06:29Z det $ -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "LupsNanoSpray91", - desc = "Wraps the nano spray to LUPS", - author = "jK", - date = "2008-2010", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = Game.version:find('91.0') and (Game.version:find('91.0.1') == nil) - } -end - - -local spGetFactoryCommands = Spring.GetFactoryCommands -local spGetUnitCommands = Spring.GetUnitCommands - -local function GetCmdTag(unitID) - local cmdTag = 0 - local cmds = spGetFactoryCommands(unitID,1) - if (cmds) then - local cmd = cmds[1] - if cmd then - cmdTag = cmd.tag - end - end - if cmdTag == 0 then - local cmds = spGetUnitCommands(unitID,1) - if (cmds) then - local cmd = cmds[1] - if cmd then - cmdTag = cmd.tag - end - end - end - return cmdTag -end - - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -if (gadgetHandler:IsSyncedCode()) then -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - - local GetUnitScriptPiece = Spring.GetUnitScriptPiece - if (not GetUnitScriptPiece) then --//75b2 compa - GetUnitScriptPiece = function(_,i) return i+1 end - end - local GetUnitAllyTeam = Spring.GetUnitAllyTeam - - local bit_and = math.bit_and - local bit_or = math.bit_or - local bit_bits = math.bit_bits - - local nanoEmitters = {} - for i=0,29 do nanoEmitters[i] = {} end - _G.nanoEmitters = nanoEmitters - - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - - function QueryNanoPieceLua(unitID,unitDefID,teamID,piecenum) - local cmdTag = GetCmdTag(unitID) - - - local offset = unitID%30 - local emitter = nanoEmitters[offset][unitID] - if (emitter) then - emitter.strength = emitter.strength+1 - emitter.cmdTag = cmdTag - if bit_and( emitter.nanoPieces,bit_bits(piecenum) )==0 then - emitter.nanoPieces = bit_or( emitter.nanoPieces, bit_bits(piecenum) ) - emitter.pieceCount = emitter.pieceCount+1 - emitter[emitter.pieceCount] = piecenum - end - else - nanoEmitters[offset][unitID] = { - teamID = teamID, - unitDefID = unitDefID, - allyID = GetUnitAllyTeam(unitID), - strength = 1, - pieceCount = 1, - nanoPieces = bit_bits(piecenum), - cmdTag = cmdTag, - [1] = piecenum, - } - end - end - - - function QueryNanoPieceCOB(unitID,unitDefID,teamID,piecenum) - piecenum = GetUnitScriptPiece(unitID,piecenum) - QueryNanoPieceLua(unitID,unitDefID,teamID,piecenum) - end - - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - - function gadget:GameFrame(n) - local offset = ((n+16) % 30) - if (next(nanoEmitters[offset])) then - SendToUnsynced("nano_GameFrame", offset) - nanoEmitters[offset] = {} - end - end - - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - - function gadget:Initialize() - GG.LUPS = GG.LUPS or {} - GG.LUPS.QueryNanoPiece = QueryNanoPieceLua - gadgetHandler:RegisterGlobal("QueryNanoPiece",QueryNanoPieceCOB) - end - - function gadget:Shutdown() - GG.LUPS = nil - gadgetHandler:DeregisterGlobal("QueryNanoPiece") - end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -else ------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -local Lups --// Lua Particle System -local initialized = false --// if LUPS isn't started yet, we try it once a gameframe later -local tryloading = 1 --// try to activate lups if it isn't found - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - ---// Speed-ups -local GetUnitRadius = Spring.GetUnitRadius -local GetFeatureRadius = Spring.GetFeatureRadius -local spGetFeatureDefID = Spring.GetFeatureDefID -local spGetTeamColor = Spring.GetTeamColor -local spGetGameFrame = Spring.GetGameFrame -local Utils_GetUnitNanoTarget = Spring.Utilities.GetUnitNanoTarget - -local tinsert = table.insert -local type = type -local pairs = pairs -local SYNCED = SYNCED -local spairs = spairs - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -if (not GetFeatureRadius) then - GetFeatureRadius = function(featureID) - local fDefID = spGetFeatureDefID(featureID) - return (FeatureDefs[fDefID].radius or 0) - end -end - - -local function SetTable(table,arg1,arg2,arg3,arg4) - table[1] = arg1 - table[2] = arg2 - table[3] = arg3 - table[4] = arg4 -end - - -local function CopyTable(outtable,intable) - for i,v in pairs(intable) do - if (type(v)=='table') then - if (type(outtable[i])~='table') then outtable[i] = {} end - CopyTable(outtable[i],v) - else - outtable[i] = v - end - end -end - - -local function CopyMergeTables(table1,table2) - local ret = {} - CopyTable(ret,table2) - CopyTable(ret,table1) - return ret -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- «« some basic functions »» --- - -local supportedFxs = {} -local function fxSupported(fxclass) - if (supportedFxs[fxclass]~=nil) then - return supportedFxs[fxclass] - else - supportedFxs[fxclass] = Lups.HasParticleClass(fxclass) - return supportedFxs[fxclass] - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Lua StrFunc parsing and execution --- - -local loadstring = loadstring -local pcall = pcall -local function ParseLuaStrFunc(strfunc) - local luaCode = [[ - return function(count,inversed) - local limcount = (count/6) - limcount = limcount/(limcount+1) - return ]] .. strfunc .. [[ - end - ]] - - local luaFunc = loadstring(luaCode) - local success,ret = pcall(luaFunc) - - if (success) then - return ret - else - Spring.Echo("LUPS(NanoSpray): parsing error in user function: \n" .. ret) - return function() return 0 end - end -end - -local function ParseLuaCode(t) - for i,v in pairs(t) do - if (type(v)=="string")and(i~="texture")and(i~="fxtype") then - t[i] = ParseLuaStrFunc(v) - end - end -end - -local function ExecuteLuaCode(t) - for i,v in pairs(t) do - if (type(v)=="function") then - t[i]=v(t.count,t.inversed) - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- «« NanoSpray handling »» --- - -local maxEngineParticles = Spring.GetConfigInt("MaxNanoParticles", 10000) - -local nanoParticles = {} - -local function GetFaction(udid) - --local udef_factions = UnitDefs[udid].factions or {} - --return ((#udef_factions~=1) and 'unknown') or udef_factions[1] - return "default" -- default -end - -local factionsNanoFx = { - default = { - fxtype = "NanoLasers", - alpha = "0.2+count/30", - corealpha = "0.2+count/120", - corethickness = "limcount", - streamThickness = "0.5+5*limcount", - streamSpeed = "limcount*0.05", - }, - ["default_high_quality"] = { - fxtype = "NanoParticles", - alpha = 0.27, - size = 6, - sizeSpread = 6, - sizeGrowth = 0.65, - rotSpeed = 0.1, - rotSpread = 360, - texture = "bitmaps/Other/Poof.png", - particles = 1.2, - }, - --[[arm = { - fxtype = "NanoParticles", - delaySpread = 30, - size = 3, - sizeSpread = 5, - sizeGrowth = 0.25, - texture = "bitmaps/PD/nano.png" - }, - ["arm_high_quality"] = { - fxtype = "NanoParticles", - alpha = 0.27, - size = 6, - sizeSpread = 6, - sizeGrowth = 0.65, - rotSpeed = 0.1, - rotSpread = 360, - texture = "bitmaps/Other/Poof.png", - particles = 1.2, - }, - core = { - fxtype = "NanoLasers", - alpha = "0.2+count/30", - corealpha = "0.2+count/120", - corethickness = "limcount", - streamThickness = "0.5+5*limcount", - streamSpeed = "limcount*0.05", - }, - unknown = { - fxtype = "NanoLasers", - alpha = "0.2+count/30", - corealpha = "0.2+count/120", - corethickness = "limcount", - streamThickness = "0.5+5*limcount", - streamSpeed = "limcount*0.05", - },]]-- -} - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - - function GameFrame(_,offset) - for unitID,nanoInfo in spairs(SYNCED.nanoEmitters[offset]) do - local type, target, isFeature = Utils_GetUnitNanoTarget(unitID) - - if (target and Lups) then - local cmdTag = GetCmdTag(unitID) - - if (nanoInfo.cmdTag == cmdTag) then - local endpos - local radius = 30 - if (type=="restore") then - endpos = target - radius = target[4] - target = -1 - elseif (not isFeature) then - radius = (GetUnitRadius(target) or 1)*0.80 - else - radius = (GetFeatureRadius(target) or 1) * 0.80 - end - - local terraform = false - local inversed = false - if (type=="restore") then - terraform = true - elseif (type=="reclaim") then - inversed = true - end - - local strength = nanoInfo.strength - if (type=="reclaim") then - --// reclaim is done always at full speed - strength = 30 - end - - local faction = GetFaction(nanoInfo.unitDefID) - local teamColor = {spGetTeamColor(nanoInfo.teamID)} - - for i=1,nanoInfo.pieceCount do - local nanoParams = { - targetID = target, - isFeature = isFeature, - unitpiece = nanoInfo[i], - unitID = unitID, - unitDefID = nanoInfo.unitDefID, - teamID = nanoInfo.teamID, - allyID = nanoInfo.allyID, - nanopiece = nanoInfo[i], - targetpos = endpos, - count = strength, - color = teamColor, - type = type, - targetradius = radius, - terraform = terraform, - inversed = inversed, - cmdTag = cmdTag, --//used to end the fx when the command is finished - } - - local nanoSettings = CopyMergeTables(factionsNanoFx[faction] or factionsNanoFx.default,nanoParams) - ExecuteLuaCode(nanoSettings) - - local fxType = nanoSettings.fxtype - if (not nanoParticles[unitID]) then nanoParticles[unitID] = {} end - local unitFxs = nanoParticles[unitID] - unitFxs[#unitFxs+1] = Lups.AddParticles(nanoSettings.fxtype,nanoSettings) - end - end - end - - end --//for - end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function gadget:Update() - if (spGetGameFrame()<1) then - return - end - - gadgetHandler:RemoveCallIn("Update") - - Lups = GG['Lups'] - - if (Lups) then - initialized=true - else - return - end - - --// enable freaky arm nano fx when quality>3 - if ((Lups.Config["quality"] or 3) >= 3) then - factionsNanoFx.default = factionsNanoFx["default_high_quality"] - end - - --// init user custom nano fxs - for faction,fx in pairs(Lups.Config or {}) do - if (fx and (type(fx)=='table') and fx.fxtype) then - local fxType = fx.fxtype - local fxSettings = fx - - if (fxType)and - ((fxType:lower()=="nanolasers")or - (fxType:lower()=="nanoparticles"))and - (fxSupported(fxType))and - (fxSettings) - then - factionsNanoFx[faction] = fxSettings - end - end - end - - for faction,fx in pairs(factionsNanoFx) do - if (not fxSupported(fx.fxtype or "noneNANO")) then - factionsNanoFx[faction] = factionsNanoFx.default - end - - local factionNanoFx = factionsNanoFx[faction] - factionNanoFx.delaySpread = 30 - factionNanoFx.fxtype = factionNanoFx.fxtype:lower() - if ((Lups.Config["quality"] or 2)>=2)and((factionNanoFx.fxtype=="nanolasers")or(factionNanoFx.fxtype=="nanolasersshader")) then - factionNanoFx.flare = true - end - - --// parse lua code in the table, so we can execute it later - ParseLuaCode(factionNanoFx) - end - -end - - function gadget:Initialize() - gadgetHandler:AddSyncAction("nano_GameFrame", GameFrame) - --maxEngineParticles = Spring.GetConfigInt("MaxNanoParticles", 10000) - --Spring.SetConfigInt("MaxNanoParticles", 0) - end - - function gadget:Shutdown() - gadgetHandler:RemoveSyncAction("nano_GameFrame") - --Spring.SetConfigInt("MaxNanoParticles", maxEngineParticles) - end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -end diff --git a/LuaRules/Gadgets/lups_napalm.lua b/LuaRules/Gadgets/lups_napalm.lua index 1794b6340..758343dcc 100644 --- a/LuaRules/Gadgets/lups_napalm.lua +++ b/LuaRules/Gadgets/lups_napalm.lua @@ -8,7 +8,7 @@ function gadget:GetInfo() date = "Sep. 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true, + enabled = false, } end @@ -16,13 +16,15 @@ end if (gadgetHandler:IsSyncedCode()) then local napalmWeapons = {} + local wantedList = {} --// find napalms for i=1,#WeaponDefs do local wd = WeaponDefs[i] - if (wd.description:find("Napalm")) then + if (wd.description:find("Napalm") or (wd.customParams and (wd.customParams.lups_napalm_fx or wd.customParams.lups_heat_fx))) then Script.SetWatchWeapon(wd.id,true) napalmWeapons[wd.id] = true + wantedList[#wantedList + 1] = wd.id end end @@ -31,9 +33,13 @@ if (gadgetHandler:IsSyncedCode()) then --// Speed-ups local SendToUnsynced = SendToUnsynced + function gadget:Explosion_GetWantedWeaponDef() + return wantedList + end + function gadget:Explosion(weaponID, px, py, pz) if (napalmWeapons[weaponID]) then - napalmExplosions[#napalmExplosions+1] = {px, py, pz} + napalmExplosions[#napalmExplosions+1] = {weaponID, px, py, pz} end return false end @@ -49,77 +55,30 @@ if (gadgetHandler:IsSyncedCode()) then else - local napalmFX = { - colormap = { {0, 0, 0, 0.01}, {0.75, 0.75, 0.9, 0.02}, {0.45, 0.2, 0.3, 0.1}, {0.4, 0.16, 0.1, 0.12}, {0.3, 0.15, 0.01, 0.15}, {0.3, 0.15, 0.01, 0.15}, {0.3, 0.15, 0.01, 0.15}, {0.1, 0.035, 0.01, 0.15}, {0, 0, 0, 0.01} }, - count = 4, - life = 175, - lifeSpread = 40, - emitVector = {0,1,0}, - emitRotSpread = 90, - force = {0,0.3,0}, - - partpos = "r*sin(alpha),0,r*cos(alpha) | r=rand()*15, alpha=rand()*2*pi", - - rotSpeed = 0.25, - rotSpeedSpread = -0.5, - rotSpread = 360, - rotExp = 1.5, - - speed = 0.225, - speedSpread = 0.05, - speedExp = 7, - - size = 40, - sizeSpread = 10, - sizeGrowth = 0.15, - sizeExp = 2.5, - - layer = 1, - texture = "bitmaps/GPL/flame.png", - } - - - local heatFX = { - count = 1, - emitVector = {0,1,0}, - emitRotSpread = 60, - force = {0,0.5,0}, - - life = 270, - lifeSpread = 70, - - speed = 0.25, - speedSpread = 0.25, - speedExp = 7, - - size = 100, - sizeSpread = 40, - sizeGrowth = 0.3, - sizeExp = 2.5, - - strength = 0.75, - scale = 5.0, - animSpeed = 0.25, - heat = 6.5, - - texture = 'bitmaps/GPL/Lups/mynoise2.png', - } + local napalmFX, heatFX = include("LuaRules/Configs/lups_napalm_fxs.lua") local Lups local LupsAddParticles local SYNCED = SYNCED - local function SpawnNapalmFX(pos) - napalmFX.pos = {pos[1],pos[2],pos[3]} - Lups.AddParticles('SimpleParticles2',napalmFX) - heatFX.pos = napalmFX.pos - Lups.AddParticles('JitterParticles2',heatFX) + local function SpawnNapalmFX(data) + local nFXkey = WeaponDefs[data[1]].customParams and WeaponDefs[data[1]].customParams.lups_napalm_fx or "default" + local hFXkey = WeaponDefs[data[1]].customParams and WeaponDefs[data[1]].customParams.lups_heat_fx or "default" + + local nFX = napalmFX[nFXkey] + local hFX = heatFX[hFXkey] + + nFX.pos = {data[2],data[3],data[4]} + Lups.AddParticles('SimpleParticles2',nFX) + hFX.pos = nFX.pos + Lups.AddParticles('JitterParticles2',hFX) end local function GameFrame() if (not Lups) then Lups = GG['Lups']; LupsAddParticles = Lups.AddParticles end local explosions = SYNCED.napalmExplosions - for i=1,SYNCED.napalmCount do + local napalmCount = SYNCED.napalmCount + for i=1,napalmCount do SpawnNapalmFX(explosions[i]) end end diff --git a/LuaRules/Gadgets/lups_projectiles.lua b/LuaRules/Gadgets/lups_projectiles.lua new file mode 100644 index 000000000..462d2c2d4 --- /dev/null +++ b/LuaRules/Gadgets/lups_projectiles.lua @@ -0,0 +1,134 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function gadget:GetInfo() + return { + name = "Projectile Lups", + desc = "Attaches Lups FX to projectiles", + author = "KingRaptor (L.J. Lim)", + date = "2013-06-28", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = false + } +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +local weapons = include("LuaRules/Configs/lups_projectile_fxs.lua") --{} + +--[[ +for i=1,#WeaponDefs do + local wd = WeaponDefs[i] + if wd.customParams and wd.customParams.projectilelups then + local data + local func, err = loadstring("return" .. (ud.customParams.projectilelups or "")) + if func then + data = func() + elseif err then + Spring.Log(gadget:GetInfo().name, LOG.WARNING, "malformed projectile Lups definition for weapon " .. wd.name .. "\n" .. err ) + end + if data then + Script.SetWatchWeapon(i, true) + weapons[i] = data + end + end +end +]] +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if (gadgetHandler:IsSyncedCode()) then + +-------------------------------------------------------------------------------- +-- SYNCED +-------------------------------------------------------------------------------- +local projectiles = {} + +function gadget:ProjectileCreated(proID, proOwnerID, weaponID) + if weapons[weaponID] then + projectiles[proID] = true; + SendToUnsynced("lupsProjectiles_AddProjectile", proID, proOwnerID, weaponID) + end +end + +function gadget:ProjectileDestroyed(proID) + if projectiles[proID] then + SendToUnsynced("lupsProjectiles_RemoveProjectile", proID) + projectiles[proID] = nil + end +end + +function gadget:Initialize() + for weaponID in pairs(weapons) do + Script.SetWatchWeapon(weaponID, true) + end +end + +function gadget:Shutdown() +for weaponID in pairs(weapons) do + Script.SetWatchWeapon(weaponID, false) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +else +-------------------------------------------------------------------------------- +-- unsynced +-------------------------------------------------------------------------------- + +local Lups +local LupsAddParticles +local SYNCED = SYNCED + +local projectiles = {} + +local function AddProjectile(_, proID, proOwnerID, weaponID) + if (not Lups) then Lups = GG['Lups']; LupsAddParticles = Lups.AddParticles end + projectiles[proID] = {} + local def = weapons[weaponID] + for i=1,#def do + local fxTable = projectiles[proID] + local fx = def[i] + local options = Spring.Utilities.CopyTable(fx.options) + --options.unit = proOwnerID + options.projectile = proID + options.weapon = weaponID + --options.worldspace = true + local fxID = LupsAddParticles(fx.class, options) + if fxID ~= -1 then + fxTable[#fxTable+1] = fxID + end + end +end + +local function RemoveProjectile(_, proID) + if projectiles[proID] then + for i=1,#projectiles[proID] do + local fxID = projectiles[proID][i] + local fx = Lups.GetParticles(fxID) + if fx.persistAfterDeath then + fx.isvalid = nil + else + Lups.RemoveParticles(fxID) + end + end + projectiles[proID] = nil + end +end + + + +function gadget:Initialize() + gadgetHandler:AddSyncAction("lupsProjectiles_AddProjectile", AddProjectile) + gadgetHandler:AddSyncAction("lupsProjectiles_RemoveProjectile", RemoveProjectile) +end + + +function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("lupsProjectiles_AddProjectile") + gadgetHandler:RemoveSyncAction("lupsProjectiles_RemoveProjectile") +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/lups_shield.lua b/LuaRules/Gadgets/lups_shield.lua new file mode 100644 index 000000000..066e7241f --- /dev/null +++ b/LuaRules/Gadgets/lups_shield.lua @@ -0,0 +1,184 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Lups Shield", + desc = "Draws variable shields for shielded units", + author = "GoogleFrog", + date = "14 November 2017", + license = "GNU GPL, v2 or later", + layer = 500, -- Call ShieldPreDamaged after gadgets which change whether interception occurs + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if gadgetHandler:IsSyncedCode() then + local spSetUnitRulesParam = Spring.SetUnitRulesParam + local INLOS_ACCESS = {inlos = true} + local gameFrame = 0 + + function gadget:GameFrame(n) + gameFrame = n + end + + function gadget:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitter, beamCarrierID) + spSetUnitRulesParam(shieldCarrierUnitID, "shieldHitFrame", gameFrame, INLOS_ACCESS) + return false + end + + return +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetSpectatingState = Spring.GetSpectatingState + +local IterableMap = VFS.Include("LuaRules/Gadgets/Include/IterableMap.lua") +local shieldUnitDefs = include("LuaRules/Configs/lups_shield_fxs.lua") + +local Lups +local LupsAddParticles +local UPDATE_PERIOD = 10 + +local myAllyTeamID = spGetMyAllyTeamID() + +local shieldUnits = IterableMap.New() +local startup = true + +local stunnedUnits = {} + +local function GetVisibleSearch(x, z, search) + if not x then + return false + end + for i = 1, #search do + if Spring.IsPosInAirLos(x + search[i][1], 0, z + search[i][2], myAllyTeamID) then + return true + end + end + return false +end + +local function UpdateVisibility(unitID, unitData, unitVisible, forceUpdate) + unitVisible = unitVisible or (myAllyTeamID == unitData.allyTeamID) + if not unitVisible then + local ux,_,uz = Spring.GetUnitPosition(unitID) + unitVisible = GetVisibleSearch(ux, uz, unitData.search) + end + + if unitVisible == unitData.unitVisible and not forceUpdate then + return + end + unitData.unitVisible = unitVisible + + for i = 1, #unitData.fxTable do + local fxID = unitData.fxTable[i] + local fx = Lups.GetParticles(fxID) + fx.visibleToMyAllyTeam = unitVisible + end +end + +local function AddUnit(unitID, unitDefID) + if (not Lups) then + Lups = GG['Lups'] + LupsAddParticles = Lups.AddParticles + end + + local def = shieldUnitDefs[unitDefID] + local defFx = def.fx + local fxTable = {} + for i = 1, #defFx do + local fx = defFx[i] + local options = Spring.Utilities.CopyTable(fx.options) + options.unit = unitID + options.shieldCapacity = def.shieldCapacity + local fxID = LupsAddParticles(fx.class, options) + if fxID ~= -1 then + fxTable[#fxTable + 1] = fxID + end + end + + local unitData = { + unitDefID = unitDefID, + search = def.search, + fxTable = fxTable, + allyTeamID = Spring.GetUnitAllyTeam(unitID) + } + shieldUnits.Add(unitID, unitData) + + local _, fullview = spGetSpectatingState() + UpdateVisibility(unitID, unitData, fullview, true) +end + +local function RemoveUnit(unitID) + local unitData = shieldUnits.Get(unitID) + if unitData then + for i = 1, #unitData.fxTable do + local fxID = unitData.fxTable[i] + Lups.RemoveParticles(fxID) + end + shieldUnits.Remove(unitID) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + RemoveUnit(unitID) + stunnedUnits[unitID] = nil +end + +function gadget:UnitFinished(unitID, unitDefID, unitTeam) + if shieldUnitDefs[unitDefID] then + AddUnit(unitID, unitDefID) + end +end + +function gadget:UnitTaken(unitID, unitDefID, newTeam, oldTeam) + local unitData = shieldUnits.Get(unitID) + if unitData then + unitData.allyTeamID = Spring.GetUnitAllyTeam(unitID) + end +end + +function gadget:PlayerChanged() + myAllyTeamID = spGetMyAllyTeamID() +end + +function gadget:GameFrame(n) + if startup then + local allUnits = Spring.GetAllUnits() + for i = 1, #allUnits do + local unitID = allUnits[i] + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:UnitFinished(unitID, unitDefID) + end + startup = false + end + + if n%UPDATE_PERIOD == 0 then + local _, fullview = spGetSpectatingState() + for unitID, unitData in shieldUnits.Iterator() do + if Spring.GetUnitIsStunned(unitID) then + RemoveUnit(unitID) + stunnedUnits[unitID] = Spring.GetUnitDefID(unitID) + end + UpdateVisibility(unitID, unitData, fullview) + end + + for unitID, unitDefID in pairs(stunnedUnits) do + if not Spring.GetUnitIsStunned(unitID) then + AddUnit(unitID, unitDefID) + stunnedUnits[unitID] = nil + end + end + end + +end \ No newline at end of file diff --git a/LuaRules/Gadgets/lups_shockwaves.lua b/LuaRules/Gadgets/lups_shockwaves.lua index 0f904c96d..34b87ba72 100644 --- a/LuaRules/Gadgets/lups_shockwaves.lua +++ b/LuaRules/Gadgets/lups_shockwaves.lua @@ -12,43 +12,77 @@ function gadget:GetInfo() } end - +------------------------------------------------------------------------------- +-- Synced +------------------------------------------------------------------------------- if (gadgetHandler:IsSyncedCode()) then +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + + local hasShockwave = {} -- other gadgets can do Script.SetWatchWeapon and it is a global setting + local wantedList = {} --// find weapons which cause a shockwave for i=1,#WeaponDefs do local wd = WeaponDefs[i] - if (not wd.description:find("ChickenKick")) then - if (wd.damageAreaOfEffect>10 and not wd.paralyzer) then + local customParams = wd.customParams or {} + if (not customParams.lups_noshockwave) then + local speed = 1 + local life = 1 + local normalShockwave = (wd.damageAreaOfEffect>70 and not wd.paralyzer and not customParams.disarmdamageonly) + if customParams.lups_explodespeed then + speed = wd.customParams.lups_explodespeed + normalShockwave = true + end + if customParams.lups_explodelife then + life = wd.customParams.lups_explodelife + normalShockwave = true + end + if wd.description == "Implosion Bomb" then + hasShockwave[wd.id] = {special = 1} + Script.SetWatchWeapon(wd.id,true) + wantedList[#wantedList + 1] = wd.id + elseif normalShockwave then + hasShockwave[wd.id] = { + life = 17*life, + speed = speed, + growth = (wd.damageAreaOfEffect*1.1)/20*speed + } Script.SetWatchWeapon(wd.id,true) + wantedList[#wantedList + 1] = wd.id elseif (wd.type == "DGun") then + hasShockwave[wd.id] = {DGun = true} Script.SetWatchWeapon(wd.id,true) - --elseif (wd.description:find("Clogger")) then - -- Script.SetWatchWeapon(wd.id,true) + wantedList[#wantedList + 1] = wd.id end end end + + function gadget:Explosion_GetWantedWeaponDef() + return wantedList + end function gadget:Explosion(weaponID, px, py, pz, ownerID) - local wd = WeaponDefs[weaponID] - --if (wd.description=="PlasmaImplosionDumpRocket") then --// Liche - -- SendToUnsynced("lups_shockwave", px, py, pz, 6.4, 30, 0.13, true) - -- return true - --else - if (wd.type == "DGun") then - SendToUnsynced("lups_shockwave", px, py, pz, 4.0, 18, 0.13, true) - else - --local growth = wd.explosionSpeed - --local life = wd.damageAreaOfEffect / wd.explosionSpeed - local growth = (wd.damageAreaOfEffect*1.1)/20 - local life = 23 - SendToUnsynced("lups_shockwave", px, py, pz, growth, life) - end - + local wd = WeaponDefs[weaponID] + local shockwave = hasShockwave[weaponID] + if shockwave then + if shockwave.DGun then + SendToUnsynced("lups_shockwave", px, py, pz, 4.0, 18, 0.13, true) + elseif shockwave.special == 1 then + SendToUnsynced("lups_shockwave", px, py, pz, 6, 30, 0.13, true) + else + SendToUnsynced("lups_shockwave", px, py, pz, shockwave.growth, shockwave.life) + end + end return false end +------------------------------------------------------------------------------- +-- Unsynced +------------------------------------------------------------------------------- else +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- local function SpawnShockwave(_,px,py,pz, growth, life, strength, desintergrator) local Lups = GG['Lups'] diff --git a/LuaRules/Gadgets/lups_thrusters.lua b/LuaRules/Gadgets/lups_thrusters.lua new file mode 100644 index 000000000..1ffc82574 --- /dev/null +++ b/LuaRules/Gadgets/lups_thrusters.lua @@ -0,0 +1,153 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- UNSYNCED ONLY +if gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Thrusters", + desc = "Da red ones go fasta", + author = "KingRaptor (L.J. Lim)", + date = "2013.06.25", + license = "Public Domain", + layer = 0, + enabled = true, + } +end + +local unitDefs = include("LuaRules/Configs/lups_thruster_fxs.lua") +local UPDATE_PERIOD = 3 +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local Lups +local LupsAddParticles +local SYNCED = SYNCED + +local units = {} +local unitSpeeds = {} +local startup = true + +local function AddUnit(unitID, unitDefID) + if (not Lups) then Lups = GG['Lups']; LupsAddParticles = Lups.AddParticles end + + units[unitID] = { + unitDefID = unitDefID, + speed = unitSpeeds[unitID], + fx = {}, + } + local def = unitDefs[unitDefID] + for i=1,#def do + local fxTable = units[unitID].fx + local fx = def[i] + local options = Spring.Utilities.CopyTable(fx.options) + options.unit = unitID + local fxID = LupsAddParticles(fx.class, options) + if fxID ~= -1 then + fxTable[#fxTable+1] = fxID + end + end +end + +local function RemoveUnit(unitID) + if units[unitID] then + for i=1,#units[unitID].fx do + local fx = units[unitID].fx[i] + Lups.RemoveParticles(fx) + end + units[unitID] = nil + end +end + +local function GameFrameUnitsCheck() + for unitID, data in pairs(units) do + local def = unitDefs[data.unitDefID] + local maxDelta = def.maxDeltaSpeed*(UPDATE_PERIOD/30) + local oldSpeed = data.speed or 0 + local trueSpeed = unitSpeeds[unitID] + local delta = trueSpeed - oldSpeed + if delta > maxDelta then + delta = maxDelta + elseif delta < -maxDelta then + delta = -maxDelta + end + + local speed = oldSpeed + delta + if speed < def.minSpeed then + speed = def.minSpeed + end + + if delta > 0.01 or delta < -0.01 then + data.speed = speed + local modDelta = delta + delta*def.accelMod -- give bigger thrust when accelerating then when at constant speed + local modSpeed = speed + modDelta + + local mult = modSpeed/(def.baseSpeed or 8) + + for i=1,#data.fx do + local fxID = data.fx[i] + local fx = Lups.GetParticles(fxID) + if fx.size then + fx.size = fx.baseSize*mult + end + if fx.length then + fx.length = fx.baseLength + fx.linearLength*mult + end + fx:Destroy() -- clean up any display lists + fx:CreateParticle() + end + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--// Speed-ups +local spGetUnitVelocity = Spring.GetUnitVelocity + +local function GetUnitSpeed(unitID) + if GG.GetUnitSpeed then + local speed = GG.GetUnitSpeed(unitID) + if speed then + return speed + end + end + + local _, _, _, speed = spGetUnitVelocity(unitID) + return speed +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + RemoveUnit(unitID) + unitSpeeds[unitID] = nil +end + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + if unitDefs[unitDefID] then + AddUnit(unitID, unitDefID) + unitSpeeds[unitID] = GetUnitSpeed(unitID) + end +end + +function gadget:GameFrame(n) + if startup then + local allUnits = Spring.GetAllUnits() + for i=1,#allUnits do + local unitID = allUnits[i] + local unitDefID = Spring.GetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end + startup = false + end + if n%UPDATE_PERIOD == 0 then + for unitID in pairs(unitSpeeds) do + unitSpeeds[unitID] = GetUnitSpeed(unitID) + end + GameFrameUnitsCheck() + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/mex_placement.lua b/LuaRules/Gadgets/mex_placement.lua index 63cc8332a..c0498f5c5 100644 --- a/LuaRules/Gadgets/mex_placement.lua +++ b/LuaRules/Gadgets/mex_placement.lua @@ -1,8 +1,16 @@ +-------------------------------------------------------------------------------- +-- SYNCED +-------------------------------------------------------------------------------- +if (not gadgetHandler:IsSyncedCode()) then + return +end + + function gadget:GetInfo() return { name = "Mex Placement", desc = "Controls mex placement and income", - author = "Google Frog, smoth", -- + author = "Google Frog", -- date = "21 April 2012", license = "GNU GPL, v2 or later", layer = -10, @@ -12,33 +20,23 @@ end include("LuaRules/Configs/customcmds.h.lua") --------------------------------------------------------------------------------- --- SYNCED --------------------------------------------------------------------------------- -if (not gadgetHandler:IsSyncedCode()) then - return -end - -------------------------------------------------------------------------------- -- Command Definition -------------------------------------------------------------------------------- ---local mexDefID = UnitDefNames["emetalextractor"].id - -local mexUnitDef = UnitDefNames["emetalextractor"] -local referenceLandMexId = mexUnitDef.id -local referenceUnderWaterMexId = UnitDefNames["euwmetalextractor"].id +local mexDefID = {} +for udid, ud in pairs(UnitDefs) do + if ud.customParams.metal_extractor then + mexDefID[udid] = tonumber (ud.customParams.metal_extractor) + end +end -local mexDefIDs = { - [referenceLandMexId] = referenceLandMexId, - [referenceUnderWaterMexId] = referenceUnderWaterMexId, - } - local cmdMex = { id = CMD_AREA_MEX, type = CMDTYPE.ICON_AREA, - tooltip = 'Define an area to make mexes in', - name = 'Mex', + tooltip = 'Area Metal Extractor Queue: Click and drag to queue Metal Extractors in an area.', + name = [[Area +Mex]], cursor = 'Repair', action = 'areamex', params = {}, @@ -46,15 +44,11 @@ local cmdMex = { local canMex = {} for udid, ud in ipairs(UnitDefs) do - for _, targetId in ipairs(ud.buildOptions) do - if mexDefIDs[targetId] then - canMex[udid] = true - --Spring.Echo(ud.name) - end + if ud.customParams.area_mex_def then + canMex[udid] = true end end - -------------------------------------------------------------------------------- -- Variables -------------------------------------------------------------------------------- @@ -65,14 +59,30 @@ local spotData = {} local metalSpots = {} local metalSpotsByPos = {} +local MEX_DISTANCE = 500 +local communism = false + +metalCommunism = Spring.GetModOptions().metalextractorcommunism or "disabled" +if metalCommunism == "enabled" then + communism = true -- pass a modoption here or whatever +else + communism = false +end + + -------------------------------------------------------------------------------- -- Command Handling -------------------------------------------------------------------------------- local sameOrder = {} + function gadget:AllowCommand_GetWantedCommand() - return {[-mexDefID] = true, [CMD.INSERT] = true} + local ret = { [CMD.INSERT] = true } + for id in pairs(mexDefID) do + ret[-id] = true + end + return ret end function gadget:AllowCommand_GetWantedUnitDefID() @@ -80,12 +90,26 @@ function gadget:AllowCommand_GetWantedUnitDefID() end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) - if (mexDefIDs[-cmdID] or (cmdID == CMD.INSERT and cmdParams and mexDefIDs[-cmdParams[2]])) and metalSpots then - local _,_,_,isAI = Spring.GetTeamInfo(teamID) - local x = cmdParams[1] - local z = cmdParams[3] - --Spring.MarkerAddPoint(x,0,z,x .. ", " .. z) - return x and z and isAI or (metalSpotsByPos[x] and metalSpotsByPos[x][z]) + if (mexDefID[-cmdID] or (cmdID == CMD.INSERT and cmdParams and mexDefID[-cmdParams[2]])) and metalSpots then + local x = math.ceil(cmdParams[cmdID == CMD.INSERT and 4 or 1]) + local z = math.ceil(cmdParams[cmdID == CMD.INSERT and 6 or 3]) + if x and z then + if metalSpotsByPos[x] and metalSpotsByPos[x][z] then + return true + else + local _,_,_,isAI = Spring.GetTeamInfo(teamID) + if not isAI then + return false; + else + local nearestspot, dist, spotindex = GetClosestMetalSpot(x, z) + if spotData[spotindex] == nil and dist < MEX_DISTANCE then + return true + else + return false + end + end + end + end end return true end @@ -98,39 +122,112 @@ function gadget:Initialize() -- load active units for _, unitID in ipairs(Spring.GetAllUnits()) do local unitDefID = Spring.GetUnitDefID(unitID) - gadget:UnitCreated(unitID, unitDefID) + local teamID = Spring.GetUnitTeam(unitID) + gadget:UnitCreated(unitID, unitDefID, teamID) end + + -- This sets a building mask so that only mexDefID can be built on the mex spot + -- if metalSpots then + -- local scalingFactor = 2 * Game.squareSize + -- for i = 1, #metalSpots do + -- local spot = metalSpots[i] + -- for x = -3, 3 do + -- for z = -3, 3 do + -- Spring.SetSquareBuildingMask(spot.x / scalingFactor + x, spot.z / scalingFactor + z, 2) + -- end + -- end + -- end + -- end end -------------------------------------------------------------------------------- -- Unit Tracker -------------------------------------------------------------------------------- +local inlosTrueTable = {inlos = true} + function gadget:UnitCreated(unitID, unitDefID, unitTeam) if canMex[unitDefID] then Spring.InsertUnitCmdDesc(unitID, cmdMex) end - if mexDefIDs[unitID] then + if mexDefID[unitDefID] then local x,_,z = Spring.GetUnitPosition(unitID) + local income if metalSpots then local spotID = metalSpotsByPos[x] and metalSpotsByPos[x][z] if spotID then spotByID[unitID] = spotID spotData[spotID] = {unitID = unitID} - Spring.SetUnitRulesParam(unitID, "mexIncome", metalSpots[spotID].metal) + income = metalSpots[spotID].metal --GG.UnitEcho(unitID,spotID) + else + local nearestspot, dist, spotindex = GetClosestMetalSpot(x, z) + if spotData[spotindex] == nil and dist < MEX_DISTANCE then + local _,_,_,isAI = Spring.GetTeamInfo(unitTeam) + if not isAI then + Spring.SetUnitPosition(unitID, nearestspot.x, nearestspot.z) + end + spotByID[unitID] = spotindex + spotData[spotindex] = {unitID = unitID} + income = metalSpots[spotindex].metal + end end else - local metal = GG.IntegrateMetal(x, z) - Spring.SetUnitRulesParam(unitID, "mexIncome", metal) + income = GG.IntegrateMetal(x, z) + spotByID[unitID] = true + end + + if income then + income = income * mexDefID[unitDefID] + Spring.SetUnitRulesParam(unitID, "mexIncome", income, inlosTrueTable) + if not communism then + Spring.SetUnitResourcing(unitID, "cmm", income) + end end end end +function GetClosestMetalSpot(x, z) --is used by single mex placement, not used by areamex + local bestSpot + local bestDist = math.huge + local bestIndex + for i = 1, #metalSpots do + local spot = metalSpots[i] + local dx, dz = x - spot.x, z - spot.z + local dist = dx*dx + dz*dz + if dist < bestDist then + bestSpot = spot + bestDist = dist + bestIndex = i + end + end + return bestSpot, math.sqrt(bestDist), bestIndex +end + function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - if mexDefIDs[unitID] and spotByID[unitID] then + if mexDefID[unitDefID] and spotByID[unitID] then spotData[spotByID[unitID]] = nil spotByID[unitID] = nil end end + +if communism then function gadget:GameFrame (n) + if n % 30 ~= 0 then return end + + local allyteamIncomes = {} + for unitID in pairs (spotByID) do + if Spring.GetUnitIsActive (unitID) then + local allyteamID = select (6, Spring.GetTeamInfo (Spring.GetUnitTeam (unitID))) + allyteamIncomes[allyteamID] = (allyteamIncomes[allyteamID] or 0) + Spring.GetUnitRulesParam (unitID, "mexIncome") + end + end + + for allyTeamID, income in pairs (allyteamIncomes) do + -- fixme: handle comshare + local teams = Spring.GetTeamList (allyTeamID) + for i = 1, #teams do + Spring.AddTeamResource (teams[i], "m", income / #teams) + end + end +end end diff --git a/LuaRules/Gadgets/mex_spot_finder.lua b/LuaRules/Gadgets/mex_spot_finder.lua index 43dc926e7..488496047 100644 --- a/LuaRules/Gadgets/mex_spot_finder.lua +++ b/LuaRules/Gadgets/mex_spot_finder.lua @@ -1 +1,439 @@ - function gadget:GetInfo() return { name = "Metalspot Finder Gadget", desc = "Finds metal spots", author = "Niobium, modified by Google Frog", version = "v1.1", date = "November 2010", license = "GNU GPL, v2 or later", layer = -math.huge, enabled = true } end -------------------------------------------------------------------------------- -- SYNCED -------------------------------------------------------------------------------- if (gadgetHandler:IsSyncedCode()) then ------------------------------------------------------------ -- Config ------------------------------------------------------------ local MAPSIDE_METALMAP = "mapconfig/map_metal_layout.lua" local GAMESIDE_METALMAP = "LuaRules/Configs/MetalSpots/" .. (Game.mapName or "") .. ".lua" local DEFAULT_MEX_INCOME = 2 local MINIMUN_MEX_INCOME = 0.2 local gridSize = 16 -- Resolution of metal map local buildGridSize = 8 -- Resolution of build positions local METAL_MAP_SQUARE_SIZE = 16 local MEX_RADIUS = Game.extractorRadius local MAP_SIZE_X = Game.mapSizeX local MAP_SIZE_X_SCALED = MAP_SIZE_X / METAL_MAP_SQUARE_SIZE local MAP_SIZE_Z = Game.mapSizeZ local MAP_SIZE_Z_SCALED = MAP_SIZE_Z / METAL_MAP_SQUARE_SIZE local gameConfig = VFS.FileExists(GAMESIDE_METALMAP) and VFS.Include(GAMESIDE_METALMAP) or false local mapConfig = VFS.FileExists(MAPSIDE_METALMAP) and VFS.Include(MAPSIDE_METALMAP) or false ------------------------------------------------------------ -- Speedups ------------------------------------------------------------ local min, max = math.min, math.max local floor, ceil = math.floor, math.ceil local sqrt = math.sqrt local huge = math.huge local spGetGroundInfo = Spring.GetGroundInfo local spGetGroundHeight = Spring.GetGroundHeight local spTestBuildOrder = Spring.TestBuildOrder local extractorRadius = Game.extractorRadius local extractorRadiusSqr = extractorRadius * extractorRadius local buildmapSizeX = Game.mapSizeX - buildGridSize local buildmapSizeZ = Game.mapSizeZ - buildGridSize local buildmapStartX = buildGridSize local buildmapStartZ = buildGridSize local metalmapSizeX = Game.mapSizeX - 1.5 * gridSize local metalmapSizeZ = Game.mapSizeZ - 1.5 * gridSize local metalmapStartX = 1.5 * gridSize local metalmapStartZ = 1.5 * gridSize ------------------------------------------------------------ -- Variables ------------------------------------------------------------ local mexUnitDef = UnitDefNames["emetalextractor"] local mexDefInfo = { extraction = 0.001, square = false, oddX = mexUnitDef.xsize % 4 == 2, oddZ = mexUnitDef.zsize % 4 == 2, } local modOptions if (Spring.GetModOptions) then modOptions = Spring.GetModOptions() end ------------------------------------------------------------ -- Callins ------------------------------------------------------------ function gadget:Initialize() Spring.Log(gadget:GetInfo().name, LOG.INFO, "Mex Spot Finder Initialising") local metalSpots = GetSpots() local metalSpotsByPos = false if #metalSpots < 6 then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Indiscrete metal map detected") metalSpots = false end local metalValueOverride = gameConfig and gameConfig.metalValueOverride if metalSpots then local mult = (modOptions and modOptions.metalmult) or 1 local i = 1 while i <= #metalSpots do local spot = metalSpots[i] if spot.metal > MINIMUN_MEX_INCOME then if metalValueOverride then spot.metal = metalValueOverride end spot.metal = spot.metal*mult i = i + 1 else metalSpots[i] = metalSpots[#metalSpots] metalSpots[#metalSpots] = nil end end metalSpotsByPos = GetSpotsByPos(metalSpots) end GG.metalSpots = metalSpots GG.metalSpotsByPos = metalSpotsByPos _G.metalSpots = metalSpots GG.IntegrateMetal = IntegrateMetal Spring.Log(gadget:GetInfo().name, LOG.INFO, "Metal Spots found and GGed") end ------------------------------------------------------------ -- Extractor Income Processing ------------------------------------------------------------ function IntegrateMetal(x, z, radius) local centerX, centerZ radius = radius or MEX_RADIUS if (mexDefInfo.oddX) then centerX = (floor( x / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE else centerX = floor( x / METAL_MAP_SQUARE_SIZE + 0.5) * METAL_MAP_SQUARE_SIZE end if (mexDefInfo.oddZ) then centerZ = (floor( z / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE else centerZ = floor( z / METAL_MAP_SQUARE_SIZE + 0.5) * METAL_MAP_SQUARE_SIZE end local startX = floor((centerX - radius) / METAL_MAP_SQUARE_SIZE) local startZ = floor((centerZ - radius) / METAL_MAP_SQUARE_SIZE) local endX = floor((centerX + radius) / METAL_MAP_SQUARE_SIZE) local endZ = floor((centerZ + radius) / METAL_MAP_SQUARE_SIZE) startX, startZ = max(startX, 0), max(startZ, 0) endX, endZ = min(endX, MAP_SIZE_X_SCALED - 1), min(endZ, MAP_SIZE_Z_SCALED - 1) local mult = mexDefInfo.extraction local square = mexDefInfo.square local result = 0 if (square) then for i = startX, endX do for j = startZ, endZ do local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE local _, metal = spGetGroundInfo(cx, cz) result = result + metal end end else for i = startX, endX do for j = startZ, endZ do local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE local dx, dz = cx - centerX, cz - centerZ local dist = sqrt(dx * dx + dz * dz) if (dist < radius) then local _, metal = spGetGroundInfo(cx, cz) result = result + metal end end end end return result * mult, centerX, centerZ end ------------------------------------------------------------ -- Mex finding ------------------------------------------------------------ local function SanitiseSpots(spots) local i = 1 while i <= #spots do local spot = spots[i] if spot and spot.x and spot.z then local metal metal, spot.x, spot.z = IntegrateMetal(spot.x, spot.z) spot.y = spGetGroundHeight(spot.x, spot.z) spot.metal = metalValueOverride or spot.metal or (metal > 0 and metal) or DEFAULT_MEX_INCOME i = i + 1 else spot[i] = spot[#spots] spot[#spots] = nil end end return spots end local function makeString(group) if group then local ret = "" for i, v in pairs(group.left) do ret = ret .. i .. v end ret = ret .. " " for i, v in pairs(group.right) do ret = ret .. i .. v end ret = ret .. " " .. group.minZ .. " " .. group.maxZ .. " " .. group.worth return ret else return "" end end function GetSpots() local spots = {} -- Check configs if gameConfig then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Loading gameside mex config") if gameConfig.spots then spots = SanitiseSpots(gameConfig.spots) return spots end end if mapConfig then Spring.Log(gadget:GetInfo().name, LOG.INFO, "Loading mapside mex config") loadConfig = true spots = SanitiseSpots(mapConfig.spots) return spots end Spring.Log(gadget:GetInfo().name, LOG.INFO, "Detecting mex config from metalmap") -- Main group collection local uniqueGroups = {} -- Strip info local nStrips = 0 local stripLeft = {} local stripRight = {} local stripGroup = {} -- Indexes local aboveIdx local workingIdx -- Strip processing function (To avoid some code duplication) local function DoStrip(x1, x2, z, worth) local assignedTo for i = aboveIdx, workingIdx - 1 do if stripLeft[i] > x2 + gridSize then break elseif stripRight[i] + gridSize >= x1 then local matchGroup = stripGroup[i] if assignedTo then if matchGroup ~= assignedTo then for iz = matchGroup.minZ, assignedTo.minZ - gridSize, gridSize do assignedTo.left[iz] = matchGroup.left[iz] end for iz = matchGroup.minZ, matchGroup.maxZ, gridSize do assignedTo.right[iz] = matchGroup.right[iz] end if matchGroup.minZ < assignedTo.minZ then assignedTo.minZ = matchGroup.minZ end assignedTo.maxZ = z assignedTo.worth = assignedTo.worth + matchGroup.worth uniqueGroups[makeString(matchGroup)] = nil end else assignedTo = matchGroup assignedTo.left[z] = assignedTo.left[z] or x1 -- Only accept the first assignedTo.right[z] = x2 -- Repeated overwrite gives us result we want assignedTo.maxZ = z -- Repeated overwrite gives us result we want assignedTo.worth = assignedTo.worth + worth end else aboveIdx = aboveIdx + 1 end end nStrips = nStrips + 1 stripLeft[nStrips] = x1 stripRight[nStrips] = x2 if assignedTo then stripGroup[nStrips] = assignedTo else local newGroup = { left = {[z] = x1}, right = {[z] = x2}, minZ = z, maxZ = z, worth = worth } stripGroup[nStrips] = newGroup uniqueGroups[makeString(newGroup)] = newGroup end end -- Strip finding workingIdx = huge for mz = metalmapStartX, metalmapSizeZ, gridSize do aboveIdx = workingIdx workingIdx = nStrips + 1 local stripStart = nil local stripWorth = 0 for mx = metalmapStartZ, metalmapSizeX, gridSize do local _, groundMetal = spGetGroundInfo(mx, mz) if groundMetal > 0 then stripStart = stripStart or mx stripWorth = stripWorth + groundMetal elseif stripStart then DoStrip(stripStart, mx - gridSize, mz, stripWorth) stripStart = nil stripWorth = 0 end end if stripStart then DoStrip(stripStart, metalmapSizeX, mz, stripWorth) end end -- Final processing for _, g in pairs(uniqueGroups) do local d = {} local gMinX, gMaxX = huge, -1 local gLeft, gRight = g.left, g.right for iz = g.minZ, g.maxZ, gridSize do if gLeft[iz] < gMinX then gMinX = gLeft[iz] end if gRight[iz] > gMaxX then gMaxX = gRight[iz] end end local x = (gMinX + gMaxX) * 0.5 local z = (g.minZ + g.maxZ) * 0.5 d.metal, d.x, d.z = IntegrateMetal(x,z) d.y = spGetGroundHeight(d.x, d.z) local merged = false for i = 1, #spots do local spot = spots[i] local dis = (d.x - spot.x)^2 + (d.z - spot.z)^2 if dis < extractorRadiusSqr*4 then local metal, mx, mz = IntegrateMetal((d.x + spot.x) * 0.5, (d.z + spot.z) * 0.5) if dis < extractorRadiusSqr*1.7 or metal > (d.metal + spot.metal)*0.95 then spot.x = mx spot.y = spGetGroundHeight(mx, mx) spot.z = mz spot.metal = metal merged = true break end end end if not merged then spots[#spots + 1] = d end end --for i = 1, #spots do -- Spring.MarkerAddPoint(spots[i].x,spots[i].y,spots[i].z,"") --end return spots end function GetValidStrips(spot) local sMinZ, sMaxZ = spot.minZ, spot.maxZ local sLeft, sRight = spot.left, spot.right local validLeft = {} local validRight = {} local maxZOffset = buildGridSize * ceil(extractorRadius / buildGridSize - 1) for mz = max(sMaxZ - maxZOffset, buildmapStartZ), min(sMinZ + maxZOffset, buildmapSizeZ), buildGridSize do local vLeft, vRight = buildmapStartX, buildmapSizeX for sz = sMinZ, sMaxZ, gridSize do local dz = sz - mz local maxXOffset = buildGridSize * ceil(sqrt(extractorRadiusSqr - dz * dz) / buildGridSize - 1) -- Test for metal being included is dist < extractorRadius local left, right = sRight[sz] - maxXOffset, sLeft[sz] + maxXOffset if left > vLeft then vLeft = left end if right < vRight then vRight = right end end validLeft[mz] = vLeft validRight[mz] = vRight end spot.validLeft = validLeft spot.validRight = validRight end ------------------------------------------------------------ -- Speedup ------------------------------------------------------------ function GetSpotsByPos(spots) local spotPos = {} for i = 1, #spots do local spot = spots[i] local x = spot.x local z = spot.z --Spring.MarkerAddPoint(x,0,z,x .. ", " .. z) spotPos[x] = spotPos[x] or {} spotPos[x][z] = i end return spotPos end ------------------------------------------------------------ -- Widget asks Gadget to send data ------------------------------------------------------------ function gadget:RecvLuaMsg(msg, playerID) if msg == "RequestMetalSpots" then SendToUnsynced("SendMetalSpots", playerID) end end ------------------------------------------------------------ -- UNSYNCED ------------------------------------------------------------ else local metalSpots = {} local metalSpotsByPos = {} function WrapToLuaUI(_,playerID) if playerID == Spring.GetLocalPlayerID() and Script.LuaUI('SendMetalSpots') then Script.LuaUI.SendMetalSpots(playerID, metalSpots, metalSpotsByPos) end end local prevFrame = 1 local FRAME_GAP = 300 function gadget:Update() local frame = Spring.GetGameFrame() if Spring.IsReplay() then if Script.LuaUI('SendMetalSpots') then Script.LuaUI.SendMetalSpots(playerID, metalSpots, metalSpotsByPos) gadgetHandler:RemoveCallIn("Update") end if (frame > prevFrame) then if Script.LuaUI('SendMetalSpots') then Script.LuaUI.SendMetalSpots(playerID, metalSpots, metalSpotsByPos) gadgetHandler:RemoveCallIn("Update") else prevFrame = frame + FRAME_GAP end end else gadgetHandler:RemoveCallIn("Update") end end function gadget:Initialize() if type(SYNCED.metalSpots) == "table" then for i, v in spairs(SYNCED.metalSpots) do local x = v.x local z = v.z metalSpots[i] = { x = x, y = v.y, z = z, metal = v.metal } --Spring.MarkerAddPoint(x,0,z,x .. ", " .. z) metalSpotsByPos[x] = metalSpotsByPos[x] or {} metalSpotsByPos[x][z] = i end else metalSpots = false metalSpotsByPos = false end gadgetHandler:AddSyncAction('SendMetalSpots',WrapToLuaUI) end end \ No newline at end of file + +if not gadgetHandler:IsSyncedCode() then return end + +function gadget:GetInfo() + return { + name = "Metalspot Finder Gadget", + desc = "Finds metal spots", + author = "Niobium, modified by Google Frog", + version = "v1.1", + date = "November 2010", + license = "GNU GPL, v2 or later", + layer = -math.huge + 5, + enabled = true + } +end + +------------------------------------------------------------ +-- Config +------------------------------------------------------------ +local MAPSIDE_METALMAP = "mapconfig/map_metal_layout.lua" +local defaultMexMap = Spring.GetModOptions().mexlayout or "enabled" +if defaultMexMap == "enabled" then + GAMESIDE_METALMAP = "LuaRules/Configs/MetalSpots/" .. ("defaultLayout") .. ".lua" +else + GAMESIDE_METALMAP = "LuaRules/Configs/MetalSpots/" .. (Game.mapName or "") .. ".lua" +end + +local DEFAULT_MEX_INCOME = 2 +local MINIMUN_MEX_INCOME = 0.2 + +local gridSize = 16 -- Resolution of metal map +local buildGridSize = 8 -- Resolution of build positions + +local METAL_MAP_SQUARE_SIZE = 16 +local MEX_RADIUS = Game.extractorRadius +local MAP_SIZE_X = Game.mapSizeX +local MAP_SIZE_X_SCALED = MAP_SIZE_X / METAL_MAP_SQUARE_SIZE +local MAP_SIZE_Z = Game.mapSizeZ +local MAP_SIZE_Z_SCALED = MAP_SIZE_Z / METAL_MAP_SQUARE_SIZE + +local gameConfig = VFS.FileExists(GAMESIDE_METALMAP) and VFS.Include(GAMESIDE_METALMAP) or false +local mapConfig = VFS.FileExists(MAPSIDE_METALMAP) and VFS.Include(MAPSIDE_METALMAP) or false + +------------------------------------------------------------ +-- Speedups +------------------------------------------------------------ +local min, max = math.min, math.max +local floor, ceil = math.floor, math.ceil +local sqrt = math.sqrt +local huge = math.huge + +local spGetGroundInfo = Spring.GetGroundInfo +local spGetGroundHeight = Spring.GetGroundHeight +local spTestBuildOrder = Spring.TestBuildOrder +local spSetGameRulesParam = Spring.SetGameRulesParam + +local extractorRadius = Game.extractorRadius +local extractorRadiusSqr = extractorRadius * extractorRadius + +local buildmapSizeX = Game.mapSizeX - buildGridSize +local buildmapSizeZ = Game.mapSizeZ - buildGridSize +local buildmapStartX = buildGridSize +local buildmapStartZ = buildGridSize + +local metalmapSizeX = Game.mapSizeX - 1.5 * gridSize +local metalmapSizeZ = Game.mapSizeZ - 1.5 * gridSize +local metalmapStartX = 1.5 * gridSize +local metalmapStartZ = 1.5 * gridSize + +------------------------------------------------------------ +-- Variables +------------------------------------------------------------ + +local modOptions +if (Spring.GetModOptions) then + modOptions = Spring.GetModOptions() +end + + +------------------------------------------------------------ +-- Speedup +------------------------------------------------------------ +local function GetSpotsByPos(spots) + local spotPos = {} + for i = 1, #spots do + local spot = spots[i] + local x = spot.x + local z = spot.z + --Spring.MarkerAddPoint(x,0,z,x .. ", " .. z) + spotPos[x] = spotPos[x] or {} + spotPos[x][z] = i + end + return spotPos +end + +------------------------------------------------------------ +-- Set Game Rules so widgets can read metal spots +------------------------------------------------------------ +local function SetMexGameRulesParams(metalSpots) + if not metalSpots then -- Mexes can be built anywhere + spSetGameRulesParam("mex_count", -1) + return + end + + local mexCount = #metalSpots + spSetGameRulesParam("mex_count", mexCount) + + for i = 1, mexCount do + local mex = metalSpots[i] + spSetGameRulesParam("mex_x" .. i, mex.x) + spSetGameRulesParam("mex_y" .. i, mex.y) + spSetGameRulesParam("mex_z" .. i, mex.z) + spSetGameRulesParam("mex_metal" .. i, mex.metal) + end +end + +------------------------------------------------------------ +-- Callins +------------------------------------------------------------ +function gadget:Initialize() + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Mex Spot Finder Initialising") + Spring.SetGameRulesParam("base_extraction", 0.001) + local metalSpots, fromEngineMetalmap = GetSpots() + local metalSpotsByPos = false + + if fromEngineMetalmap and #metalSpots < 6 then + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Indiscrete metal map detected") + metalSpots = false + end + + local metalValueOverride = gameConfig and gameConfig.metalValueOverride + + if metalSpots then + local mult = (modOptions and modOptions.metalmult) or 1 + local i = 1 + while i <= #metalSpots do + local spot = metalSpots[i] + if spot.metal > MINIMUN_MEX_INCOME then + if metalValueOverride then + spot.metal = metalValueOverride + end + spot.metal = spot.metal*mult + i = i + 1 + else + metalSpots[i] = metalSpots[#metalSpots] + metalSpots[#metalSpots] = nil + end + end + + metalSpotsByPos = GetSpotsByPos(metalSpots) + end + + SetMexGameRulesParams(metalSpots) + + GG.metalSpots = metalSpots + GG.metalSpotsByPos = metalSpotsByPos + + GG.IntegrateMetal = IntegrateMetal + + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Metal Spots found and GGed") +end + +------------------------------------------------------------ +-- Extractor Income Processing +------------------------------------------------------------ + +function IntegrateMetal(x, z, radius) + local centerX, centerZ + + radius = radius or MEX_RADIUS + + centerX = (floor( x / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE + centerZ = (floor( z / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE + + local startX = floor((centerX - radius) / METAL_MAP_SQUARE_SIZE) + local startZ = floor((centerZ - radius) / METAL_MAP_SQUARE_SIZE) + local endX = floor((centerX + radius) / METAL_MAP_SQUARE_SIZE) + local endZ = floor((centerZ + radius) / METAL_MAP_SQUARE_SIZE) + startX, startZ = max(startX, 0), max(startZ, 0) + endX, endZ = min(endX, MAP_SIZE_X_SCALED - 1), min(endZ, MAP_SIZE_Z_SCALED - 1) + + local mult = Spring.GetGameRulesParam("base_extraction") + local result = 0 + + for i = startX, endX do + for j = startZ, endZ do + local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE + local dx, dz = cx - centerX, cz - centerZ + local dist = sqrt(dx * dx + dz * dz) + + if (dist < radius) then + local _, metal,metal2 = spGetGroundInfo(cx, cz) + if type(metal) == 'string' then -- Spring > v104 + metal = metal2 + end + result = result + metal + end + end + end + + return result * mult, centerX, centerZ +end + +------------------------------------------------------------ +-- Mex finding +------------------------------------------------------------ +local function SanitiseSpots(spots, metalValueOverride) + local i = 1 + while i <= #spots do + local spot = spots[i] + if spot and spot.x and spot.z then + local metal + metal, spot.x, spot.z = IntegrateMetal(spot.x, spot.z) + spot.y = spGetGroundHeight(spot.x, spot.z) + spot.metal = spot.metal or metalValueOverride or (metal > 0 and metal) or DEFAULT_MEX_INCOME + i = i + 1 + else + spot[i] = spot[#spots] + spot[#spots] = nil + end + end + + return spots +end + +local function makeString(group) + if group then + local ret = "" + for i, v in pairs(group.left) do + ret = ret .. i .. v + end + ret = ret .. " " + for i, v in pairs(group.right) do + ret = ret .. i .. v + end + ret = ret .. " " .. group.minZ .. " " .. group.maxZ .. " " .. group.worth + return ret + else + return "" + end +end + +function GetSpots() + + local spots = {} + + -- Check configs + if gameConfig then + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Loading gameside mex config") + if gameConfig.spots then + spots = SanitiseSpots(gameConfig.spots, gameConfig.metalValueOverride) + return spots, false + end + end + + if mapConfig then + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Loading mapside mex config") + loadConfig = true + spots = SanitiseSpots(mapConfig.spots, mapConfig.metalValueOverride) + return spots, false + end + + Spring.Log(gadget:GetInfo().name, LOG.INFO, "Detecting mex config from metalmap") + + -- Main group collection + local uniqueGroups = {} + + -- Strip info + local nStrips = 0 + local stripLeft = {} + local stripRight = {} + local stripGroup = {} + + -- Indexes + local aboveIdx + local workingIdx + + -- Strip processing function (To avoid some code duplication) + local function DoStrip(x1, x2, z, worth) + + local assignedTo + + for i = aboveIdx, workingIdx - 1 do + if stripLeft[i] > x2 + gridSize then + break + elseif stripRight[i] + gridSize >= x1 then + local matchGroup = stripGroup[i] + if assignedTo then + if matchGroup ~= assignedTo then + for iz = matchGroup.minZ, assignedTo.minZ - gridSize, gridSize do + assignedTo.left[iz] = matchGroup.left[iz] + end + for iz = matchGroup.minZ, matchGroup.maxZ, gridSize do + assignedTo.right[iz] = matchGroup.right[iz] + end + if matchGroup.minZ < assignedTo.minZ then + assignedTo.minZ = matchGroup.minZ + end + assignedTo.maxZ = z + assignedTo.worth = assignedTo.worth + matchGroup.worth + uniqueGroups[makeString(matchGroup)] = nil + end + else + assignedTo = matchGroup + assignedTo.left[z] = assignedTo.left[z] or x1 -- Only accept the first + assignedTo.right[z] = x2 -- Repeated overwrite gives us result we want + assignedTo.maxZ = z -- Repeated overwrite gives us result we want + assignedTo.worth = assignedTo.worth + worth + end + else + aboveIdx = aboveIdx + 1 + end + end + + nStrips = nStrips + 1 + stripLeft[nStrips] = x1 + stripRight[nStrips] = x2 + + if assignedTo then + stripGroup[nStrips] = assignedTo + else + local newGroup = { + left = {[z] = x1}, + right = {[z] = x2}, + minZ = z, + maxZ = z, + worth = worth + } + stripGroup[nStrips] = newGroup + uniqueGroups[makeString(newGroup)] = newGroup + end + end + + -- Strip finding + workingIdx = huge + for mz = metalmapStartX, metalmapSizeZ, gridSize do + + aboveIdx = workingIdx + workingIdx = nStrips + 1 + + local stripStart = nil + local stripWorth = 0 + + for mx = metalmapStartZ, metalmapSizeX, gridSize do + local groundMetal + if Engine ~= nil and Engine.version ~= nil and Engine.version ~= "104" then + _,_, groundMetal = spGetGroundInfo(mx, mz) + else + _, groundMetal = spGetGroundInfo(mx, mz) + end + if groundMetal > 0 then + stripStart = stripStart or mx + stripWorth = stripWorth + groundMetal + elseif stripStart then + DoStrip(stripStart, mx - gridSize, mz, stripWorth) + stripStart = nil + stripWorth = 0 + end + end + + if stripStart then + DoStrip(stripStart, metalmapSizeX, mz, stripWorth) + end + end + + -- Final processing + for _, g in pairs(uniqueGroups) do + local d = {} + + local gMinX, gMaxX = huge, -1 + local gLeft, gRight = g.left, g.right + for iz = g.minZ, g.maxZ, gridSize do + if gLeft[iz] < gMinX then gMinX = gLeft[iz] end + if gRight[iz] > gMaxX then gMaxX = gRight[iz] end + end + local x = (gMinX + gMaxX) * 0.5 + local z = (g.minZ + g.maxZ) * 0.5 + + d.metal, d.x, d.z = IntegrateMetal(x,z) + + d.y = spGetGroundHeight(d.x, d.z) + + local merged = false + + for i = 1, #spots do + local spot = spots[i] + local dis = (d.x - spot.x)^2 + (d.z - spot.z)^2 + if dis < extractorRadiusSqr*4 then + local metal, mx, mz = IntegrateMetal((d.x + spot.x) * 0.5, (d.z + spot.z) * 0.5) + + if dis < extractorRadiusSqr*1.7 or metal > (d.metal + spot.metal)*0.95 then + spot.x = mx + spot.y = spGetGroundHeight(mx, mx) + spot.z = mz + spot.metal = metal + merged = true + break + end + end + end + + if not merged then + spots[#spots + 1] = d + end + end + + --for i = 1, #spots do + -- Spring.MarkerAddPoint(spots[i].x,spots[i].y,spots[i].z,"") + --end + + return spots, true +end + +function GetValidStrips(spot) + + local sMinZ, sMaxZ = spot.minZ, spot.maxZ + local sLeft, sRight = spot.left, spot.right + + local validLeft = {} + local validRight = {} + + local maxZOffset = buildGridSize * ceil(extractorRadius / buildGridSize - 1) + for mz = max(sMaxZ - maxZOffset, buildmapStartZ), min(sMinZ + maxZOffset, buildmapSizeZ), buildGridSize do + local vLeft, vRight = buildmapStartX, buildmapSizeX + for sz = sMinZ, sMaxZ, gridSize do + local dz = sz - mz + local maxXOffset = buildGridSize * ceil(sqrt(extractorRadiusSqr - dz * dz) / buildGridSize - 1) -- Test for metal being included is dist < extractorRadius + local left, right = sRight[sz] - maxXOffset, sLeft[sz] + maxXOffset + if left > vLeft then vLeft = left end + if right < vRight then vRight = right end + end + validLeft[mz] = vLeft + validRight[mz] = vRight + end + + spot.validLeft = validLeft + spot.validRight = validRight +end + diff --git a/LuaRules/Gadgets/pseudo_orders.lua b/LuaRules/Gadgets/pseudo_orders.lua deleted file mode 100644 index c3f18826f..000000000 --- a/LuaRules/Gadgets/pseudo_orders.lua +++ /dev/null @@ -1,218 +0,0 @@ - - -function gadget:GetInfo() - return { - name = "Pseudo Orders", - desc = "Transfer, synced TimeWait, queuable Repeat, ...", - author = "zwzsg", - date = "August, 4th, 2009", - license = "Public domain", - layer = 17, - enabled = true - } -end - -VFS.Include("LuaRules/Gadgets/libs/new_cmd_id.lua",nil) - ---[[ --- Looks like I didn't need those after all -local TmWtDscrptn = { - name="Time Wait", - type=CMDTYPE.NUMBER, - tooltip="Wait a given amoutn of seconds", - id=CMD_TIMEWAIT, - action="timewait", - cursor="wait", -- not sure -} - -local TrnsfrDscrptn = { - name="Transfer", - type=CMDTYPE.NUMBER, - tooltip="Give unit to a team", - id=CMD_TRANSFER, - action="transfer", - cursor="Unload units", -} -]]-- - -if (gadgetHandler:IsSyncedCode()) then ---SYNCED - - local WaitTimers={} - local Transfers={} - local Orders={} - - local function CustomCommand(u,ud,team,cmd,params,options,tag,synced) - if cmd == CMD_TIMEWAIT then - if #params==1 and type(params[1])=="number" then - local gs=Spring.GetGameSeconds() - for wti,wt in ipairs(WaitTimers) do - if wt.unit==u and wt.tag==tag then - if gs>wt.ending then - table.remove(WaitTimers,wti) - return true,true - else - return true,false - end - end - end - table.insert(WaitTimers,{unit=u,duration=params[1],ending=gs+params[1],tag=tag}) - return true,false - else - Spring.Echo("Bad parameters to CMD_TIMEWAIT") - end - end - if cmd == CMD_TRANSFER then - if #params==1 and type(params[1])=="number" then - if Spring.GetTeamInfo(params[1]) then - table.insert(Transfers,{SourceUnit=u,DestinationTeam=params[1]}) - return true,(Spring.GetUnitTeam(u)==params[1]) - else - Spring.Echo("Bad TeamID to CMD_TRANSFER") - end - else - Spring.Echo("Bad parameters to CMD_TRANSFER") - end - end - if cmd == CMD_REPEAT then - if #params==0 then - if Spring.GetUnitStates(u)["repeat"] then - return true, true - else - table.insert(Orders,{unit=u,cmd=CMD.REPEAT,params={1},options={}}) - return true,true - end - else - Spring.Echo("Bad parameters to CMD_REPEAT") - end - end - if cmd == CMD_IF_UNIT_IN_AREA then - local tcid,tudid,x,y,z,radius,blocking=unpack(params) - local closest_d,closest_u - if not UnitDefs[tudid] then - Spring.Echo("CMD_IF_UNIT_IN_AREA: not a valid unitDefID",tudid) - return false - end - --Spring.Echo("CMD_IF_UNIT_IN_AREA: looking for a "..UnitDefs[tudid].name.." at ",x,y,z," in radius ",radius," blocking=",blocking) - for _,u in ipairs(Spring.GetUnitsInCylinder(x,z,radius)) do - if Spring.GetUnitDefID(u)==tudid then - local ux,_,uz=Spring.GetUnitPosition(u) - local d=(ux-x)^2+(uz-z)^2 - if (closest_u==nil) or (d1 then - Spring.Echo("CMD_SELECTABLE takes one or zero parameter!") - return false - else - local switch=((not params[1]) or tonumber(params[1])~="0") and true or false - Spring.SetUnitNoSelect(u,switch) - return true,true - end - end - end - - function gadget:AllowCommand(u,ud,team,cmd,params,options,tag,synced) - -- Factories never receive CommandFallback because they handle queue differently - -- So I have to catch custom orders at the AllowCommmand stage - if UnitDefs[ud].isFactory then - CustomCommand(u,ud,team,cmd,params,options,tag,synced) - end - return true - end - - function gadget:CommandFallback(u,ud,team,cmd,params,options,tag) - -- returns: Used, Finished - if UnitDefs[ud].isFactory then - return false,false - else - return CustomCommand(u,ud,team,cmd,params,options,tag) - end - end - - function gadget:GameFrame(f) - for _,o in ipairs(Orders) do - if Spring.ValidUnitID(o.unit) then - Spring.GiveOrderToUnit(o.unit,o.cmd,o.params,o.options) - end - end - Orders={} - for _,trnsfr in ipairs(Transfers) do - if Spring.ValidUnitID(trnsfr.SourceUnit) then - Spring.TransferUnit(trnsfr.SourceUnit,trnsfr.DestinationTeam) - end - end - Transfers={} - end - - function gadget:UnitDestroyed(u,ud,team) - for ti=#WaitTimers,1,-1 do - if u==WaitTimers[ti].unit then - table.remove(WaitTimers,ti) - end - end - for ti=#Transfers,1,-1 do - if u==Transfers[ti].SourceUnit then - table.remove(Transfers,ti) - end - end - for oi=#Orders,1,-1 do - if u==Orders[oi].unit then - table.remove(Orders,oi) - end - end - end - - -else ---UNSYNCED - - --[[ - -- Doesn't appear to be working - function gadget:Initialize() - Spring.SetCustomCommandDrawData(CMD_TIMEWAIT,"Wait", {.5,.5,1,1}) - Spring.SetCustomCommandDrawData(CMD_TRANSFER,"Resurrect", {.5,.5,1,1}) - end - ]]-- - - -end diff --git a/LuaRules/Gadgets/resourcegifts.lua b/LuaRules/Gadgets/resourcegifts.lua deleted file mode 100644 index c73a83d97..000000000 --- a/LuaRules/Gadgets/resourcegifts.lua +++ /dev/null @@ -1,179 +0,0 @@ -function gadget:GetInfo() - return { - name = "Resource Gifts and Mex Income", - desc = "Adds 1/1 resource income so that I don't have to tie it to units anymore, controls extractor income", - author = "lurker (Dylan Petonke), Google Frog", - date = "Sept 8 2009", - license = "GPL", - layer = 1, - enabled = true - } -end - -local MEX_INCOME = 0.5 -- income of each mex - -if (not gadgetHandler:IsSyncedCode()) then - return -- No Unsynced -end - ---- Detect metal extractors, manual entering of mexes possible -local mexDefs = {} - -for i=1,#UnitDefs do - local udef = UnitDefs[i] - if (udef.extractsMetal > 0) then - mexDefs[i] = true - end -end - --- Initialise ally teams -local allyTeamInfo = {} -- list of players and mexes on a team - -local allyTeamList = Spring.GetAllyTeamList() -local allyTeams = #allyTeamList -do - for i=1,allyTeams do - local allyTeamID = allyTeamList[i] - local teamList = Spring.GetTeamList(allyTeamID) - allyTeamInfo[allyTeamID] = { - teams = 0, - team = {}, - mexes = 0, - mex = {}, - mexIndex = {}, - } - for j=1,#teamList do - local teamID = teamList[j] - allyTeamInfo[allyTeamID].teams = allyTeamInfo[allyTeamID].teams + 1 - allyTeamInfo[allyTeamID].team[allyTeamInfo[allyTeamID].teams] = teamID - end - end -end - -local function addMex(unitID) - local allyTeam = allyTeamInfo[Spring.GetUnitAllyTeam(unitID)] - allyTeam.mexes = allyTeam.mexes + 1 - allyTeam.mex[allyTeam.mexes] = unitID - allyTeam.mexIndex[unitID] = allyTeam.mexes -end - -local function removeMex(unitID) - local allyTeam = allyTeamInfo[Spring.GetUnitAllyTeam(unitID)] - allyTeam[allyTeam.mexIndex[unitID]] = allyTeam[allyTeam.mexes] - allyTeam[allyTeam.mexes] = nil - allyTeam.mexIndex[unitID] = nil - allyTeam.mexes = allyTeam.mexes - 1 -end - -local function getMexIncomes() - - local income = {} - - for i=1,allyTeams do - local allyTeamID = allyTeamList[i] - local allyTeam = allyTeamInfo[allyTeamID] - local mexCount = 0 - for i = 1, allyTeam.mexes do - local unitID = allyTeam.mex[i] - local stunned_or_inbuld = Spring.GetUnitIsStunned(unitID) - if not stunned_or_inbuld then - mexCount = mexCount + 1 - end - end - income[allyTeamID] = MEX_INCOME*mexCount/allyTeam.teams - end - - return income -end - -function gadget:Initialize(n) - if ( Spring.GetModOptions().comm == "sandbox" or Spring.GetModOptions().comm == "feature" ) then - - for _,i in ipairs(Spring.GetTeamList()) do - Spring.SetTeamResource(i,"e",1000000000000) - Spring.SetTeamResource(i,"m",1000000000000) - end - end - - for _, unitID in ipairs(Spring.GetAllUnits()) do - if (mexDefs[unitDefID]) then - addMex(unitID) - end - end -end - -function gadget:GameFrame(n) - - -- Give a trickle of resources to teams - if n%32 == 4 then - local mexIncome = getMexIncomes() - for _,i in ipairs(Spring.GetTeamList()) do - local _,_,_,_,_,allyTeamID = Spring.GetTeamInfo(i) - if allyTeamID then -- don't give free stuff to GAIA - Spring.AddTeamResource(i,"e",1) - Spring.AddTeamResource(i,"m",0.5 + mexIncome[allyTeamID]) - end - end - --Give free resources to AI - Necessary for AI's to properly function - for _,TeamID in ipairs(Spring.GetTeamList()) do - local teamNum,leader,isDead,isAiTeam,side,allyTeam,teamCustomOptions = Spring.GetTeamInfo(TeamID) - if isAiTeam then - Spring.AddTeamResource(TeamID,"e",10) - end - end - end - - -- Give free unlimited power to AI - if n==60 and GG.TechGrant then - for _,TeamID in ipairs(Spring.GetTeamList()) do - local teamNum,leader,isDead,isAiTeam,side,allyTeam,teamCustomOptions = Spring.GetTeamInfo(TeamID) - if isAiTeam then - GG.TechGrant("Power",TeamID) - end - end - end - - if n%1920 == 1 then - for _,TeamID in ipairs(Spring.GetTeamList()) do - local teamNum,leader,isDead,isAiTeam,side,allyTeam,teamCustomOptions = Spring.GetTeamInfo(TeamID) - if isAiTeam then - Spring.AddTeamResource(TeamID,"m",100) - end - end - end - -end - -function gadget:UnitCreated(unitID, unitDefID, unitTeam) - if (mexDefs[unitDefID]) then - addMex(unitID) - end -end - -function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) - if (mexDefs[unitDefID]) then - removeMex(unitID) - end -end - -function gadget:UnitGiven(unitID, unitDefID, teamID, oldTeamID) - local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID) - local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID) - - if (newAllyTeam ~= oldAllyTeam) then - if (mexDefs[unitDefID]) then - addMex(unitID) - end - end -end - -function gadget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) - local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID) - local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID) - - if (newAllyTeam ~= oldAllyTeam) then - if (mexDefs[unitDefID]) then - removeMex(unitID) - end - end -end diff --git a/LuaRules/Gadgets/scavengers/API/api.lua b/LuaRules/Gadgets/scavengers/API/api.lua new file mode 100644 index 000000000..9b97abca2 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/API/api.lua @@ -0,0 +1,280 @@ +Spring.Echo("[Scavengers] API initialized") + +math_random = math.random +-- variables +mapsizeX = Game.mapSizeX +mapsizeZ = Game.mapSizeZ +GaiaTeamID = Spring.GetGaiaTeamID() +ScavengerStartboxXMin = mapsizeX + 1 +ScavengerStartboxZMin = mapsizeZ + 1 +ScavengerStartboxXMax = mapsizeX + 1 +ScavengerStartboxZMax = mapsizeZ + 1 +ScavengerStartboxExists = false +spawnmultiplier = tonumber(Spring.GetModOptions().scavengers) or 1 +scavTechDifficulty = Spring.GetModOptions().scavengerstech or "adaptive" +if scavengersAIEnabled then + if spawnmultiplier == 0 then + spawnmultiplier = 0.5 + end + GaiaTeamID = scavengerAITeamID + _,_,_,_,_,GaiaAllyTeamID = Spring.GetTeamInfo(GaiaTeamID) + ScavengerStartboxXMin, ScavengerStartboxZMin, ScavengerStartboxXMax, ScavengerStartboxZMax = Spring.GetAllyTeamStartBox(GaiaAllyTeamID) + if ScavengerStartboxXMin == 0 and ScavengerStartboxZMin == 0 and ScavengerStartboxXMax == mapsizeX and ScavengerStartboxZMax == mapsizeZ then + ScavengerStartboxExists = false + else + ScavengerStartboxExists = true + end +else + _,_,_,_,_,GaiaAllyTeamID = Spring.GetTeamInfo(GaiaTeamID) + ScavengerStartboxExists = false +end +teamcount = #Spring.GetTeamList() - 1 +allyteamcount = #Spring.GetAllyTeamList() - 1 + +BossWaveStarted = false +selfdx = {} +selfdy = {} +selfdz = {} +oldselfdx = {} +oldselfdy = {} +oldselfdz = {} +scavNoSelfD = {} +UDC = Spring.GetTeamUnitDefCount +UDN = UnitDefNames +scavStructure = {} +scavConstructor = {} +scavAssistant = {} +scavResurrector = {} +scavFactory = {} +scavCollector = {} +scavReclaimer = {} +scavSpawnBeacon = {} +scavStockpiler = {} +scavNuke = {} +UnitSuffixLenght = {} +numOfSpawnBeacons = 0 +numOfSpawnBeaconsTeams = {} +scavMaxUnits = 2000 +scavengerSoundPath = "Sounds/voice/scavengers/" +killedscavengers = 0 +QueuedSpawns = {} +QueuedSpawnsFrames = {} +ConstructorNumberOfRetries = {} +CaptureProgressForBeacons = {} +AliveEnemyCommanders = {} +AliveEnemyCommandersCount = 0 +FinalBossKilled = false +bosshealthmultiplier = 5--teamcount*spawnmultiplier + +if Spring.GetModOptions() and Spring.GetModOptions().maxunits then + scavMaxUnits = tonumber(Spring.GetModOptions().maxunits) +end +if GaiaTeamID == Spring.GetGaiaTeamID() then + scavMaxUnits = 10000 +end +TierSpawnChances = { + T0 = 100, + T1 = 0, + T2 = 0, + T3 = 0, + T4 = 0, +} + +-- check for solo play +if teamcount <= 0 then + teamcount = 1 +end + if allyteamcount <= 0 then + allyteamcount = 1 +end + +-- Check height diffrences +function posCheck(posx, posy, posz, posradius) + -- if true then can spawn + local testpos1 = Spring.GetGroundHeight((posx + posradius), (posz + posradius) ) + local testpos2 = Spring.GetGroundHeight((posx + posradius), (posz - posradius) ) + local testpos3 = Spring.GetGroundHeight((posx - posradius), (posz + posradius) ) + local testpos4 = Spring.GetGroundHeight((posx - posradius), (posz - posradius) ) + local testpos5 = Spring.GetGroundHeight((posx + posradius), posz ) + local testpos6 = Spring.GetGroundHeight(posx, (posz + posradius) ) + local testpos7 = Spring.GetGroundHeight((posx - posradius), posz ) + local testpos8 = Spring.GetGroundHeight(posx, (posz - posradius) ) + local deathwater = Game.waterDamage + local heighttollerance = scavconfig.other.heighttolerance + if scavconfig.other.noheightchecksforwater and (not deathwater or deathwater == 0) and posy <= 0 then + return true + elseif deathwater > 0 and posy <= 0 then + return false + elseif testpos1 < posy - heighttollerance or testpos1 > posy + heighttollerance then + return false + elseif testpos2 < posy - heighttollerance or testpos2 > posy + heighttollerance then + return false + elseif testpos3 < posy - heighttollerance or testpos3 > posy + heighttollerance then + return false + elseif testpos4 < posy - heighttollerance or testpos4 > posy + heighttollerance then + return false + elseif testpos5 < posy - heighttollerance or testpos5 > posy + heighttollerance then + return false + elseif testpos6 < posy - heighttollerance or testpos6 > posy + heighttollerance then + return false + elseif testpos7 < posy - heighttollerance or testpos7 > posy + heighttollerance then + return false + elseif testpos8 < posy - heighttollerance or testpos8 > posy + heighttollerance then + return false + else + return true + end +end + +-- Check if area is occupied +function posOccupied(posx, posy, posz, posradius) + -- if true then can spawn + local unitcount = #Spring.GetUnitsInRectangle(posx-posradius, posz-posradius, posx+posradius, posz+posradius) + if unitcount > 0 then + return false + else + return true + end +end + +-- Check if area is visible for any player +function posLosCheck(posx, posy, posz, posradius) + -- if true then can spawn + for _,allyTeamID in ipairs(Spring.GetAllyTeamList()) do + if allyTeamID ~= GaiaAllyTeamID then + if Spring.IsPosInLos(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInRadar(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInRadar(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInRadar(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInRadar(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInRadar(posx - posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInAirLos(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx - posradius, posy, posz - posradius, allyTeamID) == true then + return false + end + end + end + return true +end + +function posFriendlyCheckOnlyLos(posx, posy, posz, allyTeamID) + return Spring.IsPosInLos(posx, posy, posz, allyTeamID) +end + +function posLosCheckNoRadar(posx, posy, posz, posradius) + -- if true then can spawn + for _,allyTeamID in ipairs(Spring.GetAllyTeamList()) do + if allyTeamID ~= GaiaAllyTeamID then + if Spring.IsPosInLos(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInAirLos(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInAirLos(posx - posradius, posy, posz - posradius, allyTeamID) == true then + return false + end + end + end + return true +end + +function posLosCheckOnlyLOS(posx, posy, posz, posradius) + -- if true then can spawn + for _,allyTeamID in ipairs(Spring.GetAllyTeamList()) do + if allyTeamID ~= GaiaAllyTeamID then + if Spring.IsPosInLos(posx, posy, posz, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx + posradius, posy, posz - posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz + posradius, allyTeamID) == true or + Spring.IsPosInLos(posx - posradius, posy, posz - posradius, allyTeamID) == true then + return false + end + end + end + return true +end + +function posStartboxCheck(posx, posy, posz, posradius) + if ScavengerStartboxExists and posx <= ScavengerStartboxXMax and posx >= ScavengerStartboxXMin and posz >= ScavengerStartboxZMin and posz <= ScavengerStartboxZMax then + return false + else + return true + end +end + +function posMapsizeCheck(posx, posy, posz, posradius) + if posx + posradius >= mapsizeX or posx - posradius <= 0 or posz - posradius <= 0 or posz + posradius >= mapsizeZ then + return false + else + return true + end +end + + +function teamsCheck() + + bestTeamScore = 0 + bestTeam = 0 + if scavTechDifficulty == "adaptive" or globalScore == nil then + globalScore = 0 + end + nonFinalGlobalScore = 0 + scoreTeamCount = 0 + scorePerTeam = {} + for _,teamID in ipairs(Spring.GetTeamList()) do + if teamID ~= GaiaTeamID and teamID ~= Spring.GetGaiaTeamID() then + if not numOfSpawnBeaconsTeams[teamID] then + numOfSpawnBeaconsTeams[teamID] = 0 + end + local i = teamID + local _,_,teamisDead = Spring.GetTeamInfo(i) + local unitCount = Spring.GetTeamUnitCount(i) + if (not teamisDead) or unitCount > 0 then + scoreTeamCount = scoreTeamCount + 1 + local _,_,_,mi = Spring.GetTeamResources(i, "metal") + local _,_,_,ei = Spring.GetTeamResources(i, "energy") + local resourceScoreM = mi*scavconfig.scoreConfig.scorePerMetal + local resourceScoreE = ei*scavconfig.scoreConfig.scorePerEnergy + local unitScore = unitCount*scavconfig.scoreConfig.scorePerOwnedUnit + local finalScore = resourceScoreM + resourceScoreE + unitScore + + nonFinalGlobalScore = nonFinalGlobalScore + finalScore + + scorePerTeam[teamID] = finalScore + + if finalScore > bestTeamScore then + bestTeamScore = finalScore + bestTeam = i + end + end + end + end + if not killedscavengers then + killedscavengers = 0 + end + local timeScore = Spring.GetGameSeconds()*scavconfig.scoreConfig.scorePerSecond + if scavTechDifficulty == "adaptive" then + globalScore = math.ceil((nonFinalGlobalScore/scoreTeamCount) + killedscavengers + timeScore) + elseif scavTechDifficulty == "easy" then + globalScore = math.ceil(globalScore + 10*scavconfig.difficulty.easy*(Spring.GetGameSeconds()/60)) + elseif scavTechDifficulty == "medium" then + globalScore = math.ceil(globalScore + 10*scavconfig.difficulty.medium*(Spring.GetGameSeconds()/60)) + elseif scavTechDifficulty == "hard" then + globalScore = math.ceil(globalScore + 10*scavconfig.difficulty.hard*(Spring.GetGameSeconds()/60)) + elseif scavTechDifficulty == "brutal" then + globalScore = math.ceil(globalScore + 10*scavconfig.difficulty.brutal*(Spring.GetGameSeconds()/60)) + end + nonFinalGlobalScore = nil + scoreTeamCount = nil +end \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Constructor/placeholder.lua b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Constructor/placeholder.lua new file mode 100644 index 000000000..ad839becd --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Constructor/placeholder.lua @@ -0,0 +1,550 @@ + +-- table.insert(ScavengerBlueprintsT0,FunctionName) +-- table.insert(ScavengerBlueprintsT1,FunctionName) +-- table.insert(ScavengerBlueprintsT2,FunctionName) +-- table.insert(ScavengerBlueprintsT3,FunctionName) + +-- example blueprint: +-- local function a(posx, posy, posz, GaiaTeamID, radiusCheck) +-- local posradius = 120 + -- if radiusCheck then + -- return posradius + -- else + -- Spring.CreateUnit("unitname", posx, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx-100, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx+100, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx, posy, posz-100, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx, posy, posz+100, math.random(0,3),GaiaTeamID) + -- end +-- end +-- table.insert(ScavengerBlueprintsT1,a) + +local UDN = UnitDefNames + +local function placeholderradar1(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx-200, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+200, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx, posy, posz-200, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx, posy, posz+200, 0}, {"shift"}) + end +end +table.insert(ScavengerConstructorBlueprintsT0,placeholderradar1) +table.insert(ScavengerConstructorBlueprintsT1,placeholderradar1) +table.insert(ScavengerConstructorBlueprintsT2,placeholderradar1) +table.insert(ScavengerConstructorBlueprintsT3,placeholderradar1) + +local function placeholderradar2(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_up1_scav.id), {posx, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx-200, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+200, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx, posy, posz-200, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx, posy, posz+200, 0}, {"shift"}) + end +end +table.insert(ScavengerConstructorBlueprintsT2,placeholderradar2) +table.insert(ScavengerConstructorBlueprintsT3,placeholderradar2) + +local function emines(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + Spring.GiveOrderToUnit(scav, -(UDN.emine.id), {posx, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine.id), {posx-100, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine.id), {posx+100, posy, posz, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine.id), {posx, posy, posz-100, 0}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine.id), {posx, posy, posz+100, 0}, {"shift"}) + end +end + +table.insert(ScavengerConstructorBlueprintsT0,emines) +table.insert(ScavengerConstructorBlueprintsT1,emines) +table.insert(ScavengerConstructorBlueprintsT2,emines) +table.insert(ScavengerConstructorBlueprintsT3,emines) + +local function defenseoutpost(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(4), posy, posz+(-245), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-12), posy, posz+(219), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-380), posy, posz+(11), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(244), posy, posz+(171), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(276), posy, posz+(283), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-324), posy, posz+(147), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(116), posy, posz+(-405), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(236), posy, posz+(-253), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-108), posy, posz+(-405), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-172), posy, posz+(-101), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(468), posy, posz+(-197), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(252), posy, posz+(3), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(20), posy, posz+(459), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-404), posy, posz+(51), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-444), posy, posz+(-149), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-460), posy, posz+(91), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(220), posy, posz+(259), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-156), posy, posz+(-197), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-220), posy, posz+(-469), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(348), posy, posz+(131), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(20), posy, posz+(-5), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ekmar_scav.id), {posx+(20), posy, posz+(-85), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(516), posy, posz+(-5), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-396), posy, posz+(-261), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-212), posy, posz+(-317), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-124), posy, posz+(379), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-316), posy, posz+(331), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-4), posy, posz+(-269), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(28), posy, posz+(323), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(324), posy, posz+(-5), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(404), posy, posz+(59), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(12), posy, posz+(179), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(228), posy, posz+(123), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eshieldgen_scav.id), {posx+(12), posy, posz+(-157), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(372), posy, posz+(-245), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(388), posy, posz+(267), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(364), posy, posz+(-77), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(12), posy, posz+(-349), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-292), posy, posz+(3), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-268), posy, posz+(139), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-212), posy, posz+(259), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-340), posy, posz+(-173), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(276), posy, posz+(-133), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-92), posy, posz+(59), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(20), posy, posz+(363), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-156), posy, posz+(-5), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(244), posy, posz+(-149), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-156), posy, posz+(171), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(164), posy, posz+(395), 1}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-332), posy, posz+(-197), 1}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,defenseoutpost) +table.insert(ScavengerConstructorBlueprintsT3,defenseoutpost) + + +local function basehbot(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-239), posy, posz+(-184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(313), posy, posz+(144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(161), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-295), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-359), posy, posz+(-80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(217), posy, posz+(64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(185), posy, posz+(-192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-15), posy, posz+(312), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-135), posy, posz+(-112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-215), posy, posz+(160), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(353), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-279), posy, posz+(-384), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ehbotfac_scav.id), {posx+(25), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(73), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.etech1_scav.id), {posx+(-295), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(249), posy, posz+(-144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.efusion2_scav.id), {posx+(201), posy, posz+(272), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-127), posy, posz+(-24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(89), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(0), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(201), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-128), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(9), posy, posz+(-336), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(137), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(25), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-447), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-87), posy, posz+(80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-96), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(128), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,basehbot) +table.insert(ScavengerConstructorBlueprintsT3,basehbot) + + +local function basehover(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-239), posy, posz+(-184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(313), posy, posz+(144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(161), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-295), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-359), posy, posz+(-80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(217), posy, posz+(64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(185), posy, posz+(-192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-15), posy, posz+(312), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-135), posy, posz+(-112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-215), posy, posz+(160), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(353), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-279), posy, posz+(-384), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ebasefactory_scav.id), {posx+(25), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(73), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.etech1_scav.id), {posx+(-295), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(249), posy, posz+(-144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.efusion2_scav.id), {posx+(201), posy, posz+(272), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-127), posy, posz+(-24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(89), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(0), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(201), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-128), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(9), posy, posz+(-336), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(137), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(25), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-447), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-87), posy, posz+(80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-96), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(128), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,basehover) +table.insert(ScavengerConstructorBlueprintsT3,basehover) + + +local function baseallterr(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-239), posy, posz+(-184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(313), posy, posz+(144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(161), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-295), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-359), posy, posz+(-80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(217), posy, posz+(64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(185), posy, posz+(-192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-15), posy, posz+(312), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-135), posy, posz+(-112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-215), posy, posz+(160), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(353), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-279), posy, posz+(-384), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eallterrfac_scav.id), {posx+(25), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(73), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.etech1_scav.id), {posx+(-295), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(249), posy, posz+(-144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.efusion2_scav.id), {posx+(201), posy, posz+(272), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-127), posy, posz+(-24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(89), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(0), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(201), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-128), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(9), posy, posz+(-336), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(137), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(25), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-447), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-87), posy, posz+(80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-96), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(128), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,baseallterr) +table.insert(ScavengerConstructorBlueprintsT3,baseallterr) + + +local function baseamphib(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-239), posy, posz+(-184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(313), posy, posz+(144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(161), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-295), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-359), posy, posz+(-80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(217), posy, posz+(64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(185), posy, posz+(-192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-15), posy, posz+(312), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-135), posy, posz+(-112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-215), posy, posz+(160), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(353), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-279), posy, posz+(-384), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eamphibfac_scav.id), {posx+(25), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(73), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.etech1_scav.id), {posx+(-295), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(249), posy, posz+(-144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.efusion2_scav.id), {posx+(201), posy, posz+(272), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-127), posy, posz+(-24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(89), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(0), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(201), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-128), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(9), posy, posz+(-336), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(137), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(25), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-447), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-87), posy, posz+(80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-96), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(128), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,baseallterr) +table.insert(ScavengerConstructorBlueprintsT3,baseallterr) + + +local function baseair(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-239), posy, posz+(-184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(313), posy, posz+(144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(161), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-295), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-359), posy, posz+(-80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(217), posy, posz+(64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(185), posy, posz+(-192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-32), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-15), posy, posz+(312), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-87), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-135), posy, posz+(-112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-215), posy, posz+(160), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(425), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(353), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-279), posy, posz+(-384), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eairplant_scav.id), {posx+(25), posy, posz+(-64), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(73), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-183), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(176), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.etech1_scav.id), {posx+(-295), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(-215), posy, posz+(-48), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(249), posy, posz+(-144), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.efusion2_scav.id), {posx+(201), posy, posz+(272), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(192), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-127), posy, posz+(-24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(89), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.estorage_scav.id), {posx+(393), posy, posz+(112), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(0), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(201), posy, posz+(-288), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-128), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(9), posy, posz+(-336), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(137), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(25), posy, posz+(240), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-447), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-87), posy, posz+(80), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esolar2_scav.id), {posx+(-71), posy, posz+(-96), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.egeothermal_scav.id), {posx+(-23), posy, posz+(128), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT2,baseair) +table.insert(ScavengerConstructorBlueprintsT3,baseair) + + + +local function antinuke(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(422), posy, posz+(-59), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(326), posy, posz+(101), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eshieldgen_scav.id), {posx+(62), posy, posz+(-99), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-490), posy, posz+(-123), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-298), posy, posz+(-267), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(86), posy, posz+(453), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(30), posy, posz+(-259), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(94), posy, posz+(269), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(342), posy, posz+(-283), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(486), posy, posz+(-235), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(406), posy, posz+(261), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ekmar_scav.id), {posx+(-74), posy, posz+(-27), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-234), posy, posz+(101), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-82), posy, posz+(365), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-226), posy, posz+(-83), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-426), posy, posz+(-251), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(270), posy, posz+(205), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-218), posy, posz+(341), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(278), posy, posz+(-315), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(422), posy, posz+(117), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-98), posy, posz+(-147), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(214), posy, posz+(341), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-282), posy, posz+(437), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-258), posy, posz+(125), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-58), posy, posz+(-363), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(238), posy, posz+(109), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(54), posy, posz+(53), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-410), posy, posz+(165), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-26), posy, posz+(-443), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-226), posy, posz+(29), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-394), posy, posz+(-59), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(166), posy, posz+(-251), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-410), posy, posz+(117), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(318), posy, posz+(-83), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ekmar_scav.id), {posx+(166), posy, posz+(-27), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-170), posy, posz+(-187), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT3,antinuke) + + +local function antinuke(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(422), posy, posz+(-59), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(326), posy, posz+(101), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eshieldgen_scav.id), {posx+(62), posy, posz+(-99), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-490), posy, posz+(-123), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-298), posy, posz+(-267), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(86), posy, posz+(453), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(30), posy, posz+(-259), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(94), posy, posz+(269), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(342), posy, posz+(-283), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(486), posy, posz+(-235), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(406), posy, posz+(261), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ekmar_scav.id), {posx+(-74), posy, posz+(-27), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-234), posy, posz+(101), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-82), posy, posz+(365), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-226), posy, posz+(-83), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-426), posy, posz+(-251), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(270), posy, posz+(205), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-218), posy, posz+(341), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(278), posy, posz+(-315), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(422), posy, posz+(117), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-98), posy, posz+(-147), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(214), posy, posz+(341), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-282), posy, posz+(437), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-258), posy, posz+(125), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-58), posy, posz+(-363), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(238), posy, posz+(109), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eradar2_scav.id), {posx+(54), posy, posz+(53), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-410), posy, posz+(165), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-26), posy, posz+(-443), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elaserbattery_scav.id), {posx+(-226), posy, posz+(29), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-394), posy, posz+(-59), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(166), posy, posz+(-251), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-410), posy, posz+(117), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(318), posy, posz+(-83), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ekmar_scav.id), {posx+(166), posy, posz+(-27), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-170), posy, posz+(-187), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT3,antinuke) + + +local function nuke(scav, posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 150 + if radiusCheck then + return posradius + else + + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(92), posy, posz+(184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-164), posy, posz+(-168), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ejammer2_scav.id), {posx+(156), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(204), posy, posz+(104), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(204), posy, posz+(24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-28), posy, posz+(224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(92), posy, posz+(-168), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.esilo_scav.id), {posx+(-4), posy, posz+(24), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(268), posy, posz+(200), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(204), posy, posz+(-152), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-308), posy, posz+(-232), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(4), posy, posz+(-224), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-100), posy, posz+(184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(276), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(204), posy, posz+(-56), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(-276), posy, posz+(184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.ejammer2_scav.id), {posx+(-164), posy, posz+(8), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.eheavyturret2_scav.id), {posx+(-252), posy, posz+(16), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-36), posy, posz+(-152), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.elightturret2_scav.id), {posx+(252), posy, posz+(-216), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-212), posy, posz+(184), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-212), posy, posz+(-72), 2}, {"shift"}) + Spring.GiveOrderToUnit(scav, -(UDN.emine_scav.id), {posx+(-196), posy, posz+(88), 2}, {"shift"}) + + end +end + +table.insert(ScavengerConstructorBlueprintsT3,nuke) \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/placeholder.lua b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/placeholder.lua new file mode 100644 index 000000000..dafe8d79c --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/placeholder.lua @@ -0,0 +1,33 @@ + +-- table.insert(ScavengerBlueprintsT0,FunctionName) +-- table.insert(ScavengerBlueprintsT1,FunctionName) +-- table.insert(ScavengerBlueprintsT2,FunctionName) +-- table.insert(ScavengerBlueprintsT3,FunctionName) + +-- example blueprint: +-- local function a(posx, posy, posz, GaiaTeamID, radiusCheck) +-- local posradius = 120 + -- if radiusCheck then + -- return posradius + -- else + -- Spring.CreateUnit("unitname", posx, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx-100, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx+100, posy, posz, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx, posy, posz-100, math.random(0,3),GaiaTeamID) + -- Spring.CreateUnit("unitname", posx, posy, posz+100, math.random(0,3),GaiaTeamID) + -- end +-- end +-- table.insert(ScavengerBlueprintsT1,a) + +local function placeholderradar(posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 30 + if radiusCheck then + return posradius + else + Spring.CreateUnit("eradar2_scav", posx, posy, posz, math.random(0,3),GaiaTeamID) + end +end +table.insert(ScavengerBlueprintsT0,placeholderradar) +table.insert(ScavengerBlueprintsT1,placeholderradar) +table.insert(ScavengerBlueprintsT2,placeholderradar) +table.insert(ScavengerBlueprintsT3,placeholderradar) \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/simblebases.lua b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/simblebases.lua new file mode 100644 index 000000000..f935d6fb1 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Blueprints/EvoRTS/Spawner/simblebases.lua @@ -0,0 +1,95 @@ +nameSuffix = "_scav" + +local function simplebasehover(posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 500 + if radiusCheck then + return posradius + else + Spring.CreateUnit("estorage"..nameSuffix, posx+(-286), posy, posz+(31), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(-302), posy, posz+(-385), 0,GaiaTeamID) + Spring.CreateUnit("elightturret2"..nameSuffix, posx+(306), posy, posz+(-305), 0,GaiaTeamID) + Spring.CreateUnit("esolar2"..nameSuffix, posx+(370), posy, posz+(-65), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-222), posy, posz+(31), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-286), posy, posz+(-97), 0,GaiaTeamID) + Spring.CreateUnit("ebasefactory"..nameSuffix, posx+(82), posy, posz+(47), 0,GaiaTeamID) + Spring.CreateUnit("esolar2"..nameSuffix, posx+(370), posy, posz+(31), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(-302), posy, posz+(335), 0,GaiaTeamID) + Spring.CreateUnit("etech1"..nameSuffix, posx+(50), posy, posz+(-289), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-222), posy, posz+(-97), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(386), posy, posz+(303), 0,GaiaTeamID) + Spring.CreateUnit("elightturret2"..nameSuffix, posx+(66), posy, posz+(463), 0,GaiaTeamID) + end +end +table.insert(ScavengerBlueprintsT0,simplebasehover) +table.insert(ScavengerBlueprintsT1,simplebasehover) +table.insert(ScavengerBlueprintsT2,simplebasehover) +table.insert(ScavengerBlueprintsT3,simplebasehover) + +local function simplebasehbot(posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 500 + if radiusCheck then + return posradius + else + Spring.CreateUnit("elightturret2"..nameSuffix, posx+(-208), posy, posz+(-350), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-272), posy, posz+(-174), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(32), posy, posz+(450), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(288), posy, posz+(290), 0,GaiaTeamID) + Spring.CreateUnit("etech1"..nameSuffix, posx+(48), posy, posz+(-270), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(320), posy, posz+(98), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(448), posy, posz+(274), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(288), posy, posz+(-350), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-144), posy, posz+(-174), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(208), posy, posz+(-158), 0,GaiaTeamID) + --Spring.CreateUnit("elightturret2"..nameSuffix, posx+(-288), posy, posz+(274), 0,GaiaTeamID) + Spring.CreateUnit("ehbotfac"..nameSuffix, posx+(48), posy, posz+(18), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-272), posy, posz+(-46), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-336), posy, posz+(-46), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-176), posy, posz+(98), 0,GaiaTeamID) + Spring.CreateUnit("estorage"..nameSuffix, posx+(-336), posy, posz+(-174), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-128), posy, posz+(322), 0,GaiaTeamID) + Spring.CreateUnit("elightturret2"..nameSuffix, posx+(480), posy, posz+(-78), 0,GaiaTeamID) + end +end +table.insert(ScavengerBlueprintsT0,simplebasehbot) +table.insert(ScavengerBlueprintsT1,simplebasehbot) +table.insert(ScavengerBlueprintsT2,simplebasehbot) +table.insert(ScavengerBlueprintsT3,simplebasehbot) + +local function simplebaseair(posx, posy, posz, GaiaTeamID, radiusCheck) +local posradius = 500 + if radiusCheck then + return posradius + else + Spring.CreateUnit("emine"..nameSuffix, posx+(-520), posy, posz+(-253), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-472), posy, posz+(291), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(392), posy, posz+(131), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(600), posy, posz+(-221), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-152), posy, posz+(-493), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(40), posy, posz+(-285), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-280), posy, posz+(-317), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(104), posy, posz+(-541), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(216), posy, posz+(307), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(296), posy, posz+(-189), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(232), posy, posz+(563), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(504), posy, posz+(323), 0,GaiaTeamID) + Spring.CreateUnit("elaserbattery"..nameSuffix, posx+(-360), posy, posz+(-45), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-344), posy, posz+(-477), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-168), posy, posz+(579), 0,GaiaTeamID) + Spring.CreateUnit("eairplant"..nameSuffix, posx+(8), posy, posz+(-13), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-312), posy, posz+(323), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-56), posy, posz+(403), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-232), posy, posz+(-141), 0,GaiaTeamID) + Spring.CreateUnit("elaserbattery"..nameSuffix, posx+(504), posy, posz+(3), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-456), posy, posz+(163), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-296), posy, posz+(51), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(424), posy, posz+(-381), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(664), posy, posz+(3), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(360), posy, posz+(19), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-200), posy, posz+(211), 0,GaiaTeamID) + Spring.CreateUnit("emine"..nameSuffix, posx+(-488), posy, posz+(3), 0,GaiaTeamID) + end +end +table.insert(ScavengerBlueprintsT0,simplebaseair) +table.insert(ScavengerBlueprintsT1,simplebaseair) +table.insert(ScavengerBlueprintsT2,simplebaseair) +table.insert(ScavengerBlueprintsT3,simplebaseair) \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Blueprints/readme.txt b/LuaRules/Gadgets/scavengers/Blueprints/readme.txt new file mode 100644 index 000000000..178ced66d --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Blueprints/readme.txt @@ -0,0 +1,4 @@ +You can add more files with blueprints into those folders. Script will automatically load all of them + +Spawner folder is for buildingSpawnerModule +Constructor folder is for constructor blueprints \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/air.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/air.lua new file mode 100644 index 000000000..51b7945e0 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/air.lua @@ -0,0 +1,32 @@ +T0AirUnits = { + "escoutdrone", + "zairscout", +} + +T1AirUnits = { + "efighter", + "zairtoairfighter", +} + +T2AirUnits = { + "efighter", + "zairtoairfighter", + "egunship2", + "ebomber", + "zairtogroundfighter", + "zairbomber", +} + +T3AirUnits = { + "efighter", + "zairtoairfighter", + "egunship2", + "ebomber", + "zairtogroundfighter", + "zairbomber", +} + +T4AirUnits = { + "ekrow", + "ekrow", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/boss.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/boss.lua new file mode 100644 index 000000000..79d3208dc --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/boss.lua @@ -0,0 +1,7 @@ +BossUnits = { +"ekrowboss_scav", +"eallterranarchidboss_scav", +"eamphiblevelerboss_scav", +"ehbotkargannethboss_scav", +"elaceratorboss_scav", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/constructors.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/constructors.lua new file mode 100644 index 000000000..66d507103 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/constructors.lua @@ -0,0 +1,44 @@ +ConstructorsList = { + "ecommander", + --"xcommander", +} + +-- put ALL commander units from your game here +CommandersList = { + "ecommander", + "ecommanderbattle", + "ecommanderbuild", + "ecommandercloak", + "ecommanderfactory", + "ecommandermeteor", + "ecommandershield", + "zarm", + --"xcommander", +} + +ConstructorsCounter = { + UDN.ecommander.id, + --UDN.xcommander.id, +} + +AssistUnits = { + "eorb", + "zconstructor", + "ztenticle", + "zarm", +} + +Resurrectors = { +"placeholder", +"placeholder", +} + +ResurrectorsSea = { +"placeholder", +"placeholder", +} + +Collectors = { +"placeholder", +"placeholder", +} \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/factories.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/factories.lua new file mode 100644 index 000000000..4717da4e3 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/factories.lua @@ -0,0 +1,13 @@ +Factories = { + "ebasefactory", + "eminifac", + "eamphibfac", + "ehbotfac", + "eairplant", + "zhatch", +} + +FactoriesExcludedUnits = { +"placeholder", +"placeholder", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/land.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/land.lua new file mode 100644 index 000000000..d9a2059ba --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/land.lua @@ -0,0 +1,65 @@ +T0LandUnits = { + "eallterrlight", + "eamphibbuggy", + "ehbotpeewee", + "elighttank3", + "zlightswarm", +} + +T1LandUnits = { + "eallterrlight", + "eamphibbuggy", + "ehbotpeewee", + "elighttank3", + "zlightswarm", + "eallterrriot", + "eallterrriot_shotgun", + "eallterrmed", + "eamphibneedle", + "eamphibriot", + "eamphibriot_shotgun", + "ehbotthud", + "eriottank2", + "eriottank2_shotgun", + "eallterrassault", + "eamphibarty", + "eartytank", + "eartytank_saturation", + "zmedswarm", + "zpyro", +} + +T2LandUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T3LandUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T4LandUnits = { + "eallterranarchid", + "eamphibleveler", + "ehbotkarganneth", + "elacerator", + "zqueen", + "eamphibbuggybig", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/reinforcements.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/reinforcements.lua new file mode 100644 index 000000000..9f6df4f8e --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/reinforcements.lua @@ -0,0 +1,136 @@ +T1ReinforcementLandUnits = { + "eallterrlight", + "eamphibbuggy", + "ehbotpeewee", + "elighttank3", + "zlightswarm", + "eallterrriot", + "eallterrriot_shotgun", + "eallterrmed", + "eamphibneedle", + "eamphibriot", + "eamphibriot_shotgun", + "ehbotthud", + "eriottank2", + "eriottank2_shotgun", + "eallterrassault", + "eamphibarty", + "eartytank", + "eartytank_saturation", + "zmedswarm", + "zpyro", +} + +T2ReinforcementLandUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T3ReinforcementLandUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T4ReinforcementLandUnits = { + "eallterranarchid", + "eamphibleveler", + "ehbotkarganneth", + "elacerator", + "zqueen", +} + +T1ReinforcementAirUnits = { + "efighter", + "zairtoairfighter", +} + +T2ReinforcementAirUnits = { + "egunship2", + "ebomber", + "zairtogroundfighter", + "zairbomber", +} + +T3ReinforcementAirUnits = { + "egunship2", + "ebomber", + "zairbomber", +} + +T4ReinforcementAirUnits = { + "ekrow", + "ekrow", +} + +T1ReinforcementSeaUnits = { + "eallterrlight", + "eamphibbuggy", + "ehbotpeewee", + "elighttank3", + "zlightswarm", + "eallterrriot", + "eallterrriot_shotgun", + "eallterrmed", + "eamphibneedle", + "eamphibriot", + "eamphibriot_shotgun", + "ehbotthud", + "eriottank2", + "eriottank2_shotgun", + "eallterrassault", + "eamphibarty", + "eartytank", + "eartytank_saturation", + "zmedswarm", + "zpyro", +} + +T2ReinforcementSeaUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T3ReinforcementSeaUnits = { + "eallterrheavy", + "eallterrshield", + "eamphibmedtank", + "eamphibrock", + "ehbotrocko", + "ehbotsniper", + "eheavytank3", + "emissiletank", + "zskirmisher", + "zassault", +} + +T4ReinforcementSeaUnits = { + "eallterranarchid", + "eamphibleveler", + "ehbotkarganneth", + "elacerator", + "zqueen", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/sea.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/sea.lua new file mode 100644 index 000000000..a71c39397 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/sea.lua @@ -0,0 +1,14 @@ +T0SeaUnits = { +} + +T1SeaUnits = { +} + +T2SeaUnits = { +} + +T3SeaUnits = { +} + +T4SeaUnits = { +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/staticunits.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/staticunits.lua new file mode 100644 index 000000000..bd4a2b03d --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/UnitLists/staticunits.lua @@ -0,0 +1,144 @@ +NoSelfdList = { + "ehbotkarganneth_turret", + "ehbotpeewee_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", + "zarm", + "ztenticle", + "ztumor", + "lootboxbronze", + "lootboxsilver", + "lootboxgold", + "lootboxplatinum", +} + +StockpilingUnitNames = { + "placeholder", + "placeholder", +} + +NukingUnitNames = { + "esilo", +} + +BeaconCaptureExcludedUnits = { + "fuck", + "this", +} + +BeaconDefenceStructuresT0 = { + "elightturret2", + "elightturret2", + "ehbotpeewee_turret", +} + +BeaconDefenceStructuresT1 = { + "elightturret2", + "eheavyturret2", + "ehbotpeewee_turret", + "ehbotthud_turret", +} + +BeaconDefenceStructuresT2 = { + "eheavyturret2", + "elaserbattery", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + +BeaconDefenceStructuresT3 = { + "eheavyturret2", + "elaserbattery", + "eartyturret", + "ehbotkarganneth_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + + + +StartboxDefenceStructuresT0 = { + "elightturret2", + "elightturret2", + "ehbotpeewee_turret", +} + +StartboxDefenceStructuresT1 = { + "elightturret2", + "eheavyturret2", + "ehbotpeewee_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT2 = { + "eheavyturret2", + "elaserbattery", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT3 = { + "eheavyturret2", + "elaserbattery", + "eartyturret", + "ehbotkarganneth_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT4 = { + "eheavyturret2", + "elaserbattery", + "eartyturret", + "ehbotkarganneth_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + + +StartboxDefenceStructuresT0Sea = { + "elightturret2", + "elightturret2", + "ehbotpeewee_turret", +} + +StartboxDefenceStructuresT1Sea = { + "elightturret2", + "eheavyturret2", + "ehbotpeewee_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT2Sea = { + "eheavyturret2", + "elaserbattery", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT3Sea = { + "eheavyturret2", + "elaserbattery", + "eartyturret", + "ehbotkarganneth_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} + +StartboxDefenceStructuresT4Sea = { + "eheavyturret2", + "elaserbattery", + "eartyturret", + "ehbotkarganneth_turret", + "ehbotrocko_turret", + "ehbotsniper_turret", + "ehbotthud_turret", +} diff --git a/LuaRules/Gadgets/scavengers/Configs/EvoRTS/config.lua b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/config.lua new file mode 100644 index 000000000..ff3ab9957 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Configs/EvoRTS/config.lua @@ -0,0 +1,259 @@ +Spring.Echo("[Scavengers] Config initialized") + +adder = 300 +multiplier = 0.5 +-- Config for Scavengers Survival AI + +scavconfig = { + difficulty = { + easy = 1, + medium = 2, + hard = 3, + brutal = 5, + }, + unitnamesuffix = "_scav", + messenger = true, -- BYAR specific thing, don't enable otherwise (or get gui_messages.lua from BYAR) + modules = { + buildingSpawnerModule = true, --building spawner spawns random blueprints around map + constructorControllerModule = true, --constructor controller is for units that build blueprints + factoryControllerModule = true, --factory controller is to give orders to factories + unitSpawnerModule = true, --spawns units + startBoxProtection = true, --spawns turrets around the startboxes (if you are using startboxes) and damages units inside of it + reinforcementsModule = false, --reinforcements adds beacon capturing and friendly drops + stockpilers = false, --stockpilers adds controller for units with stockpile mechanic + nukes = true, --nukes gives orders to nuke units + }, + + scoreConfig = { + -- set to 0 to disable + scorePerMetal = 1, -- thisvalue*metalproduction + scorePerEnergy = 1, -- thisvalue*energyproduction + scorePerSecond = 1, -- thisvalue*secondspassed + scorePerOwnedUnit = 1, -- thisvalue*countofunits + ----------------------------------------- + baseScorePerKill = 1, -- How much score EVERY KILL and CAPTURE adds + -- Additional score for specific unit types, use -baseScorePerKill(default 1) to make it have no effect on score, use values lower than baseScorePerKill to reduce score + scorePerKilledBuilding = 4, + scorePerKilledConstructor = 99, + scorePerKilledSpawner = 49, + scorePerCapturedSpawner = -51, -- this doesn't care about baseScorePerKill + }, + + timers = { + -- globalScore values + T0start = 1, + T1start = 150+adder*multiplier, + T1low = 300+adder*multiplier, + T1med = 450+adder*multiplier, + T1high = 600+adder*multiplier, + T1top = 750+adder*multiplier, + T2start = 900+adder*multiplier, + T2low = 1050+adder*multiplier, + T2med = 1200+adder*multiplier, + T2high = 1350+adder*multiplier, + T2top = 1500+adder*multiplier, + T3start = 1750+adder*multiplier, + T3low = 2000+adder*multiplier, + T3med = 2250+adder*multiplier, + T3high = 2500+adder*multiplier, + T3top = 2750+adder*multiplier, + T4start = 3000+adder*multiplier, + T4low = 3250+adder*multiplier, + T4med = 3500+adder*multiplier, + T4high = 3750+adder*multiplier, + T4top = 4000+adder*multiplier, + BossFight = 4001+adder*multiplier, + -- don't delete + NoRadar = 1200, --Under this score beacons don't spawn in radar covered area. Above this score they can spawn in radar but not in LoS. + }, + other = { + heighttolerance = 30, -- higher = allow higher height diffrences + noheightchecksforwater = true, + } +} + + +-- Modules configs +buildingSpawnerModuleConfig = { + spawnchance = 90, +} + +unitSpawnerModuleConfig = { + bossFightEnabled = true, + FinalBossUnit = true, + FinalBossHealth = 1500000, -- this*teamcount*difficulty + FinalBossMinionsPassive = 1000, -- this/(teamcount*difficulty), how often does boss spawn minions passively, frames. + FinalBossMinionsActive = 150, -- this/(teamcount*difficulty), how often does boss spawn minions when taking damage, frames. + BossWaveTimeLeft = 480, + aircraftchance = 8, -- higher number = lower chance + globalscoreperoneunit = 200, + spawnchance = 120, + beaconspawnchance = 120, + minimumspawnbeacons = 2, + landmultiplier = 0.75, + airmultiplier = 2, + seamultiplier = 0.2, + chanceforaircraftonsea = 2, -- higher number = lower chance + + t0multiplier = 1.5, + t1multiplier = 1.25, + t2multiplier = 1, + t3multiplier = 0.75, + t4multiplier = 0.1, +} + +constructorControllerModuleConfig = { + constructortimerstart = 120, -- ammount of seconds it skips from constructortimer for the first spawn (make first spawn earlier - this timer starts on timer-Timer1) + constructortimer = 220, -- time in seconds between commander/constructor spawns + constructortimerreductionframes = 36000, + minimumconstructors = 5, + useresurrectors = false, + searesurrectors = false, + useconstructors = true, + usecollectors = false, +} + +unitControllerModuleConfig = { + minimumrangeforfight = 650, +} + +spawnProtectionConfig = { + spread = 192, +} + + +-- Functions which you can configure +function CountScavConstructors() + return UDC(GaiaTeamID, UDN.ecommander.id) + UDC(GaiaTeamID, UDN.ecommanderbattle.id) +end + +function UpdateTierChances(n) + -- Must be 100 in total + if globalScore > scavconfig.timers.T4top then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 10 + TierSpawnChances.T3 = 30 + TierSpawnChances.T4 = 60 + elseif globalScore > scavconfig.timers.T4high then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 20 + TierSpawnChances.T3 = 50 + TierSpawnChances.T4 = 30 + elseif globalScore > scavconfig.timers.T4med then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 30 + TierSpawnChances.T3 = 50 + TierSpawnChances.T4 = 20 + elseif globalScore > scavconfig.timers.T4low then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 40 + TierSpawnChances.T3 = 50 + TierSpawnChances.T4 = 10 + elseif globalScore > scavconfig.timers.T4start then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 40 + TierSpawnChances.T3 = 55 + TierSpawnChances.T4 = 5 + elseif globalScore > scavconfig.timers.T3top then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 20 + TierSpawnChances.T3 = 70 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T3high then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 50 + TierSpawnChances.T3 = 40 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T3med then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 60 + TierSpawnChances.T3 = 30 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T3low then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 65 + TierSpawnChances.T3 = 25 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T3start then + TierSpawnChances.T0 = 0 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 70 + TierSpawnChances.T3 = 10 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T2top then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 80 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T2high then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 30 + TierSpawnChances.T2 = 60 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T2med then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 40 + TierSpawnChances.T2 = 50 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T2low then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 60 + TierSpawnChances.T2 = 30 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T2start then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 70 + TierSpawnChances.T2 = 20 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T1top then + TierSpawnChances.T0 = 10 + TierSpawnChances.T1 = 90 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T1high then + TierSpawnChances.T0 = 40 + TierSpawnChances.T1 = 60 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T1med then + TierSpawnChances.T0 = 60 + TierSpawnChances.T1 = 40 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T1low then + TierSpawnChances.T0 = 80 + TierSpawnChances.T1 = 20 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + elseif globalScore > scavconfig.timers.T1start then + TierSpawnChances.T0 = 90 + TierSpawnChances.T1 = 10 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + else + TierSpawnChances.T0 = 100 + TierSpawnChances.T1 = 0 + TierSpawnChances.T2 = 0 + TierSpawnChances.T3 = 0 + TierSpawnChances.T4 = 0 + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Modules/building_spawner.lua b/LuaRules/Gadgets/scavengers/Modules/building_spawner.lua new file mode 100644 index 000000000..016deb16b --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/building_spawner.lua @@ -0,0 +1,71 @@ + +Spring.Echo("[Scavengers] Building spawner initialized") + +BlueprintsList = VFS.DirList('luarules/gadgets/scavengers/Blueprints/'..GameShortName..'/Spawner/','*.lua') +for i = 1,#BlueprintsList do + VFS.Include(BlueprintsList[i]) + Spring.Echo("Scav Blueprints Directory: " ..BlueprintsList[i]) +end + +function SpawnBlueprint(n) + if n > 9000 then + local gaiaUnitCount = Spring.GetTeamUnitCount(GaiaTeamID) + local spawnchance = math_random(0,buildingSpawnerModuleConfig.spawnchance) + if spawnchance == 0 or canBuildHere == false then + posx = math_random(200,mapsizeX-200) + posz = math_random(200,mapsizeZ-200) + posy = Spring.GetGroundHeight(posx, posz) + local spawnTier = math_random(1,100) + if posy > 0 then + if spawnTier <= TierSpawnChances.T0 then + blueprint = ScavengerBlueprintsT0[math_random(1,#ScavengerBlueprintsT0)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + blueprint = ScavengerBlueprintsT1[math_random(1,#ScavengerBlueprintsT1)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + blueprint = ScavengerBlueprintsT2[math_random(1,#ScavengerBlueprintsT2)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + blueprint = ScavengerBlueprintsT3[math_random(1,#ScavengerBlueprintsT3)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + blueprint = ScavengerBlueprintsT3[math_random(1,#ScavengerBlueprintsT3)] + else + blueprint = ScavengerBlueprintsT0[math_random(1,#ScavengerBlueprintsT0)] + end + elseif posy <= 0 then + if spawnTier <= TierSpawnChances.T0 then + blueprint = ScavengerBlueprintsT0Sea[math_random(1,#ScavengerBlueprintsT0Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + blueprint = ScavengerBlueprintsT1Sea[math_random(1,#ScavengerBlueprintsT1Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + blueprint = ScavengerBlueprintsT2Sea[math_random(1,#ScavengerBlueprintsT2Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + blueprint = ScavengerBlueprintsT3Sea[math_random(1,#ScavengerBlueprintsT3Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + blueprint = ScavengerBlueprintsT4Sea[math_random(1,#ScavengerBlueprintsT4Sea)] + else + blueprint = ScavengerBlueprintsT0Sea[math_random(1,#ScavengerBlueprintsT0Sea)] + end + end + posradius = blueprint(posx, posy, posz, GaiaTeamID, true) + canBuildHere = posLosCheck(posx, posy, posz, posradius) + if canBuildHere then + canBuildHere = posOccupied(posx, posy, posz, posradius) + end + if canBuildHere then + canBuildHere = posCheck(posx, posy, posz, posradius) + end + + if canBuildHere then + -- let's do this shit + blueprint(posx, posy, posz, GaiaTeamID, false) + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz-posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz-posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz-posradius, math_random(0,3),GaiaTeamID) + end + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Modules/constructor_controller.lua b/LuaRules/Gadgets/scavengers/Modules/constructor_controller.lua new file mode 100644 index 000000000..6772d5c69 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/constructor_controller.lua @@ -0,0 +1,240 @@ +Spring.Echo("[Scavengers] Constructor Controller initialized") + +VFS.Include("luarules/gadgets/scavengers/Configs/"..GameShortName.."/UnitLists/constructors.lua") +Blueprints2List = VFS.DirList('luarules/gadgets/scavengers/Blueprints/'..GameShortName..'/Constructor/','*.lua') +for i = 1,#Blueprints2List do + VFS.Include(Blueprints2List[i]) + Spring.Echo("Scav Blueprints Directory: " ..Blueprints2List[i]) +end +local constructortimer = constructorControllerModuleConfig.constructortimerstart + +scavvoicenotif = 2 + +function AssistantOrders(n, scav) + local x,y,z = Spring.GetUnitPosition(scav) + Spring.GiveOrderToUnit(scav, CMD.PATROL,{x-100,y,z}, {"shift"}) + Spring.GiveOrderToUnit(scav, CMD.PATROL,{x+100,y,z}, {"shift"}) + Spring.GiveOrderToUnit(scav, CMD.PATROL,{x,y,z-100}, {"shift"}) + Spring.GiveOrderToUnit(scav, CMD.PATROL,{x,y,z+100}, {"shift"}) +end + +function ResurrectorOrders(n, scav) + local mapcenterX = mapsizeX/2 + local mapcenterZ = mapsizeZ/2 + local mapcenterY = Spring.GetGroundHeight(mapcenterX, mapcenterZ) + local mapdiagonal = math.ceil(math.sqrt((mapsizeX*mapsizeX)+(mapsizeZ*mapsizeZ))) + Spring.GiveOrderToUnit(scav, CMD.RESURRECT,{mapcenterX+math_random(-100,100),mapcenterY,mapcenterZ+math_random(-100,100),mapdiagonal}, 0) +end + +function CollectorOrders(n, scav) + local mapcenterX = mapsizeX/2 + local mapcenterZ = mapsizeZ/2 + local mapcenterY = Spring.GetGroundHeight(mapcenterX, mapcenterZ) + local mapdiagonal = math.ceil(math.sqrt((mapsizeX*mapsizeX)+(mapsizeZ*mapsizeZ))) + Spring.GiveOrderToUnit(scav, CMD.RECLAIM,{mapcenterX+math_random(-100,100),mapcenterY,mapcenterZ+math_random(-100,100),mapdiagonal}, 0) +end + +function ReclaimerOrders(n, scav) + local nearestenemy = Spring.GetUnitNearestEnemy(scav, 999999, false) + Spring.GiveOrderToUnit(scav, CMD.RECLAIM,{nearestenemy}, 0) + local x,y,z = Spring.GetUnitPosition(nearestenemy) + Spring.GiveOrderToUnit(scav, CMD.FIGHT,{x,y,z}, {"meta", "shift", "alt"}) +end + +function SpawnConstructor(n) + if (constructortimer > constructorControllerModuleConfig.constructortimer or CountScavConstructors() < constructorControllerModuleConfig.minimumconstructors ) and numOfSpawnBeacons > 0 and constructortimer > 4 then + local scavengerunits = Spring.GetTeamUnits(GaiaTeamID) + SpawnBeacons = {} + for i = 1,#scavengerunits do + local scav = scavengerunits[i] + local scavDef = Spring.GetUnitDefID(scav) + if scavSpawnBeacon[scav] then + table.insert(SpawnBeacons,scav) + end + end + for b = 1,10 do + local pickedBeaconTest = SpawnBeacons[math_random(1,#SpawnBeacons)] + local _,_,_,pickedBeaconCaptureProgress = Spring.GetUnitHealth(pickedBeaconTest) + if pickedBeaconCaptureProgress == 0 then + pickedBeacon = pickedBeaconTest + break + else + pickedBeacon = 1234567890 + end + end + if pickedBeacon == 1234567890 then + return + end + posx,posy,posz = Spring.GetUnitPosition(pickedBeacon) + local nearestEnemy = Spring.GetUnitNearestEnemy(pickedBeacon, 99999, false) + local nearestEnemyTeam = Spring.GetUnitTeam(nearestEnemy) + if nearestEnemyTeam == bestTeam then + canSpawnCommanderHere = true + else + local r = math_random(0,4) + if r == 0 then + canSpawnCommanderHere = true + else + canSpawnCommanderHere = false + end + end + if canSpawnCommanderHere then + posradius = 48 + --Spring.GiveOrderToUnit(pickedBeacon, CMD.SELFD,{}, {"shift"}) + if not anothercommander then + ScavSendNotification("scav_scavcomdetected") + anothercommander = true + else + local s = math_random(0,scavvoicenotif) + if s == 0 then + ScavSendNotification("scav_scavadditionalcomdetected") + elseif s == 1 then + ScavSendNotification("scav_scavanotherscavcomdetected") + elseif s == 2 then + ScavSendNotification("scav_scavnewcomentered") + elseif s == 3 then + ScavSendNotification("scav_scavcomspotted") + elseif s == 4 then + ScavSendNotification("scav_scavcomnewdetect") + else + ScavSendMessage("A Scavenger Commander detected") + end + if scavvoicenotif < 20 then + scavvoicenotif = scavvoicenotif + 1 + end + end + SpawnBeacon(n) + constructortimer = constructortimer - constructorControllerModuleConfig.constructortimer + local r = ConstructorsList[math_random(1,#ConstructorsList)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID,n+90) + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID) + if constructorControllerModuleConfig.useresurrectors then + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz-posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz+posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx-posradius, posy, posz-posradius, math_random(0,3),GaiaTeamID) + Spring.CreateUnit("scavengerdroppod_scav", posx+posradius, posy, posz-posradius, math_random(0,3),GaiaTeamID) + if posy > 0 then + local r2 = Resurrectors[math_random(1,#Resurrectors)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx+32, posy, posz, math_random(0,3),GaiaTeamID,n+90+1) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx-32, posy, posz, math_random(0,3),GaiaTeamID,n+90+2) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz+32, math_random(0,3),GaiaTeamID,n+90+3) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz-32, math_random(0,3),GaiaTeamID,n+90+4) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx+32, posy, posz+32, math_random(0,3),GaiaTeamID,n+90+5) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx-32, posy, posz-32, math_random(0,3),GaiaTeamID,n+90+6) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx-32, posy, posz+32, math_random(0,3),GaiaTeamID,n+90+7) + QueueSpawn(r2..scavconfig.unitnamesuffix, posx+32, posy, posz-32, math_random(0,3),GaiaTeamID,n+90+8) + elseif constructorControllerModuleConfig.searesurrectors == true then + local r3 = ResurrectorsSea[math_random(1,#ResurrectorsSea)] + QueueSpawn(r3..scavconfig.unitnamesuffix, posx+32, posy, posz+32, math_random(0,3),GaiaTeamID,n+90+1) + QueueSpawn(r3..scavconfig.unitnamesuffix, posx-32, posy, posz-32, math_random(0,3),GaiaTeamID,n+90+2) + QueueSpawn(r3..scavconfig.unitnamesuffix, posx-32, posy, posz+32, math_random(0,3),GaiaTeamID,n+90+3) + QueueSpawn(r3..scavconfig.unitnamesuffix, posx+32, posy, posz-32, math_random(0,3),GaiaTeamID,n+90+4) + end + end + else + constructortimer = constructortimer + math.ceil(n/constructorControllerModuleConfig.constructortimerreductionframes) + end + else + constructortimer = constructortimer + math.ceil(n/constructorControllerModuleConfig.constructortimerreductionframes) + end +end + +ConstructorNumberOfRetries = {} +function ConstructNewBlueprint(n, scav) + if not ConstructorNumberOfRetries[scav] then + ConstructorNumberOfRetries[scav] = 0 + end + ConstructorNumberOfRetries[scav] = ConstructorNumberOfRetries[scav] + 1 + local x,y,z = Spring.GetUnitPosition(scav) + local posx = math_random(x-(50*ConstructorNumberOfRetries[scav]),x+(50*ConstructorNumberOfRetries[scav])) + local posz = math_random(z-(50*ConstructorNumberOfRetries[scav]),z+(50*ConstructorNumberOfRetries[scav])) + local posy = Spring.GetGroundHeight(posx, posz) + local spawnTier = math_random(1,100) + local unitCount = Spring.GetTeamUnitCount(GaiaTeamID) + if unitCount + 200 < scavMaxUnits then + if posy > 0 then + if spawnTier <= TierSpawnChances.T0 then + blueprint = ScavengerConstructorBlueprintsT0[math_random(1,#ScavengerConstructorBlueprintsT0)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + blueprint = ScavengerConstructorBlueprintsT1[math_random(1,#ScavengerConstructorBlueprintsT1)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + blueprint = ScavengerConstructorBlueprintsT2[math_random(1,#ScavengerConstructorBlueprintsT2)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + blueprint = ScavengerConstructorBlueprintsT3[math_random(1,#ScavengerConstructorBlueprintsT3)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + blueprint = ScavengerConstructorBlueprintsT3[math_random(1,#ScavengerConstructorBlueprintsT3)] + else + blueprint = ScavengerConstructorBlueprintsT0[math_random(1,#ScavengerConstructorBlueprintsT0)] + end + elseif posy <= 0 then + if spawnTier <= TierSpawnChances.T0 then + blueprint = ScavengerConstructorBlueprintsT0Sea[math_random(1,#ScavengerConstructorBlueprintsT0Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + blueprint = ScavengerConstructorBlueprintsT1Sea[math_random(1,#ScavengerConstructorBlueprintsT1Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + blueprint = ScavengerConstructorBlueprintsT2Sea[math_random(1,#ScavengerConstructorBlueprintsT2Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + blueprint = ScavengerConstructorBlueprintsT3Sea[math_random(1,#ScavengerConstructorBlueprintsT3Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + blueprint = ScavengerConstructorBlueprintsT3Sea[math_random(1,#ScavengerConstructorBlueprintsT3Sea)] + else + blueprint = ScavengerConstructorBlueprintsT0Sea[math_random(1,#ScavengerConstructorBlueprintsT0Sea)] + end + end + else + local mapcenterX = mapsizeX/2 + local mapcenterZ = mapsizeZ/2 + local mapcenterY = Spring.GetGroundHeight(mapcenterX, mapcenterZ) + local mapdiagonal = math.ceil(math.sqrt((mapsizeX*mapsizeX)+(mapsizeZ*mapsizeZ))) + Spring.GiveOrderToUnit(scav, CMD.RECLAIM,{mapcenterX+math_random(-100,100),mapcenterY,mapcenterZ+math_random(-100,100),mapdiagonal}, 0) + Spring.GiveOrderToUnit(scav, CMD.RECLAIM,{mapcenterX+math_random(-100,100),mapcenterY,mapcenterZ+math_random(-100,100),mapdiagonal}, {"shift"}) + end + + posradius = blueprint(scav, posx, posy, posz, GaiaTeamID, true) + canConstructHere = posOccupied(posx, posy, posz, posradius) + if canConstructHere then + canConstructHere = posCheck(posx, posy, posz, posradius) + end + if canConstructHere then + canConstructHere = posStartboxCheck(posx, posy, posz, posradius) + end + if canConstructHere then + canConstructHere = posMapsizeCheck(posx, posy, posz, posradius) + end + + if canConstructHere then + -- let's do this shit + Spring.GiveOrderToUnit(scav, CMD.MOVE,{posx+math.random(-posradius,posradius),posy+500,posz+math.random(-posradius,posradius)}, {"shift"}) + blueprint(scav, posx, posy, posz, GaiaTeamID, false) + ConstructorNumberOfRetries[scav] = 0 + else + return + end + -- if canConstructHere then + -- -- let's do this shit + -- blueprint(scav, posx, posy, posz, GaiaTeamID, false) + -- local x = math_random(x-1000,x+1000) + -- local z = math_random(z-1000,z+1000) + -- local y = Spring.GetGroundHeight(x,z) + -- Spring.GiveOrderToUnit(scav, CMD.MOVE,{x,y,z}, {"shift"}) + -- local x = math_random(x-100,x+100) + -- local z = math_random(z-100,z+100) + -- local y = Spring.GetGroundHeight(x,z) + -- Spring.GiveOrderToUnit(scav, CMD.MOVE,{x,y,z}, {"shift"}) + -- else + -- local x,y,z = Spring.GetUnitPosition(scav) + -- local x = math_random(x-500,x+500) + -- local z = math_random(z-500,z+500) + -- local y = Spring.GetGroundHeight(x,z) + -- Spring.GiveOrderToUnit(scav, CMD.MOVE,{x,y,z}, {"shift"}) + -- local x,y,z = Spring.GetUnitPosition(scav) + -- local x = math_random(x-100,x+100) + -- local z = math_random(z-100,z+100) + -- local y = Spring.GetGroundHeight(x,z) + -- Spring.GiveOrderToUnit(scav, CMD.MOVE,{x,y,z}, {"shift"}) + -- end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/scavengers/Modules/factory_controller.lua b/LuaRules/Gadgets/scavengers/Modules/factory_controller.lua new file mode 100644 index 000000000..cee9a6888 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/factory_controller.lua @@ -0,0 +1,21 @@ +VFS.Include("luarules/gadgets/scavengers/Configs/"..GameShortName.."/UnitLists/factories.lua") + +function FactoryProduction(n, scav, scavDef) + local buildOptions = UnitDefs[scavDef].buildOptions + local buildUnit = buildOptions[math_random(1,#buildOptions)] + local buildName = UnitDefs[buildUnit].name + isExcluded = {} + for i = 1,#FactoriesExcludedUnits do + if string.find(buildName..scavconfig.unitnamesuffix, FactoriesExcludedUnits[i]) then + isExcluded[scavDef] = true + end + end + if not isExcluded[scavDef] then + local x,y,z = Spring.GetUnitPosition(scav) + local a = math_random(3,10) + for a = 1,a do + Spring.GiveOrderToUnit(scav, -buildUnit, {x, y, z, 0}, 0) + end + end + isExcluded[scavDef] = nil +end diff --git a/LuaRules/Gadgets/scavengers/Modules/messenger.lua b/LuaRules/Gadgets/scavengers/Modules/messenger.lua new file mode 100644 index 000000000..c6fbf93d6 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/messenger.lua @@ -0,0 +1,140 @@ + +--ScavSendMessage("addmessage Global score: "..globalScore) + +function pregameMessages(n) + if n == 1800 then + ScavSendMessage("WARNING") + ScavSendVoiceMessage(scavengerSoundPath.."warning.wav") + end + + if n == 1830 then + ScavSendNotification("scav_unidentifiedObjectsDetected") + end + + if n == 2100 then + ScavSendMessage("... waiting for further data ... ") + ScavSendVoiceMessage(scavengerSoundPath.."waitingForIntel.wav") + end + + if n == 3900 then + ScavSendNotification("scav_classifiedAsScavengers") + end + + if n == 6300 then + ScavSendMessage("WARNING") + ScavSendVoiceMessage(scavengerSoundPath.."warning.wav") + end + + if n == 6330 then + ScavSendMessage("Scavenger Droppods detected nearby") + ScavSendVoiceMessage(scavengerSoundPath.."droppodsDetectedNearby.wav") + end + + if n == 7200 then + ScavSendMessage("WARNING") + ScavSendVoiceMessage(scavengerSoundPath.."warning.wav") + end + + if n == 7230 then + ScavSendNotification("scav_droppodsDetectedInArea") + end + + if n == 9000 then + ScavSendMessage("WARNING") + ScavSendVoiceMessage(scavengerSoundPath.."warning.wav") + end + + if n == 9030 then + ScavSendNotification("scav_droppingUnits") + end + +end + +function BossFightMessages(BossWaveTimeLeft) + if not BossWaveFirstMessage then + ScavSendNotification("scav_scavfinalattack") + BossWaveFirstMessage = true + end + + if BossWaveTimeLeft == 750 then + ScavSendNotification("scav_scavfinal12remain") + end + + if BossWaveTimeLeft == 600 then + ScavSendNotification("scav_scavfinal10remain") + end + + if BossWaveTimeLeft == 540 then + ScavSendNotification("scav_scavfinal09remain") + end + + if BossWaveTimeLeft == 480 then + ScavSendNotification("scav_scavfinal08remain") + end + + if BossWaveTimeLeft == 420 then + ScavSendNotification("scav_scavfinal07remain") + end + + if BossWaveTimeLeft == 360 then + ScavSendNotification("scav_scavfinal06remain") + end + + if BossWaveTimeLeft == 300 then + ScavSendNotification("scav_scavfinal05remain") + end + + if BossWaveTimeLeft == 240 then + ScavSendNotification("scav_scavfinal04remain") + end + + if BossWaveTimeLeft == 180 then + ScavSendNotification("scav_scavfinal03remain") + end + + if BossWaveTimeLeft == 120 then + ScavSendNotification("scav_scavfinal02remain") + end + + if BossWaveTimeLeft == 60 then + ScavSendNotification("scav_scavfinal01remain") + end + + if BossWaveTimeLeft == 10 then + -- since ScavSendNotification would put this in a queue, we cant use that method for this message + ScavSendVoiceMessage(scavengerSoundPath.."scavfinalcountdown.wav") + ScavSendMessage("10") + end + + if BossWaveTimeLeft == 9 then + ScavSendMessage("9") + end + if BossWaveTimeLeft == 8 then + ScavSendMessage("8") + end + if BossWaveTimeLeft == 7 then + ScavSendMessage("7") + end + if BossWaveTimeLeft == 6 then + ScavSendMessage("6") + end + if BossWaveTimeLeft == 5 then + ScavSendMessage("5") + end + if BossWaveTimeLeft == 4 then + ScavSendMessage("4") + end + if BossWaveTimeLeft == 3 then + ScavSendMessage("3") + end + if BossWaveTimeLeft == 2 then + ScavSendMessage("2") + end + if BossWaveTimeLeft == 1 then + ScavSendMessage("1") + end + + if BossWaveTimeLeft == 0 then + ScavSendNotification("scav_scavfinalvictory") + end +end diff --git a/LuaRules/Gadgets/scavengers/Modules/nuke_controller.lua b/LuaRules/Gadgets/scavengers/Modules/nuke_controller.lua new file mode 100644 index 000000000..7104375be --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/nuke_controller.lua @@ -0,0 +1,24 @@ + +function SendRandomNukeOrder(n, scav) + local unitDefID = Spring.GetUnitDefID(scav) + local unitRange = Spring.GetUnitMaxRange(scav) + if unitRange and unitRange > 0 then + local posx, posy, posz = Spring.GetUnitPosition(scav) + local possibleTargets = Spring.GetUnitsInCylinder(posx, posz, unitRange) + local targetnum = #possibleTargets + if targetnum and targetnum > 1 then + local r = math_random(1,targetnum) + local targetID = possibleTargets[r] + local targetTeam = Spring.GetUnitTeam(targetID) + local targetNeutral = Spring.GetUnitNeutral(targetID) + if targetTeam ~= GaiaTeamID and targetNeutral == false then + local targetDefID = Spring.GetUnitDefID(targetID) + local targetCanFly = UnitDefs[targetDefID].canFly + if targetCanFly == false then + local tx, ty, tz = Spring.GetUnitPosition(targetID) + Spring.GiveOrderToUnit(scav, CMD.ATTACK,{tx,ty,tz}, {}) + end + end + end + end +end diff --git a/LuaRules/Gadgets/scavengers/Modules/reinforcements_module.lua b/LuaRules/Gadgets/scavengers/Modules/reinforcements_module.lua new file mode 100644 index 000000000..992c514c5 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/reinforcements_module.lua @@ -0,0 +1,366 @@ +local ReinforcementsCountPerTeam = {} +local TryingToSpawnReinforcements = {} +local ReinforcementsFaction = {} +local ReinforcementsChancePerTeam = {} +local numOfSpawnBeaconsTeamsForSpawn = {} +local CaptureProgressForBeacons = {} + +function CaptureBeacons(n) + local scavengerunits = Spring.GetTeamUnits(GaiaTeamID) + local spGetUnitTeam = Spring.GetUnitTeam + + for i = 1,#scavengerunits do + local scav = scavengerunits[i] + local scavDef = Spring.GetUnitDefID(scav) + if scavSpawnBeacon[scav] then + if not CaptureProgressForBeacons[scav] then + CaptureProgressForBeacons[scav] = 0 + Spring.SetUnitHealth(scav, {capture = CaptureProgressForBeacons[scav]}) + end + local posx,posy,posz = Spring.GetUnitPosition(scav) + --Spring.Echo("posx "..posx) + --Spring.Echo("posz "..posz) + unitsAround = Spring.GetUnitsInCylinder(posx, posz, 256) + --Spring.Echo("#unitsAround "..#unitsAround) + CapturingUnits = {} + CapturingUnitsTeam = {} + CapturingUnitsTeamTest = {} + local TeamsCapturing = 0 + CapturingUnits[scav] = 0 + + for j = 1,#unitsAround do + local unitID = unitsAround[j] + local unitTeamID = spGetUnitTeam(unitID) + local unitAllyTeam = Spring.GetUnitAllyTeam(unitID) + local LuaAI = Spring.GetTeamLuaAI(unitTeamID) + local _,_,_,isAI,_,_ = Spring.GetTeamInfo(unitTeamID) + if (not LuaAI) and unitTeamID ~= GaiaTeamID and unitTeamID ~= Spring.GetGaiaTeamID() and (not isAI) then + captureraiTeam = false + else + captureraiTeam = false -- true + end + if not CapturingUnitsTeamTest[unitAllyTeam] then + CapturingUnitsTeamTest[unitAllyTeam] = true + if unitTeamID ~= GaiaTeamID and captureraiTeam == false then + TeamsCapturing = TeamsCapturing + 1 + if TeamsCapturing > 1 then + break + end + end + end + captureraiTeam = nil + end + + for j = 1,#unitsAround do + local unitID = unitsAround[j] + local unitTeamID = spGetUnitTeam(unitID) + if not CapturingUnitsTeam[unitTeamID] then + CapturingUnitsTeam[unitTeamID] = 0 + end + local unitDefID = Spring.GetUnitDefID(unitID) + local LuaAI = Spring.GetTeamLuaAI(unitTeamID) + local _,_,_,isAI,_,_ = Spring.GetTeamInfo(unitTeamID) + + if (not LuaAI) and unitTeamID ~= GaiaTeamID and unitTeamID ~= Spring.GetGaiaTeamID() and (not isAI) then + captureraiTeam = false + else + captureraiTeam = false -- true + end + + if not CapturingUnitsTeam[unitTeamID] then + CapturingUnitsTeam[unitTeamID] = 0 + end + + for k = 1,#BeaconCaptureExcludedUnits do + if UnitDefs[unitDefID].name == BeaconCaptureExcludedUnits[k] then + IsUnitExcluded = true + break + else + IsUnitExcluded = false + end + end + + if unitDefID == scavDef then + CaptureProgressForBeacons[scav] = CaptureProgressForBeacons[scav] - 0.0005 + --Spring.Echo("uncapturing myself") + elseif unitTeamID == GaiaTeamID and (not unitDefID == scavDef) then + CaptureProgressForBeacons[scav] = CaptureProgressForBeacons[scav] - 1 + --Spring.Echo("uncapturing our beacon") + elseif captureraiTeam == false and unitTeamID ~= GaiaTeamID and unitTeamID ~= Spring.GetGaiaTeamID() and IsUnitExcluded == false and (not UnitDefs[unitDefID].canFly) then + CaptureProgressForBeacons[scav] = CaptureProgressForBeacons[scav] + 0.001 + CapturingUnitsTeam[unitTeamID] = CapturingUnitsTeam[unitTeamID] + 1 + --Spring.Echo("capturing scav beacon") + end + if CaptureProgressForBeacons[scav] < 0 then + CaptureProgressForBeacons[scav] = 0 + --Spring.Echo("capture below 0") + end + if CaptureProgressForBeacons[scav] > 1 then + CaptureProgressForBeacons[scav] = 1 + --Spring.Echo("capture above 1") + end + Spring.SetUnitHealth(scav, {capture = CaptureProgressForBeacons[scav]}) + + if TeamsCapturing < 2 and captureraiTeam == false and CaptureProgressForBeacons[scav] >= 1 then + CaptureProgressForBeacons[scav] = 0 + Spring.SetUnitHealth(scav, {capture = 0}) + Spring.TransferUnit(scav, unitTeamID, true) + captureraiTeam = nil + break + end + captureraiTeam = nil + IsUnitExcluded = nil + end + CapturingUnits = nil + CapturingUnitsTeam = nil + unitsAround = nil + end + end +end + +function SetBeaconsResourceProduction(n) + if globalScore then + local units = Spring.GetAllUnits() + local minutes = math.ceil(Spring.GetGameSeconds()/300) + local beaconmetalproduction = minutes + local beaconenergyproduction = beaconmetalproduction*20 + for i = 1,#units do + local unitID = units[i] + local unitDefID = Spring.GetUnitDefID(unitID) + local name = UnitDefs[unitDefID].name + if name == "scavengerdroppodbeacon_scav" then + --Spring.AddUnitResource(unitID, "m", beaconmetalproduction) + Spring.AddUnitResource(unitID, "e", beaconenergyproduction) + end + end + end +end + +-- function SpawnDefencesAfterCapture(unitID, teamID) + -- local spawnTier = math_random(1,100) + -- if spawnTier <= TierSpawnChances.T0 then + -- grouptier = BeaconDefenceStructuresT0 + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + -- grouptier = BeaconDefenceStructuresT1 + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + -- grouptier = BeaconDefenceStructuresT2 + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + -- grouptier = BeaconDefenceStructuresT3 + -- end + -- if spawnTier <= TierSpawnChances.T0 then + -- grouptiersea = StartboxDefenceStructuresT0Sea + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + -- grouptiersea = StartboxDefenceStructuresT1Sea + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + -- grouptiersea = StartboxDefenceStructuresT2Sea + -- elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + -- grouptiersea = StartboxDefenceStructuresT3Sea + -- end + + -- local posx,posy,posz = Spring.GetUnitPosition(unitID) + -- local posy = Spring.GetGroundHeight(posx, posz) + -- local n = Spring.GetGameFrame() + + -- local r = grouptier[math_random(1,#grouptier)] + -- local r2 = grouptiersea[math_random(1,#grouptiersea)] + -- Spring.CreateUnit("scavengerdroppodfriendly", posx-128, posy, posz-128, math_random(0,3),teamID) + -- local posy = Spring.GetGroundHeight(posx-128, posz-128) + -- if posy > 0 then + -- QueueSpawn(r..scavconfig.unitnamesuffix, posx-128, posy, posz-128, math_random(0,3),teamID, n+90) + -- else + -- QueueSpawn(r2..scavconfig.unitnamesuffix, posx-128, posy, posz-128, math_random(0,3),teamID, n+90) + -- end + + -- local r = grouptier[math_random(1,#grouptier)] + -- local r2 = grouptiersea[math_random(1,#grouptiersea)] + -- Spring.CreateUnit("scavengerdroppodfriendly", posx+128, posy, posz+128, math_random(0,3),teamID) + -- local posy = Spring.GetGroundHeight(posx+128, posz+128) + -- if posy > 0 then + -- QueueSpawn(r..scavconfig.unitnamesuffix, posx+128, posy, posz+128, math_random(0,3),teamID, n+90) + -- else + -- QueueSpawn(r2..scavconfig.unitnamesuffix, posx+128, posy, posz+128, math_random(0,3),teamID, n+90) + -- end + + -- local r = grouptier[math_random(1,#grouptier)] + -- local r2 = grouptiersea[math_random(1,#grouptiersea)] + -- Spring.CreateUnit("scavengerdroppodfriendly", posx-128, posy, posz+128, math_random(0,3),teamID) + -- local posy = Spring.GetGroundHeight(posx-128, posz+128) + -- if posy > 0 then + -- QueueSpawn(r..scavconfig.unitnamesuffix, posx-128, posy, posz+128, math_random(0,3),teamID, n+90) + -- else + -- QueueSpawn(r2..scavconfig.unitnamesuffix, posx-128, posy, posz+128, math_random(0,3),teamID, n+90) + -- end + + -- local r = grouptier[math_random(1,#grouptier)] + -- local r2 = grouptiersea[math_random(1,#grouptiersea)] + -- Spring.CreateUnit("scavengerdroppodfriendly", posx+128, posy, posz-128, math_random(0,3),teamID) + -- local posy = Spring.GetGroundHeight(posx+128, posz-128) + -- if posy > 0 then + -- QueueSpawn(r..scavconfig.unitnamesuffix, posx+128, posy, posz-128, math_random(0,3),teamID, n+90) + -- else + -- QueueSpawn(r2..scavconfig.unitnamesuffix, posx+128, posy, posz-128, math_random(0,3),teamID, n+90) + -- end + + -- grouptier = nil + -- grouptiersea = nil +-- end + +function spawnPlayerReinforcements(n) + --mapsizeX + --mapsizeZ + --ScavengerStartboxXMin + --ScavengerStartboxZMin + --ScavengerStartboxXMax + --ScavengerStartboxZMax + --GaiaTeamID + --GaiaAllyTeamID + --posCheck(posx, posy, posz, posradius) + --posOccupied(posx, posy, posz, posradius) + for _,teamID in ipairs(Spring.GetTeamList()) do + local LuaAI = Spring.GetTeamLuaAI(teamID) + local _,teamLeader,isDead,isAI,_,allyTeamID = Spring.GetTeamInfo(teamID) + + if (not LuaAI) and teamID ~= GaiaTeamID and teamID ~= Spring.GetGaiaTeamID() and (not isAI) then + local playerName = Spring.GetPlayerInfo(teamLeader) + if not numOfSpawnBeaconsTeams[teamID] then + numOfSpawnBeaconsTeams[teamID] = 0 + end + if not numOfSpawnBeaconsTeamsForSpawn[teamID] or numOfSpawnBeaconsTeamsForSpawn[teamID] == 0 then + numOfSpawnBeaconsTeamsForSpawn[teamID] = 2 + else + numOfSpawnBeaconsTeamsForSpawn[teamID] = numOfSpawnBeaconsTeams[teamID] + 2 + end + + + if not ReinforcementsCountPerTeam[teamID] then + ReinforcementsCountPerTeam[teamID] = 0 + end + if not ReinforcementsChancePerTeam[teamID] then + ReinforcementsChancePerTeam[teamID] = (((unitSpawnerModuleConfig.spawnchance)*10)/numOfSpawnBeaconsTeamsForSpawn[teamID]) + end + + if not isDead then + if TryingToSpawnReinforcements[teamID] == true then + local playerunits = Spring.GetTeamUnits(teamID) + PlayerSpawnBeacons = {} + for i = 1,#playerunits do + local playerbeacon = playerunits[i] + local playerbeaconDef = Spring.GetUnitDefID(playerbeacon) + local UnitName = UnitDefs[playerbeaconDef].name + if UnitName == "scavengerdroppodbeacon_scav" then + table.insert(PlayerSpawnBeacons,playerbeacon) + end + end + --numOfSpawnBeaconsTeams[teamID] = 10 + if numOfSpawnBeaconsTeams[teamID] == 1 then + pickedBeacon = PlayerSpawnBeacons[1] + elseif numOfSpawnBeaconsTeams[teamID] > 1 then + pickedBeacon = PlayerSpawnBeacons[math_random(1,#PlayerSpawnBeacons)] + else + pickedBeacon = nil + TryingToSpawnReinforcements[teamID] = false + ReinforcementsChancePerTeam[teamID] = (((unitSpawnerModuleConfig.spawnchance)*10)/numOfSpawnBeaconsTeamsForSpawn[teamID]) + end + PlayerSpawnBeacons = nil + if pickedBeacon then + if not globalScore then + teamsCheck() + end + local groupsize = (bestTeamScore / unitSpawnerModuleConfig.globalscoreperoneunit)*spawnmultiplier + local groupsize = math.ceil(groupsize*2) + if scorePerTeam[teamID] < bestTeamScore*2 then + groupsize = math.ceil(groupsize*2) + end + local posradius = 160 + local posx,posy,posz = Spring.GetUnitPosition(pickedBeacon) + local posy = Spring.GetGroundHeight(posx, posz) + local spawnTier = math_random(1,100) + local aircraftchance = math_random(0,unitSpawnerModuleConfig.aircraftchance) + if aircraftchance == 0 then + if spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1ReinforcementAirUnits[math_random(1,#T1ReinforcementAirUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2ReinforcementAirUnits[math_random(1,#T2ReinforcementAirUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3ReinforcementAirUnits[math_random(1,#T3ReinforcementAirUnits)] + groupsize = 5 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4ReinforcementAirUnits[math_random(1,#T4ReinforcementAirUnits)] + groupsize = 2 + end + elseif posy > -20 then + if spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1ReinforcementLandUnits[math_random(1,#T1ReinforcementLandUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2ReinforcementLandUnits[math_random(1,#T2ReinforcementLandUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3ReinforcementLandUnits[math_random(1,#T3ReinforcementLandUnits)] + groupsize = 5 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4ReinforcementLandUnits[math_random(1,#T4ReinforcementLandUnits)] + groupsize = 2 + end + elseif posy <= -20 then + if spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1ReinforcementSeaUnits[math_random(1,#T1ReinforcementSeaUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2ReinforcementSeaUnits[math_random(1,#T2ReinforcementSeaUnits)] + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3ReinforcementSeaUnits[math_random(1,#T3ReinforcementSeaUnits)] + groupsize = 5 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4ReinforcementSeaUnits[math_random(1,#T4ReinforcementSeaUnits)] + groupsize = 2 + end + ScavSendMessage(playerName .."'s reinforcements detected. Units: ".. UDN[groupunit1].humanName .. "s.") + end + for i = 1,groupsize do + local posx = posx+(math_random(-posradius,posradius)) + local posz = posz+(math_random(-posradius,posradius)) + local newposy = Spring.GetGroundHeight(posx, posz) + if posy >= -20 and newposy >= -20 then + if i then + QueueSpawn("scavengerdroppodfriendly", posx, posy, posz, math_random(0,3),GaiaTeamID, n+(i*60)) + QueueSpawn(groupunit..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90+(i*60)) + else + QueueSpawn("scavengerdroppodfriendly", posx, posy, posz, math_random(0,3),GaiaTeamID, n) + QueueSpawn(groupunit..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + elseif posy < -20 and newposy < -20 then + if i then + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n+(i*60)) + QueueSpawn(groupunit..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90+(i*60)) + else + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n) + QueueSpawn(groupunit..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + end + end + groupsize = nil + groupunit1 = nil + groupunit2 = nil + TryingToSpawnReinforcements[teamID] = false + ReinforcementsCountPerTeam[teamID] = ReinforcementsCountPerTeam[teamID] + 1 + end + else + local r = math_random(0,ReinforcementsChancePerTeam[teamID]) + if r == 0 or ReinforcementsCountPerTeam[teamID] == 0 then + TryingToSpawnReinforcements[teamID] = true + ReinforcementsChancePerTeam[teamID] = (((unitSpawnerModuleConfig.spawnchance)*10)/numOfSpawnBeaconsTeamsForSpawn[teamID]) + else + TryingToSpawnReinforcements[teamID] = false + ReinforcementsChancePerTeam[teamID] = ReinforcementsChancePerTeam[teamID] - 1 + end + end + end + end + end + pickedBeacon = nil +end + diff --git a/LuaRules/Gadgets/scavengers/Modules/spawn_beacons.lua b/LuaRules/Gadgets/scavengers/Modules/spawn_beacons.lua new file mode 100644 index 000000000..be25faa6a --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/spawn_beacons.lua @@ -0,0 +1,250 @@ +local BeaconSpawnChance = unitSpawnerModuleConfig.beaconspawnchance +local UnitLists = VFS.DirList('luarules/gadgets/scavengers/Configs/'..GameShortName..'/UnitLists/','*.lua') +for i = 1,#UnitLists do + VFS.Include(UnitLists[i]) + Spring.Echo("Scav Units Directory: " ..UnitLists[i]) +end + +function SpawnBeacon(n) + if n and n > 7200 then + if scavengersAIEnabled == true then -- Survival + local BeaconSpawnChance = math_random(0,BeaconSpawnChance) + if numOfSpawnBeacons <= unitSpawnerModuleConfig.minimumspawnbeacons then + BeaconSpawnChance = 0 + end + if BossWaveTimeLeft and BossWaveTimeLeft < 1 then + BeaconSpawnChance = 1 -- can't spawn + end + if BeaconSpawnChance == 0 or canSpawnBeaconHere == false then + local posx = math_random(80,mapsizeX-80) + local posz = math_random(80,mapsizeZ-80) + local posy = Spring.GetGroundHeight(posx, posz) + local posradius = 80 + canSpawnBeaconHere = posCheck(posx, posy, posz, posradius) + if canSpawnBeaconHere then + if globalScore then + local g = math_random(0,3) + if ScavengerStartboxExists and g ~= 0 then + if ScavengerStartboxXMin < posx and ScavengerStartboxXMax > posx and ScavengerStartboxZMin < posz and ScavengerStartboxZMax > posz then + canSpawnBeaconHere = true + else + canSpawnBeaconHere = false + end + else + -- elseif globalScore > scavconfig.timers.OnlyLos then + -- canSpawnBeaconHere = posLosCheckOnlyLOS(posx, posy, posz,posradius) + if globalScore > scavconfig.timers.NoRadar then + canSpawnBeaconHere = posLosCheckNoRadar(posx, posy, posz,posradius) + else + canSpawnBeaconHere = posLosCheck(posx, posy, posz,posradius) + end + end + end + end + if canSpawnBeaconHere then + canSpawnBeaconHere = posOccupied(posx, posy, posz, posradius) + end + + if canSpawnBeaconHere then + local spawnTier = math_random(1,100) + if spawnTier <= TierSpawnChances.T0 then + grouptier = BeaconDefenceStructuresT0 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + grouptier = BeaconDefenceStructuresT1 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + grouptier = BeaconDefenceStructuresT2 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + grouptier = BeaconDefenceStructuresT3 + else + grouptier = BeaconDefenceStructuresT0 + end + if spawnTier <= TierSpawnChances.T0 then + grouptiersea = StartboxDefenceStructuresT0Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + grouptiersea = StartboxDefenceStructuresT1Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + grouptiersea = StartboxDefenceStructuresT2Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + grouptiersea = StartboxDefenceStructuresT3Sea + else + grouptiersea = StartboxDefenceStructuresT0Sea + end + + BeaconSpawnChance = unitSpawnerModuleConfig.beaconspawnchance + Spring.CreateUnit("scavengerdroppodbeacon_scav", posx, posy, posz, math_random(0,3),GaiaTeamID) + + + Spring.CreateUnit("scavengerdroppod_scav", posx-128, posy, posz, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx-128, posz) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx-128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx-128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx+128, posy, posz, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx+128, posz) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx+128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx+128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz+128, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx, posz+128) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx, posy, posz+128, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz+128, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz-128, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx, posz-128) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx, posy, posz-128, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz-128, math_random(0,3),GaiaTeamID, n+90) + end + + grouptier = nil + grouptiersea = nil + + end + else + BeaconSpawnChance = BeaconSpawnChance - 1 + if BeaconSpawnChance < 1 then + BeaconSpawnChance = 1 + end + end + else -- PvP + local BeaconSpawnChance = math_random(0,BeaconSpawnChance) + if numOfSpawnBeacons <= unitSpawnerModuleConfig.minimumspawnbeacons then + BeaconSpawnChance = 0 + end + if BossWaveTimeLeft and BossWaveTimeLeft < 1 then + BeaconSpawnChance = 1 -- can't spawn + end + if BeaconSpawnChance == 0 or canSpawnBeaconHere == false then + if not beaconspawnretrycount then + beaconspawnretrycount = 0 + end + local posx = math_random(math.ceil((mapsizeX/2)-(((mapsizeX/2)/60)*beaconspawnretrycount)),math.floor((mapsizeX/2)+(((mapsizeX/2)/60)*beaconspawnretrycount))) + local posz = math_random(math.ceil((mapsizeZ/2)-(((mapsizeZ/2)/60)*beaconspawnretrycount)),math.floor((mapsizeZ/2)+(((mapsizeZ/2)/60)*beaconspawnretrycount))) + if posx < 256 then + posx = 256 + end + if posx > mapsizeX-256 then + posx = mapsizeX-256 + end + if posz < 256 then + posz = 256 + end + if posz > mapsizeZ-256 then + posz = mapsizeZ-256 + end + local posy = Spring.GetGroundHeight(posx, posz) + local posradius = 80 + beaconspawnretrycount = beaconspawnretrycount + 1 + canSpawnBeaconHere = posCheck(posx, posy, posz, posradius) + if canSpawnBeaconHere then + if globalScore then + -- elseif globalScore > scavconfig.timers.NoRadar then + -- canSpawnBeaconHere = posLosCheckNoRadar(posx, posy, posz,posradius) + --else + canSpawnBeaconHere = posLosCheck(posx, posy, posz,posradius) + --end + end + end + if canSpawnBeaconHere then + local posradius = 384 + canSpawnBeaconHere = posOccupied(posx, posy, posz, posradius) + end + + if canSpawnBeaconHere then + beaconspawnretrycount = 0 + local spawnTier = math_random(1,100) + if spawnTier <= TierSpawnChances.T0 then + grouptier = BeaconDefenceStructuresT0 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + grouptier = BeaconDefenceStructuresT1 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + grouptier = BeaconDefenceStructuresT2 + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + grouptier = BeaconDefenceStructuresT3 + end + if spawnTier <= TierSpawnChances.T0 then + grouptiersea = StartboxDefenceStructuresT0Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + grouptiersea = StartboxDefenceStructuresT1Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + grouptiersea = StartboxDefenceStructuresT2Sea + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + grouptiersea = StartboxDefenceStructuresT3Sea + end + + BeaconSpawnChance = unitSpawnerModuleConfig.beaconspawnchance + Spring.CreateUnit("scavengerdroppodbeacon_scav", posx, posy, posz, math_random(0,3),GaiaTeamID) + + + Spring.CreateUnit("scavengerdroppod_scav", posx-128, posy, posz, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx-128, posz) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx-128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx-128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx+128, posy, posz, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx+128, posz) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx+128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx+128, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz+128, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx, posz+128) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx, posy, posz+128, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz+128, math_random(0,3),GaiaTeamID, n+90) + end + + Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz-128, math_random(0,3),GaiaTeamID) + local posy = Spring.GetGroundHeight(posx, posz-128) + if posy > 0 then + local r = grouptier[math_random(1,#grouptier)] + QueueSpawn(r..scavconfig.unitnamesuffix, posx, posy, posz-128, math_random(0,3),GaiaTeamID, n+90) + else + local r2 = grouptiersea[math_random(1,#grouptiersea)] + QueueSpawn(r2..scavconfig.unitnamesuffix, posx, posy, posz-128, math_random(0,3),GaiaTeamID, n+90) + end + + grouptier = nil + grouptiersea = nil + end + posx = nil + posz = nil + else + BeaconSpawnChance = BeaconSpawnChance - 1 + if BeaconSpawnChance < 1 then + BeaconSpawnChance = 1 + end + end + end + end +end diff --git a/LuaRules/Gadgets/scavengers/Modules/startbox_protection.lua b/LuaRules/Gadgets/scavengers/Modules/startbox_protection.lua new file mode 100644 index 000000000..e9481fb91 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/startbox_protection.lua @@ -0,0 +1,136 @@ + +function spawnStartBoxProtection(n) + for i = 1,10 do + --mapsizeX + --mapsizeZ + --ScavengerStartboxXMin + --ScavengerStartboxZMin + --ScavengerStartboxXMax + --ScavengerStartboxZMax + --GaiaTeamID + --GaiaAllyTeamID + --posCheck(posx, posy, posz, posradius) + --posOccupied(posx, posy, posz, posradius) + local r = math_random(0,3) + local r2 = math_random(0,80) + local spread = spawnProtectionConfig.spread + local spawnPosX = math_random(ScavengerStartboxXMin,ScavengerStartboxXMax) + local spawnPosZ = math_random(ScavengerStartboxZMin,ScavengerStartboxZMax) + if r == 0 then -- south edge + spawnPosZ = ScavengerStartboxZMax + spawnDirection = 0 + elseif r == 1 then -- east edge + spawnPosX = ScavengerStartboxXMax + spawnDirection = 1 + elseif r == 2 then -- south edge + spawnPosZ = ScavengerStartboxZMin + spawnDirection = 2 + elseif r == 3 then -- west edge + spawnPosX = ScavengerStartboxXMin + spawnDirection = 3 + end + if r2 == 0 then + spawnPosX = math_random(ScavengerStartboxXMin,ScavengerStartboxXMax) + spawnPosZ = math_random(ScavengerStartboxZMin,ScavengerStartboxZMax) + end + canSpawnDefence = true + if spawnPosX > mapsizeX - 128 or spawnPosX < 128 or spawnPosZ > mapsizeZ - 128 or spawnPosZ < 128 then + canSpawnDefence = false + end + spawnPosX = spawnPosX + math_random(-spread*2,spread*2) + spawnPosZ = spawnPosZ + math_random(-spread*2,spread*2) + if spawnPosX > mapsizeX - 128 or spawnPosX < 128 or spawnPosZ > mapsizeZ - 128 or spawnPosZ < 128 then + canSpawnDefence = false + end + if canSpawnDefence then + local spawnPosY = Spring.GetGroundHeight(spawnPosX, spawnPosZ) + local spawnTier = math_random(1,100) + + if spawnPosY > 0 then + if spawnTier <= TierSpawnChances.T0 then + pickedTurret = StartboxDefenceStructuresT0[math_random(1,#StartboxDefenceStructuresT0)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + pickedTurret = StartboxDefenceStructuresT1[math_random(1,#StartboxDefenceStructuresT1)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + pickedTurret = StartboxDefenceStructuresT2[math_random(1,#StartboxDefenceStructuresT2)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + pickedTurret = StartboxDefenceStructuresT3[math_random(1,#StartboxDefenceStructuresT3)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + pickedTurret = StartboxDefenceStructuresT4[math_random(1,#StartboxDefenceStructuresT4)] + else + pickedTurret = StartboxDefenceStructuresT0[math_random(1,#StartboxDefenceStructuresT0)] + end + elseif spawnPosY <= 0 then + if spawnTier <= TierSpawnChances.T0 then + pickedTurret = StartboxDefenceStructuresT0Sea[math_random(1,#StartboxDefenceStructuresT0Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + pickedTurret = StartboxDefenceStructuresT1Sea[math_random(1,#StartboxDefenceStructuresT1Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + pickedTurret = StartboxDefenceStructuresT2Sea[math_random(1,#StartboxDefenceStructuresT2Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + pickedTurret = StartboxDefenceStructuresT3Sea[math_random(1,#StartboxDefenceStructuresT3Sea)] + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + pickedTurret = StartboxDefenceStructuresT4Sea[math_random(1,#StartboxDefenceStructuresT4Sea)] + else + pickedTurret = StartboxDefenceStructuresT0Sea[math_random(1,#StartboxDefenceStructuresT0Sea)] + end + end + + canSpawnDefence = posCheck(spawnPosX, spawnPosY, spawnPosZ, spread) + if canSpawnDefence then + canSpawnDefence = posOccupied(spawnPosX, spawnPosY, spawnPosZ, spread) + end + + if canSpawnDefence then + QueueSpawn(pickedTurret..scavconfig.unitnamesuffix, spawnPosX, spawnPosY, spawnPosZ, spawnDirection,GaiaTeamID,n+90) + Spring.CreateUnit("scavengerdroppod_scav", spawnPosX, spawnPosY, spawnPosZ, spawnDirection,GaiaTeamID) + end + end + + + spawnPosX = nil + spawnPosZ = nil + spawnDirection = nil + canSpawnDefence = nil + pickedTurret = nil + end +end + +function executeStartBoxProtection(n) + if ScavengerStartboxExists then + local list = Spring.GetUnitsInRectangle(ScavengerStartboxXMin,ScavengerStartboxZMin,ScavengerStartboxXMax,ScavengerStartboxZMax) + for i = 1,#list do + local unitID = list[i] + local unitTeam = Spring.GetUnitTeam(unitID) + if unitTeam ~= GaiaTeamID then + local currentHealth,maxHealth = Spring.GetUnitHealth(unitID) + local damage = maxHealth*0.1 + if damage < currentHealth then + Spring.SetUnitHealth(unitID,currentHealth-damage) + local posx, posy, posz = Spring.GetUnitPosition(unitID) + Spring.SpawnCEG("scavradiation-lightning",posx,posy+40,posz,0,0,0) + else + Spring.DestroyUnit(unitID, false, false) + end + end + end + end +end + +function spawnStartBoxEffect(n) + if ScavengerStartboxExists then + local x = math.random(ScavengerStartboxXMin,ScavengerStartboxXMax) + local z = math.random(ScavengerStartboxZMin,ScavengerStartboxZMax) + local y = Spring.GetGroundHeight(x,z) + Spring.SpawnCEG("scavradiation",x,y+100,z,0,0,0) + end +end + +function spawnStartBoxEffect2(n) + if ScavengerStartboxExists then + local x = math.random(ScavengerStartboxXMin,ScavengerStartboxXMax) + local z = math.random(ScavengerStartboxZMin,ScavengerStartboxZMax) + local y = Spring.GetGroundHeight(x,z) + Spring.SpawnCEG("scavradiation-lightning",x,y+100,z,0,0,0) + end +end diff --git a/LuaRules/Gadgets/scavengers/Modules/stockpiling.lua b/LuaRules/Gadgets/scavengers/Modules/stockpiling.lua new file mode 100644 index 000000000..5317dcdb9 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/stockpiling.lua @@ -0,0 +1,4 @@ + +function ScavStockpile(n, scav) + Spring.GiveOrderToUnit(scav, CMD.STOCKPILE, {}, {}) +end diff --git a/LuaRules/Gadgets/scavengers/Modules/unit_controller.lua b/LuaRules/Gadgets/scavengers/Modules/unit_controller.lua new file mode 100644 index 000000000..fea241dfd --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/unit_controller.lua @@ -0,0 +1,102 @@ +Spring.Echo("[Scavengers] Unit Controller initialized") + +VFS.Include("luarules/gadgets/scavengers/Configs/"..GameShortName.."/UnitLists/staticunits.lua") + +function SelfDestructionControls(n, scav, scavDef) + UnitRange = {} + Constructing = {} + --Constructing[scav] = false + local _,_,_,_,buildProgress = Spring.GetUnitHealth(scav) + if buildProgress == 1 then + if selfdx[scav] then + oldselfdx[scav] = selfdx[scav] + end + if selfdy[scav] then + oldselfdy[scav] = selfdy[scav] + end + if selfdz[scav] then + oldselfdz[scav] = selfdz[scav] + end + selfdx[scav],selfdy[scav],selfdz[scav] = Spring.GetUnitPosition(scav) + if UnitDefs[scavDef].maxWeaponRange < 800 then + UnitRange[scav] = 800 + else + UnitRange[scav] = UnitDefs[scavDef].maxWeaponRange + end + if scavConstructor[scav] then + local metalMake, metalUse = Spring.GetUnitResources(scav) + if metalUse > 0 then + Constructing[scav] = true + else + Constructing[scav] = false + end + end + if (oldselfdx[scav] and oldselfdy[scav] and oldselfdz[scav]) and (oldselfdx[scav] > selfdx[scav]-10 and oldselfdx[scav] < selfdx[scav]+10) and (oldselfdy[scav] > selfdy[scav]-10 and oldselfdy[scav] < selfdy[scav]+10) and (oldselfdz[scav] > selfdz[scav]-10 and oldselfdz[scav] < selfdz[scav]+10) then + if selfdx[scav] < mapsizeX and selfdx[scav] > 0 and selfdz[scav] < mapsizeZ and selfdz[scav] > 0 then + if not scavConstructor[scav] or Constructing[scav] == false then + for q = 1,5 do + local posx = math.random(selfdx[scav] - 400, selfdx[scav] + 400) + local posz = math.random(selfdz[scav] - 400, selfdz[scav] + 400) + local telstartposy = Spring.GetGroundHeight(selfdx[scav], selfdz[scav]) + local telendposy = Spring.GetGroundHeight(posx, posz) + if (UnitDefs[scavDef].minWaterDepth and -(UnitDefs[scavDef].minWaterDepth) > telendposy) or (UnitDefs[scavDef].maxWaterDepth and -(UnitDefs[scavDef].maxWaterDepth) < telendposy) then + Spring.SpawnCEG("scav-prettypop",selfdx[scav],telstartposy,selfdz[scav],0,0,0) + Spring.SpawnCEG("scav-prettypop",posx,telendposy,posz,0,0,0) + Spring.SetUnitPosition(scav, posx, posz) + Spring.GiveOrderToUnit(scav, CMD.STOP, 0, 0) + break + end + end + end + end + --Spring.DestroyUnit(scav, false, true) + end + end + UnitRange[scav] = nil + Constructing[scav] = nil +end + +function ArmyMoveOrders(n, scav, scavDef) + UnitRange = {} + if UnitDefs[scavDef].maxWeaponRange and UnitDefs[scavDef].maxWeaponRange > 10 then + UnitRange[scav] = UnitDefs[scavDef].maxWeaponRange + else + UnitRange[scav] = 10 + end + if not BossWaveStarted or BossWaveStarted == false then + attackTarget = Spring.GetUnitNearestEnemy(scav, 200000, false) + else + if AliveEnemyCommanders and AliveEnemyCommandersCount > 0 then + if AliveEnemyCommandersCount > 1 then + for i = 1,AliveEnemyCommandersCount do + -- let's get nearest commander + local separation = Spring.GetUnitSeparation(scav,AliveEnemyCommanders[i]) + if not lowestSeparation then + lowestSeparation = separation + attackTarget = AliveEnemyCommanders[i] + end + if separation < lowestSeparation then + lowestSeparation = separation + attackTarget = AliveEnemyCommanders[i] + end + end + lowestSeparation = nil + elseif AliveEnemyCommandersCount == 1 then + attackTarget = AliveEnemyCommanders[1] + end + end + end + if attackTarget == nil then + attackTarget = Spring.GetUnitNearestEnemy(scav, 200000, false) + end + local x,y,z = Spring.GetUnitPosition(attackTarget) + local range = UnitRange[scav] + local x = x + math_random(-range*3,range*3) + local z = z + math_random(-range*3,range*3) + if (not BossWaveStarted) and (UnitDefs[scavDef].canFly or (UnitRange[scav] > unitControllerModuleConfig.minimumrangeforfight)) then + Spring.GiveOrderToUnit(scav, CMD.FIGHT,{x,y,z}, {"shift", "alt", "ctrl"}) + else + Spring.GiveOrderToUnit(scav, CMD.MOVE,{x,y,z}, {"shift", "alt", "ctrl"}) + end + attackTarget = nil +end diff --git a/LuaRules/Gadgets/scavengers/Modules/unit_spawner.lua b/LuaRules/Gadgets/scavengers/Modules/unit_spawner.lua new file mode 100644 index 000000000..ddedf4fdb --- /dev/null +++ b/LuaRules/Gadgets/scavengers/Modules/unit_spawner.lua @@ -0,0 +1,365 @@ +Spring.Echo("[Scavengers] Unit Spawner initialized") + +local UnitSpawnChance = unitSpawnerModuleConfig.spawnchance + +function BossWaveTimer(n) + if not BossWaveTimeLeft then + BossWaveTimeLeft = unitSpawnerModuleConfig.BossWaveTimeLeft + end + if not FinalSelfDChance then + FinalSelfDChance = 60 + end + if BossWaveTimeLeft > 0 then + BossWaveTimeLeft = BossWaveTimeLeft - 1 + BossFightMessages(BossWaveTimeLeft) + elseif BossWaveTimeLeft <= 0 then + if not FinalBossUnitSpawned and unitSpawnerModuleConfig.FinalBossUnit == true then + + local bossunit = BossUnits[math_random(1,#BossUnits)] + + local scavengerunits = Spring.GetTeamUnits(GaiaTeamID) + SpawnBeacons = {} + for i = 1,#scavengerunits do + local scav = scavengerunits[i] + local scavDef = Spring.GetUnitDefID(scav) + if scavSpawnBeacon[scav] then + table.insert(SpawnBeacons,scav) + end + end + + if #SpawnBeacons > 1 then + for b = 1,1000 do + local pickedBeaconTest = SpawnBeacons[math_random(1,#SpawnBeacons)] + local _,_,_,pickedBeaconCaptureProgress = Spring.GetUnitHealth(pickedBeaconTest) + if pickedBeaconCaptureProgress == 0 then + pickedBeacon = pickedBeaconTest + break + else + pickedBeacon = 1234567890 + end + end + elseif #SpawnBeacons == 1 then + pickedBeacon = SpawnBeacons[1] + end + SpawnBeacons = nil + + if pickedBeacon == 1234567890 then + return + else + if pickedBeacon then + local posx,posy,posz = Spring.GetUnitPosition(pickedBeacon) + local posy = Spring.GetGroundHeight(posx, posz) + Spring.CreateUnit(bossunit, posx, posy, posz, math_random(0,3),GaiaTeamID) + FinalBossUnitSpawned = true + Spring.Echo("BOSS COMMANDER SPAWNED") + elseif ScavengerStartboxExists == true then + local posx = math.floor((ScavengerStartboxXMin + ScavengerStartboxXMax)/2) + local posz = math.floor((ScavengerStartboxZMin + ScavengerStartboxZMax)/2) + local posy = Spring.GetGroundHeight(posx, posz) + Spring.CreateUnit(bossunit, posx, posy, posz, math_random(0,3),GaiaTeamID) + FinalBossUnitSpawned = true + Spring.Echo("BOSS COMMANDER SPAWNED") + else + local posx = math.floor(mapsizeX/2) + local posz = math.floor(mapsizeZ/2) + local posy = Spring.GetGroundHeight(posx, posz) + Spring.CreateUnit(bossunit, posx, posy, posz, math_random(0,3),GaiaTeamID) + FinalBossUnitSpawned = true + Spring.Echo("BOSS COMMANDER SPAWNED") + end + end + pickedBeacon = nil + + elseif (not unitSpawnerModuleConfig.FinalBossUnit) or FinalBossKilled == true then + local units = Spring.GetTeamUnits(GaiaTeamID) + FinalSelfDChance = FinalSelfDChance - 1 + if FinalSelfDChance < 2 then + FinalSelfDChance = 2 + end + for i = 1,#units do + local r = math_random(1,FinalSelfDChance) + if r == 1 then + Spring.DestroyUnit(units[i],false,false) + end + end + end + end +end + +function BossMinionsSpawn(n) + local x,y,z = Spring.GetUnitPosition(FinalBossUnitID) + local posx = x + math_random(-500,500) + local posz = z + math_random(-500,500) + local posy = Spring.GetGroundHeight(posx, posz) + local r = math_random(0,100) + local rair = math_random(0, unitSpawnerModuleConfig.aircraftchance) + + if rair == 0 then + if r <= 20 then + minionUnit = T1AirUnits[math_random(1,#T1AirUnits)]..scavconfig.unitnamesuffix + elseif r <= 70 then + minionUnit = T2AirUnits[math_random(1,#T2AirUnits)]..scavconfig.unitnamesuffix + elseif r <= 95 then + minionUnit = T3AirUnits[math_random(1,#T3AirUnits)]..scavconfig.unitnamesuffix + elseif r <= 100 then + minionUnit = T4AirUnits[math_random(1,#T4AirUnits)]..scavconfig.unitnamesuffix + else + minionUnit = T0AirUnits[math_random(1,#T0AirUnits)]..scavconfig.unitnamesuffix + end + elseif posy > -20 then + if r <= 20 then + minionUnit = T1LandUnits[math_random(1,#T1LandUnits)]..scavconfig.unitnamesuffix + elseif r <= 70 then + minionUnit = T2LandUnits[math_random(1,#T2LandUnits)]..scavconfig.unitnamesuffix + elseif r <= 95 then + minionUnit = T3LandUnits[math_random(1,#T3LandUnits)]..scavconfig.unitnamesuffix + elseif r <= 100 then + minionUnit = T4LandUnits[math_random(1,#T4LandUnits)]..scavconfig.unitnamesuffix + else + minionUnit = T0LandUnits[math_random(1,#T0LandUnits)]..scavconfig.unitnamesuffix + end + elseif posy <= -20 then + if r <= 20 then + minionUnit = T1SeaUnits[math_random(1,#T1SeaUnits)]..scavconfig.unitnamesuffix + elseif r <= 70 then + minionUnit = T2SeaUnits[math_random(1,#T2SeaUnits)]..scavconfig.unitnamesuffix + elseif r <= 95 then + minionUnit = T3SeaUnits[math_random(1,#T3SeaUnits)]..scavconfig.unitnamesuffix + elseif r <= 100 then + minionUnit = T4SeaUnits[math_random(1,#T4SeaUnits)]..scavconfig.unitnamesuffix + else + minionUnit = T0SeaUnits[math_random(1,#T0SeaUnits)]..scavconfig.unitnamesuffix + end + end + Spring.CreateUnit(minionUnit, posx, posy, posz, math_random(0,3),GaiaTeamID) + Spring.SpawnCEG("scav-prettypop",posx,posy,posz,0,0,0) +end + + +function UnitGroupSpawn(n) + if n > 9000 then + local gaiaUnitCount = Spring.GetTeamUnitCount(GaiaTeamID) + if BossWaveTimeLeft then + if numOfSpawnBeacons or numOfSpawnBeacons == 0 then + ActualUnitSpawnChance = math_random(0,math.ceil(UnitSpawnChance)*3) + else + ActualUnitSpawnChance = math_random(0,(UnitSpawnChance/(numOfSpawnBeacons/5))*3) + end + else + if numOfSpawnBeacons or numOfSpawnBeacons == 0 then + ActualUnitSpawnChance = math_random(0,math.ceil(UnitSpawnChance)) + else + ActualUnitSpawnChance = math_random(0,(UnitSpawnChance/(numOfSpawnBeacons/5))) + end + end + if (ActualUnitSpawnChance == 0 or canSpawnHere == false) and numOfSpawnBeacons > 0 then + -- check positions + local scavengerunits = Spring.GetTeamUnits(GaiaTeamID) + SpawnBeacons = {} + for i = 1,#scavengerunits do + local scav = scavengerunits[i] + local scavDef = Spring.GetUnitDefID(scav) + if scavSpawnBeacon[scav] then + table.insert(SpawnBeacons,scav) + end + end + + for b = 1,10 do + local pickedBeaconTest = SpawnBeacons[math_random(1,#SpawnBeacons)] + local _,_,_,pickedBeaconCaptureProgress = Spring.GetUnitHealth(pickedBeaconTest) + if pickedBeaconCaptureProgress == 0 then + pickedBeacon = pickedBeaconTest + break + else + pickedBeacon = 1234567890 + end + end + if pickedBeacon == 1234567890 then + return + end + + local posx,posy,posz = Spring.GetUnitPosition(pickedBeacon) + local posy = Spring.GetGroundHeight(posx, posz) + local posradius = 256 + local nearestEnemy = Spring.GetUnitNearestEnemy(pickedBeacon, 99999, false) + local nearestEnemyTeam = Spring.GetUnitTeam(nearestEnemy) + if nearestEnemyTeam == bestTeam then + bestTeamGroupMultiplier = 1.25 + else + bestTeamGroupMultiplier = 0.75 + end + canSpawnHere = true + --Spring.DestroyUnit(pickedBeacon,false,false) + SpawnBeacon(n) + pickedBeacon = nil + + if canSpawnHere then + + if BossWaveTimeLeft then + UnitSpawnChance = math.ceil(unitSpawnerModuleConfig.spawnchance / (teamcount/2)) + else + UnitSpawnChance = unitSpawnerModuleConfig.spawnchance + end + if not globalScore then + teamsCheck() + end + if (globalScore/unitSpawnerModuleConfig.globalscoreperoneunit)*spawnmultiplier < #scavengerunits then + UnitSpawnChance = math.ceil(UnitSpawnChance/2) + end + local groupsize = (globalScore / unitSpawnerModuleConfig.globalscoreperoneunit)*spawnmultiplier + local aircraftchance = math_random(0,unitSpawnerModuleConfig.aircraftchance) + local aircraftchanceonsea = math_random(0,unitSpawnerModuleConfig.chanceforaircraftonsea) + local bossaircraftchance = math_random(0,unitSpawnerModuleConfig.aircraftchance*5) + local spawnTier = math_random(1,100) + + if (posy <= -20 and aircraftchanceonsea == 0) or (aircraftchance == 0 and (not BossWaveTimeLeft)) or (bossaircraftchance == 0 and BossWaveTimeLeft and BossWaveTimeLeft > 0) then + if unitSpawnerModuleConfig.bossFightEnabled and BossWaveTimeLeft then + if spawnTier < 50 then + groupunit = T4AirUnits + else + groupunit = T3AirUnits + end + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t4multiplier + elseif spawnTier <= TierSpawnChances.T0 then + groupunit = T0AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t0multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t3multiplier + -- ScavSendMessage("Warning! Scavengers dropped group of ".. UDN[groupunit].humanName .."s") + -- if math_random(0,2) == 0 then + -- ScavSendNotification("scav_scavheavyairdetected") + -- end + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t4multiplier + -- ScavSendNotification("scav_scavbossdetected") + else + groupunit = T0AirUnits + groupsize = groupsize*unitSpawnerModuleConfig.airmultiplier*unitSpawnerModuleConfig.t0multiplier + end + elseif posy > -20 then + if unitSpawnerModuleConfig.bossFightEnabled and BossWaveTimeLeft then + if spawnTier < 50 then + groupunit = T4LandUnits + else + groupunit = T3LandUnits + end + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t4multiplier + elseif spawnTier <= TierSpawnChances.T0 then + groupunit = T0LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t0multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t3multiplier + -- local c = math_random(0,2) + -- if c == 0 then + -- ScavSendMessage("Warning! Scavengers dropped group of ".. UDN[groupunit].humanName .."s") + -- local s = math_random(0,4) + -- if s == 0 then + -- ScavSendNotification("scav_scavtech3") + -- elseif s == 1 then + -- ScavSendNotification("scav_scavtech3b") + -- elseif s == 2 then + -- ScavSendNotification("scav_scavtech3c") + -- elseif s == 3 then + -- ScavSendNotification("scav_scavtech3d") + -- else + -- ScavSendNotification("scav_scavtech3e") + -- end + -- else + -- ScavSendMessage("Warning! Scavengers dropped group of ".. UDN[groupunit].humanName .."s") + -- end + + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t4multiplier + -- ScavSendNotification("scav_scavbossdetected") + else + groupunit = T0LandUnits + groupsize = groupsize*unitSpawnerModuleConfig.landmultiplier*unitSpawnerModuleConfig.t0multiplier + end + elseif posy <= -20 then + if unitSpawnerModuleConfig.bossFightEnabled and BossWaveTimeLeft then + if spawnTier < 50 then + groupunit = T4SeaUnits + else + groupunit = T3SeaUnits + end + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t4multiplier + elseif spawnTier <= TierSpawnChances.T0 then + groupunit = T0SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t0multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 then + groupunit = T1SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t1multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 then + groupunit = T2SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t2multiplier + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 then + groupunit = T3SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t3multiplier + -- ScavSendMessage("Warning! Scavengers dropped group of ".. UDN[groupunit].humanName .."s") + -- if math_random(0,2) == 0 then + -- ScavSendNotification("scav_scavheavyshipsdetected") + -- end + elseif spawnTier <= TierSpawnChances.T0 + TierSpawnChances.T1 + TierSpawnChances.T2 + TierSpawnChances.T3 + TierSpawnChances.T4 then + groupunit = T4SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t4multiplier + -- ScavSendNotification("scav_scavbossdetected") + else + groupunit = T0SeaUnits + groupsize = groupsize*unitSpawnerModuleConfig.seamultiplier*unitSpawnerModuleConfig.t0multiplier + end + end + + local groupsize = math.ceil(groupsize*bestTeamGroupMultiplier*(teamcount/2)) + for i=1, groupsize do + local posx = posx+math_random(-160,160) + local posz = posz+math_random(-160,160) + local newposy = Spring.GetGroundHeight(posx, posz) + if posy >= -20 and newposy >= -20 then + if i then + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n+(i*15)) + QueueSpawn(groupunit[math_random(1,#groupunit)]..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90+(i*15)) + else + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n) + QueueSpawn(groupunit[math_random(1,#groupunit)]..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + elseif posy < -20 and newposy < -20 then + if i then + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n+(i*15)) + QueueSpawn(groupunit[math_random(1,#groupunit)]..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90+(i*15)) + else + QueueSpawn("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID, n) + QueueSpawn(groupunit[math_random(1,#groupunit)]..scavconfig.unitnamesuffix, posx, posy, posz, math_random(0,3),GaiaTeamID, n+90) + end + end + --Spring.CreateUnit("scavengerdroppod_scav", posx, posy, posz, math_random(0,3),GaiaTeamID) + end + posx = nil + posy = nil + posz = nil + SpawnBeacons = nil + end + else + UnitSpawnChance = UnitSpawnChance - 1 + if UnitSpawnChance < 1 then + UnitSpawnChance = 1 + end + end + end +end + diff --git a/LuaRules/Gadgets/scavengers/boot.lua b/LuaRules/Gadgets/scavengers/boot.lua new file mode 100644 index 000000000..4dea445a1 --- /dev/null +++ b/LuaRules/Gadgets/scavengers/boot.lua @@ -0,0 +1,715 @@ +if (not gadgetHandler:IsSyncedCode()) then + return false +end + +GameShortName = Game.gameShortName +VFS.Include("luarules/gadgets/scavengers/Configs/"..GameShortName.."/config.lua") +--for i = 1,#scavconfig do +--Spring.Echo("scavconfig value "..i.." = "..scavconfig[i]) +--end + +function ScavSendMessage(message) + if scavconfig.messenger then + SendToUnsynced("SendMessage", message) + end +end + +function ScavSendNotification(name) + if scavconfig.messenger then + SendToUnsynced("SendNotification", name) + end +end + +function ScavSendVoiceMessage(filedirectory) + if scavconfig.messenger then + Spring.SendCommands("scavplaysoundfile "..filedirectory) + end +end + +VFS.Include("luarules/gadgets/scavengers/API/api.lua") +VFS.Include("luarules/gadgets/scavengers/Modules/unit_controller.lua") + +local UnitLists = VFS.DirList('luarules/gadgets/scavengers/Configs/'..GameShortName..'/UnitLists/','*.lua') +for i = 1,#UnitLists do + VFS.Include(UnitLists[i]) + Spring.Echo("Scav Units Directory: " ..UnitLists[i]) +end + +if scavconfig.modules.buildingSpawnerModule then + ScavengerBlueprintsT0 = {} + ScavengerBlueprintsT1 = {} + ScavengerBlueprintsT2 = {} + ScavengerBlueprintsT3 = {} + ScavengerBlueprintsT4 = {} + ScavengerBlueprintsT0Sea = {} + ScavengerBlueprintsT1Sea = {} + ScavengerBlueprintsT2Sea = {} + ScavengerBlueprintsT3Sea = {} + ScavengerBlueprintsT4Sea = {} + VFS.Include("luarules/gadgets/scavengers/Modules/building_spawner.lua") +end + +if scavconfig.modules.constructorControllerModule then + ScavengerConstructorBlueprintsT0 = {} + ScavengerConstructorBlueprintsT1 = {} + ScavengerConstructorBlueprintsT2 = {} + ScavengerConstructorBlueprintsT3 = {} + ScavengerConstructorBlueprintsT4 = {} + ScavengerConstructorBlueprintsT0Sea = {} + ScavengerConstructorBlueprintsT1Sea = {} + ScavengerConstructorBlueprintsT2Sea = {} + ScavengerConstructorBlueprintsT3Sea = {} + ScavengerConstructorBlueprintsT4Sea = {} + VFS.Include("luarules/gadgets/scavengers/Modules/constructor_controller.lua") +end + +if scavconfig.modules.factoryControllerModule then + VFS.Include("luarules/gadgets/scavengers/Modules/factory_controller.lua") +end + +if scavconfig.modules.unitSpawnerModule then + VFS.Include("luarules/gadgets/scavengers/Modules/unit_spawner.lua") +end + +if scavconfig.modules.startBoxProtection then + VFS.Include("luarules/gadgets/scavengers/Modules/startbox_protection.lua") +end + +if scavconfig.modules.reinforcementsModule then + VFS.Include("luarules/gadgets/scavengers/Modules/reinforcements_module.lua") +end + +if scavconfig.modules.stockpilers == true then + VFS.Include("luarules/gadgets/scavengers/Modules/stockpiling.lua") +end + +if scavconfig.modules.nukes == true then + VFS.Include("luarules/gadgets/scavengers/Modules/nuke_controller.lua") +end + +VFS.Include("luarules/gadgets/scavengers/Modules/spawn_beacons.lua") +VFS.Include("luarules/gadgets/scavengers/Modules/messenger.lua") + + +local function DisableUnit(unitID) + Spring.MoveCtrl.Enable(unitID) + Spring.MoveCtrl.SetNoBlocking(unitID, true) + Spring.MoveCtrl.SetPosition(unitID, Game.mapSizeX+1000, 2000, Game.mapSizeZ+1000) --don't move too far out or prevent_aicraft_hax will explode it! + Spring.SetUnitCloak(unitID, true) + --Spring.SetUnitHealth(unitID, {paralyze=99999999}) + Spring.SetUnitNoDraw(unitID, true) + Spring.SetUnitStealth(unitID, true) + Spring.SetUnitNoSelect(unitID, true) + Spring.SetUnitNoMinimap(unitID, true) + Spring.GiveOrderToUnit(unitID, CMD.MOVE_STATE, { 0 }, 0) + Spring.GiveOrderToUnit(unitID, CMD.FIRE_STATE, { 0 }, 0) +end + +local function DisableCommander() + local teamUnits = Spring.GetTeamUnits(scavengerAITeamID) + for _, unitID in ipairs(teamUnits) do + HiddenCommander = unitID + DisableUnit(unitID) + end +end + +function QueueSpawn(unitName, posx, posy, posz, facing, team, frame) + local QueueSpawnCommand = {unitName, posx, posy, posz, facing, team} + local QueueFrame = frame + if #QueuedSpawnsFrames > 0 then + for i = 1, #QueuedSpawnsFrames do + local CurrentQueueFrame = QueuedSpawnsFrames[i] + if (not(CurrentQueueFrame < QueueFrame)) or i == #QueuedSpawnsFrames then + table.insert(QueuedSpawns, i, QueueSpawnCommand) + table.insert(QueuedSpawnsFrames, i, QueueFrame) + break + end + end + else + table.insert(QueuedSpawns, QueueSpawnCommand) + table.insert(QueuedSpawnsFrames, QueueFrame) + end +end + +function SpawnFromQueue(n) + local QueuedSpawnsForNow = #QueuedSpawns + if QueuedSpawnsForNow > 0 then + for i = 1,QueuedSpawnsForNow do + if n == QueuedSpawnsFrames[1] then + local createSpawnCommand = QueuedSpawns[1] + Spring.CreateUnit(QueuedSpawns[1][1],QueuedSpawns[1][2],QueuedSpawns[1][3],QueuedSpawns[1][4],QueuedSpawns[1][5],QueuedSpawns[1][6]) + table.remove(QueuedSpawns, 1) + table.remove(QueuedSpawnsFrames, 1) + --else + --break + end + end + end +end + +-- function PutSpectatorsInScavTeam(n) + -- local players = Spring.GetPlayerList() + -- for i = 1,#players do + -- local player = players[i] + -- local name, active, spectator = Spring.GetPlayerInfo(player) + -- if spectator == true then + -- Spring.AssignPlayerToTeam(player, GaiaTeamID) + -- end + -- end +-- end + + + +local minionFramerate = math.ceil(unitSpawnerModuleConfig.FinalBossMinionsPassive/(teamcount*spawnmultiplier)) +function gadget:GameFrame(n) + + + -- if n%30 == 0 then + -- PutSpectatorsInScavTeam(n) + -- end + + if n > 1 then + SpawnFromQueue(n) + end + + if n == 300 then + --Spring.Echo("New Scavenger Spawner initialized") + Spring.SetTeamColor(GaiaTeamID, 0.38, 0.14, 0.38) + end + + if n%30 == 0 and scavconfig.messenger == true then + pregameMessages(n) + end + + if n%150 == 85 and FinalBossUnitSpawned and FinalBossKilled == false then + local bosshealth = Spring.GetUnitHealth(FinalBossUnitID) + ScavSendMessage("Boss Health: "..math.ceil(bosshealth)) + end + + if n%minionFramerate == 0 and FinalBossUnitSpawned and FinalBossKilled == false then + BossMinionsSpawn(n) + end + + + if scavconfig.modules.startBoxProtection == true and ScavengerStartboxExists == true and FinalBossKilled == false then + if n%30 == 0 then + spawnStartBoxProtection(n) + executeStartBoxProtection(n) + spawnStartBoxEffect2(n) + end + if n%3 == 0 then + spawnStartBoxEffect(n) + end + end + + if n%30 == 0 and scavconfig.modules.reinforcementsModule then + spawnPlayerReinforcements(n) + CaptureBeacons(n) + SetBeaconsResourceProduction(n) + end + + if n%30 == 0 and GaiaTeamID ~= Spring.GetGaiaTeamID() then + if not disabledCommander then + DisableCommander() + disabledCommander = true + end + Spring.SetUnitHealth(HiddenCommander, 9999999) + end + + if n == 100 and globalScore then + Spring.SetTeamResource(GaiaTeamID, "ms", 1000000) + Spring.SetTeamResource(GaiaTeamID, "es", 1000000) + Spring.SetGlobalLos(GaiaAllyTeamID, false) + end + if n%30 == 0 and globalScore then + Spring.SetTeamResource(GaiaTeamID, "ms", 1000000) + Spring.SetTeamResource(GaiaTeamID, "es", 1000000) + Spring.SetTeamResource(GaiaTeamID, "m", 1000000) + Spring.SetTeamResource(GaiaTeamID, "e", 1000000) + if BossWaveStarted == true then + BossWaveTimer(n) + end + end + if n%1800 == 0 and n > 100 then + teamsCheck() + UpdateTierChances(n) + if (BossWaveStarted == false) and globalScore > scavconfig.timers.BossFight and unitSpawnerModuleConfig.bossFightEnabled then + BossWaveStarted = true + elseif not FinalBossUnitSpawned and not BossWaveStarted then + if scavengersAIEnabled and scavengersAIEnabled == true then + if globalScore == 0 then globalScore = 1 end + if scavconfig.timers.BossFight == 0 then scavconfig.timers.BossFight = 1 end + if globalScore/scavconfig.timers.BossFight < 1 then + ScavSendMessage("Scavengers Tech Progress: "..math.ceil((globalScore/scavconfig.timers.BossFight)*100).."%") + ScavSendMessage("Scav Score: "..globalScore) + ScavSendMessage(TierSpawnChances.Message) + else + ScavSendMessage("Scavengers Tech Progress: 100%") + ScavSendMessage("Score: "..globalScore) + ScavSendMessage(TierSpawnChances.Message) + end + end + end + end + + if n%90 == 0 and scavconfig.modules.buildingSpawnerModule and (not FinalBossUnitSpawned) then + SpawnBlueprint(n) + end + if n%30 == 0 then + if scavconfig.modules.unitSpawnerModule and (not FinalBossUnitSpawned) then + SpawnBeacon(n) + UnitGroupSpawn(n) + end + if scavconfig.modules.constructorControllerModule and constructorControllerModuleConfig.useconstructors and n > 9000 and (not FinalBossUnitSpawned) then + SpawnConstructor(n) + end + local scavengerunits = Spring.GetTeamUnits(GaiaTeamID) + if scavengerunits then + for i = 1,#scavengerunits do + local scav = scavengerunits[i] + local scavDef = Spring.GetUnitDefID(scav) + local collectorRNG = math_random(0,2) + + if n%300 == 0 and scavconfig.modules.stockpilers == true then + if scavStockpiler[scav] == true then + ScavStockpile(n, scav) + end + end + + if scavconfig.modules.nukes == true then + if scavNuke[scav] == true then + SendRandomNukeOrder(n, scav) + end + end + + if scavconfig.modules.constructorControllerModule then + if constructorControllerModuleConfig.useconstructors then + if scavConstructor[scav] then + if Spring.GetCommandQueue(scav, 0) <= 0 then + -- if n%1800 == 0 then + -- if (not HiddenCommander) or (scav ~= HiddenCommander) then + -- SelfDestructionControls(n, scav, scavDef) + -- end + -- end + ConstructNewBlueprint(n, scav) + end + end + end + + if constructorControllerModuleConfig.useresurrectors and collectorRNG == 0 then + if scavResurrector[scav] then + ResurrectorOrders(n, scav) + end + end + + if constructorControllerModuleConfig.usecollectors and collectorRNG == 0 then + if scavCollector[scav] then + CollectorOrders(n, scav) + end + if scavReclaimer[scav] then + ReclaimerOrders(n, scav) + end + end + + if scavAssistant[scav] and Spring.GetCommandQueue(scav, 0) <= 0 then + AssistantOrders(n, scav) + end + end + + if scavconfig.modules.factoryControllerModule then + if scavFactory[scav] and #Spring.GetFullBuildQueue(scav, 0) <= 0 then + FactoryProduction(n, scav, scavDef) + end + end + + -- backup -- and not scavConstructor[scav] and not scavResurrector[scav] and not scavCollector[scav] + if n%450 == 0 and not scavStructure[scav] and not scavAssistant[scav] and not scavFactory[scav] and not scavSpawnBeacon[scav] then + SelfDestructionControls(n, scav, scavDef) + end + if Spring.GetCommandQueue(scav, 0) <= 1 and not scavStructure[scav] and not scavConstructor[scav] and not scavReclaimer[scav] and not scavResurrector[scav] and not scavAssistant[scav] and not scavCollector[scav] and not scavFactory[scav] and not scavSpawnBeacon[scav] then + ArmyMoveOrders(n, scav, scavDef) + end + + end + end + end +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + local UnitName = UnitDefs[unitDefID].name + if unitTeam == GaiaTeamID then + + if FinalBossUnitSpawned == true then + for i = 1,#BossUnits do + if string.sub(UnitName, 1, string.len(UnitName)) == BossUnits[i] then + Spring.Echo("GG") + FinalBossKilled = true + FinalBossUnitID = nil + end + end + end + + killedscavengers = killedscavengers + scavconfig.scoreConfig.baseScorePerKill + if scavStructure[unitID] and not UnitName == "scavengerdroppod_scav" and not UnitName == "scavengerdroppodbeacon_scav" then + killedscavengers = killedscavengers + scavconfig.scoreConfig.scorePerKilledBuilding + end + if scavConstructor[unitID] then + killedscavengers = killedscavengers + scavconfig.scoreConfig.scorePerKilledConstructor + end + if UnitName == "scavengerdroppodbeacon_scav" then + numOfSpawnBeacons = numOfSpawnBeacons - 1 + killedscavengers = killedscavengers + scavconfig.scoreConfig.scorePerKilledSpawner + end + if UnitName == "scavengerdroppod_scav" then + killedscavengers = killedscavengers - scavconfig.scoreConfig.baseScorePerKill + end + selfdx[unitID] = nil + selfdy[unitID] = nil + selfdz[unitID] = nil + oldselfdx[unitID] = nil + oldselfdy[unitID] = nil + oldselfdz[unitID] = nil + scavNoSelfD[unitID] = nil + scavConstructor[unitID] = nil + scavAssistant[unitID] = nil + scavResurrector[unitID] = nil + scavCollector[unitID] = nil + scavReclaimer[unitID] = nil + scavStructure[unitID] = nil + scavFactory[unitID] = nil + scavSpawnBeacon[unitID] = nil + scavStockpiler[unitID] = nil + scavNuke[unitID] = nil + UnitSuffixLenght[unitID] = nil + ConstructorNumberOfRetries[unitID] = nil + CaptureProgressForBeacons[unitID] = nil + else + for i = 1,#AliveEnemyCommanders do + local comID = AliveEnemyCommanders[i] + if unitID == comID then + AliveEnemyCommandersCount = AliveEnemyCommandersCount - 1 + table.remove(AliveEnemyCommanders, i) + break + end + end + if UnitName == "scavengerdroppodbeacon_scav" then + numOfSpawnBeaconsTeams[unitTeam] = numOfSpawnBeaconsTeams[unitTeam] - 1 + end + end +end + +function gadget:UnitTaken(unitID, unitDefID, unitOldTeam, unitNewTeam) + local UnitName = UnitDefs[unitDefID].name + if unitOldTeam == GaiaTeamID then + if UnitDefs[unitDefID].name == "scavengerdroppodbeacon_scav" then + numOfSpawnBeacons = numOfSpawnBeacons - 1 + numOfSpawnBeaconsTeams[unitNewTeam] = numOfSpawnBeaconsTeams[unitNewTeam] + 1 + killedscavengers = killedscavengers + scavconfig.scoreConfig.scorePerCapturedSpawner + if scavconfig.modules.reinforcementsModule == true then + Spring.SetUnitNeutral(unitID, false) + Spring.SetUnitHealth(unitID, 2500) + Spring.SetUnitMaxHealth(unitID, 2500) + end + --SpawnDefencesAfterCapture(unitID, unitNewTeam) + end + selfdx[unitID] = nil + selfdy[unitID] = nil + selfdz[unitID] = nil + oldselfdx[unitID] = nil + oldselfdy[unitID] = nil + oldselfdz[unitID] = nil + scavNoSelfD[unitID] = nil + scavConstructor[unitID] = nil + scavAssistant[unitID] = nil + scavResurrector[unitID] = nil + scavCollector[unitID] = nil + scavReclaimer[unitID] = nil + scavStructure[unitID] = nil + scavFactory[unitID] = nil + scavSpawnBeacon[unitID] = nil + scavStockpiler[unitID] = nil + scavNuke[unitID] = nil + UnitSuffixLenght[unitID] = nil + ConstructorNumberOfRetries[unitID] = nil + CaptureProgressForBeacons[unitID] = nil + Spring.SetUnitHealth(unitID, {capture = 0}) + + else + if unitNewTeam == GaiaTeamID then + if string.find(UnitName, scavconfig.unitnamesuffix) then + UnitSuffixLenght[unitID] = string.len(scavconfig.unitnamesuffix) + else + UnitSuffixLenght[unitID] = 0 + end + --Spring.Echo("Scavs just captured me " .. UnitName .. " and my suffix lenght is " .. UnitSuffixLenght[unitID]) + if UnitDefs[unitDefID].name == "scavengerdroppodbeacon_scav" then + numOfSpawnBeaconsTeams[unitOldTeam] = numOfSpawnBeaconsTeams[unitOldTeam] - 1 + numOfSpawnBeacons = numOfSpawnBeacons + 1 + scavSpawnBeacon[unitID] = true + end + -- CMD.CLOAK = 37382 + Spring.GiveOrderToUnit(unitID,37382,{1},0) + -- Fire At Will + Spring.GiveOrderToUnit(unitID,CMD.FIRE_STATE,{2},0) + scavStructure[unitID] = UnitDefs[unitDefID].isBuilding + for i = 1,#NoSelfdList do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == NoSelfdList[i] then--string.find(UnitName, NoSelfdList[i]) then + scavStructure[unitID] = true + end + end + + if scavconfig.modules.stockpilers == true then + for i = 1,#StockpilingUnitNames do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == StockpilingUnitNames[i] then + scavStockpiler[unitID] = true + end + end + end + + if scavconfig.modules.nukes == true then + for i = 1,#NukingUnitNames do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == NukingUnitNames[i] then + scavNuke[unitID] = true + end + end + end + + if scavconfig.modules.constructorControllerModule then + if constructorControllerModuleConfig.useconstructors then + for i = 1,#ConstructorsList do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == ConstructorsList[i] then + scavConstructor[unitID] = true + end + end + end + + if constructorControllerModuleConfig.useresurrectors then + for i = 1,#Resurrectors do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Resurrectors[i] then + scavResurrector[unitID] = true + end + end + for i = 1,#ResurrectorsSea do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == ResurrectorsSea[i] then + scavResurrector[unitID] = true + end + end + end + + if constructorControllerModuleConfig.usecollectors then + for i = 1,#Collectors do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Collectors[i] then + if math_random(0,100) <= 10 then + scavCollector[unitID] = true + else + scavReclaimer[unitID] = true + end + end + end + end + + for i = 1,#AssistUnits do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == AssistUnits[i] then + scavAssistant[unitID] = true + end + end + end + + if scavconfig.modules.factoryControllerModule then + for i = 1,#Factories do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Factories[i] then + scavFactory[unitID] = true + end + end + end + end + if UnitDefs[unitDefID].name == "scavengerdroppodbeacon_scav" then + numOfSpawnBeaconsTeams[unitOldTeam] = numOfSpawnBeaconsTeams[unitOldTeam] - 1 + numOfSpawnBeaconsTeams[unitNewTeam] = numOfSpawnBeaconsTeams[unitNewTeam] + 1 + end + end +end + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + local UnitName = UnitDefs[unitDefID].name + --Spring.Echo(Spring.GetUnitHeading(unitID)) + if UnitName == "scavengerdroppodfriendly" then + Spring.GiveOrderToUnit(unitID, CMD.SELFD,{}, {"shift"}) + end + if unitTeam == GaiaTeamID then + if string.find(UnitName, scavconfig.unitnamesuffix) then + UnitSuffixLenght[unitID] = string.len(scavconfig.unitnamesuffix) + else + UnitSuffixLenght[unitID] = 0 + local frame = Spring.GetGameFrame() + if frame > 300 then + local heading = Spring.GetUnitHeading(unitID) + local suffix = scavconfig.unitnamesuffix + local posx, posy, posz = Spring.GetUnitPosition(unitID) + Spring.DestroyUnit(unitID, false, true) + if heading >= -24576 and heading < -8192 then -- west + -- 3 + Spring.CreateUnit(UnitName..suffix, posx, posy, posz, 3,GaiaTeamID) + elseif heading >= -8192 and heading < 8192 then -- south + -- 0 + Spring.CreateUnit(UnitName..suffix, posx, posy, posz, 0,GaiaTeamID) + elseif heading >= 8192 and heading < 24576 then -- east + -- 1 + Spring.CreateUnit(UnitName..suffix, posx, posy, posz, 1,GaiaTeamID) + else -- north + -- 2 + Spring.CreateUnit(UnitName..suffix, posx, posy, posz, 2,GaiaTeamID) + end + return + end + end + for i = 1,#BossUnits do + if string.sub(UnitName, 1, string.len(UnitName)) == BossUnits[i] then + Spring.Echo("Got boss commander ID, attempting to spawn minions") + FinalBossUnitID = unitID + local bosshealth = unitSpawnerModuleConfig.FinalBossHealth*teamcount*spawnmultiplier + Spring.SetUnitHealth(unitID, bosshealth) + end + end + if UnitName == "scavengerdroppod_scav" then + Spring.GiveOrderToUnit(unitID, CMD.SELFD,{}, {"shift"}) + end + if UnitName == "scavengerdroppodbeacon_scav" then + scavSpawnBeacon[unitID] = true + numOfSpawnBeacons = numOfSpawnBeacons + 1 + if scavconfig.modules.reinforcementsModule == true then + Spring.SetUnitNeutral(unitID, true) + Spring.SetUnitMaxHealth(unitID, 10000) + Spring.SetUnitHealth(unitID, 10000) + end + end + -- if UnitName == "lootboxgold" then //perhaps add this later when lootboxes are fully implemented + -- Spring.SetUnitNeutral(unitID, true) + -- end + + -- CMD.CLOAK = 37382 + Spring.GiveOrderToUnit(unitID,37382,{1},0) + -- Fire At Will + Spring.GiveOrderToUnit(unitID,CMD.FIRE_STATE,{2},0) + scavStructure[unitID] = UnitDefs[unitDefID].isBuilding + for i = 1,#NoSelfdList do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == NoSelfdList[i] then--string.find(UnitName, NoSelfdList[i]) then + scavStructure[unitID] = true + end + end + + if scavconfig.modules.stockpilers == true then + for i = 1,#StockpilingUnitNames do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == StockpilingUnitNames[i] then + scavStockpiler[unitID] = true + end + end + end + + if scavconfig.modules.nukes == true then + for i = 1,#NukingUnitNames do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == NukingUnitNames[i] then + scavNuke[unitID] = true + end + end + end + + if scavconfig.modules.constructorControllerModule then + if constructorControllerModuleConfig.useconstructors then + for i = 1,#ConstructorsList do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == ConstructorsList[i] then + scavConstructor[unitID] = true + end + end + end + + if constructorControllerModuleConfig.useresurrectors then + for i = 1,#Resurrectors do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Resurrectors[i] then + scavResurrector[unitID] = true + end + end + for i = 1,#ResurrectorsSea do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == ResurrectorsSea[i] then + scavResurrector[unitID] = true + end + end + end + + if constructorControllerModuleConfig.usecollectors then + for i = 1,#Collectors do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Collectors[i] then + if math_random(0,100) <= 10 then + scavCollector[unitID] = true + else + scavReclaimer[unitID] = true + end + end + end + end + + for i = 1,#AssistUnits do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == AssistUnits[i] then + scavAssistant[unitID] = true + end + end + end + + if scavconfig.modules.factoryControllerModule then + for i = 1,#Factories do + if string.sub(UnitName, 1, string.len(UnitName)-UnitSuffixLenght[unitID]) == Factories[i] then + scavFactory[unitID] = true + end + end + end + else + --AliveEnemyCommanders + for i = 1,#CommandersList do + if string.sub(UnitName, 1, string.len(UnitName)) == CommandersList[i] then + AliveEnemyCommandersCount = AliveEnemyCommandersCount + 1 + table.insert(AliveEnemyCommanders,unitID) + end + end + if UnitDefs[unitDefID].name == "scavengerdroppodbeacon_scav" then + numOfSpawnBeaconsTeams[unitTeam] = numOfSpawnBeaconsTeams[unitTeam] + 1 + if scavconfig.modules.reinforcementsModule == true then + Spring.SetUnitNeutral(unitID, false) + Spring.SetUnitMaxHealth(unitID, 10000) + Spring.SetUnitHealth(unitID, 10000) + end + end + end +end + +function gadget:UnitFinished(unitID, unitDefID, unitTeam) + if unitTeam == GaiaTeamID then + -- CMD.CLOAK = 37382 + Spring.GiveOrderToUnit(unitID,37382,{1},0) + -- Fire At Will + if scavConstructor[unitID] then + Spring.GiveOrderToUnit(unitID,CMD.FIRE_STATE,{1},0) + Spring.GiveOrderToUnit(unitID,CMD.MOVE_STATE,{0},0) + else + Spring.GiveOrderToUnit(unitID,CMD.FIRE_STATE,{2},0) + Spring.GiveOrderToUnit(unitID,CMD.MOVE_STATE,{2},0) + end + end +end + +function gadget:UnitDamaged(unitID, unitDefID, unitTeam) + if unitTeam == GaiaTeamID then + local UnitName = UnitDefs[unitDefID].name + for i = 1,#BossUnits do + if string.sub(UnitName, 1, string.len(UnitName)) == BossUnits[i] then + local n = Spring.GetGameFrame() + if not lastMinionFrame then + lastMinionFrame = n + end + if n > lastMinionFrame + math.ceil(unitSpawnerModuleConfig.FinalBossMinionsActive/(teamcount*spawnmultiplier)) and FinalBossUnitID then + lastMinionFrame = n + BossMinionsSpawn(n) + end + end + end + end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/share_control.lua b/LuaRules/Gadgets/share_control.lua deleted file mode 100644 index 6b2229e3a..000000000 --- a/LuaRules/Gadgets/share_control.lua +++ /dev/null @@ -1 +0,0 @@ --- $Id: share_control.lua 4292 2009-04-05 05:29:29Z carrepairer $ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- file: share_control.lua -- brief: only allow sharing with allied teams -- author: Dave Rodgers -- -- Copyright (C) 2007. -- Licensed under the terms of the GNU GPL, v2 or later. -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "ShareControl", desc = "Controls sharing of units and resources", author = "trepan", date = "Apr 22, 2007", license = "GNU GPL, v2 or later", layer = -5, enabled = true -- loaded by default? } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local spGetTeamInfo = Spring.GetTeamInfo local resShare = true -- allow sharing resources local unitShare = true -- allow sharing units local resShareEnemy = false -- allow sharing resources with enemies local unitShareEnemy = false -- allow sharing units with enemies local unitShareCeasefired = false -- allow sharing units with ceasefired if not GG.shareunits then GG.shareunits = {} end --------------- CarRepairer start ------------- --[[ local GetAllyTeamList = Spring.GetAllyTeamList local GetTeamList = Spring.GetTeamList local GetPlayerList = Spring.GetPlayerList local backupPlayerMode local backups = {} --]] local GetTeamInfo = Spring.GetTeamInfo -- -- A team indexed list of the last frames that a unit transfer was blocked. -- This helps to avoid filling up the console with warnings when a user tries -- to share multiple units. -- -- local lastRefusals = {} -------------------------------------------------------------------------------- --if Spring.FixedAllies() == false then return false end --remove local function AllowAction(playerID) if (playerID ~= 0) then Spring.SendMessageToPlayer(playerID, "Must be the host player") return false end if (not Spring.IsCheatingEnabled()) then Spring.SendMessageToPlayer(playerID, "Cheating must be enabled") return false end return true end local function PrintState() Spring.Echo('sharing units is ' .. (unitShare and 'enabled' or 'disabled')) Spring.Echo('sharing resources is ' .. (resShare and 'enabled' or 'disabled')) Spring.Echo('sharing units with enemies is ' .. (unitShare and unitShareEnemy and 'enabled' or 'disabled')) Spring.Echo('sharing resources with enemies is ' .. (resShare and resShareEnemy and 'enabled' or 'disabled')) return true end local function ChatControl(cmd, line, words, playerID) if (not AllowAction(playerID)) then PrintState() return true end local count = #words if (count == 0) then unitShare = not unitShare resShare = unitShare elseif (count == 1) then if ((words[1] == '0') or (words[1] == 'none')) then resShare = false unitShare = false resShareEnemy = false unitShareEnemy = false elseif ((words[1] == '1') or (words[1] == 'ally')) then resShare = true unitShare = true resShareEnemy = false unitShareEnemy = false elseif ((words[1] == '2') or (words[1] == 'full')) then resShare = true unitShare = true resShareEnemy = true unitShareEnemy = true elseif (words[1] == 'r') then resShare = not resShare elseif (words[1] == 'u') then unitShare = not unitShare elseif (words[1] == 'e') then resShareEnemy = not resShareEnemy unitShareEnemy = not unitShareEnemy end elseif (count == 2) then if (words[1] == 'e') then if (words[2] == '0') then resShareEnemy = false unitShareEnemy = false elseif (words[2] == '1') then resShareEnemy = true unitShareEnemy = true end elseif (words[1] == 'r') then if (words[2] == '0') then resShare = false elseif (words[2] == '1') then resShare = true elseif (words[2] == 'e') then resShareEnemy = not resShareEnemy end elseif (words[1] == 'u') then if (words[2] == '0') then unitShare = false elseif (words[2] == '1') then unitShare = true elseif (words[2] == 'e') then unitShareEnemy = not unitShareEnemy end end elseif (count == 3) then if (words[1] == 'r') then if (words[2] == 'e') then if (words[3] == '0') then resShareEnemy = false elseif (words[3] == '1') then resShareEnemy = true end end elseif (words[1] == 'u') then if (words[2] == 'e') then if (words[3] == '0') then unitShareEnemy = false elseif (words[3] == '1') then unitShareEnemy = true end end end end PrintState() return true end function gadget:Initialize() if (not gadgetHandler:IsSyncedCode()) then gadgetHandler:RemoveGadget() return end if( Spring.GetModOptions() ) then unitShareEnemy = Spring.GetModOptions().sharemode == 'anyone' --resShareEnemy = unitShareEnemy unitShareCeasefired = Spring.GetModOptions().sharemode == 'ceasefire' end local cmd, help cmd = "sharectrl" local h = '' h = h.. ' [ "none" | "ally" | "full"]: basic sharing modes\n' h = h..cmd..' <"u"|"r"> ["e"] [0|1]: finer sharing control\n' h = h..' u: unit sharing\n' h = h..' r: resource sharing\n' h = h..' e: enemy mode\n' -- h = h..cmd..' [0|1]: control unit and resource sharing\n' -- h = h..cmd..' res [0|1]: control resource sharing\n' -- h = h..cmd..' unit [0|1]: control unit sharing\n' -- h = h..cmd..' enemy [0|1]: control enemy unit and resource sharing\n' -- h = h..cmd..' enemy res [0|1]: control enemy resource sharing\n' help = h gadgetHandler:AddChatAction(cmd, ChatControl, help) Script.AddActionFallback(cmd .. ' ', help) --------------- CarRepairer start ------------- --[[ allyTeamList = GetAllyTeamList() allyTeamCount = {} backupPlayerMode = (Spring.GetModOptions().backupplayers == 1) for _, allyTeam in ipairs(allyTeamList) do teamList = GetTeamList(allyTeam) allyTeamCount[allyTeam] = #teamList for _, team in ipairs(teamList) do _,_,_,_,faction,_ = GetTeamInfo(team) if (faction == 'backup') then backups[team] = allyTeam end end end --]] --------------- CarRepairer end ------------- end --------------- CarRepairer start ------------- --[[ function MissingPlayer(allyTeamID) local activePlayers = GetPlayerList(true) activePlayerCount = 0 for _, activePlayer in ipairs(activePlayers) do local _, _, _, curTeamID, curAllyTeamID = GetPlayerInfo(activePlayer) if curAllyTeamID == allyTeamID then activePlayerCount = activePlayerCount + 1 end end if activePlayerCount < allyTeamCount[allyTeamID] then return true end return false end --]] --------------- CarRepairer end ------------- function gadget:Shutdown() gadgetHandler:RemoveChatAction("sharectrl", ChatControl) end function gadget:AllowResourceTransfer(oldTeam, newTeam, type, amount) if(amount < 0) then return end --thx to gnurps@o2.pl for this patch. This prevent player from taking resources from his ally. if (resShare) then --if (resShareEnemy or Spring.AreTeamsAllied(oldTeam, newTeam)) then local _,_,_,_,_,oldAlliance = spGetTeamInfo(oldTeam) local _,_,_,_,_,newAlliance = spGetTeamInfo(newTeam) if (resShareEnemy or oldAlliance == newAlliance) then return true else Spring.SendMessageToTeam(oldTeam, "Cannot give resources to enemies when the fixed alliances option is set.") end else Spring.SendMessageToTeam(oldTeam, "Resource sharing has been disabled.") end return false end local function AddRefusal(team, msg) local frameNum = Spring.GetGameFrame() local lastRefusal = lastRefusals[team] if ((not lastRefusal) or (lastRefusal ~= frameNum)) then lastRefusals[team] = frameNum Spring.SendMessageToTeam(team, msg) end end function gadget:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) --------------- CarRepairer start ------------- --[[ if (backups[newTeam]) then allyTeam = backups[newTeam] if backupPlayerMode then if (MissingPlayer(allyTeam)) then backups[newTeam] = nil allyTeamCount[allyTeam] = allyTeamCount[allyTeam] - 1 else AddRefusal(oldTeam, "A Backup Player cannot receive units until a player drops.") return false end else AddRefusal(oldTeam, "A Backup may only receive units in 'Backup Player Mode.'") return false end end --]] --------------- CarRepairer end ------------- if (capture) then return true end if (Spring.IsCheatingEnabled()) then return true end local _,_,_,_,faction,_ = GetTeamInfo(newTeam) if (faction == 'teamspec') then AddRefusal(oldTeam, "Cannot share units to a Teamspec.") return false end if GG.shareunits[unitID] then GG.shareunits[unitID] = nil return true end if (not unitShare) then AddRefusal(oldTeam, "Unit sharing has been disabled.") return false end -- AreTeamsAllied includes temporary alliances local _,_,_,_,_,oldAlliance = spGetTeamInfo(oldTeam) local _,_,_,_,_,newAlliance = spGetTeamInfo(newTeam) if (unitShareEnemy or oldAlliance == newAlliance) then return true end -- can give PW buildings to gaia local pwUnits = (GG.PlanetWars or {}).unitsByID if (newTeam == Spring.GetGaiaTeamID()) and (pwUnits or {})[unitID] then return true end if (unitShareCeasefired and Spring.AreTeamsAllied(oldTeam, newTeam)) then return true end AddRefusal(oldTeam, "Cannot give units to enemies unless enabled in mod options.") return false end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/Gadgets/share_levels.lua b/LuaRules/Gadgets/share_levels.lua deleted file mode 100644 index 2b521e1fb..000000000 --- a/LuaRules/Gadgets/share_levels.lua +++ /dev/null @@ -1,231 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: share_levels.lua --- brief: control resource sharing --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "ShareLevels", - desc = "Control resource sharing", - author = "trepan", - date = "Apr 22, 2007", - license = "GNU GPL, v2 or later", - layer = -5, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local metalForce = true -local metalLevel = 0.95 - -local energyForce = true -local energyLevel = 0.9 - --- for toggling -local prevMetal = false -local prevEnery = false - -local cmdName = "sharelevels" -local help = " []>]>" - .. ": control automatic team resource sharing" - - --------------------------------------------------------------------------------- - -local function AllowAction(playerID) - if (playerID ~= 0) then - Spring.SendMessageToPlayer(playerID, "Must be the host player") - return false - end - if (not Spring.IsCheatingEnabled()) then - Spring.SendMessageToPlayer(playerID, "Cheating must be enabled") - return false - end - return true -end - - - -local function PrintHelp() - Spring.Echo(help) - return true -end - - -local function PrintState() - if (not metalForce) then - Spring.Echo('forced metal sharing is disabled') - else - Spring.Echo(string.format( - 'forced metal sharing level set to: %i%%', - ((1 - metalLevel) * 100) - )) - end - if (not energyForce) then - Spring.Echo('forced energy sharing is disabled') - else - Spring.Echo(string.format( - 'forced energy sharing level set to: %i%%', - ((1 - energyLevel) * 100) - )) - end - return true -end - - -local function ToggleBoth() - local hadPrev = (prevMetal or prevEnergy) - if (metalForce or energyForce) then - prevMetal = metalForce - prevEnergy = energyForce - metalForce = false - energyForce = false - elseif (hadPrev) then - metalForce = prevMetal - energyForce = prevEnergy - else - metalForce = true - energyForce = true - end -end - - -local function ChatControl(cmd, line, words, playerID) - if (not AllowAction(playerID)) then - PrintState() - return true - end - - local w1, w2 = words[1], words[2] - - if ((w1 == 'list') or (w1 == 'l')) then - return PrintState() - elseif ((w1 == 'toggle') or (w1 == 't')) then - ToggleBoth() - return PrintState() - elseif (w1 == 'on') then - metalForce = true - energyForce = true - return PrintState() - elseif (w1 == 'off') then - metalForce = false - energyForce = false - return PrintState() - end - - if (not (w1 == 'e') and - not (w1 == 'm') and - not (w1 == '*')) then - return PrintHelp() - end - - if (w2 == nil) then - if (w1 == 'm') then - metalForce = not metalForce - return PrintState() - elseif (w1 == 'e') then - energyForce = not energyForce - return PrintState() - else - ToggleBoth() - return PrintState() - end - end - - if ((w2 == 'on') or (w2 == 'off')) then - local state = (w2 == 'on') - if (w1 == 'm') then - metalForce = state - return PrintState() - elseif (w1 == 'e') then - energyForce = state - return PrintState() - else - metalForce = state - energyForce = state - return PrintState() - end - return PrintHelp() - end - - local level = tonumber(w2) - if (level == nil) then - PrintHelp() - Spring.Echo("bad sharing level: " .. w2) - return true - end - level = (100 - level) * 0.01 - if (level < 0) then level = 0 end - if (level > 1) then level = 1 end - - if ((w1 == 'm') or (w1 == '*')) then - metalLevel = level - metalForce = true - end - if ((w1 == 'e') or (w1 == '*')) then - energyLevel = level - energyForce = true - end - - return PrintState() -end - - --------------------------------------------------------------------------------- - -function gadget:Initialize() - if (not gadgetHandler:IsSyncedCode()) then - gadgetHandler:RemoveGadget() - return - end - gadgetHandler:AddChatAction(cmdName, ChatControl, help) - Script.AddActionFallback(cmdName .. ' ', help) -end - - -function gadget:Shutdown() - gadgetHandler:RemoveChatAction(cmdName, ChatControl) -end - - --------------------------------------------------------------------------------- - -local GetTeamList = Spring.GetTeamList -local SetTeamShareLevel = Spring.SetTeamShareLevel - - -function gadget:GameFrame() - if (not (metalForce or energyForce)) then - return - end - for _,team in ipairs(GetTeamList()) do - if (metalForce) then SetTeamShareLevel(team, 'm', metalLevel) end - if (energyForce) then SetTeamShareLevel(team, 'e', energyLevel) end - end - return false -end - - -function gadget:AllowResourceLevel(teamID, type, level) - if (type == 'm') then - return not metalForce - elseif (type == 'e') then - return not energyForce - end - return true -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/spawn_units.lua b/LuaRules/Gadgets/spawn_units.lua deleted file mode 100644 index 1049405a2..000000000 --- a/LuaRules/Gadgets/spawn_units.lua +++ /dev/null @@ -1,195 +0,0 @@ - -function gadget:GetInfo() - return { - name = "Spawn Units", - desc = "Spawn/dump units & features & triggers from/to missions startscripts", - author = "zwzsg", - version = "1.6", - date = "20th May, 2009", - license = "Public Domain", - layer = 0, - enabled = true, - } -end - -VFS.Include("LuaRules/Gadgets/libs/dump_units_lib.lua",nil) -VFS.Include("LuaRules/Gadgets/libs/FillModSpecific.lua",nil) ---VFS.Include("LuaRules/Gadgets/libs/ColorConversion.lua",nil) -- Not need to invent new color when we take current ones -VFS.Include("LuaRules/Gadgets/libs/GenerateGame.lua",nil) -- Only so WriteScript.lua gets GetMaxAllyTeam from GenerateGame.lua" -VFS.Include("LuaRules/Gadgets/libs/WriteScript.lua",nil) - -if (gadgetHandler:IsSyncedCode()) then ---SYNCED - - local fullscript={} - function gadget:RecvLuaMsg(msg,player) - local MsgForMe=string.match(msg,gadget:GetInfo().name..":(.*)") - if MsgForMe then - local num,str=string.match(MsgForMe,"(%d+)%:(.*)") - fullscript[tonumber(num)]=str - end - end - - function gadget:GameFrame(frame) - if frame>12 then - RefreshTriggers(frame) - elseif frame==3 then - if #fullscript>0 and Spring.GetModOptions() and Spring.GetModOptions()["fullscript"] then - fullscript=table.concat(fullscript,"") - SetModOptionsToFull(fullscript) - fullscript={} - end - SpawnHeightMap() - SpawnAllTriggers() - SpawnAllUnits() -- This also delete already present units for teams with RemoveUnits=1 - SpawnAllFeatures() -- This also delete features when RemoveFeatures=1. By default does it on a pear team basis, leaving Gaia features untouched. - elseif frame==5 then - SpawnAllOrders() - SpawnResources() - end - end - - - function gadget:UnitDestroyed(u) - RemoveUnitFromSpawn(u) - end - - - - local function DumpCmdIssued(cmd,line,words,player) - if #Spring.GetPlayerList()>1 and not Spring.IsCheatingEnabled() then - Spring.SendMessageToPlayer(player,"Dump in multiplayer requires cheat") - return - end - --Spring.SendMessageToPlayer(player,"/dump [filename] [abbreviated] [grid] [restart]") - local restart=false - local SaveHeightmap=false - repeat - local LoopAgain=false - if words[#words] and string.lower(words[#words])=="restart" then - table.remove(words) - restart=true - LoopAgain=true - end - if words[#words] and string.lower(words[#words])=="light" then - table.remove(words) - SaveHeightmap=false - LoopAgain=true - end - until not LoopAgain - local filename=words[1] - local abbreviated=((words[2] and ((not tonumber(words[2])) or (tonumber(words[2])>=1))) and 1 or nil) - local grid=(words[3] and tonumber(words[3])) or nil - if filename and string.len(filename)>=1 then - if string.sub(filename,-4)~=".txt" and string.sub(filename,-4)~=".sav" then - filename=filename..".sav" - end - else - filename="Dump.sav" - end - SendToUnsynced("Dump",filename,abbreviated,grid,restart,SaveHeightmap)-- "Dump" is both the name of the SyncAction, and the first parameter passed to it - end - - local function SetupCmdDump() - local cmd,func,help - cmd = "dump" - func = DumpCmdIssued - help = " dump every unit into a startscript" - gadgetHandler:AddChatAction(cmd,func,help) - Script.AddActionFallback(cmd..' ',help) - end - - function gadget:Initialize() - GG.MissionTrigger={Equ={},States={},FromNames={}} - SetupCmdDump() - end - -else ---UNSYNCED - - local function IsThereFolder(foldername,path) - local folders=VFS.SubDirs((path or "").."/","*",VFS.RAW) - for _,folder in ipairs(folders) do - local BeginIndex=1 - local EndIndex=string.len(folder) - while string.sub(folder,EndIndex,EndIndex)=="/" or string.sub(folder,EndIndex,EndIndex)=="\\" do - EndIndex=EndIndex-1 - end - repeat - local NewBeginIndex=string.find(string.sub(folder,BeginIndex,EndIndex),"/",1,true) - or string.find(string.sub(folder,BeginIndex,EndIndex),"\\",1,true) - BeginIndex=NewBeginIndex and BeginIndex+NewBeginIndex or BeginIndex - until not NewBeginIndex - if string.lower(string.sub(folder,BeginIndex,EndIndex))==string.lower(foldername) then - return true - end - end - return false - end - - local function MakeDumpNao(actioname,filename,abbreviated,grid,restart,SaveHeightmap) - if restart then - Spring.Echo("MakeDumpNao with restart") - if Script.LuaUI('WriteAndRunState') then - local state,ok=GenerateFromCurrentState(nil,nil,true,false) - if ok then - Script.LuaUI.WriteAndRunState(state) - else - Spring.Echo((actioname or "Dump").." failed!" - ..(ok and "" or " Failed to regenerate game state script.")) - end - else - Spring.Echo((actioname or "Dump").." impossible!" - .." Please enable \"Write GameState\" widget.") - end - else - local state,ok=GenerateFromCurrentState(nil,nil,false,SaveHeightmap) - if ok and Script.LuaUI('WriteStateToScript') then - local folder="Savegames" - pcall(Spring.CreateDir,folder) - if IsThereFolder(folder) then - folder=folder.."/"..Game.modShortName - pcall(Spring.CreateDir,folder) - if IsThereFolder(Game.modShortName,"savegames") then - folder=folder.."/" - else - folder="" - end - else - folder="" - end - Spring.Echo((actioname or "Dump").." to \""..folder..filename.."\"") - Script.LuaUI.WriteStateToScript(state,folder..filename,abbreviated,grid) - else - Spring.Echo((actioname or "Dump").." failed!" - ..(ok and "" or " Failed to regenerate game state script.") - ..(Script.LuaUI('WriteStateToScript') and "" or " Please enable \"Write GameState\" widget.")) - end - end - end - - local LastAutoSaveFrame = 0 - - function gadget:DrawScreen() - local frame=Spring.GetGameFrame() - if frame>LastAutoSaveFrame+30*60*5 then -- 30 frames per seconds, 60 seconds per minutes, 5 minutes - LastAutoSaveFrame=frame - if #Spring.GetPlayerList()<=1 or Spring.IsCheatingEnabled() then - MakeDumpNao("AutoSave","AutoSave.sav") - end - end - end - - function gadget:Initialize() - gadgetHandler:AddSyncAction("Dump",MakeDumpNao) - local fullscript=GetFullScript() - if fullscript then - -- Spring crashes when I send 2MB through SendLuaRulesMsg, so I split it in smaller chunks - local chunk_size=30000 - for chunk=0,string.len(fullscript)/chunk_size do - Spring.SendLuaRulesMsg(gadget:GetInfo().name..":"..(1+chunk)..":"..string.sub(fullscript,1+chunk*chunk_size,(1+chunk)*chunk_size)) - end - end - end - -end diff --git a/LuaRules/Gadgets/system_info.lua b/LuaRules/Gadgets/system_info.lua new file mode 100644 index 000000000..ccf44ad83 --- /dev/null +++ b/LuaRules/Gadgets/system_info.lua @@ -0,0 +1,198 @@ + +function gadget:GetInfo() + return { + name = "System info", + desc = "", + author = "Floris", + date = "July,2016", + layer = 0, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-- synced +-------------------------------------------------------------------------------- +if gadgetHandler:IsSyncedCode() then + + local charset = {} do -- [0-9a-zA-Z] + for c = 48, 57 do table.insert(charset, string.char(c)) end + for c = 65, 90 do table.insert(charset, string.char(c)) end + for c = 97, 122 do table.insert(charset, string.char(c)) end + end + local function randomString(length) + if not length or length <= 0 then return '' end + --math.randomseed(os.clock()^5) + return randomString(length - 1) .. charset[math.random(1, #charset)] + end + + local validation = randomString(2) + _G.validationSys = validation + + function gadget:RecvLuaMsg(msg, playerID) + if msg:sub(1,3)=="$y$" and msg:sub(4,5)==validation then + SendToUnsynced("systemBroadcast",playerID,msg:sub(6)) + return true + end + end + +else + -------------------------------------------------------------------------------- + -- unsynced + -------------------------------------------------------------------------------- + + local SendLuaRulesMsg = Spring.SendLuaRulesMsg + local systems = {} + local validation = SYNCED.validationSys + + function lines(str) + local t = {} + local function helper(line) table.insert(t, line) return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t + end + + function gadget:Initialize() + gadgetHandler:AddSyncAction("systemBroadcast", handleSystemEvent) + + if (Spring.GetConfigInt("SystemPrivacy",0) or 0) == 1 then + return + end + + if Engine ~= nil and Platform ~= nil then -- v104 + if Platform.gpu ~= nil then + s_gpu = Platform.gpu + s_gpu = string.gsub(s_gpu, "/PCIe", "") + s_gpu = string.gsub(s_gpu, "/SSE2", "") + s_gpu = string.gsub(s_gpu, " Series", "") + s_gpu = string.gsub(s_gpu, "%((.*)%)", "") + s_gpu = string.gsub(s_gpu, "Gallium ([0-9].*) on ", "") + if Platform.gpuVendor == 'Nvidia' then + s_gpuVram = math.floor(Platform.gpuMemorySize/1000)..'MB' + end + end + if Platform.osFamily ~= nil then + s_os = Platform.osFamily + if Platform.osVersion ~= nil then + s_os = s_os .. ' ' .. Platform.osVersion + end + end + end + + local infolog = VFS.LoadFile("infolog.txt") + if infolog then + + -- store changelog into array + fileLines = lines(infolog) + + for i, line in ipairs(fileLines) do + + if string.sub(line, 1, 3) == '[F=' then + break + end + + -- Spring v104 + if s_gpu ~= nil and string.match(line, 'current=\{[0-9]*x[0-9]*') then + s_resolution = string.sub(string.match(line, 'current=\{[0-9]*x[0-9]*'), 10) + end + + if s_gpu == nil and string.find(line, '(Supported Video modes on Display )') then + if s_displays == nil then + s_displays = '' + ds = '' + end + s_displays = s_displays .. ds .. string.gsub(string.match(line, '([0-9].*)'), ':','') + ds = ' | ' + end + if string.find(line, 'Physical CPU Cores') then + s_cpuCoresPhysical = string.match(line, '([0-9].*)') + end + if string.find(line, 'Logical CPU Cores') then + s_cpuCoresLogical = string.match(line, '([0-9].*)') + end + if (string.find(line:lower(), 'hardware config: ')) then + s_cpu = string.sub(line, select(2, string.find(line:lower(), 'hardware config: '))) + s_cpu = string.match(s_cpu, '([\+a-zA-Z0-9 ()@._-]*)') + s_cpu = string.gsub(s_cpu, " Processor", "") + s_cpu = string.gsub(s_cpu, " Eight[-]Core", "") + s_cpu = string.gsub(s_cpu, " Six[-]Core", "") + s_cpu = string.gsub(s_cpu, " Quad[-]Core", "") + s_cpu = string.gsub(s_cpu, " CPU", "") + s_cpu = string.gsub(s_cpu, "%((.*)%)", "") + s_ram = string.match(line, '([0-9]*MB RAM)') + s_ram = string.gsub(s_ram, " RAM", "") + end + if (string.find(line:lower(), 'operating system: ')) then + s_os = string.sub(line, select(2, string.find(line:lower(), 'operating system: '))) + end + end + + + --if s_os == nil and s_configs_os == nil and string.find(line, 'Operating System:') then + -- local charStart = string.find(line, 'Operating System:') + -- s_os = string.sub(line, 18 + charStart) + --end + + if s_config ~= nil and configEnd == nil and line == '============== ==============' then + configEnd = true + end + if s_config ~= nil and configEnd == nil then + s_config = s_config..nl..line + nl = '\n' + end + if s_config == nil and line == '============== ==============' then + s_config = '' + nl = '' + end + end + + if s_os then + if string.find(s_os, 'Windows') then -- simplyfy, also for some privacy (hiding build number) + s_os = string.match(s_os, "(Windows [0-9.]*)") + elseif string.find(s_os, 'Linux') then -- simplyfy, also for some privacy (hiding build number) + s_os = 'Linux' + end + end + + local system = '' + if s_cpu ~= nil then + system = system..'\nCPU: '..string.gsub(s_cpu, " ", " ") + end + if s_cpuCoresPhysical ~= nil then + system = system..'\nCPU cores: '..s_cpuCoresPhysical..' / '..s_cpuCoresLogical + end + if s_ram ~= nil then + system = system..'\nRAM: '..string.gsub(s_ram, " ", " ") + end + if s_gpu ~= nil then + system = system..'\nGPU: '..string.gsub(s_gpu, " ", " ") + end + if s_gpuVram ~= nil then + system = system..'\nGPU VRAM: '..string.gsub(s_gpuVram, " ", " ") + end + if s_resolution ~= nil then + system = system..'\n'..string.gsub(s_resolution, " ", " ") + end + if s_os ~= nil then + system = system..'\nOS: '..s_os + end + + system = string.sub(system, 2) + if system ~= '' then + SendLuaRulesMsg("$y$"..validation..system) + end + end + + function gadget:Shutdown() + gadgetHandler:RemoveSyncAction("systemBroadcast") + end + + function handleSystemEvent(_,playerID,system) + if Script.LuaUI("SystemEvent") then + if systems[playerID] == nil and system ~= nil then systems[playerID] = system end + Script.LuaUI.SystemEvent(playerID,systems[playerID]) + end + end + +end + diff --git a/LuaRules/Gadgets/tp_cover.lua b/LuaRules/Gadgets/tp_cover.lua deleted file mode 100644 index 2339bc42b..000000000 --- a/LuaRules/Gadgets/tp_cover.lua +++ /dev/null @@ -1,219 +0,0 @@ -----used custom tags -------in the featureDef: provide_cover (int) -------in the unitDef: need_cover (int) - -function gadget:GetInfo() - return { - name = "take cover assheads", - desc = "fuck yeah", - author = "knorke", - date = "now", - license = "weeeeeee iam on horse", - layer = -3, - enabled = true-- loaded by default? - } -end - -if (gadgetHandler:IsSyncedCode()) then ---SYNCHED - -local resolution = 100 -local updateRate = 30 -_G.resolution = resolution -cover = {} -_G.cover = cover -local mapX = Game.mapSizeX+1 -local mapZ = Game.mapSizeZ+1 - -local needed_cover = {} --[unitID] - ---Spring.GetFeatureRadius ( number featureID ) -> nil | number ---Spring.GetFeaturePosition( number featureID ) -> nil | number x, number y, number z - -function gadget:Initialize() - local all_units = Spring.GetAllUnits () - for i in pairs(all_units) do - --Spring.Echo ("unit " .. all_units[i]) - local ud = UnitDefs[Spring.GetUnitDefID(all_units[i])] - if (ud) then - needed_cover[all_units[i]] = tonumber (ud.customParams.needed_cover) or 999 - --Spring.Echo ("needs a cover of " .. needed_cover[all_units[i]]) - end - end - buildCover () -end - -function setcover (x,z, c) - --Spring.Echo ("x= ".. x .. " z=" .. z) - local tx, tz = tcoord (x,z) - --Spring.Echo ("tx= ".. tx .. " tz=" .. tz) - cover[tx][tz] = c - _G.cover = cover -end - -function getcover (x,z) - if (x > mapX) then return 0 end - if (x < 0) then return 0 end - if (z > mapZ) then return 0 end - if (z < 0) then return 0 end - local tx, tz = tcoord (x,z) - return cover[tx][tz] or 0 -end - -function addcover (x,z, a) - --Spring.Echo ("adding " .. a .. " cover at " .. x .. ":" .. z) - local old = getcover (x,z) - if (old+a < 0) then - setcover (x,z, 0) - else - setcover (x,z, old+a) - end -end - -function providedCoverFromFeature (featureID) - local fd = FeatureDefs[Spring.GetFeatureDefID(featureID)] - --Spring.Echo (fd.name) - if (not fd) then return 555 end - if (not fd.customParams) then return 666 end - return fd.customParams["provide_cover"] or 0 -end - - -function tcoord (x,z) - tx=math.floor ((x/resolution)+0.5) - tz=math.floor ((z/resolution)+0.5) - return tx,tz -end - -function buildCover () - local cnt=0 - for x=0, mapX+resolution, resolution do - local tx, tz = tcoord (x,666) - cover[tx]={} - for z=0 , mapZ+resolution, resolution do - cnt=cnt+1 - --Spring.Echo ("BAUE tx= ".. tx .. " tz=" .. tz) - local tx, tz = tcoord (x,z) - cover[tx][tz] = 0 --***wasting memory. who cares? - end - end - --Spring.Echo ("count=" .. cnt) - - local allF = Spring.GetAllFeatures () - for i in pairs(allF) do - local fi = allF[i] - local x,y,z = Spring.GetFeaturePosition (fi) - if(x and z) then - --local tx, tz = tcoord (x,z) - --Spring.MarkerAddPoint (x,y,z, "feature @ " .. tx .. ":" .. tz) - --addcover (x,z, 1) - --addcover (x,z, 1) - addcover (x,z, providedCoverFromFeature (fi)) - --local old = getcover (tx,tz) - --setcover (x,z, old+a) - end - end -end - -function updateUnits () - local all_units = Spring.GetAllUnits () - for i in pairs(all_units) do - local x,y,z=Spring.GetUnitPosition (all_units[i]) - if (x and y and z) then --***why is this needed? sometimes x is nil for some reason?! - local c = getcover (x,z) - if (c >= (needed_cover[all_units[i]] or 999)) then - --Spring.Echo (c) - hideUnit (all_units[i]) - else - unhideUnit (all_units[i]) - end - end - - end -end - ---***vielleicht lieber setunitlosstate? -function hideUnit (uID) - Spring.SetUnitCloak (uID, 2 ,false) - Spring.SetUnitStealth (uID, true) -end - -function unhideUnit (uID) - Spring.SetUnitCloak (uID, false ,false) - if not UnitDefs[Spring.GetUnitDefID(uID)].stealth then - Spring.SetUnitStealth (uID, false) - end -end - - -function gadget:GameFrame (f) - if (f%updateRate ==0) then - --Spring.Echo ("running") - updateUnits () - end -end - -function gadget:FeatureDestroyed(featureID, allyTeam) - local x,y,z = Spring.GetFeaturePosition (featureID) - if(x and z) then - addcover (x,z, -providedCoverFromFeature (featureID)) - end -end - -function gadget:FeatureCreated(featureID, allyTeam) - local x,y,z = Spring.GetFeaturePosition (featureID) - if(x and z) then - addcover (x,z, providedCoverFromFeature (featureID)) - end -end - -function gadget:UnitFinished(unitID, unitDefID, teamID) - local cp = UnitDefs[unitDefID].customParams - if (not cp) then return end - needed_cover[unitID] = tonumber (cp.needed_cover) or math.huge -end - -function gadget:UnitDestroyed(unitID) - needed_cover[unitID] = nil -end - - -------------------- -else ----UNSYNCED-- -------------------- - -local debugDraw = false ---***how can i avoid having this function twice? -function utcoord (x,z) - tx=math.floor ((x/SYNCED.resolution)+0.5) - tz=math.floor ((z/SYNCED.resolution)+0.5) - return tx,tz -end - -function ugetcover (x,z) - local tx, tz = utcoord (x,z) - return SYNCED.cover[tx][tz] -end - -function gadget:DrawWorldPreUnit() - if (debugDraw) then - --gl.LineWidth(2.0) - gl.Color(0, 1, 1, 1) - local mapX = Game.mapSizeX-1 - local mapZ = Game.mapSizeZ-1 - for x=1, mapX, SYNCED.resolution do - for z=1 ,mapZ, SYNCED.resolution do - local c = ugetcover (x,z) - if (c > -1) then - gl.DrawGroundCircle (x,100,z, SYNCED.resolution/2, 8) - gl.DrawGroundCircle (x,100,z, (SYNCED.resolution/10)+(c*10), 8) - end - end - end - end -end - ---[[ function gadget:KeyPress(key, mods, isRepeat) - if (key == 108 and Spring.IsCheatingEnabled() ) then debugDraw = not debugDraw end --108=L -end ]]-- - -end \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_cloak_shield.lua b/LuaRules/Gadgets/unit_cloak_shield.lua index 990eba567..9be87753d 100644 --- a/LuaRules/Gadgets/unit_cloak_shield.lua +++ b/LuaRules/Gadgets/unit_cloak_shield.lua @@ -1 +1,927 @@ --- $Id: unit_cloak_shield.lua 3605 2008-12-31 08:50:31Z google frog $ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- file: unit_cloak_shield.lua -- brief: adds a cloak-shield command to units -- author: Dave Rodgers, modified by Evil4Zerggin -- -- Copyright (C) 2007. -- Licensed under the terms of the GNU GPL, v2 or later. -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "UnitCloakShield", desc = "Adds a cloak-shield command to units", author = "trepan, modified by Evil4Zerggin", date = "May 02, 2007", --updated on 23 January 2014 license = "GNU GPL, v2 or later", layer = 1, enabled = true -- loaded by default? } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- FIXME: (TODO) -- - wait for UnitFinished() before allowing cloak_shield? -- - don't allow state changes during pauses (tied to the above) -- -------------------------------------------------------------------------------- include("LuaRules/Configs/customcmds.h.lua") local SYNCSTR = "unit_cloak_shield" -------------------------------------------------------------------------------- -- COMMON -------------------------------------------------------------------------------- if (gadgetHandler:IsSyncedCode()) then -------------------------------------------------------------------------------- -- SYNCED -------------------------------------------------------------------------------- -- -- speed-ups -- local GetUnitDefID = Spring.GetUnitDefID local UseUnitResource = Spring.UseUnitResource local GetUnitSeparation = Spring.GetUnitSeparation local SetUnitCloak = Spring.SetUnitCloak local FindUnitCmdDesc = Spring.FindUnitCmdDesc local EditUnitCmdDesc = Spring.EditUnitCmdDesc local SetUnitRulesParam = Spring.SetUnitRulesParam local GetUnitRulesParam = Spring.GetUnitRulesParam -------------------------------------------------------------------------------- local cloakShieldDefs = {} local uncloakableDefs = {} local cloakShieldUnits = {} -- make it global in Initialize() local cloakers = {} local cloakees = {} local cloakShieldCmdDesc = { id = CMD_CLOAK_SHIELD, type = CMDTYPE.ICON_MODE, name = 'CloakShield', cursor = 'CloakShield', -- add with LuaUI? action = 'cloak_shield', tooltip = 'Cloak Shield State: Sets whether the unit is cloaking', params = {'0', 'Cloaker Off', 'Cloaker On' } } -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function ValidateCloakShieldDefs(mds) local newDefs = {} for udName, def in pairs(mds) do local ud = UnitDefNames[udName] if (not ud) then Spring.Log(gadget:GetInfo().name, LOG.WARNING, 'Bad cloakShield unit type: ' .. udName) else local newData = {} newData.draw = def.draw or true newData.init = def.init or false newData.level = def.level or 2 newData.delay = def.delay or 30 newData.energy = def.energy or 0 newData.minrad = def.minrad or 64 newData.maxrad = def.maxrad or 256 newData.growRate = def.growRate or 256 newData.shrinkRate = def.shrinkRate or 256 newData.selfCloak = def.selfCloak or false newData.decloakDistance = def.decloakDistance or false newData.isTransport = (ud.transportCapacity >= 1) newDefs[ud.id] = newData end end -- print the table (alphabetically) --[[ local sorted = {} for n, ud in pairs(UnitDefNames) do table.insert(sorted, {n, ud.id}) end table.sort(sorted, function(a,b) return (a[1] < b[1]) end) for _, name_id in ipairs(sorted) do local nd = newDefs[ name_id[2] ] if (nd) then print('CloakShield ' .. name_id[1]) print(' draw = ' .. tostring(nd.draw)) print(' init = ' .. tostring(nd.init)) print(' delay = ' .. tostring(nd.delay)) print(' energy = ' .. tostring(nd.energy)) print(' minrad = ' .. tostring(nd.minrad)) print(' maxrad = ' .. tostring(nd.maxrad)) print(' growRate = ' .. tostring(nd.growRate)) print(' shrinkRate = ' .. tostring(nd.shrinkRate)) print(' selfCloak = ' .. tostring(nd.selfCloak)) print(' decloakDistance = ' .. tostring(nd.decloakDistance)) end end --]] return newDefs end local function ValidateUncloakableDefs(unclks) local newDefs = {} for udName, data in pairs(unclks) do local ud = UnitDefNames[udName] if (not ud) then Spring.Log(gadget:GetInfo().name, LOG.WARNING, 'Bad uncloakable unit type: ' .. udName) else newDefs[ud.id] = true -- print('uncloakable: ' .. udName) end end return newDefs end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function AddCloakShieldCmdDesc(unitID, cloakShieldDef) cloakShieldCmdDesc.params[1] = (cloakShieldDef.init and '1') or '0' local insertID = FindUnitCmdDesc(unitID, CMD.CLOAK) or FindUnitCmdDesc(unitID, CMD.ONOFF) or FindUnitCmdDesc(unitID, CMD.TRAJECTORY) or FindUnitCmdDesc(unitID, CMD.REPEAT) or FindUnitCmdDesc(unitID, CMD.MOVE_STATE) or FindUnitCmdDesc(unitID, CMD.FIRE_STATE) or 123456 -- back of the pack Spring.InsertUnitCmdDesc(unitID, insertID + 1, cloakShieldCmdDesc) end local function AddCloakShieldRulesParam(unitID, state) SetUnitRulesParam(unitID, "cloak_shield", state and 2 or 0) end local function AddCloakShieldUnit(unitID, cloakShieldDef) AddCloakShieldCmdDesc(unitID, cloakShieldDef) local data = { id = unitID, def = cloakShieldDef, draw = cloakShieldDef.draw, radius = 0, minrad = cloakShieldDef.minrad, maxrad = cloakShieldDef.maxrad, energy = cloakShieldDef.energy / 32, isTransport = cloakShieldDef.isTransport, unitRadius = Spring.GetUnitRadius(unitID), } cloakShieldUnits[unitID] = data if (cloakShieldDef.init) then data.want = true cloakers[unitID] = data end AddCloakShieldRulesParam(unitID, cloakShieldDef.init) end local alliedTrueTable = {allied = true} local function SetUnitCloakAndParam(unitID, level) if level then local cannotCloak = GetUnitRulesParam(unitID, "cannotcloak") if cannotCloak ~= 1 then SetUnitCloak(unitID, level) end else local wantCloak = GetUnitRulesParam(unitID, "wantcloak") if wantCloak == 1 then local cannotCloak = GetUnitRulesParam(unitID, "cannotcloak") if cannotCloak ~= 1 then SetUnitCloak(unitID, 1) end else SetUnitCloak(unitID, 0) end end SetUnitRulesParam(unitID, "areacloaked", (level and 1) or 0, alliedTrueTable) end -------------------------------------------------------------------------------- function gadget:Initialize() -- get the cloakShieldDefs cloakShieldDefs, uncloakableDefs = include("LuaRules/Configs/cloak_shield_defs.lua") if (not cloakShieldDefs) then gadgetHandler:RemoveGadget() return end gadgetHandler:RegisterCMDID(CMD_CLOAK_SHIELD) cloakShieldDefs = ValidateCloakShieldDefs(cloakShieldDefs) uncloakableDefs = ValidateUncloakableDefs(uncloakableDefs) -- add the CloakShield command to existing units for _,unitID in ipairs(Spring.GetAllUnits()) do local unitDefID = GetUnitDefID(unitID) local cloakShieldDef = cloakShieldDefs[unitDefID] if (cloakShieldDef) then AddCloakShieldUnit(unitID, cloakShieldDef) end end end function gadget:Shutdown() for _,unitID in ipairs(Spring.GetAllUnits()) do SetUnitCloakAndParam(unitID, false) local ud = UnitDefs[GetUnitDefID(unitID)] local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) if (cmdDescID) then Spring.RemoveUnitCmdDesc(unitID, cmdDescID) end end end -------------------------------------------------------------------------------- function gadget:UnitCreated(unitID, unitDefID, unitTeam) local cloakShieldDef = cloakShieldDefs[unitDefID] if (not cloakShieldDef) then return end AddCloakShieldUnit(unitID, cloakShieldDef) end function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) cloakShieldUnits[unitID] = nil cloakers[unitID] = nil cloakees[unitID] = nil SendToUnsynced(SYNCSTR, unitID, 0) end function gadget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID) local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID) if (newAllyTeam ~= oldAllyTeam) then if (cloakShieldUnits[unitID]) then cloakShieldUnits[unitID].radius = 0 end cloakers[unitID] = nil cloakees[unitID] = nil SetUnitCloakAndParam(unitID, false) SendToUnsynced(SYNCSTR, unitID, 0) local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) if (cmdDescID) then cloakShieldCmdDesc.params[1] = (state and '2') or '0' EditUnitCmdDesc(unitID, cmdDescID, { params = cloakShieldCmdDesc.params }) end end end -------------------------------------------------------------------------------- local GetUnitAllyTeam = Spring.GetUnitAllyTeam local GetUnitPosition = Spring.GetUnitPosition local GetUnitsInSphere = Spring.GetUnitsInSphere local function UpdateCloakees(data) local unitID = data.id local radius = data.radius local level = data.def.level local selfCloak = data.def.selfCloak local decloakDistance = data.def.decloakDistance local x, y, z = GetUnitPosition(unitID) if (x == nil) then return end local closeUnits = GetUnitsInSphere(x, y, z, radius) if (closeUnits == nil) then return end local allyTeam = GetUnitAllyTeam(unitID) for _,cloakee in ipairs(closeUnits) do local udid = GetUnitDefID(cloakee) if ((not uncloakableDefs[udid]) and (GetUnitAllyTeam(cloakee) == allyTeam)) then if (cloakee ~= unitID) then --other units SetUnitCloakAndParam(cloakee, level) cloakees[cloakee] = true elseif (selfCloak) then --self cloak SetUnitCloakAndParam(cloakee, level) cloakees[cloakee] = true end end -- the GetUnitsInSphere() call uses unit midPos's, which can -- differ from the unit's position while being transported. -- here we do a direct check to see what units the cloakees are -- transporting. this does not fix nested transports if (UnitDefs[udid].transportCapacity >= 1) then local transported = Spring.GetUnitIsTransporting(cloakee) if transported ~= nil then for _,cloakeeLvl2 in ipairs(transported) do local udid = GetUnitDefID(cloakeeLvl2) if ((not uncloakableDefs[udid]) and (GetUnitAllyTeam(cloakeeLvl2) == allyTeam)) then SetUnitCloakAndParam(cloakeeLvl2, 4) -- note: this gives perfect cloaking, but is the only level -- to work under paralysis cloakees[cloakeeLvl2] = true end end end end end --check if the cloaker is a transport if (data.isTransport and (radius >= data.unitRadius)) then local transported = Spring.GetUnitIsTransporting(unitID) if transported ~= nil then for _,cloakee in ipairs(transported) do local udid = GetUnitDefID(cloakee) if ((not uncloakableDefs[udid]) and (GetUnitAllyTeam(cloakee) == allyTeam)) then SetUnitCloakAndParam(cloakee, level) cloakees[cloakee] = true end end end end end local function GrowRadius(cloaker) local r = cloaker.radius local maxrad = cloaker.maxrad if (r >= maxrad) then r = maxrad return r end r = (r * r) + cloaker.def.growRate r = math.sqrt(r) r = (r >= cloaker.maxrad) and cloaker.maxrad or r cloaker.radius = r if (cloaker.draw) then SendToUnsynced(SYNCSTR, cloaker.id, r) end end local function ShrinkRadius(cloaker) local r = cloaker.radius if (r <= 0) then cloaker.radius = 0 return 0 end local r = cloaker.radius r = (r * r) - cloaker.def.shrinkRate r = (r < 0) and 0 or math.sqrt(r) cloaker.radius = r if (cloaker.draw) then SendToUnsynced(SYNCSTR, cloaker.id, r) end if ((r <= 0) and (not cloaker.want)) then cloakers[cloaker.id] = nil end end local GetUnitIsStunned = Spring.GetUnitIsStunned function gadget:GameFrame(frameNum) local checkCloakees = ((frameNum % 6) < 1) if (checkCloakees) then for uid in pairs(cloakees) do SetUnitCloakAndParam(uid, false) end cloakees = {} end for unitID, data in pairs(cloakers) do if (data.delay) then data.delay = data.delay - 1 if (data.delay <= 0) then data.delay = nil end ShrinkRadius(data) elseif (GetUnitIsStunned(unitID) or (Spring.GetUnitRulesParam(unitID, "disarmed") == 1)) then ShrinkRadius(data) elseif (not data.want) then ShrinkRadius(data) else local activeState = Spring.GetUnitStates(unitID) local newState = activeState and activeState["active"] and UseUnitResource(unitID, 'e', data.energy) if (newState) then GrowRadius(data) else ShrinkRadius(data) end if (data.active ~= newState) then data.active = newState if (newState) then SetUnitRulesParam(unitID, "cloak_shield", 2) else SetUnitRulesParam(unitID, "cloak_shield", 1) data.delay = data.def.delay end end end if (checkCloakees and (data.radius > 0)) then UpdateCloakees(data) end end end -------------------------------------------------------------------------------- function CloakShieldCommand(unitID, cmdParams) if (type(cmdParams[1]) ~= 'number') then return false end local data = cloakShieldUnits[unitID] if (not data) then return false end local state = (cmdParams[1] == 1) if (state) then cloakers[unitID] = data data.want = true SetUnitRulesParam(unitID, "cloak_shield", 2) else data.want = false SetUnitRulesParam(unitID, "cloak_shield", 0) end local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) if (cmdDescID) then cloakShieldCmdDesc.params[1] = (state and '1') or '0' EditUnitCmdDesc(unitID, cmdDescID, { params = cloakShieldCmdDesc.params }) end end function gadget:AllowCommand_GetWantedCommand() return {[CMD_CLOAK_SHIELD] = true} end function gadget:AllowCommand_GetWantedUnitDefID() return true end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) if (cmdID ~= CMD_CLOAK_SHIELD) then return true -- command was not used end CloakShieldCommand(unitID, cmdParams) return false -- command was used end function gadget:CommandFallback(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) if (cmdID ~= CMD_CLOAK_SHIELD) then return false -- command was not used end CloakShieldCommand(unitID, cmdParams) return true, true -- command was used, remove it end -------------------------------------------------------------------------------- -- SYNCED -------------------------------------------------------------------------------- else -------------------------------------------------------------------------------- -- UNSYNCED -------------------------------------------------------------------------------- -- -- speed-ups -- local GetUnitTeam = Spring.GetUnitTeam local GetUnitRadius = Spring.GetUnitRadius local GetUnitHeading = Spring.GetUnitHeading local GetUnitViewPosition = Spring.GetUnitViewPosition local GetGameFrame = Spring.GetGameFrame local GetFrameTimeOffset = Spring.GetFrameTimeOffset local glPushMatrix = gl.PushMatrix local glPopMatrix = gl.PopMatrix local glTranslate = gl.Translate local glRotate = gl.Rotate local glScale = gl.Scale local glCallList = gl.CallList -------------------------------------------------------------------------------- local sphereDivs = 16 local sphereArcs = 32 local drawUnits = {} local sphereList = 0 local negSphereList = 0 local setupMatList = 0 local resetMatList = 0 local backMatList = 0 local frontMatList = 0 local atiFixMatList = 0 local shieldList = 0 local miniMapXformList = 0 local trans = {0.1, 0.28, 0.60 } -------------------------------------------------------------------------------- local function SphereVertex(x, y, z, neg) if (neg) then gl.Normal(-x, -y, -z) else gl.Normal(x, y, z) end gl.Vertex(x, y, z) end local function DrawSphere(divs, arcs, neg) local cos = math.cos local sin = math.sin local twoPI = (2.0 * math.pi) local divRads = math.pi / divs local minRad = sin(divRads) -- sides for d = 4, (divs - 2) do if (d < 7) then gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, trans[d-3]}, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1 }, shininess = 4 }) elseif (d > 10) then gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, trans[15-d]}, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1 }, shininess = 4 }) else gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 1.0 }, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1.0 }, shininess = 4 }) end gl.BeginEnd(GL.QUAD_STRIP, function() local topRads = divRads * (d + 0) local botRads = divRads * (d + 1) local top = cos(topRads) local bot = cos(botRads) local topRad = sin(topRads) local botRad = sin(botRads) for i = 0, arcs do local a = i * (2.0 * math.pi) / arcs SphereVertex(sin(a) * topRad, top, cos(a) * topRad, neg) SphereVertex(sin(a) * botRad, bot, cos(a) * botRad, neg) end end) end -- bottom gl.BeginEnd(GL.TRIANGLE_FAN, function() SphereVertex(0, -1, 0, neg) for i = 0, arcs do local a = -i * (2.0 * math.pi) / arcs SphereVertex(sin(a) * minRad, -cos(divRads), cos(a) * minRad, neg) end end) gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 0.5 }, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1.0 }, shininess = 4 }) -- lines gl.LineWidth(2.0) gl.BeginEnd(GL.LINES, function() SphereVertex( 1, 0, 0); SphereVertex(-1, 0, 0) SphereVertex(0, 1, 0); SphereVertex(0, -1, 0) SphereVertex(0, 0, 1); SphereVertex(0, 0, -1) end) gl.LineWidth(1.0) -- points -- FIXME ATIBUG gl.PointSize(10.0) --[[gl.BeginEnd(GL.POINTS, function() SphereVertex( 1, 0, 0) SphereVertex(-1, 0, 0) SphereVertex(0, 1, 0) SphereVertex(0, -1, 0) SphereVertex(0, 0, 1) SphereVertex(0, 0, -1) end)--]] -- FIXME ATIBUG gl.PointSize(1.0) end -------------------------------------------------------------------------------- local function SetupMaterial() gl.Color(0.1, 0.2, 0.3, 0.3) gl.Blending(GL.SRC_ALPHA, GL.ONE) gl.DepthTest(true) gl.Lighting(true) gl.ShadeModel(GL.FLAT) gl.Fog(false) gl.ClipPlane(1, 0, 1, 0, 0) -- invisible in water end local function ResetMaterial() gl.ShadeModel(GL.SMOOTH) gl.Lighting(false) gl.DepthTest(false) gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) gl.Fog(true) gl.ClipPlane(1, false) -- invisible in water gl.Color(1,1,1,1) end local function BackMaterial() gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 0.5 }, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1.0 }, shininess = 4 }) end local function FrontMaterial() gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 0.75 }, emission = { 0.05, 0.10, 0.15 }, specular = { 0.25, 0.75, 1.0 }, shininess = 4 }) end local function AtiBugFixMaterial() gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 0 }, emission = { 0, 0, 0 }, specular = { 0, 0, 0 }, shininess = 0 }) end local function ShieldList() gl.Culling(GL.FRONT) gl.CallList(backMatList) glCallList(negSphereList) gl.Culling(GL.BACK) gl.CallList(frontMatList) glCallList(sphereList) gl.Culling(false) end local function MiniMapXform() local mapX = Game.mapX * 512 local mapY = Game.mapY * 512 -- this will probably be a common display -- list for widgets that use DrawInMiniMap() gl.LoadIdentity() gl.Translate(0, 1, 0) gl.Scale(1 / mapX, 1 / mapY, 1) gl.Rotate(90, 1, 0, 0) end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --[[ local function getAlpha() local frame = GetGameFrame() + GetFrameTimeOffset() local alpha = (math.abs((frame % 128) - 64) / 64) if (alpha < 0.5) then alpha = 0.5 end return alpha end ]]-- local function DrawShield(unitID, radius, degrees) local x, y, z = GetUnitViewPosition(unitID, true) if (x == nil) then return end if (not Spring.IsSphereInView(x, y, z, math.abs(radius))) then return end glPushMatrix() glTranslate(x, y, z) glScale(radius, radius, radius) glRotate(degrees, 0, 1, 0) glCallList(shieldList) glPopMatrix() end local GetSpectatingState = Spring.GetSpectatingState local GetLocalAllyTeamID = Spring.GetLocalAllyTeamID local IsUnitSelected = Spring.IsUnitSelected local GetUnitAllyTeam = Spring.GetUnitAllyTeam local GetLocalAllyTeamID = Spring.GetLocalAllyTeamID local GetUnitViewPosition = Spring.GetUnitViewPosition local DrawGroundCircle = gl.DrawGroundCircle function gadget:DrawWorld() if (not next(drawUnits)) then return end local dt = GetFrameTimeOffset() local frame = GetGameFrame() + GetFrameTimeOffset() local degrees = frame % (360 * 2 * 3 * 5) local readAllyTeam = GetLocalAllyTeamID() local _, fullView = GetSpectatingState() glCallList(setupMatList) for unitID, radius in pairs(drawUnits) do if (fullView or (GetUnitAllyTeam(unitID) == readAllyTeam)) then DrawShield(unitID, radius, degrees + unitID * 57) end end glCallList(resetMatList) gl.Material({ ambient = { 0, 0, 0 }, diffuse = { 0, 0, 0, 0 }, emission = { 0, 0, 0 }, specular = { 0, 0, 0 }, shininess = 0 }) --gl.CallList(atiFixMatList) end function gadget:DrawInMiniMap() if (not next(drawUnits)) then return end gl.PushMatrix() glCallList(miniMapXformList) local readAllyTeam = GetLocalAllyTeamID() local _, fullView = GetSpectatingState() for unitID, radius in pairs(drawUnits) do if (IsUnitSelected(unitID)) then local x, y, z = GetUnitViewPosition(unitID, true) if (x ~= nil) then if (fullView or (GetUnitAllyTeam(unitID) == readAllyTeam)) then DrawGroundCircle(x, y, z, radius, 64) end end end end gl.PopMatrix() end function gadget:UpdateFIXME() -- testing "cloak_shield" RulesParam for _,unitID in ipairs(Spring.GetSelectedUnits()) do print(unitID, Spring.GetUnitRulesParam(unitID, "cloak_shield")) end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function UnitUpdate(cmd, unitID, radius) if (radius <= 0) then drawUnits[unitID] = nil else drawUnits[unitID] = radius end end function gadget:Initialize() gadgetHandler:AddSyncAction(SYNCSTR, UnitUpdate) sphereList = gl.CreateList(DrawSphere, sphereDivs, sphereArcs, false) negSphereList = gl.CreateList(DrawSphere, sphereDivs, sphereArcs, true) setupMatList = gl.CreateList(SetupMaterial) resetMatList = gl.CreateList(ResetMaterial) backMatList = gl.CreateList(BackMaterial) frontMatList = gl.CreateList(FrontMaterial) atiFixMatList = gl.CreateList(AtiBugFixMaterial) shieldList = gl.CreateList(ShieldList) miniMapXformList = gl.CreateList(MiniMapXform) end function gadget:Shutdown() gl.DeleteList(sphereList) gl.DeleteList(negSphereList) gl.DeleteList(setupMatList) gl.DeleteList(resetMatList) gl.DeleteList(backMatList) gl.DeleteList(frontMatList) gl.DeleteList(shieldList) gl.DeleteList(miniMapXformList) end -------------------------------------------------------------------------------- -- UNSYNCED -------------------------------------------------------------------------------- end -------------------------------------------------------------------------------- -- COMMON -------------------------------------------------------------------------------- \ No newline at end of file +-- $Id: unit_cloak_shield.lua 3605 2008-12-31 08:50:31Z google frog $ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: unit_cloak_shield.lua +-- brief: adds a cloak-shield command to units +-- author: Dave Rodgers, modified by Evil4Zerggin +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "UnitCloakShield", + desc = "Adds a cloak-shield command to units", + author = "trepan, modified by Evil4Zerggin", + date = "May 02, 2007", --updated on 23 January 2014 + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- FIXME: (TODO) +-- - wait for UnitFinished() before allowing cloak_shield? +-- - don't allow state changes during pauses (tied to the above) +-- +-------------------------------------------------------------------------------- + +include("LuaRules/Configs/customcmds.h.lua") +include("LuaRules/Configs/constants.lua") + +local SYNCSTR = "unit_cloak_shield" + + +-------------------------------------------------------------------------------- +-- COMMON +-------------------------------------------------------------------------------- +if (gadgetHandler:IsSyncedCode()) then +-------------------------------------------------------------------------------- +-- SYNCED +-------------------------------------------------------------------------------- + +-- +-- speed-ups +-- + +local GetUnitDefID = Spring.GetUnitDefID +local GetUnitSeparation = Spring.GetUnitSeparation +local SetUnitCloak = Spring.SetUnitCloak + +local FindUnitCmdDesc = Spring.FindUnitCmdDesc +local EditUnitCmdDesc = Spring.EditUnitCmdDesc + +local SetUnitRulesParam = Spring.SetUnitRulesParam +local GetUnitRulesParam = Spring.GetUnitRulesParam + + +-------------------------------------------------------------------------------- + +local cloakShieldDefs = {} +local uncloakableDefs = {} + +local cloakShieldUnits = {} -- make it global in Initialize() +local cloakers = {} +local cloakees = {} + +local cloakShieldCmdDesc = { + id = CMD_CLOAK_SHIELD, + type = CMDTYPE.ICON_MODE, + name = 'CloakShield', + cursor = 'CloakShield', -- add with LuaUI? + action = 'cloak_shield', + tooltip = 'Cloak Shield State: Sets whether the unit is cloaking', + params = {'0', 'Cloaker Off', 'Cloaker On' } +} + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function ValidateCloakShieldDefs(mds) + local newDefs = {} + for udName, def in pairs(mds) do + local ud = UnitDefNames[udName] + if (not ud) then + Spring.Log(gadget:GetInfo().name, LOG.WARNING, 'Bad cloakShield unit type: ' .. udName) + else + local newData = {} + newData.draw = def.draw or true + newData.init = def.init or false + newData.level = def.level or 2 + newData.delay = def.delay or 30 + newData.energy = def.energy or 0 + newData.minrad = def.minrad or 64 + newData.maxrad = def.maxrad or 256 + newData.growRate = def.growRate or 256 + newData.shrinkRate = def.shrinkRate or 256 + newData.selfCloak = def.selfCloak or false + newData.decloakDistance = def.decloakDistance or false + newData.radiusException = def.radiusException or {} + newData.isTransport = (ud.transportCapacity >= 1) + newDefs[ud.id] = newData + end + end + + -- print the table (alphabetically) +--[[ + local sorted = {} + for n, ud in pairs(UnitDefNames) do table.insert(sorted, {n, ud.id}) end + table.sort(sorted, function(a,b) return (a[1] < b[1]) end) + for _, name_id in ipairs(sorted) do + local nd = newDefs[ name_id[2] ] + if (nd) then + print('CloakShield ' .. name_id[1]) + print(' draw = ' .. tostring(nd.draw)) + print(' init = ' .. tostring(nd.init)) + print(' delay = ' .. tostring(nd.delay)) + print(' energy = ' .. tostring(nd.energy)) + print(' minrad = ' .. tostring(nd.minrad)) + print(' maxrad = ' .. tostring(nd.maxrad)) + print(' growRate = ' .. tostring(nd.growRate)) + print(' shrinkRate = ' .. tostring(nd.shrinkRate)) + print(' selfCloak = ' .. tostring(nd.selfCloak)) + print(' decloakDistance = ' .. tostring(nd.decloakDistance)) + end + end +--]] + + return newDefs +end + + +local function ValidateUncloakableDefs(unclks) + local newDefs = {} + for udName, data in pairs(unclks) do + local ud = UnitDefNames[udName] + if (not ud) then + Spring.Log(gadget:GetInfo().name, LOG.WARNING, 'Bad uncloakable unit type: ' .. udName) + else + newDefs[ud.id] = true +-- print('uncloakable: ' .. udName) + end + end + return newDefs +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function AddCloakShieldCmdDesc(unitID, cloakShieldDef) + cloakShieldCmdDesc.params[1] = (cloakShieldDef.init and '1') or '0' + local insertID = + FindUnitCmdDesc(unitID, CMD.CLOAK) or + FindUnitCmdDesc(unitID, CMD.ONOFF) or + FindUnitCmdDesc(unitID, CMD.TRAJECTORY) or + FindUnitCmdDesc(unitID, CMD.REPEAT) or + FindUnitCmdDesc(unitID, CMD.MOVE_STATE) or + FindUnitCmdDesc(unitID, CMD.FIRE_STATE) or + 123456 -- back of the pack + Spring.InsertUnitCmdDesc(unitID, insertID + 1, cloakShieldCmdDesc) +end + + +local function AddCloakShieldRulesParam(unitID, state) + SetUnitRulesParam(unitID, "cloak_shield", state and 2 or 0) +end + + +local function AddCloakShieldUnit(unitID, cloakShieldDef) + + AddCloakShieldCmdDesc(unitID, cloakShieldDef) + + local data = { + id = unitID, + def = cloakShieldDef, + draw = cloakShieldDef.draw, + radius = 0, + minrad = cloakShieldDef.minrad, + maxrad = cloakShieldDef.maxrad, + energy = cloakShieldDef.energy / TEAM_SLOWUPDATE_RATE, + isTransport = cloakShieldDef.isTransport, + unitRadius = Spring.GetUnitRadius(unitID), + + } + cloakShieldUnits[unitID] = data + + if (cloakShieldDef.init) then + data.want = true + cloakers[unitID] = data + end + + AddCloakShieldRulesParam(unitID, cloakShieldDef.init) +end + +local alliedTrueTable = {allied = true} +local function SetUnitCloakAndParam(unitID, level, decloakDistance) + local newRadius = decloakDistance + if level then + local cannotCloak = GetUnitRulesParam(unitID, "cannotcloak") + if cannotCloak ~= 1 then + local changeRadius = true + if cloakers[unitID] and cloakers[unitID].radius > 0 then + changeRadius = false + newRadius = 0 + end + SetUnitCloak(unitID, level, ((changeRadius and decloakDistance) or GetUnitRulesParam(unitID, "comm_decloak_distance") or false)) + end + else + local wantCloak = GetUnitRulesParam(unitID, "wantcloak") + if wantCloak == 1 then + local cannotCloak = GetUnitRulesParam(unitID, "cannotcloak") + if cannotCloak ~= 1 then + SetUnitCloak(unitID, 1, GetUnitRulesParam(unitID, "comm_decloak_distance") or false) + end + else + SetUnitCloak(unitID, 0, GetUnitRulesParam(unitID, "comm_decloak_distance") or false) + end + end + SetUnitRulesParam(unitID, "areacloaked", (level and 1) or 0, alliedTrueTable) + SetUnitRulesParam(unitID, "areacloaked_radius", (level and newRadius) or 0, alliedTrueTable) +end + +-------------------------------------------------------------------------------- + +function gadget:Initialize() + -- get the cloakShieldDefs + cloakShieldDefs, uncloakableDefs = include("LuaRules/Configs/cloak_shield_defs.lua") + + if (not cloakShieldDefs) then + gadgetHandler:RemoveGadget() + return + end + gadgetHandler:RegisterCMDID(CMD_CLOAK_SHIELD) + + cloakShieldDefs = ValidateCloakShieldDefs(cloakShieldDefs) + uncloakableDefs = ValidateUncloakableDefs(uncloakableDefs) + + -- add the CloakShield command to existing units + for _,unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = GetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end +end + +function gadget:Shutdown() + for _,unitID in ipairs(Spring.GetAllUnits()) do + SetUnitCloakAndParam(unitID, false) + + local ud = UnitDefs[GetUnitDefID(unitID)] + local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) + if (cmdDescID) then + Spring.RemoveUnitCmdDesc(unitID, cmdDescID) + end + end +end + +-------------------------------------------------------------------------------- + +function gadget:UnitCreated(unitID, unitDefID, unitTeam) + local cloakShieldDef = cloakShieldDefs[unitDefID] + if (not cloakShieldDef) then + return + end + AddCloakShieldUnit(unitID, cloakShieldDef) +end + + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + cloakShieldUnits[unitID] = nil + cloakers[unitID] = nil + cloakees[unitID] = nil +end + + +function gadget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) + local _,_,_,_,_,newAllyTeam = Spring.GetTeamInfo(teamID, false) + local _,_,_,_,_,oldAllyTeam = Spring.GetTeamInfo(oldTeamID, false) + + if (newAllyTeam ~= oldAllyTeam) then + if (cloakShieldUnits[unitID]) then + cloakShieldUnits[unitID].radius = 0 + end + cloakers[unitID] = nil + cloakees[unitID] = nil + SetUnitCloakAndParam(unitID, false) + local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) + if (cmdDescID) then + cloakShieldCmdDesc.params[1] = (state and '2') or '0' + EditUnitCmdDesc(unitID, cmdDescID, { params = cloakShieldCmdDesc.params }) + end + end +end + + +-------------------------------------------------------------------------------- + +local GetUnitAllyTeam = Spring.GetUnitAllyTeam +local GetUnitPosition = Spring.GetUnitPosition +local GetUnitsInSphere = Spring.GetUnitsInSphere + +local function UpdateCloakees(data) + local unitID = data.id + local radius = data.radius + local level = data.def.level + local selfCloak = data.def.selfCloak + local decloakDistance = data.def.decloakDistance + local radiusException = data.def.radiusException + local x, y, z = GetUnitPosition(unitID) + if (x == nil) then return end + local closeUnits = GetUnitsInSphere(x, y, z, radius) + if (closeUnits == nil) then return end + local allyTeam = GetUnitAllyTeam(unitID) + for _,cloakee in ipairs(closeUnits) do + local udid = GetUnitDefID(cloakee) + if ((not uncloakableDefs[udid]) and (not GetUnitRulesParam(cloakee, "comm_shield_id")) and (GetUnitAllyTeam(cloakee) == allyTeam)) then + if (cloakee ~= unitID) then + --other units + SetUnitCloakAndParam(cloakee, level, (not radiusException[udid]) and decloakDistance) + cloakees[cloakee] = true + elseif (selfCloak) then + --self cloak + SetUnitCloakAndParam(cloakee, level, (not radiusException[udid]) and decloakDistance) + cloakees[cloakee] = true + end + end + -- the GetUnitsInSphere() call uses unit midPos's, which can + -- differ from the unit's position while being transported. + -- here we do a direct check to see what units the cloakees are + -- transporting. this does not fix nested transports + if (UnitDefs[udid].transportCapacity >= 1) then + local transported = Spring.GetUnitIsTransporting(cloakee) + if transported ~= nil then + for _,cloakeeLvl2 in ipairs(transported) do + local udid = GetUnitDefID(cloakeeLvl2) + if ((not uncloakableDefs[udid]) and + (GetUnitAllyTeam(cloakeeLvl2) == allyTeam)) then + SetUnitCloakAndParam(cloakeeLvl2, 4, (not radiusException[udid]) and decloakDistance) + -- note: this gives perfect cloaking, but is the only level + -- to work under paralysis + cloakees[cloakeeLvl2] = true + end + end + end + end + end + --check if the cloaker is a transport + if (data.isTransport and (radius >= data.unitRadius)) then + local transported = Spring.GetUnitIsTransporting(unitID) + if transported ~= nil then + for _,cloakee in ipairs(transported) do + local udid = GetUnitDefID(cloakee) + if ((not uncloakableDefs[udid]) and + (GetUnitAllyTeam(cloakee) == allyTeam)) then + SetUnitCloakAndParam(cloakee, level, (not radiusException[udid]) and decloakDistance) + cloakees[cloakee] = true + end + end + end + end +end + + +local function GrowRadius(cloaker) + local r = cloaker.radius + local maxrad = cloaker.maxrad + if (r >= maxrad) then + r = maxrad + return r + end + r = (r * r) + cloaker.def.growRate + r = math.sqrt(r) + r = (r >= cloaker.maxrad) and cloaker.maxrad or r + cloaker.radius = r + Spring.SetUnitRulesParam(cloaker.id, "cloakerRadius", r) + + if (cloaker.draw) then + SendToUnsynced(SYNCSTR, cloaker.id, r) + end +end + + +local function ShrinkRadius(cloaker) + local r = cloaker.radius + if (r <= 0) then + cloaker.radius = 0 + return 0 + end + r = (r * r) - cloaker.def.shrinkRate + r = (r < 0) and 0 or math.sqrt(r) + cloaker.radius = r + Spring.SetUnitRulesParam(cloaker.id, "cloakerRadius", r) + if (cloaker.draw) then + SendToUnsynced(SYNCSTR, cloaker.id, r) + end + if ((r <= 0) and (not cloaker.want)) then + cloakers[cloaker.id] = nil + end +end + + +local GetUnitIsStunned = Spring.GetUnitIsStunned + +function gadget:GameFrame(frameNum) + local checkCloakees = ((frameNum % 6) < 1) + if (checkCloakees) then + for uid in pairs(cloakees) do + SetUnitCloakAndParam(uid, false) + end + cloakees = {} + end + + for unitID, data in pairs(cloakers) do + if (data.delay) then + data.delay = data.delay - 1 + if (data.delay <= 0) then + data.delay = nil + end + ShrinkRadius(data) + elseif (GetUnitIsStunned(unitID) or (Spring.GetUnitRulesParam(unitID, "disarmed") == 1) or (Spring.GetUnitRulesParam(unitID, "morphDisable") == 1)) then + ShrinkRadius(data) + elseif (not data.want) then + ShrinkRadius(data) + else + local newState = Spring.Utilities.GetUnitActiveState(unitID) and (GetUnitRulesParam(unitID, "forcedOff") ~= 1) + if (newState) then + GrowRadius(data) + else + ShrinkRadius(data) + end + + if (data.active ~= newState) then + data.active = newState + if (newState) then + SetUnitRulesParam(unitID, "cloak_shield", 2) + else + SetUnitRulesParam(unitID, "cloak_shield", 1) + data.delay = data.def.delay + end + end + end + + if (checkCloakees and (data.radius > 0)) then + UpdateCloakees(data) + end + end +end + +function gadget:Load(zip) + -- restore cloak shield for dyncomms + for _,unitID in ipairs(Spring.GetAllUnits()) do + if not cloakShieldUnits[unitID] then + local unitDefID = Spring.GetUnitDefID(unitID) + local cloakShieldDef = GG.Upgrades_UnitCloakShieldDef(unitID) + if cloakShieldDef then + local state = GetUnitRulesParam(unitID, "cloak_shield") + local radius = Spring.GetUnitRulesParam(unitID, "cloakerRadius") + local isOn = state ~= nil and state > 0 + + AddCloakShieldUnit(unitID, cloakShieldDef) + CloakShieldCommand(unitID, {isOn and 1 or 0}) + Spring.SetUnitRulesParam(unitID, "cloakerRadius", radius) + end + end + end + + for unitID, data in pairs(cloakers) do + local radius = Spring.GetUnitRulesParam(unitID, "cloakerRadius") or 0 + if radius > 0 then + data.radius = radius + if (data.draw) then + SendToUnsynced(SYNCSTR, data.id, radius) + end + UpdateCloakees(data) + end + end +end + +-------------------------------------------------------------------------------- + +function CloakShieldCommand(unitID, cmdParams) + if (type(cmdParams[1]) ~= 'number') then + return false + end + local data = cloakShieldUnits[unitID] + if (not data) then + return false + end + + local state = (cmdParams[1] == 1) + if (state) then + cloakers[unitID] = data + data.want = true + SetUnitRulesParam(unitID, "cloak_shield", 2) + else + data.want = false + SetUnitRulesParam(unitID, "cloak_shield", 0) + end + + local cmdDescID = FindUnitCmdDesc(unitID, CMD_CLOAK_SHIELD) + if (cmdDescID) then + cloakShieldCmdDesc.params[1] = (state and '1') or '0' + EditUnitCmdDesc(unitID, cmdDescID, { params = cloakShieldCmdDesc.params }) + end +end + + +function gadget:AllowCommand_GetWantedCommand() + return {[CMD_CLOAK_SHIELD] = true} +end + +function gadget:AllowCommand_GetWantedUnitDefID() + return true +end + +function gadget:AllowCommand(unitID, unitDefID, teamID, + cmdID, cmdParams, cmdOptions) + if (cmdID ~= CMD_CLOAK_SHIELD) then + return true -- command was not used + end + CloakShieldCommand(unitID, cmdParams) + return false -- command was used +end + + +function gadget:CommandFallback(unitID, unitDefID, teamID, + cmdID, cmdParams, cmdOptions) + if (cmdID ~= CMD_CLOAK_SHIELD) then + return false -- command was not used + end + CloakShieldCommand(unitID, cmdParams) + return true, true -- command was used, remove it +end + + +-------------------------------------------------------------------------------- +-- SYNCED +-------------------------------------------------------------------------------- +else +-------------------------------------------------------------------------------- +-- UNSYNCED +-------------------------------------------------------------------------------- + +-- +-- speed-ups +-- + +local GetUnitTeam = Spring.GetUnitTeam +local GetUnitRadius = Spring.GetUnitRadius +local GetUnitHeading = Spring.GetUnitHeading +local GetUnitViewPosition = Spring.GetUnitViewPosition + +local GetGameFrame = Spring.GetGameFrame +local GetFrameTimeOffset = Spring.GetFrameTimeOffset + +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glRotate = gl.Rotate +local glScale = gl.Scale +local glCallList = gl.CallList + + +-------------------------------------------------------------------------------- + +local sphereDivs = 16 +local sphereArcs = 32 + +local drawUnits = {} + +local sphereList = 0 +local negSphereList = 0 + +local setupMatList = 0 +local resetMatList = 0 +local backMatList = 0 +local frontMatList = 0 +local atiFixMatList = 0 + +local shieldList = 0 + +local miniMapXformList = 0 + +local trans = {0.1, 0.28, 0.60 } + + +-------------------------------------------------------------------------------- + +local function SphereVertex(x, y, z, neg) + if (neg) then + gl.Normal(-x, -y, -z) + else + gl.Normal(x, y, z) + end + gl.Vertex(x, y, z) +end + + +local function DrawSphere(divs, arcs, neg) + local cos = math.cos + local sin = math.sin + local twoPI = (2.0 * math.pi) + local divRads = math.pi / divs + local minRad = sin(divRads) + + -- sides + for d = 4, (divs - 2) do + + if (d < 7) then + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, trans[d-3]}, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1 }, + shininess = 4 + }) + elseif (d > 10) then + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, trans[15-d]}, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1 }, + shininess = 4 + }) + else + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 1.0 }, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1.0 }, + shininess = 4 + }) + end + + gl.BeginEnd(GL.QUAD_STRIP, function() + local topRads = divRads * (d + 0) + local botRads = divRads * (d + 1) + local top = cos(topRads) + local bot = cos(botRads) + local topRad = sin(topRads) + local botRad = sin(botRads) + + for i = 0, arcs do + local a = i * (2.0 * math.pi) / arcs + SphereVertex(sin(a) * topRad, top, cos(a) * topRad, neg) + SphereVertex(sin(a) * botRad, bot, cos(a) * botRad, neg) + end + end) + end + + -- bottom + gl.BeginEnd(GL.TRIANGLE_FAN, function() + SphereVertex(0, -1, 0, neg) + for i = 0, arcs do + local a = -i * (2.0 * math.pi) / arcs + SphereVertex(sin(a) * minRad, -cos(divRads), cos(a) * minRad, neg) + end + end) + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 0.5 }, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1.0 }, + shininess = 4 + }) + -- lines + gl.LineWidth(2.0) + gl.BeginEnd(GL.LINES, function() + SphereVertex( 1, 0, 0); SphereVertex(-1, 0, 0) + SphereVertex(0, 1, 0); SphereVertex(0, -1, 0) + SphereVertex(0, 0, 1); SphereVertex(0, 0, -1) + end) + gl.LineWidth(1.0) + + -- points + -- FIXME ATIBUG gl.PointSize(10.0) + --[[gl.BeginEnd(GL.POINTS, function() + SphereVertex( 1, 0, 0) + SphereVertex(-1, 0, 0) + SphereVertex(0, 1, 0) + SphereVertex(0, -1, 0) + SphereVertex(0, 0, 1) + SphereVertex(0, 0, -1) + end)--]] + -- FIXME ATIBUG gl.PointSize(1.0) +end + + +-------------------------------------------------------------------------------- + +local function SetupMaterial() + gl.Color(0.1, 0.2, 0.3, 0.3) + gl.Blending(GL.SRC_ALPHA, GL.ONE) + gl.DepthTest(true) + gl.Lighting(true) + gl.ShadeModel(GL.FLAT) + gl.Fog(false) + gl.ClipPlane(1, 0, 1, 0, 0) -- invisible in water +end + + +local function ResetMaterial() + gl.ShadeModel(GL.SMOOTH) + gl.Lighting(false) + gl.DepthTest(false) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.Fog(true) + gl.ClipPlane(1, false) -- invisible in water + gl.Color(1,1,1,1) +end + +local function BackMaterial() + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 0.5 }, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1.0 }, + shininess = 4 + }) +end + +local function FrontMaterial() + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 0.75 }, + emission = { 0.05, 0.10, 0.15 }, + specular = { 0.25, 0.75, 1.0 }, + shininess = 4 + }) +end + +local function AtiBugFixMaterial() + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 0 }, + emission = { 0, 0, 0 }, + specular = { 0, 0, 0 }, + shininess = 0 + }) +end + +local function ShieldList() + gl.Culling(GL.FRONT) + gl.CallList(backMatList) + glCallList(negSphereList) + + gl.Culling(GL.BACK) + gl.CallList(frontMatList) + glCallList(sphereList) + + gl.Culling(false) +end + + +local function MiniMapXform() + local mapX = Game.mapX * 512 + local mapY = Game.mapY * 512 + -- this will probably be a common display + -- list for widgets that use DrawInMiniMap() + gl.LoadIdentity() + gl.Translate(0, 1, 0) + gl.Scale(1 / mapX, 1 / mapY, 1) + gl.Rotate(90, 1, 0, 0) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--[[ +local function getAlpha() + local frame = GetGameFrame() + GetFrameTimeOffset() + local alpha = (math.abs((frame % 128) - 64) / 64) + if (alpha < 0.5) then alpha = 0.5 end + return alpha +end +]]-- + +local function DrawShield(unitID, radius, degrees) + local x, y, z = GetUnitViewPosition(unitID, true) + if (x == nil) then + return + end + if (not Spring.IsSphereInView(x, y, z, math.abs(radius))) then + return + end + + glPushMatrix() + + glTranslate(x, y, z) + glScale(radius, radius, radius) + glRotate(degrees, 0, 1, 0) + + glCallList(shieldList) + + glPopMatrix() +end + +local GetSpectatingState = Spring.GetSpectatingState +local GetLocalAllyTeamID = Spring.GetLocalAllyTeamID +local IsUnitSelected = Spring.IsUnitSelected +local GetUnitAllyTeam = Spring.GetUnitAllyTeam +local DrawGroundCircle = gl.DrawGroundCircle + +function gadget:DrawWorld() + if (not next(drawUnits)) then + return + end + + local dt = GetFrameTimeOffset() + local frame = GetGameFrame() + GetFrameTimeOffset() + local degrees = frame % (360 * 2 * 3 * 5) + + local readAllyTeam = GetLocalAllyTeamID() + local _, fullView = GetSpectatingState() + + glCallList(setupMatList) + + for unitID, radius in pairs(drawUnits) do + if (fullView or (GetUnitAllyTeam(unitID) == readAllyTeam)) then + DrawShield(unitID, radius, degrees + unitID * 57) + end + end + + glCallList(resetMatList) + gl.Material({ + ambient = { 0, 0, 0 }, + diffuse = { 0, 0, 0, 0 }, + emission = { 0, 0, 0 }, + specular = { 0, 0, 0 }, + shininess = 0 + }) + --gl.CallList(atiFixMatList) +end + + +function gadget:DrawInMiniMap() + if (not next(drawUnits)) then + return + end + + gl.PushMatrix() + glCallList(miniMapXformList) + + local readAllyTeam = GetLocalAllyTeamID() + local _, fullView = GetSpectatingState() + + for unitID, radius in pairs(drawUnits) do + if (IsUnitSelected(unitID)) then + local x, y, z = GetUnitViewPosition(unitID, true) + if (x ~= nil) then + if (fullView or (GetUnitAllyTeam(unitID) == readAllyTeam)) then + DrawGroundCircle(x, y, z, radius, 64) + end + end + end + end + + gl.PopMatrix() +end + + +function gadget:UpdateFIXME() -- testing "cloak_shield" RulesParam + for _,unitID in ipairs(Spring.GetSelectedUnits()) do + print(unitID, Spring.GetUnitRulesParam(unitID, "cloak_shield")) + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function UnitUpdate(cmd, unitID, radius) + if (radius <= 0) then + drawUnits[unitID] = nil + else + drawUnits[unitID] = radius + end +end + +function gadget:UnitDestroyed(unitID) + UnitUpdate(0, unitID, 0) +end + +function gadget:Taken(unitID) + UnitUpdate(0, unitID, 0) +end + +function gadget:Initialize() + gadgetHandler:AddSyncAction(SYNCSTR, UnitUpdate) + sphereList = gl.CreateList(DrawSphere, sphereDivs, sphereArcs, false) + negSphereList = gl.CreateList(DrawSphere, sphereDivs, sphereArcs, true) + setupMatList = gl.CreateList(SetupMaterial) + resetMatList = gl.CreateList(ResetMaterial) + backMatList = gl.CreateList(BackMaterial) + frontMatList = gl.CreateList(FrontMaterial) + atiFixMatList = gl.CreateList(AtiBugFixMaterial) + shieldList = gl.CreateList(ShieldList) + miniMapXformList = gl.CreateList(MiniMapXform) +end + + +function gadget:Shutdown() + gl.DeleteList(sphereList) + gl.DeleteList(negSphereList) + gl.DeleteList(setupMatList) + gl.DeleteList(resetMatList) + gl.DeleteList(backMatList) + gl.DeleteList(frontMatList) + gl.DeleteList(shieldList) + gl.DeleteList(miniMapXformList) +end + + +-------------------------------------------------------------------------------- +-- UNSYNCED +-------------------------------------------------------------------------------- +end +-------------------------------------------------------------------------------- +-- COMMON +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/unit_cobbutton.lua b/LuaRules/Gadgets/unit_cobbutton.lua deleted file mode 100644 index 4bd24c3b1..000000000 --- a/LuaRules/Gadgets/unit_cobbutton.lua +++ /dev/null @@ -1,214 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (not gadgetHandler:IsSyncedCode()) then - return false -end - -function gadget:GetInfo() - return { - name = "CobButton", - desc = "Easy cob button Creation", - author = "quantum, Deadnight Warrior", - date = "June 28, 2008", - license = "GNU GPL, v2 or later", - layer = -10, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- Proposed Command ID Ranges: --- --- all negative: Engine (build commands) --- 0 - 999: Engine --- 1000 - 9999: Group AI --- 10000 - 19999: LuaUI --- 20000 - 29999: LuaCob --- 30000 - 39999: LuaRules --- - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Spring, ipairs, pairs = Spring, ipairs, pairs -local SetUnitRulesParam, GetUnitRulesParam = Spring.SetUnitRulesParam, Spring.GetUnitRulesParam -local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc -local spGetUnitCmdDescs = Spring.GetUnitCmdDescs -local spEditUnitCmdDesc = Spring.EditUnitCmdDesc -local spRemoveUnitCmdDesc = Spring.RemoveUnitCmdDesc -local spCallCOBScript = Spring.CallCOBScript -local spGetUnitDefID = Spring.GetUnitDefID -local format = string.format --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local reloads = {} - -local buttonDefs = VFS.Include"LuaRules/Configs/cob_buttons.lua" - -local buttons = {} -local buttonParams = {} -local cmdOffset = 0 -for unit, cmds in pairs(buttonDefs) do - for i, cmd in ipairs(cmds) do - cmd.id = 34520 + cmdOffset - cmdOffset = cmdOffset + 1 - buttons[cmd.id] = cmd - cmd.unit = unit - cmd.buttonIndex = i - cmd.name = cmd.name or cmd.cob - cmd.cmdDesc = { - id = cmd.id, - name = cmd.name or cmd.cob, - action = string.lower(cmd.name), - type = cmd.type or CMDTYPE.ICON, - tooltip = cmd.tooltip, - params = cmd.params, - } - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:Initialize() - for cmdID in pairs(buttons) do - gadgetHandler:RegisterCMDID(cmdID) - end - for _, unitID in ipairs(Spring.GetAllUnits()) do - gadget:UnitCreated(unitID, Spring.GetUnitDefID(unitID)) - end -end - - -function gadget:UnitCreated(unitID, unitDefID) - local name = UnitDefs[unitDefID].name - if (buttonDefs[name]) then - buttonParams[unitID] = {} - for i, button in ipairs(buttonDefs[name]) do - spInsertUnitCmdDesc(unitID, button.position or 500, button.cmdDesc) - if button.params then - buttonParams[unitID][button.id] = {} - for p=1, #button.params do - buttonParams[unitID][button.id][p] = button.params[p] - end - end - end - reloads[unitID] = {} - end -end - - -function gadget:Shutdown() - for _, unitID in ipairs(Spring.GetAllUnits()) do - for cmdID in pairs(buttons) do - local cmdDescID = spFindUnitCmdDesc(unitID, cmdID) - if (cmdDescID) then - spRemoveUnitCmdDesc(unitID, cmdDescID) - end - end - end -end - - -function gadget:GameFrame(n) - local s = n/30 - for unitID, unitButtons in pairs(reloads) do - local udfid = spGetUnitDefID(unitID) - if (udfid==nil) then - reloads[unitID] = nil - else - local unitName = UnitDefs[udfid].name - for buttonIndex, status in pairs(unitButtons) do - local reload = status[1] - local expired = status[2] - local cmd = buttonDefs[unitName][buttonIndex] - local cmdDescID = spFindUnitCmdDesc(unitID, cmd.id) - if (cmdDescID) then - local cmdArray - if (cmd.duration and s - reload > cmd.duration and s - reload < cmd.reload) then - if (cmd.endcob and not expired) then - spCallCOBScript(unitID, cmd.endcob, 0) - status[2] = true - end - local progress = (s-reload-cmd.duration) / (cmd.reload-cmd.duration) * 100 - local text = format("%d%%", progress) - cmdArray = {name = text, disabled = true} - elseif (s - reload < cmd.reload) then - local progress = (s-reload) / (cmd.duration) * 100 - local text = format("%d%%", progress) - cmdArray = {name = text, disabled = true} - else - if (not cmd.duration) then - spCallCOBScript(unitID, cmd.endcob, 0) - end - cmdArray = {name = cmd.name, disabled = false} - unitButtons[buttonIndex] = nil - end - spEditUnitCmdDesc(unitID, cmdDescID, cmdArray) - end - end - if (not next(unitButtons)) then - reloads[unitID] = nil - end - end - end -end - - -function gadget:UnitDestroyed(unitID) - reloads[unitID] = nil -end - - -function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) - if buttons[cmdID] then - local unitName = UnitDefs[unitDefID].name - if buttonDefs[unitName] then - local buttonDoesntExist = true -- if an unit has multiple cob buttons, check them all, not just the first one - for i=1, #buttonDefs[unitName] do - if buttons[cmdID].name==buttonDefs[unitName][i].name then - buttonDoesntExist = false - break - end - end - if buttonDoesntExist then - return true - end - local cmd = buttons[cmdID] - local cmdDescID = spFindUnitCmdDesc(unitID, cmdID) - if (cmd.reload) then - reloads[unitID] = reloads[unitID] or {} - if (not reloads[unitID][cmd.buttonIndex]) then - reloads[unitID][cmd.buttonIndex] = {Spring.GetGameSeconds()} - spCallCOBScript(unitID, cmd.cob, 0) - end - else - if (cmdDescID and buttonParams[unitID][cmdID]) then - local bp = buttonParams[unitID][cmdID] - bp[1] = cmdParams[1] - spCallCOBScript(unitID, cmd.cob, 0, cmdParams[1]) - spEditUnitCmdDesc(unitID, cmdDescID, {params=bp}) - else - spCallCOBScript(unitID, cmd.cob, 0) - end - end - return false -- command was used - end - end - return true -- command was not used -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_death_sounds.lua b/LuaRules/Gadgets/unit_death_sounds.lua index 1178bd6b7..838fb9f99 100644 --- a/LuaRules/Gadgets/unit_death_sounds.lua +++ b/LuaRules/Gadgets/unit_death_sounds.lua @@ -22,7 +22,7 @@ local GetUnitPosition = Spring.GetUnitPosition local PlaySoundFile = Spring.PlaySoundFile -- constants -local DEFAULT_VOLUME = 15 +local DEFAULT_VOLUME = 7.5 local SOUNDS_PATH = "sounds/deathsounds/" local GAIA_TEAM_ID = Spring.GetGaiaTeamID() diff --git a/LuaRules/Gadgets/unit_decloak_damaged.lua b/LuaRules/Gadgets/unit_decloak_damaged.lua index edd2caa1d..b6beb91f8 100644 --- a/LuaRules/Gadgets/unit_decloak_damaged.lua +++ b/LuaRules/Gadgets/unit_decloak_damaged.lua @@ -1 +1,334 @@ --------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "Decloak when damaged", desc = "Decloaks units when they are damged", author = "Google Frog", date = "Nov 25, 2009", -- Major rework 12 Feb 2014 license = "GNU GPL, v2 or later", layer = 0, enabled = false -- loaded by default? } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- include("LuaRules/Configs/customcmds.h.lua") local CMD_CLOAK = CMD.CLOAK local unitWantCloakCommandDesc = { id = CMD_WANT_CLOAK, type = CMDTYPE.ICON_MODE, name = 'Cloak State', action = 'wantcloak', tooltip = 'Unit cloaking state', params = {0, 'Decloaked', 'Cloaked'} } -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local alliedTrueTable = {allied = true} local Spring = Spring local spAreTeamsAllied = Spring.AreTeamsAllied local spSetUnitCloak = Spring.SetUnitCloak local spGetUnitIsCloaked = Spring.GetUnitIsCloaked local spGetUnitRulesParam = Spring.GetUnitRulesParam local spSetUnitRulesParam = Spring.SetUnitRulesParam local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitIsDead = Spring.GetUnitIsDead if (not gadgetHandler:IsSyncedCode()) then return false -- silent removal end local recloakUnit = {} local recloakUnits = 0 local recloakUnitID = {} local noFFWeaponDefs = {} for i = 1, #WeaponDefs do local wd = WeaponDefs[i] if wd.customParams and wd.customParams.nofriendlyfire then noFFWeaponDefs[i] = true end end local DEFAULT_DECLOAK_TIME = 100 local cloakUnitDefID = {} for i = 1, #UnitDefs do local ud = UnitDefs[i] if ud.canCloak then cloakUnitDefID[i] = true end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function PokeDecloakUnit(unitID, duration) duration = duration or DEFAULT_DECLOAK_TIME if recloakUnitID[unitID] then recloakUnit[recloakUnitID[unitID]].frames = duration else --local cloak = Spring.GetUnitIsCloaked(unitID) spSetUnitRulesParam(unitID, "cannotcloak", 1, alliedTrueTable) spSetUnitCloak(unitID, 0) recloakUnits = recloakUnits + 1 recloakUnit[recloakUnits] = {id = unitID, frames = duration} recloakUnitID[unitID] = recloakUnits end end GG.PokeDecloakUnit = PokeDecloakUnit function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, attackerID, attackerDefID, attackerTeam) if damage > 0 and not (attackerTeam and weaponID and noFFWeaponDefs[weaponID] and attackerID ~= unitID and spAreTeamsAllied(unitTeam, attackerTeam)) then PokeDecloakUnit(unitID) end end function gadget:GameFrame(n) local i = 1 while i <= recloakUnits do recloakUnit[i].frames = recloakUnit[i].frames - 1 --spSetUnitCloak(recloakUnit[i].id, false) if recloakUnit[i].frames <= 0 then local unitID = recloakUnit[i].id local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") spSetUnitRulesParam(unitID, "cannotcloak", 0, alliedTrueTable) if wantCloakState == 1 or areaCloaked == 1 then spSetUnitCloak(unitID, 1) end -- remove current unit and move last one to current position -- delete index recloakUnitID[recloakUnit[i].id] = nil -- do not to move if last element if i < recloakUnits then -- override recloakUnit[i] = recloakUnit[recloakUnits] -- update recloakUnitID for moved unit recloakUnitID[recloakUnit[i].id] = i end -- remove last recloakUnit[recloakUnits] = nil recloakUnits = recloakUnits - 1 else i = i + 1 end end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- local function SetWantedCloaked(unitID, state) if (not unitID) or spGetUnitIsDead(unitID) then return end local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") local cmdDescID = Spring.FindUnitCmdDesc(unitID, CMD_WANT_CLOAK) if (cmdDescID) then Spring.EditUnitCmdDesc(unitID, cmdDescID, { params = {state, 'Decloaked', 'Cloaked'}}) end if state == 1 and wantCloakState ~= 1 then local cannotCloak = spGetUnitRulesParam(unitID, "cannotcloak") local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") if cannotCloak ~= 1 and areaCloaked ~= 1 then spSetUnitCloak(unitID, 1) end spSetUnitRulesParam(unitID, "wantcloak", 1, alliedTrueTable) elseif state == 0 and wantCloakState == 1 then local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") if areaCloaked ~= 1 then spSetUnitCloak(unitID, 0) end spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) end end GG.SetWantedCloaked = SetWantedCloaked function gadget:AllowCommand_GetWantedCommand() return {[CMD_CLOAK] = true, [CMD_WANT_CLOAK] = true} end function gadget:AllowCommand_GetWantedUnitDefID() return true end function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) if cmdID == CMD_WANT_CLOAK then if cloakUnitDefID[unitDefID] then SetWantedCloaked(unitID,cmdParams[1]) end return false elseif cmdID == CMD_CLOAK then return false end return true end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:UnitCreated(unitID, unitDefID) local ud = UnitDefs[unitDefID] if ud.canCloak then local cloakDescID = Spring.FindUnitCmdDesc(unitID, CMD_CLOAK) if cloakDescID then Spring.InsertUnitCmdDesc(unitID, unitWantCloakCommandDesc) Spring.RemoveUnitCmdDesc(unitID, cloakDescID) spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) if ud.customParams.initcloaked then SetWantedCloaked(unitID,1) end end end end function gadget:Initialize() for _, unitID in ipairs(Spring.GetAllUnits()) do local unitDefID = spGetUnitDefID(unitID) gadget:UnitCreated(unitID, unitDefID) end end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:GetInfo() + return { + name = "Decloak when damaged", + desc = "Decloaks units when they are damged", + author = "Google Frog", + date = "Nov 25, 2009", -- Major rework 12 Feb 2014 + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +include("LuaRules/Configs/customcmds.h.lua") + +local CMD_CLOAK = CMD.CLOAK + +local unitWantCloakCommandDesc = { + id = CMD_WANT_CLOAK, + type = CMDTYPE.ICON_MODE, + name = 'Cloak State', + action = 'wantcloak', + tooltip = 'Unit cloaking state', + params = {0, 'Decloaked', 'Cloaked'} +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if (not gadgetHandler:IsSyncedCode()) then + return false -- silent removal +end + +local alliedTrueTable = {allied = true} + +local Spring = Spring +local spAreTeamsAllied = Spring.AreTeamsAllied + +local spSetUnitCloak = Spring.SetUnitCloak +local spGetUnitIsCloaked = Spring.GetUnitIsCloaked +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitIsDead = Spring.GetUnitIsDead + +local recloakUnit = {} +local recloakFrame = {} + +local noFFWeaponDefs = {} +for i = 1, #WeaponDefs do + local wd = WeaponDefs[i] + if wd.customParams and wd.customParams.nofriendlyfire then + noFFWeaponDefs[i] = true + end +end + +local DEFAULT_DECLOAK_TIME = 60 +local UPDATE_FREQUENCY = 10 +local CLOAK_MOVE_THRESHOLD = math.sqrt(0.2) + +local currentFrame = 0 + +local cloakUnitDefID = {} +for i = 1, #UnitDefs do + local ud = UnitDefs[i] + if ud.canCloak and not ud.customParams.dynamic_comm then + cloakUnitDefID[i] = true + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Water handling + +local waterUnitCount = 0 +local waterUnitMap = {} +local waterUnits = {} +local waterUnitCloakBlocked = {} + +local function AddWaterUnit(unitID) + if waterUnitMap[unitID] then + return + end + waterUnitCount = waterUnitCount + 1 + waterUnitMap[unitID] = waterUnitCount + waterUnits[waterUnitCount] = unitID +end + +local function RemoveWaterUnit(unitID) + if not waterUnitMap[unitID] then + return + end + waterUnits[waterUnitMap[unitID]] = waterUnits[waterUnitCount] + waterUnitMap[waterUnits[waterUnitCount]] = waterUnitMap[unitID] + waterUnits[waterUnitCount] = nil + waterUnitMap[unitID] = nil + waterUnitCount = waterUnitCount - 1 + + waterUnitCloakBlocked[unitID] = nil +end + +function gadget:UnitEnteredWater(unitID) + AddWaterUnit(unitID) +end + +function gadget:UnitLeftWater(unitID) + RemoveWaterUnit(unitID) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function PokeDecloakUnit(unitID, duration) + if recloakUnit[unitID] then + recloakUnit[unitID] = duration or DEFAULT_DECLOAK_TIME + else + spSetUnitRulesParam(unitID, "cannotcloak", 1, alliedTrueTable) + spSetUnitCloak(unitID, 0) + recloakUnit[unitID] = duration or DEFAULT_DECLOAK_TIME + end + +end + +GG.PokeDecloakUnit = PokeDecloakUnit + +function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, + weaponID, attackerID, attackerDefID, attackerTeam) + if damage > 0 and + not (attackerTeam and + weaponID and + noFFWeaponDefs[weaponID] and + attackerID ~= unitID and + spAreTeamsAllied(unitTeam, attackerTeam)) then + PokeDecloakUnit(unitID) + end +end + +local function CheckWaterBlockCloak(unitID, pos) + local radius = Spring.GetUnitRadius(unitID) + if radius + pos < 0 then + if not waterUnitCloakBlocked[unitID] then + PokeDecloakUnit(unitID) + spSetUnitRulesParam(unitID, "cannotcloak", 1, alliedTrueTable) + waterUnitCloakBlocked[unitID] = true + end + return true + end + return false +end + +function gadget:GameFrame(n) + currentFrame = n + if n%UPDATE_FREQUENCY == 2 then + for unitID, frames in pairs(recloakUnit) do + if frames <= UPDATE_FREQUENCY then + if not ((spGetUnitRulesParam(unitID,"on_fire") == 1) or (spGetUnitRulesParam(unitID,"disarmed") == 1) or waterUnitCloakBlocked[unitID]) then + local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") + spSetUnitRulesParam(unitID, "cannotcloak", 0, alliedTrueTable) + if wantCloakState == 1 or areaCloaked == 1 then + spSetUnitCloak(unitID, 1) + end + recloakUnit[unitID] = nil + end + else + recloakUnit[unitID] = frames - UPDATE_FREQUENCY + end + end + + local i = 1 + while i <= waterUnitCount do + local unitID = waterUnits[i] + if Spring.ValidUnitID(unitID) then + local pos = select(5, Spring.GetUnitPosition(unitID, true)) + if pos < 0 then + if (not CheckWaterBlockCloak(unitID, pos)) and waterUnitCloakBlocked[unitID] then + spSetUnitRulesParam(unitID, "cannotcloak", 0, alliedTrueTable) + waterUnitCloakBlocked[unitID] = false + end + else + if waterUnitCloakBlocked[unitID] then + spSetUnitRulesParam(unitID, "cannotcloak", 0, alliedTrueTable) + waterUnitCloakBlocked[unitID] = false + end + end + i = i + 1 + else + RemoveWaterUnit(unitID) + end + end + end +end + +-- Only called with enemyID if an enemy is within decloak radius. +function gadget:AllowUnitCloak(unitID, enemyID) + if enemyID then + local transID = Spring.GetUnitTransporter(unitID) + if transID then + -- For some reason enemyID indicates that the unit is being transported. + return Spring.GetUnitIsCloaked(transID) + end + return false + end + + if recloakFrame[unitID] then + if recloakFrame[unitID] > currentFrame then + return false + end + recloakFrame[unitID] = nil + end + + local stunnedOrInbuild = Spring.GetUnitIsStunned(unitID) + if stunnedOrInbuild then + return false + end + + local unitDefID = unitID and Spring.GetUnitDefID(unitID) + local ud = unitDefID and UnitDefs[unitDefID] + if not ud then + return false + end + + local areaCloaked = (Spring.GetUnitRulesParam(unitID, "areacloaked") == 1) and ((Spring.GetUnitRulesParam(unitID, "cloak_shield") or 0) == 0) + if not areaCloaked then + local speed = select(4, Spring.GetUnitVelocity(unitID)) + local moving = speed and speed > CLOAK_MOVE_THRESHOLD + local cost = moving and ud.cloakCostMoving or ud.cloakCost + + if not Spring.UseUnitResource(unitID, "e", cost/2) then -- SlowUpdate happens twice a second. + return false + end + end + + return true +end + +function gadget:AllowUnitDecloak(unitID, objectID, weaponID) + recloakFrame[unitID] = currentFrame + DEFAULT_DECLOAK_TIME +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function SetWantedCloaked(unitID, state) + if (not unitID) or spGetUnitIsDead(unitID) then + return + end + + local wantCloakState = spGetUnitRulesParam(unitID, "wantcloak") + local cmdDescID = Spring.FindUnitCmdDesc(unitID, CMD_WANT_CLOAK) + if (cmdDescID) then + Spring.EditUnitCmdDesc(unitID, cmdDescID, { params = {state, 'Decloaked', 'Cloaked'}}) + end + + if state == 1 and wantCloakState ~= 1 then + local cannotCloak = spGetUnitRulesParam(unitID, "cannotcloak") + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") + if cannotCloak ~= 1 and areaCloaked ~= 1 then + spSetUnitCloak(unitID, 1) + end + spSetUnitRulesParam(unitID, "wantcloak", 1, alliedTrueTable) + elseif state == 0 and wantCloakState == 1 then + local areaCloaked = spGetUnitRulesParam(unitID, "areacloaked") + if areaCloaked ~= 1 then + spSetUnitCloak(unitID, 0) + end + spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) + end +end + +GG.SetWantedCloaked = SetWantedCloaked + +function gadget:AllowCommand_GetWantedCommand() + return {[CMD_CLOAK] = true, [CMD_WANT_CLOAK] = true} +end + +function gadget:AllowCommand_GetWantedUnitDefID() + return true +end + +function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + if cmdID == CMD_WANT_CLOAK then + if cloakUnitDefID[unitDefID] then + SetWantedCloaked(unitID,cmdParams[1]) + end + return false + elseif cmdID == CMD_CLOAK then + return false + end + return true +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function gadget:UnitCreated(unitID, unitDefID) + local ud = UnitDefs[unitDefID] + if cloakUnitDefID[unitDefID] then + local cloakDescID = Spring.FindUnitCmdDesc(unitID, CMD_CLOAK) + if cloakDescID then + Spring.InsertUnitCmdDesc(unitID, unitWantCloakCommandDesc) + Spring.RemoveUnitCmdDesc(unitID, cloakDescID) + spSetUnitRulesParam(unitID, "wantcloak", 0, alliedTrueTable) + if ud.customParams.initcloaked then + SetWantedCloaked(unitID, 1) + end + return + end + elseif ud.customParams.dynamic_comm then + local cloakDescID = Spring.FindUnitCmdDesc(unitID, CMD_CLOAK) + if cloakDescID then + Spring.RemoveUnitCmdDesc(unitID, cloakDescID) + end + end +end + +function gadget:Initialize() + for _, unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = spGetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + local pos = select(2, Spring.GetUnitPosition(unitID)) + if pos <= 0 then + gadget:UnitEnteredWater(unitID) + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/unit_icongenerator.lua b/LuaRules/Gadgets/unit_icongenerator.lua index 23d2bdb3e..9a6c125fc 100644 --- a/LuaRules/Gadgets/unit_icongenerator.lua +++ b/LuaRules/Gadgets/unit_icongenerator.lua @@ -30,10 +30,10 @@ function gadget:GetInfo() } end +if (gadgetHandler:IsSyncedCode()) then + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -if (gadgetHandler:IsSyncedCode()) then -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -72,40 +72,42 @@ if (gadgetHandler:IsSyncedCode()) then local y = Spring.GetGroundHeight(0,0); Spring.LevelHeightMap(x-50,z-50,x+50,z+50,y); - local uid = Spring.CreateUnit(cunit.defname,x,y,z,"south",cunit.team); - units[#units+1] = {id=uid,defname=cunit.defname,frame=n+cunit.time}; - curTeam = cunit.team; - - Spring.SetUnitNeutral(uid,true); - Spring.GiveOrderToUnit(uid,CMD.FIRE_STATE,{0},{}); - Spring.GiveOrderToUnit(uid,CMD.STOP,{},{}); - - local env = Spring.UnitScript.GetScriptEnv(uid) - if env then lus = true end - - if lus then - if env.Activate then Spring.UnitScript.CallAsUnit(uid, env.Activate) end - else Spring.CallCOBScript(uid,"Activate",0) end - - if (cunit.move) then - if lus then - if env.StartMoving then Spring.UnitScript.CallAsUnit(uid, env.StartMoving) end - else Spring.CallCOBScript(uid,"StartMoving",0) end - end; + local uid = Spring.CreateUnit(cunit.defname,x,y,z,"south", 0); -- FIXME needs to be a non-gaia team if gaia doesn't have its unitlimit assigned + if uid then + units[#units+1] = {id=uid,defname=cunit.defname,frame=n+cunit.time}; + curTeam = cunit.team; - if (cunit.attack and not lus) then - local angle = (cunit.shotAngle / 180) * 32768 + Spring.SetUnitNeutral(uid,true); + Spring.GiveOrderToUnit(uid,CMD.FIRE_STATE,{0},{}); + Spring.GiveOrderToUnit(uid,CMD.STOP,{},{}); - Spring.CallCOBScript(uid,"AimPrimary",0,Spring.GetHeadingFromVector(0,1),angle); - Spring.CallCOBScript(uid,"AimWeapon1",0,Spring.GetHeadingFromVector(0,1),angle); + local env = Spring.UnitScript.GetScriptEnv(uid) + if env then lus = true end + + if lus then + if env.Activate then Spring.UnitScript.CallAsUnit(uid, env.Activate) end + else Spring.CallCOBScript(uid,"Activate",0) end - Spring.CallCOBScript(uid,"AimSecondary",0,Spring.GetHeadingFromVector(0,1),angle); - Spring.CallCOBScript(uid,"AimWeapon2",0,Spring.GetHeadingFromVector(0,1),angle); + if (cunit.move) then + if lus then + if env.StartMoving then Spring.UnitScript.CallAsUnit(uid, env.StartMoving) end + else Spring.CallCOBScript(uid,"StartMoving",0) end + end; - Spring.CallCOBScript(uid,"AimTertiary",0,Spring.GetHeadingFromVector(0,1),angle); - Spring.CallCOBScript(uid,"AimWeapon3",0,Spring.GetHeadingFromVector(0,1),angle); + if (cunit.attack and not lus) then + local angle = (cunit.shotAngle / 180) * 32768 - end; + Spring.CallCOBScript(uid,"AimPrimary",0,Spring.GetHeadingFromVector(0,1),angle); + Spring.CallCOBScript(uid,"AimWeapon1",0,Spring.GetHeadingFromVector(0,1),angle); + + Spring.CallCOBScript(uid,"AimSecondary",0,Spring.GetHeadingFromVector(0,1),angle); + Spring.CallCOBScript(uid,"AimWeapon2",0,Spring.GetHeadingFromVector(0,1),angle); + + Spring.CallCOBScript(uid,"AimTertiary",0,Spring.GetHeadingFromVector(0,1),angle); + Spring.CallCOBScript(uid,"AimWeapon3",0,Spring.GetHeadingFromVector(0,1),angle); + + end; + end end; end; createunits = leftunits; @@ -121,11 +123,10 @@ if (gadgetHandler:IsSyncedCode()) then function gadget:RecvLuaMsg(msg, playerID) if (msg:find("buildicon",1,true)) then - Spring.Echo("Creating unit for animation pose...") - --[[if (not Spring.IsCheatingEnabled()) then + if (not Spring.IsCheatingEnabled()) then Spring.SendMessageToPlayer(playerID, "Cheating must be enabled"); return true; - end;]] + end; local msg = msg:sub(11,msg:len()); local d = msg:find(";",d,true); @@ -274,12 +275,11 @@ local function CreateResources() varying vec3 normal; varying vec4 pos; varying float clamp; - uniform float clampIn; void main(void) { gl_FrontColor = gl_Color; gl_TexCoord[0] = gl_MultiTexCoord0; - clamp = clampIn;//gl_MultiTexCoord1.x; + clamp = gl_MultiTexCoord1.x; normal = gl_Normal; pos = gl_ModelViewMatrix * gl_Vertex; @@ -308,7 +308,7 @@ local function CreateResources() }, }) - if (not pre_shader) then Spring.Echo(gl.GetShaderLog()) end + if (not pre_shader) then Spring.Log(gadget:GetInfo().name, LOG.ERROR, gl.GetShaderLog()) end post_shader = gl.CreateShader({ vertex = [[ @@ -424,7 +424,7 @@ local function CreateResources() }, }) - if (not post_shader) then Spring.Echo(gl.GetShaderLog()) end + if (not post_shader) then Spring.Log(gadget:GetInfo().name, LOG.ERROR, gl.GetShaderLog()) end halo_shader = gl.CreateShader({ vertex = [[ @@ -485,7 +485,7 @@ local function CreateResources() }) - if (not halo_shader) then Spring.Echo(gl.GetShaderLog()) end + if (not halo_shader) then Spring.Log(gadget:GetInfo().name, LOG.ERROR, gl.GetShaderLog()) end clear_shader = gl.CreateShader({ fragment = [[ @@ -496,7 +496,7 @@ local function CreateResources() ]] }) - if (not clear_shader) then Spring.Echo(gl.GetShaderLog()) end + if (not clear_shader) then Spring.Log(gadget:GetInfo().name, LOG.ERROR, gl.GetShaderLog()) end end -------------------------------------------------------------------------------- @@ -611,8 +611,7 @@ local function DrawIcon(udid,teamID,uid) local midx,midy,midz,radius = GetUnitDefDims(udid); radius = radius * cfg.zoom; - --gl.MultiTexCoord(1, cfg.clamp); - gl.Uniform(gl.GetUniformLocation(pre_shader , "clampIn"), cfg.clamp) + gl.MultiTexCoord(1, cfg.clamp); gl.Blending(false); gl.DepthTest(true); @@ -731,11 +730,9 @@ end gl.Shape(GL.QUADS,elements); else - gl.Color(0,0,0,0); gl.Texture(background); gl.TexRect(-1,-1,1,1); gl.Texture(false); - gl.Color(1,1,1); end end @@ -865,23 +862,25 @@ end local function ProcessJobs() --//note: we have a LIFO stack for i=#jobs,1,-1 do - --Spring.Echo("Test banana") if (jobs[i]() ~= false) then - --Spring.Echo("Test banana 2") jobs[i] = nil; else - --Spring.Echo("Test banana 3") break; end; end; if (#jobs == 0) then - --[[gadget.DrawGenesis = nil; - gadgetHandler:UpdateCallIn("DrawGenesis");]] + --gadget.DrawGenesis = nil; + --gadgetHandler:UpdateCallIn("DrawGenesis"); end; end +function gadget:DrawGenesis() + ProcessJobs() +end + + local function GetFaction(udef_factions) return ((#udef_factions~=1) and 'unknown') or udef_factions[1]; end @@ -951,16 +950,7 @@ end gl.Blending(false); gl.Texture(false); - local outfile = (outdir) .."/".. (UnitDefs[udid].name); - if VFS.FileExists(outfile .. imageExt, VFS.RAW) then - local count = 1 - while VFS.FileExists(outfile .. "_" .. count .. (imageExt), VFS.RAW) do - count = count + 1 - end - outfile = outfile .. "_" .. count - end - outfile = outfile .. imageExt - Spring.Echo("Saving image to " .. outfile) + local outfile = (outdir) .."/".. (UnitDefs[udid].name) .. (imageExt); --if (VFS.FileExists(outfile, VFS.RAW)) then -- os.remove(outfile); --end; @@ -969,7 +959,7 @@ end end); if (not result and not cfg.empty) then - Spring.Echo("icongen: ".. (UnitDefs[udid].name) ..": give up :<"); + Spring.Log(gadget:GetInfo().name, LOG.ERROR, "icongen: ".. (UnitDefs[udid].name) ..": give up :<"); end; end @@ -1021,13 +1011,9 @@ end local schemes,resolutions,ratios = {},{},{} local function BuildIcon(cmd, line, words, playerID) - --[[if (not Spring.IsCheatingEnabled()) then + if (not Spring.IsCheatingEnabled()) then Spring.Echo("Cheating must be enabled"); return false; - end;]] - if (not Spring.GetModUICtrl()) then - Spring.Echo("ModUICtrl is needed (type /luamoduictrl 1)"); - return false; end; if (final_tex or #jobs>0) then Spring.Echo("Wait until current process is finished"); @@ -1044,11 +1030,11 @@ local schemes,resolutions,ratios = {},{},{} for _,res in pairs(resolutions) do for _,_scheme in pairs(schemes) do for _ratio_name,_ratio in pairs(ratios) do - Spring.Echo("THIS IS A TEST 1") + AddJob( FreeResources ); ---Spring.Echo("THIS IS A TEST 2") + AddJob( WaitForSyncedJobs ); ---Spring.Echo("THIS IS A TEST 2") + if (words[1] and words[1]~="all") then AddJob( function () AddUnitJob(UnitDefNames[ words[1] ].id); end); else @@ -1056,28 +1042,27 @@ local schemes,resolutions,ratios = {},{},{} AddJob( function () AddUnitJob(udid); end); end; end; ---Spring.Echo("THIS IS A TEST 3") + AddJob( CreateResources ); ---Spring.Echo("THIS IS A TEST 4") + AddJob( function () scheme = _scheme; ratio, ratio_name = _ratio, _ratio_name; iconX, iconY = res[1], res[2]; outdir = "buildicons/".. (scheme) .."_".. (ratio_name) .."_".. (iconX) .."x".. (iconY); - Spring.Echo(outdir) Spring.CreateDir(outdir); ---Spring.Echo("THIS IS A TEST 6") + LoadScheme(); end ); ---Spring.Echo("THIS IS A TEST 5") + end; end; end; - --[[gadget.DrawGenesis = ProcessJobs; - gadgetHandler:UpdateCallIn("DrawGenesis"); - gadgetHandler:UpdateCallIn("DrawGenesis"); --stupid bug]] + --gadget.DrawGenesis = ProcessJobs; + --gadgetHandler:UpdateCallIn("DrawGenesis"); + --gadgetHandler:UpdateCallIn("DrawGenesis"); --stupid bug end @@ -1087,9 +1072,9 @@ local schemes,resolutions,ratios = {},{},{} local uid,defname = uid,defname; jobs[#jobs+1] = function() CreateIcon(UnitDefNames[defname].id,uid) end; - --[[gadget.DrawGenesis = ProcessJobs; + gadget.DrawGenesis = ProcessJobs; gadgetHandler:UpdateCallIn("DrawGenesis"); - gadgetHandler:UpdateCallIn("DrawGenesis"); --stupid bug]] + gadgetHandler:UpdateCallIn("DrawGenesis"); --stupid bug end function gadget:Initialize() @@ -1101,9 +1086,6 @@ local schemes,resolutions,ratios = {},{},{} gadgetHandler:AddSyncAction("buildicon_unitcreated", UnitCreated); end - function gadget:DrawGenesis() - ProcessJobs() - end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -end +end \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_morph.lua b/LuaRules/Gadgets/unit_morph.lua index 6ad78b1fd..a4d04ea26 100644 --- a/LuaRules/Gadgets/unit_morph.lua +++ b/LuaRules/Gadgets/unit_morph.lua @@ -1,10 +1,9 @@ --- $Id: unit_morph.lua 4651 2009-05-23 17:04:46Z carrepairer $ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- -- file: unit_morph.lua -- brief: Adds unit morphing command --- author: Dave Rodgers (improved by jK, Licho and aegis) +-- author: Dave Rodgers (improved by jK, Licho, aegis, CarRepairer & MaDDoX) -- -- Copyright (C) 2007. -- Licensed under the terms of the GNU GPL, v2 or later. @@ -16,14 +15,35 @@ function gadget:GetInfo() return { name = "UnitMorph", desc = "Adds unit morphing", - author = "trepan (improved by jK, Licho and aegis)", + author = "trepan (improved by jK, Licho, aegis, CarRepairer, MaDDoX)", date = "Jan, 2008", license = "GNU GPL, v2 or later", - layer = 0, + layer = 500, enabled = true } end +local echo = Spring.Echo +--local unitDefsData = VFS.Include("gamedata/unitdefs_data.lua") -- TA Prime all-inclusive unitDefs file format + +-- Changes for "The Cursed" +-- CarRepairer: may add a customized texture in the morphdefs, otherwise uses original behavior (unit buildicon). +-- aZaremoth: may add a customized text in the morphdefs +-- Changes for "Advanced BA" +-- Deadnight Warrior: may add a customized command name in the morphdefs, otherwise defaults to "Upgrade" +-- you may use "$$unitname" and "$$into" in 'text', both will be replaced with human readable unit names +-- Changes by raaar (04/2012): +-- commented out the preservation of cmd queue and unit lineage at lines 536 and 559 +-- Changes by raaar (12/2013): +-- commented out turning unit off at lines 396 and 425, was giving errors in spring 95.0 +-- Changes for "TA Prime" by _MaDDoX (12/2017): +-- Default buildtime, buildcostenergy and buildcostmetal is now the difference between original and target unit values +-- Accepts and prioritizes definitions in customData.morphdef +-- Properly talks to multi_tech.lua (tech tree gadget by zwzsg) +-- 'require' entry now require techs instead of units +-- 'require' supports multiple tech requirements (comma-separated) +-- Morph button text now shown in red when requirements not fulfilled + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -37,12 +57,11 @@ end -- 30000 - 39999: LuaRules -- -local CMD_MORPH_STOP = 32210 -local CMD_MORPH = 31210 - +local CMD_MORPH_STOP = 32410 +local CMD_MORPH = 31410 +local CMD_EZ_MORPH = 31337 -- accepts target unitDefID as optional 1st parameter (1st found morph if missing) local MAX_MORPH = 0 --// will increase dynamically - -------------------------------------------------------------------------------- -- COMMON -------------------------------------------------------------------------------- @@ -54,6 +73,21 @@ function GetTechLevel(udid) end ]]-- +function string:split( inSplitPattern, outResults ) + if not outResults then + outResults = { } + end + local theStart = 1 + local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart ) + while theSplitStart do + table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) ) + theStart = theSplitEnd + 1 + theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart ) + end + table.insert( outResults, string.sub( self, theStart ) ) + return outResults +end + -- // for use with mods like CA <_< local function GetTechLevel(UnitDefID) --return UnitDefs[UnitDefID].techLevel or 0 @@ -82,7 +116,8 @@ local function isFinished(UnitID) end local function HeadingToFacing(heading) - return math.floor((-heading - 24576) / 16384) % 4 + --return math.floor((-heading - 24576) / 16384) % 4 + return math.floor((heading + 8192) / 16384) % 4 end -------------------------------------------------------------------------------- @@ -97,11 +132,9 @@ if (gadgetHandler:IsSyncedCode()) then include("LuaRules/colors.h.lua") local stopPenalty = 0.667 -local morphPenalty = 1.0 -local upgradingBuildSpeed = 250 -local XpScale = 0.50 -local GetUnitPosition = Spring.GetUnitPosition -local tobemorphed = {} +local morphPenalty = 1.6 +local upgradingBuildSpeed = 250 -- Commander workertime = 300 +local XpScale = 1.0 local XpMorphUnits = {} @@ -116,22 +149,24 @@ local extraUnitMorphDefs = {} -- stores mainly planetwars morphs local hostName = nil -- planetwars hostname local PWUnits = {} -- planetwars units local morphUnits = {} --// make it global in Initialize() -local reqDefIDs = {} --// all possible unitDefID's, which are used as a requirement for a morph + +local reqTechs = {} --// all possible techs which are used as a requirement for a morph --// per team techlevel and owned MorphReq. units table local teamTechLevel = {} -local teamReqUnits = {} +--// Prime: Removing support for Required Units +local morphableUnits = {} -- UnitTypeIDs which may be morphed [teamId] [# of required UnitTypeIDs currenty] local teamList = Spring.GetTeamList() for i=1,#teamList do local teamID = teamList[i] - teamReqUnits[teamID] = {} + morphableUnits[teamID] = {} teamTechLevel[teamID] = 0 end local morphCmdDesc = { -- id = CMD_MORPH, -- added by the calling function because there is now more than one option type = CMDTYPE.ICON, - name = 'Morph', + name = 'Upgrade', cursor = 'Morph', -- add with LuaUI? action = 'morph', } @@ -151,31 +186,39 @@ for defName in pairs(UnitDefNames) do defNamesL[string.lower(defName)] = defName end +--// Calculates Default values | edited for TA Prime by MaDDoX local function DefCost(paramName, udSrc, udDst) local pSrc = udSrc[paramName] - local pDst = udDst[paramName] - if ((not pSrc) or (not pDst) or + local pTgt = udDst[paramName] + if ((not pSrc) or (not pTgt) or (type(pSrc) ~= 'number') or - (type(pDst) ~= 'number')) then + (type(pTgt) ~= 'number')) then + Spring.Echo('Morph '..paramName..' error: NaN found') return 0 end - local cost = (pDst - pSrc) * morphPenalty + local cost = (pTgt - pSrc) * morphPenalty if (cost < 0) then cost = 0 end return math.floor(cost) end +-- That's only called on initialize, to validate morph_defs.lua & custom data local function BuildMorphDef(udSrc, morphData) local udDst = UnitDefNames[defNamesL[string.lower(morphData.into)] or -1] if (not udDst) then - Spring.Echo('Morph gadget: Bad morph dst type: ' .. morphData.into) + if (not morphData.into) then + Spring.Echo('Morph gadget: Invalid "into" field within morphData') + else + Spring.Echo('Morph gadget: Bad morph dst type: ' .. morphData.into) + end return else local unitDef = udDst local newData = {} newData.into = udDst.id - newData.time = morphData.time or math.floor(unitDef.buildTime*7/upgradingBuildSpeed) + --newData.time = morphData.time or math.floor(unitDef.buildTime*7/upgradingBuildSpeed) + newData.time = morphData.time or (DefCost('buildTime', udSrc, udDst) / upgradingBuildSpeed) newData.increment = (1 / (30 * newData.time)) newData.metal = morphData.metal or DefCost('metalCost', udSrc, udDst) newData.energy = morphData.energy or DefCost('energyCost', udSrc, udDst) @@ -187,22 +230,45 @@ local function BuildMorphDef(udSrc, morphData) newData.xp = morphData.xp or 0 newData.rank = morphData.rank or 0 newData.facing = morphData.facing - local require = -1 + + local requireDefined = -1 + local foundAllRequires = true if (morphData.require) then - require = (UnitDefNames[defNamesL[string.lower(morphData.require)] or -1] or {}).id - if (require) then - reqDefIDs[require]=true - else - Spring.Echo('Morph gadget: Bad morph requirement: ' .. morphData.require) - require = -1 + --require = (UnitDefNames[defNamesL[string.lower(morphData.require)] or -1] or {}).id + local requires = morphData.require:split(',') + -- // All required technologies must be defined, or else invalidate + for i = 1, #requires do + -- Team 0 is used just as a filler here, the important is that the return ~= nil + requireDefined = GG.TechCheck(requires[i], 0) ~= nil + if (requireDefined) then + --echo('Morph gadget: Requirement defined: ' .. requires[i]) + reqTechs[requires[i]]=true + else + -- echo('Morph gadget: Bad morph requirement: ' .. requires[i].." tech not found") + --require = -1 + foundAllRequires = false + end end end - newData.require = require + --newData.require = require + newData.require = foundAllRequires and morphData.require or -1 newData.cmd = CMD_MORPH + MAX_MORPH newData.stopCmd = CMD_MORPH_STOP + MAX_MORPH MAX_MORPH = MAX_MORPH + 1 + newData.texture = morphData.texture + if morphData.text then + newData.text = string.gsub(morphData.text, "$$unitname", udSrc.humanName) + newData.text = string.gsub(newData.text, "$$into", udDst.humanName) + else + newData.text = morphData.text + end + if morphData.cmdname then + newData.cmdname = morphData.cmdname + else + newData.cmdname = "Upgrade" + end return newData end end @@ -210,6 +276,14 @@ end local function ValidateMorphDefs(mds) local newDefs = {} for src,morphData in pairs(mds) do + --//#debug +-- Spring.Echo("Source: "..src) +-- for k,v in pairs(morphData) do +-- Spring.Echo("K, V:"..tostring(k),v) +-- for q,w in pairs(v) do +-- Spring.Echo("-- morphData v: "..q,w) +-- end +-- end local udSrc = UnitDefNames[defNamesL[string.lower(src)] or -1] if (not udSrc) then Spring.Echo('Morph gadget: Bad morph src type: ' .. src) @@ -234,34 +308,102 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +-- //This is where multiple tech requirements check kick in. -local function UnitReqCheck(teamID, reqUnit) - if (reqUnit==-1) then return true end +-- Previously it returned how many of the required unit type there are in the game + --return ((teamReqUnits[teamID][reqTechs] or 0) > 0) +-- Now it returns a list of all unreached techs +local function TechReqList(teamID, reqTechs) + if (reqTechs == -1) then + return {} end - return ((teamReqUnits[teamID][reqUnit] or 0) > 0) + local unreachedTechs = {} + if (reqTechs) then + local requires = reqTechs:split(',') + + for i = 1, #requires do + local hasRequire = GG.TechCheck(requires[i], teamID) == true + if (hasRequire) then + --echo('Morph gadget: Requirement found: ' .. requires[i]) + else + --echo('Morph gadget: Unreached requirement: ' .. requires[i]) + --require = -1 + unreachedTechs[#unreachedTechs+1] = requires[i] + end + end + end + + return unreachedTechs +end + +local function TechReqCheck(teamID, reqTechs) + if (not reqTechs or reqTechs == -1) then + return true end + + local hasAllTechs = true + local requires = reqTechs:split(',') + + for i = 1, #requires do + local hasRequire = GG.TechCheck(requires[i], teamID) == true + if not hasRequire then + hasAllTechs = false + end + end + + return hasAllTechs end -local function GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, teamOwnsReqUnit) +local function GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, unreachedTechs) local ud = UnitDefs[morphDef.into] local tt = '' - tt = tt .. WhiteStr .. 'Morph into a ' .. ud.humanName .. '\n' - tt = tt .. GreenStr .. 'time: ' .. morphDef.time .. '\n' - tt = tt .. CyanStr .. 'metal: ' .. morphDef.metal .. '\n' - tt = tt .. YellowStr .. 'energy: ' .. morphDef.energy .. '\n' + if (morphDef.text ~= nil) then + tt = tt .. WhiteStr .. morphDef.text .. '\n' + else + --tt = tt .. WhiteStr .. 'Upgrade into a ' .. ud.humanName .. '\n' + tt = tt .. 'Upgrade into a ' .. ud.humanName .. '\n' + end + if (morphDef.time > 0) then + tt = tt .. GreenStr .. 'time: ' .. morphDef.time .. '\n' + end + if (morphDef.metal > 0) then + tt = tt .. CyanStr .. 'metal: ' .. morphDef.metal .. '\n' + end + if (morphDef.energy > 0) then + tt = tt .. YellowStr .. 'energy: ' .. morphDef.energy .. '\n' + end if (morphDef.tech > teamTech) or (morphDef.xp > unitXP) or (morphDef.rank > unitRank) or - (not teamOwnsReqUnit) + (unreachedTechs and #unreachedTechs >= 1) then tt = tt .. RedStr .. 'needs' if (morphDef.tech>teamTech) then tt = tt .. ' level: ' .. morphDef.tech end if (morphDef.xp>unitXP) then tt = tt .. ' xp: ' .. string.format('%.2f',morphDef.xp) end if (morphDef.rank>unitRank) then tt = tt .. ' rank: ' .. morphDef.rank .. ' (' .. string.format('%.2f',RankToXp(unitDefID,morphDef.rank)) .. 'xp)' end - if (not teamOwnsReqUnit) then tt = tt .. ' unit: ' .. UnitDefs[morphDef.require].humanName end + -- if (not teamOwnsReqUnit) then tt = tt .. ' unit: ' .. UnitDefs[morphDef.require].humanName end + -- Refactored to show unreached+required tech + --tt = tt .. ' unit: ' .. reqTech[x] + -- // Loop all unreachedTechs and add to the tooltip + if (unreachedTechs and #unreachedTechs >= 1) then + local str = ' tech(s): ' .. unreachedTechs[1] + if #unreachedTechs > 1 then + for i = 2, #unreachedTechs do + str = str .. ', '..unreachedTechs[i] + end + end + tt = tt..str + end end return tt end +local function MorphRequirementsFulfilled(unitID, morphDef, techLevel, unreachedTechs) + return morphDef.tech <= techLevel + and morphDef.rank <= GetUnitRank(unitID) + and morphDef.xp <= Spring.GetUnitExperience(unitID) + and #unreachedTechs == 0 +end + local function UpdateMorphReqs(teamID) local morphCmdDesc = {} @@ -277,9 +419,15 @@ local function UpdateMorphReqs(teamID) for _,morphDef in pairs(morphDefs) do local cmdDescID = Spring.FindUnitCmdDesc(unitID, morphDef.cmd) if (cmdDescID) then - local teamOwnsReqUnit = UnitReqCheck(teamID,morphDef.require) - morphCmdDesc.disabled = (morphDef.tech > teamTech)or(morphDef.rank > unitRank)or(morphDef.xp > unitXP)or(not teamOwnsReqUnit) - morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, teamOwnsReqUnit) + local unreachedTechs = TechReqList(teamID, morphDef.require) + morphCmdDesc.disabled = not MorphRequirementsFulfilled(unitID, morphDef, teamTech, unreachedTechs) + if (morphCmdDesc.disabled) then + morphCmdDesc.name = "\255\255\64\64"..morphDef.cmdname + else + morphCmdDesc.name = "\255\255\255\255"..morphDef.cmdname + end + morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, + unitRank, unreachedTechs) Spring.EditUnitCmdDesc(unitID, cmdDescID, morphCmdDesc) end end @@ -289,10 +437,19 @@ end local function AddMorphCmdDesc(unitID, unitDefID, teamID, morphDef, teamTech) local unitXP = Spring.GetUnitExperience(unitID) local unitRank = GetUnitRank(unitID) - local teamOwnsReqUnit = UnitReqCheck(teamID,morphDef.require) - morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, teamOwnsReqUnit) - morphCmdDesc.texture = "#" .. morphDef.into --//only works with a patched layout.lua or the TweakedLayout widget! - morphCmdDesc.disabled= (morphDef.tech > teamTech)or(morphDef.rank > unitRank)or(morphDef.xp > unitXP)or(not teamOwnsReqUnit) + local teamReqTechs = TechReqList(teamID, morphDef.require) + local teamHasTechs = teamReqTechs and #teamReqTechs == 0 + morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, teamReqTechs) + + if morphDef.texture then + morphCmdDesc.texture = "LuaRules/Images/Morph/".. morphDef.texture + else + morphCmdDesc.texture = "#" .. morphDef.into --//only works with a patched layout.lua or the TweakedLayout widget! + end + morphCmdDesc.name = morphDef.cmdname + + morphCmdDesc.disabled= (morphDef.tech > teamTech) or (morphDef.rank > unitRank) + or(morphDef.xp > unitXP) or (not teamHasTechs) morphCmdDesc.id = morphDef.cmd @@ -305,6 +462,7 @@ local function AddMorphCmdDesc(unitID, unitDefID, teamID, morphDef, teamTech) morphCmdDesc.tooltip = nil morphCmdDesc.texture = nil + morphCmdDesc.text = nil end @@ -328,7 +486,7 @@ local function ReAssignAssists(newUnit,oldUnit) local alliedUnits = Spring.GetTeamUnits(teamID) for i=1,#alliedUnits do local unitID = alliedUnits[i] - local cmds = Spring.GetCommandQueue(unitID) + local cmds = Spring.GetCommandQueue(unitID, 1) for j=1,#cmds do local cmd = cmds[j] if (cmd.id == CMD.GUARD)and(cmd.params[1] == oldUnit) then @@ -344,11 +502,18 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - local function StartMorph(unitID, unitDefID, teamID, morphDef) - Spring.SetUnitHealth(unitID, { paralyze = 1.0e9 }) --// turns mexes and mm off (paralyze the unit) + + -- do not allow morph for unfinsihed units + if not isFinished(unitID) + or not MorphRequirementsFulfilled(unitID, morphDef, teamTechLevel[teamID] or 0, TechReqList(teamID, morphDef.require)) + then + return true + end + + --Spring.SetUnitHealth(unitID, { paralyze = 1.0e9 }) --// turns mexes and mm off (paralyze the unit) Spring.SetUnitResourcing(unitID,"e",0) --// turns solars off - Spring.GiveOrderToUnit(unitID, CMD.ONOFF, { 0 }, { "alt" }) --// turns radars/jammers off + -- Spring.GiveOrderToUnit(unitID, CMD.ONOFF, { 0 }, { "alt" }) --// turns radars/jammers off morphUnits[unitID] = { def = morphDef, @@ -369,13 +534,13 @@ end local function StopMorph(unitID, morphData) morphUnits[unitID] = nil - - Spring.SetUnitHealth(unitID, { paralyze = -1}) + + --Spring.SetUnitHealth(unitID, { paralyze = -1}) local scale = morphData.progress * stopPenalty local unitDefID = Spring.GetUnitDefID(unitID) Spring.SetUnitResourcing(unitID,"e", UnitDefs[unitDefID].energyMake) - Spring.GiveOrderToUnit(unitID, CMD.ONOFF, { 1 }, { "alt" }) + -- Spring.GiveOrderToUnit(unitID, CMD.ONOFF, { 1 }, { "alt" }) local usedMetal = morphData.def.metal * scale Spring.AddUnitResource(unitID, 'metal', usedMetal) --local usedEnergy = morphData.def.energy * scale @@ -385,11 +550,12 @@ local function StopMorph(unitID, morphData) local cmdDescID = Spring.FindUnitCmdDesc(unitID, morphData.def.stopCmd) if (cmdDescID) then - Spring.EditUnitCmdDesc(unitID, cmdDescID, {id=morphData.def.cmd, name=morphCmdDesc.name}) + Spring.EditUnitCmdDesc(unitID, cmdDescID, {id=morphData.def.cmd, name=morphData.def.cmdname}) end end + local function FinishMorph(unitID, morphData) local udDst = UnitDefs[morphData.def.into] local ud = UnitDefs[unitID] @@ -407,12 +573,15 @@ local function FinishMorph(unitID, morphData) end local newUnit + local face = HeadingToFacing(h) - if udDst.isBuilding then + if udDst.isBuilding or udDst.isFactory then + --if udDst.isBuilding then + local x = math.floor(px/16)*16 local y = py local z = math.floor(pz/16)*16 - local face = HeadingToFacing(h) + local xsize = udDst.xsize local zsize =(udDst.zsize or udDst.ysize) if ((face == 1) or(face == 3)) then @@ -424,10 +593,11 @@ local function FinishMorph(unitID, morphData) if zsize/4 ~= math.floor(zsize/4) then z = z+8 end - newUnit = Spring.CreateUnit(defName, x, y, z, face, unitTeam, isBeingBuilt) + newUnit = Spring.CreateUnit(defName, x, y, z, face, unitTeam) Spring.SetUnitPosition(newUnit, x, y, z) else - newUnit = Spring.CreateUnit(defName, px, py, pz, HeadingToFacing(h), unitTeam, isBeingBuilt) + newUnit = Spring.CreateUnit(defName, px, py, pz, face, unitTeam) + --Spring.SetUnitRotation(newUnit, 0, -h * math.pi / 32768, 0) Spring.SetUnitPosition(newUnit, px, py, pz) end @@ -438,7 +608,8 @@ local function FinishMorph(unitID, morphData) -- send planetwars deployment message PWUnit = PWUnits[unitID] PWUnit.currentDef=udDst - local data = PWUnit.owner..","..defName..","..math.floor(px)..","..math.floor(pz)..",".."S" -- todo determine and apply smart orientation of the structure + -- TODO: determine and apply smart orientation of the structure + local data = PWUnit.owner..","..defName..","..math.floor(px)..","..math.floor(pz)..",".."S" Spring.SendCommands("w "..hostName.." pwmorph:"..data) extraUnitMorphDefs[unitID] = nil GG.PlanetWars.units[unitID] = nil @@ -446,7 +617,7 @@ local function FinishMorph(unitID, morphData) SendToUnsynced('PWCreate', unitTeam, newUnit) elseif (not morphData.def.facing) then -- set rotation only if unit is not planetwars and facing is not true --Spring.Echo(morphData.def.facing) - Spring.SetUnitRotation(newUnit, 0, -h * math.pi / 32768, 0) + --Spring.SetUnitRotation(newUnit, 0, -h * math.pi / 32768, 0) end @@ -481,17 +652,18 @@ local function FinishMorph(unitID, morphData) { CMD.TRAJECTORY, { states.trajectory and 1 or 0 }, { } }, }) - --//copy command queue - local cmds = Spring.GetUnitCommands(unitID) - for i = 2, #cmds do -- skip the first command (CMD_MORPH) - local cmd = cmds[i] - Spring.GiveOrderToUnit(newUnit, cmd.id, cmd.params, cmd.options.coded) - end + --//copy command queue FIX : removed 04/2012, caused erros + --local cmds = Spring.GetUnitCommands(unitID) + --for i = 2, cmds.n do -- skip the first command (CMD_MORPH) + --local cmd = cmds[i] + --Spring.GiveOrderToUnit(newUnit, cmd.id, cmd.params, cmd.options.coded) + --end --//reassign assist commands to new unit ReAssignAssists(newUnit,unitID) --// copy health + local oldHealth,oldMaxHealth,_,_,buildProgress = Spring.GetUnitHealth(unitID) local _,newMaxHealth = Spring.GetUnitHealth(newUnit) local newHealth = (oldHealth / oldMaxHealth) * newMaxHealth if newHealth<=1 then newHealth = 1 end @@ -502,9 +674,10 @@ local function FinishMorph(unitID, morphData) if oldShieldState and Spring.GetUnitShieldState(newUnit) then Spring.SetUnitShieldState(newUnit, enabled,oldShieldState) end - - local lineage = Spring.GetUnitLineage(unitID) - Spring.SetUnitLineage(newUnit,lineage,true) + + -- FIX : unit lineage was disabled in 84.0 + --local lineage = Spring.GetUnitLineage(unitID) + --Spring.SetUnitLineage(newUnit,lineage,true) --// FIXME: - re-attach to current transport? --// update selection @@ -516,7 +689,7 @@ end local function UpdateMorph(unitID, morphData) - + if not isFinished(unitID) then return true end if Spring.GetUnitTransporter(unitID) then return true end if (Spring.UseUnitResource(unitID, morphData.def.resTable)) then @@ -533,6 +706,38 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- + + --// Add MorphDefs from customData entries (TODO: allow data merge, currently only overrides) + local function AddCustomMorphDefs() + -- Standard .fbi method: (needs testing, TA Prime uses UnitDefsData) + for id,unitDef in pairs(UnitDefs) do + if unitDef.customParams.morphdef and type(unitDef.customParams.morphdef) == "table" then + local customMorphDef = unitDef.customParams.morphdef + --#debug echo(unitname.." morphdef into: "..tostring(unitDef.customParams.into)) + morphDefs[unitDef.name] = {customMorphDef} + end + end + return + + -- UnitDefsData method: + -- if unitDefsData == nil then + -- return end + + -- for id,unitDef in pairs(UnitDefs) do + -- local nam = unitDef.name + -- for _, uData in pairs(unitDefsData.data) do + -- if type(uData) == "table" and uData[1] == nam then + -- local dataEntry = uData[2] + -- if (dataEntry.customparams ~= nil and dataEntry.customparams.morphdef ~= nil) then + -- local customMorphDef = dataEntry.customparams.morphdef + --#debug Spring.Echo(nam .." morphdef into = ".. dataEntry.customparams.morphdef.into) + -- morphDefs[nam] = {customMorphDef} + -- end + -- end + -- end + + -- end + end function gadget:Initialize() @@ -553,9 +758,14 @@ function gadget:Initialize() table.insert(GG.UnitRanked, UnitRanked) --// get the morphDefs - morphDefs = include("LuaRules/Configs/morph_defs.lua") - if (not morphDefs) then gadgetHandler:RemoveGadget(); return; end + morphDefs = include("gamedata/morph_defs.lua") + + --// MorphDefs can now be all defined in customParams (by MaDDoX) + AddCustomMorphDefs() morphDefs = ValidateMorphDefs(morphDefs) +-- if (not morphDefs) +-- then gadgetHandler:RemoveGadget() +-- return end --// make it global for unsynced access via SYNCED _G.morphUnits = morphUnits @@ -563,30 +773,23 @@ function gadget:Initialize() _G.extraUnitMorphDefs = extraUnitMorphDefs --// Register CmdIDs - for number=0,MAX_MORPH-1 do - gadgetHandler:RegisterCMDID(CMD_MORPH+number) - gadgetHandler:RegisterCMDID(CMD_MORPH_STOP+number) + for number = 0, MAX_MORPH-1 do + gadgetHandler:RegisterCMDID(CMD_MORPH + number) + gadgetHandler:RegisterCMDID(CMD_MORPH_STOP + number) end - - --// check existing ReqUnits+TechLevel local allUnits = Spring.GetAllUnits() - for i=1,#allUnits do + for i = 1, #allUnits do local unitID = allUnits[i] local unitDefID = Spring.GetUnitDefID(unitID) local teamID = Spring.GetUnitTeam(unitID) - if (reqDefIDs[unitDefID])and(isFinished(unitID)) then - local teamReq = teamReqUnits[teamID] - teamReq[unitDefID] = (teamReq[unitDefID] or 0) + 1 - end + --// Deprecated, now just checks existing technologies on start +-- if (reqTechs[unitDefID])and(isFinished(unitID)) then +-- local morphUnits = morphableUnits[teamID] +-- morphUnits[unitDefID] = (morphUnits[unitDefID] or 0) + 1 +-- end + UpdateMorphReqs(teamID) AddFactory(unitID, unitDefID, teamID) - end - - --// add the Morph Menu Button to existing units - for i=1,#allUnits do - local unitID = allUnits[i] - local teamID = Spring.GetUnitTeam(unitID) - local unitDefID = Spring.GetUnitDefID(unitID) local morphDefSet = morphDefs[unitDefID] if (morphDefSet) then local useXPMorph = false @@ -596,12 +799,11 @@ function gadget:Initialize() if (not cmdDescID) then AddMorphCmdDesc(unitID, unitDefID, teamID, morphDef, teamTechLevel[teamID]) end - - useXPMorph = (morphDef.xp>0) or useXPMorph + useXPMorph = (morphDef.xp > 0) or useXPMorph end end - - if (useXPMorph) then XpMorphUnits[#XpMorphUnits+1] = {id=unitID,defID=unitDefID,team=teamID} end + if (useXPMorph) then + XpMorphUnits[#XpMorphUnits+1] = {id=unitID, defID=unitDefID, team=teamID} end end end @@ -637,7 +839,7 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - +-- When a unit starts being built, still in green-placeholder mode function gadget:UnitCreated(unitID, unitDefID, teamID) local morphDefSet = morphDefs[unitDefID] if (morphDefSet) then @@ -645,27 +847,29 @@ function gadget:UnitCreated(unitID, unitDefID, teamID) for _,morphDef in pairs(morphDefSet) do if (morphDef) then AddMorphCmdDesc(unitID, unitDefID, teamID, morphDef, teamTechLevel[teamID]) - useXPMorph = (morphDef.xp>0) or useXPMorph + useXPMorph = (morphDef.xp > 0) or useXPMorph end end if (useXPMorph) then XpMorphUnits[#XpMorphUnits+1] = {id=unitID,defID=unitDefID,team=teamID} end end end - +-- When a unit is completed, it must re-check morphing prereqs, since some tech could've been unlocked function gadget:UnitFinished(unitID, unitDefID, teamID) local bfrTechLevel = teamTechLevel[teamID] or 0 AddFactory(unitID, unitDefID, teamID) - if (reqDefIDs[unitDefID]) then - local teamReq = teamReqUnits[teamID] - teamReq[unitDefID] = (teamReq[unitDefID] or 0) + 1 - if (teamReq[unitDefID]==1) then - UpdateMorphReqs(teamID) - end - end - - if (bfrTechLevel~=teamTechLevel[teamID]) then + UpdateMorphReqs(teamID) +-- if (reqTechs[unitDefID]) then +-- local teamReq = morphableUnits[teamID] +-- -- add 1 to amount of existing required units +-- teamReq[unitDefID] = (teamReq[unitDefID] or 0) + 1 +-- if (teamReq[unitDefID]==1) then +-- UpdateMorphReqs(teamID) +-- end +-- end + + if (bfrTechLevel ~= teamTechLevel[teamID]) then UpdateMorphReqs(teamID) end end @@ -681,8 +885,9 @@ function gadget:UnitDestroyed(unitID, unitDefID, teamID) RemoveFactory(unitID, unitDefID, teamID) local updateButtons = false - if (reqDefIDs[unitDefID])and(isFinished(unitID)) then - local teamReq = teamReqUnits[teamID] + if (reqTechs[unitDefID])and(isFinished(unitID)) then + local teamReq = morphableUnits[teamID] + -- Reduces 1 from amount of required units found teamReq[unitDefID] = (teamReq[unitDefID] or 0) - 1 if (teamReq[unitDefID]==0) then StopMorphsOnDevolution(teamID) @@ -696,7 +901,6 @@ function gadget:UnitDestroyed(unitID, unitDefID, teamID) end if (updateButtons) then UpdateMorphReqs(teamID) end - tobemorphed[unitID] = nil end @@ -724,9 +928,12 @@ function UnitRanked(unitID,unitDefID,teamID,newRank,oldRank) local cmdDescID = Spring.FindUnitCmdDesc(unitID, morphDef.cmd) if (cmdDescID) then local morphCmdDesc = {} - local teamOwnsReqUnit = UnitReqCheck(teamID,morphDef.require) - morphCmdDesc.disabled = (morphDef.tech > teamTech)or(morphDef.rank > newRank)or(morphDef.xp > unitXP)or(not teamOwnsReqUnit) - morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, newRank, teamOwnsReqUnit) + local teamReqTechs = TechReqList(teamID,morphDef.require) + local teamHasTechs = teamReqTechs and #teamReqTechs == 0 + + morphCmdDesc.disabled = (morphDef.tech > teamTech) or (morphDef.rank > newRank) + or (morphDef.xp > unitXP) or (not teamHasTechs) + morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, newRank, teamReqTechs) Spring.EditUnitCmdDesc(unitID, cmdDescID, morphCmdDesc) end end @@ -781,7 +988,7 @@ function StopMorphsOnDevolution(teamID) if (morphData.teamID == teamID)and ( (morphDef.tech>teamTechLevel[teamID])or - (not UnitReqCheck(teamID, morphDef.require)) + (not TechReqCheck(teamID, morphDef.require)) ) then StopMorph(unitID, morphData) @@ -794,9 +1001,15 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - function gadget:GameFrame(n) + + --if n == startFrame then + + --end + if ((n+24)%150<1) then + --AddCustomMorphDefs() + local unitCount = #XpMorphUnits local i = 1 @@ -818,7 +1031,7 @@ function gadget:GameFrame(n) local cmdDescID = Spring.FindUnitCmdDesc(unitID, morphDef.cmd) if (cmdDescID) then local morphCmdDesc = {} - local teamOwnsReqUnit = UnitReqCheck(teamID,morphDef.require) + local teamOwnsReqUnit = TechReqList(teamID, morphDef.require) morphCmdDesc.disabled = (morphDef.tech > teamTech)or(morphDef.rank > unitRank)or(morphDef.xp > unitXP)or(not teamOwnsReqUnit) morphCmdDesc.tooltip = GetMorphToolTip(unitID, unitDefID, teamID, morphDef, teamTech, unitXP, unitRank, teamOwnsReqUnit) Spring.EditUnitCmdDesc(unitID, cmdDescID, morphCmdDesc) @@ -840,18 +1053,6 @@ function gadget:GameFrame(n) end end - - for unitID in pairs(tobemorphed) do - local x, y, z = GetUnitPosition(unitID) - --if (y ~= nil) and (y <= -30) then - if (y <= -30) then - StartMorph(unitID, tobemorphed[unitID][1], tobemorphed[unitID][2], tobemorphed[unitID][3]) - tobemorphed[unitID] = nil - end - end - - - for unitID, morphData in pairs(morphUnits) do if (not UpdateMorph(unitID, morphData)) then morphUnits[unitID] = nil @@ -859,9 +1060,38 @@ function gadget:GameFrame(n) end end +local function handleEzMorph(unitID, unitDefID, teamID, targetDefID) + local morphData = morphUnits[unitID] + if morphData then + return true, false + end + local morphSet = morphDefs[unitDefID] + if not morphSet then + return true, true + end + + local validMorphs = {} + for morphCmd, morphDef in pairs(morphSet) do + if (not targetDefID or morphDef.into == targetDefID) + and MorphRequirementsFulfilled(unitID, morphDef, teamTechLevel[teamID] or 0, TechReqList(teamID, morphDef.require)) then + validMorphs[#validMorphs+1] = morphDef + end + end + + if #validMorphs > 0 then + StartMorph(unitID, unitDefID, teamID, validMorphs[math.random(1, #validMorphs)]) + end + + return true, true +end +--// Allows or disallow the morph command button function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) local morphData = morphUnits[unitID] + if cmdID == CMD_EZ_MORPH and isFactory(unitDefID) then + handleEzMorph(unitID, unitDefID, teamID, cmdParams[1]) + return false + end if (morphData) then if (cmdID==morphData.def.stopCmd)or(cmdID == CMD.STOP) then if not Spring.GetUnitTransporter(unitID) then @@ -879,11 +1109,11 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt end elseif (cmdID >= CMD_MORPH and cmdID < CMD_MORPH+MAX_MORPH) then local morphDef = (morphDefs[unitDefID] or {})[cmdID] or extraUnitMorphDefs[unitID] - if ((morphDef)and - (morphDef.tech<=teamTechLevel[teamID])and - (morphDef.rank<=GetUnitRank(unitID))and - (morphDef.xp<=Spring.GetUnitExperience(unitID))and - (UnitReqCheck(teamID, morphDef.require)) ) + if ( (morphDef)and + (morphDef.tech<=teamTechLevel[teamID])and + (morphDef.rank<=GetUnitRank(unitID))and + (morphDef.xp<=Spring.GetUnitExperience(unitID))and + (TechReqCheck(teamID, morphDef.require)) ) then if (isFactory(unitDefID)) then --// the factory cai is broken and doesn't call CommandFallback(), @@ -900,8 +1130,10 @@ function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpt return true end - function gadget:CommandFallback(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + if cmdID == CMD_EZ_MORPH then + return handleEzMorph(unitID, unitDefID, teamID, cmdParams[1]) + end if (cmdID < CMD_MORPH or cmdID >= CMD_MORPH+MAX_MORPH) then return false --// command was not used end @@ -911,18 +1143,7 @@ function gadget:CommandFallback(unitID, unitDefID, teamID, cmdID, cmdParams, cmd end local morphData = morphUnits[unitID] if (not morphData) then - if UnitDefs[unitDefID]["name"] ~= 'esubplane' then - StartMorph(unitID, unitDefID, teamID, morphDef) - else - - local x, y, z = GetUnitPosition(unitID) - if (y <= -30) then - StartMorph(unitID, unitDefID, teamID, morphDef) - -- tobemorphed = - else - tobemorphed[unitID] = {unitDefID, teamID, morphDef} - end - end + StartMorph(unitID, unitDefID, teamID, morphDef) return true, true end return true, false --// command was used, do not remove it @@ -1070,6 +1291,8 @@ function gadget:Initialize() gadgetHandler:AddSyncAction("unit_morph_finished", SelectSwap) gadgetHandler:AddSyncAction("unit_morph_start", StartMorph) gadgetHandler:AddSyncAction("unit_morph_stop", StopMorph) + + --startFrame = spGetGameFrame() end @@ -1137,6 +1360,7 @@ local function InitializeUnitShape(unitDefID,unitTeam) glPushMatrix() gl.ColorMask(false) + gl.Scale(1.002,1.002,1.002) glUnitShape(unitDefID, unitTeam) gl.ColorMask(true) glPopMatrix() @@ -1171,6 +1395,7 @@ local function DrawMorphUnit(unitID, morphData, localTeamID) glPushMatrix() glTranslate(px, py, pz) glRotate(angle, 0, 1, 0) + gl.Scale(1.002,1.002,1.002) glUnitShape(morphData.def.into, unitTeam) glPopMatrix() @@ -1183,7 +1408,7 @@ local function DrawMorphUnit(unitID, morphData, localTeamID) glTranslate(px, py+14, pz) glBillboard() local progStr = string.format("%.1f%%", 100 * morphData.progress) - gl.Text(progStr, 0, -20, 9, "oc") + gl.Text(progStr, 0, -65, 24, "oc") glPopAttrib() glPopMatrix() end @@ -1191,12 +1416,7 @@ end function gadget:DrawWorld() - if (not morphUnits) then - morphUnits = SYNCED.morphUnits - if (not morphUnits) then return end - end - - if (not snext(morphUnits)) then + if (not snext(SYNCED.morphUnits)) then return --//no morphs to draw end @@ -1214,7 +1434,7 @@ function gadget:DrawWorld() end CallAsTeam({ ['read'] = readTeam }, function() - for unitID, morphData in spairs(morphUnits) do + for unitID, morphData in spairs(SYNCED.morphUnits) do if (unitID and morphData)and(IsUnitVisible(unitID)) then DrawMorphUnit(unitID, morphData,readTeam) end @@ -1233,4 +1453,3 @@ end -------------------------------------------------------------------------------- -- COMMON -------------------------------------------------------------------------------- - diff --git a/LuaRules/Gadgets/unit_noenemyfire.lua b/LuaRules/Gadgets/unit_noenemyfire.lua deleted file mode 100644 index b3e1d8a98..000000000 --- a/LuaRules/Gadgets/unit_noenemyfire.lua +++ /dev/null @@ -1,50 +0,0 @@ --- $Id: unit_noenemyfire.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function gadget:GetInfo() - return { - name = "No Enemy Fire", - desc = "Adds the noenemyfire custom param", - author = "quantum", - date = "June 24, 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (not gadgetHandler:IsSyncedCode()) then - return false -- silent removal -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- Automatically generated local definitions - -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetUnitHealth = Spring.GetUnitHealth -local spSetUnitHealth = Spring.SetUnitHealth - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, - weaponID, attackerID, attackerDefID, attackerTeam) - if (attackerDefID and - UnitDefs[attackerDefID].customParams and - UnitDefs[attackerDefID].customParams.noenemyfire and - attackerID ~= unitID and - not spAreTeamsAllied(unitTeam, attackerTeam)) then - return 0 - end - return damage -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/unit_nofriendlyfire.lua b/LuaRules/Gadgets/unit_nofriendlyfire.lua index 57152f56e..5bb4baf5b 100644 --- a/LuaRules/Gadgets/unit_nofriendlyfire.lua +++ b/LuaRules/Gadgets/unit_nofriendlyfire.lua @@ -9,7 +9,7 @@ function gadget:GetInfo() author = "quantum", date = "June 24, 2008", license = "GNU GPL, v2 or later", - layer = 0, + layer = -999, enabled = true -- loaded by default? } end @@ -21,29 +21,113 @@ if (not gadgetHandler:IsSyncedCode()) then return false -- silent removal end +local wantedWeaponList = {} + +local noFFWeaponDefs = {} + +--[[ Units can die before their projectiles hit, so to know whether a damage instance is friendly fire + we need to read the teamID from the projectile. But again: projectiles with slow explosions can be + cleaned up before the explosion finishes. Fortunately the old projectileID is still passed to the + UnitPreDamaged callin which makes it possible to cache these values in ProjectileCreated and only + remove them after the explosion is sure to have dissipated. ]] + +local haxMAX_EXPLOSION_DURATION = 128 -- frames; magic value from engine source +local haxWeapons = {} -- [weaponDefID] = true +local haxProjectiles = {} -- [projID] = teamID +local haxCleanupNow, haxCleanupNowCount = {}, 0 -- { [index] = projID } +local haxCleanupNext, haxCleanupNextCount = {}, 0 + +for wdid = 1, #WeaponDefs do + local wdcp = WeaponDefs[wdid].customParams + if wdcp and wdcp.nofriendlyfire then + noFFWeaponDefs[wdid] = true + wantedWeaponList[#wantedWeaponList + 1] = wdid + + if wdcp.nofriendlyfire == "needs hax" then + haxWeapons[wdid] = true + if Script.SetWatchProjectile then + Script.SetWatchProjectile(wdid, true) + else + Script.SetWatchWeapon(wdid, true) + end + end + end +end + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Automatically generated local definitions -local spAreTeamsAllied = Spring.AreTeamsAllied -local spGetUnitHealth = Spring.GetUnitHealth -local spSetUnitHealth = Spring.SetUnitHealth +local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetProjectileTeamID = Spring.GetProjectileTeamID +local spGetUnitHealth = Spring.GetUnitHealth +local spSetUnitHealth = Spring.SetUnitHealth + +local DefensiveManeuverDefs = { + [UnitDefNames["esolar2"].id] = true +} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +function gadget:ProjectileCreated(projID, unitID, weaponDefID) + if not haxWeapons[weaponDefID] then + return + end + haxProjectiles[projID] = spGetProjectileTeamID(projID) +end + +function gadget:ProjectileDestroyed(projID) + if not haxProjectiles[projID] then + return + end + + -- cannot cleanup immediately since the whole point is to + -- access data after projectile has been cleaned up by engine + haxCleanupNextCount = haxCleanupNextCount + 1 + haxCleanupNext[haxCleanupNextCount] = projID +end + +function gadget:GameFrame(n) + if n % haxMAX_EXPLOSION_DURATION ~= 0 then + return + end + + for i = 1, haxCleanupNowCount do + haxProjectiles[haxCleanupNow[i]] = nil + end + + local temp = haxCleanupNow + haxCleanupNow = haxCleanupNext + haxCleanupNext = temp + haxCleanupNowCount = haxCleanupNextCount + haxCleanupNextCount = 0 +end + +function gadget:UnitPreDamaged_GetWantedWeaponDef() + return wantedWeaponList +end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, - weaponID, attackerID, attackerDefID, attackerTeam) - if (attackerDefID and - UnitDefs[attackerDefID].customParams and - UnitDefs[attackerDefID].customParams.nofriendlyfire and - attackerID ~= unitID and - spAreTeamsAllied(unitTeam, attackerTeam)) then - return 0 - end - return damage + weaponID, attackerID, attackerDefID, attackerTeam, projectileID) + if weaponID and noFFWeaponDefs[weaponID] then + attackerTeam = attackerTeam or haxProjectiles[projectileID] + if not attackerTeam then + --Spring.Echo(" OUTLAWFHTAGN ") -- some unique string I can search infologs for to track the bug's existence (too trivial for LUA_ERRRUN) + attackerTeam = unitTeam + end + if attackerID ~= unitID and spAreTeamsAllied(unitTeam, attackerTeam) then + return 0, 0 + elseif unitDefID and DefensiveManeuverDefs[unitDefID] then + local env = Spring.UnitScript.GetScriptEnv(unitID) + if env then + Spring.UnitScript.CallAsUnit(unitID,env.HitByWeaponGadget) + end + end + end + + return damage end -------------------------------------------------------------------------------- diff --git a/LuaRules/Gadgets/unit_noselfpwn.lua b/LuaRules/Gadgets/unit_noselfpwn.lua index fce5995ef..1f3374279 100644 --- a/LuaRules/Gadgets/unit_noselfpwn.lua +++ b/LuaRules/Gadgets/unit_noselfpwn.lua @@ -43,7 +43,7 @@ end -------------------------------------------------------------------------------- function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, - weaponID, attackerID, attackerDefID, attackerTeam) + projID, weaponID, attackerID, attackerDefID, attackerTeam) if (unitID == attackerID and not exceptionMap[unitDefID]) then return 0 diff --git a/LuaRules/Gadgets/unit_paralysis_damage.lua b/LuaRules/Gadgets/unit_paralysis_damage.lua deleted file mode 100644 index 9894b9d84..000000000 --- a/LuaRules/Gadgets/unit_paralysis_damage.lua +++ /dev/null @@ -1 +0,0 @@ --------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "Paralysis", desc = "Handels paralysis system and adds extra_damage to lightning weapons", author = "Google Frog", date = "Apr, 2010", license = "GNU GPL, v2 or later", layer = 0, enabled = true -- loaded by default? } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- if (not gadgetHandler:IsSyncedCode()) then return false -- no unsynced code end local spGetUnitHealth = Spring.GetUnitHealth local spSetUnitHealth = Spring.SetUnitHealth local spGetUnitDefID = Spring.GetUnitDefID local extraNormalDamageList = {} local extraNormalDamageFalloffList = {} for i=1,#WeaponDefs do if WeaponDefs[i].customParams and WeaponDefs[i].customParams.extra_damage then extraNormalDamageList[i] = WeaponDefs[i].customParams.extra_damage if WeaponDefs[i].customParams.extra_damage_falloff_max then extraNormalDamageFalloffList[i] = 1/WeaponDefs[i].customParams.extra_damage_falloff_max end end end function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam) if paralyzer then -- the weapon deals paralysis damage local health, maxHealth = Spring.GetUnitHealth(unitID) if extraNormalDamageList[weaponDefID] then attackerID = attackerID or -1 local extraDamage = extraNormalDamageList[weaponDefID] if extraNormalDamageFalloffList[weaponDefID] then local armored, mult = Spring.GetUnitArmored(unitID) if armored then damage = damage/mult end extraDamage = extraDamage*damage*extraNormalDamageFalloffList[weaponDefID] end -- be careful; this line can cause recursion! don't make it do paralyzer damage Spring.AddUnitDamage(unitID, extraDamage, 0, attackerID, weaponDefID) end if health and maxHealth and health ~= 0 then -- taking no chances. return damage*maxHealth/health end end return damage end \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_plane_stop.lua b/LuaRules/Gadgets/unit_plane_stop.lua new file mode 100644 index 000000000..cf9cd127c --- /dev/null +++ b/LuaRules/Gadgets/unit_plane_stop.lua @@ -0,0 +1,259 @@ +function gadget:GetInfo() + return { + name = "Plane Stop", + desc = "Fighters and Bombers set to flight mode freeze mid-air when stopped", + author = "MaDDoX", + date = "6 Dec 2019", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if (not gadgetHandler:IsSyncedCode()) then + return +end + +VFS.Include("gamedata/taptools.lua") + +local EditUnitCmdDesc = Spring.EditUnitCmdDesc +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spGetUnitCmdDescs = Spring.GetUnitCmdDescs +local spGetUnitDefID = Spring.GetUnitDefID +local InsertUnitCmdDesc = Spring.InsertUnitCmdDesc +local GiveOrderToUnit = Spring.GiveOrderToUnit +local SetUnitNeutral = Spring.SetUnitNeutral + +local trackedUnits = { + -- [UnitDefNames["armfig"].id] = true, + -- [UnitDefNames["corveng"].id] = true, + -- [UnitDefNames["armthund"].id] = true, + -- [UnitDefNames["corshad"].id] = true, + -- [UnitDefNames["armhawk"].id] = true, + -- [UnitDefNames["corvamp"].id] = true, + -- [UnitDefNames["armpnix"].id] = true, + -- [UnitDefNames["armaap"].id] = true, + -- [UnitDefNames["armplat"].id] = true +} + +local planes = {} +local planesToPause, pausedPlanes, planesToUnpause = {}, {}, {} +local planeDestinations = {} + +local CMD_STOP = CMD.STOP +local CMD_MOVE = CMD.MOVE +local CMD_IDLEMODE = CMD.IDLEMODE + +--TODO: Check if spawning (by group) fires UnitFinished, if not enable this +--function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID) +--end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + planes[unitID] = nil +end + +function gadget:UnitFinished(unitID, unitDefID, unitTeam) + if trackedUnits[unitDefID] then + local uDefID = spGetUnitDefID(unitID) + local uDef = UnitDefs[uDefID] + planes[unitID] = uDef + Spring.Echo("Alt: "..tostring(uDef.wantedHeight)) + --GiveOrderToUnit(unitID, CMD.IDLEMODE, { planes[builderID].landAt }, { }) + end +end + +local function isSetToFly(unitID) + local cmdIdleModeId = spFindUnitCmdDesc(unitID, CMD_IDLEMODE) + if not cmdIdleModeId then + return false end + local cmdIdleModeDesc = spGetUnitCmdDescs(unitID, cmdIdleModeId, cmdIdleModeId)[1] + if istable(cmdIdleModeDesc.params) then + return cmdIdleModeDesc.params[1] == "0" -- If equal "0" ==> Fly + else + return false end +end + +function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + local planeuDefID = planes[unitID] + if planeuDefID then + --DebugTable(cmdOptions) + if cmdID == CMD_MOVE then + --for i = 1, #cmdParams do + -- Spring.Echo(" param "..i..": "..cmdParams[i]) + --end + planeDestinations[unitID] = { x = cmdParams[1], y = cmdParams[2], z = cmdParams[3]} + end + if cmdID == CMD_STOP and not cmdOptions.shift then --TODO: And flyState == fly + if isSetToFly(unitID) and not pausedPlanes[unitID] then + local x, y, z = Spring.GetUnitPosition(unitID) + local velx, vely, velz= Spring.GetUnitVelocity(unitID) + planesToPause[unitID] = { wantedHeight = planeuDefID.wantedHeight, + targetPos = { x = x, y = y, z = z }, + sourceVel = { x = velx, y = vely, z = velz } + } + else + if pausedPlanes[unitID] then + planesToUnpause[unitID] = planeuDefID end + end + else + if pausedPlanes[unitID] then + planesToUnpause[unitID] = planeuDefID end + end + end + return true +end + +local function sign(num) + return num/math.abs(num) +end + +function gadget:GameFrame(f) + --if f%20 > 0.001 then + -- return end + for unitID, data in pairs(planesToPause) do + --planesToPause[unitID] = nil + --Spring.Echo("Pausing Plane: "..tostring(unitID)) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxAcc", 0) + -- Spring.MoveCtrl.SetAirMoveTypeData(unitID, "myGravity", 0) + --local x,y,z=Spring.GetUnitVectors(unitID) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxPitch", 0) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxElevator", 0) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxRudder", 0) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxAileron", 0) + local posx, posy, posz = Spring.GetUnitPosition(unitID) + -- local velx, vely, velz= Spring.GetUnitVelocity(unitID) + -- local currentAlt = posy - Spring.GetGroundHeight(posx, posz) + local relativeHeight = Spring.GetGroundHeight(posx, posz) + data.wantedHeight + -- Spring.SetUnitVelocity(unitID, 0, vely + sign(wantedAlt - currentAlt), 0) + --Spring.SetUnitVelocity(unitID, math.random(-0.5,0.5), 0, math.random(-0.5,0.5)) + --Spring.SetUnitVelocity(unitID, 0, 0, 0) + --local dirx, diry, dirz = Spring.GetUnitDirection(unitID) + --local h = math.asin(-dirx / math.sqrt(dirx*dirx + dirz*dirz)) + --local rotx, roty, rotz = Spring.GetUnitRotation(unitID) + local targetRotY = roty + local dest = planeDestinations[unitID] + if dest then + --rotx = math.deg(math.atan2(px, pz)) + --roty = math.deg(math.atan2(px, pz)) + --rotz = math.deg(math.atan2(py, px)) + --local dirx, dirz = dest.x - posx, dest.z - posz + -- --targetRotY = math.asin(-dirx / math.sqrt(dirx*dirx + dirz*dirz)) + --targetRotY = math.atan2(dirz, dirx) --|| todeg => * 180 / math.pi + --targetRotY = math.max(-2.5, (math.min(2.5, targetRotY))) + --Spring.Echo("rot Y: "..dy.." target rot Y: "..py) + local rx, ry, rz = Spring.GetUnitRotation(unitID) -- source Direction + local px, py, pz = dest.x - posx, dest.y - posy, dest.z - posz + Spring.SetUnitDirection(unitID, px, py, pz) -- apply target Direction + local trx, try, trz = Spring.GetUnitRotation(unitID) -- read back target Rotation + Spring.SetUnitRotation(unitID, lerp(rx, trx, 0.1), lerp(ry, try, 0.1), lerp(rz, trz, 0.1)) + end + --Spring.SetUnitRotation(unitID, 0, targetRotY, 0) + --Spring.SetUnitRotation(unitID, rotx, roty, rotz) + --Spring.SetUnitRotation(unitID, lerp(rotx, 0, 0.1), + -- --roty, + -- lerp(roty, targetRotY, 0.1), + -- lerp(rotz, 0, 0.1)) + + Spring.MoveCtrl.Enable(unitID) + Spring.MoveCtrl.SetPosition(unitID, lerp(posx, data.targetPos.x + data.sourceVel.x * 10, 0.1), + lerp(posy, relativeHeight, 0.025), + lerp(posz, data.targetPos.z + data.sourceVel.z * 10, 0.1)) + + ----if math.abs(currentAlt - wantedAlt) > 10 then + ---- --Spring.SetUnitVelocity(unitID, velx, vely +sign(wantedAlt - currentAlt), velz) + ----end + -- + --if diry > 0 then + --end + pausedPlanes[unitID] = true + end + for unitID, uDef in pairs(planesToUnpause) do + Spring.MoveCtrl.Disable(unitID) + planesToPause[unitID] = nil + planesToUnpause[unitID] = nil + pausedPlanes[unitID] = nil + + Spring.Echo("Unpausing Plane: "..tostring(unitID)) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "maxAcc", uDef.maxAcc) + --Spring.MoveCtrl.SetAirMoveTypeData(unitID, "myGravity", uDef.myGravity) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--function gadget:GetInfo() +-- return { +-- name = "Zeppelin Physics", +-- desc = "Forces Zeppelin-type units to obey their cruisealt and prevents them from pitching", +-- author = "Ð�нархид", +-- date = "2.2.2009", +-- license = "None", +-- layer = 50, +-- enabled = true +-- } +--end + +zeppelinuDefs ={} +zeppelin={} + +--SYNCED +--if (gadgetHandler:IsSyncedCode()) then +-- +-- function gadget:Initialize() +-- for id,unitDef in pairs(UnitDefs) do +-- if unitDef.myGravity == 0 and +-- unitDef.maxElevator == 0 then +-- Spring.Echo(unitDef.name.." is a zeppelin with cruisealt "..unitDef.wantedHeight) +-- zeppelinuDefs[id]={ +-- pitch=unitDef.maxPitch, +-- alt=unitDef.wantedHeight, +-- name= unitDef.name, +-- } +-- end +-- end +-- end +-- +-- function gadget:UnitCreated(UnitID, whatever) +-- local uDefID = Spring.GetUnitDefID(UnitID); +-- if zeppelinuDefs[uDefID] then +-- zeppelin[UnitID]= uDefID +-- end +-- end +-- +-- function gadget:UnitDestroyed(UnitID, whatever) +-- local uDefID = Spring.GetUnitDefID(UnitID); +-- if zeppelinuDefs[uDefID] then +-- zeppelin[UnitID]=nil +-- end +-- end +-- +-- local function sign(num) +-- return num/math.abs(num) +-- end +-- +-- function gadget:GameFrame(f) +-- if f%20<1 then +-- for unitID, uDefID in pairs(zeppelin) do +-- local x,y,z=Spring.GetUnitVectors(unitID) +-- local ux, uy, uz= Spring.GetUnitPosition(unitID) +-- local vx, vy, vz= Spring.GetUnitVelocity(unitID) +-- local dirx, diry, dirz = Spring.GetUnitDirection(unitID) +-- local altitude = uy - Spring.GetGroundHeight(ux,uz) +-- local wanted= zeppelinuDefs[uDefID].alt +-- if math.abs(altitude-wanted)>10 then +-- Spring.SetUnitVelocity(unitID, vx, vy+sign(wanted-altitude), vz) +-- end +-- +-- if diry>0 then +-- local h = math.asin(-dirx / math.sqrt(dirx*dirx + dirz*dirz)) +-- Spring.SetUnitRotation(unitID,0,h,0) +-- end +-- end--for +-- end--iff +-- end--fn +-- +--end--sync \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_priority.lua b/LuaRules/Gadgets/unit_priority.lua index cdf1a7f24..46984066a 100644 --- a/LuaRules/Gadgets/unit_priority.lua +++ b/LuaRules/Gadgets/unit_priority.lua @@ -27,9 +27,15 @@ end local CMD_PRIORITY=34220 local Tooltips = { - 'Construction spending None. (Hotkey: i)', - 'Construction spending Normal. Default - inherits low/high temporarily from unit it builds. (Hotkey: i)', - 'Construction spending Low. Served only after high and normal priority units. (Hotkey: i)', + [[Construction spending: Low Priority + +Low priority constructions are only built using resources that are left over from other construction projects.]], + [[Construction spending: Normal Priority + +Normal priority constructions share resources evenly between one another.]], + [[Construction spending: High Priority + +High priority constructions will receive resources and buildpower before any other lower priority constructions.]], } local DefaultState = 1 local CommandOrder = 123456 @@ -38,9 +44,16 @@ local CommandDesc = { type = CMDTYPE.ICON_MODE, name = 'Priority', action = 'priority', - texture = 'bitmaps/ui/buttons/cmd_priority.png', - tooltip = Tooltips[DefaultState + 1], - params = {DefaultState, 'Low','Normal','High'} + --texture = 'bitmaps/ui/buttons/cmd_priority.png', + tooltip = Tooltips[DefaultState+1], + params = {DefaultState, +[[Low +Priority]], +[[Normal +Priority]], +[[High +Priority]] + } } local StateCount = #CommandDesc.params-1 diff --git a/LuaRules/Gadgets/unit_scaler.lua b/LuaRules/Gadgets/unit_scaler.lua new file mode 100644 index 000000000..3966c616b --- /dev/null +++ b/LuaRules/Gadgets/unit_scaler.lua @@ -0,0 +1,154 @@ +function gadget:GetInfo() + return { + name = "Unit Scaler", + desc = "", + author = "Floris", + date = "March 2019", + license = "GNU LGPL, v2.1 or later", + layer = 0, + enabled = false + } +end + + +if (not gadgetHandler:IsSyncedCode()) then + + local unitScalesUnaffected = true -- exclude units defined in unitScales from additional scalings + local unitScales = { + } + local scales = { + global = 0.75, + --mobile = 1, + --building = 1, + --t1 = 0.95, + --t2 = 1.1, + --t3 = 1.4, + --kbot = 0.9, + --vehicle = 1, + --ship = 1, + --air = 1, + --hover = 1, + } + + --local modCategoryScale = { + --weapon = 0.5 + --} + + + + local spurSetUnitLuaDraw = Spring.UnitRendering.SetUnitLuaDraw + local spGetUnitDefID = Spring.GetUnitDefID + local spGetUnitTeam = Spring.GetUnitTeam + local glScale = gl.Scale + + local udefScale ={} + + local function init() + for udID, ud in pairs(UnitDefs) do + -- only ARM and COR + --if string.sub(ud.name, 1, 3) == 'Outer_Colonies' then + if not unitScales[udID] or not unitScalesUnaffected then + local scale = scales.global or 1 + if scales.building and ud.isBuilding then + scale = scale * scales.building + end + if scales.mobile and not ud.isBuilding then + scale = scale * scales.mobile + end + if ud.customParams and ud.customParams.techlevel then + if scales.t3 and ud.customParams.techlevel == '3' then + scale = scale * scales.t3 + end + if scales.t2 and ud.customParams.techlevel == '2' then + scale = scale * scales.t2 + end + elseif scales.t1 then + scale = scale * scales.t1 + end + if scales.kbot and ud.modCategories.kbot then + scale = scale * scales.kbot + end + if scales.vehicle and ud.modCategories.tank then + scale = scale * scales.vehicle + end + if scales.ship and ud.modCategories.ship then + scale = scale * scales.ship + end + if scales.hover and ud.modCategories.hover then + scale = scale * scales.hover + end + if scales.air and ud.modCategories.vtol then + scale = scale * scales.air + end + if modCategoryScale then + for cat1, cat in pairs(ud.modCategories) do + if modCategoryScale[cat1] then + scale = scale * modCategoryScale[cat1] + end + end + end + if scale ~= 1 then + udefScale[udID] = scale * (unitScales[udID] and unitScales[udID] or 1) + end + else + udefScale[udID] = unitScales[udID] + end + --end + end + end + init() + + + local separator = ';' + local function import() + + end + + + local function export() + + end + + + function gadget:UnitCreated(unitID, unitDefID, team) + if udefScale[unitDefID] then + spurSetUnitLuaDraw(unitID, true) + end + end + + function gadget:Initialize() + + local allUnits = Spring.GetAllUnits() + for i = 1, #allUnits do + local unitID = allUnits[i] + local udID = spGetUnitDefID(unitID) + local team = spGetUnitTeam(unitID) + if not udefScale[udID] then + udefScale[udID] = 1 + end + gadget:UnitCreated(unitID, udID, team) + end + end + + function gadget:DrawUnit(unitID, drawMode) + local udefID = Spring.GetUnitDefID(unitID) + if udefScale[udefID] then + glScale( udefScale[udefID], udefScale[udefID], udefScale[udefID] ) + return false + end + end + + function gadget:Initialize() + gadgetHandler:AddChatAction('scale', scalercmd, "") + end + + function gadget:Shutdown() + gadgetHandler:RemoveChatAction('scale') + end + + function scalercmd(_,line, words, playerID) + if not Spring.IsCheatingEnabled() or playerID ~= Spring.GetMyPlayerID() then return end + + end + +end diff --git a/LuaRules/Gadgets/unit_shield_link.lua b/LuaRules/Gadgets/unit_shield_link.lua index 4c0ed2684..262d48293 100644 --- a/LuaRules/Gadgets/unit_shield_link.lua +++ b/LuaRules/Gadgets/unit_shield_link.lua @@ -9,6 +9,7 @@ function gadget:GetInfo() enabled = true -- loaded by default? } end +local version = 1.232 -- CHANGELOG -- 2009-5-24: CarRepairer: Added graphic lines to show links of shields (also shows links of enemies' visible shields, can remove if desired). @@ -18,21 +19,74 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- + +if gadgetHandler:IsSyncedCode() then + local spGetUnitPosition = Spring.GetUnitPosition local spGetUnitDefID = Spring.GetUnitDefID local spGetUnitTeam = Spring.GetUnitTeam +local spGetTeamInfo = Spring.GetTeamInfo local spGetUnitAllyTeam = Spring.GetUnitAllyTeam local spGetUnitIsStunned = Spring.GetUnitIsStunned local spGetUnitIsActive = Spring.GetUnitIsActive local spGetUnitShieldState = Spring.GetUnitShieldState local spSetUnitShieldState = Spring.SetUnitShieldState -local spGetTeamInfo = Spring.GetTeamInfo +local spSetUnitRulesParam = Spring.SetUnitRulesParam +local spGetUnitRulesParam = Spring.GetUnitRulesParam + +------------ +local RECHARGE_KOEF = 0.01 +local CHARGE_DRAW_THRESHOLD = 0.1 +------------ +local allyTeamShields = {} +local allyTeamShieldList = {} -if gadgetHandler:IsSyncedCode() then +local unitRulesParamsSetting = {inlos = true} -- Let enemies see links. It is information availible to them anyway + +local updateLink = {} +local updateAllyTeamLinks = {} + +-- Double table with index in things +local function AddDataThingToIterable(id, data, things, thingByID) + if id and data then + thingByID.count = thingByID.count + 1 + thingByID[thingByID.count] = id + things[id] = data + things[id].index = thingByID.count + end +end + +local function RemoveDataThingFromIterable(id, things, thingByID) + if things[id] then + things[thingByID[thingByID.count]].index = things[id].index + thingByID[things[id].index] = thingByID[thingByID.count] + thingByID[thingByID.count] = nil + things[id] = nil + thingByID.count = thingByID.count - 1 + return true + end + return false +end + +-- Double table is required to choose a random element from the list +local function AddThingToIterable(id, things, thingByID) + thingByID.count = thingByID.count + 1 + thingByID[thingByID.count] = id + things[id] = thingByID.count +end -local shieldTeams = {} -shieldConnections = {} +local function RemoveThingFromIterable(id, things, thingByID) + if things[id] then + things[thingByID[thingByID.count]] = things[id] + thingByID[things[id]] = thingByID[thingByID.count] + thingByID[thingByID.count] = nil + things[id] = nil + thingByID.count = thingByID.count - 1 + return true + end + return false +end function gadget:Initialize() for _,unitID in ipairs(Spring.GetAllUnits()) do @@ -43,26 +97,54 @@ function gadget:Initialize() end function gadget:UnitCreated(unitID, unitDefID) - -- only count finished buildings local stunned_or_inbuild, stunned, inbuild = spGetUnitIsStunned(unitID) if stunned_or_inbuild ~= nil and inbuild then return end - + local ud = UnitDefs[unitDefID] - if ud.shieldWeaponDef then - local shieldWep = WeaponDefs[ud.shieldWeaponDef] - local x,y,z = spGetUnitPosition(unitID) - local allyTeam = spGetUnitAllyTeam(unitID) - shieldTeams[allyTeam] = shieldTeams[allyTeam] or {} - shieldUnit = { - shieldPower = shieldWep.shieldPower, - shieldRadius = shieldWep.shieldRadius, - shieldOn = true, - link = {}, - } - shieldTeams[allyTeam][unitID] = shieldUnit + + local shieldWeaponDefID + local shieldNum = -1 + if ud.customParams.dynamic_comm then + if GG.Upgrades_UnitShieldDef then + shieldWeaponDefID, shieldNum = GG.Upgrades_UnitShieldDef(unitID) + end + else + shieldWeaponDefID = ud.shieldWeaponDef + end + + if shieldWeaponDefID then + local shieldWep = WeaponDefs[shieldWeaponDefID] + --local x,y,z = spGetUnitPosition(unitID) + local allyTeamID = spGetUnitAllyTeam(unitID) + if not (allyTeamShields[allyTeamID] and allyTeamShields[allyTeamID][unitID]) then -- not need to redo table if already have table (UnitFinished() will call this function 2nd time) + allyTeamShields[allyTeamID] = allyTeamShields[allyTeamID] or {} + allyTeamShieldList[allyTeamID] = allyTeamShieldList[allyTeamID] or {count = 0} + + local shieldRegen = shieldWep.shieldPowerRegen + if shieldRegen == 0 and shieldWep.customParams and shieldWep.customParams.shield_rate then + shieldRegen = tonumber(shieldWep.customParams.shield_rate) + end + + local shieldUnit = { + shieldMaxCharge = shieldWep.shieldPower, + shieldNum = shieldNum, + shieldRadius = shieldWep.shieldRadius, + shieldRegen = shieldRegen, + shieldRank = ((shieldWep.shieldRadius > 200) and 2) or 1, + unitDefID = unitDefID, + neighbors = {}, + neighborList = {count = 0}, + allyTeamID = allyTeamID, + enabled = false, + oldEnabled = false, + oldFastEnabled = false, + } + AddDataThingToIterable(unitID, shieldUnit, allyTeamShields[allyTeamID], allyTeamShieldList[allyTeamID]) + end + QueueLinkUpdate(allyTeamID,unitID) end end @@ -72,164 +154,261 @@ end function gadget:UnitDestroyed(unitID, unitDefID) local ud = UnitDefs[unitDefID] - local allyTeam = spGetUnitAllyTeam(unitID) - if ud.shieldWeaponDef and shieldTeams[allyTeam] then - local shieldUnit = shieldTeams[allyTeam][unitID] - shieldTeams[allyTeam][unitID] = nil - if shieldUnit then - shieldUnit.link[unitID] = nil + local allyTeamID = spGetUnitAllyTeam(unitID) + if allyTeamShields[allyTeamID] and allyTeamShields[allyTeamID][unitID] then + local unitData = allyTeamShields[allyTeamID][unitID] + if unitData then + RemoveUnitFromNeighbors(allyTeamID, unitID, unitData.neighborList) end + RemoveDataThingFromIterable(unitID, allyTeamShields[allyTeamID], allyTeamShieldList[allyTeamID]) end end function gadget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) local ud = UnitDefs[unitDefID] local _,_,_,_,_,oldAllyTeam = spGetTeamInfo(oldTeam) - if ud.shieldWeaponDef then - if shieldTeams[oldAllyTeam] and shieldTeams[oldAllyTeam][unitID] then - local shieldUnit = shieldTeams[oldAllyTeam][unitID] - shieldTeams[oldAllyTeam][unitID] = nil - shieldUnit.link[unitID] = nil - shieldUnit.link = {} + local allyTeamID = spGetUnitAllyTeam(unitID) + if allyTeamID and allyTeamShields[oldAllyTeam] and allyTeamShields[oldAllyTeam][unitID] then + local unitData + if allyTeamShields[oldAllyTeam] and allyTeamShields[oldAllyTeam][unitID] then + unitData = allyTeamShields[oldAllyTeam][unitID] + + RemoveDataThingFromIterable(unitID, allyTeamShields[oldAllyTeam], allyTeamShieldList[oldAllyTeam]) + RemoveUnitFromNeighbors(oldAllyTeam, unitID, unitData.neighborList) + unitData.neighbors = {} + unitData.neighborList = {count = 0} + unitData.allyTeamID = allyTeamID end + allyTeamShields[allyTeamID] = allyTeamShields[allyTeamID] or {} + allyTeamShieldList[allyTeamID] = allyTeamShieldList[allyTeamID] or {count = 0} - local allyTeam = spGetUnitAllyTeam(unitID) - shieldTeams[allyTeam] = shieldTeams[allyTeam] or {} - shieldTeams[allyTeam][unitID] = shieldUnit + --Note: wont be problem when NIL when nanoframe is captured because is always filled with new value when unit finish + AddDataThingToIterable(unitID, unitData, allyTeamShields[allyTeamID], allyTeamShieldList[allyTeamID]) + QueueLinkUpdate(allyTeamID,unitID) end end --- check if working unit so it can be used for shield link -local function linkable(unitID) - local stunned_or_inbuild, stunned, inbuild = spGetUnitIsStunned(unitID) - if stunned_or_inbuild then +function RemoveUnitFromNeighbors(allyTeamID, unitID, neighborList) + local otherID + local thisShieldTeam = allyTeamShields[allyTeamID] + for i = 1, neighborList.count do + otherID = neighborList[i] + if thisShieldTeam[otherID] then + RemoveThingFromIterable(unitID, thisShieldTeam[otherID].neighbors, thisShieldTeam[otherID].neighborList) + end + end +end + +function QueueLinkUpdate(allyTeamID,unitID) + updateLink[allyTeamID] = updateLink[allyTeamID] or {} + updateLink[allyTeamID][unitID] = true +end + +-- Check if working unit so it can be used for shield link +local function IsEnabled(unitID) + local enabled = spGetUnitShieldState(unitID) + if not enabled then return false end - local active = spGetUnitIsActive(unitID) - if active ~= nil then - return active - else - return true + local stunned_or_inbuild, stunned, inbuild = spGetUnitIsStunned(unitID) + if stunned_or_inbuild then + return false end + local att_enabled = (spGetUnitRulesParam(unitID, "att_abilityDisabled") ~= 1) + return att_enabled end -local function AdjustLinks() - shieldConnections = {} - _G.shieldConnections = shieldConnections +local function ShieldsAreTouching(shield1, shield2) + local xDiff = shield1.x - shield2.x + local zDiff = shield1.z - shield2.z + local yDiff = shield1.y - shield2.y + local sumRadius = shield1.shieldRadius + shield2.shieldRadius + return xDiff <= sumRadius and zDiff <= sumRadius and (xDiff*xDiff + yDiff*yDiff + zDiff*zDiff) < sumRadius*sumRadius +end - for allyTeam,shieldUnits in pairs(shieldTeams) do - for unitID,su in pairs(shieldUnits) do - local x,y,z = spGetUnitPosition(unitID) - su.link = {[unitID] = su} - su.x = x - su.y = y - su.z = z - su.valid = x and y and z +local function AdjustLinks(allyTeamID, shieldUnits, shieldList, unitUpdateList) + local unitData + for unitID,_ in pairs(unitUpdateList) do + unitData = shieldUnits[unitID] + if unitData and unitData.enabled then + local otherID, otherData + for i = 1, shieldList.count do --iterate over all shield unit, find anyone that's in range. + otherID = shieldList[i] + if unitID ~= otherID then + otherData = shieldUnits[otherID] + if not (otherData.neighbors[unitID] or unitData.neighbors[otherID]) and + otherData.enabled and ShieldsAreTouching(unitData, otherData) then + if unitData.shieldRank == otherData.shieldRank then + AddThingToIterable(otherID, unitData.neighbors, unitData.neighborList) + AddThingToIterable(unitID, otherData.neighbors, otherData.neighborList) + elseif unitData.shieldRank < otherData.shieldRank then + -- The higher ranked shield does not initiate transfer with lower shields. + AddThingToIterable(otherID, unitData.neighbors, unitData.neighborList) + else + AddThingToIterable(unitID, otherData.neighbors, otherData.neighborList) + end + end + end + end -- for otherID end - - local sc = {} - local cnt = 1 - shieldConnections[allyTeam] = sc - - -- cache - local unitStat = {} + end -- for unitID +end - for ud1,su in pairs(shieldUnits) do +local function UpdateAllLinks(allyTeamID, shieldUnits, shieldList, unitUpdateList) + local unitData + for unitID,_ in pairs(unitUpdateList) do + unitData = allyTeamShields[allyTeamID][unitID] + if unitData then + local x,y,z = spGetUnitPosition(unitID) + local valid = x and y and z + unitData.enabled = valid and IsEnabled(unitID) + + if (unitData.enabled) then + unitData.x = x + unitData.y = y + unitData.z = z + end + end + end + + AdjustLinks(allyTeamID, shieldUnits, shieldList, unitUpdateList) +end - repeat - if unitStat[ud1] == nil then - unitStat[ud1] = linkable(ud1) +local function UpdateEnabledState() + for allyTeamID,unitList in pairs(allyTeamShields) do + for unitID,shieldUnit in pairs(unitList) do + shieldUnit.enabled = IsEnabled(unitID) + if shieldUnit.enabled ~= shieldUnit.oldFastEnabled then + if shieldUnit.oldFastEnabled then + spSetUnitRulesParam(unitID,"shield_link_unit",-1,unitRulesParamsSetting) end - if not unitStat[ud1] then break end -- continue - - for ud2,su2 in pairs(shieldUnits) do - - if unitStat[ud2] == nil then - unitStat[ud2] = linkable(ud2) - end - - if su.link ~= su2.link and unitStat[ud2] then - if su.valid and ((su.x - su2.x)^2 + (su.y - su2.y)^2 + (su.z - su2.z)^2) ^ 0.5 < (su.shieldRadius + su2.shieldRadius) then - - sc[cnt] = {ud1,ud2} - cnt = cnt + 1 - - for unitID,linksu in pairs(su2.link) do - su.link[unitID] = linksu - linksu.link = su.link - end - end - end - end -- for ud2 - until true - end -- for ud1 + shieldUnit.oldFastEnabled = shieldUnit.enabled + end + end end end -local RECHARGE_KOEF = 0.01 +local function DoChargeTransfer(lowID, lowData, lowCharge, highID, highData, highCharge) + --charge flow is: based on the absolute difference in charge content, + --charge flow must: + --1)not be more than receiver's capacity, + --2)not be more than donator's available charge, + --3)leave spaces for receiver to regen, + --charge flow is capable: to reverse flow (IS DISABLED!) when receiver have regen and is full, + local chargeFlow = math.min(RECHARGE_KOEF*(highCharge - lowCharge),highCharge, lowData.shieldMaxCharge - lowData.shieldRegen - lowCharge) --minimize positive flow + if chargeFlow > 0 then -- Disallow negative flow + chargeFlow = chargeFlow * (spGetUnitRulesParam(highID, "totalReloadSpeedChange") or 1) + spSetUnitShieldState(highID, highData.shieldNum, highCharge - chargeFlow) + spSetUnitShieldState(lowID, lowData.shieldNum, lowCharge + chargeFlow) + return chargeFlow + end + return 0 +end function gadget:GameFrame(n) - if n%30 == 18 then AdjustLinks() end - - -- cache - local unitStat = {} - - for allyTeam,shieldUnits in pairs(shieldTeams) do - local processedLinks = {} --DO NOT USE PAIRS ON THIS - for unitID,su in pairs(shieldUnits) do - repeat - if not processedLinks[su.link] then - processedLinks[su.link] = true - - -- only update working shields - if unitStat[unitID] == nil then - unitStat[unitID] = linkable(unitID) + if n%30 == 18 then --update every 30 frames at the 18th frame + --note: only update link when unit moves reduce total consumption by 53% when unit idle. + for allyTeamID,unitList in pairs(allyTeamShieldList) do + local unitID, unitData + for i = 1, unitList.count do + unitID = unitList[i] + unitData = allyTeamShields[allyTeamID][unitID] + if unitData.enabled ~= unitData.oldEnabled then --if unit was linked/unlinked but now stunned/unstunned (state changes) + if not unitData.oldEnabled then + QueueLinkUpdate(allyTeamID,unitID) end - if not unitStat[unitID] then - break -- continue - end - - local totalCharge = 0 - local linkUnits = 0 - local udata = {} -- unit data, charge and chargeMax - for unitID2,su2 in pairs(su.link) do - local shieldOn,shieldCharge = spGetUnitShieldState(unitID2, -1) - su.shieldOn = shieldOn - if (shieldOn) then - udata[unitID2] = { - charge = shieldCharge, - chargeMax = su2.shieldPower - } - totalCharge = totalCharge + shieldCharge - linkUnits = linkUnits + 1 - end - end - local avg = totalCharge / linkUnits -- calculate average charge of netwrok - local overflow = 0 - local slack = 0 - - for uid,d in pairs(udata) do -- equalize all sheilds to average by 1% of their difference from average - local newCharge = d.charge + (avg - d.charge) * RECHARGE_KOEF - if (newCharge > d.chargeMax) then - overflow = overflow + newCharge - d.chargeMax - newCharge = d.chargeMax - else - slack = slack + d.chargeMax - newCharge - end - d.charge = newCharge - spSetUnitShieldState(uid, -1, newCharge) + unitData.oldEnabled = unitData.enabled + elseif unitData.enabled then + local x,y,z = unitData.x, unitData.y, unitData.z + if x and y and z then + local ux,uy,uz = spGetUnitPosition(unitID) + if ux-x > 10 or x-ux > 10 or uy-y > 10 or y-uy > 10 or uz-z > 10 or z-uz > 10 then --if unit change position + QueueLinkUpdate(allyTeamID, unitID) + end + else + Spring.Echo("Warning: shieldUnitPosition for " .. unitID .. " is NIL") --should not happen, all ShieldUnit should've been subjected to linking check at least once + updateAllyTeamLinks[allyTeamID] = true --re-create all link + break; --nothing else to do, escape loop end + end + end + end + for allyTeamID,_ in pairs(updateAllyTeamLinks) do + UpdateAllLinks(allyTeamID,allyTeamShields[allyTeamID],allyTeamShieldList[allyTeamID],allyTeamShields[allyTeamID]) + updateAllyTeamLinks[allyTeamID] = nil + end + for allyTeamID,unitToLink in pairs(updateLink) do + UpdateAllLinks(allyTeamID,allyTeamShields[allyTeamID],allyTeamShieldList[allyTeamID],unitToLink) --adjust/create link + updateLink[allyTeamID] = nil + end - if overflow > 0 and slack > 0 then -- if there was overflow (above max charge) and there is still some unused space for charge, transfer it there - for uid,d in pairs(udata) do - if (d.charge < d.chargeMax) then - local newCharge = d.charge + overflow * (d.chargeMax - d.charge) / slack - spSetUnitShieldState(uid, -1, newCharge) - end + elseif n%5 == 3 then + UpdateEnabledState() --do stun checks at a bit faster rate for charge distribution algorithm (below) + end + + -- Charge Distribution + --Distribute charge to random nearby neighbor + local drawChange = (n%10 == 0) + if n%2 == 0 then + for allyTeamID,unitList in pairs(allyTeamShieldList) do + local shieldUnits = allyTeamShields[allyTeamID] + local unitID, unitData, unitCharge + local otherID, otherData, otherCharge + local on, chargeFlow, attempt + local randomUnitIndex, randomNumberRange + for i = 1, unitList.count do + unitID = unitList[i] + unitData = shieldUnits[unitID] + on, unitCharge = spGetUnitShieldState(unitID, unitData.shieldNum) + chargeFlow = 0 + attempt = 1 + while attempt and attempt < 3 do + if on and unitCharge and unitData.enabled and unitData.neighborList.count >= 1 then + allyTeamID = unitData.allyTeamID + unitFlow = 0 + -- The +1 is here intentionally to give units a chance to not link (because + -- otherID will be nil). This penalises the flow rate of units with few + -- neighbors. + randomNumberRange = unitData.neighborList.count + 1 + randomUnitIndex = math.random(1, randomNumberRange) + otherID = unitData.neighborList[randomUnitIndex] + if otherID then + otherData = allyTeamShields[allyTeamID][otherID] + if otherData then + on, otherCharge = spGetUnitShieldState(otherID, otherData.shieldNum) + if on and otherCharge and otherData.enabled and ShieldsAreTouching(unitData, otherData) then + if (unitCharge > otherCharge) then + chargeFlow = DoChargeTransfer(otherID, otherData, otherCharge, unitID, unitData, unitCharge) + else + chargeFlow = DoChargeTransfer(unitID, unitData, unitCharge, otherID, otherData, otherCharge) + end + if chargeFlow >= CHARGE_DRAW_THRESHOLD and drawChange then + spSetUnitRulesParam(unitID,"shield_link_unit",otherID,unitRulesParamsSetting) + end + attempt = false + else + RemoveThingFromIterable(unitID, otherData.neighbors, otherData.neighborList) + RemoveThingFromIterable(otherID, unitData.neighbors, unitData.neighborList) + attempt = attempt + 1 + end + else + RemoveThingFromIterable(otherID, unitData.neighbors, unitData.neighborList) + attempt = attempt + 1 + end + elseif randomUnitIndex == randomNumberRange then + -- If I hit the end of the range I picked myself as a partner. + attempt = false + else + attempt = attempt + 1 end - end + else + attempt = false + end + end + if chargeFlow < CHARGE_DRAW_THRESHOLD and drawChange then + spSetUnitRulesParam(unitID,"shield_link_unit",-1,unitRulesParamsSetting) end - until true + end end end end @@ -252,68 +431,101 @@ local glPopAttrib = gl.PopAttrib local GL_LINE_BITS = GL.LINE_BITS local GL_LINES = GL.LINES +local abs = math.abs + local spGetMyAllyTeamID = Spring.GetMyAllyTeamID local spGetSpectatingState = Spring.GetSpectatingState local spIsUnitInView = Spring.IsUnitInView local spValidUnitID = Spring.ValidUnitID +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spGetUnitViewPosition = Spring.GetUnitViewPosition +local spGetUnitLosState = Spring.GetUnitLosState +local spGetGameFrame = Spring.GetGameFrame -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +local shieldUnits = {} +local shieldCount = 0 +function gadget:UnitCreated(unitID, unitDefID) + if UnitDefs[unitDefID].shieldWeaponDef then + shieldCount = shieldCount + 1 + shieldUnits[shieldCount] = unitID + end +end -function gadget:Initialize() +function gadget:UnitDestroyed(unitID, unitDefID) + if UnitDefs[unitDefID].shieldWeaponDef then + for i=1, #shieldUnits do + if shieldUnits[i] == unitID then + table.remove(shieldUnits,i) + shieldCount = shieldCount - 1 + break; + end + end + end end +function gadget:Initialize() + local spGetUnitDefID = Spring.GetUnitDefID + for _,unitID in ipairs(Spring.GetAllUnits()) do + local unitDefID = spGetUnitDefID(unitID) + gadget:UnitCreated(unitID, unitDefID) + end +end local function DrawFunc() - myAllyID = spGetMyAllyTeamID() + local unitID + local connectedToUnitID + local x1, y1, z1, x2, y2, z2 local spec, fullview = spGetSpectatingState() - spec = spec or fullview - - for allyID, connections in spairs(SYNCED.shieldConnections) do - for _,con in sipairs(connections) do - local u1 = con[1] - local u2 = con[2] - - local l1 - local l2 - - if (spec or allyID == myAllyID) then - l1 = spIsUnitInView(u1) - l2 = spIsUnitInView(u2) - end - - if ((l1 or l2) and (spValidUnitID(u1) and spValidUnitID(u2))) then - local _,_,_,x1, y1, z1 = spGetUnitPosition(u1, true) - local _,_,_,x2, y2, z2 = spGetUnitPosition(u2, true) + local myTeam = spGetMyAllyTeamID() + for i=1, #shieldUnits do + unitID = shieldUnits[i] + connectedToUnitID = tonumber(spGetUnitRulesParam(unitID, "shield_link_unit") or -1) + if connectedToUnitID and connectedToUnitID >= 0 and (spValidUnitID(unitID) and spValidUnitID(connectedToUnitID)) then + local los1 = spGetUnitLosState(unitID, myTeam, false) + local los2 = spGetUnitLosState(connectedToUnitID, myTeam, false) + if (fullview or (los1 and los1.los) or (los2 and los2.los)) and + (spIsUnitInView(unitID) or spIsUnitInView(connectedToUnitID)) then + + x1, y1, z1 = spGetUnitViewPosition(unitID, true) + x2, y2, z2 = spGetUnitViewPosition(connectedToUnitID, true) glVertex(x1, y1, z1) glVertex(x2, y2, z2) end end end -end +end - -function gadget:DrawWorld() - if SYNCED.shieldConnections and snext(SYNCED.shieldConnections) then +local function DrawWorldFunc() + if shieldCount > 1 then + local frame = spGetGameFrame() + local alpha = 0.5-0.1*abs((frame%10) - 5) + glPushAttrib(GL_LINE_BITS) - + glDepthTest(true) - glColor(1,0,1,math.random()*0.3+0.2) - glLineWidth(1) + glColor(1,0,1,alpha) + glLineWidth(alpha+0.6) glBeginEnd(GL_LINES, DrawFunc) - + glDepthTest(false) glColor(1,1,1,1) - + glPopAttrib() end end +function gadget:DrawWorld() + DrawWorldFunc() +end +function gadget:DrawWorldRefraction() + DrawWorldFunc() +end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - diff --git a/LuaRules/Gadgets/unit_supply_requirement.lua b/LuaRules/Gadgets/unit_supply_requirement.lua index 677eb1f0e..7d201c50b 100644 --- a/LuaRules/Gadgets/unit_supply_requirement.lua +++ b/LuaRules/Gadgets/unit_supply_requirement.lua @@ -1,10 +1,9 @@ - function gadget:GetInfo() return { name = "Supply Requirement", desc = "Implements a single supply for each team. Uses supply_cost and supply_granted.", - author = "GoogleFrog", - date = "Novemember 11 2013", + author = "GoogleFrog, modified by CommonPlayer", + date = "Novemember 11 2013", --modified by CommonPlayer, Oct 2018 license = "GNU GPL, v2 or later", layer = 0, enabled = true -- loaded by default? @@ -28,14 +27,18 @@ local spGetUnitDefID = Spring.GetUnitDefID local spFindUnitCmdDesc = Spring.FindUnitCmdDesc local spEditUnitCmdDesc = Spring.EditUnitCmdDesc local spGetUnitIsStunned = Spring.GetUnitIsStunned +local spGetUnitTeam = Spring.GetUnitTeam local spSetTeamRulesParam = Spring.SetTeamRulesParam +local teamList = Spring.GetTeamList() +local PRIVATE = {private = true} + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Configuration -local SUPPLY_CAP = 200 -local INTRINSIC_SUPPLY = 0 +local SUPPLY_CAP = tonumber(Spring.GetModOptions().supplycap) or 1000000 -- !!!SREMEMBER TO CHANGE THIS SETTING IN gui_resourceBar.lua !!! +local INTRINSIC_SUPPLY = tonumber(Spring.GetModOptions().intrinsicsupply) or 10 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -71,53 +74,25 @@ local maxSupply = {} -- This ignores SUPPLY_CAP for convinience local maxSupplyWithCap = {} local currentSupply = {} +local isTeamSupplyBlocked = {} + local lockedUnitsArray = {} -- by teamID then unitDefID -- Only finished units grant supply, keep track of it here. local grantingSupply = {} -- by teamID then unitID local costingSupply = {} --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- Utility functions for modifying commands and blocking construction. - -function EnableUnit(unitDefID, teamID) - spSetTeamRulesParam(teamID, "disallowed_" .. unitDefID, 0, {private = true}) -end - -function DisableUnit(unitDefID, teamID) - spSetTeamRulesParam(teamID, "disallowed_" .. unitDefID, 1, {private = true}) -end - -local function NewUnitIsAllowed(unitDefID, teamID) - if costUnitDefID[unitDefID] then - return not lockedUnitsArray[teamID][unitDefID] - end - return true -end - --- Do not block commands because that would make the UI stupid ---function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts) --- return cmdID > 0 or cmdOpts.right or NewUnitIsAllowed(-cmdID, teamID) ---end - --- Block unit creation -function gadget:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z) - return NewUnitIsAllowed(unitDefID, builderTeam) -end - --- Block unit transfer -function gadget:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) - return NewUnitIsAllowed(unitDefID, newTeam) -end +-- by unitID, if supply cost is not paid for build progress is locked +-- 0 = supply blocked; 1 = paid for +local paidFor = {} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Handle updates to supply. local function updateIncreaseSupplyGap(teamID) - spSetTeamRulesParam(teamID, "supplyUsed", currentSupply[teamID], {private = true}) - spSetTeamRulesParam(teamID, "supplyMax", maxSupplyWithCap[teamID], {private = true}) + spSetTeamRulesParam(teamID, "supplyUsed", currentSupply[teamID], PRIVATE) + spSetTeamRulesParam(teamID, "supplyMax", maxSupplyWithCap[teamID], PRIVATE) local supplyGap = maxSupplyWithCap[teamID] - currentSupply[teamID] local lockedArray = lockedUnitsArray[teamID] @@ -128,14 +103,14 @@ local function updateIncreaseSupplyGap(teamID) end if supplyGap >= costUnitDefID[unitDefID] then lockedArray[unitDefID] = false - EnableUnit(unitDefID, teamID) + --EnableUnit(unitDefID, teamID) end end end local function updateDecreaseSupplyGap(teamID) - spSetTeamRulesParam(teamID, "supplyUsed", currentSupply[teamID], {private = true}) - spSetTeamRulesParam(teamID, "supplyMax", maxSupplyWithCap[teamID], {private = true}) + spSetTeamRulesParam(teamID, "supplyUsed", currentSupply[teamID], PRIVATE) + spSetTeamRulesParam(teamID, "supplyMax", maxSupplyWithCap[teamID], PRIVATE) local supplyGap = maxSupplyWithCap[teamID] - currentSupply[teamID] local lockedArray = lockedUnitsArray[teamID] @@ -146,7 +121,7 @@ local function updateDecreaseSupplyGap(teamID) end if supplyGap < costUnitDefID[unitDefID] then lockedArray[unitDefID] = true - DisableUnit(unitDefID, teamID) + --DisableUnit(unitDefID, teamID) end end end @@ -188,6 +163,65 @@ local function RemoveSupplyFromUnit(unitID, unitDefID, teamID, justTurnedIntoNan end end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Utility functions for modifying commands and blocking construction. + +--[[function EnableUnit(unitDefID, teamID) + spSetTeamRulesParam(teamID, "disallowed_" .. unitDefID, 0, {private = true}) +end +function DisableUnit(unitDefID, teamID) + spSetTeamRulesParam(teamID, "disallowed_" .. unitDefID, 1, {private = true}) +end]] + +local function NewUnitIsAllowed(unitDefID, teamID) + if costUnitDefID[unitDefID] then + return not lockedUnitsArray[teamID][unitDefID] + end + return true +end + +-- Do not block commands because that would make the UI stupid +--function gadget:AllowCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOpts) +-- return cmdID > 0 or cmdOpts.right or NewUnitIsAllowed(-cmdID, teamID) +--end + +local function AddSupplyBlockedCounter(teamID) + isTeamSupplyBlocked[teamID] = isTeamSupplyBlocked[teamID] + 1 + if isTeamSupplyBlocked[teamID] == 1 then spSetTeamRulesParam(teamID, "supply_blocked", 1, PRIVATE) end +end +local function SubtractSupplyBlockedCounter(teamID) + isTeamSupplyBlocked[teamID] = isTeamSupplyBlocked[teamID] - 1 + if isTeamSupplyBlocked[teamID] == 0 then spSetTeamRulesParam(teamID, "supply_blocked", nil, PRIVATE) end +end + +function gadget:AllowUnitBuildStep(builderID, builderTeam, unitID, unitDefID, part) + if part <= 0 or not costUnitDefID[unitDefID] or paidFor[unitID] == 1 then return true end + + local teamID = spGetUnitTeam(unitID) + if NewUnitIsAllowed(unitDefID, teamID) then + AddSupplyFromUnit(unitID, unitDefID, teamID, true) + if paidFor[unitID] == 0 then SubtractSupplyBlockedCounter(teamID) end + paidFor[unitID] = 1 + return true + end + if not paidFor[unitID] then + paidFor[unitID] = 0 + AddSupplyBlockedCounter(teamID) + end + return false +end + +-- Block unit creation +--[[function gadget:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z) + return NewUnitIsAllowed(unitDefID, builderTeam) +end]] + +-- Block unit transfer +function gadget:AllowUnitTransfer(unitID, unitDefID, oldTeam, newTeam, capture) + return NewUnitIsAllowed(unitDefID, newTeam) +end + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Unit creation, destruction, transfer. This part assumes that the action in @@ -197,23 +231,47 @@ function gadget:UnitFinished(unitID, unitDefID, teamID) AddSupplyFromUnit(unitID, unitDefID, teamID, false) end -function gadget:UnitCreated(unitID, unitDefID, teamID) +--[[function gadget:UnitCreated(unitID, unitDefID, teamID) AddSupplyFromUnit(unitID, unitDefID, teamID, true) -end +end]] function gadget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) + if paidFor[unitID] == 0 then + SubtractSupplyBlockedCounter(teamID) -- this unit no longer blocks supply for old team + end RemoveSupplyFromUnit(unitID, unitDefID, teamID, false) end function gadget:UnitGiven(unitID, unitDefID, teamID, oldTeamID) - local stunned_or_inbuild, stunned, inbuild = spGetUnitIsStunned(unitID) - AddSupplyFromUnit(unitID, unitDefID, teamID, inbuild) + if paidFor[unitID] == 0 then + AddSupplyBlockedCounter(teamID) -- this unit now blocks supply for new team + elseif paidFor[unitID] == 1 then + local stunned_or_inbuild, stunned, inbuild = spGetUnitIsStunned(unitID) + AddSupplyFromUnit(unitID, unitDefID, teamID, inbuild) + end end function gadget:UnitDestroyed(unitID, unitDefID, teamID) + if paidFor[unitID] == 0 then SubtractSupplyBlockedCounter(teamID) end RemoveSupplyFromUnit(unitID, unitDefID, teamID, false) + paidFor[unitID] = nil end +-- TODO: polling is inferior to events, ideally unit created/destroyed would be used +--[[function gadget:GameFrame(n) + if n % 30 ~= 28 then + return + end + + for i = 1, #teamList do + local teamID = teamList[i] + if isTeamSupplyBlocked[teamID] then + spSetTeamRulesParam(teamID, "supply_blocked", nil, PRIVATE) + isTeamSupplyBlocked[teamID] = false + end + end +end]] + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Initialisation @@ -225,12 +283,15 @@ local function InitializeTeamSupply(teamID) lockedUnitsArray[teamID] = {} grantingSupply[teamID] = {} costingSupply[teamID] = {} + isTeamSupplyBlocked[teamID] = 0 + spSetTeamRulesParam(teamID, "supply_blocked", nil, PRIVATE) -- If no units have been added then we have 0 supply cap so everything is locked for i = 1, costUnitCount do local unitDefID = costUnitList[i] if costUnitDefID[unitDefID] > maxSupplyWithCap[teamID] then lockedUnitsArray[teamID][unitDefID] = true + --DisableUnit(unitDefID, teamID) end end @@ -244,8 +305,7 @@ local function InitializeTeamSupply(teamID) end function gadget:Initialize() - local teams = Spring.GetTeamList() - for _, teamID in ipairs(teams) do + for _, teamID in ipairs(teamList) do InitializeTeamSupply(teamID) end -end \ No newline at end of file +end diff --git a/LuaRules/Gadgets/unit_takeCover.lua b/LuaRules/Gadgets/unit_takeCover.lua new file mode 100644 index 000000000..79d62c16a --- /dev/null +++ b/LuaRules/Gadgets/unit_takeCover.lua @@ -0,0 +1,215 @@ +----used custom tags +------in the featureDef: provide_cover (int) +------in the unitDef: need_cover (int) + +function gadget:GetInfo() + return { + name = "Unit Take Cover", + desc = "Units gain cloak when in the presence of features on the map", + author = "knorke, Forboding Angel", + date = "2016", + license = "CC0", + layer = -3, + enabled = false -- loaded by default? + } +end + +if (gadgetHandler:IsSyncedCode()) then ---SYNCHED + +local resolution = 100 +local updateRate = 30 +_G.resolution = resolution +cover = {} +_G.cover = cover +local mapX = Game.mapSizeX+1 +local mapZ = Game.mapSizeZ+1 + +local needed_cover = {} --[unitID] + +--Spring.GetFeatureRadius ( number featureID ) -> nil | number +--Spring.GetFeaturePosition( number featureID ) -> nil | number x, number y, number z + +function gadget:Initialize() + local all_units = Spring.GetAllUnits () + for i in pairs(all_units) do + --Spring.Echo ("unit " .. all_units[i]) + local ud = UnitDefs[Spring.GetUnitDefID(all_units[i])] + if (ud) then + needed_cover[all_units[i]] = tonumber (ud.customParams.needed_cover) or 999 + --Spring.Echo ("needs a cover of " .. needed_cover[all_units[i]]) + end + end + buildCover () +end + +function setcover (x,z, c) + --Spring.Echo ("x= ".. x .. " z=" .. z) + local tx, tz = tcoord (x,z) + --Spring.Echo ("tx= ".. tx .. " tz=" .. tz) + cover[tx][tz] = c + _G.cover = cover +end + +function getcover (x,z) + if (x > mapX) then return 0 end + if (x < 0) then return 0 end + if (z > mapZ) then return 0 end + if (z < 0) then return 0 end + local tx, tz = tcoord (x,z) + return cover[tx][tz] or 0 +end + +function addcover (x,z, a) + --Spring.Echo ("adding " .. a .. " cover at " .. x .. ":" .. z) + local old = getcover (x,z) + if (old+a < 0) then + setcover (x,z, 0) + else + setcover (x,z, old+a) + end +end + +function providedCoverFromFeature (featureID) + local fd = FeatureDefs[Spring.GetFeatureDefID(featureID)] + --Spring.Echo (fd.name) + if (not fd) then return 555 end + if (not fd.customParams) then return 666 end + return fd.customParams["provide_cover"] or 0 +end + + +function tcoord (x,z) + tx=math.floor ((x/resolution)+0.5) + tz=math.floor ((z/resolution)+0.5) + return tx,tz +end + +function buildCover () + local cnt=0 + for x=0, mapX+resolution, resolution do + local tx, tz = tcoord (x,666) + cover[tx]={} + for z=0 , mapZ+resolution, resolution do + cnt=cnt+1 + --Spring.Echo ("BAUE tx= ".. tx .. " tz=" .. tz) + local tx, tz = tcoord (x,z) + cover[tx][tz] = 0 --***wasting memory. who cares? + end + end + --Spring.Echo ("count=" .. cnt) + + local allF = Spring.GetAllFeatures () + for i in pairs(allF) do + local fi = allF[i] + local x,y,z = Spring.GetFeaturePosition (fi) + if(x and z) then + --local tx, tz = tcoord (x,z) + --Spring.MarkerAddPoint (x,y,z, "feature @ " .. tx .. ":" .. tz) + --addcover (x,z, 1) + --addcover (x,z, 1) + addcover (x,z, providedCoverFromFeature (fi)) + --local old = getcover (tx,tz) + --setcover (x,z, old+a) + end + end +end + +function updateUnits () + local all_units = Spring.GetAllUnits () + for i in pairs(all_units) do + local x,y,z=Spring.GetUnitPosition (all_units[i]) + if (x and y and z) then --***why is this needed? sometimes x is nil for some reason?! + local c = getcover (x,z) + if (c >= (needed_cover[all_units[i]] or 999)) then + --Spring.Echo (c) + hideUnit (all_units[i]) + else + unhideUnit (all_units[i]) + end + end + + end +end + +--***vielleicht lieber setunitlosstate? +function hideUnit (uID) + Spring.SetUnitCloak (uID, 2 ,false) +end + +function unhideUnit (uID) + Spring.SetUnitCloak (uID, false ,false) +end + + +function gadget:GameFrame (f) + if (f%updateRate ==0) then + --Spring.Echo ("running") + updateUnits () + end +end + +function gadget:FeatureDestroyed(featureID, allyTeam) + local x,y,z = Spring.GetFeaturePosition (featureID) + if(x and z) then + addcover (x,z, -providedCoverFromFeature (featureID)) + end +end + +function gadget:FeatureCreated(featureID, allyTeam) + local x,y,z = Spring.GetFeaturePosition (featureID) + if(x and z) then + addcover (x,z, providedCoverFromFeature (featureID)) + end +end + +function gadget:UnitFinished(unitID, unitDefID, teamID) + local cp = UnitDefs[unitDefID].customParams + if (not cp) then return end + needed_cover[unitID] = tonumber (cp.needed_cover) or math.huge +end + +function gadget:UnitDestroyed(unitID) + needed_cover[unitID] = nil +end + + +------------------- +else ----UNSYNCED-- +------------------- + +local debugDraw = false +--***how can i avoid having this function twice? +function utcoord (x,z) + tx=math.floor ((x/SYNCED.resolution)+0.5) + tz=math.floor ((z/SYNCED.resolution)+0.5) + return tx,tz +end + +function ugetcover (x,z) + local tx, tz = utcoord (x,z) + return SYNCED.cover[tx][tz] +end + +function gadget:DrawWorldPreUnit() + if (debugDraw) then + --gl.LineWidth(2.0) + gl.Color(0, 1, 1, 1) + local mapX = Game.mapSizeX-1 + local mapZ = Game.mapSizeZ-1 + for x=1, mapX, SYNCED.resolution do + for z=1 ,mapZ, SYNCED.resolution do + local c = ugetcover (x,z) + if (c > -1) then + gl.DrawGroundCircle (x,100,z, SYNCED.resolution/2, 8) + gl.DrawGroundCircle (x,100,z, (SYNCED.resolution/10)+(c*10), 8) + end + end + end + end +end + +--[[ function gadget:KeyPress(key, mods, isRepeat) + if (key == 108 and Spring.IsCheatingEnabled() ) then debugDraw = not debugDraw end --108=L +end ]]-- + +end \ No newline at end of file diff --git a/LuaRules/Gadgets/unit_transport_radius_adjuster.lua b/LuaRules/Gadgets/unit_transport_radius_adjuster.lua deleted file mode 100644 index d41ae1b82..000000000 --- a/LuaRules/Gadgets/unit_transport_radius_adjuster.lua +++ /dev/null @@ -1,27 +0,0 @@ - function gadget:GetInfo() - return { - name = "Transport radius adjuster", - desc = "a hack in .90, to adjust the radius of transports so they can pick up units, also because they cant be adjusted in 3do, nor per unitdef.", - author = "Beherith", - date = "aug 2012", - license = "PD", - layer = 0, - enabled = true, - } - end - -if (not gadgetHandler:IsSyncedCode()) then - return -end -local AirTrans = { - [UnitDefNames["etransport"].id] = 16, -} -function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) - if AirTrans[unitDefID] then - - --Spring.Echo('reset radius for airtrans') - --Spring.SetUnitRadiusAndHeight New in version 89.0( number unitID, number radius, number height ) - Spring.SetUnitRadiusAndHeight(unitID, AirTrans[unitDefID], 32 ) - end -end - diff --git a/LuaRules/Gadgets/unit_transportee_hider.lua b/LuaRules/Gadgets/unit_transportee_hider.lua new file mode 100644 index 000000000..f3fc66d7e --- /dev/null +++ b/LuaRules/Gadgets/unit_transportee_hider.lua @@ -0,0 +1,99 @@ +function gadget:GetInfo() + return { + name = "Transportee Hider", + desc = "Hides units when inside a closed transport, issues stop command to units trying to enter a full transport", + author = "FLOZi", + date = "09/02/10", + license = "PD", + layer = 0, + enabled = true -- loaded by default? + } +end + +local SetUnitNoDraw = Spring.SetUnitNoDraw +local SetUnitNeutral = Spring.SetUnitNeutral +local SetUnitStealth = Spring.SetUnitStealth +local SetUnitSonarStealth = Spring.SetUnitSonarStealth +local GetUnitDefID = Spring.GetUnitDefID +local GetUnitPosition = Spring.GetUnitPosition +local GetUnitTransporter = Spring.GetUnitTransporter +local GetUnitsInCylinder = Spring.GetUnitsInCylinder +local GiveOrderToUnit = Spring.GiveOrderToUnit + +-- Constants +local CMD_LOAD_ONTO = CMD.LOAD_ONTO +local CMD_STOP = CMD.STOP +-- Variables +local massLeft = {} +local toBeLoaded = {} + +if (gadgetHandler:IsSyncedCode()) then + +function gadget:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) + if cmdID == CMD_LOAD_ONTO then + local transportID = cmdParams[1] + toBeLoaded[unitID] = transportID + end + return true +end + + +function gadget:UnitCreated(unitID, unitDefID, teamID) + local unitDef = UnitDefs[unitDefID] + local maxMass = unitDef.transportMass + if maxMass then + massLeft[unitID] = maxMass + end +end + +function gadget:UnitDestroyed(unitID, unitDefID, unitTeam) + massLeft[unitID] = nil + toBeLoaded[unitID] = nil +end + +local function TransportIsFull(transportID) + for unitID, targetTransporterID in pairs(toBeLoaded) do + if targetTransporterID == transportID then + GiveOrderToUnit(unitID, CMD_STOP, {}, {}) + toBeLoaded[unitID] = nil + end + end +end + +function gadget:UnitLoaded(unitID, unitDefID, unitTeam, transportID, transportTeam) + --Spring.Echo("UnitLoaded", unitDefID, transportID) + if ((not unitDefID) or (not transportID)) then return end + local transportDef = UnitDefs[GetUnitDefID(transportID)] + local unitDef = UnitDefs[unitDefID] + -- Check if transport is full (former crash risk!) + if not massLeft[transportID] then return end + massLeft[transportID] = massLeft[transportID] - unitDef.mass + if massLeft[transportID] == 0 then + TransportIsFull(transportID) + end + if (not transportDef.springCategories.vtol) and (not transportDef.isAirBase) then + SetUnitNoDraw(unitID, true) + SetUnitStealth(unitID, true) + SetUnitSonarStealth(unitID, true) + end +end + +function gadget:UnitUnloaded(unitID, unitDefID, teamID, transportID) + --Spring.Echo("UnitUnloaded") + if ((not unitDefID) or (not transportID)) then return end + local transportDef = UnitDefs[GetUnitDefID(transportID)] + local unitDef = UnitDefs[unitDefID] + if not massLeft[transportID] then return end + massLeft[transportID] = massLeft[transportID] + unitDef.mass + if (not transportDef.springCategories.vtol) and (not transportDef.isAirBase) then + SetUnitNoDraw(unitID, false) + SetUnitStealth(unitID, false) + SetUnitSonarStealth(unitID, false) + end +end + +else + +end + + diff --git a/LuaRules/Gadgets/weapon_ignore_gibs.lua b/LuaRules/Gadgets/weapon_ignore_gibs.lua new file mode 100644 index 000000000..90f5664c5 --- /dev/null +++ b/LuaRules/Gadgets/weapon_ignore_gibs.lua @@ -0,0 +1,23 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if not gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function gadget:GetInfo() + return { + name = "Ignore Gibs", + desc = "Makes shrapnel not call ProjectileCreated and ProjectileDestroyed", + author = "GoogleFrog", + date = "3 March 2019", + license = "Public domain", + layer = 0, + enabled = true + } +end + +function gadget:Initialize() + Script.SetWatchWeapon(-1, false) + gadgetHandler:RemoveGadget() +end diff --git a/LuaRules/Gadgets/weapon_noexplode_stopper.lua b/LuaRules/Gadgets/weapon_noexplode_stopper.lua new file mode 100644 index 000000000..2815cfc6a --- /dev/null +++ b/LuaRules/Gadgets/weapon_noexplode_stopper.lua @@ -0,0 +1,83 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if not gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function gadget:GetInfo() + return { + name = "Noexplode Stopper", + desc = "Implements noexplodes that do not penetrate shields.", + author = "GoogleFrog", + date = "4 Feb 2012", + license = "None", + layer = 50, + enabled = true + } +end + +local passedProjectile = {} +local shieldDamages = {} +local noExplode = {} +for i = 1, #WeaponDefs do + shieldDamages[i] = tonumber(WeaponDefs[i].customParams.shield_damage) + if WeaponDefs[i].noExplode then + noExplode[i] = true + end +end + +function gadget:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile) + + --[[ + -- Code that causes projectile bounce + if Spring.ValidUnitID(shieldCarrierUnitID) then + + local px, py, pz = Spring.GetProjectilePosition(proID) + local vx, vy, vz = Spring.GetProjectileVelocity(proID) + local sx, sy, sz = Spring.GetUnitPosition(shieldCarrierUnitID) + + local rx, ry, rz = px-sx, py-sy, pz-sz + + local f = 2 * (rx*vx + ry*vy + rz*vz) / (rx^2 + ry^2 + rz^2) + + local nx, ny, nz = vx - f*rx, vy - f*ry, vz - f*rz + Spring.SetProjectileVelocity(proID, nx, ny, nz) + + return true + end + + return false + --]] + + local weaponDefID = Spring.GetProjectileDefID(proID) + if passedProjectile[proID] then + return true + --elseif select(2, Spring.GetProjectilePosition(proID)) < 0 then + -- passedProjectile[proID] = true + -- return true + elseif weaponDefID and shieldCarrierUnitID and shieldEmitterWeaponNum and noExplode[weaponDefID] then + local _, charge = Spring.GetUnitShieldState(shieldCarrierUnitID) --FIXME figure out a way to get correct shield + if charge and shieldDamages[weaponDefID] < charge then + Spring.DeleteProjectile(proID) + else + passedProjectile[proID] = true + end + end + + return false + +end + +function gadget:ProjectileDestroyed(proID) + if passedProjectile[proID] then + passedProjectile[proID] = false + end +end + + +function gadget:Initialize() + for id, _ in pairs(noExplode) do + Script.SetWatchProjectile(id, true) + end +end diff --git a/LuaRules/Gadgets/weapon_single_hit.lua b/LuaRules/Gadgets/weapon_single_hit.lua index bb55967ed..bcc6152c6 100644 --- a/LuaRules/Gadgets/weapon_single_hit.lua +++ b/LuaRules/Gadgets/weapon_single_hit.lua @@ -1,7 +1,14 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +if not gadgetHandler:IsSyncedCode() then + return +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- function gadget:GetInfo() return { name = "Single-Hit Weapon", - desc = "Forces marked weapons to only inflict damage once per projectile per unit", + desc = "Forces marked weapons to only inflict damage once per projectile per unit. For use with noexplode weapons.", author = "Anarchid", date = "25.03.2013", license = "Public domain", @@ -12,10 +19,7 @@ end local spGetGameFrame = Spring.GetGameFrame ------- SYNCED ------------------------------------------------------- -if (gadgetHandler:IsSyncedCode()) then - -local isNewEngine = not (Game.version:find('91.0') and (Game.version:find('91.0.1') == nil)) +local wantedWeaponList = {} local singleHitWeapon = {} local singleHitUnitId = {} @@ -24,15 +28,17 @@ local singleHitMultiWeapon = {} local singleHitProjectile = {} function gadget:Initialize() - for i=1,#WeaponDefs do - local wd = WeaponDefs[i] + for wdid = 1, #WeaponDefs do + local wd = WeaponDefs[wdid] if wd.customParams then if wd.customParams.single_hit then singleHitWeapon[wd.id] = true; + wantedWeaponList[#wantedWeaponList + 1] = wdid end - if isNewEngine and wd.customParams.single_hit_multi then + if wd.customParams.single_hit_multi then Script.SetWatchWeapon(wd.id, true) singleHitMultiWeapon[wd.id] = true; + wantedWeaponList[#wantedWeaponList + 1] = wdid end end end @@ -51,6 +57,9 @@ function gadget:ProjectileDestroyed(proID) end end +function gadget:UnitPreDamaged_GetWantedWeaponDef() + return wantedWeaponList +end function gadget:UnitPreDamaged(unitID,unitDefID,_, damage,_, weaponDefID,attackerID,_,_, projectileID) if singleHitWeapon[weaponDefID] then @@ -68,7 +77,6 @@ function gadget:UnitPreDamaged(unitID,unitDefID,_, damage,_, weaponDefID,attacke end end return damage - end end @@ -83,10 +91,5 @@ function gadget:UnitPreDamaged(unitID,unitDefID,_, damage,_, weaponDefID,attacke end return damage end - return damage; -end - - -end ------ END SYNCED --------------------------------------------------- +end \ No newline at end of file diff --git a/LuaRules/Gadgets/weapon_tech_levels.lua b/LuaRules/Gadgets/weapon_tech_levels.lua deleted file mode 100644 index 89d9ee948..000000000 --- a/LuaRules/Gadgets/weapon_tech_levels.lua +++ /dev/null @@ -1,89 +0,0 @@ -function gadget:GetInfo() - return { - name = "Weapon Tech Levels", - desc = "Makes certain weapons better after technologies are unlocked", - author = "Anarchid", - date = "28th February 2014", - license = "GNU GPL, v2 or later", - layer = -1, - enabled = false, - } -end - --- Entire gadget is synced -if not gadgetHandler:IsSyncedCode() then - return -end - --- list of upgrade class names to tech levels, automatically initialized from weapondef customparam "upgradeClass" -local upgrades = {} - --- table to contain each team's current level in each tech. Ideally should be somehow available to widgets, for example via TeamRulesParams. --- however, rulesparams cannot have tables, so the table would have to be serialized... cba atm. -local teamUpgradeLevels = {} - -function gadget:Initialize() - local upgradeClassCount = 0; - -- filter distinct upgrade classes from all weapondef customparams - for i=1,#WeaponDefs do - local wd = WeaponDefs[i] - if wd.customParams then - local class = wd.customParams.upgradeclass; - if class then - if not upgrades[class] then - upgrades[class] = true - upgradeClassCount = upgradeClassCount + 1; - end - end - end - end - - -- assign zero tech level in each tech to each team - local teams = Spring.GetTeamList() - for i=1, #teams do - teamUpgradeLevels[teams[i]] = {} - for upgrade,_ in pairs(upgrades) do - teamUpgradeLevels[teams[i]][upgrade] = 0; - end - end - - Spring.Echo('initialized weapon upgrade system with '..upgradeClassCount..' techs and '..#teams..' teams'); -end - - --- Currently upgrades are units like any other. This is simply the easiest way to do them. --- If you want to do it any other way, just call GG.UpgradeComplete on your appropriate event. -function gadget:UnitCreated(unitID, unitDefID, teamID, builderID) - local ud = UnitDefs[unitDefID]; - if ud.customParams then - local tech = ud.customParams.upgradetech; - local level = tonumber(ud.customParams.upgradelevel); - - if tech and level then - GG.UpgradeComplete(tech, level, teamID); - end - end -end - -function GG.UpgradeComplete(techName, level, teamID) - level = math.max(teamUpgradeLevels[teamID][techName], level); - teamUpgradeLevels[teamID][techName] = level; -end - -function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam) - local wd = WeaponDefs[weaponDefID]; - - if wd and wd.customParams then - local weaponTech = wd.customParams.upgradeclass or false; - - if (weaponTech) then - local techModifier = (teamUpgradeLevels[attackerTeam][weaponTech] or 0); - Spring.Echo ("Techmodifier:" .. techModifier) - damage = damage*techModifier; - Spring.Echo ("Damage:" .. damage) - end - end - - return damage; -end - diff --git a/LuaRules/Images/bgcorner.png b/LuaRules/Images/bgcorner.png new file mode 100644 index 000000000..317f49a57 Binary files /dev/null and b/LuaRules/Images/bgcorner.png differ diff --git a/LuaRules/Images/controlpoints.png b/LuaRules/Images/controlpoints.png new file mode 100644 index 000000000..c374cd35e Binary files /dev/null and b/LuaRules/Images/controlpoints.png differ diff --git a/LuaRules/Utilities/getunitisbuilding.lua b/LuaRules/Utilities/getunitisbuilding.lua index f603ecfee..640974c31 100644 --- a/LuaRules/Utilities/getunitisbuilding.lua +++ b/LuaRules/Utilities/getunitisbuilding.lua @@ -8,8 +8,15 @@ ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- +local engineVersion = (Game and Game.version) or (Engine and Engine.version) or "Engine version error" + +local reverseCompat = (engineVersion:find('91.0') == 1) + local function IsFeatureInRange(unitID, featureID, range) - range = range + 20 -- fudge factor + if reverseCompat then + return true + end + range = range + 100 -- fudge factor local x,y,z = Spring.GetFeaturePosition(featureID) local ux,uy,uz = Spring.GetUnitPosition(unitID) return ((ux - x)^2 + (uz - z)^2) <= range^2 @@ -30,17 +37,17 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) if (buildID) then target = buildID type = "building" - --inRange = true + inRange = true else - --local unitDef = UnitDefs[Spring.GetUnitDefID(unitID)] or {} - --local buildRange = unitDef.buildDistance or 0 - local cmds = Spring.GetUnitCommands(unitID,1) + local unitDef = UnitDefs[Spring.GetUnitDefID(unitID)] or {} + local buildRange = unitDef.buildDistance or 0 + local cmds = Spring.GetCommandQueue(unitID,1) if (cmds)and(cmds[1]) then local cmd = cmds[1] local cmdID = cmd.id local cmdParams = cmd.params - if cmdID == CMD.RECLAIM then + if cmdID == CMD.RECLAIM then --// anything except "#cmdParams = 1 or 5" is either invalid or discribes an area reclaim if (not cmdParams[2])or(cmdParams[5]) then local id = cmdParams[1] @@ -52,13 +59,13 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) target = featureID isFeature = true type = "reclaim" - --inRange = IsFeatureInRange(unitID, featureID, buildRange) + inRange = IsFeatureInRange(unitID, featureID, buildRange) end else if Spring.ValidUnitID(unitID_) then target = unitID_ type = "reclaim" - --inRange = Spring.GetUnitSeparation(unitID, unitID_, true) <= buildRange + inRange = Spring.GetUnitSeparation(unitID, unitID_, true) <= buildRange end end end @@ -68,7 +75,7 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) if Spring.ValidUnitID(repairID) then target = repairID type = "repair" - --inRange = Spring.GetUnitSeparation(unitID, repairID, true) <= buildRange + inRange = Spring.GetUnitSeparation(unitID, repairID, true) <= buildRange end elseif cmdID == CMD.RESTORE then @@ -76,7 +83,7 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) local z = cmd.params[3] type = "restore" target = {x, GetGroundHeight(x,z)+5, z, cmd.params[4]} - --inRange = IsGroundPosInRange(unitID, x, z, buildRange) + inRange = IsGroundPosInRange(unitID, x, z, buildRange) elseif cmdID == CMD.CAPTURE then if (not cmdParams[2])or(cmdParams[5]) then @@ -84,7 +91,7 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) if Spring.ValidUnitID(captureID) then target = captureID type = "capture" - --inRange = Spring.GetUnitSeparation(unitID, captureID, true) <= buildRange + inRange = Spring.GetUnitSeparation(unitID, captureID, true) <= buildRange end end @@ -94,12 +101,16 @@ function Spring.Utilities.GetUnitNanoTarget(unitID) target = rezzID isFeature = true type = "resurrect" - --inRange = IsFeatureInRange(unitID, featureID, buildRange) + inRange = IsFeatureInRange(unitID, rezzID, buildRange) end end end end - return type, target, isFeature, inRange + if inRange then + return type, target, isFeature + else + return + end end diff --git a/LuaRules/Utilities/glvolumes.lua b/LuaRules/Utilities/glvolumes.lua index b06f154c1..b31c71561 100644 --- a/LuaRules/Utilities/glvolumes.lua +++ b/LuaRules/Utilities/glvolumes.lua @@ -71,24 +71,47 @@ function gl.Utilities.DrawMyBox(minX,minY,minZ, maxX,maxY,maxZ) end) end +function gl.Utilities.DrawMy3DTriangle(x1,z1, x2, z2, x3,z3, minY, maxY) + gl.BeginEnd(GL.TRIANGLES, function() + --// top + glVertex(x1, maxY, z1) + glVertex(x2, maxY, z2) + glVertex(x3, maxY, z3) + --// bottom + glVertex(x1, minY, z1) + glVertex(x3, minY, z3) + glVertex(x2, minY, z2) + end) + gl.BeginEnd(GL.QUAD_STRIP, function() + --// sides + glVertex(x1, maxY, z1) + glVertex(x1, minY, z1) + glVertex(x2, maxY, z2) + glVertex(x2, minY, z2) + glVertex(x3, maxY, z3) + glVertex(x3, minY, z3) + glVertex(x1, maxY, z1) + glVertex(x1, minY, z1) + end) +end local function CreateSinCosTable(divs) local sinTable = {} local cosTable = {} - + local divAngle = TWO_PI / divs local alpha = 0 local i = 1 repeat sinTable[i] = sin(alpha) cosTable[i] = cos(alpha) - + alpha = alpha + divAngle i = i + 1 until (alpha >= TWO_PI) sinTable[i] = 0.0 -- sin(TWO_PI) cosTable[i] = 1.0 -- cos(TWO_PI) - + return sinTable, cosTable end @@ -98,7 +121,7 @@ function gl.Utilities.DrawMyCylinder(x,y,z, height,radius,divs) local sinTable, cosTable = CreateSinCosTable(divs) local bottomY = y - (height / 2) local topY = y + (height / 2) - + gl.BeginEnd(GL.TRIANGLE_STRIP, function() --// top for i = #sinTable, 1, -1 do @@ -133,6 +156,18 @@ function gl.Utilities.DrawMyCylinder(x,y,z, height,radius,divs) end +function gl.Utilities.DrawMyCircle(x,y,radius,divs) + divs = divs or 25 + local sinTable, cosTable = CreateSinCosTable(divs) + + gl.BeginEnd(GL.LINE_LOOP, function() + for i = #sinTable, 1, -1 do + glVertex(x + radius*sinTable[i], y + radius*cosTable[i], 0) + end + end) +end + + function gl.Utilities.DrawMyHollowCylinder(x,y,z, height,radius,inRadius,divs) divs = divs or 25 local sinTable, cosTable = CreateSinCosTable(divs) @@ -195,6 +230,18 @@ function gl.Utilities.DrawGroundRectangle(x1,z1,x2,z2) gl.PopMatrix() end +local triangles = {} +function gl.Utilities.DrawGroundTriangle(args) + if not triangles[args] then + triangles[args] = gl.CreateList(gl.Utilities.DrawMy3DTriangle, args[1], args[2], args[3], args[4], args[5], args[6], -0.5, 0.5) + end + gl.PushMatrix() + gl.Translate(0, averageGroundHeight, 0) + gl.Scale(1, shapeHeight, 1) + gl.Utilities.DrawVolume(triangles[args]) + gl.PopMatrix() +end + local cylinder = gl.CreateList(gl.Utilities.DrawMyCylinder,0,0,0,1,1,35) function gl.Utilities.DrawGroundCircle(x,z,radius) gl.PushMatrix() @@ -204,6 +251,24 @@ function gl.Utilities.DrawGroundCircle(x,z,radius) gl.PopMatrix() end +local circle = gl.CreateList(gl.Utilities.DrawMyCircle,0,0,1,35) +function gl.Utilities.DrawCircle(x,y,radius) + gl.PushMatrix() + gl.Translate(x, y, 0) + gl.Scale(radius, radius, 1) + gl.Utilities.DrawVolume(circle) + gl.PopMatrix() +end + +-- See comment in DrawMergedVolume +function gl.Utilities.DrawMergedGroundCircle(x,z,radius) + gl.PushMatrix() + gl.Translate(x, averageGroundHeight, z) + gl.Scale(radius, shapeHeight, radius) + gl.Utilities.DrawMergedVolume(cylinder) + gl.PopMatrix() +end + local hollowCylinders = { [ 0 ] = cylinder, @@ -244,8 +309,8 @@ function gl.Utilities.DrawVolume(vol_dlist) gl.ColorMask(false, false, false, false) gl.StencilOp(GL.KEEP, GL.INCR, GL.KEEP) --gl.StencilOp(GL.KEEP, GL.INVERT, GL.KEEP) - gl.StencilMask(0x11) - gl.StencilFunc(GL.ALWAYS, 0, 0) + gl.StencilMask(1) + gl.StencilFunc(GL.ALWAYS, 0, 1) gl.CallList(vol_dlist) @@ -253,16 +318,49 @@ function gl.Utilities.DrawVolume(vol_dlist) gl.DepthTest(false) gl.ColorMask(true, true, true, true) gl.StencilOp(GL.ZERO, GL.ZERO, GL.ZERO) - gl.StencilMask(0x11) - gl.StencilFunc(GL.NOTEQUAL, 0, 0+1) + gl.StencilMask(1) + gl.StencilFunc(GL.NOTEQUAL, 0, 1) gl.CallList(vol_dlist) if (gl.DepthClamp) then gl.DepthClamp(false) end gl.StencilTest(false) + -- gl.DepthTest(true) + gl.Culling(false) +end + +-- Make sure that you start with a clear stencil and that you +-- clear it using gl.Clear(GL.STENCIL_BUFFER_BIT, 0) +-- after finishing all the merged volumes +function gl.Utilities.DrawMergedVolume(vol_dlist) + gl.DepthMask(false) + if (gl.DepthClamp) then gl.DepthClamp(true) end + gl.StencilTest(true) + + gl.Culling(false) gl.DepthTest(true) + gl.ColorMask(false, false, false, false) + gl.StencilOp(GL.KEEP, GL.INVERT, GL.KEEP) + --gl.StencilOp(GL.KEEP, GL.INVERT, GL.KEEP) + gl.StencilMask(1) + gl.StencilFunc(GL.ALWAYS, 0, 1) + + gl.CallList(vol_dlist) + + gl.Culling(GL.FRONT) + gl.DepthTest(false) + gl.ColorMask(true, true, true, true) + gl.StencilOp(GL.KEEP, GL.INCR, GL.INCR) + gl.StencilMask(3) + gl.StencilFunc(GL.EQUAL, 1, 3) + + gl.CallList(vol_dlist) + + if (gl.DepthClamp) then gl.DepthClamp(false) end + gl.StencilTest(false) + -- gl.DepthTest(true) gl.Culling(false) end -------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/Utilities/tablefunctions.lua b/LuaRules/Utilities/tablefunctions.lua index 3fc6bb609..6cdb916aa 100644 --- a/LuaRules/Utilities/tablefunctions.lua +++ b/LuaRules/Utilities/tablefunctions.lua @@ -1,31 +1,34 @@ +Spring.Utilities = Spring.Utilities or {} + +------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- ---deep not safe with circular tables! defaults To false +-- bool deep: clone subtables. defaults to false. not safe with circular tables! function Spring.Utilities.CopyTable(tableToCopy, deep) - local copy = {} - for key, value in pairs(tableToCopy) do - if (deep and type(value) == "table") then - copy[key] = Spring.Utilities.CopyTable(value, true) - else - copy[key] = value - end - end - return copy + local copy = {} + for key, value in pairs(tableToCopy) do + if (deep and type(value) == "table") then + copy[key] = Spring.Utilities.CopyTable(value, true) + else + copy[key] = value + end + end + return copy end --- modifies primary directly; if you don't want to do that then make a copy and pass that function Spring.Utilities.MergeTable(primary, secondary, deep) + local new = Spring.Utilities.CopyTable(primary, deep) for i, v in pairs(secondary) do -- key not used in primary, assign it the value at same key in secondary - if not primary[i] then + if not new[i] then if (deep and type(v) == "table") then - primary[i] = Spring.Utilities.CopyTable(v, true) + new[i] = Spring.Utilities.CopyTable(v, true) else - primary[i] = v + new[i] = v end -- values at key in both primary and secondary are tables, merge those - elseif type(primary[i]) == "table" and type(v) == "table" then - Spring.Utilities.MergeTable(primary[i], v, deep) + elseif type(new[i]) == "table" and type(v) == "table" then + new[i] = Spring.Utilities.MergeTable(new[i], v, deep) end end + return new end \ No newline at end of file diff --git a/LuaRules/Utilities/unitStates.lua b/LuaRules/Utilities/unitStates.lua new file mode 100644 index 000000000..f694fc255 --- /dev/null +++ b/LuaRules/Utilities/unitStates.lua @@ -0,0 +1,70 @@ +local REVERSE_COMPAT = not Spring.Utilities.IsCurrentVersionNewerThan(104, 1120) +local REVERSE_COMPAT_ORDER = not Spring.Utilities.IsCurrentVersionNewerThan(104, 1140) + +function Spring.Utilities.GetUnitRepeat(unitID) + if REVERSE_COMPAT then + local state = Spring.GetUnitStates(unitID) + return state and state["repeat"] + end + + local _,_,_,repeatState = Spring.GetUnitStates(unitID, false, true) + return repeatState +end + +function Spring.Utilities.GetUnitFireState(unitID) + if REVERSE_COMPAT then + local state = Spring.GetUnitStates(unitID) + return state and state["firestate"] + end + + local fireState = Spring.GetUnitStates(unitID, false) + return fireState +end + +function Spring.Utilities.GetUnitMoveState(unitID) + if REVERSE_COMPAT then + local state = Spring.GetUnitStates(unitID) + return state and state["movestate"] + end + + local _,moveState = Spring.GetUnitStates(unitID, false) + return moveState +end + +function Spring.Utilities.GetUnitActiveState(unitID) + if REVERSE_COMPAT then + local state = Spring.GetUnitStates(unitID) + return state and state["active"] + end + + local _,_,_,_,_,activeState = Spring.GetUnitStates(unitID, false, true) + return activeState +end + +function Spring.Utilities.GetUnitTrajectoryState(unitID) + if REVERSE_COMPAT then + local state = Spring.GetUnitStates(unitID) + return state and state["trajectory"] + end + + local _,_,_,_,_,_,trajectory = Spring.GetUnitStates(unitID, false, true) + return trajectory +end + +function Spring.Utilities.GetUnitFirstCommand(unitID) + if REVERSE_COMPAT_ORDER then + local cQueue = Spring.GetCommandQueue(unitID, 1) + return cQueue and cQueue[1] and cQueue[1].id + end + + local cmdID = Spring.GetUnitCurrentCommand(unitID) + return cmdID +end + +function Spring.Utilities.CheckBit(name, number, bit) + if not number then + Spring.Echo("Name", name) + end + return number and (number%(2*bit) >= bit) +end + diff --git a/LuaRules/Utilities/unitTypeChecker.lua b/LuaRules/Utilities/unitTypeChecker.lua new file mode 100644 index 000000000..14de62844 --- /dev/null +++ b/LuaRules/Utilities/unitTypeChecker.lua @@ -0,0 +1,25 @@ + +function Spring.Utilities.getMovetype(ud) + if ud.canFly or ud.isAirUnit then + if ud.isHoveringAirUnit then + return 1 -- gunship + else + return 0 -- fixedwing + end + elseif not (ud.isBuilding or ud.isFactory or ud.speed == 0) then + return 2 -- ground/sea + end + return false -- For structures or any other invalid movetype +end + +function Spring.Utilities.getMovetypeByID(unitDefID) + local ud = unitDefID and UnitDefs[unitDefID] + if ud then + Spring.Utilities.getMovetype(ud) + end + return false +end + +function Spring.Utilities.BlueprintFloat(ud) + return Spring.Utilities.IsCurrentVersionNewerThan(103, 289) and ud.floatOnWater +end diff --git a/LuaRules/Utilities/unitrendering.lua b/LuaRules/Utilities/unitrendering.lua index 673242729..a963e183c 100644 --- a/LuaRules/Utilities/unitrendering.lua +++ b/LuaRules/Utilities/unitrendering.lua @@ -1,3 +1,8 @@ +VFS.Include("LuaRules/Utilities/versionCompare.lua") +local reverseCompat = not Spring.Utilities.IsCurrentVersionNewerThan(100, 0) + +if reverseCompat then + -- $Id:$ ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- @@ -79,3 +84,135 @@ function Spring.UnitRendering.DeactivateMaterial(unitID,lod) Spring.UnitRendering.SetLODCount(unitID,0) end end + +else -- reverseCompat + +-- $Id:$ +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- +-- exported functions: +-- Spring.UnitRendering.GetLODCount(unitID) -> int +-- Spring.UnitRendering.ActivateMaterial(unitID,lod) -> nil +-- Spring.UnitRendering.DeactivateMaterial(unitID,lod) -> nil +-- Spring.FeatureRendering.GetLODCount(featureID) -> int +-- Spring.FeatureRendering.ActivateMaterial(featureID,lod) -> nil +-- Spring.FeatureRendering.DeactivateMaterial(featureID,lod) -> nil +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +if (SendToUnsynced) then + return +end + +local unitRendering = { + lods = {}, + curHighestLOD = 0, + + activeMats = {}, + + spSetLODCount = Spring.UnitRendering.SetLODCount, + spSetMaterialLastLOD = Spring.UnitRendering.SetMaterialLastLOD, +} + +local featureRendering = { + lods = {}, + curHighestLOD = 0, + + activeMats = {}, + + spSetLODCount = Spring.FeatureRendering.SetLODCount, + spSetMaterialLastLOD = Spring.FeatureRendering.SetMaterialLastLOD, +} + +local function SetLODCount(rendering, objectID, lod_count) + rendering.lods[objectID] = lod_count + rendering.spSetLODCount(objectID, lod_count) +end + +local function GetLODCount(rendering, objectID) + return rendering.lods[objectID] or 0 +end + +local function ActivateMaterial(rendering, objectID, lod) + local activeMats = rendering.activeMats[objectID] + if not activeMats then + activeMats = {current = math.huge} + rendering.activeMats[objectID] = activeMats + end + + local lod_count = GetLODCount(rendering, objectID) + if lod_count < lod then + SetLODCount(rendering, objectID, lod) + end + + activeMats[lod] = true + + if lod > rendering.curHighestLOD then + rendering.curHighestLOD = lod + end + + if lod <= activeMats.current then + activeMats.current = lod + rendering.spSetMaterialLastLOD(objectID, "opaque", lod) + end +end + + +local function DeactivateMaterial(rendering, objectID, lod) + local activeMats = rendering.activeMats[objectID] + if not activeMats then + return + end + + activeMats[lod] = nil + + if activeMats.current == lod then + --// detect next available material + for i = 1, rendering.curHighestLOD do + if activeMats[i] then + activeMats.current = i + rendering.spSetMaterialLastLOD(objectID, "opaque", i) + return + end + end + + --// none material active + rendering.activeMats[objectID] = nil + rendering.spSetMaterialLastLOD(objectID, "opaque", 0) + SetLODCount(rendering, objectID, 0) + end +end + +function Spring.UnitRendering.SetLODCount(unitID, lod_count) + SetLODCount(unitRendering, unitID, lod_count) +end + +function Spring.UnitRendering.GetLODCount(unitID) + return GetLODCount(unitRendering, unitID) +end + +function Spring.UnitRendering.ActivateMaterial(unitID, lod) + ActivateMaterial(unitRendering, unitID, lod) +end + +function Spring.UnitRendering.DeactivateMaterial(unitID, lod) + DeactivateMaterial(unitRendering, unitID, lod) +end + +function Spring.FeatureRendering.SetLODCount(featureID, lod_count) + SetLODCount(featureRendering, featureID, lod_count) +end + +function Spring.FeatureRendering.GetLODCount(featureID) + return GetLODCount(featureRendering, featureID) +end + +function Spring.FeatureRendering.ActivateMaterial(featureID, lod) + ActivateMaterial(featureRendering, featureID, lod) +end + +function Spring.FeatureRendering.DeactivateMaterial(featureID, lod) + DeactivateMaterial(featureRendering, featureID, lod) +end + +end \ No newline at end of file diff --git a/LuaRules/Utilities/versionCompare.lua b/LuaRules/Utilities/versionCompare.lua new file mode 100644 index 000000000..8fcfdd141 --- /dev/null +++ b/LuaRules/Utilities/versionCompare.lua @@ -0,0 +1,32 @@ +function Spring.Utilities.IsCurrentVersionNewerThan(rel, dev) + -- Argument example, .0.1--g5072695 + local thisVersion = (Game and Game.version) or (Engine and Engine.version) or "Engine version error" + local thisRel, thisDev + local i = 1 + for word in thisVersion:gmatch("[^%-]+") do + if i == 1 then + local j = 1 + for subword in word:gmatch("[^%.]+") do + if j == 1 then + thisRel = tonumber(subword) + if thisRel then + if thisRel < rel then + return false + end + if thisRel > rel then + return true + end + end + end + j = j + 1 + end + elseif i == 2 then + thisDev = tonumber(word) + if thisDev then + return thisDev > dev + end + end + i = i + 1 + end + return false -- A newer version would not fail to return before now +end diff --git a/LuaRules/callins.lua b/LuaRules/callins.lua index 248641759..256e07a61 100644 --- a/LuaRules/callins.lua +++ b/LuaRules/callins.lua @@ -1,4 +1,3 @@ --- $Id: callins.lua 3171 2008-11-06 09:06:29Z det $ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -9,79 +8,181 @@ -- Copyright (C) 2007. -- Licensed under the terms of the GNU GPL, v2 or later. -- +-- functions listed here are reserved and not allowed to be RegisterGlobal()'ed +-- they are set to 'nil' if not used by any gadget, see gadgetHandler:UpdateCallIn -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -CallInsList = { - - "Shutdown", - "LayoutButtons", - "ConfigureLayout", - "CommandNotify", - - "KeyPress", - "KeyRelease", - "MouseMove", - "MousePress", - "MouseRelease", - "IsAbove", - "GetTooltip", - "AddConsoleLine", - "GroupChanged", - - "GameOver", - "TeamDied", - - "UnitCreated", - "UnitFinished", - "UnitFromFactory", - "UnitDestroyed", - "UnitTaken", - "UnitGiven", - "UnitIdle", - "UnitSeismicPing", - "UnitEnteredRadar", - "UnitEnteredLos", - "UnitLeftRadar", - "UnitLeftLos", - "UnitLoaded", - "UnitUnloaded", - - "FeatureCreated", - "FeatureDestroyed", - - "DrawWorld", - "DrawWorldPreUnit", - "DrawWorldShadow", - "DrawWorldReflection", - "DrawWorldRefraction", - "DrawScreenEffects", - "DrawScreen", - "DrawInMiniMap", - - "Explosion", - "ShockFront", - - "GameFrame", - "CobCallback", - "AllowCommand", - "CommandFallback", - "AllowUnitCreation", - "AllowUnitTransfer", - "AllowUnitBuildStep", - "AllowFeatureCreation", - "AllowFeatureBuildStep", - "AllowResourceLevel", - "AllowResourceTransfer", -} +CALLIN_MAP = {} +CALLIN_LIST = { + -- Save/Load + "Save", + "Load", + -- called when Lua is disabled or this client exits + "Shutdown", --- make the map -CallInsMap = {} -for _, callin in ipairs(CallInsList) do - CallInsMap[callin] = true -end + -- game callins + "GameSetup", + "GamePreload", + "GameStart", + "GameOver", + "GameFrame", + "GamePaused", + "GameProgress", + "GameID", + -- player callins + "PlayerChanged", + "PlayerAdded", + "PlayerRemoved", + + -- team callins + "TeamDied", + "TeamChanged", + + -- unit callins + "UnitCreated", + "UnitFinished", + "UnitFromFactory", + "UnitReverseBuilt", + "UnitDestroyed", + "RenderUnitDestroyed", + "UnitExperience", + "UnitIdle", + "UnitCmdDone", + "UnitPreDamaged", + "UnitDamaged", + "UnitStunned", + "UnitTaken", + "UnitGiven", + "UnitEnteredRadar", + "UnitEnteredLos", + "UnitLeftRadar", + "UnitLeftLos", + "UnitSeismicPing", + "UnitLoaded", + "UnitUnloaded", + "UnitCloaked", + "UnitDecloaked", + "UnitUnitCollision", + "UnitFeatureCollision", + "UnitMoveFailed", + "UnitMoved", -- FIXME: not exposed to Lua yet (as of 95.0) + "UnitEnteredAir", -- FIXME: not implemented by base GH + "UnitLeftAir", -- FIXME: not implemented by base GH + "UnitEnteredWater", -- FIXME: not implemented by base GH + "UnitLeftWater", -- FIXME: not implemented by base GH + "UnitCommand", + + -- weapon callins + "StockpileChanged", + + -- feature callins + "FeatureCreated", + "FeatureDestroyed", + "FeatureDamaged", + "FeatureMoved", -- FIXME: not exposed to Lua yet (as of 95.0) + "FeaturePreDamaged", + + -- projectile callins + "ProjectileCreated", + "ProjectileDestroyed", + + -- shield callins + "ShieldPreDamaged", + + -- misc synced LuaRules callins + "AllowCommand", + "AllowStartPosition", + "AllowUnitCreation", + "AllowUnitTransfer", + "AllowUnitBuildStep", + "AllowFeatureBuildStep", + "AllowFeatureCreation", + "AllowResourceLevel", + "AllowResourceTransfer", + "AllowDirectUnitControl", + "AllowBuilderHoldFire", + "AllowWeaponTargetCheck", + "AllowWeaponTarget", + "AllowWeaponInterceptTarget", + + "Explosion", + "CommandFallback", + "MoveCtrlNotify", + "TerraformComplete", + + -- synced message callins + "GotChatMsg", + "RecvLuaMsg", + + -- unsynced callins + "Update", + "UnsyncedHeightMapUpdate", -- FIXME: not implemented by base GH + + "DrawGenesis", + "DrawWorld", + "DrawWorldPreUnit", + "DrawWorldShadow", + "DrawWorldReflection", + "DrawWorldRefraction", + "DrawGroundPreForward", + "DrawGroundPreDeferred", + "DrawGroundPostDeferred", + "DrawUnitsPostDeferred", + "DrawFeaturesPostDeferred", + "DrawScreenEffects", + "DrawScreen", + "DrawInMiniMap", + + "SunChanged", + + "DrawUnit", + "DrawFeature", + "DrawShield", + "DrawProjectile", + + -- unsynced message callins + "RecvFromSynced", + "RecvSkirmishAIMessage", + + "DefaultCommand", + "CommandNotify", + + "ViewResize", -- FIXME ? + "LayoutButtons", + "ConfigureLayout", + + "AddConsoleLine", + "GroupChanged", + + -- moved from LuaUI + "KeyPress", + "KeyRelease", + "TextInput", + "MousePress", + "MouseRelease", + "MouseMove", + "MouseWheel", + + "IsAbove", + "GetTooltip", + + "WorldTooltip", -- FIXME: not implemented by base GH + "MapDrawCmd", + "ShockFront", -- FIXME: not implemented by base GH + + "DownloadQueued", + "DownloadStarted", + "DownloadFinished", + "DownloadFailed", + "DownloadProgress", +} + +for callinIdx, callinName in ipairs(CALLIN_LIST) do + CALLIN_MAP[callinName] = callinIdx +end -------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaRules/draw.lua b/LuaRules/draw.lua index 7f2880ce9..11535da0a 100644 --- a/LuaRules/draw.lua +++ b/LuaRules/draw.lua @@ -62,4 +62,4 @@ else Spring.Echo("LUARULES-DRAW (GADGETS) -- DEVMODE") end -end +end \ No newline at end of file diff --git a/LuaRules/factions.lua b/LuaRules/factions.lua index 5d16a4e74..d870400cf 100644 --- a/LuaRules/factions.lua +++ b/LuaRules/factions.lua @@ -35,27 +35,9 @@ local function AddFaction(ud,faction,scaned) end ---[[ for i,sideData in ipairs(sides) do AddFaction(UnitDefNames[sideData.startUnit],sideData.sideName,{}) end ---]] - - -AddFaction(UnitDefNames['ecommander'],'outer_colonies',{}) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -for udid,udef in ipairs(UnitDefs) do - if ((#udef.factions)==0) then - local lowname = udef.name:lower() - if (lowname:sub(1,3)=='cor') then - AddFaction(udef,'core',{}) - elseif (lowname:sub(1,3)=='arm') then - AddFaction(udef,'arm',{}) - elseif (lowname:sub(1,5)=='chick') then - AddFaction(udef,'chicken',{}) - end - end -end diff --git a/LuaRules/gadgets.lua b/LuaRules/gadgets.lua index 3f5759e0e..b77dd30fb 100644 --- a/LuaRules/gadgets.lua +++ b/LuaRules/gadgets.lua @@ -19,12 +19,8 @@ -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -local SAFEWRAP = 0 --- 0: disabled --- 1: enabled, but can be overriden by gadget.GetInfo().unsafe --- 2: always enabled - +local HANDLER_BASENAME = "gadgets.lua" +local isMission = VFS.FileExists("mission.lua") -- or Game.gameName:find("Scenario Editor") local HANDLER_DIR = 'LuaGadgets/' local GADGETS_DIR = Script.GetName():gsub('US$', '') .. '/Gadgets/' @@ -36,30 +32,29 @@ if (Spring.IsDevLuaEnabled()) then VFSMODE = VFS.RAW_ONLY end - VFS.Include(HANDLER_DIR .. 'setupdefs.lua', nil, VFSMODE) VFS.Include(HANDLER_DIR .. 'system.lua', nil, VFSMODE) VFS.Include(HANDLER_DIR .. 'callins.lua', nil, VFSMODE) VFS.Include(SCRIPT_DIR .. 'utilities.lua', nil, VFSMODE) -local CallInsList = CALLIN_LIST; -local CallInsMap = CALLIN_MAP; - local actionHandler = VFS.Include(HANDLER_DIR .. 'actions.lua', nil, VFSMODE) -local HANDLER_BASENAME = "gadgets.lua" - --------------------------------------------------------------------------------- - -function pgl() -- (print gadget list) FIXME: move this into a gadget - for k,v in ipairs(gadgetHandler.gadgets) do - Spring.Echo( - string.format("%3i %3i %s", k, v.ghInfo.layer, v.ghInfo.name) - ) - end +local modOptions = Spring.GetModOptions() +if not modOptions.startmetal then -- load via file + local raw = VFS.Include("modoptions.lua", nil, VFS.ZIP) + for i, v in ipairs(raw) do + if v.type ~= "section" then + modOptions[v.key] = v.def + end + end + raw = VFS.Include("engineoptions.lua", nil, VFS.ZIP) + for i, v in ipairs(raw) do + if v.type ~= "section" then + modOptions[v.key:lower()] = v.def + end + end end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -88,13 +83,161 @@ gadgetHandler = { yViewSizeOld = 1, mouseOwner = nil, - + actionHandler = actionHandler, -- FIXME: not in base } + +-- these call-ins are set to 'nil' if not used +-- they are setup in UpdateCallIns() +local callInLists = { + "Shutdown", + + "GamePreload", + "GameStart", + "GameOver", + "GameID", + "TeamDied", + + "PlayerAdded", + "PlayerChanged", + "PlayerRemoved", + + "GameFrame", + + "ViewResize", -- FIXME ? + + "TextCommand", -- FIXME ? + "GotChatMsg", + "RecvLuaMsg", + + -- Unit CallIns + "UnitCreated", + "UnitFinished", + "UnitReverseBuilt", + "UnitFromFactory", + "UnitDestroyed", + "RenderUnitDestroyed", + "UnitExperience", + "UnitIdle", + "UnitCmdDone", + "UnitPreDamaged", + "UnitDamaged", + "UnitStunned", + "UnitTaken", + "UnitGiven", + "UnitEnteredRadar", + "UnitEnteredLos", + "UnitLeftRadar", + "UnitLeftLos", + "UnitSeismicPing", + "UnitLoaded", + "UnitUnloaded", + "UnitCloaked", + "UnitDecloaked", + -- optional + -- "UnitUnitCollision", + -- "UnitFeatureCollision", + -- "UnitMoveFailed", + "StockpileChanged", + + -- Feature CallIns + "FeatureCreated", + "FeatureDestroyed", + + -- Projectile CallIns + "ProjectileCreated", + "ProjectileDestroyed", + + -- Shield CallIns + "ShieldPreDamaged", + + -- Misc Synced CallIns + "Explosion", + + -- LuaRules CallIns (note: the *PreDamaged calls belong here too) + "CommandFallback", + "AllowCommand", + "AllowStartPosition", + "AllowUnitCreation", + "AllowUnitTransfer", + "AllowUnitBuildStep", + "AllowUnitTransport", + "AllowUnitTransportLoad", + "AllowUnitTransportUnload", + "AllowUnitCloak", + "AllowUnitDecloak", + "AllowUnitTargetRange", + "AllowFeatureBuildStep", + "AllowFeatureCreation", + "AllowResourceLevel", + "AllowResourceTransfer", + "AllowDirectUnitControl", + "AllowBuilderHoldFire", + "MoveCtrlNotify", + "TerraformComplete", + "AllowWeaponTargetCheck", + "AllowWeaponTarget", + "AllowWeaponInterceptTarget", + -- unsynced + "DrawUnit", + "DrawFeature", + "DrawShield", + "DrawProjectile", + "RecvSkirmishAIMessage", + + -- COB CallIn (FIXME?) + "CobCallback", + + -- Unsynced CallIns + "Update", + "DefaultCommand", + "DrawGenesis", + "DrawWorld", + "DrawWorldPreUnit", + "DrawWorldShadow", + "DrawWorldReflection", + "DrawWorldRefraction", + "DrawScreenEffects", + "DrawScreenPost", + "DrawScreen", + "DrawInMiniMap", + "RecvFromSynced", + + -- moved from LuaUI + "KeyPress", + "KeyRelease", + "MousePress", + "MouseRelease", + "MouseMove", + "MouseWheel", + "IsAbove", + "GetTooltip", + + -- FIXME -- not implemented (more of these?) + "WorldTooltip", + "MapDrawCmd", + "GameSetup", + "DefaultCommand", + + -- Save/Load + "Save", + "Load", + + -- FIXME: NOT IN BASE + "UnitCommand", + "UnitEnteredWater", + "UnitEnteredAir", + "UnitLeftWater", + "UnitLeftAir", + + "UnsyncedHeightMapUpdate" +} + + -- initialize the call-in lists do - for _,listname in ipairs(CallInsList) do + for _,listname in ipairs(callInLists) do gadgetHandler[listname .. 'List'] = {} end end @@ -107,26 +250,6 @@ local function IsSyncedCode() end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Reverse integer iterator for drawing --- - -local function rev_iter(t, key) - if (key <= 1) then - return nil - else - local nkey = key - 1 - return nkey, t[nkey] - end -end - -local function ripairs(t) - return rev_iter, t, (1 + #t) -end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- @@ -209,7 +332,8 @@ function gadgetHandler:LoadGadget(filename) local gadget = gadgetHandler:NewGadget() setfenv(chunk, gadget) - local success, err = pcall(chunk) + local success + success, err = pcall(chunk) if (not success) then Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') return nil @@ -284,7 +408,8 @@ function gadgetHandler:NewGadget() -- wrapped calls (closures) gadget.gadgetHandler = {} local gh = gadget.gadgetHandler - local self = self + + gh.gadgetHandler = self -- NOT IN BASE (required for api_subdir_gadgets) gadget.include = function (f) return VFS.Include(f, gadget, VFSMODE) @@ -390,51 +515,6 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local function SafeWrap(func, funcName) - local gh = gadgetHandler - return function(g, ...) - local r = { pcall(func, g, ...) } - if (r[1]) then - table.remove(r, 1) - return unpack(r) - else - if (funcName ~= 'Shutdown') then - gadgetHandler:RemoveGadget(g) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Error in Shutdown') - end - local name = g.ghInfo.name - Spring.Echo(r[2]) - Spring.Echo('Removed gadget: ' .. name) - return nil - end - end -end - - -local function SafeWrapGadget(gadget) - if (SAFEWRAP <= 0) then - return - elseif (SAFEWRAP == 1) then - if (gadget.GetInfo and gadget.GetInfo().unsafe) then - Spring.Echo('LuaUI: loaded unsafe gadget: ' .. gadget.ghInfo.name) - return - end - end - - for _,ciName in ipairs(CallInsList) do - if (gadget[ciName]) then - gadget[ciName] = SafeWrap(gadget[ciName], ciName) - end - if (gadget.Initialize) then - gadget.Initialize = SafeWrap(gadget.Initialize, 'Initialize') - end - end -end - - --------------------------------------------------------------------------------- - local function ArrayInsert(t, f, g) if (f) then local layer = g.ghInfo.layer @@ -468,7 +548,7 @@ function gadgetHandler:InsertGadget(gadget) end ArrayInsert(self.gadgets, true, gadget) - for _,listname in ipairs(CallInsList) do + for _,listname in ipairs(callInLists) do local func = gadget[listname] if (type(func) == 'function') then ArrayInsert(self[listname..'List'], func, gadget) @@ -490,14 +570,15 @@ function gadgetHandler:RemoveGadget(gadget) local name = gadget.ghInfo.name self.knownGadgets[name].active = false + --Spring.Echo(name) if (gadget.Shutdown) then - gadget:Shutdown() + gadget:Shutdown() end ArrayRemove(self.gadgets, gadget) self:RemoveGadgetGlobals(gadget) actionHandler.RemoveGadgetActions(gadget) - for _,listname in ipairs(CallInsList) do + for _,listname in ipairs(callInLists) do ArrayRemove(self[listname..'List'], gadget) end @@ -559,7 +640,7 @@ end function gadgetHandler:UpdateCallIns() - for _,name in ipairs(CallInsList) do + for _,name in ipairs(callInLists) do self:UpdateCallIn(name) end end @@ -660,7 +741,7 @@ function gadgetHandler:RaiseGadget(gadget) end end Raise(self.gadgets, true, gadget) - for _,listname in ipairs(CallInsList) do + for _,listname in ipairs(callInLists) do Raise(self[listname..'List'], gadget[listname], gadget) end end @@ -692,7 +773,7 @@ function gadgetHandler:LowerGadget(gadget) end end Lower(self.gadgets, true, gadget) - for _,listname in ipairs(CallInsList) do + for _,listname in ipairs(callInLists) do Lower(self[listname..'List'], gadget[listname], gadget) end end @@ -721,7 +802,7 @@ function gadgetHandler:RegisterGlobal(owner, name, value) if ((name == nil) or (_G[name]) or (self.globals[name]) or - (CallInsMap[name])) then + ((CallInsMap and CallInsMap[name]) or (CALLIN_MAP and CALLIN_MAP[name]))) then return false end _G[name] = value @@ -782,25 +863,25 @@ end function gadgetHandler:RegisterCMDID(gadget, id) - if (id < 30000) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a CMD_ID < 30000') - Script.Kill('Bad CMD_ID code: ' .. id) - end - if (id >= 40000) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a CMD_ID >= 40000') - Script.Kill('Bad CMD_ID code: ' .. id) - end - if (self.CMDIDs[id] ~= nil) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a duplicated CMD_ID') - Script.Kill('Duplicate CMD_ID code: ' .. id) - end - self.CMDIDs[id] = gadget -end + if not id then + Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Gadget (' .. gadget.ghInfo.name .. ') ' .. + 'tried to register a NIL CMD_ID') + else + if (id < 1000) then + Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Gadget (' .. gadget.ghInfo.name .. ') ' .. + 'tried to register a reserved CMD_ID') + Script.Kill('Reserved CMD_ID code: ' .. id) + end + if (self.CMDIDs[id] ~= nil) then + Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Gadget (' .. gadget.ghInfo.name .. ') ' .. + 'tried to register a duplicated CMD_ID') + Script.Kill('Duplicate CMD_ID code: ' .. id) + end + self.CMDIDs[id] = gadget + end +end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -823,9 +904,13 @@ function gadgetHandler:GameStart() end function gadgetHandler:Shutdown() + Spring.Echo("Start gadgetHandler:Shutdown") for _,g in ipairs(self.ShutdownList) do - g:Shutdown() + local name = g.ghInfo.name or "UNKNOWN NAME" + Spring.Echo("Shutdown - " .. name) + g:Shutdown() end + Spring.Echo("End gadgetHandler:Shutdown") return end @@ -850,44 +935,40 @@ function gadgetHandler:RecvFromSynced(...) end -function gadgetHandler:GotChatMsg(msg, player) - if ((player == 0) and Spring.IsCheatingEnabled()) then - local sp = '^%s*' -- start pattern - local ep = '%s+(.*)' -- end pattern - local s, e, match - s, e, match = string.find(msg, sp..'togglegadget'..ep) - if (match) then - self:ToggleGadget(match) - return true - end - s, e, match = string.find(msg, sp..'enablegadget'..ep) - if (match) then - self:EnableGadget(match) - return true - end - s, e, match = string.find(msg, sp..'disablegadget'..ep) - if (match) then - self:DisableGadget(match) - return true - end - end - - if (actionHandler.GotChatMsg(msg, player)) then - return true - end - - for _,g in ipairs(self.GotChatMsgList) do - if (g:GotChatMsg(msg, player)) then - return true - end - end - - if (IsSyncedCode()) then - SendToUnsynced(player, msg) - end - - return false -end +--function gadgetHandler:GotChatMsg(msg, player) +-- if ((player == 0) and Spring.IsCheatingEnabled()) then +-- local sp = '^%s*' -- start pattern +-- local ep = '%s+(.*)' -- end pattern +-- local s, e, match +-- s, e, match = string.find(msg, sp..'togglegadget'..ep) +-- if (match) then +-- self:ToggleGadget(match) +-- return true +-- end +-- s, e, match = string.find(msg, sp..'enablegadget'..ep) +-- if (match) then +-- self:EnableGadget(match) +-- return true +-- end +-- s, e, match = string.find(msg, sp..'disablegadget'..ep) +-- if (match) then +-- self:DisableGadget(match) +-- return true +-- end +-- end +-- +-- if (actionHandler.GotChatMsg(msg, player)) then +-- return true +-- end +-- +-- for _,g in ipairs(self.GotChatMsgList) do +-- if (g:GotChatMsg(msg, player)) then +-- return true +-- end +-- end +-- +-- return false +--end function gadgetHandler:RecvLuaMsg(msg, player) @@ -931,9 +1012,9 @@ end -- Game call-ins -- -function gadgetHandler:GameOver() +function gadgetHandler:GameOver(winners) for _,g in ipairs(self.GameOverList) do - g:GameOver() + g:GameOver(winners) end return end @@ -953,6 +1034,27 @@ function gadgetHandler:TeamDied(teamID) return end +function gadgetHandler:PlayerAdded(playerID) + for _,g in ipairs(self.PlayerAddedList) do + g:PlayerAdded(playerID) + end + return +end + +function gadgetHandler:PlayerChanged(playerID) + for _,g in ipairs(self.PlayerChangedList) do + g:PlayerChanged(playerID) + end + return +end + +function gadgetHandler:PlayerRemoved(playerID, reason) + for _,g in ipairs(self.PlayerRemovedList) do + g:PlayerRemoved(playerID, reason) + end + return +end + -------------------------------------------------------------------------------- -- @@ -986,6 +1088,15 @@ function gadgetHandler:DrawShield(unitID, weaponID, drawMode) return false end +function gadgetHandler:DrawProjectile(projectileID, drawMode) + for _,g in ipairs(self.DrawProjectileList) do + if (g:DrawProjectile(projectileID, drawMode)) then + return true + end + end + return false +end + function gadgetHandler:RecvSkirmishAIMessage(aiTeam, dataStr) for _,g in ipairs(self.RecvSkirmishAIMessageList) do local dataRet = g:RecvSkirmishAIMessage(aiTeam, dataStr) @@ -1012,7 +1123,8 @@ end function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced) for _,g in ipairs(self.AllowCommandList) do - if (not g:AllowCommand(unitID, unitDefID, unitTeam, + + if (not g:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced)) then return false end @@ -1020,6 +1132,14 @@ function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, return true end +function gadgetHandler:AllowStartPosition(playerID, teamID, readyState, cx, cy, cz, rx, ry, rz) + for _,g in ipairs(self.AllowStartPositionList) do + if (not g:AllowStartPosition(playerID, teamID, readyState, cx, cy, cz, rx, ry, rz)) then + return false + end + end + return true +end function gadgetHandler:AllowUnitCreation(unitDefID, builderID, builderTeam, x, y, z, facing) @@ -1056,6 +1176,77 @@ function gadgetHandler:AllowUnitBuildStep(builderID, builderTeam, return true end +function gadgetHandler:AllowUnitTransport( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam +) + for _,g in ipairs(self.AllowUnitTransportList) do + if (not g:AllowUnitTransport( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam + )) then + return false + end + end + return true +end + +function gadgetHandler:AllowUnitTransportLoad( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam, + loadPosX, loadPosY, loadPosZ +) + for _,g in ipairs(self.AllowUnitTransportLoadList) do + if (not g:AllowUnitTransportLoad( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam, + loadPosX, loadPosY, loadPosZ + )) then + return false + end + end + return true +end + +function gadgetHandler:AllowUnitTransportUnload( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam, + unloadPosX, unloadPosY, unloadPosZ +) + for _,g in ipairs(self.AllowUnitTransportUnloadList) do + if (not g:AllowUnitTransportUnload( + transporterID, transporterUnitDefID, transporterTeam, + transporteeID, transporteeUnitDefID, transporteeTeam, + unloadPosX, unloadPosY, unloadPosZ + )) then + return false + end + end + return true +end + +function gadgetHandler:AllowUnitCloak(unitID, enemyID) + -- The case can be that unitID == enemyID. This is for engine stunned unitID, they are their own enemies. + for _,g in ipairs(self.AllowUnitCloakList) do + if (not g:AllowUnitCloak(unitID, enemyID)) then + return false + end + end + + return true +end + + +function gadgetHandler:AllowUnitDecloak(unitID, objectID, weaponID) + for _,g in ipairs(self.AllowUnitDecloakList) do + if (not g:AllowUnitDecloak(unitID, objectID, weaponID)) then + return false + end + end + + return true +end + function gadgetHandler:AllowFeatureBuildStep(builderID, builderTeam, featureID, featureDefID, part) @@ -1110,6 +1301,15 @@ function gadgetHandler:AllowDirectUnitControl(unitID, unitDefID, unitTeam, return true end +function gadgetHandler:AllowBuilderHoldFire(unitID, unitDefID, action) + for _,g in ipairs(self.AllowBuilderHoldFireList) do + if (not g:AllowBuilderHoldFire(unitID, unitDefID, action)) then + return false + end + end + return true +end + function gadgetHandler:MoveCtrlNotify(unitID, unitDefID, unitTeam, data) local state = false @@ -1144,12 +1344,34 @@ function gadgetHandler:AllowWeaponTargetCheck(attackerID, attackerWeaponNum, att return true end +-- AllowWeaponTarget is also called when auto-generating CAI attack commands. +-- When targetID=-1 and weaponNum=-1 targetPriority determines the target search +-- radius; targetPriority=nil accompanies any actual + function gadgetHandler:AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority) local allowed = true - local priority = defPriority + local returnValue + + if targetID == -1 then + local unitID = attackerID + local aquireRange = defPriority + for _, g in ipairs(self.AllowUnitTargetRangeList) do + -- Send priority to each successive gadget. + local targetAllowed, newRange = g:AllowUnitTargetRange(unitID, aquireRange) + if (not targetAllowed) then + allowed = false + break + end + + aquireRange = newRange + end + return true, aquireRange + end + + local priority = defPriority for _, g in ipairs(self.AllowWeaponTargetList) do - -- Send priority to each sucessive gadget. + -- Send priority to each successive gadget. local targetAllowed, targetPriority = g:AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, priority) if (not targetAllowed) then @@ -1159,30 +1381,66 @@ function gadgetHandler:AllowWeaponTarget(attackerID, targetID, attackerWeaponNum priority = targetPriority end - return allowed, priority end +function gadgetHandler:AllowWeaponInterceptTarget(interceptorUnitID, interceptorWeaponNum, targetProjectileID) + for _, g in ipairs(self.AllowWeaponInterceptTargetList) do + if (not g:AllowWeaponInterceptTarget(interceptorUnitID, interceptorWeaponNum, targetProjectileID)) then + return false + end + end + + return true +end + -------------------------------------------------------------------------------- -- -- Unit call-ins -- +local inCreated = false +local finishedDuringCreated = false -- assumes non-recursive create function gadgetHandler:UnitCreated(unitID, unitDefID, unitTeam, builderID) + + finishedDuringCreated = false + inCreated = true for _,g in ipairs(self.UnitCreatedList) do g:UnitCreated(unitID, unitDefID, unitTeam, builderID) end - return -end + inCreated = false + if finishedDuringCreated then + finishedDuringCreated = false + gadgetHandler:UnitFinished(unitID, unitDefID, unitTeam) + end +end function gadgetHandler:UnitFinished(unitID, unitDefID, unitTeam) + if inCreated then + finishedDuringCreated = true + return + end + for _,g in ipairs(self.UnitFinishedList) do g:UnitFinished(unitID, unitDefID, unitTeam) end return end +function gadgetHandler:UnitReverseBuilt(unitID, unitDefID, unitTeam) + for _,g in ipairs(self.UnitReverseBuiltList) do + g:UnitReverseBuilt(unitID, unitDefID, unitTeam) + end + return +end + +function gadgetHandler:UnitStunned(unitID, unitDefID, unitTeam, stunned) + for _,g in ipairs(self.UnitStunnedList) do + g:UnitStunned(unitID, unitDefID, unitTeam, stunned) + end + return +end function gadgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) @@ -1195,7 +1453,8 @@ end function gadgetHandler:UnitDestroyed(unitID, unitDefID, unitTeam, - attackerID, attackerDefID, attackerTeam) + attackerID, attackerDefID, attackerTeam, pre) + if pre == false then return end for _,g in ipairs(self.UnitDestroyedList) do g:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) @@ -1204,6 +1463,14 @@ function gadgetHandler:UnitDestroyed(unitID, unitDefID, unitTeam, end +function gadgetHandler:RenderUnitDestroyed(unitID, unitDefID, unitTeam) + for _,g in ipairs(self.RenderUnitDestroyedList) do + g:RenderUnitDestroyed(unitID, unitDefID, unitTeam) + end + return +end + + function gadgetHandler:UnitExperience(unitID, unitDefID, unitTeam, experience, oldExperience) for _,g in ipairs(self.UnitExperienceList) do @@ -1221,24 +1488,83 @@ function gadgetHandler:UnitIdle(unitID, unitDefID, unitTeam) end -function gadgetHandler:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdTag) +function gadgetHandler:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) for _,g in ipairs(self.UnitCmdDoneList) do - g:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdTag) + g:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) end return end +local UnitPreDamaged_GadgetMap = {} +local UnitPreDamaged_first = true +local allWeaponDefs = {} + +do + for i=-7,#WeaponDefs do + allWeaponDefs[#allWeaponDefs+1] = i + end +end function gadgetHandler:UnitPreDamaged(unitID, unitDefID, unitTeam, - damage, paralyzer, weaponDefID, projectileID, - attackerID, attackerDefID, attackerTeam) + damage, paralyzer, weaponDefID, + projectileID, attackerID, attackerDefID, attackerTeam) + + if UnitPreDamaged_first then + for _,g in ipairs(self.UnitPreDamagedList) do + local weaponDefs = (g.UnitPreDamaged_GetWantedWeaponDef and g:UnitPreDamaged_GetWantedWeaponDef()) or allWeaponDefs + for _,wdid in ipairs(weaponDefs) do + if UnitPreDamaged_GadgetMap[wdid] then + UnitPreDamaged_GadgetMap[wdid].count = UnitPreDamaged_GadgetMap[wdid].count + 1 + UnitPreDamaged_GadgetMap[wdid].data[UnitPreDamaged_GadgetMap[wdid].count] = g + else + UnitPreDamaged_GadgetMap[wdid] = { + count = 1, + data = {g} + } + end + end + end + UnitPreDamaged_first = false + end + + local rDam = damage + local rImp = 1.0 + + local gadgets = UnitPreDamaged_GadgetMap[weaponDefID] + if gadgets then + local data = gadgets.data + local g + for i = 1, gadgets.count do + g = data[i] + local dam, imp = g:UnitPreDamaged(unitID, unitDefID, unitTeam, + rDam, paralyzer, weaponDefID, + attackerID, attackerDefID, attackerTeam, + projectileID) + if (dam ~= nil) then + rDam = dam + end + if (imp ~= nil) then + rImp = math.min(imp, rImp) + end + end + end + + return rDam, rImp +end + +--[[ Old +function gadgetHandler:UnitPreDamaged(unitID, unitDefID, unitTeam, + damage, paralyzer, weaponDefID, + projectileID, attackerID, attackerDefID, attackerTeam) + local rDam = damage local rImp = 1.0 for _,g in ipairs(self.UnitPreDamagedList) do dam, imp = g:UnitPreDamaged(unitID, unitDefID, unitTeam, rDam, paralyzer, weaponDefID, - attackerID, attackerDefID, attackerTeam,projectileID) + attackerID, attackerDefID, attackerTeam, + projectileID) if (dam ~= nil) then rDam = dam end @@ -1249,11 +1575,39 @@ function gadgetHandler:UnitPreDamaged(unitID, unitDefID, unitTeam, return rDam, rImp end +--]] + +local UnitDamaged_first = true +local UnitDamaged_count = 0 +local UnitDamaged_gadgets = {} + +function gadgetHandler:UnitDamaged(unitID, unitDefID, unitTeam, + damage, paralyzer, weaponID, projectileID, + attackerID, attackerDefID, attackerTeam) + + if UnitDamaged_first then + for _,g in ipairs(self.UnitDamagedList) do + UnitDamaged_count = UnitDamaged_count + 1 + UnitDamaged_gadgets[UnitDamaged_count] = g + end + UnitDamaged_first = false + end + local g + for i = 1, UnitDamaged_count do + g = UnitDamaged_gadgets[i] + g:UnitDamaged(unitID, unitDefID, unitTeam, + damage, paralyzer, weaponID, + attackerID, attackerDefID, attackerTeam) + end + return +end +--[[ Old function gadgetHandler:UnitDamaged(unitID, unitDefID, unitTeam, - damage, paralyzer, weaponID, + damage, paralyzer, weaponID, projectileID, attackerID, attackerDefID, attackerTeam) + for _,g in ipairs(self.UnitDamagedList) do g:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponID, @@ -1261,6 +1615,7 @@ function gadgetHandler:UnitDamaged(unitID, unitDefID, unitTeam, end return end +--]] function gadgetHandler:UnitTaken(unitID, unitDefID, unitTeam, newTeam) @@ -1427,11 +1782,11 @@ end -- Shield call-ins -- -function gadgetHandler:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile) +function gadgetHandler:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ) for _,g in ipairs(self.ShieldPreDamagedList) do -- first gadget to handle this consumes the event - if (g:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile)) then + if (g:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ)) then return true end end @@ -1445,33 +1800,87 @@ end -- Misc call-ins -- +local Explosion_GadgetMap = {} +local Explosion_GadgetSingle = {} + +local Explosion_first = true + +function gadgetHandler:Explosion(weaponID, px, py, pz, ownerID, proID) + if Explosion_first then + for _,g in ipairs(self.ExplosionList) do + local weaponDefs = (g.Explosion_GetWantedWeaponDef and g:Explosion_GetWantedWeaponDef()) or allWeaponDefs + for _,wdid in ipairs(weaponDefs) do + if Explosion_GadgetSingle[wdid] or Explosion_GadgetMap[wdid] then + if Explosion_GadgetMap[wdid] then + Explosion_GadgetMap[wdid].count = Explosion_GadgetMap[wdid].count + 1 + Explosion_GadgetMap[wdid].data[Explosion_GadgetMap[wdid].count] = g + else + Explosion_GadgetMap[wdid] = { + count = 2, + data = {Explosion_GadgetSingle[wdid], g} + } + Explosion_GadgetSingle[wdid] = nil + end + else + Explosion_GadgetSingle[wdid] = g + end + end + end + Explosion_first = false + end + + local noGfx = false + local single = Explosion_GadgetSingle[weaponID] + local map = Explosion_GadgetMap[weaponID] + if single then + noGfx = single:Explosion(weaponID, px, py, pz, ownerID, proID) + elseif map then + local gadgets = map + local data = gadgets.data + local g + for i = 1, gadgets.count do + g = data[i] + noGfx = noGfx or g:Explosion(weaponID, px, py, pz, ownerID, proID) + end + end + return noGfx or false +end + +--[[ Base function gadgetHandler:Explosion(weaponID, px, py, pz, ownerID) local noGfx = false for _,g in ipairs(self.ExplosionList) do - noGfx = noGfx or g:Explosion(weaponID, px, py, pz, ownerID) + noGfx = noGfx or g:Explosion(weaponID, px, py, pz, ownerID) end return noGfx end - +--]] -------------------------------------------------------------------------------- -- -- Draw call-ins -- -function gadgetHandler:Update() +function gadgetHandler:SunChanged() + for _,g in ipairs(self.SunChangedList) do + g:SunChanged() + end + return +end + +function gadgetHandler:Update(deltaTime) for _,g in ipairs(self.UpdateList) do - g:Update() + g:Update(deltaTime) end return end -function gadgetHandler:DefaultCommand(type, id) +function gadgetHandler:DefaultCommand(type, id, engineCmd) for _,g in ipairs(self.DefaultCommandList) do - local id = g:DefaultCommand(type, id) - if (id) then - return id + local defCmd = g:DefaultCommand(type, id, engineCmd) + if defCmd then + return defCmd end end return @@ -1533,6 +1942,13 @@ function gadgetHandler:DrawScreenEffects(vsx, vsy) return end +function gadgetHandler:DrawScreenPost(vsx, vsy) + for _,g in ipairs(self.DrawScreenPostList) do + g:DrawScreenPost(vsx, vsy) + end + return +end + function gadgetHandler:DrawScreen(vsx, vsy) for _,g in ipairs(self.DrawScreenList) do @@ -1674,127 +2090,33 @@ end -- OVERRIDES -- -function gadgetHandler:NewGadget() - local gadget = {} - -- load the system calls into the gadget table - for k,v in pairs(System) do - gadget[k] = v - end - gadget._G = _G -- the global table - gadget.GG = self.GG -- the shared table - gadget.gadget = gadget -- easy self referencing - - -- wrapped calls (closures) - gadget.gadgetHandler = {} - local gh = gadget.gadgetHandler - local self = self - - gh.gadgetHandler = self -- FIXME: not in base - - gadget.include = function (f) - return VFS.Include(f, gadget, VFSMODE) - end - - gh.RaiseGadget = function (_) self:RaiseGadget(gadget) end - gh.LowerGadget = function (_) self:LowerGadget(gadget) end - gh.RemoveGadget = function (_) self:RemoveGadget(gadget) end - gh.GetViewSizes = function (_) return self:GetViewSizes() end - gh.GetHourTimer = function (_) return self:GetHourTimer() end - gh.IsSyncedCode = function (_) return IsSyncedCode() end - - gh.UpdateCallIn = function (_, name) - self:UpdateGadgetCallIn(name, gadget) - end - gh.RemoveCallIn = function (_, name) - self:RemoveGadgetCallIn(name, gadget) - end - - gh.RegisterCMDID = function(_, id) - self:RegisterCMDID(gadget, id) - end - - gh.RegisterGlobal = function(_, name, value) - return self:RegisterGlobal(gadget, name, value) - end - gh.DeregisterGlobal = function(_, name) - return self:DeregisterGlobal(gadget, name) - end - gh.SetGlobal = function(_, name, value) - return self:SetGlobal(gadget, name, value) - end - - gh.AddChatAction = function (_, cmd, func, help) - return actionHandler.AddChatAction(gadget, cmd, func, help) - end - gh.RemoveChatAction = function (_, cmd) - return actionHandler.RemoveChatAction(gadget, cmd) - end - - if (not IsSyncedCode()) then - gh.AddSyncAction = function(_, cmd, func, help) - return actionHandler.AddSyncAction(gadget, cmd, func, help) - end - gh.RemoveSyncAction = function(_, cmd) - return actionHandler.RemoveSyncAction(gadget, cmd) - end - end - - return gadget -end - function gadgetHandler:GetViewSizes() --FIXME remove return gl.GetViewSizes() -- ours --return self.xViewSize, self.yViewSize -- base end -function gadgetHandler:RegisterCMDID(gadget, id) - if (id < 30000) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a CMD_ID < 30000') - Script.Kill('Bad CMD_ID code: ' .. id) - end - if (id >= 40000) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register a CMD_ID >= 40000') - Script.Kill('Bad CMD_ID code: ' .. id) - end - if (self.CMDIDs[id] ~= nil) then - Spring.Echo('Gadget (' .. gadget.ghInfo.name .. ') ' .. - 'tried to register an already used CMD_ID') -- ours --- 'tried to register a CMD_ID >= 40000') -- base - Script.Kill('Duplicate CMD_ID code: ' .. id) - end - self.CMDIDs[id] = gadget -end +local AllowCommand_WantedCommand = {} +local AllowCommand_WantedUnitDefID = {} -function gadgetHandler:AllowResourceTransfer(oldTeam, newTeam, type, amount) -- ours ---function gadgetHandler:AllowResourceTransfer(teamID, res, level) -- base - for _,g in ipairs(self.AllowResourceTransferList) do - if (not g:AllowResourceTransfer(oldTeam, newTeam, type, amount)) then -- ours - --if (not g:AllowResourceTransfer(teamID, res, level)) then -- base - return false - end - end - return true -end - ---function gadgetHandler:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) -- ours -function gadgetHandler:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) -- base - for _,g in ipairs(self.CommandFallbackList) do - --local used, remove = g:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions) -- ours - local used, remove = g:CommandFallback(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag) -- base - if (used) then - return remove - end - end - return true -- remove the command -end - -function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions,fromSynced) -- ours +function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced) -- ours --function gadgetHandler:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced) -- base for _,g in ipairs(self.AllowCommandList) do - if (not g:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, fromSynced)) then -- ours + if not AllowCommand_WantedCommand[g] then + AllowCommand_WantedCommand[g] = (g.AllowCommand_GetWantedCommand and g:AllowCommand_GetWantedCommand()) or true + end + if not AllowCommand_WantedUnitDefID[g] then + AllowCommand_WantedUnitDefID[g] = (g.AllowCommand_GetWantedUnitDefID and g:AllowCommand_GetWantedUnitDefID()) or true + end + local wantedCommand = AllowCommand_WantedCommand[g] + local wantedUnitDefID = AllowCommand_WantedUnitDefID[g] + + --if g:GetBadCommand() then + -- Spring.Echo(g:GetBadCommand()) + --end + if ((wantedCommand == true) or wantedCommand[cmdID]) and + ((wantedUnitDefID == true) or wantedUnitDefID[unitDefID]) and + (not g:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced)) then -- ours --if (not g:AllowCommand(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced)) then -- base return false end @@ -1836,6 +2158,7 @@ end --]] function gadgetHandler:GotChatMsg(msg, player) + if (((player == 0) or (player == 255)) and Spring.IsCheatingEnabled()) then -- ours --if ((player == 0) and Spring.IsCheatingEnabled()) then -- base local sp = '^%s*' -- start pattern @@ -1854,7 +2177,7 @@ function gadgetHandler:GotChatMsg(msg, player) s, e, match = string.find(msg, sp..'disablegadget'..ep) if (match) then self:DisableGadget(match) - return true + return false end end @@ -1868,10 +2191,6 @@ function gadgetHandler:GotChatMsg(msg, player) end end - if (IsSyncedCode()) then - SendToUnsynced("proxy_ChatMsg", msg, player) -- ours - --SendToUnsynced(player, msg) -- base - end return false end @@ -1917,7 +2236,7 @@ end function gadgetHandler:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams) -- opts is a bitmask for _,g in ipairs(self.UnitCommandList) do - g:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams) + g:UnitCommand(unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams) end return end @@ -1963,8 +2282,19 @@ function gadgetHandler:GameSetup(state, ready, playerStates) return false end +--[[ +-- makes available to gadgets with handler = true +function gadgetHandler:AddSyncAction(gadget, cmd, func, help) + return actionHandler.AddSyncAction(gadget, cmd, func, help) +end + +function gadgetHandler:RemoveSyncAction(gadget, cmd) + return actionHandler.RemoveSyncAction(gadget, cmd) +end +]] -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- gadgetHandler:Initialize() + diff --git a/LuaRules/main.lua b/LuaRules/main.lua index 163ad545e..c176d1fcb 100644 --- a/LuaRules/main.lua +++ b/LuaRules/main.lua @@ -1,4 +1,3 @@ if AllowUnsafeChanges then AllowUnsafeChanges("USE AT YOUR OWN PERIL") end -VFS.Include("LuaRules/gadgets.lua") - +VFS.Include("LuaRules/gadgets.lua") \ No newline at end of file diff --git a/LuaUI/Configs/EVO_HotkeyInfo.lua b/LuaUI/Configs/EVO_HotkeyInfo.lua new file mode 100644 index 000000000..a114cf065 --- /dev/null +++ b/LuaUI/Configs/EVO_HotkeyInfo.lua @@ -0,0 +1,109 @@ +General = { + {"Chat", title=true}, + {"enter", "Send chat message"}, + {"alt + enter", "Send chat message to allies"}, + {"shift + enter", "Send chat message to spectators"}, + {"ctrl + left click on name", "Ignore player"}, + {blankLine=true}, + {"Menus", title=true}, + {"shift + esc", "Quit menu"}, + {"f11", "Widget list"}, + {"ctrl + f11", "Widget teak mode"}, + {"h", "Share units / resources"}, + {blankLine=true}, + {"Camera movement", title=true}, + {"scrollwheel", "Zoom camera"}, + {"arrow keys / mouse at screen edge", "Move camera"}, + {"ctrl + scrollwheel", "Change camera angle"}, + {"middle click (+ drag)", "Drag camera"}, + {"ctrl + shift + o", "Flip camera"}, + {blankLine=true}, + {"Camera modes", title=true}, + {"ctrl + f1,2,3,4,5", "Change camera type"}, + {"alt + backspace", "Toggle fullscreen"}, + {"tab", "Toggle overview camera"}, + {"l", "Toggle LOS view"}, + {"f1", "Show height map"}, + {"f2", "Show passability (for selected unit)"}, + {"f3", "Cycle through map marks"}, + {"f4", "Show metal map"}, + {"f5", "Hide GUI"}, + {blankLine=true}, + {"Sound", title=true}, + {"-/+", "Change volume"}, + {"f6", "Toggle mute"}, +} + +Units_I_II = { + {"Selecting units", title=true}, + {"left mouse (+ drag)", "Select or deselect units"}, + {blankLine=true}, + {"Giving orders", title=true}, + {"right mouse (single click)", "Give order to unit(s)"}, + {"right mouse (drag)", "Give formation order to unit(s)"}, + {blankLine=true}, + {"Selecting orders", title=true}, + {"(none)", "default order (usually move)"}, + {"q", "Toggle Repeat"}, + {"m", "move"}, + {"a", "attack"}, + -- {"y", "set priority target"}, + {"r", "repair"}, + -- {"e", "reclaim"}, + -- {"o", "resurrect"}, + {"f", "fight"}, + {"p", "patrol"}, + {"k", "cloak"}, + {blankLine=true}, + {"s", "stop (clears order queue)"}, + {"w", "wait (pause current command)"}, + {"j", "cancel priority target"}, + {blankLine=true}, + {"d", "manual fire (dgun)"}, + {"ctrl + d", "self-destruct"}, + {blankLine=true}, + {"Giving selected orders", title=true}, + {"left mouse (single click)", "Give order to unit(s)"}, + {"right mouse (single click)", "Revert to default order"}, + {"right mouse + drag", "Give formation order to unit(s)"}, + {blankLine=true}, + {"Queueing orders", title=true}, + {"shift + (some order)", "Add order to end of order queue"}, + {"space + (some order)", "Add order to start of order queue"}, +} + + +Units_III = { + {"Selecting build orders", title=true}, + {"(mouse)", "Select from units build-menu"}, + -- {"z", "Cycle through mexes"}, + -- {"x", "Cycle through energy production"}, + -- {"c", "Cycle through radar/defence/etc"}, + -- {"v", "Cycle through factories"}, + {"[ and ]", "Change facing of buildings"}, + {blankLine=true}, + {"Giving build orders", title=true}, + {"left mouse", "Give build order"}, + {"right mouse", "De-select build order"}, + {"shift + (build order)", "Build in a line"}, + {"shift + alt + (build order)", "Build in a square"}, + {"b", "Increase build spacing"}, + {"n", "Decrease build spacing"}, + {blankLine=true}, + {"Group selection", title=true}, + {"ctrl + a", "Select all units"}, + {"ctrl + b", "Select all constructors"}, + {"ctrl + (num)", "Add units to group (num=1,2,..)"}, + {"(num)", "Select all units assigned to group (num)"}, + {"ctrl + z", "Select all units of same type as current"}, + {blankLine=true}, + {"Drawing", title=true}, + {"q + dbl click", "Place map mark"}, + {"q + drag left mouse", "Draw on map"}, + {"q + drag right mouse","Erase drawings and markers"}, + {blankLine=true}, + {"Console commands", title=true}, + {"/clearmapmarks", "Erase all drawings and markes"}, + {"/clock", "Toggle ingame clock"}, + {"/fps", "Toggle ingame fps indicator"}, +} diff --git a/LuaUI/Configs/LuaMex/options.lua b/LuaUI/Configs/LuaMex/options.lua new file mode 100644 index 000000000..948d0d75e --- /dev/null +++ b/LuaUI/Configs/LuaMex/options.lua @@ -0,0 +1,64 @@ +options = { + + drawincome = { + name = 'Should income be drawn below the mex spot?', + type = 'bool', + value = true, + tooltip = "When disabled, this will prevent income from being drawn below the mex spot.", + OnChange = function() updateMexDrawList() end + }, + drawcustomincomeamount = { + name = 'Draw a custom mex income amount under each spot instead of the automatically calculated one?', + type = 'bool', + value = false, + tooltip = "Enabled, this will allow you to draw a custom amount underneath each mex spot.", + OnChange = function() updateMexDrawList() end + }, + drawicons = { + name = 'Show Income as Icon', + type = 'bool', + value = false, + tooltip = "When enabled income is shown pictorially. When disabled income is shown as a number.", + OnChange = function() updateMexDrawList() end + }, + size = { + name = "Income Display Size", + type = "number", + value = 50, + min = 10, + max = 150, + step = 5, + OnChange = function() updateMexDrawList() end + }, + rounding = { + name = "Display digits", + type = "number", + value = 1, + min = 1, + max = 4, + advanced = true, + OnChange = function() updateMexDrawList() end + }, + multiplier = { + name = "Multiplier used for base mex value", + type = "number", + value = 1, -- Most games will use 1 for this value as most games base mex income around a mex giving 2.0. Please note that changing this value only changes the number visually displayed underneath the mex spot. The actual multiplier is determined in the mex unitdef customparam "metal_extractor = ," + min = 0, + max = 100, + OnChange = function() updateMexDrawList() end + }, + customamount = { + name = "Custom amount to be drawn under each mex", + type = "number", + value = 0.5, + min = 0, + max = 100, + OnChange = function() updateMexDrawList() end + }, + specPlayerColours = { + name = "Use player colours when spectating", + type = "bool", + value = true, + OnChange = function() updateMexDrawList() end + } +} \ No newline at end of file diff --git a/LuaUI/Configs/evo_buildHotkeysConfig.lua b/LuaUI/Configs/evo_buildHotkeysConfig.lua new file mode 100644 index 000000000..64a5c4a2c --- /dev/null +++ b/LuaUI/Configs/evo_buildHotkeysConfig.lua @@ -0,0 +1,102 @@ +local a = 97 +local b = 98 +local c = 99 +local d = 100 +local e = 101 +local f = 102 +local g = 103 +local h = 104 +local i = 105 +local j = 106 +local k = 107 +local l = 108 +local m = 109 +local n = 110 +local o = 111 +local p = 112 +local q = 113 +local r = 114 +local s = 115 +local t = 116 +local u = 117 +local v = 118 +local w = 119 +local x = 120 +local y = 121 +local z = 122 + +nameToKeyCode = { + ehbotfac = {f, b}, + eminifac = {f, t}, + ebasefactory = {f, h}, + eamphibfac = {f, a}, + eairplant = {f, p}, + f1landfac = {f, l}, + f2landfac = {f, l}, + + etech1 = {b, t}, + emetalextractor = {e, m}, + esolar2 = {e, s}, + egeothermal = {e, g}, + efusion2 = {e, f}, + estorage = {e, d}, + + eradar2 = {b, r}, + ejammer2 = {b, j}, + ekmar = {b, k}, + emine = {v, m}, + elightturret2 = {v, p}, + eheavyturret2 = {v, i}, + elaserbattery = {v, b}, + eartyturret = {v, l}, + eshieldgen = {v, a}, + esilo = {v, s}, + escoutdrone = {b, d}, + ebox = {b, x}, + ehbotengineer = {b, e}, + fedengineer = {b, e}, + lozengineer = {b, e}, + eorb = {b, o}, + ecommander = {v, o}, + + -- HBots + ehbotpeewee = {q}, + ehbotthud = {w}, + ehbotsniper = {e}, + ehbotrocko = {r}, + ehbotkarganneth = {t}, + + -- ATs + eallterrlight = {q}, + eallterrriot = {w}, + eallterrmed = {e}, + eallterrheavy = {r}, + eallterrassault = {t}, + eallterranarchid = {y}, + eallterrshield = {u}, + + -- Hovers + elighttank3 = {q}, + eriottank2 = {w}, + eheavytank3 = {e}, + emissiletank = {r}, + eartytank = {t}, + elacerator = {y}, + + -- Amphibious + eamphibbuggy = {q}, + eamphibriot = {w}, + eamphibneedle = {e}, + eamphibmedtank = {r}, + eamphibrock = {t}, + eamphibarty = {y}, + eamphibleveler = {u}, + + -- Air + efighter = {q}, + egunship2 = {w}, + ebomber = {e}, + eairemp = {r}, + etransport = {t}, + ekrow = {y}, +} diff --git a/LuaUI/Configs/integral_menu_commands.lua b/LuaUI/Configs/integral_menu_commands.lua deleted file mode 100644 index e842c3a80..000000000 --- a/LuaUI/Configs/integral_menu_commands.lua +++ /dev/null @@ -1,316 +0,0 @@ -VFS.Include("LuaRules/Configs/customcmds.h.lua") - ---FIXME: use this table until state tooltip detection is fixed -local tooltips = { - priority = "Priority: Set construction priority (low, normal, high)", - miscpriority = "Misc Priority: Set priority for morph or stockpile (low, normal, high)", - retreat = "Retreat: Retreat to closest retreat point at 30/60/90% of health (right-click to disable)", - landat = "Repair level: set the HP % at which this aircraft will go to a repair pad (0, 30, 50, 80)", - factoryGuard = "Auto Assist: Newly built constructors automatically assist their factory", - diveBomb = "\255\90\255\90Green\255\255\255\255:Dive For Shielded Target\n\255\255\255\90Yellow\255\255\255\255:Dive For All Target\n\255\255\90\90Red\255\255\255\255:Always Fly Low\n\255\90\90\90Grey\255\255\255\255:Always Fly High", --override tooltip supplied by unit_bomber_dive.lua gadget. - floatState = "\255\90\255\90Green\255\255\255\255:Always float \n\255\90\90\90Grey\255\255\255\255:Float to fire\n\255\255\90\90Red\255\255\255\255:Never float", - fireState = "Fire State: Sets under what conditions a unit will fire without an explicit attack order (never, when attacked, always)", - moveState = "Move State: Sets how far out of its way a unit will move to attack enemies", - ["repeat"] = "Repeat: if on the unit will continously push finished orders to the end of its order queue", -} - -local factories = { - ebasefactory = {order = 1}, - eamphibfac = {order = 2}, - eminifac = {order = 3}, - eairplant = {order = 4}, - eexperimentalfac = {order = 5}, -} - ---Integral menu is NON-ROBUST ---all buildings (except facs) need a row or they won't appear! ---you can put too many things into the same row, but the buttons will be squished -local econ = { - emetalextractor = {order = 1, row = 1}, - esolar2 = {order = 2, row = 1}, - egeothermal = {order = 3, row = 1}, - efusion2 = {order = 4, row = 1}, - emaker = {order = 1, row = 2}, - estorage = {order = 2, row = 2}, -} - -local defense = { - elightturret2 = {order = 0, row = 1}, - eheavyturret2 = {order = 1, row = 1}, - euwturret = {order = 2, row = 1}, - eaaturret = {order = 3, row = 1}, - emine = {order = 4, row = 1}, - ekmar = {order = 0, row = 2}, - eshieldgen = {order = 1, row = 2}, -} - -local aux = { --merged into special - eorb = {order = 0, row = 1}, - ecommander = {order = 1, row = 1}, - eradar2 = {order = 0, row = 2}, - ejammer2 = {order = 1, row = 2}, -} - -local super = { --merged into special - elrpc = {order = 0, row = 2}, - esilo = {order = 1, row = 2}, -} - ---manual entries not needed; menu has autodetection -local common_commands = {} -local states_commands = {} - -local factory_commands = {} -local econ_commands = {} -local defense_commands = {} -local special_commands = { - -- [CMD_RAMP] = {order = 16, row = 3}, - -- [CMD_LEVEL] = {order = 17, row = 3}, - -- [CMD_RAISE] = {order = 18, row = 3}, - -- [CMD_RESTORE] = {order = 19, row = 3}, - -- [CMD_SMOOTH] = {order = 20, row = 3}, - --[CMD_BUMPY] = {order = 21, row = 3}, -} - -local function CopyBuildArray(source, target) - for name, value in pairs(source) do - udef = (UnitDefNames[name]) - if udef then - target[-udef.id] = value - end - end -end - -CopyBuildArray(factories, factory_commands) -CopyBuildArray(econ, econ_commands) -CopyBuildArray(aux, special_commands) -CopyBuildArray(defense, defense_commands) -CopyBuildArray(super, special_commands) - --- Global commands defined here - they have cmdDesc format + -local globalCommands = { ---[[ { - name = "crap", - texture= 'LuaUi/Images/move_hold.png', - id = math.huge, - OnClick = {function() - Spring.SendMessage("crap") - end } - } - { - id = CMD_RETREAT_ZONE - type = CMDTYPE.ICON_MAP, - tooltip = 'Place a retreat zone. Units will retreat there. Constructors placed in it will repair units.', - cursor = 'Repair', - action = 'sethaven', - params = { }, - texture = 'LuaUI/Images/ambulance.png', - }]]-- -} - --- Command overrides. State commands by default expect array of textures, one for each state. --- You can specify texture, text,tooltip, color -local imageDir = 'LuaUI/Images/commands/' - ---[[ -local overrides = { - [CMD.ATTACK] = { texture = imageDir .. 'attack.png', text= '\255\0\255\0A\008ttack'}, - [CMD.STOP] = { texture = imageDir .. 'cancel.png', color={1,0,0,1.2}, text= '\255\0\255\0S\008top'}, - [CMD.FIGHT] = { texture = imageDir .. 'fight.png',text= '\255\0\255\0F\008ight'}, - [CMD.GUARD] = { texture = imageDir .. 'guard.png', text= '\255\0\255\0G\008uard'}, - [CMD.MOVE] = { texture = imageDir .. 'move.png', text= '\255\0\255\0M\008ove'}, - [CMD.PATROL] = { texture = imageDir .. 'patrol.png', text= '\255\0\255\0P\008atrol'}, - [CMD.WAIT] = { texture = imageDir .. 'wait.png', text= '\255\0\255\0W\008ait'}, - - [CMD.REPAIR] = {text= '\255\0\255\0R\008epair', texture = imageDir .. 'repair.png'}, - [CMD.RECLAIM] = {text= 'R\255\0\255\0e\008claim', texture = imageDir .. 'reclaim.png'}, - [CMD.RESURRECT] = {text= 'Resurrec\255\0\255\0t\008', texture = imageDir .. 'resurrect.png'}, - [CMD_BUILD] = {text = '\255\0\255\0B\008uild'}, - [CMD.DGUN] = { texture = imageDir .. 'dgun.png', text= '\255\0\255\0D\008Gun'}, - - [CMD_RAMP] = {text = 'Ramp', texture = imageDir .. 'ramp.png'}, - [CMD_LEVEL] = {text = 'Level', texture = imageDir .. 'level.png'}, - [CMD_RAISE] = {text = 'Raise', texture = imageDir .. 'raise.png'}, - [CMD_SMOOTH] = {text = 'Smooth', texture = imageDir .. 'smooth.png'}, - [CMD_RESTORE] = {text = 'Restore', texture = imageDir .. 'restore.png'}, - - [CMD_AREA_MEX] = {text = 'Mex', texture = 'LuaUi/Images/ibeam.png'}, - [CMD_JUMP] = {text = 'Jump', texture = imageDir .. 'Bold/jump.png'}, - - [CMD.ONOFF] = { texture = {imageDir .. 'states/off.png', imageDir .. 'states/on.png'}, text=''}, - [CMD_UNIT_AI] = { texture = {imageDir .. 'states/bulb_off.png', imageDir .. 'states/bulb_on.png'}, text=''}, - [CMD.REPEAT] = { texture = {imageDir .. 'states/repeat_off.png', imageDir .. 'states/repeat_on.png'}, text=''}, - [CMD.CLOAK] = { texture = {imageDir .. 'states/cloak_off.png', imageDir .. 'states/cloak_on.png'}, text ='', tooltip = 'Unit cloaking state - press \255\0\255\0K\008 to toggle'}, - [CMD_CLOAK_SHIELD] = { texture = {imageDir .. 'states/areacloak_off.png', imageDir .. 'states/areacloak_on.png'}, text ='',}, - [CMD_STEALTH] = { texture = {imageDir .. 'states/stealth_off.png', imageDir .. 'states/stealth_on.png'}, text ='', }, - [CMD_PRIORITY] = { texture = {imageDir .. 'states/wrench_low.png', imageDir .. 'states/wrench_med.png', imageDir .. 'states/wrench_high.png'}, text='', tooltip = tooltips.priority}, - [CMD.MOVE_STATE] = { texture = {imageDir .. 'states/move_hold.png', imageDir .. 'states/move_engage.png', imageDir .. 'states/move_roam.png'}, text=''}, - [CMD.FIRE_STATE] = { texture = {imageDir .. 'states/fire_hold.png', imageDir .. 'states/fire_return.png', imageDir .. 'states/fire_atwill.png'}, text=''}, - [CMD_RETREAT] = { texture = {imageDir .. 'states/retreat_off.png', imageDir .. 'states/retreat_30.png', imageDir .. 'states/retreat_60.png', imageDir .. 'states/retreat_90.png'}, text=''}, -}]] - -local overrides = { - [CMD.ATTACK] = { texture = imageDir .. 'Bold/attack.png'}, - [CMD.STOP] = { texture = imageDir .. 'Bold/cancel.png'}, - [CMD.FIGHT] = { texture = imageDir .. 'Bold/fight.png'}, - [CMD.GUARD] = { texture = imageDir .. 'Bold/guard.png'}, - [CMD.MOVE] = { texture = imageDir .. 'Bold/move.png'}, - [CMD.PATROL] = { texture = imageDir .. 'Bold/patrol.png'}, - [CMD.WAIT] = { texture = imageDir .. 'Bold/wait.png'}, - [CMD.CAPTURE] = { texture = imageDir .. 'Bold/capture.png'}, - - [CMD.REPAIR] = {texture = imageDir .. 'Bold/repair.png'}, - [CMD.RECLAIM] = {texture = imageDir .. 'Bold/reclaim.png'}, - [CMD.RESURRECT] = {texture = imageDir .. 'Bold/resurrect.png'}, - [CMD_BUILD] = {texture = imageDir .. 'Bold/build.png'}, - [CMD.MANUALFIRE] = { texture = imageDir .. 'Bold/dgun.png'}, - - [CMD.LOAD_UNITS] = { texture = imageDir .. 'Bold/load.png'}, - [CMD.UNLOAD_UNITS] = { texture = imageDir .. 'Bold/unload.png'}, - [CMD.AREA_ATTACK] = { texture = imageDir .. 'Bold/areaattack.png'}, - - [CMD_RAMP] = {texture = imageDir .. 'ramp.png'}, - [CMD_LEVEL] = {texture = imageDir .. 'level.png'}, - [CMD_RAISE] = {texture = imageDir .. 'raise.png'}, - [CMD_SMOOTH] = {texture = imageDir .. 'smooth.png'}, - [CMD_RESTORE] = {texture = imageDir .. 'restore.png'}, - [CMD_BUMPY] = {texture = imageDir .. 'bumpy.png'}, - - [CMD_AREA_GUARD] = { texture = imageDir .. 'Bold/guard.png'}, - - [CMD_AREA_MEX] = {text = ' ', texture = imageDir .. 'Bold/mex.png'}, - - [CMD_JUMP] = {texture = imageDir .. 'Bold/jump.png'}, - - [CMD_FIND_PAD] = {text = ' ', texture = imageDir .. 'Bold/rearm.png'}, - - [CMD_EMBARK] = {text = ' ', texture = imageDir .. 'Bold/embark.png'}, - [CMD_DISEMBARK] = {text = ' ', texture = imageDir .. 'Bold/disembark.png'}, - - [CMD_ONECLICK_WEAPON] = {},--texture = imageDir .. 'Bold/action.png'}, - [CMD_UNIT_SET_TARGET_CIRCLE] = {text='', texture = imageDir .. 'Bold/settarget.png'}, - [CMD_UNIT_CANCEL_TARGET] = {text='', texture = imageDir .. 'Bold/canceltarget.png'}, - - [CMD_ABANDON_PW] = {text= '', texture = 'LuaUI/Images/Crystal_Clear_action_flag_white.png'}, - - [CMD_PLACE_BEACON] = {text= '', texture = imageDir .. 'Bold/drop_beacon.png'}, - - -- states - [CMD.ONOFF] = { texture = {imageDir .. 'states/off.png', imageDir .. 'states/on.png'}, text=''}, - [CMD_UNIT_AI] = { texture = {imageDir .. 'states/bulb_off.png', imageDir .. 'states/bulb_on.png'}, text=''}, - [CMD.REPEAT] = { texture = {imageDir .. 'states/repeat_off.png', imageDir .. 'states/repeat_on.png'}, text='', tooltip = tooltips["repeat"]}, - [CMD.CLOAK] = { texture = {imageDir .. 'states/cloak_off.png', imageDir .. 'states/cloak_on.png'}, - text ='', tooltip = 'Unit cloaking state - press \255\0\255\0K\008 to toggle'}, - [CMD_WANT_CLOAK] = { texture = {imageDir .. 'states/cloak_off.png', imageDir .. 'states/cloak_on.png'}, - text ='', tooltip = 'Unit cloaking state - press \255\0\255\0K\008 to toggle'}, - [CMD_CLOAK_SHIELD] = { texture = {imageDir .. 'states/areacloak_off.png', imageDir .. 'states/areacloak_on.png'}, - text ='', tooltip = 'Area Cloaker State'}, - [CMD_STEALTH] = { texture = {imageDir .. 'states/stealth_off.png', imageDir .. 'states/stealth_on.png'}, text ='', }, - [CMD_PRIORITY] = { texture = {imageDir .. 'states/wrench_low.png', imageDir .. 'states/wrench_med.png', imageDir .. 'states/wrench_high.png'}, - text='', tooltip = tooltips.priority}, - [CMD_MISC_PRIORITY] = { texture = {imageDir .. 'states/wrench_low_other.png', imageDir .. 'states/wrench_med_other.png', imageDir .. 'states/wrench_high_other.png'}, - text='', tooltip = tooltips.miscpriority}, - [CMD_FACTORY_GUARD] = { texture = {imageDir .. 'states/autoassist_off.png', imageDir .. 'states/autoassist_on.png'}, - text='', tooltip = tooltips.factoryGuard,}, - [CMD.MOVE_STATE] = { texture = {imageDir .. 'states/move_hold.png', imageDir .. 'states/move_engage.png', imageDir .. 'states/move_roam.png'}, text='', tooltip = tooltips.moveState}, - [CMD.FIRE_STATE] = { texture = {imageDir .. 'states/fire_hold.png', imageDir .. 'states/fire_return.png', imageDir .. 'states/fire_atwill.png'}, text='', tooltip = tooltips.fireState}, - [CMD_RETREAT] = { texture = {imageDir .. 'states/retreat_off.png', imageDir .. 'states/retreat_30.png', imageDir .. 'states/retreat_60.png', imageDir .. 'states/retreat_90.png'}, - text='', tooltip = tooltips.retreat,}, - [CMD.IDLEMODE] = { texture = {imageDir .. 'states/fly_on.png', imageDir .. 'states/fly_off.png'}, text=''}, - [CMD_AP_FLY_STATE] = { texture = {imageDir .. 'states/fly_on.png', imageDir .. 'states/fly_off.png'}, text=''}, - [CMD.AUTOREPAIRLEVEL] = { texture = {imageDir .. 'states/landat_off.png', imageDir .. 'states/landat_30.png', imageDir .. 'states/landat_50.png', imageDir .. 'states/landat_80.png'}, - text = '', tooltip = tooltips.landat,}, - [CMD_AP_AUTOREPAIRLEVEL] = { texture = {imageDir .. 'states/landat_off.png', imageDir .. 'states/landat_30.png', imageDir .. 'states/landat_50.png', imageDir .. 'states/landat_80.png'}, - text = ''}, - [CMD_UNIT_BOMBER_DIVE_STATE] = { texture = {imageDir .. 'states/divebomb_off.png', imageDir .. 'states/divebomb_shield.png', imageDir .. 'states/divebomb_attack.png', imageDir .. 'states/divebomb_always.png'}, - text = '', tooltip = tooltips.diveBomb}, - [CMD_UNIT_KILL_SUBORDINATES] = {texture = {imageDir .. 'states/capturekill_off.png', imageDir .. 'states/capturekill_on.png'}, text=''}, - [CMD_DONT_FIRE_AT_RADAR] = {texture = {imageDir .. 'states/stealth_on.png', imageDir .. 'states/stealth_off.png'}, text=''}, - [CMD.TRAJECTORY] = { texture = {imageDir .. 'states/traj_low.png', imageDir .. 'states/traj_high.png'}, text=''}, - [CMD_AIR_STRAFE] = { texture = {imageDir .. 'states/strafe_off.png', imageDir .. 'states/strafe_on.png'}, text=''}, - [CMD_UNIT_FLOAT_STATE] = { texture = {imageDir .. 'states/amph_sink.png', imageDir .. 'states/amph_attack.png', imageDir .. 'states/amph_float.png'}, text='', tooltip=tooltips.floatState}, - } - --- noone really knows what this table does but it's needed for epic menu to get the hotkey -local custom_cmd_actions = { - -- states are 2, targeted commands (e.g. attack) are 1, instant commands (e.g. selfd) are 3 - -- can (probably) set to 1 instead of 3 if order doesn't need to be queueable - --SPRING COMMANDS - selfd=3, - attack=1, - stop=3, - fight=1, - guard=1, - move=1, - patrol=1, - wait=3, - repair=1, - reclaim=1, - resurrect=1, - manualfire=1, - loadunits=1, - unloadunits=1, - areaattack=1, - - -- states - onoff=2, - ['repeat']=2, - cloak=2, - movestate=2, - firestate=2, - idlemode=2, - autorepairlevel=2, - - - --CUSTOM COMMANDS - sethaven=1, - --build=1, - areamex=1, - areaguard=1, - mine=1, - build=1, - jump=1, - find_pad=3, - embark=3, - disembark=3, - oneclickwep=3, - settarget=1, - settargetcircle=1, - canceltarget=3, - setferry=1, - radialmenu=3, - placebeacon=1, - buildprev=1, - - -- terraform - rampground=1, - levelground=1, - raiseground=1, - smoothground=1, - restoreground=1, - --terraform_internal=1, - - resetfire=3, - resetmove=3, - - --states --- stealth=2, --no longer applicable - cloak_shield=2, - retreat=2, - ['luaui noretreat']=2, - priority=2, - miscpriority=2, - ap_fly_state=2, - ap_autorepairlevel=2, - floatstate=2, - dontfireatradar=2, - antinukezone=2, - unitai=2, - unit_kill_subordinates=2, - autoassist=2, - airstrafe=2, - divestate=2, -} - - -return common_commands, states_commands, factory_commands, econ_commands, defense_commands, special_commands, globalCommands, overrides, custom_cmd_actions \ No newline at end of file diff --git a/LuaUI/Configs/lupsfxs.lua b/LuaUI/Configs/lupsfxs.lua index 696280c03..eba7f9461 100644 --- a/LuaUI/Configs/lupsfxs.lua +++ b/LuaUI/Configs/lupsfxs.lua @@ -161,21 +161,129 @@ cafusBursts = { corjamtBursts = { layer = -35, life = math.huge, - piece = "sphere", - rotSpeed = 0.7, + piece = "base", + rotSpeed = 1, rotSpread = 0, arc = 50, arcSpread = 0, - size = 14, - sizeSpread = 10, + size = 200, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {0, 0, 1, 0.25} }, + directional= true, + repeatEffect = true, + count = 20, +} + +shieldBursts200 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 200, + sizeSpread = 50, texture = "bitmaps/GPL/Lups/shieldbursts5.png", --colormap = { {1, 0.6, 1, 0.8} }, - colormap = { {1, 0.3, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, directional= true, repeatEffect = true, count = 20, } +shieldBursts300 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 300, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, + directional= true, + repeatEffect = true, + count = 20, +} + +shieldBursts400 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 400, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, + directional= true, + repeatEffect = true, + count = 20, +} + +shieldBursts1000 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 1000, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, + directional= true, + repeatEffect = true, + count = 10, +} + +shieldBursts1500 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 1500, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, + directional= true, + repeatEffect = true, + count = 10, +} + +shieldBursts2000 = { + layer = -35, + life = math.huge, + piece = "base", + rotSpeed = 0.50, + rotSpread = 0, + arc = 50, + arcSpread = 0, + size = 2000, + sizeSpread = 50, + texture = "bitmaps/GPL/Lups/shieldbursts5.png", + --colormap = { {1, 0.6, 1, 0.8} }, + colormap = { {1, 1, 1, 0.1} }, + directional= true, + repeatEffect = true, + count = 10, +} + ---------------------------------------------------------------------------- -- COLORSPHERES ------------------------------------------------------------ ---------------------------------------------------------------------------- @@ -192,10 +300,10 @@ cafusShieldSphere = { efusShieldSphere = { layer=-35, life=20, - pos={0,51,0}, - size=10, - colormap1 = { {0.9, 0.9, 1, 0.2},{0.9, 0.9, 1, 0.2},{0.9, 0.9, 1, 0.2},{0.9, 0.9, 1, 0.2} }, - colormap2 = { {0.2, 0.2, 1, 0.2},{0.2, 0.2, 1, 0.2},{0.2, 0.2, 1, 0.2},{0.2, 0.2, 1, 0.2} }, + pos={0,20,0}, + size=400, + colormap1 = { {0.9, 0.9, 1, 0.1},{0.9, 0.9, 1, 0.1},{0.9, 0.9, 1, 0.1},{0.9, 0.9, 1, 0.1} }, + colormap2 = { {0.2, 0.2, 1, 0.1},{0.2, 0.2, 1, 0.1},{0.2, 0.2, 1, 0.1},{0.2, 0.2, 1, 0.1} }, repeatEffect=true } @@ -209,6 +317,66 @@ corfusShieldSphere = { repeatEffect=true } +ShieldSphere200 = { + layer=-34, + life=20, + pos={0,20,0}, + size=200, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + +ShieldSphere300 = { + layer=-34, + life=20, + pos={0,20,0}, + size=300, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + +ShieldSphere400 = { + layer=-34, + life=20, + pos={0,20,0}, + size=400, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + +ShieldSphere1000 = { + layer=-34, + life=20, + pos={0,60,0}, + size=1000, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + +ShieldSphere1500 = { + layer=-34, + life=20, + pos={0,60,0}, + size=1500, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + +ShieldSphere2000 = { + layer=-34, + life=20, + pos={0,60,0}, + size=2000, + colormap1 = { {0, 0, 1, 0.2} }, + colormap2 = { {0.2, 0.2, 1, 0.0} }, + repeatEffect=true +} + ---------------------------------------------------------------------------- -- LIGHT ------------------------------------------------------------------- ---------------------------------------------------------------------------- diff --git a/LuaUI/Configs/lupsunitfxs.lua b/LuaUI/Configs/lupsunitfxs.lua index 9ade376de..4a0845921 100644 --- a/LuaUI/Configs/lupsunitfxs.lua +++ b/LuaUI/Configs/lupsunitfxs.lua @@ -1,6 +1,107 @@ effectUnitDefs = { +------------------ +------------------ + escoutdrone = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=40, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=40, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=40, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=40, piece="rengine2", onActive=true}}, + }, efighter = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine4", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="rengine2", onActive=true}}, + }, + + egunship2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=50, piece="rengine2", onActive=true}}, + }, + + ebomber = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=100, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=100, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=100, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=100, piece="rengine2", onActive=true}}, + }, + + eairengineer = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + escout = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="rengine2", onActive=true}}, + }, + + eraider = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, + }, + + eairemp = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=70, piece="rengine2", onActive=true}}, + }, + + ekrow = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine2", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine3", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine4", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine5", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine6", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine7", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=120, piece="engine8", onActive=true, emitVector = {0, 1, 0}}}, + }, + + eairplant = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=false, emitVector = {0, 0, 1}}}, + }, + + etransport = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="rengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="bengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="bengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="bengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=30, piece="bengine4", onActive=true}}, + }, + +------------------ +------------------ + edrone_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine2", onActive=true}}, + }, + + efighter_up1 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine3", onActive=true}}, @@ -9,35 +110,125 @@ effectUnitDefs = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, }, - egunship2 = { + egunship2_up1 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, }, - ebomber = { + ebomber_up1 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, }, - eairengineer = { + escout_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, + }, + + eraider_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, + }, + + ekrow_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=true, emitVector = {0, 1, 0}}}, + }, + + etransport_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="rengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine4", onActive=true}}, + }, + + eairplant_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=false, emitVector = {0, 0, 1}}}, + }, + +------------------ +------------------ + edrone_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine2", onActive=true}}, + }, + + efighter_up2 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine4", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, }, - escout = { + egunship2_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + ebomber_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + escout_up2 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, }, - etransport = { + eraider_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, + }, + + ekrow_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=true, emitVector = {0, 1, 0}}}, + }, + + etransport_up2 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="rengine1", onActive=true}}, @@ -48,29 +239,233 @@ effectUnitDefs = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine4", onActive=true}}, }, - esubplane = { - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="engines", onActive=true}}, + eairplant_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=false, emitVector = {0, 0, 1}}}, }, - - edrone = { + +------------------ +------------------ + edrone_up3 = { {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="fengine2", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine1", onActive=true}}, {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 2, length=20, piece="rengine2", onActive=true}}, }, - eairplant = { - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine1"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine2"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine3"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine4"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine5"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine6"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine7"}}, - {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 8, length=80, piece="engine8"}}, + efighter_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine4", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + egunship2_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + ebomber_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=25, piece="rengine2", onActive=true}}, + }, + + escout_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, }, - esolar2 = { + eraider_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="rengine2", onActive=true}}, + }, + + ekrow_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=true, emitVector = {0, 1, 0}}}, + }, + + etransport_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="fengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="rengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="rengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine1", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine2", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine3", onActive=true}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=40, piece="bengine4", onActive=true}}, + }, + + eairplant_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine1", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine2", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine3", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine4", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine5", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine6", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine7", onActive=false, emitVector = {0, 0, 1}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 16, length=60, piece="engine8", onActive=false, emitVector = {0, 0, 1}}}, + }, + +------------------ +------------------ + + esubplane = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 4, length=35, piece="engines", onActive=true}}, + }, + +------------------ +------------------ + + ehbotengineer = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotpeewee = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotthud = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotsniper = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotrocko = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotkarganneth = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + + ehbotengineer_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotpeewee_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotthud_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotsniper_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotrocko_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotkarganneth_up1 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + + ehbotengineer_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotpeewee_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotthud_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotsniper_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotrocko_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotkarganneth_up2 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + + ehbotengineer_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotpeewee_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotthud_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotsniper_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotrocko_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + + ehbotkarganneth_up3 = { + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust1", onActive=true, emitVector = {0, 1, 0}}}, + {class='AirJet', options={color={1,0.5,0.0,0.75}, width = 5, length=20, piece="exhaust2", onActive=true, emitVector = {0, 1, 0}}}, + }, + +------------------ +------------------ + +-- esolar2 = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -78,8 +473,8 @@ effectUnitDefs = { -- {class='Bursts', options=esolarBursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,32,0}, size=10, precision=22, strength = 0.02, repeatEffect=true}}, - }, - emetalextractor = { +-- }, +-- emetalextractor = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -87,8 +482,8 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,55,0}, size=10, precision=22, strength = 0.015, repeatEffect=true}}, - }, - euwmetalextractor = { +-- }, +-- euwmetalextractor = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -96,8 +491,8 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,25,0}, size=15, precision=22, strength = 0.015, repeatEffect=true}}, - }, - egeothermal = { +-- }, +-- egeothermal = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -105,8 +500,8 @@ effectUnitDefs = { -- {class='Bursts', options=egeoBursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,26,0.0}, size=10, precision=22, strength = 0.02, repeatEffect=true}}, - }, - efusion2 = { +-- }, +-- efusion2 = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -117,9 +512,9 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,51,0.0}, size=23, precision=22, strength = 0.02, repeatEffect=true}}, - }, +-- }, - burrow = { +-- burrow = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -130,9 +525,9 @@ effectUnitDefs = { -- {class='Bursts', options=burrowBursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,51,0.0}, size=23, precision=22, strength = 0.02, repeatEffect=true}}, - }, +-- }, - eminifac = { +-- eminifac = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -140,8 +535,8 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,25,110}, size=75, precision=22, strength = 0.015, repeatEffect=true}}, - }, - ebasefactory = { +-- }, +-- ebasefactory = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -149,8 +544,8 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={20,25,10}, size=55, precision=22, strength = 0.015, repeatEffect=true}}, - }, - eamphibfac = { +-- }, +-- eamphibfac = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -158,8 +553,8 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,25,85}, size=60, precision=22, strength = 0.015, repeatEffect=true}}, - }, - eairplant = { +-- }, +-- eairplant = { -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, @@ -167,36 +562,119 @@ effectUnitDefs = { -- {class='Bursts', options=efusion2Bursts}, -- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,280,30}, size=55, precision=22, strength = 0.015, repeatEffect=true}}, +-- }, + +-- eexperimentalfac = { +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, + +-- {class='Bursts', options=efusion2Bursts}, +-- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,50,0}, size=140, precision=22, strength = 0.015, repeatEffect=true}}, +-- }, + +-- eshieldgen = { +-- {class='ShieldSphere',options=ShieldSphere2000}, +-- {class='Bursts',options=shieldBursts2000}, +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, + +-- {class='Bursts', options=efusion2Bursts}, +-- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,60,0.0}, size=2005, precision=0, strength = 0.001, repeatEffect=true}}, +-- }, + + eantinukeai = { + --{class='ShieldSphere',options=ShieldSphere2000}, + {class='Bursts',options=shieldBursts2000}, +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, + +-- {class='Bursts', options=efusion2Bursts}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,60,0.0}, size=2005, precision=0, strength = 0.001, repeatEffect=true}}, }, +------------------ +------------------ + + eallterrshield = { + --{class='ShieldSphere',options=ShieldSphere300}, +-- {class='Bursts',options=shieldBursts200}, +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, - eexperimentalfac = { +-- {class='Bursts', options=efusion2Bursts}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=305, precision=0, strength = 0.001, repeatEffect=true}}, + }, + + eallterrshield_up1 = { + --{class='ShieldSphere',options=ShieldSphere300}, + --{class='Bursts',options=shieldBursts300}, -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, -- {class='StaticParticles', options=corfusNova4}, -- {class='Bursts', options=efusion2Bursts}, - {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,50,0}, size=140, precision=22, strength = 0.015, repeatEffect=true}}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=305, precision=0, strength = 0.001, repeatEffect=true}}, }, - eshieldgen = { + + eallterrshield_up2 = { + --{class='ShieldSphere',options=ShieldSphere300}, +-- {class='Bursts',options=shieldBursts200}, -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, -- {class='StaticParticles', options=corfusNova4}, -- {class='Bursts', options=efusion2Bursts}, --- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,60,0.0}, size=1500, precision=0, strength = 0.0025, repeatEffect=true}}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=305, precision=0, strength = 0.001, repeatEffect=true}}, }, - eallterrshield = { + + eallterrshield_up3 = { + --{class='ShieldSphere',options=ShieldSphere300}, +-- {class='Bursts',options=shieldBursts200}, +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, + +-- {class='Bursts', options=efusion2Bursts}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=305, precision=0, strength = 0.001, repeatEffect=true}}, + }, + +------------------ +------------------ + + ekmar = { + --{class='ShieldSphere',options=ShieldSphere400}, +-- {class='Bursts',options=shieldBursts200}, +-- {class='StaticParticles', options=corfusNova}, +-- {class='StaticParticles', options=corfusNova2}, +-- {class='StaticParticles', options=corfusNova3}, +-- {class='StaticParticles', options=corfusNova4}, + +-- {class='Bursts', options=efusion2Bursts}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=1005, precision=0, strength = 0.001, repeatEffect=true}}, + }, + + ecommandershield = { + --{class='ShieldSphere',options=ShieldSphere400}, +-- {class='Bursts',options=shieldBursts200}, -- {class='StaticParticles', options=corfusNova}, -- {class='StaticParticles', options=corfusNova2}, -- {class='StaticParticles', options=corfusNova3}, -- {class='StaticParticles', options=corfusNova4}, -- {class='Bursts', options=efusion2Bursts}, --- {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,60,0.0}, size=300, precision=0, strength = 0.0025, repeatEffect=true}}, + {class='ShieldJitter', options={delay=0,life=math.huge, pos={0,20,0.0}, size=405, precision=0, strength = 0.001, repeatEffect=true}}, }, diff --git a/LuaUI/Configs/marking_menu_keys.lua b/LuaUI/Configs/marking_menu_keys.lua deleted file mode 100644 index ea0ddd83d..000000000 --- a/LuaUI/Configs/marking_menu_keys.lua +++ /dev/null @@ -1,71 +0,0 @@ -local config = { - qwerty = { - keys = { - [KEYSYMS.W] = '0', - [KEYSYMS.E] = '45', - [KEYSYMS.D] = '90', - [KEYSYMS.C] = '135', - [KEYSYMS.X] = '180', - [KEYSYMS.Z] = '225', - [KEYSYMS.A] = '270', - [KEYSYMS.Q] = '315', - }, - keys_display = { - 'W', - 'E', - 'D', - 'C', - 'X', - 'Z', - 'A', - 'Q', - } - }, - qwerty_d = { - keys = { - [KEYSYMS.E] = '0', - [KEYSYMS.R] = '45', - [KEYSYMS.F] = '90', - [KEYSYMS.V] = '135', - [KEYSYMS.C] = '180', - [KEYSYMS.X] = '225', - [KEYSYMS.S] = '270', - [KEYSYMS.W] = '315', - }, - keys_display = { - 'E', - 'R', - 'F', - 'V', - 'C', - 'X', - 'S', - 'W', - } - }, - - qwertz = { - keys = { - [KEYSYMS.W] = '0', - [KEYSYMS.E] = '45', - [KEYSYMS.D] = '90', - [KEYSYMS.C] = '135', - [KEYSYMS.X] = '180', - [KEYSYMS.Y] = '225', - [KEYSYMS.A] = '270', - [KEYSYMS.Q] = '315', - }, - keys_display = { - 'W', - 'E', - 'D', - 'C', - 'X', - 'Y', - 'A', - 'Q', - } - } -} - -return config diff --git a/LuaUI/Configs/marking_menu_menus.lua b/LuaUI/Configs/marking_menu_menus.lua deleted file mode 100644 index 63cf4fabd..000000000 --- a/LuaUI/Configs/marking_menu_menus.lua +++ /dev/null @@ -1,32 +0,0 @@ -local menu_ecommander = { - items = { - { - angle = 0, - unit = "emetalextractor", - label = "Economy", - items = { - { - angle = 45, - unit = "esolar2" - }, - } - }, - { - angle = -45, - unit = "ebasefactory", - label = "Facs", - items = { - { - angle = 90, - unit = "eairplant" - }, - - } - }, - } -} -local menu_use = { - ecommander = menu_ecommander, -} - -return menu_use diff --git a/LuaUI/Fonts/ComicSans-Bold.ttf b/LuaUI/Fonts/ComicSans-Bold.ttf new file mode 100644 index 000000000..b84728924 Binary files /dev/null and b/LuaUI/Fonts/ComicSans-Bold.ttf differ diff --git a/LuaUI/Fonts/ComicSans.ttf b/LuaUI/Fonts/ComicSans.ttf new file mode 100644 index 000000000..22d569472 Binary files /dev/null and b/LuaUI/Fonts/ComicSans.ttf differ diff --git a/LuaUI/Fonts/FreeMonoBold_12.lua b/LuaUI/Fonts/FreeMonoBold_12.lua deleted file mode 100644 index 6185160af..000000000 --- a/LuaUI/Fonts/FreeMonoBold_12.lua +++ /dev/null @@ -1,1365 +0,0 @@ --- $Id: FreeMonoBold_12.lua 3171 2008-11-06 09:06:29Z det $ - -local fontSpecs = { - srcFile = [[Fonts/FreeMonoBold.ttf]], - family = [[FreeMono]], - style = [[Bold]], - yStep = 13, - height = 12, - xTexSize = 256, - yTexSize = 256, - outlineRadius = 1, - outlineWeight = 100, -} - -local glyphs = {} - -glyphs[32] = { --' '-- - num = 32, - adv = 7, - oxn = -1, oyn = -2, oxp = 2, oyp = 1, - txn = 1, tyn = 1, txp = 4, typ = 4, -} -glyphs[33] = { --'!'-- - num = 33, - adv = 7, - oxn = 1, oyn = -2, oxp = 6, oyp = 9, - txn = 14, tyn = 1, txp = 19, typ = 12, -} -glyphs[34] = { --'"'-- - num = 34, - adv = 7, - oxn = 0, oyn = 2, oxp = 7, oyp = 9, - txn = 27, tyn = 1, txp = 34, typ = 8, -} -glyphs[35] = { --'#'-- - num = 35, - adv = 7, - oxn = -1, oyn = -3, oxp = 8, oyp = 10, - txn = 40, tyn = 1, txp = 49, typ = 14, -} -glyphs[36] = { --'$'-- - num = 36, - adv = 7, - oxn = 0, oyn = -3, oxp = 8, oyp = 10, - txn = 53, tyn = 1, txp = 61, typ = 14, -} -glyphs[37] = { --'%'-- - num = 37, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 66, tyn = 1, txp = 75, typ = 12, -} -glyphs[38] = { --'&'-- - num = 38, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 8, - txn = 79, tyn = 1, txp = 88, typ = 11, -} -glyphs[39] = { --'''-- - num = 39, - adv = 7, - oxn = 1, oyn = 2, oxp = 6, oyp = 9, - txn = 92, tyn = 1, txp = 97, typ = 8, -} -glyphs[40] = { --'('-- - num = 40, - adv = 7, - oxn = 2, oyn = -3, oxp = 7, oyp = 9, - txn = 105, tyn = 1, txp = 110, typ = 13, -} -glyphs[41] = { --')'-- - num = 41, - adv = 7, - oxn = 0, oyn = -3, oxp = 6, oyp = 9, - txn = 118, tyn = 1, txp = 124, typ = 13, -} -glyphs[42] = { --'*'-- - num = 42, - adv = 7, - oxn = 0, oyn = 1, oxp = 8, oyp = 9, - txn = 131, tyn = 1, txp = 139, typ = 9, -} -glyphs[43] = { --'+'-- - num = 43, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 144, tyn = 1, txp = 153, typ = 10, -} -glyphs[44] = { --','-- - num = 44, - adv = 7, - oxn = 0, oyn = -3, oxp = 6, oyp = 3, - txn = 157, tyn = 1, txp = 163, typ = 7, -} -glyphs[45] = { --'-'-- - num = 45, - adv = 7, - oxn = -1, oyn = 1, oxp = 8, oyp = 5, - txn = 170, tyn = 1, txp = 179, typ = 5, -} -glyphs[46] = { --'.'-- - num = 46, - adv = 7, - oxn = 1, oyn = -2, oxp = 6, oyp = 3, - txn = 183, tyn = 1, txp = 188, typ = 6, -} -glyphs[47] = { --'/'-- - num = 47, - adv = 7, - oxn = 0, oyn = -3, oxp = 8, oyp = 10, - txn = 196, tyn = 1, txp = 204, typ = 14, -} -glyphs[48] = { --'0'-- - num = 48, - adv = 7, - oxn = 0, oyn = -2, oxp = 8, oyp = 9, - txn = 209, tyn = 1, txp = 217, typ = 12, -} -glyphs[49] = { --'1'-- - num = 49, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 9, - txn = 222, tyn = 1, txp = 230, typ = 11, -} -glyphs[50] = { --'2'-- - num = 50, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 235, tyn = 1, txp = 244, typ = 11, -} -glyphs[51] = { --'3'-- - num = 51, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 1, tyn = 17, txp = 10, typ = 28, -} -glyphs[52] = { --'4'-- - num = 52, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 14, tyn = 17, txp = 23, typ = 27, -} -glyphs[53] = { --'5'-- - num = 53, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 27, tyn = 17, txp = 36, typ = 28, -} -glyphs[54] = { --'6'-- - num = 54, - adv = 7, - oxn = 0, oyn = -2, oxp = 8, oyp = 9, - txn = 40, tyn = 17, txp = 48, typ = 28, -} -glyphs[55] = { --'7'-- - num = 55, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 53, tyn = 17, txp = 62, typ = 28, -} -glyphs[56] = { --'8'-- - num = 56, - adv = 7, - oxn = 0, oyn = -2, oxp = 8, oyp = 9, - txn = 66, tyn = 17, txp = 74, typ = 28, -} -glyphs[57] = { --'9'-- - num = 57, - adv = 7, - oxn = 0, oyn = -2, oxp = 8, oyp = 9, - txn = 79, tyn = 17, txp = 87, typ = 28, -} -glyphs[58] = { --':'-- - num = 58, - adv = 7, - oxn = 1, oyn = -2, oxp = 6, oyp = 7, - txn = 92, tyn = 17, txp = 97, typ = 26, -} -glyphs[59] = { --';'-- - num = 59, - adv = 7, - oxn = 0, oyn = -3, oxp = 6, oyp = 7, - txn = 105, tyn = 17, txp = 111, typ = 27, -} -glyphs[60] = { --'<'-- - num = 60, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 118, tyn = 17, txp = 127, typ = 26, -} -glyphs[61] = { --'='-- - num = 61, - adv = 7, - oxn = -1, oyn = 0, oxp = 8, oyp = 7, - txn = 131, tyn = 17, txp = 140, typ = 24, -} -glyphs[62] = { --'>'-- - num = 62, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 7, - txn = 144, tyn = 17, txp = 153, typ = 25, -} -glyphs[63] = { --'?'-- - num = 63, - adv = 7, - oxn = 0, oyn = -2, oxp = 8, oyp = 9, - txn = 157, tyn = 17, txp = 165, typ = 28, -} -glyphs[64] = { --'@'-- - num = 64, - adv = 7, - oxn = -1, oyn = -3, oxp = 8, oyp = 9, - txn = 170, tyn = 17, txp = 179, typ = 29, -} -glyphs[65] = { --'A'-- - num = 65, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 8, - txn = 183, tyn = 17, txp = 194, typ = 26, -} -glyphs[66] = { --'B'-- - num = 66, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 196, tyn = 17, txp = 205, typ = 26, -} -glyphs[67] = { --'C'-- - num = 67, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 209, tyn = 17, txp = 218, typ = 28, -} -glyphs[68] = { --'D'-- - num = 68, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 222, tyn = 17, txp = 231, typ = 26, -} -glyphs[69] = { --'E'-- - num = 69, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 235, tyn = 17, txp = 244, typ = 26, -} -glyphs[70] = { --'F'-- - num = 70, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 1, tyn = 33, txp = 10, typ = 42, -} -glyphs[71] = { --'G'-- - num = 71, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 9, - txn = 14, tyn = 33, txp = 24, typ = 44, -} -glyphs[72] = { --'H'-- - num = 72, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 27, tyn = 33, txp = 36, typ = 42, -} -glyphs[73] = { --'I'-- - num = 73, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 8, - txn = 40, tyn = 33, txp = 48, typ = 42, -} -glyphs[74] = { --'J'-- - num = 74, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 8, - txn = 53, tyn = 33, txp = 63, typ = 43, -} -glyphs[75] = { --'K'-- - num = 75, - adv = 7, - oxn = -1, oyn = -1, oxp = 9, oyp = 8, - txn = 66, tyn = 33, txp = 76, typ = 42, -} -glyphs[76] = { --'L'-- - num = 76, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 79, tyn = 33, txp = 88, typ = 42, -} -glyphs[77] = { --'M'-- - num = 77, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 9, - txn = 92, tyn = 33, txp = 103, typ = 43, -} -glyphs[78] = { --'N'-- - num = 78, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 8, - txn = 105, tyn = 33, txp = 116, typ = 42, -} -glyphs[79] = { --'O'-- - num = 79, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 118, tyn = 33, txp = 127, typ = 44, -} -glyphs[80] = { --'P'-- - num = 80, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 131, tyn = 33, txp = 140, typ = 42, -} -glyphs[81] = { --'Q'-- - num = 81, - adv = 7, - oxn = -1, oyn = -3, oxp = 8, oyp = 9, - txn = 144, tyn = 33, txp = 153, typ = 45, -} -glyphs[82] = { --'R'-- - num = 82, - adv = 7, - oxn = -1, oyn = -1, oxp = 9, oyp = 8, - txn = 157, tyn = 33, txp = 167, typ = 42, -} -glyphs[83] = { --'S'-- - num = 83, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 170, tyn = 33, txp = 179, typ = 44, -} -glyphs[84] = { --'T'-- - num = 84, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 183, tyn = 33, txp = 192, typ = 42, -} -glyphs[85] = { --'U'-- - num = 85, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 8, - txn = 196, tyn = 33, txp = 206, typ = 43, -} -glyphs[86] = { --'V'-- - num = 86, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 8, - txn = 209, tyn = 33, txp = 220, typ = 42, -} -glyphs[87] = { --'W'-- - num = 87, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 8, - txn = 222, tyn = 33, txp = 233, typ = 42, -} -glyphs[88] = { --'X'-- - num = 88, - adv = 7, - oxn = -1, oyn = -1, oxp = 9, oyp = 8, - txn = 235, tyn = 33, txp = 245, typ = 42, -} -glyphs[89] = { --'Y'-- - num = 89, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 1, tyn = 49, txp = 10, typ = 58, -} -glyphs[90] = { --'Z'-- - num = 90, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 14, tyn = 49, txp = 23, typ = 58, -} -glyphs[91] = { --'['-- - num = 91, - adv = 7, - oxn = 2, oyn = -3, oxp = 7, oyp = 9, - txn = 27, tyn = 49, txp = 32, typ = 61, -} -glyphs[92] = { --'\'-- - num = 92, - adv = 7, - oxn = 0, oyn = -3, oxp = 8, oyp = 10, - txn = 40, tyn = 49, txp = 48, typ = 62, -} -glyphs[93] = { --']'-- - num = 93, - adv = 7, - oxn = 0, oyn = -3, oxp = 6, oyp = 9, - txn = 53, tyn = 49, txp = 59, typ = 61, -} -glyphs[94] = { --'^'-- - num = 94, - adv = 7, - oxn = 0, oyn = 2, oxp = 8, oyp = 9, - txn = 66, tyn = 49, txp = 74, typ = 56, -} -glyphs[95] = { --'_'-- - num = 95, - adv = 7, - oxn = -2, oyn = -3, oxp = 9, oyp = 1, - txn = 79, tyn = 49, txp = 90, typ = 53, -} -glyphs[96] = { --'`'-- - num = 96, - adv = 7, - oxn = 0, oyn = 4, oxp = 6, oyp = 10, - txn = 92, tyn = 49, txp = 98, typ = 55, -} -glyphs[97] = { --'a'-- - num = 97, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 105, tyn = 49, txp = 114, typ = 58, -} -glyphs[98] = { --'b'-- - num = 98, - adv = 7, - oxn = -2, oyn = -2, oxp = 8, oyp = 9, - txn = 118, tyn = 49, txp = 128, typ = 60, -} -glyphs[99] = { --'c'-- - num = 99, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 131, tyn = 49, txp = 140, typ = 58, -} -glyphs[100] = { --'d'-- - num = 100, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 9, - txn = 144, tyn = 49, txp = 154, typ = 60, -} -glyphs[101] = { --'e'-- - num = 101, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 157, tyn = 49, txp = 166, typ = 58, -} -glyphs[102] = { --'f'-- - num = 102, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 170, tyn = 49, txp = 179, typ = 59, -} -glyphs[103] = { --'g'-- - num = 103, - adv = 7, - oxn = -1, oyn = -4, oxp = 9, oyp = 7, - txn = 183, tyn = 49, txp = 193, typ = 60, -} -glyphs[104] = { --'h'-- - num = 104, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 196, tyn = 49, txp = 205, typ = 59, -} -glyphs[105] = { --'i'-- - num = 105, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 209, tyn = 49, txp = 218, typ = 59, -} -glyphs[106] = { --'j'-- - num = 106, - adv = 7, - oxn = 0, oyn = -4, oxp = 7, oyp = 9, - txn = 222, tyn = 49, txp = 229, typ = 62, -} -glyphs[107] = { --'k'-- - num = 107, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 235, tyn = 49, txp = 244, typ = 59, -} -glyphs[108] = { --'l'-- - num = 108, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 1, tyn = 65, txp = 10, typ = 75, -} -glyphs[109] = { --'m'-- - num = 109, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 7, - txn = 14, tyn = 65, txp = 25, typ = 73, -} -glyphs[110] = { --'n'-- - num = 110, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 7, - txn = 27, tyn = 65, txp = 36, typ = 73, -} -glyphs[111] = { --'o'-- - num = 111, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 40, tyn = 65, txp = 49, typ = 74, -} -glyphs[112] = { --'p'-- - num = 112, - adv = 7, - oxn = -2, oyn = -4, oxp = 8, oyp = 7, - txn = 53, tyn = 65, txp = 63, typ = 76, -} -glyphs[113] = { --'q'-- - num = 113, - adv = 7, - oxn = -1, oyn = -4, oxp = 9, oyp = 7, - txn = 66, tyn = 65, txp = 76, typ = 76, -} -glyphs[114] = { --'r'-- - num = 114, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 7, - txn = 79, tyn = 65, txp = 88, typ = 73, -} -glyphs[115] = { --'s'-- - num = 115, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 92, tyn = 65, txp = 101, typ = 74, -} -glyphs[116] = { --'t'-- - num = 116, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 105, tyn = 65, txp = 114, typ = 76, -} -glyphs[117] = { --'u'-- - num = 117, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 118, tyn = 65, txp = 127, typ = 74, -} -glyphs[118] = { --'v'-- - num = 118, - adv = 7, - oxn = -1, oyn = -1, oxp = 9, oyp = 7, - txn = 131, tyn = 65, txp = 141, typ = 73, -} -glyphs[119] = { --'w'-- - num = 119, - adv = 7, - oxn = -1, oyn = -1, oxp = 9, oyp = 7, - txn = 144, tyn = 65, txp = 154, typ = 73, -} -glyphs[120] = { --'x'-- - num = 120, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 7, - txn = 157, tyn = 65, txp = 166, typ = 73, -} -glyphs[121] = { --'y'-- - num = 121, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 7, - txn = 170, tyn = 65, txp = 179, typ = 76, -} -glyphs[122] = { --'z'-- - num = 122, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 7, - txn = 183, tyn = 65, txp = 191, typ = 73, -} -glyphs[123] = { --'{'-- - num = 123, - adv = 7, - oxn = 1, oyn = -3, oxp = 7, oyp = 9, - txn = 196, tyn = 65, txp = 202, typ = 77, -} -glyphs[124] = { --'|'-- - num = 124, - adv = 7, - oxn = 2, oyn = -3, oxp = 6, oyp = 9, - txn = 209, tyn = 65, txp = 213, typ = 77, -} -glyphs[125] = { --'}'-- - num = 125, - adv = 7, - oxn = 1, oyn = -3, oxp = 7, oyp = 9, - txn = 222, tyn = 65, txp = 228, typ = 77, -} -glyphs[126] = { --'~'-- - num = 126, - adv = 7, - oxn = -1, oyn = 1, oxp = 8, oyp = 6, - txn = 235, tyn = 65, txp = 244, typ = 70, -} -glyphs[127] = { --''-- - num = 127, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 1, tyn = 81, txp = 8, typ = 92, -} -glyphs[128] = { --'€'-- - num = 128, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 14, tyn = 81, txp = 21, typ = 92, -} -glyphs[129] = { --'�'-- - num = 129, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 27, tyn = 81, txp = 34, typ = 92, -} -glyphs[130] = { --'‚'-- - num = 130, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 40, tyn = 81, txp = 47, typ = 92, -} -glyphs[131] = { --'ƒ'-- - num = 131, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 53, tyn = 81, txp = 60, typ = 92, -} -glyphs[132] = { --'„'-- - num = 132, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 66, tyn = 81, txp = 73, typ = 92, -} -glyphs[133] = { --'…'-- - num = 133, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 79, tyn = 81, txp = 86, typ = 92, -} -glyphs[134] = { --'†'-- - num = 134, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 92, tyn = 81, txp = 99, typ = 92, -} -glyphs[135] = { --'‡'-- - num = 135, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 105, tyn = 81, txp = 112, typ = 92, -} -glyphs[136] = { --'ˆ'-- - num = 136, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 118, tyn = 81, txp = 125, typ = 92, -} -glyphs[137] = { --'‰'-- - num = 137, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 131, tyn = 81, txp = 138, typ = 92, -} -glyphs[138] = { --'Š'-- - num = 138, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 144, tyn = 81, txp = 151, typ = 92, -} -glyphs[139] = { --'‹'-- - num = 139, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 157, tyn = 81, txp = 164, typ = 92, -} -glyphs[140] = { --'Œ'-- - num = 140, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 170, tyn = 81, txp = 177, typ = 92, -} -glyphs[141] = { --'�'-- - num = 141, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 183, tyn = 81, txp = 190, typ = 92, -} -glyphs[142] = { --'Ž'-- - num = 142, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 196, tyn = 81, txp = 203, typ = 92, -} -glyphs[143] = { --'�'-- - num = 143, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 209, tyn = 81, txp = 216, typ = 92, -} -glyphs[144] = { --'�'-- - num = 144, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 222, tyn = 81, txp = 229, typ = 92, -} -glyphs[145] = { --'‘'-- - num = 145, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 235, tyn = 81, txp = 242, typ = 92, -} -glyphs[146] = { --'’'-- - num = 146, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 1, tyn = 97, txp = 8, typ = 108, -} -glyphs[147] = { --'“'-- - num = 147, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 14, tyn = 97, txp = 21, typ = 108, -} -glyphs[148] = { --'”'-- - num = 148, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 27, tyn = 97, txp = 34, typ = 108, -} -glyphs[149] = { --'•'-- - num = 149, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 40, tyn = 97, txp = 47, typ = 108, -} -glyphs[150] = { --'–'-- - num = 150, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 53, tyn = 97, txp = 60, typ = 108, -} -glyphs[151] = { --'—'-- - num = 151, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 66, tyn = 97, txp = 73, typ = 108, -} -glyphs[152] = { --'˜'-- - num = 152, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 79, tyn = 97, txp = 86, typ = 108, -} -glyphs[153] = { --'™'-- - num = 153, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 92, tyn = 97, txp = 99, typ = 108, -} -glyphs[154] = { --'š'-- - num = 154, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 105, tyn = 97, txp = 112, typ = 108, -} -glyphs[155] = { --'›'-- - num = 155, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 118, tyn = 97, txp = 125, typ = 108, -} -glyphs[156] = { --'œ'-- - num = 156, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 131, tyn = 97, txp = 138, typ = 108, -} -glyphs[157] = { --'�'-- - num = 157, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 144, tyn = 97, txp = 151, typ = 108, -} -glyphs[158] = { --'ž'-- - num = 158, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 157, tyn = 97, txp = 164, typ = 108, -} -glyphs[159] = { --'Ÿ'-- - num = 159, - adv = 7, - oxn = -1, oyn = -1, oxp = 6, oyp = 10, - txn = 170, tyn = 97, txp = 177, typ = 108, -} -glyphs[160] = { --' '-- - num = 160, - adv = 7, - oxn = -1, oyn = -2, oxp = 2, oyp = 1, - txn = 183, tyn = 97, txp = 186, typ = 100, -} -glyphs[161] = { --'¡'-- - num = 161, - adv = 7, - oxn = 1, oyn = -4, oxp = 6, oyp = 7, - txn = 196, tyn = 97, txp = 201, typ = 108, -} -glyphs[162] = { --'¢'-- - num = 162, - adv = 7, - oxn = 0, oyn = -2, oxp = 7, oyp = 9, - txn = 209, tyn = 97, txp = 216, typ = 108, -} -glyphs[163] = { --'£'-- - num = 163, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 222, tyn = 97, txp = 231, typ = 107, -} -glyphs[164] = { --'¤'-- - num = 164, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 235, tyn = 97, txp = 244, typ = 106, -} -glyphs[165] = { --'¥'-- - num = 165, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 1, tyn = 113, txp = 10, typ = 122, -} -glyphs[166] = { --'¦'-- - num = 166, - adv = 7, - oxn = 2, oyn = -3, oxp = 6, oyp = 9, - txn = 14, tyn = 113, txp = 18, typ = 125, -} -glyphs[167] = { --'§'-- - num = 167, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 8, - txn = 27, tyn = 113, txp = 36, typ = 125, -} -glyphs[168] = { --'¨'-- - num = 168, - adv = 7, - oxn = 0, oyn = 5, oxp = 7, oyp = 9, - txn = 40, tyn = 113, txp = 47, typ = 117, -} -glyphs[169] = { --'©'-- - num = 169, - adv = 7, - oxn = -2, oyn = -2, oxp = 9, oyp = 9, - txn = 53, tyn = 113, txp = 64, typ = 124, -} -glyphs[170] = { --'ª'-- - num = 170, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 66, tyn = 113, txp = 73, typ = 121, -} -glyphs[171] = { --'«'-- - num = 171, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 6, - txn = 79, tyn = 113, txp = 88, typ = 120, -} -glyphs[172] = { --'¬'-- - num = 172, - adv = 7, - oxn = -1, oyn = 0, oxp = 7, oyp = 7, - txn = 92, tyn = 113, txp = 100, typ = 120, -} -glyphs[173] = { --'­'-- - num = 173, - adv = 7, - oxn = -1, oyn = 1, oxp = 8, oyp = 5, - txn = 105, tyn = 113, txp = 114, typ = 117, -} -glyphs[174] = { --'®'-- - num = 174, - adv = 7, - oxn = -2, oyn = -2, oxp = 9, oyp = 9, - txn = 118, tyn = 113, txp = 129, typ = 124, -} -glyphs[175] = { --'¯'-- - num = 175, - adv = 7, - oxn = 0, oyn = 5, oxp = 7, oyp = 9, - txn = 131, tyn = 113, txp = 138, typ = 117, -} -glyphs[176] = { --'°'-- - num = 176, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 144, tyn = 113, txp = 151, typ = 121, -} -glyphs[177] = { --'±'-- - num = 177, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 157, tyn = 113, txp = 166, typ = 123, -} -glyphs[178] = { --'²'-- - num = 178, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 170, tyn = 113, txp = 177, typ = 121, -} -glyphs[179] = { --'³'-- - num = 179, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 183, tyn = 113, txp = 190, typ = 121, -} -glyphs[180] = { --'´'-- - num = 180, - adv = 7, - oxn = 2, oyn = 4, oxp = 7, oyp = 10, - txn = 196, tyn = 113, txp = 201, typ = 119, -} -glyphs[181] = { --'µ'-- - num = 181, - adv = 7, - oxn = -1, oyn = -3, oxp = 8, oyp = 7, - txn = 209, tyn = 113, txp = 218, typ = 123, -} -glyphs[182] = { --'¶'-- - num = 182, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 8, - txn = 222, tyn = 113, txp = 231, typ = 125, -} -glyphs[183] = { --'·'-- - num = 183, - adv = 7, - oxn = 1, oyn = 1, oxp = 6, oyp = 6, - txn = 235, tyn = 113, txp = 240, typ = 118, -} -glyphs[184] = { --'¸'-- - num = 184, - adv = 7, - oxn = 1, oyn = -4, oxp = 6, oyp = 1, - txn = 1, tyn = 129, txp = 6, typ = 134, -} -glyphs[185] = { --'¹'-- - num = 185, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 14, tyn = 129, txp = 21, typ = 137, -} -glyphs[186] = { --'º'-- - num = 186, - adv = 7, - oxn = 0, oyn = 1, oxp = 7, oyp = 9, - txn = 27, tyn = 129, txp = 34, typ = 137, -} -glyphs[187] = { --'»'-- - num = 187, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 6, - txn = 40, tyn = 129, txp = 49, typ = 136, -} -glyphs[188] = { --'¼'-- - num = 188, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 9, - txn = 53, tyn = 129, txp = 64, typ = 139, -} -glyphs[189] = { --'½'-- - num = 189, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 9, - txn = 66, tyn = 129, txp = 77, typ = 139, -} -glyphs[190] = { --'¾'-- - num = 190, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 9, - txn = 79, tyn = 129, txp = 90, typ = 139, -} -glyphs[191] = { --'¿'-- - num = 191, - adv = 7, - oxn = -1, oyn = -5, oxp = 7, oyp = 6, - txn = 92, tyn = 129, txp = 100, typ = 140, -} -glyphs[192] = { --'À'-- - num = 192, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 12, - txn = 105, tyn = 129, txp = 116, typ = 142, -} -glyphs[193] = { --'Á'-- - num = 193, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 12, - txn = 118, tyn = 129, txp = 129, typ = 142, -} -glyphs[194] = { --'Â'-- - num = 194, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 12, - txn = 131, tyn = 129, txp = 142, typ = 142, -} -glyphs[195] = { --'Ã'-- - num = 195, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 11, - txn = 144, tyn = 129, txp = 155, typ = 141, -} -glyphs[196] = { --'Ä'-- - num = 196, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 11, - txn = 157, tyn = 129, txp = 168, typ = 141, -} -glyphs[197] = { --'Å'-- - num = 197, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 12, - txn = 170, tyn = 129, txp = 181, typ = 142, -} -glyphs[198] = { --'Æ'-- - num = 198, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 8, - txn = 183, tyn = 129, txp = 194, typ = 138, -} -glyphs[199] = { --'Ç'-- - num = 199, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 9, - txn = 196, tyn = 129, txp = 205, typ = 142, -} -glyphs[200] = { --'È'-- - num = 200, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 12, - txn = 209, tyn = 129, txp = 218, typ = 142, -} -glyphs[201] = { --'É'-- - num = 201, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 12, - txn = 222, tyn = 129, txp = 231, typ = 142, -} -glyphs[202] = { --'Ê'-- - num = 202, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 12, - txn = 235, tyn = 129, txp = 244, typ = 142, -} -glyphs[203] = { --'Ë'-- - num = 203, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 11, - txn = 1, tyn = 145, txp = 10, typ = 157, -} -glyphs[204] = { --'Ì'-- - num = 204, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 12, - txn = 14, tyn = 145, txp = 22, typ = 158, -} -glyphs[205] = { --'Í'-- - num = 205, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 12, - txn = 27, tyn = 145, txp = 35, typ = 158, -} -glyphs[206] = { --'Î'-- - num = 206, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 12, - txn = 40, tyn = 145, txp = 48, typ = 158, -} -glyphs[207] = { --'Ï'-- - num = 207, - adv = 7, - oxn = 0, oyn = -1, oxp = 8, oyp = 11, - txn = 53, tyn = 145, txp = 61, typ = 157, -} -glyphs[208] = { --'Ð'-- - num = 208, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 66, tyn = 145, txp = 75, typ = 154, -} -glyphs[209] = { --'Ñ'-- - num = 209, - adv = 7, - oxn = -2, oyn = -1, oxp = 9, oyp = 11, - txn = 79, tyn = 145, txp = 90, typ = 157, -} -glyphs[210] = { --'Ò'-- - num = 210, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 12, - txn = 92, tyn = 145, txp = 101, typ = 159, -} -glyphs[211] = { --'Ó'-- - num = 211, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 12, - txn = 105, tyn = 145, txp = 114, typ = 159, -} -glyphs[212] = { --'Ô'-- - num = 212, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 12, - txn = 118, tyn = 145, txp = 127, typ = 159, -} -glyphs[213] = { --'Õ'-- - num = 213, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 11, - txn = 131, tyn = 145, txp = 140, typ = 158, -} -glyphs[214] = { --'Ö'-- - num = 214, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 11, - txn = 144, tyn = 145, txp = 153, typ = 158, -} -glyphs[215] = { --'×'-- - num = 215, - adv = 7, - oxn = 0, oyn = -1, oxp = 7, oyp = 7, - txn = 157, tyn = 145, txp = 164, typ = 153, -} -glyphs[216] = { --'Ø'-- - num = 216, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 9, - txn = 170, tyn = 145, txp = 180, typ = 156, -} -glyphs[217] = { --'Ù'-- - num = 217, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 12, - txn = 183, tyn = 145, txp = 193, typ = 159, -} -glyphs[218] = { --'Ú'-- - num = 218, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 12, - txn = 196, tyn = 145, txp = 206, typ = 159, -} -glyphs[219] = { --'Û'-- - num = 219, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 12, - txn = 209, tyn = 145, txp = 219, typ = 159, -} -glyphs[220] = { --'Ü'-- - num = 220, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 11, - txn = 222, tyn = 145, txp = 232, typ = 158, -} -glyphs[221] = { --'Ý'-- - num = 221, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 12, - txn = 235, tyn = 145, txp = 244, typ = 158, -} -glyphs[222] = { --'Þ'-- - num = 222, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 1, tyn = 161, txp = 10, typ = 170, -} -glyphs[223] = { --'ß'-- - num = 223, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 14, tyn = 161, txp = 23, typ = 172, -} -glyphs[224] = { --'à'-- - num = 224, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 27, tyn = 161, txp = 36, typ = 173, -} -glyphs[225] = { --'á'-- - num = 225, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 40, tyn = 161, txp = 49, typ = 173, -} -glyphs[226] = { --'â'-- - num = 226, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 53, tyn = 161, txp = 62, typ = 173, -} -glyphs[227] = { --'ã'-- - num = 227, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 66, tyn = 161, txp = 75, typ = 172, -} -glyphs[228] = { --'ä'-- - num = 228, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 79, tyn = 161, txp = 88, typ = 172, -} -glyphs[229] = { --'å'-- - num = 229, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 92, tyn = 161, txp = 101, typ = 173, -} -glyphs[230] = { --'æ'-- - num = 230, - adv = 7, - oxn = -2, oyn = -2, oxp = 9, oyp = 7, - txn = 105, tyn = 161, txp = 116, typ = 170, -} -glyphs[231] = { --'ç'-- - num = 231, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 7, - txn = 118, tyn = 161, txp = 127, typ = 172, -} -glyphs[232] = { --'è'-- - num = 232, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 131, tyn = 161, txp = 140, typ = 173, -} -glyphs[233] = { --'é'-- - num = 233, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 144, tyn = 161, txp = 153, typ = 173, -} -glyphs[234] = { --'ê'-- - num = 234, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 157, tyn = 161, txp = 166, typ = 173, -} -glyphs[235] = { --'ë'-- - num = 235, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 170, tyn = 161, txp = 179, typ = 172, -} -glyphs[236] = { --'ì'-- - num = 236, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 10, - txn = 183, tyn = 161, txp = 192, typ = 172, -} -glyphs[237] = { --'í'-- - num = 237, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 10, - txn = 196, tyn = 161, txp = 205, typ = 172, -} -glyphs[238] = { --'î'-- - num = 238, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 10, - txn = 209, tyn = 161, txp = 218, typ = 172, -} -glyphs[239] = { --'ï'-- - num = 239, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 222, tyn = 161, txp = 231, typ = 171, -} -glyphs[240] = { --'ð'-- - num = 240, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 235, tyn = 161, txp = 244, typ = 172, -} -glyphs[241] = { --'ñ'-- - num = 241, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 9, - txn = 1, tyn = 177, txp = 10, typ = 187, -} -glyphs[242] = { --'ò'-- - num = 242, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 14, tyn = 177, txp = 23, typ = 189, -} -glyphs[243] = { --'ó'-- - num = 243, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 27, tyn = 177, txp = 36, typ = 189, -} -glyphs[244] = { --'ô'-- - num = 244, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 40, tyn = 177, txp = 49, typ = 189, -} -glyphs[245] = { --'õ'-- - num = 245, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 53, tyn = 177, txp = 62, typ = 188, -} -glyphs[246] = { --'ö'-- - num = 246, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 66, tyn = 177, txp = 75, typ = 188, -} -glyphs[247] = { --'÷'-- - num = 247, - adv = 7, - oxn = -1, oyn = -1, oxp = 8, oyp = 8, - txn = 79, tyn = 177, txp = 88, typ = 186, -} -glyphs[248] = { --'ø'-- - num = 248, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 7, - txn = 92, tyn = 177, txp = 101, typ = 186, -} -glyphs[249] = { --'ù'-- - num = 249, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 105, tyn = 177, txp = 114, typ = 189, -} -glyphs[250] = { --'ú'-- - num = 250, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 118, tyn = 177, txp = 127, typ = 189, -} -glyphs[251] = { --'û'-- - num = 251, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 10, - txn = 131, tyn = 177, txp = 140, typ = 189, -} -glyphs[252] = { --'ü'-- - num = 252, - adv = 7, - oxn = -1, oyn = -2, oxp = 8, oyp = 9, - txn = 144, tyn = 177, txp = 153, typ = 188, -} -glyphs[253] = { --'ý'-- - num = 253, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 10, - txn = 157, tyn = 177, txp = 166, typ = 191, -} -glyphs[254] = { --'þ'-- - num = 254, - adv = 7, - oxn = -2, oyn = -4, oxp = 8, oyp = 9, - txn = 170, tyn = 177, txp = 180, typ = 190, -} -glyphs[255] = { --'ÿ'-- - num = 255, - adv = 7, - oxn = -1, oyn = -4, oxp = 8, oyp = 9, - txn = 183, tyn = 177, txp = 192, typ = 190, -} - -fontSpecs.glyphs = glyphs - -return fontSpecs - diff --git a/LuaUI/Fonts/FreeMonoBold_12.png b/LuaUI/Fonts/FreeMonoBold_12.png deleted file mode 100644 index 96bc21e42..000000000 Binary files a/LuaUI/Fonts/FreeMonoBold_12.png and /dev/null differ diff --git a/LuaUI/Fonts/FreeSansBoldWOutline_14.lua b/LuaUI/Fonts/FreeSansBoldWOutline_14.lua deleted file mode 100644 index ec60feb6f..000000000 --- a/LuaUI/Fonts/FreeSansBoldWOutline_14.lua +++ /dev/null @@ -1,1365 +0,0 @@ --- $Id: FreeSansBold_14.lua 2491 2008-07-17 13:36:51Z det $ - -local fontSpecs = { - srcFile = [[FreeSansBold.ttf]], - family = [[FreeSans]], - style = [[Bold]], - yStep = 15, - height = 14, - xTexSize = 512, - yTexSize = 256, - outlineRadius = 2, - outlineWeight = 100, -} - -local glyphs = {} - -glyphs[32] = { --' '-- - num = 32, - adv = 4, - oxn = -2, oyn = -3, oxp = 3, oyp = 2, - txn = 1, tyn = 1, txp = 6, typ = 6, -} -glyphs[33] = { --'!'-- - num = 33, - adv = 5, - oxn = -1, oyn = -2, oxp = 6, oyp = 13, - txn = 21, tyn = 1, txp = 28, typ = 16, -} -glyphs[34] = { --'"'-- - num = 34, - adv = 7, - oxn = -2, oyn = 4, oxp = 8, oyp = 13, - txn = 41, tyn = 1, txp = 51, typ = 10, -} -glyphs[35] = { --'#'-- - num = 35, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 12, - txn = 61, tyn = 1, txp = 73, typ = 16, -} -glyphs[36] = { --'$'-- - num = 36, - adv = 8, - oxn = -2, oyn = -4, oxp = 10, oyp = 13, - txn = 81, tyn = 1, txp = 93, typ = 18, -} -glyphs[37] = { --'%'-- - num = 37, - adv = 12, - oxn = -2, oyn = -3, oxp = 15, oyp = 12, - txn = 101, tyn = 1, txp = 118, typ = 16, -} -glyphs[38] = { --'&'-- - num = 38, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 121, tyn = 1, txp = 135, typ = 17, -} -glyphs[39] = { --'''-- - num = 39, - adv = 3, - oxn = -2, oyn = 4, oxp = 5, oyp = 13, - txn = 141, tyn = 1, txp = 148, typ = 10, -} -glyphs[40] = { --'('-- - num = 40, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 161, tyn = 1, txp = 170, typ = 19, -} -glyphs[41] = { --')'-- - num = 41, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 13, - txn = 181, tyn = 1, txp = 189, typ = 19, -} -glyphs[42] = { --'*'-- - num = 42, - adv = 5, - oxn = -2, oyn = 3, oxp = 7, oyp = 13, - txn = 201, tyn = 1, txp = 210, typ = 11, -} -glyphs[43] = { --'+'-- - num = 43, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 221, tyn = 1, txp = 233, typ = 13, -} -glyphs[44] = { --','-- - num = 44, - adv = 4, - oxn = -2, oyn = -5, oxp = 5, oyp = 5, - txn = 241, tyn = 1, txp = 248, typ = 11, -} -glyphs[45] = { --'-'-- - num = 45, - adv = 5, - oxn = -2, oyn = 0, oxp = 7, oyp = 7, - txn = 261, tyn = 1, txp = 270, typ = 8, -} -glyphs[46] = { --'.'-- - num = 46, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 5, - txn = 281, tyn = 1, txp = 288, typ = 8, -} -glyphs[47] = { --'/'-- - num = 47, - adv = 4, - oxn = -2, oyn = -3, oxp = 6, oyp = 12, - txn = 301, tyn = 1, txp = 309, typ = 16, -} -glyphs[48] = { --'0'-- - num = 48, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 321, tyn = 1, txp = 333, typ = 17, -} -glyphs[49] = { --'1'-- - num = 49, - adv = 8, - oxn = -2, oyn = -2, oxp = 8, oyp = 12, - txn = 341, tyn = 1, txp = 351, typ = 15, -} -glyphs[50] = { --'2'-- - num = 50, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 361, tyn = 1, txp = 373, typ = 16, -} -glyphs[51] = { --'3'-- - num = 51, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 1, txp = 393, typ = 17, -} -glyphs[52] = { --'4'-- - num = 52, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 401, tyn = 1, txp = 413, typ = 15, -} -glyphs[53] = { --'5'-- - num = 53, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 12, - txn = 421, tyn = 1, txp = 433, typ = 16, -} -glyphs[54] = { --'6'-- - num = 54, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 441, tyn = 1, txp = 453, typ = 17, -} -glyphs[55] = { --'7'-- - num = 55, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 461, tyn = 1, txp = 473, typ = 15, -} -glyphs[56] = { --'8'-- - num = 56, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 481, tyn = 1, txp = 493, typ = 17, -} -glyphs[57] = { --'9'-- - num = 57, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 1, tyn = 22, txp = 13, typ = 38, -} -glyphs[58] = { --':'-- - num = 58, - adv = 5, - oxn = -1, oyn = -2, oxp = 6, oyp = 10, - txn = 21, tyn = 22, txp = 28, typ = 34, -} -glyphs[59] = { --';'-- - num = 59, - adv = 5, - oxn = -1, oyn = -5, oxp = 6, oyp = 10, - txn = 41, tyn = 22, txp = 48, typ = 37, -} -glyphs[60] = { --'<'-- - num = 60, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 61, tyn = 22, txp = 73, typ = 34, -} -glyphs[61] = { --'='-- - num = 61, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 8, - txn = 81, tyn = 22, txp = 93, typ = 32, -} -glyphs[62] = { --'>'-- - num = 62, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 101, tyn = 22, txp = 113, typ = 34, -} -glyphs[63] = { --'?'-- - num = 63, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 121, tyn = 22, txp = 133, typ = 37, -} -glyphs[64] = { --'@'-- - num = 64, - adv = 14, - oxn = -2, oyn = -4, oxp = 16, oyp = 13, - txn = 141, tyn = 22, txp = 159, typ = 39, -} -glyphs[65] = { --'A'-- - num = 65, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 161, tyn = 22, txp = 175, typ = 37, -} -glyphs[66] = { --'B'-- - num = 66, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 181, tyn = 22, txp = 194, typ = 37, -} -glyphs[67] = { --'C'-- - num = 67, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 201, tyn = 22, txp = 215, typ = 38, -} -glyphs[68] = { --'D'-- - num = 68, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 221, tyn = 22, txp = 234, typ = 37, -} -glyphs[69] = { --'E'-- - num = 69, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 241, tyn = 22, txp = 253, typ = 37, -} -glyphs[70] = { --'F'-- - num = 70, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 261, tyn = 22, txp = 273, typ = 37, -} -glyphs[71] = { --'G'-- - num = 71, - adv = 11, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 281, tyn = 22, txp = 295, typ = 38, -} -glyphs[72] = { --'H'-- - num = 72, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 301, tyn = 22, txp = 315, typ = 37, -} -glyphs[73] = { --'I'-- - num = 73, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 321, tyn = 22, txp = 328, typ = 37, -} -glyphs[74] = { --'J'-- - num = 74, - adv = 8, - oxn = -2, oyn = -3, oxp = 9, oyp = 13, - txn = 341, tyn = 22, txp = 352, typ = 38, -} -glyphs[75] = { --'K'-- - num = 75, - adv = 10, - oxn = -1, oyn = -2, oxp = 13, oyp = 13, - txn = 361, tyn = 22, txp = 375, typ = 37, -} -glyphs[76] = { --'L'-- - num = 76, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 381, tyn = 22, txp = 393, typ = 37, -} -glyphs[77] = { --'M'-- - num = 77, - adv = 12, - oxn = -2, oyn = -2, oxp = 13, oyp = 13, - txn = 401, tyn = 22, txp = 416, typ = 37, -} -glyphs[78] = { --'N'-- - num = 78, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 421, tyn = 22, txp = 435, typ = 37, -} -glyphs[79] = { --'O'-- - num = 79, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 441, tyn = 22, txp = 456, typ = 38, -} -glyphs[80] = { --'P'-- - num = 80, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 461, tyn = 22, txp = 473, typ = 37, -} -glyphs[81] = { --'Q'-- - num = 81, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 481, tyn = 22, txp = 496, typ = 38, -} -glyphs[82] = { --'R'-- - num = 82, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 1, tyn = 43, txp = 14, typ = 58, -} -glyphs[83] = { --'S'-- - num = 83, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 21, tyn = 43, txp = 34, typ = 59, -} -glyphs[84] = { --'T'-- - num = 84, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 13, - txn = 41, tyn = 43, txp = 54, typ = 58, -} -glyphs[85] = { --'U'-- - num = 85, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 13, - txn = 61, tyn = 43, txp = 74, typ = 59, -} -glyphs[86] = { --'V'-- - num = 86, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 81, tyn = 43, txp = 95, typ = 58, -} -glyphs[87] = { --'W'-- - num = 87, - adv = 13, - oxn = -2, oyn = -2, oxp = 16, oyp = 13, - txn = 101, tyn = 43, txp = 119, typ = 58, -} -glyphs[88] = { --'X'-- - num = 88, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 121, tyn = 43, txp = 135, typ = 58, -} -glyphs[89] = { --'Y'-- - num = 89, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 141, tyn = 43, txp = 155, typ = 58, -} -glyphs[90] = { --'Z'-- - num = 90, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 13, - txn = 161, tyn = 43, txp = 174, typ = 58, -} -glyphs[91] = { --'['-- - num = 91, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 181, tyn = 43, txp = 190, typ = 61, -} -glyphs[92] = { --'\'-- - num = 92, - adv = 4, - oxn = -3, oyn = -3, oxp = 7, oyp = 12, - txn = 201, tyn = 43, txp = 211, typ = 58, -} -glyphs[93] = { --']'-- - num = 93, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 13, - txn = 221, tyn = 43, txp = 229, typ = 61, -} -glyphs[94] = { --'^'-- - num = 94, - adv = 8, - oxn = -2, oyn = 1, oxp = 10, oyp = 12, - txn = 241, tyn = 43, txp = 253, typ = 54, -} -glyphs[95] = { --'_'-- - num = 95, - adv = 8, - oxn = -3, oyn = -5, oxp = 11, oyp = 1, - txn = 261, tyn = 43, txp = 275, typ = 49, -} -glyphs[96] = { --'`'-- - num = 96, - adv = 5, - oxn = -2, oyn = 6, oxp = 5, oyp = 13, - txn = 281, tyn = 43, txp = 288, typ = 50, -} -glyphs[97] = { --'a'-- - num = 97, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 301, tyn = 43, txp = 313, typ = 56, -} -glyphs[98] = { --'b'-- - num = 98, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 321, tyn = 43, txp = 334, typ = 59, -} -glyphs[99] = { --'c'-- - num = 99, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 341, tyn = 43, txp = 353, typ = 56, -} -glyphs[100] = { --'d'-- - num = 100, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 43, txp = 373, typ = 59, -} -glyphs[101] = { --'e'-- - num = 101, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 381, tyn = 43, txp = 393, typ = 56, -} -glyphs[102] = { --'f'-- - num = 102, - adv = 5, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 401, tyn = 43, txp = 410, typ = 58, -} -glyphs[103] = { --'g'-- - num = 103, - adv = 9, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 421, tyn = 43, txp = 433, typ = 59, -} -glyphs[104] = { --'h'-- - num = 104, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 441, tyn = 43, txp = 453, typ = 58, -} -glyphs[105] = { --'i'-- - num = 105, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 461, tyn = 43, txp = 468, typ = 58, -} -glyphs[106] = { --'j'-- - num = 106, - adv = 4, - oxn = -2, oyn = -6, oxp = 5, oyp = 13, - txn = 481, tyn = 43, txp = 488, typ = 62, -} -glyphs[107] = { --'k'-- - num = 107, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 1, tyn = 64, txp = 13, typ = 79, -} -glyphs[108] = { --'l'-- - num = 108, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 21, tyn = 64, txp = 28, typ = 79, -} -glyphs[109] = { --'m'-- - num = 109, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 10, - txn = 41, tyn = 64, txp = 57, typ = 76, -} -glyphs[110] = { --'n'-- - num = 110, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 61, tyn = 64, txp = 73, typ = 76, -} -glyphs[111] = { --'o'-- - num = 111, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 81, tyn = 64, txp = 93, typ = 77, -} -glyphs[112] = { --'p'-- - num = 112, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 10, - txn = 101, tyn = 64, txp = 114, typ = 80, -} -glyphs[113] = { --'q'-- - num = 113, - adv = 9, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 121, tyn = 64, txp = 133, typ = 80, -} -glyphs[114] = { --'r'-- - num = 114, - adv = 5, - oxn = -2, oyn = -2, oxp = 8, oyp = 10, - txn = 141, tyn = 64, txp = 151, typ = 76, -} -glyphs[115] = { --'s'-- - num = 115, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 161, tyn = 64, txp = 173, typ = 77, -} -glyphs[116] = { --'t'-- - num = 116, - adv = 5, - oxn = -2, oyn = -3, oxp = 7, oyp = 12, - txn = 181, tyn = 64, txp = 190, typ = 79, -} -glyphs[117] = { --'u'-- - num = 117, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 201, tyn = 64, txp = 213, typ = 77, -} -glyphs[118] = { --'v'-- - num = 118, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 221, tyn = 64, txp = 233, typ = 76, -} -glyphs[119] = { --'w'-- - num = 119, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 10, - txn = 241, tyn = 64, txp = 256, typ = 76, -} -glyphs[120] = { --'x'-- - num = 120, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 261, tyn = 64, txp = 273, typ = 76, -} -glyphs[121] = { --'y'-- - num = 121, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 281, tyn = 64, txp = 293, typ = 80, -} -glyphs[122] = { --'z'-- - num = 122, - adv = 7, - oxn = -2, oyn = -2, oxp = 9, oyp = 10, - txn = 301, tyn = 64, txp = 312, typ = 76, -} -glyphs[123] = { --'{'-- - num = 123, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 321, tyn = 64, txp = 330, typ = 82, -} -glyphs[124] = { --'|'-- - num = 124, - adv = 4, - oxn = -1, oyn = -5, oxp = 5, oyp = 13, - txn = 341, tyn = 64, txp = 347, typ = 82, -} -glyphs[125] = { --'}'-- - num = 125, - adv = 5, - oxn = -1, oyn = -5, oxp = 7, oyp = 13, - txn = 361, tyn = 64, txp = 369, typ = 82, -} -glyphs[126] = { --'~'-- - num = 126, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 7, - txn = 381, tyn = 64, txp = 393, typ = 72, -} -glyphs[127] = { --''-- - num = 127, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 401, tyn = 64, txp = 410, typ = 78, -} -glyphs[128] = { --'€'-- - num = 128, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 421, tyn = 64, txp = 430, typ = 78, -} -glyphs[129] = { --'�'-- - num = 129, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 441, tyn = 64, txp = 450, typ = 78, -} -glyphs[130] = { --'‚'-- - num = 130, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 461, tyn = 64, txp = 470, typ = 78, -} -glyphs[131] = { --'ƒ'-- - num = 131, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 481, tyn = 64, txp = 490, typ = 78, -} -glyphs[132] = { --'„'-- - num = 132, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 1, tyn = 85, txp = 10, typ = 99, -} -glyphs[133] = { --'…'-- - num = 133, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 21, tyn = 85, txp = 30, typ = 99, -} -glyphs[134] = { --'†'-- - num = 134, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 41, tyn = 85, txp = 50, typ = 99, -} -glyphs[135] = { --'‡'-- - num = 135, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 61, tyn = 85, txp = 70, typ = 99, -} -glyphs[136] = { --'ˆ'-- - num = 136, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 81, tyn = 85, txp = 90, typ = 99, -} -glyphs[137] = { --'‰'-- - num = 137, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 101, tyn = 85, txp = 110, typ = 99, -} -glyphs[138] = { --'Š'-- - num = 138, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 121, tyn = 85, txp = 130, typ = 99, -} -glyphs[139] = { --'‹'-- - num = 139, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 141, tyn = 85, txp = 150, typ = 99, -} -glyphs[140] = { --'Œ'-- - num = 140, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 161, tyn = 85, txp = 170, typ = 99, -} -glyphs[141] = { --'�'-- - num = 141, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 181, tyn = 85, txp = 190, typ = 99, -} -glyphs[142] = { --'Ž'-- - num = 142, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 201, tyn = 85, txp = 210, typ = 99, -} -glyphs[143] = { --'�'-- - num = 143, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 221, tyn = 85, txp = 230, typ = 99, -} -glyphs[144] = { --'�'-- - num = 144, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 241, tyn = 85, txp = 250, typ = 99, -} -glyphs[145] = { --'‘'-- - num = 145, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 261, tyn = 85, txp = 270, typ = 99, -} -glyphs[146] = { --'’'-- - num = 146, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 281, tyn = 85, txp = 290, typ = 99, -} -glyphs[147] = { --'“'-- - num = 147, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 301, tyn = 85, txp = 310, typ = 99, -} -glyphs[148] = { --'”'-- - num = 148, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 321, tyn = 85, txp = 330, typ = 99, -} -glyphs[149] = { --'•'-- - num = 149, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 341, tyn = 85, txp = 350, typ = 99, -} -glyphs[150] = { --'–'-- - num = 150, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 361, tyn = 85, txp = 370, typ = 99, -} -glyphs[151] = { --'—'-- - num = 151, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 381, tyn = 85, txp = 390, typ = 99, -} -glyphs[152] = { --'˜'-- - num = 152, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 401, tyn = 85, txp = 410, typ = 99, -} -glyphs[153] = { --'™'-- - num = 153, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 421, tyn = 85, txp = 430, typ = 99, -} -glyphs[154] = { --'š'-- - num = 154, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 441, tyn = 85, txp = 450, typ = 99, -} -glyphs[155] = { --'›'-- - num = 155, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 461, tyn = 85, txp = 470, typ = 99, -} -glyphs[156] = { --'œ'-- - num = 156, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 481, tyn = 85, txp = 490, typ = 99, -} -glyphs[157] = { --'�'-- - num = 157, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 1, tyn = 106, txp = 10, typ = 120, -} -glyphs[158] = { --'ž'-- - num = 158, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 21, tyn = 106, txp = 30, typ = 120, -} -glyphs[159] = { --'Ÿ'-- - num = 159, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 41, tyn = 106, txp = 50, typ = 120, -} -glyphs[160] = { --' '-- - num = 160, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 61, tyn = 106, txp = 70, typ = 120, -} -glyphs[161] = { --'¡'-- - num = 161, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 10, - txn = 81, tyn = 106, txp = 89, typ = 121, -} -glyphs[162] = { --'¢'-- - num = 162, - adv = 8, - oxn = -2, oyn = -4, oxp = 10, oyp = 11, - txn = 101, tyn = 106, txp = 113, typ = 121, -} -glyphs[163] = { --'£'-- - num = 163, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 121, tyn = 106, txp = 133, typ = 122, -} -glyphs[164] = { --'¤'-- - num = 164, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 11, - txn = 141, tyn = 106, txp = 153, typ = 118, -} -glyphs[165] = { --'¥'-- - num = 165, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 161, tyn = 106, txp = 173, typ = 120, -} -glyphs[166] = { --'¦'-- - num = 166, - adv = 4, - oxn = -1, oyn = -5, oxp = 5, oyp = 13, - txn = 181, tyn = 106, txp = 187, typ = 124, -} -glyphs[167] = { --'§'-- - num = 167, - adv = 8, - oxn = -2, oyn = -5, oxp = 10, oyp = 13, - txn = 201, tyn = 106, txp = 213, typ = 124, -} -glyphs[168] = { --'¨'-- - num = 168, - adv = 5, - oxn = -2, oyn = 6, oxp = 7, oyp = 13, - txn = 221, tyn = 106, txp = 230, typ = 113, -} -glyphs[169] = { --'©'-- - num = 169, - adv = 10, - oxn = -3, oyn = -3, oxp = 13, oyp = 13, - txn = 241, tyn = 106, txp = 257, typ = 122, -} -glyphs[170] = { --'ª'-- - num = 170, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 261, tyn = 106, txp = 270, typ = 118, -} -glyphs[171] = { --'«'-- - num = 171, - adv = 8, - oxn = -1, oyn = -1, oxp = 9, oyp = 9, - txn = 281, tyn = 106, txp = 291, typ = 116, -} -glyphs[172] = { --'¬'-- - num = 172, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 8, - txn = 301, tyn = 106, txp = 313, typ = 115, -} -glyphs[173] = { --'­'-- - num = 173, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 321, tyn = 106, txp = 330, typ = 120, -} -glyphs[174] = { --'®'-- - num = 174, - adv = 10, - oxn = -3, oyn = -3, oxp = 13, oyp = 13, - txn = 341, tyn = 106, txp = 357, typ = 122, -} -glyphs[175] = { --'¯'-- - num = 175, - adv = 5, - oxn = -2, oyn = 6, oxp = 7, oyp = 13, - txn = 361, tyn = 106, txp = 370, typ = 113, -} -glyphs[176] = { --'°'-- - num = 176, - adv = 8, - oxn = 0, oyn = 3, oxp = 9, oyp = 12, - txn = 381, tyn = 106, txp = 390, typ = 115, -} -glyphs[177] = { --'±'-- - num = 177, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 11, - txn = 401, tyn = 106, txp = 413, typ = 120, -} -glyphs[178] = { --'²'-- - num = 178, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 421, tyn = 106, txp = 430, typ = 118, -} -glyphs[179] = { --'³'-- - num = 179, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 441, tyn = 106, txp = 450, typ = 118, -} -glyphs[180] = { --'´'-- - num = 180, - adv = 5, - oxn = -1, oyn = 6, oxp = 7, oyp = 13, - txn = 461, tyn = 106, txp = 469, typ = 113, -} -glyphs[181] = { --'µ'-- - num = 181, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 10, - txn = 481, tyn = 106, txp = 494, typ = 122, -} -glyphs[182] = { --'¶'-- - num = 182, - adv = 8, - oxn = -2, oyn = -5, oxp = 10, oyp = 13, - txn = 1, tyn = 127, txp = 13, typ = 145, -} -glyphs[183] = { --'·'-- - num = 183, - adv = 4, - oxn = -2, oyn = 0, oxp = 5, oyp = 7, - txn = 21, tyn = 127, txp = 28, typ = 134, -} -glyphs[184] = { --'¸'-- - num = 184, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 2, - txn = 41, tyn = 127, txp = 50, typ = 135, -} -glyphs[185] = { --'¹'-- - num = 185, - adv = 5, - oxn = -2, oyn = 1, oxp = 6, oyp = 12, - txn = 61, tyn = 127, txp = 69, typ = 138, -} -glyphs[186] = { --'º'-- - num = 186, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 81, tyn = 127, txp = 90, typ = 139, -} -glyphs[187] = { --'»'-- - num = 187, - adv = 8, - oxn = -1, oyn = -1, oxp = 9, oyp = 9, - txn = 101, tyn = 127, txp = 111, typ = 137, -} -glyphs[188] = { --'¼'-- - num = 188, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 121, tyn = 127, txp = 137, typ = 143, -} -glyphs[189] = { --'½'-- - num = 189, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 141, tyn = 127, txp = 157, typ = 143, -} -glyphs[190] = { --'¾'-- - num = 190, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 161, tyn = 127, txp = 177, typ = 143, -} -glyphs[191] = { --'¿'-- - num = 191, - adv = 9, - oxn = -2, oyn = -5, oxp = 10, oyp = 10, - txn = 181, tyn = 127, txp = 193, typ = 142, -} -glyphs[192] = { --'À'-- - num = 192, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 201, tyn = 127, txp = 215, typ = 145, -} -glyphs[193] = { --'Á'-- - num = 193, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 15, - txn = 221, tyn = 127, txp = 235, typ = 144, -} -glyphs[194] = { --'Â'-- - num = 194, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 241, tyn = 127, txp = 255, typ = 145, -} -glyphs[195] = { --'Ã'-- - num = 195, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 261, tyn = 127, txp = 275, typ = 145, -} -glyphs[196] = { --'Ä'-- - num = 196, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 281, tyn = 127, txp = 295, typ = 145, -} -glyphs[197] = { --'Å'-- - num = 197, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 301, tyn = 127, txp = 315, typ = 145, -} -glyphs[198] = { --'Æ'-- - num = 198, - adv = 14, - oxn = -2, oyn = -2, oxp = 16, oyp = 13, - txn = 321, tyn = 127, txp = 339, typ = 142, -} -glyphs[199] = { --'Ç'-- - num = 199, - adv = 10, - oxn = -2, oyn = -6, oxp = 12, oyp = 13, - txn = 341, tyn = 127, txp = 355, typ = 146, -} -glyphs[200] = { --'È'-- - num = 200, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 361, tyn = 127, txp = 373, typ = 145, -} -glyphs[201] = { --'É'-- - num = 201, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 381, tyn = 127, txp = 393, typ = 145, -} -glyphs[202] = { --'Ê'-- - num = 202, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 401, tyn = 127, txp = 413, typ = 145, -} -glyphs[203] = { --'Ë'-- - num = 203, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 421, tyn = 127, txp = 433, typ = 145, -} -glyphs[204] = { --'Ì'-- - num = 204, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 16, - txn = 441, tyn = 127, txp = 448, typ = 145, -} -glyphs[205] = { --'Í'-- - num = 205, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 461, tyn = 127, txp = 470, typ = 145, -} -glyphs[206] = { --'Î'-- - num = 206, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 481, tyn = 127, txp = 490, typ = 145, -} -glyphs[207] = { --'Ï'-- - num = 207, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 1, tyn = 148, txp = 10, typ = 166, -} -glyphs[208] = { --'Ð'-- - num = 208, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 21, tyn = 148, txp = 35, typ = 163, -} -glyphs[209] = { --'Ñ'-- - num = 209, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 41, tyn = 148, txp = 55, typ = 166, -} -glyphs[210] = { --'Ò'-- - num = 210, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 61, tyn = 148, txp = 76, typ = 167, -} -glyphs[211] = { --'Ó'-- - num = 211, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 81, tyn = 148, txp = 96, typ = 167, -} -glyphs[212] = { --'Ô'-- - num = 212, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 101, tyn = 148, txp = 116, typ = 167, -} -glyphs[213] = { --'Õ'-- - num = 213, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 121, tyn = 148, txp = 136, typ = 167, -} -glyphs[214] = { --'Ö'-- - num = 214, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 141, tyn = 148, txp = 156, typ = 167, -} -glyphs[215] = { --'×'-- - num = 215, - adv = 8, - oxn = -1, oyn = -2, oxp = 10, oyp = 9, - txn = 161, tyn = 148, txp = 172, typ = 159, -} -glyphs[216] = { --'Ø'-- - num = 216, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 181, tyn = 148, txp = 196, typ = 164, -} -glyphs[217] = { --'Ù'-- - num = 217, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 201, tyn = 148, txp = 214, typ = 167, -} -glyphs[218] = { --'Ú'-- - num = 218, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 221, tyn = 148, txp = 234, typ = 167, -} -glyphs[219] = { --'Û'-- - num = 219, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 241, tyn = 148, txp = 254, typ = 167, -} -glyphs[220] = { --'Ü'-- - num = 220, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 261, tyn = 148, txp = 274, typ = 167, -} -glyphs[221] = { --'Ý'-- - num = 221, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 281, tyn = 148, txp = 295, typ = 166, -} -glyphs[222] = { --'Þ'-- - num = 222, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 301, tyn = 148, txp = 313, typ = 163, -} -glyphs[223] = { --'ß'-- - num = 223, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 321, tyn = 148, txp = 334, typ = 164, -} -glyphs[224] = { --'à'-- - num = 224, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 341, tyn = 148, txp = 353, typ = 164, -} -glyphs[225] = { --'á'-- - num = 225, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 148, txp = 373, typ = 164, -} -glyphs[226] = { --'â'-- - num = 226, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 148, txp = 393, typ = 164, -} -glyphs[227] = { --'ã'-- - num = 227, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 401, tyn = 148, txp = 413, typ = 164, -} -glyphs[228] = { --'ä'-- - num = 228, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 421, tyn = 148, txp = 433, typ = 164, -} -glyphs[229] = { --'å'-- - num = 229, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 441, tyn = 148, txp = 453, typ = 164, -} -glyphs[230] = { --'æ'-- - num = 230, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 10, - txn = 461, tyn = 148, txp = 477, typ = 161, -} -glyphs[231] = { --'ç'-- - num = 231, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 481, tyn = 148, txp = 493, typ = 164, -} -glyphs[232] = { --'è'-- - num = 232, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 1, tyn = 169, txp = 13, typ = 185, -} -glyphs[233] = { --'é'-- - num = 233, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 21, tyn = 169, txp = 33, typ = 185, -} -glyphs[234] = { --'ê'-- - num = 234, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 41, tyn = 169, txp = 53, typ = 185, -} -glyphs[235] = { --'ë'-- - num = 235, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 61, tyn = 169, txp = 73, typ = 185, -} -glyphs[236] = { --'ì'-- - num = 236, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 81, tyn = 169, txp = 88, typ = 184, -} -glyphs[237] = { --'í'-- - num = 237, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 101, tyn = 169, txp = 110, typ = 184, -} -glyphs[238] = { --'î'-- - num = 238, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 121, tyn = 169, txp = 130, typ = 184, -} -glyphs[239] = { --'ï'-- - num = 239, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 141, tyn = 169, txp = 150, typ = 184, -} -glyphs[240] = { --'ð'-- - num = 240, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 161, tyn = 169, txp = 173, typ = 185, -} -glyphs[241] = { --'ñ'-- - num = 241, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 181, tyn = 169, txp = 193, typ = 184, -} -glyphs[242] = { --'ò'-- - num = 242, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 201, tyn = 169, txp = 213, typ = 185, -} -glyphs[243] = { --'ó'-- - num = 243, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 221, tyn = 169, txp = 233, typ = 185, -} -glyphs[244] = { --'ô'-- - num = 244, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 241, tyn = 169, txp = 253, typ = 185, -} -glyphs[245] = { --'õ'-- - num = 245, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 261, tyn = 169, txp = 273, typ = 185, -} -glyphs[246] = { --'ö'-- - num = 246, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 281, tyn = 169, txp = 293, typ = 185, -} -glyphs[247] = { --'÷'-- - num = 247, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 301, tyn = 169, txp = 313, typ = 181, -} -glyphs[248] = { --'ø'-- - num = 248, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 321, tyn = 169, txp = 334, typ = 182, -} -glyphs[249] = { --'ù'-- - num = 249, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 341, tyn = 169, txp = 353, typ = 185, -} -glyphs[250] = { --'ú'-- - num = 250, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 169, txp = 373, typ = 185, -} -glyphs[251] = { --'û'-- - num = 251, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 169, txp = 393, typ = 185, -} -glyphs[252] = { --'ü'-- - num = 252, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 401, tyn = 169, txp = 413, typ = 185, -} -glyphs[253] = { --'ý'-- - num = 253, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 13, - txn = 421, tyn = 169, txp = 433, typ = 188, -} -glyphs[254] = { --'þ'-- - num = 254, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 13, - txn = 441, tyn = 169, txp = 454, typ = 188, -} -glyphs[255] = { --'ÿ'-- - num = 255, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 13, - txn = 461, tyn = 169, txp = 473, typ = 188, -} - -fontSpecs.glyphs = glyphs - -return fontSpecs - diff --git a/LuaUI/Fonts/FreeSansBoldWOutline_14.png b/LuaUI/Fonts/FreeSansBoldWOutline_14.png deleted file mode 100644 index b4095e590..000000000 Binary files a/LuaUI/Fonts/FreeSansBoldWOutline_14.png and /dev/null differ diff --git a/LuaUI/Fonts/FreeSansBold_14.lua b/LuaUI/Fonts/FreeSansBold_14.lua deleted file mode 100644 index ec60feb6f..000000000 --- a/LuaUI/Fonts/FreeSansBold_14.lua +++ /dev/null @@ -1,1365 +0,0 @@ --- $Id: FreeSansBold_14.lua 2491 2008-07-17 13:36:51Z det $ - -local fontSpecs = { - srcFile = [[FreeSansBold.ttf]], - family = [[FreeSans]], - style = [[Bold]], - yStep = 15, - height = 14, - xTexSize = 512, - yTexSize = 256, - outlineRadius = 2, - outlineWeight = 100, -} - -local glyphs = {} - -glyphs[32] = { --' '-- - num = 32, - adv = 4, - oxn = -2, oyn = -3, oxp = 3, oyp = 2, - txn = 1, tyn = 1, txp = 6, typ = 6, -} -glyphs[33] = { --'!'-- - num = 33, - adv = 5, - oxn = -1, oyn = -2, oxp = 6, oyp = 13, - txn = 21, tyn = 1, txp = 28, typ = 16, -} -glyphs[34] = { --'"'-- - num = 34, - adv = 7, - oxn = -2, oyn = 4, oxp = 8, oyp = 13, - txn = 41, tyn = 1, txp = 51, typ = 10, -} -glyphs[35] = { --'#'-- - num = 35, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 12, - txn = 61, tyn = 1, txp = 73, typ = 16, -} -glyphs[36] = { --'$'-- - num = 36, - adv = 8, - oxn = -2, oyn = -4, oxp = 10, oyp = 13, - txn = 81, tyn = 1, txp = 93, typ = 18, -} -glyphs[37] = { --'%'-- - num = 37, - adv = 12, - oxn = -2, oyn = -3, oxp = 15, oyp = 12, - txn = 101, tyn = 1, txp = 118, typ = 16, -} -glyphs[38] = { --'&'-- - num = 38, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 121, tyn = 1, txp = 135, typ = 17, -} -glyphs[39] = { --'''-- - num = 39, - adv = 3, - oxn = -2, oyn = 4, oxp = 5, oyp = 13, - txn = 141, tyn = 1, txp = 148, typ = 10, -} -glyphs[40] = { --'('-- - num = 40, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 161, tyn = 1, txp = 170, typ = 19, -} -glyphs[41] = { --')'-- - num = 41, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 13, - txn = 181, tyn = 1, txp = 189, typ = 19, -} -glyphs[42] = { --'*'-- - num = 42, - adv = 5, - oxn = -2, oyn = 3, oxp = 7, oyp = 13, - txn = 201, tyn = 1, txp = 210, typ = 11, -} -glyphs[43] = { --'+'-- - num = 43, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 221, tyn = 1, txp = 233, typ = 13, -} -glyphs[44] = { --','-- - num = 44, - adv = 4, - oxn = -2, oyn = -5, oxp = 5, oyp = 5, - txn = 241, tyn = 1, txp = 248, typ = 11, -} -glyphs[45] = { --'-'-- - num = 45, - adv = 5, - oxn = -2, oyn = 0, oxp = 7, oyp = 7, - txn = 261, tyn = 1, txp = 270, typ = 8, -} -glyphs[46] = { --'.'-- - num = 46, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 5, - txn = 281, tyn = 1, txp = 288, typ = 8, -} -glyphs[47] = { --'/'-- - num = 47, - adv = 4, - oxn = -2, oyn = -3, oxp = 6, oyp = 12, - txn = 301, tyn = 1, txp = 309, typ = 16, -} -glyphs[48] = { --'0'-- - num = 48, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 321, tyn = 1, txp = 333, typ = 17, -} -glyphs[49] = { --'1'-- - num = 49, - adv = 8, - oxn = -2, oyn = -2, oxp = 8, oyp = 12, - txn = 341, tyn = 1, txp = 351, typ = 15, -} -glyphs[50] = { --'2'-- - num = 50, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 361, tyn = 1, txp = 373, typ = 16, -} -glyphs[51] = { --'3'-- - num = 51, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 1, txp = 393, typ = 17, -} -glyphs[52] = { --'4'-- - num = 52, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 401, tyn = 1, txp = 413, typ = 15, -} -glyphs[53] = { --'5'-- - num = 53, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 12, - txn = 421, tyn = 1, txp = 433, typ = 16, -} -glyphs[54] = { --'6'-- - num = 54, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 441, tyn = 1, txp = 453, typ = 17, -} -glyphs[55] = { --'7'-- - num = 55, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 461, tyn = 1, txp = 473, typ = 15, -} -glyphs[56] = { --'8'-- - num = 56, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 481, tyn = 1, txp = 493, typ = 17, -} -glyphs[57] = { --'9'-- - num = 57, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 1, tyn = 22, txp = 13, typ = 38, -} -glyphs[58] = { --':'-- - num = 58, - adv = 5, - oxn = -1, oyn = -2, oxp = 6, oyp = 10, - txn = 21, tyn = 22, txp = 28, typ = 34, -} -glyphs[59] = { --';'-- - num = 59, - adv = 5, - oxn = -1, oyn = -5, oxp = 6, oyp = 10, - txn = 41, tyn = 22, txp = 48, typ = 37, -} -glyphs[60] = { --'<'-- - num = 60, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 61, tyn = 22, txp = 73, typ = 34, -} -glyphs[61] = { --'='-- - num = 61, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 8, - txn = 81, tyn = 22, txp = 93, typ = 32, -} -glyphs[62] = { --'>'-- - num = 62, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 101, tyn = 22, txp = 113, typ = 34, -} -glyphs[63] = { --'?'-- - num = 63, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 121, tyn = 22, txp = 133, typ = 37, -} -glyphs[64] = { --'@'-- - num = 64, - adv = 14, - oxn = -2, oyn = -4, oxp = 16, oyp = 13, - txn = 141, tyn = 22, txp = 159, typ = 39, -} -glyphs[65] = { --'A'-- - num = 65, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 161, tyn = 22, txp = 175, typ = 37, -} -glyphs[66] = { --'B'-- - num = 66, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 181, tyn = 22, txp = 194, typ = 37, -} -glyphs[67] = { --'C'-- - num = 67, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 201, tyn = 22, txp = 215, typ = 38, -} -glyphs[68] = { --'D'-- - num = 68, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 221, tyn = 22, txp = 234, typ = 37, -} -glyphs[69] = { --'E'-- - num = 69, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 241, tyn = 22, txp = 253, typ = 37, -} -glyphs[70] = { --'F'-- - num = 70, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 261, tyn = 22, txp = 273, typ = 37, -} -glyphs[71] = { --'G'-- - num = 71, - adv = 11, - oxn = -2, oyn = -3, oxp = 12, oyp = 13, - txn = 281, tyn = 22, txp = 295, typ = 38, -} -glyphs[72] = { --'H'-- - num = 72, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 301, tyn = 22, txp = 315, typ = 37, -} -glyphs[73] = { --'I'-- - num = 73, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 321, tyn = 22, txp = 328, typ = 37, -} -glyphs[74] = { --'J'-- - num = 74, - adv = 8, - oxn = -2, oyn = -3, oxp = 9, oyp = 13, - txn = 341, tyn = 22, txp = 352, typ = 38, -} -glyphs[75] = { --'K'-- - num = 75, - adv = 10, - oxn = -1, oyn = -2, oxp = 13, oyp = 13, - txn = 361, tyn = 22, txp = 375, typ = 37, -} -glyphs[76] = { --'L'-- - num = 76, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 381, tyn = 22, txp = 393, typ = 37, -} -glyphs[77] = { --'M'-- - num = 77, - adv = 12, - oxn = -2, oyn = -2, oxp = 13, oyp = 13, - txn = 401, tyn = 22, txp = 416, typ = 37, -} -glyphs[78] = { --'N'-- - num = 78, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 421, tyn = 22, txp = 435, typ = 37, -} -glyphs[79] = { --'O'-- - num = 79, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 441, tyn = 22, txp = 456, typ = 38, -} -glyphs[80] = { --'P'-- - num = 80, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 461, tyn = 22, txp = 473, typ = 37, -} -glyphs[81] = { --'Q'-- - num = 81, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 481, tyn = 22, txp = 496, typ = 38, -} -glyphs[82] = { --'R'-- - num = 82, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 13, - txn = 1, tyn = 43, txp = 14, typ = 58, -} -glyphs[83] = { --'S'-- - num = 83, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 21, tyn = 43, txp = 34, typ = 59, -} -glyphs[84] = { --'T'-- - num = 84, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 13, - txn = 41, tyn = 43, txp = 54, typ = 58, -} -glyphs[85] = { --'U'-- - num = 85, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 13, - txn = 61, tyn = 43, txp = 74, typ = 59, -} -glyphs[86] = { --'V'-- - num = 86, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 81, tyn = 43, txp = 95, typ = 58, -} -glyphs[87] = { --'W'-- - num = 87, - adv = 13, - oxn = -2, oyn = -2, oxp = 16, oyp = 13, - txn = 101, tyn = 43, txp = 119, typ = 58, -} -glyphs[88] = { --'X'-- - num = 88, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 121, tyn = 43, txp = 135, typ = 58, -} -glyphs[89] = { --'Y'-- - num = 89, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 141, tyn = 43, txp = 155, typ = 58, -} -glyphs[90] = { --'Z'-- - num = 90, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 13, - txn = 161, tyn = 43, txp = 174, typ = 58, -} -glyphs[91] = { --'['-- - num = 91, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 181, tyn = 43, txp = 190, typ = 61, -} -glyphs[92] = { --'\'-- - num = 92, - adv = 4, - oxn = -3, oyn = -3, oxp = 7, oyp = 12, - txn = 201, tyn = 43, txp = 211, typ = 58, -} -glyphs[93] = { --']'-- - num = 93, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 13, - txn = 221, tyn = 43, txp = 229, typ = 61, -} -glyphs[94] = { --'^'-- - num = 94, - adv = 8, - oxn = -2, oyn = 1, oxp = 10, oyp = 12, - txn = 241, tyn = 43, txp = 253, typ = 54, -} -glyphs[95] = { --'_'-- - num = 95, - adv = 8, - oxn = -3, oyn = -5, oxp = 11, oyp = 1, - txn = 261, tyn = 43, txp = 275, typ = 49, -} -glyphs[96] = { --'`'-- - num = 96, - adv = 5, - oxn = -2, oyn = 6, oxp = 5, oyp = 13, - txn = 281, tyn = 43, txp = 288, typ = 50, -} -glyphs[97] = { --'a'-- - num = 97, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 301, tyn = 43, txp = 313, typ = 56, -} -glyphs[98] = { --'b'-- - num = 98, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 321, tyn = 43, txp = 334, typ = 59, -} -glyphs[99] = { --'c'-- - num = 99, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 341, tyn = 43, txp = 353, typ = 56, -} -glyphs[100] = { --'d'-- - num = 100, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 43, txp = 373, typ = 59, -} -glyphs[101] = { --'e'-- - num = 101, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 381, tyn = 43, txp = 393, typ = 56, -} -glyphs[102] = { --'f'-- - num = 102, - adv = 5, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 401, tyn = 43, txp = 410, typ = 58, -} -glyphs[103] = { --'g'-- - num = 103, - adv = 9, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 421, tyn = 43, txp = 433, typ = 59, -} -glyphs[104] = { --'h'-- - num = 104, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 441, tyn = 43, txp = 453, typ = 58, -} -glyphs[105] = { --'i'-- - num = 105, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 461, tyn = 43, txp = 468, typ = 58, -} -glyphs[106] = { --'j'-- - num = 106, - adv = 4, - oxn = -2, oyn = -6, oxp = 5, oyp = 13, - txn = 481, tyn = 43, txp = 488, typ = 62, -} -glyphs[107] = { --'k'-- - num = 107, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 1, tyn = 64, txp = 13, typ = 79, -} -glyphs[108] = { --'l'-- - num = 108, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 21, tyn = 64, txp = 28, typ = 79, -} -glyphs[109] = { --'m'-- - num = 109, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 10, - txn = 41, tyn = 64, txp = 57, typ = 76, -} -glyphs[110] = { --'n'-- - num = 110, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 61, tyn = 64, txp = 73, typ = 76, -} -glyphs[111] = { --'o'-- - num = 111, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 81, tyn = 64, txp = 93, typ = 77, -} -glyphs[112] = { --'p'-- - num = 112, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 10, - txn = 101, tyn = 64, txp = 114, typ = 80, -} -glyphs[113] = { --'q'-- - num = 113, - adv = 9, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 121, tyn = 64, txp = 133, typ = 80, -} -glyphs[114] = { --'r'-- - num = 114, - adv = 5, - oxn = -2, oyn = -2, oxp = 8, oyp = 10, - txn = 141, tyn = 64, txp = 151, typ = 76, -} -glyphs[115] = { --'s'-- - num = 115, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 161, tyn = 64, txp = 173, typ = 77, -} -glyphs[116] = { --'t'-- - num = 116, - adv = 5, - oxn = -2, oyn = -3, oxp = 7, oyp = 12, - txn = 181, tyn = 64, txp = 190, typ = 79, -} -glyphs[117] = { --'u'-- - num = 117, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 10, - txn = 201, tyn = 64, txp = 213, typ = 77, -} -glyphs[118] = { --'v'-- - num = 118, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 221, tyn = 64, txp = 233, typ = 76, -} -glyphs[119] = { --'w'-- - num = 119, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 10, - txn = 241, tyn = 64, txp = 256, typ = 76, -} -glyphs[120] = { --'x'-- - num = 120, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 10, - txn = 261, tyn = 64, txp = 273, typ = 76, -} -glyphs[121] = { --'y'-- - num = 121, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 281, tyn = 64, txp = 293, typ = 80, -} -glyphs[122] = { --'z'-- - num = 122, - adv = 7, - oxn = -2, oyn = -2, oxp = 9, oyp = 10, - txn = 301, tyn = 64, txp = 312, typ = 76, -} -glyphs[123] = { --'{'-- - num = 123, - adv = 5, - oxn = -2, oyn = -5, oxp = 7, oyp = 13, - txn = 321, tyn = 64, txp = 330, typ = 82, -} -glyphs[124] = { --'|'-- - num = 124, - adv = 4, - oxn = -1, oyn = -5, oxp = 5, oyp = 13, - txn = 341, tyn = 64, txp = 347, typ = 82, -} -glyphs[125] = { --'}'-- - num = 125, - adv = 5, - oxn = -1, oyn = -5, oxp = 7, oyp = 13, - txn = 361, tyn = 64, txp = 369, typ = 82, -} -glyphs[126] = { --'~'-- - num = 126, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 7, - txn = 381, tyn = 64, txp = 393, typ = 72, -} -glyphs[127] = { --''-- - num = 127, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 401, tyn = 64, txp = 410, typ = 78, -} -glyphs[128] = { --'€'-- - num = 128, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 421, tyn = 64, txp = 430, typ = 78, -} -glyphs[129] = { --'�'-- - num = 129, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 441, tyn = 64, txp = 450, typ = 78, -} -glyphs[130] = { --'‚'-- - num = 130, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 461, tyn = 64, txp = 470, typ = 78, -} -glyphs[131] = { --'ƒ'-- - num = 131, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 481, tyn = 64, txp = 490, typ = 78, -} -glyphs[132] = { --'„'-- - num = 132, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 1, tyn = 85, txp = 10, typ = 99, -} -glyphs[133] = { --'…'-- - num = 133, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 21, tyn = 85, txp = 30, typ = 99, -} -glyphs[134] = { --'†'-- - num = 134, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 41, tyn = 85, txp = 50, typ = 99, -} -glyphs[135] = { --'‡'-- - num = 135, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 61, tyn = 85, txp = 70, typ = 99, -} -glyphs[136] = { --'ˆ'-- - num = 136, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 81, tyn = 85, txp = 90, typ = 99, -} -glyphs[137] = { --'‰'-- - num = 137, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 101, tyn = 85, txp = 110, typ = 99, -} -glyphs[138] = { --'Š'-- - num = 138, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 121, tyn = 85, txp = 130, typ = 99, -} -glyphs[139] = { --'‹'-- - num = 139, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 141, tyn = 85, txp = 150, typ = 99, -} -glyphs[140] = { --'Œ'-- - num = 140, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 161, tyn = 85, txp = 170, typ = 99, -} -glyphs[141] = { --'�'-- - num = 141, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 181, tyn = 85, txp = 190, typ = 99, -} -glyphs[142] = { --'Ž'-- - num = 142, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 201, tyn = 85, txp = 210, typ = 99, -} -glyphs[143] = { --'�'-- - num = 143, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 221, tyn = 85, txp = 230, typ = 99, -} -glyphs[144] = { --'�'-- - num = 144, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 241, tyn = 85, txp = 250, typ = 99, -} -glyphs[145] = { --'‘'-- - num = 145, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 261, tyn = 85, txp = 270, typ = 99, -} -glyphs[146] = { --'’'-- - num = 146, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 281, tyn = 85, txp = 290, typ = 99, -} -glyphs[147] = { --'“'-- - num = 147, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 301, tyn = 85, txp = 310, typ = 99, -} -glyphs[148] = { --'”'-- - num = 148, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 321, tyn = 85, txp = 330, typ = 99, -} -glyphs[149] = { --'•'-- - num = 149, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 341, tyn = 85, txp = 350, typ = 99, -} -glyphs[150] = { --'–'-- - num = 150, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 361, tyn = 85, txp = 370, typ = 99, -} -glyphs[151] = { --'—'-- - num = 151, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 381, tyn = 85, txp = 390, typ = 99, -} -glyphs[152] = { --'˜'-- - num = 152, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 401, tyn = 85, txp = 410, typ = 99, -} -glyphs[153] = { --'™'-- - num = 153, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 421, tyn = 85, txp = 430, typ = 99, -} -glyphs[154] = { --'š'-- - num = 154, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 441, tyn = 85, txp = 450, typ = 99, -} -glyphs[155] = { --'›'-- - num = 155, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 461, tyn = 85, txp = 470, typ = 99, -} -glyphs[156] = { --'œ'-- - num = 156, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 481, tyn = 85, txp = 490, typ = 99, -} -glyphs[157] = { --'�'-- - num = 157, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 1, tyn = 106, txp = 10, typ = 120, -} -glyphs[158] = { --'ž'-- - num = 158, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 21, tyn = 106, txp = 30, typ = 120, -} -glyphs[159] = { --'Ÿ'-- - num = 159, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 41, tyn = 106, txp = 50, typ = 120, -} -glyphs[160] = { --' '-- - num = 160, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 61, tyn = 106, txp = 70, typ = 120, -} -glyphs[161] = { --'¡'-- - num = 161, - adv = 5, - oxn = -2, oyn = -5, oxp = 6, oyp = 10, - txn = 81, tyn = 106, txp = 89, typ = 121, -} -glyphs[162] = { --'¢'-- - num = 162, - adv = 8, - oxn = -2, oyn = -4, oxp = 10, oyp = 11, - txn = 101, tyn = 106, txp = 113, typ = 121, -} -glyphs[163] = { --'£'-- - num = 163, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 121, tyn = 106, txp = 133, typ = 122, -} -glyphs[164] = { --'¤'-- - num = 164, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 11, - txn = 141, tyn = 106, txp = 153, typ = 118, -} -glyphs[165] = { --'¥'-- - num = 165, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 12, - txn = 161, tyn = 106, txp = 173, typ = 120, -} -glyphs[166] = { --'¦'-- - num = 166, - adv = 4, - oxn = -1, oyn = -5, oxp = 5, oyp = 13, - txn = 181, tyn = 106, txp = 187, typ = 124, -} -glyphs[167] = { --'§'-- - num = 167, - adv = 8, - oxn = -2, oyn = -5, oxp = 10, oyp = 13, - txn = 201, tyn = 106, txp = 213, typ = 124, -} -glyphs[168] = { --'¨'-- - num = 168, - adv = 5, - oxn = -2, oyn = 6, oxp = 7, oyp = 13, - txn = 221, tyn = 106, txp = 230, typ = 113, -} -glyphs[169] = { --'©'-- - num = 169, - adv = 10, - oxn = -3, oyn = -3, oxp = 13, oyp = 13, - txn = 241, tyn = 106, txp = 257, typ = 122, -} -glyphs[170] = { --'ª'-- - num = 170, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 261, tyn = 106, txp = 270, typ = 118, -} -glyphs[171] = { --'«'-- - num = 171, - adv = 8, - oxn = -1, oyn = -1, oxp = 9, oyp = 9, - txn = 281, tyn = 106, txp = 291, typ = 116, -} -glyphs[172] = { --'¬'-- - num = 172, - adv = 8, - oxn = -2, oyn = -1, oxp = 10, oyp = 8, - txn = 301, tyn = 106, txp = 313, typ = 115, -} -glyphs[173] = { --'­'-- - num = 173, - adv = 6, - oxn = -2, oyn = -2, oxp = 7, oyp = 12, - txn = 321, tyn = 106, txp = 330, typ = 120, -} -glyphs[174] = { --'®'-- - num = 174, - adv = 10, - oxn = -3, oyn = -3, oxp = 13, oyp = 13, - txn = 341, tyn = 106, txp = 357, typ = 122, -} -glyphs[175] = { --'¯'-- - num = 175, - adv = 5, - oxn = -2, oyn = 6, oxp = 7, oyp = 13, - txn = 361, tyn = 106, txp = 370, typ = 113, -} -glyphs[176] = { --'°'-- - num = 176, - adv = 8, - oxn = 0, oyn = 3, oxp = 9, oyp = 12, - txn = 381, tyn = 106, txp = 390, typ = 115, -} -glyphs[177] = { --'±'-- - num = 177, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 11, - txn = 401, tyn = 106, txp = 413, typ = 120, -} -glyphs[178] = { --'²'-- - num = 178, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 421, tyn = 106, txp = 430, typ = 118, -} -glyphs[179] = { --'³'-- - num = 179, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 441, tyn = 106, txp = 450, typ = 118, -} -glyphs[180] = { --'´'-- - num = 180, - adv = 5, - oxn = -1, oyn = 6, oxp = 7, oyp = 13, - txn = 461, tyn = 106, txp = 469, typ = 113, -} -glyphs[181] = { --'µ'-- - num = 181, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 10, - txn = 481, tyn = 106, txp = 494, typ = 122, -} -glyphs[182] = { --'¶'-- - num = 182, - adv = 8, - oxn = -2, oyn = -5, oxp = 10, oyp = 13, - txn = 1, tyn = 127, txp = 13, typ = 145, -} -glyphs[183] = { --'·'-- - num = 183, - adv = 4, - oxn = -2, oyn = 0, oxp = 5, oyp = 7, - txn = 21, tyn = 127, txp = 28, typ = 134, -} -glyphs[184] = { --'¸'-- - num = 184, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 2, - txn = 41, tyn = 127, txp = 50, typ = 135, -} -glyphs[185] = { --'¹'-- - num = 185, - adv = 5, - oxn = -2, oyn = 1, oxp = 6, oyp = 12, - txn = 61, tyn = 127, txp = 69, typ = 138, -} -glyphs[186] = { --'º'-- - num = 186, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 13, - txn = 81, tyn = 127, txp = 90, typ = 139, -} -glyphs[187] = { --'»'-- - num = 187, - adv = 8, - oxn = -1, oyn = -1, oxp = 9, oyp = 9, - txn = 101, tyn = 127, txp = 111, typ = 137, -} -glyphs[188] = { --'¼'-- - num = 188, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 121, tyn = 127, txp = 137, typ = 143, -} -glyphs[189] = { --'½'-- - num = 189, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 141, tyn = 127, txp = 157, typ = 143, -} -glyphs[190] = { --'¾'-- - num = 190, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 13, - txn = 161, tyn = 127, txp = 177, typ = 143, -} -glyphs[191] = { --'¿'-- - num = 191, - adv = 9, - oxn = -2, oyn = -5, oxp = 10, oyp = 10, - txn = 181, tyn = 127, txp = 193, typ = 142, -} -glyphs[192] = { --'À'-- - num = 192, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 201, tyn = 127, txp = 215, typ = 145, -} -glyphs[193] = { --'Á'-- - num = 193, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 15, - txn = 221, tyn = 127, txp = 235, typ = 144, -} -glyphs[194] = { --'Â'-- - num = 194, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 241, tyn = 127, txp = 255, typ = 145, -} -glyphs[195] = { --'Ã'-- - num = 195, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 261, tyn = 127, txp = 275, typ = 145, -} -glyphs[196] = { --'Ä'-- - num = 196, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 281, tyn = 127, txp = 295, typ = 145, -} -glyphs[197] = { --'Å'-- - num = 197, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 301, tyn = 127, txp = 315, typ = 145, -} -glyphs[198] = { --'Æ'-- - num = 198, - adv = 14, - oxn = -2, oyn = -2, oxp = 16, oyp = 13, - txn = 321, tyn = 127, txp = 339, typ = 142, -} -glyphs[199] = { --'Ç'-- - num = 199, - adv = 10, - oxn = -2, oyn = -6, oxp = 12, oyp = 13, - txn = 341, tyn = 127, txp = 355, typ = 146, -} -glyphs[200] = { --'È'-- - num = 200, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 361, tyn = 127, txp = 373, typ = 145, -} -glyphs[201] = { --'É'-- - num = 201, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 381, tyn = 127, txp = 393, typ = 145, -} -glyphs[202] = { --'Ê'-- - num = 202, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 401, tyn = 127, txp = 413, typ = 145, -} -glyphs[203] = { --'Ë'-- - num = 203, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 16, - txn = 421, tyn = 127, txp = 433, typ = 145, -} -glyphs[204] = { --'Ì'-- - num = 204, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 16, - txn = 441, tyn = 127, txp = 448, typ = 145, -} -glyphs[205] = { --'Í'-- - num = 205, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 461, tyn = 127, txp = 470, typ = 145, -} -glyphs[206] = { --'Î'-- - num = 206, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 481, tyn = 127, txp = 490, typ = 145, -} -glyphs[207] = { --'Ï'-- - num = 207, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 16, - txn = 1, tyn = 148, txp = 10, typ = 166, -} -glyphs[208] = { --'Ð'-- - num = 208, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 13, - txn = 21, tyn = 148, txp = 35, typ = 163, -} -glyphs[209] = { --'Ñ'-- - num = 209, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 41, tyn = 148, txp = 55, typ = 166, -} -glyphs[210] = { --'Ò'-- - num = 210, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 61, tyn = 148, txp = 76, typ = 167, -} -glyphs[211] = { --'Ó'-- - num = 211, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 81, tyn = 148, txp = 96, typ = 167, -} -glyphs[212] = { --'Ô'-- - num = 212, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 101, tyn = 148, txp = 116, typ = 167, -} -glyphs[213] = { --'Õ'-- - num = 213, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 121, tyn = 148, txp = 136, typ = 167, -} -glyphs[214] = { --'Ö'-- - num = 214, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 16, - txn = 141, tyn = 148, txp = 156, typ = 167, -} -glyphs[215] = { --'×'-- - num = 215, - adv = 8, - oxn = -1, oyn = -2, oxp = 10, oyp = 9, - txn = 161, tyn = 148, txp = 172, typ = 159, -} -glyphs[216] = { --'Ø'-- - num = 216, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 13, - txn = 181, tyn = 148, txp = 196, typ = 164, -} -glyphs[217] = { --'Ù'-- - num = 217, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 201, tyn = 148, txp = 214, typ = 167, -} -glyphs[218] = { --'Ú'-- - num = 218, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 221, tyn = 148, txp = 234, typ = 167, -} -glyphs[219] = { --'Û'-- - num = 219, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 241, tyn = 148, txp = 254, typ = 167, -} -glyphs[220] = { --'Ü'-- - num = 220, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 16, - txn = 261, tyn = 148, txp = 274, typ = 167, -} -glyphs[221] = { --'Ý'-- - num = 221, - adv = 9, - oxn = -2, oyn = -2, oxp = 12, oyp = 16, - txn = 281, tyn = 148, txp = 295, typ = 166, -} -glyphs[222] = { --'Þ'-- - num = 222, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 13, - txn = 301, tyn = 148, txp = 313, typ = 163, -} -glyphs[223] = { --'ß'-- - num = 223, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 13, - txn = 321, tyn = 148, txp = 334, typ = 164, -} -glyphs[224] = { --'à'-- - num = 224, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 341, tyn = 148, txp = 353, typ = 164, -} -glyphs[225] = { --'á'-- - num = 225, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 148, txp = 373, typ = 164, -} -glyphs[226] = { --'â'-- - num = 226, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 148, txp = 393, typ = 164, -} -glyphs[227] = { --'ã'-- - num = 227, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 401, tyn = 148, txp = 413, typ = 164, -} -glyphs[228] = { --'ä'-- - num = 228, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 421, tyn = 148, txp = 433, typ = 164, -} -glyphs[229] = { --'å'-- - num = 229, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 441, tyn = 148, txp = 453, typ = 164, -} -glyphs[230] = { --'æ'-- - num = 230, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 10, - txn = 461, tyn = 148, txp = 477, typ = 161, -} -glyphs[231] = { --'ç'-- - num = 231, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 10, - txn = 481, tyn = 148, txp = 493, typ = 164, -} -glyphs[232] = { --'è'-- - num = 232, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 1, tyn = 169, txp = 13, typ = 185, -} -glyphs[233] = { --'é'-- - num = 233, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 21, tyn = 169, txp = 33, typ = 185, -} -glyphs[234] = { --'ê'-- - num = 234, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 41, tyn = 169, txp = 53, typ = 185, -} -glyphs[235] = { --'ë'-- - num = 235, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 61, tyn = 169, txp = 73, typ = 185, -} -glyphs[236] = { --'ì'-- - num = 236, - adv = 4, - oxn = -2, oyn = -2, oxp = 5, oyp = 13, - txn = 81, tyn = 169, txp = 88, typ = 184, -} -glyphs[237] = { --'í'-- - num = 237, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 101, tyn = 169, txp = 110, typ = 184, -} -glyphs[238] = { --'î'-- - num = 238, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 121, tyn = 169, txp = 130, typ = 184, -} -glyphs[239] = { --'ï'-- - num = 239, - adv = 4, - oxn = -2, oyn = -2, oxp = 7, oyp = 13, - txn = 141, tyn = 169, txp = 150, typ = 184, -} -glyphs[240] = { --'ð'-- - num = 240, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 161, tyn = 169, txp = 173, typ = 185, -} -glyphs[241] = { --'ñ'-- - num = 241, - adv = 9, - oxn = -2, oyn = -2, oxp = 10, oyp = 13, - txn = 181, tyn = 169, txp = 193, typ = 184, -} -glyphs[242] = { --'ò'-- - num = 242, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 201, tyn = 169, txp = 213, typ = 185, -} -glyphs[243] = { --'ó'-- - num = 243, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 221, tyn = 169, txp = 233, typ = 185, -} -glyphs[244] = { --'ô'-- - num = 244, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 241, tyn = 169, txp = 253, typ = 185, -} -glyphs[245] = { --'õ'-- - num = 245, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 261, tyn = 169, txp = 273, typ = 185, -} -glyphs[246] = { --'ö'-- - num = 246, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 281, tyn = 169, txp = 293, typ = 185, -} -glyphs[247] = { --'÷'-- - num = 247, - adv = 8, - oxn = -2, oyn = -3, oxp = 10, oyp = 9, - txn = 301, tyn = 169, txp = 313, typ = 181, -} -glyphs[248] = { --'ø'-- - num = 248, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 321, tyn = 169, txp = 334, typ = 182, -} -glyphs[249] = { --'ù'-- - num = 249, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 341, tyn = 169, txp = 353, typ = 185, -} -glyphs[250] = { --'ú'-- - num = 250, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 361, tyn = 169, txp = 373, typ = 185, -} -glyphs[251] = { --'û'-- - num = 251, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 381, tyn = 169, txp = 393, typ = 185, -} -glyphs[252] = { --'ü'-- - num = 252, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 13, - txn = 401, tyn = 169, txp = 413, typ = 185, -} -glyphs[253] = { --'ý'-- - num = 253, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 13, - txn = 421, tyn = 169, txp = 433, typ = 188, -} -glyphs[254] = { --'þ'-- - num = 254, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 13, - txn = 441, tyn = 169, txp = 454, typ = 188, -} -glyphs[255] = { --'ÿ'-- - num = 255, - adv = 8, - oxn = -2, oyn = -6, oxp = 10, oyp = 13, - txn = 461, tyn = 169, txp = 473, typ = 188, -} - -fontSpecs.glyphs = glyphs - -return fontSpecs - diff --git a/LuaUI/Fonts/FreeSansBold_14.png b/LuaUI/Fonts/FreeSansBold_14.png deleted file mode 100644 index 01c39b386..000000000 Binary files a/LuaUI/Fonts/FreeSansBold_14.png and /dev/null differ diff --git a/LuaUI/Fonts/FreeSansBold_16.lua b/LuaUI/Fonts/FreeSansBold_16.lua deleted file mode 100644 index 5b5ad4041..000000000 --- a/LuaUI/Fonts/FreeSansBold_16.lua +++ /dev/null @@ -1,1365 +0,0 @@ --- $Id: FreeSansBold_16.lua 3171 2008-11-06 09:06:29Z det $ - -local fontSpecs = { - srcFile = [[FreeSansBold.ttf]], - family = [[FreeSans]], - style = [[Bold]], - yStep = 17, - height = 16, - xTexSize = 512, - yTexSize = 256, - outlineRadius = 2, - outlineWeight = 100, -} - -local glyphs = {} - -glyphs[32] = { --' '-- - num = 32, - adv = 4, - oxn = -2, oyn = -3, oxp = 3, oyp = 2, - txn = 1, tyn = 1, txp = 6, typ = 6, -} -glyphs[33] = { --'!'-- - num = 33, - adv = 5, - oxn = -1, oyn = -2, oxp = 7, oyp = 14, - txn = 23, tyn = 1, txp = 31, typ = 17, -} -glyphs[34] = { --'"'-- - num = 34, - adv = 8, - oxn = -2, oyn = 5, oxp = 9, oyp = 14, - txn = 45, tyn = 1, txp = 56, typ = 10, -} -glyphs[35] = { --'#'-- - num = 35, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 67, tyn = 1, txp = 80, typ = 18, -} -glyphs[36] = { --'$'-- - num = 36, - adv = 9, - oxn = -2, oyn = -5, oxp = 11, oyp = 15, - txn = 89, tyn = 1, txp = 102, typ = 21, -} -glyphs[37] = { --'%'-- - num = 37, - adv = 14, - oxn = -2, oyn = -3, oxp = 16, oyp = 14, - txn = 111, tyn = 1, txp = 129, typ = 18, -} -glyphs[38] = { --'&'-- - num = 38, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 14, - txn = 133, tyn = 1, txp = 149, typ = 18, -} -glyphs[39] = { --'''-- - num = 39, - adv = 4, - oxn = -2, oyn = 5, oxp = 6, oyp = 14, - txn = 155, tyn = 1, txp = 163, typ = 10, -} -glyphs[40] = { --'('-- - num = 40, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 14, - txn = 177, tyn = 1, txp = 186, typ = 21, -} -glyphs[41] = { --')'-- - num = 41, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 14, - txn = 199, tyn = 1, txp = 208, typ = 21, -} -glyphs[42] = { --'*'-- - num = 42, - adv = 6, - oxn = -2, oyn = 4, oxp = 8, oyp = 14, - txn = 221, tyn = 1, txp = 231, typ = 11, -} -glyphs[43] = { --'+'-- - num = 43, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 243, tyn = 1, txp = 256, typ = 14, -} -glyphs[44] = { --','-- - num = 44, - adv = 4, - oxn = -1, oyn = -5, oxp = 6, oyp = 5, - txn = 265, tyn = 1, txp = 272, typ = 11, -} -glyphs[45] = { --'-'-- - num = 45, - adv = 5, - oxn = -2, oyn = 1, oxp = 7, oyp = 8, - txn = 287, tyn = 1, txp = 296, typ = 8, -} -glyphs[46] = { --'.'-- - num = 46, - adv = 4, - oxn = -1, oyn = -2, oxp = 6, oyp = 5, - txn = 309, tyn = 1, txp = 316, typ = 8, -} -glyphs[47] = { --'/'-- - num = 47, - adv = 4, - oxn = -2, oyn = -3, oxp = 7, oyp = 14, - txn = 331, tyn = 1, txp = 340, typ = 18, -} -glyphs[48] = { --'0'-- - num = 48, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 353, tyn = 1, txp = 366, typ = 18, -} -glyphs[49] = { --'1'-- - num = 49, - adv = 9, - oxn = -1, oyn = -2, oxp = 9, oyp = 14, - txn = 375, tyn = 1, txp = 385, typ = 17, -} -glyphs[50] = { --'2'-- - num = 50, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 14, - txn = 397, tyn = 1, txp = 410, typ = 17, -} -glyphs[51] = { --'3'-- - num = 51, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 419, tyn = 1, txp = 432, typ = 18, -} -glyphs[52] = { --'4'-- - num = 52, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 14, - txn = 441, tyn = 1, txp = 454, typ = 17, -} -glyphs[53] = { --'5'-- - num = 53, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 463, tyn = 1, txp = 476, typ = 18, -} -glyphs[54] = { --'6'-- - num = 54, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 485, tyn = 1, txp = 498, typ = 18, -} -glyphs[55] = { --'7'-- - num = 55, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 14, - txn = 1, tyn = 24, txp = 14, typ = 40, -} -glyphs[56] = { --'8'-- - num = 56, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 23, tyn = 24, txp = 36, typ = 41, -} -glyphs[57] = { --'9'-- - num = 57, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 45, tyn = 24, txp = 58, typ = 41, -} -glyphs[58] = { --':'-- - num = 58, - adv = 5, - oxn = -1, oyn = -2, oxp = 7, oyp = 11, - txn = 67, tyn = 24, txp = 75, typ = 37, -} -glyphs[59] = { --';'-- - num = 59, - adv = 5, - oxn = -1, oyn = -5, oxp = 7, oyp = 11, - txn = 89, tyn = 24, txp = 97, typ = 40, -} -glyphs[60] = { --'<'-- - num = 60, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 111, tyn = 24, txp = 124, typ = 37, -} -glyphs[61] = { --'='-- - num = 61, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 9, - txn = 133, tyn = 24, txp = 146, typ = 35, -} -glyphs[62] = { --'>'-- - num = 62, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 155, tyn = 24, txp = 168, typ = 37, -} -glyphs[63] = { --'?'-- - num = 63, - adv = 10, - oxn = -1, oyn = -2, oxp = 11, oyp = 14, - txn = 177, tyn = 24, txp = 189, typ = 40, -} -glyphs[64] = { --'@'-- - num = 64, - adv = 16, - oxn = -2, oyn = -5, oxp = 18, oyp = 14, - txn = 199, tyn = 24, txp = 219, typ = 43, -} -glyphs[65] = { --'A'-- - num = 65, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 14, - txn = 221, tyn = 24, txp = 237, typ = 40, -} -glyphs[66] = { --'B'-- - num = 66, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 243, tyn = 24, txp = 257, typ = 40, -} -glyphs[67] = { --'C'-- - num = 67, - adv = 12, - oxn = -2, oyn = -3, oxp = 13, oyp = 14, - txn = 265, tyn = 24, txp = 280, typ = 41, -} -glyphs[68] = { --'D'-- - num = 68, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 287, tyn = 24, txp = 301, typ = 40, -} -glyphs[69] = { --'E'-- - num = 69, - adv = 11, - oxn = -1, oyn = -2, oxp = 12, oyp = 14, - txn = 309, tyn = 24, txp = 322, typ = 40, -} -glyphs[70] = { --'F'-- - num = 70, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 14, - txn = 331, tyn = 24, txp = 344, typ = 40, -} -glyphs[71] = { --'G'-- - num = 71, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 14, - txn = 353, tyn = 24, txp = 369, typ = 41, -} -glyphs[72] = { --'H'-- - num = 72, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 375, tyn = 24, txp = 389, typ = 40, -} -glyphs[73] = { --'I'-- - num = 73, - adv = 4, - oxn = -1, oyn = -2, oxp = 6, oyp = 14, - txn = 397, tyn = 24, txp = 404, typ = 40, -} -glyphs[74] = { --'J'-- - num = 74, - adv = 9, - oxn = -2, oyn = -3, oxp = 10, oyp = 14, - txn = 419, tyn = 24, txp = 431, typ = 41, -} -glyphs[75] = { --'K'-- - num = 75, - adv = 12, - oxn = -1, oyn = -2, oxp = 14, oyp = 14, - txn = 441, tyn = 24, txp = 456, typ = 40, -} -glyphs[76] = { --'L'-- - num = 76, - adv = 10, - oxn = -1, oyn = -2, oxp = 12, oyp = 14, - txn = 463, tyn = 24, txp = 476, typ = 40, -} -glyphs[77] = { --'M'-- - num = 77, - adv = 13, - oxn = -1, oyn = -2, oxp = 15, oyp = 14, - txn = 485, tyn = 24, txp = 501, typ = 40, -} -glyphs[78] = { --'N'-- - num = 78, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 1, tyn = 47, txp = 15, typ = 63, -} -glyphs[79] = { --'O'-- - num = 79, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 14, - txn = 23, tyn = 47, txp = 39, typ = 64, -} -glyphs[80] = { --'P'-- - num = 80, - adv = 11, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 45, tyn = 47, txp = 59, typ = 63, -} -glyphs[81] = { --'Q'-- - num = 81, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 14, - txn = 67, tyn = 47, txp = 83, typ = 64, -} -glyphs[82] = { --'R'-- - num = 82, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 89, tyn = 47, txp = 103, typ = 63, -} -glyphs[83] = { --'S'-- - num = 83, - adv = 11, - oxn = -2, oyn = -3, oxp = 13, oyp = 14, - txn = 111, tyn = 47, txp = 126, typ = 64, -} -glyphs[84] = { --'T'-- - num = 84, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 14, - txn = 133, tyn = 47, txp = 147, typ = 63, -} -glyphs[85] = { --'U'-- - num = 85, - adv = 12, - oxn = -1, oyn = -3, oxp = 13, oyp = 14, - txn = 155, tyn = 47, txp = 169, typ = 64, -} -glyphs[86] = { --'V'-- - num = 86, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 14, - txn = 177, tyn = 47, txp = 192, typ = 63, -} -glyphs[87] = { --'W'-- - num = 87, - adv = 15, - oxn = -2, oyn = -2, oxp = 17, oyp = 14, - txn = 199, tyn = 47, txp = 218, typ = 63, -} -glyphs[88] = { --'X'-- - num = 88, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 14, - txn = 221, tyn = 47, txp = 236, typ = 63, -} -glyphs[89] = { --'Y'-- - num = 89, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 14, - txn = 243, tyn = 47, txp = 258, typ = 63, -} -glyphs[90] = { --'Z'-- - num = 90, - adv = 10, - oxn = -2, oyn = -2, oxp = 12, oyp = 14, - txn = 265, tyn = 47, txp = 279, typ = 63, -} -glyphs[91] = { --'['-- - num = 91, - adv = 5, - oxn = -1, oyn = -6, oxp = 7, oyp = 14, - txn = 287, tyn = 47, txp = 295, typ = 67, -} -glyphs[92] = { --'\'-- - num = 92, - adv = 4, - oxn = -3, oyn = -3, oxp = 7, oyp = 14, - txn = 309, tyn = 47, txp = 319, typ = 64, -} -glyphs[93] = { --']'-- - num = 93, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 14, - txn = 331, tyn = 47, txp = 340, typ = 67, -} -glyphs[94] = { --'^'-- - num = 94, - adv = 9, - oxn = -2, oyn = 2, oxp = 11, oyp = 14, - txn = 353, tyn = 47, txp = 366, typ = 59, -} -glyphs[95] = { --'_'-- - num = 95, - adv = 9, - oxn = -3, oyn = -6, oxp = 12, oyp = 1, - txn = 375, tyn = 47, txp = 390, typ = 54, -} -glyphs[96] = { --'`'-- - num = 96, - adv = 5, - oxn = -2, oyn = 7, oxp = 6, oyp = 15, - txn = 397, tyn = 47, txp = 405, typ = 55, -} -glyphs[97] = { --'a'-- - num = 97, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 11, - txn = 419, tyn = 47, txp = 432, typ = 61, -} -glyphs[98] = { --'b'-- - num = 98, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 14, - txn = 441, tyn = 47, txp = 455, typ = 64, -} -glyphs[99] = { --'c'-- - num = 99, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 11, - txn = 463, tyn = 47, txp = 476, typ = 61, -} -glyphs[100] = { --'d'-- - num = 100, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 485, tyn = 47, txp = 498, typ = 64, -} -glyphs[101] = { --'e'-- - num = 101, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 11, - txn = 1, tyn = 70, txp = 14, typ = 84, -} -glyphs[102] = { --'f'-- - num = 102, - adv = 5, - oxn = -2, oyn = -2, oxp = 8, oyp = 14, - txn = 23, tyn = 70, txp = 33, typ = 86, -} -glyphs[103] = { --'g'-- - num = 103, - adv = 10, - oxn = -2, oyn = -6, oxp = 11, oyp = 11, - txn = 45, tyn = 70, txp = 58, typ = 87, -} -glyphs[104] = { --'h'-- - num = 104, - adv = 10, - oxn = -1, oyn = -2, oxp = 11, oyp = 14, - txn = 67, tyn = 70, txp = 79, typ = 86, -} -glyphs[105] = { --'i'-- - num = 105, - adv = 4, - oxn = -1, oyn = -2, oxp = 6, oyp = 14, - txn = 89, tyn = 70, txp = 96, typ = 86, -} -glyphs[106] = { --'j'-- - num = 106, - adv = 4, - oxn = -2, oyn = -6, oxp = 6, oyp = 14, - txn = 111, tyn = 70, txp = 119, typ = 90, -} -glyphs[107] = { --'k'-- - num = 107, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 14, - txn = 133, tyn = 70, txp = 146, typ = 86, -} -glyphs[108] = { --'l'-- - num = 108, - adv = 4, - oxn = -1, oyn = -2, oxp = 6, oyp = 14, - txn = 155, tyn = 70, txp = 162, typ = 86, -} -glyphs[109] = { --'m'-- - num = 109, - adv = 14, - oxn = -2, oyn = -2, oxp = 16, oyp = 11, - txn = 177, tyn = 70, txp = 195, typ = 83, -} -glyphs[110] = { --'n'-- - num = 110, - adv = 10, - oxn = -1, oyn = -2, oxp = 11, oyp = 11, - txn = 199, tyn = 70, txp = 211, typ = 83, -} -glyphs[111] = { --'o'-- - num = 111, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 11, - txn = 221, tyn = 70, txp = 235, typ = 84, -} -glyphs[112] = { --'p'-- - num = 112, - adv = 10, - oxn = -2, oyn = -6, oxp = 12, oyp = 11, - txn = 243, tyn = 70, txp = 257, typ = 87, -} -glyphs[113] = { --'q'-- - num = 113, - adv = 10, - oxn = -2, oyn = -6, oxp = 11, oyp = 11, - txn = 265, tyn = 70, txp = 278, typ = 87, -} -glyphs[114] = { --'r'-- - num = 114, - adv = 6, - oxn = -1, oyn = -2, oxp = 8, oyp = 11, - txn = 287, tyn = 70, txp = 296, typ = 83, -} -glyphs[115] = { --'s'-- - num = 115, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 11, - txn = 309, tyn = 70, txp = 322, typ = 84, -} -glyphs[116] = { --'t'-- - num = 116, - adv = 5, - oxn = -2, oyn = -3, oxp = 7, oyp = 13, - txn = 331, tyn = 70, txp = 340, typ = 86, -} -glyphs[117] = { --'u'-- - num = 117, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 11, - txn = 353, tyn = 70, txp = 366, typ = 84, -} -glyphs[118] = { --'v'-- - num = 118, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 11, - txn = 375, tyn = 70, txp = 388, typ = 83, -} -glyphs[119] = { --'w'-- - num = 119, - adv = 12, - oxn = -2, oyn = -2, oxp = 15, oyp = 11, - txn = 397, tyn = 70, txp = 414, typ = 83, -} -glyphs[120] = { --'x'-- - num = 120, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 11, - txn = 419, tyn = 70, txp = 432, typ = 83, -} -glyphs[121] = { --'y'-- - num = 121, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 11, - txn = 441, tyn = 70, txp = 454, typ = 87, -} -glyphs[122] = { --'z'-- - num = 122, - adv = 8, - oxn = -2, oyn = -2, oxp = 10, oyp = 11, - txn = 463, tyn = 70, txp = 475, typ = 83, -} -glyphs[123] = { --'{'-- - num = 123, - adv = 6, - oxn = -2, oyn = -6, oxp = 8, oyp = 14, - txn = 485, tyn = 70, txp = 495, typ = 90, -} -glyphs[124] = { --'|'-- - num = 124, - adv = 4, - oxn = -1, oyn = -6, oxp = 5, oyp = 14, - txn = 1, tyn = 93, txp = 7, typ = 113, -} -glyphs[125] = { --'}'-- - num = 125, - adv = 6, - oxn = -1, oyn = -6, oxp = 8, oyp = 14, - txn = 23, tyn = 93, txp = 32, typ = 113, -} -glyphs[126] = { --'~'-- - num = 126, - adv = 9, - oxn = -2, oyn = 0, oxp = 11, oyp = 8, - txn = 45, tyn = 93, txp = 58, typ = 101, -} -glyphs[127] = { --''-- - num = 127, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 67, tyn = 93, txp = 77, typ = 108, -} -glyphs[128] = { --'€'-- - num = 128, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 89, tyn = 93, txp = 99, typ = 108, -} -glyphs[129] = { --'�'-- - num = 129, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 111, tyn = 93, txp = 121, typ = 108, -} -glyphs[130] = { --'‚'-- - num = 130, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 133, tyn = 93, txp = 143, typ = 108, -} -glyphs[131] = { --'ƒ'-- - num = 131, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 155, tyn = 93, txp = 165, typ = 108, -} -glyphs[132] = { --'„'-- - num = 132, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 177, tyn = 93, txp = 187, typ = 108, -} -glyphs[133] = { --'…'-- - num = 133, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 199, tyn = 93, txp = 209, typ = 108, -} -glyphs[134] = { --'†'-- - num = 134, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 221, tyn = 93, txp = 231, typ = 108, -} -glyphs[135] = { --'‡'-- - num = 135, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 243, tyn = 93, txp = 253, typ = 108, -} -glyphs[136] = { --'ˆ'-- - num = 136, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 265, tyn = 93, txp = 275, typ = 108, -} -glyphs[137] = { --'‰'-- - num = 137, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 287, tyn = 93, txp = 297, typ = 108, -} -glyphs[138] = { --'Š'-- - num = 138, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 309, tyn = 93, txp = 319, typ = 108, -} -glyphs[139] = { --'‹'-- - num = 139, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 331, tyn = 93, txp = 341, typ = 108, -} -glyphs[140] = { --'Œ'-- - num = 140, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 353, tyn = 93, txp = 363, typ = 108, -} -glyphs[141] = { --'�'-- - num = 141, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 375, tyn = 93, txp = 385, typ = 108, -} -glyphs[142] = { --'Ž'-- - num = 142, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 397, tyn = 93, txp = 407, typ = 108, -} -glyphs[143] = { --'�'-- - num = 143, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 419, tyn = 93, txp = 429, typ = 108, -} -glyphs[144] = { --'�'-- - num = 144, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 441, tyn = 93, txp = 451, typ = 108, -} -glyphs[145] = { --'‘'-- - num = 145, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 463, tyn = 93, txp = 473, typ = 108, -} -glyphs[146] = { --'’'-- - num = 146, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 485, tyn = 93, txp = 495, typ = 108, -} -glyphs[147] = { --'“'-- - num = 147, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 1, tyn = 116, txp = 11, typ = 131, -} -glyphs[148] = { --'”'-- - num = 148, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 23, tyn = 116, txp = 33, typ = 131, -} -glyphs[149] = { --'•'-- - num = 149, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 45, tyn = 116, txp = 55, typ = 131, -} -glyphs[150] = { --'–'-- - num = 150, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 67, tyn = 116, txp = 77, typ = 131, -} -glyphs[151] = { --'—'-- - num = 151, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 89, tyn = 116, txp = 99, typ = 131, -} -glyphs[152] = { --'˜'-- - num = 152, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 111, tyn = 116, txp = 121, typ = 131, -} -glyphs[153] = { --'™'-- - num = 153, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 133, tyn = 116, txp = 143, typ = 131, -} -glyphs[154] = { --'š'-- - num = 154, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 155, tyn = 116, txp = 165, typ = 131, -} -glyphs[155] = { --'›'-- - num = 155, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 177, tyn = 116, txp = 187, typ = 131, -} -glyphs[156] = { --'œ'-- - num = 156, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 199, tyn = 116, txp = 209, typ = 131, -} -glyphs[157] = { --'�'-- - num = 157, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 221, tyn = 116, txp = 231, typ = 131, -} -glyphs[158] = { --'ž'-- - num = 158, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 243, tyn = 116, txp = 253, typ = 131, -} -glyphs[159] = { --'Ÿ'-- - num = 159, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 265, tyn = 116, txp = 275, typ = 131, -} -glyphs[160] = { --' '-- - num = 160, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 287, tyn = 116, txp = 297, typ = 131, -} -glyphs[161] = { --'¡'-- - num = 161, - adv = 5, - oxn = -1, oyn = -5, oxp = 6, oyp = 11, - txn = 309, tyn = 116, txp = 316, typ = 132, -} -glyphs[162] = { --'¢'-- - num = 162, - adv = 9, - oxn = -2, oyn = -4, oxp = 11, oyp = 13, - txn = 331, tyn = 116, txp = 344, typ = 133, -} -glyphs[163] = { --'£'-- - num = 163, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 353, tyn = 116, txp = 366, typ = 133, -} -glyphs[164] = { --'¤'-- - num = 164, - adv = 9, - oxn = -2, oyn = -1, oxp = 11, oyp = 12, - txn = 375, tyn = 116, txp = 388, typ = 129, -} -glyphs[165] = { --'¥'-- - num = 165, - adv = 9, - oxn = -2, oyn = -2, oxp = 11, oyp = 14, - txn = 397, tyn = 116, txp = 410, typ = 132, -} -glyphs[166] = { --'¦'-- - num = 166, - adv = 4, - oxn = -1, oyn = -6, oxp = 5, oyp = 14, - txn = 419, tyn = 116, txp = 425, typ = 136, -} -glyphs[167] = { --'§'-- - num = 167, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 14, - txn = 441, tyn = 116, txp = 454, typ = 136, -} -glyphs[168] = { --'¨'-- - num = 168, - adv = 5, - oxn = -2, oyn = 7, oxp = 8, oyp = 14, - txn = 463, tyn = 116, txp = 473, typ = 123, -} -glyphs[169] = { --'©'-- - num = 169, - adv = 12, - oxn = -3, oyn = -3, oxp = 15, oyp = 14, - txn = 485, tyn = 116, txp = 503, typ = 133, -} -glyphs[170] = { --'ª'-- - num = 170, - adv = 6, - oxn = -2, oyn = 2, oxp = 8, oyp = 14, - txn = 1, tyn = 139, txp = 11, typ = 151, -} -glyphs[171] = { --'«'-- - num = 171, - adv = 9, - oxn = -1, oyn = -1, oxp = 10, oyp = 10, - txn = 23, tyn = 139, txp = 34, typ = 150, -} -glyphs[172] = { --'¬'-- - num = 172, - adv = 9, - oxn = -2, oyn = -1, oxp = 11, oyp = 8, - txn = 45, tyn = 139, txp = 58, typ = 148, -} -glyphs[173] = { --'­'-- - num = 173, - adv = 7, - oxn = -1, oyn = -2, oxp = 9, oyp = 13, - txn = 67, tyn = 139, txp = 77, typ = 154, -} -glyphs[174] = { --'®'-- - num = 174, - adv = 12, - oxn = -3, oyn = -3, oxp = 15, oyp = 14, - txn = 89, tyn = 139, txp = 107, typ = 156, -} -glyphs[175] = { --'¯'-- - num = 175, - adv = 5, - oxn = -2, oyn = 8, oxp = 8, oyp = 14, - txn = 111, tyn = 139, txp = 121, typ = 145, -} -glyphs[176] = { --'°'-- - num = 176, - adv = 10, - oxn = 0, oyn = 4, oxp = 10, oyp = 13, - txn = 133, tyn = 139, txp = 143, typ = 148, -} -glyphs[177] = { --'±'-- - num = 177, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 12, - txn = 155, tyn = 139, txp = 168, typ = 154, -} -glyphs[178] = { --'²'-- - num = 178, - adv = 6, - oxn = -2, oyn = 2, oxp = 8, oyp = 14, - txn = 177, tyn = 139, txp = 187, typ = 151, -} -glyphs[179] = { --'³'-- - num = 179, - adv = 6, - oxn = -2, oyn = 2, oxp = 8, oyp = 14, - txn = 199, tyn = 139, txp = 209, typ = 151, -} -glyphs[180] = { --'´'-- - num = 180, - adv = 5, - oxn = -1, oyn = 7, oxp = 8, oyp = 15, - txn = 221, tyn = 139, txp = 230, typ = 147, -} -glyphs[181] = { --'µ'-- - num = 181, - adv = 10, - oxn = -2, oyn = -6, oxp = 12, oyp = 11, - txn = 243, tyn = 139, txp = 257, typ = 156, -} -glyphs[182] = { --'¶'-- - num = 182, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 14, - txn = 265, tyn = 139, txp = 278, typ = 159, -} -glyphs[183] = { --'·'-- - num = 183, - adv = 4, - oxn = -1, oyn = 0, oxp = 6, oyp = 7, - txn = 287, tyn = 139, txp = 294, typ = 146, -} -glyphs[184] = { --'¸'-- - num = 184, - adv = 5, - oxn = -2, oyn = -6, oxp = 7, oyp = 2, - txn = 309, tyn = 139, txp = 318, typ = 147, -} -glyphs[185] = { --'¹'-- - num = 185, - adv = 6, - oxn = -2, oyn = 2, oxp = 6, oyp = 14, - txn = 331, tyn = 139, txp = 339, typ = 151, -} -glyphs[186] = { --'º'-- - num = 186, - adv = 6, - oxn = -2, oyn = 2, oxp = 8, oyp = 14, - txn = 353, tyn = 139, txp = 363, typ = 151, -} -glyphs[187] = { --'»'-- - num = 187, - adv = 9, - oxn = -1, oyn = -1, oxp = 10, oyp = 10, - txn = 375, tyn = 139, txp = 386, typ = 150, -} -glyphs[188] = { --'¼'-- - num = 188, - adv = 14, - oxn = -2, oyn = -3, oxp = 16, oyp = 14, - txn = 397, tyn = 139, txp = 415, typ = 156, -} -glyphs[189] = { --'½'-- - num = 189, - adv = 14, - oxn = -2, oyn = -3, oxp = 16, oyp = 14, - txn = 419, tyn = 139, txp = 437, typ = 156, -} -glyphs[190] = { --'¾'-- - num = 190, - adv = 14, - oxn = -2, oyn = -3, oxp = 16, oyp = 14, - txn = 441, tyn = 139, txp = 459, typ = 156, -} -glyphs[191] = { --'¿'-- - num = 191, - adv = 10, - oxn = -2, oyn = -6, oxp = 11, oyp = 11, - txn = 463, tyn = 139, txp = 476, typ = 156, -} -glyphs[192] = { --'À'-- - num = 192, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 18, - txn = 485, tyn = 139, txp = 501, typ = 159, -} -glyphs[193] = { --'Á'-- - num = 193, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 18, - txn = 1, tyn = 162, txp = 17, typ = 182, -} -glyphs[194] = { --'Â'-- - num = 194, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 18, - txn = 23, tyn = 162, txp = 39, typ = 182, -} -glyphs[195] = { --'Ã'-- - num = 195, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 17, - txn = 45, tyn = 162, txp = 61, typ = 181, -} -glyphs[196] = { --'Ä'-- - num = 196, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 17, - txn = 67, tyn = 162, txp = 83, typ = 181, -} -glyphs[197] = { --'Å'-- - num = 197, - adv = 12, - oxn = -2, oyn = -2, oxp = 14, oyp = 18, - txn = 89, tyn = 162, txp = 105, typ = 182, -} -glyphs[198] = { --'Æ'-- - num = 198, - adv = 16, - oxn = -2, oyn = -2, oxp = 18, oyp = 14, - txn = 111, tyn = 162, txp = 131, typ = 178, -} -glyphs[199] = { --'Ç'-- - num = 199, - adv = 12, - oxn = -2, oyn = -6, oxp = 13, oyp = 14, - txn = 133, tyn = 162, txp = 148, typ = 182, -} -glyphs[200] = { --'È'-- - num = 200, - adv = 11, - oxn = -1, oyn = -2, oxp = 12, oyp = 18, - txn = 155, tyn = 162, txp = 168, typ = 182, -} -glyphs[201] = { --'É'-- - num = 201, - adv = 11, - oxn = -1, oyn = -2, oxp = 12, oyp = 18, - txn = 177, tyn = 162, txp = 190, typ = 182, -} -glyphs[202] = { --'Ê'-- - num = 202, - adv = 11, - oxn = -1, oyn = -2, oxp = 12, oyp = 18, - txn = 199, tyn = 162, txp = 212, typ = 182, -} -glyphs[203] = { --'Ë'-- - num = 203, - adv = 11, - oxn = -1, oyn = -2, oxp = 12, oyp = 17, - txn = 221, tyn = 162, txp = 234, typ = 181, -} -glyphs[204] = { --'Ì'-- - num = 204, - adv = 4, - oxn = -2, oyn = -2, oxp = 6, oyp = 18, - txn = 243, tyn = 162, txp = 251, typ = 182, -} -glyphs[205] = { --'Í'-- - num = 205, - adv = 4, - oxn = -1, oyn = -2, oxp = 8, oyp = 18, - txn = 265, tyn = 162, txp = 274, typ = 182, -} -glyphs[206] = { --'Î'-- - num = 206, - adv = 4, - oxn = -2, oyn = -2, oxp = 8, oyp = 18, - txn = 287, tyn = 162, txp = 297, typ = 182, -} -glyphs[207] = { --'Ï'-- - num = 207, - adv = 4, - oxn = -2, oyn = -2, oxp = 8, oyp = 17, - txn = 309, tyn = 162, txp = 319, typ = 181, -} -glyphs[208] = { --'Ð'-- - num = 208, - adv = 12, - oxn = -2, oyn = -2, oxp = 13, oyp = 14, - txn = 331, tyn = 162, txp = 346, typ = 178, -} -glyphs[209] = { --'Ñ'-- - num = 209, - adv = 12, - oxn = -1, oyn = -2, oxp = 13, oyp = 17, - txn = 353, tyn = 162, txp = 367, typ = 181, -} -glyphs[210] = { --'Ò'-- - num = 210, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 18, - txn = 375, tyn = 162, txp = 391, typ = 183, -} -glyphs[211] = { --'Ó'-- - num = 211, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 18, - txn = 397, tyn = 162, txp = 413, typ = 183, -} -glyphs[212] = { --'Ô'-- - num = 212, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 18, - txn = 419, tyn = 162, txp = 435, typ = 183, -} -glyphs[213] = { --'Õ'-- - num = 213, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 17, - txn = 441, tyn = 162, txp = 457, typ = 182, -} -glyphs[214] = { --'Ö'-- - num = 214, - adv = 12, - oxn = -2, oyn = -3, oxp = 14, oyp = 17, - txn = 463, tyn = 162, txp = 479, typ = 182, -} -glyphs[215] = { --'×'-- - num = 215, - adv = 9, - oxn = -1, oyn = -2, oxp = 11, oyp = 10, - txn = 485, tyn = 162, txp = 497, typ = 174, -} -glyphs[216] = { --'Ø'-- - num = 216, - adv = 12, - oxn = -2, oyn = -3, oxp = 15, oyp = 14, - txn = 1, tyn = 185, txp = 18, typ = 202, -} -glyphs[217] = { --'Ù'-- - num = 217, - adv = 12, - oxn = -1, oyn = -3, oxp = 13, oyp = 18, - txn = 23, tyn = 185, txp = 37, typ = 206, -} -glyphs[218] = { --'Ú'-- - num = 218, - adv = 12, - oxn = -1, oyn = -3, oxp = 13, oyp = 18, - txn = 45, tyn = 185, txp = 59, typ = 206, -} -glyphs[219] = { --'Û'-- - num = 219, - adv = 12, - oxn = -1, oyn = -3, oxp = 13, oyp = 18, - txn = 67, tyn = 185, txp = 81, typ = 206, -} -glyphs[220] = { --'Ü'-- - num = 220, - adv = 12, - oxn = -1, oyn = -3, oxp = 13, oyp = 17, - txn = 89, tyn = 185, txp = 103, typ = 205, -} -glyphs[221] = { --'Ý'-- - num = 221, - adv = 11, - oxn = -2, oyn = -2, oxp = 13, oyp = 18, - txn = 111, tyn = 185, txp = 126, typ = 205, -} -glyphs[222] = { --'Þ'-- - num = 222, - adv = 11, - oxn = -1, oyn = -2, oxp = 13, oyp = 14, - txn = 133, tyn = 185, txp = 147, typ = 201, -} -glyphs[223] = { --'ß'-- - num = 223, - adv = 10, - oxn = -1, oyn = -3, oxp = 12, oyp = 14, - txn = 155, tyn = 185, txp = 168, typ = 202, -} -glyphs[224] = { --'à'-- - num = 224, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 177, tyn = 185, txp = 190, typ = 203, -} -glyphs[225] = { --'á'-- - num = 225, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 199, tyn = 185, txp = 212, typ = 203, -} -glyphs[226] = { --'â'-- - num = 226, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 221, tyn = 185, txp = 234, typ = 203, -} -glyphs[227] = { --'ã'-- - num = 227, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 243, tyn = 185, txp = 256, typ = 202, -} -glyphs[228] = { --'ä'-- - num = 228, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 265, tyn = 185, txp = 278, typ = 202, -} -glyphs[229] = { --'å'-- - num = 229, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 287, tyn = 185, txp = 300, typ = 203, -} -glyphs[230] = { --'æ'-- - num = 230, - adv = 14, - oxn = -2, oyn = -3, oxp = 16, oyp = 11, - txn = 309, tyn = 185, txp = 327, typ = 199, -} -glyphs[231] = { --'ç'-- - num = 231, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 11, - txn = 331, tyn = 185, txp = 344, typ = 202, -} -glyphs[232] = { --'è'-- - num = 232, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 353, tyn = 185, txp = 366, typ = 203, -} -glyphs[233] = { --'é'-- - num = 233, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 375, tyn = 185, txp = 388, typ = 203, -} -glyphs[234] = { --'ê'-- - num = 234, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 397, tyn = 185, txp = 410, typ = 203, -} -glyphs[235] = { --'ë'-- - num = 235, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 419, tyn = 185, txp = 432, typ = 202, -} -glyphs[236] = { --'ì'-- - num = 236, - adv = 4, - oxn = -2, oyn = -2, oxp = 6, oyp = 15, - txn = 441, tyn = 185, txp = 449, typ = 202, -} -glyphs[237] = { --'í'-- - num = 237, - adv = 4, - oxn = -1, oyn = -2, oxp = 8, oyp = 15, - txn = 463, tyn = 185, txp = 472, typ = 202, -} -glyphs[238] = { --'î'-- - num = 238, - adv = 4, - oxn = -2, oyn = -2, oxp = 8, oyp = 15, - txn = 485, tyn = 185, txp = 495, typ = 202, -} -glyphs[239] = { --'ï'-- - num = 239, - adv = 4, - oxn = -2, oyn = -2, oxp = 8, oyp = 14, - txn = 1, tyn = 208, txp = 11, typ = 224, -} -glyphs[240] = { --'ð'-- - num = 240, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 14, - txn = 23, tyn = 208, txp = 37, typ = 225, -} -glyphs[241] = { --'ñ'-- - num = 241, - adv = 10, - oxn = -1, oyn = -2, oxp = 11, oyp = 14, - txn = 45, tyn = 208, txp = 57, typ = 224, -} -glyphs[242] = { --'ò'-- - num = 242, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 15, - txn = 67, tyn = 208, txp = 81, typ = 226, -} -glyphs[243] = { --'ó'-- - num = 243, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 15, - txn = 89, tyn = 208, txp = 103, typ = 226, -} -glyphs[244] = { --'ô'-- - num = 244, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 15, - txn = 111, tyn = 208, txp = 125, typ = 226, -} -glyphs[245] = { --'õ'-- - num = 245, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 14, - txn = 133, tyn = 208, txp = 147, typ = 225, -} -glyphs[246] = { --'ö'-- - num = 246, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 14, - txn = 155, tyn = 208, txp = 169, typ = 225, -} -glyphs[247] = { --'÷'-- - num = 247, - adv = 9, - oxn = -2, oyn = -3, oxp = 11, oyp = 10, - txn = 177, tyn = 208, txp = 190, typ = 221, -} -glyphs[248] = { --'ø'-- - num = 248, - adv = 10, - oxn = -2, oyn = -3, oxp = 12, oyp = 11, - txn = 199, tyn = 208, txp = 213, typ = 222, -} -glyphs[249] = { --'ù'-- - num = 249, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 221, tyn = 208, txp = 234, typ = 226, -} -glyphs[250] = { --'ú'-- - num = 250, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 243, tyn = 208, txp = 256, typ = 226, -} -glyphs[251] = { --'û'-- - num = 251, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 15, - txn = 265, tyn = 208, txp = 278, typ = 226, -} -glyphs[252] = { --'ü'-- - num = 252, - adv = 10, - oxn = -2, oyn = -3, oxp = 11, oyp = 14, - txn = 287, tyn = 208, txp = 300, typ = 225, -} -glyphs[253] = { --'ý'-- - num = 253, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 15, - txn = 309, tyn = 208, txp = 322, typ = 229, -} -glyphs[254] = { --'þ'-- - num = 254, - adv = 10, - oxn = -2, oyn = -6, oxp = 12, oyp = 14, - txn = 331, tyn = 208, txp = 345, typ = 228, -} -glyphs[255] = { --'ÿ'-- - num = 255, - adv = 9, - oxn = -2, oyn = -6, oxp = 11, oyp = 14, - txn = 353, tyn = 208, txp = 366, typ = 228, -} - -fontSpecs.glyphs = glyphs - -return fontSpecs - diff --git a/LuaUI/Fonts/FreeSansBold_16.png b/LuaUI/Fonts/FreeSansBold_16.png deleted file mode 100644 index 4faf177ba..000000000 Binary files a/LuaUI/Fonts/FreeSansBold_16.png and /dev/null differ diff --git a/LuaUI/Fonts/JosefinSans-Bold.ttf b/LuaUI/Fonts/JosefinSans-Bold.ttf new file mode 100644 index 000000000..f4166a1e9 Binary files /dev/null and b/LuaUI/Fonts/JosefinSans-Bold.ttf differ diff --git a/LuaUI/Fonts/JosefinSans-Regular.ttf b/LuaUI/Fonts/JosefinSans-Regular.ttf new file mode 100644 index 000000000..292dcb07e Binary files /dev/null and b/LuaUI/Fonts/JosefinSans-Regular.ttf differ diff --git a/LuaUI/Fonts/JosefinSans-SemiBold(OTF).otf b/LuaUI/Fonts/JosefinSans-SemiBold(OTF).otf new file mode 100644 index 000000000..0f439422e Binary files /dev/null and b/LuaUI/Fonts/JosefinSans-SemiBold(OTF).otf differ diff --git a/LuaUI/Fonts/JosefinSans-SemiBold.ttf b/LuaUI/Fonts/JosefinSans-SemiBold.ttf new file mode 100644 index 000000000..1ca56c76e Binary files /dev/null and b/LuaUI/Fonts/JosefinSans-SemiBold.ttf differ diff --git a/LuaUI/Fonts/Skrawl_40.lua b/LuaUI/Fonts/Skrawl_40.lua index 6f8158554..66ea6b05d 100644 --- a/LuaUI/Fonts/Skrawl_40.lua +++ b/LuaUI/Fonts/Skrawl_40.lua @@ -1,4 +1,3 @@ --- $Id: Skrawl_40.lua 3171 2008-11-06 09:06:29Z det $ local fontSpecs = { srcFile = [[Skrawl.ttf]], diff --git a/LuaUI/Fonts/VISITOR.FON b/LuaUI/Fonts/VISITOR.FON new file mode 100644 index 000000000..31e4c5ba8 Binary files /dev/null and b/LuaUI/Fonts/VISITOR.FON differ diff --git a/LuaUI/Fonts/MicrogrammaDBold.ttf b/LuaUI/Fonts/unlisted/microgrammadbold.ttf similarity index 100% rename from LuaUI/Fonts/MicrogrammaDBold.ttf rename to LuaUI/Fonts/unlisted/microgrammadbold.ttf diff --git a/LuaUI/Fonts/visitor.txt b/LuaUI/Fonts/visitor.txt new file mode 100644 index 000000000..08f1239f0 --- /dev/null +++ b/LuaUI/Fonts/visitor.txt @@ -0,0 +1,86 @@ +______________________________ +Visitor Created by Brian Kent +¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + +Thanks for Downloading Visitor. + +-Visitor TT1 [.ttf] +-Visitor TT2 [.ttf] +-Visitor [7pt] [.fon] + + 'Visitor.fon' is a Windows Bitmap Font (.fon). This font is best +used at 7pt. To use it at larger point sizes (for images), try using +a graphics program like Photo Shop, Paint Shop Pro, or the Paint +program that comes with Windows. Type out your text at the recommended +point size [7pt], then resize the image. Set the color mode to 256 +or 2 colors so the edges don't get blured when resizing, then after you +have the text to the size that you want, then change back to a higher +color mode and edit the image. + + For programs that don't show Bitmap Fonts in the Font Selector, you +may be able to get the font to work by typing in: +visitor -brk- + + The TTF versions were created different ways. TT1 was created from +within FontLab and TT2 was created in Illustrator then imported into +FontLab. I didn't know which one to include so I just included both. + + +If you have any questions or comments, you can e-mail me at +kentpw@norwich.net + +You can visit my Homepage <ÆNIGMA GAMES & FONTS> at +http://www.aenigmafonts.com/ + +____________ +!!! NOTE !!! +¯¯¯¯¯¯¯¯¯¯¯¯ +This font has been updated! I've edited the (BRK) in the font name +to just BRK. It seems that Adobe Illustrator and web pages with CSS +don't like fonts with ( and ) in their name. + +________________ +INSTALLING FONTS +¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ + There's a couple of ways to install Fonts. The 'easy' way to +install fonts is to just Unzip/place the font file(s) into your +Windows\Fonts directory (I always use this method). If you're unable +to do it the 'easy' way, then try to do it this way (for Windows +95/98/NT): + +1] Unzip the Font(s) to a folder (or somewhere, just remember where +you unzipped it) on your Computer. + +2] Next, click on the START button, then select SETTINGS then +CONTROL PANEL. + +3] When the Control Panel Window pops up, Double Click on FONTS. + +4] When the FONTS window pops up, select File then Install New Font... + +5] A Add Fonts window will pop up, just go to the folder that you +unzipped the Font(s) to, select the Font(s) and then click on OK. +Now the Font(s) are installed. + + Now you can use the Font(s) in programs the utilize Fonts. Make +sure that you install the font(s) first, then open up your apps +(so the app will recognize the font). Sometimes you'll have to +wait until you computer 'auto-refreshes' for programs to recognize +fonts (Windows is sometimes slow to do that). You can refresh your +computer quicker by going into Windows Explorer -or- My Computer and +press F5 (or in the menubar select VIEW then REFRESH). + + +__________ +DISCLAIMER +¯¯¯¯¯¯¯¯¯¯ +-The font(s) in this zip file were created by me (Brian Kent). All +of my Fonts are Freeware, you can use them any way you want to +(Personal use, Commercial use, or whatever). + +-If you have a Font related site and would like to offer my fonts on +your site, go right ahead. All I ask is that you keep this text file +intact with the Font. + +-You may not Sell or Distribute my Fonts for profit or alter them in +any way without asking me first. [e-mail - kentpw@norwich.net] \ No newline at end of file diff --git a/LuaUI/Fonts/visitor1.ttf b/LuaUI/Fonts/visitor1.ttf new file mode 100644 index 000000000..04ce123d4 Binary files /dev/null and b/LuaUI/Fonts/visitor1.ttf differ diff --git a/LuaUI/Fonts/visitor2.ttf b/LuaUI/Fonts/visitor2.ttf new file mode 100644 index 000000000..870130d76 Binary files /dev/null and b/LuaUI/Fonts/visitor2.ttf differ diff --git a/LuaUI/Images/AlliedCursors.png b/LuaUI/Images/AlliedCursors.png deleted file mode 100644 index d5ad6d05d..000000000 Binary files a/LuaUI/Images/AlliedCursors.png and /dev/null differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank0.dds b/LuaUI/Images/advplayerslist/Ranks/rank0.dds new file mode 100644 index 000000000..8f28a2037 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank0.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank1.dds b/LuaUI/Images/advplayerslist/Ranks/rank1.dds new file mode 100644 index 000000000..881380b94 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank1.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank2.dds b/LuaUI/Images/advplayerslist/Ranks/rank2.dds new file mode 100644 index 000000000..267754675 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank2.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank3.dds b/LuaUI/Images/advplayerslist/Ranks/rank3.dds new file mode 100644 index 000000000..f284805f3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank3.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank4.dds b/LuaUI/Images/advplayerslist/Ranks/rank4.dds new file mode 100644 index 000000000..d2983ec8e Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank4.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank5.dds b/LuaUI/Images/advplayerslist/Ranks/rank5.dds new file mode 100644 index 000000000..7f3e34ab1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank5.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank6.dds b/LuaUI/Images/advplayerslist/Ranks/rank6.dds new file mode 100644 index 000000000..6460fa30f Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank6.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank7.dds b/LuaUI/Images/advplayerslist/Ranks/rank7.dds new file mode 100644 index 000000000..d9502a817 Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank7.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/rank_unknown.dds b/LuaUI/Images/advplayerslist/Ranks/rank_unknown.dds new file mode 100644 index 000000000..4478d266b Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/rank_unknown.dds differ diff --git a/LuaUI/Images/advplayerslist/Ranks/star.dds b/LuaUI/Images/advplayerslist/Ranks/star.dds new file mode 100644 index 000000000..ced6150db Binary files /dev/null and b/LuaUI/Images/advplayerslist/Ranks/star.dds differ diff --git a/LuaUI/Images/advplayerslist/ally.dds b/LuaUI/Images/advplayerslist/ally.dds new file mode 100644 index 000000000..ec815d53e Binary files /dev/null and b/LuaUI/Images/advplayerslist/ally.dds differ diff --git a/LuaUI/Images/advplayerslist/arm_default.png b/LuaUI/Images/advplayerslist/arm_default.png index 08130ae93..60b652f57 100644 Binary files a/LuaUI/Images/advplayerslist/arm_default.png and b/LuaUI/Images/advplayerslist/arm_default.png differ diff --git a/LuaUI/Images/advplayerslist/arrow.dds b/LuaUI/Images/advplayerslist/arrow.dds new file mode 100644 index 000000000..593846c53 Binary files /dev/null and b/LuaUI/Images/advplayerslist/arrow.dds differ diff --git a/LuaUI/Images/advplayerslist/arrowd.png b/LuaUI/Images/advplayerslist/arrowd.png index 4eb050338..7e1c5052c 100644 Binary files a/LuaUI/Images/advplayerslist/arrowd.png and b/LuaUI/Images/advplayerslist/arrowd.png differ diff --git a/LuaUI/Images/advplayerslist/barglow-center.dds b/LuaUI/Images/advplayerslist/barglow-center.dds new file mode 100644 index 000000000..11be8460e Binary files /dev/null and b/LuaUI/Images/advplayerslist/barglow-center.dds differ diff --git a/LuaUI/Images/advplayerslist/barglow-center.png b/LuaUI/Images/advplayerslist/barglow-center.png new file mode 100644 index 000000000..05ccb7252 Binary files /dev/null and b/LuaUI/Images/advplayerslist/barglow-center.png differ diff --git a/LuaUI/Images/advplayerslist/barglow-edge.dds b/LuaUI/Images/advplayerslist/barglow-edge.dds new file mode 100644 index 000000000..3e3e961f2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/barglow-edge.dds differ diff --git a/LuaUI/Images/advplayerslist/barglow-edge.png b/LuaUI/Images/advplayerslist/barglow-edge.png new file mode 100644 index 000000000..147ea100e Binary files /dev/null and b/LuaUI/Images/advplayerslist/barglow-edge.png differ diff --git a/LuaUI/Images/advplayerslist/blob_small.png b/LuaUI/Images/advplayerslist/blob_small.png new file mode 100644 index 000000000..1fc691c57 Binary files /dev/null and b/LuaUI/Images/advplayerslist/blob_small.png differ diff --git a/LuaUI/Images/advplayerslist/camera.dds b/LuaUI/Images/advplayerslist/camera.dds new file mode 100644 index 000000000..6fad65adb Binary files /dev/null and b/LuaUI/Images/advplayerslist/camera.dds differ diff --git a/LuaUI/Images/advplayerslist/chat.dds b/LuaUI/Images/advplayerslist/chat.dds new file mode 100644 index 000000000..987ddd620 Binary files /dev/null and b/LuaUI/Images/advplayerslist/chat.dds differ diff --git a/LuaUI/Images/advplayerslist/chip.dds b/LuaUI/Images/advplayerslist/chip.dds new file mode 100644 index 000000000..91712901a Binary files /dev/null and b/LuaUI/Images/advplayerslist/chip.dds differ diff --git a/LuaUI/Images/advplayerslist/core_default.png b/LuaUI/Images/advplayerslist/core_default.png index 1207a4d8e..7b6ba56d6 100644 Binary files a/LuaUI/Images/advplayerslist/core_default.png and b/LuaUI/Images/advplayerslist/core_default.png differ diff --git a/LuaUI/Images/advplayerslist/country.dds b/LuaUI/Images/advplayerslist/country.dds new file mode 100644 index 000000000..1658fa2e3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/country.dds differ diff --git a/LuaUI/Images/advplayerslist/cpu.dds b/LuaUI/Images/advplayerslist/cpu.dds new file mode 100644 index 000000000..496938c6f Binary files /dev/null and b/LuaUI/Images/advplayerslist/cpu.dds differ diff --git a/LuaUI/Images/advplayerslist/cpuping.dds b/LuaUI/Images/advplayerslist/cpuping.dds new file mode 100644 index 000000000..496938c6f Binary files /dev/null and b/LuaUI/Images/advplayerslist/cpuping.dds differ diff --git a/LuaUI/Images/advplayerslist/cross.dds b/LuaUI/Images/advplayerslist/cross.dds new file mode 100644 index 000000000..3ce1be6db Binary files /dev/null and b/LuaUI/Images/advplayerslist/cross.dds differ diff --git a/LuaUI/Images/advplayerslist/draw.dds b/LuaUI/Images/advplayerslist/draw.dds new file mode 100644 index 000000000..b7155dc2c Binary files /dev/null and b/LuaUI/Images/advplayerslist/draw.dds differ diff --git a/LuaUI/Images/advplayerslist/energy.dds b/LuaUI/Images/advplayerslist/energy.dds new file mode 100644 index 000000000..1db1084f8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/energy.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ad.dds b/LuaUI/Images/advplayerslist/flags/ad.dds new file mode 100644 index 000000000..63ca92334 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ad.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ae.dds b/LuaUI/Images/advplayerslist/flags/ae.dds new file mode 100644 index 000000000..1b7ad4535 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ae.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/af.dds b/LuaUI/Images/advplayerslist/flags/af.dds new file mode 100644 index 000000000..9e2ef2387 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/af.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ag.dds b/LuaUI/Images/advplayerslist/flags/ag.dds new file mode 100644 index 000000000..4875d8bc0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ag.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ai.dds b/LuaUI/Images/advplayerslist/flags/ai.dds new file mode 100644 index 000000000..cbee4f083 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ai.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/al.dds b/LuaUI/Images/advplayerslist/flags/al.dds new file mode 100644 index 000000000..f0f1e300c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/al.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/am.dds b/LuaUI/Images/advplayerslist/flags/am.dds new file mode 100644 index 000000000..e0f5603fe Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/am.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/an.dds b/LuaUI/Images/advplayerslist/flags/an.dds new file mode 100644 index 000000000..189f429ab Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/an.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ao.dds b/LuaUI/Images/advplayerslist/flags/ao.dds new file mode 100644 index 000000000..2bc7a7eee Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ao.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ar.dds b/LuaUI/Images/advplayerslist/flags/ar.dds new file mode 100644 index 000000000..300eee6eb Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ar.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/as.dds b/LuaUI/Images/advplayerslist/flags/as.dds new file mode 100644 index 000000000..eb6468610 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/as.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/at.dds b/LuaUI/Images/advplayerslist/flags/at.dds new file mode 100644 index 000000000..909d1d031 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/at.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/au.dds b/LuaUI/Images/advplayerslist/flags/au.dds new file mode 100644 index 000000000..bd1ed03a0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/au.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/aw.dds b/LuaUI/Images/advplayerslist/flags/aw.dds new file mode 100644 index 000000000..825676dc8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/aw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ax.dds b/LuaUI/Images/advplayerslist/flags/ax.dds new file mode 100644 index 000000000..ed8f14b0b Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ax.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/az.dds b/LuaUI/Images/advplayerslist/flags/az.dds new file mode 100644 index 000000000..b1b6190ad Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/az.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ba.dds b/LuaUI/Images/advplayerslist/flags/ba.dds new file mode 100644 index 000000000..9a748cbf8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ba.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bb.dds b/LuaUI/Images/advplayerslist/flags/bb.dds new file mode 100644 index 000000000..aadbc56c2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bb.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bd.dds b/LuaUI/Images/advplayerslist/flags/bd.dds new file mode 100644 index 000000000..cf699324d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bd.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/be.dds b/LuaUI/Images/advplayerslist/flags/be.dds new file mode 100644 index 000000000..f61f6c085 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/be.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bf.dds b/LuaUI/Images/advplayerslist/flags/bf.dds new file mode 100644 index 000000000..fac5c031e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bg.dds b/LuaUI/Images/advplayerslist/flags/bg.dds new file mode 100644 index 000000000..9cb22202a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bh.dds b/LuaUI/Images/advplayerslist/flags/bh.dds new file mode 100644 index 000000000..e1fe7a536 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bi.dds b/LuaUI/Images/advplayerslist/flags/bi.dds new file mode 100644 index 000000000..86094b103 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bi.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bj.dds b/LuaUI/Images/advplayerslist/flags/bj.dds new file mode 100644 index 000000000..7d3a244e5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bj.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bm.dds b/LuaUI/Images/advplayerslist/flags/bm.dds new file mode 100644 index 000000000..80c105697 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bn.dds b/LuaUI/Images/advplayerslist/flags/bn.dds new file mode 100644 index 000000000..672843e9d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bo.dds b/LuaUI/Images/advplayerslist/flags/bo.dds new file mode 100644 index 000000000..db6fbe6fb Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bo.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/br.dds b/LuaUI/Images/advplayerslist/flags/br.dds new file mode 100644 index 000000000..c375709b2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/br.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bs.dds b/LuaUI/Images/advplayerslist/flags/bs.dds new file mode 100644 index 000000000..9b6e6e2d2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bs.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bt.dds b/LuaUI/Images/advplayerslist/flags/bt.dds new file mode 100644 index 000000000..9b895fd2e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bv.dds b/LuaUI/Images/advplayerslist/flags/bv.dds new file mode 100644 index 000000000..bf79db2a5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bw.dds b/LuaUI/Images/advplayerslist/flags/bw.dds new file mode 100644 index 000000000..0bc496d6a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/by.dds b/LuaUI/Images/advplayerslist/flags/by.dds new file mode 100644 index 000000000..27a4746f9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/by.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/bz.dds b/LuaUI/Images/advplayerslist/flags/bz.dds new file mode 100644 index 000000000..cf33b2ee0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/bz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ca.dds b/LuaUI/Images/advplayerslist/flags/ca.dds new file mode 100644 index 000000000..7a8685d33 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ca.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/catalonia.dds b/LuaUI/Images/advplayerslist/flags/catalonia.dds new file mode 100644 index 000000000..0c1f17ced Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/catalonia.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cc.dds b/LuaUI/Images/advplayerslist/flags/cc.dds new file mode 100644 index 000000000..cd211156c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cd.dds b/LuaUI/Images/advplayerslist/flags/cd.dds new file mode 100644 index 000000000..6ce5e2531 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cd.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cf.dds b/LuaUI/Images/advplayerslist/flags/cf.dds new file mode 100644 index 000000000..a3b419523 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cg.dds b/LuaUI/Images/advplayerslist/flags/cg.dds new file mode 100644 index 000000000..8a30fac96 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ch.dds b/LuaUI/Images/advplayerslist/flags/ch.dds new file mode 100644 index 000000000..9924f3de3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ch.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ci.dds b/LuaUI/Images/advplayerslist/flags/ci.dds new file mode 100644 index 000000000..6b13e2c08 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ci.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ck.dds b/LuaUI/Images/advplayerslist/flags/ck.dds new file mode 100644 index 000000000..6eb138189 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ck.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cl.dds b/LuaUI/Images/advplayerslist/flags/cl.dds new file mode 100644 index 000000000..3202e5f19 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cm.dds b/LuaUI/Images/advplayerslist/flags/cm.dds new file mode 100644 index 000000000..760b70594 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cn.dds b/LuaUI/Images/advplayerslist/flags/cn.dds new file mode 100644 index 000000000..70a1222c5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/co.dds b/LuaUI/Images/advplayerslist/flags/co.dds new file mode 100644 index 000000000..e7420e64d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/co.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cr.dds b/LuaUI/Images/advplayerslist/flags/cr.dds new file mode 100644 index 000000000..9cb4d5dd4 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cs.dds b/LuaUI/Images/advplayerslist/flags/cs.dds new file mode 100644 index 000000000..7fc81db03 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cs.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cu.dds b/LuaUI/Images/advplayerslist/flags/cu.dds new file mode 100644 index 000000000..63ce00563 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cv.dds b/LuaUI/Images/advplayerslist/flags/cv.dds new file mode 100644 index 000000000..097a72c07 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cx.dds b/LuaUI/Images/advplayerslist/flags/cx.dds new file mode 100644 index 000000000..e25446ad8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cx.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cy.dds b/LuaUI/Images/advplayerslist/flags/cy.dds new file mode 100644 index 000000000..6707c28b8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cy.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/cz.dds b/LuaUI/Images/advplayerslist/flags/cz.dds new file mode 100644 index 000000000..0c7ae81a9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/cz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/de.dds b/LuaUI/Images/advplayerslist/flags/de.dds new file mode 100644 index 000000000..238aa263e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/de.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/dj.dds b/LuaUI/Images/advplayerslist/flags/dj.dds new file mode 100644 index 000000000..d735ddaf8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/dj.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/dk.dds b/LuaUI/Images/advplayerslist/flags/dk.dds new file mode 100644 index 000000000..3bcfedfd5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/dk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/dm.dds b/LuaUI/Images/advplayerslist/flags/dm.dds new file mode 100644 index 000000000..bc5e5641c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/dm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/do.dds b/LuaUI/Images/advplayerslist/flags/do.dds new file mode 100644 index 000000000..e9a4522a1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/do.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/dz.dds b/LuaUI/Images/advplayerslist/flags/dz.dds new file mode 100644 index 000000000..e61564dfc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/dz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ec.dds b/LuaUI/Images/advplayerslist/flags/ec.dds new file mode 100644 index 000000000..76794903f Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ec.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ee.dds b/LuaUI/Images/advplayerslist/flags/ee.dds new file mode 100644 index 000000000..40a62a5eb Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ee.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/eg.dds b/LuaUI/Images/advplayerslist/flags/eg.dds new file mode 100644 index 000000000..cdf46fc48 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/eg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/eh.dds b/LuaUI/Images/advplayerslist/flags/eh.dds new file mode 100644 index 000000000..c675e66aa Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/eh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/england.dds b/LuaUI/Images/advplayerslist/flags/england.dds new file mode 100644 index 000000000..7b4a37fee Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/england.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/er.dds b/LuaUI/Images/advplayerslist/flags/er.dds new file mode 100644 index 000000000..462a67bc6 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/er.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/es.dds b/LuaUI/Images/advplayerslist/flags/es.dds new file mode 100644 index 000000000..1f3c704a2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/es.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/et.dds b/LuaUI/Images/advplayerslist/flags/et.dds new file mode 100644 index 000000000..1d3324071 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/et.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/europeanunion.dds b/LuaUI/Images/advplayerslist/flags/europeanunion.dds new file mode 100644 index 000000000..074c16b30 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/europeanunion.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fam.dds b/LuaUI/Images/advplayerslist/flags/fam.dds new file mode 100644 index 000000000..9d355e30b Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fam.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fi.dds b/LuaUI/Images/advplayerslist/flags/fi.dds new file mode 100644 index 000000000..79d2a4f16 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fi.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fj.dds b/LuaUI/Images/advplayerslist/flags/fj.dds new file mode 100644 index 000000000..cea0d1bcc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fj.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fk.dds b/LuaUI/Images/advplayerslist/flags/fk.dds new file mode 100644 index 000000000..cdacbadcf Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fm.dds b/LuaUI/Images/advplayerslist/flags/fm.dds new file mode 100644 index 000000000..24fe9ef23 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fo.dds b/LuaUI/Images/advplayerslist/flags/fo.dds new file mode 100644 index 000000000..92155f850 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fo.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/fr.dds b/LuaUI/Images/advplayerslist/flags/fr.dds new file mode 100644 index 000000000..bfd13b7a8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/fr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ga.dds b/LuaUI/Images/advplayerslist/flags/ga.dds new file mode 100644 index 000000000..1b4514e66 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ga.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gb.dds b/LuaUI/Images/advplayerslist/flags/gb.dds new file mode 100644 index 000000000..5a67ae9f4 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gb.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gd.dds b/LuaUI/Images/advplayerslist/flags/gd.dds new file mode 100644 index 000000000..2f4803c12 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gd.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ge.dds b/LuaUI/Images/advplayerslist/flags/ge.dds new file mode 100644 index 000000000..60e869cbd Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ge.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gf.dds b/LuaUI/Images/advplayerslist/flags/gf.dds new file mode 100644 index 000000000..bfd13b7a8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gh.dds b/LuaUI/Images/advplayerslist/flags/gh.dds new file mode 100644 index 000000000..ad8ed5839 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gi.dds b/LuaUI/Images/advplayerslist/flags/gi.dds new file mode 100644 index 000000000..40d7c222a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gi.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gl.dds b/LuaUI/Images/advplayerslist/flags/gl.dds new file mode 100644 index 000000000..e52b3d31b Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gm.dds b/LuaUI/Images/advplayerslist/flags/gm.dds new file mode 100644 index 000000000..39a59ee1e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gn.dds b/LuaUI/Images/advplayerslist/flags/gn.dds new file mode 100644 index 000000000..673c340ec Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gp.dds b/LuaUI/Images/advplayerslist/flags/gp.dds new file mode 100644 index 000000000..23a3cba10 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gp.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gq.dds b/LuaUI/Images/advplayerslist/flags/gq.dds new file mode 100644 index 000000000..c53f1d9e3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gq.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gr.dds b/LuaUI/Images/advplayerslist/flags/gr.dds new file mode 100644 index 000000000..0204c21f1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gs.dds b/LuaUI/Images/advplayerslist/flags/gs.dds new file mode 100644 index 000000000..fe5b6a268 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gs.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gt.dds b/LuaUI/Images/advplayerslist/flags/gt.dds new file mode 100644 index 000000000..ca4bfaac0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gu.dds b/LuaUI/Images/advplayerslist/flags/gu.dds new file mode 100644 index 000000000..781506968 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gw.dds b/LuaUI/Images/advplayerslist/flags/gw.dds new file mode 100644 index 000000000..295ee727e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/gy.dds b/LuaUI/Images/advplayerslist/flags/gy.dds new file mode 100644 index 000000000..702dc9a96 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/gy.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/hk.dds b/LuaUI/Images/advplayerslist/flags/hk.dds new file mode 100644 index 000000000..8f1d27013 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/hk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/hm.dds b/LuaUI/Images/advplayerslist/flags/hm.dds new file mode 100644 index 000000000..bd1ed03a0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/hm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/hn.dds b/LuaUI/Images/advplayerslist/flags/hn.dds new file mode 100644 index 000000000..28ed01269 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/hn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/hr.dds b/LuaUI/Images/advplayerslist/flags/hr.dds new file mode 100644 index 000000000..120ab4d46 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/hr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ht.dds b/LuaUI/Images/advplayerslist/flags/ht.dds new file mode 100644 index 000000000..43e33b044 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ht.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/hu.dds b/LuaUI/Images/advplayerslist/flags/hu.dds new file mode 100644 index 000000000..c52c43802 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/hu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/id.dds b/LuaUI/Images/advplayerslist/flags/id.dds new file mode 100644 index 000000000..f7725ab24 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/id.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ie.dds b/LuaUI/Images/advplayerslist/flags/ie.dds new file mode 100644 index 000000000..a01ec995d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ie.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/il.dds b/LuaUI/Images/advplayerslist/flags/il.dds new file mode 100644 index 000000000..d5f71ad97 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/il.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/in.dds b/LuaUI/Images/advplayerslist/flags/in.dds new file mode 100644 index 000000000..d1c3a4188 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/in.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/io.dds b/LuaUI/Images/advplayerslist/flags/io.dds new file mode 100644 index 000000000..32bd3c10b Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/io.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/iq.dds b/LuaUI/Images/advplayerslist/flags/iq.dds new file mode 100644 index 000000000..47202df0f Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/iq.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ir.dds b/LuaUI/Images/advplayerslist/flags/ir.dds new file mode 100644 index 000000000..6fefff1e1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ir.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/is.dds b/LuaUI/Images/advplayerslist/flags/is.dds new file mode 100644 index 000000000..e72686d68 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/is.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/it.dds b/LuaUI/Images/advplayerslist/flags/it.dds new file mode 100644 index 000000000..02fd1eabb Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/it.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/jm.dds b/LuaUI/Images/advplayerslist/flags/jm.dds new file mode 100644 index 000000000..da4790460 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/jm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/jo.dds b/LuaUI/Images/advplayerslist/flags/jo.dds new file mode 100644 index 000000000..a300495b9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/jo.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/jp.dds b/LuaUI/Images/advplayerslist/flags/jp.dds new file mode 100644 index 000000000..0cc2d4623 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/jp.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ke.dds b/LuaUI/Images/advplayerslist/flags/ke.dds new file mode 100644 index 000000000..022ab6700 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ke.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kg.dds b/LuaUI/Images/advplayerslist/flags/kg.dds new file mode 100644 index 000000000..2c3566679 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kh.dds b/LuaUI/Images/advplayerslist/flags/kh.dds new file mode 100644 index 000000000..10858f467 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ki.dds b/LuaUI/Images/advplayerslist/flags/ki.dds new file mode 100644 index 000000000..532e0afb5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ki.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/km.dds b/LuaUI/Images/advplayerslist/flags/km.dds new file mode 100644 index 000000000..dc5e37640 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/km.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kn.dds b/LuaUI/Images/advplayerslist/flags/kn.dds new file mode 100644 index 000000000..7a6236926 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kp.dds b/LuaUI/Images/advplayerslist/flags/kp.dds new file mode 100644 index 000000000..e9aeb47cc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kp.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kr.dds b/LuaUI/Images/advplayerslist/flags/kr.dds new file mode 100644 index 000000000..6390aaad1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kw.dds b/LuaUI/Images/advplayerslist/flags/kw.dds new file mode 100644 index 000000000..cc7929c64 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ky.dds b/LuaUI/Images/advplayerslist/flags/ky.dds new file mode 100644 index 000000000..6f87e1074 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ky.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/kz.dds b/LuaUI/Images/advplayerslist/flags/kz.dds new file mode 100644 index 000000000..99594c944 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/kz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/la.dds b/LuaUI/Images/advplayerslist/flags/la.dds new file mode 100644 index 000000000..dddb164c5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/la.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lb.dds b/LuaUI/Images/advplayerslist/flags/lb.dds new file mode 100644 index 000000000..5a258fc6d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lb.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lc.dds b/LuaUI/Images/advplayerslist/flags/lc.dds new file mode 100644 index 000000000..3e14c63c1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/li.dds b/LuaUI/Images/advplayerslist/flags/li.dds new file mode 100644 index 000000000..83db22b74 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/li.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lk.dds b/LuaUI/Images/advplayerslist/flags/lk.dds new file mode 100644 index 000000000..06f232fd6 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lr.dds b/LuaUI/Images/advplayerslist/flags/lr.dds new file mode 100644 index 000000000..ce3d0ced2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ls.dds b/LuaUI/Images/advplayerslist/flags/ls.dds new file mode 100644 index 000000000..36f70915c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ls.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lt.dds b/LuaUI/Images/advplayerslist/flags/lt.dds new file mode 100644 index 000000000..6cc36eb25 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lu.dds b/LuaUI/Images/advplayerslist/flags/lu.dds new file mode 100644 index 000000000..217c898f8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/lv.dds b/LuaUI/Images/advplayerslist/flags/lv.dds new file mode 100644 index 000000000..d90bfe17e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/lv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ly.dds b/LuaUI/Images/advplayerslist/flags/ly.dds new file mode 100644 index 000000000..52f7d4e0a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ly.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ma.dds b/LuaUI/Images/advplayerslist/flags/ma.dds new file mode 100644 index 000000000..626e6105a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ma.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mc.dds b/LuaUI/Images/advplayerslist/flags/mc.dds new file mode 100644 index 000000000..0e8e3d9c5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/md.dds b/LuaUI/Images/advplayerslist/flags/md.dds new file mode 100644 index 000000000..08543efdc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/md.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/me.dds b/LuaUI/Images/advplayerslist/flags/me.dds new file mode 100644 index 000000000..53fcf5029 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/me.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mg.dds b/LuaUI/Images/advplayerslist/flags/mg.dds new file mode 100644 index 000000000..9be91a269 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mh.dds b/LuaUI/Images/advplayerslist/flags/mh.dds new file mode 100644 index 000000000..5a8e6cc26 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mk.dds b/LuaUI/Images/advplayerslist/flags/mk.dds new file mode 100644 index 000000000..d2132d3cc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ml.dds b/LuaUI/Images/advplayerslist/flags/ml.dds new file mode 100644 index 000000000..71c64c831 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ml.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mm.dds b/LuaUI/Images/advplayerslist/flags/mm.dds new file mode 100644 index 000000000..3f9fdd6a1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mn.dds b/LuaUI/Images/advplayerslist/flags/mn.dds new file mode 100644 index 000000000..33a09586d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mo.dds b/LuaUI/Images/advplayerslist/flags/mo.dds new file mode 100644 index 000000000..839b9f1db Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mo.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mp.dds b/LuaUI/Images/advplayerslist/flags/mp.dds new file mode 100644 index 000000000..4ffd21103 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mp.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mq.dds b/LuaUI/Images/advplayerslist/flags/mq.dds new file mode 100644 index 000000000..4a946b460 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mq.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mr.dds b/LuaUI/Images/advplayerslist/flags/mr.dds new file mode 100644 index 000000000..d54664b0a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ms.dds b/LuaUI/Images/advplayerslist/flags/ms.dds new file mode 100644 index 000000000..4487cd915 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ms.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mt.dds b/LuaUI/Images/advplayerslist/flags/mt.dds new file mode 100644 index 000000000..56b7338ec Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mu.dds b/LuaUI/Images/advplayerslist/flags/mu.dds new file mode 100644 index 000000000..06f59f7ed Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mv.dds b/LuaUI/Images/advplayerslist/flags/mv.dds new file mode 100644 index 000000000..112c244a9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mw.dds b/LuaUI/Images/advplayerslist/flags/mw.dds new file mode 100644 index 000000000..dfdb327b9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mx.dds b/LuaUI/Images/advplayerslist/flags/mx.dds new file mode 100644 index 000000000..889daf2ca Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mx.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/my.dds b/LuaUI/Images/advplayerslist/flags/my.dds new file mode 100644 index 000000000..13bf2fdc2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/my.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/mz.dds b/LuaUI/Images/advplayerslist/flags/mz.dds new file mode 100644 index 000000000..336ffa03c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/mz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/na.dds b/LuaUI/Images/advplayerslist/flags/na.dds new file mode 100644 index 000000000..e4a628a49 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/na.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nc.dds b/LuaUI/Images/advplayerslist/flags/nc.dds new file mode 100644 index 000000000..b958c67c5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ne.dds b/LuaUI/Images/advplayerslist/flags/ne.dds new file mode 100644 index 000000000..b2eb8b174 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ne.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nf.dds b/LuaUI/Images/advplayerslist/flags/nf.dds new file mode 100644 index 000000000..418fc72cd Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ng.dds b/LuaUI/Images/advplayerslist/flags/ng.dds new file mode 100644 index 000000000..fdc8b6201 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ng.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ni.dds b/LuaUI/Images/advplayerslist/flags/ni.dds new file mode 100644 index 000000000..a06abfaa6 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ni.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nl.dds b/LuaUI/Images/advplayerslist/flags/nl.dds new file mode 100644 index 000000000..db9dd9ce7 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/no.dds b/LuaUI/Images/advplayerslist/flags/no.dds new file mode 100644 index 000000000..bf79db2a5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/no.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/np.dds b/LuaUI/Images/advplayerslist/flags/np.dds new file mode 100644 index 000000000..86e65d326 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/np.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nr.dds b/LuaUI/Images/advplayerslist/flags/nr.dds new file mode 100644 index 000000000..dc1d14dfd Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nu.dds b/LuaUI/Images/advplayerslist/flags/nu.dds new file mode 100644 index 000000000..9ca6cab51 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/nz.dds b/LuaUI/Images/advplayerslist/flags/nz.dds new file mode 100644 index 000000000..dd9e0569c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/nz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/om.dds b/LuaUI/Images/advplayerslist/flags/om.dds new file mode 100644 index 000000000..ecc2afd60 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/om.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pa.dds b/LuaUI/Images/advplayerslist/flags/pa.dds new file mode 100644 index 000000000..8c6af4091 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pa.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pe.dds b/LuaUI/Images/advplayerslist/flags/pe.dds new file mode 100644 index 000000000..c0a19c1e7 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pe.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pf.dds b/LuaUI/Images/advplayerslist/flags/pf.dds new file mode 100644 index 000000000..6860d6372 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pg.dds b/LuaUI/Images/advplayerslist/flags/pg.dds new file mode 100644 index 000000000..6753ea5c8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ph.dds b/LuaUI/Images/advplayerslist/flags/ph.dds new file mode 100644 index 000000000..547e56675 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ph.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pk.dds b/LuaUI/Images/advplayerslist/flags/pk.dds new file mode 100644 index 000000000..a727ad9e2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pl.dds b/LuaUI/Images/advplayerslist/flags/pl.dds new file mode 100644 index 000000000..37cf89b62 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pm.dds b/LuaUI/Images/advplayerslist/flags/pm.dds new file mode 100644 index 000000000..ce2e3a033 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pn.dds b/LuaUI/Images/advplayerslist/flags/pn.dds new file mode 100644 index 000000000..d5b85f059 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pr.dds b/LuaUI/Images/advplayerslist/flags/pr.dds new file mode 100644 index 000000000..59249a45c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ps.dds b/LuaUI/Images/advplayerslist/flags/ps.dds new file mode 100644 index 000000000..7d8296598 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ps.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pt.dds b/LuaUI/Images/advplayerslist/flags/pt.dds new file mode 100644 index 000000000..5a81491f8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/pw.dds b/LuaUI/Images/advplayerslist/flags/pw.dds new file mode 100644 index 000000000..fea788647 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/pw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/py.dds b/LuaUI/Images/advplayerslist/flags/py.dds new file mode 100644 index 000000000..c7225409e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/py.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/qa.dds b/LuaUI/Images/advplayerslist/flags/qa.dds new file mode 100644 index 000000000..f52612b74 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/qa.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/re.dds b/LuaUI/Images/advplayerslist/flags/re.dds new file mode 100644 index 000000000..bfd13b7a8 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/re.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ro.dds b/LuaUI/Images/advplayerslist/flags/ro.dds new file mode 100644 index 000000000..3e4be5f80 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ro.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/rs.dds b/LuaUI/Images/advplayerslist/flags/rs.dds new file mode 100644 index 000000000..acb896897 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/rs.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ru.dds b/LuaUI/Images/advplayerslist/flags/ru.dds new file mode 100644 index 000000000..afefe74ab Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ru.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/rw.dds b/LuaUI/Images/advplayerslist/flags/rw.dds new file mode 100644 index 000000000..e3cf230f3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/rw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sa.dds b/LuaUI/Images/advplayerslist/flags/sa.dds new file mode 100644 index 000000000..7dea89e2f Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sa.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sb.dds b/LuaUI/Images/advplayerslist/flags/sb.dds new file mode 100644 index 000000000..f998ba689 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sb.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sc.dds b/LuaUI/Images/advplayerslist/flags/sc.dds new file mode 100644 index 000000000..39afea81f Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/scotland.dds b/LuaUI/Images/advplayerslist/flags/scotland.dds new file mode 100644 index 000000000..e10e5dee2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/scotland.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sd.dds b/LuaUI/Images/advplayerslist/flags/sd.dds new file mode 100644 index 000000000..ab7678356 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sd.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/se.dds b/LuaUI/Images/advplayerslist/flags/se.dds new file mode 100644 index 000000000..8f05a17bb Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/se.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sg.dds b/LuaUI/Images/advplayerslist/flags/sg.dds new file mode 100644 index 000000000..e4746a71d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sh.dds b/LuaUI/Images/advplayerslist/flags/sh.dds new file mode 100644 index 000000000..9cb23100e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sh.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/si.dds b/LuaUI/Images/advplayerslist/flags/si.dds new file mode 100644 index 000000000..49c100c18 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/si.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sj.dds b/LuaUI/Images/advplayerslist/flags/sj.dds new file mode 100644 index 000000000..bf79db2a5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sj.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sk.dds b/LuaUI/Images/advplayerslist/flags/sk.dds new file mode 100644 index 000000000..7de59d89d Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sl.dds b/LuaUI/Images/advplayerslist/flags/sl.dds new file mode 100644 index 000000000..bf7dc8f54 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sm.dds b/LuaUI/Images/advplayerslist/flags/sm.dds new file mode 100644 index 000000000..0b23aef7e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sn.dds b/LuaUI/Images/advplayerslist/flags/sn.dds new file mode 100644 index 000000000..4ba8d4f56 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/so.dds b/LuaUI/Images/advplayerslist/flags/so.dds new file mode 100644 index 000000000..93ccdd001 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/so.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sr.dds b/LuaUI/Images/advplayerslist/flags/sr.dds new file mode 100644 index 000000000..80603f2e2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/st.dds b/LuaUI/Images/advplayerslist/flags/st.dds new file mode 100644 index 000000000..d2ea3fabd Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/st.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sv.dds b/LuaUI/Images/advplayerslist/flags/sv.dds new file mode 100644 index 000000000..be25119a0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sy.dds b/LuaUI/Images/advplayerslist/flags/sy.dds new file mode 100644 index 000000000..818c317f5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sy.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/sz.dds b/LuaUI/Images/advplayerslist/flags/sz.dds new file mode 100644 index 000000000..b69481186 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/sz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tc.dds b/LuaUI/Images/advplayerslist/flags/tc.dds new file mode 100644 index 000000000..be6532aca Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/td.dds b/LuaUI/Images/advplayerslist/flags/td.dds new file mode 100644 index 000000000..653727611 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/td.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tf.dds b/LuaUI/Images/advplayerslist/flags/tf.dds new file mode 100644 index 000000000..f2469ab36 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tg.dds b/LuaUI/Images/advplayerslist/flags/tg.dds new file mode 100644 index 000000000..a635fddd9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/th.dds b/LuaUI/Images/advplayerslist/flags/th.dds new file mode 100644 index 000000000..386a915c5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/th.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tj.dds b/LuaUI/Images/advplayerslist/flags/tj.dds new file mode 100644 index 000000000..282f395b9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tj.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tk.dds b/LuaUI/Images/advplayerslist/flags/tk.dds new file mode 100644 index 000000000..bba5e51dc Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tk.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tl.dds b/LuaUI/Images/advplayerslist/flags/tl.dds new file mode 100644 index 000000000..6361df18e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tl.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tm.dds b/LuaUI/Images/advplayerslist/flags/tm.dds new file mode 100644 index 000000000..0f35031ac Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tn.dds b/LuaUI/Images/advplayerslist/flags/tn.dds new file mode 100644 index 000000000..55af9b0e3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/to.dds b/LuaUI/Images/advplayerslist/flags/to.dds new file mode 100644 index 000000000..4aedd3fa3 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/to.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tr.dds b/LuaUI/Images/advplayerslist/flags/tr.dds new file mode 100644 index 000000000..6c49dab33 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tr.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tt.dds b/LuaUI/Images/advplayerslist/flags/tt.dds new file mode 100644 index 000000000..f2a019200 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tv.dds b/LuaUI/Images/advplayerslist/flags/tv.dds new file mode 100644 index 000000000..c6f608e87 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tv.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tw.dds b/LuaUI/Images/advplayerslist/flags/tw.dds new file mode 100644 index 000000000..e909dc531 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tw.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/tz.dds b/LuaUI/Images/advplayerslist/flags/tz.dds new file mode 100644 index 000000000..e2bdbe8e4 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/tz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ua.dds b/LuaUI/Images/advplayerslist/flags/ua.dds new file mode 100644 index 000000000..46747599a Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ua.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ug.dds b/LuaUI/Images/advplayerslist/flags/ug.dds new file mode 100644 index 000000000..6343e0239 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ug.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/um.dds b/LuaUI/Images/advplayerslist/flags/um.dds new file mode 100644 index 000000000..3ba166595 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/um.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/us.dds b/LuaUI/Images/advplayerslist/flags/us.dds new file mode 100644 index 000000000..46126f163 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/us.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/uy.dds b/LuaUI/Images/advplayerslist/flags/uy.dds new file mode 100644 index 000000000..463423543 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/uy.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/uz.dds b/LuaUI/Images/advplayerslist/flags/uz.dds new file mode 100644 index 000000000..ccb1453d5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/uz.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/va.dds b/LuaUI/Images/advplayerslist/flags/va.dds new file mode 100644 index 000000000..8b2f619ee Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/va.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/vc.dds b/LuaUI/Images/advplayerslist/flags/vc.dds new file mode 100644 index 000000000..bb3311346 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/vc.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ve.dds b/LuaUI/Images/advplayerslist/flags/ve.dds new file mode 100644 index 000000000..0cccb50e1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ve.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/vg.dds b/LuaUI/Images/advplayerslist/flags/vg.dds new file mode 100644 index 000000000..f901f0a8c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/vg.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/vi.dds b/LuaUI/Images/advplayerslist/flags/vi.dds new file mode 100644 index 000000000..ca33d9fbf Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/vi.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/vn.dds b/LuaUI/Images/advplayerslist/flags/vn.dds new file mode 100644 index 000000000..db1e06563 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/vn.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/vu.dds b/LuaUI/Images/advplayerslist/flags/vu.dds new file mode 100644 index 000000000..c70ee6cbf Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/vu.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/wales.dds b/LuaUI/Images/advplayerslist/flags/wales.dds new file mode 100644 index 000000000..0e4c38d5f Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/wales.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/wf.dds b/LuaUI/Images/advplayerslist/flags/wf.dds new file mode 100644 index 000000000..906e9299e Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/wf.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ws.dds b/LuaUI/Images/advplayerslist/flags/ws.dds new file mode 100644 index 000000000..97de5dd9c Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ws.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/wut.dds b/LuaUI/Images/advplayerslist/flags/wut.dds new file mode 100644 index 000000000..7a162c3e1 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/wut.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/ye.dds b/LuaUI/Images/advplayerslist/flags/ye.dds new file mode 100644 index 000000000..97fea1945 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/ye.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/yt.dds b/LuaUI/Images/advplayerslist/flags/yt.dds new file mode 100644 index 000000000..f25d40903 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/yt.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/za.dds b/LuaUI/Images/advplayerslist/flags/za.dds new file mode 100644 index 000000000..925dc9dd9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/za.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/zm.dds b/LuaUI/Images/advplayerslist/flags/zm.dds new file mode 100644 index 000000000..706590f72 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/zm.dds differ diff --git a/LuaUI/Images/advplayerslist/flags/zw.dds b/LuaUI/Images/advplayerslist/flags/zw.dds new file mode 100644 index 000000000..37b366553 Binary files /dev/null and b/LuaUI/Images/advplayerslist/flags/zw.dds differ diff --git a/LuaUI/Images/advplayerslist/id.dds b/LuaUI/Images/advplayerslist/id.dds new file mode 100644 index 000000000..d97c535e0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/id.dds differ diff --git a/LuaUI/Images/advplayerslist/indent.png b/LuaUI/Images/advplayerslist/indent.png new file mode 100644 index 000000000..796e8806b Binary files /dev/null and b/LuaUI/Images/advplayerslist/indent.png differ diff --git a/LuaUI/Images/advplayerslist/indicator.dds b/LuaUI/Images/advplayerslist/indicator.dds new file mode 100644 index 000000000..2cc4baae2 Binary files /dev/null and b/LuaUI/Images/advplayerslist/indicator.dds differ diff --git a/LuaUI/Images/advplayerslist/low.dds b/LuaUI/Images/advplayerslist/low.dds new file mode 100644 index 000000000..d36a6361c Binary files /dev/null and b/LuaUI/Images/advplayerslist/low.dds differ diff --git a/LuaUI/Images/advplayerslist/metal.dds b/LuaUI/Images/advplayerslist/metal.dds new file mode 100644 index 000000000..06563a2f0 Binary files /dev/null and b/LuaUI/Images/advplayerslist/metal.dds differ diff --git a/LuaUI/Images/advplayerslist/name.dds b/LuaUI/Images/advplayerslist/name.dds new file mode 100644 index 000000000..c874bd153 Binary files /dev/null and b/LuaUI/Images/advplayerslist/name.dds differ diff --git a/LuaUI/Images/advplayerslist/notfirst.dds b/LuaUI/Images/advplayerslist/notfirst.dds new file mode 100644 index 000000000..87ab1dc34 Binary files /dev/null and b/LuaUI/Images/advplayerslist/notfirst.dds differ diff --git a/LuaUI/Images/advplayerslist/notfirst.png b/LuaUI/Images/advplayerslist/notfirst.png index 4ffc141fe..5667900d2 100644 Binary files a/LuaUI/Images/advplayerslist/notfirst.png and b/LuaUI/Images/advplayerslist/notfirst.png differ diff --git a/LuaUI/Images/advplayerslist/ping.dds b/LuaUI/Images/advplayerslist/ping.dds new file mode 100644 index 000000000..a44c9cd19 Binary files /dev/null and b/LuaUI/Images/advplayerslist/ping.dds differ diff --git a/LuaUI/Images/advplayerslist/point.dds b/LuaUI/Images/advplayerslist/point.dds new file mode 100644 index 000000000..eda4e43e4 Binary files /dev/null and b/LuaUI/Images/advplayerslist/point.dds differ diff --git a/LuaUI/Images/advplayerslist/res.png b/LuaUI/Images/advplayerslist/res.png new file mode 100644 index 000000000..54649d9ad Binary files /dev/null and b/LuaUI/Images/advplayerslist/res.png differ diff --git a/LuaUI/Images/advplayerslist/resbar.png b/LuaUI/Images/advplayerslist/resbar.png new file mode 100644 index 000000000..fa0f57dd7 Binary files /dev/null and b/LuaUI/Images/advplayerslist/resbar.png differ diff --git a/LuaUI/Images/advplayerslist/resbarbg.png b/LuaUI/Images/advplayerslist/resbarbg.png new file mode 100644 index 000000000..8b99ed7f5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/resbarbg.png differ diff --git a/LuaUI/Images/advplayerslist/resources.dds b/LuaUI/Images/advplayerslist/resources.dds new file mode 100644 index 000000000..e07bf5c96 Binary files /dev/null and b/LuaUI/Images/advplayerslist/resources.dds differ diff --git a/LuaUI/Images/advplayerslist/separator.png b/LuaUI/Images/advplayerslist/separator.png new file mode 100644 index 000000000..f9c804334 Binary files /dev/null and b/LuaUI/Images/advplayerslist/separator.png differ diff --git a/LuaUI/Images/advplayerslist/share.dds b/LuaUI/Images/advplayerslist/share.dds new file mode 100644 index 000000000..854bd5f59 Binary files /dev/null and b/LuaUI/Images/advplayerslist/share.dds differ diff --git a/LuaUI/Images/advplayerslist/side.dds b/LuaUI/Images/advplayerslist/side.dds new file mode 100644 index 000000000..744ab97b5 Binary files /dev/null and b/LuaUI/Images/advplayerslist/side.dds differ diff --git a/LuaUI/Images/advplayerslist/sizedn.dds b/LuaUI/Images/advplayerslist/sizedn.dds new file mode 100644 index 000000000..77375bbfc Binary files /dev/null and b/LuaUI/Images/advplayerslist/sizedn.dds differ diff --git a/LuaUI/Images/advplayerslist/sizeup.dds b/LuaUI/Images/advplayerslist/sizeup.dds new file mode 100644 index 000000000..81e379810 Binary files /dev/null and b/LuaUI/Images/advplayerslist/sizeup.dds differ diff --git a/LuaUI/Images/advplayerslist/take.dds b/LuaUI/Images/advplayerslist/take.dds new file mode 100644 index 000000000..f604a1ef9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/take.dds differ diff --git a/LuaUI/Images/advplayerslist/ts.dds b/LuaUI/Images/advplayerslist/ts.dds new file mode 100644 index 000000000..00e969fd6 Binary files /dev/null and b/LuaUI/Images/advplayerslist/ts.dds differ diff --git a/LuaUI/Images/advplayerslist/ts.png b/LuaUI/Images/advplayerslist/ts.png new file mode 100644 index 000000000..cd335a1a9 Binary files /dev/null and b/LuaUI/Images/advplayerslist/ts.png differ diff --git a/LuaUI/Images/advplayerslist/units.dds b/LuaUI/Images/advplayerslist/units.dds new file mode 100644 index 000000000..8a2d4b341 Binary files /dev/null and b/LuaUI/Images/advplayerslist/units.dds differ diff --git a/LuaUI/Images/advplayerslist/units0.png b/LuaUI/Images/advplayerslist/units0.png new file mode 100644 index 000000000..98ab05057 Binary files /dev/null and b/LuaUI/Images/advplayerslist/units0.png differ diff --git a/LuaUI/Images/allycursor.dds b/LuaUI/Images/allycursor.dds new file mode 100644 index 000000000..97cfddd99 Binary files /dev/null and b/LuaUI/Images/allycursor.dds differ diff --git a/LuaUI/Images/armortype/armored.dds b/LuaUI/Images/armortype/armored.dds new file mode 100644 index 000000000..aac1f5796 Binary files /dev/null and b/LuaUI/Images/armortype/armored.dds differ diff --git a/LuaUI/Images/backward.dds b/LuaUI/Images/backward.dds new file mode 100644 index 000000000..92dfcc392 Binary files /dev/null and b/LuaUI/Images/backward.dds differ diff --git a/LuaUI/Images/barglow-center.dds b/LuaUI/Images/barglow-center.dds new file mode 100644 index 000000000..f5e416d17 Binary files /dev/null and b/LuaUI/Images/barglow-center.dds differ diff --git a/LuaUI/Images/barglow-center.png b/LuaUI/Images/barglow-center.png new file mode 100644 index 000000000..05ccb7252 Binary files /dev/null and b/LuaUI/Images/barglow-center.png differ diff --git a/LuaUI/Images/barglow-edge.dds b/LuaUI/Images/barglow-edge.dds new file mode 100644 index 000000000..54ef132fb Binary files /dev/null and b/LuaUI/Images/barglow-edge.dds differ diff --git a/LuaUI/Images/barglow-edge.png b/LuaUI/Images/barglow-edge.png new file mode 100644 index 000000000..147ea100e Binary files /dev/null and b/LuaUI/Images/barglow-edge.png differ diff --git a/LuaUI/Images/bgcorner.png b/LuaUI/Images/bgcorner.png new file mode 100644 index 000000000..317f49a57 Binary files /dev/null and b/LuaUI/Images/bgcorner.png differ diff --git a/LuaUI/Images/bgcorner1.png b/LuaUI/Images/bgcorner1.png new file mode 100644 index 000000000..7f14ecc75 Binary files /dev/null and b/LuaUI/Images/bgcorner1.png differ diff --git a/LuaUI/Images/button-highlight.dds b/LuaUI/Images/button-highlight.dds new file mode 100644 index 000000000..dad8ed220 Binary files /dev/null and b/LuaUI/Images/button-highlight.dds differ diff --git a/LuaUI/Images/button-pushed.dds b/LuaUI/Images/button-pushed.dds new file mode 100644 index 000000000..839b8af91 Binary files /dev/null and b/LuaUI/Images/button-pushed.dds differ diff --git a/LuaUI/Images/button.dds b/LuaUI/Images/button.dds new file mode 100644 index 000000000..acf8785b0 Binary files /dev/null and b/LuaUI/Images/button.dds differ diff --git a/LuaUI/Images/close.dds b/LuaUI/Images/close.dds new file mode 100644 index 000000000..c52563e60 Binary files /dev/null and b/LuaUI/Images/close.dds differ diff --git a/LuaUI/Images/commandsfx/glow.dds b/LuaUI/Images/commandsfx/glow.dds new file mode 100644 index 000000000..66f9dded5 Binary files /dev/null and b/LuaUI/Images/commandsfx/glow.dds differ diff --git a/LuaUI/Images/commandsfx/glow.png b/LuaUI/Images/commandsfx/glow.png new file mode 100644 index 000000000..bfafa6dba Binary files /dev/null and b/LuaUI/Images/commandsfx/glow.png differ diff --git a/LuaUI/Images/commandsfx/line.dds b/LuaUI/Images/commandsfx/line.dds new file mode 100644 index 000000000..90a843ea2 Binary files /dev/null and b/LuaUI/Images/commandsfx/line.dds differ diff --git a/LuaUI/Images/commandsfx/line.png b/LuaUI/Images/commandsfx/line.png new file mode 100644 index 000000000..6c74e959f Binary files /dev/null and b/LuaUI/Images/commandsfx/line.png differ diff --git a/LuaUI/Images/commandsfx/line2.dds b/LuaUI/Images/commandsfx/line2.dds new file mode 100644 index 000000000..635ac7b26 Binary files /dev/null and b/LuaUI/Images/commandsfx/line2.dds differ diff --git a/LuaUI/Images/commandsfx/pulse.png b/LuaUI/Images/commandsfx/pulse.png new file mode 100644 index 000000000..af6715b0e Binary files /dev/null and b/LuaUI/Images/commandsfx/pulse.png differ diff --git a/LuaUI/Images/damagetype/armor.dds b/LuaUI/Images/damagetype/armor.dds new file mode 100644 index 000000000..9e9f3717e Binary files /dev/null and b/LuaUI/Images/damagetype/armor.dds differ diff --git a/LuaUI/Images/damagetype/building.dds b/LuaUI/Images/damagetype/building.dds new file mode 100644 index 000000000..ba1f83b94 Binary files /dev/null and b/LuaUI/Images/damagetype/building.dds differ diff --git a/LuaUI/Images/damagetype/light.dds b/LuaUI/Images/damagetype/light.dds new file mode 100644 index 000000000..a14390586 Binary files /dev/null and b/LuaUI/Images/damagetype/light.dds differ diff --git a/LuaUI/Images/discord.png b/LuaUI/Images/discord.png new file mode 100644 index 000000000..5d9d47030 Binary files /dev/null and b/LuaUI/Images/discord.png differ diff --git a/LuaUI/Images/ecommander.png b/LuaUI/Images/ecommander.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/LuaUI/Images/ecommander.png differ diff --git a/LuaUI/Images/energy2.png b/LuaUI/Images/energy2.png new file mode 100644 index 000000000..08d838903 Binary files /dev/null and b/LuaUI/Images/energy2.png differ diff --git a/LuaUI/Images/evologo.png b/LuaUI/Images/evologo.png index 2aeb4e864..fe0df259a 100644 Binary files a/LuaUI/Images/evologo.png and b/LuaUI/Images/evologo.png differ diff --git a/LuaUI/Images/forward.dds b/LuaUI/Images/forward.dds new file mode 100644 index 000000000..361b2096b Binary files /dev/null and b/LuaUI/Images/forward.dds differ diff --git a/LuaUI/Images/glow.dds b/LuaUI/Images/glow.dds new file mode 100644 index 000000000..66f9dded5 Binary files /dev/null and b/LuaUI/Images/glow.dds differ diff --git a/LuaUI/Images/glow2.dds b/LuaUI/Images/glow2.dds new file mode 100644 index 000000000..4a123fe40 Binary files /dev/null and b/LuaUI/Images/glow2.dds differ diff --git a/LuaUI/Images/guishader/noise.dds b/LuaUI/Images/guishader/noise.dds new file mode 100644 index 000000000..20768e352 Binary files /dev/null and b/LuaUI/Images/guishader/noise.dds differ diff --git a/LuaUI/Images/guishader/noise1.dds b/LuaUI/Images/guishader/noise1.dds new file mode 100644 index 000000000..baa56eede Binary files /dev/null and b/LuaUI/Images/guishader/noise1.dds differ diff --git a/LuaUI/Images/guishader/noise2.dds b/LuaUI/Images/guishader/noise2.dds new file mode 100644 index 000000000..da58aedd2 Binary files /dev/null and b/LuaUI/Images/guishader/noise2.dds differ diff --git a/LuaUI/Images/line.dds b/LuaUI/Images/line.dds new file mode 100644 index 000000000..90a843ea2 Binary files /dev/null and b/LuaUI/Images/line.dds differ diff --git a/LuaUI/Images/lozcommander.png b/LuaUI/Images/lozcommander.png new file mode 100644 index 000000000..2df811a34 Binary files /dev/null and b/LuaUI/Images/lozcommander.png differ diff --git a/LuaUI/Images/mapmarksfx/eraser.dds b/LuaUI/Images/mapmarksfx/eraser.dds new file mode 100644 index 000000000..817214293 Binary files /dev/null and b/LuaUI/Images/mapmarksfx/eraser.dds differ diff --git a/LuaUI/Images/mapmarksfx/glow.dds b/LuaUI/Images/mapmarksfx/glow.dds new file mode 100644 index 000000000..9ef7e8e21 Binary files /dev/null and b/LuaUI/Images/mapmarksfx/glow.dds differ diff --git a/LuaUI/Images/mapmarksfx/pencil.dds b/LuaUI/Images/mapmarksfx/pencil.dds new file mode 100644 index 000000000..c95b514f1 Binary files /dev/null and b/LuaUI/Images/mapmarksfx/pencil.dds differ diff --git a/LuaUI/Images/mapmarksfx/ring-plain.dds b/LuaUI/Images/mapmarksfx/ring-plain.dds new file mode 100644 index 000000000..98b123926 Binary files /dev/null and b/LuaUI/Images/mapmarksfx/ring-plain.dds differ diff --git a/LuaUI/Images/mapmarksfx/ring.dds b/LuaUI/Images/mapmarksfx/ring.dds new file mode 100644 index 000000000..df77188c2 Binary files /dev/null and b/LuaUI/Images/mapmarksfx/ring.dds differ diff --git a/LuaUI/Images/metal.png b/LuaUI/Images/metal.png new file mode 100644 index 000000000..ea9a47112 Binary files /dev/null and b/LuaUI/Images/metal.png differ diff --git a/LuaUI/Images/music/forward.png b/LuaUI/Images/music/forward.png new file mode 100644 index 000000000..48d2d3843 Binary files /dev/null and b/LuaUI/Images/music/forward.png differ diff --git a/LuaUI/Images/music/music.png b/LuaUI/Images/music/music.png new file mode 100644 index 000000000..dcf038616 Binary files /dev/null and b/LuaUI/Images/music/music.png differ diff --git a/LuaUI/Images/music/next.png b/LuaUI/Images/music/next.png new file mode 100644 index 000000000..2f35baf1a Binary files /dev/null and b/LuaUI/Images/music/next.png differ diff --git a/LuaUI/Images/music/pause.png b/LuaUI/Images/music/pause.png new file mode 100644 index 000000000..4842ee362 Binary files /dev/null and b/LuaUI/Images/music/pause.png differ diff --git a/LuaUI/Images/music/play.png b/LuaUI/Images/music/play.png new file mode 100644 index 000000000..e9c47aa2a Binary files /dev/null and b/LuaUI/Images/music/play.png differ diff --git a/LuaUI/Images/music/volume.png b/LuaUI/Images/music/volume.png new file mode 100644 index 000000000..7f5290908 Binary files /dev/null and b/LuaUI/Images/music/volume.png differ diff --git a/LuaUI/Images/new.dds b/LuaUI/Images/new.dds new file mode 100644 index 000000000..5a73b3a42 Binary files /dev/null and b/LuaUI/Images/new.dds differ diff --git a/LuaUI/Images/panel.tga b/LuaUI/Images/panel.tga new file mode 100644 index 000000000..f00b79982 Binary files /dev/null and b/LuaUI/Images/panel.tga differ diff --git a/LuaUI/Images/redminimap/move.png b/LuaUI/Images/redminimap/move.png new file mode 100644 index 000000000..94e022b3c Binary files /dev/null and b/LuaUI/Images/redminimap/move.png differ diff --git a/LuaUI/Images/redminimap/resize.png b/LuaUI/Images/redminimap/resize.png new file mode 100644 index 000000000..1d3f1c8c7 Binary files /dev/null and b/LuaUI/Images/redminimap/resize.png differ diff --git a/LuaUI/Images/resbar.dds b/LuaUI/Images/resbar.dds new file mode 100644 index 000000000..c095c777a Binary files /dev/null and b/LuaUI/Images/resbar.dds differ diff --git a/LuaUI/Images/skull.dds b/LuaUI/Images/skull.dds new file mode 100644 index 000000000..e5fcb5934 Binary files /dev/null and b/LuaUI/Images/skull.dds differ diff --git a/LuaUI/Images/snow/snow1.dds b/LuaUI/Images/snow/snow1.dds new file mode 100644 index 000000000..9bcde3258 Binary files /dev/null and b/LuaUI/Images/snow/snow1.dds differ diff --git a/LuaUI/Images/snow/snow2.dds b/LuaUI/Images/snow/snow2.dds new file mode 100644 index 000000000..e929f0b52 Binary files /dev/null and b/LuaUI/Images/snow/snow2.dds differ diff --git a/LuaUI/Images/snow/snow3.dds b/LuaUI/Images/snow/snow3.dds new file mode 100644 index 000000000..26093b1a3 Binary files /dev/null and b/LuaUI/Images/snow/snow3.dds differ diff --git a/LuaUI/Images/snow/snow4.dds b/LuaUI/Images/snow/snow4.dds new file mode 100644 index 000000000..2e6b8140b Binary files /dev/null and b/LuaUI/Images/snow/snow4.dds differ diff --git a/LuaUI/Images/snow/snow5.dds b/LuaUI/Images/snow/snow5.dds new file mode 100644 index 000000000..8a1b83089 Binary files /dev/null and b/LuaUI/Images/snow/snow5.dds differ diff --git a/LuaUI/Images/snow/snow6.dds b/LuaUI/Images/snow/snow6.dds new file mode 100644 index 000000000..96ea2ffc6 Binary files /dev/null and b/LuaUI/Images/snow/snow6.dds differ diff --git a/LuaUI/Images/supply.png b/LuaUI/Images/supply.png new file mode 100644 index 000000000..ea00eca3f Binary files /dev/null and b/LuaUI/Images/supply.png differ diff --git a/LuaUI/Images/tick.png b/LuaUI/Images/tick.png new file mode 100644 index 000000000..9e3cb433c Binary files /dev/null and b/LuaUI/Images/tick.png differ diff --git a/LuaUI/Images/xcommander.png b/LuaUI/Images/xcommander.png new file mode 100644 index 000000000..87a46ee49 Binary files /dev/null and b/LuaUI/Images/xcommander.png differ diff --git a/LuaUI/Images/zarm.png b/LuaUI/Images/zarm.png new file mode 100644 index 000000000..05f870f98 Binary files /dev/null and b/LuaUI/Images/zarm.png differ diff --git a/LuaUI/Sounds/ambient/ambient-stereo-short.wav b/LuaUI/Sounds/ambient/ambient-stereo-short.wav new file mode 100644 index 000000000..44352872a Binary files /dev/null and b/LuaUI/Sounds/ambient/ambient-stereo-short.wav differ diff --git a/LuaUI/Sounds/ambient/zaalambient.wav b/LuaUI/Sounds/ambient/zaalambient.wav new file mode 100644 index 000000000..b7d87ec37 Binary files /dev/null and b/LuaUI/Sounds/ambient/zaalambient.wav differ diff --git a/LuaUI/Sounds/buildbar_add.wav b/LuaUI/Sounds/buildbar_add.wav index 3d4945a1b..72100990e 100644 Binary files a/LuaUI/Sounds/buildbar_add.wav and b/LuaUI/Sounds/buildbar_add.wav differ diff --git a/LuaUI/Sounds/buildbar_click.WAV b/LuaUI/Sounds/buildbar_click.WAV index 55376b300..491f4ac4c 100644 Binary files a/LuaUI/Sounds/buildbar_click.WAV and b/LuaUI/Sounds/buildbar_click.WAV differ diff --git a/LuaUI/Sounds/buildbar_hover.wav b/LuaUI/Sounds/buildbar_hover.wav index def489b01..1f629e430 100644 Binary files a/LuaUI/Sounds/buildbar_hover.wav and b/LuaUI/Sounds/buildbar_hover.wav differ diff --git a/LuaUI/Sounds/click.wav b/LuaUI/Sounds/click.wav new file mode 100644 index 000000000..fc8ff1e38 Binary files /dev/null and b/LuaUI/Sounds/click.wav differ diff --git a/LuaUI/Sounds/click2.wav b/LuaUI/Sounds/click2.wav new file mode 100644 index 000000000..c4be68573 Binary files /dev/null and b/LuaUI/Sounds/click2.wav differ diff --git a/LuaUI/Sounds/hover.wav b/LuaUI/Sounds/hover.wav new file mode 100644 index 000000000..e6fef65f1 Binary files /dev/null and b/LuaUI/Sounds/hover.wav differ diff --git a/LuaUI/Sounds/pushbutton.wav b/LuaUI/Sounds/pushbutton.wav new file mode 100644 index 000000000..8409b919b Binary files /dev/null and b/LuaUI/Sounds/pushbutton.wav differ diff --git a/LuaUI/Sounds/switchoff.wav b/LuaUI/Sounds/switchoff.wav new file mode 100644 index 000000000..67c2ef1ee Binary files /dev/null and b/LuaUI/Sounds/switchoff.wav differ diff --git a/LuaUI/Sounds/switchon.wav b/LuaUI/Sounds/switchon.wav new file mode 100644 index 000000000..b01506520 Binary files /dev/null and b/LuaUI/Sounds/switchon.wav differ diff --git a/LuaUI/Sounds/tock.wav b/LuaUI/Sounds/tock.wav new file mode 100644 index 000000000..f774f70e4 Binary files /dev/null and b/LuaUI/Sounds/tock.wav differ diff --git a/LuaUI/Sounds/zap.wav b/LuaUI/Sounds/zap.wav new file mode 100644 index 000000000..47b25ad9a Binary files /dev/null and b/LuaUI/Sounds/zap.wav differ diff --git a/LuaUI/Widgets_Evo/Include/LuaShader.lua b/LuaUI/Widgets_Evo/Include/LuaShader.lua new file mode 100644 index 000000000..1501a513c --- /dev/null +++ b/LuaUI/Widgets_Evo/Include/LuaShader.lua @@ -0,0 +1,468 @@ +local UNIFORM_TYPE_MIXED = 0 -- includes arrays; float or int +local UNIFORM_TYPE_INT = 1 -- includes arrays +local UNIFORM_TYPE_FLOAT = 2 -- includes arrays +local UNIFORM_TYPE_FLOAT_MATRIX = 3 + +local glGetUniformLocation = gl.GetUniformLocation +local glUseShader = gl.UseShader +local glActiveShader = gl.ActiveShader +local glUniform = gl.Uniform +local glUniformInt = gl.UniformInt +local glUniformMatrix = gl.UniformMatrix +local glUniformArray = gl.UniformArray + +local function new(class, shaderParams, shaderName, logEntries) + local logEntriesSanitized + if type(logEntries) == "number" then + logEntriesSanitized = logEntries + else + logEntriesSanitized = 1 + end + + return setmetatable( + { + shaderName = shaderName or "Unnamed Shader", + shaderParams = shaderParams or {}, + logEntries = logEntriesSanitized, + logHash = {}, + shaderObj = nil, + active = false, + ignoreActive = false, + ignoreUnkUniform = false, + uniforms = {}, + }, class) +end + +local function IsGeometryShaderSupported() + return gl.HasExtension("GL_ARB_geometry_shader4") and (gl.SetShaderParameter ~= nil or gl.SetGeometryShaderParameter ~= nil) +end + +local function IsTesselationShaderSupported() + return gl.HasExtension("GL_ARB_tessellation_shader") and (gl.SetTesselationShaderParameter ~= nil) +end + +local function IsDeferredShadingEnabled() + return (Spring.GetConfigInt("AllowDeferredMapRendering") == 1) and (Spring.GetConfigInt("AllowDeferredModelRendering") == 1) and (Spring.GetConfigInt("AdvMapShading") == 1) +end + +local function GetAdvShadingActive() + local advUnitShading, advMapShading = Spring.HaveAdvShading() + if advMapShading == nil then + advMapShading = true + end --old engine + return advUnitShading and advMapShading +end + + +local LuaShader = setmetatable({}, { + __call = function(self, ...) return new(self, ...) end, + }) +LuaShader.__index = LuaShader +LuaShader.isGeometryShaderSupported = IsGeometryShaderSupported() +LuaShader.isTesselationShaderSupported = IsTesselationShaderSupported() +LuaShader.isDeferredShadingEnabled = IsDeferredShadingEnabled() +LuaShader.GetAdvShadingActive = GetAdvShadingActive + +-----------------============ Warnings & Error Gandling ============----------------- +function LuaShader:OutputLogEntry(text, isError) + local message + + local warnErr = (isError and "error") or "warning" + + message = string.format("LuaShader: [%s] shader %s(s):\n%s", self.shaderName, warnErr, text) + + if self.logHash[message] == nil then + self.logHash[message] = 0 + end + + if self.logHash[message] <= self.logEntries then + local newCnt = self.logHash[message] + 1 + self.logHash[message] = newCnt + if (newCnt == self.logEntries) then + message = message .. string.format("\nSupressing further %s of the same kind", warnErr) + end + Spring.Echo(message) + end +end + +function LuaShader:ShowWarning(text) + self:OutputLogEntry(text, false) +end + +function LuaShader:ShowError(text) + self:OutputLogEntry(text, true) +end + +-----------------============ Handle Ghetto Include<> ==============----------------- +local includeRegexps = { + '.-#include <(.-)>.-', + '.-#include \"(.-)\".-', + '.-#pragma(%s+)include <(.-)>.-', + '.-#pragma(%s+)include \"(.-)\".-', +} + +function LuaShader:HandleIncludes(shaderCode, shaderName) + local incFiles = {} + local t1 = Spring.GetTimer() + repeat + local incFile + local regEx + for _, rx in ipairs(includeRegexps) do + _, _, incFile = string.find(shaderCode, rx) + if incFile then + regEx = rx + break + end + end + + Spring.Echo(shaderName, incFile) + + if incFile then + shaderCode = string.gsub(shaderCode, regEx, '', 1) + table.insert(incFiles, incFile) + end + until (incFile == nil) + local t2 = Spring.GetTimer() + Spring.Echo(Spring.DiffTimers(t2, t1, true)) + + local includeText = "" + for _, incFile in ipairs(incFiles) do + if VFS.FileExists(incFile) then + includeText = includeText .. VFS.LoadFile(incFile) .. "\n" + else + self:ShowError(string.format("Attempt to execute %s with file that does not exist in VFS", incFile)) + return false + end + end + + if includeText ~= "" then + return includeText .. shaderCode + else + return shaderCode + end +end + +-----------------========= End of Handle Ghetto Include<> ==========----------------- + +-----------------============ General LuaShader methods ============----------------- +function LuaShader:Compile() + if not gl.CreateShader then + self:ShowError("GLSL Shaders are not supported by hardware or drivers") + return false + end + +-- LuaShader:HandleIncludes is too slow. Figure out faster way. +--[[ + for _, shaderType in ipairs({"vertex", "tcs", "tes", "geometry", "fragment"}) do + if self.shaderParams[shaderType] then + local newShaderCode = LuaShader:HandleIncludes(self.shaderParams[shaderType], self.shaderName) + if newShaderCode then + self.shaderParams[shaderType] = newShaderCode + end + end + end +]]-- + + self.shaderObj = gl.CreateShader(self.shaderParams) + local shaderObj = self.shaderObj + + local shLog = gl.GetShaderLog() or "" + + if not shaderObj then + self:ShowError(shLog) + return false + elseif (shLog ~= "") then + self:ShowWarning(shLog) + end + + local uniforms = self.uniforms + for idx, info in ipairs(gl.GetActiveUniforms(shaderObj)) do + local uniName = string.gsub(info.name, "%[0%]", "") -- change array[0] to array + uniforms[uniName] = { + location = glGetUniformLocation(shaderObj, uniName), + --type = info.type, + --size = info.size, + values = {}, + } + --Spring.Echo(uniName, uniforms[uniName].location, uniforms[uniName].type, uniforms[uniName].size) + --Spring.Echo(uniName, uniforms[uniName].location) + end + return true +end + +LuaShader.Initialize = LuaShader.Compile + +function LuaShader:GetHandle() + if self.shaderObj ~= nil then + return self.shaderObj + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()?", funcName)) + end +end + +function LuaShader:Delete() + if self.shaderObj ~= nil then + gl.DeleteShader(self.shaderObj) + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + end +end + +LuaShader.Finalize = LuaShader.Delete + +function LuaShader:Activate() + if self.shaderObj ~= nil then + self.active = true + return glUseShader(self.shaderObj) + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + return false + end +end + +function LuaShader:SetActiveStateIgnore(flag) + self.ignoreActive = flag +end + +function LuaShader:SetUnknownUniformIgnore(flag) + self.ignoreUnkUniform = flag +end + + +function LuaShader:ActivateWith(func, ...) + if self.shaderObj ~= nil then + self.active = true + glActiveShader(self.shaderObj, func, ...) + self.active = false + else + local funcName = (debug and debug.getinfo(1).name) or "UnknownFunction" + self:ShowError(string.format("Attempt to use invalid shader object in [%s](). Did you call :Compile() or :Initialize()", funcName)) + end +end + +function LuaShader:Deactivate() + self.active = false + glUseShader(0) +end +-----------------============ End of general LuaShader methods ============----------------- + + +-----------------============ Friend LuaShader functions ============----------------- +local function getUniformImpl(self, name) + local uniform = self.uniforms[name] + + if uniform and type(uniform) == "table" then + return uniform + elseif uniform == nil then --used for indexed elements. nil means not queried for location yet + local location = glGetUniformLocation(self.shaderObj, name) + if location and location > -1 then + self.uniforms[name] = { + location = location, + values = {}, + } + return self.uniforms[name] + else + self.uniforms[name] = false --checked dynamic uniform name and didn't find it + end + end + + -- (uniform == false) + return nil +end + +local function getUniform(self, name) + if not (self.active or self.ignoreActive) then + self:ShowError(string.format("Trying to set uniform [%s] on inactive shader object. Did you use :Activate() or :ActivateWith()?", name)) + return nil + end + local uniform = getUniformImpl(self, name) + if not (uniform ~= nil or self.ignoreUnkUniform) then + self:ShowWarning(string.format("Attempt to set uniform [%s], which does not exist in the compiled shader", name)) + return nil + end + return uniform +end + +local function isUpdateRequired(uniform, tbl) + if (#tbl == 1) and (type(tbl[1]) == "string") then --named matrix + return true --no need to update cache + end + + local update = false + local cachedValues = uniform.values + for i, val in ipairs(tbl) do + if cachedValues[i] ~= val then + cachedValues[i] = val --update cache + update = true + end + end + + return update +end +-----------------============ End of friend LuaShader functions ============----------------- + + +-----------------============ LuaShader uniform manipulation functions ============----------------- +-- TODO: do it safely with types, len, size check + +function LuaShader:GetUniformLocation(name) + return (getUniform(self, name) or {}).location or -1 +end + +--FLOAT UNIFORMS +local function setUniformAlwaysImpl(uniform, ...) + glUniform(uniform.location, ...) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformAlwaysImpl(uniform, ...) +end + +local function setUniformImpl(uniform, ...) + if isUpdateRequired(uniform, {...}) then + return setUniformAlwaysImpl(uniform, ...) + end + return true +end + +function LuaShader:SetUniform(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformImpl(uniform, ...) +end + +LuaShader.SetUniformFloat = LuaShader.SetUniform +LuaShader.SetUniformFloatAlways = LuaShader.SetUniformAlways + + +--INTEGER UNIFORMS +local function setUniformIntAlwaysImpl(uniform, ...) + glUniformInt(uniform.location, ...) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformIntAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntAlwaysImpl(uniform, ...) +end + +local function setUniformIntImpl(uniform, ...) + if isUpdateRequired(uniform, {...}) then + return setUniformIntAlwaysImpl(uniform, ...) + end + return true +end + +function LuaShader:SetUniformInt(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntImpl(uniform, ...) +end + + +--FLOAT ARRAY UNIFORMS +local function setUniformFloatArrayAlwaysImpl(uniform, tbl) + glUniformArray(uniform.location, UNIFORM_TYPE_FLOAT, tbl) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformFloatArrayAlways(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformFloatArrayAlwaysImpl(uniform, tbl) +end + +local function setUniformFloatArrayImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformFloatArrayAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformFloatArray(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformFloatArrayImpl(uniform, tbl) +end + + +--INT ARRAY UNIFORMS +local function setUniformIntArrayAlwaysImpl(uniform, tbl) + glUniformArray(uniform.location, UNIFORM_TYPE_INT, tbl) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformIntArrayAlways(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntArrayAlwaysImpl(uniform, tbl) +end + +local function setUniformIntArrayImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformIntArrayAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformIntArray(name, tbl) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformIntArrayImpl(uniform, tbl) +end + + +--MATRIX UNIFORMS +local function setUniformMatrixAlwaysImpl(uniform, tbl) + glUniformMatrix(uniform.location, unpack(tbl)) + return true --currently there is no way to check if uniform is set or not :( +end + +function LuaShader:SetUniformMatrixAlways(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformMatrixAlwaysImpl(uniform, {...}) +end + +local function setUniformMatrixImpl(uniform, tbl) + if isUpdateRequired(uniform, tbl) then + return setUniformMatrixAlwaysImpl(uniform, tbl) + end + return true +end + +function LuaShader:SetUniformMatrix(name, ...) + local uniform = getUniform(self, name) + if not uniform then + return false + end + return setUniformMatrixImpl(uniform, {...}) +end +-----------------============ End of LuaShader uniform manipulation functions ============----------------- + +return LuaShader \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/PrintCam.lua b/LuaUI/Widgets_Evo/PrintCam.lua deleted file mode 100644 index 29efa4277..000000000 --- a/LuaUI/Widgets_Evo/PrintCam.lua +++ /dev/null @@ -1,22 +0,0 @@ -function widget:GetInfo() - return { - name = "PrintCam", - desc = "Print GetCameraState()", - author = "zwzsg", - version = "1", - date = "Dec, 2009", - license = "Free", - layer = 1, - enabled = false, - } -end - - -function widget:MousePress(mx, my, button) - local txt=nil - for k,v in pairs(Spring.GetCameraState()) do - txt=(txt and (txt..", ") or "")..tostring(k).."="..tostring(v) - end - txt="ViewPoint={\""..txt.."}\";" - Spring.Echo(txt) -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/dof.fs b/LuaUI/Widgets_Evo/Shaders/dof.fs new file mode 100644 index 000000000..a0892a430 --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/dof.fs @@ -0,0 +1,501 @@ +#define NORMALIZE_FILTER(fullRangeFilter) (fullRangeFilter * 0.25) + 0.5 +#define UNNORMALIZE_FILTER(normedFilter) ((2.0 * normedFilter) - 1.0) * 2.0 + +uniform sampler2D origTex; + +uniform sampler2D blurTex0; +uniform sampler2D blurTex1; +uniform sampler2D blurTex2; +uniform sampler2D blurTex3; + +uniform vec3 eyePos; +uniform mat4 viewProjection; +uniform vec2 resolution; +uniform vec2 distanceLimits; +uniform vec2 mouseDepthCoord; + +uniform int autofocus; +uniform int mousefocus; +uniform float manualFocusDepth; +uniform float fStop; +uniform int quality; + +uniform int pass; + +// Circular DOF by Kleber Garcia "Kecho" - 2017 +// Publication & Filter generator: https://github.com/kecho/CircularDofFilterGenerator + +/** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +**/ +//Main blur pass paramters +const int KERNEL_RADIUS = 5; +const int KERNEL_COUNT = 11; +const vec4 Kernel0BracketsRealXY_ImZW = vec4(-0.056556,0.920040,-0.035849,0.611305); +const vec2 Kernel0Weights_RealX_ImY = vec2(0.411259,-0.548794); +const vec4 Kernel0_RealX_ImY_RealZ_ImW[] = vec4[]( + vec4(/*XY: Non Bracketed*/0.022302,-0.035849,/*Bracketed WZ:*/0.085711,0.000000), + vec4(/*XY: Non Bracketed*/-0.056556,-0.013273,/*Bracketed WZ:*/0.000000,0.036931), + vec4(/*XY: Non Bracketed*/-0.023847,0.070538,/*Bracketed WZ:*/0.035552,0.174032), + vec4(/*XY: Non Bracketed*/0.059140,0.066382,/*Bracketed WZ:*/0.125751,0.167233), + vec4(/*XY: Non Bracketed*/0.096696,0.020687,/*Bracketed WZ:*/0.166571,0.092483), + vec4(/*XY: Non Bracketed*/0.102454,0.000000,/*Bracketed WZ:*/0.172829,0.058643), + vec4(/*XY: Non Bracketed*/0.096696,0.020687,/*Bracketed WZ:*/0.166571,0.092483), + vec4(/*XY: Non Bracketed*/0.059140,0.066382,/*Bracketed WZ:*/0.125751,0.167233), + vec4(/*XY: Non Bracketed*/-0.023847,0.070538,/*Bracketed WZ:*/0.035552,0.174032), + vec4(/*XY: Non Bracketed*/-0.056556,-0.013273,/*Bracketed WZ:*/0.000000,0.036931), + vec4(/*XY: Non Bracketed*/0.022302,-0.035849,/*Bracketed WZ:*/0.085711,0.000000) +); +const vec4 Kernel1BracketsRealXY_ImZW = vec4(0.000181,0.552380,0.000000,0.180493); +const vec2 Kernel1Weights_RealX_ImY = vec2(0.513282,4.561110); +const vec4 Kernel1_RealX_ImY_RealZ_ImW[] = vec4[]( + vec4(/*XY: Non Bracketed*/0.000181,0.014423,/*Bracketed WZ:*/0.000000,0.079908), + vec4(/*XY: Non Bracketed*/0.015852,0.024540,/*Bracketed WZ:*/0.028370,0.135962), + vec4(/*XY: Non Bracketed*/0.042831,0.026910,/*Bracketed WZ:*/0.077211,0.149093), + vec4(/*XY: Non Bracketed*/0.072553,0.018473,/*Bracketed WZ:*/0.131019,0.102347), + vec4(/*XY: Non Bracketed*/0.094542,0.005900,/*Bracketed WZ:*/0.170826,0.032690), + vec4(/*XY: Non Bracketed*/0.102454,0.000000,/*Bracketed WZ:*/0.185149,0.000000), + vec4(/*XY: Non Bracketed*/0.094542,0.005900,/*Bracketed WZ:*/0.170826,0.032690), + vec4(/*XY: Non Bracketed*/0.072553,0.018473,/*Bracketed WZ:*/0.131019,0.102347), + vec4(/*XY: Non Bracketed*/0.042831,0.026910,/*Bracketed WZ:*/0.077211,0.149093), + vec4(/*XY: Non Bracketed*/0.015852,0.024540,/*Bracketed WZ:*/0.028370,0.135962), + vec4(/*XY: Non Bracketed*/0.000181,0.014423,/*Bracketed WZ:*/0.000000,0.079908) +); +//Blur pass parameters for objects near camera +const vec4 KernelNearBracketsRealXY_ImZW = vec4(0.034624,0.050280,-0.027250,0.190460); +const vec2 KernelNearWeights_RealX_ImY = vec2(5.268909,-0.886528); +const vec4 KernelNear_RealX_ImY_RealZ_ImW[] = vec4[]( + vec4(/*XY: Non Bracketed*/0.044566,-0.027250,/*Bracketed WZ:*/0.197749,0.000000), + vec4(/*XY: Non Bracketed*/0.042298,-0.015499,/*Bracketed WZ:*/0.152642,0.061698), + vec4(/*XY: Non Bracketed*/0.039368,-0.007880,/*Bracketed WZ:*/0.094353,0.101698), + vec4(/*XY: Non Bracketed*/0.036836,-0.003243,/*Bracketed WZ:*/0.044003,0.126048), + vec4(/*XY: Non Bracketed*/0.035189,-0.000773,/*Bracketed WZ:*/0.011253,0.139018), + vec4(/*XY: Non Bracketed*/0.034624,-0.000000,/*Bracketed WZ:*/0.000000,0.143075), + vec4(/*XY: Non Bracketed*/0.035189,-0.000773,/*Bracketed WZ:*/0.011253,0.139018), + vec4(/*XY: Non Bracketed*/0.036836,-0.003243,/*Bracketed WZ:*/0.044003,0.126048), + vec4(/*XY: Non Bracketed*/0.039368,-0.007880,/*Bracketed WZ:*/0.094353,0.101698), + vec4(/*XY: Non Bracketed*/0.042298,-0.015499,/*Bracketed WZ:*/0.152642,0.061698), + vec4(/*XY: Non Bracketed*/0.044566,-0.027250,/*Bracketed WZ:*/0.197749,0.000000) +); + +const float baseStepValMag = 1.0/540.0; + +const float colorPower = 1.9; + +const float inFocusThreshold = 0.4 / float(KERNEL_RADIUS); +const float focusMixDepthRange = (float(KERNEL_RADIUS) * 2.0); +const float maxFilterRadius = 1.2; //keep between 0 and 2. Any higher than 2 will require modifying the normalization maths + //(currently does (radius/4)+0.5 to get [-2..2] to [0..1]) + +//Approximately a circle, but bulging slightly up to help with focus making sense when looking down ramps +const vec2 autofocusTestCoordOffsets[] = vec2[]( + vec2(-0.71, -0.71), + vec2(-0.71, 0.76), + vec2(0.71, 0.76), + vec2(0.71, -0.71), + vec2(-1.0, 0.0), + vec2(0.0, 1.1), + vec2(0.0, -1.0), + vec2(1.0, 0.0) +); + +vec2 multComplex(vec2 p, vec2 q) +{ + return vec2(p.x*q.x-p.y*q.y, p.x*q.y+p.y*q.x); +} + +vec4 get2CompFilters(int x) +{ + vec2 c0 = Kernel0_RealX_ImY_RealZ_ImW[x].xy; + vec2 c1 = Kernel1_RealX_ImY_RealZ_ImW[x].xy; + return vec4(c0.x, c0.y, c1.x, c1.y); +} +vec2 get1CompFilters(int x) +{ + return KernelNear_RealX_ImY_RealZ_ImW[x].xy; +} + +float LinearizeDepth(vec2 uv){ + float depthNDC = texture2D(blurTex0, uv).r; + #if DEPTH_CLIP01 + depthNDC = 2.0 * depthNDC - 1.0; + #endif + + float n22 = viewProjection[2][2]; + + return ((abs(((1.0 + depthNDC) * (1.0 + n22))/(2.0 * (depthNDC + n22))) + * (distanceLimits.y - distanceLimits.x)) + distanceLimits.x) / BLUR_START_DIST; + // return abs(viewProjection[3][2] / (viewProjection[2][2] + depthNDC)) / BLUR_START_DIST; +} + +float GetFilterRadius(vec2 uv) +{ + return UNNORMALIZE_FILTER(texture2D(origTex, uv).a); +} + +float GetEdgeNearFilterRadius(vec2 uv, vec2 stepVal) +{ + vec2 maxCoordsOffset = stepVal * maxFilterRadius * KERNEL_RADIUS; + vec2 maxCoordsOffsetPerp = vec2(stepVal.y, -stepVal.x) * maxFilterRadius * KERNEL_RADIUS; + float edgeRadius = + min(min(GetFilterRadius(uv + maxCoordsOffset), GetFilterRadius(uv - maxCoordsOffset)), + min(GetFilterRadius(uv + maxCoordsOffsetPerp), GetFilterRadius(uv - maxCoordsOffsetPerp))); + float halfEdgeRadius = + min(min(GetFilterRadius(uv + maxCoordsOffset / 2.0), GetFilterRadius(uv - maxCoordsOffset / 2.0)), + min(GetFilterRadius(uv + maxCoordsOffsetPerp / 2.0), GetFilterRadius(uv - maxCoordsOffsetPerp / 2.0))); + return min(edgeRadius, halfEdgeRadius); +} + +vec2 GetFilterCoords(int i, vec2 uv, vec2 stepVal, float filterRadius, out float targetFilterRadius) +{ + float filterDistance = float(i)*abs(filterRadius); + vec2 coords = uv + stepVal*filterDistance; + targetFilterRadius = GetFilterRadius(coords); + + //Taking the filter radius for the first candidate sampled pixel if it's less than the base filter radius + //makes sure that we both don't blur in-focus objects into out-of-focus regions behind them, and + //also blur in the out-of-focus objects nearer to the camera than the in-focus region. + //This works because it's basically checking if the first candidate sampled pixel's blur radius is large + //enough to hit the pixel we are gathering into now, that means its circle of confusion is big enough to reach + //that starting pixel. + if (targetFilterRadius - filterRadius < -0.02 / float(KERNEL_RADIUS)) + { + filterDistance = (float(i))*abs(targetFilterRadius); + coords = uv + stepVal*filterDistance; + } + return coords; +} + +//Used to find the mix value to blend between the full-size screen texture and the +//downscaled out-of-focus textures. +float FocusThresholdMixFactor(float filterRadius, float threshold) +{ + return clamp((filterRadius - threshold) * focusMixDepthRange, 0.0, 1.0); +} + +float ApertureSizeToKeepFocusFor(float targetInFocusDepth, float focusDepth) +{ + return (targetInFocusDepth * inFocusThreshold) / abs(targetInFocusDepth - focusDepth); +} + +void main() +{ + vec4 fragColor = vec4(0,0,0,0); + vec2 uv = gl_TexCoord[0].st; + float aspectRatio = resolution.y / resolution.x; + vec2 stepVal = vec2(baseStepValMag * aspectRatio, baseStepValMag); + + if (pass == FILTER_SIZE_PASS) + { + + float depth = LinearizeDepth(uv); + float focusDepth = manualFocusDepth; + float aperture = 1.0/fStop; + + vec2 centerUV = vec2(0.5,0.5); + if (mousefocus == 1) + { + centerUV = mouseDepthCoord; + focusDepth = LinearizeDepth(mouseDepthCoord); + } + + if (autofocus == 1) + { + //The numbers in the autofocus computation that look like magic numbers are, + //found by experimentation to work well enough in practice, but not sacred. + float centerDepth = LinearizeDepth(centerUV); + focusDepth = centerDepth; + float testFocusDepth = focusDepth; + + //Find the depths to use as a safety bound for the in-focus region + float minTestDepth = focusDepth; + float maxTestDepth = focusDepth; + float testDepth = 0.0; + int autofocusTestCoordCount = 8; + for (int i = 0; i < autofocusTestCoordCount; ++i) + { + testDepth = LinearizeDepth(centerUV + + (vec2(autofocusTestCoordOffsets[i].x * aspectRatio, + autofocusTestCoordOffsets[i].y) * clamp(focusDepth * 4.4, 0.1, 0.225))); + //We use averages here instead of just directly min/max testing testDepth in order to have smoother focus transitions + //across big changes to focus depth, such as the camera scrolling over a cliff or being zoomed in on a unit. + minTestDepth = min(minTestDepth, (3.0 * minTestDepth + 2.0 * testDepth) / 5.0); + maxTestDepth = max(maxTestDepth, (3.0 * maxTestDepth + 2.0 * testDepth) / 5.0); + } + + //pull focus back a bit to bias slightly towards air units and against distant terrain + float focusDepthAirFactor = clamp(0.92 + (focusDepth * 12.0), 0.92, 1.2); + testFocusDepth /= max(focusDepthAirFactor, 1.0); + focusDepth /= max(focusDepthAirFactor, 1.0); + + //The min depth bound is scaled more strongly to reduce air unit blurring when zoomed moderately out + minTestDepth = min(minTestDepth / focusDepthAirFactor, focusDepth); + maxTestDepth = + max(focusDepthAirFactor > 1.0 ? + (maxTestDepth + 2.5 * maxTestDepth * focusDepthAirFactor) / 3.5 : + maxTestDepth * focusDepthAirFactor, focusDepth); + + float focalLength = 0.05; + float minFStop = 1.0 * focalLength; + float curveDepth = 6.0; + float baseAperture = + focalLength/max(testFocusDepth * exp(curveDepth * testFocusDepth), minFStop); + + float apertureBoundsFudgeFactor = 1.15; //Used to control bounds depths without having to change inFocusThreshold + float maxDepthAperture = ApertureSizeToKeepFocusFor(maxTestDepth, focusDepth) * apertureBoundsFudgeFactor; + float minDepthAperture = ApertureSizeToKeepFocusFor(minTestDepth, focusDepth) * apertureBoundsFudgeFactor; + + aperture = min(baseAperture, min(maxDepthAperture, minDepthAperture)); + } + + float filterRadius = clamp(((depth - focusDepth) * aperture)/depth, -maxFilterRadius, maxFilterRadius); + + vec4 colors = texture2D(origTex, uv); + //Add extra brightness to brighter colours in blurrier spots to maintain a consistent exposure. + //In real life there would be a wide enough range of light levels to make bright blurry regions not + //lose brightness when blurring, but we need to fudge that here. + float lum = dot(colors.rgb,vec3(0.2126,0.7152,0.0722))*(min(0.2 + 0.65 * abs(filterRadius), 1.5)); + colors = colors *(1.0 + 0.2*lum*lum*lum); + //Raise colours to a power to increase the sharpness of the blur discs + colors = vec4(pow(colors.r, colorPower), pow(colors.g, colorPower), pow(colors.b, colorPower), colors.a); + + fragColor = vec4(colors.rgb, NORMALIZE_FILTER(filterRadius)); + + gl_FragData[0] = fragColor; + if (quality > LOW_QUALITY) + { + gl_FragData[1] = fragColor; + } + } + + else if (pass == INITIAL_BLUR_PASS) + { + vec4 valR = vec4(0,0,0,0); + vec4 valG = vec4(0,0,0,0); + vec4 valB = vec4(0,0,0,0); + float filterRadius = GetFilterRadius(uv); + float targetFilterRadius = 0.0; + int compI = 0; + for (int i=-KERNEL_RADIUS; i <=KERNEL_RADIUS; ++i) + { + compI = i; + vec2 coords = GetFilterCoords(i, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius); + if (compI < -KERNEL_RADIUS) continue; + + vec4 imageTexelRGB = texture2D(origTex, coords); + vec4 c0_c1 = get2CompFilters(compI+KERNEL_RADIUS); + valR.xy += imageTexelRGB.r * c0_c1.xy; + valR.zw += imageTexelRGB.r * c0_c1.zw; + valG.xy += imageTexelRGB.g * c0_c1.xy; + valG.zw += imageTexelRGB.g * c0_c1.zw; + valB.xy += imageTexelRGB.b * c0_c1.xy; + valB.zw += imageTexelRGB.b * c0_c1.zw; + } + gl_FragData[0] = valR; + gl_FragData[1] = valG; + gl_FragData[2] = valB; + } + + else if (pass == FINAL_BLUR_PASS) + { + vec4 valR = vec4(0,0,0,0); + vec4 valG = vec4(0,0,0,0); + vec4 valB = vec4(0,0,0,0); + float filterRadius = GetFilterRadius(uv); + float targetFilterRadius = 0.0; + int compI = 0; + for (int i=-KERNEL_RADIUS; i <=KERNEL_RADIUS; ++i) + { + compI = i; + vec2 coords = GetFilterCoords(i, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius); + if (compI < -KERNEL_RADIUS) continue; + vec4 imageTexelR = texture2D(blurTex0, coords); + vec4 imageTexelG = texture2D(blurTex1, coords); + vec4 imageTexelB = texture2D(blurTex2, coords); + + vec4 c0_c1 = get2CompFilters(compI+KERNEL_RADIUS); + + + valR.xy += multComplex(imageTexelR.xy,c0_c1.xy); + valR.zw += multComplex(imageTexelR.zw,c0_c1.zw); + + valG.xy += multComplex(imageTexelG.xy,c0_c1.xy); + valG.zw += multComplex(imageTexelG.zw,c0_c1.zw); + + valB.xy += multComplex(imageTexelB.xy,c0_c1.xy); + valB.zw += multComplex(imageTexelB.zw,c0_c1.zw); + } + + float redChannel = dot(valR.xy,Kernel0Weights_RealX_ImY)+dot(valR.zw,Kernel1Weights_RealX_ImY); + float greenChannel = dot(valG.xy,Kernel0Weights_RealX_ImY)+dot(valG.zw,Kernel1Weights_RealX_ImY); + float blueChannel = dot(valB.xy,Kernel0Weights_RealX_ImY)+dot(valB.zw,Kernel1Weights_RealX_ImY); + + fragColor = vec4(vec3(pow(redChannel, 1.0/colorPower),pow(greenChannel, 1.0/colorPower), + pow(blueChannel, 1.0/colorPower)), NORMALIZE_FILTER(filterRadius)); + gl_FragData[0] = fragColor; + } + + else if (pass == INITIAL_NEAR_BLUR_PASS) + { + vec4 valR = vec4(0,0,0,0); + vec4 valG = vec4(0,0,0,0); + vec4 valB = vec4(0,0,0,0); + vec4 valA = vec4(0,0,0,0); + //Start by finding the maximum possible relevant blur radius, since we're blurring things + //that will end up in front of more in-focus objects. + float baseFilterRadius = GetFilterRadius(uv); + float filterRadius = min(baseFilterRadius, GetEdgeNearFilterRadius(uv, stepVal)); + filterRadius = min(filterRadius, GetEdgeNearFilterRadius(uv, vec2(stepVal.y, 0.0))); + float targetFilterRadius = 0.0; + int compI = 0; + for (int i=-KERNEL_RADIUS; i <=KERNEL_RADIUS; ++i) + { + compI = i; + vec2 coords = GetFilterCoords(i, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius); + if (compI < -KERNEL_RADIUS) continue; + + vec4 imageTexelRGB = texture2D(origTex, coords); + float alpha = FocusThresholdMixFactor(-targetFilterRadius, inFocusThreshold); + alpha = min(alpha, clamp(abs(targetFilterRadius - baseFilterRadius) / 0.05, 0.0, 1.0)); + + // vec2 c0 = get1CompFilters(compI+KERNEL_RADIUS); + // valRG.xy += imageTexelRGB.r * c0; + // valRG.zw += imageTexelRGB.g * c0; + // valBA.xy += imageTexelRGB.b * c0; + // valBA.zw += alpha * c0; + + vec4 c0_c1 = get2CompFilters(compI+KERNEL_RADIUS); + valR.xy += imageTexelRGB.r * c0_c1.xy; + valR.zw += imageTexelRGB.r * c0_c1.zw; + valG.xy += imageTexelRGB.g * c0_c1.xy; + valG.zw += imageTexelRGB.g * c0_c1.zw; + valB.xy += imageTexelRGB.b * c0_c1.xy; + valB.zw += imageTexelRGB.b * c0_c1.zw; + valA.xy += alpha * c0_c1.xy; + valA.zw += alpha * c0_c1.zw; + } + // gl_FragData[0] = valRG; + // gl_FragData[1] = valBA; + + gl_FragData[0] = valR; + gl_FragData[1] = valG; + gl_FragData[2] = valB; + gl_FragData[3] = valA; + + } + + else if (pass == FINAL_NEAR_BLUR_PASS) + { + vec4 valR = vec4(0,0,0,0); + vec4 valG = vec4(0,0,0,0); + vec4 valB = vec4(0,0,0,0); + vec4 valA = vec4(0,0,0,0); + float baseFilterRadius = GetFilterRadius(uv); + float filterRadius = min(GetFilterRadius(uv), GetEdgeNearFilterRadius(uv, stepVal)); + filterRadius = min(filterRadius, GetEdgeNearFilterRadius(uv, vec2(stepVal.x, 0.0))); + float targetFilterRadius = 0.0; + int compI = 0; + for (int i=-KERNEL_RADIUS; i <=KERNEL_RADIUS; ++i) + { + compI = i; + vec2 coords = GetFilterCoords(i, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius); + if (compI < -KERNEL_RADIUS) continue; + + //imageTexelBA/imageTexelA has the alpha from the initial pass, but we need to also get it for the + //final pass separately since alpha represents the edge of different filter radii, and + //that's not something a single pass of a 2-pass blur will fully pick up. + float finalPassAlpha = FocusThresholdMixFactor(-targetFilterRadius, inFocusThreshold); + finalPassAlpha = min(finalPassAlpha, clamp(abs(targetFilterRadius - baseFilterRadius) / 0.05, 0.0, 1.0)); + + // vec4 imageTexelRG = texture2D(blurTex0, coords); + // vec4 imageTexelBA = texture2D(blurTex1, coords); + + // vec2 c0 = get1CompFilters(compI+KERNEL_RADIUS); + + // valR.xy += multComplex(imageTexelRG.xy,c0); + // valG.xy += multComplex(imageTexelRG.zw,c0); + // valB.xy += multComplex(imageTexelBA.xy,c0); + // valA.xy += multComplex(imageTexelBA.zw,c0); + // valA.xy += finalPassAlpha * c0; + + vec4 imageTexelR = texture2D(blurTex0, coords); + vec4 imageTexelG = texture2D(blurTex1, coords); + vec4 imageTexelB = texture2D(blurTex2, coords); + vec4 imageTexelA = texture2D(blurTex3, coords); + + vec4 c0_c1 = get2CompFilters(compI+KERNEL_RADIUS); + + valR.xy += multComplex(imageTexelR.xy,c0_c1.xy); + valR.zw += multComplex(imageTexelR.zw,c0_c1.zw); + + valG.xy += multComplex(imageTexelG.xy,c0_c1.xy); + valG.zw += multComplex(imageTexelG.zw,c0_c1.zw); + + valB.xy += multComplex(imageTexelB.xy,c0_c1.xy); + valB.zw += multComplex(imageTexelB.zw,c0_c1.zw); + + valA.xy += multComplex(imageTexelA.xy,c0_c1.xy); + valA.zw += multComplex(imageTexelA.zw,c0_c1.zw); + valA.xy += finalPassAlpha * c0_c1.xy; + valA.zw += finalPassAlpha * c0_c1.zw; + } + // float redChannel = dot(valR.xy,KernelNearWeights_RealX_ImY); + // float greenChannel = dot(valG.xy,KernelNearWeights_RealX_ImY); + // float blueChannel = dot(valB.xy,KernelNearWeights_RealX_ImY); + // float alphaChannel = dot(valA.xy, KernelNearWeights_RealX_ImY); + + float redChannel = dot(valR.xy,Kernel0Weights_RealX_ImY)+dot(valR.zw,Kernel1Weights_RealX_ImY); + float greenChannel = dot(valG.xy,Kernel0Weights_RealX_ImY)+dot(valG.zw,Kernel1Weights_RealX_ImY); + float blueChannel = dot(valB.xy,Kernel0Weights_RealX_ImY)+dot(valB.zw,Kernel1Weights_RealX_ImY); + float alphaChannel = dot(valA.xy,Kernel0Weights_RealX_ImY)+dot(valA.zw,Kernel1Weights_RealX_ImY); + + fragColor = vec4(pow(redChannel, 1.0/colorPower),pow(greenChannel, 1.0/colorPower), + pow(blueChannel, 1.0/colorPower), clamp(alphaChannel, 0.0, 1.0)); + gl_FragData[0] = fragColor; + } + + else if (pass == COMPOSITION_PASS) + { + vec4 blurTexAtUV = texture2D(blurTex0, uv); + vec4 origTexAtUV = texture2D(origTex, uv); + float filterRadius = UNNORMALIZE_FILTER(blurTexAtUV.a); + float mixFactor = FocusThresholdMixFactor(abs(filterRadius), inFocusThreshold); + fragColor = origTexAtUV; + + // if (quality >= HIGH_QUALITY) + // { + // float mixFactor = FocusThresholdMixFactor(abs(filterRadius), inFocusThreshold * 2.5); //Need to blur later since full screen blurring helps transition + // if (abs(filterRadius) > inFocusThreshold) + // { + // float targetFilterRadius = 0.0; + // fragColor += texture2D(origTex, GetFilterCoords(KERNEL_RADIUS, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(-KERNEL_RADIUS, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(KERNEL_RADIUS, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(-KERNEL_RADIUS, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(KERNEL_RADIUS / 2, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(-KERNEL_RADIUS / 2, uv, vec2(stepVal.x, 0.0), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(KERNEL_RADIUS / 2, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius)) + // + texture2D(origTex, GetFilterCoords(-KERNEL_RADIUS / 2, uv, vec2(0.0, stepVal.y), filterRadius, targetFilterRadius)); + // fragColor /= 9.0; + // } + // } + + fragColor = mix(fragColor, blurTexAtUV, mixFactor); + + if (quality > LOW_QUALITY) + { + vec4 nearBlurTexAtUV = texture2D(blurTex1, uv); + float alpha = clamp(nearBlurTexAtUV.a * 1.5, 0.0, 1.0); + fragColor.rgb = mix(fragColor.rgb, nearBlurTexAtUV.rgb, alpha); + // fragColor = vec4(alpha); + } + + gl_FragData[0] = fragColor; + } + +} diff --git a/LuaUI/Widgets_Evo/Shaders/gaussianBlur.frag.glsl b/LuaUI/Widgets_Evo/Shaders/gaussianBlur.frag.glsl new file mode 100644 index 000000000..35512987b --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/gaussianBlur.frag.glsl @@ -0,0 +1,37 @@ +#version 150 compatibility + +uniform sampler2D tex; + +uniform float offsets[###BLUR_HALF_KERNEL_SIZE###]; +uniform float weights[###BLUR_HALF_KERNEL_SIZE###]; + +uniform vec2 dir; + +uniform vec2 viewPortSize; + +void main(void) +{ + vec2 uv = gl_FragCoord.xy / viewPortSize; + vec4 acc = texture( tex, uv ) * weights[0]; + float okCoords; + + for (int i = 1; i < ###BLUR_HALF_KERNEL_SIZE###; ++i) { + vec2 uvOff = offsets[i] * dir / viewPortSize; + vec2 uvP = uv + uvOff; + vec2 uvN = uv - uvOff; + + float weightP = weights[i]; + float weightN = weights[i]; + + okCoords = float( all(bvec4( greaterThanEqual(uvP, vec2(0.0)), lessThanEqual(uvP, vec2(1.0)) )) ); + weightP *= okCoords; + + okCoords = float( all(bvec4( greaterThanEqual(uvN, vec2(0.0)), lessThanEqual(uvN, vec2(1.0)) )) ); + weightN *= okCoords; + + acc += texture( tex, uvP ) * weightP; + acc += texture( tex, uvN ) * weightN; + } + + gl_FragColor = acc; +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/gbuffFuse.frag.glsl b/LuaUI/Widgets_Evo/Shaders/gbuffFuse.frag.glsl new file mode 100644 index 000000000..eb744fe50 --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/gbuffFuse.frag.glsl @@ -0,0 +1,77 @@ +#version 150 compatibility + +#define DEPTH_CLIP01 ###DEPTH_CLIP01### +#define MERGE_MISC ###MERGE_MISC### + +uniform sampler2D modelDepthTex; +uniform sampler2D mapDepthTex; + +uniform sampler2D modelNormalTex; +uniform sampler2D mapNormalTex; + +uniform sampler2D modelMiscTex; +uniform sampler2D mapMiscTex; + +uniform vec2 viewPortSize; + +uniform mat4 invProjMatrix; +uniform mat4 viewMatrix; + +#define NORM2SNORM(value) (value * 2.0 - 1.0) +#define SNORM2NORM(value) (value * 0.5 + 0.5) + +// Calculate out of the fragment in screen space the view space position. +vec4 GetViewPos(vec2 texCoord, float sampledDepth) { + vec4 projPosition = vec4(0.0, 0.0, 0.0, 1.0); + + //texture space [0;1] to NDC space [-1;1] + #if (DEPTH_CLIP01 == 1) + //don't transform depth as it's in the same [0;1] space + projPosition.xyz = vec3(NORM2SNORM(texCoord), sampledDepth); + #else + projPosition.xyz = NORM2SNORM(vec3(texCoord, sampledDepth)); + #endif + + vec4 viewPosition = invProjMatrix * projPosition; + viewPosition /= viewPosition.w; + + return viewPosition; +} + +void main() { + vec2 uv = gl_FragCoord.xy / viewPortSize; + + float modelDepth = texelFetch(modelDepthTex, ivec2(gl_FragCoord.xy), 0).r; + float mapDepth = texelFetch(mapDepthTex, ivec2(gl_FragCoord.xy), 0).r; + + float modelOccludesMap = float(modelDepth < mapDepth); + float depth = mix(mapDepth, modelDepth, modelOccludesMap); + + vec4 viewPosition = GetViewPos(uv, depth); + + vec3 modelNormal = texture(modelNormalTex, uv).rgb; + vec3 mapNormal = texture(mapNormalTex, uv).rgb; + + vec3 viewNormal = mix(mapNormal, modelNormal, modelOccludesMap); + float validNormal = float(length(viewNormal) > 0.2); //empty spaces in g-buffer will have vec3(0.0) normals + + viewNormal = NORM2SNORM(viewNormal); + viewNormal = normalize(viewNormal); + viewNormal = vec3(viewMatrix * vec4(viewNormal, 0.0)); //transform world-->view space + + #if (MERGE_MISC == 1) + vec4 modelMiscInfo = texture(modelMiscTex, uv); + vec4 mapMiscInfo = texture(mapMiscTex, uv); + vec4 miscInfo = mix(mapMiscInfo, modelMiscInfo, modelOccludesMap); + #endif + + // MRT output: + //[0] = gbuffFuseViewPosTex + //[1] = gbuffFuseViewNormalTex + //[2] = gbuffFuseMiscTex (conditional to MERGE_MISC == 1) + gl_FragData[0].xyz = viewPosition.xyz; + gl_FragData[1].xyz = mix( vec3(0.0), viewNormal.xyz, vec3(validNormal) ); + #if (MERGE_MISC == 1) + gl_FragData[2] = miscInfo; + #endif +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/identity.vert.glsl b/LuaUI/Widgets_Evo/Shaders/identity.vert.glsl new file mode 100644 index 000000000..6c4a87db2 --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/identity.vert.glsl @@ -0,0 +1,5 @@ +#version 150 compatibility + +void main() { + gl_Position = gl_Vertex; +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/outlineApplication.frag.glsl b/LuaUI/Widgets_Evo/Shaders/outlineApplication.frag.glsl new file mode 100644 index 000000000..c08050cee --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/outlineApplication.frag.glsl @@ -0,0 +1,17 @@ +#version 150 compatibility + +uniform sampler2D tex; +uniform sampler2D modelDepthTex; + +uniform float strength = 1.0; + +void main() { + ivec2 imageCoord = ivec2(gl_FragCoord.xy); + + vec4 color = texelFetch(tex, imageCoord, 0); + float modelDepth = texelFetch(modelDepthTex, imageCoord, 0).r; + + vec4 mixVal = strength * vec4(modelDepth == 1.0); //outside of any existing model shapes + + gl_FragColor = mix(vec4(0.0), color, mixVal); +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/outlineDilate.frag.glsl b/LuaUI/Widgets_Evo/Shaders/outlineDilate.frag.glsl new file mode 100644 index 000000000..aba6ea03c --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/outlineDilate.frag.glsl @@ -0,0 +1,86 @@ +#version 150 compatibility + +uniform sampler2D depthTex; +uniform sampler2D colorTex; + +uniform mat4 projMatrix; + +#define DILATE_SINGLE_PASS ###DILATE_SINGLE_PASS### + +uniform int dilateHalfKernelSize = 1; + +uniform vec2 viewPortSize; +uniform float strength = 1.0; +//layout(pixel_center_integer) in vec4 gl_FragCoord; +//layout(origin_upper_left) in vec4 gl_FragCoord; + + +#if (DILATE_SINGLE_PASS == 1) + void main(void) + { + ivec4 vpsMinMax = ivec4(0, 0, ivec2(viewPortSize)); + + float minDepth = 1.0; + vec4 maxColor = vec4(0.0); + + ivec2 thisCoord = ivec2(gl_FragCoord.xy); + + vec2 bnd = vec2(dilateHalfKernelSize - 1, dilateHalfKernelSize + 2) * strength; + + for (int x = -dilateHalfKernelSize; x <= dilateHalfKernelSize; ++x) { + for (int y = -dilateHalfKernelSize; y <= dilateHalfKernelSize; ++y) { + + ivec2 offset = ivec2(x, y); + /* + ivec2 samplingCoord = thisCoord + offset; + bool okCoords = ( all(bvec4( + greaterThanEqual(samplingCoord, vpsMinMax.xy), + lessThanEqual(samplingCoord, vpsMinMax.zw) )) + ); + + if (okCoords)*/ { + minDepth = min(minDepth, texelFetchOffset( depthTex, thisCoord, 0, offset).r); + vec4 thisColor = texelFetchOffset( colorTex, thisCoord, 0, offset); + thisColor.a *= smoothstep(bnd.y, bnd.x, sqrt(float(x * x + y * y))); + maxColor = max(maxColor, thisColor); + } + } + } + gl_FragDepth = minDepth; + gl_FragColor = maxColor; + } +#else //separable vert/horiz passes + uniform vec2 dir; + void main(void) + { + ivec4 vpsMinMax = ivec4(0, 0, ivec2(viewPortSize)); + + float minDepth = 1.0; + vec4 maxColor = vec4(0.0); + + ivec2 thisCoord = ivec2(gl_FragCoord.xy); + + vec2 bnd = vec2(dilateHalfKernelSize - 1, dilateHalfKernelSize + 2) * strength; + + for (int i = -dilateHalfKernelSize; i <= dilateHalfKernelSize; ++i) { + + ivec2 offset = ivec2(i) * ivec2(dir); + /* + ivec2 samplingCoord = thisCoord + offset; + bool okCoords = ( all(bvec4( + greaterThanEqual(samplingCoord, vpsMinMax.xy), + lessThanEqual(samplingCoord, vpsMinMax.zw) )) + ); + + if (okCoords)*/ { + minDepth = min(minDepth, texelFetchOffset( depthTex, thisCoord, 0, offset).r); + vec4 thisColor = texelFetchOffset( colorTex, thisCoord, 0, offset); + thisColor.a *= smoothstep(bnd.y, bnd.x, abs(i)); + maxColor = max(maxColor, thisColor); + } + } + + gl_FragDepth = minDepth; + gl_FragColor = maxColor; + } +#endif \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/outlineShape.frag.glsl b/LuaUI/Widgets_Evo/Shaders/outlineShape.frag.glsl new file mode 100644 index 000000000..97635a810 --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/outlineShape.frag.glsl @@ -0,0 +1,31 @@ +#version 150 compatibility + +uniform sampler2D modelDepthTex; +uniform sampler2D mapDepthTex; +uniform sampler2D modelMiscTex; + +uniform vec4 outlineColor; + +#define USE_MATERIAL_INDICES ###USE_MATERIAL_INDICES### + +void main() { + ivec2 imageCoord = ivec2(gl_FragCoord.xy); + + float mapDepth = texelFetch(mapDepthTex, imageCoord, 0).r; + float modelDepth = texelFetch(modelDepthTex, imageCoord, 0).r; + + bool cond = mapDepth > modelDepth && modelDepth < 1.0; + + vec4 validUnit = vec4(cond); + #if (USE_MATERIAL_INDICES == 1) + #define MATERIAL_UNITS_MAX_INDEX 127 + #define MATERIAL_UNITS_MIN_INDEX 1 + + if (cond) { + int matIndices = int(texelFetch(modelMiscTex, imageCoord, 0).r * 255.0); + validUnit *= float( (matIndices >= MATERIAL_UNITS_MIN_INDEX) && (matIndices <= MATERIAL_UNITS_MAX_INDEX) ); + } + #endif + + gl_FragColor = mix(vec4(0.0), outlineColor, validUnit); +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/Shaders/ssao.frag.glsl b/LuaUI/Widgets_Evo/Shaders/ssao.frag.glsl new file mode 100644 index 000000000..b8a3ebd3b --- /dev/null +++ b/LuaUI/Widgets_Evo/Shaders/ssao.frag.glsl @@ -0,0 +1,113 @@ +#version 150 compatibility + +uniform sampler2D viewPosTex; +uniform sampler2D viewNormalTex; + +uniform vec2 viewPortSize; + +uniform float shadowDensity; + +uniform mat4 projMatrix; + +#define NORM2SNORM(value) (value * 2.0 - 1.0) +#define SNORM2NORM(value) (value * 0.5 + 0.5) + +#define HASHSCALE3 vec3(.1031, .1030, .0973) + +vec3 hash32(vec2 p) { + vec3 p3 = fract(vec3(p.xyx) * HASHSCALE3); + p3 += dot(p3, p3.yxz+19.19); + return fract((p3.xxy+p3.yzz)*p3.zyx); +} + +//---------------------------------------------------------------------------------------- + +#define SSAO_KERNEL_SIZE ###SSAO_KERNEL_SIZE### + +#define SSAO_RADIUS ###SSAO_RADIUS### +#define SSAO_MIN ###SSAO_MIN### +#define SSAO_MAX ###SSAO_MAX### * SSAO_RADIUS + +#define SSAO_FADE_DIST_1 800.0 +#define SSAO_FADE_DIST_0 3.0 * SSAO_FADE_DIST_1 + +#define SSAO_ALPHA_POW ###SSAO_ALPHA_POW### + +//---------------------------------------------------------------------------------------- + +uniform vec3 samplingKernel[SSAO_KERNEL_SIZE]; + +// generally follow https://github.com/McNopper/OpenGL/blob/master/Example28/shader/ssao.frag.glsl +void main() { + vec2 uv = gl_FragCoord.xy / viewPortSize; + + vec4 viewPosition = vec4( texture(viewPosTex, uv).xyz, 1.0 ); + vec3 viewNormal = texture(viewNormalTex, uv).xyz; + + float fragDistFactor = smoothstep( SSAO_FADE_DIST_0, SSAO_FADE_DIST_1, -viewPosition.z ); + + gl_FragColor = vec4(1.0, 1.0, 1.0, 0.0); + + if ( dot(viewNormal, viewNormal) > 0.0 && fragDistFactor > 0.0 ) { + // Calculate the rotation matrix for the kernel. + vec3 randomVector = normalize( NORM2SNORM(hash32(gl_FragCoord.xy)) ); + + // Using Gram-Schmidt process to get an orthogonal vector to the normal vector. + // The resulting tangent is on the same plane as the random and normal vector. + // see http://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process + // Note: No division by needed, as this is for normal vectors 1. + vec3 viewTangent = normalize(randomVector - dot(randomVector, viewNormal) * viewNormal); + + vec3 viewBitangent = cross(viewNormal, viewTangent); + + // Final matrix to reorient the kernel depending on the normal and the random vector. + // TBN matrix. Transforms from tangent space to view space + mat3 kernelMatrix = mat3(viewTangent, viewBitangent, viewNormal); + + // Go through the kernel samples and create occlusion factor. + float occlusion = 0.0; + + + for (int i = 0; i < SSAO_KERNEL_SIZE; ++i) { + // Reorient sample vector in view space ... + vec3 viewSampleVector = kernelMatrix * samplingKernel[i]; + + // ... and calculate sample point. + vec4 viewTestPosition = viewPosition + SSAO_RADIUS * vec4(viewSampleVector, 0.0); + + // projection + vec4 ndcTestPosition = projMatrix * viewTestPosition; + // perspecitive division + ndcTestPosition /= ndcTestPosition.w; + + // [-1;1] to [0;1] + vec2 texSampingPoint = SNORM2NORM(ndcTestPosition.xy); + + // Get sample viewPos from the viewPosTex texture + vec3 viewPositionSampled = texture(viewPosTex, texSampingPoint).xyz; + + float delta = viewPositionSampled.z - viewTestPosition.z; + + #if 0 + float occlusionCondition = float(delta >= SSAO_MIN && delta <= SSAO_MAX); + #else + float occlusionCondition = float(delta >= SSAO_MIN) * smoothstep(SSAO_MAX, 0.5 * SSAO_MAX, delta); + #endif + + occlusion += occlusionCondition; + } + + occlusion *= fragDistFactor; + + // No occlusion gets white, full occlusion gets black. + occlusion = 1.0 - occlusion / float(SSAO_KERNEL_SIZE); + + float occlusionAlpha = occlusion; + occlusionAlpha = pow(occlusionAlpha, SSAO_ALPHA_POW); + + occlusionAlpha = clamp(1.0 - occlusionAlpha, 0.0, 1.0); + //occlusionAlpha = 1.0; + + gl_FragColor = vec4(vec3(shadowDensity * occlusion), occlusionAlpha); + } +} \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/api_chili.lua b/LuaUI/Widgets_Evo/api_chili.lua index 0015b6d0d..421b07350 100644 --- a/LuaUI/Widgets_Evo/api_chili.lua +++ b/LuaUI/Widgets_Evo/api_chili.lua @@ -2,19 +2,19 @@ -------------------------------------------------------------------------------- function widget:GetInfo() - return { - name = "Chili Framework", - desc = "Hot GUI Framework", - author = "jK", - date = "WIP", - license = "GPLv2", - version = "2.0", - layer = 1000, - enabled = true, -- loaded by default? - handler = true, - api = true, - alwaysStart = true, - } + return { + name = "Chili Framework", + desc = "Hot GUI Framework", + author = "jK", + date = "WIP", + license = "GPLv2", + version = "2.1", + layer = -1000, + enabled = true, -- loaded by default? + handler = true, + api = true, + hidden = true, + } end @@ -31,138 +31,214 @@ local tf -------------------------------------------------------------------------------- -- Chili's location -local function GetDirectory(filepath) - return filepath and filepath:gsub("(.*/)(.*)", "%1") -end +local function GetDirectory(filepath) + return filepath and filepath:gsub("(.*/)(.*)", "%1") +end +assert(debug) local source = debug and debug.getinfo(1).source -local DIR = GetDirectory(source) or (LUAUI_DIRNAME.."Widgets/") +local DIR = GetDirectory(source) or ((LUA_DIRNAME or LUAUI_DIRNAME) .."Widgets_Evo/") CHILI_DIRNAME = DIR .. "chili/" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function widget:Initialize() - Chili = VFS.Include(CHILI_DIRNAME .. "core.lua", nil, VFS.RAW_FIRST) + Chili = VFS.Include(CHILI_DIRNAME .. "core.lua", nil, VFS.RAW_FIRST) - screen0 = Chili.Screen:New{} - th = Chili.TextureHandler - tk = Chili.TaskHandler - tf = Chili.FontHandler + screen0 = Chili.Screen:New{} + th = Chili.TextureHandler + tk = Chili.TaskHandler + tf = Chili.FontHandler - --// Export Widget Globals - WG.Chili = Chili - WG.Chili.Screen0 = screen0 + --// Export Widget Globals + WG.Chili = Chili + WG.Chili.Screen0 = screen0 - --// do this after the export to the WG table! - --// because other widgets use it with `parent=Chili.Screen0`, - --// but chili itself doesn't handle wrapped tables correctly (yet) - screen0 = Chili.DebugHandler.SafeWrap(screen0) + --// do this after the export to the WG table! + --// because other widgets use it with `parent=Chili.Screen0`, + --// but chili itself doesn't handle wrapped tables correctly (yet) + screen0 = Chili.DebugHandler.SafeWrap(screen0) end function widget:Shutdown() - --table.clear(Chili) the Chili table also is the global of the widget so it contains a lot more than chili's controls (pairs,select,...) - WG.Chili = nil + --table.clear(Chili) the Chili table also is the global of the widget so it contains a lot more than chili's controls (pairs,select,...) + WG.Chili = nil end function widget:Dispose() - screen0:Dispose() + screen0:Dispose() end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -function widget:DrawScreen() - if (not screen0:IsEmpty()) then - gl.PushMatrix() - local vsx,vsy = gl.GetViewSizes() - gl.Translate(0,vsy,0) - gl.Scale(1,-1,1) - screen0:Draw() - gl.PopMatrix() - end +local pressed = {} + +function widget:MousePress(mx, my, mButton) + if pressed[mButton] then --engine bug?(mouserelease is not called when another mouse button is pressed before releasing) + --this is also fixed in Update() + widget:MouseRelease(mx, my, mButton) end +pressed[mButton] = true -function widget:TweakDrawScreen() - if (not screen0:IsEmpty()) then - gl.PushMatrix() - local vsx,vsy = gl.GetViewSizes() - gl.Translate(0,vsy,0) - gl.Scale(1,-1,1) - screen0:TweakDraw() - gl.PopMatrix() - end +return true end +function widget:MouseRelease(mx, my, mButton) + if not pressed[mButton] then return false end + + pressed[mButton] = false + return true +end function widget:Update() - tk.Update() - tf.Update() + local mx, my, lmb, mmb, rmb = Spring.GetMouseState()--engine BUG FIX --should work fine even after engine/wh bug is fixed + if pressed[1] and not lmb then + widget:MouseRelease(mx, my, 1) + end + if pressed[2] and not mmb then + widget:MouseRelease(mx, my, 2) + end + if pressed[3] and not rmb then + widget:MouseRelease(mx, my, 3) + end +end + + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + gl.Color(1,1,1,1) + if (not screen0:IsEmpty()) then + gl.PushMatrix() + local vsx,vsy = gl.GetViewSizes() + gl.Translate(0,vsy,0) + gl.Scale(1,-1,1) + screen0:Draw() + gl.PopMatrix() + end + gl.Color(1,1,1,1) +end + + +function widget:DrawLoadScreen() + gl.Color(1,1,1,1) + if (not screen0:IsEmpty()) then + gl.PushMatrix() + local vsx,vsy = gl.GetViewSizes() + gl.Scale(1/vsx,1/vsy,1) + gl.Translate(0,vsy,0) + gl.Scale(1,-1,1) + screen0:Draw() + gl.PopMatrix() + end + gl.Color(1,1,1,1) +end + + +function widget:TweakDrawScreen() + gl.Color(1,1,1,1) + if (not screen0:IsEmpty()) then + gl.PushMatrix() + local vsx,vsy = gl.GetViewSizes() + gl.Translate(0,vsy,0) + gl.Scale(1,-1,1) + screen0:TweakDraw() + gl.PopMatrix() + end + gl.Color(1,1,1,1) end function widget:DrawGenesis() - th.Update() + gl.Color(1,1,1,1) + tf.Update() + th.Update() + tk.Update() + gl.Color(1,1,1,1) end function widget:IsAbove(x,y) - return (not screen0:IsEmpty()) and screen0:IsAbove(x,y) + if Spring.IsGUIHidden() then return false end + + return screen0:IsAbove(x,y) end local mods = {} function widget:MousePress(x,y,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + if Spring.IsGUIHidden() then return false end - return screen0:MouseDown(x,y,button,mods) + local alt, ctrl, meta, shift = Spring.GetModKeyState() + mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + return screen0:MouseDown(x,y,button,mods) end function widget:MouseRelease(x,y,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + if Spring.IsGUIHidden() then return false end - return screen0:MouseUp(x,y,button,mods) + local alt, ctrl, meta, shift = Spring.GetModKeyState() + mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + return screen0:MouseUp(x,y,button,mods) end function widget:MouseMove(x,y,dx,dy,button) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + if Spring.IsGUIHidden() then return false end - return screen0:MouseMove(x,y,dx,dy,button,mods) + local alt, ctrl, meta, shift = Spring.GetModKeyState() + mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + return screen0:MouseMove(x,y,dx,dy,button,mods) end function widget:MouseWheel(up,value) - local x,y = Spring.GetMouseState() - local alt, ctrl, meta, shift = Spring.GetModKeyState() - mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + if Spring.IsGUIHidden() then return false end - return screen0:MouseWheel(x,y,up,value,mods) + local x,y = Spring.GetMouseState() + local alt, ctrl, meta, shift = Spring.GetModKeyState() + mods.alt=alt; mods.ctrl=ctrl; mods.meta=meta; mods.shift=shift; + return screen0:MouseWheel(x,y,up,value,mods) end local keyPressed = true function widget:KeyPress(key, mods, isRepeat, label, unicode) - keyPressed = screen0:KeyPress(key, mods, isRepeat, label, unicode) - return keyPressed + if Spring.IsGUIHidden() then return false end + + keyPressed = screen0:KeyPress(key, mods, isRepeat, label, unicode) + return keyPressed end function widget:KeyRelease() - local _keyPressed = keyPressed - keyPressed = false - return _keyPressed -- block engine actions when we processed it + if Spring.IsGUIHidden() then return false end + + local _keyPressed = keyPressed + keyPressed = false + return _keyPressed -- block engine actions when we processed it end +function widget:TextInput(utf8, ...) + if Spring.IsGUIHidden() then return false end -function widget:ViewResize(vsx, vsy) + return screen0:TextInput(utf8, ...) +end + + +function widget:ViewResize(vsx, vsy) screen0:Resize(vsx, vsy) -end +end widget.TweakIsAbove = widget.IsAbove widget.TweakMousePress = widget.MousePress diff --git a/LuaUI/Widgets_Evo/api_mexspot_fetcher.lua b/LuaUI/Widgets_Evo/api_mexspot_fetcher.lua new file mode 100644 index 000000000..6585bbeb5 --- /dev/null +++ b/LuaUI/Widgets_Evo/api_mexspot_fetcher.lua @@ -0,0 +1,59 @@ + +function widget:GetInfo() + return { + name = "Mexspot Fetcher", + desc = "Fetches metal spot data from synced.", + author = "Google Frog", -- + date = "22 April 2012", + license = "GNU GPL, v2 or later", + layer = -30000, + enabled = true, -- loaded by default? + alwaysStart = true, + hidden = true, + } +end + +local spGetGameRulesParam = Spring.GetGameRulesParam + +local function GetSpotsByPos(spots) + local spotPos = {} + for i = 1, #spots do + local spot = spots[i] + local x = spot.x + local z = spot.z + --Spring.MarkerAddPoint(x,0,z,x .. ", " .. z) + spotPos[x] = spotPos[x] or {} + spotPos[x][z] = i + end + return spotPos +end + +local function GetMexSpotsFromGameRules() + local mexCount = spGetGameRulesParam("mex_count") + if (not mexCount) or mexCount == -1 then + WG.metalSpots = false + WG.metalSpotsByPos = false + return + end + + local metalSpots = {} + + for i = 1, mexCount do + metalSpots[i] = { + x = spGetGameRulesParam("mex_x" .. i), + y = spGetGameRulesParam("mex_y" .. i), + z = spGetGameRulesParam("mex_z" .. i), + metal = spGetGameRulesParam("mex_metal" .. i), + } + end + + local metalSpotsByPos = GetSpotsByPos(metalSpots) + + WG.metalSpots = metalSpots + WG.metalSpotsByPos = metalSpotsByPos +end + +function widget:Initialize() + Spring.Echo("Mexspot Fetcher fetching") + GetMexSpotsFromGameRules() +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/autoquit.lua b/LuaUI/Widgets_Evo/autoquit.lua deleted file mode 100644 index f4da9bb61..000000000 --- a/LuaUI/Widgets_Evo/autoquit.lua +++ /dev/null @@ -1,57 +0,0 @@ - ----------------------------------------------------------------- --- global variables ----------------------------------------------------------------- -local versionNumber = "v1.2" -local delay = 20 -local endTime -local mx,my - ----------------------------------------------------------------- --- speedups ----------------------------------------------------------------- -local DiffTimers = Spring.DiffTimers -local GetTimer = Spring.GetTimer -local SendCommands = Spring.SendCommands -local Echo = Spring.Echo -local GetMouseState = Spring.GetMouseState - ----------------------------------------------------------------- --- callins ----------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Autoquit", - desc = versionNumber .. " Automatically quits "..delay.."s after the game ends. Move mouse to cancel.", - author = "Evil4Zerggin & zwzsg", - date = "25 December 2008", - license = "GNU LGPL, v2.1 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - -function widget:Initialize() - endTime = false -end - -function widget:GameOver() - endTime = GetTimer() - mx,my = GetMouseState() - Echo(" Automatically exiting in " .. delay .. " seconds. Move mouse to cancel.") -end - -function widget:Update(dt) - if endTime then - local nmx,nmy = GetMouseState() - if nmx~=mx or nmy~=my then - Echo(" Autoquit canceled.") - endTime = false - -- widgetHandler:RemoveWidget() - elseif DiffTimers(GetTimer(), endTime) > delay then - Echo(" Autoquit sending quit command.") - SendCommands("quitforce") - end - end -end diff --git a/LuaUI/Widgets_Evo/camera_cofc.lua b/LuaUI/Widgets_Evo/camera_cofc.lua deleted file mode 100644 index 8ef43cafc..000000000 --- a/LuaUI/Widgets_Evo/camera_cofc.lua +++ /dev/null @@ -1,1665 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Combo Overhead/Free Camera (experimental)", - desc = "v0.107 Camera featuring 6 actions. Type \255\90\90\255/luaui cofc help\255\255\255\255 for help.", - author = "CarRepairer", - date = "2011-03-16", --2013-02-13 (msafwan) - license = "GNU GPL, v2 or later", - layer = 1002, - handler = true, - enabled = true, - } -end - -include("keysym.h.lua") - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local init = true -local trackmode = false --before options -local thirdperson_trackunit = false - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options_path = 'Settings/Camera/Advanced Camera Config' -options_order = { - 'helpwindow', - - 'lblRotate', - 'targetmouse', - 'rotateonedge', - 'rotfactor', - 'inverttilt', - 'groundrot', - - 'lblScroll', - 'edgemove', - 'smoothscroll', - 'speedFactor', - 'speedFactor_k', - 'invertscroll', - 'smoothmeshscroll', - - 'lblZoom', - 'invertzoom', - 'invertalt', - 'zoomintocursor', - 'zoomoutfromcursor', - 'zoominfactor', - 'zoomoutfactor', - - 'lblMisc', - 'overviewmode', - 'follow', - 'smoothness', - 'fov', - --'restrictangle', - --'mingrounddist', - 'freemode', - - 'trackmode', - 'persistenttrackmode', - 'thirdpersontrack', - 'thirdpersonedgescroll', - --'persistentthirdpersontrackmode', - 'resetcam', - - 'enableCycleView', - -} - -local OverviewAction = function() end -local SetFOV = function(fov) end - -options = { - - lblblank1 = {name='', type='label'}, - lblRotate = {name='Rotation', type='label'}, - lblScroll = {name='Scrolling', type='label'}, - lblZoom = {name='Zooming', type='label'}, - lblMisc = {name='Misc.', type='label'}, - - helpwindow = { - name = 'COFCam Help', - type = 'text', - value = [[ - Complete Overhead/Free Camera has six main actions... - - Zoom..... - Tilt World..... + - Altitude..... + - Mouse Scroll..... - Rotate World..... + - Rotate Camera..... + - - Additional actions: - Keyboard: replicate middlebutton drag while replicate mousewheel. You can use these with ctrl, alt & shift to replicate mouse camera actions. - Use to speed up camera movements. - Reset Camera..... + + + - ]], - }, - smoothscroll = { - name = 'Smooth scrolling', - desc = 'Use smoothscroll method when mouse scrolling.', - type = 'bool', - value = false, - }, - smoothmeshscroll = { - name = 'Smooth Mesh Scrolling', - desc = 'A smoother way to scroll. Applies to all types of mouse/keyboard scrolling.', - type = 'bool', - value = true, - }, - - targetmouse = { - name = 'Rotate world origin at cursor', - desc = 'Rotate world using origin at the cursor rather than the center of screen.', - type = 'bool', - value = false, - }, - edgemove = { - name = 'Scroll camera at edge', - desc = 'Scroll camera when the cursor is at the edge of the screen.', - springsetting = 'WindowedEdgeMove', - type = 'bool', - value = true, - - }, - speedFactor = { - name = 'Mouse scroll speed', - desc = 'This speed applies to scrolling with the middle button.', - type = 'number', - min = 10, max = 40, - value = 25, - }, - speedFactor_k = { - name = 'Keyboard/edge scroll speed', - desc = 'This speed applies to edge scrolling and keyboard keys.', - type = 'number', - min = 1, max = 50, - value = 20, - }, - zoominfactor = { - name = 'Zoom-in speed', - type = 'number', - min = 0.1, max = 0.5, step = 0.05, - value = 0.2, - }, - zoomoutfactor = { - name = 'Zoom-out speed', - type = 'number', - min = 0.1, max = 0.5, step = 0.05, - value = 0.2, - }, - invertzoom = { - name = 'Invert zoom', - desc = 'Invert the scroll wheel direction for zooming.', - type = 'bool', - value = true, - }, - invertalt = { - name = 'Invert altitude', - desc = 'Invert the scroll wheel direction for altitude.', - type = 'bool', - value = false, - }, - inverttilt = { - name = 'Invert tilt', - desc = 'Invert the tilt direction when using ctrl+mousewheel.', - type = 'bool', - value = false, - }, - - zoomoutfromcursor = { - name = 'Zoom out from cursor', - desc = 'Zoom out from the cursor rather than center of the screen.', - type = 'bool', - value = false, - }, - zoomintocursor = { - name = 'Zoom in to cursor', - desc = 'Zoom in to the cursor rather than the center of the screen.', - type = 'bool', - value = true, - }, - follow = { - name = "Follow player's cursor", - desc = "Follow the cursor of the player you're spectating (needs Ally Cursor widget to be on).", - type = 'bool', - value = false, - path = 'Settings/Camera', - }, - rotfactor = { - name = 'Rotation speed', - type = 'number', - min = 0.001, max = 0.020, step = 0.001, - value = 0.005, - }, - rotateonedge = { - name = "Rotate camera at edge", - desc = "Rotate camera when the cursor is at the edge of the screen (edge scroll must be off).", - type = 'bool', - value = false, - }, - - smoothness = { - name = 'Smoothness', - desc = "Controls how smooth the camera moves.", - type = 'number', - min = 0.0, max = 0.8, step = 0.1, - value = 0.4, - }, - fov = { - name = 'Field of View (Degrees)', - --desc = "FOV (25 deg - 100 deg).", - type = 'number', - min = 10, max = 100, step = 5, - value = Spring.GetCameraFOV(), - OnChange = function(self) SetFOV(self.value) end - }, - invertscroll = { - name = "Invert scrolling direction", - desc = "Invert scrolling direction (doesn't apply to smoothscroll).", - type = 'bool', - value = false, - }, - restrictangle = { - name = "Restrict Camera Angle", - desc = "If disabled you can point the camera upward, but end up with strange camera positioning.", - type = 'bool', - advanced = true, - value = true, - OnChange = function(self) init = true; end - }, - freemode = { - name = "FreeMode (risky)", - desc = "Be free. Camera movement not bound to map edge. USE AT YOUR OWN RISK!", - type = 'bool', - advanced = true, - value = false, - OnChange = function(self) init = true; end, - }, - mingrounddist = { - name = 'Minimum Ground Distance', - desc = 'Getting too close to the ground allows strange camera positioning.', - type = 'number', - advanced = true, - min = 0, max = 100, step = 1, - value = 1, - OnChange = function(self) init = true; end, - }, - - overviewmode = { - name = "Overview", - desc = "Go to overview mode, then restore view to cursor position.", - type = 'button', - hotkey = {key='tab', mod=''}, - OnChange = function(self) OverviewAction() end, - }, - - trackmode = { - name = "Enter Trackmode", - desc = "Track the selected unit (midclick to cancel)", - type = 'button', - hotkey = {key='t', mod='alt+'}, - OnChange = function(self) trackmode = true; end, - }, - - persistenttrackmode = { - name = "Persistent trackmode state", - desc = "Trackmode will not cancel unless user press midclick", - type = 'bool', - value = false, - }, - - thirdpersontrack = { - name = "Enter 3rd Person Trackmode", - desc = "Track the selected unit (midclick to cancel)", - type = 'button', - hotkey = {key='k', mod='alt+'}, - OnChange = function(self) - local selUnits = Spring.GetSelectedUnits() - if selUnits and selUnits[1] and thirdperson_trackunit ~= selUnits[1] then --check if 3rd Person into same unit or if there's any unit at all - Spring.SendCommands('viewfps') - Spring.SendCommands('track') - thirdperson_trackunit = selUnits[1] - local cs = Spring.GetCameraState() - cs.px,cs.py,cs.pz =Spring.GetUnitPosition(selUnits[1]) --place FPS camera on the ground (prevent out of LOD case) - cs.py = cs.py + 25 - Spring.SetCameraState(cs,0) - else - Spring.SendCommands('trackoff') - Spring.SendCommands('viewfree') - thirdperson_trackunit = false - end - end, - }, - - thirdpersonedgescroll = { - name = "3rd Person Trackmode Retarget", - desc = "When in 3rd Person Trackmode, use the arrow keys to follow a nearby unit.", - type = 'bool', - value = true, - }, - resetcam = { - name = "Reset Camera", - desc = "Reset the camera position and orientation. Map a hotkey or use + + + ", - type = 'button', - -- OnChange defined later - }, - - groundrot = { - name = "Rotate When Camera Hits Ground", - desc = "If world-rotation motion causes the camera to hit the ground, camera-rotation motion takes over. Doesn't apply in Free Mode.", - type = 'bool', - value = false, - }, - - enableCycleView = { - name = "Group recall cycle within group", - type = 'bool', - value = false, - path='Settings/Camera', - desc = "Cycle camera focus among group units when same number is pressed more than once. Note: This option will automatically enable \'Receive Indicator\' widget (for its cluster detection feature).", - OnChange = function(self) - if self.value==true then - Spring.SendCommands("luaui enablewidget Receive Units Indicator") - end - end, - }, - -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local GL_LINES = GL.LINES -local GL_GREATER = GL.GREATER -local GL_POINTS = GL.POINTS - -local glBeginEnd = gl.BeginEnd -local glColor = gl.Color -local glLineWidth = gl.LineWidth -local glVertex = gl.Vertex -local glAlphaTest = gl.AlphaTest -local glPointSize = gl.PointSize -local glTexture = gl.Texture -local glTexRect = gl.TexRect - -local red = { 1, 0, 0 } -local green = { 0, 1, 0 } -local black = { 0, 0, 0 } -local white = { 1, 1, 1 } - - -local spGetCameraState = Spring.GetCameraState -local spGetCameraVectors = Spring.GetCameraVectors -local spGetGroundHeight = Spring.GetGroundHeight -local spGetSmoothMeshHeight = Spring.GetSmoothMeshHeight -local spGetModKeyState = Spring.GetModKeyState -local spGetMouseState = Spring.GetMouseState -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetUnitPosition = Spring.GetUnitPosition -local spIsAboveMiniMap = Spring.IsAboveMiniMap -local spSendCommands = Spring.SendCommands -local spSetCameraState = Spring.SetCameraState -local spSetMouseCursor = Spring.SetMouseCursor -local spTraceScreenRay = Spring.TraceScreenRay -local spWarpMouse = Spring.WarpMouse -local spGetCameraDirection = Spring.GetCameraDirection -local spSetCameraTarget = Spring.SetCameraTarget -local spGetTimer = Spring.GetTimer -local spDiffTimers = Spring.DiffTimers - -local abs = math.abs -local min = math.min -local max = math.max -local sqrt = math.sqrt -local sin = math.sin -local cos = math.cos - -local echo = Spring.Echo - -local helpText = {} --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local ls_x, ls_y, ls_z --lockspot position -local ls_dist, ls_have, ls_onmap --lockspot flag -local tilting -local overview_mode, last_rx, last_ls_dist --overview_mode's variable - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local vsx, vsy = widgetHandler:GetViewSizes() -local cx,cy = vsx * 0.5,vsy * 0.5 -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY - cx = vsx * 0.5 - cy = vsy * 0.5 -end - -local PI = 3.1415 ---local TWOPI = PI*2 -local HALFPI = PI/2 ---local HALFPIPLUS = HALFPI+0.01 -local HALFPIMINUS = HALFPI-0.01 - - -local fpsmode = false -local mx, my = 0,0 -local msx, msy = 0,0 -local smoothscroll = false -local springscroll = false -local lockspringscroll = false -local rotate, movekey -local move, rot = {}, {} -local key_code = { - left = 276, - right = 275, - up = 273, - down = 274, - pageup = 280, - pagedown = 281, -} -local keys = { - [276] = 'left', - [275] = 'right', - [273] = 'up', - [274] = 'down', -} -local icon_size = 20 -local cycle = 1 -local camcycle = 1 -local trackcycle = 1 -local hideCursor = false - - -local mwidth, mheight = Game.mapSizeX, Game.mapSizeZ -local averageEdgeHeight = (spGetGroundHeight(mwidth/2,0) + spGetGroundHeight(0,mheight/2) + spGetGroundHeight(mwidth/2,mheight) +spGetGroundHeight(mwidth,mheight/2))/4 -local mcx, mcz = mwidth / 2, mheight / 2 -local mcy = spGetGroundHeight(mcx, mcz) -local maxDistY = max(mheight, mwidth) * 1 --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local rotate_transit --switch for smoothing "rotate at mouse position instead of screen center" -local last_move = spGetTimer() --switch for reset lockspot for edgescroll -local thirdPerson_transit = spGetTimer() --switch for smoothing "3rd person trackmode edge screen scroll" --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function GetDist(x1,y1,z1, x2,y2,z2) - local d1 = x2-x1 - local d2 = y2-y1 - local d3 = z2-z1 - - return sqrt(d1*d1 + d2*d2 + d3*d3) -end - -local function explode(div,str) - if (div=='') then return false end - local pos,arr = 0,{} - -- for each divider found - for st,sp in function() return string.find(str,div,pos,true) end do - table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider - pos = sp + 1 -- Jump past current divider - end - table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider - return arr -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---[[ --NOTE: is not yet used for the moment -local function MoveRotatedCam(cs, mxm, mym) - if not cs.dy then - return cs - end - - -- forward, up, right, top, bottom, left, right - local camVecs = spGetCameraVectors() - local cf = camVecs.forward - local len = sqrt((cf[1] * cf[1]) + (cf[3] * cf[3])) - local dfx = cf[1] / len - local dfz = cf[3] / len - local cr = camVecs.right - local len = sqrt((cr[1] * cr[1]) + (cr[3] * cr[3])) - local drx = cr[1] / len - local drz = cr[3] / len - - local vecDist = (- cs.py) / cs.dy - - local ddx = (mxm * drx) + (mym * dfx) - local ddz = (mxm * drz) + (mym * dfz) - - local gx1, gz1 = cs.px + vecDist*cs.dx, cs.pz + vecDist*cs.dz --note me: what does cs.dx mean? - local gx2, gz2 = cs.px + vecDist*cs.dx + ddx, cs.pz + vecDist*cs.dz + ddz - - local extra = 500 - - if gx2 > mwidth + extra then - ddx = mwidth + extra - gx1 - elseif gx2 < 0 - extra then - ddx = -gx1 - extra - end - - if gz2 > mheight + extra then - ddz = mheight - gz1 + extra - elseif gz2 < 0 - extra then - ddz = -gz1 - extra - end - - cs.px = cs.px + ddx - cs.pz = cs.pz + ddz - return cs -end ---]] - ---Note: If the x,y is not pointing at an onmap point, this function traces a virtual ray to an --- offmap position using the camera direction and disregards the x,y parameters. -local function VirtTraceRay(x,y, cs) - local _, gpos = spTraceScreenRay(x, y, true) - - - if gpos then - local gx, gy, gz = gpos[1], gpos[2], gpos[3] - - --gy = spGetSmoothMeshHeight (gx,gz) - - if gx < 0 or gx > mwidth or gz < 0 or gz > mheight then --out of map - return false, gx, gy, gz - else - return true, gx, gy, gz - end - end - - if not cs or not cs.dy or cs.dy == 0 then - return false, false - end - --[[ - local vecDist = (- cs.py) / cs.dy - local gx, gy, gz = cs.px + vecDist*cs.dx, cs.py + vecDist*cs.dy, cs.pz + vecDist*cs.dz --note me: what does cs.dx mean? - --]] - ---===Convert camera angle into estimated ground position (by Msafwan)=== - local camTilt = math.min(1.5550425, PI/2 + cs.rx) - local xzDist = math.tan(camTilt)*(cs.py-averageEdgeHeight) --the ground distance (at xz-plane) between FreeStyle camera and the target. - local xDist = sin(cs.ry)*xzDist ----break down "xzDist" into x and z component. - local zDist = cos(cs.ry)*xzDist - gx, gy, gz = cs.px+xDist,averageEdgeHeight,cs.pz+zDist --estimated ground position infront of camera (if outside map) - ---=== - - --gy = spGetSmoothMeshHeight (gx,gz) - return false, gx, gy, gz -end - -local function SetLockSpot2(cs, x, y) --set an anchor on the ground for camera rotation - if ls_have then --if lockspot is locked - return - end - - local x, y = x, y - if not x then - x, y = cx, cy --center of screen - end - - --local gpos - --_, gpos = spTraceScreenRay(x, y, true) - local onmap, gx,gy,gz = VirtTraceRay(x, y, cs) --convert screen coordinate to ground coordinate - - if gx then - ls_x,ls_y,ls_z = gx,gy,gz - local px,py,pz = cs.px,cs.py,cs.pz - local dx,dy,dz = ls_x-px, ls_y-py, ls_z-pz - ls_onmap = onmap - ls_dist = sqrt(dx*dx + dy*dy + dz*dz) --distance to ground coordinate - ls_have = true - end -end - - -local function UpdateCam(cs) - local cs = cs - if not (cs.rx and cs.ry and ls_dist) then - --return cs - return false - end - - local alt = sin(cs.rx) * ls_dist - local opp = cos(cs.rx) * ls_dist --OR same as: sqrt(ls_dist * ls_dist - alt * alt) - cs.px = ls_x - sin(cs.ry) * opp - cs.py = ls_y - alt - cs.pz = ls_z - cos(cs.ry) * opp - - if not options.freemode.value then - local gndheight = spGetGroundHeight(cs.px, cs.pz)+5 - --gndheight = spGetSmoothMeshHeight(cs.px, cs.pz)+5 - if cs.py < gndheight then - if options.groundrot.value then - cs.py = gndheight - else - return false - end - end - end - - return cs -end - -local function Zoom(zoomin, shift, forceCenter) - local zoomin = zoomin - if options.invertzoom.value then - zoomin = not zoomin - end - - local cs = spGetCameraState() - -- [[ - if - (not forceCenter) and - ( - (zoomin and options.zoomintocursor.value) - or ((not zoomin) and options.zoomoutfromcursor.value) - ) - then - - local onmap, gx,gy,gz = VirtTraceRay(mx, my, cs) - - if onmap then - if gx then - dx = gx - cs.px - dy = gy - cs.py - dz = gz - cs.pz - else - return false - end - - local sp = (zoomin and options.zoominfactor.value or -options.zoomoutfactor.value) * (shift and 3 or 1) - - local new_px = cs.px + dx * sp --a zooming that get slower the closer you are to the target. - local new_py = cs.py + dy * sp - local new_pz = cs.pz + dz * sp - - if not options.freemode.value then - if new_py < spGetGroundHeight(cs.px, cs.pz)+5 then --zooming underground? - sp = (spGetGroundHeight(cs.px, cs.pz)+5 - cs.py) / dy - new_px = cs.px + dx * sp --a zooming that get slower the closer you are to the ground. - new_py = cs.py + dy * sp - new_pz = cs.pz + dz * sp - elseif (not zoomin) and new_py > maxDistY then --zoom out to space? - sp = (maxDistY - cs.py) / dy - new_px = cs.px + dx * sp --a zoom-out that get slower the closer you are to the ceiling? - new_py = cs.py + dy * sp - new_pz = cs.pz + dz * sp - end - - end - - cs.px = new_px - cs.py = new_py - cs.pz = new_pz - - spSetCameraState(cs, options.smoothness.value) - ls_have = false - return - end - - end - --]] - ls_have = false --unlock lockspot - SetLockSpot2(cs) --set lockspot - if not ls_have then - return - end - - -- if zoomin and not ls_onmap then --prevent zooming into null area (outside map) - -- return - -- end - - local sp = (zoomin and -options.zoominfactor.value or options.zoomoutfactor.value) * (shift and 3 or 1) - - local ls_dist_new = ls_dist + ls_dist*sp -- a zoom in that get faster the further away from target - ls_dist_new = math.max(ls_dist_new, 20) - ls_dist_new = math.min(ls_dist_new, maxDistY) - - ls_dist = ls_dist_new - - local cstemp = UpdateCam(cs) - if cstemp then cs = cstemp; end - if zoomin or ls_dist < maxDistY then - spSetCameraState(cs, options.smoothness.value) - end - - return true -end - - -local function Altitude(up, s) - ls_have = false - - local up = up - if options.invertalt.value then - up = not up - end - - local cs = spGetCameraState() - local py = max(1, abs(cs.py) ) - local dy = py * (up and 1 or -1) * (s and 0.3 or 0.1) - local new_py = py + dy - if not options.freemode.value then - if new_py < spGetGroundHeight(cs.px, cs.pz)+5 then - new_py = spGetGroundHeight(cs.px, cs.pz)+5 - elseif new_py > maxDistY then - new_py = maxDistY - end - end - cs.py = new_py - spSetCameraState(cs, options.smoothness.value) - return true -end - -SetFOV = function(fov) - local cs = spGetCameraState() - cs.fov = fov - spSetCameraState(cs,0) -end - -local function ResetCam() - local cs = spGetCameraState() - cs.px = Game.mapSizeX/2 - cs.py = maxDistY - cs.pz = Game.mapSizeZ/2 - cs.rx = -HALFPI - cs.ry = PI - spSetCameraState(cs, 1) -end -options.resetcam.OnChange = ResetCam - -OverviewAction = function() - if not overview_mode then - if thirdperson_trackunit then --exit 3rd person to show map overview - spSendCommands('trackoff') - spSendCommands('viewfree') - end - - local cs = spGetCameraState() - SetLockSpot2(cs) - last_ls_dist = ls_dist - last_rx = cs.rx - - cs.px = Game.mapSizeX/2 - cs.py = maxDistY - cs.pz = Game.mapSizeZ/2 - cs.rx = -HALFPI - spSetCameraState(cs, 1) - else --if in overview mode - local cs = spGetCameraState() - mx, my = spGetMouseState() - local onmap, gx, gy, gz = VirtTraceRay(mx,my,cs) --create a lockstop point. - if gx then --Note: Now VirtTraceRay can extrapolate coordinate in null space (no need to check for onmap) - local cs = spGetCameraState() - cs.rx = last_rx - ls_dist = last_ls_dist - ls_x = gx - ls_z = gz - ls_y = gy - ls_have = true - local cstemp = UpdateCam(cs) --set camera position & orientation based on lockstop point - if cstemp then cs = cstemp; end - spSetCameraState(cs, 1) - end - - if thirdperson_trackunit then - local selUnits = spGetSelectedUnits() --player's new unit to track - if not (selUnits and selUnits[1]) then --if player has no new unit to track - Spring.SelectUnitArray({thirdperson_trackunit}) --select the original unit - selUnits = spGetSelectedUnits() - end - thirdperson_trackunit = false - if selUnits and selUnits[1] then - spSendCommands('viewfps') - spSendCommands('track') -- re-issue 3rd person for selected unit - thirdperson_trackunit = selUnits[1] - local cs = spGetCameraState() - cs.px,cs.py,cs.pz=spGetUnitPosition(selUnits[1]) --move camera to unit position so no "out of LOD" case - cs.py= cs.py+25 --move up 25-elmo incase FPS camera stuck to unit's feet instead of tracking it (aesthetic) - spSetCameraState(cs,0) - end - end - end - - overview_mode = not overview_mode -end - - - - -local function RotateCamera(x, y, dx, dy, smooth, lock) - local cs = spGetCameraState() - local cs1 = cs - if cs.rx then - - cs.rx = cs.rx + dy * options.rotfactor.value - cs.ry = cs.ry - dx * options.rotfactor.value - - --local max_rx = options.restrictangle.value and -0.1 or HALFPIMINUS - local max_rx = HALFPIMINUS - - if cs.rx < -HALFPIMINUS then - cs.rx = -HALFPIMINUS - elseif cs.rx > max_rx then - cs.rx = max_rx - end - - -- [[ - if trackmode then --always rotate world instead of camera in trackmode - lock = true - ls_have = false - SetLockSpot2(cs) - end - --]] - if lock and ls_onmap then - local cstemp = UpdateCam(cs) - if cstemp then - cs = cstemp; - else - return - end - else - ls_have = false - end - spSetCameraState(cs, smooth and options.smoothness.value or 0) - end -end - -local function ThirdPersonScrollCam(cs) --3rd person mode that allow you to jump between unit by edge scrolling (by msafwan) - local initRadius = 50 - --local camVecs = spGetCameraVectors() - local isSpec = Spring.GetSpectatingState() - local teamID = (not isSpec and Spring.GetMyTeamID()) --get teamID if not spec - local foundUnit - local forwardOffset,backwardOffset,leftOffset,rightOffset - if move.right or rot.right then --content of move & rot table is set in Update() and in KeyPress(). Is global. Is used to start scrolling & rotation (initiated in Update()) - rightOffset =initRadius - elseif move.up or rot.up then - forwardOffset = initRadius - elseif move.left or rot.left then - leftOffset =initRadius - elseif move.down or rot.down then - backwardOffset = initRadius - end - for i=1, 5 do --create a (detection) sphere of increasing size (x5) in scroll direction - local front, top, right = Spring.GetUnitVectors(thirdperson_trackunit) --get vector of current tracked unit - local x,y,z = spGetUnitPosition(thirdperson_trackunit) - y = y+25 - local offX_temp = (forwardOffset and forwardOffset+25) or (backwardOffset and -backwardOffset-25) or 0 --set direction where sphere must grow in x,y,z (global) direction. - local offY_temp = 0 - local offZ_temp = (rightOffset and rightOffset+25) or (leftOffset and -leftOffset-25) or 0 - local offX = front[1]*offX_temp + top[1]*offY_temp + right[1]*offZ_temp --rotate (translate) the global right/left/forward/backward into a direction relative to current unit - local offY = front[2]*offX_temp + top[2]*offY_temp + right[2]*offZ_temp - local offZ = front[3]*offX_temp + top[3]*offY_temp + right[3]*offZ_temp - local selUnits = Spring.GetUnitsInSphere(x+offX,y+offY,z+offZ, initRadius,teamID) --create sphere that detect unit in area of this direction - Spring.SelectUnitArray({selUnits[1]}) --test select unit (in case its not selectable) - selUnits = spGetSelectedUnits() - if selUnits and selUnits[1] then --find unit in that area - foundUnit = selUnits[1] - break - end - if forwardOffset then --increase distance of detection sphere away into selected direction - forwardOffset =forwardOffset*2 - elseif backwardOffset then - backwardOffset =backwardOffset*2 - elseif leftOffset then - leftOffset =leftOffset*2 - elseif rightOffset then - rightOffset =rightOffset*2 - end - initRadius =initRadius*2 --increase size of detection sphere - end - if not foundUnit then --if no unit in the area: use current unit (as target) - foundUnit = thirdperson_trackunit - Spring.Echo("COFC: no unit in that direction to jump to!") - end - Spring.SelectUnitArray({foundUnit}) --give selection order to player - spSendCommands('viewfps') - spSendCommands('track') - thirdperson_trackunit = foundUnit --remember current unitID - cs.px,cs.py,cs.pz=spGetUnitPosition(foundUnit) --move FPS camera to ground level (prevent out of LOD problem where unit turn into icons) - cs.py = cs.py+25 - spSetCameraState(cs,0) - thirdPerson_transit = spGetTimer() --block access to edge scroll until camera focus on unit -end - -local function Tilt(s, dir) - if not tilting then - ls_have = false - end - tilting = true - local cs = spGetCameraState() - SetLockSpot2(cs) - if not ls_have then - return - end - local dir = dir * (options.inverttilt.value and -1 or 1) - - - local speed = dir * (s and 30 or 10) - RotateCamera(vsx * 0.5, vsy * 0.5, 0, speed, true, true) --smooth, lock - - return true -end - -local function ScrollCam(cs, mxm, mym, smoothlevel) - SetLockSpot2(cs) - if not cs.dy or not ls_have then - --echo " scrollcam fcn fail" - return - end - if not ls_onmap then - smoothlevel = 0.5 - end - - -- forward, up, right, top, bottom, left, right - local camVecs = spGetCameraVectors() - local cf = camVecs.forward - local len = sqrt((cf[1] * cf[1]) + (cf[3] * cf[3])) --get hypotenus of x & z vector only - local dfx = cf[1] / len - local dfz = cf[3] / len - local cr = camVecs.right - local len = sqrt((cr[1] * cr[1]) + (cr[3] * cr[3])) - local drx = cr[1] / len - local drz = cr[3] / len - - local vecDist = (- cs.py) / cs.dy - - local ddx = (mxm * drx) + (mym * dfx) - local ddz = (mxm * drz) + (mym * dfz) - - ls_x = ls_x + ddx - ls_z = ls_z + ddz - - if not options.freemode.value then - ls_x = math.min(ls_x, mwidth-3) --limit camera movement to map area - ls_x = math.max(ls_x, 3) - - ls_z = math.min(ls_z, mheight-3) - ls_z = math.max(ls_z, 3) - end - - if options.smoothmeshscroll.value then - ls_y = spGetSmoothMeshHeight(ls_x, ls_z) or 0 - else - ls_y = spGetGroundHeight(ls_x, ls_z) or 0 - end - - - local csnew = UpdateCam(cs) - if csnew then - spSetCameraState(csnew, smoothlevel) - end - -end - -local function PeriodicWarning() - local c_widgets, c_widgets_list = '', {} - for name,data in pairs(widgetHandler.knownWidgets) do - if data.active and - ( - name:find('SmoothScroll') - or name:find('Hybrid Overhead') - or name:find('Complete Control Camera') - ) - then - c_widgets_list[#c_widgets_list+1] = name - end - end - for i=1, #c_widgets_list do - c_widgets = c_widgets .. c_widgets_list[i] .. ', ' - end - if c_widgets ~= '' then - echo(' *Periodic warning* Please disable other camera widgets: ' .. c_widgets) - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Update(dt) - - if hideCursor then - spSetMouseCursor('%none%') - end - - if options.follow.value then - camcycle = camcycle %(32*6) + 1 - if camcycle == 1 then - if WG.alliedCursorsPos then - local teamID = Spring.GetLocalTeamID() - local _, playerID = Spring.GetTeamInfo(teamID) - local pp = WG.alliedCursorsPos[ playerID ] - if pp then - spSetCameraTarget(pp[1], 0, pp[2], 5) - end - end - end - end - cycle = cycle %(32*15) + 1 - -- Periodic warning - if cycle == 1 then - PeriodicWarning() - end - - trackcycle = trackcycle %(4) + 1 - if trackcycle == 1 and trackmode and (not rotate) then --update trackmode during normal/non-rotating state (doing both will cause a zoomed-out bug) - local selUnits = spGetSelectedUnits() - if selUnits and selUnits[1] then - local x,y,z = spGetUnitPosition( selUnits[1] ) - spSetCameraTarget(x,y,z, 0.2) - elseif (not options.persistenttrackmode.value) then --cancel trackmode when no more units is present in non-persistent trackmode. - trackmode=false --exit trackmode - end - end - - - local cs = spGetCameraState() - - local use_lockspringscroll = lockspringscroll and not springscroll - - local a,c,m,s = spGetModKeyState() - - if (not thirdperson_trackunit and --block 3rd Person - (rot.right or rot.left or rot.up or rot.down)) - then - - local speed = options.rotfactor.value * (s and 400 or 150) - if rot.right then - RotateCamera(vsx * 0.5, vsy * 0.5, speed, 0, true) - elseif rot.left then - RotateCamera(vsx * 0.5, vsy * 0.5, -speed, 0, true) - end - - if rot.up then - RotateCamera(vsx * 0.5, vsy * 0.5, 0, speed, true) - elseif rot.down then - RotateCamera(vsx * 0.5, vsy * 0.5, 0, -speed, true) - end - - end - - if (not thirdperson_trackunit and --block 3rd Person - (smoothscroll or - move.right or move.left or move.up or move.down or - use_lockspringscroll)) - then - - local x, y, lmb, mmb, rmb = spGetMouseState() - - if (c) then - return - end - - local smoothlevel = 0 - - -- clear the velocities - cs.vx = 0; cs.vy = 0; cs.vz = 0 - cs.avx = 0; cs.avy = 0; cs.avz = 0 - - local mxm, mym = 0,0 - - local heightFactor = (cs.py/1000) - if smoothscroll then - --local speed = dt * options.speedFactor.value * heightFactor - local speed = math.max( dt * options.speedFactor.value * heightFactor, 0.005 ) - mxm = speed * (x - cx) - mym = speed * (y - cy) - elseif use_lockspringscroll then - --local speed = options.speedFactor.value * heightFactor / 10 - local speed = math.max( options.speedFactor.value * heightFactor / 10, 0.05 ) - local dir = options.invertscroll.value and -1 or 1 - mxm = speed * (x - mx) * dir - mym = speed * (y - my) * dir - - spWarpMouse(cx, cy) - else --edge screen scroll - --local speed = options.speedFactor_k.value * (s and 3 or 1) * heightFactor - local speed = math.max( options.speedFactor_k.value * (s and 3 or 1) * heightFactor, 1 ) - - if move.right then - mxm = speed - elseif move.left then - mxm = -speed - end - - if move.up then - mym = speed - elseif move.down then - mym = -speed - end - smoothlevel = options.smoothness.value - - if spDiffTimers(spGetTimer(),last_move)>1 then --if edge scroll is 'first time': unlock lockspot once - ls_have = false - end - last_move = spGetTimer() - end - - ScrollCam(cs, mxm, mym, smoothlevel) - - end - - mx, my = spGetMouseState() - - if options.edgemove.value then - if not movekey then --if not doing arrow key on keyboard: reset - move = {} - end - - if mx > vsx-2 then - move.right = true - elseif mx < 2 then - move.left = true - end - if my > vsy-2 then - move.up = true - elseif my < 2 then - move.down = true - end - - elseif options.rotateonedge.value then - rot = {} - if mx > vsx-2 then - rot.right = true - elseif mx < 2 then - rot.left = true - end - if my > vsy-2 then - rot.up = true - elseif my < 2 then - rot.down = true - end - end - - if (thirdperson_trackunit and - not overview_mode and --block 3rd person scroll when in overview mode - (move.right or move.left or move.up or move.down or - rot.right or rot.left or rot.up or rot.down)) --NOTE: engine exit 3rd-person trackmode if it detect edge-screen scroll, so we handle 3rd person trackmode scrolling here. - then - - if options.thirdpersonedgescroll.value and spDiffTimers(spGetTimer(),thirdPerson_transit)>=1 then --edge scroll will 3rd Person nearby unit - ThirdPersonScrollCam(cs) --edge scroll to nearby unit - else --not 3rdPerson-edge-Scroll: edge scroll won't effect tracking - local selUnits = spGetSelectedUnits() - if selUnits and selUnits[1] then -- re-issue 3rd person for selected unit - spSendCommands('viewfps') - spSendCommands('track') - thirdperson_trackunit = selUnits[1] - cs.px,cs.py,cs.pz=spGetUnitPosition(selUnits[1]) - cs.py= cs.py+25 --move up 25-elmo incase FPS camera stuck to unit's feet instead of tracking it (aesthetic) - spSetCameraState(cs,0) - else --no unit selected: return to freeStyle camera - spSendCommands('trackoff') - spSendCommands('viewfree') - thirdperson_trackunit = false - end - end - end - - fpsmode = cs.name == "fps" - if init or ((cs.name ~= "free") and (cs.name ~= "ov") and not fpsmode) then - init = false - spSendCommands("viewfree") - local cs = spGetCameraState() - cs.tiltSpeed = 0 - cs.scrollSpeed = 0 - --cs.gndOffset = options.mingrounddist.value - cs.gndOffset = options.freemode.value and 0 or 1 - spSetCameraState(cs,0) - end - -end - -function widget:MouseMove(x, y, dx, dy, button) - if rotate then - local smoothed - if rotate_transit then --if "rotateAtCursor" flag is True, then this will run 'once' to smoothen camera motion - if spDiffTimers(spGetTimer(),rotate_transit)<1 then --smooth camera for in-transit effect - smoothed = true - end - end - if abs(dx) > 0 or abs(dy) > 0 then - RotateCamera(x, y, dx, dy, smoothed, ls_have) - end - - spWarpMouse(msx, msy) - - elseif springscroll then - - if abs(dx) > 0 or abs(dy) > 0 then - lockspringscroll = false - end - local dir = options.invertscroll.value and -1 or 1 - - local cs = spGetCameraState() - - local speed = options.speedFactor.value * cs.py/1000 / 10 - local mxm = speed * dx * dir - local mym = speed * dy * dir - ScrollCam(cs, mxm, mym, 0) - end -end - - -function widget:MousePress(x, y, button) --called once when pressed, not repeated - ls_have = false - --overview_mode = false - --if fpsmode then return end - if lockspringscroll then - lockspringscroll = false - return true - end - - -- Not Middle Click -- - if (button ~= 2) then - return false - end - - local a,c,m,s = spGetModKeyState() - - spSendCommands('trackoff') - spSendCommands('viewfree') - if not (options.persistenttrackmode.value and (c or a)) then --Note: wont escape trackmode if pressing Ctrl or Alt in persistent trackmode, else: always escape. - trackmode = false - end - thirdperson_trackunit = false - - - -- Reset -- - if a and c and s then - ResetCam() - return true - end - - -- Above Minimap -- - if (spIsAboveMiniMap(x, y)) then - return false - end - - local cs = spGetCameraState() - - msx = x - msy = y - - spSendCommands({'trackoff'}) - - rotate = false - -- Rotate -- - if a then - spWarpMouse(cx, cy) - ls_have = false - rotate = true - return true - end - -- Rotate World -- - if c then - rotate_transit = nil - if options.targetmouse.value then --if "rotateAtCursor": trigger smoot in-transit effect - - local onmap, gx, gy, gz = VirtTraceRay(x,y, cs) - if gx and onmap then - SetLockSpot2(cs,x,y) - - spSetCameraTarget(gx,gy,gz, 1) - rotate_transit = spGetTimer() - end - end - spWarpMouse(cx, cy) - SetLockSpot2(cs) - rotate = true - msx = cx - msy = cy - return true - end - - -- Scrolling -- - if options.smoothscroll.value then - spWarpMouse(cx, cy) - smoothscroll = true - else - springscroll = true - lockspringscroll = not lockspringscroll - end - - return true - -end - -function widget:MouseRelease(x, y, button) - if (button == 2) then - rotate = nil - smoothscroll = false - springscroll = false - return -1 - end -end - -function widget:MouseWheel(wheelUp, value) - if fpsmode then return end - local alt,ctrl,m,shift = spGetModKeyState() - - if ctrl then - return Tilt(shift, wheelUp and 1 or -1) - elseif alt then - if overview_mode then --cancel overview_mode if Overview_mode + descending - local zoomin = not wheelUp - if options.invertalt.value then - zoomin = not zoomin - end - if zoomin then - overview_mode = false - else return; end-- skip wheel if Overview_mode + ascending - end - return Altitude(wheelUp, shift) - end - - if overview_mode then --cancel overview_mode if Overview_mode + ZOOM-in - local zoomin = not wheelUp - if options.invertzoom.value then - zoomin = not zoomin - end - if zoomin then - overview_mode = false - else return; end --skip wheel if Overview_mode + ZOOM-out - end - return Zoom(not wheelUp, shift) -end - -function widget:KeyPress(key, modifier, isRepeat) - local intercept = GroupRecallFix(key, modifier, isRepeat) - if intercept then - return true - end - - --ls_have = false - tilting = false - - if thirdperson_trackunit then --move key for edge Scroll in 3rd person trackmode - if keys[key] and not (modifier.ctrl or modifier.alt) then - movekey = true - move[keys[key]] = true - end - end - if fpsmode then return end - if keys[key] then - if modifier.ctrl or modifier.alt then - - local cs = spGetCameraState() - SetLockSpot2(cs) - if not ls_have then - return - end - - - local speed = modifier.shift and 30 or 10 - - if key == key_code.right then RotateCamera(vsx * 0.5, vsy * 0.5, speed, 0, true, not modifier.alt) - elseif key == key_code.left then RotateCamera(vsx * 0.5, vsy * 0.5, -speed, 0, true, not modifier.alt) - elseif key == key_code.down then RotateCamera(vsx * 0.5, vsy * 0.5, 0, -speed, true, not modifier.alt) - elseif key == key_code.up then RotateCamera(vsx * 0.5, vsy * 0.5, 0, speed, true, not modifier.alt) - end - return - else - movekey = true - move[keys[key]] = true - end - elseif key == key_code.pageup then - if modifier.ctrl then - Tilt(modifier.shift, 1) - return - elseif modifier.alt then - Altitude(true, modifier.shift) - return - else - Zoom(true, modifier.shift, true) - return - end - elseif key == key_code.pagedown then - if modifier.ctrl then - Tilt(modifier.shift, -1) - return - elseif modifier.alt then - Altitude(false, modifier.shift) - return - else - Zoom(false, modifier.shift, true) - return - end - end - tilting = false -end -function widget:KeyRelease(key) - if keys[key] then - move[keys[key]] = nil - end - if not (move.up or move.down or move.left or move.right) then - movekey = nil - end -end - -local function DrawLine(x0, y0, c0, x1, y1, c1) - glColor(c0); glVertex(x0, y0) - glColor(c1); glVertex(x1, y1) -end - -local function DrawPoint(x, y, c, s) - --FIXME reenable later - ATIBUG glPointSize(s) - glColor(c) - glBeginEnd(GL_POINTS, glVertex, x, y) -end - -function widget:DrawScreen() - hideCursor = false - if not cx then return end - - local x, y - if smoothscroll then - x, y = spGetMouseState() - glLineWidth(2) - glBeginEnd(GL_LINES, DrawLine, x, y, green, cx, cy, red) - glLineWidth(1) - - DrawPoint(cx, cy, black, 14) - DrawPoint(cx, cy, white, 11) - DrawPoint(cx, cy, black, 8) - DrawPoint(cx, cy, red, 5) - - DrawPoint(x, y, { 0, 1, 0 }, 5) - end - - local filefound - if smoothscroll or (rotate and ls_have) then - filefound = glTexture(LUAUI_DIRNAME .. 'Images/ccc/arrows-dot.png') - elseif rotate or lockspringscroll or springscroll then - filefound = glTexture(LUAUI_DIRNAME .. 'Images/ccc/arrows.png') - end - - if filefound then - - if smoothscroll then - glColor(0,1,0,1) - elseif (rotate and ls_have) then - glColor(1,0.6,0,1) - elseif rotate then - glColor(1,1,0,1) - elseif lockspringscroll then - glColor(1,0,0,1) - elseif springscroll then - if options.invertscroll.value then - glColor(1,0,1,1) - else - glColor(0,1,1,1) - end - end - - glAlphaTest(GL_GREATER, 0) - - if not (springscroll and not lockspringscroll) then - hideCursor = true - end - if smoothscroll then - local icon_size2 = icon_size - glTexRect(x-icon_size, y-icon_size2, x+icon_size, y+icon_size2) - else - glTexRect(cx-icon_size, cy-icon_size, cx+icon_size, cy+icon_size) - end - glTexture(false) - - glColor(1,1,1,1) - glAlphaTest(false) - end -end - - -function widget:Initialize() - helpText = explode( '\n', options.helpwindow.value ) - cx = vsx * 0.5 - cy = vsy * 0.5 - - spSendCommands( 'unbindaction toggleoverview' ) - spSendCommands( 'unbindaction trackmode' ) - spSendCommands( 'unbindaction track' ) - spSendCommands( 'unbindaction mousestate' ) --//disable screen-panning-mode toggled by 'backspace' key - - spSendCommands("luaui disablewidget SmoothScroll") -end - -function widget:Shutdown() - spSendCommands{"viewta"} - spSendCommands( 'bind any+tab toggleoverview' ) - spSendCommands( 'bind any+t track' ) - spSendCommands( 'bind ctrl+t trackmode' ) - spSendCommands( 'bind backspace mousestate' ) --//re-enable screen-panning-mode toggled by 'backspace' key -end - -function widget:TextCommand(command) - - if command == "cofc help" then - for i, text in ipairs(helpText) do - echo(' '.. text) - end - return true - elseif command == "cofc reset" then - ResetCam() - return true - end - return false -end - -function widget:UnitDestroyed(unitID) --transfer 3rd person trackmode to other unit or exit to freeStyle view - if thirdperson_trackunit and thirdperson_trackunit == unitID then --return user to normal view if tracked unit is destroyed - local isSpec = Spring.GetSpectatingState() - local attackerID= Spring.GetUnitLastAttacker(unitID) - if not isSpec then - spSendCommands('trackoff') - spSendCommands('viewfree') - thirdperson_trackunit = false - return - end - if Spring.ValidUnitID(attackerID) then --shift tracking toward attacker if it is alive (cinematic). - Spring.SelectUnitArray({attackerID}) - end - local selUnits = spGetSelectedUnits()--test select unit - if not (selUnits and selUnits[1]) then --if can't select, then, check any unit in vicinity - local x,_,z = spGetUnitPosition(unitID) - local units = Spring.GetUnitsInCylinder(x,z, 100) - if units and units[1] then - Spring.SelectUnitArray({units[1]}) - end - end - selUnits = spGetSelectedUnits()--test select unit - if selUnits and selUnits[1] then - spSendCommands('viewfps') - spSendCommands('track') - thirdperson_trackunit = selUnits[1] - local cs = spGetCameraState() - cs.px,cs.py,cs.pz=spGetUnitPosition(selUnits[1]) - cs.py= cs.py+25 --move up 25-elmo incase FPS camera stuck to unit's feet instead of tracking it (aesthetic) - spSetCameraState(cs,0) - else - spSendCommands('trackoff') - spSendCommands('viewfree') - thirdperson_trackunit = false - end - end -end - --------------------------------------------------------------------------------- ---Group Recall Fix--- (by msafwan, 9 Jan 2013) ---Remake Spring's group recall to trigger ZK's custom Spring.SetCameraTarget (which work for freestyle camera mode). --------------------------------------------------------------------------------- -local spGetUnitGroup = Spring.GetUnitGroup -local spGetGroupList = Spring.GetGroupList - - ---include("keysym.h.lua") -local previousGroup =99 -local currentIteration = 1 -local previousKey = 99 -local previousTime = spGetTimer() - -function GroupRecallFix(key, modifier, isRepeat) - if ( not modifier.alt and not modifier.meta) then --check key for group. Reference: unit_auto_group.lua by Licho - local gr - if (key == KEYSYMS.N_0) then gr = 0 - elseif (key == KEYSYMS.N_1) then gr = 1 - elseif (key == KEYSYMS.N_2) then gr = 2 - elseif (key == KEYSYMS.N_3) then gr = 3 - elseif (key == KEYSYMS.N_4) then gr = 4 - elseif (key == KEYSYMS.N_5) then gr = 5 - elseif (key == KEYSYMS.N_6) then gr = 6 - elseif (key == KEYSYMS.N_7) then gr = 7 - elseif (key == KEYSYMS.N_8) then gr = 8 - elseif (key == KEYSYMS.N_9) then gr = 9 - end - if (gr ~= nil) then - local selectedUnit = spGetSelectedUnits() - local groupCount = spGetGroupList() - if groupCount[gr] ~= #selectedUnit then - return false - end - for i=1,#selectedUnit do - local unitGroup = spGetUnitGroup(selectedUnit[i]) - if unitGroup~=gr then - return false - end - end - if previousKey == key and (spDiffTimers(spGetTimer(),previousTime) > 2) then - currentIteration = 0 --reset cycle if delay between 2 similar tap took too long. - end - previousKey = key - previousTime = spGetTimer() - - if options.enableCycleView.value and WG.recvIndicator then - local slctUnitUnordered = {} - for i=1 , #selectedUnit do - local unitID = selectedUnit[i] - local x,y,z = spGetUnitPosition(unitID) - slctUnitUnordered[unitID] = {x,y,z} - end - selectedUnit = nil - local cluster, lonely = WG.recvIndicator.OPTICS_cluster(slctUnitUnordered, 600,2, Spring.GetMyTeamID(),300) --//find clusters with atleast 2 unit per cluster and with at least within 300-elmo from each other with 600-elmo detection range - if previousGroup == gr then - currentIteration = currentIteration +1 - if currentIteration > (#cluster + #lonely) then - currentIteration = 1 - end - else - currentIteration = 1 - end - if currentIteration <= #cluster then - local sumX, sumY,sumZ, unitCount,meanX, meanY, meanZ = 0,0 ,0 ,0 ,0,0,0 - for unitIndex=1, #cluster[currentIteration] do - local unitID = cluster[currentIteration][unitIndex] - local x,y,z= slctUnitUnordered[unitID][1],slctUnitUnordered[unitID][2],slctUnitUnordered[unitID][3] --// get stored unit position - sumX= sumX+x - sumY = sumY+y - sumZ = sumZ+z - unitCount=unitCount+1 - end - meanX = sumX/unitCount --//calculate center of cluster - meanY = sumY/unitCount - meanZ = sumZ/unitCount - Spring.SetCameraTarget(meanX, meanY, meanZ,0.5) - else - local unitID = lonely[currentIteration-#cluster] - local x,y,z= slctUnitUnordered[unitID][1],slctUnitUnordered[unitID][2],slctUnitUnordered[unitID][3] --// get stored unit position - Spring.SetCameraTarget(x,y,z,0.5) - end - cluster=nil - slctUnitUnordered = nil - else --conventional method: - local sumX, sumY,sumZ, unitCount,meanX, meanY, meanZ = 0,0 ,0 ,0 ,0,0,0 - for i=1, #selectedUnit do - local unitID = selectedUnit[i] - local x,y,z= spGetUnitPosition(unitID) - sumX= sumX+x - sumY = sumY+y - sumZ = sumZ+z - unitCount=unitCount+1 - end - meanX = sumX/unitCount --//calculate center - meanY = sumY/unitCount - meanZ = sumZ/unitCount - Spring.SetCameraTarget(meanX, meanY, meanZ,0.5) --is overriden by Spring.SetCameraTarget() at cache.lua. - end - previousGroup= gr - return true - end - end -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/camera_fov_changer.lua b/LuaUI/Widgets_Evo/camera_fov_changer.lua new file mode 100644 index 000000000..a5fadbbe1 --- /dev/null +++ b/LuaUI/Widgets_Evo/camera_fov_changer.lua @@ -0,0 +1,37 @@ +function widget:GetInfo() + return { + name = "FOV changer", + desc = "shortcuts: keypad 1/7 or CTRL+O/P", + author = "", + date = "", + license = "GNU GPL, v2 or later", + layer = 99999999, + enabled = false -- loaded by a horse? + } +end + +local fovStep = 5 +local FOVminus = 111 -- CTRL+O +local FOVplus = 112 -- CTRL+P +local FOVminus2 = 257 --KP1 +local FOVplus2 = 263 --KP7 + +function widget:KeyRelease(key, modifier) + --Spring.Echo(key) + if ((key == FOVplus and modifier.ctrl) or key == FOVplus2 or (key == FOVminus and modifier.ctrl) or key == FOVminus2) then + local current_cam_state = Spring.GetCameraState() + if key == FOVplus or key == FOVplus2 then + current_cam_state.fov = math.floor(current_cam_state.fov + fovStep) + if current_cam_state.fov > 100 then -- glitches beyond 100 + current_cam_state.fov = 100 + end + else + current_cam_state.fov = math.floor(current_cam_state.fov - fovStep) + if current_cam_state.fov < 0 then + current_cam_state.fov = 0 + end + end + Spring.Echo('target FOV: '..current_cam_state.fov) + Spring.SetCameraState(current_cam_state, WG['options'] and WG['options'].getCameraSmoothness() or 2) + end +end diff --git a/LuaUI/Widgets_Evo/camera_player_tv.lua b/LuaUI/Widgets_Evo/camera_player_tv.lua new file mode 100644 index 000000000..aab1c23fd --- /dev/null +++ b/LuaUI/Widgets_Evo/camera_player_tv.lua @@ -0,0 +1,626 @@ +function widget:GetInfo() + return { + name = "Player-TV", + desc = "Automaticly tracks players camera, (shows player-switch countdown on top of advplayerlist)", + author = "Floris", + date = "January 2018", + license = "GNU GPL, v2 or later", + layer = -2, + enabled = true, + } +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 32 +local fontfileOutlineSize = 7 +local fontfileOutlineStrength = 1.18 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local displayPlayername = true + +local playerChangeDelay = 40 + +local parentPos = {} +local prevPos = {} +local drawlistsCountdown = {} +local drawlistsPlayername = {} +local fontSize = 14 -- 14 to be alike with advplayerslist_lockcamera widget +local top, left, bottom, right, widgetScale = 0,0,0,0,1 +local rejoining = false +local initGameframe = Spring.GetGameFrame() +local prevOrderID = 1 + +local currentTrackedPlayer +local playersTS = {} +local nextTrackingPlayerChange = os.clock() + +local tsOrderedPlayerCount = 0 +local tsOrderedPlayers = {} + +local isSpec = Spring.GetSpectatingState() +local vsx, vsy = Spring.GetViewGeometry() +local widgetScale = (0.7 + (vsx*vsy / 5000000)) + +local toggled = false + +local bgcorner = ":n:LuaUI/Images/bgcorner.png" + +local drawlist = {} +local widgetHeight = 23 + +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- + +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy +end + +function addPlayerTsOrdered(ts, playerID, teamID, spec) + local inserted = false + local newTsOrderedPlayers = {} + tsOrderedPlayerCount = 0 + for _,params in ipairs(tsOrderedPlayers) do + if not inserted and ts > params[1] then + tsOrderedPlayerCount = tsOrderedPlayerCount + 1 + newTsOrderedPlayers[tsOrderedPlayerCount] = {ts, playerID, teamID, spec} + inserted = true + end + tsOrderedPlayerCount = tsOrderedPlayerCount + 1 + newTsOrderedPlayers[tsOrderedPlayerCount] = params + end + if not inserted then + tsOrderedPlayerCount = tsOrderedPlayerCount + 1 + newTsOrderedPlayers[tsOrderedPlayerCount] = {ts, playerID, teamID, spec } + end + tsOrderedPlayers = deepcopy(newTsOrderedPlayers) +end + +function tsOrderPlayers() + local playersList = Spring.GetPlayerList() + for _,playerID in ipairs(playersList) do + local _,_,spec,teamID = Spring.GetPlayerInfo(playerID,false) + if playersTS[playerID] ~= nil then + addPlayerTsOrdered(playersTS[playerID], playerID, teamID, spec) + end + end +end + +function GetSkill(playerID) + local customtable = select(11,Spring.GetPlayerInfo(playerID)) -- player custom table + local tsMu = customtable.skill + local tskill = "" + if tsMu then + tskill = tsMu and tonumber(tsMu:match("%d+%.?%d*")) or 0 + end + return tskill +end + + +function SelectTrackingPlayer(playerID) + local newTrackedPlayer + if playerID then + newTrackedPlayer = playerID + else + local highestTs = 0 + local playersList = Spring.GetPlayerList() + for _,playerID in ipairs(playersList) do + local _,active,spec = Spring.GetPlayerInfo(playerID,false) + if not spec and active then + if playersTS[playerID] ~= nil and playersTS[playerID] > highestTs then + highestTs = playersTS[playerID] + newTrackedPlayer = playerID + end + end + end + end + if newTrackedPlayer ~= nil and newTrackedPlayer ~= currentTrackedPlayer then + currentTrackedPlayer = newTrackedPlayer + + if WG['advplayerlist_api'] ~= nil and WG['advplayerlist_api'].SetLockPlayerID ~= nil then + WG['advplayerlist_api'].SetLockPlayerID(currentTrackedPlayer) + end + end +end + +function createCountdownLists() + --if parentPos ~= nil then + for i=1,#drawlistsCountdown do + gl.DeleteList(drawlistsCountdown[i]) + end + drawlistsCountdown = {} + local i = 0 + local leftPadding = 7.5*widgetScale + while i < playerChangeDelay do + drawlistsCountdown[i] = gl.CreateList(function() + font:Begin() + font:SetTextColor(0,0,0,0.6) + font:Print(i, leftPadding+left-(0.7*widgetScale), bottom+(7*widgetScale), fontSize*widgetScale, 'n') + font:Print(i, leftPadding+left+(0.7*widgetScale), bottom+(7*widgetScale), fontSize*widgetScale, 'n') + font:SetTextColor(0.8,0.8,0.8,1) + font:Print(i, leftPadding+left, bottom+(8*widgetScale), fontSize*widgetScale, 'n') + font:End() + end) + i = i + 1 + end + --end +end + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +local function createList() + for i=1,#drawlist do + gl.DeleteList(drawlist[i]) + end + drawlist[1] = gl.CreateList( function() + --glColor(0, 0, 0, 0.66) + --RectRound(left, bottom, right, top, 5.5*widgetScale) + -- + --local borderPadding = 2.75*widgetScale + --glColor(1,1,1,0.025) + --RectRound(left+borderPadding, bottom+borderPadding, right-borderPadding, top-borderPadding, 4.4*widgetScale) + local fontSize = (widgetHeight*widgetScale) * 0.5 + local text = ' cancel camera ' + local color = '\255\255\222\222' + if not toggled and not lockPlayerID then + text = ' Player TV ' + color = '\255\222\255\222' + gl.Color(0, 0.5, 0, 0.66) + else + gl.Color(0.66, 0, 0, 0.66) + end + local textWidth = font:GetTextWidth(text) * fontSize + RectRound(right-textWidth, bottom, right, top, 5.5*widgetScale) + toggleButton = {right-textWidth, bottom, right, top } + + local borderPadding = 2.75*widgetScale + gl.Color(0,0,0,0.18) + RectRound(right-textWidth+borderPadding, bottom+borderPadding, right-borderPadding, top-borderPadding, 4.4*widgetScale) + + font:Begin() + font:Print(color..text, right-(textWidth/2), bottom+(8*widgetScale), fontSize, 'oc') + + if toggled then + local name = 'Player TV ' + local fontSize = (widgetHeight*widgetScale) * 0.6 + local vpos = bottom+(5.5*widgetScale) + font:SetTextColor(0,0,0,0.6) + font:Print(name, right-textWidth-(0.7*widgetScale), vpos, fontSize, 'rn') + font:Print(name, right-textWidth+(0.7*widgetScale), vpos, fontSize, 'rn') + font:SetTextColor(1,1,1,1) + font:Print(name, right-textWidth, vpos+(1*widgetScale), fontSize, 'rn') + end + font:End() + end) + drawlist[2] = gl.CreateList( function() + if toggled or lockPlayerID then + gl.Color(1, 0.2, 0.2, 0.4) + else + gl.Color(0.2, 1, 0.2, 0.4) + end + RectRound(toggleButton[1], toggleButton[2], toggleButton[3], toggleButton[4], 5.5*widgetScale) + + local borderPadding = 2.75*widgetScale + gl.Color(0,0,0,0.14) + RectRound(toggleButton[1]+borderPadding, toggleButton[2]+borderPadding, toggleButton[3]-borderPadding, toggleButton[4]-borderPadding, 4.4*widgetScale) + + local text = ' cancel camera ' + local color = '\255\255\222\222' + if not toggled and not lockPlayerID then + text = ' Player TV ' + color = '\255\222\255\222' + end + local fontSize = (widgetHeight*widgetScale) * 0.5 + local textWidth = font:GetTextWidth(text) * fontSize + font:Begin() + font:Print(color..text, toggleButton[3]-(textWidth/2), toggleButton[2]+(8*widgetScale), fontSize, 'oc') + font:End() + end) + + if WG['guishader'] and isSpec then + if backgroundGuishader then + gl.DeleteList(backgroundGuishader) + end + backgroundGuishader = gl.CreateList( function() + RectRound(toggleButton[1], toggleButton[2], toggleButton[3], toggleButton[4], 5.5*widgetScale) + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'playertv') + end +end + + + +function updatePosition(force) + prevPos = parentPos + if (WG['advplayerlist_api'] ~= nil) then + if WG['displayinfo'] ~= nil then + parentPos = WG['displayinfo'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + elseif WG['music'] ~= nil then + parentPos = WG['music'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + else + parentPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + end + end + + if parentPos[1] then + left = parentPos[2] + bottom = parentPos[1] + right = parentPos[4] + top = parentPos[1]+(widgetHeight*parentPos[5]) + widgetScale = parentPos[5] + + if (prevPos[1] == nil or prevPos[1] ~= parentPos[1] or prevPos[2] ~= parentPos[2] or prevPos[5] ~= parentPos[5]) or force then + createCountdownLists() + createList() + end + end +end + + +function widget:Initialize() + isSpec = Spring.GetSpectatingState() + if WG['advplayerlist_api'] == nil then + Spring.Echo("Top TS camera tracker: AdvPlayerlist not found! ...exiting") + widgetHandler:RemoveWidget(self) + return + end + + local humanPlayers = 0 + local playersList = Spring.GetPlayerList() + for _,playerID in ipairs(playersList) do + local _,active,spec,team = Spring.GetPlayerInfo(playerID,false) + if not spec then + playersTS[playerID] = GetSkill(playerID) + if not select(3,Spring.GetTeamInfo(team,false)) and not select(4,Spring.GetTeamInfo(team,false)) then + humanPlayers = humanPlayers + 1 + end + end + end + if humanPlayers == 0 then + widgetHandler:RemoveWidget(self) + return + end + + tsOrderPlayers() + + updatePosition() + WG['playertv'] = {} + WG['playertv'].GetPosition = function() + return {top,left,bottom,right,widgetScale} + end + WG['playertv'].isActive = function() + return (toggled and isSpec) + end + WG['playertv'].GetPlayerChangeDelay = function() + return playerChangeDelay + end + WG['playertv'].SetPlayerChangeDelay = function(value) + playerChangeDelay = value + createCountdownLists() + end +end + + +function widget:GameStart() + isSpec = Spring.GetSpectatingState() + nextTrackingPlayerChange = os.clock() + tsOrderPlayers() + if isSpec and not rejoining and toggled then + SelectTrackingPlayer() + end +end + + +function widget:PlayerChanged(playerID) + isSpec = Spring.GetSpectatingState() + tsOrderPlayers() + if not rejoining then + if playerID == currentTrackedPlayer then + SelectTrackingPlayer() + end + end +end + +local passedTime = 1 +function widget:Update(dt) + passedTime = passedTime + dt + if passedTime > 0.1 then + passedTime = 0 + updatePosition() + end + if isSpec and Spring.GetGameFrame() > 0 and not rejoining then + if WG['tooltip'] and not toggled and not lockPlayerID then + mx,my,mb = Spring.GetMouseState() + if toggleButton ~= nil and isInBox(mx, my, toggleButton) then + WG['tooltip'].ShowTooltip('playertv', 'Auto camera-track of mostly top TS players\n(switches player every '..playerChangeDelay..' seconds)') + end + end + if (not rejoining and toggled) then + if Spring.GetGameFrame() > initGameframe+70 and os.clock() > nextTrackingPlayerChange then --delay some gameframes so we know if we're rejoining or not + nextTrackingPlayerChange = os.clock() + playerChangeDelay + local scope = 1 + math.floor(1 + tsOrderedPlayerCount/2) + if tsOrderedPlayerCount <= 2 then + scope = 2 + elseif tsOrderedPlayerCount <= 6 then + scope = 1 + math.floor(1 + tsOrderedPlayerCount/1.5) + elseif tsOrderedPlayerCount <= 10 then + scope = 1 + math.floor(1 + tsOrderedPlayerCount/1.75) + end + local orderID = math.random(1,scope) + + local r = math.random() + orderID = 1 + math.floor((r * (r*r)) * scope) + if orderID == prevOrderID then -- prevent same player POV again + orderID = orderID - 1 + if orderID < 1 then + orderID = 2 + end + end + prevorderID = orderID + if tsOrderedPlayers[orderID] then + SelectTrackingPlayer(tsOrderedPlayers[orderID][2]) + end + end + end + end +end + +function widget:GameFrame(n) + if WG['topbar'] then + local prevRejoining = rejoining + rejoining = WG['topbar'].showingRejoining() + end + if isSpec and toggled and n % 30 == 5 then + if rejoining and prevRejoining ~= rejoining then + SelectTrackingPlayer() + elseif rejoining and WG['advplayerlist_api'].GetLockPlayerID() ~= nil then + WG['advplayerlist_api'].SetLockPlayerID() + end + prevGameframeClock = os.clock() + + if currentTrackedPlayer ~= nil and not rejoining then + local _,active,spec = Spring.GetPlayerInfo(currentTrackedPlayer,false) + if not active or spec then + SelectTrackingPlayer() + end + end + end +end + +function isInBox(mx, my, box) + if (WG['topbar'] and WG['topbar'].showingQuit()) then + return false + else + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] + end +end + +function widget:MousePress(mx, my, mb) + if isSpec and mb == 1 and (Spring.GetGameFrame() > 0 or lockPlayerID) then + if toggleButton ~= nil and isInBox(mx, my, toggleButton) then + prevorderID = nil + currentTrackedPlayer = nil + if toggled or lockPlayerID then + toggled = false + WG['advplayerlist_api'].SetLockPlayerID() + lockPlayerID = nil + prevLockPlayerID = nil + createList() + elseif not rejoining then + toggled = true + nextTrackingPlayerChange = os.clock()-1 + createList() + end + end + end +end + +function widget:ViewResize(newX,newY) + vsx, vsy = Spring.GetViewGeometry() + widgetScale = (0.7 + (vsx*vsy / 5000000)) + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + createCountdownLists() +end + + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not isSpec then return end + + local gameFrame = Spring.GetGameFrame() + + if (rejoining or gameFrame == 0) and not lockPlayerID then + if WG['guishader'] then + WG['guishader'].DeleteDlist('playertv') + end + --return + end + + if gameFrame > 0 or lockPlayerID then + if drawlist[1] then + gl.PushMatrix() + gl.CallList(drawlist[1]) + gl.PopMatrix() + mx,my,mb = Spring.GetMouseState() + if toggleButton ~= nil and isInBox(mx, my, toggleButton) then + gl.CallList(drawlist[2]) + end + end + end + + if toggled and not rejoining and gameFrame > 0 then + local countDown = math.floor(nextTrackingPlayerChange - os.clock()) + if drawlistsCountdown[countDown] ~= nil then + gl.PushMatrix() + gl.CallList(drawlistsCountdown[countDown]) + gl.PopMatrix() + end + end + if displayPlayername then + if WG['advplayerlist_api'] then + if lockPlayerID == nil or lockPlayerID ~= WG['advplayerlist_api'].GetLockPlayerID() then + lockPlayerID = WG['advplayerlist_api'].GetLockPlayerID() + if not toggled and prevLockPlayerID ~= lockPlayerID then + createList() + prevLockPlayerID = lockPlayerID + end + if lockPlayerID and not drawlistsPlayername[lockPlayerID] then + drawlistsPlayername[lockPlayerID] = gl.CreateList( function() + local name,_,spec,teamID,_,_,_,_,_ = Spring.GetPlayerInfo(lockPlayerID,false) + local fontSize = 31 * widgetScale + local nameColourR,nameColourG,nameColourB = 1,1,1 + if not spec then + nameColourR,nameColourG,nameColourB,_ = Spring.GetTeamColor(teamID) + end + local posX = vsx * 0.5 + local posY = vsy * 0.095 + + font:Begin() + font:SetTextColor(nameColourR,nameColourG,nameColourB,1) + if (nameColourR + nameColourG*1.2 + nameColourB*0.4) < 0.8 then + font:SetOutlineColor(1,1,1,1) + else + font:SetOutlineColor(0,0,0,1) + end + font:Print(name, posX, posY, fontSize, "con") + font:End() + end) + end + end + end + if lockPlayerID and drawlistsPlayername[lockPlayerID] then + gl.PushMatrix() + gl.CallList(drawlistsPlayername[lockPlayerID]) + gl.PopMatrix() + end + end +end + + +function widget:Shutdown() + for i=1,#drawlistsCountdown do + gl.DeleteList(drawlistsCountdown[i]) + end + for i,v in pairs(drawlistsPlayername) do + gl.DeleteList(drawlistsPlayername[i]) + end + if WG['guishader'] then + WG['guishader'].DeleteDlist('playertv') + end + for i=1,#drawlist do + gl.DeleteList(drawlist[i]) + end + gl.DeleteFont(font) + if toggled then + WG['advplayerlist_api'].SetLockPlayerID() + end +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.toggled = toggled + savedTable.playerChangeDelay = playerChangeDelay + return savedTable +end + +function widget:SetConfigData(data) + if Spring.GetGameFrame() > 0 and data.toggled ~= nil then + toggled = data.toggled + end + if data.playerChangeDelay then + playerChangeDelay = data.playerChangeDelay + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/camera_shake.lua b/LuaUI/Widgets_Evo/camera_shake.lua index 44e308e9e..52ce40b08 100644 --- a/LuaUI/Widgets_Evo/camera_shake.lua +++ b/LuaUI/Widgets_Evo/camera_shake.lua @@ -70,6 +70,10 @@ function widget:ShockFront(power, dx, dy, dz) power = 10 end shake = shake + power + if shake > 0.05 then + shake = 0.05 + end + --Spring.Echo ("Shake Power is " .. shake) end diff --git a/LuaUI/Widgets_Evo/chili/Headers/unicode.lua b/LuaUI/Widgets_Evo/chili/Headers/unicode.lua new file mode 100644 index 000000000..6559d90bf --- /dev/null +++ b/LuaUI/Widgets_Evo/chili/Headers/unicode.lua @@ -0,0 +1,119 @@ +--//============================================================================= +--// + +-- shift left +local function lsh(value,shift) + return (value*(2^shift)) % 2^24 +end +-- shift right +local function rsh(value,shift) + return math.floor(value/2^shift) % 2^24 +end + + +function UnicodeToUtf8(ch) + if (ch == 0) then + return nil + end + + if (ch < lsh(1,7)) then + return string.char(ch) + elseif (ch < lsh(1,11)) then + return string.char( + math.bit_or(0xC0, rsh(ch,6)), + math.bit_or(0x80, math.bit_and(ch, 0x3F)) + ) + elseif (ch < lsh(1,16)) then + return string.char( + math.bit_or(0xE0, rsh(ch,12)), + math.bit_or(0x80, math.bit_and(rsh(ch,6), 0x3F)), + math.bit_or(0x80, math.bit_and( ch, 0x3F)) + ) + elseif (ch < lsh(1,21)) then + return string.char( + math.bit_or(0xF0, rsh(ch,18)), + math.bit_or(0x80, math.bit_and(rsh(ch,12), 0x3F)), + math.bit_or(0x80, math.bit_and( rsh(ch,6), 0x3F)), + math.bit_or(0x80, math.bit_and( ch, 0x3F)) + ) + end + + return nil +end + + +local function count_leading_ones(num) + return + ((math.bit_and(num, 0xF0) == 0xF0) and 4) + or ((math.bit_and(num, 0xE0) == 0xE0) and 3) + or ((math.bit_and(num, 0xC0) == 0xC0) and 2) + or ((math.bit_and(num, 0x80) == 0x80) and 1) + or 0 +end + + +local function Utf8GetCharByteLength(text, pos) + --// UTF8 looks like this + --// 1Byte == ASCII: 0xxxxxxxxx + --// 2Bytes encoded char: 110xxxxxxx 10xxxxxx + --// 3Bytes encoded char: 1110xxxxxx 10xxxxxx 10xxxxxx + --// 4Bytes encoded char: 11110xxxxx 10xxxxxx 10xxxxxx 10xxxxxx + --// Originaly there were 5&6 byte versions too, but they were dropped in RFC 3629. + --// So UTF8 maps to UTF16 range only + + local UTF8_CONT_MASK = 0xC0 --// 11xxxxxx + local UTF8_CONT_OKAY = 0x80 --// 10xxxxxx + + if (pos <= 0) then + return 0 + end + + --// read next 4bytes and check if it is an utf8 sequence + local remainingChars = (text:len() + 1) - pos --FIXME + if (remainingChars <= 0) then + return 0 + end + + --// how many bytes are requested for our multi-byte utf8 sequence + local clo = count_leading_ones(string.byte(text, pos, pos)) --FIXME + if (clo>4) or (clo==0) then clo = 1 end --// ignore >=5 byte ones cause of RFC 3629 + + --// how many healthy utf8 bytes are following + local numValidUtf8Bytes = 1; --// first char is always valid + if (math.bit_and(string.byte(text, pos + 1, pos + 1) or 0, UTF8_CONT_MASK) == UTF8_CONT_OKAY) then numValidUtf8Bytes = numValidUtf8Bytes + 1 end + if (math.bit_and(string.byte(text, pos + 2, pos + 2) or 0, UTF8_CONT_MASK) == UTF8_CONT_OKAY) then numValidUtf8Bytes = numValidUtf8Bytes + 1 end + if (math.bit_and(string.byte(text, pos + 3, pos + 3) or 0, UTF8_CONT_MASK) == UTF8_CONT_OKAY) then numValidUtf8Bytes = numValidUtf8Bytes + 1 end + + --// check if enough trailing utf8 bytes are healthy + --// else ignore utf8 and parse it as 8bit Latin-1 char (extended ASCII) + --// this adds backwardcompatibility with the old renderer + --// which supported extended ASCII with umlauts etc. + if (clo > numValidUtf8Bytes) then + return 1 + end + return clo +end + + +function Utf8PrevChar(s, startPos) + local pos = math.max(startPos - 4, 1) + local oldPos = pos + while (pos < startPos) do + oldPos = pos + pos = pos + Utf8GetCharByteLength(s, pos) + end + return oldPos +end +function Utf8NextChar(s, pos) + return pos + Utf8GetCharByteLength(s, pos) +end + +function Utf8BackspaceAt(s, pos) + if pos <= 1 then return s, pos end + local p = Utf8PrevChar(s, pos) + return Utf8DeleteAt(s, p), p +end +function Utf8DeleteAt(s, pos) + local l = Utf8GetCharByteLength(s, pos) + return s:sub(1, pos - 1) .. s:sub(pos + l) +end diff --git a/LuaUI/Widgets_Evo/chili/controls/LayoutPanel.lua b/LuaUI/Widgets_Evo/chili/controls/LayoutPanel.lua index c819e234e..439113775 100644 --- a/LuaUI/Widgets_Evo/chili/controls/LayoutPanel.lua +++ b/LuaUI/Widgets_Evo/chili/controls/LayoutPanel.lua @@ -11,6 +11,26 @@ --// This doesn't affect simple containers like grids & stackcontrols, which --// don't create any controls themselves (instead they just align their children). +--- LayoutPanel module + +--- LayoutPanel fields. +-- Inherits from Control. +-- @see control.Control +-- @table LayoutPanel +-- @tparam {left,top,right,bottom} itemPadding table of item padding, (default {5,5,5,5}) +-- @tparam {left,top,right,bottom} itemMargin table of item margin, (default {5,5,5,5}) +-- @int[opt=1] minWidth minimum item width +-- @int[opt=0] maxWidth maximum item width +-- @int[opt=1] minHeight minimum item height +-- @int[opt=0] maxHeight maximum item height +-- @string[opt="horizontal] orientation orientation of the items +-- @bool[opt=false] resizeItems items are resized +-- @bool[opt=true] centerItems items are centered +-- @bool[opt=false] selectable items can be selected +-- @bool[multiSelect=true] multiSelect multiple items can be selected +-- @tparam {func1,func2,...} OnSelectItem function listeners to be called on item selection change (default {}) +-- @tparam {func1,func2,...} OnDrawItem function listeners to be called when an item is drawn (default {}) +-- @tparam (func1,func2,...} OnDblClickItem function listeners to be called on double click (default {}) LayoutPanel = Control:Inherit{ classname = "layoutpanel", @@ -67,6 +87,8 @@ end --//============================================================================= +--- Set the panel's orientation +-- @string orientation new orientation function LayoutPanel:SetOrientation(orientation) self.orientation = orientation inherited.UpdateClientArea(self) @@ -248,10 +270,6 @@ function LayoutPanel:_AutoArrangeOrdinate(freeSpace) local lineSizes = {} for i=1,#_lines do local first_cell_in_line = _cells[ _lines[i] ] - if not first_cell_in_line then - Spring.Log(widget:GetInfo().name, "WARNING", "(StackPanel) failed to find first_cell_in_line") - return - end if (self.orientation == "horizontal") then --FIXME lineSizes[i] = {i,first_cell_in_line[4]} else @@ -416,17 +434,6 @@ function LayoutPanel:_LayoutChildrenResizeItems() local cn = self.children local cn_count = #cn - local max_ix = math.floor(self.clientArea[3] / self.minItemWidth) - local max_iy = math.floor(self.clientArea[4] / self.minItemHeight) - - if (max_ix * max_iy < cn_count) or - (max_ix < (self.columns or 0)) or - (max_iy < (self.rows or 0)) - then - --FIXME add autoEnlarge/autoAdjustSize? - --error"LayoutPanel: not enough space" - end - --FIXME take minWidth/height maxWidth/Height into account! (and try to reach a 1:1 pixel ratio) if self.columns and self.rows then self._columns = self.columns @@ -741,7 +748,7 @@ function LayoutPanel:DrawChildren() if (not cn[1]) then return end gl.PushMatrix() - gl.Translate(math.floor(self.x + self.clientArea[1]),math.floor(self.y + self.clientArea[2]),0) + gl.Translate(self.clientArea[1], self.clientArea[2], 0) for i=1,#cn do self:DrawItemBkGnd(i) end @@ -766,13 +773,13 @@ function LayoutPanel:DrawChildrenForList() gl.Color(0,1,0,0.5) gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) gl.LineWidth(2) - gl.Rect(self.x,self.y,self.x+self.width,self.y+self.height) + gl.Rect(0, 0, self.width, self.height) gl.LineWidth(1) gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) end gl.PushMatrix() - gl.Translate(math.floor(self.x + self.clientArea[1]),math.floor(self.y + self.clientArea[2]),0) + gl.Translate(self.clientArea[1], self.clientArea[2], 0) for i=1,#cn do self:DrawItemBkGnd(i) end @@ -860,7 +867,8 @@ function LayoutPanel:MultiRectSelect(item1,item2,append) self:Invalidate() end - +--- Toggle item selection +-- @int itemIdx id of the item for which the selection will be toggled function LayoutPanel:ToggleItem(itemIdx) local newstate = not self.selectedItems[itemIdx] self.selectedItems[itemIdx] = newstate @@ -869,7 +877,9 @@ function LayoutPanel:ToggleItem(itemIdx) self:Invalidate() end - +--- Select the item +-- @int itemIdx id of the item to be selected +-- @bool append whether the old selection should be kept function LayoutPanel:SelectItem(itemIdx, append) if (self.selectedItems[itemIdx]) then return @@ -891,7 +901,8 @@ function LayoutPanel:SelectItem(itemIdx, append) self:Invalidate() end - +--- Deselect item +-- @int itemIdx id of the item to deselect function LayoutPanel:DeselectItem(itemIdx) if (not self.selectedItems[itemIdx]) then return @@ -903,14 +914,14 @@ function LayoutPanel:DeselectItem(itemIdx) self:Invalidate() end - +--- Select all items function LayoutPanel:SelectAll() for i=1,#self.children do self:SelectItem(i, append) end end - +--- Deselect all items function LayoutPanel:DeselectAll() for idx in pairs(self.selectedItems) do self:DeselectItem(idx) diff --git a/LuaUI/Widgets_Evo/chili/controls/button.lua b/LuaUI/Widgets_Evo/chili/controls/button.lua index 769607fab..2d518752f 100644 --- a/LuaUI/Widgets_Evo/chili/controls/button.lua +++ b/LuaUI/Widgets_Evo/chili/controls/button.lua @@ -1,8 +1,15 @@ --//============================================================================= +--- Button module + +--- Button fields. +-- Inherits from Control. +-- @see control.Control +-- @table Button +-- @string[opt="button"] caption caption to be displayed Button = Control:Inherit{ classname= "button", - caption = 'button', + caption = 'button', defaultWidth = 70, defaultHeight = 20, } @@ -12,6 +19,8 @@ local inherited = this.inherited --//============================================================================= +--- Sets the caption of the button +-- @string caption new caption of the button function Button:SetCaption(caption) if (self.caption == caption) then return end self.caption = caption diff --git a/LuaUI/Widgets_Evo/chili/controls/checkbox.lua b/LuaUI/Widgets_Evo/chili/controls/checkbox.lua index 174781a88..bc405d619 100644 --- a/LuaUI/Widgets_Evo/chili/controls/checkbox.lua +++ b/LuaUI/Widgets_Evo/chili/controls/checkbox.lua @@ -1,5 +1,18 @@ --//============================================================================= +--- Checkbox module + +--- Checkbox fields. +-- Inherits from Control. +-- @see control.Control +-- @table Checkbox +-- @bool[opt=true] checked checkbox checked state +-- @string[opt="text"] caption caption to appear in the checkbox +-- @string[opt="left"] textalign text alignment +-- @string[opt="right"] boxalign box alignment +-- @int[opt=10] boxsize box size +-- @tparam {r,g,b,a} textColor text color, (default {0,0,0,1}) +-- @tparam {func1,func2,...} OnChange listener functions for checked state changes, (default {}) Checkbox = Control:Inherit{ classname = "checkbox", checked = true, @@ -29,6 +42,7 @@ end --//============================================================================= +--- Toggles the checked state function Checkbox:Toggle() self:CallListeners(self.OnChange,not self.checked) self.checked = not self.checked diff --git a/LuaUI/Widgets_Evo/chili/controls/colorbars.lua b/LuaUI/Widgets_Evo/chili/controls/colorbars.lua index f62d7b5b7..50582177e 100644 --- a/LuaUI/Widgets_Evo/chili/controls/colorbars.lua +++ b/LuaUI/Widgets_Evo/chili/controls/colorbars.lua @@ -1,5 +1,13 @@ --//============================================================================= +--- Colorbars module + +--- Colorbar fields. +-- Inherits from Control. +-- @see control.Control +-- @table Colorbars +-- @tparam {r,g,b,a} color color table, (default {1,1,1,1}) +-- @tparam {func1,func2,...} OnChange listener functions for color changes, (default {}) Colorbars = Control:Inherit{ classname = "colorbars", color = {1,1,1,1}, @@ -15,6 +23,8 @@ local inherited = this.inherited --//============================================================================= +--- Sets the new color +-- @tparam {r,g,b,a} c color table function Colorbars:SetColor(c) self:CallListeners(self.OnChange,c) self.value = c @@ -34,9 +44,6 @@ local glColor = gl.Color local glBeginEnd = gl.BeginEnd function Colorbars:DrawControl() - glPushMatrix() - glTranslate(self.x,self.y,0) - local barswidth = self.width - (self.height + 4) local color = self.color @@ -64,8 +71,6 @@ function Colorbars:DrawControl() glRect(barswidth + 2,self.height,self.width - 2,0) gl.BeginEnd(GL.TRIANGLE_STRIP, theme.DrawBorder_, barswidth + 2,0,self.width - barswidth - 4,self.height, 1, self.borderColor, self.borderColor2) - - glPopMatrix() end --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/combobox.lua b/LuaUI/Widgets_Evo/chili/controls/combobox.lua index 894ec5055..9928b1dca 100644 --- a/LuaUI/Widgets_Evo/chili/controls/combobox.lua +++ b/LuaUI/Widgets_Evo/chili/controls/combobox.lua @@ -1,4 +1,14 @@ --//============================================================================= + +--- ComboBox module + +--- ComboBox fields. +-- Inherits from Control. +-- @see control.Control +-- @table ComboBox +-- @tparam {"item1","item2",...} items table of items in the ComboBox, (default {"items"}) +-- @int[opt=1] selected id of the selected item +-- @tparam {func1,func2,...} OnSelect listener functions for selected item changes, (default {}) ComboBox = Button:Inherit{ classname = "combobox", caption = 'combobox', @@ -7,10 +17,14 @@ ComboBox = Button:Inherit{ items = { "items" }, selected = 1, OnSelect = {}, + maxDropDownHeight = 200, + minDropDownHeight = 50, + maxDropDownWidth = 500, + minDropDownWidth = 50, } local ComboBoxWindow = Window:Inherit{classname = "combobox_window", resizable = false, draggable = false, } -local ComboBoxScrollPanel = ScrollPanel:Inherit{classname = "combobox_scrollpanel", horizontalScrollBar = false, } +local ComboBoxScrollPanel = ScrollPanel:Inherit{classname = "combobox_scrollpanel", horizontalScrollbar = false, } local ComboBoxStackPanel = StackPanel:Inherit{classname = "combobox_stackpanel", autosize = true, resizeItems = false, borderThickness = 0, padding = {0,0,0,0}, itemPadding = {0,0,0,0}, itemMargin = {0,0,0,0}, } local ComboBoxItem = Button:Inherit{classname = "combobox_item"} @@ -23,13 +37,20 @@ function ComboBox:New(obj) return obj end +--- Selects an item by id +-- @int itemIdx id of the item to be selected function ComboBox:Select(itemIdx) if (type(itemIdx)=="number") then - if not self.items[itemIdx] then + local item = self.items[itemIdx] + if not item then return end self.selected = itemIdx - self.caption = self.items[itemIdx] + self.caption = "" + + if type(item) == "string" then + self.caption = item + end self:CallListeners(self.OnSelect, itemIdx, true) self:Invalidate() end @@ -61,21 +82,39 @@ function ComboBox:MouseDown(...) local labels = {} local labelHeight = 20 + + local width = math.max(self.width, self.minDropDownWidth) + local height = 10 for i = 1, #self.items do - local newBtn = ComboBoxItem:New { - caption = self.items[i], - width = '100%', - height = labelHeight, - state = {focused = (i == self.selected), selected = (i == self.selected)}, - OnMouseUp = { function() - self:Select(i) - self:_CloseWindow() - end } - } - labels[#labels+1] = newBtn + local item = self.items[i] + if type(item) == "string" then + local newBtn = ComboBoxItem:New { + caption = item, + width = '100%', + height = labelHeight, + state = {focused = (i == self.selected), selected = (i == self.selected)}, + OnMouseUp = { function() + self:Select(i) + self:_CloseWindow() + end } + } + labels[#labels+1] = newBtn + height = height + labelHeight + width = math.max(width, self.font:GetTextWidth(item)) + else + labels[#labels+1] = item + item.OnMouseUp = { function() + self:Select(i) + self:_CloseWindow() + end } + width = math.max(width, item.width + 5) + height = height + item.height -- FIXME: what if this height is relative? + end end - local height = math.min(200, labelHeight * #labels) + height = math.max(self.minDropDownHeight, height) + height = math.min(self.maxDropDownHeight, height) + width = math.min(self.maxDropDownWidth, width) local screen = self:FindParent("screen") local y = sy + self.height @@ -85,9 +124,9 @@ function ComboBox:MouseDown(...) self._dropDownWindow = ComboBoxWindow:New{ parent = screen, - width = self.width, + width = width, height = height, - x = sx, + x = sx - (width - self.width), y = y, children = { ComboBoxScrollPanel:New{ diff --git a/LuaUI/Widgets_Evo/chili/controls/control.lua b/LuaUI/Widgets_Evo/chili/controls/control.lua index 26ee5e39b..f2de5e8ee 100644 --- a/LuaUI/Widgets_Evo/chili/controls/control.lua +++ b/LuaUI/Widgets_Evo/chili/controls/control.lua @@ -1,5 +1,29 @@ --//============================================================================= +--- Control module + +--- Control fields. +-- Inherits from Object. +-- @see object.Object +-- @table Control +-- @tparam {left,top,right,bottom} padding table of padding, (default {5,5,5,5}) +-- @number[opt=1.5] borderThickness border thickness in pixels +-- @tparam {r,g,b,a} borderColor border color {r,g,b,a}, (default {1,1,1,0.6}) +-- @tparam {r,g,b,a} borderColor2 border color second {r,g,b,a}, (default {0,0,0,0.8}) +-- @tparam {r,g,b,a} backgroundColor background color {r,g,b,a}, (default {0.8,0.8,1,0.4}) +-- @tparam {r,g,b,a} focusColor focus color {r,g,b,a}, (default {0.2,0.2,1,0.6}) +-- @bool[opt=false] autosize whether size will be determined automatically +-- @bool[opt=false] draggable can control be dragged +-- @bool[opt=false] resizable can control be resized +-- @int[opt=10] minWidth minimum width +-- @int[opt=10] minHeight minimum height +-- @int[opt=1e9] maxWidth maximum width +-- @int[opt=1e9] maxHeight maximum height +-- @tparam {func1,fun2,...} OnResize table of function listeners for size changes, (default {}) + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + Control = Object:Inherit{ classname = 'control', padding = {5, 5, 5, 5}, @@ -29,11 +53,8 @@ Control = Object:Inherit{ fixedRatio = false, tooltip = nil, --// JUST TEXT - useDList = true, - safeOpengl = true, --// enables scissors - font = { - font = "FreeSansBold.otf", + font = fontfile2, size = 14, shadow = false, outline = false, @@ -56,6 +77,11 @@ Control = Object:Inherit{ skin = nil, skinName = nil, + drawcontrolv2 = nil, --// disable backward support with old DrawControl gl state (with 2.1 self.xy translation isn't needed anymore) + + useRTT = ((gl.CreateFBO and gl.BlendFuncSeparate) ~= nil), + useDLists = (gl.CreateList ~= nil) and false, --FIXME broken in combination with RTT (wrong blending) + OnResize = {}, } @@ -67,11 +93,11 @@ local inherited = this.inherited function Control:New(obj) --// backward compability BackwardCompa(obj) - - --//minimum size from minimum size table when minWidth & minHeight is not set (backward compatibility) - local minimumSize = obj.minimumSize or {} - obj.minWidth = obj.minWidth or minimumSize[1] - obj.minHeight = obj.minHeight or minimumSize[2] + + if obj.DrawControl then + obj._hasCustomDrawControl = true + end + --// load the skin for this control obj.classname = self.classname @@ -84,6 +110,18 @@ function Control:New(obj) obj = inherited.New(self,obj) + if obj._hasCustomDrawControl then + if not obj.drawcontrolv2 then + local w = obj._widget or {whInfo = { name = "unknown" } } + local fmtStr = [[You are using a custom %s::DrawControl in widget "%s". + Please note that with Chili 2.1 the (self.x, self.y) translation is moved a level up and does not need to be done in DrawControl anymore. + When you adjusted your code set `drawcontrolv2 = true` in the respective control to disable this message.]] + Spring.Log("Chili", "warning", fmtStr:format(obj.name, w.whInfo.name)) + else + obj._hasCustomDrawControl = false + end + end + local p = obj.padding if (obj.clientWidth) then obj.width = obj.clientWidth + p[1] + p[3] @@ -109,19 +147,31 @@ function Control:New(obj) return obj end - +--- Removes the control. function Control:Dispose(...) - if (self._all_dlist) then - gl.DeleteList(self._all_dlist) - self._all_dlist = nil - end - if (self._children_dlist) then - gl.DeleteList(self._children_dlist) - self._children_dlist = nil - end - if (self._own_dlist) then - gl.DeleteList(self._own_dlist) - self._own_dlist = nil + gl.DeleteList(self._all_dlist) + self._all_dlist = nil + + gl.DeleteList(self._children_dlist) + self._children_dlist = nil + + gl.DeleteList(self._own_dlist) + self._own_dlist = nil + + gl.DeleteTexture(self._tex_all) + self._tex_all = nil + gl.DeleteTexture(self._tex_children) + self._tex_children = nil + + if gl.DeleteFBO then + gl.DeleteRBO(self._stencil_all) + self._stencil_all = nil + gl.DeleteRBO(self._stencil_children) + self._stencil_children = nil + gl.DeleteFBO(self._fbo_all) + self._fbo_all = nil + gl.DeleteFBO(self._fbo_children) + self._fbo_children = nil end inherited.Dispose(self,...) @@ -130,11 +180,16 @@ end --//============================================================================= +--- Sets the control's parent object. +-- @tparam object.Object obj parent object function Control:SetParent(obj) inherited.SetParent(self,obj) - self:RequestRealign() + if obj then self:RequestRealign() end end +--- Adds a child object to the control +-- @tparam object.Object obj child object +-- @param dontUpdate if true won't trigger a RequestRealign() function Control:AddChild(obj, dontUpdate) inherited.AddChild(self,obj) if (not dontUpdate) then @@ -142,6 +197,8 @@ function Control:AddChild(obj, dontUpdate) end end +--- Removes a child object from the control +-- @tparam object.Object obj child object function Control:RemoveChild(obj) local found = inherited.RemoveChild(self,obj) if (found) then @@ -152,13 +209,6 @@ end --//============================================================================= -function Control:Invalidate() - self._needRedraw = true - self:RequestUpdate() -end - ---//============================================================================= - function Control:_GetMaxChildConstraints(child) return 0, 0, self.clientWidth, self.clientHeight end @@ -303,7 +353,7 @@ end --//============================================================================= -function Control:UpdateClientArea() +function Control:UpdateClientArea(dontRedraw) local padding = self.padding self.clientWidth = self.width - padding[1] - padding[3] @@ -326,11 +376,7 @@ function Control:UpdateClientArea() self._oldheight_uca = self.height end -if (self.debug) then - Spring.Echo(self.name, self.width, self.height, self._realignRequested) -end - - self:Invalidate() --FIXME correct place? + if not dontRedraw then self:Invalidate() end --FIXME only when RTT! self:CallListeners(self.OnResize) --FIXME more arguments and filter unchanged resizes end @@ -419,8 +465,16 @@ end --//============================================================================= +--- Sets the control's position +-- @int x x-coordinate +-- @int y y-coordinate +-- @int w width +-- @int h height +-- @param clientArea TODO +-- @bool dontUpdateRelative TODO function Control:SetPos(x, y, w, h, clientArea, dontUpdateRelative) local changed = false + local redraw = false --//FIXME add an API for relative constraints changes if (x)and(type(x) == "number") then @@ -463,12 +517,14 @@ function Control:SetPos(x, y, w, h, clientArea, dontUpdateRelative) if (self.width ~= w) then self.width = w changed = true + redraw = true end if (not dontUpdateRelative) then if (self._relativeBounds.width ~= w) then self._relativeBounds.width = IsRelativeCoord(w) and w self._givenBounds.width = w changed = true + redraw = true end end end @@ -480,24 +536,33 @@ function Control:SetPos(x, y, w, h, clientArea, dontUpdateRelative) if (self.height ~= h) then self.height = h changed = true + redraw = true end if (not dontUpdateRelative) then if (self._relativeBounds.height ~= h) then self._relativeBounds.height = IsRelativeCoord(h) and h self._givenBounds.height = h changed = true + redraw = true end end end if (changed)or(not self.clientArea) then - self:UpdateClientArea() + self:UpdateClientArea(not redraw) end end - +--- Sets the control's relative position +-- @int x x-coordinate +-- @int y y-coordinate +-- @int w width +-- @int h height +-- @param clientArea TODO +-- @bool dontUpdateRelative TODO function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) local changed = false + local redraw = false --//FIXME add an API for relative constraints changes if x then @@ -541,6 +606,7 @@ function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) if (self.width ~= w) then self.width = w changed = true + redraw = true end end if (not dontUpdateRelative) then @@ -548,6 +614,7 @@ function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) self._relativeBounds.width = IsRelativeCoord(w) and w self._givenBounds.width = w changed = true + redraw = true end end end @@ -560,6 +627,7 @@ function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) if (self.height ~= h) then self.height = h changed = true + redraw = true end end if (not dontUpdateRelative) then @@ -567,15 +635,21 @@ function Control:SetPosRelative(x, y, w, h, clientArea, dontUpdateRelative) self._relativeBounds.height = IsRelativeCoord(h) and h self._givenBounds.height = h changed = true + redraw = true end end end if (changed)or(not self.clientArea) then - self:UpdateClientArea() + self:UpdateClientArea(not redraw) end end +--- Resize the control +-- @int w width +-- @int h height +-- @param clientArea TODO +-- @bool dontUpdateRelative TODO function Control:Resize(w, h, clientArea, dontUpdateRelative) self:SetPosRelative(nil, nil, w, h, clientArea, dontUpdateRelative) end @@ -688,7 +762,7 @@ function Control:GetChildrenCurrentExtents() local minTop = 0 local maxRight = 0 local maxBottom = 0 - + local cn = self.children for i=1,#cn do local c = cn[i] @@ -709,7 +783,7 @@ end function Control:StartResizing(x,y) --//FIXME the x,y aren't needed check how drag is handled! self.resizing = { - mouse = {x, y}, + mouse = {x, y}, size = {self.width, self.height}, pos = {self.x, self.y}, } @@ -746,13 +820,13 @@ end function Control:ParentToClient(x,y) local ca = self.clientArea - return x - self.x - ca[1], y - self.y - ca[2] + return x - self.x - ca[1], y - self.y - ca[2] end function Control:ClientToParent(x,y) local ca = self.clientArea - return x + self.x + ca[1], y + self.y + ca[2] + return x + self.x + ca[1], y + self.y + ca[2] end @@ -764,100 +838,279 @@ end --//============================================================================= +--- Requests a redraw of the control. +function Control:Invalidate() + self._needRedraw = true + self._needRedrawSelf = nil + self:RequestUpdate() +end + +--- Requests a redraw of the control. +function Control:InvalidateSelf() + self._needRedraw = true + self._needRedrawSelf = true + self:RequestUpdate() +end + +--//============================================================================= + +function Control:InstantUpdate() + if self:IsInView() then + if self._needRedraw then + self:Update() + else + self._in_update = true + self:_UpdateChildrenDList() + self:_UpdateAllDList() + self._in_update = false + end + end +end + + function Control:Update() - if (self._realignRequested) then + if self._realignRequested then self:Realign(self.__savespace) - self._realignRequested = nil + self._realignRequested = false end - if (self._needRedraw)and(self:IsInView()) then - if (self.useDList) then - --//FIXME don't recreate the own displaylist each time we _move_ a window + if self._needRedraw then + if self:IsInView() then + self._in_update = true self:_UpdateOwnDList() - --self:_UpdateChildrenDList() + if not self._needRedrawSelf then self:_UpdateChildrenDList() end self:_UpdateAllDList() + self._in_update = false + + self._needRedraw = false + self._needRedrawSelf = false + self._redrawSelfCounter = (self._redrawSelfCounter or 0) + 1 end - self._needRedraw = nil end end -function Control:InstantUpdate() - if self:IsInView() then - if self._needRedraw then - self:Update() +--//============================================================================= + +function Control:_CheckIfRTTisAppreciated() + if (self.width <= 0)or(self.height <= 0) then + return false + end + + if self._cantUseRTT or not(self.useRTT) then + return false + end + + if self:InheritsFrom("window") then + if self._usingRTT then + return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.2) else - self:_UpdateAllDList() + return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.1) + end + else + if (self._redrawCounter or 0) > 300 then + return (((self._redrawSelfCounter or 1) / (self._redrawCounter or 1)) < 0.03) end end end ---//============================================================================= function Control:_UpdateOwnDList() - if (not self.parent) then return end - if not self:IsInView() then return end + if not self.parent then return end + if not self:IsInView() then return end + if not self.useDLists then return end - self:CallChildren('_UpdateOwnDList') + gl.DeleteList(self._own_dlist) + self._own_dlist = gl.CreateList(self.DrawControl, self) +end - if (self._needRedraw) then - if (self._own_dlist) then - gl.DeleteList(self._own_dlist) - self._own_dlist = nil - end - self._own_dlist = gl.CreateList(self.DrawControl, self) +function Control:_UpdateChildrenDList() + if not self.parent then return end + if not self:IsInView() then return end - self._needRedraw = nil - end + if self:InheritsFrom("scrollpanel") and not self._cantUseRTT then + local contentX,contentY,contentWidth,contentHeight = unpack4(self.contentArea) + if (contentWidth <= 0)or(contentHeight <= 0) then return end + self:CreateViewTexture("children", contentWidth, contentHeight, self.DrawChildrenForList, self, true) + end + + --FIXME + --if self.useDLists then + -- self._children_dlist = gl.CreateList(self.DrawChildrenForList, self, true) + --end end ---[[ -function Control:_UpdateChildrenDList() - if (self._children_dlist) then - gl.DeleteList(self._children_dlist) - self._children_dlist = nil - end - self._children_dlist = gl.CreateList(self.CallChildrenInverse, self, 'DrawForList') + +function Control:_UpdateAllDList() + if not self.parent then return end + if not self:IsInView() then return end + + local RTT = self:_CheckIfRTTisAppreciated() + + gl.DeleteList(self._all_dlist) + + if RTT then + self._usingRTT = true + self:CreateViewTexture("all", self.width, self.height, self.DrawForList, self) + else + local suffix_name = "all" + local texname = "_tex_" .. suffix_name + local texStencilName = "_stencil_" .. suffix_name + local fboName = "_fbo_" .. suffix_name + local texw = "_texw_" .. suffix_name + local texh = "_texh_" .. suffix_name + if gl.DeleteFBO then + gl.DeleteFBO(self[fboName]) + gl.DeleteTexture(self[texname]) + gl.DeleteRBO(self[texStencilName]) + end + self[texStencilName] = nil + self[texname] = nil + self[fboName] = nil + self[texw] = nil + self[texh] = nil + self._usingRTT = false + + --FIXME + --if self.useDLists then + -- self._all_dlist = gl.CreateList(self.DrawForList,self) + --end + end + + if (self.parent)and(not self.parent._needRedraw)and(self.parent._UpdateAllDList) then + TaskHandler.RequestInstantUpdate(self.parent) + end end + + + +function Control:_SetupRTT(fnc, self_, drawInContentRect, ...) + gl.Clear(GL.COLOR_BUFFER_BIT, 0,0,0,1) + gl.Clear(GL.STENCIL_BUFFER_BIT, 0) + + --// no need to push/pop cause gl.ActiveFBO already does so + gl.MatrixMode(GL.MODELVIEW) + gl.Translate(-1,1,0) + if not drawInContentRect then + gl.Scale(2/self.width, -2/self.height, 1) + gl.Translate(-self.x, -self.y, 0) + else + local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) + local contentX,contentY,contentWidth,contentHeight = unpack4(self.contentArea) + gl.Scale(2/contentWidth, -2/contentHeight, 1) + gl.Translate(-(clientX - self.scrollPosX), -(clientY - self.scrollPosY), 0) + end + + gl.Color(1,1,1,1) + gl.AlphaTest(false) + gl.StencilTest(true) + gl.StencilFunc(GL.EQUAL, 0, 0xFF) + gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) + + gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) + fnc(self_, ...) +--[[ + --//Render a red quad to indicate that RTT is used for the respective control + gl.Color(1,0,0,0.5) + if not drawInContentRect then + gl.Rect(self.x,self.y,self.x+50,self.y+50) + else + gl.Rect(0,0,50,50) + end + gl.Color(1,1,1,1) --]] + gl.Blending("reset") -function Control:_UpdateAllDList() - if (not self.parent) then return end - if not self:IsInView() then return end + gl.StencilTest(false) +end + +local staticRttTextureParams = { + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + border = false, +} +local staticDepthStencilTarget = { + format = GL_DEPTH24_STENCIL8, +} - self._redrawCounter = (self._redrawCounter or 0) + 1 +function Control:CreateViewTexture(suffix_name, width, height, fnc, ...) + if not gl.CreateFBO or not gl.BlendFuncSeparate then + self._cantUseRTT = true + self._usingRTT = false + return + end - if (self._all_dlist) then - gl.DeleteList(self._all_dlist) - self._all_dlist = nil - end - self._all_dlist = gl.CreateList(self.DrawForList,self) + local texname = "_tex_" .. suffix_name + local texw = "_texw_" .. suffix_name + local texh = "_texh_" .. suffix_name + local texStencilName = "_stencil_" .. suffix_name + local fboName = "_fbo_" .. suffix_name + + local fbo = self[fboName] or gl.CreateFBO() + local texColor = self[texname] + local texStencil = self[texStencilName] + + if (width ~= self[texw])or(height ~= self[texh]) then + self[texw] = width + self[texh] = height + fbo.color0 = nil + fbo.stencil = nil + gl.DeleteTexture(texColor) + gl.DeleteRBO(texStencil) + + texColor = gl.CreateTexture(width, height, staticRttTextureParams) + texStencil = gl.CreateRBO(width, height, staticDepthStencilTarget) + + fbo.color0 = texColor + fbo.stencil = texStencil + end - if (self.parent)and(not self.parent._needRedraw)and(self.parent._UpdateAllDList)and(self.parent.useDList) then - TaskHandler.RequestInstantUpdate(self.parent) - end + if (not (fbo and texColor and texStencil))or(not gl.IsValidFBO(fbo)) then + gl.DeleteFBO(fbo) + gl.DeleteTexture(texColor) + gl.DeleteRBO(texStencil) + self[texw] = nil + self[texh] = nil + self[texStencilName] = nil + self[texname] = nil + self[fboName] = nil + self._cantUseRTT = true + self._usingRTT = false + return + end + + EnterRTT() + self._inrtt = true + gl.ActiveFBO(fbo, true, Control._SetupRTT, self, fnc, ...) + self._inrtt = false + LeaveRTT() + + self[texname] = texColor + self[texStencilName] = texStencil + self[fboName] = fbo end --//============================================================================= + function Control:_DrawInClientArea(fnc,...) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - if (self.safeOpengl) then - local sx,sy = self:LocalToScreen(clientX,clientY) - sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) + local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - PushScissor(sx,sy,math.ceil(clientWidth),math.ceil(clientHeight)) - end + gl.PushMatrix() + gl.Translate(clientX, clientY, 0) - gl.PushMatrix() - gl.Translate(math.floor(self.x + clientX),math.floor(self.y + clientY),0) - fnc(...) - gl.PopMatrix() + local sx,sy = self:LocalToScreen(clientX,clientY) + sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) - if (self.safeOpengl) then - PopScissor() - end + if PushLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) then + fnc(...) + PopLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) + end + + gl.PopMatrix() end @@ -896,119 +1149,195 @@ function Control:_DrawChildrenInClientArea(event) self:_DrawInClientArea(self.CallChildrenInverseCheckFunc, self, self.IsChildInView, event or 'Draw') end + +function Control:_DrawChildrenInClientAreaWithoutViewCheck(event) + self:_DrawInClientArea(self.CallChildrenInverse, self, event or 'Draw') +end + + --//============================================================================= --//FIXME move resize and drag to Window class!!!! function Control:DrawBackground() - --// gets overriden by the skin/theme + --// gets overriden by the skin/theme end function Control:DrawDragGrip() - --// gets overriden by the skin/theme + --// gets overriden by the skin/theme end function Control:DrawResizeGrip() - --// gets overriden by the skin/theme + --// gets overriden by the skin/theme end function Control:DrawBorder() - --// gets overriden by the skin/theme ?????? + --// gets overriden by the skin/theme ?????? end function Control:DrawGrips() -- FIXME this thing is a hack, fix it - todo ideally make grips appear only when mouse hovering over it - local drawResizeGrip = self.resizable - local drawDragGrip = self.draggable and self.dragUseGrip - --[[if IsTweakMode() then - drawResizeGrip = drawResizeGrip or self.tweakResizable - drawDragGrip = (self.tweakDraggable and self.tweakDragUseGrip) - end--]] - - if drawResizeGrip then - self:DrawResizeGrip() - end - if drawDragGrip then - self:DrawDragGrip() - end + local drawResizeGrip = self.resizable + local drawDragGrip = self.draggable and self.dragUseGrip + --[[if IsTweakMode() then + drawResizeGrip = drawResizeGrip or self.tweakResizable + drawDragGrip = (self.tweakDraggable and self.tweakDragUseGrip) + end--]] + + if drawResizeGrip then + self:DrawResizeGrip() + end + if drawDragGrip then + self:DrawDragGrip() + end end function Control:DrawControl() - --//an option to make panel position snap to an integer - if self.snapToGrid then - self.x = math.floor(self.x) + 0.5 - self.y = math.floor(self.y) + 0.5 - end - self:DrawBackground() - self:DrawBorder() + self:DrawBackground() + self:DrawBorder() end function Control:DrawForList() - if (self._own_dlist) then - gl.CallList(self._own_dlist); - else - self:DrawControl(); - end + self._redrawCounter = (self._redrawCounter or 0) + 1 + if (not self._in_update and not self._usingRTT and self:_CheckIfRTTisAppreciated()) then self:InvalidateSelf() end + + if (self._tex_all and not self._inrtt) then + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) + gl.BlendFuncSeparate(GL.ONE, GL.SRC_ALPHA, GL.ZERO, GL.SRC_ALPHA) + gl.Color(1,1,1,1) + gl.Texture(0, self._tex_all) + gl.TexRect(0, 0, self.width, self.height) + gl.Texture(0, false) + gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) + gl.PopMatrix() + return + elseif (self._all_dlist) then + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) + gl.CallList(self._all_dlist); + gl.PopMatrix() + return + end - if (self._children_dlist) then - self:_DrawInClientArea(gl.CallList,self._children_dlist); - else - self:DrawChildrenForList(); - end + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) - if (self.DrawControlPostChildren) then - self:DrawControlPostChildren(); - end + if (self._own_dlist) then + gl.CallList(self._own_dlist) + else + if self._hasCustomDrawControl then + gl.Translate(-self.x, -self.y, 0) + self:DrawControl() + gl.Translate(self.x, self.y, 0) + else + self:DrawControl() + end + end - self:DrawGrips(); + local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) + if (clientWidth > 0)and(clientHeight > 0) then + if (self._tex_children) then + gl.BlendFuncSeparate(GL.ONE, GL.SRC_ALPHA, GL.ZERO, GL.SRC_ALPHA) + gl.Color(1,1,1,1) + gl.Texture(0, self._tex_children) + local contX,contY,contWidth,contHeight = unpack4(self.contentArea) + + local s = self.scrollPosX / contWidth + local t = 1 - self.scrollPosY / contHeight + local u = s + clientWidth / contWidth + local v = t - clientHeight / contHeight + gl.TexRect(clientX, clientY, clientX + clientWidth, clientY + clientHeight, s, t, u, v) + gl.Texture(0, false) + gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) + elseif (self._children_dlist) then + self:_DrawInClientArea(gl.CallList, self._children_dlist) + else + self:DrawChildrenForList() + end + + if (self.DrawControlPostChildren) then + self:DrawControlPostChildren() + end + end + + self:DrawGrips() + gl.PopMatrix() end function Control:Draw() - if (self._all_dlist) then - gl.CallList(self._all_dlist); - return; - end + self._redrawCounter = (self._redrawCounter or 0) + 1 + if (not self._in_update and not self._usingRTT and self:_CheckIfRTTisAppreciated()) then self:InvalidateSelf() end + + if (self._tex_all) then + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) + gl.BlendFunc(GL.ONE, GL.SRC_ALPHA) + gl.Color(1,1,1,1) + gl.Texture(0, self._tex_all) + gl.TexRect(0, 0, self.width, self.height) + gl.Texture(0, false) + gl.Blending("reset") + gl.PopMatrix() + return + elseif (self._all_dlist) then + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) + gl.CallList(self._all_dlist); + gl.PopMatrix() + return + end - if (self._own_dlist) then - gl.CallList(self._own_dlist); - else - self:DrawControl(); - end + gl.PushMatrix() + gl.Translate(self.x, self.y, 0) - if (self._children_dlist) then - self:_DrawInClientArea(gl.CallList,self._children_dlist); - else - self:DrawChildren(); - end + if (self._own_dlist) then + gl.CallList(self._own_dlist) + else + if self._hasCustomDrawControl then + gl.Translate(-self.x, -self.y, 0) + self:DrawControl() + gl.Translate(self.x, self.y, 0) + else + self:DrawControl() + end + end - if (self.DrawControlPostChildren) then - self:DrawControlPostChildren(); - end + if (self._children_dlist) then + self:_DrawInClientArea(gl.CallList, self._children_dlist) + else + self:DrawChildren(); + end - self:DrawGrips(); + if (self.DrawControlPostChildren) then + self:DrawControlPostChildren(); + end + + self:DrawGrips(); + gl.PopMatrix() end function Control:TweakDraw() - if (next(self.children)) then - self:_DrawChildrenInClientArea('TweakDraw') - end + if (next(self.children)) then + self:_DrawChildrenInClientArea('TweakDraw') + end end function Control:DrawChildren() - if (next(self.children)) then - self:_DrawChildrenInClientArea('Draw') - end + if (next(self.children)) then + self:_DrawChildrenInClientArea('Draw') + end end function Control:DrawChildrenForList() - if (next(self.children)) then - self:_DrawChildrenInClientArea('DrawForList') - end + if (next(self.children)) then + self:_DrawChildrenInClientAreaWithoutViewCheck('DrawForList') + end end --//============================================================================= @@ -1035,10 +1364,6 @@ function Control:HitTest(x,y) end end end - --//an option that allow you to mouse click on empty panel - if self.hitTestAllowEmpty then - return self - end end end @@ -1049,6 +1374,18 @@ function Control:HitTest(x,y) end end + if + self.tooltip + or (#self.OnMouseDown > 0) + or (#self.OnMouseUp > 0) + or (#self.OnClick > 0) + or (#self.OnDblClick > 0) + or (#self.OnMouseMove > 0) + or (#self.OnMouseWheel > 0) + then + return self + end + return false end @@ -1091,7 +1428,7 @@ function Control:MouseMove(x, y, dx, dy, ...) local deltaMousePosY = y - oldState.mouse[2] local w = math.max( - self.minWidth, + self.minWidth, oldState.size[1] + deltaMousePosX ) local h = math.max( @@ -1112,6 +1449,23 @@ function Control:MouseMove(x, y, dx, dy, ...) end end + -- fixes resizing components that have a right or bottom bound + if self._relativeBounds.right ~= nil and type(self._relativeBounds.right) == "number" then + local deltaW = w - self.width + self._relativeBounds.right = self._relativeBounds.right - deltaW + if self._relativeBounds.right < 0 then + w = w + self._relativeBounds.right + self._relativeBounds.right = 0 + end + end + if self._relativeBounds.bottom ~= nil and type(self._relativeBounds.bottom) == "number" then + local deltaH = h - self.height + self._relativeBounds.bottom = self._relativeBounds.bottom - deltaH + if self._relativeBounds.bottom < 0 then + h = h + self._relativeBounds.bottom + self._relativeBounds.bottom = 0 + end + end self:SetPos(nil,nil,w,h) return self end @@ -1146,13 +1500,20 @@ function Control:MouseWheel(x, y, ...) return inherited.MouseWheel(self, cx, cy, ...) end - +--[[ function Control:KeyPress(...) return inherited.KeyPress(self, ...) end +function Control:TextInput(...) + return inherited.TextInput(self, ...) +end +--]] + + function Control:FocusUpdate(...) + self:InvalidateSelf() return inherited.FocusUpdate(self, ...) end @@ -1160,14 +1521,14 @@ end function Control:MouseOver(...) inherited.MouseOver(self, ...) self.state.hovered = true - self:Invalidate() + self:InvalidateSelf() end function Control:MouseOut(...) inherited.MouseOut(self, ...) self.state.hovered = false - self:Invalidate() + self:InvalidateSelf() end --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/editbox.lua b/LuaUI/Widgets_Evo/chili/controls/editbox.lua index 9deb973a8..8c79b1b2a 100644 --- a/LuaUI/Widgets_Evo/chili/controls/editbox.lua +++ b/LuaUI/Widgets_Evo/chili/controls/editbox.lua @@ -1,6 +1,19 @@ --//============================================================================= -include("keysym.h.lua") +--- EditBox module + +--- EditBox fields. +-- Inherits from Control. +-- @see control.Control +-- @table EditBox +-- @tparam {r,g,b,a} cursorColor cursor color, (default {0,0,1,0.7}) +-- @tparam {r,g,b,a} selectionColor selection color, (default {0,1,1,0.3}) +-- @string[opt="left"] align alignment +-- @string[opt="linecenter"] valign vertical alignment +-- @string[opt=""] text text contained in the editbox +-- @string[opt=""] hint hint to be displayed when there is no text and the control isn't focused +-- @int[opt=1] cursor cursor position +-- @bool passwordInput specifies whether the text should be treated as a password EditBox = Control:Inherit{ classname= "editbox", @@ -10,14 +23,26 @@ EditBox = Control:Inherit{ padding = {3,3,3,3}, cursorColor = {0,0,1,0.7}, + selectionColor = {0,1,1,0.3}, align = "left", valign = "linecenter", + hintFont = table.merge({ color = {1,1,1,0.7} }, Control.font), + text = "", + hint = "", cursor = 1, offset = 1, + selStart = nil, + selEnd = nil, + + allowUnicode = true, + passwordInput = false, } +if Script.IsEngineMinVersion == nil or not Script.IsEngineMinVersion(97) then + EditBox.allowUnicode = false +end local this = EditBox local inherited = this.inherited @@ -27,22 +52,34 @@ local inherited = this.inherited function EditBox:New(obj) obj = inherited.New(self,obj) obj._interactedTime = Spring.GetTimer() + --// create font + obj.hintFont = Font:New(obj.hintFont) + obj.hintFont:SetParent(obj) obj:SetText(obj.text) obj:RequestUpdate() return obj end +function EditBox:Dispose(...) + Control.Dispose(self) + self.hintFont:SetParent() +end + function EditBox:HitTest(x,y) return self end --//============================================================================= +--- Sets the EditBox text +-- @string newtext text to be set function EditBox:SetText(newtext) if (self.text == newtext) then return end self.text = newtext self.cursor = 1 self.offset = 1 + self.selStart = nil + self.selEnd = nil self:UpdateLayout() self:Invalidate() end @@ -105,75 +142,227 @@ function EditBox:Update(...) end end +function EditBox:_SetCursorByMousePos(x, y) + local clientX = self.clientArea[1] + if x - clientX < 0 then + self.offset = self.offset - 1 + self.offset = math.max(0, self.offset) + self.cursor = self.offset + 1 + else + local text = self.text + -- properly accounts for passworded text where characters are represented as "*" + -- TODO: what if the passworded text is displayed differently? this is using assumptions about the skin + if #text > 0 and self.passwordInput then + text = string.rep("*", #text) + end + self.cursor = #text + 1 -- at end of text + for i = self.offset, #text do + local tmp = text:sub(self.offset, i) + if self.font:GetTextWidth(tmp) > (x - clientX) then + self.cursor = i + break + end + end + end +end function EditBox:MouseDown(x, y, ...) - local clientX = self.clientArea[1] - self.cursor = #self.text + 1 -- at end of text - for i = self.offset, #self.text do - local tmp = self.text:sub(self.offset, i) - if self.font:GetTextWidth(tmp) > (x - clientX) then - self.cursor = i - break + local _, _, _, shift = Spring.GetModKeyState() + local cp = self.cursor + self:_SetCursorByMousePos(x, y) + if shift then + if not self.selStart then + self.selStart = cp end + self.selEnd = self.cursor + elseif self.selStart then + self.selStart = nil + self.selEnd = nil end + self._interactedTime = Spring.GetTimer() inherited.MouseDown(self, x, y, ...) self:Invalidate() return self end +function EditBox:MouseMove(x, y, dx, dy, button) + if button ~= 1 then + return inherited.MouseMove(self, x, y, dx, dy, button) + end + + local _, _, _, shift = Spring.GetModKeyState() + local cp = self.cursor + self:_SetCursorByMousePos(x, y) + if not self.selStart then + self.selStart = cp + end + self.selEnd = self.cursor + + self._interactedTime = Spring.GetTimer() + inherited.MouseMove(self, x, y, dx, dy, button) + self:Invalidate() + return self +end + function EditBox:MouseUp(...) inherited.MouseUp(self, ...) self:Invalidate() return self end +function EditBox:ClearSelected() + local left = self.selStart + local right = self.selEnd + if left > right then + left, right = right, left + end + self.cursor = right + local i = 0 + while self.cursor ~= left do + self.text, self.cursor = Utf8BackspaceAt(self.text, self.cursor) + i = i + 1 + if i > 100 then + break + end + end + self.selStart = nil + self.selEnd = nil + self:Invalidate() +end + + function EditBox:KeyPress(key, mods, isRepeat, label, unicode, ...) local cp = self.cursor local txt = self.text - if key == KEYSYMS.RETURN then - return false - elseif key == KEYSYMS.BACKSPACE then - if #txt > 0 and cp > 1 then - self.cursor = cp - 1 - self.text = txt:sub(1, cp - 2) .. txt:sub(cp, #txt) + + -- enter & return + if key == Spring.GetKeyCode("enter") or key == Spring.GetKeyCode("numpad_enter") then + return inherited.KeyPress(self, key, mods, isRepeat, label, unicode, ...) or true + + -- deletions + elseif key == Spring.GetKeyCode("backspace") then + if self.selStart == nil then + if mods.ctrl then + repeat + self.text, self.cursor = Utf8BackspaceAt(self.text, self.cursor) + until self.cursor == 1 or (self.text:sub(self.cursor-2, self.cursor-2) ~= " " and self.text:sub(self.cursor-1, self.cursor-1) == " ") + else + self.text, self.cursor = Utf8BackspaceAt(self.text, self.cursor) + end + else + self:ClearSelected() end - elseif key == KEYSYMS.DELETE then - if #txt > 0 and cp <= #txt then - self.text = txt:sub(1, cp - 1) .. txt:sub(cp + 1, #txt) + elseif key == Spring.GetKeyCode("delete") then + if self.selStart == nil then + if mods.ctrl then + repeat + self.text = Utf8DeleteAt(self.text, self.cursor) + until self.cursor >= #self.text-1 or (self.text:sub(self.cursor, self.cursor) == " " and self.text:sub(self.cursor+1, self.cursor+1) ~= " ") + else + self.text = Utf8DeleteAt(txt, cp) + end + else + self:ClearSelected() end - elseif key == KEYSYMS.LEFT then - if cp > 1 then - self.cursor = cp - 1 + + -- cursor movement + elseif key == Spring.GetKeyCode("left") then + if mods.ctrl then + repeat + self.cursor = Utf8PrevChar(txt, self.cursor) + until self.cursor == 1 or (txt:sub(self.cursor-1, self.cursor-1) ~= " " and txt:sub(self.cursor, self.cursor) == " ") + else + self.cursor = Utf8PrevChar(txt, cp) end - elseif key == KEYSYMS.RIGHT then - if cp <= #txt then - self.cursor = cp + 1 + elseif key == Spring.GetKeyCode("right") then + if mods.ctrl then + repeat + self.cursor = Utf8NextChar(txt, self.cursor) + until self.cursor >= #txt-1 or (txt:sub(self.cursor-1, self.cursor-1) == " " and txt:sub(self.cursor, self.cursor) ~= " ") + else + self.cursor = Utf8NextChar(txt, cp) end - elseif key == KEYSYMS.HOME then + elseif key == Spring.GetKeyCode("home") then self.cursor = 1 - elseif key == KEYSYMS.END then + elseif key == Spring.GetKeyCode("end") then self.cursor = #txt + 1 - else - local char = nil - local success, char = pcall(string.char, unicode) + + -- copy & paste + elseif mods.ctrl and (key == Spring.GetKeyCode("c") or key == Spring.GetKeyCode("x")) then + local s = self.selStart + local e = self.selEnd + if s and e then + s,e = math.min(s,e), math.max(s,e) + Spring.SetClipboard(txt:sub(s,e-1)) + end + if key == Spring.GetKeyCode("x") and self.selStart ~= nil then + self:ClearSelected() + end + elseif mods.ctrl and key == Spring.GetKeyCode("v") then + self:TextInput(Spring.GetClipboard()) + + -- select all + elseif mods.ctrl and key == Spring.GetKeyCode("a") then + self.selStart = 1 + self.selEnd = #txt + 1 + -- character input + elseif unicode and unicode ~= 0 then + -- backward compability with Spring <97 + self:TextInput(unicode) + end + + -- text selection handling + if key == Spring.GetKeyCode("left") or key == Spring.GetKeyCode("right") or key == Spring.GetKeyCode("home") or key == Spring.GetKeyCode("end") then + if mods.shift then + if not self.selStart then + self.selStart = cp + end + self.selEnd = self.cursor + elseif self.selStart then + self.selStart = nil + self.selEnd = nil + end + end + + self._interactedTime = Spring.GetTimer() + inherited.KeyPress(self, key, mods, isRepeat, label, unicode, ...) + self:UpdateLayout() + self:Invalidate() + return self +end + + +function EditBox:TextInput(utf8char, ...) + local unicode = utf8char + if (not self.allowUnicode) then + local success + success, unicode = pcall(string.char, utf8char) if success then - success = not char:find("%c") + success = not unicode:find("%c") end if not success then - char = nil + unicode = nil end - if char then - self.text = txt:sub(1, cp - 1) .. char .. txt:sub(cp, #txt) - self.cursor = cp + 1 - else - return false + end + + if unicode then + local cp = self.cursor + local txt = self.text + if self.selStart ~= nil then + self:ClearSelected() + txt = self.text + cp = self.cursor end + self.text = txt:sub(1, cp - 1) .. unicode .. txt:sub(cp, #txt) + self.cursor = cp + unicode:len() end + self._interactedTime = Spring.GetTimer() - inherited.KeyPress(self, key, mods, isRepeat, label, unicode, ...) + inherited.TextInput(self, utf8char, ...) self:UpdateLayout() self:Invalidate() return self end + --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/font.lua b/LuaUI/Widgets_Evo/chili/controls/font.lua index 4094e3eec..f8cfcf4aa 100644 --- a/LuaUI/Widgets_Evo/chili/controls/font.lua +++ b/LuaUI/Widgets_Evo/chili/controls/font.lua @@ -1,9 +1,26 @@ --//============================================================================= +--- Font module + +--- Font fields +-- Inherits from Control. +-- @see control.Control +-- @table Font +-- @string[opt="FreeSansBold.otf"] font font name +-- @int[opt=12] size font size +-- @bool[opt=false] shadow shadow enabled +-- @bool[opt=false] outline outline enabled +-- @tparam {r,g,b,a} color color table (default {1,1,1,1}) +-- @tparam {r,g,b,a} outlineColor outlineColor table (default {0,0,0,1}) +-- @bool[opt=true] autoOutlineColor ?? + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + Font = Object:Inherit{ classname = 'font', - font = "FreeSansBold.otf", + font = fontfile, size = 12, outlineWidth = 3, outlineWeight = 3, @@ -32,7 +49,7 @@ end function Font:Dispose(...) if (not self.disposed) then - FontHandler.UnloadFont(self._font) + FontHandler.UnloadFont(self._font) end inherited.Dispose(self,...) end @@ -41,7 +58,8 @@ end function Font:_LoadFont() local oldfont = self._font - self._font = FontHandler.LoadFont(self.font,self.size,self.outlineWidth,self.outlineWeight) + local uiScale = (WG and WG.uiScale or 1) + self._font = FontHandler.LoadFont(self.font,math.floor(self.size*uiScale),math.floor(self.outlineWidth*uiScale),self.outlineWeight) --// do this after LoadFont because it can happen that LoadFont returns the same font again --// but if we Unload our old one before, the gc could collect it before, so the engine would have to reload it again FontHandler.UnloadFont(oldfont) @@ -117,11 +135,11 @@ do if (recreateFont) then self:_LoadFont() if (p) then - p:RequestRealign() + p:RequestRealign() end else if (p)and NotEqual(oldValue, self[param]) then - p:Invalidate() + p:Invalidate() end end end @@ -164,6 +182,14 @@ end function Font:AdjustPosToAlignment(x, y, width, height, align, valign) local extra = '' + if self.shadow then + width = width - 1 - self.size * 0.1 + height = height - 1 - self.size * 0.1 + elseif self.outline then + width = width - 1 - self.outlineWidth + height = height - 1 - self.outlineWidth + end + --// vertical alignment if valign == "center" then y = y + height/2 @@ -181,7 +207,7 @@ function Font:AdjustPosToAlignment(x, y, width, height, align, valign) extra = 'a' end --FIXME add baseline 'd' - + --// horizontal alignment if align == "left" then --do nothing @@ -225,13 +251,31 @@ end --//============================================================================= +function Font:_DrawText(text, x, y, extra) + local font = self._font + + gl.PushAttrib(GL.COLOR_BUFFER_BIT) + gl.PushMatrix() + gl.Scale(1,-1,1) + font:Begin() + if AreInRTT() then + gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE_MINUS_SRC_ALPHA) + end + font:SetTextColor(self.color) + font:SetOutlineColor(self.outlineColor) + font:SetAutoOutlineColor(self.autoOutlineColor) + font:Print(text, x, -y, self.size, extra) + font:End() + gl.PopMatrix() + gl.PopAttrib() +end + + function Font:Draw(text, x, y, align, valign) if (not text) then return end - local font = self._font - local extra = _GetExtra(align, valign) if self.outline then extra = extra .. 'o' @@ -239,15 +283,7 @@ function Font:Draw(text, x, y, align, valign) extra = extra .. 's' end - gl.PushMatrix() - gl.Scale(1,-1,1) - font:Begin() - font:SetTextColor(self.color) - font:SetOutlineColor(self.outlineColor) - font:SetAutoOutlineColor(self.autoOutlineColor) - font:Print(text, x, -y, self.size, extra) - font:End() - gl.PopMatrix() + self:_DrawText(text, x, y, extra) end @@ -256,10 +292,8 @@ function Font:DrawInBox(text, x, y, w, h, align, valign) return end - local font = self._font - local x,y,extra = self:AdjustPosToAlignment(x, y, w, h, align, valign) - + if self.outline then extra = extra .. 'o' elseif self.shadow then @@ -268,15 +302,7 @@ function Font:DrawInBox(text, x, y, w, h, align, valign) y = y + 1 --// FIXME: if this isn't done some chars as 'R' get truncated at the top - gl.PushMatrix() - gl.Scale(1,-1,1) - font:Begin() - font:SetTextColor(self.color) - font:SetOutlineColor(self.outlineColor) - font:SetAutoOutlineColor(self.autoOutlineColor) - font:Print(text, x, -y, self.size, extra) - font:End() - gl.PopMatrix() + self:_DrawText(text, x, y, extra) end Font.Print = Font.Draw diff --git a/LuaUI/Widgets_Evo/chili/controls/grid.lua b/LuaUI/Widgets_Evo/chili/controls/grid.lua index ad95bdb22..4a1f133e1 100644 --- a/LuaUI/Widgets_Evo/chili/controls/grid.lua +++ b/LuaUI/Widgets_Evo/chili/controls/grid.lua @@ -1,3 +1,9 @@ +--- Grid module + +--- Grid fields. +-- Inherits from LayoutPanel. +-- @see layoutpanel.LayoutPanel +-- @table Grid Grid = LayoutPanel:Inherit{ classname = "grid", resizeItems = true, @@ -5,4 +11,4 @@ Grid = LayoutPanel:Inherit{ } local this = Grid -local inherited = this.inherited \ No newline at end of file +local inherited = this.inherited diff --git a/LuaUI/Widgets_Evo/chili/controls/image.lua b/LuaUI/Widgets_Evo/chili/controls/image.lua index 6c77ee383..a8538b43d 100644 --- a/LuaUI/Widgets_Evo/chili/controls/image.lua +++ b/LuaUI/Widgets_Evo/chili/controls/image.lua @@ -1,5 +1,15 @@ --//============================================================================= +--- Image module + +--- Image fields. +-- Inherits from Control. +-- @see button.Button +-- @table Image +-- @tparam {r,g,b,a} color color, (default {1,1,1,1}) +-- @string[opt=nil] file path +-- @bool[opt=true] keepAspect aspect should be kept +-- @tparam {func1,func2} OnClick function listeners to be invoked on click (default {}) Image = Button:Inherit{ classname= "image", @@ -16,6 +26,8 @@ Image = Button:Inherit{ keepAspect = true; + useRTT = false; + OnClick = {}, } @@ -53,26 +65,26 @@ function Image:DrawControl() gl.Color(self.color) if (self.keepAspect) then - if (self.file2) then + if (self.file2) then TextureHandler.LoadTexture(0,self.file2,self) local texInfo = gl.TextureInfo(self.file2) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.x,self.y,self.width,self.height, tw,th, self.flip2) - end - if (self.file) then + _DrawTextureAspect(0,0,self.width,self.height, tw,th, self.flip2) + end + if (self.file) then TextureHandler.LoadTexture(0,self.file,self) local texInfo = gl.TextureInfo(self.file) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.x,self.y,self.width,self.height, tw,th, self.flip) + _DrawTextureAspect(0,0,self.width,self.height, tw,th, self.flip) end else - if (self.file2) then + if (self.file2) then TextureHandler.LoadTexture(0,self.file2,self) - gl.TexRect(self.x,self.y,self.x+self.width,self.y+self.height,false,self.flip2) - end - if (self.file) then + gl.TexRect(0,0,self.width,self.height,false,self.flip2) + end + if (self.file) then TextureHandler.LoadTexture(0,self.file,self) - gl.TexRect(self.x,self.y,self.x+self.width,self.y+self.height,false,self.flip) + gl.TexRect(0,0,self.width,self.height,false,self.flip) end end gl.Texture(0,false) diff --git a/LuaUI/Widgets_Evo/chili/controls/imagelistview.lua b/LuaUI/Widgets_Evo/chili/controls/imagelistview.lua index 44c5aedf6..9a6f70a18 100644 --- a/LuaUI/Widgets_Evo/chili/controls/imagelistview.lua +++ b/LuaUI/Widgets_Evo/chili/controls/imagelistview.lua @@ -1,5 +1,13 @@ --//============================================================================= +--- ImageListView module + +--- ImageListView fields. +-- Inherits from LayoutPanel. +-- @see layoutpanel.LayoutPanel +-- @table ImageListView +-- @string[opt=""] dir initial directory +-- @tparam {func1,func2,...} OnDirChange table of function listeners for directory change (default {}) ImageListView = LayoutPanel:Inherit{ classname = "imagelistview", @@ -21,6 +29,8 @@ ImageListView = LayoutPanel:Inherit{ dir = '', + useRTT = false; + OnDirChange = {}, } @@ -108,6 +118,7 @@ function ImageListView:_AddFile(name,imagefile) itemMargin = {0,0,0,0}, rows = 2, columns = 1, + useRTT = false; children = { Image:New{ @@ -140,6 +151,7 @@ function ImageListView:ScanDir() end end + self._dirsNum = #dirs self._dirList = dirs @@ -184,7 +196,6 @@ function ImageListView:SetDir(directory) self:DeselectAll() self.dir = directory self:ScanDir() - self:CallListeners(self.OnDirChange, directory) if (self.parent) then @@ -196,6 +207,11 @@ function ImageListView:SetDir(directory) end +function ImageListView:GoToParentDir() + self:SetDir(GetParentDir(self.dir)) +end + + function ImageListView:GotoFile(filepath) local dir = ExtractDir(filepath) local file = ExtractFileName(filepath) diff --git a/LuaUI/Widgets_Evo/chili/controls/label.lua b/LuaUI/Widgets_Evo/chili/controls/label.lua index 76de41a8c..0b913743e 100644 --- a/LuaUI/Widgets_Evo/chili/controls/label.lua +++ b/LuaUI/Widgets_Evo/chili/controls/label.lua @@ -1,5 +1,14 @@ --//============================================================================= +--- Label module + +--- Label fields. +-- Inherits from Control. +-- @see control.Control +-- @table Label +-- @string[opt="left"] align alignment +-- @string[opt="linecenter"] valign vertical alignment +-- @string[opt="no text"] caption text to be displayed Label = Control:Inherit{ classname= "label", @@ -9,7 +18,7 @@ Label = Control:Inherit{ padding = {0,0,0,0}, autosize = true, - autoObeyLineHeight = true, --// (needs autosize) if true, autosize will obey the lineHeight (-> texts with the same line count will have the same height) + autoObeyLineHeight = true, --// (needs autosize) if true, autosize will obey the lineHeight (-> texts with the same line count will have the same height) align = "left", valign = "linecenter", --// usefull too "ascender" @@ -29,6 +38,8 @@ end --//============================================================================= +--- Set the label caption +-- @string newcaption new caption to be set function Label:SetCaption(newcaption) if (self.caption == newcaption) then return end self.caption = newcaption @@ -52,6 +63,14 @@ function Label:UpdateLayout() h = math.ceil(h-d) end + if font.shadow then + w = w + 2 + font.size * 0.1 + h = h + 2 + font.size * 0.1 + elseif font.outline then + w = w + 2 + font.size * font.outlineWidth + h = h + 2 + font.size * font.outlineWidth + end + local x = self.x local y = self.y @@ -81,13 +100,13 @@ end function Label:DrawControl() local font = self.font - font:DrawInBox(self._caption,self.x,self.y,self.width,self.height,self.align,self.valign) + font:DrawInBox(self._caption,0,0,self.width,self.height,self.align,self.valign) if (self.debug) then gl.Color(0,1,0,0.5) gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) gl.LineWidth(2) - gl.Rect(self.x,self.y,self.x+self.width,self.y+self.height) + gl.Rect(0,0,self.width,self.height) gl.LineWidth(1) gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) end diff --git a/LuaUI/Widgets_Evo/chili/controls/line.lua b/LuaUI/Widgets_Evo/chili/controls/line.lua index a54f6379e..c281430f7 100644 --- a/LuaUI/Widgets_Evo/chili/controls/line.lua +++ b/LuaUI/Widgets_Evo/chili/controls/line.lua @@ -1,5 +1,13 @@ --//============================================================================= +--- Line module + +--- Line fields. +-- Inherits from Control. +-- @see control.Control +-- @table Line +-- @string[opt="line"] caption text to be displayed on the line(?) +-- @string[opt="horizontal] style style of the line Line = Control:Inherit{ classname= "line", caption = 'line', @@ -11,4 +19,4 @@ Line = Control:Inherit{ local this = Line local inherited = this.inherited ---//============================================================================= \ No newline at end of file +--//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/multiprogressbar.lua b/LuaUI/Widgets_Evo/chili/controls/multiprogressbar.lua index e796dac4d..e1d5f4265 100644 --- a/LuaUI/Widgets_Evo/chili/controls/multiprogressbar.lua +++ b/LuaUI/Widgets_Evo/chili/controls/multiprogressbar.lua @@ -1,21 +1,32 @@ --//============================================================================= +--- Multiprogressbar module + +--- Multiprogressbar fields. +-- Inherits from Control. +-- @see control.Control +-- @table Multiprogressbar +-- @bool[opt=false] drawBorder should the border be drawn? +-- @tparam {r,g,b,a} borderColor specifies the border color (default: {1,0,0,1}) +-- @string[opt="horizontal"] orientation orientation of the progress bar +-- @bool[opt=false] reverse reverse drawing orientation +-- @tparam fnc scaleFunction scaling function that takes 0-1 and must return 0-1 Multiprogressbar = Control:Inherit{ classname = "multiprogressbar", defaultWidth = 90, defaultHeight = 20, - - padding = {0,0,0,0}, + + padding = {0,0,0,0}, drawBorder = false, borderColor = {1,0,0,1}, - orientation = "horizontal", - reverse = false, -- draw in reversed orientation - - scaleFunction = nil, --- function that can be used to rescale graph - takes 0-1 and must return 0-1 + orientation = "horizontal", + reverse = false, -- draw in reversed orientation + + scaleFunction = nil, --- function that can be used to rescale graph - takes 0-1 and must return 0-1 - - bars = { -- list of bar components to display + -- list of bar components to display + bars = { { color1 = {1,0,1,1}, color2 = {0.7,0,0.7,1}, @@ -25,7 +36,7 @@ Multiprogressbar = Control:Inherit{ t = 1, tileSize = nil, -- if set then main axis texture coord = width / tileSize }, - + } } @@ -38,23 +49,23 @@ local glVertex = gl.Vertex local glColor = gl.Color local glBeginEnd = gl.BeginEnd -local function drawBox(x,y,w,h) +local function drawBox(x,y,w,h) glVertex(x,y) glVertex(x+w,y) glVertex(x+w,y+h) glVertex(x,y+h) -end +end -local function drawBarH(x,y,w,h,color1, color2) +local function drawBarH(x,y,w,h,color1, color2) glColor(color1) glVertex(x,y) glVertex(x+w,y) glColor(color2) glVertex(x+w,y+h) glVertex(x,y+h) -end +end -local function drawBarV(x,y,w,h,color1, color2) +local function drawBarV(x,y,w,h,color1, color2) glColor(color1) glVertex(x,y) glVertex(x,y+h) @@ -66,85 +77,87 @@ end function Multiprogressbar:DrawControl() local percentDone = 0 - local efp - + local efp + if (self.scaleFunction ~= nil) then -- if using non linear scale fix the bar local totalPercent = 0 - for _,b in ipairs(self.bars) do + for _,b in ipairs(self.bars) do totalPercent = totalPercent + (b.percent or 0) - end - + end + local resize = self.scaleFunction(totalPercent) / totalPercent - for _,b in ipairs(self.bars) do + for _,b in ipairs(self.bars) do b._drawPercent = b.percent * resize - end - else - for _,b in ipairs(self.bars) do + end + else + for _,b in ipairs(self.bars) do b._drawPercent = b.percent - end - end + end + end + - - if (self.orientation=="horizontal") then - for _,b in ipairs(self.bars) do + if (self.orientation=="horizontal") then + for _,b in ipairs(self.bars) do if b._drawPercent > 0 then - if (self.reverse) then + if (self.reverse) then efp = 1 - percentDone - b._drawPercent - else + else efp = percentDone - end - if (b.color1 ~= nil) then glBeginEnd(GL.QUADS, drawBarH, self.x + efp * self.width,self.y, self.width * b._drawPercent, self.height, b.color1, b.color2) end + end + if (b.color1 ~= nil) then + glBeginEnd(GL.QUADS, drawBarH, efp * self.width, 0, self.width * b._drawPercent, self.height, b.color1, b.color2) + end percentDone = percentDone + b._drawPercent - - if b.texture then - TextureHandler.LoadTexture(b.texture,self) + + if b.texture then + TextureHandler.LoadTexture(b.texture,self) glColor(1,1,1,1) - + local bs = b.s - if (b.tileSize) then + if (b.tileSize) then bs = self.width * b._drawPercent / b.tileSize - end - gl.TexRect(self.x + efp * self.width,self.y, self.x + (efp + b._drawPercent) * self.width, self.y + self.height, 0,0,bs,b.t) - gl.Texture(false) - end - end - end - - else - for _,b in ipairs(self.bars) do - if b._drawPercent > 0 then - if (self.reverse) then + end + gl.TexRect(efp * self.width, 0, (efp + b._drawPercent) * self.width, self.height, 0,0,bs,b.t) + gl.Texture(false) + end + end + end + + else + for _,b in ipairs(self.bars) do + if b._drawPercent > 0 then + if (self.reverse) then efp = 1 - percentDone - b._drawPercent - else + else efp = percentDone - end - - if (b.color1 ~= nil) then glBeginEnd(GL.QUADS, drawBarV, self.x,self.y + efp * self.height, self.width, self.height * b._drawPercent, b.color1, b.color2) end - + end + + if (b.color1 ~= nil) then glBeginEnd(GL.QUADS, drawBarV, 0, efp * self.height, self.width, self.height * b._drawPercent, b.color1, b.color2) end + percentDone = percentDone + b._drawPercent - - if b.texture then + + if b.texture then TextureHandler.LoadTexture(b.texture,self) glColor(1,1,1,1) - + local bt = b.t - if (b.tileSize) then + if (b.tileSize) then bt = self.height * b._drawPercent / b.tileSize - end - gl.TexRect(self.x, self.y + efp * self.height, self.x + self.width, self.y + (efp + b._drawPercent) * self.height, 0,0,b.s,bt) + end + gl.TexRect(0, efp * self.height, self.width, (efp + b._drawPercent) * self.height, 0,0,b.s,bt) gl.Texture(false) - end + end end - end - end + end + end + + - - if self.drawBorder then glColor(self.borderColor) - glBeginEnd(GL.LINE_LOOP, drawBox, self.x, self.y, self.width, self.height) - end + glBeginEnd(GL.LINE_LOOP, drawBox, 0, 0, self.width, self.height) + end end diff --git a/LuaUI/Widgets_Evo/chili/controls/object.lua b/LuaUI/Widgets_Evo/chili/controls/object.lua index 338a1cabc..7c890c5f0 100644 --- a/LuaUI/Widgets_Evo/chili/controls/object.lua +++ b/LuaUI/Widgets_Evo/chili/controls/object.lua @@ -1,5 +1,25 @@ --//============================================================================= +--- Object module + +--- Object fields. +-- @table Object +-- @bool[opt=true] visible control is displayed +-- @tparam {Object1,Object2,...} children table of visible children objects (default {}) +-- @tparam {Object1,Object2,...} children_hidden table of invisible children objects (default {}) +-- @tparam {"obj1Name"=Object1,"obj2Name"=Object2,...} childrenByName table mapping name->child +-- @tparam {func1,func2,...} OnDispose function listeners for object disposal, (default {}) +-- @tparam {func1,func2,...} OnClick function listeners for mouse click, (default {}) +-- @tparam {func1,func2,...} OnDblClick function listeners for mouse double click, (default {}) +-- @tparam {func1,func2,...} OnMouseDown function listeners for mouse press, (default {}) +-- @tparam {func1,func2,...} OnMouseUp function listeners for mouse release, (default {}) +-- @tparam {func1,func2,...} OnMouseMove function listeners for mouse movement, (default {}) +-- @tparam {func1,func2,...} OnMouseWheel function listeners for mouse scrolling, (default {}) +-- @tparam {func1,func2,...} OnMouseOver function listeners for mouse over...?, (default {}) +-- @tparam {func1,func2,...} OnMouseOut function listeners for mouse leaving the object, (default {}) +-- @tparam {func1,func2,...} OnKeyPress function listeners for key press, (default {}) +-- @tparam {func1,func2,...} OnFocusUpdate function listeners for focus change, (default {}) +-- @bool[opt=false] disableChildrenHitTest if set childrens are not clickable/draggable etc - their mouse events are not processed Object = { classname = 'object', --x = 0, @@ -28,10 +48,13 @@ Object = { OnMouseOver = {}, OnMouseOut = {}, OnKeyPress = {}, + OnTextInput = {}, OnFocusUpdate = {}, + OnHide = {}, + OnShow = {}, disableChildrenHitTest = false, --// if set childrens are not clickable/draggable etc - their mouse events are not processed -} +} do local __lowerkeys = {} @@ -58,6 +81,8 @@ end --//============================================================================= +--- Object constructor +-- @tparam Object obj the object table function Object:New(obj) obj = obj or {} @@ -87,7 +112,7 @@ function Object:New(obj) ot = "table"; end if (ot ~= "table")and(ot ~= "metatable") then - Spring.Echo("Chili: " .. obj.name .. ": Wrong param type given to " .. i .. ": got " .. ot .. " expected table.") + Spring.Log("Chili", "error", obj.name .. ": Wrong param type given to " .. i .. ": got " .. ot .. " expected table.") obj[i] = {} end @@ -126,9 +151,10 @@ function Object:New(obj) end --- calling this releases unmanaged resources like display lists and disposes of the object --- children are disposed too --- todo: use scream, in case the user forgets +--- Disposes of the object. +-- Calling this releases unmanaged resources like display lists and disposes of the object. +-- Children are disposed too. +-- TODO: use scream, in case the user forgets. -- nil -> nil function Object:Dispose(_internal) if (not self.disposed) then @@ -139,7 +165,7 @@ function Object:Dispose(_internal) local hlinks_cnt = table.size(self._hlinks) local i,v = next(self._hlinks) if hlinks_cnt > 1 or (v ~= self) then --// check if user called Dispose() directly - Spring.Echo(("Chili: tried to dispose \"%s\"! It's still referenced %i times!"):format(self.name, hlinks_cnt)) + Spring.Log("Chili", "error", ("Tried to dispose \"%s\"! It's still referenced %i times!"):format(self.name, hlinks_cnt)) end end end @@ -196,11 +222,19 @@ function Object:Inherit(class) --setmetatable(class,{__index=self}) + --// backward compability with old DrawControl gl state (change was done with v2.1) + local w = DebugHandler.GetWidgetOrigin() + if (w ~= widget)and(w ~= Chili) then + class._hasCustomDrawControl = true + end + return class end --//============================================================================= +--- Sets the parent object +-- @tparam Object obj parent object function Object:SetParent(obj) obj = UnlinkSafe(obj) local typ = type(obj) @@ -215,12 +249,13 @@ function Object:SetParent(obj) self:Invalidate() end - +--- Adds the child object +-- @tparam Object obj child object to be added function Object:AddChild(obj, dontUpdate) local objDirect = UnlinkSafe(obj) if (self.children[objDirect]) then - Spring.Echo(("Chili: tried to add multiple times \"%s\" to \"%s\"!"):format(obj.name, self.name)) + Spring.Log("Chili", "error", ("Tried to add multiple times \"%s\" to \"%s\"!"):format(obj.name, self.name)) return end @@ -248,6 +283,8 @@ function Object:AddChild(obj, dontUpdate) end +--- Removes the child object +-- @tparam Object child child object to be removed function Object:RemoveChild(child) if not isindexable(child) then return child @@ -303,7 +340,7 @@ function Object:RemoveChild(child) return false end - +--- Removes all children function Object:ClearChildren() --// make it faster local old = self.preserveChildrenOrder @@ -322,27 +359,30 @@ function Object:ClearChildren() self.preserveChildrenOrder = old end - +--- Specifies whether the object has any visible children +-- @treturn bool function Object:IsEmpty() return (not self.children[1]) end --//============================================================================= +--- Hides a specific child +-- @tparam Object obj child to be hidden function Object:HideChild(obj) --FIXME cause of performance reasons it would be usefull to use the direct object, but then we need to cache the link somewhere to avoid the auto calling of dispose local objDirect = UnlinkSafe(obj) if (not self.children[objDirect]) then --if (self.debug) then - Spring.Echo("Chili: tried to hide a non-child (".. (obj.name or "") ..")") + Spring.Log("Chili", "error", "Tried to hide a non-child (".. (obj.name or "") ..")") --end return end if (self.children_hidden[objDirect]) then --if (self.debug) then - Spring.Echo("Chili: tried to hide the same child multiple times (".. (obj.name or "") ..")") + Spring.Log("Chili", "error", "Tried to hide the same child multiple times (".. (obj.name or "") ..")") --end return end @@ -364,21 +404,22 @@ function Object:HideChild(obj) obj.parent = self end - +--- Makes a specific child visible +-- @tparam Object obj child to be made visible function Object:ShowChild(obj) --FIXME cause of performance reasons it would be usefull to use the direct object, but then we need to cache the link somewhere to avoid the auto calling of dispose local objDirect = UnlinkSafe(obj) if (not self.children_hidden[objDirect]) then --if (self.debug) then - Spring.Echo("Chili: tried to show a non-child (".. (obj.name or "") ..")") + Spring.Log("Chili", "error", "Tried to show a non-child (".. (obj.name or "") ..")") --end return end if (self.children[objDirect]) then --if (self.debug) then - Spring.Echo("Chili: tried to show the same child multiple times (".. (obj.name or "") ..")") + Spring.Log("Chili", "error", "Tried to show the same child multiple times (".. (obj.name or "") ..")") --end return end @@ -404,7 +445,8 @@ function Object:ShowChild(obj) return true end - +--- Sets the visibility of the object +-- @bool visible visibility status function Object:SetVisibility(visible) if (visible) then self.parent:ShowChild(self) @@ -415,17 +457,25 @@ function Object:SetVisibility(visible) self.hidden = not visible end - +--- Hides the objects function Object:Hide() + local wasHidden = self.hidden self:SetVisibility(false) + if not wasHidden then + self:CallListeners(self.OnHide, self) + end end - +--- Makes the object visible function Object:Show() + local wasVisible = self.hidden self:SetVisibility(true) + if not wasVisible then + self:CallListeners(self.OnShow, self) + end end - +--- Toggles object visibility function Object:ToggleVisibility() self:SetVisibility(not self.visible) end @@ -475,6 +525,9 @@ end --//============================================================================= +--- Returns a child by name +-- @string name child name +-- @treturn Object child function Object:GetChildByName(name) local cn = self.children for i=1,#cn do @@ -494,7 +547,9 @@ end Object.GetChild = Object.GetChildByName ---// Resursive search to find an object by its name +--- Resursive search to find an object by its name +-- @string name name of the object +-- @treturn Object function Object:GetObjectByName(name) local r = self.childrenByName[name] if r then return r end @@ -888,6 +943,15 @@ function Object:KeyPress(...) end +function Object:TextInput(...) + if (self:CallListeners(self.OnTextInput, ...)) then + return self + end + + return false +end + + function Object:FocusUpdate(...) if (self:CallListeners(self.OnFocusUpdate, ...)) then return self diff --git a/LuaUI/Widgets_Evo/chili/controls/panel.lua b/LuaUI/Widgets_Evo/chili/controls/panel.lua index 8d5e319e7..95f8a1f36 100644 --- a/LuaUI/Widgets_Evo/chili/controls/panel.lua +++ b/LuaUI/Widgets_Evo/chili/controls/panel.lua @@ -1,5 +1,11 @@ --//============================================================================= +--- Panel module + +--- Panel fields. +-- Inherits from Control. +-- @see control.Control +-- @table Panel Panel = Control:Inherit{ classname= "panel", defaultWidth = 100, @@ -9,4 +15,4 @@ Panel = Control:Inherit{ local this = Panel local inherited = this.inherited ---//============================================================================= \ No newline at end of file +--//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/progressbar.lua b/LuaUI/Widgets_Evo/chili/controls/progressbar.lua index 0f953ddf3..619d7d44d 100644 --- a/LuaUI/Widgets_Evo/chili/controls/progressbar.lua +++ b/LuaUI/Widgets_Evo/chili/controls/progressbar.lua @@ -1,5 +1,18 @@ --//============================================================================= +--- Progressbar module + +--- Progressbar fields. +-- Inherits from Control. +-- @see control.Control +-- @table Progressbar +-- @int[opt=0] min minimum value of the Progressbar +-- @int[opt=100] max maximum value of the Progressbar +-- @int[opt=100] value value of the Progressbar +-- @string[opt=""] caption text to be displayed +-- @tparam {r,g,b,a} color specifies the color of the bar (default: {0,0,1,1}) +-- @tparam {r,g,b,a} backgroundColor specifies the background color (default: {1,1,1,1}) +-- @tparam {func1,fun2,...} OnChange function listeners for value change (default {}) Progressbar = Control:Inherit{ classname = "progressbar", @@ -51,6 +64,8 @@ end --//============================================================================= +--- Sets the new color +-- @tparam {r,g,b,a} c color table function Progressbar:SetColor(...) local color = _ParseColorArgs(...) table.merge(color,self.color) @@ -60,14 +75,18 @@ function Progressbar:SetColor(...) end end - +--- Sets the minimum and maximum value of the progress bar +-- @int[opt=0] min minimum value +-- @int[opt=1] max maximum value (why is 1 the default?) function Progressbar:SetMinMax(min,max) self.min = tonumber(min) or 0 self.max = tonumber(max) or 1 self:SetValue(self.value) end - +--- Sets the value of the progress bar +-- @int v value of the progress abr +-- @bool[opt=false] setcaption whether the caption should be set as well function Progressbar:SetValue(v,setcaption) v = self:_Clamp(v) local oldvalue = self.value @@ -83,7 +102,8 @@ function Progressbar:SetValue(v,setcaption) end end - +--- Sets the caption +-- @string str caption to be set function Progressbar:SetCaption(str) if (self.caption ~= str) then self.caption = str @@ -102,13 +122,13 @@ function Progressbar:DrawControl() local h = self.height gl.Color(self.backgroundColor) - gl.Rect(x+w*percent,y,x+w,y+h) + gl.Rect(w*percent,y,w,h) gl.Color(self.color) - gl.Rect(x,y,x+w*percent,y+h) + gl.Rect(0,y,w*percent,h) if (self.caption) then - (self.font):Print(self.caption, x+w*0.5, y+h*0.5, "center", "center") + (self.font):Print(self.caption, w*0.5, h*0.5, "center", "center") end end diff --git a/LuaUI/Widgets_Evo/chili/controls/scale.lua b/LuaUI/Widgets_Evo/chili/controls/scale.lua index e3ecedf94..1c7c66dc4 100644 --- a/LuaUI/Widgets_Evo/chili/controls/scale.lua +++ b/LuaUI/Widgets_Evo/chili/controls/scale.lua @@ -1,15 +1,21 @@ +--- Scales module + +--- Scale fields. +-- Inherits from Control. +-- @see control.Control +-- @table Scales Scale = Control:Inherit{ classname = "scale", min = -50, max = 50, step = 10, logBase = 1.5, - + defaultWidth = 90, defaultHeight = 12, fontsize = 8, - scaleFunction = nil,--- function that can be used to rescale graph - takes 0-1 and must return 0-1 + scaleFunction = nil,-- function that can be used to rescale graph - takes 0-1 and must return 0-1 color = {0,0,0,1}, } @@ -21,61 +27,61 @@ local this = Scale local glVertex = gl.Vertex -local function defaultTransform(x) +local function defaultTransform(x) return (math.log(1+x*140 ) / math.log(141)) end -local function drawScaleLines(self) +local function drawScaleLines(self) local hline = self.y + self.height local h1 = self.y + self.fontsize local h2 = self.y + self.height - - glVertex(self.x, hline) - glVertex(self.x + self.width,hline) - - if (self.scaleFunction == nil) then + + glVertex(0, hline) + glVertex(self.width, hline) + + if (self.scaleFunction == nil) then local scale = self.width / (self.max-self.min) - - for v = self.min, self.max, self.step do - local xp = self.x + scale * (v - self.min) + + for v = self.min, self.max, self.step do + local xp = scale * (v - self.min) glVertex(xp, h1) glVertex(xp, h2) - end + end else - local center = self.x + self.width*0.5 + local center = self.width*0.5 local halfWidth = 0.5 * self.width local lastXp = -1 - for v = 0, self.max, self.step do - local xp = self.scaleFunction(v/self.max) * halfWidth + center + for v = 0, self.max, self.step do + local xp = self.scaleFunction(v/self.max) * halfWidth + center glVertex(xp, h1) glVertex(xp, h2) - if (xp - lastXp < 2) then + if (xp - lastXp < 2) then glVertex(xp,h1) - glVertex(self.x + self.width, h1) + glVertex(self.width, h1) glVertex(xp,h2) - glVertex(self.x + self.width, h2) + glVertex(self.width, h2) break - end + end lastXp = xp - end - + end + local lastXp = 99999 - for v = 0, self.min, -self.step do + for v = 0, self.min, -self.step do local xp = center - self.scaleFunction(v/self.min) * halfWidth glVertex(xp, h1) glVertex(xp, h2) - if (lastXp - xp <= 2) then + if (lastXp - xp <= 2) then glVertex(xp,h1) - glVertex(self.x, h1) + glVertex(0, h1) glVertex(xp,h2) - glVertex(self.x, h2) + glVertex(0, h2) break - end + end lastXp = xp - end - + end + end -end +end @@ -84,14 +90,14 @@ function Scale:DrawControl() gl.BeginEnd(GL.LINES, drawScaleLines, self) local font = self.font - - if (self.min <=0 and self.max >= 0) then + + if (self.min <=0 and self.max >= 0) then local scale = self.width / (self.max-self.min) - font:Print(0, self.x + scale * (0 - self.min), self.y, "center", "ascender") - end + font:Print(0, scale * (0 - self.min), 0, "center", "ascender") + end - font:Print(self.min, self.x, self.y, "left", "ascender") - font:Print("+"..self.max, self.x+self.width, self.y, "right", "ascender") + font:Print(self.min, 0, 0, "left", "ascender") + font:Print("+"..self.max, self.width, 0, "right", "ascender") end --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/screen.lua b/LuaUI/Widgets_Evo/chili/controls/screen.lua index fa0cf7016..d57452e7d 100644 --- a/LuaUI/Widgets_Evo/chili/controls/screen.lua +++ b/LuaUI/Widgets_Evo/chili/controls/screen.lua @@ -1,3 +1,16 @@ +--- Screen module + +--- Screen fields. +-- Inherits from Object. +-- @see object.Object +-- @table Screen +-- @int[opt=0] x x position +-- @int[opt=0] y y position +-- @int[opt=0] width width +-- @int[opt=0] height height +-- @tparam control.Control activeControl active control +-- @tparam control.Control focusedControl focused control +-- @tparam control.Control hoveredControl hovered control Screen = Object:Inherit{ --Screen = Control:Inherit{ classname = 'screen', @@ -43,19 +56,19 @@ end function Screen:OnGlobalDispose(obj) - if (UnlinkSafe(self.activeControl) == obj) then + if CompareLinks(self.activeControl, obj) then self.activeControl = nil end - if (UnlinkSafe(self.hoveredControl) == obj) then + if CompareLinks(self.hoveredControl, obj) then self.hoveredControl = nil end - if (UnlinkSafe(self._lastHoveredControl) == obj) then + if CompareLinks(self._lastHoveredControl, obj) then self._lastHoveredControl = nil end - if (UnlinkSafe(self.focusedControl) == obj) then + if CompareLinks(self.focusedControl, obj) then self.focusedControl = nil end end @@ -138,7 +151,7 @@ function Screen:IsAbove(x,y,...) local hoveredControl = inherited.IsAbove(self,x,y,...) --// tooltip - if (UnlinkSafe(hoveredControl) ~= UnlinkSafe(self._lastHoveredControl)) then + if not CompareLinks(hoveredControl, self._lastHoveredControl) then if self._lastHoveredControl then self._lastHoveredControl:MouseOut() end @@ -165,25 +178,29 @@ function Screen:IsAbove(x,y,...) return (not not hoveredControl) end - -function Screen:MouseDown(x,y,...) - y = select(2,gl.GetViewSizes()) - y - - local activeControl = inherited.MouseDown(self,x,y,...) - self.activeControl = MakeWeakLink(activeControl, self.activeControl) - if not CompareLinks(self.activeControl, self.focusedControl) then +function Screen:FocusControl(control) + --UnlinkSafe(self.activeControl) + if not CompareLinks(control, self.focusedControl) then local focusedControl = UnlinkSafe(self.focusedControl) if focusedControl then focusedControl.state.focused = false focusedControl:FocusUpdate() --rename FocusLost() end self.focusedControl = nil - if self.activeControl then - self.focusedControl = MakeWeakLink(activeControl, self.focusedControl) + if control then + self.focusedControl = MakeWeakLink(control, self.focusedControl) self.focusedControl.state.focused = true self.focusedControl:FocusUpdate() --rename FocusGain() end end +end + +function Screen:MouseDown(x,y,...) + y = select(2,gl.GetViewSizes()) - y + + local activeControl = inherited.MouseDown(self,x,y,...) + self:FocusControl(activeControl) + self.activeControl = MakeWeakLink(activeControl, self.activeControl) return (not not activeControl) end @@ -263,6 +280,7 @@ function Screen:MouseWheel(x,y,...) return (not not inherited.MouseWheel(self,x,y,...)) end + function Screen:KeyPress(...) local focusedControl = UnlinkSafe(self.focusedControl) if focusedControl then @@ -271,4 +289,14 @@ function Screen:KeyPress(...) return (not not inherited:KeyPress(...)) end + +function Screen:TextInput(...) + local focusedControl = UnlinkSafe(self.focusedControl) + if focusedControl then + return (not not focusedControl:TextInput(...)) + end + return (not not inherited:TextInput(...)) +end + + --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/scrollpanel.lua b/LuaUI/Widgets_Evo/chili/controls/scrollpanel.lua index 78969f2ac..30f8eae19 100644 --- a/LuaUI/Widgets_Evo/chili/controls/scrollpanel.lua +++ b/LuaUI/Widgets_Evo/chili/controls/scrollpanel.lua @@ -1,5 +1,20 @@ --//============================================================================= +--- ScrollPanel module + +--- ScrollPanel fields. +-- Inherits from Control. +-- @see control.Control +-- @table ScrollPanel +-- @int[opt=12] scrollBarSize size of the scrollbar +-- @int[opt=0] scrollPosX position of the scrollbar +-- @int[opt=0] scrollPosY position of the scrollbar +-- @bool[opt=true] verticalScrollbar the vertical scroll bar is enabled +-- @bool[opt=true] horizontalScrollbar the horizontal scroll bar is enabled +-- @bool[opt=true] smoothScroll smooth scroll is enabled +-- @bool[opt=false] verticalSmartScroll if control is scrolled to bottom, keep scroll when layout changes +-- @number[opt=0.7] smoothScrollTime time of the smooth scroll, in seconds +-- @bool[opt=false] ignoreMouseWheel mouse wheel scrolling is enabled ScrollPanel = Control:Inherit{ classname = "scrollpanel", padding = {0,0,0,0}, @@ -9,9 +24,9 @@ ScrollPanel = Control:Inherit{ scrollPosY = 0, verticalScrollbar = true, horizontalScrollbar = true, - verticalSmartScroll = false, --// if control is scrolled to bottom, keep scroll when layout changes + verticalSmartScroll = false, smoothScroll = true, - smoothScrollTime = 0.7, --// in seconds + smoothScrollTime = 0.7, ignoreMouseWheel = false, } @@ -26,8 +41,12 @@ end --//============================================================================= -function ScrollPanel:SetScrollPos(x,y,inview) - if (self.smoothScroll) then +--- Sets the scroll position +-- @int x x position +-- @int y y position +function ScrollPanel:SetScrollPos(x,y,inview,smoothscroll) + local dosmooth = self.smoothScroll and (smoothscroll or (smoothscroll == nil)) + if dosmooth then self._oldScrollPosX = self.scrollPosX self._oldScrollPosY = self.scrollPosY end @@ -51,7 +70,7 @@ function ScrollPanel:SetScrollPos(x,y,inview) end end - if (self.smoothScroll) then + if dosmooth then if (self._oldScrollPosX ~= self.scrollPosX)or(self._oldScrollPosY ~= self.scrollPosY) then self._smoothScrollEnd = Spring.GetTimer() self._newScrollPosX = self.scrollPosX @@ -61,7 +80,7 @@ function ScrollPanel:SetScrollPos(x,y,inview) end end - self:Invalidate() + self:InvalidateSelf() end @@ -79,7 +98,7 @@ function ScrollPanel:Update(...) for n=1,3 do trans = smoothstep(trans) end self.scrollPosX = self._oldScrollPosX * (1 - trans) + self._newScrollPosX * trans self.scrollPosY = self._oldScrollPosY * (1 - trans) + self._newScrollPosY * trans - self:Invalidate() + self:InvalidateSelf() end end @@ -197,16 +216,16 @@ function ScrollPanel:UpdateLayout() end self.scrollPosX = clamp(0, self.contentArea[3] - self.clientArea[3], self.scrollPosX) - + local oldClamp = self.clampY or 0 self.clampY = self.contentArea[4] - self.clientArea[4] - if self.verticalSmartScroll and self.scrollPosY >= oldClamp then + if self.verticalSmartScroll and self.scrollPosY >= oldClamp then self.scrollPosY = self.clampY - else + else self.scrollPosY = clamp(0, self.clampY, self.scrollPosY) end - + return true; end @@ -218,6 +237,10 @@ function ScrollPanel:IsRectInView(x,y,w,h) return false end + if self._inrtt then + return true + end + --//FIXME 1. don't create tables 2. merge somehow into Control:IsRectInView local cx = x - self.scrollPosX local cy = y - self.scrollPosY @@ -243,23 +266,20 @@ end function ScrollPanel:_DrawInClientArea(fnc,...) - local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) + local clientX,clientY,clientWidth,clientHeight = unpack4(self.clientArea) - if (self.safeOpengl) then - local sx,sy = self:LocalToScreen(clientX,clientY) - sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) + gl.PushMatrix() + gl.Translate(clientX - self.scrollPosX, clientY - self.scrollPosY, 0) - PushScissor(sx,sy,clientWidth,clientHeight) - end + local sx,sy = self:LocalToScreen(clientX,clientY) + sy = select(2,gl.GetViewSizes()) - (sy + clientHeight) - gl.PushMatrix() - gl.Translate(math.floor(self.x + clientX - self.scrollPosX),math.floor(self.y + clientY - self.scrollPosY),0) - fnc(...) - gl.PopMatrix() + if PushLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) then + fnc(...) + PopLimitRenderRegion(self, sx, sy, clientWidth, clientHeight) + end - if (self.safeOpengl) then - PopScissor() - end + gl.PopMatrix() end @@ -294,18 +314,14 @@ function ScrollPanel:MouseDown(x, y, ...) self._vscrolling = true local clientArea = self.clientArea local cy = y - clientArea[2] - self.scrollPosY = (cy/clientArea[4])*self.contentArea[4] - 0.5*clientArea[4] - self.scrollPosY = clamp(0, self.contentArea[4] - clientArea[4], self.scrollPosY) - self:Invalidate() + self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) return self end if self:IsAboveHScrollbars(x,y) then self._hscrolling = true local clientArea = self.clientArea local cx = x - clientArea[1] - self.scrollPosX = (cx/clientArea[3])*self.contentArea[3] - 0.5*clientArea[3] - self.scrollPosX = clamp(0, self.contentArea[3] - clientArea[3], self.scrollPosX) - self:Invalidate() + self:SetScrollPos((cx/clientArea[3])*self.contentArea[3], nil, true, false) return self end @@ -317,17 +333,13 @@ function ScrollPanel:MouseMove(x, y, dx, dy, ...) if self._vscrolling then local clientArea = self.clientArea local cy = y - clientArea[2] - self.scrollPosY = (cy/clientArea[4])*self.contentArea[4] - 0.5*clientArea[4] - self.scrollPosY = clamp(0, self.contentArea[4] - clientArea[4], self.scrollPosY) - self:Invalidate() + self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) return self end if self._hscrolling then local clientArea = self.clientArea local cx = x - clientArea[1] - self.scrollPosX = (cx/clientArea[3])*self.contentArea[3] - 0.5*clientArea[3] - self.scrollPosX = clamp(0, self.contentArea[3] - clientArea[3], self.scrollPosX) - self:Invalidate() + self:SetScrollPos((cx/clientArea[3])*self.contentArea[3], nil, true, false) return self end @@ -336,7 +348,7 @@ function ScrollPanel:MouseMove(x, y, dx, dy, ...) self._vHovered = self:IsAboveVScrollbars(x,y) local new = (self._hHovered and 1 or 0) + (self._vHovered and 2 or 0) if (new ~= old) then - self:Invalidate() + self:InvalidateSelf() end return inherited.MouseMove(self, x, y, dx, dy, ...) @@ -348,18 +360,14 @@ function ScrollPanel:MouseUp(x, y, ...) self._vscrolling = nil local clientArea = self.clientArea local cy = y - clientArea[2] - self.scrollPosY = (cy/clientArea[4])*self.contentArea[4] - 0.5*clientArea[4] - self.scrollPosY = clamp(0, self.contentArea[4] - clientArea[4], self.scrollPosY) - self:Invalidate() + self:SetScrollPos(nil, (cy/clientArea[4])*self.contentArea[4], true, false) return self end if self._hscrolling then self._hscrolling = nil local clientArea = self.clientArea local cx = x - clientArea[1] - self.scrollPosX = (cx/clientArea[3])*self.contentArea[3] - 0.5*clientArea[3] - self.scrollPosX = clamp(0, self.contentArea[3] - clientArea[3], self.scrollPosX) - self:Invalidate() + self:SetScrollPos((cx/clientArea[3])*self.contentArea[3], nil, true, false) return self end @@ -369,9 +377,7 @@ end function ScrollPanel:MouseWheel(x, y, up, value, ...) if self._vscrollbar and not self.ignoreMouseWheel then - self.scrollPosY = self.scrollPosY - value*30 - self.scrollPosY = clamp(0, self.contentArea[4] - self.clientArea[4], self.scrollPosY) - self:Invalidate() + self:SetScrollPos(nil, self.scrollPosY - value*30, false, false) return self end @@ -383,5 +389,5 @@ function ScrollPanel:MouseOut(...) inherited.MouseOut(self, ...) self._hHovered = false self._vHovered = false - self:Invalidate() + self:InvalidateSelf() end diff --git a/LuaUI/Widgets_Evo/chili/controls/stackpanel.lua b/LuaUI/Widgets_Evo/chili/controls/stackpanel.lua index c36f0fd80..49a5da2b3 100644 --- a/LuaUI/Widgets_Evo/chili/controls/stackpanel.lua +++ b/LuaUI/Widgets_Evo/chili/controls/stackpanel.lua @@ -1,5 +1,11 @@ --//============================================================================= +--- StackPanel module + +--- StackPanel fields. +-- Inherits from LayoutPanel. +-- @see layoutpanel.LayoutPanel +-- @table StackPanel StackPanel = LayoutPanel:Inherit{ classname = "stackpanel", orientation = "vertical", @@ -35,4 +41,4 @@ function StackPanel:SetOrientation(orientation) inherited.SetOrientation(self,orientation) end ---//============================================================================= \ No newline at end of file +--//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/tabpanel.lua b/LuaUI/Widgets_Evo/chili/controls/tabpanel.lua new file mode 100644 index 000000000..e5a83a74f --- /dev/null +++ b/LuaUI/Widgets_Evo/chili/controls/tabpanel.lua @@ -0,0 +1,103 @@ +--//============================================================================= + +--- TabPanel module + +--- TabPanel fields. +-- Inherits from LayoutPanel. +-- @see layoutpanel.LayoutPanel +-- @table TabPanel +-- @tparam {tab1,tab2,...} tabs contained in the tab panel, each tab has a .name (string) and a .children field (table of Controls)(default {}) +-- @tparam chili.Control currentTab currently visible tab +TabPanel = LayoutPanel:Inherit{ + classname = "tabpanel", + orientation = "vertical", + resizeItems = false, + itemPadding = {0, 0, 0, 0}, + itemMargin = {0, 0, 0, 0}, + barHeight = 40, + tabs = {}, + currentTab = {}, +} + +local this = TabPanel +local inherited = this.inherited + +--//============================================================================= + +function TabPanel:New(obj) + obj = inherited.New(self,obj) + + local tabNames = {} + for i=1,#obj.tabs do + tabNames[i] = obj.tabs[i].name + end + obj:AddChild( + TabBar:New { + tabs = tabNames, + x = 0, + y = 0, + right = 0, + height = obj.barHeight, + } + ) + + obj.currentTab = Control:New { + x = 0, + y = obj.barHeight, + right = 0, + bottom = 0, + padding = {0, 0, 0, 0}, + } + obj:AddChild(obj.currentTab) + obj.tabIndexMapping = {} + for i=1, #obj.tabs do + local tabName = obj.tabs[i].name + local tabFrame = Control:New { + padding = {0, 0, 0, 0}, + x = 0, + y = 0, + right = 0, + bottom = 0, + children = obj.tabs[i].children + } + obj.tabIndexMapping[tabName] = tabFrame + obj.currentTab:AddChild(tabFrame) + if i == 1 then + obj.currentFrame = tabFrame + else + tabFrame:SetVisibility(false) + end + end + obj.children[1].OnChange = { function(tabbar, tabname) obj:ChangeTab(tabname) end } + return obj +end + +function TabPanel:AddTab(tab) + local tabbar = self.children[1] + tabbar:AddChild( + TabBarItem:New{caption = tab.name, defaultWidth = tabbar.minItemWidth, defaultHeight = tabbar.minItemHeight} --FIXME: implement an "Add Tab in TabBar too" + ) + local tabFrame = Control:New { + padding = {0, 0, 0, 0}, + x = 0, + y = 0, + right = 0, + bottom = 0, + children = tab.children + } + self.tabIndexMapping[tab.name] = tabFrame + self.currentTab:AddChild(tabFrame) + tabFrame:SetVisibility(false) +end + +--//============================================================================= + +function TabPanel:ChangeTab(tabname) + if not tabname or not self.tabIndexMapping[tabname] then + return + end + self.currentFrame:SetVisibility(false) + self.currentFrame = self.tabIndexMapping[tabname] + self.currentFrame:SetVisibility(true) +end +--//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/textbox.lua b/LuaUI/Widgets_Evo/chili/controls/textbox.lua index fa5ceeb7f..6157e132c 100644 --- a/LuaUI/Widgets_Evo/chili/controls/textbox.lua +++ b/LuaUI/Widgets_Evo/chili/controls/textbox.lua @@ -1,11 +1,21 @@ +--- TextBox module + +--- TextBox fields. +-- Inherits from Control. +-- @see control.Control +-- @table TextBox +-- @string[opt=""] text text contained in the editbox +-- @bool[opt=true] autoHeight sets height to text size, useful for embedding in scrollboxes +-- @bool[opt=true] autoObeyLineHeight (needs autoHeight) if true, autoHeight will obey the lineHeight (-> texts with the same line count will have the same height) +-- @int[opt=12] fontSize font size TextBox = Control:Inherit{ classname = "textbox", padding = {0,0,0,0}, text = "line1\nline2", - autoHeight = true, --// sets height to text size, useful for embedding in scrollboxes - autoObeyLineHeight = true, --// (needs autoHeight) if true, autoHeight will obey the lineHeight (-> texts with the same line count will have the same height) + autoHeight = true, + autoObeyLineHeight = true, fontsize = 12, _lines = {}, @@ -17,9 +27,15 @@ local inherited = this.inherited -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +--- Set text +-- @string t sets the text function TextBox:SetText(t) + if (self.text == t) then + return + end self.text = t self:RequestRealign() + self:Invalidate() -- seems RequestRealign() doesn't always cause an invalidate end -------------------------------------------------------------------------------- @@ -84,9 +100,18 @@ end function TextBox:DrawControl() local paddx, paddy = unpack4(self.clientArea) - local x = math.ceil(self.x + paddx) - local y = math.ceil(self.y + paddy) + local x = paddx + local y = paddy local font = self.font font:Draw(self._wrappedText, x, y) + + if (self.debug) then + gl.Color(0,1,0,0.5) + gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) + gl.LineWidth(2) + gl.Rect(0,0,self.width,self.height) + gl.LineWidth(1) + gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) + end end diff --git a/LuaUI/Widgets_Evo/chili/controls/trackbar.lua b/LuaUI/Widgets_Evo/chili/controls/trackbar.lua index 987d2cfb2..40fa1f4ef 100644 --- a/LuaUI/Widgets_Evo/chili/controls/trackbar.lua +++ b/LuaUI/Widgets_Evo/chili/controls/trackbar.lua @@ -1,5 +1,16 @@ --//============================================================================= +--- Trackbar module + +--- Trackbar fields. +-- Inherits from Control. +-- @see control.Control +-- @table Trackbar +-- @int[opt=0] min minimum value of the Trackbar +-- @int[opt=100] max maximum value of the Trackbar +-- @int[opt=50] value value of the Trackbar +-- @int[opt=50] step step value +-- @tparam {func1,fun2,...} OnChange function listeners for value change (default {}) Trackbar = Control:Inherit{ classname = "trackbar", value = 50, @@ -43,7 +54,7 @@ end function Trackbar:New(obj) obj = inherited.New(self,obj) - if ((not obj.tooltip) or (obj.tooltip == '')) and (useValueTooltip ~= false) then + if ((not obj.tooltip) or (obj.tooltip == '')) and (obj.useValueTooltip ~= false) then obj.useValueTooltip = true end @@ -95,6 +106,9 @@ end --//============================================================================= +--- Sets the minimum and maximum value of the track bar +-- @int[opt=0] min minimum value +-- @int[opt=1] max maximum value (why is 1 the default?) function Trackbar:SetMinMax(min,max) self.min = tonumber(min) or 0 self.max = tonumber(max) or 1 @@ -102,7 +116,13 @@ function Trackbar:SetMinMax(min,max) end +--- Sets the value of the track bar +-- @int v value of the track abr function Trackbar:SetValue(v) + if type(v) ~= "number" then + Spring.Log("Chili", "error", "Wrong param to Trackbar:SetValue(number v)") + return + end local r = v % self.step if (r > 0.5*self.step) then v = v + self.step - r @@ -113,7 +133,7 @@ function Trackbar:SetValue(v) local oldvalue = self.value self.value = v if self.useValueTooltip then - self.tooltip = "Current: "..FormatNum(v) + self.tooltip = "Current: "..FormatNum(self.value) end self:CallListeners(self.OnChange,v,oldvalue) self:Invalidate() diff --git a/LuaUI/Widgets_Evo/chili/controls/treeview.lua b/LuaUI/Widgets_Evo/chili/controls/treeview.lua index 223a12388..3faf3b826 100644 --- a/LuaUI/Widgets_Evo/chili/controls/treeview.lua +++ b/LuaUI/Widgets_Evo/chili/controls/treeview.lua @@ -1,5 +1,15 @@ --//============================================================================= +--- TreeView module + +--- TreeView fields. +-- Inherits from Control. +-- @see control.Control +-- @table TreeView +-- @bool[opt=true] autosize whether size is automatically determined +-- @int[opt=1] selected selected item +-- @tparam {TreeNode1,TreeNode2,...} nodes nodes of the tree +-- @tparam {func1,fun2,...} OnSelectNode function listeners for node selection (default {}) TreeView = Control:Inherit{ classname = "treeview", @@ -111,4 +121,4 @@ function TreeView:UpdateLayout() return true end ---//============================================================================= \ No newline at end of file +--//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/controls/window.lua b/LuaUI/Widgets_Evo/chili/controls/window.lua index 58bfabd00..7159ff7ff 100644 --- a/LuaUI/Widgets_Evo/chili/controls/window.lua +++ b/LuaUI/Widgets_Evo/chili/controls/window.lua @@ -1,3 +1,9 @@ +--- Window module + +--- Window fields. +-- Inherits from Control. +-- @see control.Control +-- @table Window Window = Control:Inherit{ classname = 'window', resizable = true, @@ -50,19 +56,17 @@ VFS.Include(CHILI_DIRNAME .. "headers/skinutils.lua", nil, VFS.RAW_FIRST) function Window:TweakDraw() gl.Color(0.6,1,0.6,0.65) - local x = self.x - local y = self.y local w = self.width local h = self.height if (self.resizable or self.tweakResizable) then - TextureHandler.LoadTexture(0,"LuaUI/Widgets_Evo/chili/skins/default/tweak_overlay_resizable.png",self) + TextureHandler.LoadTexture(0,"LuaUI/Widgets/chili/skins/default/tweak_overlay_resizable.png",self) else - TextureHandler.LoadTexture(0,"LuaUI/Widgets_Evo/chili/skins/default/tweak_overlay.png",self) + TextureHandler.LoadTexture(0,"LuaUI/Widgets/chili/skins/default/tweak_overlay.png",self) end - local texInfo = gl.TextureInfo("LuaUI/Widgets_Evo/chili/skins/default/tweak_overlay.png") or {xsize=1, ysize=1} + local texInfo = gl.TextureInfo("LuaUI/Widgets/chili/skins/default/tweak_overlay.png") or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, 31,31,31,31, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.x,self.y,w,h, 31,31,31,31, tw,th, 0) gl.Texture(0,false) end diff --git a/LuaUI/Widgets_Evo/chili/core.lua b/LuaUI/Widgets_Evo/chili/core.lua index 5f04055ee..2465b8c31 100644 --- a/LuaUI/Widgets_Evo/chili/core.lua +++ b/LuaUI/Widgets_Evo/chili/core.lua @@ -3,7 +3,8 @@ local includes = { "headers/util.lua", "headers/links.lua", "headers/backwardcompability.lua", - + "headers/unicode.lua", + "handlers/debughandler.lua", "handlers/taskhandler.lua", "handlers/skinhandler.lua", @@ -40,11 +41,12 @@ local includes = { "controls/combobox.lua", "controls/tabbaritem.lua", "controls/tabbar.lua", + "controls/tabpanel.lua", } local Chili = widget -Chili.CHILI_DIRNAME = CHILI_DIRNAME or (LUAUI_DIRNAME .. "Widgets/chili/") +Chili.CHILI_DIRNAME = CHILI_DIRNAME or (LUAUI_DIRNAME .. "Widgets_Evo/chili/") Chili.SKIN_DIRNAME = SKIN_DIRNAME or (CHILI_DIRNAME .. "skins/") if (-1>0) then diff --git a/LuaIntro/chili/chili/handlers/backwardcompability.lua b/LuaUI/Widgets_Evo/chili/handlers/backwardcompability.lua similarity index 100% rename from LuaIntro/chili/chili/handlers/backwardcompability.lua rename to LuaUI/Widgets_Evo/chili/handlers/backwardcompability.lua diff --git a/LuaUI/Widgets_Evo/chili/handlers/debughandler.lua b/LuaUI/Widgets_Evo/chili/handlers/debughandler.lua index 42de18309..aa4b2db16 100644 --- a/LuaUI/Widgets_Evo/chili/handlers/debughandler.lua +++ b/LuaUI/Widgets_Evo/chili/handlers/debughandler.lua @@ -27,7 +27,7 @@ setmetatable(DebugHandler.objectsOwnedByWidgets, { local st = {}; setmetatable(st,{__mode="v"}); if (not i) then - Spring.Echo("WAAA",debug.traceback()) + Spring.Log("Chili", "error", "WAAA",debug.traceback()) end t[i] = st; return st; @@ -73,7 +73,10 @@ local function ChiliErrorHandler(msg,...) end if (name == "self") then if (value._widget ~= widget) then --// ignore controls owned by Chili Framework! - control = value + --// ignore non-chili objects; TODO: implement a better way of checking whether something is a chili object + if value.name and value.Dispose then + control = value + end end end @@ -83,24 +86,26 @@ local function ChiliErrorHandler(msg,...) _i = _i + 1 until(control) + if (control) then local w = control._widget - if (w) then - Spring.Echo(("Chili-Error in `%s`:%s : %s"):format(w.whInfo.name, control.name, msg)) - Spring.Echo(DebugHandler.Stacktrace()) + if isindexable(w) then + local wname = (w.whInfo and w.whInfo.name) or "unknown" + Spring.Log("Chili", "error", ("in `%s`:%s : %s"):format(wname, control.name, msg)) + Spring.Log("Chili", "error", DebugHandler.Stacktrace()) --// this also unloads all owned chili objects - Spring.Echo("Removed widget: " .. w.whInfo.name) + Spring.Log("Chili", "error", "Removed widget: " .. wname) widgetHandler:RemoveWidget(w) else - Spring.Echo(("Chili-Error in `%s` (couldn't detect the owner widget): %s"):format(control.name, msg)) - Spring.Echo(DebugHandler.Stacktrace()) + Spring.Log("Chili", "error", ("in `%s` (couldn't detect the owner widget): %s"):format(control.name, msg)) + Spring.Log("Chili", "error", DebugHandler.Stacktrace()) control:Dispose() end else --// error in Chili itself - Spring.Echo(("Chili-Error: %s"):format(msg)) - Spring.Echo(DebugHandler.Stacktrace()) + Spring.Log("Chili", "error", ("%s"):format(msg)) + Spring.Log("Chili", "error", DebugHandler.Stacktrace()) if (os.clock() - lastError < 5) then numChiliErrors = numChiliErrors + 1 @@ -111,7 +116,7 @@ local function ChiliErrorHandler(msg,...) --// unload Chili to avoid error spam if (numChiliErrors>=DebugHandler.maxChiliErrors) then - Spring.Echo("Removed widget: " .. widget.whInfo.name) + Spring.Log("Chili", "error", "Removed widget: " .. widget.whInfo.name) widgetHandler:RemoveWidget(widget) end end @@ -161,7 +166,7 @@ function DebugHandler.Stacktrace() local i = 1 + math.ceil(DebugHandler.maxStackLength/2)+1 local tail = (DebugHandler.maxStackLength - i) local j = #trace - tail - trace[i] = "..." + trace[i] = ("... (%i calls)"):format(#trace - (i + tail)) for n=1,tail do trace[i+n] = trace[j+n] end @@ -249,7 +254,7 @@ SafeCall = xpcall_va --// external code should access it via Chili.SafeCall() local orig_gl = gl local cdCreateList = gl.CreateList gl = {} -setmetatable(gl,{__index=function(t,i) t[i] = orig_gl[i]; return t[i]; end}) --// use metatable to copy table entries on-demand +setmetatable(gl,{__index=function(t,i) t[i] = orig_gl[i] or false; return t[i]; end}) --// use metatable to copy table entries on-demand gl.CreateList = function(...) return cdCreateList(xpcall_va, ...) end diff --git a/LuaUI/Widgets_Evo/chili/handlers/skinhandler.lua b/LuaUI/Widgets_Evo/chili/handlers/skinhandler.lua index 9fdc70be7..dabdad547 100644 --- a/LuaUI/Widgets_Evo/chili/handlers/skinhandler.lua +++ b/LuaUI/Widgets_Evo/chili/handlers/skinhandler.lua @@ -85,7 +85,7 @@ for i,skinConfig in ipairs(SkinHandler.knownSkins) do dirs[#dirs+1] = dependSkin.info.dir table.merge(skinConfig, dependSkin) else - Spring.Echo("Chili: Skin " .. skinConfig.info.name .. " depends on an unknown skin named " .. dependSkinName .. ".") + Spring.Log("Chili", "error", "Skin " .. skinConfig.info.name .. " depends on an unknown skin named " .. dependSkinName .. ".") end end diff --git a/LuaUI/Widgets_Evo/chili/handlers/texturehandler.lua b/LuaUI/Widgets_Evo/chili/handlers/texturehandler.lua index 8bf1cc0da..fd0a6ae46 100644 --- a/LuaUI/Widgets_Evo/chili/handlers/texturehandler.lua +++ b/LuaUI/Widgets_Evo/chili/handlers/texturehandler.lua @@ -32,6 +32,8 @@ local placeholderFilename = theme.skin.icons.imageplaceholder local placeholderDL = gl.CreateList(gl.Texture,CHILI_DIRNAME .. "skins/default/empty.png") --local placeholderDL = gl.CreateList(gl.Texture,placeholderFilename) +local isEngineTexture = { [string.byte("!")] = true, [string.byte("%")] = true, [string.byte("#")] = true, [string.byte("$")] = true, [string.byte("^")] = true } + local function AddRequest(filename,obj) local req = requested if (req[filename]) then @@ -71,13 +73,17 @@ function TextureHandler.LoadTexture(arg1,arg2,arg3) filename = arg1 obj = arg2 end - + local tex = loaded[filename] - if (not tex) then - AddRequest(filename,obj) - glActiveTexture(activeTexID,glCallList,placeholderDL) - else + if (tex) then glActiveTexture(activeTexID,glCallList,tex.dl) + else + AddRequest(filename,obj) + if isEngineTexture[filename:byte(1)] then + gl.Texture(activeTexID, filename) + else + glActiveTexture(activeTexID,glCallList,placeholderDL) + end end end @@ -100,45 +106,59 @@ end local usedTime = 0 local lastCall = spGetTimer() +local nullInfo = {xsize=0} -function TextureHandler.Update() - if (usedTime>0) then - thisCall = spGetTimer() - - usedTime = usedTime - spDiffTimers(thisCall,lastCall) - lastCall = thisCall - - if (usedTime<0) then usedTime = 0 end - end - if (not next(requested)) then return end - - local timerStart = spGetTimer() - while (usedTime < timeLimit) do - local filename,objs = next(requested) - - if (not filename) then return end - - gl.Texture(filename) - gl.Texture(false) - - local texture = {} - texture.dl = gl.CreateList(gl.Texture,filename) - texture.references = #objs - loaded[filename] = texture - - for obj in pairs(objs) do - obj:Invalidate() - end - - requested[filename] = nil - - local timerEnd = spGetTimer() - usedTime = usedTime + spDiffTimers(timerEnd,timerStart) - timerStart = timerEnd - end - - lastCall = spGetTimer() +function TextureHandler.Update() + if (not next(requested)) then return end + + if (usedTime>0) then + thisCall = spGetTimer() + + usedTime = usedTime - spDiffTimers(thisCall,lastCall) + lastCall = thisCall + + if (usedTime<0) then usedTime = 0 end + end + + local broken = {} + local timerStart = spGetTimer() + local finished = false + while (usedTime < timeLimit)and(not finished) do + local filename,objs = next(requested) + + if (filename) then + gl.Texture(filename) + gl.Texture(false) + + if (gl.TextureInfo(filename) or nullInfo).xsize > 0 then + local texture = {} + texture.dl = gl.CreateList(gl.Texture,filename) + loaded[filename] = texture + + for obj in pairs(objs) do + obj:Invalidate() + texture.references = (texture.references or 0) + 1 + end + else + broken[filename] = objs + end + + requested[filename] = nil + + local timerEnd = spGetTimer() + usedTime = usedTime + spDiffTimers(timerEnd,timerStart) + timerStart = timerEnd + else + finished = true + end + end + + for i,v in pairs(broken) do + requested[i] = v + end + + lastCall = spGetTimer() end --//============================================================================= diff --git a/LuaUI/Widgets_Evo/chili/headers/backwardcompability.lua b/LuaUI/Widgets_Evo/chili/headers/backwardcompability.lua index fe92c708e..d689076e5 100644 --- a/LuaUI/Widgets_Evo/chili/headers/backwardcompability.lua +++ b/LuaUI/Widgets_Evo/chili/headers/backwardcompability.lua @@ -1,19 +1,28 @@ --//============================================================================= --// +local function CheckNoneNil(x, fallback) + if (x ~= nil) then + return x + else + return fallback + end +end + + function BackwardCompa(obj) obj.font = obj.font or {} - obj.font.outline = obj.font.outline or obj.fontOutline - obj.font.color = obj.font.color or obj.captionColor - obj.font.color = obj.font.color or obj.textColor - obj.font.size = obj.font.size or obj.fontSize - obj.font.size = obj.font.size or obj.fontsize - obj.font.shadow = obj.font.shadow or obj.fontShadow - obj.bolderColor = obj.borderColor or obj.borderColor1 + obj.font.outline = CheckNoneNil(obj.font.outline, obj.fontOutline) + obj.font.color = CheckNoneNil(obj.font.color, obj.captionColor) + obj.font.color = CheckNoneNil(obj.font.color, obj.textColor) + obj.font.size = CheckNoneNil(obj.font.size, obj.fontSize) + obj.font.size = CheckNoneNil(obj.font.size, obj.fontsize) + obj.font.shadow = CheckNoneNil(obj.font.shadow, obj.fontShadow) + obj.bolderColor = CheckNoneNil(obj.borderColor, obj.borderColor1) obj.fontOutline = nil obj.textColor = nil obj.captionColor = nil obj.fontSize = nil obj.fontsize = nil obj.fontShadow = nil -end \ No newline at end of file +end diff --git a/LuaUI/Widgets_Evo/chili/headers/skinutils.lua b/LuaUI/Widgets_Evo/chili/headers/skinutils.lua index bbc070488..b332725b6 100644 --- a/LuaUI/Widgets_Evo/chili/headers/skinutils.lua +++ b/LuaUI/Widgets_Evo/chili/headers/skinutils.lua @@ -35,6 +35,7 @@ function _DrawTiledTexture(x,y,w,h, skLeft,skTop,skRight,skBottom, texw,texh, te local txBottom = skBottom/texh --//scale down the texture if we don't have enough space + local scaleY = h/(skTop+skBottom) local scaleX = w/(skLeft+skRight) local scale = (scaleX < scaleY) and scaleX or scaleY @@ -195,8 +196,8 @@ local _DrawTiledBorder = _DrawTiledBorder local function _DrawDragGrip(obj) - local x = obj.x + 13 - local y = obj.y + 8 + local x = 13 + local y = 8 local w = obj.dragGripSize[1] local h = obj.dragGripSize[2] @@ -223,8 +224,8 @@ end local function _DrawResizeGrip(obj) if (obj.resizable) then - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local resizeBox = GetRelativeObjBox(obj,obj.boxes.resize) @@ -261,13 +262,17 @@ local function _DrawCursor(x, y, w, h) gl.Vertex(x + w, y + h) end +local function _DrawSelection(x, y, w, h) + gl.Vertex(x, y) + gl.Vertex(x, y + h) + gl.Vertex(x + w, y) + gl.Vertex(x + w, y + h) +end --//============================================================================= --// function DrawWindow(obj) - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height @@ -283,11 +288,11 @@ function DrawWindow(obj) local texInfo = gl.TextureInfo(obj.TileImage) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th) gl.Texture(0,false) if (obj.caption) then - obj.font:Print(obj.caption, x+w*0.5, y+9, "center") + obj.font:Print(obj.caption, w*0.5, 9, "center") end end @@ -295,8 +300,8 @@ end --// function DrawButton(obj) - local x = obj.x - local y = obj.y + if obj.debug then Spring.Echo("DrawButton", obj.name, obj.state.pressed) end + local w = obj.width local h = obj.height @@ -315,7 +320,7 @@ function DrawButton(obj) local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) --gl.Texture(0,false) local fgcolor = obj.borderColor @@ -330,11 +335,11 @@ function DrawButton(obj) local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) if (obj.caption) then - obj.font:Print(obj.caption, x+w*0.5, y+h*0.5, "center", "center") + obj.font:Print(obj.caption, w*0.5, h*0.5, "center", "center") end end @@ -350,7 +355,7 @@ function DrawComboBox(self) TextureHandler.LoadTexture(0,self.TileImageArrow,self) local texInfo = gl.TextureInfo(self.TileImageArrow) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.x + self.width - self.padding[3], self.y, self.padding[3], self.height, tw,th) + _DrawTextureAspect(self.width - self.padding[3], 0, self.padding[3], self.height, tw,th) gl.Texture(0,false) end @@ -362,7 +367,7 @@ function DrawEditBox(obj) TextureHandler.LoadTexture(0,obj.TileImageBK,obj) local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, obj.x, obj.y, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, 0, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) --gl.Texture(0,false) if obj.state.focused or obj.state.hovered then @@ -373,10 +378,24 @@ function DrawEditBox(obj) TextureHandler.LoadTexture(0,obj.TileImageFG,obj) local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, obj.x, obj.y, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, 0, obj.width, obj.height, skLeft,skTop,skRight,skBottom, tw,th) gl.Texture(0,false) - if (obj.text) then + local text = obj.text + local font = obj.font + local displayHint = false + + if text == "" and not obj.state.focused then + text = obj.hint + displayHint = true + font = obj.hintFont + end + + if (text) then + if obj.passwordInput and not displayHint then + text = string.rep("*", #text) + end + if (obj.offset > obj.cursor) then obj.offset = obj.cursor end @@ -385,8 +404,8 @@ function DrawEditBox(obj) --// make cursor pos always visible (when text is longer than editbox!) repeat - local txt = obj.text:sub(obj.offset, obj.cursor) - local wt = obj.font:GetTextWidth(txt) + local txt = text:sub(obj.offset, obj.cursor) + local wt = font:GetTextWidth(txt) if (wt <= clientWidth) then break end @@ -396,12 +415,12 @@ function DrawEditBox(obj) obj.offset = obj.offset + 1 until (false) - local txt = obj.text:sub(obj.offset) + local txt = text:sub(obj.offset) --// strip part at the end that exceeds the editbox - local lsize = math.max(0, obj.font:WrapText(txt, clientWidth, clientHeight):len() - 3) -- find a good start (3 dots at end if stripped) + local lsize = math.max(0, font:WrapText(txt, clientWidth, clientHeight):len() - 3) -- find a good start (3 dots at end if stripped) while (lsize <= txt:len()) do - local wt = obj.font:GetTextWidth(txt:sub(1, lsize)) + local wt = font:GetTextWidth(txt:sub(1, lsize)) if (wt > clientWidth) then break end @@ -410,11 +429,11 @@ function DrawEditBox(obj) txt = txt:sub(1, lsize - 1) gl.Color(1,1,1,1) - obj.font:DrawInBox(txt, obj.x + clientX, obj.y + clientY, clientWidth, clientHeight, obj.align, obj.valign) + font:DrawInBox(txt, clientX, clientY, clientWidth, clientHeight, obj.align, obj.valign) if obj.state.focused then - local cursorTxt = obj.text:sub(obj.offset, obj.cursor - 1) - local cursorX = obj.font:GetTextWidth(cursorTxt) + local cursorTxt = text:sub(obj.offset, obj.cursor - 1) + local cursorX = font:GetTextWidth(cursorTxt) local dt = Spring.DiffTimers(Spring.GetTimer(), obj._interactedTime) local as = math.sin(dt * 8); @@ -427,8 +446,29 @@ function DrawEditBox(obj) local cc = obj.cursorColor gl.Color(cc[1], cc[2], cc[3], cc[4] * alpha) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawCursor, obj.x + cursorX + clientX - 1, obj.y + clientY, 3, clientHeight) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawCursor, cursorX + clientX - 1, clientY, 3, clientHeight) end + if obj.selStart and obj.state.focused then + local cursorTxt = text:sub(obj.offset, obj.cursor - 1) + local cursorX = font:GetTextWidth(cursorTxt) + local cc = obj.selectionColor + gl.Color(cc[1], cc[2], cc[3], cc[4]) + + local left, right = obj.selStart, obj.selEnd + if left > right then + left, right = right, left + end + + local leftTxt = text:sub(obj.offset, left - 1) + local leftX = font:GetTextWidth(leftTxt) + local rightTxt = text:sub(obj.offset, right - 1) + local rightX = font:GetTextWidth(rightTxt) + + local w = rightX - leftX + -- limit the selection to the editbox width + w = math.min(w, obj.width - leftX - 3) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawSelection, leftX + clientX - 1, clientY, w, clientHeight) + end end end @@ -436,8 +476,6 @@ end --// function DrawPanel(obj) - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height @@ -448,7 +486,7 @@ function DrawPanel(obj) local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) --gl.Texture(0,false) gl.Color(obj.borderColor) @@ -456,7 +494,7 @@ function DrawPanel(obj) local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) end @@ -513,7 +551,7 @@ function DrawScrollPanelBorder(self) end gl.Color(self.borderColor) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledBorder, self.x,self.y,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledBorder, 0,0,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) end end @@ -542,13 +580,13 @@ function DrawScrollPanel(obj) end gl.Color(obj.backgroundColor) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, obj.x,obj.y,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,width,height, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) end if obj._vscrollbar then - local x = obj.x + obj.width - obj.scrollbarSize - local y = obj.y + local x = obj.width - obj.scrollbarSize + local y = 0 local w = obj.scrollbarSize local h = obj.height --FIXME what if hscrollbar is visible if (obj._hscrollbar) then @@ -587,10 +625,10 @@ function DrawScrollPanel(obj) end if obj._hscrollbar then - gl.Color(1,1,1,1) + gl.Color(1,1,1,1) - local x = obj.x - local y = obj.y + obj.height - obj.scrollbarSize + local x = 0 + local y = obj.height - obj.scrollbarSize local w = obj.width local h = obj.scrollbarSize if (obj._vscrollbar) then @@ -635,8 +673,8 @@ end function DrawCheckbox(obj) local boxSize = obj.boxsize - local x = obj.x + obj.width - boxSize - local y = obj.y + obj.height*0.5 - boxSize*0.5 + local x = obj.width - boxSize + local y = obj.height*0.5 - boxSize*0.5 local w = boxSize local h = boxSize @@ -644,7 +682,7 @@ function DrawCheckbox(obj) local ty = obj.height * 0.5 --// verticale center if obj.boxalign == "left" then - x = obj.x + x = 0 tx = boxSize + 2 end @@ -671,7 +709,7 @@ function DrawCheckbox(obj) gl.Color(1,1,1,1) if (obj.caption) then - obj.font:Print(obj.caption, obj.x + tx, obj.y + ty, nil, "center") + obj.font:Print(obj.caption, tx, ty, nil, "center") end end @@ -679,8 +717,6 @@ end --// function DrawProgressbar(obj) - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height @@ -689,29 +725,25 @@ function DrawProgressbar(obj) local skLeft,skTop,skRight,skBottom = unpack4(obj.tiles) gl.Color(obj.backgroundColor) - if not obj.noSkin then - TextureHandler.LoadTexture(0,obj.TileImageBK,obj) + TextureHandler.LoadTexture(0,obj.TileImageBK,obj) local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.Texture(0,false) - end + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + --gl.Texture(0,false) gl.Color(obj.color) TextureHandler.LoadTexture(0,obj.TileImageFG,obj) local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - -- workaround for catalyst >12.6 drivers: do the "clipping" by multiplying width by percentage in glBeginEnd instead of using glClipPlane - -- fuck AMD - --gl.ClipPlane(1, -1,0,0, x+w*percent) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w*percent,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - --gl.ClipPlane(1, false) + gl.ClipPlane(1, -1,0,0, w*percent) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.ClipPlane(1, false) gl.Texture(0,false) if (obj.caption) then - (obj.font):Print(obj.caption, x+w*0.5, y+h*0.5, "center", "center") + (obj.font):Print(obj.caption, w*0.5, h*0.5, "center", "center") end end @@ -720,8 +752,6 @@ end function DrawTrackbar(self) local percent = self:_GetPercent() - local x = self.x - local y = self.y local w = self.width local h = self.height @@ -729,15 +759,13 @@ function DrawTrackbar(self) local pdLeft,pdTop,pdRight,pdBottom = unpack4(self.hitpadding) gl.Color(1,1,1,1) - if not self.noDrawBar then - TextureHandler.LoadTexture(0,self.TileImage,self) + + TextureHandler.LoadTexture(0,self.TileImage,self) local texInfo = gl.TextureInfo(self.TileImage) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) - end - - if not self.noDrawStep then - TextureHandler.LoadTexture(0,self.StepImage,self) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + + TextureHandler.LoadTexture(0,self.StepImage,self) local texInfo = gl.TextureInfo(self.StepImage) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize @@ -767,23 +795,21 @@ function DrawTrackbar(self) end stepWidth = newStepWidth - local my = y+h*0.5 - local mx = x+pdLeft+stepWidth - while (mx<(x+pdLeft+barWidth)) do + local my = h*0.5 + local mx = pdLeft+stepWidth + while (mx<(pdLeft+barWidth)) do gl.TexRect(math.ceil(mx-tw*0.5),math.ceil(my-th*0.5),math.ceil(mx+tw*0.5),math.ceil(my+th*0.5),false,true) mx = mx+stepWidth end end - end if (self.state.hovered) then gl.Color(self.focusColor) else gl.Color(1,1,1,1) end - - if not self.noDrawThumb then - TextureHandler.LoadTexture(0,self.ThumbImage,self) + + TextureHandler.LoadTexture(0,self.ThumbImage,self) local texInfo = gl.TextureInfo(self.ThumbImage) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize @@ -792,13 +818,12 @@ function DrawTrackbar(self) th = h local barWidth = w - (pdLeft + pdRight) - local mx = x + pdLeft + barWidth * percent - local my = y + h * 0.5 + local mx = pdLeft + barWidth * percent + local my = h * 0.5 mx = math.floor(mx - tw * 0.5) my = math.floor(my - th * 0.5) gl.TexRect(mx, my, mx + tw, my + th, false, true) - end - + gl.Texture(0,false) end @@ -807,8 +832,8 @@ end function DrawTreeviewNode(self) if CompareLinks(self.treeview.selected,self) then - local x = self.x + self.clientArea[1] - local y = self.y + local x = self.clientArea[1] + local y = 0 local w = self.children[1].width local h = self.clientArea[2] + self.children[1].height @@ -819,7 +844,7 @@ function DrawTreeviewNode(self) local texInfo = gl.TextureInfo(self.treeview.ImageNodeSelected) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) end end @@ -856,11 +881,11 @@ end function DrawTreeviewNodeTree(self) - local x1 = self.x + math.ceil(self.padding[1]*0.5) - local x2 = self.x + self.padding[1] - local y1 = self.y - local y2 = self.y + self.height - local y3 = self.y + self.padding[2] + math.ceil(self.children[1].height*0.5) + local x1 = math.ceil(self.padding[1]*0.5) + local x2 = self.padding[1] + local y1 = 0 + local y2 = self.height + local y3 = self.padding[2] + math.ceil(self.children[1].height*0.5) if (self.parent)and(CompareLinks(self,self.parent.nodes[#self.parent.nodes])) then y2 = y3 @@ -883,7 +908,7 @@ function DrawTreeviewNodeTree(self) local texInfo = gl.TextureInfo(image) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.x,self.y,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) + _DrawTextureAspect(0,0,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) gl.Texture(0,false) end @@ -899,23 +924,30 @@ function DrawLine(self) TextureHandler.LoadTexture(0,self.TileImageV,self) local texInfo = gl.TextureInfo(self.TileImageV) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.x + self.width * 0.5 - 2, self.y, 4, self.height, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.width * 0.5 - 2, 0, 4, self.height, skLeft,skTop,skRight,skBottom, tw,th, 0) else local skLeft,skTop,skRight,skBottom = unpack4(self.tiles) TextureHandler.LoadTexture(0,self.TileImage,self) local texInfo = gl.TextureInfo(self.TileImage) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, self.x, self.y + self.height * 0.5 - 2, self.width, 4, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0, self.height * 0.5 - 2, self.width, 4, skLeft,skTop,skRight,skBottom, tw,th, 0) end gl.Texture(0,false) + + if (self.debug) then + gl.Color(0,1,0,0.5) + gl.PolygonMode(GL.FRONT_AND_BACK,GL.LINE) + gl.LineWidth(2) + gl.Rect(0,0,self.width,self.height) + gl.LineWidth(1) + gl.PolygonMode(GL.FRONT_AND_BACK,GL.FILL) + end end --//============================================================================= --// function DrawTabBarItem(obj) - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height @@ -934,7 +966,7 @@ function DrawTabBarItem(obj) local texInfo = gl.TextureInfo(obj.TileImageBK) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) --gl.Texture(0,false) if (obj.state.pressed) then @@ -949,17 +981,17 @@ function DrawTabBarItem(obj) local texInfo = gl.TextureInfo(obj.TileImageFG) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, x,y,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTiledTexture, 0,0,w,h, skLeft,skTop,skRight,skBottom, tw,th, 0) gl.Texture(0,false) if (obj.caption) then local cx,cy,cw,ch = unpack4(obj.clientArea) - obj.font:DrawInBox(obj.caption, x + cx, y + cy, cw, ch, "center", "center") + obj.font:DrawInBox(obj.caption, cx, cy, cw, ch, "center", "center") end end --//============================================================================= ---// +--// function DrawDragGrip(obj) gl.BeginEnd(GL.TRIANGLES, _DrawDragGrip, obj) diff --git a/LuaUI/Widgets_Evo/chili/headers/util.lua b/LuaUI/Widgets_Evo/chili/headers/util.lua index 8a01a8cf4..32742daa5 100644 --- a/LuaUI/Widgets_Evo/chili/headers/util.lua +++ b/LuaUI/Widgets_Evo/chili/headers/util.lua @@ -6,6 +6,14 @@ end --//============================================================================= +--// some needed gl constants +GL_DEPTH24_STENCIL8 = 0x88F0 +GL_KEEP = 0x1E00 +GL_INCR_WRAP = 0x8507 +GL_DECR_WRAP = 0x8508 + +--//============================================================================= + function unpack4(t) return t[1], t[2], t[3], t[4] end @@ -113,41 +121,141 @@ local curScissor = {1,1,1e9,1e9} local stack = {curScissor} local stackN = 1 -function PushScissor(x,y,w,h) - local right = x+w - local bottom = y+h - if (right > curScissor[3]) then - right = curScissor[3] - end - if (bottom > curScissor[4]) then - bottom = curScissor[4] - end - if (x < curScissor[1]) then - x = curScissor[1] - end - if (y < curScissor[2]) then - y = curScissor[2] - end - curScissor = {x,y,right,bottom} - stackN = stackN + 1 - stack[stackN] = curScissor +local pool = {} +local function GetVector4() + if not pool[1] then + return {0,0,0,0} + end + local t = pool[#pool] + pool[#pool] = nil + return t +end +local function FreeVector4(t) + pool[#pool + 1] = t +end + +local function PushScissor(_,x,y,w,h) + local right = x + w + local bottom = y + h + if (right > curScissor[3]) then right = curScissor[3] end + if (bottom > curScissor[4]) then bottom = curScissor[4] end + if (x < curScissor[1]) then x = curScissor[1] end + if (y < curScissor[2]) then y = curScissor[2] end + + w = right - x + h = bottom - y + if (w < 0) or (h < 0) then + --// scissor is null space -> don't render at all + return false + end - gl.Scissor(x,y,right - x,bottom - y) + --curScissor = {x,y,right,bottom} + curScissor = GetVector4() + curScissor[1] = x; curScissor[2] = y; curScissor[3] = right; curScissor[4] = bottom; + stackN = stackN + 1 + stack[stackN] = curScissor + + gl.Scissor(x,y,w,h) + return true +end + + +local function PopScissor() + FreeVector4(curScissor) + stack[stackN] = nil + stackN = stackN - 1 + curScissor = stack[stackN] + assert(stackN >= 1) + if (stackN == 1) then + gl.Scissor(false) + else + local x,y, right,bottom = unpack4(curScissor) + local w = right - x + local h = bottom - y + gl.Scissor(x,y,w,h) + end end -function PopScissor() - stack[stackN] = nil - stackN = stackN - 1 - curScissor = stack[stackN] - if (stackN == 1) then - gl.Scissor(false) - else - local x,y, right,bottom = unpack4(curScissor) - gl.Scissor(x,y,right - x,bottom - y) - end + +local function PushStencilMask(obj, x,y,w,h) + obj._stencilMask = (obj.parent._stencilMask or 0) + 1 + if (obj._stencilMask > 255) then + obj._stencilMask = 0 + end + + gl.ColorMask(false) + + gl.StencilFunc(GL.ALWAYS, 0, 0xFF) + gl.StencilOp(GL_KEEP, GL_INCR_WRAP, GL_INCR_WRAP) + + if not obj.scrollPosY then + gl.Rect(0, 0, w, h) + else + local contentX,contentY,contentWidth,contentHeight = unpack4(obj.contentArea) + gl.Rect(0, 0, contentWidth,contentHeight) + end + + gl.ColorMask(true) + gl.StencilFunc(GL.EQUAL, obj._stencilMask, 0xFF) + gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) + return true +end + +local function PopStencilMask(obj, x,y,w,h) + gl.ColorMask(false) + + gl.StencilFunc(GL.ALWAYS, 0, 0xFF) + gl.StencilOp(GL_KEEP, GL_DECR_WRAP, GL_DECR_WRAP) + + if not obj.scrollPosY then + gl.Rect(0, 0, w, h) + else + local contentX,contentY,contentWidth,contentHeight = unpack4(obj.contentArea) + gl.Rect(0, 0, contentWidth,contentHeight) + end + + gl.ColorMask(true) + gl.StencilFunc(GL.EQUAL, obj.parent._stencilMask or 0, 0xFF) + gl.StencilOp(GL_KEEP, GL_KEEP, GL_KEEP) + --gl.StencilTest(false) + + obj._stencilMask = nil +end + + +local inRTT = false + +function EnterRTT() + inRTT = true +end + +function LeaveRTT() + inRTT = false end +function AreInRTT() + return inRTT +end + + +function PushLimitRenderRegion(...) + if inRTT then + return PushStencilMask(...) + else + return PushScissor(...) + end +end + +function PopLimitRenderRegion(...) + if inRTT then + PopStencilMask(...) + else + PopScissor(...) + end +end + + --//============================================================================= function AreRectsOverlapping(rect1,rect2) @@ -297,6 +405,7 @@ function table:merge(table2) self[i] = v end end + return self end function table:iequal(table2) diff --git a/LuaUI/Widgets_Evo/chili/simple examples/Widgets/gui_chiligui.lua b/LuaUI/Widgets_Evo/chili/simple examples/Widgets/gui_chiligui.lua index 463c4437f..3fb1815f0 100644 --- a/LuaUI/Widgets_Evo/chili/simple examples/Widgets/gui_chiligui.lua +++ b/LuaUI/Widgets_Evo/chili/simple examples/Widgets/gui_chiligui.lua @@ -36,7 +36,14 @@ WG.Chili.Screen0 = screen0 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if (not th) then th = Chili.TextureHandler th.Initialize() diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2.png index ea8a53a27..b5e7531ac 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_bg.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_bg.png index 58c581ee6..b5e7531ac 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_bg.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_bg.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_border.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_border.png index c5bc400d9..564e3ed12 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_border.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/panel2_border.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/skin.lua b/LuaUI/Widgets_Evo/chili/skins/Evolved/skin.lua index 3141cc708..92d0fd4f3 100644 --- a/LuaUI/Widgets_Evo/chili/skins/Evolved/skin.lua +++ b/LuaUI/Widgets_Evo/chili/skins/Evolved/skin.lua @@ -9,12 +9,15 @@ local skin = { } } +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + --//============================================================================= --// skin.general = { - --font = "FreeSansBold.ttf", - fontOutline = false, + font = fontfile2, + fontOutline = true, fontsize = 13, textColor = {1,1,1,1}, diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_button.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_button.png index f775e24f4..4a31829a3 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_button.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_button.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_checked.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_checked.png index 6a9c2ed6f..046686e07 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_checked.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_checked.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_unchecked.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_unchecked.png index ac9d34dbd..9da7323fc 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_unchecked.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_checkbox_unchecked.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_dragwindow.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_dragwindow.png index 86c2dd547..e1e0ecb77 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_dragwindow.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_dragwindow.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_empty.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_empty.png index 190ada92a..96d4937f2 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_empty.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_empty.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_full.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_full.png index 9a5fb5253..60a64c727 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_full.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_progressbar_full.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar.png index 7e4d47e8f..239eaf91b 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar_knob.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar_knob.png index d1de12e8d..378bd3981 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar_knob.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/tech_scrollbar_knob.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Evolved/trackbar_thumb.png b/LuaUI/Widgets_Evo/chili/skins/Evolved/trackbar_thumb.png index 310053ca1..5f5fe94c6 100644 Binary files a/LuaUI/Widgets_Evo/chili/skins/Evolved/trackbar_thumb.png and b/LuaUI/Widgets_Evo/chili/skins/Evolved/trackbar_thumb.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox.png b/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox.png new file mode 100644 index 000000000..db0e82845 Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/checkbox.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/checkbox.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/checkbox.psp diff --git a/LuaIntro/chili/chili/skins/Glass/checkbox_.png b/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox_.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/checkbox_.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/checkbox_.png diff --git a/LuaIntro/chili/chili/skins/Glass/checkbox_arrow.png b/LuaUI/Widgets_Evo/chili/skins/Lima/checkbox_arrow.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/checkbox_arrow.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/checkbox_arrow.png diff --git a/LuaIntro/chili/chili/skins/Glass/combobox_ctrl_arrow.png b/LuaUI/Widgets_Evo/chili/skins/Lima/combobox_ctrl_arrow.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/combobox_ctrl_arrow.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/combobox_ctrl_arrow.png diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/combobox_wnd.png b/LuaUI/Widgets_Evo/chili/skins/Lima/combobox_wnd.png new file mode 100644 index 000000000..5b09522e8 Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/combobox_wnd.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/glass.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glass.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glass.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/glass.png diff --git a/LuaIntro/chili/chili/skins/Glass/glass2.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glass2.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glass2.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/glass2.png diff --git a/LuaIntro/chili/chili/skins/Glass/glass2.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/glass2.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glass2.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/glass2.psp diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/glassBK.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glassBK.png new file mode 100644 index 000000000..840293faa Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/glassBK.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/glassButton.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/glassButton.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glassButton.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/glassButton.psp diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/glassFG.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glassFG.png new file mode 100644 index 000000000..30029e7fe Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/glassFG.png differ diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/glass_.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glass_.png new file mode 100644 index 000000000..c0c592bb6 Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/glass_.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/glass_line.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glass_line.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glass_line.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/glass_line.png diff --git a/LuaIntro/chili/chili/skins/Glass/glass_line_vert.png b/LuaUI/Widgets_Evo/chili/skins/Lima/glass_line_vert.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/glass_line_vert.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/glass_line_vert.png diff --git a/LuaIntro/chili/chili/skins/Glass/hscrollbar.png b/LuaUI/Widgets_Evo/chili/skins/Lima/hscrollbar.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/hscrollbar.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/hscrollbar.png diff --git a/LuaIntro/chili/chili/skins/Glass/itemlistview_item_fg.png b/LuaUI/Widgets_Evo/chili/skins/Lima/itemlistview_item_fg.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/itemlistview_item_fg.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/itemlistview_item_fg.png diff --git a/LuaIntro/chili/chili/skins/Glass/node_selected.png b/LuaUI/Widgets_Evo/chili/skins/Lima/node_selected.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/node_selected.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/node_selected.png diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/panel.png b/LuaUI/Widgets_Evo/chili/skins/Lima/panel.png new file mode 100644 index 000000000..57eb1b046 Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/panel.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/panel.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/panel.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/panel.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/panel.psp diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/panel_.png b/LuaUI/Widgets_Evo/chili/skins/Lima/panel_.png new file mode 100644 index 000000000..766bff3c3 Binary files /dev/null and b/LuaUI/Widgets_Evo/chili/skins/Lima/panel_.png differ diff --git a/LuaIntro/chili/chili/skins/Glass/porgressbar_empty.png b/LuaUI/Widgets_Evo/chili/skins/Lima/porgressbar_empty.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/porgressbar_empty.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/porgressbar_empty.png diff --git a/LuaIntro/chili/chili/skins/Glass/progressbar_empty.png b/LuaUI/Widgets_Evo/chili/skins/Lima/progressbar_empty.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/progressbar_empty.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/progressbar_empty.png diff --git a/LuaIntro/chili/chili/skins/Glass/progressbar_full.png b/LuaUI/Widgets_Evo/chili/skins/Lima/progressbar_full.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/progressbar_full.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/progressbar_full.png diff --git a/LuaIntro/chili/chili/skins/Glass/scrollbar.png b/LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/scrollbar.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar.png diff --git a/LuaIntro/chili/chili/skins/Glass/scrollbar_knob.png b/LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar_knob.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/scrollbar_knob.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar_knob.png diff --git a/LuaIntro/chili/chili/skins/Glass/scrollbar_knob.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar_knob.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/scrollbar_knob.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/scrollbar_knob.psp diff --git a/LuaUI/Widgets_Evo/chili/skins/Lima/skin.lua b/LuaUI/Widgets_Evo/chili/skins/Lima/skin.lua new file mode 100644 index 000000000..4f824ed68 --- /dev/null +++ b/LuaUI/Widgets_Evo/chili/skins/Lima/skin.lua @@ -0,0 +1,232 @@ +--//============================================================================= +--// LimaSkin + +local skin = { + info = { + name = "Lima", + version = "0.1", + author = "Adrianulima", + } +} + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + +--//============================================================================= +--// + +skin.general = { + font = "JosefinSans-SemiBold.ttf", + fontsize = 13, + textColor = {1.0, 1.0, 1.0, 1.0}, + focusColor = {0.35, 0.35, 1.0, 0.9}, + borderColor = {1.0, 1.0, 1.0, 1.0}, + + --padding = {5, 5, 5, 5}, --// padding: left, top, right, bottom + backgroundColor = {0.1, 0.1, 0.1, 0.7}, + + font = { + outlineColor = {0,0,0,0.7}, + --autoOutlineColor = false, + shadow = true, + }, +} + +skin.icons = { + imageplaceholder = ":cl:placeholder.png", +} + +skin.button = { + TileImageFG = ":cl:glassFG.png", + TileImageBK = ":cl:glassBK.png", + tiles = {6,6,6,6}, + + textColor = {1,1,1,1}, + + padding = {5, 5, 5, 5}, + backgroundColor = {1, 1, 1, 1}, + focusColor = {1, 1, 1, 0.9}, + + DrawControl = DrawButton, +} + + +skin.combobox = { + TileImageFG = ":cl:glassFG.png", + TileImageBK = ":cl:glassBK.png", + TileImageArrow = ":cl:combobox_ctrl_arrow.png", + tiles = {6,6,6,6}, + padding = {10, 10, 26, 10}, + + textColor = {1,1,1,1}, + backgroundColor = {0.1, 0.1, 0.1, 0.7}, + + DrawControl = DrawComboBox, +} + + +skin.combobox_window = { + clone = "window"; + TileImage = ":cl:combobox_wnd.png", + padding = {4, 3, 3, 4}; +} + + +skin.combobox_scrollpanel = { + clone = "scrollpanel"; + borderColor = {1, 1, 1, 0}; + padding = {0, 0, 0, 0}; +} + + +skin.combobox_item = { + clone = "button"; +} + + +skin.editbox = { + textColor = {1.0, 1.0, 1.0, 1.0}, + backgroundColor = {0.1, 0.1, 0.1, 0.7}, + cursorColor = {0.35, 0.35, 1.0, 0.9}, +} + +skin.checkbox = { + TileImageFG = ":cl:checkbox_arrow.png", + TileImageBK = ":cl:checkbox.png", + tiles = {3,3,3,3}, + boxsize = 13, + + DrawControl = DrawCheckbox, +} + + +skin.imagelistview = { + imageFolder = "folder.png", + imageFolderUp = "folder_up.png", + + --DrawControl = DrawBackground, + + colorFG = {0.75,0.75,0.75,0.65}, + colorFG_selected = {1,1,1,0.65}, + imageFG = ":cl:itemlistview_item_fg.png", + + colorBK = {0.5, 0.5, 0.5, 0.1}, + colorBK_selected = {0.35,0.35,1,0.9}, + imageBK = ":cl:glassBK.png", + + tiles = {6,6,6,6}, + + DrawItemBackground = DrawItemBkGnd, +} +--[[ +skin.imagelistviewitem = { + imageFG = ":cl:glassFG.png", + imageBK = ":cl:glassBK.png", + tiles = {17,15,17,20}, + + padding = {12, 12, 12, 12}, + + DrawSelectionItemBkGnd = DrawSelectionItemBkGnd, +} +--]] + +skin.panel = { + TileImageFG = ":cl:glassFG.png", + TileImageBK = ":cl:glassBK.png", + tiles = {6,6,6,6}, + + DrawControl = DrawPanel, +} + +skin.progressbar = { + TileImageFG = ":cl:progressbar_full.png", + TileImageBK = ":cl:progressbar_empty.png", + tiles = {3,3,3,3}, + + DrawControl = DrawProgressbar, +} + +skin.scrollpanel = { + BorderTileImage = ":cl:panel.png", + bordertiles = {14,10,14,8}, + + TileImage = ":cl:scrollbar.png", + tiles = {6,3,6,3}, + KnobTileImage = ":cl:scrollbar_knob.png", + KnobTiles = {6,7,6,7}, + + HTileImage = ":cl:hscrollbar.png", + htiles = {3,6,3,6}, + HKnobTileImage = ":cl:scrollbar_knob.png", + HKnobTiles = {6,7,6,9}, + + KnobColorSelected = {0.35, 0.35, 1.0, 0.9}, + + padding = {1,1,1,1}, + + scrollbarSize = 11, + DrawControl = DrawScrollPanel, + DrawControlPostChildren = DrawScrollPanelBorder, +} + +skin.trackbar = { + TileImage = ":cl:trackbar.png", + tiles = {6, 3, 6, 3}, --// tile widths: left,top,right,bottom + + ThumbImage = ":cl:trackbar_thumb.png", + StepImage = ":cl:trackbar_step.png", + + hitpadding = {4, 4, 4, 4}, + + DrawControl = DrawTrackbar, +} + +skin.treeview = { + ImageNodeSelected = ":cl:node_selected.png", + tiles = {10,9,10,22}, + + ImageExpanded = ":cl:treeview_node_expanded.png", + ImageCollapsed = ":cl:treeview_node_collapsed.png", + treeColor = {0,0,0,0.4}, + + DrawNode = DrawTreeviewNode, + DrawNodeTree = DrawTreeviewNodeTree, +} + +skin.window = { + TileImage = ":cl:glass_.png", + tiles = {6, 6, 6, 6}, --// tile widths: left,top,right,bottom + padding = {5, 5, 5, 5}, + hitpadding = {0, 0, 0, 0}, + + captionColor = {0, 0, 0, 0.55}, + + boxes = { + resize = {-25, -25, -14, -14}, + drag = {0, 0, "100%", 24}, + }, + + NCHitTest = NCHitTestWithPadding, + NCMouseDown = WindowNCMouseDown, + NCMouseDownPostChildren = WindowNCMouseDownPostChildren, + + DrawControl = DrawWindow, + DrawDragGrip = DrawDragGrip, + DrawResizeGrip = DrawResizeGrip, +} + +skin.line = { + TileImage = ":cl:glass_line.png", + tiles = {0, 0, 0, 0}, + TileImageV = ":cl:glass_line_vert.png", + tilesV = {0, 0, 0, 0}, + DrawControl = DrawLine, +} + +skin.control = skin.general + + +--//============================================================================= +--// + +return skin diff --git a/LuaIntro/chili/chili/skins/Glass/trackbar.png b/LuaUI/Widgets_Evo/chili/skins/Lima/trackbar.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/trackbar.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/trackbar.png diff --git a/LuaIntro/chili/chili/skins/Glass/trackbar_step.png b/LuaUI/Widgets_Evo/chili/skins/Lima/trackbar_step.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/trackbar_step.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/trackbar_step.png diff --git a/LuaIntro/chili/chili/skins/Glass/trackbar_thumb.png b/LuaUI/Widgets_Evo/chili/skins/Lima/trackbar_thumb.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/trackbar_thumb.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/trackbar_thumb.png diff --git a/LuaIntro/chili/chili/skins/Glass/treeview_node.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/treeview_node.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node.psp diff --git a/LuaIntro/chili/chili/skins/Glass/treeview_node2.psp b/LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node2.psp similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/treeview_node2.psp rename to LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node2.psp diff --git a/LuaIntro/chili/chili/skins/Glass/treeview_node_collapsed.png b/LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node_collapsed.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/treeview_node_collapsed.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node_collapsed.png diff --git a/LuaIntro/chili/chili/skins/Glass/treeview_node_expanded.png b/LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node_expanded.png similarity index 100% rename from LuaIntro/chili/chili/skins/Glass/treeview_node_expanded.png rename to LuaUI/Widgets_Evo/chili/skins/Lima/treeview_node_expanded.png diff --git a/LuaUI/Widgets_Evo/chili/skins/Robocracy/skin.lua b/LuaUI/Widgets_Evo/chili/skins/Robocracy/skin.lua index 16a1ec2b4..e45ba8f70 100644 --- a/LuaUI/Widgets_Evo/chili/skins/Robocracy/skin.lua +++ b/LuaUI/Widgets_Evo/chili/skins/Robocracy/skin.lua @@ -9,6 +9,9 @@ local skin = { } } +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + --//============================================================================= --// @@ -17,7 +20,7 @@ skin.general = { borderColor = {1.0, 1.0, 1.0, 1.0}, font = { - font = SKINDIR .. "fonts/n019003l.pfb", + font = fontfile, color = {1,1,1,1}, outlineColor = {0.05,0.05,0.05,0.9}, outline = false, @@ -90,6 +93,8 @@ skin.checkbox = { } skin.editbox = { + hintFont = table.merge({color = {1,1,1,0.7}}, skin.general.font), + backgroundColor = {0.1, 0.1, 0.1, 0.7}, cursorColor = {1.0, 0.7, 0.1, 0.8}, @@ -212,9 +217,10 @@ skin.window = { padding = {13, 13, 13, 13}, hitpadding = {4, 4, 4, 4}, - color = {1, 1, 1, 0.7}, captionColor = {1, 1, 1, 0.45}, + backgroundColor = {0.1, 0.1, 0.1, 0.7}, + boxes = { resize = {-21, -21, -10, -10}, drag = {0, 0, "100%", 10}, @@ -258,4 +264,4 @@ skin.control = skin.general --//============================================================================= --// -return skin \ No newline at end of file +return skin diff --git a/LuaUI/Widgets_Evo/chili/skins/default/skin.lua b/LuaUI/Widgets_Evo/chili/skins/default/skin.lua index e0abcf3c6..27eb44ac8 100644 --- a/LuaUI/Widgets_Evo/chili/skins/default/skin.lua +++ b/LuaUI/Widgets_Evo/chili/skins/default/skin.lua @@ -9,6 +9,9 @@ local skin = { } } +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + --//============================================================================= --// Render Helpers @@ -78,8 +81,8 @@ end local function _DrawDragGrip(obj) - local x = obj.x + obj.borderThickness + 1 - local y = obj.y + obj.borderThickness + 1 + local x = obj.borderThickness + 1 + local y = obj.borderThickness + 1 local w = obj.dragGripSize[1] local h = obj.dragGripSize[2] @@ -111,8 +114,8 @@ local function _DrawResizeGrip(obj) end if (resizable) then - local x = obj.x + obj.width - obj.padding[3] --obj.borderThickness - 1 - local y = obj.y + obj.height - obj.padding[4] --obj.borderThickness - 1 + local x = obj.width - obj.padding[3] --obj.borderThickness - 1 + local y = obj.height - obj.padding[4] --obj.borderThickness - 1 local w = obj.resizeGripSize[1] local h = obj.resizeGripSize[2] @@ -147,8 +150,8 @@ end --// function DrawBorder(obj,state) - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local w = obj.width local h = obj.height local bt = obj.borderThickness @@ -196,8 +199,8 @@ end function _DrawBackground(obj) - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local w = obj.width local h = obj.height @@ -210,8 +213,8 @@ end function _DrawTabBackground(obj) - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local w = obj.width local h = obj.height local bt= 2 @@ -225,8 +228,8 @@ end local function _DrawTabBorder(obj, state) - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local w = obj.width local h = obj.height local bt= 2 @@ -263,19 +266,17 @@ function DrawButton(obj) gl.BeginEnd(GL.TRIANGLE_STRIP, DrawBorder, obj, obj.state) if (obj.caption) then - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height - obj.font:Print(obj.caption, x+w*0.5, y+h*0.5, "center", "center") + obj.font:Print(obj.caption, w*0.5, h*0.5, "center", "center") end end function _DrawTriangle(obj) local w = obj.width - local x = obj.x - local y = obj.y + local x = 0 + local y = 0 local w = obj.width local h = obj.height local bt = obj.borderThickness @@ -305,9 +306,9 @@ end function DrawEditBox(obj) gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBackground, obj, obj.state) if obj.state.focused then - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, obj.x, obj.y, obj.width, obj.height, obj.borderThickness, obj.focusColor, obj.focusColor) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0, 0, obj.width, obj.height, obj.borderThickness, obj.focusColor, obj.focusColor) else - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, obj.x, obj.y, obj.width, obj.height, obj.borderThickness, obj.borderColor2, obj.borderColor) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0, 0, obj.width, obj.height, obj.borderThickness, obj.borderColor2, obj.borderColor) end if (obj.text) then @@ -344,7 +345,7 @@ function DrawEditBox(obj) txt = txt:sub(1, lsize - 1) gl.Color(1,1,1,1) - obj.font:DrawInBox(txt, obj.x + clientX, obj.y + clientY, clientWidth, clientHeight, obj.align, obj.valign) + obj.font:DrawInBox(txt, clientX, clientY, clientWidth, clientHeight, obj.align, obj.valign) if obj.state.focused then local cursorTxt = obj.text:sub(obj.offset, obj.cursor - 1) @@ -361,7 +362,7 @@ function DrawEditBox(obj) local cc = obj.cursorColor gl.Color(cc[1], cc[2], cc[3], cc[4] * alpha) - gl.BeginEnd(GL.TRIANGLE_STRIP, DrawCursor, obj.x + cursorX + clientX - 1, obj.y + clientY, 3, clientHeight) + gl.BeginEnd(GL.TRIANGLE_STRIP, DrawCursor, cursorX + clientX - 1, clientY, 3, clientHeight) end end end @@ -375,7 +376,7 @@ end function DrawItemBkGnd(obj,x,y,w,h,state) if (state=="selected") then - gl.Color(0.15,0.15,0.9,1) + gl.Color(0.15,0.15,0.9,1) else gl.Color({0.8, 0.8, 1, 0.45}) end @@ -390,7 +391,7 @@ function DrawScrollPanel(obj) local contX,contY,contWidth,contHeight = unpack4(obj.contentArea) gl.PushMatrix() - gl.Translate(math.floor(obj.x + clientX),math.floor(obj.y + clientY),0) + gl.Translate(clientX, clientY,0) if obj._vscrollbar and (contHeight > 0) then local height = (not obj._hscrollbar and obj.height) or (obj.height - obj.scrollbarSize) @@ -409,16 +410,14 @@ end function DrawTrackbar(obj) local percent = (obj.value-obj.min)/(obj.max-obj.min) - local x = obj.x - local y = obj.y local w = obj.width local h = obj.height gl.Color(0,0,0,1) - gl.Rect(x,y+h*0.5,x+w,y+h*0.5+1) + gl.Rect(0,h*0.5,w,h*0.5+1) - local vc = y+h*0.5 --//verticale center - local pos = x+percent*w + local vc = h*0.5 --//verticale center + local pos = percent*w gl.Rect(pos-2,vc-h*0.5,pos+2,vc+h*0.5) end @@ -430,7 +429,7 @@ function DrawCheckbox(obj) local ty = vc gl.PushMatrix() - gl.Translate(obj.x,obj.y,0) + gl.Translate(0,0,0) obj.font:Print(obj.caption, tx, ty, "left", "center") @@ -452,7 +451,7 @@ end function DrawColorbars(obj) gl.PushMatrix() - gl.Translate(obj.x,obj.y,0) + gl.Translate(0,0,0) local barswidth = obj.width - (obj.height + 4) @@ -487,9 +486,9 @@ end function DrawLine(self) if (self.style:find("^v")) then - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawVLine, self.x + self.width * 0.5, self.y, self.height, 1, self.borderColor, self.borderColor2) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawVLine, self.width * 0.5, 0, self.height, 1, self.borderColor, self.borderColor2) else - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawHLine, self.x, self.y + self.height * 0.5, self.width, 1, self.borderColor, self.borderColor2) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawHLine, 0, self.height * 0.5, self.width, 1, self.borderColor, self.borderColor2) end end @@ -507,14 +506,14 @@ end local darkBlue = {0.0,0.0,0.6,0.9} function DrawTreeviewNode(self) if CompareLinks(self.treeview.selected,self) then - local x = self.x + self.clientArea[1] - local y = self.y + local x = self.clientArea[1] + local y = 0 local w = self.children[1].width local h = self.clientArea[2] + self.children[1].height gl.Color(0.1,0.1,1,0.55) - gl.Rect(x,y,x+w,y+h) - gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, x,y,w,h, 1, darkBlue, darkBlue) + gl.Rect(0,0,w,h) + gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawBorder, 0,0,w,h, 1, darkBlue, darkBlue) end end @@ -550,11 +549,11 @@ end function DrawTreeviewNodeTree(self) - local x1 = self.x + math.ceil(self.padding[1]*0.5) - local x2 = self.x + self.padding[1] - local y1 = self.y - local y2 = self.y + self.height - local y3 = self.y + self.padding[2] + math.ceil(self.children[1].height*0.5) + local x1 = math.ceil(self.padding[1]*0.5) + local x2 = self.padding[1] + local y1 = 0 + local y2 = self.height + local y3 = self.padding[2] + math.ceil(self.children[1].height*0.5) if (self.parent)and(CompareLinks(self,self.parent.nodes[#self.parent.nodes])) then y2 = y3 @@ -577,7 +576,7 @@ function DrawTreeviewNodeTree(self) local texInfo = gl.TextureInfo(image) or {xsize=1, ysize=1} local tw,th = texInfo.xsize, texInfo.ysize - _DrawTextureAspect(self.x,self.y,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) + _DrawTextureAspect(0,0,math.ceil(self.padding[1]),math.ceil(self.children[1].height) ,tw,th) gl.Texture(0,false) end @@ -589,8 +588,6 @@ function DrawTabBarItem(self) gl.BeginEnd(GL.TRIANGLE_STRIP, _DrawTabBorder, self, self.state) if self.caption then - local x = self.x - local y = self.y local w = self.width local h = self.height local bt= 2 @@ -599,7 +596,7 @@ function DrawTabBarItem(self) if self.state.selected then self.font:SetColor(self.focusColor) end - self.font:Print(self.caption, x+w*0.5, y+bt+h*0.5, "center", "center") + self.font:Print(self.caption, w*0.5, bt+h*0.5, "center", "center") if self.state.selected then self.font:SetColor(oldColor) end @@ -610,12 +607,12 @@ end --// skin.general = { - --font = "FreeSansBold.ttf", + font = fontfile2, textColor = {0,0,0,1}, font = { - outlineColor = {0,0,0,0.5}, - outline = false, + outlineColor = {0,0,0,0.7}, + outline = true, size = 13, }, @@ -687,7 +684,6 @@ skin.window = { DrawDragGrip = DrawDragGrip, DrawResizeGrip = DrawResizeGrip, - color = {0.1, 0.1, 0.1, 0.7}, hitpadding = {4, 4, 4, 4}, boxes = { resize = {-21, -21, -10, -10}, diff --git a/LuaUI/Widgets_Evo/chili/themes/theme.lua b/LuaUI/Widgets_Evo/chili/themes/theme.lua index b5c4f8972..0b80304b8 100644 --- a/LuaUI/Widgets_Evo/chili/themes/theme.lua +++ b/LuaUI/Widgets_Evo/chili/themes/theme.lua @@ -3,13 +3,13 @@ theme = {} -theme.name = "default" +theme.name = "Lima" --//============================================================================= --// Define default skins -local defaultSkin = "Evolved" +local defaultSkin = "Lima" --local defaultSkin = "DarkGlass" theme.skin = { diff --git a/LuaUI/Widgets_Evo/cmd_area_attack_tweak.lua b/LuaUI/Widgets_Evo/cmd_area_attack_tweak.lua new file mode 100644 index 000000000..6e0a625db --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_area_attack_tweak.lua @@ -0,0 +1,277 @@ +local version = "v1.121" + +function widget:GetInfo() + return { + name = "Area Attack Tweak", + desc = version .. " Tweak to area attack command:".. + "\n• automatically filter out ground target for AA units.".. + "\n• CTRL+Attack split targets among units.", + author = "msafwan", + date = "May 22, 2012", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +VFS.Include("LuaRules/Configs/customcmds.h.lua") + +local defaultCommands = { + [CMD.ATTACK] = true, + [CMD.AREA_ATTACK] = true, + [CMD.FIGHT] = true, + [CMD.PATROL] = true, + [CMD.GUARD] = true, + [CMD.MANUALFIRE] = true, + [CMD_REARM] = true, + [CMD_FIND_PAD] = true, + [CMD.MOVE] = true, + [CMD_UNIT_SET_TARGET] = true, + [CMD_UNIT_SET_TARGET_CIRCLE] = true, + -- [CMD.REMOVE] = true, + -- [CMD.INSERT] = true, +} + +local unitsSplitAttackQueue = {nil} --just in case user press SHIFT after doing split attack, we need to remove these queue +local handledCount = 0 + +function widget:CommandNotify(id, params, options) --ref: gui_tacticalCalculator.lua by msafwan, and central_build_AI.lua by Troy H. Creek + if not defaultCommands[id] or options.internal then --only process user's command + return false + end + if Spring.GetSelectedUnitsCount() == 0 then --skip whole thing if no selection + return false + end + local units + if handledCount > 0 then + --This remove all but 1st attack order from CTRL+Area_attack if user choose to append new order to unit (eg: SHIFT+move), + --this is to be consistent with bomber_command (rearm-able bombers), which only shoot 1st target and move on to next order. + + --Known limitation: not able to remove order if user queued faster than network delay (it need to see unit's current command queue) + units = Spring.GetSelectedUnits() + local unitID,attackList + for i=1,#units do + unitID = units[i] + attackList = GetAndRemoveHandledHistory(unitID) + if attackList and options.shift then + RevertAllButOneAttackQueue(unitID,attackList) + end + end + end + + if (id == CMD.ATTACK or id == CMD_UNIT_SET_TARGET or id == CMD_UNIT_SET_TARGET_CIRCLE) then + local cx, cy, cz, cr = params[1], params[2], params[3], params[4] + if (cr == nil) then --not area command + return false + end + if (cx == nil or cy == nil or cz == nil) then --outside of map + return false + end + --The following code filter out ground unit from dedicated AA, and + --split target among selected unit if user press CTRL+Area_attack + local cx2, cy2, cz2 = params[4], params[5], params[6] + units = units or Spring.GetSelectedUnits() + local targetUnits + if cz2 then + targetUnits = Spring.GetUnitsInRectangle(math.min(cx,cx2), math.min(cz,cz2), math.max(cx,cx2), math.max(cz,cz2)) + else + targetUnits = Spring.GetUnitsInCylinder(cx, cz, cr) + end + local antiAirUnits,normalUnits = GetAAUnitList(units) + local airTargets, allTargets = ReturnAllAirTarget(targetUnits, Spring.GetUnitAllyTeam(units[1]),(#antiAirUnits>1)) -- get all air target for selected area-command + if #allTargets>0 then --skip if no target + return ReIssueCommandsToUnits(antiAirUnits,airTargets,normalUnits,allTargets,id,options) + end + end + return false +end + +function widget:UnitGiven(unitID) + GetAndRemoveHandledHistory(unitID) +end + +function widget:UnitDestroyed(unitID) + GetAndRemoveHandledHistory(unitID) +end +-------------------------------------------------------------------------------- +function GetAndRemoveHandledHistory(unitID) + if unitsSplitAttackQueue[unitID] then + local attackList = unitsSplitAttackQueue[unitID] + unitsSplitAttackQueue[unitID] = nil + handledCount = handledCount - 1 + return attackList + end + return nil +end + +function RevertAllButOneAttackQueue(unitID,attackList) + local queue = Spring.GetUnitCommands(unitID, -1) + if queue then + local toRemoveCount = 0 + local queueToRemove = {} + for j=1,#queue do + command = queue[j] + if command.id == CMD.ATTACK and attackList[command.params[1] ] then + if toRemoveCount > 0 then --skip first queue + queueToRemove[toRemoveCount] = command.tag + end + toRemoveCount = toRemoveCount + 1 + end + end + Spring.GiveOrderToUnit (unitID,CMD.REMOVE, queueToRemove,{}) + end +end + +function ReturnAllAirTarget(targetUnits, selectedAlly,checkAir) + local filteredTargets = {} + local nonFilteredTargets = {} + for i=1, #targetUnits,1 do --see if targets can fly and if they are enemy or ally. + local unitID = targetUnits[i] + local enemyAllyID = Spring.GetUnitAllyTeam(unitID) + if (selectedAlly ~= enemyAllyID) then --differentiate between selected unit, targeted units, and enemyteam. Filter out ally and owned units + if checkAir then + local unitDefID = Spring.GetUnitDefID(unitID) + local unitDef = UnitDefs[unitDefID] + if not unitDef then + if GetDotsFloating(unitID) then --check & remember floating radar dots in new table. + filteredTargets[#filteredTargets +1] = unitID + end + else + if unitDef["canFly"] then --check & remember flying units in new table + filteredTargets[#filteredTargets +1] = unitID + end + end + end + nonFilteredTargets[#nonFilteredTargets +1] = unitID --also copy all target to a non-filtered table + end + end + return filteredTargets, nonFilteredTargets +end + +function GetAAUnitList(units) + local antiAirUnits = {nil} + local normalUnits = {nil} + for i=1, #units,1 do --catalog AA and non-AA + local unitID = units[i] + local unitDefID = Spring.GetUnitDefID(unitID) + local unitDef_primaryWeapon = UnitDefs[unitDefID].weapons[1] + if (unitDef_primaryWeapon~= nil) then + local primaryWeapon_target = UnitDefs[unitDefID].weapons[1].onlyTargets + local exclusiveAA = (primaryWeapon_target["fixedwing"] and primaryWeapon_target["gunship"]) and + not (primaryWeapon_target["sink"] or primaryWeapon_target["land"] or primaryWeapon_target["sub"]) + --[[ + Spring.Echo(UnitDefs[unitDefID].weapons[1].onlyTargets) + for name,content in pairs(UnitDefs[unitDefID].weapons[1].onlyTargets) do + Spring.Echo(name) + Spring.Echo(content) + end + --]] + if (exclusiveAA) then + antiAirUnits[#antiAirUnits +1]= unitID + else + normalUnits[#normalUnits +1]= unitID + end + else + normalUnits[#normalUnits +1]= unitID + end + end + return antiAirUnits, normalUnits +end + +function ReIssueCommandsToUnits(antiAirUnits,airTargets,normalUnits,allTargets,cmdID,options) + local isHandled = false + if options.ctrl then -- split attacks between units + --split between AA and ground, + IssueSplitedCommand(antiAirUnits,airTargets,cmdID,options) + IssueSplitedCommand(normalUnits,allTargets,cmdID,options) + isHandled = true + else -- normal queue + if #antiAirUnits>1 then + --split between AA and ground, + IssueCommand(antiAirUnits,airTargets,cmdID,options) + IssueCommand(normalUnits,allTargets,cmdID,options) + isHandled = true + else + isHandled = false --nothing need to be done, let spring handle + end + end + return isHandled +end +-------------------------------------------------------------------------------- +function IssueCommand(selectedUnits,allTargets,cmdID,options) + if #allTargets>=1 then + local attackCommandListAll = PrepareCommandArray(allTargets, cmdID, options,1) -- prepare a normal queue (like regular SHIFT) + Spring.GiveOrderArrayToUnitArray (selectedUnits, attackCommandListAll) + end +end + +function IssueSplitedCommand(selectedUnits,allTargets,cmdID,options) + if #allTargets>=1 then + local targetsUnordered = {} + if cmdID==CMD.ATTACK then --and not CMD_UNIT_SET_TARGET. Note: only CMD.ATTACK support split attack queue, and in such case we also need to remember the queue so we can revert later if user decided to do SHIFT+Move + for i=1,#allTargets do + targetsUnordered[allTargets[i] ] = true + end + for i=1, #selectedUnits do + unitsSplitAttackQueue[selectedUnits[i] ] = targetsUnordered --note: all units in this loop was refer to same table to avoid duplication + handledCount = handledCount + 1 + end + end + for i=1, #selectedUnits do + -- local noAttackQueue = queueException[Spring.GetUnitDefID(selectedUnits[i])] + local attackCommandListAll = PrepareCommandArray(allTargets, cmdID, options,i,true,noAttackQueue) --prepare a shuffled queue for target splitting + Spring.GiveOrderArrayToUnitArray ({selectedUnits[i]}, attackCommandListAll) + end + end +end +-------------------------------------------------------------------------------- +function GetDotsFloating (unitID) --ref: gui_vertLineAid.lua by msafwan + local x, y, z = Spring.GetUnitPosition(unitID) + if x == nil then + return false + end + local isFloating = false + local groundY = Spring.GetGroundHeight(x,z) + local surfaceY = math.max (groundY, 0) --//select water, or select terrain height depending on which is higher. + if (y-surfaceY) >= 100 then --//mark unit as flying if it appears to float far above surface, if this fail then player can force attack it with single-(non-area)-attack or scout its ID first. + isFloating = true + end + return isFloating +end + +function PrepareCommandArray (targetUnits, cmdID, options,indx,shuffle) + indx = LoopAroundIndex(indx, #targetUnits) + local stepSkip = 1 + if shuffle then + stepSkip = (#targetUnits%(2))*-1 +3 + --stepSkip is 3 if #targetUnits is EVEN number (eg: 4,6,8), or 2 if #targetUnits is ODD (eg: 3,5,7) + --this will shuffle the target sequence appropriately + end + local attackCommandList = {} + local j = 1 + attackCommandList[j] = {cmdID,{targetUnits[indx],},{((options.shift and "shift") or nil),}} + if cmdID == CMD.ATTACK then + for i=1, #targetUnits-1, 1 do + j= j + 1 + indx = indx + stepSkip --stepSkip>1 will shuffle the queue + indx = LoopAroundIndex(indx, #targetUnits) + attackCommandList[j] = {cmdID,{targetUnits[indx],},{"shift",}} --every unit get to attack every target + end + end + return attackCommandList +end +-------------------------------------------------------------------------------- +function LoopAroundIndex(indx, maxIndex) + ---- + -- Example: + -- if maxIndex is 3 and input indx is 1,2,3,4,5,6 + -- the following 3 line of code will convert indx into: 1,2,3,1,2,3 (which will avoid "index out-of-bound" case) + indx = indx - 1 + indx = indx%(maxIndex) + indx = indx + 1 + -- also: if indx is (maxIndex + extraValue), then it would convert into: (1 + extraValue). + return indx +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_autocheat.lua b/LuaUI/Widgets_Evo/cmd_autocheat.lua new file mode 100644 index 000000000..07f48bc33 --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_autocheat.lua @@ -0,0 +1,20 @@ +function widget:GetInfo() + return { + name = "Auto Cheat and Globallos", + desc = "Sends cheat and globallos so I don't have to", + author = "Forboding Angel", + date = "01-21-2014", + license = "GPL v2 or later", + layer = 5, + enabled = false + } +end + +function widget:Initialize() + Spring.Echo([[I'm a filthy cheater]]) + + Spring.SendCommands("cheat") + Spring.SendCommands("globallos") + + widgetHandler:RemoveWidget() +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_customformations2.lua b/LuaUI/Widgets_Evo/cmd_customformations2.lua new file mode 100644 index 000000000..8be38a84d --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_customformations2.lua @@ -0,0 +1,1352 @@ +function widget:GetInfo() + return { + name = "CustomFormations2", + desc = "Allows you to draw a formation line:".. + "\n• mouse drag draw various command on ground.".. + "\n• ALT+Attack draw attack command on the ground.", + author = "Niobium, modified by Skasi", -- Based on 'Custom Formations' by jK and gunblob + version = "v3.4", -- With modified dot drawing from v4.3 + date = "Mar, 2010", + license = "GNU GPL, v2 or later", + layer = 1000000, + enabled = true, + handler = true, + } +end + +VFS.Include("LuaRules/Configs/customcmds.h.lua") + +-------------------------------------------------------------------------------- +-- Epic Menu Options +-------------------------------------------------------------------------------- + +options_path = 'Settings/Interface/Command Visibility/Formations' +options_order = { 'drawmode', 'linewidth', 'dotsize' } +options = { + drawmode = { + name = 'Draw mode', + -- desc is not supported here :( + -- desc = 'Change the formation display. Formations are drawn by moving the mouse while the mouse button is pressed. Supported commands are Move, Fight, Patrol, Manual attacks, Jump and with the ALT key held down Attack, Set target and Unload.' + -- (new) players might not even know about custom formations, so ultimately this should probably be displayed above these options + type = 'radioButton', + value = 'lines', + items={ + {key='lines', name='Lines only', desc='Draw stippled lines along the drawn formation'}, + {key='dots', name='Dots only', desc='Draw dots at command locations'}, + {key='both', name='Draw both', desc='Draw lines and dots'}, + }, + }, + + linewidth = { + name = 'Width of lines', + type = 'number', + value = 2, + min = 1, max = 2, step=1, + -- For some reason drawing lines fails for numbers higher than 2. + }, + + dotsize = { + name = 'Size of dots', + type = 'number', + value = 1, + min = 0.5, max = 2, step=0.1, + }, +} + +-------------------------------------------------------------------------------- +-- User Configurable Constants +-------------------------------------------------------------------------------- +-- Minimum spacing between commands (Squared) when drawing a path for a single unit, must be >16*16 (Or orders overlap and cancel) +local minPathSpacingSq = 50 * 50 + +-- Minimum line length to cause formation move instead of single-click-style order +local minFormationLength = 20 + +-- How long should algorithms take. (~0.1 gives visible stutter, default: 0.05) +local maxHngTime = 0.05 -- Desired maximum time for hungarian algorithm +local maxNoXTime = 0.05 -- Strict maximum time for backup algorithm + +local defaultHungarianUnits = 20 -- Need a baseline to start from when no config data saved +local minHungarianUnits = 10 -- If we kept reducing maxUnits it can get to a point where it can never increase, so we enforce minimums on the algorithms. +local unitIncreaseThresh = 0.85 -- We only increase maxUnits if the units are great enough for time to be meaningful + +-- Alpha loss per second after releasing mouse +local lineFadeRate = 2.0 + +-- What commands are eligible for custom formations +local formationCmds = { + [CMD.MOVE] = true, + [CMD.FIGHT] = true, + [CMD.ATTACK] = true, + [CMD.PATROL] = true, + [CMD.UNLOAD_UNIT] = true, + [CMD_JUMP] = true, -- jump + [CMD_UNIT_SET_TARGET] = true, -- settarget + [CMD_UNIT_SET_TARGET_CIRCLE] = true, -- settarget +} + +-- What commands require alt to be held (Must also appear in formationCmds) +local requiresAlt = { + [CMD.ATTACK] = true, + [CMD.UNLOAD_UNIT] = true, + [CMD_UNIT_SET_TARGET] = true, -- settarget + [CMD_UNIT_SET_TARGET_CIRCLE] = true, -- settarget +} + +-- Context-based default commands that can be overridden (i.e. guard when mouseover unit) +-- If the mouse remains on the same target for both Press/Release then the formation is ignored and original command is issued. +-- Normal logic will follow after override, i.e. must be a formationCmd to get formation, alt must be held if requiresAlt, etc. +local overrideCmds = { + [CMD.GUARD] = CMD.MOVE, +} + +-- What commands are issued at a position or unit/feature ID (Only used by GetUnitPosition) +local positionCmds = { + [CMD.MOVE]=true, [CMD.ATTACK]=true, [CMD.RECLAIM]=true, [CMD.RESTORE]=true, [CMD.RESURRECT]=true, + [CMD.PATROL]=true, [CMD.CAPTURE]=true, [CMD.FIGHT]=true, [CMD.MANUALFIRE]=true, [CMD_JUMP]=true, -- jump + [CMD.UNLOAD_UNIT]=true, [CMD.UNLOAD_UNITS]=true,[CMD.LOAD_UNITS]=true, [CMD.GUARD]=true, [CMD.AREA_ATTACK] = true, +} + +-------------------------------------------------------------------------------- +-- Globals +-------------------------------------------------------------------------------- +local maxHungarianUnits = defaultHungarianUnits -- Also set when loading config + +local fNodes = {} -- Formation nodes, filled as we draw +local fDists = {} -- fDists[i] = distance from node 1 to node i +local totaldxy = 0 -- Measure of distance mouse has moved, used to unjag lines drawn in minimap +local lineLength = 0 -- Total length of the line + +local dimmCmd = nil -- The dimming command (Used for color) +local dimmNodes = {} -- The current nodes of dimming line +local dimmAlpha = 0 -- The current alpha of dimming line + +local pathCandidate = false -- True if we should start a path on mouse move +local draggingPath = false -- True if we are dragging a path for unit(s) to follow +local lastPathPos = nil -- The last point added to the path, used for min-distance check + +local overriddenCmd = nil -- The command we ignored in favor of move +local overriddenTarget = nil -- The target (for params) we ignored + +local usingCmd = nil -- The command to execute across the line +local usingRMB = false -- If the command is the default it uses right click, otherwise it is active and uses left click +local inMinimap = false -- Is the line being drawn in the minimap +local endShift = false -- True to reset command when shift is released + +local MiniMapFullProxy = (Spring.GetConfigInt("MiniMapFullProxy", 0) == 1) + +-------------------------------------------------------------------------------- +-- Speedups +-------------------------------------------------------------------------------- +local GL_LINE_STRIP = GL.LINE_STRIP +local glVertex = gl.Vertex +local glLineStipple = gl.LineStipple +local glLineWidth = gl.LineWidth +local glColor = gl.Color +local glBeginEnd = gl.BeginEnd +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glScale = gl.Scale +local glTranslate = gl.Translate +local glLoadIdentity = gl.LoadIdentity + +local spGetActiveCommand = Spring.GetActiveCommand +local spSetActiveCommand = Spring.SetActiveCommand +local spGetDefaultCommand = Spring.GetDefaultCommand +local spFindUnitCmdDesc = Spring.FindUnitCmdDesc +local spGetModKeyState = Spring.GetModKeyState +local spGetInvertQueueKey = Spring.GetInvertQueueKey +local spIsAboveMiniMap = Spring.IsAboveMiniMap +local spGetUnitDefID = Spring.GetUnitDefID +local spGiveOrder = Spring.GiveOrder +local spGetUnitIsTransporting = Spring.GetUnitIsTransporting +local spGetCommandQueue = Spring.GetCommandQueue +local spGetUnitPosition = Spring.GetUnitPosition +local spTraceScreenRay = Spring.TraceScreenRay +local spGetGroundHeight = Spring.GetGroundHeight +local spGetFeaturePosition = Spring.GetFeaturePosition +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetUnitHeight = Spring.GetUnitHeight +local spGetCameraPosition = Spring.GetCameraPosition +local spGetViewGeometry = Spring.GetViewGeometry +local spTraceScreenRay = Spring.TraceScreenRay + + +local mapSizeX, mapSizeZ = Game.mapSizeX, Game.mapSizeZ +local maxUnits = Game.maxUnits + +local osclock = os.clock +local tsort = table.sort +local floor = math.floor +local ceil = math.ceil +local sqrt = math.sqrt +local sin = math.sin +local cos = math.cos +local max = math.max +local huge = math.huge +local pi2 = 2*math.pi + +local CMD_INSERT = CMD.INSERT +local CMD_MOVE = CMD.MOVE +local CMD_ATTACK = CMD.ATTACK +local CMD_UNLOADUNIT = CMD.UNLOAD_UNIT +local CMD_UNLOADUNITS = CMD.UNLOAD_UNITS +local CMD_OPT_ALT = CMD.OPT_ALT +local CMD_OPT_CTRL = CMD.OPT_CTRL +local CMD_OPT_META = CMD.OPT_META +local CMD_OPT_SHIFT = CMD.OPT_SHIFT +local CMD_OPT_RIGHT = CMD.OPT_RIGHT + +local keyShift = 304 +local selectedUnits = Spring.GetSelectedUnits() +local selectedUnitsCount = Spring.GetSelectedUnitsCount() + +-------------------------------------------------------------------------------- +-- Helper Functions +-------------------------------------------------------------------------------- +local function GetModKeys() + + local alt, ctrl, meta, shift = spGetModKeyState() + + if spGetInvertQueueKey() then -- Shift inversion + shift = not shift + end + + return alt, ctrl, meta, shift +end +local function GetUnitFinalPosition(uID) + + local ux, uy, uz = spGetUnitPosition(uID) + + local cmds = spGetCommandQueue(uID, -1) + for i = #cmds, 1, -1 do + + local cmd = cmds[i] + if (cmd.id < 0) or positionCmds[cmd.id] then + + local params = cmd.params + if #params >= 3 then + return params[1], params[2], params[3] + else + if #params == 1 then + + local pID = params[1] + local px, py, pz + + if pID > maxUnits then + px, py, pz = spGetFeaturePosition(pID - maxUnits) + else + px, py, pz = spGetUnitPosition(pID) + end + + if px then + return px, py, pz + end + end + end + end + end + + return ux, uy, uz +end +local function SetColor(cmdID, alpha) + if cmdID == CMD_MOVE then glColor(0.5, 1.0, 0.5, alpha) -- Green + elseif cmdID == CMD_ATTACK then glColor(1.0, 0.2, 0.2, alpha) -- Red + elseif cmdID == CMD_UNLOADUNIT then glColor(1.0, 1.0, 0.0, alpha) -- Yellow + elseif cmdID == CMD_UNIT_SET_TARGET then glColor(1, 0.75, 0, alpha) -- Orange + elseif cmdID == CMD_UNIT_SET_TARGET_CIRCLE then glColor(1, 0.75, 0, alpha) -- Orange + else glColor(0.5, 0.5, 1.0, alpha) -- Blue + end +end +local function CanUnitExecute(uID, cmdID) + + if cmdID == CMD_UNLOADUNIT then + local transporting = spGetUnitIsTransporting(uID) + return (transporting and #transporting > 0) + end + + return (spFindUnitCmdDesc(uID, cmdID) ~= nil) +end +local function GetExecutingUnits(cmdID) + local units = {} + for i = 1, selectedUnitsCount do + local uID = selectedUnits[i] + if CanUnitExecute(uID, cmdID) then + units[#units + 1] = uID + end + end + return units +end + +local function AddFNode(pos) + + local px, pz = pos[1], pos[3] + if px < 0 or pz < 0 or px > mapSizeX or pz > mapSizeZ then + return false + end + + local n = #fNodes + if n == 0 then + fNodes[1] = pos + fDists[1] = 0 + else + local prevNode = fNodes[n] + local dx, dz = px - prevNode[1], pz - prevNode[3] + local distSq = dx*dx + dz*dz + if distSq == 0.0 then -- Don't add if duplicate + return false + end + + local dis = sqrt(distSq) + + fNodes[n + 1] = pos + fDists[n + 1] = fDists[n] + dis + lineLength = lineLength + dis + end + + totaldxy = 0 + return true +end + +local function HasWaterWeapon(UnitDefID) + local haswaterweapon = false + local numweapons = #(UnitDefs[UnitDefID]["weapons"]) + for j=1, numweapons do + local weapondefid = UnitDefs[UnitDefID]["weapons"][j]["weaponDef"] + local iswaterweapon = WeaponDefs[weapondefid]["waterWeapon"] + if iswaterweapon then haswaterweapon=true end + end + return haswaterweapon +end + +local function GetInterpNodes(mUnits) + + local number = #mUnits + local spacing = fDists[#fNodes] / (#mUnits - 1) + + local haswaterweapon = {} + for i=1, number do + local UnitDefID = spGetUnitDefID(mUnits[i]) + haswaterweapon[i] = HasWaterWeapon(UnitDefID) + end + --result of this and code below is that the height of the aimpoint for a unit [i] will be: + --(a) on GetGroundHeight(units aimed position), if the unit has a waterweapon + --(b) on whichever is highest out of water surface (=0) and GetGroundHeight(units aimed position), if the unit does not have water weapon. + --in BA this must match the behaviour of prevent_range_hax or commands will get modified. + + local interpNodes = {} + + local sPos = fNodes[1] + local sX = sPos[1] + local sZ = sPos[3] + local sDist = 0 + + local eIdx = 2 + local ePos = fNodes[2] + local eX = ePos[1] + local eZ = ePos[3] + local eDist = fDists[2] + + local sY + if haswaterweapon[1] then + sY = spGetGroundHeight(sX, sZ) + else + sY = math.max(0,spGetGroundHeight(sX,sZ)) + end + interpNodes[1] = {sX, sY, sZ} + + for n = 1, number - 2 do + + local reqDist = n * spacing + while (reqDist > eDist) do + + sX = eX + sZ = eZ + sDist = eDist + + eIdx = eIdx + 1 + ePos = fNodes[eIdx] + eX = ePos[1] + eZ = ePos[3] + eDist = fDists[eIdx] + end + + local nFrac = (reqDist - sDist) / (eDist - sDist) + local nX = sX * (1 - nFrac) + eX * nFrac + local nZ = sZ * (1 - nFrac) + eZ * nFrac + local nY + if haswaterweapon[number+1] then + nY = spGetGroundHeight(nX, nZ) + else + nY = math.max(0,spGetGroundHeight(nX, nZ)) + end + interpNodes[n + 1] = {nX, nY, nZ} + end + + ePos = fNodes[#fNodes] + eX = ePos[1] + eZ = ePos[3] + local eY + if haswaterweapon[number] then eY=spGetGroundHeight(eX, eZ) else eY=math.max(0,spGetGroundHeight(eX, eZ)) end + interpNodes[number] = {eX, eY, eZ} + + --DEBUG for i=1,number do Spring.Echo(interpNodes[i]) end + + return interpNodes +end +local function GetCmdOpts(alt, ctrl, meta, shift, right) + + local opts = { alt=alt, ctrl=ctrl, meta=meta, shift=shift, right=right } + local coded = 0 + + if alt then coded = coded + CMD_OPT_ALT end + if ctrl then coded = coded + CMD_OPT_CTRL end + if meta then coded = coded + CMD_OPT_META end + if shift then coded = coded + CMD_OPT_SHIFT end + if right then coded = coded + CMD_OPT_RIGHT end + + opts.coded = coded + return opts +end + +local function GiveNotifyingOrder(cmdID, cmdParams, cmdOpts) + if widgetHandler:CommandNotify(cmdID, cmdParams, cmdOpts) then + return + end + spGiveOrder(cmdID, cmdParams, cmdOpts.coded) +end + +local function GiveNonNotifyingOrder(cmdID, cmdParams, cmdOpts) + spGiveOrder(cmdID, cmdParams, cmdOpts.coded) +end + +local function GiveNotifyingOrderToUnit(uID, cmdID, cmdParams, cmdOpts) + local widgets = widgetHandler.widgets + for i=1, #widgets do + local w = widgets[i] + if w.UnitCommandNotify and w:UnitCommandNotify(uID, cmdID, cmdParams, cmdOpts) then + return + end + end + + spGiveOrderToUnit(uID, cmdID, cmdParams, cmdOpts.coded) +end + + +function widget:SelectionChanged(sel) + selectedUnits = sel + selectedUnitsCount = Spring.GetSelectedUnitsCount() +end + +-------------------------------------------------------------------------------- +-- Mouse/keyboard Callins +-------------------------------------------------------------------------------- +function widget:MousePress(mx, my, mButton) + + lineLength = 0 + -- Where did we click + inMinimap = spIsAboveMiniMap(mx, my) + if inMinimap and not MiniMapFullProxy then return false end + + -- Get command that would've been issued + local _, activeCmdID = spGetActiveCommand() + if activeCmdID then + if mButton ~= 1 then + return false + end + + usingCmd = activeCmdID + usingRMB = false + else + if mButton ~= 3 then + return false + end + + local _, defaultCmdID = spGetDefaultCommand() + if not defaultCmdID then return false end + + local overrideCmdID = overrideCmds[defaultCmdID] + if overrideCmdID then + + local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) + if targType == 'unit' then + overriddenCmd = defaultCmdID + overriddenTarget = targID + elseif targType == 'feature' then + overriddenCmd = defaultCmdID + overriddenTarget = targID + maxUnits + else + -- We can't reversibly override a command if we can't get the original target, so we give up overriding it. + return false + end + + usingCmd = overrideCmdID + else + overriddenCmd = nil + overriddenTarget = nil + + usingCmd = defaultCmdID + end + + usingRMB = true + end + + -- Without this, the unloads issued will use the area of the last area unload + if usingCmd == CMD_UNLOADUNITS then + usingCmd = CMD_UNLOADUNIT + end + + -- Is this command eligible for a custom formation ? + local alt, ctrl, meta, shift = GetModKeys() + if not (formationCmds[usingCmd] and (alt or not requiresAlt[usingCmd])) then + return false + end + + -- Get clicked position + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if not pos then return false end + + -- Setup formation node array + if not AddFNode(pos) then return false end + + -- Is this line a path candidate (We don't do a path off an overriden command) + pathCandidate = (not overriddenCmd) and (selectedUnitsCount==1 or (alt and not requiresAlt[usingCmd])) + + -- We handled the mouse press + return true +end +function widget:MouseMove(mx, my, dx, dy, mButton) + -- It is possible for MouseMove to fire after MouseRelease + if #fNodes == 0 then + return false + end + + -- Minimap-specific checks + if inMinimap then + totaldxy = totaldxy + dx*dx + dy*dy + if (totaldxy < 5) or not spIsAboveMiniMap(mx, my) then + return false + end + end + + -- Get clicked position + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if not pos then return false end + + -- Add the new formation node + if not AddFNode(pos) then return false end + + -- Have we started drawing a line? + if #fNodes == 2 then + + -- We have enough nodes to start drawing now + widgetHandler:UpdateWidgetCallIn("DrawInMiniMap", self) + widgetHandler:UpdateWidgetCallIn("DrawWorld", self) + + -- If the line is a path, start the units moving to this node + if pathCandidate then + + local alt, ctrl, meta, shift = GetModKeys() + local cmdOpts = GetCmdOpts(false, ctrl, meta, shift, usingRMB) -- using alt uses springs box formation, so we set it off always + GiveNotifyingOrder(usingCmd, pos, cmdOpts) + lastPathPos = pos + + draggingPath = true + end + else + -- Are we dragging a path? + if draggingPath then + + local dx, dz = pos[1] - lastPathPos[1], pos[3] - lastPathPos[3] + if (dx*dx + dz*dz) > minPathSpacingSq then + + local alt, ctrl, meta, shift = GetModKeys() + local cmdOpts = GetCmdOpts(false, ctrl, meta, true, usingRMB) -- using alt uses springs box formation, so we set it off always + GiveNonNotifyingOrder(usingCmd, pos, cmdOpts) + lastPathPos = pos + end + end + end + + return false +end +function widget:MouseRelease(mx, my, mButton) + + -- It is possible for MouseRelease to fire after MouseRelease + if #fNodes == 0 then + return false + end + + -- Modkeys / command reset + local alt, ctrl, meta, shift = GetModKeys() + if not usingRMB then + if shift then + endShift = true -- Reset on release of shift + else + spSetActiveCommand(0) -- Reset immediately + end + end + + -- Are we going to use the drawn formation? + local usingFormation = true + + -- Override checking + if overriddenCmd then + + local targetID + local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) + if targType == 'unit' then + targetID = targID + elseif targType == 'feature' then + targetID = targID + maxUnits + end + + if targetID and targetID == overriddenTarget then + + -- Signal that we are no longer using the drawn formation + usingFormation = false + + -- Process the original command instead + local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) + GiveNotifyingOrder(overriddenCmd, {overriddenTarget}, cmdOpts) + end + end + + -- Using path? If so then we do nothing + if draggingPath then + + draggingPath = false + + -- Using formation? If so then it's time to calculate and issue orders. + elseif usingFormation then + + -- Add final position (Sometimes we don't get the last MouseMove before this MouseRelease) + if (not inMinimap) or spIsAboveMiniMap(mx, my) then + local _, pos = spTraceScreenRay(mx, my, true, inMinimap) + if pos then + AddFNode(pos) + end + end + + -- Get command options + local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) + + -- Single click ? (no line drawn) + --if (#fNodes == 1) then + if fDists[#fNodes] < minFormationLength then + -- We should check if any units are able to execute it, + -- but the order is small enough network-wise that the tiny bug potential isn't worth it. + GiveNotifyingOrder(usingCmd, fNodes[1], cmdOpts) + else + -- Order is a formation + -- Are any units able to execute it? + local mUnits = GetExecutingUnits(usingCmd) + if #mUnits > 0 then + + local interpNodes = GetInterpNodes(mUnits) + + local orders + if (#mUnits <= maxHungarianUnits) then + orders = GetOrdersHungarian(interpNodes, mUnits, #mUnits, shift and not meta) + else + orders = GetOrdersNoX(interpNodes, mUnits, #mUnits, shift and not meta) + end + + if meta then + local altOpts = GetCmdOpts(true, false, false, false, false) + for i = 1, #orders do + local orderPair = orders[i] + local orderPos = orderPair[2] + GiveNotifyingOrderToUnit(orderPair[1], CMD_INSERT, {0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3]}, altOpts) + end + else + for i = 1, #orders do + local orderPair = orders[i] + GiveNotifyingOrderToUnit(orderPair[1], usingCmd, orderPair[2], cmdOpts) + end + end + end + end + end + + if #fNodes > 1 then + dimmCmd = usingCmd + dimmNodes = fNodes + dimmAlpha = 1.0 + widgetHandler:UpdateWidgetCallIn("Update", self) + end + + fNodes = {} + fDists = {} + + return true +end +function widget:KeyRelease(key) + if (key == keyShift) and endShift then + spSetActiveCommand(0) + endShift = false + end +end + +-------------------------------------------------------------------------------- +-- Drawing +-------------------------------------------------------------------------------- + +local function tVerts(verts) + for i = 1, #verts do + local v = verts[i] + if v[1] and v[2] and v[3] then + glVertex(v[1], v[2], v[3]) + end + end +end + +local function tVertsMinimap(verts) + for i = 1, #verts do + local v = verts[i] + if v[1] and v[3] then + glVertex(v[1], v[3], 1) + end + end +end + +local function DrawFilledCircle(pos, size, cornerCount) + glPushMatrix() + glTranslate(pos[1], pos[2], pos[3]) + glBeginEnd(GL.TRIANGLE_FAN, function() + glVertex(0,0,0) + for t = 0, pi2, pi2 / cornerCount do + glVertex(sin(t) * size, 0, cos(t) * size) + end + end) + glPopMatrix() +end + +local function DrawFilledCircleOutFading(pos, size, cornerCount) + glPushMatrix() + glTranslate(pos[1], pos[2], pos[3]) + glBeginEnd(GL.TRIANGLE_FAN, function() + SetColor(usingCmd, 1) + glVertex(0,0,0) + SetColor(usingCmd, 0) + for t = 0, pi2, pi2 / cornerCount do + glVertex(sin(t) * size, 0, cos(t) * size) + end + end) + -- draw extra glow as base + -- has hardly any effect but doubles gpuTime, so disabled for now + -- glBeginEnd(GL.TRIANGLE_FAN, function() + -- SetColor(usingCmd, 1/15) + -- glVertex(0,0,0) + -- SetColor(usingCmd, 0) + -- local baseSize = size * 2.8 + -- for t = 0, pi2, pi2 / 8 do + -- glVertex(sin(t) * baseSize, 0, cos(t) * baseSize) + -- end + -- end) + glPopMatrix() +end + +local function DrawFormationDots(vertFunction, zoomY, unitCount) + local currentLength = 0 + local lengthPerUnit = lineLength / (unitCount-1) + local lengthUnitNext = lengthPerUnit + local dotSize = sqrt(zoomY*0.1)*options.dotsize.value + if (#fNodes > 1) and (unitCount > 1) then + SetColor(usingCmd, 1) + DrawFilledCircleOutFading(fNodes[1], dotSize, 8) + if (#fNodes > 2) then + for i=1, #fNodes-2 do -- first and last circle are drawn before and after the for loop + local x = fNodes[i][1] + local y = fNodes[i][3] + local x2 = fNodes[i+1][1] + local y2 = fNodes[i+1][3] + local dx = x - x2 + local dy = y - y2 + local length = sqrt((dx*dx)+(dy*dy)) + while (currentLength + length >= lengthUnitNext) do + local factor = (lengthUnitNext - currentLength) / length + local factorPos = + {fNodes[i][1] + ((fNodes[i+1][1] - fNodes[i][1]) * factor), + fNodes[i][2] + ((fNodes[i+1][2] - fNodes[i][2]) * factor), + fNodes[i][3] + ((fNodes[i+1][3] - fNodes[i][3]) * factor)} + DrawFilledCircleOutFading(factorPos, dotSize, 8) + lengthUnitNext = lengthUnitNext + lengthPerUnit + end + currentLength = currentLength + length + end + end + DrawFilledCircleOutFading(fNodes[#fNodes], dotSize, 8) + end +end + +local function DrawFormationLines(vertFunction, lineStipple) + + glLineStipple(lineStipple, 4095) + glLineWidth(options.linewidth.value) + + if #fNodes > 1 then + SetColor(usingCmd, 1.0) + glBeginEnd(GL_LINE_STRIP, vertFunction, fNodes) + glColor(1,1,1,1) + end + + if #dimmNodes > 1 then + SetColor(dimmCmd, dimmAlpha) + glBeginEnd(GL_LINE_STRIP, vertFunction, dimmNodes) + glColor(1,1,1,1) + end + + glLineWidth(1.0) + glLineStipple(false) +end + +local Xs, Ys = spGetViewGeometry() +Xs, Ys = Xs*0.5, Ys*0.5 +function widget:ViewResize(viewSizeX, viewSizeY) + Xs, Ys = spGetViewGeometry() + Xs, Ys = Xs*0.5, Ys*0.5 +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + -- Draw lines when a path is drawn instead of a formation, OR when drawmode for formations is not "dots" only + if pathCandidate or options.drawmode.value ~= "dots" then + DrawFormationLines(tVerts, 2) + end + -- Draw dots when no path is drawn AND nodenumber is high enough AND drawmode for formations is not "lines" only + if not pathCandidate and (#fNodes > 1 or #dimmNodes > 1) and options.drawmode.value ~= "lines" then + local camX, camY, camZ = spGetCameraPosition() + local at, p = spTraceScreenRay(Xs,Ys,true,false,false) + if at == "ground" then + local dx, dy, dz = camX-p[1], camY-p[2], camZ-p[3] + --zoomY = ((dx*dx + dy*dy + dz*dz)*0.01)^0.25 --tests show that sqrt(sqrt(x)) is faster than x^0.25 + zoomY = sqrt(dx*dx + dy*dy + dz*dz) + else + --zoomY = sqrt((camY - max(spGetGroundHeight(camX, camZ), 0))*0.1) + zoomY = camY - max(spGetGroundHeight(camX, camZ), 0) + end + if zoomY < 6 then + zoomY = 6 + end + if lineLength > 0 then --don't try and draw if the command was cancelled by having two mouse buttons pressed at once + DrawFormationDots(tVerts, zoomY, unitCount) + end + end +end +function widget:DrawInMiniMap() + + glPushMatrix() + glLoadIdentity() + glTranslate(0, 1, 0) + glScale(1 / mapSizeX, -1 / mapSizeZ, 1) + + DrawFormationLines(tVertsMinimap, 1) + glPopMatrix() +end + +function widget:Update(deltaTime) + + dimmAlpha = dimmAlpha - lineFadeRate * deltaTime + + if dimmAlpha <= 0 then + + dimmNodes = {} + widgetHandler:RemoveWidgetCallIn("Update", self) + + if #fNodes == 0 then + widgetHandler:RemoveWidgetCallIn("DrawWorld", self) + widgetHandler:RemoveWidgetCallIn("DrawInMiniMap", self) + end + end +end + +--------------------------------------------------------------------------------------------------------- +-- Config +--------------------------------------------------------------------------------------------------------- +function widget:GetConfigData() -- Saving + return { + ['maxHungarianUnits'] = maxHungarianUnits, + } +end +function widget:SetConfigData(data) -- Loading + maxHungarianUnits = data['maxHungarianUnits'] or defaultHungarianUnits +end + +--------------------------------------------------------------------------------------------------------- +-- Matching Algorithms +--------------------------------------------------------------------------------------------------------- +function GetOrdersNoX(nodes, units, unitCount, shifted) + + -- Remember when we start + -- This is for capping total time + -- Note: We at least complete initial assignment + local startTime = osclock() + + --------------------------------------------------------------------------------------------------------- + -- Find initial assignments + --------------------------------------------------------------------------------------------------------- + local unitSet = {} + local fdist = -1 + local fm + + for u = 1, unitCount do + + -- Get unit position + local ux, uz + if shifted then + ux, _, uz = GetUnitFinalPosition(units[u]) + else + ux, _, uz = spGetUnitPosition(units[u]) + end + unitSet[u] = {ux, units[u], uz, -1} -- Such that x/z are in same place as in nodes (So we can use same sort function) + + -- Work on finding furthest points (As we have ux/uz already) + for i = u - 1, 1, -1 do + + local up = unitSet[i] + local vx, vz = up[1], up[3] + local dx, dz = vx - ux, vz - uz + local dist = dx*dx + dz*dz + + if (dist > fdist) then + fdist = dist + fm = (vz - uz) / (vx - ux) + end + end + end + + -- Maybe nodes are further apart than the units + for i = 1, unitCount - 1 do + + local np = nodes[i] + local nx, nz = np[1], np[3] + + for j = i + 1, unitCount do + + local mp = nodes[j] + local mx, mz = mp[1], mp[3] + local dx, dz = mx - nx, mz - nz + local dist = dx*dx + dz*dz + + if (dist > fdist) then + fdist = dist + fm = (mz - nz) / (mx - nx) + end + end + end + + local function sortFunc(a, b) + -- y = mx + c + -- c = y - mx + -- c = y + x / m (For perp line) + return (a[3] + a[1] / fm) < (b[3] + b[1] / fm) + end + + tsort(unitSet, sortFunc) + tsort(nodes, sortFunc) + + for u = 1, unitCount do + unitSet[u][4] = nodes[u] + end + + --------------------------------------------------------------------------------------------------------- + -- Main part of algorithm + --------------------------------------------------------------------------------------------------------- + + -- M/C for each finished matching + local Ms = {} + local Cs = {} + + -- Stacks to hold finished and still-to-check units + local stFin = {} + local stFinCnt = 0 + local stChk = {} + local stChkCnt = 0 + + -- Add all units to check stack + for u = 1, unitCount do + stChk[u] = u + end + stChkCnt = unitCount + + -- Begin algorithm + while ((stChkCnt > 0) and (osclock() - startTime < maxNoXTime)) do + + -- Get unit, extract position and matching node position + local u = stChk[stChkCnt] + local ud = unitSet[u] + local ux, uz = ud[1], ud[3] + local mn = ud[4] + local nx, nz = mn[1], mn[3] + + -- Calculate M/C + local Mu = (nz - uz) / (nx - ux) + local Cu = uz - Mu * ux + + -- Check for clashes against finished matches + local clashes = false + + for i = 1, stFinCnt do + + -- Get opposing unit and matching node position + local f = stFin[i] + local fd = unitSet[f] + local tn = fd[4] + + -- Get collision point + local ix = (Cs[f] - Cu) / (Mu - Ms[f]) + local iz = Mu * ix + Cu + + -- Check bounds + if ((ux - ix) * (ix - nx) >= 0) and + ((uz - iz) * (iz - nz) >= 0) and + ((fd[1] - ix) * (ix - tn[1]) >= 0) and + ((fd[3] - iz) * (iz - tn[3]) >= 0) then + + -- Lines cross + + -- Swap matches, note this retains solution integrity + ud[4] = tn + fd[4] = mn + + -- Remove clashee from finished + stFin[i] = stFin[stFinCnt] + stFinCnt = stFinCnt - 1 + + -- Add clashee to top of check stack + stChkCnt = stChkCnt + 1 + stChk[stChkCnt] = f + + -- No need to check further + clashes = true + break + end + end + + if not clashes then + + -- Add checked unit to finished + stFinCnt = stFinCnt + 1 + stFin[stFinCnt] = u + + -- Remove from to-check stack (Easily done, we know it was one on top) + stChkCnt = stChkCnt - 1 + + -- We can set the M/C now + Ms[u] = Mu + Cs[u] = Cu + end + end + + --------------------------------------------------------------------------------------------------------- + -- Return orders + --------------------------------------------------------------------------------------------------------- + local orders = {} + for i = 1, unitCount do + local unit = unitSet[i] + orders[i] = {unit[2], unit[4]} + end + return orders +end +function GetOrdersHungarian(nodes, units, unitCount, shifted) + ------------------------------------------------------------------------------------- + ------------------------------------------------------------------------------------- + -- (the following code is written by gunblob) + -- this code finds the optimal solution (slow, but effective!) + -- it uses the hungarian algorithm from http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html + -- if this violates gpl license please let gunblob and me know + ------------------------------------------------------------------------------------- + ------------------------------------------------------------------------------------- + local t = osclock() + + -------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------- + -- cache node<->unit distances + + local distances = {} + --for i = 1, unitCount do distances[i] = {} end + + for i = 1, unitCount do + + local uID = units[i] + local ux, uz + + if shifted then + ux, _, uz = GetUnitFinalPosition(uID) + else + ux, _, uz = spGetUnitPosition(uID) + end + + distances[i] = {} + local dists = distances[i] + for j = 1, unitCount do + + local nodePos = nodes[j] + local dx, dz = nodePos[1] - ux, nodePos[3] - uz + dists[j] = floor(sqrt(dx*dx + dz*dz) + 0.5) + -- Integer distances = greatly improved algorithm speed + end + end + + -------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------- + -- find optimal solution and send orders + local result = findHungarian(distances, unitCount) + + -------------------------------------------------------------------------------------------- + -------------------------------------------------------------------------------------------- + -- determine needed time and optimize the maxUnits limit + + local delay = osclock() - t + + if (delay > maxHngTime) and (maxHungarianUnits > minHungarianUnits) then + + -- Delay is greater than desired, we have to reduce units + maxHungarianUnits = maxHungarianUnits - 1 + else + -- Delay is less than desired, so thats OK + -- To make judgements we need number of units to be close to max + -- Because we are making predictions of time and we want them to be accurate + if (#units > maxHungarianUnits*unitIncreaseThresh) then + + -- This implementation of Hungarian algorithm is O(n3) + -- Because we have less than maxUnits, but are altering maxUnits... + -- We alter the time, to 'predict' time we would be getting at maxUnits + -- We then recheck that against maxHngTime + + local nMult = maxHungarianUnits / #units + + if ((delay*nMult*nMult*nMult) < maxHngTime) then + maxHungarianUnits = maxHungarianUnits + 1 + else + if (maxHungarianUnits > minHungarianUnits) then + maxHungarianUnits = maxHungarianUnits - 1 + end + end + end + end + + -- Return orders + local orders = {} + for i = 1, unitCount do + local rPair = result[i] + orders[i] = {units[rPair[1]], nodes[rPair[2]]} + end + + return orders +end + +function findHungarian(array, n) + + -- Vars + local colcover = {} + local rowcover = {} + local starscol = {} + local primescol = {} + + -- Initialization + for i = 1, n do + rowcover[i] = false + colcover[i] = false + starscol[i] = false + primescol[i] = false + end + + -- Subtract minimum from rows + for i = 1, n do + + local aRow = array[i] + local minVal = aRow[1] + for j = 2, n do + if aRow[j] < minVal then + minVal = aRow[j] + end + end + + for j = 1, n do + aRow[j] = aRow[j] - minVal + end + end + + -- Subtract minimum from columns + for j = 1, n do + + local minVal = array[1][j] + for i = 2, n do + if array[i][j] < minVal then + minVal = array[i][j] + end + end + + for i = 1, n do + array[i][j] = array[i][j] - minVal + end + end + + -- Star zeroes + for i = 1, n do + local aRow = array[i] + for j = 1, n do + if (aRow[j] == 0) and not colcover[j] then + colcover[j] = true + starscol[i] = j + break + end + end + end + + -- Start solving system + while true do + + -- Are we done ? + local done = true + for i = 1, n do + if not colcover[i] then + done = false + break + end + end + + if done then + local pairings = {} + for i = 1, n do + pairings[i] = {i, starscol[i]} + end + return pairings + end + + -- Not done + local r, c = stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) + stepFiveStar(colcover, rowcover, r, c, n, starscol, primescol) + end +end +function doPrime(array, colcover, rowcover, n, starscol, r, c, rmax, primescol) + + primescol[r] = c + + local starCol = starscol[r] + if starCol then + + rowcover[r] = true + colcover[starCol] = false + + for i = 1, rmax do + if not rowcover[i] and (array[i][starCol] == 0) then + local rr, cc = doPrime(array, colcover, rowcover, n, starscol, i, starCol, rmax, primescol) + if rr then + return rr, cc + end + end + end + + return + else + return r, c + end +end +function stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) + + -- Infinite loop + while true do + + -- Find uncovered zeros and prime them + for i = 1, n do + if not rowcover[i] then + local aRow = array[i] + for j = 1, n do + if (aRow[j] == 0) and not colcover[j] then + local i, j = doPrime(array, colcover, rowcover, n, starscol, i, j, i-1, primescol) + if i then + return i, j + end + break -- this row is covered + end + end + end + end + + -- Find minimum uncovered + local minVal = huge + for i = 1, n do + if not rowcover[i] then + local aRow = array[i] + for j = 1, n do + if (aRow[j] < minVal) and not colcover[j] then + minVal = aRow[j] + end + end + end + end + + -- There is the potential for minVal to be 0, very very rarely though. (Checking for it costs more than the +/- 0's) + + -- Covered rows = + + -- Uncovered cols = - + for i = 1, n do + local aRow = array[i] + if rowcover[i] then + for j = 1, n do + if colcover[j] then + aRow[j] = aRow[j] + minVal + end + end + else + for j = 1, n do + if not colcover[j] then + aRow[j] = aRow[j] - minVal + end + end + end + end + end +end +function stepFiveStar(colcover, rowcover, row, col, n, starscol, primescol) + + -- Star the initial prime + primescol[row] = false + starscol[row] = col + local ignoreRow = row -- Ignore the star on this row when looking for next + + repeat + local noFind = true + + for i = 1, n do + + if (starscol[i] == col) and (i ~= ignoreRow) then + + noFind = false + + -- Unstar the star + -- Turn the prime on the same row into a star (And ignore this row (aka star) when searching for next star) + + local pcol = primescol[i] + primescol[i] = false + starscol[i] = pcol + ignoreRow = i + col = pcol + + break + end + end + until noFind + + for i = 1, n do + rowcover[i] = false + colcover[i] = false + primescol[i] = false + end + + for i = 1, n do + local scol = starscol[i] + if scol then + colcover[scol] = true + end + end +end diff --git a/LuaUI/Widgets_Evo/cmd_doubleclickfight.lua b/LuaUI/Widgets_Evo/cmd_doubleclickfight.lua index df9fd2a87..ade686e59 100644 --- a/LuaUI/Widgets_Evo/cmd_doubleclickfight.lua +++ b/LuaUI/Widgets_Evo/cmd_doubleclickfight.lua @@ -77,7 +77,7 @@ end local function RemoveMove(unitID) - local queue = spGetCommandQueue(unitID) + local queue = spGetCommandQueue(unitID, -1) local qLast = #queue if (qLast < 1) then return false diff --git a/LuaUI/Widgets_Evo/cmd_mex_placement.lua b/LuaUI/Widgets_Evo/cmd_mex_placement.lua index a7e10ce29..c598c68e8 100644 --- a/LuaUI/Widgets_Evo/cmd_mex_placement.lua +++ b/LuaUI/Widgets_Evo/cmd_mex_placement.lua @@ -1,8 +1,9 @@ + function widget:GetInfo() return { name = "Mex Placement Handler", desc = "Places mexes in the correct position DO NOT DISABLE", - author = "Google Frog with some from Niobium, Evil4Zerggin and Smoth", + author = "Google Frog, Niobium, Evil4Zerggin. Animated spritesheet support by Ivand, art by MaDDoX.", version = "v1", date = "22 April, 2012", --2 April 2013 license = "GNU GPL, v2 or later", @@ -13,6 +14,14 @@ function widget:GetInfo() end VFS.Include("LuaRules/Configs/customcmds.h.lua") +VFS.Include("LuaRules/Utilities/glVolumes.lua") + +local fontfile = "JosefinSans-SemiBold.ttf" + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") + +local font = gl.LoadFont(fontfile, 80, 8, 3) ------------------------------------------------------------ -- Speedups @@ -27,16 +36,17 @@ local spGetUnitHealth = Spring.GetUnitHealth local spGetSelectedUnits = Spring.GetSelectedUnits local spInsertUnitCmdDesc = Spring.InsertUnitCmdDesc local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitPosition = Spring.GetUnitPosition local spGetTeamUnits = Spring.GetTeamUnits local spGetMyTeamID = Spring.GetMyTeamID local spTestBuildOrder = Spring.TestBuildOrder local spGetUnitsInRectangle = Spring.GetUnitsInRectangle -local spGiveOrder = Spring.GiveOrder +local spGiveOrder = Spring.GiveOrder local spGetGroundInfo = Spring.GetGroundInfo local spGetGroundHeight = Spring.GetGroundHeight local spGetMapDrawMode = Spring.GetMapDrawMode local spGetGameFrame = Spring.GetGameFrame +local spGetFrameTimeOffset = Spring.GetFrameTimeOffset local spGetSpectatingState = Spring.GetSpectatingState local spGetAllUnits = Spring.GetAllUnits local spGetPositionLosState = Spring.GetPositionLosState @@ -48,6 +58,8 @@ local glText = gl.Text local glGetTextWidth = gl.GetTextWidth local glPolygonMode = gl.PolygonMode local glDrawGroundCircle = gl.DrawGroundCircle +local glDrawGroundRect = gl.Utilities.DrawGroundRectangle +local glDrawCircle local glUnitShape = gl.UnitShape local glDepthTest = gl.DepthTest local glLighting = gl.Lighting @@ -73,7 +85,7 @@ local GL_GREATER = GL.GREATER local floor = math.floor local min, max = math.min, math.max local strFind = string.find -local strFormat = string.format +local strFormat = string.format local CMD_OPT_SHIFT = CMD.OPT_SHIFT @@ -96,51 +108,132 @@ local MAP_SIZE_Z = Game.mapSizeZ local MAP_SIZE_Z_SCALED = MAP_SIZE_Z / METAL_MAP_SQUARE_SIZE local allyMexColor = {[1] = {0, 1, 1, 0.7}, [2] = {0, 1, 1, 1}} -local neutralMexColor = {[1] = {1, 1, 0, 0.7}, [2] = {1, 1, 0,1}} +local neutralMexColor = {[1] = {0.53, 0.77, 0.89, 1}, [2] = {0.53, 0.77, 0.89, 1}} local enemyMexColor = {[1] = {1, 0, 0, 0.7}, [2] = {1, 0, 0, 1}} +local allyTeams = {} -- [id] = {team1, team2, ...} + +local previousOsClock = os.clock() +local currentRotationAngle = 0 +local currentRotationAngleOpposite = 0 +local drawIncome = false -- Should we draw the income estimation? + +local minimapIconSizeMult = 0.0145 --0.0145 + +-- only used when animating a spreadsheet/atlas texture +local spotTexture = "bitmaps/default/metalshimmer_color9.dds" +local animRate = 1000 -- That's actually the reverse of animrate, the lower it is the faster the animation goes +local texturewidth = 40 --160 (actual in-game rect width) +local textureYoffset = 2 --10 (offset from the ground) +local numberOfImagesX = 16 +local numberOfImagesY = 16 + +-------------------- + +local animShader = nil +local animProgressLoc = -1 + +local animShaderVS = [[ + #version 150 compatibility + #line 100126 + + uniform ivec2 numImages; + uniform float animProgress; //0 to 1 + + out vec4 samplingBias; + out vec2 uv; + out float blendFactor; + + void main() { + float ap = fract(animProgress); //sanitize inputs + int maxImgIdx = numImages.x * numImages.y - 1; + ap *= float(maxImgIdx); + + int i0 = int(floor(ap)); + int i1 = i0 + 1; + blendFactor = fract(ap); + + samplingBias = vec4( + float(i0 / numImages.x), + float(i0 % numImages.x), + float(i1 / numImages.x), + float(i1 % numImages.x) + ); + + samplingBias /= vec4(numImages.xyxy); + uv = gl_MultiTexCoord0.xy / vec2(numImages.xy); + + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + } +]] + +local animShaderFS = [[ + #version 150 compatibility + #line 200161 + + uniform sampler2D colorAtlas; + uniform sampler2D normAtlas; + + in vec4 samplingBias; + in vec2 uv; + in float blendFactor; + + void main() { + vec4 c0 = texture(colorAtlas, samplingBias.xy + uv); + vec4 c1 = texture(colorAtlas, samplingBias.zw + uv); + + // unused yet + //vec4 n0 = texture(colorAtlas, samplingBias.xy + uv); + //vec4 n1 = texture(colorAtlas, samplingBias.zw + uv); + + gl_FragColor = mix(c0, c1, blendFactor); + } +]] + +-------------------- + ------------------------------------------------------------ -- Config ------------------------------------------------------------ -local TEXT_SIZE = 16 -local TEXT_CORRECT_Y = 1.25 +local MINIMAP_DRAW_SIZE = math.max(mapX,mapZ) * minimapIconSizeMult + +options_path = 'Settings/Interface/Map/Metal Spots' +options_order = { 'drawicons', 'size', 'specPlayerColours', 'rounding'} -local MINIMAP_DRAW_SIZE = math.max(mapX,mapZ) * 0.0145 +VFS.Include("LuaUI/Configs/LuaMex/options.lua") +local circleOptions = { + enabled = true, + animating = true, -- its only rotation, but will cost more performance + alwaysshow = true, + innersize = 40, -- outersize-innersize = circle width + outersize = 43, -- outersize-innersize = circle width + circlePieces = 3, + circlePieceDetail = 5, + circleSpaceUsage = 0.45, + circleInnerOffset = 0.42, + rotationSpeed = 5, +} ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- -- Mexes and builders -local mexUnitDef = UnitDefNames["emetalextractor"] -local referenceLandMexId = mexUnitDef.id -local referenceUnderWaterMexId = UnitDefNames["emetalextractor"].id - -local mexDefIDs = { - [referenceLandMexId] = referenceLandMexId, - [referenceUnderWaterMexId] = referenceUnderWaterMexId, - } - - - -local mexDefInfo = { - extraction = 0.001, - square = mexUnitDef.extractSquare, - oddX = mexUnitDef.xsize % 4 == 2, - oddZ = mexUnitDef.zsize % 4 == 2, -} +local mexDefID = {} +for udid, ud in pairs(UnitDefs) do + if ud.customParams.metal_extractor then + mexDefID[udid] = tonumber (ud.customParams.metal_extractor) + end +end local mexBuilder = {} -local mexBuilderDefs = {} - -for udid, ud in ipairs(UnitDefs) do - for _, targetId in ipairs(ud.buildOptions) do - if mexDefIDs[targetId] then - mexBuilderDefs[udid] = true - end - end +local mexBuilderDefs = {} +for udid, ud in ipairs(UnitDefs) do + if ud.customParams.area_mex_def then + mexBuilderDefs[udid] = UnitDefNames[ud.customParams.area_mex_def].id + end end -------------------------------------------------------------------------------- @@ -158,492 +251,580 @@ local metalSpotsNil = true ------------------------------------------------------------ -- Functions ------------------------------------------------------------ +local function GetNearestMex (x, z) + local units = Spring.GetUnitsInRectangle(x-1, z-1, x+1, z+1) + local myAlly = spGetMyAllyTeamID() + for i = 1, #units do + local unitID = units[i] + local unitDefID = Spring.GetUnitDefID(unitID) + if unitDefID and mexDefID[unitDefID] and spGetUnitAllyTeam(unitID) == myAlly then + return unitID + end + end +end + local function GetClosestMetalSpot(x, z) --is used by single mex placement, not used by areamex - local bestSpot - local bestDist = math.huge - local bestIndex - for i = 1, #WG.metalSpots do - local spot = WG.metalSpots[i] - local dx, dz = x - spot.x, z - spot.z - local dist = dx*dx + dz*dz - if dist < bestDist then - bestSpot = spot - bestDist = dist - bestIndex = i - end - end - return bestSpot, sqrt(bestDist), bestIndex + local bestSpot + local bestDist = math.huge + local bestIndex + for i = 1, #WG.metalSpots do + local spot = WG.metalSpots[i] + local dx, dz = x - spot.x, z - spot.z + local dist = dx*dx + dz*dz + if dist < bestDist then + bestSpot = spot + bestDist = dist + bestIndex = i + end + end + return bestSpot, sqrt(bestDist), bestIndex end local function Distance(x1,z1,x2,z2) - local dis = (x1-x2)*(x1-x2)+(z1-z2)*(z1-z2) - return dis + local dis = (x1-x2)*(x1-x2)+(z1-z2)*(z1-z2) + return dis end local function IntegrateMetal(x, z, forceUpdate) - local newCenterX, newCenterZ - - if (mexDefInfo.oddX) then - newCenterX = (floor( x / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE - else - newCenterX = floor( x / METAL_MAP_SQUARE_SIZE + 0.5) * METAL_MAP_SQUARE_SIZE - end - - if (mexDefInfo.oddZ) then - newCenterZ = (floor( z / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE - else - newCenterZ = floor( z / METAL_MAP_SQUARE_SIZE + 0.5) * METAL_MAP_SQUARE_SIZE - end - - if (centerX == newCenterX and centerZ == newCenterZ and not forceUpdate) then - return - end - - centerX = newCenterX - centerZ = newCenterZ - - local startX = floor((centerX - MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) - local startZ = floor((centerZ - MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) - local endX = floor((centerX + MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) - local endZ = floor((centerZ + MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) - startX, startZ = max(startX, 0), max(startZ, 0) - endX, endZ = min(endX, MAP_SIZE_X_SCALED - 1), min(endZ, MAP_SIZE_Z_SCALED - 1) - - local mult = mexDefInfo.extraction - local square = mexDefInfo.square - local result = 0 - - if (square) then - for i = startX, endX do - for j = startZ, endZ do - local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE - local _, metal = spGetGroundInfo(cx, cz) - result = result + metal - end - end - else - for i = startX, endX do - for j = startZ, endZ do - local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE - local dx, dz = cx - centerX, cz - centerZ - local dist = sqrt(dx * dx + dz * dz) - - if (dist < MEX_RADIUS) then - local _, metal = spGetGroundInfo(cx, cz) - result = result + metal - end - end - end - end - - extraction = result * mult + local newCenterX, newCenterZ + + newCenterX = (floor( x / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE + newCenterZ = (floor( z / METAL_MAP_SQUARE_SIZE) + 0.5) * METAL_MAP_SQUARE_SIZE + + if (centerX == newCenterX and centerZ == newCenterZ and not forceUpdate) then + return + end + + centerX = newCenterX + centerZ = newCenterZ + + local startX = floor((centerX - MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) + local startZ = floor((centerZ - MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) + local endX = floor((centerX + MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) + local endZ = floor((centerZ + MEX_RADIUS) / METAL_MAP_SQUARE_SIZE) + startX, startZ = max(startX, 0), max(startZ, 0) + endX, endZ = min(endX, MAP_SIZE_X_SCALED - 1), min(endZ, MAP_SIZE_Z_SCALED - 1) + + local mult = Spring.GetGameRulesParam("base_extraction") + local result = 0 + + for i = startX, endX do + for j = startZ, endZ do + local cx, cz = (i + 0.5) * METAL_MAP_SQUARE_SIZE, (j + 0.5) * METAL_MAP_SQUARE_SIZE + local dx, dz = cx - centerX, cz - centerZ + local dist = sqrt(dx * dx + dz * dz) + + if (dist < MEX_RADIUS) then + local _, metal, metal2 = spGetGroundInfo(cx, cz) + if type(metal) == 'string' then -- Spring > v104 + metal = metal2 + end + result = result + metal + end + end + end + + extraction = result * mult end +local function DrawCircleLine(innersize, outersize) + gl.BeginEnd(GL.QUADS, function() + local detailPartWidth, a1,a2,a3,a4 + local width = circleOptions.circleSpaceUsage + local detail = circleOptions.circlePieceDetail + + local radstep = (2.0 * math.pi) / circleOptions.circlePieces + for i = 1, circleOptions.circlePieces do + for d = 1, detail do + + detailPartWidth = ((width / detail) * d) + a1 = ((i+detailPartWidth - (width / detail)) * radstep) + a2 = ((i+detailPartWidth) * radstep) + a3 = ((i+circleOptions.circleInnerOffset+detailPartWidth - (width / detail)) * radstep) + a4 = ((i+circleOptions.circleInnerOffset+detailPartWidth) * radstep) + + --outer (fadein) + gl.Vertex(math.sin(a4)*innersize, 0, math.cos(a4)*innersize) + gl.Vertex(math.sin(a3)*innersize, 0, math.cos(a3)*innersize) + --outer (fadeout) + gl.Vertex(math.sin(a1)*outersize, 0, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2)*outersize, 0, math.cos(a2)*outersize) + end + end + end) +end ------------------------------------------------------------ -- Command Handling ------------------------------------------------------------ -function widget:CommandNotify(cmdID, params, options) - if (cmdID == CMD_AREA_MEX and WG.metalSpots) then - - local cx, cy, cz, cr = params[1], params[2], params[3], math.max((params[4] or 60),60) - - local xmin = cx-cr - local xmax = cx+cr - local zmin = cz-cr - local zmax = cz+cr - - local commands = {} - local orderedCommands = {} - local dis = {} - - local ux = 0 - local uy = 0 - local uz = 0 - local us = 0 - - local aveX = 0 - local aveZ = 0 - local aveY = 0 - - local units = spGetSelectedUnits() - - for i = 1, #units do - local unitID = units[i] - if mexBuilder[unitID] then - local x,y,z = spGetUnitPosition(unitID) - ux = ux+x - uy = uy+y - uz = uz+z - us = us+1 - end - end - - if (us == 0) then - return - else - aveX = ux/us - aveY = uy/us - aveZ = uz/us - end - - for i = 1, #WG.metalSpots do - local mex = WG.metalSpots[i] - --if (mex.x > xmin) and (mex.x < xmax) and (mex.z > zmin) and (mex.z < zmax) then -- square area, should be faster - if (not spotData[i]) and (Distance(cx,cz,mex.x,mex.z) < cr*cr) then -- circle area, slower - commands[#commands+1] = {x = mex.x, y = mex.y, z = mex.z, d = Distance(aveX,aveZ,mex.x,mex.z)} - end - end - - local noCommands = #commands - while noCommands > 0 do - - tasort(commands, function(a,b) return a.d < b.d end) - orderedCommands[#orderedCommands+1] = commands[1] - aveX = commands[1].x - aveY = commands[1].y - aveZ = commands[1].z - taremove(commands, 1) - for k, com in pairs(commands) do - com.d = Distance(aveX,aveZ,com.x,com.z) - end - noCommands = noCommands-1 - end - - local shift = options.shift - do --issue ordered order to unit(s) - local commandArrayToIssue={} - local unitArrayToReceive ={} - for i = 1, #units do --prepare unit list - local unitID = units[i] - if mexBuilder[unitID] then - unitArrayToReceive[#unitArrayToReceive+1] = unitID - end - end - --prepare command list - if not shift then - commandArrayToIssue[1] = {CMD.STOP, {} , {}} - --spGiveOrderToUnit(unitID, CMD.STOP, {} , 0 ) - end - for i, command in ipairs(orderedCommands) do - local x = command.x - local y = command.y - local z = command.z - - local referenceMexId = referenceLandMexId - - if y < 0 then - referenceMexId = referenceUnderWaterMexId - end - - local buildable, feature = spTestBuildOrder(referenceMexId,x,0,z,1) - if buildable ~= 0 then - local handledExternally = false - - if (Script.LuaUI('CommandNotifyMex')) then --send away new mex queue in an event called CommandNotifyMex. Used by "central_build_AI.lua" - handledExternally = Script.LuaUI.CommandNotifyMex(-referenceMexId, {x,0,z,0} , options , true) --add additional flag "true" for additional logic for zk areamex - end - if ( not handledExternally ) then - commandArrayToIssue[#commandArrayToIssue+1] = {-referenceMexId, {x,0,z,0} , {"shift"}} - --spGiveOrderToUnit(unitID, -mexDefID, {x,0,z,0} , {"shift"}) - end - else - local mexes = spGetUnitsInRectangle(x-1,z-1,x+1,z+1) - for i = 1, #mexes do --check unit in build location - local aid = mexes[i] - local udid = spGetUnitDefID(aid) - if spGetUnitAllyTeam(aid) == myAllyTeam and mexDefIDs[udid] then - if select(5, spGetUnitHealth(aid)) ~= 1 then - commandArrayToIssue[#commandArrayToIssue+1] = {CMD.REPAIR, {aid} , {"shift"}} - --spGiveOrderToUnit(unitID, CMD.REPAIR, {aid} , {"shift"}) - break - end - end - end - end - end - --issue all order to all unit at once - Spring.GiveOrderArrayToUnitArray(unitArrayToReceive,commandArrayToIssue) - end - - return true - end - - if mexDefIDs[-cmdID] and WG.metalSpots then - - local bx, bz = params[1], params[3] - local closestSpot = GetClosestMetalSpot(bx, bz) - if closestSpot then - local units = spGetUnitsInRectangle(closestSpot.x-1, closestSpot.z-1, closestSpot.x+1, closestSpot.z+1) - local foundUnit = false - local myAlly = spGetMyAllyTeamID() - for i = 1, #units do - local unitID = units[i] - --why would you even?!? - --local unitDefID = Spring.GetUnitDefID(unitID) - - local unitDefID = Spring.GetUnitDefID(unitID) - if unitDefID and mexDefIDs[unitDefID] and spGetUnitAllyTeam(unitID) == myAlly then - foundUnit = unitID - break - end - end - - if foundUnit then - local build = select(5, spGetUnitHealth(foundUnit)) - if build ~= 1 then - spGiveOrder(CMD.REPAIR, {foundUnit}, options.coded) - end - return true - else - local handledExternally = false - if (Script.LuaUI('CommandNotifyMex')) then --send away new mex queue in an event called CommandNotifyMex. Used by "central_build_AI.lua" - handledExternally = Script.LuaUI.CommandNotifyMex(cmdID, {closestSpot.x, closestSpot.y, closestSpot.z, params[4]}, options) - end - if ( not handledExternally ) then - spGiveOrder(cmdID, {closestSpot.x, closestSpot.y, closestSpot.z, params[4]}, options.coded) - end - return true - end - end - end - +function widget:CommandNotify(cmdID, params, options) + if (cmdID == CMD_AREA_MEX and WG.metalSpots) then + + local cx, cy, cz, cr = params[1], params[2], params[3], math.max((params[4] or 60),60) + + local xmin = cx-cr + local xmax = cx+cr + local zmin = cz-cr + local zmax = cz+cr + + local commands = {} + local orderedCommands = {} + local dis = {} + + local ux = 0 + local uz = 0 + local us = 0 + + local aveX = 0 + local aveZ = 0 + + local units = spGetSelectedUnits() + + for i = 1, #units do + local unitID = units[i] + if mexBuilder[unitID] then + local x,_,z = spGetUnitPosition(unitID) + ux = ux+x + uz = uz+z + us = us+1 + end + end + + if (us == 0) then + return + else + aveX = ux/us + aveZ = uz/us + end + + for i = 1, #WG.metalSpots do + local mex = WG.metalSpots[i] + --if (mex.x > xmin) and (mex.x < xmax) and (mex.z > zmin) and (mex.z < zmax) then -- square area, should be faster + if (Distance(cx,cz,mex.x,mex.z) < cr*cr) then -- circle area, slower + commands[#commands+1] = {x = mex.x, z = mex.z, d = Distance(aveX,aveZ,mex.x,mex.z)} + end + end + + local noCommands = #commands + while noCommands > 0 do + + tasort(commands, function(a,b) return a.d < b.d end) + orderedCommands[#orderedCommands+1] = commands[1] + aveX = commands[1].x + aveZ = commands[1].z + taremove(commands, 1) + for _, com in pairs(commands) do + com.d = Distance(aveX,aveZ,com.x,com.z) + end + noCommands = noCommands-1 + end + + local shift = options.shift + + local buildersByType = {} + for i = 1, #units do + local unitID = units[i] + local mexType = mexBuilder[unitID] + if mexType then + buildersByType[mexType] = buildersByType[mexType] or {} + local array = buildersByType[mexType] + array[#array + 1] = unitID + end + end + for mexType, unitArrayToReceive in pairs (buildersByType) do + local commandArrayToIssue={} + + --prepare command list + if not shift then + commandArrayToIssue[1] = {CMD.STOP, {} , {}} + end + for i, command in ipairs(orderedCommands) do + local x = command.x + local z = command.z + local y = Spring.GetGroundHeight(x, z) + + local unit = GetNearestMex (x, z) + if unit then + if Spring.GetUnitDefID(unit) ~= mexType then + commandArrayToIssue[#commandArrayToIssue+1] = {CMD.RECLAIM, {unit}, {"shift"}} + commandArrayToIssue[#commandArrayToIssue+1] = {CMD.INSERT, {-1, -mexType, CMD.OPT_INTERNAL, x,y,z,0}, {"alt"}} + elseif select (5, Spring.GetUnitHealth (unit)) < 1 then + commandArrayToIssue[#commandArrayToIssue+1] = {CMD.REPAIR, {unit}, {"shift"}} + end + else + commandArrayToIssue[#commandArrayToIssue+1] = {-mexType, {x,y,z,0} , {"shift"}} + end + end + + if (#commandArrayToIssue > 0) then + Spring.GiveOrderArrayToUnitArray(unitArrayToReceive,commandArrayToIssue) + end + end + return true + end + + if mexDefID[-cmdID] and WG.metalSpots then + local bx, bz = params[1], params[3] + local closestSpot = GetClosestMetalSpot(bx, bz) + if closestSpot then + local commandHeight = math.max(0, Spring.GetGroundHeight(closestSpot.x, closestSpot.z)) + local foundUnit = GetNearestMex (closestSpot.x, closestSpot.z) + if foundUnit then + + if Spring.GetUnitDefID(foundUnit) ~= mexType then + spGiveOrder(CMD.RECLAIM, {foundUnit}, CMD.OPT_INTERNAL) + spGiveOrder(CMD.INSERT, {-1, cmdID, options.coded, closestSpot.x, commandHeight, closestSpot.z, params[4]} , {"alt"}) + elseif select (5, Spring.GetUnitHealth (foundUnit)) < 1 then + spGiveOrder(CMD.REPAIR, {foundUnit}, options.coded) + end + else + spGiveOrder(cmdID, {closestSpot.x, commandHeight, closestSpot.z, params[4]}, options.coded) + end + end + return true + end end function widget:UnitCreated(unitID, unitDefID) - if mexBuilderDefs[unitDefID] then - mexBuilder[unitID] = true - end + mexBuilder[unitID] = mexBuilderDefs[unitDefID] end function widget:UnitFinished(unitID, unitDefID, teamID) - if mexDefIDs[unitID] and WG.metalSpots then - if spGetSpectatingState() then - local x,_,z = Spring.GetUnitPosition(unitID) - local spotID = WG.metalSpotsByPos[x] and WG.metalSpotsByPos[x][z] - if spotID then - spotByID[unitID] = spotID - spotData[spotID] = {unitID = unitID, allyTeam = spGetUnitAllyTeam(unitID)} - updateMexDrawList() - end - elseif spGetUnitAllyTeam(unitID) == myAllyTeam then - local x,_,z = Spring.GetUnitPosition(unitID) - local spotID = WG.metalSpotsByPos[x] and WG.metalSpotsByPos[x][z] - if spotID then - spotByID[unitID] = spotID - spotData[spotID] = {unitID = unitID} - updateMexDrawList() - end - end - end + if mexDefID[unitDefID] and WG.metalSpots then + if spGetSpectatingState() then + local x,_,z = Spring.GetUnitPosition(unitID) + local spotID = WG.metalSpotsByPos[x] and WG.metalSpotsByPos[x][z] + if spotID then + spotByID[unitID] = spotID + spotData[spotID] = {unitID = unitID, team = Spring.GetUnitTeam(unitID), allyTeam = spGetUnitAllyTeam(unitID)} + updateMexDrawList() + end + elseif spGetUnitAllyTeam(unitID) == myAllyTeam then + local x,_,z = Spring.GetUnitPosition(unitID) + local spotID = WG.metalSpotsByPos[x] and WG.metalSpotsByPos[x][z] + if spotID then + spotByID[unitID] = spotID + spotData[spotID] = {unitID = unitID, team = Spring.GetUnitTeam(unitID)} + updateMexDrawList() + end + end + end end function widget:UnitDestroyed(unitID, unitDefID) - if mexDefIDs[unitID] and spotByID[unitID] then - spotData[spotByID[unitID]] = nil - spotByID[unitID] = nil - updateMexDrawList() - end + if mexDefID[unitDefID] and spotByID[unitID] then + spotData[spotByID[unitID]] = nil + spotByID[unitID] = nil + updateMexDrawList() + end + mexBuilder[unitID] = nil end function widget:UnitGiven(unitID, unitDefID, newTeamID, teamID) - if mexDefIDs[unitID] then - local done = select(5, spGetUnitHealth(unitID)) - if done == 1 then - widget:UnitFinished(unitID, unitDefID,unitDefID) - end - end + mexBuilder[unitID] = mexBuilderDefs[unitDefID] + if mexDefID[unitDefID] then + local done = select(5, spGetUnitHealth(unitID)) + if done == 1 then + widget:UnitFinished(unitID, unitDefID,unitDefID) + end + end end function widget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) - widget:UnitDestroyed(unitID, unitDefID, oldTeamID) + widget:UnitDestroyed(unitID, unitDefID, oldTeamID) end -local function Initialize() - - local units = spGetAllUnits() - for i, unitID in ipairs(units) do - local unitDefID = spGetUnitDefID(unitID) - widget:UnitCreated(unitID, unitDefID) - if mexDefIDs[unitID] then - local done = select(5, spGetUnitHealth(unitID)) - if done == 1 then - widget:UnitFinished(unitID, unitDefID,team) - end - end - end - if WG.metalSpots then - Spring.Echo("Mex Placement Initialised with " .. #WG.metalSpots .. " spots.") - updateMexDrawList() - else - Spring.Echo("Mex Placement Initialised with metal map mode.") - end +local function Initialize() + animShader = gl.CreateShader({ + vertex = animShaderVS, + fragment = animShaderFS, + uniformInt = { + colorAtlas = 0, + normAtlas = 1, + numImages = {numberOfImagesX, numberOfImagesY} + }, + uniformFloat = { + animProgress = 0.0, + }, + }) + + local shLog = gl.GetShaderLog() or "" + + if not animShader then + Spring.Echo("ERROR:\n"..shLog) + return false + elseif (shLog ~= "") then + Spring.Echo("WARNING:\n"..shLog) + end + + animProgressLoc = gl.GetUniformLocation(animShader, "animProgress") + + + circleList = gl.CreateList(DrawCircleLine, circleOptions.innersize, circleOptions.outersize) + currentClock = os.clock() + + local units = spGetAllUnits() + for i, unitID in ipairs(units) do + local unitDefID = spGetUnitDefID(unitID) + widget:UnitCreated(unitID, unitDefID) + if mexDefID[unitDefID] then + local done = select(5, spGetUnitHealth(unitID)) + if done == 1 then + widget:UnitFinished(unitID, unitDefID,team) + end + end + end + if WG.metalSpots then + --Spring.Echo("Mex Placement Initialised with " .. #WG.metalSpots .. " spots.") + updateMexDrawList() + else + --Spring.Echo("Mex Placement Initialised with metal map mode.") + end end local mexSpotToDraw = false local drawMexSpots = false function widget:Update() - if WG.metalSpots and (not wasSpectating) and spGetSpectatingState() then - spotByID = {} - spotData = {} - wasSpectating = true - local units = spGetAllUnits() - for i, unitID in ipairs(units) do - local unitDefID = spGetUnitDefID(unitID) - if mexDefIDs[unitID] then - local done = select(5, spGetUnitHealth(unitID)) - if done == 1 then - widget:UnitFinished(unitID, unitDefID,team) - end - end - end - end - if metalSpotsNil and WG.metalSpots ~= nil then - Initialize() - metalSpotsNil = false - end - - WG.mouseoverMexIncome = 0 - - if mexSpotToDraw and WG.metalSpots then - WG.mouseoverMexIncome = mexSpotToDraw.metal - else - local _, cmd_id = spGetActiveCommand() - if cmd_id ~= nil and mexDefIDs[-cmd_id] == nil then - return - end - local mx, my = spGetMouseState() - local _, coords = spTraceScreenRay(mx, my, true, true) - if (not coords) then - return - end - IntegrateMetal(coords[1], coords[3]) - WG.mouseoverMexIncome = extraction - end + if WG.metalSpots and (not wasSpectating) and spGetSpectatingState() then + spotByID = {} + spotData = {} + wasSpectating = true + local units = spGetAllUnits() + for i, unitID in ipairs(units) do + local unitDefID = spGetUnitDefID(unitID) + if mexDefID[unitDefID] then + local done = select(5, spGetUnitHealth(unitID)) + if done == 1 then + widget:UnitFinished(unitID, unitDefID,team) + end + end + end + end + if metalSpotsNil and WG.metalSpots ~= nil then + Initialize() + metalSpotsNil = false + end + + WG.mouseoverMexIncome = false + + if mexSpotToDraw and WG.metalSpots then + WG.mouseoverMexIncome = mexSpotToDraw.metal + WG.mouseoverMex = mexSpotToDraw + else + local _, cmd_id = spGetActiveCommand() + if not cmd_id or not mexDefID[-cmd_id] then + return + end + local mx, my = spGetMouseState() + local _, coords = spTraceScreenRay(mx, my, true, true) + if (not coords) then + return + end + IntegrateMetal(coords[1], coords[3]) + WG.mouseoverMexIncome = extraction * mexDefID[-cmd_id] + end end ------------------------------------------------------------ -- Drawing ------------------------------------------------------------ -local centerX +local centerX local centerZ local extraction = 0 local mainMexDrawList = 0 +local mainMexValueDrawList = 0 local miniMexDrawList = 0 local function getSpotColor(x,y,z,id, specatate, t) - if specatate then - if spotData[id] then - if spotData[id].allyTeam == spGetMyAllyTeamID() then - return allyMexColor[t] - else - return enemyMexColor[t] - end - else - return neutralMexColor[t] - end - else - if spotData[id] then - return allyMexColor[t] - else - --local _, inLos = spGetPositionLosState(x,y,z, myAllyTeam) - --if inLos then - return neutralMexColor[t] - --else - -- return enemyMexColor - --end - end - end + if specatate then + if spotData[id] then + if options.specPlayerColours.value then + local r, g, b = Spring.GetTeamColor(spotData[id].team) + local alpha = t == 1 and 0.7 or 1.0 --Judging by colours set up top + return {r, g, b, alpha} + else + local r, g, b = Spring.GetTeamColor(Spring.GetTeamList(spotData[id].allyTeam)[1]) + local alpha = t == 1 and 0.7 or 1.0 --Judging by colours set up top + return {r, g, b, alpha} + end + else + return neutralMexColor[t] + end + else + if spotData[id] then + local r, g, b = Spring.GetTeamColor(spotData[id].team) + local alpha = t == 1 and 0.7 or 1.0 --Judging by colours set up top + return {r, g, b, alpha} + else + return neutralMexColor[t] + end + end end -function calcMainMexDrawList() - local specatate = spGetSpectatingState() - - for i = 1, #WG.metalSpots do - local spot = WG.metalSpots[i] - local x,z = spot.x, spot.z - local y = spGetGroundHeight(x,z) - if y < 0 then y = 0 end - - local mexColor = getSpotColor(x,y+45,z,i,specatate,1) - local metal = spot.metal - local size = 1 - if metal > 10 then - if metal > 100 then - metal = metal*0.01 - size = 5 - else - metal = metal*0.1 - size = 2.5 - end - end - - glPushMatrix() - - glLineWidth(spot.metal*1.5) - glColor(mexColor) - glDepthTest(true) - glDrawGroundCircle(x, 1, z, 40, 32) - - glRotate(90,1,0,0) - glColor(0,1,1) - glTranslate(0,0,-y-10) - glColor(1,1,1) - glTexture("LuaUI/Images/ibeam.png") - local width = 30*metal*size - glTexRect(x-width/2, z+20, x+width/2, z+20+30*size,0,0,metal,1) - glTexture(false) - --glColor(0,1,1) - --glRect(x-width/2, z+18, x+width/2, z+20) - glDepthTest(false) - glPopMatrix() - end - - glLineWidth(0) - glColor(1,1,1,1) +function calcMainMexDrawList(valuesonly) + local specatate = spGetSpectatingState() + + if WG.metalSpots then + if not valuesonly and circleOptions.enabled then + if circleOptions.animating == false then + DrawMexList() + end + end + + for i = 1, #WG.metalSpots do + local spot = WG.metalSpots[i] + local x,z,y = spot.x, spot.z, spot.y + if y < 0 then y = 0 end + local mexColor = getSpotColor(x,y+45,z,i,specatate,1) + local metal = spot.metal or 0 --nil fix by MaDDoX + + glPushMatrix() + if not valuesonly and not circleOptions.enabled then + glDepthTest(true) + glColor(0,0,0,0.7) + glLineWidth(spot.metal*2.6) + glDrawGroundCircle(x, 1, z, 40, 32) + glColor(mexColor) + glLineWidth(spot.metal*1.6) + glDrawGroundCircle(x, 1, z, 40, 32) + end + glPopMatrix() + + if valuesonly then + glPushMatrix() + + glDepthTest(false) + if options.drawicons.value then + local size = 1 + if metal > 10 then + if metal > 100 then + metal = metal*0.01 + size = 5 + else + metal = metal*0.1 + size = 2.5 + end + end + + + size = options.size.value + + glRotate(90,1,0,0) + glTranslate(0,0,-y-10) + glColor(1,1,1) + glTexture("LuaUI/Images/ibeam.png") + local width = metal*size + glTexRect(x-width/2, z+42, x+width/2, z+40+size,0,0,metal,1) + glTexture(false) + else + -- Draws the metal spot's base income "south" of the metal spot + glRotate(270,1,0,0) + glColor(1,1,1) + glTranslate(x,-z-70-options.size.value, y) + + if drawIncome then + font:Begin() + font:SetTextColor(1,1,1) + font:SetOutlineColor(0,0,0) + if options.drawcustomincomeamount.value ~= true then + font:Print(("%."..options.rounding.value.."f"):format(metal*options.multiplier.value), 0, 0, options.size.value, "con") + else + font:Print(("%."..options.rounding.value.."f"):format(options.customamount.value), 0, 0, options.size.value, "con") + end + font:End() + end + end + + glPopMatrix() + end + end + glLineWidth(1.0) + glColor(1,1,1,1) + end end ---[[ -function calcMiniMexDrawList() - local specatate = spGetSpectatingState() - - glLoadIdentity() - glTranslate(0,1,0) - glScale(mapXinv , -mapZinv, 1) - glRotate(270,1,0,0) - - for i = 1, #WG.metalSpots do - local spot = WG.metalSpots[i] - local x,z = spot.x, spot.z - local y = spGetGroundHeight(x,z) - - local mexColor = getSpotColor(x,y,z,i,specatate) - - glLineWidth(spot.metal) - glColor(mexColor) - - glDrawGroundCircle(x, 0, z, 40, 32) - - glPushMatrix() - - glPopMatrix() - end - - glLineWidth(0) - glColor(1,1,1,1) + +function DrawMexList() + local specatate = spGetSpectatingState() + + local gf = spGetGameFrame() + spGetFrameTimeOffset(); + + gl.Texture(0, spotTexture) + gl.Blending(GL.ONE, GL.ONE) -- "hellish" look (1/2) + + if WG.metalSpots and circleList then + for i = 1, #WG.metalSpots do + local spot = WG.metalSpots[i] + local x,z,y = spot.x, spot.z, spot.y + if y < 0 then y = 0 end + local mexColor = getSpotColor(x,y+45,z,i,specatate,1) + local metal = spot.metal or 0 + metal = math.max(metal, 0.1) --min = 0.1 + + glPushMatrix() + --glScale(0.5,1,0.5) -- Remove this to properly align the fancy circles (from circleList) + --glLoadIdentity() + + --glTranslate(x,y + 100,z) + glTranslate(0, y + textureYoffset, 0) + --glColor(0,0,0,1) Black Solid + glColor(0.53, 0.77, 0.89, 0.9) + --glRotate(currentRotationAngle,0,1,0) + --glScale(0.9,1,0.9) + gl.UseShader(animShader) + gl.Uniform(animProgressLoc, (gf % animRate) / animRate) + glRotate(90, 1, 0, 0) + gl.TexRect(x-texturewidth, z-texturewidth, x+texturewidth, z+texturewidth) + --glDrawGroundRect(x-80, z-80, x+80, z+80) + gl.UseShader(0) + --glCallList(circleList) + ----mexColor[4] = 0.8 + ----glColor(mexColor) + --glColor(1,1,1,(metal or 0) * 0.5) + --glScale(0.9,1,0.9) + --glCallList(circleList) + --glRotate(-currentRotationAngle,0,1,0) + + --glRotate(currentRotationAngleOpposite,0,1,0) + --glRotate(180,1,0,0) + --glColor(0,0,0,1) + --glScale(2.5,1,2.5) + --glCallList(circleList) + ----mexColor[4] = 0.8 + ----glColor(mexColor) + --glColor(0.53, 0.77, 0.89, 1) + --glScale(0.9,0.9,0.9) + --glCallList(circleList) + --glTranslate(-x,-y,-z) + --glRotate(-currentRotationAngleOpposite,0,1,0) + glPopMatrix() + end + end + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) --Hellish look (2/2) + gl.Texture(0, false) end ---]] + function updateMexDrawList() - if (mainMexDrawList) then gl.DeleteList(mainMexDrawList); mainMexDrawList=nil end --delete previous list if exist (ref:gui_chicken.lua by quantum) - mainMexDrawList = glCreateList(calcMainMexDrawList) - --miniMexDrawList = glCreateList(calcMiniMexDrawList) + if (mainMexDrawList) then + gl.DeleteList(mainMexDrawList); + gl.DeleteList(mainMexValueDrawList); + mainMexDrawList = nil + mainMexValueDrawList = nil + end --delete previous list if exist (ref:gui_chicken.lua by quantum) + mainMexDrawList = glCreateList(calcMainMexDrawList, false) + mainMexValueDrawList = glCreateList(calcMainMexDrawList, true) + --miniMexDrawList = glCreateList(calcMiniMexDrawList) end function widget:Shutdown() - gl.DeleteList(mainMexDrawList) + gl.DeleteList(mainMexDrawList) + gl.DeleteList(mainMexValueDrawList) + gl.DeleteList(circleList) + gl.DeleteShader(animShader) end local function DoLine(x1, y1, z1, x2, y2, z2) @@ -651,158 +832,164 @@ local function DoLine(x1, y1, z1, x2, y2, z2) gl.Vertex(x2, y2, z2) end -function widget:DrawWorld() - - -- Check command is to build a mex - local _, cmdID = spGetActiveCommand() - local peruse = spGetGameFrame() < 1 or spGetMapDrawMode() == 'metal' or (WG.GetWidgetOption and WG.GetWidgetOption('Chili Minimap','Settings/Interface/Map','alwaysDisplayMexes').value) - - local mx, my = spGetMouseState() - local _, pos = spTraceScreenRay(mx, my, true) - - mexSpotToDraw = false - - local validMexId = false - - if cmd_id ~= nil and mexDefIDs[-cmd_id] then - - validMexId = true - end - - drawMexSpots = WG.metalSpots and (validMexId or CMD_AREA_MEX == cmdID or peruse) - - if WG.metalSpots and pos and (validMexId or peruse or CMD_AREA_MEX == cmdID) then - - - -- Find build position and check if it is valid (Would get 100% metal) - - local referenceMexId = referenceLandMexId - - if pos[2] < 1 then - referenceMexId = referenceUnderWaterMexId - end - - local bx, by, bz = Spring.Pos2BuildPos(referenceMexId, pos[1], pos[2], pos[3]) - - local bface = Spring.GetBuildFacing() - local closestSpot, distance, index = GetClosestMetalSpot(bx, bz) - - if closestSpot and (validMexId or not ((CMD_AREA_MEX == cmdID or peruse) and distance > 1000)) and (not spotData[index]) then - - mexSpotToDraw = closestSpot - gl.DepthTest(false) - - local height = spGetGroundHeight(closestSpot.x,closestSpot.z) - height = height > 0 and height or 0 - - gl.LineWidth(1.49) - gl.Color(1, 1, 0, 0.5) - gl.BeginEnd(GL.LINE_STRIP, DoLine, bx, by, bz, closestSpot.x, height, closestSpot.z) - gl.LineWidth(1.0) - - gl.DepthTest(true) - gl.DepthMask(true) - - gl.Color(1, 1, 1, 0.5) - gl.PushMatrix() - gl.Translate(closestSpot.x, height, closestSpot.z) - gl.Rotate(90 * bface, 0, 1, 0) - gl.UnitShape(referenceMexId, Spring.GetMyTeamID()) - gl.PopMatrix() - - gl.DepthTest(false) - gl.DepthMask(false) - end - end - - if drawMexSpots then - glCallList(mainMexDrawList) - end - - gl.Color(1, 1, 1, 1) -end +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + -- Check command is to build a mex + local _, cmdID = spGetActiveCommand() + local peruse = spGetGameFrame() < 1 or spGetMapDrawMode() == 'metal' + + drawMexSpots = WG.metalSpots and ((cmdID and mexDefID[-cmdID]) or CMD_AREA_MEX == cmdID or peruse) + + + if drawMexSpots or (circleOptions.enabled and circleOptions.alwaysshow) then + + if circleOptions.enabled and circleOptions.animating then + local clockDifference = (os.clock() - previousOsClock) + previousOsClock = os.clock() + + -- animate rotation + if circleOptions.rotationSpeed > 0 then + local angleDifference = (circleOptions.rotationSpeed) * (clockDifference * 5) + currentRotationAngle = currentRotationAngle + (angleDifference*0.66) + if currentRotationAngle > 360 then + currentRotationAngle = currentRotationAngle - 360 + end + + currentRotationAngleOpposite = currentRotationAngleOpposite - angleDifference + if currentRotationAngleOpposite < -360 then + currentRotationAngleOpposite = currentRotationAngleOpposite + 360 + end + end + + -- Draw the amounts + gl.DepthTest(true) + gl.DepthMask(true) + if not circleOptions.enabled then + glCallList(mainMexDrawList) + end + glCallList(mainMexValueDrawList) -function widget:DrawInMiniMap() - - if drawMexSpots then - --[[ - glPushMatrix() - glLoadIdentity() - glTranslate(0, 1, 0) - glScale(mapXinv , -mapZinv, 1) - - widget:DrawWorld() - glPopMatrix() - --]] - - local specatate = spGetSpectatingState() - - glLoadIdentity() - glTranslate(0,1,0) - glScale(mapXinv , -mapZinv, 1) - glRotate(270,1,0,0) - - for i = 1, #WG.metalSpots do - local spot = WG.metalSpots[i] - local x,z = spot.x, spot.z - local y = spGetGroundHeight(x,z) - - local mexColor = getSpotColor(x,y,z,i,specatate,2) - - glLineWidth(spot.metal) - glLighting(false) - glColor(mexColor) - - glDrawGroundCircle(x, 0, z, MINIMAP_DRAW_SIZE, 32) - end - - glLineWidth(0) - glColor(1,1,1,1) - - end + -- + DrawMexList() + + gl.DepthTest(false) + gl.DepthMask(false) + end + end end ---[[ -local function DrawTextWithBackground(text, x, y, size, opt) - local width = glGetTextWidth(text) * size - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) - - glColor(0.25, 0.25, 0.25, 0.75) - if (opt) then - if (strFind(opt, "r")) then - glRect(x, y, x - width, y + size * TEXT_CORRECT_Y) - elseif (strFind(opt, "c")) then - glRect(x + width * 0.5, y, x - width * 0.5, y + size * TEXT_CORRECT_Y) - else - glRect(x, y, x + width, y + size * TEXT_CORRECT_Y) - end - else - glRect(x, y, x + width, y + size * TEXT_CORRECT_Y) - end - glColor(0.75, 0.75, 0.75, 1) - glText(text, x, y, size, opt) - +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end end -function widget:DrawScreen() - if mexSpotToDraw and WG.metalSpots then - local mx, my = spGetMouseState() - DrawTextWithBackground("\255\255\255\255Metal extraction: " .. strFormat("%.2f", mexSpotToDraw.metal), mx, my, TEXT_SIZE, "d") - glColor(1, 1, 1, 1) - else - local _, cmd_id = spGetActiveCommand() - if -mexDefID ~= cmd_id then - return - end - local mx, my = spGetMouseState() - local _, coords = spTraceScreenRay(mx, my, true, true) - if (not coords) then - return - end - IntegrateMetal(coords[1], coords[3]) - DrawTextWithBackground("\255\255\255\255Metal extraction: " .. strFormat("%.2f", extraction), mx, my, TEXT_SIZE, "d") - glColor(1, 1, 1, 1) - end +function widget:DrawWorld() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + -- Check command is to build a mex + local _, cmdID = spGetActiveCommand() + local peruse = spGetGameFrame() < 1 or spGetMapDrawMode() == 'metal' + + local mx, my = spGetMouseState() + local _, pos = spTraceScreenRay(mx, my, true) + + mexSpotToDraw = false + + if WG.metalSpots and pos and ((cmdID and mexDefID[-cmdID]) or peruse or CMD_AREA_MEX == cmdID) then + + -- Find build position and check if it is valid (Would get 100% metal) + local bx, by, bz + if cmdID and cmdID < 0 then + bx, by, bz = Spring.Pos2BuildPos(-cmdID, pos[1], pos[2], pos[3]) + else + bx, by, bz = pos[1], pos[2], pos[3] + end + local bface = Spring.GetBuildFacing() + local closestSpot, distance, index = GetClosestMetalSpot(bx, bz) + + if closestSpot and ((cmdID and mexDefID[-cmdID]) or not ((CMD_AREA_MEX == cmdID or peruse) and distance > 60)) and (not spotData[index]) then + + mexSpotToDraw = closestSpot + + local height = spGetGroundHeight(closestSpot.x,closestSpot.z) + height = height > 0 and height or 0 + + gl.DepthTest(false) + + gl.LineWidth(1.7) + gl.Color(1, 1, 0, 0.5) + gl.BeginEnd(GL.LINE_STRIP, DoLine, bx, by, bz, closestSpot.x, height, closestSpot.z) + gl.LineWidth(1.0) + + gl.DepthTest(true) + gl.DepthMask(true) + + gl.Color(1, 1, 1, 0.5) + gl.PushMatrix() + gl.Translate(closestSpot.x, height, closestSpot.z) + gl.Rotate(90 * bface, 0, 1, 0) + if (cmdID and cmdID < 0) then + gl.UnitShape(-cmdID, Spring.GetMyTeamID(), false, true, false) + end + gl.PopMatrix() + + gl.DepthTest(false) + gl.DepthMask(false) + end + end + + gl.Color(1, 1, 1, 1) +end + +function widget:DrawInMiniMap(minimapX, minimapY) + + if not glDrawCircle then + glDrawCircle = gl.Utilities.DrawCircle + end + + --if drawMexSpots then + local specatate = spGetSpectatingState() + + glTranslate(0,minimapY,0) + glScale(minimapX/mapX, -minimapY/mapZ, 1) + + for i = 1, #WG.metalSpots do + local spot = WG.metalSpots[i] + local x,z = spot.x, spot.z + local y = spGetGroundHeight(x,z) + + local mexColor = getSpotColor(x,y,z,i,specatate,2) + + glLighting(false) + + --Static minimap mex marker locations + glColor(0,0,0,1) + glLineWidth(2.5) + glDrawCircle(x, z, MINIMAP_DRAW_SIZE) + glLineWidth(1.75) + --mexColor[4] = 0.85 + --glColor(mexColor) + glColor(0.53, 0.77, 0.89, 1) + + --This is for mex circles on the minimap that denote the amount that mexes give (hard to see) + -- glColor(0,0,0,0.66) + -- glLineWidth(((spot.metal > 0 and spot.metal) or 0.1)*5.0) + -- glDrawGroundCircle(x, 0, z, MINIMAP_DRAW_SIZE, 32) + -- glLineWidth(((spot.metal > 0 and spot.metal)*2) or 0.1) + -- mexColor[4] = 0.85 + -- glColor(mexColor) + + glDrawCircle(x, z, MINIMAP_DRAW_SIZE) + end + + glLineWidth(1.0) + glColor(1,1,1,1) + + --end + end ---]] \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_no_duplicate_orders.lua b/LuaUI/Widgets_Evo/cmd_no_duplicate_orders.lua deleted file mode 100644 index a13523c0c..000000000 --- a/LuaUI/Widgets_Evo/cmd_no_duplicate_orders.lua +++ /dev/null @@ -1,128 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: cmd_no_duplicate_orders.lua --- brief: Blocks duplicate Attack and Repair/Build orders --- author: Owen Martindell --- --- Copyright (C) 2008. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "NoDuplicateOrders", - desc = "Blocks duplicate Attack and Repair/Build orders 1.1b", - author = "TheFatController", - date = "16 April, 2008", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local GetSelectedUnits = Spring.GetSelectedUnits -local GetCommandQueue = Spring.GetCommandQueue -local GetUnitPosition = Spring.GetUnitPosition -local GiveOrderToUnit = Spring.GiveOrderToUnit -local GetUnitHealth = Spring.GetUnitHealth - -local buildList = {} - -function widget:Initialize() - if Spring.GetSpectatingState() or Spring.IsReplay() then widgetHandler:RemoveWidget() end - for _,unitID in ipairs(Spring.GetTeamUnits(Spring.GetMyTeamID())) do - local _, _, _, _, buildProgress = GetUnitHealth(unitID) - if (buildProgress < 1) then widget:UnitCreated(unitID) end - end -end - -local function toLocString(posX,posY,posZ) - return (math.ceil(posX - 0.5) .. "_" .. math.ceil(posZ - 0.5)) -end - -function widget:UnitCreated(unitID, unitDefID, unitTeam) - local locString = toLocString(GetUnitPosition(unitID)) - buildList[locString] = unitID -end - -function widget:UnitFinished(unitID, unitDefID, unitTeam) - local locString = toLocString(GetUnitPosition(unitID)) - buildList[locString] = nil -end - -function widget:UnitDestroyed(unitID, unitDefID, unitTeam) - local locString = toLocString(GetUnitPosition(unitID)) - buildList[locString] = nil -end - -function widget:CommandNotify(id, params, options) - if (options.coded == 16) then - if (id == CMD.REPAIR) then - local selUnits = GetSelectedUnits() - local blockUnits = {} - for _,unitID in ipairs(selUnits) do - local cQueue = GetCommandQueue(unitID, 1) - if (#cQueue > 0) then - if (cQueue[1].id < 0) and (params[1] == buildList[toLocString(cQueue[1].params[1], 0, cQueue[1].params[3])]) then - blockUnits[unitID] = true - elseif (cQueue[1].id == CMD.REPAIR) and (params[1] == cQueue[1].params[1]) then - blockUnits[unitID] = true - end - end - end - if next(blockUnits) then - for _,unitID in ipairs(selUnits) do - if not blockUnits[unitID] then - GiveOrderToUnit(unitID, id, params, options) - else - local cQueue = GetCommandQueue(unitID) - for _,v in ipairs(cQueue) do - if (v.tag ~= cQueue[1].tag) then - GiveOrderToUnit(unitID,v.id,v.params,{"shift"}) - end - end - end - end - return true - else - return false - end - elseif (id == CMD.ATTACK) then - local selUnits = GetSelectedUnits() - local blockUnits = {} - for _,unitID in ipairs(selUnits) do - local cQueue = GetCommandQueue(unitID) - if (#cQueue > 0) and (params[1] == cQueue[1].params[1]) then - blockUnits[unitID] = true - end - end - if next(blockUnits) then - for _,unitID in ipairs(selUnits) do - if not blockUnits[unitID] then - GiveOrderToUnit(unitID, id, params, options) - else - local cQueue = GetCommandQueue(unitID) - for _,v in ipairs(cQueue) do - if (v.tag ~= cQueue[1].tag) then - GiveOrderToUnit(unitID,v.id,v.params,{"shift"}) - end - end - end - end - return true - else - return false - end - end - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/cmd_old_style_chat_keys.lua b/LuaUI/Widgets_Evo/cmd_old_style_chat_keys.lua new file mode 100644 index 000000000..397824a75 --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_old_style_chat_keys.lua @@ -0,0 +1,44 @@ +function widget:GetInfo() + return { + name = "Alternate Chat Keys", + desc = "Binds alt/shift+enter for ally/spec chat, alt+backspace for fullscreen toggle" , + author = "", + date = "", + license = "Anyone who uses this widget has to email me a horse", + layer = 0, + enabled = true + } +end + +local binds={ + "bind Alt+backspace fullscreen", + + "bind Alt+enter chatally", + "bind Alt+enter chatswitchally", + "bind Ctrl+enter chatall", + "bind Ctrl+enter chatswitchall", + "bind Shift+enter chatspec", + "bind Shift+enter chatswitchspec", +} + +local unbinds={ + "bind Alt+enter fullscreen", +} + +function widget:Initialize() + for k,v in ipairs(unbinds) do + Spring.SendCommands("un"..v) + end + for k,v in ipairs(binds) do + Spring.SendCommands(v) + end +end + +function widget:Shutdown() + for k,v in ipairs(binds) do + Spring.SendCommands("un"..v) + end + for k,v in ipairs(unbinds) do + Spring.SendCommands(v) + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_persistent_build_spacing.lua b/LuaUI/Widgets_Evo/cmd_persistent_build_spacing.lua new file mode 100644 index 000000000..a00a7d7c3 --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_persistent_build_spacing.lua @@ -0,0 +1,46 @@ +function widget:GetInfo() + return { + name = "Persistent Build Spacing", + desc = "Recalls last build spacing set for each building and game [v2.0]", + author = "Niobium & DrHash", + date = "Sep 6, 2011", + license = "GNU GPL, v3 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-- Config +local defaultSpacing = 0 + +-- Globals +local lastCmdID = nil +local buildSpacing = {} + +-- Speedups +local spGetActiveCommand = Spring.GetActiveCommand +local spGetBuildSpacing = Spring.GetBuildSpacing +local spSetBuildSpacing = Spring.SetBuildSpacing + +-- Callins +function widget:Update() + + local _, cmdID = spGetActiveCommand() + if cmdID and cmdID < 0 then + + if cmdID ~= lastCmdID then + spSetBuildSpacing(buildSpacing[-cmdID] or defaultSpacing) + lastCmdID = cmdID + end + + buildSpacing[-cmdID] = spGetBuildSpacing() + end +end + +function widget:GetConfigData() + return { buildSpacing = buildSpacing } +end + +function widget:SetConfigData(data) + buildSpacing = data.buildSpacing or {} +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_state_reverse_toggle.lua b/LuaUI/Widgets_Evo/cmd_state_reverse_toggle.lua index da3560071..6606a9f56 100644 --- a/LuaUI/Widgets_Evo/cmd_state_reverse_toggle.lua +++ b/LuaUI/Widgets_Evo/cmd_state_reverse_toggle.lua @@ -1,8 +1,8 @@ function widget:GetInfo() return { name = "State Reverse Toggle", - desc = "Makes multinary states reverse toggleable", - author = "Google Frog", + desc = "Makes all buttons with 3 or more states reverse toggleable", + author = "Google Frog, Deadnight Warrior", date = "Oct 2, 2009", license = "GNU GPL, v2 or later", layer = 0, @@ -12,32 +12,26 @@ end local spGetSelectedUnits = Spring.GetSelectedUnits local spGiveOrderToUnit = Spring.GiveOrderToUnit - -local CMD_FIRE_STATE = CMD.FIRE_STATE -local CMD_MOVE_STATE = CMD.MOVE_STATE - -local multiStates = { - [CMD_FIRE_STATE] = 3, - [CMD_MOVE_STATE] = 3, - [CMD.AUTOREPAIRLEVEL] = 4, -} +local spGetActiveCmdDesc = Spring.GetActiveCmdDesc +local spGetCmdDescIndex = Spring.GetCmdDescIndex function widget:CommandNotify(id, params, options) - - if multiStates[id] then - if options.right then - local units = spGetSelectedUnits() - local state = params[1] - - state = state - 2 -- engine sent us one step forward instead of one step back, so we go two steps back - if state < 0 then - state = multiStates[id] + state -- wrap - end - for i=1, #units do - spGiveOrderToUnit(units[i], id, { state }, {}) + + local index = spGetCmdDescIndex(id) + if index then + local comButton = spGetActiveCmdDesc(index) + if comButton and comButton.params and #comButton.params>3 then + if options.right then + local units = spGetSelectedUnits() + local state = params[1] -2 + if state < 0 then + state = state + #comButton.params - 1 + end + for _,sid in ipairs(units) do + spGiveOrderToUnit(sid, id, { state }, {}) + end + return true end - return true end - end - -end \ No newline at end of file + end +end diff --git a/LuaUI/Widgets_Evo/cmd_stop_selfd.lua b/LuaUI/Widgets_Evo/cmd_stop_selfd.lua new file mode 100644 index 000000000..5c068f36a --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_stop_selfd.lua @@ -0,0 +1,23 @@ +function widget:GetInfo() + return { + name = "Stop Self-D", + desc = "Stop orders cancel self destruct commands", + author = "Bluestone", + date = "GPL v3 or later", + license = "Feb 2015", + layer = 0, + enabled = true + } +end + +local CMD_STOP = CMD.STOP + +function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + if cmdID ~= CMD_STOP then return end + if not unitID then return end + if teamID ~= Spring.GetMyTeamID() then return end + + if (Spring.GetUnitSelfDTime(unitID) > 0) then + Spring.GiveOrderToUnit(unitID, CMD.SELFD, {}, {}) + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cmd_tumorspread.lua.disabledfornow b/LuaUI/Widgets_Evo/cmd_tumorspread.lua.disabledfornow new file mode 100644 index 000000000..9e68cfd57 --- /dev/null +++ b/LuaUI/Widgets_Evo/cmd_tumorspread.lua.disabledfornow @@ -0,0 +1,61 @@ +function widget:GetInfo() + return { + name = "Automatic Tumor Spread", + desc = "AAAAAAAAAAAAAA", + author = "Damgam", + date = "2020", + license = "nobody cares", + layer = 5, + enabled = true + } +end + +--local tumortype = game:GetTypeByName("ztumor") +function widget:GameFrame(n) + + if n == 1 then + myTeamID = Spring.GetMyTeamID() + myFaction = Spring.GetTeamRulesParam(myTeamID, "faction", playerFaction) + --Spring.Echo("[Ambient Background Sound Player] Player faction is " .. myFaction) + + if myFaction ~= "zaal" then + widgetHandler:RemoveWidget(self) + end + end + + +end + +function widget:Initialize() + +end + +function widget:UnitFinished(unitID, unitDefID, unitTeam) + if myTeamID == unitTeam and UnitDefs[unitDefID].name == "ztumor" then + local builderX, builderY, builderZ = Spring.GetUnitPosition(unitID) + local buildpos1X = builderX - 296 + local buildpos2X = builderX + 296 + local buildpos3X = builderX + local buildpos4X = builderX + local buildpos1Z = builderZ + local buildpos2Z = builderZ + local buildpos3Z = builderZ + 296 + local buildpos4Z = builderZ - 296 + local buildpos1Y = Spring.GetGroundHeight(buildpos1X, buildpos1Z) + local buildpos2Y = Spring.GetGroundHeight(buildpos2X, buildpos2Z) + local buildpos3Y = Spring.GetGroundHeight(buildpos3X, buildpos3Z) + local buildpos4Y = Spring.GetGroundHeight(buildpos4X, buildpos4Z) + if #Spring.GetUnitsInCylinder(buildpos1X,buildpos1Z,250) < 1 then + Spring.GiveOrderToUnit(unitID, -unitDefID , {buildpos1X, buildpos1Y, buildpos1Z, 0}, {"shift"}) + end + if #Spring.GetUnitsInCylinder(buildpos2X,buildpos2Z,250) < 1 then + Spring.GiveOrderToUnit(unitID, -unitDefID , {buildpos2X, buildpos2Y, buildpos2Z, 0}, {"shift"}) + end + if #Spring.GetUnitsInCylinder(buildpos3X,buildpos3Z,250) < 1 then + Spring.GiveOrderToUnit(unitID, -unitDefID , {buildpos3X, buildpos3Y, buildpos3Z, 0}, {"shift"}) + end + if #Spring.GetUnitsInCylinder(buildpos4X,buildpos4Z,250) < 1 then + Spring.GiveOrderToUnit(unitID, -unitDefID , {buildpos4X, buildpos4Y, buildpos4Z, 0}, {"shift"}) + end + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/cnslcmd.lua b/LuaUI/Widgets_Evo/cnslcmd.lua deleted file mode 100644 index 386e8002e..000000000 --- a/LuaUI/Widgets_Evo/cnslcmd.lua +++ /dev/null @@ -1,19 +0,0 @@ - -function widget:GetInfo() - return { - name = "Luarules Console Commands", - desc = "Remove the need to add /luarules in front of gadgets command", - author = "zwzsg", - date = "15th July, 2009", - license = "Public Domain", - layer = 0, - enabled = true, - handler = false, - } -end - -function widget:AddConsoleLine(line,priority) - if string.match("\n"..line,"\n/(.+)") and not string.match("\n"..line,"\n/luarules(.+)") then - Spring.SendCommands("luarules "..string.match("\n"..line,"\n/(.+)")) - end -end diff --git a/LuaUI/Widgets_Evo/dbg_buildpic_preload.lua b/LuaUI/Widgets_Evo/dbg_buildpic_preload.lua deleted file mode 100644 index 814732109..000000000 --- a/LuaUI/Widgets_Evo/dbg_buildpic_preload.lua +++ /dev/null @@ -1,65 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Image Preloader", - desc = "Preloads images; fixes buildpic issues", - author = "jK", - date = "@2009", - license = "GPLv2", - layer = 1000, - enabled = true, -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local i = 1 -local v = 1 -local files = nil - -local function AddDir(path) - for _, f in ipairs(VFS.DirList(path),"*.png") do - files[#files+1] = f - end - for _, f in ipairs(VFS.DirList(path),"*.dds") do - files[#files+1] = f - end - --[[for _, f in ipairs(VFS.SubDirs(path)) do - if (f ~= "." and f ~=".." and f~=".svn") then - AddDir(f) - end - end]]-- -end - - - -function widget:DrawGenesis() - if files == nil then - files = {} - --AddDir("LuaUI/Images") - AddDir("icons") - else - if (UnitDefs[i]) then - gl.Texture(7,'#'..i) - gl.Texture(7,false) - i = i + 1 - else - local file = files[v] - if file then - --Spring.Echo(file) - gl.Texture(7, file) - gl.Texture(7, false) - v = v + 1 - - else - widgetHandler:RemoveWidget() - end - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/dbg_ceg_spawner.lua b/LuaUI/Widgets_Evo/dbg_ceg_spawner.lua deleted file mode 100644 index 9a8a09613..000000000 --- a/LuaUI/Widgets_Evo/dbg_ceg_spawner.lua +++ /dev/null @@ -1,129 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "CEG Spawner", - desc = "v0.03 Spawn CEGs", - author = "CarRepairer", - date = "2010-11-07", - license = "GPLv2", - layer = 5, - enabled = true, -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---Set to true to sort CEGs into alphabetic submenus. This cannot be added to epicmenu options because it's used to actually change those options. -local ALPHA = true - -local echo = Spring.Echo --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -options_order = { 'reload', 'xdir', 'ydir', 'zdir', 'radius', } -options_path = 'Settings/Toolbox/CEG Spawner' -options = { - reload = { - name = 'Reload CEGs', - type = 'button', - OnChange = function() Spring.SendCommands('reloadcegs') end, - }, - - xdir = { - name = 'X (-1,1)', - type = 'number', - min = -1, max = 1, step = 0.1, - value = 0, - }, - ydir = { - name = 'Y (-1,1)', - type = 'number', - min = -1, max = 1, step = 0.1, - value = 0, - }, - zdir = { - name = 'Z (-1,1)', - type = 'number', - min = -1, max = 1, step = 0.1, - value = 0, - }, - radius = { - name = 'Radius (0 - 100)', - type = 'number', - min = 0, max = 100, step = 1, - value = 20, - }, - - - -} - - -local vsx, vsy = widgetHandler:GetViewSizes() -local cx,cy = vsx * 0.5,vsy * 0.5 - - -local function AddCEGButton(cegname) - options_order[#options_order+1] = cegname - - options[cegname] = { - type = 'button', - name = cegname, - OnChange = function() - if not Spring.IsCheatingEnabled() then - echo "Cannot do this unless Cheating is enabled." - return - end - cx,cy = vsx * 0.5,vsy * 0.5 - local ttype,pos = Spring.TraceScreenRay(cx, cy, true) - if ttype == 'ground' then - Spring.SendLuaRulesMsg( '*' .. cegname - .. '|' .. pos[1] - .. '|' .. pos[2] - .. '|' .. pos[3] - - .. '|' .. options.xdir.value - .. '|' .. options.ydir.value - .. '|' .. options.zdir.value - .. '|' .. options.radius.value - - - ) - else - echo "Cannot do this with a unit in the center of the screen." - end - end, - } - - if ALPHA then - options[cegname].path = options_path..'/' .. cegname:sub(1,1):upper() - --echo ( options[cegname].path ) - end -end - -local function SetupOptions() - local explosionDefs = VFS.Include("gamedata/explosions.lua") - - local explosions2 = {} - for k,v in pairs(explosionDefs) do - --echo(k,v) - explosions2[#explosions2+1] = k - end - table.sort(explosions2) - for i,v in ipairs(explosions2) do - AddCEGButton(v) - end -end - - -SetupOptions() - - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY - cx = vsx * 0.5 - cy = vsy * 0.5 -end diff --git a/LuaUI/Widgets_Evo/dbg_chili_inspector.lua b/LuaUI/Widgets_Evo/dbg_chili_inspector.lua index 26980c9e3..1f1f01e71 100644 --- a/LuaUI/Widgets_Evo/dbg_chili_inspector.lua +++ b/LuaUI/Widgets_Evo/dbg_chili_inspector.lua @@ -35,7 +35,7 @@ local function trace(children, node, level, max_level) for i=1,#children do local obj = children[i] if obj and (obj.name ~= "wnd_inspector") then - local caption = ("%s: %s (redrawn: %i)"):format(obj.classname, obj.name, obj._redrawCounter or 0) + local caption = ("%s: %s (redrawn: %i/%i)"):format(obj.classname, obj.name, obj._redrawSelfCounter or 0, obj._redrawCounter or 0) local nodec = node:Add(caption) trace(obj.children, nodec, (level or 0) + 1, max_level) end @@ -44,7 +44,7 @@ end local function traceLost(node) - + for i,obj in pairs(Chili.DebugHandler.allObjects) do if obj.name ~= "wnd_inspector" then if (not obj.parent)and(not obj:InheritsFrom("screen")) then diff --git a/LuaUI/Widgets_Evo/dbg_deferred_test.lua b/LuaUI/Widgets_Evo/dbg_deferred_test.lua new file mode 100644 index 000000000..a82b33e98 --- /dev/null +++ b/LuaUI/Widgets_Evo/dbg_deferred_test.lua @@ -0,0 +1,27 @@ +function widget:GetInfo() + return { + name = "Deferred shading test", + layer = 0, + enabled = false, + } +end + +local vsx, vsy + +function widget:Initialize() + vsx, vsy = widgetHandler:GetViewSizes() +end + +function widget:Shutdown() +end + +function widget:DrawGenesis() +end + +local texName = "$model_gbuffer_normtex" + +function widget:DrawScreenEffects() + gl.Texture(0, texName) + gl.TexRect(0, 0, vsx, vsy, false, true) + gl.Texture(0, false) +end diff --git a/LuaUI/Widgets_Evo/dbg_devcommands.lua b/LuaUI/Widgets_Evo/dbg_devcommands.lua deleted file mode 100644 index 169b2c5c8..000000000 --- a/LuaUI/Widgets_Evo/dbg_devcommands.lua +++ /dev/null @@ -1,96 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Dev Commands", - desc = "v0.01 Dev Commands", - author = "CarRepairer", - date = "2011-11-17", - license = "GPLv2", - layer = 5, - enabled = true, -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local echo = Spring.Echo --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -options_path = 'Settings/Toolbox/Dev Commands' -options = { - - cheat = { - name = "Cheat", - type = 'button', - action = 'cheat', - }, - nocost = { - name = "No Cost", - type = 'button', - action = 'nocost', - }, - - spectator = { - name = "Spectator", - type = 'button', - action = 'spectator', - }, - - godmode = { - name = "Godmode", - type = 'button', - action = 'godmode', - }, - - testunit = { - name = "Spawn Testunit", - type = 'button', - action = 'give testunit', - }, - - luauireload = { - name = "Reload LuaUI", - type = 'button', - action = 'luaui reload', - }, - - luarulesreload = { - name = "Reload LuaRules", - type = 'button', - action = 'luarules reload', - }, - - debug = { - name = "Debug", - type = 'button', - action = 'debug', - }, - debugcolvol = { - name = "Debug Colvol", - type = 'button', - action = 'debugcolvol', - }, - debugpath = { - name = "Debug Path", - type = 'button', - action = 'debugpath', - }, - - - printunits = { - name = "Print Units", - type = 'button', - OnChange = function(self) - for i=1,#UnitDefs do - local ud = UnitDefs[i] - local name = ud.name - Spring.Echo("'" .. name .. "',") - end - end, - }, - -} - diff --git a/LuaUI/Widgets_Evo/dbg_image_preload.lua b/LuaUI/Widgets_Evo/dbg_image_preload.lua new file mode 100644 index 000000000..f7356b0d3 --- /dev/null +++ b/LuaUI/Widgets_Evo/dbg_image_preload.lua @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Image Preloader", + desc = "Preloads images; fixes buildpic issues", + author = "jK", + date = "@2009", + license = "GPLv2", + layer = 1000, + enabled = true, -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local i = 1 +local v = 1 +local files = nil + +local function AddDir(path) + for _, f in ipairs(VFS.DirList(path),"*.png") do + files[#files+1] = f + end + for _, f in ipairs(VFS.DirList(path),"*.dds") do + files[#files+1] = f + end + --[[for _, f in ipairs(VFS.SubDirs(path)) do + if (f ~= "." and f ~=".." and f~=".svn") then + AddDir(f) + end + end]]-- +end + + + +function widget:DrawGenesis() + if files == nil then + files = {} + AddDir("unittextures") + AddDir("unitpics") + AddDir("icons") + else + if (UnitDefs[i]) then + gl.Texture(7,'#'..i) + gl.Texture(7,false) + i = i + 1 + else + local file = files[v] + if file then + --Spring.Echo(file) + gl.Texture(7, file) + gl.Texture(7, false) + v = v + 1 + + else + widgetHandler:RemoveWidget() + end + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/dbg_mouse_to_cv_portable.lua b/LuaUI/Widgets_Evo/dbg_mouse_to_cv_portable.lua new file mode 100644 index 000000000..cb67080ba --- /dev/null +++ b/LuaUI/Widgets_Evo/dbg_mouse_to_cv_portable.lua @@ -0,0 +1,78 @@ +function widget:GetInfo() + return { + name = "Mouse to Control Victory Points", + desc = "Click to make a control points table. Alt+M to toggle. Works with any game.", + author = "Google Frog", + date = "April 28, 2012", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false -- loaded by default? + } +end + +include("keysym.h.lua") + +local floor = math.floor + +------------------------------------------------ +-- Variables +------------------------------------------------ +local enabled = true +local markers = {} +local cvIndex = 1 +local yPosition = 0 -- The gadget sets this, no need to bother setting it to anything other than 0 +local handle + +------------------------------------------------ +-- Press Handling +------------------------------------------------ + +function widget:KeyPress(key, modifier, isRepeat) + if modifier.alt then + if key == KEYSYMS.M then + enabled = not enabled + end + end +end + +local function legalPos(pos) + return pos and pos[1] > 0 and pos[3] > 0 and pos[1] < Game.mapSizeX and pos[3] < Game.mapSizeZ +end + +function widget:MousePress(mx, my, button) + if enabled and (not Spring.IsAboveMiniMap(mx, my)) then + local _, pos = Spring.TraceScreenRay(mx, my, true) + if legalPos(pos) then + if true then + handle:write("[" .. cvIndex .. "] = {x = " .. floor(pos[1] + 0.5) .. ", y = " .. tostring(yPosition) .. ", z = " .. floor(pos[3] + 0.5) .. "},\n") + handle:flush() + markers[#markers + 1] = {pos[1], 0, pos[3]} + Spring.MarkerAddPoint(pos[1], 0, pos[3], cvIndex) + cvIndex = cvIndex + 1 + else -- TODO: make right click remove markers + Spring.MarkerErasePosition (pos[1], 0, pos[3]) + end + end + end +end + +function widget:Initialize() + if not Spring.IsCheatingEnabled() then + Spring.Echo("This widget requires cheats enabled") + widgetHandler:RemoveWidget() + end + handle = io.open("cv_" .. Game.mapName .. ".lua", "w") + if (handle == nil) then + widgetHandler:RemoveWidget() + end +end + +function widget:Shutdown() + for _, i in pairs (markers) do + Spring.MarkerErasePosition (i[1], i[2], i[3]) + end + if handle ~= nil then + io.close(handle) + Spring.Echo ("Writen Control Victory Points To: " .. "cv_" .. Game.mapName .. ".lua") + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/dbg_mouse_to_mex_portable.lua b/LuaUI/Widgets_Evo/dbg_mouse_to_mex_portable.lua index f06055cbc..599460af4 100644 --- a/LuaUI/Widgets_Evo/dbg_mouse_to_mex_portable.lua +++ b/LuaUI/Widgets_Evo/dbg_mouse_to_mex_portable.lua @@ -1,6 +1,6 @@ function widget:GetInfo() return { - name = "Debug Mouse to Mexes Portable", + name = "Mouse to Mexes", desc = "Click to make a mex table. Alt+M to toggle. Works with any game.", author = "Google Frog", date = "April 28, 2012", @@ -17,8 +17,11 @@ local floor = math.floor ------------------------------------------------ -- Variables ------------------------------------------------ -local enabled = false -local spots = {} +local enabled = true +local markers = {} +local mexIndex = 1 +local metal = 2.0 +local handle ------------------------------------------------ -- Press Handling @@ -27,13 +30,6 @@ local spots = {} function widget:KeyPress(key, modifier, isRepeat) if modifier.alt then if key == KEYSYMS.M then - if enabled then - for i = 1, #spots do - local spot = spots[i] - Spring.Echo(" [00] = {x = " .. floor(spot.x+0.5) .. ", z = " .. floor(spot.z+0.5) .. ", metal = false},") - end - spots = {} - end enabled = not enabled end end @@ -46,12 +42,37 @@ end function widget:MousePress(mx, my, button) if enabled and (not Spring.IsAboveMiniMap(mx, my)) then local _, pos = Spring.TraceScreenRay(mx, my, true) - if legalPos(pos) then - spots[#spots+1] = { - x = pos[1], - z = pos[3], - } - Spring.MarkerAddPoint(pos[1],0,pos[3],#spots) + if legalPos(pos) then + if true then + handle:write("{x = " .. floor(pos[1] + 0.5) .. ", z = " .. floor(pos[3] + 0.5) .. ", metal = " .. tostring(metal) .. "},\n") + handle:flush() + markers[#markers + 1] = {pos[1], 0, pos[3]} + Spring.MarkerAddPoint(pos[1], 0, pos[3], mexIndex) + mexIndex = mexIndex + 1 + else -- TODO: make right click remove markers + Spring.MarkerErasePosition (pos[1], 0, pos[3]) + end end end +end + +function widget:Initialize() + if not Spring.IsCheatingEnabled() then + Spring.Echo("This widget requires cheats enabled") + widgetHandler:RemoveWidget() + end + handle = io.open("MexSpots_" .. Game.mapName, "w") + if (handle == nil) then + widgetHandler:RemoveWidget() + end +end + +function widget:Shutdown() + for _, i in pairs (markers) do + Spring.MarkerErasePosition (i[1], i[2], i[3]) + end + if handle ~= nil then + io.close(handle) + Spring.Echo ("Writen Mex Spots To: " .. "MexSpots_" .. Game.mapName) + end end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/dbg_widget_profiler.lua b/LuaUI/Widgets_Evo/dbg_widget_profiler.lua new file mode 100644 index 000000000..2174f3317 --- /dev/null +++ b/LuaUI/Widgets_Evo/dbg_widget_profiler.lua @@ -0,0 +1,535 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() +return { + name = "Widget Profiler", + desc = "", + author = "jK, Bluestone", + version = "2.0", + date = "2007+", + license = "GNU GPL, v2 or later", + layer = -math.huge, + handler = true, + enabled = false -- loaded by default? +} +end + +local usePrefixedNames = true + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local engineVersion = 100 -- just filled this in here incorrectly but old engines arent used anyway +if Engine and Engine.version then + local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results + end + engineVersion = Split(Engine.version, '-') + if engineVersion[2] ~= nil and engineVersion[3] ~= nil then + engineVersion = tonumber(string.gsub(engineVersion[1], '%.', '')..engineVersion[2]) + else + engineVersion = tonumber(Engine.version) + end +elseif Game and Game.version then + engineVersion = tonumber(Game.version) +end + +if (engineVersion < 1000 and engineVersion >= 105) or engineVersion >= 10401409 then + spGetLuaMemUsage = Spring.GetLuaMemUsage +else + function spGetLuaMemUsage() + return 0,0,0,0,0,0,0,0 + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local prefixedWnames = {} +local function ConstructPrefixedName (ghInfo) + local gadgetName = ghInfo.name + local baseName = ghInfo.basename + local _pos = baseName:find("_", 1) + local prefix = ((_pos and usePrefixedNames) and (baseName:sub(1, _pos-1)..": ") or "") + local prefixedGadgetName = "\255\200\200\200" .. prefix .. "\255\255\255\255" .. gadgetName + + prefixedWnames[gadgetName] = prefixedGadgetName + return prefixedWnames[gadgetName] +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local callinStats = {} + +local spGetTimer = Spring.GetTimer +local spDiffTimers = Spring.DiffTimers + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function ArrayInsert(t, f, g) + if (f) then + local layer = g.whInfo.layer + local index = 1 + for i,v in ipairs(t) do + if (v == g) then + return -- already in the table + end + if (layer >= v.whInfo.layer) then + index = i + 1 + end + end + table.insert(t, index, g) + end +end + + +local function ArrayRemove(t, g) + for k,v in ipairs(t) do + if (v == g) then + table.remove(t, k) + -- break + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- make a table of the names of user widgets +local userWidgets = {} +function widget:Initialize() + for name,wData in pairs(widgetHandler.knownWidgets) do + userWidgets[name] = (not wData.fromZip) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local oldUpdateWidgetCallIn +local oldInsertWidget + +local listOfHooks = {} +setmetatable(listOfHooks, { __mode = 'k' }) + +local inHook = false +local function IsHook(func) + return listOfHooks[func] +end + +local function Hook(w,name) -- name is the callin + local widgetName = w.whInfo.name + + local wname = prefixedWnames[widgetName] or ConstructPrefixedName(w.whInfo) + + local realFunc = w[name] + w["_old" .. name] = realFunc + + if (widgetName=="Widget Profiler") then + return realFunc -- don't profile the profilers callins (it works, but it is better that our DrawScreen call is unoptimized and expensive anyway!) + end + + local widgetCallinTime = callinStats[wname] or {} + callinStats[wname] = widgetCallinTime + widgetCallinTime[name] = widgetCallinTime[name] or {0,0,0,0} + local c = widgetCallinTime[name] + + local t + + local helper_func = function(...) + local dt = spDiffTimers(spGetTimer(),t) + local _,_,new_s,_ = spGetLuaMemUsage() + local ds = new_s - s + c[1] = c[1] + dt + c[2] = c[2] + dt + c[3] = c[3] + ds + c[4] = c[4] + ds + inHook = nil + return ... + end + + local hook_func = function(...) + if (inHook) then + return realFunc(...) + end + + inHook = true + t = spGetTimer() + local _,_,new_s,_ = spGetLuaMemUsage() + s = new_s + return helper_func(realFunc(...)) + end + + listOfHooks[hook_func] = true + + return hook_func +end + +local function StartHook() + Spring.Echo("start profiling") + + local wh = widgetHandler + + local CallInsList = {} + for name,e in pairs(wh) do + local i = name:find("List") + if (i)and(type(e)=="table") then + CallInsList[#CallInsList+1] = name:sub(1,i-1) + end + end + + --// hook all existing callins + for _,callin in ipairs(CallInsList) do + local callinGadgets = wh[callin .. "List"] + for _,w in ipairs(callinGadgets or {}) do + w[callin] = Hook(w,callin) + end + end + + Spring.Echo("hooked all callins") + + --// hook the UpdateCallin function + oldUpdateWidgetCallIn = wh.UpdateWidgetCallIn + wh.UpdateWidgetCallIn = function(self,name,w) + local listName = name .. 'List' + local ciList = self[listName] + if (ciList) then + local func = w[name] + if (type(func) == 'function') then + if (not IsHook(func)) then + w[name] = Hook(w,name) + end + ArrayInsert(ciList, func, w) + else + ArrayRemove(ciList, w) + end + self:UpdateCallIn(name) + else + print('UpdateWidgetCallIn: bad name: ' .. name) + end + end + + Spring.Echo("hooked UpdateCallin") + + --// hook the InsertWidget function + oldInsertWidget = wh.InsertWidget + widgetHandler.InsertWidget = function(self,widget) + if (widget == nil) then + return + end + + oldInsertWidget(self,widget) + + for _,callin in ipairs(CallInsList) do + local func = widget[callin] + if (type(func) == 'function') then + widget[callin] = Hook(widget,callin) + end + end + end + + Spring.Echo("hooked InsertWidget") +end + + +local function StopHook() + Spring.Echo("stop profiling") + + local wh = widgetHandler + + local CallInsList = {} + for name,e in pairs(wh) do + local i = name:find("List") + if (i)and(type(e)=="table") then + CallInsList[#CallInsList+1] = name:sub(1,i-1) + end + end + + --// unhook all existing callins + for _,callin in ipairs(CallInsList) do + local callinWidgets = wh[callin .. "List"] + for _,w in ipairs(callinWidgets or {}) do + if (w["_old" .. callin]) then + w[callin] = w["_old" .. callin] + end + end + end + + Spring.Echo("unhooked all callins") + + --// unhook the UpdateCallin and InsertWidget functions + wh.UpdateWidgetCallIn = oldUpdateWidgetCallIn + Spring.Echo("unhooked UpdateCallin") + wh.InsertWidget = oldInsertWidget + Spring.Echo("unhooked InsertWidget") +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local tick = 0.2 +local averageTime = 2 +local timeLoadAverages = {} +local spaceLoadAverages = {} +local startTimer + +function widget:Update() + widgetHandler:RemoveWidgetCallIn("Update", self) + StartHook() + startTimer = Spring.GetTimer() +end + +function widget:Shutdown() + StopHook() +end + +local lm,_,gm,_,um,_,sm,_ = spGetLuaMemUsage() + +local allOverTime = 0 +local allOverTimeSec = 0 -- currently unused +local allOverSpace = 0 +local totalSpace = {} + +local sortedList = {} +local function SortFunc(a,b) + return a.plainname < b.plainname +end + +local deltaTime +local redStrength = {} + +local minPerc = 0.005 -- above this value, we fade in how red we mark a widget +local maxPerc = 0.02 -- above this value, we mark a widget as red +local minSpace = 10 -- Kb +local maxSpace = 100 + +local title_colour = "\255\160\255\160" +local totals_colour = "\255\200\200\255" + +local function CalcLoad(old_load, new_load, t) + return old_load*math.exp(-tick/t) + new_load*(1 - math.exp(-tick/t)) +end + +function ColourString(R,G,B) + R255 = math.floor(R*255) + G255 = math.floor(G*255) + B255 = math.floor(B*255) + if (R255%10 == 0) then R255 = R255+1 end + if (G255%10 == 0) then G255 = G255+1 end + if (B255%10 == 0) then B255 = B255+1 end + return "\255"..string.char(R255)..string.char(G255)..string.char(B255) +end + +function GetRedColourStrings(v) --tLoad is % + local tTime = v.tTime + local sLoad = v.sLoad + local name = v.plainname + local u = math.exp(-deltaTime/5) --magic colour changing rate + + if tTime>maxPerc then tTime = maxPerc end + if tTime=maxLines-5 then x = x - colWidth; j = 0; end + j = j + 1 + gl.Text(title_colour..name.." WIDGETS", x+152, y-lineSpace*j, fontSize, "no") + j = j + 2 + + for i=1,#list do + if j>=maxLines then x = x - colWidth; j = 0; end + + local v = list[i] + local name = v.plainname + local wname = v.fullname + local tLoad = v.tLoad + local sLoad = v.sLoad + local tColour = v.timeColourString + local sColour = v.spaceColourString + gl.Text(tColour .. ('%.2f%%'):format(tLoad), x, y-lineSpace*j, fontSize, "no") + gl.Text(sColour .. ('%.0f'):format(sLoad) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + gl.Text(wname, x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + + j = j + 1 + end + + gl.Text(totals_colour..('%.2f%%'):format(list.allOverTime), x, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.0f'):format(list.allOverSpace) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour.."totals ("..string.lower(name)..")", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + j = j + 1 + + return x,j +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not (next(callinStats)) then + return --// nothing to do + end + + deltaTime = Spring.DiffTimers(Spring.GetTimer(),startTimer) + + -- sort & count timing + if (deltaTime>=tick) then + startTimer = Spring.GetTimer() + sortedList = {} + + allOverTime = 0 + allOverSpace = 0 + local n = 1 + for wname,callins in pairs(callinStats) do + local t = 0 -- would call it time, but protected + local cmax_t = 0 + local cmaxname_t = "-" + local space = 0 + local cmax_space = 0 + local cmaxname_space = "-" + for cname,c in pairs(callins) do + t = t + c[1] + if (c[2]>cmax_t) then + cmax_t = c[2] + cmaxname_t = cname + end + c[1] = 0 + + space = space + c[3] + if (c[4]>cmax_space) then + cmax_space = c[4] + cmaxname_space = cname + end + c[3] = 0 + end + + local relTime = 100 * t / deltaTime + timeLoadAverages[wname] = CalcLoad(timeLoadAverages[wname] or relTime, relTime, averageTime) + + local relSpace = space / deltaTime + spaceLoadAverages[wname] = CalcLoad(spaceLoadAverages[wname] or relSpace, relSpace, averageTime) + + allOverTimeSec = allOverTimeSec + t + + local tLoad = timeLoadAverages[wname] + local sLoad = spaceLoadAverages[wname] + sortedList[n] = {plainname=wname, fullname=wname..' \255\200\200\200('..cmaxname_t..','..cmaxname_space..')', tLoad=tLoad, sLoad=sLoad, tTime=t/deltaTime} + allOverTime = allOverTime + tLoad + allOverSpace = allOverSpace + sLoad + + n = n + 1 + end + + table.sort(sortedList,SortFunc) + + for i=1,#sortedList do + GetRedColourStrings(sortedList[i]) + end + lm,_,gm,_,um,_,sm,_ = spGetLuaMemUsage() + end + + if (not sortedList[1]) then + return --// nothing to do + end + + -- add to category and set colour + local userList = {} + local gameList = {} + userList.allOverTime = 0 + gameList.allOverTime = 0 + userList.allOverSpace = 0 + gameList.allOverSpace = 0 + for i=1,#sortedList do + if userWidgets[sortedList[i].plainname] then + userList[#userList+1] = sortedList[i] + userList.allOverTime = userList.allOverTime + sortedList[i].tLoad + userList.allOverSpace = userList.allOverSpace + sortedList[i].sLoad + else + gameList[#gameList+1] = sortedList[i] + gameList.allOverTime = gameList.allOverTime + sortedList[i].tLoad + gameList.allOverSpace = gameList.allOverSpace + sortedList[i].sLoad + end + end + + -- draw + local vsx, vsy = gl.GetViewSizes() + + local fontSize = math.max(11,math.floor(vsy/90)) + local lineSpace = fontSize + 2 + + local dataColWidth = fontSize*5 + local colWidth = vsx*0.98/4 + + local x,y = vsx-colWidth, vsy*0.77 -- initial coord for writing + local maxLines = math.max(20,math.floor(y/lineSpace)-3) + local j = -1 --line number + + gl.Color(1,1,1,1) + gl.BeginText() + + x,j = DrawWidgetList(gameList,"GAME",x,y,j, fontSize,lineSpace,maxLines,colWidth,dataColWidth) + x,j = DrawWidgetList(userList,"USER",x,y,j, fontSize,lineSpace,maxLines,colWidth,dataColWidth) + + if j>=maxLines-15 then x = x - colWidth; j = -1; end + j = j + 1 + gl.Text(title_colour.."ALL", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + j = j + 1 + + j = j + 1 + gl.Text(totals_colour.."total percentage of running time spent in luaui callins", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.1f%%'):format(allOverTime), x+dataColWidth, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour.."total rate of mem allocation by luaui callins", x+dataColWidth*2, y-lineSpace*j, fontSize, "no") + gl.Text(totals_colour..('%.0f'):format(allOverSpace) .. 'kB/s', x+dataColWidth, y-lineSpace*j, fontSize, "no") + + j = j + 2 + gl.Text(totals_colour..'total lua memory usage is '.. ('%.0f'):format(gm/1000) .. 'MB, of which:', x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*lm/gm) .. '% is from luaui', x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*um/gm) .. '% is from unsynced states (luarules+luagaia+luaui)', x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(totals_colour..' '..('%.0f'):format(100*sm/gm) .. '% is from synced states (luarules+luagaia)', x, y-lineSpace*j, fontSize, "no") + + j = j + 2 + gl.Text(title_colour.."All data excludes load from garbage collection & executing GL calls", x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(title_colour.."Callins in brackets are heaviest per widget for (time,allocs)", x, y-lineSpace*j, fontSize, "no") + + j = j + 2 + gl.Text(title_colour.."Tick time: " .. tick .. "s", x, y-lineSpace*j, fontSize, "no") + j = j + 1 + gl.Text(title_colour.."Smoothing time: " .. averageTime .. "s", x, y-lineSpace*j, fontSize, "no") + + gl.EndText() +end + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/dbg_widgetprofiler.lua b/LuaUI/Widgets_Evo/dbg_widgetprofiler.lua index 75eff7de9..6d802517a 100644 --- a/LuaUI/Widgets_Evo/dbg_widgetprofiler.lua +++ b/LuaUI/Widgets_Evo/dbg_widgetprofiler.lua @@ -9,7 +9,7 @@ function widget:GetInfo() version = "2.0", date = "2007,2008,2009", license = "GNU GPL, v2 or later", - layer = math.huge, + layer = -math.huge, handler = true, enabled = false -- loaded by default? } @@ -18,6 +18,25 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +-- make a table of the names of user widgets +local userWidgets = {} +function widget:Initialize() + for name,wData in pairs(widgetHandler.knownWidgets) do + userWidgets[name] = (not wData.fromZip) + end +end + +-- special widgets (things with a right to high usage that the user should not touch!) +local specialWidgets = { + ["Lups"] = true, + ["API Chili"] = true, + ["Red_UI_Framework"] = true, + ["Red_Drawing"] = true, +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + local callinTimes = {} local oldUpdateWidgetCallIn @@ -217,41 +236,110 @@ end StopHook() end -local tick = 0.1 -local averageTime = 5 +local tick = 0.2 +local averageTime = 2 local loadAverages = {} local function CalcLoad(old_load, new_load, t) return old_load*math.exp(-tick/t) + new_load*(1 - math.exp(-tick/t)) - --return (old_load-new_load)*math.exp(-tick/t) + new_load end local maximum = 0 +local avg = 0 local totalLoads = {} local allOverTime = 0 local allOverTimeSec = 0 local sortedList = {} local function SortFunc(a,b) - --if (a[2]==b[2]) then - return a[1]b[2] - --end + return a.plainname < b.plainname end - function widget:DrawScreen() +local maxLines = 50 +local deltaTime +local redStrength = {} + +function DrawWidgetList(list,name,x,y,j) + if j>=maxLines-5 then x = x - 350; j = 0; end + j = j + 1 + gl.Text("\255\160\255\160"..name.." WIDGETS", x+150, y-1-(12)*j, 10, "no") + j = j + 2 + + for i=1,#list do + if j>=maxLines then x = x - 350; j = 0; end + local v = list[i] + local name = v.plainname + local wname = v.fullname + local tLoad = v.tLoad + local colour = v.colourString + gl.Text(wname, x+150, y+1-(12)*j, 10, "no") + gl.Text(colour .. ('%.3f%%'):format(tLoad), x+105, y+1-(12)*j, 10, "no") + + j = j + 1 + end + + gl.Text("\255\255\064\064total load ("..string.lower(name)..")", x+150, y+1-(12)*j, 10, "no") + gl.Text("\255\255\064\064"..('%.3f%%'):format(list.allOverTime), x+105, y+1-(12)*j, 10, "no") + j = j + 1 + + return x,j +end + +function ColourString(R,G,B) + R255 = math.floor(R*255) + G255 = math.floor(G*255) + B255 = math.floor(B*255) + if (R255%10 == 0) then R255 = R255+1 end + if (G255%10 == 0) then G255 = G255+1 end + if (B255%10 == 0) then B255 = B255+1 end + return "\255"..string.char(R255)..string.char(G255)..string.char(B255) +end + +local minTime = 0.005 -- above this value, we fade in how heavy we mark a widget +local maxTime = 0.02 -- above this value, we mark a widget as heavy +local minFPS = 30 -- above this value, we fade out how red we mark heavy widgets +local maxFPS = 60 -- above this value, we don't mark any widgets red + +function CheckLoad(v) --tLoad is % + local tTime = v.tTime + local name = v.plainname + local FPS = Spring.GetFPS() + + if tTime>maxTime then tTime = maxTime end + if tTimemaxFPS then FPS = maxFPS end + if FPS=tick) then startTimer = Spring.GetTimer() + sortedList = {} totalLoads = {} maximum = 0 + avg = 0 allOverTime = 0 local n = 1 for wname,callins in pairs(callinTimes) do @@ -268,16 +356,19 @@ end end local load = 100*total/deltaTime - loadAverages[wname] = CalcLoad(loadAverages[wname] or load, load, averageTime) + local load_avg = CalcLoad(loadAverages[wname] or load, load, averageTime) + loadAverages[wname] = load_avg allOverTimeSec = allOverTimeSec + total local tLoad = loadAverages[wname] - sortedList[n] = {wname..'('..cmaxname..')',tLoad} + sortedList[n] = {plainname=wname, fullname=wname..'('..cmaxname..')', tLoad=tLoad, tTime=total/deltaTime} allOverTime = allOverTime + tLoad + avg = avg + tLoad if (maximum 0 then - gl.Rect(x+100-tLoad/maximum*100, y+1-(12)*i, x+100, y+9-(12)*i) - end - gl.Text(wname, x+150, y+1-(12)*i, 10) - gl.Text(('%.3f%%'):format(tLoad), x+105, y+1-(12)*i, 10) + redStrength[sortedList[i].plainname] = redStrength[sortedList[i].plainname] or 0 + if userWidgets[sortedList[i].plainname] then + sortedList[i].colourString = CheckLoad(sortedList[i]) + userList[#userList+1] = sortedList[i] + userList.allOverTime = userList.allOverTime + sortedList[i].tLoad + elseif specialWidgets[sortedList[i].plainname] then + sortedList[i].colourString = "\255\255\255\255" + specialList[#specialList+1] = sortedList[i] + specialList.allOverTime = specialList.allOverTime + sortedList[i].tLoad + else + sortedList[i].colourString = CheckLoad(sortedList[i]) + gameList[#gameList+1] = sortedList[i] + gameList.allOverTime = gameList.allOverTime + sortedList[i].tLoad + end end - local i = #sortedList + 1 - gl.Text("\255\255\064\064total time", x+150, y-1-(12)*i, 10) - gl.Text("\255\255\064\064"..('%.3fs'):format(allOverTimeSec), x+105, y-1-(12)*i, 10) - i = i+1 - gl.Text("\255\255\064\064total FPS cost", x+150, y-1-(12)*i, 10) - gl.Text("\255\255\064\064"..('%.1f%%'):format(allOverTime), x+105, y-1-(12)*i, 10) - gl.EndText() + + -- draw + local vsx, vsy = gl.GetViewSizes() + local x,y = vsx-450, vsy-100 + local widgetScale = (1 + (vsx*vsy / 6500000)) + + gl.PushMatrix() + gl.Translate(vsx-(vsx*widgetScale),vsy-(vsy*widgetScale),0) + gl.Scale(widgetScale,widgetScale,1) + + gl.Color(1,1,1,1) + gl.BeginText() + local j = -1 --line number + + x,j = DrawWidgetList(gameList,"GAME",x,y,j) + x,j = DrawWidgetList(specialList,"API & SPECIAL",x,y,j) + x,j = DrawWidgetList(userList,"USER",x,y,j) + + if j>=maxLines-5 then x = x - 350; j = 0; end + j = j + 1 + gl.Text("\255\180\255\180TOTAL", x+150, y-1-(12)*j, 10, "no") + j = j + 1 + + if j>=maxLines-5 then x = x - 350; j = 0; end + j = j + 1 + gl.Text("\255\255\064\064total load", x+150, y-1-(12)*j, 10, "no") + gl.Text("\255\255\064\064"..('%.1f%%'):format(allOverTime), x+105, y-1-(12)*j, 10, "no") + j = j + 1 + gl.Text("\255\255\064\064total time", x+150, y-1-(12)*j, 10, "no") + gl.Text("\255\255\064\064"..('%.3fs'):format(allOverTimeSec), x+105, y-1-(12)*j, 10, "no") + gl.EndText() + + gl.PopMatrix() end + + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/debug_UnitPieceList.lua b/LuaUI/Widgets_Evo/debug_UnitPieceList.lua deleted file mode 100644 index 31b83d197..000000000 --- a/LuaUI/Widgets_Evo/debug_UnitPieceList.lua +++ /dev/null @@ -1,51 +0,0 @@ -function widget:GetInfo() - return { - name = "modding/debug: unit piece tree", - desc = "Developer Debugging - write a tree or list of all the unit pieces in a unit", - author = "knorke", - date = "2011", - license = "do you care?", - layer = 0, - enabled = false -- loaded by default? - } -end - - -function widget:UnitCreated(unitID, unitDefID, teamID, builderID) --- if ( Spring.IsCheatingEnabled() == true ) then - write_unit_piece_tree (unitID, unitDefID) --- end -end - -function write_unit_piece_tree (unitID, unitDefID) - local unitDef = UnitDefs[unitDefID] - Spring.Echo ("*** pieces tree of " .. unitDef.name .. " ***") - write_children (unitID,1,0) -end - -function write_children (unitID, pID, recdeep) - PieceInfo = Spring.GetUnitPieceInfo (unitID, pID) - local pname = PieceInfo.name - if (recdeep == 0) then Spring.Echo (pname) end - local pchildren = PieceInfo.children - for i,cname in ipairs(pchildren) do - local cpID = Spring.GetUnitPieceMap(unitID)[cname] - local spacing = string.rep("-",recdeep+1) - Spring.Echo (spacing .. cname) - write_children (unitID, cpID,recdeep+1) - end - return -end - -function write_piece_list (unitID) - local allpieces = Spring.GetUnitPieceList (unitID) - local piece_n = table.getn (allpieces) - Spring.Echo ("unit has " .. piece_n .. " pieces") - for pID=1, piece_n,1 do - Spring.Echo ("pID:" .. pID) - PieceInfo = Spring.GetUnitPieceInfo (unitID,pID) - local pname = PieceInfo.name - local pchildren = PieceInfo.children - Spring.Echo (" name:"..pname) - end -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/disabled/gfx_outline.disabled b/LuaUI/Widgets_Evo/disabled/gfx_outline.disabled new file mode 100644 index 000000000..f7ad7fe6d --- /dev/null +++ b/LuaUI/Widgets_Evo/disabled/gfx_outline.disabled @@ -0,0 +1,410 @@ +-- $Id: gfx_outline.lua 3171 2008-11-06 09:06:29Z det $ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gfx_outline.lua +-- brief: Displays a nice cartoon like outline around units +-- author: jK +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local minFps = 13 -- disables below this average fps +local fpsDiff = 4 -- enabled aain above minFps + fpsDiff + +local maxOutlineUnits = 750 -- ignores other units above this amount + +function widget:GetInfo() + return { + name = "Outline", + desc = "Displays small outline around units (max "..maxOutlineUnits.."). Disables on low fps ("..minFps.."), re-enables on high fps ("..minFps+fpsDiff..")", + author = "jK", + date = "Dec 06, 2007", + license = "GNU GPL, v2 or later", + layer = -10, + enabled = false -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local customSize = 1 + +--//textures +local offscreentex +local depthtex +local blurtex + +--//shader +local depthShader +local blurShader_h +local blurShader_v +local uniformScreenXY, uniformScreenX, uniformScreenY,uniformSizeX,uniformSizeY + +--// geometric +local vsx, vsy = 0,0 +local resChanged = false + +--// display lists +local enter2d,leave2d + +local averageFps = minFps + fpsDiff + 6 +local show = true +local outlineSize = 1 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local GL_DEPTH_COMPONENT24 = 0x81A6 + +--// speed ups +local ALL_UNITS = Spring.ALL_UNITS +local GetVisibleUnits = Spring.GetVisibleUnits + +local GL_MODELVIEW = GL.MODELVIEW +local GL_PROJECTION = GL.PROJECTION +local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT + +local glUnit = gl.Unit +local glCopyToTexture = gl.CopyToTexture +local glRenderToTexture = gl.RenderToTexture +local glCallList = gl.CallList + +local glUseShader = gl.UseShader +local glUniform = gl.Uniform +local glUniformInt = gl.UniformInt + +local glClear = gl.Clear +local glTexRect = gl.TexRect +local glColor = gl.Color +local glTexture = gl.Texture + +local glResetMatrices = gl.ResetMatrices +local glMatrixMode = gl.MatrixMode +local glPushMatrix = gl.PushMatrix +local glLoadIdentity = gl.LoadIdentity +local glPopMatrix = gl.PopMatrix + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + + +function widget:Initialize() + + vsx, vsy = widgetHandler:GetViewSizes() + + if depthShader then + gl.DeleteShader(depthShader) + gl.DeleteShader(blurShader_h) + gl.DeleteShader(blurShader_v) + end + + depthShader = gl.CreateShader({ + fragment = [[ + uniform sampler2D tex0; + uniform vec2 screenXY; + + void main(void) + { + vec2 texCoord = vec2( gl_FragCoord.x/screenXY.x , gl_FragCoord.y/screenXY.y ); + float depth = texture2D(tex0, texCoord ).z; + + if (depth <= gl_FragCoord.z) { + discard; + } + gl_FragColor = gl_Color; + } + ]], + uniformInt = { + tex0 = 0, + }, + uniform = { + screenXY = {vsx,vsy}, + }, + }) + + blurShader_h = gl.CreateShader({ + fragment = [[ + uniform sampler2D tex0; + uniform int screenX; + uniform float size; + + void main(void) { + vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); + gl_FragColor = vec4(0.0); + + int i; + int n = 1; + float pixelsize = 1.0/float(screenX); + for(i = 1; i < 3; ++i){ + gl_FragColor += size * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); + --n; + } + + gl_FragColor += texture2D(tex0, texCoord ); + + n = 0; + for(i = -2; i < 0; ++i){ + gl_FragColor += size * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); + ++n; + } + } + ]], + uniformInt = { + tex0 = 0, + screenX = vsx, + }, + }) + + blurShader_v = gl.CreateShader({ + fragment = [[ uniform sampler2D tex0; + uniform int screenY; + uniform float size; + + void main(void) { + vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); + gl_FragColor = vec4(0.0); + + int i; + int n = 1; + float pixelsize = 1.0/float(screenY); + for(i = 0; i < 2; ++i){ + gl_FragColor += size * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); + --n; + } + + gl_FragColor += texture2D(tex0, texCoord ); + + n = 0; + for(i = -2; i < 0; ++i){ + gl_FragColor += size * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); + ++n; + } + } + ]], + uniformInt = { + tex0 = 0, + screenY = vsy, + }, + }) + + if (depthShader == nil) then + Spring.Echo("Outline widget: depthcheck shader error: "..gl.GetShaderLog()) + widgetHandler:RemoveWidget(self) + return false + end + if (blurShader_h == nil) then + Spring.Echo("Outline widget: hblur shader error: "..gl.GetShaderLog()) + widgetHandler:RemoveWidget(self) + return false + end + if (blurShader_v == nil) then + Spring.Echo("Outline widget: vblur shader error: "..gl.GetShaderLog()) + widgetHandler:RemoveWidget(self) + return false + end + + uniformScreenXY = gl.GetUniformLocation(depthShader, 'screenXY') + uniformScreenX = gl.GetUniformLocation(blurShader_h, 'screenX') + uniformSizeX = gl.GetUniformLocation(blurShader_h, 'size') + uniformScreenY = gl.GetUniformLocation(blurShader_v, 'screenY') + uniformSizeY = gl.GetUniformLocation(blurShader_v, 'size') + + self:ViewResize(widgetHandler:GetViewSizes()) + + enter2d = gl.CreateList(function() + glUseShader(0) + glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity() + glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity() + end) + leave2d = gl.CreateList(function() + glMatrixMode(GL_PROJECTION); glPopMatrix() + glMatrixMode(GL_MODELVIEW); glPopMatrix() + glTexture(false) + glUseShader(0) + end) + + WG['outline'] = {} + WG['outline'].getMaxunits = function() + return maxOutlineUnits + end + WG['outline'].setMaxunits = function(value) + maxOutlineUnits = value + end + WG['outline'].getSize = function() + return customSize + end + WG['outline'].setSize = function(value) + customSize = value + resChanged = true + end +end + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx = viewSizeX + vsy = viewSizeY + + outlineSize = (0.85 + (vsx*vsy / 25000000))*0.55 + + gl.DeleteTexture(depthtex or 0) + gl.DeleteTextureFBO(offscreentex or 0) + gl.DeleteTextureFBO(blurtex or 0) + + depthtex = gl.CreateTexture(vsx,vsy, { + border = false, + format = GL_DEPTH_COMPONENT24, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + + offscreentex = gl.CreateTexture(vsx,vsy, { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + fboDepth = true, + }) + + blurtex = gl.CreateTexture(vsx,vsy, { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + + resChanged = true +end + + +function widget:Shutdown() + gl.DeleteTexture(depthtex) + if (gl.DeleteTextureFBO) then + gl.DeleteTextureFBO(offscreentex) + gl.DeleteTextureFBO(blurtex) + end + + if (gl.DeleteShader) then + gl.DeleteShader(depthShader or 0) + gl.DeleteShader(blurShader_h or 0) + gl.DeleteShader(blurShader_v or 0) + end + + gl.DeleteList(enter2d) + gl.DeleteList(leave2d) + + WG['outline'] = nil +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DrawVisibleUnits() + local visibleUnits = GetVisibleUnits(ALL_UNITS,nil,false) + local count = 0 + for i=1,#visibleUnits do + glUnit(visibleUnits[i],true) + count = count + 1 + if count >= maxOutlineUnits then break end + end +end + +local MyDrawVisibleUnits = function() + glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) + glPushMatrix() + glResetMatrices() + glColor(0,0,0,0.4) + DrawVisibleUnits() + glColor(1,1,1,1) + glPopMatrix() +end + +local blur_h = function() + glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) + glUseShader(blurShader_h) + glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) +end + +local blur_v = function() + glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) + glUseShader(blurShader_v) + glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) +end + +local sec = 0 +local lastUpdate = 0 +function widget:Update(dt) + sec = sec + dt + if sec > lastUpdate + 2 then + lastUpdate = sec + + local modelCount = #Spring.GetVisibleUnits(-1,nil,false) + averageFps = averageFps + (((Spring.GetFPS()*(modelCount/50)) - averageFps*(modelCount/50)) / 70) + + if averageFps < minFps then + show = false + elseif averageFps > minFps + fpsDiff then + show = true + end + end +end + + +function widget:DrawWorldPreUnit() + if not show then return end + gl.ResetState() -- to prevent on/off flicker induced by other widgets maybe (i tried single out which thing included in gl.ResetSate fixed it but it kept doing it) + + glCopyToTexture(depthtex, 0, 0, 0, 0, vsx, vsy) + glTexture(depthtex) + + if (resChanged) then + resChanged = false + if (vsx==1) or (vsy==1) then return end + glUseShader(depthShader) + glUniform(uniformScreenXY, vsx,vsy ) + glUseShader(blurShader_h) + glUniformInt(uniformScreenX, vsx ) + glUniform(uniformSizeX, outlineSize*customSize) + glUseShader(blurShader_v) + glUniformInt(uniformScreenY, vsy ) + glUniform(uniformSizeY, outlineSize*customSize) + end + + glUseShader(depthShader) + glRenderToTexture(offscreentex,MyDrawVisibleUnits) + + glTexture(offscreentex) + glRenderToTexture(blurtex, blur_h) + glTexture(blurtex) + glRenderToTexture(offscreentex, blur_v) + + glCallList(enter2d) + glTexture(offscreentex) + glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glCallList(leave2d) +end + + +function widget:GetConfigData() + savedTable = {} + savedTable.maxOutlineUnits = maxOutlineUnits + savedTable.customSize = customSize + return savedTable +end + +function widget:SetConfigData(data) + if data.maxOutlineUnits then maxOutlineUnits = data.maxOutlineUnits or maxOutlineUnits end + if data.customSize then customSize = data.customSize or customSize end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/disabled/gui_fancy_teamplatter.disabled b/LuaUI/Widgets_Evo/disabled/gui_fancy_teamplatter.disabled new file mode 100644 index 000000000..a8bfbf51a --- /dev/null +++ b/LuaUI/Widgets_Evo/disabled/gui_fancy_teamplatter.disabled @@ -0,0 +1,201 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_fancy_teamplatter.lua +-- brief: Draws transparant smoothed donuts under enemy units +-- author: Dave Rodgers (orig. TeamPlatter edited by TradeMark) +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Fancy Teamplatter", + desc = "Draws transparant smoothed donuts under friendly and enemy units (using teamcolor)", + author = "TradeMark (Floris: added multiple ally color support) (Forboding Angel: removed extra FX stuff) (zoggop: made it use only team colors)", + date = "7.02.2014", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = false -- loaded by default? + } +end + + + +-------------------------------------------------------------------------------- +-- Config +-------------------------------------------------------------------------------- + +local drawWithHiddenGUI = true -- keep widget enabled when graphical user interface is hidden (when pressing F5) + +local circleSize = 1 +local circleDivs = 12 -- how precise circle? octagon by default +local circleOpacity = 0.5 +local innerSize = 1.35 -- circle scale compared to unit radius +local outerSize = 1.5 -- outer fade size compared to circle scale (1 = no outer fade) + +local ignoreUnits = {} +for udefID,def in ipairs(UnitDefs) do + if def.customParams['nohealthbars'] then + ignoreUnits[udefID] = true + end +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Automatically generated local definitions + +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA +local glBlending = gl.Blending +local glBeginEnd = gl.BeginEnd +local glColor = gl.Color +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glDepthTest = gl.DepthTest +local glDrawListAtUnit = gl.DrawListAtUnit +local glPolygonOffset = gl.PolygonOffset +local glVertex = gl.Vertex +local spGetTeamColor = Spring.GetTeamColor +local spGetUnitDefDimensions = Spring.GetUnitDefDimensions +local spGetUnitDefID = Spring.GetUnitDefID +local spIsUnitSelected = Spring.IsUnitSelected +local spGetTeamList = Spring.GetTeamList +local spGetVisibleUnits = Spring.GetVisibleUnits +local spIsGUIHidden = Spring.IsGUIHidden +local spGetUnitTeam = Spring.GetUnitTeam + +local myTeamID = Spring.GetLocalTeamID() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local realRadii = {} +local circlePolys = {} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Creating polygons: +function widget:Initialize() + + local teamList = spGetTeamList() + local numberOfTeams = #teamList + + for teamListIndex = 1, #teamList do + local teamID = teamList[teamListIndex] + local r,g,b,a = spGetTeamColor(teamID) + + circlePolys[teamID] = glCreateList(function() + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) -- disable layer blending + + -- colored inner circle: + glBeginEnd(GL.TRIANGLES, function() + local radstep = (2.0 * math.pi) / circleDivs + for i = 1, circleDivs do + local a1 = (i * radstep) + local a2 = ((i+1) * radstep) + --(fadefrom) + glColor(r, g, b, 0) + glVertex(0, 0, 0) + --(colorSet) + glColor(r, g, b, circleOpacity) + glVertex(math.sin(a1), 0, math.cos(a1)) + glVertex(math.sin(a2), 0, math.cos(a2)) + end + end) + + if (outerSize ~= 1) then + -- colored outer circle: + glBeginEnd(GL.QUADS, function() + local radstep = (2.0 * math.pi) / circleDivs + for i = 1, circleDivs do + local a1 = (i * radstep) + local a2 = ((i+1) * radstep) + --(colorSet) + glColor(r, g, b, circleOpacity) + glVertex(math.sin(a1), 0, math.cos(a1)) + glVertex(math.sin(a2), 0, math.cos(a2)) + --(fadeto) + glColor(r, g, b, 0) + glVertex(math.sin(a2)*outerSize, 0, math.cos(a2)*outerSize) + glVertex(math.sin(a1)*outerSize, 0, math.cos(a1)*outerSize) + end + end) + end + end) + + end + +end + +function widget:Shutdown() + --glDeleteList(circlePolys) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Retrieving radius: +local function GetUnitDefRealRadius(udid) + local radius = realRadii[udid] + if (radius) then return radius end + local ud = UnitDefs[udid] + if (ud == nil) then return nil end + local dims = spGetUnitDefDimensions(udid) + if (dims == nil) then return nil end + local scale = ud.hitSphereScale -- missing in 0.76b1+ + scale = ((scale == nil) or (scale == 0.0)) and 1.0 or scale + radius = dims.radius / scale + realRadii[udid] = radius*circleSize + return radius +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- Drawing: +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if not drawWithHiddenGUI then + if spIsGUIHidden() then return end + end + glDepthTest(true) + glPolygonOffset(-100, -2) + local visibleUnits = spGetVisibleUnits() + if #visibleUnits then + for i=1, #visibleUnits do + local unitID = visibleUnits[i] + local unitDefIDValue = spGetUnitDefID(unitID) + if ignoreUnits[unitDefIDValue] then break end + local teamID = spGetUnitTeam(unitID) + if circlePolys[teamID] ~= nil then + if (unitDefIDValue) then + local radius = GetUnitDefRealRadius(unitDefIDValue) * circleSize + if (radius) then + glDrawListAtUnit(unitID, circlePolys[teamID], false, radius, 1.0, radius) + end + end + end + end + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/dumpall.lua b/LuaUI/Widgets_Evo/dumpall.lua deleted file mode 100644 index ffafc80c8..000000000 --- a/LuaUI/Widgets_Evo/dumpall.lua +++ /dev/null @@ -1,88 +0,0 @@ -function widget:GetInfo() - return { - name = "Dump all units/features", - desc = "Writes the coordinates for all units and features to dumpedunitsfeatures.txt", - author = "Gnome, smoth", - date = "lol", - license = "PD", - layer = 5, - enabled = false -- loaded by default? - } -end - -local toUDump = {} -local toBDump = {} -local toFDump = {} - -local rotlookup = {} - - rotlookup[0] = "south" - rotlookup[16384] = "east" - rotlookup[32767] = "north" - rotlookup[-16384] = "west" - - -function widget:Initialize() - local allunits = Spring.GetAllUnits() - local x, y, z - local dx, dy, dz - local rot - - - for _,ud in ipairs(allunits) do - - x,y,z = Spring.GetUnitBasePosition(ud) - udid = Spring.GetUnitDefID(ud) - rot = Spring.GetUnitHeading(ud) - - unitname = UnitDefs[udid].name - - if ( UnitDefs[udid].customParams.featureplacer ~= true ) then - - if ( UnitDefs[udid].canMove ) then - toUDump[#toUDump + 1] = { name = unitname, x = x, z = z, rot = rot } - else -- I am not a unit - toBDump[#toBDump + 1] = { name = unitname, x = x, z = z, rot = rotlookup[rot] } - end - end - end - - local allfeatures = Spring.GetAllFeatures() - for _,fd in ipairs(allfeatures) do - - x,y,z = Spring.GetFeaturePosition(fd) - rot = Spring.GetFeatureHeading(fd) - fdid = Spring.GetFeatureDefID(fd) - fname = FeatureDefs[fdid].name - toFDump[#toFDump + 1] = { name = fname, x = x, z = z, rot = rot } - end - - local f = io.open("dumpedunitsfeatures.txt", "w+") - if (f) then - --f:write("xIcons " .. iconsX .. "\n") - - f:write("local features = { \n\tunitlist = {\n") - for i=1,#toUDump do - f:write("\t\t{ name = '" .. toUDump[i].name .. "', x = " .. toUDump[i].x .. ", z = " .. toUDump[i].z .. ", rot = " .. toUDump[i].rot .." },\n") - end - f:write("\t},\n") - - f:write("\tbuildinglist = {\n") - for i=1,#toBDump do - f:write("\t\t{ name = '" .. toBDump[i].name .. "', x = " .. toBDump[i].x .. ", z = " .. toBDump[i].z .. ", rot = \"" .. toBDump[i].rot .."\" },\n") - end - f:write("\t},\n") - - f:write("\tobjectlist = {\n") - for i=1,#toFDump do - f:write("\t\t{ name = '" .. toFDump[i].name .. "', x = " .. toFDump[i].x .. ", z = " .. toFDump[i].z .. ", rot = \"" .. toFDump[i].rot .."\" },\n") - end - f:write("\t},\n}\nreturn features\n") - - f:close() - else - Spring.Echo("Could not open dumpedunitsfeatures.txt for writing!") - end - - widgetHandler:RemoveWidget() -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/game_buildHotkeys.lua b/LuaUI/Widgets_Evo/game_buildHotkeys.lua new file mode 100644 index 000000000..7ae47b945 --- /dev/null +++ b/LuaUI/Widgets_Evo/game_buildHotkeys.lua @@ -0,0 +1,252 @@ +function widget:GetInfo() + return { + version = "1.0", + name = "EvoRTS Build Hotkeys", + desc = "Use hotkeys to build units", + author = "CommonPlayer", + date = "5 Oct 2018", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + handler = true, --can use widgetHandler:x() + } +end + +VFS.Include("luaui/configs/evo_buildHotkeysConfig.lua") + +-- Taken from gui_red_buildordermenu +local sGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local sGetActiveCmdDescs = Spring.GetActiveCmdDescs +local ssub = string.sub + +local function GetCommands() + local hiddencmds = { + [76] = true, --load units clone + [65] = true, --selfd + [9] = true, --gatherwait + [8] = true, --squadwait + [7] = true, --deathwait + [6] = true, --timewait + [39812] = true, --raw move + [34922] = true, -- set unit target + --[34923] = true, -- set target + } + local buildcmds = {} + local statecmds = {} + local othercmds = {} + local buildcmdscount = 0 + local statecmdscount = 0 + local othercmdscount = 0 + for index,cmd in pairs(sGetActiveCmdDescs()) do + if (type(cmd) == "table") then + if ( + (not hiddencmds[cmd.id]) and + (cmd.action ~= nil) and + --(not cmd.disabled) and + (not widgetHandler.commands[index].hidden) and --apparently GetActiveCmdDescs is bugged and returns hidden for every command + (cmd.type ~= 21) and + (cmd.type ~= 18) and + (cmd.type ~= 17) + ) then + if (((cmd.type == 20) --build building + or (ssub(cmd.action,1,10) == "buildunit_"))) then + buildcmdscount = buildcmdscount + 1 + buildcmds[buildcmdscount] = cmd + elseif (cmd.type == 5) then + statecmdscount = statecmdscount + 1 + statecmds[statecmdscount] = cmd + else + othercmdscount = othercmdscount + 1 + othercmds[othercmdscount] = cmd + end + end + end + end + local tempcmds = {} + for i=1,statecmdscount do + tempcmds[i] = statecmds[i] + end + for i=1,othercmdscount do + tempcmds[i+statecmdscount] = othercmds[i] + end + othercmdscount = othercmdscount + statecmdscount + othercmds = tempcmds + + return buildcmds,othercmds +end + +local sPlaySoundFile = Spring.PlaySoundFile +local sGetModKeyState = Spring.GetModKeyState +local sGetCmdDescIndex = Spring.GetCmdDescIndex +local sSetActiveCommand = Spring.SetActiveCommand + +local updateCommands = false +local buildOptions = {} +local lengBuildOptions = 0 + +local lengKeysPressed = 0 +local keysPressed = {} + +local sGetKeySymbol = Spring.GetKeySymbol + +-- VFS.Include("LuaUI/Headers/keysym.h.lua", nil, VFS.RAW_FIRST) +-- local keyCodeToString = {} +-- for k, v in pairs(KEYSYMS) do keyCodeToString[v] = k:sub(1, 1) .. k:sub(2):lower() end + +local hotkeyText = "" +local screenWidth = gl.GetViewSizes() +local function updateHotkeyText() + if lengKeysPressed > 0 then + hotkeyText = "Build hotkey: " + for i = 1, lengKeysPressed do + -- hotkeyText = hotkeyText .. keyCodeToString[keysPressed[i]] .. " + " + if keysPressed[i] >= 97 and keysPressed[i] <= 122 then hotkeyText = hotkeyText .. string.char(keysPressed[i]):upper() .. " + " end + -- local keySymbol = sGetKeySymbol(keysPressed[i]) + -- hotkeyText = hotkeyText .. keySymbol:sub(1, 1):upper() .. keySymbol:sub(2) .. " + " + -- if i < lengKeysPressed then str = str .. " + " end + end + + else hotkeyText = "" end +end +local function shortenHotkeyText() hotkeyText = hotkeyText:sub(1, -4) end +local function hotkeyTargetDisabled() hotkeyText = hotkeyText:sub(1, -4) .. ' (Locked)' end +WG.buildHotkeys = {} +WG.buildHotkeys.keysPressed = {} +WG.buildHotkeys.hasUpdated = false +local function updateWidgetVar() + WG.buildHotkeys.keysPressed = {} + for i = 1, lengKeysPressed do + if keysPressed[i] >= 97 and keysPressed[i] <= 122 then WG.buildHotkeys.keysPressed[i] = string.char(keysPressed[i]):upper() end + -- local keySymbol = sGetKeySymbol(keysPressed[i]) + -- WG.buildHotkeys.keysPressed[i] = keySymbol:sub(1, 1):upper() .. keySymbol:sub(2) + end + WG.buildHotkeys.hasUpdated = true +end + +local sGetConfigInt = Spring.GetConfigInt + +function widget:CommandsChanged() + updateCommands = true +end +local oldBuildOptions, oldLengBuildOptions +function widget:Update(dt) + if updateCommands then + updateCommands = false + + local same = true + if not oldLengBuildOptions then same = false end + buildOptions = {} + lengBuildOptions = 0 + local buildcmds, othercmds = GetCommands() + for i = 1, #buildcmds do + local name = buildcmds[i].name + if name:find("_up", -5) then name = name:sub(1, -5) end + --if nameToKeyCode[name] and not buildcmds[i].disabled then + if nameToKeyCode[name] then + lengBuildOptions = lengBuildOptions + 1 + buildOptions[lengBuildOptions] = { + keyCode = nameToKeyCode[name], + id = buildcmds[i].id, + disabled = buildcmds[i].disabled + } + if same and + (lengBuildOptions > oldLengBuildOptions or + buildOptions[lengBuildOptions].keyCode ~= oldBuildOptions[lengBuildOptions].keyCode) then + same = false + end + end + end + if not same then + lengKeysPressed = 0 + keysPressed = {} + updateHotkeyText() + end + oldBuildOptions = buildOptions + oldLengBuildOptions = lengBuildOptions + end +end + +function widget:KeyPress(key, mods, isRepeat) + if key == 304 or key == 306 or key == 308 then return false end -- shift, ctrl, alt keys + lengKeysPressed = lengKeysPressed + 1 + keysPressed[lengKeysPressed] = key + updateHotkeyText() + updateWidgetVar() + + local lengMatches = 0 + local matches = {} + for i = 1, lengBuildOptions do + local getKeyCode = buildOptions[i].keyCode + local lengKeyCode = #getKeyCode + if lengKeyCode >= lengKeysPressed then + local match = true + for j = 1, lengKeysPressed do + if keysPressed[j] ~= getKeyCode[j] then + match = false + break + end + end + if match then + lengMatches = lengMatches + 1 + matches[lengMatches] = { + id = buildOptions[i].id, + disabled = buildOptions[i].disabled, + sameLeng = lengKeyCode == lengKeysPressed + } + end + end + end + if matches[1] then + for i = 1, lengMatches do + if matches[i].sameLeng then + -- if playSounds then + -- sPlaySoundFile(sound_queue_add, 0.75, 'ui') + -- end + if matches[i].disabled then + hotkeyTargetDisabled() + else + local alt, ctrl, meta, shift = sGetModKeyState() + local rmb = 1 + if sGetConfigInt("evo_ctrl_dequeue", 1) == 1 then rmb, ctrl = ctrl and 3 or 1, false end + local index = sGetCmdDescIndex(matches[i].id) + sSetActiveCommand(index, rmb, true, false, alt, ctrl, meta, shift) + shortenHotkeyText() + updateWidgetVar() + end + keysPressed[lengKeysPressed] = nil + lengKeysPressed = lengKeysPressed - 1 -- so you can B + Q + Q + Q to spam units + if matches[i].disabled then updateWidgetVar() end -- Don't show you that you have a locked building selected + return true + end + end + else -- reset + lengKeysPressed = 0 + keysPressed = {} + updateHotkeyText() + updateWidgetVar() + end + return false +end + +function widget:MousePress(x, y, button) + -- reset on left click or right click (button = 2 for clicking mouse wheel because ???) + --if button == 1 or button == 3 then building = -1 end + if button == 1 or button == 3 then + lengKeysPressed = 0 + keysPressed = {} + updateHotkeyText() + updateWidgetVar() + end + return false +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + gl.Text(hotkeyText, screenWidth * 0.5, 60, 20, "onc") +end diff --git a/LuaUI/Widgets_Evo/game_howismybuild.lua b/LuaUI/Widgets_Evo/game_howismybuild.lua new file mode 100644 index 000000000..6a5fa60ff --- /dev/null +++ b/LuaUI/Widgets_Evo/game_howismybuild.lua @@ -0,0 +1,84 @@ +---------------------------------------- +----------version 1.2---------------- +---------------------------------------- + function widget:GetInfo() + return { + name = "How is my build", + desc = "Prints info about build timings and income to /LuaUI/Widgets/buildsaves and saves each match.", + author = "Tumulten & vvoop", + date = "Mar 7, 2014", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true + } + end + + local myTeamID = Spring.GetMyTeamID + local teamResources = Spring.GetTeamResources + local workingUnits = {} + local dataArray = {} + local logDir="buildsaves/" + local file + local fileName + + function widget:Initialize() + Spring.CreateDir(logDir); + fileName = logDir.. Game.mapName.. "_".. tostring(os.date("%m-%d-%Y_%H;%M")) ..".log" + file = io.open(fileName, "w"); + local header = string.format("%35s%17s%17s%17s%17s", + "Name: ", "Start time: ","Finish time: ","Metal income: ","Energy income: ") + file:write(header.."\n") + file:write("------------------------------------------------------------------------------------------------------------\n") + file:close() + end + + function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) + if unitTeam == myTeamID() and UnitDefs[unitDefID].isImmobile then + local unitTime = getGameTime() + local unitM, unitMI = getResource("metal") + local unitE, unitEI = getResource("energy") + workingUnits[unitID] = { unitTime = getGameTime(), unitM = unitM, unitMI = unitMI, unitE = unitE, unitEI = unitEI } + end + end + + function widget:UnitFinished(unitID, unitDefID, unitTeam) + if unitTeam == myTeamID() then + if workingUnits[unitID] ~= nil then + local finishTime = formatTime(getGameTime()) + local finishM, finishMI = getResource("metal") + local finishE, finishEI = getResource("energy") + local startTime = formatTime(workingUnits[unitID].unitTime) + local startM,startMI = workingUnits[unitID].unitM, workingUnits[unitID].unitMI + local startE,startEI = workingUnits[unitID].unitE, workingUnits[unitID].unitEI + local body = string.format("%35s%17s%17s%17s%17s", + UnitDefs[unitDefID].humanName.." ", startTime.." ",finishTime.." ",startMI.." ",startEI.." ") + file = io.open(fileName, "a"); + file:write(body.."\n") + file:close() + + local oneRow = {name = UnitDefs[unitDefID].humanName, startTime = startTime, finishTime = finishTime, startMI = startMI,startEI = startEI } + table.insert(dataArray, oneRow) + end + end + end + + function getData() + return dataArray + end + function getGameTime() + local secs = math.floor(Spring.GetGameSeconds()) + return secs + end + + function formatTime(sec) + return string.format("%.2d:%.2d:%.2d", sec/(60*60), sec/60%60, sec%60) + end + + function getResource(resource) + local currentLevel, storage, pull, income, expense, share = teamResources(myTeamID(), resource) + return math.floor(currentLevel), math.floor(income) + end + + function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) + workingUnits[unitID]=nil + end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/game_resetHotkeys.lua b/LuaUI/Widgets_Evo/game_resetHotkeys.lua new file mode 100644 index 000000000..c64c6e112 --- /dev/null +++ b/LuaUI/Widgets_Evo/game_resetHotkeys.lua @@ -0,0 +1,69 @@ +function widget:GetInfo() + return { + name = "Reset Hotkeys", + desc = "Sets default hotkeys for common order elements", + author = "", + date = "", + license = "GNU LGPL, v2.1 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +function widget:Initialize() + + -- bind k to cloak + Spring.SendCommands({ + "unbindkeyset k", + }) + Spring.SendCommands("bind k wantcloak") + + -- bind sell command + Spring.SendCommands({ + "unbindkeyset shift+s", + }) + Spring.SendCommands("bind shift+s sell") + + -- replace guard with area guard + Spring.SendCommands({ + "unbindkeyset g", + }) + Spring.SendCommands("bind g areaguard") + + -- replace fps mode bind with capture + Spring.SendCommands({ + "unbindkeyset c", + }) + Spring.SendCommands("bind ctrl+c capture") + + + -- set repeat to be bound to q + Spring.SendCommands({ + "unbindkeyset q", + }) + Spring.SendCommands("bind q repeat") + + + -- set Priority to be bound to i + Spring.SendCommands({ + "unbindkeyset i", + }) + Spring.SendCommands("bind i priority") + + -- set high quality screenshots to f12 + Spring.SendCommands({ + "unbindkeyset f12", + }) + Spring.SendCommands("bind f12 screenshot png") + + -- Remove Mex Button + Spring.SendCommands({ + "unbindkeyset f4", + }) + Spring.SendCommands("bind f4 screenshot png") + + if Game.version == "85.0" then + Spring.SendCommands({"unbindaction specteam"}) + end + +end diff --git a/LuaUI/Widgets_Evo/gamestate_write.lua b/LuaUI/Widgets_Evo/gamestate_write.lua deleted file mode 100644 index 4b478516b..000000000 --- a/LuaUI/Widgets_Evo/gamestate_write.lua +++ /dev/null @@ -1,45 +0,0 @@ - -function widget:GetInfo() - return { - name = "Write GameState", - desc = "Necessary for Lua gadgets to write startscripts.", - author = "zwzsg", - version = "1.6", - date = "8th december, 2009", - license = "Public Domain", - layer = 0, - enabled = true, - } -end - -VFS.Include("LuaRules/Gadgets/libs/dump_units_lib.lua",nil) -VFS.Include("LuaRules/Gadgets/libs/FillModSpecific.lua",nil) ---VFS.Include("LuaRules/Gadgets/libs/ColorConversion.lua",nil) -- Not need to invent new color when we take current ones -VFS.Include("LuaRules/Gadgets/libs/GenerateGame.lua",nil) -- Only so WriteScript.lua gets GetMaxAllyTeam from GenerateGame.lua" -VFS.Include("LuaRules/Gadgets/libs/WriteScript.lua",nil) - - -local function WriteStateToScript(state,filename) - FillModSpecific() - WriteScript(state,filename) -end - -local function WriteAndRunState(state,filename) - FillModSpecific() - local filename=filename or ModSpecific.ScriptFileName - Spring.Echo(widget:GetInfo().name..": Writing game state to \""..filename.."\"") - WriteScript(state) - if Spring.Restart then - Spring.Echo(widget:GetInfo().name..": Restarting game") - Spring.Restart("-s",VFS.LoadFile(filename)) - else - Spring.Echo(widget:GetInfo().name..": Cannot restart game: Spring.Restart not implemented in this build of Spring!") - Spring.Echo(widget:GetInfo().name..": Quit, then drag'n'drop "..filename.." over "..ModSpecific.ExecutableFileName.." manually.") - end -end - -function widget:Initialize() - widgetHandler:RegisterGlobal("WriteStateToScript",WriteStateToScript) - widgetHandler:RegisterGlobal("WriteAndRunState",WriteAndRunState) -end - diff --git a/LuaUI/Widgets_Evo/gfx_BloomShader.lua b/LuaUI/Widgets_Evo/gfx_BloomShader.lua deleted file mode 100644 index c707e031c..000000000 --- a/LuaUI/Widgets_Evo/gfx_BloomShader.lua +++ /dev/null @@ -1,484 +0,0 @@ --- $Id: BloomShader.lua 3171 2008-11-06 09:06:29Z det $ -function widget:GetInfo() - return { - name = "BloomShader (v0.31a)", - desc = "Sets Spring In Bloom (do not use with < 7xxx geforce series or non-latest ATI cards!)", - author = "Kloot", --Updated by Shadowfury333 - date = "28-5-2008", - license = "", - layer = 9, - enabled = false - } -end - - --- CarRepairer: v0.31 has configurable settings in the menu. - -options_path = 'Settings/Graphics/Effects/Bloom' -options = { - - dbgDraw = { type='bool', name='Draw Only Bloom Mask', value=false, }, - - maxBrightness = { type='number', name='Maximum Highlight Brightness', value=0.47, min=0.001, max=3,step=0.001, }, - illumThreshold = { type='number', name='Illumination Threshold', value=0.7, min=0, max=1,step=0.001, }, - blurPasses = { type='number', name='Blur Passes', value=2, min=0, max=10,step=1, }, -} - --- config params -local dbgDraw = 0 -- draw only the bloom-mask? [0 | 1] -local maxBrightness = 0.47 -- maximum brightness of bloom additions [1, n] -local illumThreshold = 0.7 -- how bright does a fragment need to be before being considered a glow source? [0, 1] -local blurPasses = 2 -- how many iterations of Gaussian blur should be applied to the glow sources? - -local function OnchangeFunc() - dbgDraw = options.dbgDraw.value and 1 or 0 - - maxBrightness = options.maxBrightness.value - illumThreshold = options.illumThreshold.value - blurPasses = options.blurPasses.value -end -for key,option in pairs(options) do - option.OnChange = OnchangeFunc -end -OnchangeFunc() - --- non-editables -local vsx = 1 -- current viewport width -local vsy = 1 -- current viewport height -local ivsx = 1.0 / vsx -local ivsy = 1.0 / vsy -local kernelRadius = vsx / 36.0 --30 at 1080 px high - --- shader and texture handles -local blurShaderH71 = nil -local blurShaderV71 = nil - -local brightShader = nil -local brightTexture1 = nil -local brightTexture2 = nil - -local combineShader = nil -local screenTexture = nil -local screenTextureQuarter = nil -local screenTextureSixteenth = nil - --- speedups -local glGetSun = gl.GetSun - -local glCreateTexture = gl.CreateTexture -local glDeleteTexture = gl.DeleteTexture -local glActiveTexture = gl.ActiveTexture -local glCopyToTexture = gl.CopyToTexture -local glRenderToTexture = gl.RenderToTexture -local glTexture = gl.Texture -local glTexRect = gl.TexRect -local glGenerateMipmaps = gl.GenerateMipmap - -local glGetShaderLog = gl.GetShaderLog -local glCreateShader = gl.CreateShader -local glDeleteShader = gl.DeleteShader -local glUseShader = gl.UseShader - -local glUniformInt = gl.UniformInt -local glUniform = gl.Uniform -local glGetUniformLocation = gl.GetUniformLocation -local glGetActiveUniforms = gl.GetActiveUniforms - - -local GL_RGBA32F_ARB = 0x8814 -local GL_RGB32F_ARB = 0x8815 -local GL_ALPHA32F_ARB = 0x8816 -local GL_INTENSITY32F_ARB = 0x8817 -local GL_LUMINANCE32F_ARB = 0x8818 -local GL_LUMINANCE_ALPHA32F_ARB = 0x8819 -local GL_RGBA16F_ARB = 0x881A -local GL_RGB16F_ARB = 0x881B -local GL_ALPHA16F_ARB = 0x881C -local GL_INTENSITY16F_ARB = 0x881D -local GL_LUMINANCE16F_ARB = 0x881E -local GL_LUMINANCE_ALPHA16F_ARB = 0x881F -local GL_TEXTURE_RED_TYPE_ARB = 0x8C10 -local GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11 -local GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12 -local GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13 -local GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14 -local GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15 -local GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16 -local GL_UNSIGNED_NORMALIZED_ARB = 0x8C17 - - --- shader uniform locations -local brightShaderText0Loc = nil -local brightShaderInvRXLoc = nil -local brightShaderInvRYLoc = nil -local brightShaderIllumLoc = nil - -local blurShaderH51Text0Loc = nil -local blurShaderH51InvRXLoc = nil -local blurShaderH51FragLoc = nil -local blurShaderV51Text0Loc = nil -local blurShaderV51InvRYLoc = nil -local blurShaderV51FragLoc = nil - -local blurShaderH71Text0Loc = nil -local blurShaderH71InvRXLoc = nil -local blurShaderH71FragLoc = nil -local blurShaderV71Text0Loc = nil -local blurShaderV71InvRYLoc = nil -local blurShaderV71FragLoc = nil - -local combineShaderDebgDrawLoc = nil -local combineShaderTexture0Loc = nil -local combineShaderTexture1Loc = nil -local combineShaderIllumLoc = nil -local combineShaderFragLoc = nil - - - -local function SetIllumThreshold() - local ra, ga, ba = glGetSun("ambient") - local rd, gd, bd = glGetSun("diffuse") - local rs, gs, bs = glGetSun("specular") - - local ambientIntensity = ra * 0.299 + ga * 0.587 + ba * 0.114 - local diffuseIntensity = rd * 0.299 + gd * 0.587 + bd * 0.114 - local specularIntensity = rs * 0.299 + gs * 0.587 + bs * 0.114 - - -- illumThreshold = (0.8 * ambientIntensity) + (0.1 * diffuseIntensity) + (0.1 * specularIntensity) - - print("[BloomShader::SetIllumThreshold] sun ambient color: ", ra .. ", " .. ga .. ", " .. ba .. " (intensity: " .. ambientIntensity .. ")") - print("[BloomShader::SetIllumThreshold] sun diffuse color: ", rd .. ", " .. gd .. ", " .. bd .. " (intensity: " .. diffuseIntensity .. ")") - print("[BloomShader::SetIllumThreshold] sun specular color: ", rs .. ", " .. gs .. ", " .. bs .. " (intensity: " .. specularIntensity .. ")") - print("[BloomShader::SetIllumThreshold] illumination threshold: " .. illumThreshold) -end - -local function RemoveMe(msg) - Spring.Echo(msg) - widgetHandler:RemoveWidget() -end - - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX; ivsx = 1.0 / vsx - vsy = viewSizeY; ivsy = 1.0 / vsy - kernelRadius = vsy / 36.0 - - glDeleteTexture(brightTexture1 or "") - glDeleteTexture(brightTexture2 or "") - glDeleteTexture(screenTexture or "") - - brightTexture1 = glCreateTexture(vsx/4, vsy/4, { - fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGB16F_ARB, wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, - }) - brightTexture2 = glCreateTexture(vsx/4, vsy/4, { - fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - format = GL_RGB16F_ARB, wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, - }) - - screenTexture = glCreateTexture(vsx, vsy, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - }) - screenTextureQuarter = glCreateTexture(vsx/2, vsy/2, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - }) - screenTextureSixteenth = glCreateTexture(vsx/4, vsy/4, { - min_filter = GL.LINEAR, mag_filter = GL.LINEAR, - }) - - if (brightTexture1 == nil or brightTexture2 == nil or screenTexture == nil or screenTextureQuarter == nil or screenTextureSixteenth == nil) then - RemoveMe("[BloomShader::ViewResize] removing widget, bad texture target") - return - end -end - -widget:ViewResize(widgetHandler:GetViewSizes()) - - - - -function widget:Initialize() - if (glCreateShader == nil) then - RemoveMe("[BloomShader::Initialize] removing widget, no shader support") - return - end - - SetIllumThreshold() - - - - combineShader = glCreateShader({ - fragment = [[ - uniform sampler2D texture0; - uniform sampler2D texture1; - uniform float illuminationThreshold; - uniform float fragMaxBrightness; - uniform int debugDraw; - - void main(void) { - - vec2 C0 = vec2(gl_TexCoord[0]); - vec4 S0 = texture2D(texture0, C0); - vec4 S1 = texture2D(texture1, C0); - S1 = vec4(S1.rgb * fragMaxBrightness/max(1.0 - illuminationThreshold, 0.0001), 1.0); - - - gl_FragColor = bool(debugDraw) ? S1 : S0 + S1; - } - ]], - - uniformInt = { texture0 = 0, texture1 = 1, debugDraw = 0}, - uniformFloat = {illuminationThreshold, fragMaxBrightness} - }) - - if (combineShader == nil) then - RemoveMe("[BloomShader::Initialize] combineShader compilation failed"); print(glGetShaderLog()); return - end - - - - blurShaderH71 = glCreateShader({ - fragment = [[ - uniform sampler2D texture0; - uniform float inverseRX; - uniform float fragKernelRadius; - float bloomSigma = fragKernelRadius / 2.0; - - void main(void) { - vec2 C0 = vec2(gl_TexCoord[0]); - - vec4 S = texture2D(texture0, C0); - float weight = 1.0 / (2.50663 * bloomSigma); - float total_weight = weight; - S *= weight; - for (float r = 1.5; r < fragKernelRadius; r += 2.0) - { - weight = exp(-((r*r)/(2.0 * bloomSigma * bloomSigma)))/(2.50663 * bloomSigma); - S += texture2D(texture0, C0 - vec2(r * inverseRX, 0.0)) * weight; - S += texture2D(texture0, C0 + vec2(r * inverseRX, 0.0)) * weight; - - total_weight += 2*weight; - } - - gl_FragColor = vec4(S.rgb/total_weight, 1.0); - } - ]], - - uniformInt = {texture0 = 0}, - uniformFloat = {inverseRX, fragKernelRadius} - }) - - if (blurShaderH71 == nil) then - RemoveMe("[BloomShader::Initialize] blurShaderH71 compilation failed"); print(glGetShaderLog()); return - end - - blurShaderV71 = glCreateShader({ - fragment = [[ - uniform sampler2D texture0; - uniform float inverseRY; - uniform float fragKernelRadius; - float bloomSigma = fragKernelRadius / 2.0; - - void main(void) { - vec2 C0 = vec2(gl_TexCoord[0]); - - vec4 S = texture2D(texture0, C0); - float weight = 1.0 / (2.50663 * bloomSigma); - float total_weight = weight; - S *= weight; - for (float r = 1.5; r < fragKernelRadius; r += 2.0) - { - weight = exp(-((r*r)/(2.0 * bloomSigma * bloomSigma)))/(2.50663 * bloomSigma); - S += texture2D(texture0, C0 - vec2(0.0, r * inverseRY)) * weight; - S += texture2D(texture0, C0 + vec2(0.0, r * inverseRY)) * weight; - - total_weight += 2*weight; - } - - gl_FragColor = vec4(S.rgb/total_weight, 1.0); - } - ]], - - uniformInt = {texture0 = 0}, - uniformFloat = {inverseRY, fragKernelRadius} - }) - - if (blurShaderV71 == nil) then - RemoveMe("[BloomShader::Initialize] blurShaderV71 compilation failed"); print(glGetShaderLog()); return - end - - brightShader = glCreateShader({ - fragment = [[ - uniform sampler2D texture0; - uniform float illuminationThreshold; - uniform float inverseRX; - uniform float inverseRY; - - void main(void) { - vec2 C0 = vec2(gl_TexCoord[0]); - vec3 color = vec3(texture2D(texture0, C0)); - float illum = dot(color, vec3(0.2990, 0.5870, 0.1140)); - - if (illum > illuminationThreshold) { - gl_FragColor = vec4((color - color*(illuminationThreshold/max(illum, 0.00001))), 1.0); - } else { - gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } - ]], - - uniformInt = {texture0 = 0}, - uniformFloat = {illuminationThreshold, inverseRX, inverseRY} - }) - - if (brightShader == nil) then - RemoveMe("[BloomShader::Initialize] brightShader compilation failed"); print(glGetShaderLog()); return - end - - - - brightShaderText0Loc = glGetUniformLocation(brightShader, "texture0") - brightShaderInvRXLoc = glGetUniformLocation(brightShader, "inverseRX") - brightShaderInvRYLoc = glGetUniformLocation(brightShader, "inverseRY") - brightShaderIllumLoc = glGetUniformLocation(brightShader, "illuminationThreshold") - - blurShaderH71Text0Loc = glGetUniformLocation(blurShaderH71, "texture0") - blurShaderH71InvRXLoc = glGetUniformLocation(blurShaderH71, "inverseRX") - blurShaderH71FragLoc = glGetUniformLocation(blurShaderH71, "fragKernelRadius") - blurShaderV71Text0Loc = glGetUniformLocation(blurShaderV71, "texture0") - blurShaderV71InvRYLoc = glGetUniformLocation(blurShaderV71, "inverseRY") - blurShaderV71FragLoc = glGetUniformLocation(blurShaderV71, "fragKernelRadius") - - combineShaderDebgDrawLoc = glGetUniformLocation(combineShader, "debugDraw") - combineShaderTexture0Loc = glGetUniformLocation(combineShader, "texture0") - combineShaderTexture1Loc = glGetUniformLocation(combineShader, "texture1") - combineShaderIllumLoc = glGetUniformLocation(combineShader, "illuminationThreshold") - combineShaderFragLoc = glGetUniformLocation(combineShader, "fragMaxBrightness") -end - -function widget:Shutdown() - glDeleteTexture(brightTexture1 or "") - glDeleteTexture(brightTexture2 or "") - glDeleteTexture(screenTexture or "") - - if (glDeleteShader) then - glDeleteShader(brightShader or 0) - glDeleteShader(blurShaderH71 or 0) - glDeleteShader(blurShaderV71 or 0) - glDeleteShader(combineShader or 0) - end -end - - - - - - -local function mglDrawTexture(texUnit, tex, w, h, flipS, flipT) - glTexture(texUnit, tex) - glTexRect(0, 0, w, h, flipS, flipT) - glTexture(texUnit, false) -end - -local function mglDrawFBOTexture(tex) - glTexture(tex) - glTexRect(-1, -1, 1, 1) - glTexture(false) -end - - -local function activeTextureFunc(texUnit, tex, w, h, flipS, flipT) - glTexture(texUnit, tex) - glTexRect(0, 0, w, h, flipS, flipT) - glTexture(texUnit, false) -end - -local function mglActiveTexture(texUnit, tex, w, h, flipS, flipT) - glActiveTexture(texUnit, activeTextureFunc, texUnit, tex, w, h, flipS, flipT) -end - - -local function renderToTextureFunc(tex, s, t) - glTexture(tex) - glTexRect(-1 * s, -1 * t, 1 * s, 1 * t) - glTexture(false) -end - -local function mglRenderToTexture(FBOTex, tex, s, t) - glRenderToTexture(FBOTex, renderToTextureFunc, tex, s, t) -end - - - - - - -local function Bloom() - gl.Color(1, 1, 1, 1) - - glCopyToTexture(screenTexture, 0, 0, 0, 0, vsx, vsy) - - - - glUseShader(brightShader) - glUniformInt(brightShaderText0Loc, 0) - glUniform( brightShaderInvRXLoc, ivsx) - glUniform( brightShaderInvRYLoc, ivsy) - glUniform( brightShaderIllumLoc, illumThreshold) - mglRenderToTexture(brightTexture1, screenTexture, 1, -1) - glUseShader(0) - - for i = 1, blurPasses do - glUseShader(blurShaderH71) - glUniformInt(blurShaderH71Text0Loc, 0) - glUniform( blurShaderH71InvRXLoc, ivsx) - glUniform( blurShaderH71FragLoc, kernelRadius) - mglRenderToTexture(brightTexture2, brightTexture1, 1, -1) - glUseShader(0) - glUseShader(blurShaderV71) - glUniformInt(blurShaderV71Text0Loc, 0) - glUniform( blurShaderV71InvRYLoc, ivsy) - glUniform( blurShaderV71FragLoc, kernelRadius) - mglRenderToTexture(brightTexture1, brightTexture2, 1, -1) - glUseShader(0) - end - - glUseShader(combineShader) - glUniformInt(combineShaderDebgDrawLoc, dbgDraw) - glUniformInt(combineShaderTexture0Loc, 0) - glUniformInt(combineShaderTexture1Loc, 1) - glUniform( combineShaderIllumLoc, illumThreshold) - glUniform( combineShaderFragLoc, maxBrightness) - mglActiveTexture(0, screenTexture, vsx, vsy, false, true) - mglActiveTexture(1, brightTexture1, vsx, vsy, false, true) - glUseShader(0) -end - -function widget:DrawScreenEffects() Bloom() end - - ---[[ -function widget:TextCommand(command) - if (string.find(command, "+illumthres") == 1) then illumThreshold = illumThreshold + 0.02 end - if (string.find(command, "-illumthres") == 1) then illumThreshold = illumThreshold - 0.02 end - - if (string.find(command, "+glowamplif") == 1) then maxBrightness = maxBrightness + 0.05 end - if (string.find(command, "-glowamplif") == 1) then maxBrightness = maxBrightness - 0.05 end - - if (string.find(command, "+blurpasses") == 1) then blurPasses = blurPasses + 1 end - if (string.find(command, "-blurpasses") == 1) then blurPasses = blurPasses - 1 end - - if (string.find(command, "+bloomdebug") == 1) then dbgDraw = 1 end - if (string.find(command, "-bloomdebug") == 1) then dbgDraw = 0 end - - illumThreshold = math.max(0.0, math.min(1.0, illumThreshold)) - blurPasses = math.max(0, blurPasses) - - Spring.Echo("[BloomShader::TextCommand]") - Spring.Echo(" illumThreshold: " .. illumThreshold) - Spring.Echo(" maxBrightness: " .. maxBrightness) - Spring.Echo(" blurAmplifier: " .. blurAmplifier) - Spring.Echo(" blurPasses: " .. blurPasses) - Spring.Echo(" dilatePass: " .. dilatePass) -end ---]] \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_bloom_shader.lua b/LuaUI/Widgets_Evo/gfx_bloom_shader.lua new file mode 100644 index 000000000..390224ea0 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_bloom_shader.lua @@ -0,0 +1,555 @@ +function widget:GetInfo() + return { + name = "Bloom Shader", + desc = "Sets Spring In Bloom", + author = "Floris", -- orginal bloom shader: Kloot + date = "24-9-2016", + license = "", + layer = -5, + enabled = false, + } +end + +-------------------------------------------------------------------------------- +-- config +-------------------------------------------------------------------------------- + +local basicAlpha = 0.25 +local globalBlursizeMult = 1.1 + +local dbgDraw = 0 -- debug: draw only the bloom-mask? + +local presets = { + { + blursize = 1.66, + blurPasses = 1, + quality = 4, -- high value creates flickering, but lower is more expensive + }, + { + blursize = 1.25, + blurPasses = 2, + quality = 4, + }, + { + blursize = 0.7, + blurPasses = 3, + quality = 3, + }, +} +local qualityPreset = 1 + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local drawWorldAlpha = 0 +local drawWorldPreUnitAlpha = 0 +local usedBasicAlpha = basicAlpha + +local camX, camY, camZ = Spring.GetCameraPosition() +local camDirX,camDirY,camDirZ = Spring.GetCameraDirection() + +-- shader and texture handles +local blurShaderH71 = nil +local blurShaderV71 = nil + +local brightShader = nil +local brightTexture1 = nil +local brightTexture2 = nil + +local combineShader = nil +local screenTexture = nil +local screenTextureQuarter = nil +local screenTextureSixteenth = nil + +-- speedups +local glCreateTexture = gl.CreateTexture +local glActiveTexture = gl.ActiveTexture +local glCopyToTexture = gl.CopyToTexture +local glRenderToTexture = gl.RenderToTexture +local glTexture = gl.Texture +local glTexRect = gl.TexRect + +local glUseShader = gl.UseShader + +local glUniformInt = gl.UniformInt +local glUniform = gl.Uniform +local glGetUniformLocation = gl.GetUniformLocation +local glGetActiveUniforms = gl.GetActiveUniforms + + +local GL_RGBA32F_ARB = 0x8814 +local GL_RGB32F_ARB = 0x8815 +local GL_ALPHA32F_ARB = 0x8816 +local GL_INTENSITY32F_ARB = 0x8817 +local GL_LUMINANCE32F_ARB = 0x8818 +local GL_LUMINANCE_ALPHA32F_ARB = 0x8819 +local GL_RGBA16F_ARB = 0x881A +local GL_RGB16F_ARB = 0x881B +local GL_ALPHA16F_ARB = 0x881C +local GL_INTENSITY16F_ARB = 0x881D +local GL_LUMINANCE16F_ARB = 0x881E +local GL_LUMINANCE_ALPHA16F_ARB = 0x881F +local GL_TEXTURE_RED_TYPE_ARB = 0x8C10 +local GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11 +local GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12 +local GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13 +local GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14 +local GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15 +local GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16 +local GL_UNSIGNED_NORMALIZED_ARB = 0x8C17 + + +-- shader uniform locations +local brightShaderText0Loc = nil +local brightShaderInvRXLoc = nil +local brightShaderInvRYLoc = nil +local brightShaderIllumLoc = nil + +local blurShaderH51Text0Loc = nil +local blurShaderH51InvRXLoc = nil +local blurShaderH51FragLoc = nil +local blurShaderV51Text0Loc = nil +local blurShaderV51InvRYLoc = nil +local blurShaderV51FragLoc = nil + +local blurShaderH71Text0Loc = nil +local blurShaderH71InvRXLoc = nil +local blurShaderH71FragLoc = nil +local blurShaderV71Text0Loc = nil +local blurShaderV71InvRYLoc = nil +local blurShaderV71FragLoc = nil + +local combineShaderDebgDrawLoc = nil +local combineShaderTexture0Loc = nil +local combineShaderTexture1Loc = nil +local combineShaderIllumLoc = nil +local combineShaderFragLoc = nil + +local illumThreshold = 0.33 +local function SetIllumThreshold() + local ra, ga, ba = gl.GetSun("ambient") + local rd, gd, bd = gl.GetSun("diffuse") + local rs, gs, bs = gl.GetSun("specular") + + local ambientIntensity = ra * 0.299 + ga * 0.587 + ba * 0.114 + local diffuseIntensity = rd * 0.299 + gd * 0.587 + bd * 0.114 + local specularIntensity = rs * 0.299 + gs * 0.587 + bs * 0.114 + --Spring.Echo(ambientIntensity..' '..diffuseIntensity..' '..specularIntensity) + illumThreshold = (0.33 * ambientIntensity) + (0.05 * diffuseIntensity) + (0.05 * specularIntensity) +end + +local function RemoveMe(msg) + Spring.Echo(msg) + --widgetHandler:RemoveWidget(self) +end + + +blursize = presets[qualityPreset].blursize +blurPasses = presets[qualityPreset].blurPasses +quality = presets[qualityPreset].quality +function loadPreset() + if presets[qualityPreset] ~= nil then + blursize = presets[qualityPreset].blursize + blurPasses = presets[qualityPreset].blurPasses + quality = presets[qualityPreset].quality + reset() + end +end + +function reset() + + --if not initialized then return end + usedBasicAlpha = basicAlpha + drawWorldAlpha = 0.035 + (usedBasicAlpha/11) + drawWorldPreUnitAlpha = 0.2 - (illumThreshold*0.4) + (usedBasicAlpha/6) + + gl.DeleteTexture(brightTexture1 or "") + gl.DeleteTexture(brightTexture2 or "") + gl.DeleteTexture(screenTexture or "") + + --local quality = 4.6 -- high value creates flickering, but lower is more expensive + brightTexture1 = glCreateTexture(vsx/quality, vsy/quality, { + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGB16F_ARB, wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, + }) + brightTexture2 = glCreateTexture(vsx/quality, vsy/quality, { + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGB16F_ARB, wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, + }) + screenTexture = glCreateTexture(vsx, vsy, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + }) + screenTextureQuarter = glCreateTexture(vsx/2, vsy/2, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + }) + screenTextureSixteenth = glCreateTexture(vsx/4, vsy/4, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + }) +end + + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx,vsy = gl.GetViewSizes() + + ivsx = 1.0 / vsx + ivsy = 1.0 / vsy + kernelRadius = vsy / 80.0 + kernelRadius2 = vsy / 30.0 + + reset() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Update(dt) + if initialized == false then return end + camX, camY, camZ = Spring.GetCameraPosition() + camDirX,camDirY,camDirZ = Spring.GetCameraDirection() +end + +function widget:DrawWorldPreUnit() + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + if initialized == false or drawWorldPreUnitAlpha <= 0.05 then return end + gl.PushMatrix() + gl.Color(0,0,0,(drawWorldPreUnitAlpha/2) + drawWorldPreUnitAlpha*(basicAlpha*1.5)) + gl.Translate(camX+(camDirX*360),camY+(camDirY*360),camZ+(camDirZ*360)) + gl.Billboard() + gl.Rect(-vsx, -vsy, vsx, vsy) + gl.PopMatrix() +end + +function widget:DrawWorld() + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + if initialized == false or drawWorldAlpha <= 0.05 then return end + gl.PushMatrix() + gl.Color(0,0,0,(drawWorldAlpha/2) + drawWorldAlpha*(basicAlpha*1.5)) + gl.Translate(camX+(camDirX*360),camY+(camDirY*360),camZ+(camDirZ*360)) + gl.Billboard() + gl.Rect(-vsx, -vsy, vsx, vsy) + gl.PopMatrix() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local initialized = false +function widget:Initialize() + + SetIllumThreshold() + + WG['bloom'] = {} + WG['bloom'].getBrightness = function() + return basicAlpha + end + WG['bloom'].setBrightness = function(value) + basicAlpha = value + reset() + if initialized == false then + Spring.Echo('Bloom shader doesnt work (enable shaders: \'ForceShaders = 1\' in springsettings.cfg)') + end + end + WG['bloom'].getBlursize = function() + return globalBlursizeMult + end + WG['bloom'].setBlursize = function(value) + globalBlursizeMult = value + reset() + if initialized == false then + Spring.Echo('Bloom shader doesnt work (enable shaders: \'ForceShaders = 1\' in springsettings.cfg)') + end + end + WG['bloom'].getPreset = function() + return qualityPreset + end + WG['bloom'].setPreset = function(value) + qualityPreset = value + loadPreset() + end + + if (gl.CreateShader == nil) then + RemoveMe("[BloomShader::Initialize] no shader support") + return + end + + widget:ViewResize(widgetHandler:GetViewSizes()) + + + combineShader = gl.CreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D texture0; + uniform sampler2D texture1; + uniform float illuminationThreshold; + uniform float fragMaxBrightness; + uniform int debugDraw; + + void main(void) { + + vec2 C0 = vec2(gl_TexCoord[0]); + vec4 S0 = texture2D(texture0, C0); + vec4 S1 = texture2D(texture1, C0); + S1 = vec4(S1.rgb * fragMaxBrightness/max(1.0 - illuminationThreshold, 0.0001), 1.0); + + gl_FragColor = bool(debugDraw) ? S1 : S0 + S1; + } + ]], + + uniformInt = { texture0 = 0, texture1 = 1, debugDraw = 0}, + uniformFloat = {illuminationThreshold, fragMaxBrightness} + }) + + if (combineShader == nil) then + RemoveMe("[BloomShader::Initialize] combineShader compilation failed"); print(gl.GetShaderLog()); return + end + + + blurShaderH71 = gl.CreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D texture0; + uniform float inverseRX; + uniform float fragKernelRadius; + float bloomSigma = fragKernelRadius / 2.5; + + void main(void) { + vec2 C0 = vec2(gl_TexCoord[0]); + + vec4 S = texture2D(texture0, C0); + float weight = 1.0 / (2.50663 * bloomSigma); + float total_weight = weight; + S *= weight; + for (float r = 1.5; r < fragKernelRadius; r += 2) + { + weight = exp(-((r*r)/(2.0 * bloomSigma * bloomSigma)))/(2.50663 * bloomSigma); + S += texture2D(texture0, C0 - vec2(r * inverseRX, 0.0)) * weight; + S += texture2D(texture0, C0 + vec2(r * inverseRX, 0.0)) * weight; + + total_weight += 2*weight; + } + + gl_FragColor = vec4(S.rgb/total_weight, 1.0); + } + ]], + + uniformInt = {texture0 = 0}, + uniformFloat = {inverseRX, fragKernelRadius} + }) + + if (blurShaderH71 == nil) then + RemoveMe("[BloomShader::Initialize] blurShaderH71 compilation failed"); print(gl.GetShaderLog()); return + end + + blurShaderV71 = gl.CreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D texture0; + uniform float inverseRY; + uniform float fragKernelRadius; + float bloomSigma = fragKernelRadius / 2.5; + + void main(void) { + vec2 C0 = vec2(gl_TexCoord[0]); + + vec4 S = texture2D(texture0, C0); + float weight = 1.0 / (2.50663 * bloomSigma); + float total_weight = weight; + S *= weight; + for (float r = 1.5; r < fragKernelRadius; r += 2) + { + weight = exp(-((r*r)/(2.0 * bloomSigma * bloomSigma)))/(2.50663 * bloomSigma); + S += texture2D(texture0, C0 - vec2(0.0, r * inverseRY)) * weight; + S += texture2D(texture0, C0 + vec2(0.0, r * inverseRY)) * weight; + + total_weight += 2*weight; + } + + gl_FragColor = vec4(S.rgb/total_weight, 1.0); + } + ]], + + uniformInt = {texture0 = 0}, + uniformFloat = {inverseRY, fragKernelRadius} + }) + + if (blurShaderV71 == nil) then + RemoveMe("[BloomShader::Initialize] blurShaderV71 compilation failed"); print(gl.GetShaderLog()); return + end + + brightShader = gl.CreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D texture0; + uniform float illuminationThreshold; + uniform float inverseRX; + uniform float inverseRY; + + void main(void) { + vec2 C0 = vec2(gl_TexCoord[0]); + vec3 color = vec3(texture2D(texture0, C0)); + float illum = dot(color, vec3(0.2990, 0.5870, 0.1140)); + + if (illum > illuminationThreshold) { + gl_FragColor = vec4((color - color*(illuminationThreshold/max(illum, 0.00001))), 1.0); + } else { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + ]], + + uniformInt = {texture0 = 0}, + uniformFloat = {illuminationThreshold, inverseRX, inverseRY} + }) + + if (brightShader == nil) then + RemoveMe("[BloomShader::Initialize] brightShader compilation failed"); print(gl.GetShaderLog()); return + end + + brightShaderText0Loc = glGetUniformLocation(brightShader, "texture0") + brightShaderInvRXLoc = glGetUniformLocation(brightShader, "inverseRX") + brightShaderInvRYLoc = glGetUniformLocation(brightShader, "inverseRY") + brightShaderIllumLoc = glGetUniformLocation(brightShader, "illuminationThreshold") + + blurShaderH71Text0Loc = glGetUniformLocation(blurShaderH71, "texture0") + blurShaderH71InvRXLoc = glGetUniformLocation(blurShaderH71, "inverseRX") + blurShaderH71FragLoc = glGetUniformLocation(blurShaderH71, "fragKernelRadius") + blurShaderV71Text0Loc = glGetUniformLocation(blurShaderV71, "texture0") + blurShaderV71InvRYLoc = glGetUniformLocation(blurShaderV71, "inverseRY") + blurShaderV71FragLoc = glGetUniformLocation(blurShaderV71, "fragKernelRadius") + + combineShaderDebgDrawLoc = glGetUniformLocation(combineShader, "debugDraw") + combineShaderTexture0Loc = glGetUniformLocation(combineShader, "texture0") + combineShaderTexture1Loc = glGetUniformLocation(combineShader, "texture1") + combineShaderIllumLoc = glGetUniformLocation(combineShader, "illuminationThreshold") + combineShaderFragLoc = glGetUniformLocation(combineShader, "fragMaxBrightness") + + initialized = true +end + +function widget:Shutdown() + if initialized then + gl.DeleteTexture(brightTexture1 or "") + gl.DeleteTexture(brightTexture2 or "") + gl.DeleteTexture(screenTexture or "") + + if (gl.DeleteShader) then + gl.DeleteShader(brightShader or 0) + gl.DeleteShader(blurShaderH71 or 0) + gl.DeleteShader(blurShaderV71 or 0) + gl.DeleteShader(combineShader or 0) + end + end + WG['bloom'] = nil +end + + + +local function mglDrawTexture(texUnit, tex, w, h, flipS, flipT) + glTexture(texUnit, tex) + glTexRect(0, 0, w, h, flipS, flipT) + glTexture(texUnit, false) +end + +local function mglDrawFBOTexture(tex) + glTexture(tex) + glTexRect(-1, -1, 1, 1) + glTexture(false) +end + + +local function activeTextureFunc(texUnit, tex, w, h, flipS, flipT) + glTexture(texUnit, tex) + glTexRect(0, 0, w, h, flipS, flipT) + glTexture(texUnit, false) +end + +local function mglActiveTexture(texUnit, tex, w, h, flipS, flipT) + glActiveTexture(texUnit, activeTextureFunc, texUnit, tex, w, h, flipS, flipT) +end + + +local function renderToTextureFunc(tex, s, t) + glTexture(tex) + glTexRect(-1 * s, -1 * t, 1 * s, 1 * t) + glTexture(false) +end + +local function mglRenderToTexture(FBOTex, tex, s, t) + glRenderToTexture(FBOTex, renderToTextureFunc, tex, s, t) +end + + + + +local function Bloom() + gl.Color(1, 1, 1, 1) + + glCopyToTexture(screenTexture, 0, 0, 0, 0, vsx, vsy) + + -- global bloomin + glUseShader(brightShader) + glUniformInt(brightShaderText0Loc, 0) + glUniform( brightShaderInvRXLoc, ivsx) + glUniform( brightShaderInvRYLoc, ivsy) + glUniform( brightShaderIllumLoc, illumThreshold) + mglRenderToTexture(brightTexture1, screenTexture, 1, -1) + glUseShader(0) + + for i = 1, blurPasses do + glUseShader(blurShaderH71) + glUniformInt(blurShaderH71Text0Loc, 0) + glUniform( blurShaderH71InvRXLoc, ivsx) + glUniform( blurShaderH71FragLoc, kernelRadius*blursize*globalBlursizeMult) + mglRenderToTexture(brightTexture2, brightTexture1, 1, -1) + glUseShader(0) + glUseShader(blurShaderV71) + glUniformInt(blurShaderV71Text0Loc, 0) + glUniform( blurShaderV71InvRYLoc, ivsy) + glUniform( blurShaderV71FragLoc, kernelRadius*blursize*globalBlursizeMult) + mglRenderToTexture(brightTexture1, brightTexture2, 1, -1) + glUseShader(0) + end + + glUseShader(combineShader) + glUniformInt(combineShaderDebgDrawLoc, dbgDraw) + glUniformInt(combineShaderTexture0Loc, 0) + glUniformInt(combineShaderTexture1Loc, 1) + glUniform( combineShaderIllumLoc, illumThreshold) + glUniform( combineShaderFragLoc, usedBasicAlpha) + mglActiveTexture(0, screenTexture, vsx, vsy, false, true) + mglActiveTexture(1, brightTexture1, vsx, vsy, false, true) + glUseShader(0) +end + +function widget:DrawScreenEffects() + if initialized == false then return end + Bloom() +end + +function widget:GetConfigData(data) + savedTable = {} + savedTable.basicAlpha = basicAlpha + savedTable.qualityPreset = qualityPreset + savedTable.globalBlursizeMult = globalBlursizeMult + return savedTable +end + +function widget:SetConfigData(data) + if data.basicAlpha ~= nil then + basicAlpha = data.basicAlpha + end + if data.globalBlursizeMult ~= nil then + globalBlursizeMult = data.globalBlursizeMult + end + if data.qualityPreset ~= nil then + if presets[data.qualityPreset] ~= nil then + qualityPreset = data.qualityPreset + blursize = presets[qualityPreset].blursize + blurPasses = presets[qualityPreset].blurPasses + quality = presets[qualityPreset].quality + end + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_bloom_shader_deferred.lua b/LuaUI/Widgets_Evo/gfx_bloom_shader_deferred.lua new file mode 100644 index 000000000..6117c8606 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_bloom_shader_deferred.lua @@ -0,0 +1,509 @@ +function widget:GetInfo() + return { + name = "Bloom Shader Deferred", --(v0.5) + desc = "Light Bloom Shader, simulates overbrightness", + author = "Kloot, Beherith", + date = "2018-05-13", + license = "GPL V2", + layer = 99999, + enabled = true, + } +end + + +-- config params +local dbgDraw = 0 -- draw only the bloom-mask? [0 | 1] +local globalBlursizeMult = 1 + +local glowAmplifier = 0.75 -- intensity multiplier when filtering a glow source fragment [1, n] +local blurAmplifier = 1 -- intensity multiplier when applying a blur pass [1, n] (should be set close to 1) +local drawWorldAlpha = 0.08 -- darken world so bloom doesnt blown-white out the brightest areas too much +local illumThreshold = 0 -- how bright does a fragment need to be before being considered a glow source? [0, 1] + +local presets = { + { + blursize = 22, -- gaussian blur iteration blur size + blurPasses = 1, -- how many iterations of Gaussian blur should be applied to the glow sources? + quality = 4, -- resolution divider + }, + { + blursize = 17, + blurPasses = 2, + quality = 2, + }, + { + blursize = 13, + blurPasses = 3, + quality = 2, + }, +} +--quality =1 : 90 fps, 9% memctrler load, 99% shader load +--quality =2 : 113 fps, 57% memctrler load, 99% shader load +--quality =4 : 123 fps, 9% memctrler load, 99% shader load +local qualityPreset = 1 +local blursize = presets[qualityPreset].blursize +local blurPasses = presets[qualityPreset].blurPasses +local quality = presets[qualityPreset].quality + + -- non-editables +local vsx = 1 -- current viewport width +local vsy = 1 -- current viewport height +local ivsx = 1.0 / vsx +local ivsy = 1.0 / vsy + +local debugBrightShader = false + + +-- shader and texture handles +local blurShaderH71 = nil +local blurShaderV71 = nil + +local brightShader = nil +local brightTexture1 = nil +local brightTexture2 = nil + +local combineShader = nil + +-- speedups +local glGetSun = gl.GetSun + +local glCreateTexture = gl.CreateTexture +local glDeleteTexture = gl.DeleteTexture +local glActiveTexture = gl.ActiveTexture +local glCopyToTexture = gl.CopyToTexture +local glRenderToTexture = gl.RenderToTexture +local glTexture = gl.Texture +local glTexRect = gl.TexRect + +local glGetShaderLog = gl.GetShaderLog +local glCreateShader = gl.CreateShader +local glDeleteShader = gl.DeleteShader +local glUseShader = gl.UseShader + +local glUniformInt = gl.UniformInt +local glUniform = gl.Uniform +local glGetUniformLocation = gl.GetUniformLocation +local glGetActiveUniforms = gl.GetActiveUniforms + + +-- shader uniform locations +local brightShaderText0Loc = nil +local brightShaderText1Loc = nil +local brightShaderIllumLoc = nil +local brightShaderFragLoc = nil + + +local blurShaderH71Text0Loc = nil +local blurShaderH71FragLoc = nil +local blurShaderV71Text0Loc = nil +local blurShaderV71FragLoc = nil + +local combineShaderDebgDrawLoc = nil +local combineShaderTexture0Loc = nil +local combineShaderTexture1Loc = nil + + +local hasdeferredmodelrendering = nil + +local function SetIllumThreshold() + local ra, ga, ba = glGetSun("ambient", "unit") + local rd, gd, bd = glGetSun("diffuse","unit") + local rs, gs, bs = glGetSun("specular") + + local ambientIntensity = ra * 0.299 + ga * 0.587 + ba * 0.114 + local diffuseIntensity = rd * 0.299 + gd * 0.587 + bd * 0.114 + local specularIntensity = rs * 0.299 + gs * 0.587 + bs * 0.114 + + illumThreshold = illumThreshold*(0.8 * ambientIntensity) + (0.5 * diffuseIntensity) + (0.1 * specularIntensity) + illumThreshold = math.min(illumThreshold, 0.8) + + illumThreshold = (0.5 + illumThreshold) / 2 +end + +local function RemoveMe(msg) + Spring.Echo(msg) + widgetHandler:RemoveWidget() +end + +local function MakeBloomShaders() + + if (glDeleteShader) then + if brightShader ~= nil then glDeleteShader(brightShader or 0) end + if blurShaderH71 ~= nil then glDeleteShader(blurShaderH71 or 0) end + if blurShaderV71 ~= nil then glDeleteShader(blurShaderV71 or 0) end + if combineShader ~= nil then glDeleteShader(combineShader or 0) end + end + + combineShader = glCreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D texture0; + uniform int debugDraw; + + void main(void) { + vec4 a = texture2D(texture0, gl_TexCoord[0].st); + if (debugDraw == 1) { + a.a= 1.0; + } + gl_FragColor = a; + } + ]], + --while this vertex shader seems to do nothing, it actually does the very important world space to screen space mapping for gl.TexRect! + vertex = [[ + #version 150 compatibility + void main(void) + { + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_Vertex; + } + ]], + uniformInt = { + texture0 = 0, + debugDraw = 0, + } + }) + + if (combineShader == nil) then + RemoveMe("[BloomShader::Initialize] combineShader compilation failed"); print(glGetShaderLog()); return + end + + -- How about we do linear sampling instead, using the GPU's built in texture fetching linear blur hardware :) + -- http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ + -- this allows us to get away with 5 texture fetches instead of 9 for our 9 sized kernel! + -- TODO: all this simplification may result in the accumulation of quantizing errors due to the small numbers that get pushed into the BrightTexture + + blurShaderH71 = glCreateShader({ + fragment = "#version 150 compatibility\n".. + "#define inverseRX " .. tostring(ivsx) .. "\n" .. [[ + uniform sampler2D texture0; + uniform int blursize; + uniform float fragBlurAmplifier; + const float invKernelSum = 0.0084; // (1/119) + + void main(void) { + vec2 texCoors = vec2(gl_TexCoord[0]); + vec3 newblur; + + newblur = 10 * texture2D(texture0, texCoors + vec2(-blursize * inverseRX, 0)).rgb; + newblur += 37 * texture2D(texture0, texCoors + vec2(-(blursize/3.5) * inverseRX, 0)).rgb; + newblur += 25 * texture2D(texture0, texCoors + vec2(0 , 0)).rgb; + newblur += 37 * texture2D(texture0, texCoors + vec2( (blursize/3.5) * inverseRX, 0)).rgb; + newblur += 10 * texture2D(texture0, texCoors + vec2( blursize * inverseRX, 0)).rgb; + gl_FragColor = vec4(newblur * invKernelSum * fragBlurAmplifier, 1.0); + } + ]], + uniformInt = { + texture0 = 0, + blursize = math.floor(blursize * globalBlursizeMult), + }, + }) + + if (blurShaderH71 == nil) then + RemoveMe("[BloomShader::Initialize] blurShaderH71 compilation failed"); Spring.Echo(glGetShaderLog()); return + end + + blurShaderV71 = glCreateShader({ + fragment = "#version 150 compatibility\n".. + "#define inverseRY " .. tostring(ivsy) .. "\n" .. [[ + uniform sampler2D texture0; + uniform int blursize; + uniform float fragBlurAmplifier; + const float invKernelSum = 0.0084; // (1/119) + + void main(void) { + vec2 texCoors = vec2(gl_TexCoord[0]); + vec3 newblur; + + newblur = 10 * texture2D(texture0, texCoors + vec2(0, -blursize * inverseRY)).rgb; + newblur += 37 * texture2D(texture0, texCoors + vec2(0, -(blursize/3.5) * inverseRY)).rgb; + newblur += 25 * texture2D(texture0, texCoors + vec2(0, 0)).rgb; + newblur += 37 * texture2D(texture0, texCoors + vec2(0, (blursize/3.5) * inverseRY)).rgb; + newblur += 10 * texture2D(texture0, texCoors + vec2(0, blursize * inverseRY)).rgb; + gl_FragColor = vec4(newblur * invKernelSum * fragBlurAmplifier, 1.0); + } + ]], + + uniformInt = { + texture0 = 0, + blursize = math.floor(blursize*globalBlursizeMult), + } + }) + + if (blurShaderV71 == nil) then + RemoveMe("[BloomShader::Initialize] blurShaderV71 compilation failed"); Spring.Echo(glGetShaderLog()); return + end + + brightShader = glCreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D modelDiffuseTex; + uniform sampler2D modelEmitTex; + + uniform sampler2D modelDepthTex; + uniform sampler2D mapDepthTex; + + uniform float illuminationThreshold; + uniform float fragGlowAmplifier; + + void main(void) { + vec2 texCoors = vec2(gl_TexCoord[0]); + vec3 color = vec3(texture2D(modelDiffuseTex, texCoors)); + vec4 colorEmit = texture2D(modelEmitTex, texCoors); + + float modelDepth = texture2D(modelDepthTex, texCoors).r; + float mapDepth = texture2D(mapDepthTex, texCoors).r; + + float unoccludedModel = float(modelDepth < mapDepth); + + //float detectchangedbuffer = clamp(colorEmit.g,0.0,1.0); //this is required because some things overwrite all the buffers, and deferred rendering forces this to 0.0 + //color = color *(1.0 - detectchangedbuffer); + + color += color * colorEmit.r; + + float illum = dot(color, vec3(0.2990, 0.4870, 0.2140)); //adjusted from the real values of vec3(0.2990, 0.5870, 0.1140) + + vec4 illumCond = vec4(illum > illuminationThreshold) ; + + gl_FragColor = mix( + vec4(0.0, 0.0, 0.0, 1.0), + vec4(color * (illum-illuminationThreshold), 1.0) * fragGlowAmplifier * unoccludedModel, + illumCond); + } + ]], + + uniformInt = { + modelDiffuseTex = 0, + modelEmitTex = 1, + modelDepthTex = 2, + mapDepthTex = 3, + } + }) + + if (brightShader == nil) then + RemoveMe("[BloomShader::Initialize] brightShader compilation failed"); print(glGetShaderLog()); return + end + + + + --brightShaderText0Loc = glGetUniformLocation(brightShader, "modelDiffuseTex") + --brightShaderText1Loc = glGetUniformLocation(brightShader, "modelEmitTex") + + brightShaderIllumLoc = glGetUniformLocation(brightShader, "illuminationThreshold") + brightShaderFragLoc = glGetUniformLocation(brightShader, "fragGlowAmplifier") + + --blurShaderH71Text0Loc = glGetUniformLocation(blurShaderH71, "texture0") + blurShaderH71FragLoc = glGetUniformLocation(blurShaderH71, "fragBlurAmplifier") + --blurShaderV71Text0Loc = glGetUniformLocation(blurShaderV71, "texture0") + blurShaderV71FragLoc = glGetUniformLocation(blurShaderV71, "fragBlurAmplifier") + + combineShaderDebgDrawLoc = glGetUniformLocation(combineShader, "debugDraw") + --combineShaderTexture0Loc = glGetUniformLocation(combineShader, "texture0") + --combineShaderTexture1Loc = glGetUniformLocation(combineShader, "texture1") + +end + + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx = math.max(4,viewSizeX); ivsx = 1.0 / vsx --we can do /n here! + vsy = math.max(4,viewSizeY); ivsy = 1.0 / vsy + qvsx,qvsy = math.floor(vsx/quality), math.floor(vsy/quality) + glDeleteTexture(brightTexture1 or "") + glDeleteTexture(brightTexture2 or "") + + brightTexture1 = glCreateTexture(qvsx, qvsy, { + fbo = true, + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, + }) + brightTexture2 = glCreateTexture(qvsx, qvsy, { + fbo = true, + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP, wrap_t = GL.CLAMP, + }) + + if (brightTexture1 == nil or brightTexture2 == nil) then + if (brightTexture1 == nil ) then Spring.Echo('brightTexture1 == nil ') end + if (brightTexture2 == nil ) then Spring.Echo('brightTexture2 == nil ') end + RemoveMe("[BloomShader::ViewResize] removing widget, bad texture target") + return + end + MakeBloomShaders() --we are gonna reinit the the widget, in order to recompile the shaders with the static IVSX and IVSY values in the blur shaders +end + +widget:ViewResize(widgetHandler:GetViewSizes()) + +SetIllumThreshold() + +function loadPreset() + if presets[qualityPreset] ~= nil then + blursize = presets[qualityPreset].blursize + blurPasses = presets[qualityPreset].blurPasses + quality = presets[qualityPreset].quality + MakeBloomShaders() + end +end + +function widget:Initialize() + + WG['bloomdeferred'] = {} + WG['bloomdeferred'].getBrightness = function() + return glowAmplifier + end + WG['bloomdeferred'].setBrightness = function(value) + glowAmplifier = value + MakeBloomShaders() + end + WG['bloomdeferred'].getBlursize = function() + return globalBlursizeMult + end + WG['bloomdeferred'].setBlursize = function(value) + globalBlursizeMult = value + MakeBloomShaders() + end + WG['bloomdeferred'].getPreset = function() + return qualityPreset + end + WG['bloomdeferred'].setPreset = function(value) + qualityPreset = value + loadPreset() + end + + + if (glCreateShader == nil) then + RemoveMe("[BloomShader::Initialize] removing widget, no shader support") + return + end + + hasdeferredmodelrendering = (Spring.GetConfigString("AllowDeferredModelRendering")=='1') + if hasdeferredmodelrendering == false then + RemoveMe("[BloomShader::Initialize] removing widget, AllowDeferredModelRendering is required") + end + hasdeferredmaprendering = (Spring.GetConfigString("AllowDeferredMapRendering")=='1') + if hasdeferredmaprendering == false then + RemoveMe("[BloomShader::Initialize] removing widget, AllowDeferredMapRendering is required") + end + MakeBloomShaders() + +end + +function widget:Shutdown() + + glDeleteTexture(brightTexture1 or "") + + if (glDeleteShader) then + if brightShader ~= nil then glDeleteShader(brightShader or 0) end + if blurShaderH71 ~= nil then glDeleteShader(blurShaderH71 or 0) end + if blurShaderV71 ~= nil then glDeleteShader(blurShaderV71 or 0) end + if combineShader ~= nil then glDeleteShader(combineShader or 0) end + end +end + + +local function Bloom() + gl.DepthMask(false) + gl.Color(1, 1, 1, 1) + + glUseShader(brightShader) + --glUniformInt(brightShaderText0Loc, 0) + --glUniformInt(brightShaderText1Loc, 1) + glUniform( brightShaderIllumLoc, illumThreshold) + glUniform( brightShaderFragLoc, glowAmplifier) + glTexture(0, "$model_gbuffer_difftex") + glTexture(1, "$model_gbuffer_emittex") + glTexture(2, "$model_gbuffer_zvaltex") + glTexture(3, "$map_gbuffer_zvaltex") + + glRenderToTexture(brightTexture1, gl.TexRect, -1, 1, 1, -1) + + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) + glUseShader(0) + + if not debugBrightShader then + for i = 1, blurPasses do + glUseShader(blurShaderH71) + --glUniformInt(blurShaderH71Text0Loc, 0) + glUniform(blurShaderH71FragLoc, blurAmplifier) + glTexture(brightTexture1) + glRenderToTexture(brightTexture2, gl.TexRect, -1, 1, 1, -1) + glTexture(false) + glUseShader(0) + + glUseShader(blurShaderV71) + --glUniformInt(blurShaderV71Text0Loc, 0) + glUniform(blurShaderV71FragLoc, blurAmplifier) + glTexture(brightTexture2) + glRenderToTexture(brightTexture1, gl.TexRect, -1, 1, 1, -1) + glTexture(false) + glUseShader(0) + end + end + + if dbgDraw == 0 then + gl.Blending("alpha_add") + else + gl.Blending(GL.ONE, GL.ZERO) + end + + glUseShader(combineShader) + glUniformInt(combineShaderDebgDrawLoc, dbgDraw) + --glUniformInt(combineShaderTexture0Loc, 0) + glTexture(0, brightTexture1) + gl.TexRect(-1, -1, 1, 1, 0, 0, 1, 1) + glTexture(0, false) + glUseShader(0) + + gl.Blending("reset") + gl.DepthMask(true) +end + +local camX, camY, camZ = Spring.GetCameraPosition() +local camDirX, camDirY, camDirZ = Spring.GetCameraDirection() +function widget:Update(dt) + if drawWorldAlpha <= 0 then return end + camX, camY, camZ = Spring.GetCameraPosition() + camDirX, camDirY, camDirZ = Spring.GetCameraDirection() +end + +function widget:DrawWorld() + if drawWorldAlpha <= 0 then return end + -- darken world so bloom doesnt blown-white out the brightest areas too much + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.PushPopMatrix(function() + gl.Color(0, 0, 0, drawWorldAlpha * glowAmplifier) + gl.Translate(camX + (camDirX * 360), camY + (camDirY * 360), camZ + (camDirZ * 360)) + gl.Billboard() + gl.Rect(-vsx, -vsy, vsx, vsy) + end) + + Bloom() +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.glowAmplifier = glowAmplifier + savedTable.qualityPreset = qualityPreset + savedTable.globalBlursizeMult = globalBlursizeMult + return savedTable +end + +function widget:SetConfigData(data) + if data.glowAmplifier ~= nil then + glowAmplifier = data.glowAmplifier + end + if data.globalBlursizeMult ~= nil then + globalBlursizeMult = data.globalBlursizeMult + end + if data.qualityPreset ~= nil then + if presets[data.qualityPreset] ~= nil then + qualityPreset = data.qualityPreset + blursize = presets[qualityPreset].blursize + blurPasses = presets[qualityPreset].blurPasses + quality = presets[qualityPreset].quality + end + end +end diff --git a/LuaUI/Widgets_Evo/gfx_cas.lua b/LuaUI/Widgets_Evo/gfx_cas.lua new file mode 100644 index 000000000..03e5baf4d --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_cas.lua @@ -0,0 +1,222 @@ +if gl.CreateShader == nil then + return +end + +function widget:GetInfo() + return { + name = "Contrast Adaptive Sharpen (Old)", + desc = "Spring port of AMD FidelityFX' Contrast Adaptive Sharpen (CAS)", + author = "martymcmodding, ivand", + layer = 2000, + enabled = true, + } +end + +-- Shameless port from https://gist.github.com/martymcmodding/30304c4bffa6e2bd2eb59ff8bb09d135 + +----------------------------------------------------------------- +-- Constants +----------------------------------------------------------------- + +local GL_RGBA8 = 0x8058 + +local SHARPNESS = 0.7 +local version = 1.01 + +----------------------------------------------------------------- +-- Lua Shortcuts +----------------------------------------------------------------- + +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glCallList = gl.CallList +local glCopyToTexture = gl.CopyToTexture + +----------------------------------------------------------------- +-- File path Constants +----------------------------------------------------------------- + +local luaShaderDir = "LuaUI/Widgets_Evo/Include/" + +----------------------------------------------------------------- +-- Shader Sources +----------------------------------------------------------------- + +local vsCAS = [[ +#version 150 compatibility + +void main() { + gl_Position = gl_Vertex; +} +]] + +local fsCAS = [[ +#version 150 compatibility +#line 20051 + +uniform sampler2D screenCopyTex; +uniform float sharpness; + +#if 0 + #define TEXEL_FETCH_OFFSET(t, c, l, o) texelFetch(t, c + o, l) +#else + #define TEXEL_FETCH_OFFSET texelFetchOffset +#endif + +vec3 CASPass(ivec2 tc) { + // fetch a 3x3 neighborhood around the pixel 'e', + // a b c + // d(e)f + // g h i + vec3 a = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2(-1, -1)).rgb; + vec3 b = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 0, -1)).rgb; + vec3 c = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 1, -1)).rgb; + vec3 d = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2(-1, 0)).rgb; + vec3 e = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 0, 0)).rgb; + vec3 f = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 1, 0)).rgb; + vec3 g = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2(-1, 1)).rgb; + vec3 h = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 0, 1)).rgb; + vec3 i = TEXEL_FETCH_OFFSET(screenCopyTex, tc, 0, ivec2( 1, 1)).rgb; + + // Soft min and max. + // a b c b + // d e f * 0.5 + d e f * 0.5 + // g h i h + // These are 2.0x bigger (factored out the extra multiply). + vec3 mnRGB = min(min(min(d, e), min(f, b)), h); + vec3 mnRGB2 = min(mnRGB, min(min(a, c), min(g, i))); + mnRGB += mnRGB2; + + vec3 mxRGB = max(max(max(d, e), max(f, b)), h); + vec3 mxRGB2 = max(mxRGB, max(max(a, c), max(g, i))); + mxRGB += mxRGB2; + + // Smooth minimum distance to signal limit divided by smooth max. + vec3 rcpMRGB = vec3(1.0) / mxRGB; + vec3 ampRGB = clamp(min(mnRGB, 2.0 - mxRGB) * rcpMRGB, vec3(0.0), vec3(1.0)); + + // Shaping amount of sharpening. + ampRGB = inversesqrt(ampRGB); + + float peak = 8.0 - 3.0 * sharpness; + vec3 wRGB = vec3(-1.0) / (ampRGB * peak); + + vec3 rcpWeightRGB = vec3(1.0) / (1.0 + 4.0 * wRGB); + + // 0 w 0 + // Filter shape: w 1 w + // 0 w 0 + vec3 window = (b + d) + (f + h); + vec3 outColor = clamp((window * wRGB + e) * rcpWeightRGB, vec3(0.0), vec3(1.0)); + + return outColor; +} + +void main() { + gl_FragColor = vec4(CASPass(ivec2(gl_FragCoord.xy)), 1.0); +} +]] + +----------------------------------------------------------------- +-- Global Variables +----------------------------------------------------------------- + +local LuaShader = VFS.Include(luaShaderDir.."LuaShader.lua") + +local vsx, vsy, vpx, vpy +local screenCopyTex +local casShader + +local fullTexQuad + +----------------------------------------------------------------- +-- Local Functions +----------------------------------------------------------------- + + +----------------------------------------------------------------- +-- Widget Functions +----------------------------------------------------------------- + + +function widget:Initialize() + + if gl.CreateShader == nil then + Spring.Echo("CAS: createshader not supported, removing") + widgetHandler:RemoveWidget(self) + return + end + + vsx, vsy, vpx, vpy = Spring.GetViewGeometry() + + local commonTexOpts = { + target = GL_TEXTURE_2D, + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, + } + + commonTexOpts.format = GL_RGBA8 + screenCopyTex = gl.CreateTexture(vsx, vsy, commonTexOpts) + + casShader = LuaShader({ + vertex = vsCAS, + fragment = fsCAS, + uniformInt = { + screenCopyTex = 0, + }, + }, ": Contrast Adaptive Sharpen") + casShader:Initialize() + + fullTexQuad = gl.CreateList( function () + gl.DepthTest(false) + gl.Blending(false) + gl.TexRect(-1, -1, 1, 1, false, true) --false, true + gl.Blending(true) + end) + + WG.cas = {} + WG.cas.setSharpness = function(value) + SHARPNESS = value + end + WG.cas.getSharpness = function(value) + return SHARPNESS + end +end + +function widget:Shutdown() + gl.DeleteTexture(screenCopyTex) + casShader:Finalize() + gl.DeleteList(fullTexQuad) +end + +function widget:ViewResize() + widget:Shutdown() + widget:Initialize() +end + +function widget:DrawScreenEffects() + glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) + glTexture(0, screenCopyTex) + casShader:ActivateWith( function() + casShader:SetUniform("sharpness", SHARPNESS) + glCallList(fullTexQuad) + end) + glTexture(0, false) +end + +function widget:GetConfigData(data) + return { + version = version, + SHARPNESS = SHARPNESS + } +end + +function widget:SetConfigData(data) + if data.SHARPNESS ~= nil and data.version ~= nil and data.version == version then + SHARPNESS = data.SHARPNESS + end +end diff --git a/LuaUI/Widgets_Evo/gfx_darken_map.lua b/LuaUI/Widgets_Evo/gfx_darken_map.lua new file mode 100644 index 000000000..3c527367e --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_darken_map.lua @@ -0,0 +1,147 @@ + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Darken map", + desc = "darkens the map, not units", + author = "Floris", + date = "2015", + license = "GNU GPL, v2 or later", + layer = 10000, + enabled = true -- loaded by default? + } +end + + +local darknessvalue = 0 +local maxDarkness = 0.6 +local darkenFeatures = false + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local currentMapname = Game.mapName:lower() +local maps = {} +local gaia = Spring.GetGaiaTeamID() + +local camX, camY, camZ = Spring.GetCameraPosition() +local camDirX,camDirY,camDirZ = Spring.GetCameraDirection() + +function widget:Shutdown() + WG['darkenmap'] = nil +end + +function widget:Initialize() + WG['darkenmap'] = {} + WG['darkenmap'].getMapDarkness = function() + return darknessvalue + end + WG['darkenmap'].setMapDarkness = function(value) + darknessvalue = tonumber(value) + maps[currentMapname] = darknessvalue + end + WG['darkenmap'].getDarkenFeatures = function() + return darkenFeatures + end + WG['darkenmap'].setDarkenFeatures = function(value) + darkenFeatures = value + end + + widgetHandler:AddAction("mapdarkness", mapDarkness, nil, "t") +end + + +function mapDarkness(_,_,params) + if #params == 1 then + if type(tonumber(params[1])) == "number" then + darknessvalue = tonumber(params[1]) + if darknessvalue > maxDarkness then + darknessvalue = maxDarkness + end + maps[currentMapname] = darknessvalue + end + end +end + + +local prevCam = {} +prevCam[1],prevCam[2],prevCam[3] = Spring.GetCameraPosition() +function widget:Update(dt) + if darknessvalue >= 0.01 then + camX, camY, camZ = Spring.GetCameraPosition() + camDirX,camDirY,camDirZ = Spring.GetCameraDirection() + if darkenFeatures and (camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3]) then + features = Spring.GetVisibleFeatures(-1, 250, false) + end + end +end + +function widget:DrawWorldPreUnit() + if darknessvalue >= 0.01 then + + local drawMode = Spring.GetMapDrawMode() + if (drawMode=="height") or (drawMode=="path") then return end + + gl.PushMatrix() + gl.Color(0,0,0,darknessvalue) + gl.Translate(camX+(camDirX*360),camY+(camDirY*360),camZ+(camDirZ*360)) + gl.Billboard() + gl.Rect(-500, -500, 500, 500) + gl.PopMatrix() + end +end + +local spGetFeatureDefID = Spring.GetFeatureDefID +function widget:DrawWorld() + if darkenFeatures and darknessvalue >= 0.01 then + if features == nil then + features = Spring.GetVisibleFeatures(-1, 250, false) + end + + if features ~= nil then + gl.DepthTest(true) + gl.PolygonOffset(-2, -2) + gl.Color(0,0,0,darknessvalue) + for i, featureID in pairs(features) do + local fdefID = spGetFeatureDefID(featureID) + if fdefID then + gl.Texture('%-'..fdefID..':1') + gl.Feature(featureID, true) + end + end + gl.PolygonOffset(false) + gl.DepthTest(false) + gl.Texture(false) + end + end +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.maps = maps + savedTable.darkenFeatures = darkenFeatures + return savedTable +end + +function widget:SetConfigData(data) + if data.maps ~= nil then + maps = data.maps + if data.darkenFeatures ~= nil then + darkenFeatures = data.darkenFeatures + end + if data.maps[currentMapname] ~= nil then + darknessvalue = data.maps[currentMapname] + end + end +end + + +function widget:TextCommand(command) + if (string.find(command, "resetmapdarkness") == 1 and string.len(command) == 16) then + maps = {} + darknessvalue = 0 + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_deferred_rendering.lua b/LuaUI/Widgets_Evo/gfx_deferred_rendering.lua new file mode 100644 index 000000000..2078e1157 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_deferred_rendering.lua @@ -0,0 +1,532 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Deferred rendering", + version = 3, + desc = "Collects and renders point and beam lights", + author = "beherith, aeonios", + date = "2015 Sept.", + license = "GPL V2", + layer = -1000000000, + enabled = true + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local glBeginEnd = gl.BeginEnd +local glBillboard = gl.Billboard +local glBlending = gl.Blending +local glCallList = gl.CallList +local glClear = gl.Clear +local glColor = gl.Color +local glCreateList = gl.CreateList +local glCreateShader = gl.CreateShader +local glCreateTexture = gl.CreateTexture +local glDeleteShader = gl.DeleteShader +local glDeleteTexture = gl.DeleteTexture +local glDepthMask = gl.DepthMask +local glDepthTest = gl.DepthTest +local glGetShaderLog = gl.GetShaderLog +local glGetUniformLocation = gl.GetUniformLocation +local glGetViewSizes = gl.GetViewSizes +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTexCoord = gl.TexCoord +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glRect = gl.Rect +local glRenderToTexture = gl.RenderToTexture +local glUniform = gl.Uniform +local glUniformInt = gl.UniformInt +local glUniformMatrix = gl.UniformMatrix +local glUseShader = gl.UseShader +local glVertex = gl.Vertex +local glTranslate = gl.Translate +local spEcho = Spring.Echo +local spGetCameraPosition = Spring.GetCameraPosition +local spWorldToScreenCoords = Spring.WorldToScreenCoords + + +local glowImg = "LuaUI/Images/glow2.dds" +local beamGlowImg = ":n:LuaUI/Images/barglow-center.png" +local beamGlowEndImg = ":n:LuaUI/Images/barglow-edge.png" + +local GLSLRenderer = true + +local vsx, vsy +local ivsx = 1.0 +local ivsy = 1.0 +local screenratio = 1.0 + +-- dynamic light shaders +local depthPointShader = nil +local depthBeamShader = nil + +-- shader uniforms +local lightposlocPoint = nil +local lightcolorlocPoint = nil +local lightparamslocPoint = nil +local uniformEyePosPoint +local uniformViewPrjInvPoint + +local lightposlocBeam = nil +local lightpos2locBeam = nil +local lightcolorlocBeam = nil +local lightparamslocBeam = nil +local uniformEyePosBeam +local uniformViewPrjInvBeam + +-------------------------------------------------------------------------------- +--Light falloff functions: http://gamedev.stackexchange.com/questions/56897/glsl-light-attenuation-color-and-intensity-formula +-------------------------------------------------------------------------------- + +local verbose = false +local function VerboseEcho(...) + if verbose then + Spring.Echo(...) + end +end + +local collectionFunctions = {} +local collectionFunctionCount = 0 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:ViewResize() + vsx, vsy = gl.GetViewSizes() + ivsx = 1.0 / vsx --we can do /n here! + ivsy = 1.0 / vsy + if (Spring.GetMiniMapDualScreen() == 'left') then + vsx = vsx / 2 + end + if (Spring.GetMiniMapDualScreen() == 'right') then + vsx = vsx / 2 + end + screenratio = vsy / vsx --so we dont overdraw and only always draw a square +end + +widget:ViewResize() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local vertSrc = [[ + void main(void) + { + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_Vertex; + } +]] +local fragSrc = [[ +//This code authored by Peter Sarkozy aka Beherith (mysterme@gmail.com ) +//License is GPL V2 +// old version with calced normals is 67 fps for 10 beamers full screen at 1440p +// new version with buffered normals is 88 fps for 10 beamers full screen at 1440p + + +//#define DEBUG + +#define LIGHTRADIUS lightpos.w +uniform sampler2D modelnormals; +uniform sampler2D modeldepths; +uniform sampler2D mapnormals; +uniform sampler2D mapdepths; +uniform sampler2D modelExtra; + +uniform vec3 eyePos; +uniform vec4 lightpos; +#if (BEAM_LIGHT == 1) + uniform vec4 lightpos2; +#endif +uniform vec4 lightcolor; +uniform mat4 viewProjectionInv; + +float attenuate(float dist, float radius) { + // float raw = constant-linear * dist / radius - squared * dist * dist / (radius * radius); + // float att = clamp(raw, 0.0, 0.5); + float raw = 0.7 - 0.3 * dist / radius - 1.0 * dist * dist / (radius * radius); + float att = clamp(raw, 0.0, 1.0); + return (att * att); +} + +void main(void) +{ + float mapDepth = texture2D( mapdepths, gl_TexCoord[0].st).x; + float mdlDepth = texture2D(modeldepths, gl_TexCoord[0].st).x; + + #if (CLIP_CONTROL == 1) + vec4 mappos4 = vec4( vec3(gl_TexCoord[0].st * 2.0 - 1.0, mapDepth), 1.0); + vec4 modelpos4 = vec4( vec3(gl_TexCoord[0].st * 2.0 - 1.0, mdlDepth), 1.0); + #else + vec4 mappos4 = vec4( vec3(gl_TexCoord[0].st, mapDepth) * 2.0 - 1.0, 1.0); + vec4 modelpos4 = vec4( vec3(gl_TexCoord[0].st, mdlDepth) * 2.0 - 1.0, 1.0); + #endif + + vec4 map_normals4 = texture2D(mapnormals , gl_TexCoord[0].st) * 2.0 - 1.0; + vec4 model_normals4 = texture2D(modelnormals, gl_TexCoord[0].st) * 2.0 - 1.0; + vec4 model_extra4 = texture2D(modelExtra , gl_TexCoord[0].st) * 2.0 - 1.0; + + + float specularHighlight = 1.0; + float model_lighting_multiplier = 1.0; //models recieve additional lighting, looks better. + + + if ((mappos4.z - modelpos4.z) > 0.0) { + // this means we are processing a model fragment, not a map fragment + if (model_extra4.a > 0.5) { + map_normals4 = model_normals4; + mappos4 = modelpos4; + model_lighting_multiplier = 1.5; + specularHighlight = specularHighlight + 2.0 * model_extra4.g; + } + } + + + mappos4 = viewProjectionInv * mappos4; + mappos4.xyz = mappos4.xyz / mappos4.w; + + vec3 light_direction; + + #if (BEAM_LIGHT == 0) + light_direction = normalize(lightpos.xyz - mappos4.xyz); + + float dist_light_here = dot(lightpos.xyz - mappos4.xyz, light_direction); + float cosphi = max(0.0, dot(normalize(map_normals4.xyz), light_direction)); + float attenuation = attenuate(dist_light_here, LIGHTRADIUS); + + #else + + /*distance( Point P, Segment P0:P1 ) // http://geomalgorithms.com/a02-_lines.html + { + v = P1 - P0 + w = P - P0 + if ( (c1 = w dot v) <= 0 ) // before P0 + return d(P, P0) + if ( (c2 = v dot v) <= c1 ) // after P1 + return d(P, P1) + b = c1 / c2 + Pb = P0 + bv + return d(P, Pb) + } + */ + + vec3 v = lightpos2.xyz - lightpos.xyz; + vec3 w = mappos4.xyz - lightpos.xyz; + float c1 = dot(v, w); + float c2 = dot(v, v); + + if (c1 <= 0.0){ + v = mappos4.xyz; + w = lightpos.xyz; + } else if (c2 < c1) { + v = mappos4.xyz; + w = lightpos2.xyz; + } else { + w = lightpos.xyz + (c1 / c2) * v; + v = mappos4.xyz; + } + + light_direction = normalize(w.xyz - v.xyz); + + float dist_light_here = dot(w - v, light_direction); + float cosphi = max(0.0, dot(normalize(map_normals4.xyz), light_direction)); + // float attenuation = max(0.0, (1.0 * LIGHT_CONSTANT - LIGHT_SQUARED * (dist_light_here * dist_light_here) / (LIGHTRADIUS * LIGHTRADIUS) - LIGHT_LINEAR * (dist_light_here) / (LIGHTRADIUS))); + float attenuation = attenuate(dist_light_here, LIGHTRADIUS); + #endif + + vec3 viewDirection = normalize(vec3(eyePos - mappos4.xyz)); + + // light source on the wrong side? + if (dot(map_normals4.xyz, light_direction) > 0.02) { + vec3 reflection = reflect(-1.0 * light_direction, map_normals4.xyz); + + float glossiness = dot(reflection, viewDirection); + float highlight = pow(max(0.0, glossiness), 8.0); + + specularHighlight *= (0.5 * highlight); + } else { + specularHighlight = 0.0; + } + + + //OK, our blending func is the following: Rr=Lr*Dr+1*Dr + float lightalpha = cosphi * attenuation + attenuation * specularHighlight; + //dont light underwater: + lightalpha = clamp(lightalpha, 0.0, lightalpha * ((mappos4.y + 50.0) * (0.02))); + + gl_FragColor = vec4(lightcolor.rgb * lightalpha * model_lighting_multiplier, 1.0); + + #ifdef DEBUG + gl_FragColor = vec4(map_normals4.xyz, 1.0); //world normals debugging + gl_FragColor = vec4(fract(modelpos4.z * 0.01),sign(mappos4.z - modelpos4.z), 0.0, 1.0); //world pos debugging, very useful + if (length(lightcolor.rgb * lightalpha * model_lighting_multiplier) < (1.0 / 256.0)){ //shows light boudaries + gl_FragColor=vec4(vec3(0.5, 0.0, 0.5), 0.0); + } + #endif +} + +]] +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DeferredLighting_RegisterFunction(func) + collectionFunctionCount = collectionFunctionCount + 1 + collectionFunctions[collectionFunctionCount] = func +end + +function widget:Initialize() + + if (glCreateShader == nil) then + Spring.Echo('Deferred Rendering requires shader support!') + widgetHandler:RemoveWidget(self) + return + end + + Spring.SetConfigInt("AllowDeferredMapRendering", 1) + Spring.SetConfigInt("AllowDeferredModelRendering", 1) + + if (Spring.GetConfigString("AllowDeferredMapRendering") == '0' or Spring.GetConfigString("AllowDeferredModelRendering") == '0') then + Spring.Echo('Deferred Rendering (gfx_deferred_rendering.lua) requires AllowDeferredMapRendering and AllowDeferredModelRendering to be enabled in springsettings.cfg!') + widgetHandler:RemoveWidget(self) + return + end + if ((not forceNonGLSL) and Spring.GetMiniMapDualScreen() ~= 'left') then --FIXME dualscreen + if (not glCreateShader) then + spEcho("gfx_deferred_rendering.lua: Shaders not found, removing self.") + GLSLRenderer = false + widgetHandler:RemoveWidget(self) + else + depthPointShader = depthPointShader or glCreateShader({ + defines = { + "#version 120\n", + "#define BEAM_LIGHT 0\n", + "#define CLIP_CONTROL " .. (Platform ~= nil and Platform.glSupportClipSpaceControl and 1 or 0) .. "\n" + }, + vertex = vertSrc, + fragment = fragSrc, + uniformInt = { + modelnormals = 0, + modeldepths = 1, + mapnormals = 2, + mapdepths = 3, + modelExtra = 4, + }, + }) + + if (not depthPointShader) then + spEcho(glGetShaderLog()) + spEcho("gfx_deferred_rendering.lua: Bad depth point shader, removing self.") + GLSLRenderer = false + widgetHandler:RemoveWidget(self) + else + lightposlocPoint = glGetUniformLocation(depthPointShader, "lightpos") + lightcolorlocPoint = glGetUniformLocation(depthPointShader, "lightcolor") + uniformEyePosPoint = glGetUniformLocation(depthPointShader, 'eyePos') + uniformViewPrjInvPoint = glGetUniformLocation(depthPointShader, 'viewProjectionInv') + end + --fragSrc = "#define BEAM_LIGHT \n" .. fragSrc + depthBeamShader = depthBeamShader or glCreateShader({ + defines = { + "#version 120\n", + "#define BEAM_LIGHT 1\n", + "#define CLIP_CONTROL " .. (Platform ~= nil and Platform.glSupportClipSpaceControl and 1 or 0) .. "\n" + }, + vertex = vertSrc, + fragment = fragSrc, + uniformInt = { + modelnormals = 0, + modeldepths = 1, + mapnormals = 2, + mapdepths = 3, + modelExtra = 4, + }, + }) + + if (not depthBeamShader) then + spEcho(glGetShaderLog()) + spEcho("gfx_deferred_rendering.lua: Bad depth beam shader, removing self.") + GLSLRenderer = false + widgetHandler:RemoveWidget(self) + else + lightposlocBeam = glGetUniformLocation(depthBeamShader, 'lightpos') + lightpos2locBeam = glGetUniformLocation(depthBeamShader, 'lightpos2') + lightcolorlocBeam = glGetUniformLocation(depthBeamShader, 'lightcolor') + uniformEyePosBeam = glGetUniformLocation(depthBeamShader, 'eyePos') + uniformViewPrjInvBeam = glGetUniformLocation(depthBeamShader, 'viewProjectionInv') + end + + WG.DeferredLighting_RegisterFunction = DeferredLighting_RegisterFunction + end + screenratio = vsy / vsx --so we dont overdraw and only always draw a square + else + GLSLRenderer = false + end + + widget:ViewResize() +end + +function widget:Shutdown() + if (GLSLRenderer) then + if (glDeleteShader) then + glDeleteShader(depthPointShader) + glDeleteShader(depthBeamShader) + end + end +end + +local function DrawLightType(lights, lightsCount, lighttype) -- point = 0 beam = 1 + --Spring.Echo('Camera FOV = ', Spring.GetCameraFOV()) -- default TA cam fov = 45 + --set uniforms: + local cpx, cpy, cpz = spGetCameraPosition() + if lighttype == 0 then --point + glUseShader(depthPointShader) + glUniform(uniformEyePosPoint, cpx, cpy, cpz) + glUniformMatrix(uniformViewPrjInvPoint, "viewprojectioninverse") + else --beam + glUseShader(depthBeamShader) + glUniform(uniformEyePosBeam, cpx, cpy, cpz) + glUniformMatrix(uniformViewPrjInvBeam, "viewprojectioninverse") + end + + glTexture(0, "$model_gbuffer_normtex") + glTexture(1, "$model_gbuffer_zvaltex") + glTexture(2, "$map_gbuffer_normtex") + glTexture(3, "$map_gbuffer_zvaltex") + glTexture(4, "$model_gbuffer_spectex") + + local cx, cy, cz = spGetCameraPosition() + for i = 1, lightsCount do + local light = lights[i] + local param = light.param + if verbose then + VerboseEcho('gfx_deferred_rendering.lua: Light being drawn:', i) + Spring.Utilities.TableEcho(light) + end + if lighttype == 0 then -- point + local lightradius = param.radius + --Spring.Echo("Drawlighttype position = ", light.px, light.py, light.pz) + local sx, sy, sz = spWorldToScreenCoords(light.px, light.py, light.pz) -- returns x, y, z, where x and y are screen pixels, and z is z buffer depth. + sx = sx/vsx + sy = sy/vsy --since FOV is static in the Y direction, the Y ratio is the correct one + local dist_sq = (light.px-cx)^2 + (light.py-cy)^2 + (light.pz-cz)^2 + local ratio = lightradius / math.sqrt(dist_sq) * 1.5 + glUniform(lightposlocPoint, light.px, light.py, light.pz, param.radius) --in world space + glUniform(lightcolorlocPoint, param.r * light.colMult, param.g * light.colMult, param.b * light.colMult, 1) + glTexRect( + math.max(-1 , (sx-0.5)*2-ratio*screenratio), + math.max(-1 , (sy-0.5)*2-ratio), + math.min( 1 , (sx-0.5)*2+ratio*screenratio), + math.min( 1 , (sy-0.5)*2+ratio), + math.max( 0 , sx - 0.5*ratio*screenratio), + math.max( 0 , sy - 0.5*ratio), + math.min( 1 , sx + 0.5*ratio*screenratio), + math.min( 1 , sy + 0.5*ratio) + ) -- screen size goes from -1, -1 to 1, 1; uvs go from 0, 0 to 1, 1 + end + if lighttype == 1 then -- beam + local lightradius = 0 + local px = light.px+light.dx*0.5 + local py = light.py+light.dy*0.5 + local pz = light.pz+light.dz*0.5 + local lightradius = param.radius + math.sqrt(light.dx^2 + light.dy^2 + light.dz^2)*0.5 + VerboseEcho("Drawlighttype position = ", light.px, light.py, light.pz) + local sx, sy, sz = spWorldToScreenCoords(px, py, pz) -- returns x, y, z, where x and y are screen pixels, and z is z buffer depth. + sx = sx/vsx + sy = sy/vsy --since FOV is static in the Y direction, the Y ratio is the correct one + local dist_sq = (px-cx)^2 + (py-cy)^2 + (pz-cz)^2 + local ratio = lightradius / math.sqrt(dist_sq) + ratio = ratio*2 + + glUniform(lightposlocBeam, light.px, light.py, light.pz, param.radius) --in world space + glUniform(lightpos2locBeam, light.px+light.dx, light.py+light.dy+24, light.pz+light.dz, param.radius) --in world space, the magic constant of +24 in the Y pos is needed because of our beam distance calculator function in GLSL + glUniform(lightcolorlocBeam, param.r * light.colMult, param.g * light.colMult, param.b * light.colMult, 1) + --TODO: use gl.Shape instead, to avoid overdraw + glTexRect( + math.max(-1 , (sx-0.5)*2-ratio*screenratio), + math.max(-1 , (sy-0.5)*2-ratio), + math.min( 1 , (sx-0.5)*2+ratio*screenratio), + math.min( 1 , (sy-0.5)*2+ratio), + math.max( 0 , sx - 0.5*ratio*screenratio), + math.max( 0 , sy - 0.5*ratio), + math.min( 1 , sx + 0.5*ratio*screenratio), + math.min( 1 , sy + 0.5*ratio) + ) -- screen size goes from -1, -1 to 1, 1; uvs go from 0, 0 to 1, 1 + end + end + glUseShader(0) +end + +local function renderToTextureFunc(tex, s, t) + glTexture(tex) + glTexRect(-1 * s, -1 * t, 1 * s, 1 * t) + glTexture(false) +end + +local function mglRenderToTexture(FBOTex, tex, s, t) + glRenderToTexture(FBOTex, renderToTextureFunc, tex, s, t) +end + +local beamLights = {} +local beamLightCount = 0 +local pointLights = {} +local pointLightCount = 0 +function widget:Update() + beamLights = {} + beamLightCount = 0 + pointLights = {} + pointLightCount = 0 + for i = 1, collectionFunctionCount do + beamLights, beamLightCount, pointLights, pointLightCount = collectionFunctions[i](beamLights, beamLightCount, pointLights, pointLightCount) + end +end + +-- adding a glow to Cannon projectiles +function widget:DrawWorld() + local lights = pointLights + glBlending(GL.SRC_ALPHA, GL.ONE) + gl.Texture(glowImg) + local size = 1 + for i = 1, pointLightCount do + local light = lights[i] + local param = light.param + if param.gib == nil and param.type == "Cannon"then + size = param.glowradius * 0.44 + gl.PushMatrix() + local colorMultiplier = 1 / math.max(param.r, param.g, param.b) + gl.Color(param.r*colorMultiplier, param.g*colorMultiplier, param.b*colorMultiplier, 0.016 + (size/4000)) + gl.Translate(light.px, light.py, light.pz) + gl.Billboard(true) + gl.TexRect(-(size/2), -(size/2), (size/2), (size/2)) + gl.PopMatrix() + end + end + gl.Billboard(false) + gl.Texture(false) + glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) +end + + +function widget:DrawScreenEffects() + if not (GLSLRenderer) then + Spring.Echo('Removing deferred rendering widget: failed to use GLSL shader') + widgetHandler:RemoveWidget(self) + return + end + + --glBlending(GL.DST_COLOR, GL.ONE) -- Set add blending mode + glBlending(GL.SRC_ALPHA, GL.ONE) + if beamLightCount > 0 then + DrawLightType(beamLights, beamLightCount, 1) + end + --glBlending(GL.ONE_MINUS_SRC_COLOR, GL.ONE) + if pointLightCount > 0 then + DrawLightType(pointLights, pointLightCount, 0) + end + + glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_dof.lua b/LuaUI/Widgets_Evo/gfx_dof.lua new file mode 100644 index 000000000..cad82e918 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_dof.lua @@ -0,0 +1,475 @@ +function widget:GetInfo() + return { + name = "Depth of Field", + version = 2.0, + desc = "Blurs far away objects.", + author = "aeonios, Shadowfury333 (with some code from Kleber Garcia)", + date = "Feb. 2019", + license = "GPL, MIT", + layer = -100000, --To run after gfx_deferred_rendering.lua + enabled = false + } +end + +local highQuality = true -- doesnt seem to do anything +local autofocus = true +local mousefocus = not autofocus +local focusDepth = 300 +local fStop = 3 + +----------------------------------------------------------------- +-- Engine Functions +----------------------------------------------------------------- + +local spGetCameraPosition = Spring.GetCameraPosition +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local diag = math.diag + +local glCopyToTexture = gl.CopyToTexture +local glCreateShader = gl.CreateShader +local glCreateTexture = gl.CreateTexture +local glDeleteShader = gl.DeleteShader +local glDeleteTexture = gl.DeleteTexture +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glRenderToTexture = gl.RenderToTexture +local glUseShader = gl.UseShader +local glUniform = gl.Uniform +local glUniformInt = gl.UniformInt +local glUniformMatrix = gl.UniformMatrix + +local GL_DEPTH_COMPONENT = 0x1902 +local GL_DEPTH_COMPONENT16 = 0x81A5 +local GL_DEPTH_COMPONENT24 = 0x81A6 +local GL_DEPTH_COMPONENT32 = 0x81A7 + +local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 +local GL_COLOR_ATTACHMENT1_EXT = 0x8CE1 +local GL_COLOR_ATTACHMENT2_EXT = 0x8CE2 +local GL_COLOR_ATTACHMENT3_EXT = 0x8CE3 + +----------------------------------------------------------------- + + +local function CleanupTextures() + glDeleteTexture(baseBlurTex or "") + glDeleteTexture(baseNearBlurTex or "") + glDeleteTexture(intermediateBlurTex0 or "") + glDeleteTexture(intermediateBlurTex1 or "") + glDeleteTexture(intermediateBlurTex2 or "") + glDeleteTexture(intermediateBlurTex3 or "") + glDeleteTexture(finalBlurTex or "") + glDeleteTexture(finalNearBlurTex or "") + glDeleteTexture(screenTex or "") + glDeleteTexture(depthTex or "") + gl.DeleteFBO(intermediateBlurFBO) + gl.DeleteFBO(baseBlurFBO) + baseBlurTex, baseNearBlurTex, intermediateBlurTex0, intermediateBlurTex1, + intermediateBlurTex2, intermediateBlurTex3, finalBlurTex, finalNearBlurTex, + screenTex, depthTex = + nil, nil, nil, nil, + nil, nil, nil, nil, + nil, nil + intermediateBlurFBO = nil + baseBlurFBO = nil +end +----------------------------------------------------------------- +-- Global Vars +----------------------------------------------------------------- + +local maxBlurDistance = 10000 --Distance in Spring units above which autofocus blurring can't happen + +local vsx = nil -- current viewport width +local vsy = nil -- current viewport height +local dofShader = nil +local screenTex = nil +local depthTex = nil +local baseBlurTex = nil +local baseNearBlurTex = nil +local baseBlurFBO = nil +local intermediateBlurTex0 = nil +local intermediateBlurTex1 = nil +local intermediateBlurTex2 = nil +local intermediateBlurTex3 = nil +local intermediateBlurFBO = nil +local finalBlurTex = nil +local finalNearBlurTex = nil + +-- shader uniform handles +local eyePosLoc = nil +local viewProjectionLoc = nil +local resolutionLoc = nil +local distanceLimitsLoc = nil +local autofocusLoc = nil +local mousefocusLoc = nil +local focusDepthLoc = nil +local mouseDepthCoordLoc = nil +local fStopLoc = nil +local qualityLoc = nil +local passLoc = nil + +-- shader uniform enums +local shaderPasses = +{ + filterSize = 0, + initialBlur = 1, + finalBlur = 2, + initialNearBlur = 3, + finalNearBlur = 4, + composition = 5, +} + + +function InitTextures() + vsx, vsy = gl.GetViewSizes() + local blurTexSizeX, blurTexSizeY = vsx/2, vsy/2; + + CleanupTextures() + + screenTex = glCreateTexture(vsx, vsy, { + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + + depthTex = gl.CreateTexture(vsx,vsy, { + border = false, + format = GL_DEPTH_COMPONENT24, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + + baseBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + if highQuality then + baseNearBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + end + + intermediateBlurTex0 = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + + intermediateBlurTex1 = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + + intermediateBlurTex2 = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + + if highQuality then + intermediateBlurTex3 = glCreateTexture(blurTexSizeX, blurTexSizeY, { + min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + format = GL_RGBA16F_ARB, wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + end + + finalBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + if highQuality then + finalNearBlurTex = glCreateTexture(blurTexSizeX, blurTexSizeY, { + fbo = true, min_filter = GL.LINEAR, mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_EDGE, wrap_t = GL.CLAMP_TO_EDGE, + }) + end + + if highQuality then + baseBlurFBO = gl.CreateFBO({ + color0 = baseBlurTex, + color1 = baseNearBlurTex, + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT + } + }) + + intermediateBlurFBO = gl.CreateFBO({ + color0 = intermediateBlurTex0, + color1 = intermediateBlurTex1, + color2 = intermediateBlurTex2, + color3 = intermediateBlurTex3, + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + GL_COLOR_ATTACHMENT2_EXT, + GL_COLOR_ATTACHMENT3_EXT + } + }) + else + baseBlurFBO = gl.CreateFBO({ + color0 = baseBlurTex, + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT + } + }) + + intermediateBlurFBO = gl.CreateFBO({ + color0 = intermediateBlurTex0, + color1 = intermediateBlurTex1, + color2 = intermediateBlurTex2, + drawbuffers = { + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + GL_COLOR_ATTACHMENT2_EXT + } + }) + end + + if not intermediateBlurTex0 or not intermediateBlurTex1 or not intermediateBlurTex2 + or not finalBlurTex or not baseBlurTex or not screenTex or not depthTex + or (highQuality and (not baseNearBlurTex or not intermediateBlurTex3 or not finalNearBlurTex)) then + Spring.Echo("Depth of Field: Failed to create textures!") + widgetHandler:RemoveWidget() + return + end +end + +function widget:ViewResize(x, y) + InitTextures() +end + +function init() + reset() + + if (glCreateShader == nil) then + Spring.Echo("[Depth of Field::Initialize] removing widget, no shader support") + widgetHandler:RemoveWidget() + return + end + + dofShader = dofShader or glCreateShader({ + defines = { + "#version 150 compatibility\n", + "#define DEPTH_CLIP01 " .. (Platform.glSupportClipSpaceControl and "1" or "0") .. "\n", + + "#define FILTER_SIZE_PASS " .. shaderPasses.filterSize .. "\n", + "#define INITIAL_BLUR_PASS " .. shaderPasses.initialBlur .. "\n", + "#define FINAL_BLUR_PASS " .. shaderPasses.finalBlur .. "\n", + "#define INITIAL_NEAR_BLUR_PASS " .. shaderPasses.initialNearBlur .. "\n", + "#define FINAL_NEAR_BLUR_PASS " .. shaderPasses.finalNearBlur .. "\n", + "#define COMPOSITION_PASS " .. shaderPasses.composition .. "\n", + + "#define BLUR_START_DIST " .. maxBlurDistance .. "\n", + + "#define LOW_QUALITY 0 \n", + "#define HIGH_QUALITY 1 \n" + }, + fragment = VFS.LoadFile("LuaUI/Widgets_EVO/Shaders/dof.fs", VFS.ZIP), + + uniformInt = {origTex = 0, blurTex0 = 1, blurTex1 = 2, blurTex2 = 3, blurTex3 = 4}, + }) + + if not dofShader then + Spring.Echo("Depth of Field: Failed to create shader!") + Spring.Echo(gl.GetShaderLog()) + widgetHandler:RemoveWidget() + return + end + + eyePosLoc = gl.GetUniformLocation(dofShader, "eyePos") + viewProjectionLoc = gl.GetUniformLocation(dofShader, "viewProjection") + resolutionLoc = gl.GetUniformLocation(dofShader, "resolution") + distanceLimitsLoc = gl.GetUniformLocation(dofShader, "distanceLimits") + autofocusLoc = gl.GetUniformLocation(dofShader, "autofocus") + mousefocusLoc = gl.GetUniformLocation(dofShader, "mousefocus") + focusDepthLoc = gl.GetUniformLocation(dofShader, "manualFocusDepth") + mouseDepthCoordLoc = gl.GetUniformLocation(dofShader, "mouseDepthCoord") + fStopLoc = gl.GetUniformLocation(dofShader, "fStop") + qualityLoc = gl.GetUniformLocation(dofShader, "quality") + passLoc = gl.GetUniformLocation(dofShader, "pass") + + widget:ViewResize() +end + +function widget:Initialize() + init() + WG['dof'] = {} + WG['dof'].getFocusDepth = function() + return focusDepth + end + WG['dof'].setFocusDepth = function(value) + focusDepth = value + end + WG['dof'].getFstop = function() + return fStop + end + WG['dof'].setFstop = function(value) + fStop = value + end + WG['dof'].getHighQuality = function() + return highQuality + end + WG['dof'].setHighQuality = function(value) + highQuality = value + InitTextures() + end + WG['dof'].getAutofocus = function() + return autofocus + end + WG['dof'].setAutofocus = function(value) + autofocus = value + mousefocus = not autofocus + end +end + +function reset() + if (glDeleteShader and dofShader) then + glDeleteShader(dofShader) + end + + if glDeleteTexture then + CleanupTextures() + end + dofShader = nil +end + +function widget:Shutdown() + reset() + WG['dof'] = nil +end + +local function FilterCalculation() + local cpx, cpy, cpz = spGetCameraPosition() + local gmin, gmax = Spring.GetGroundExtremes() + local effectiveHeight = cpy - math.max(0, gmin) + cpy = 3.5 * math.sqrt(effectiveHeight) * math.log(effectiveHeight) + glUniform(eyePosLoc, cpx, cpy, cpz) + glUniformInt(passLoc, shaderPasses.filterSize) + glTexture(0, screenTex) + glTexture(1, depthTex) + + -- glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glTexRect(0, 0, vsx, vsy, false, true) + -- + glTexture(0, false) + glTexture(1, false) +end + +local function InitialBlur() + glUniform(resolutionLoc, vsx/2, vsy/2) + glUniformInt(passLoc, shaderPasses.initialBlur) + glTexture(0, baseBlurTex) + glTexRect(0, 0, vsx, vsy, false, true) + glTexture(0, false) +end + +local function FinalBlur() + glUniform(resolutionLoc, vsx/2, vsy/2) + glUniformInt(passLoc, shaderPasses.finalBlur) + glTexture(0, baseBlurTex) + glTexture(1, intermediateBlurTex0) --R + glTexture(2, intermediateBlurTex1) --G + glTexture(3, intermediateBlurTex2) --B + glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) +end + +local function InitialNearBlur() + glUniform(resolutionLoc, vsx/2, vsy/2) + glUniformInt(passLoc, shaderPasses.initialNearBlur) + glTexture(0, baseNearBlurTex) + glTexRect(0, 0, vsx, vsy, false, true) + glTexture(0, false) +end + +local function FinalNearBlur() + glUniform(resolutionLoc, vsx/2, vsy/2) + glUniformInt(passLoc, shaderPasses.finalNearBlur) + glTexture(0, baseNearBlurTex) + glTexture(1, intermediateBlurTex0) --R + glTexture(2, intermediateBlurTex1) --G + glTexture(3, intermediateBlurTex2) --B + glTexture(4, intermediateBlurTex3) --A + glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) + glTexture(3, false) + glTexture(4, false) +end + +local function Composition() + glUniformInt(passLoc, shaderPasses.composition) + glTexture(0, screenTex) + glTexture(1, finalBlurTex) + if (highQuality) then + glTexture(2, finalNearBlurTex) + end + + glTexRect(0, 0, vsx, vsy, false, true) + glTexture(0, false) + glTexture(1, false) + glTexture(2, false) +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + gl.ActiveShader(dofShader, function() glUniformMatrix(viewProjectionLoc, "projection") end) +end + +function widget:DrawScreenEffects() + gl.Blending(false) + glCopyToTexture(screenTex, 0, 0, 0, 0, vsx, vsy) -- the original screen image + glCopyToTexture(depthTex, 0, 0, 0, 0, vsx, vsy) -- the original screen image + + local mx, my = Spring.GetMouseState() + + glUseShader(dofShader) + glUniform(distanceLimitsLoc, gl.GetViewRange()) + + glUniformInt(autofocusLoc, autofocus and 1 or 0) + glUniformInt(mousefocusLoc, mousefocus and 1 or 0) + glUniform(mouseDepthCoordLoc, mx/vsx, my/vsy) + glUniform(focusDepthLoc, focusDepth / maxBlurDistance) + glUniform(fStopLoc, fStop) + glUniformInt(qualityLoc, highQuality and 1 or 0) + + gl.ActiveFBO(baseBlurFBO, FilterCalculation) + gl.ActiveFBO(intermediateBlurFBO, InitialBlur) + glRenderToTexture(finalBlurTex, FinalBlur) + if highQuality then + gl.ActiveFBO(intermediateBlurFBO, InitialNearBlur) + glRenderToTexture(finalNearBlurTex, FinalNearBlur) + end + Composition() + + glUseShader(0) +end + +function widget:GetConfigData() + return { + highQuality = highQuality, + autofocus = autofocus, + focusDepth = focusDepth, + fStop = fStop, + } +end + +function widget:SetConfigData(data) + if data.highQuality ~= nil then + highQuality = data.highQuality + autofocus = data.autofocus + mousefocus = not autofocus + focusDepth = data.focusDepth + fStop = data.fStop + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_fog.lua b/LuaUI/Widgets_Evo/gfx_fog.lua new file mode 100644 index 000000000..477ba32b4 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_fog.lua @@ -0,0 +1,679 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- + +function widget:GetInfo() + return { + name = "GFX Fog", + version = 3, + desc = "Fog Drawing widget", + author = "trepan, user, aegis, jK, widget adaptation by Doo", + date = "2008-2011", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true + } +end + +local timeCyclesWeatherEffects = Spring.GetConfigInt("evo_timecyclesweathereffects", 0) +if timeCyclesWeatherEffects ~= 1 then + return false +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Config +mapcfg = {} +mapcfg.custom = { + fog = { + color = {gl.GetAtmosphere("fogColor")}, + height = tostring((1-gl.GetAtmosphere("fogStart"))*100).."%", --// allows either absolute sizes or in percent of map's MaxHeight + fogatten = 0.00125, + + } + } +GroundFogDefs = {} +local GroundFogDefs = mapcfg.custom.fog + +function GetConfig() +mapcfg = {} +mapcfg.custom = { + fog = { + color = {gl.GetAtmosphere("fogColor")}, + height = tostring((1-gl.GetAtmosphere("fogStart"))*100).."%", --// allows either absolute sizes or in percent of map's MaxHeight + fogatten = 0.00125, + } + } +GroundFogDefs = {} +GroundFogDefs = mapcfg.custom.fog +if GroundFogDefs then +if (GroundFogDefs.height == "auto") then + local min,max = Spring.GetGroundExtremes() + GroundFogDefs.height = max * (1-gl.GetAtmosphere("fogStart")) +elseif (GroundFogDefs.height:match("(%d+)%%")) then + local min,max = Spring.GetGroundExtremes() + local percent = GroundFogDefs.height:match("(%d+)%%") + GroundFogDefs.height = max * (1-gl.GetAtmosphere("fogStart")) +end +end + +fogHeight = GroundFogDefs.height +fogColor = GroundFogDefs.color +fogAtten = GroundFogDefs.fogatten +fr,fg,fb = unpack(fogColor) + +assert(type(fogHeight) == "number") +assert(type(fr) == "number") +assert(type(fg) == "number") +assert(type(fb) == "number") +assert(type(fogAtten) == "number") +end + +if GroundFogDefs then +if (GroundFogDefs.height == "auto") then + local min,max = Spring.GetGroundExtremes() + GroundFogDefs.height = max * (1-gl.GetAtmosphere("fogStart")) +elseif (GroundFogDefs.height:match("(%d+)%%")) then + local min,max = Spring.GetGroundExtremes() + local percent = GroundFogDefs.height:match("(%d+)%%") + GroundFogDefs.height = max * (1-gl.GetAtmosphere("fogStart")) +end +end + +fogHeight = GroundFogDefs.height +fogColor = GroundFogDefs.color +fogAtten = GroundFogDefs.fogatten +fr,fg,fb = unpack(fogColor) + +assert(type(fogHeight) == "number") +assert(type(fr) == "number") +assert(type(fg) == "number") +assert(type(fb) == "number") +assert(type(fogAtten) == "number") + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Automatically generated local definitions + +local GL_MODELVIEW = GL.MODELVIEW +local GL_NEAREST = GL.NEAREST +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_PROJECTION = GL.PROJECTION +local GL_QUADS = GL.QUADS +local GL_SRC_ALPHA = GL.SRC_ALPHA +local glBeginEnd = gl.BeginEnd +local glBlending = gl.Blending +local glCallList = gl.CallList +local glColor = gl.Color +local glColorMask = gl.ColorMask +local glCopyToTexture = gl.CopyToTexture +local glCreateList = gl.CreateList +local glCreateShader = gl.CreateShader +local glCreateTexture = gl.CreateTexture +local glDeleteShader = gl.DeleteShader +local glDeleteTexture = gl.DeleteTexture +local glDepthMask = gl.DepthMask +local glDepthTest = gl.DepthTest +local glGetMatrixData = gl.GetMatrixData +local glGetShaderLog = gl.GetShaderLog +local glGetUniformLocation = gl.GetUniformLocation +local glGetViewSizes = gl.GetViewSizes +local glLoadIdentity = gl.LoadIdentity +local glLoadMatrix = gl.LoadMatrix +local glMatrixMode = gl.MatrixMode +local glMultiTexCoord = gl.MultiTexCoord +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glResetMatrices = gl.ResetMatrices +local glTexCoord = gl.TexCoord +local glTexture = gl.Texture +local glRect = gl.Rect +local glUniform = gl.Uniform +local glUniformMatrix = gl.UniformMatrix +local glUseShader = gl.UseShader +local glVertex = gl.Vertex +local glTranslate = gl.Translate +local spEcho = Spring.Echo +local spGetCameraPosition = Spring.GetCameraPosition +local spGetCameraVectors = Spring.GetCameraVectors +local time = Spring.GetGameSeconds +local spGetDrawFrame = Spring.GetDrawFrame + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Extra GL constants +-- + +local GL_DEPTH_BITS = 0x0D56 + +local GL_DEPTH_COMPONENT = 0x1902 +local GL_DEPTH_COMPONENT16 = 0x81A5 +local GL_DEPTH_COMPONENT24 = 0x81A6 +local GL_DEPTH_COMPONENT32 = 0x81A7 + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local debugGfx = false --or true + +local GLSLRenderer = true +local forceNonGLSL = false -- force using the non-GLSL renderer +local post83 = false +do + post83 = true +end +if (forceNonGLSL) then + GLSLRenderer = false +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local gnd_min, gnd_max = Spring.GetGroundExtremes() +if (gnd_min < 0) then gnd_min = 0 end +if (gnd_max < 0) then gnd_max = 0 end +local vsx, vsy +local mx = Game.mapSizeX +local mz = Game.mapSizeZ +local fog +local CurrentCameraY +local timeNow, timeThen = 0,0 + + +local depthShader +local depthTexture + +local uniformEyePos +local uniformNoise +local uniformViewPrjInv + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +----a simple plane, very complete, would look good with shadows, reflex and stuff. + +local function DrawPlaneModel() + local layers = (fogHeight - (gnd_min+50)) / 50 + + glColor(fr,fg,fb,50*fogAtten) + glDepthTest(true) + glBlending(true) + + glBeginEnd(GL_QUADS,function() + for h = gnd_min+50,fogHeight,50 do + local l = -mx*4 + local r = mx + mx*4 + local t = -mz*4 + local b = mz + mz*4 + glVertex(l, h, t) + glVertex(r, h, t) + glVertex(r, h, b) + glVertex(l, h, b) + end + end) + + glDepthTest(false) + glBlending(false) + glColor(1,1,1,1) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- fog rendering + +local function FogSlices() + local h = 8*(math.sin(time()/1.2)) + 30*(math.sin(time()/7.3)) - 30 + glPushMatrix() + glTranslate(0,h,0) + glCallList(fog) + glPopMatrix() +end + +local function FogFullscreen() + local camY = select(2, spGetCameraPosition()) + local inFogH = fogHeight - camY + + if (inFogH > fogHeight * 0.1) then + glColor(fr,fg,fb, math.min(0.8, inFogH * fogAtten)) + glRect(0,0,vsx,vsy) + glColor(1,1,1,1) + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:ViewResize() + vsx, vsy = gl.GetViewSizes() + if (Spring.GetMiniMapDualScreen()=='left') then + vsx=vsx/2; + end + if (Spring.GetMiniMapDualScreen()=='right') then + vsx=vsx/2 + end + + if (depthTexture) then + glDeleteTexture(depthTexture) + depthTexture = nil + end + + depthTexture = glCreateTexture(vsx, vsy, { + format = GL_DEPTH_COMPONENT24, + min_filter = GL_NEAREST, + mag_filter = GL_NEAREST, + }) + + if (depthTexture == nil) then + spEcho("Removing fog widget, bad depth texture") + end +end + +widget:ViewResize() + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +local vertSrc = [[ + + void main(void) + { + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_Vertex; + } +]] + +local fragSrc = ([[ + const float fogAtten = %f; + const float fogHeight = %f; + const vec3 fogColor = vec3(%f, %f, %f); + + uniform sampler2D tex0; + uniform vec3 eyePos; + uniform vec2 noise; +#ifdef USE_INVERSEMATRIX + uniform mat4 viewProjectionInv; +#endif + + //! source: http://www.ozone3d.net/blogs/lab/20110427/glsl-random-generator/ + float rand(vec2 n) + { + return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); + } + + void main(void) + { + float z = texture2D(tex0, gl_TexCoord[0].st).x; + + vec4 ppos; + ppos.xyz = vec3(gl_TexCoord[0].st, z) * 2. - 1.; + ppos.a = 1.; +#ifdef USE_INVERSEMATRIX + vec4 worldPos4 = viewProjectionInv * ppos; +#else + vec4 worldPos4 = gl_ModelViewProjectionMatrixInverse * ppos; +#endif + vec3 worldPos = worldPos4.xyz / worldPos4.w; + vec3 toPoint = worldPos - eyePos; + +#ifdef DEBUG_GFX // world position debugging + const float k = 100.0; + vec3 debugColor = pow(2.0 * abs(0.5 - fract(worldPos / k)), 6.0); + gl_FragColor = vec4(debugColor, 1.0); + return; // BAIL +#endif + + float h0 = clamp(worldPos.y, 0.0, fogHeight); + float h1 = clamp(eyePos.y, 0.0, fogHeight); // FIXME: uniform ... + + float len = length(toPoint); + float dist = len * abs((h1 - h0) / toPoint.y); // div-by-zero prob? + float atten = clamp(1.0 - exp(-dist * fogAtten), 0.0, 1.0); + + gl_FragColor = vec4(fogColor, atten); + + //! noise + vec2 seed = gl_TexCoord[0].st + noise; + gl_FragColor.rgb += 0.030 * rand(seed); + } +]]):format(fogAtten, fogHeight, fogColor[1], fogColor[2], fogColor[3]) + + +if (post83) then + fragSrc = '#define USE_INVERSEMATRIX\n' .. fragSrc +end + +if (debugGfx) then + fragSrc = '#define DEBUG_GFX\n' .. fragSrc +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() +GetConfig() + if (enabled) then + if ((not forceNonGLSL) and Spring.GetMiniMapDualScreen()~='left') then --FIXME dualscreen + if (not glCreateShader) then + spEcho("Shaders not found, reverting to non-GLSL widget") + GLSLRenderer = false + else + + if depthShader then + gl.DeleteShader(depthShader) + depthShader = nil + end + + depthShader = glCreateShader({ + vertex = vertSrc, + fragment = fragSrc, + uniformInt = { + tex0 = 0, + }, + }) + Spring.Echo(depthShader) + + if (not depthShader) then + spEcho(glGetShaderLog()) + spEcho("Bad shader, reverting to non-GLSL widget.") + GLSLRenderer = false + else + uniformEyePos = glGetUniformLocation(depthShader, 'eyePos') + uniformNoise = glGetUniformLocation(depthShader, 'noise') + uniformViewPrjInv = glGetUniformLocation(depthShader, 'viewProjectionInv') + end + end + else + GLSLRenderer = false + end + if (not GLSLRenderer) then + if (fog) then + gl.DeleteList(fog) + fog = nil + end + + fog = glCreateList(DrawPlaneModel) + end + else + + end +end +frame = 0 +function widget:Update() +if frame%30 == 0 then +GetConfig() + vertSrc = nil + fragSrc = nil +vertSrc = [[ + + void main(void) + { + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_Vertex; + } +]] + +fragSrc = ([[ + const float fogAtten = %f; + const float fogHeight = %f; + const vec3 fogColor = vec3(%f, %f, %f); + + uniform sampler2D tex0; + uniform vec3 eyePos; + uniform vec2 noise; +#ifdef USE_INVERSEMATRIX + uniform mat4 viewProjectionInv; +#endif + + //! source: http://www.ozone3d.net/blogs/lab/20110427/glsl-random-generator/ + float rand(vec2 n) + { + return fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); + } + + void main(void) + { + float z = texture2D(tex0, gl_TexCoord[0].st).x; + + vec4 ppos; + ppos.xyz = vec3(gl_TexCoord[0].st, z) * 2. - 1.; + ppos.a = 1.; +#ifdef USE_INVERSEMATRIX + vec4 worldPos4 = viewProjectionInv * ppos; +#else + vec4 worldPos4 = gl_ModelViewProjectionMatrixInverse * ppos; +#endif + vec3 worldPos = worldPos4.xyz / worldPos4.w; + vec3 toPoint = worldPos - eyePos; + +#ifdef DEBUG_GFX // world position debugging + const float k = 100.0; + vec3 debugColor = pow(2.0 * abs(0.5 - fract(worldPos / k)), 6.0); + gl_FragColor = vec4(debugColor, 1.0); + return; // BAIL +#endif + + float h0 = clamp(worldPos.y, 0.0, fogHeight); + float h1 = clamp(eyePos.y, 0.0, fogHeight); // FIXME: uniform ... + + float len = length(toPoint); + float dist = len * abs((h1 - h0) / toPoint.y); // div-by-zero prob? + float atten = clamp(1.0 - exp(-dist * fogAtten), 0.0, 1.0); + + gl_FragColor = vec4(fogColor, atten); + + //! noise + vec2 seed = gl_TexCoord[0].st + noise; + gl_FragColor.rgb += 0.030 * rand(seed); + } +]]):format(fogAtten, fogHeight, fogColor[1], fogColor[2], fogColor[3]) +if (post83) then + fragSrc = '#define USE_INVERSEMATRIX\n' .. fragSrc +end +if (debugGfx) then + fragSrc = '#define DEBUG_GFX\n' .. fragSrc +end + if (enabled) then + if ((not forceNonGLSL) and Spring.GetMiniMapDualScreen()~='left') then --FIXME dualscreen + if (not glCreateShader) then + spEcho("Shaders not found, reverting to non-GLSL widget") + GLSLRenderer = false + else + depthShader = glCreateShader({ + vertex = vertSrc, + fragment = fragSrc, + uniformInt = { + tex0 = 0, + }, + }) + if (not depthShader) then + spEcho(glGetShaderLog()) + spEcho("Bad shader, reverting to non-GLSL widget.") + GLSLRenderer = false + else + uniformEyePos = glGetUniformLocation(depthShader, 'eyePos') + uniformNoise = glGetUniformLocation(depthShader, 'noise') + uniformViewPrjInv = glGetUniformLocation(depthShader, 'viewProjectionInv') + end + end + else + GLSLRenderer = false + end + if (not GLSLRenderer) then + if (fog) then + gl.DeleteList(fog) + fog = nil + end + + fog = glCreateList(DrawPlaneModel) + end + else + + end +end +frame = frame + 1 +end + + + + +function widget:Shutdown() + if (GLSLRenderer) then + glDeleteTexture(depthTexture) + if (glDeleteShader) then + glDeleteShader(depthShader) + end + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Vector Math +-- + +local function cross(a, b) + return { + (a[2] * b[3]) - (a[3] * b[2]), + (a[3] * b[1]) - (a[1] * b[3]), + (a[1] * b[2]) - (a[2] * b[1]) + } +end + +local function add(a, b) + return { + a[1] * b[1], + a[2] * b[2], + a[3] * b[3] + } +end + +local function dot(a, b) + return (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]) +end + + +local function normalize(a) + local len = math.sqrt((a[1] * a[1]) + (a[2] * a[2]) + (a[3] * a[3])) + if (len == 0.0) then + return a + end + a[1] = a[1] / len + a[2] = a[2] / len + a[3] = a[3] / len + return { a[1], a[2], a[3] } +end + + +local function scale(a, s) + a[1] = a[1] * s + a[2] = a[2] * s + a[3] = a[3] * s + return { a[1], a[2], a[3] } +end + + + +local function fract(x) + return select(2, math.modf(x,1)) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +local dl + +local function DrawFogNew() + GetConfig() + --//FIXME handle dualscreen correctly! + + -- copy the depth buffer + if (depthTexture) then + glDeleteTexture(depthTexture) + depthTexture = nil + end + + depthTexture = glCreateTexture(vsx, vsy, { + format = GL_DEPTH_COMPONENT24, + min_filter = GL_NEAREST, + mag_filter = GL_NEAREST, + }) + + glCopyToTexture(depthTexture, 0, 0, 0, 0, vsx, vsy) --FIXME scale down? + + -- setup the shader and its uniform values + + glUseShader(depthShader) + + -- set uniforms + local cpx, cpy, cpz = spGetCameraPosition() + glUniform(uniformEyePos, cpx, cpy, cpz) + + local noise1 = (spGetDrawFrame() / 2521) % 1 -- why 2521? it's prime ;) + glUniform(uniformNoise, noise1 + fract(cpx), noise1 + fract(cpz)) + + if (post83) then + glUniformMatrix(uniformViewPrjInv, "viewprojectioninverse") + end + if dl then + gl.DeleteList(dl) + dl = nil + end + if (not dl) then + dl = gl.CreateList(function() + -- render a full screen quad + glTexture(0, depthTexture) + glTexture(0, false) + gl.TexRect(-1, -1, 1, 1, 0, 0, 1, 1) + + --// finished + glUseShader(0) + end) + end + + glCallList(dl) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:DrawWorld() + GetConfig() + if (GLSLRenderer) then + if (debugGfx) then glBlending(GL_SRC_ALPHA, GL_ONE) end + if depthShader then + gl.DeleteShader(depthShader) + depthShader = nil + end + + depthShader = glCreateShader({ + vertex = vertSrc, + fragment = fragSrc, + uniformInt = { + tex0 = 0, + }, + }) + uniformEyePos = glGetUniformLocation(depthShader, 'eyePos') + uniformNoise = glGetUniformLocation(depthShader, 'noise') + uniformViewPrjInv = glGetUniformLocation(depthShader, 'viewProjectionInv') + DrawFogNew() + if (debugGfx) then glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) end + else + FogSlices() + end +end + +if (not GLSLRenderer) then + function widget:DrawScreenEffects() + FogFullscreen() + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gfx_guishader.lua b/LuaUI/Widgets_Evo/gfx_guishader.lua new file mode 100644 index 000000000..19633e712 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_guishader.lua @@ -0,0 +1,559 @@ + +-- disable for intel cards (else it will render solid dark screen) +if Platform ~= nil and Platform.gpuVendor == 'Intel' then + return +end + + +function widget:GetInfo() + return { + name = "GUI Shader", + desc = "Blurs the 3D-world under several other widgets UI elements.", + author = "Floris (original blurapi widget by: jK)", + date = "17 february 2015", + license = "GNU GPL, v2 or later", + layer = -99999999, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +------------------------------------------------------------------- + +local defaultBlurIntensity = 0.002 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--hardware capability + +local canRTT = (gl.RenderToTexture ~= nil) +local canCTT = (gl.CopyToTexture ~= nil) +local canShader = (gl.CreateShader ~= nil) +local canFBO = (gl.DeleteTextureFBO ~= nil) + +local NON_POWER_OF_TWO = gl.HasExtension("GL_ARB_texture_non_power_of_two") + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +local renderDlists = {} +local deleteDlistQueue = {} +local blurShader +local screencopy +local blurtex +local blurtex2 +local stenciltex +local stenciltexScreen +local screenBlur = false + +local blurIntensity = defaultBlurIntensity +local guishaderRects = {} +local guishaderDlists = {} +local guishaderScreenRects = {} +local guishaderScreenDlists = {} +local updateStencilTexture = false +local updateStencilTextureScreen = false + +local oldvs = 0 +local vsx, vsy = widgetHandler:GetViewSizes() +local ivsx, ivsy = vsx, vsy +function widget:ViewResize(viewSizeX, viewSizeY) + vsx, vsy = viewSizeX,viewSizeY + ivsx,ivsy = vsx, vsy + + if (gl.DeleteTextureFBO) then + gl.DeleteTextureFBO(blurtex) + gl.DeleteTextureFBO(blurtex2) + gl.DeleteTexture(screencopy) + end + + screencopy = gl.CreateTexture(vsx, vsy, { + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + blurtex = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + blurtex2 = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + + if (blurtex == nil)or(blurtex2 == nil)or(screencopy == nil) then + Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader api: texture error") + widgetHandler:RemoveWidget(self) + return false + end + + updateStencilTexture = true + updateStencilTextureScreen = true +end + + +function widget:UpdateCallIns() + self:ViewResize(vsx, vsy) + self.DrawScreenEffects = DrawScreenEffectsBlur + widgetHandler:UpdateCallIn("DrawScreenEffects") +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DrawStencilTexture(world,fullscreen) + local usedStencilTex + if world then usedStencilTex = stenciltex else usedStencilTex = stenciltexScreen end + + if (next(guishaderRects) or next(guishaderScreenRects) or next(guishaderDlists)) then + + if (usedStencilTex == nil)or(vsx+vsy~=oldvs) then + gl.DeleteTextureFBO(usedStencilTex) + + oldvs = vsx+vsy + usedStencilTex = gl.CreateTexture(vsx, vsy, { + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + + if (usedStencilTex == nil) then + Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader api: texture error") + widgetHandler:RemoveWidget(self) + return false + end + end + else + gl.RenderToTexture(usedStencilTex, gl.Clear, GL.COLOR_BUFFER_BIT ,0,0,0,0) + return + end + + gl.RenderToTexture(usedStencilTex, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.PushMatrix() + gl.Translate(-1,-1,0) + gl.Scale(2/vsx,2/vsy,0) + if world then + for _,rect in pairs(guishaderRects) do + gl.Rect(rect[1],rect[2],rect[3],rect[4]) + end + for _,dlist in pairs(guishaderDlists) do + gl.CallList(dlist) + end + elseif fullscreen then + gl.Rect(0,0,vsx,vsy) + else + for _,rect in pairs(guishaderScreenRects) do + gl.Rect(rect[1],rect[2],rect[3],rect[4]) + end + for _,dlist in pairs(guishaderScreenDlists) do + gl.CallList(dlist) + end + end + gl.PopMatrix() + end) + + if world then stenciltex = usedStencilTex else stenciltexScreen = usedStencilTex end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function CheckHardware() + if (not canCTT) then + Spring.Echo("guishader api: your hardware is missing the necessary CopyToTexture feature") + widgetHandler:RemoveWidget(self) + return false + end + + if (not canRTT) then + Spring.Echo("guishader api: your hardware is missing the necessary RenderToTexture feature") + widgetHandler:RemoveWidget(self) + return false + end + + if (not canShader) then + Spring.Echo("guishader api: your hardware does not support shaders, OR: change springsettings: \"enable lua shaders\" ") + widgetHandler:RemoveWidget(self) + return false + end + + if (not canFBO) then + Spring.Echo("guishader api: your hardware does not fbo textures") + widgetHandler:RemoveWidget(self) + return false + end + + if (not NON_POWER_OF_TWO) then + Spring.Echo("guishader api: your hardware does not non-2^n-textures") + widgetHandler:RemoveWidget(self) + return false + end + + --if Platform ~= nil then + -- if Platform.gpuVendor == 'Intel' then + -- widgetHandler:RemoveWidget(self) + -- Spring.SendCommands("luaui disablewidget GUI Shader") + -- return false + -- end + --end + return true +end + + +function widget:Initialize() + if (not CheckHardware()) then return false end + + CreateShaders() + + self:UpdateCallIns() + + WG['guishader'] = {} + WG['guishader'].InsertDlist = function(dlist,name) + guishaderDlists[name] = dlist + updateStencilTexture = true + end + WG['guishader'].RemoveDlist = function(name) + local found = false + if guishaderDlists[name] ~= nil then + found = true + end + guishaderDlists[name] = nil + updateStencilTexture = true + return found + end + WG['guishader'].DeleteDlist = function(name) + local found = false + if guishaderDlists[name] ~= nil then + found = true + deleteDlistQueue[name] = guishaderDlists[name] + end + return found + end + WG['guishader'].InsertRect = function(left,top,right,bottom,name) + guishaderRects[name] = {left,top,right,bottom} + updateStencilTexture = true + end + WG['guishader'].RemoveRect = function(name) + local found = false + if guishaderRects[name] ~= nil then + found = true + end + guishaderRects[name] = nil + updateStencilTexture = true + return found + end + WG['guishader'].InsertScreenDlist = function(dlist,name) + guishaderScreenDlists[name] = dlist + updateStencilTextureScreen = true + end + WG['guishader'].RemoveScreenDlist = function(name) + local found = false + if guishaderScreenDlists[name] ~= nil then + found = true + end + guishaderScreenDlists[name] = nil + updateStencilTextureScreen = true + return found + end + WG['guishader'].DeleteScreenDlist = function(name) + local found = false + if guishaderScreenDlists[name] ~= nil then + found = true + deleteDlistQueue[name] = guishaderScreenDlists[name] + end + return found + end + WG['guishader'].InsertScreenRect = function(left,top,right,bottom,name) + guishaderScreenRects[name] = {left,top,right,bottom} + updateStencilTextureScreen = true + end + WG['guishader'].RemoveScreenRect = function(name) + local found = false + if guishaderScreenRects[name] ~= nil then + found = true + end + guishaderScreenRects[name] = nil + updateStencilTextureScreen = true + return found + end + WG['guishader'].getBlurDefault = function() + return defaultBlurIntensity + end + WG['guishader'].getBlurIntensity = function() + return blurIntensity + end + WG['guishader'].setBlurIntensity = function(value) + if value == nil then value = defaultBlurIntensity end + blurIntensity = value + end + + WG['guishader'].setScreenBlur = function(value) + updateStencilTextureScreen = true + screenBlur = value + end + WG['guishader'].getScreenBlur = function(value) + return screenBlur + end + + -- will let it draw a given dlist to be rendered on top of screenblur + WG['guishader'].insertRenderDlist = function(value) + renderDlists[value] = true + end + WG['guishader'].removeRenderDlist = function(value) + if renderDlists[value] then + renderDlists[value] = nil + end + end + + widgetHandler:RegisterGlobal('GuishaderInsertRect', WG['guishader'].InsertRect) + widgetHandler:RegisterGlobal('GuishaderRemoveRect', WG['guishader'].RemoveRect) +end + + +function CreateShaders() + + if (blurShader) then + gl.DeleteShader(blurShader or 0) + end + + -- create blur shaders + blurShader = gl.CreateShader({ + fragment = [[ + #version 150 compatibility + uniform sampler2D tex2; + uniform sampler2D tex0; + uniform float intensity; + + void main(void) + { + vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); + float stencil = texture2D(tex2, texCoord).a; + if (stencil<0.01) + { + gl_FragColor = texture2D(tex0, texCoord); + return; + } + gl_FragColor = vec4(0.0,0.0,0.0,1.0); + + float sum = 0.0; + for (int i = -1; i <= 1; ++i) + for (int j = -1; j <= 1; ++j) { + vec2 samplingCoords = texCoord + vec2(i, j) * intensity; + float samplingCoordsOk = float( all( greaterThanEqual(samplingCoords, vec2(0.0)) ) && all( lessThanEqual(samplingCoords, vec2(1.0)) ) ); + gl_FragColor.rgb += texture2D(tex0, samplingCoords).rgb * samplingCoordsOk; + sum += samplingCoordsOk; + } + gl_FragColor.rgb /= sum; + } + ]], + + uniformInt = { + tex0 = 0, + tex2 = 2, + }, + uniformFloat = { + intensity = blurIntensity, + } + }) + + if (blurShader == nil) then + Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader blurShader: shader error: "..gl.GetShaderLog()) + widgetHandler:RemoveWidget(self) + return false + end + + -- create blurtextures + screencopy = gl.CreateTexture(vsx, vsy, { + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + blurtex = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + blurtex2 = gl.CreateTexture(ivsx, ivsy, { + border = false, + wrap_s = GL.CLAMP, + wrap_t = GL.CLAMP, + fbo = true, + }) + + intensityLoc = gl.GetUniformLocation(blurShader, "intensity") + + -- debug? + if (blurtex == nil)or(blurtex2 == nil)or(screencopy == nil) then + Spring.Log(widget:GetInfo().name, LOG.ERROR, "guishader api: texture error") + widgetHandler:RemoveWidget(self) + return false + end +end + + +function DeleteShaders() + if (gl.DeleteTextureFBO) then + gl.DeleteTextureFBO(blurtex) + gl.DeleteTextureFBO(blurtex2) + gl.DeleteTextureFBO(stenciltex) + gl.DeleteTextureFBO(stenciltexScreen) + end + gl.DeleteTexture(screencopy or 0) + + if (gl.DeleteShader) then + gl.DeleteShader(blurShader or 0) + end + blurShader = nil +end + +function widget:Shutdown() + DeleteShaders() + WG['guishader'] = nil +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:DrawScreenEffectsBlur() + if Spring.IsGUIHidden() then return end + + if not screenBlur and blurShader then + if not next(guishaderRects) and not next(guishaderDlists) then return end + + gl.Texture(false) + gl.Color(1,1,1,1) + gl.Blending(false) + + if updateStencilTexture then + DrawStencilTexture(true); + updateStencilTexture = false; + end + + gl.CopyToTexture(screencopy, 0, 0, 0, 0, vsx, vsy) + gl.Texture(screencopy) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + + gl.UseShader(blurShader) + gl.Uniform(intensityLoc, blurIntensity) + + gl.Texture(2,stenciltex) + gl.Texture(blurtex) + gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.Texture(blurtex2) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.Texture(2,false) + gl.UseShader(0) + + if blurIntensity >= 0.0016 then + gl.UseShader(blurShader) + gl.Uniform(intensityLoc, blurIntensity*0.5) + + gl.Texture(blurtex) + gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.Texture(blurtex2) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.UseShader(0) + end + + gl.Texture(blurtex) + gl.TexRect(0,vsy,vsx,0) + gl.Texture(false) + + gl.Blending(true) + end +end + +function widget:DrawScreen() + if Spring.IsGUIHidden() then return end + + if ((screenBlur or next(guishaderScreenRects) or next(guishaderScreenDlists))) and blurShader then + gl.Texture(false) + gl.Color(1,1,1,1) + gl.Blending(false) + + if updateStencilTextureScreen then + DrawStencilTexture(false, screenBlur) + updateStencilTextureScreen = false + end + + gl.CopyToTexture(screencopy, 0, 0, 0, 0, vsx, vsy) + gl.Texture(screencopy) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + + gl.UseShader(blurShader) + if screenBlur then + gl.Uniform(intensityLoc, math.max(blurIntensity, 0.0015)) + else + gl.Uniform(intensityLoc, blurIntensity) + end + + gl.Texture(2,stenciltexScreen) + gl.Texture(2,false) + + gl.Texture(blurtex) + gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.Texture(blurtex2) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.UseShader(0) + + --2nd pass + gl.UseShader(blurShader) + gl.Uniform(intensityLoc, blurIntensity*0.5) + + gl.Texture(blurtex) + gl.RenderToTexture(blurtex2, gl.TexRect, -1,1,1,-1) + gl.Texture(blurtex2) + gl.RenderToTexture(blurtex, gl.TexRect, -1,1,1,-1) + gl.UseShader(0) + + gl.Texture(blurtex) + gl.TexRect(0,vsy,vsx,0) + gl.Texture(false) + + gl.Blending(true) + end + + for k,v in pairs(renderDlists) do + gl.CallList(k) + end + + for k,v in pairs(deleteDlistQueue) do + gl.DeleteList(deleteDlistQueue[v]) + if guishaderDlists[k] then + guishaderDlists[k] = nil + elseif guishaderScreenDlists[k] then + guishaderScreenDlists[k] = nil + end + updateStencilTexture = true + end + deleteDlistQueue = {} +end + +function widget:GetConfigData(data) + savedTable = {} + savedTable.blurIntensity = blurIntensity + return savedTable +end + +function widget:SetConfigData(data) + if data.blurIntensity ~= nil then + blurIntensity = data.blurIntensity + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + screenBlur = (msg:sub(1,19) == 'LobbyOverlayActive1') + updateStencilTextureScreen = true + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_light_effects.lua b/LuaUI/Widgets_Evo/gfx_light_effects.lua new file mode 100644 index 000000000..69700c772 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_light_effects.lua @@ -0,0 +1,805 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Light Effects", + version = 4, + desc = "Creates projectile, laser and explosion lights and sends them to the deferred renderer.", + author = "Floris (original by beherith)", + date = "May 2017", + license = "GPL V2", + layer = 0, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local spGetProjectilesInRectangle = Spring.GetProjectilesInRectangle +local spGetVisibleProjectiles = Spring.GetVisibleProjectiles +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileType = Spring.GetProjectileType +local spGetProjectileDefID = Spring.GetProjectileDefID +local spGetPieceProjectileParams = Spring.GetPieceProjectileParams +local spGetProjectileVelocity = Spring.GetProjectileVelocity + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Local Variables +local previousProjectileDrawParams +local fadeProjectiles, fadeProjectileTimes = {}, {} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Config + +local useLOD = false -- Reduces the number of lights drawn based on camera distance and current fps. +local projectileFade = true +local FADE_TIME = 5 + + +local overrideParam = {r = 1, g = 1, b = 1, radius = 200} +local doOverride = false + +local globalLightMult = 3 +local globalRadiusMult = 1.3 +local globalLightMultLaser = 1.3 +local globalRadiusMultLaser = 1.3 -- gets applied on top op globalRadiusMult +local globalLifeMult = 0.7 + +local enableHeatDistortion = false +local enableDeferred = true -- else use groundflashes instead + +local gibParams = {r = 0.145*globalLightMult, g = 0.1*globalLightMult, b = 0.05*globalLightMult, radius = 75*globalRadiusMult, gib = true} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local projectileLightTypes = {} +--[1] red +--[2] green +--[3] blue +--[4] radius +--[5] BEAMTYPE, true if BEAM + +local explosionLightsCount = 0 +local explosionLights = {} + + +local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results +end + + + +local weaponConf = {} +function loadWeaponDefs() + weaponConf = {} + for i=1, #WeaponDefs do + local customParams = WeaponDefs[i].customParams or {} + if customParams.expl_light_skip == nil then + local params = {} + --local maxDamage = 0 + --for armortype, value in pairs(WeaponDefs[i].damages) do + -- maxDamage = math.max(maxDamage, value) + --end + --local dmgBonus = math.sqrt(math.sqrt(math.sqrt(maxDamage))) + params.r, params.g, params.b = 1, 0.8, 0.4 + params.radius = (WeaponDefs[i].damageAreaOfEffect*4.5) * globalRadiusMult + params.orgMult = (0.35 + (params.radius/2400)) * globalLightMult + params.life = (14*(0.8+ params.radius/1200))*globalLifeMult + + if customParams.expl_light_color then + local colorList = Split(customParams.expl_light_color, " ") + params.r = colorList[1] + params.g = colorList[2] + params.b = colorList[3] + elseif WeaponDefs[i].rgbColor ~= nil then + local colorList = Split(WeaponDefs[i].rgbColor, " ") + params.r = colorList[1] + params.g = colorList[2] + params.b = colorList[3] + end + + if customParams.expl_light_opacity ~= nil then + params.orgMult = customParams.expl_light_opacity * globalLightMult + end + + if customParams.expl_light_mult ~= nil then + params.orgMult = params.orgMult * customParams.expl_light_mult + end + + if customParams.expl_light_radius then + params.radius = tonumber(customParams.expl_light_radius) * globalRadiusMult + end + if customParams.expl_light_radius_mult then + params.radius = params.radius * tonumber(customParams.expl_light_radius_mult) + end + + params.heatradius = (WeaponDefs[i].damageAreaOfEffect*0.5) + params.heatlife = (13*(0.8+ params.heatradius/1200)) + (params.heatradius/4) + + if customParams.expl_light_heat_radius_mult then + params.heatradius = (params.heatradius * tonumber(customParams.expl_light_heat_radius_mult)) + end + + params.heatstrength = 1 + (params.heatradius/30) + + if customParams.expl_light_heat_strength_mult then + params.heatstrength = params.heatstrength * customParams.expl_light_heat_strength_mult + end + if customParams.expl_noheatdistortion then + params.noheatdistortion = true + end + + if customParams.expl_light_life then + params.life = tonumber(customParams.expl_light_life) + end + if customParams.expl_light_life_mult then + params.life = params.life * tonumber(customParams.expl_light_life_mult) + end + if WeaponDefs[i].paralyzer then + params.type = 'paralyzer' + end + if WeaponDefs[i].type == 'Flame' then + params.type = 'flame' + params.radius = params.radius * 0.66 + params.orgMult = params.orgMult * 0.66 + end + params.wtype = WeaponDefs[i].type + if params.wtype == 'Cannon' then + params.cannonsize = WeaponDefs[i].size + end + weaponConf[i] = params + end + end +end +loadWeaponDefs() + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Light Defs + + +local function GetLightsFromUnitDefs() + --Spring.Echo('GetLightsFromUnitDefs init') + local plighttable = {} + for weaponDefID = 1, #WeaponDefs do + --These projectiles should have lights: + --Cannon (projectile size: tempsize = 2.0f + std::min(wd.customParams.shield_damage * 0.0025f, wd.damageAreaOfEffect * 0.1f);) + --Dgun + --MissileLauncher + --StarburstLauncher + --LaserCannon + --LightningCannon + --BeamLaser + --Flame + --Shouldnt: + --AircraftBomb + --Shield + --TorpedoLauncher + local weaponDef = WeaponDefs[weaponDefID] + + local customParams = weaponDef.customParams or {} + + local skip = false + if customParams.light_skip ~= nil and customParams.light_skip then + skip = true + end + + local lightMultiplier = 0.08 + local bMult = 1.6 -- because blue appears to be very faint + local r,g,b = weaponDef.visuals.colorR, weaponDef.visuals.colorG, weaponDef.visuals.colorB*bMult + + local weaponData = {type=weaponDef.type, r = (r + 0.1) * lightMultiplier, g = (g + 0.1) * lightMultiplier, b = (b + 0.1) * lightMultiplier, radius = 100} + local recalcRGB = false + + if (weaponDef.type == 'Cannon') then + if customParams.single_hit then + weaponData.beamOffset = 1 + weaponData.beam = true + else + weaponData.radius = 120 * weaponDef.size + if weaponDef.damageAreaOfEffect ~= nil then + weaponData.radius = 120 * ((weaponDef.size*0.4) + (weaponDef.damageAreaOfEffect * 0.025)) + end + lightMultiplier = 0.02 * ((weaponDef.size*0.66) + (weaponDef.damageAreaOfEffect * 0.012)) + if lightMultiplier > 0.08 then + lightMultiplier = 0.08 + end + recalcRGB = true + end + elseif (weaponDef.type == 'LaserCannon') then + weaponData.radius = 70 * weaponDef.size + elseif (weaponDef.type == 'DGun') then + weaponData.radius = 500 + lightMultiplier = 0.28 + elseif (weaponDef.type == 'MissileLauncher') then + weaponData.radius = 125 * weaponDef.size + if weaponDef.damageAreaOfEffect ~= nil then + weaponData.radius = 125 * (weaponDef.size + (weaponDef.damageAreaOfEffect * 0.01)) + end + lightMultiplier = 0.01 + (weaponDef.size/55) + recalcRGB = true + elseif (weaponDef.type == 'StarburstLauncher') then + weaponData.radius = 400 + weaponData.radius1 = weaponData.radius + weaponData.radius2 = weaponData.radius*0.6 + elseif (weaponDef.type == 'Flame') then + weaponData.radius = 70 * weaponDef.size + lightMultiplier = 0.05 + recalcRGB = true + skip = true + elseif (weaponDef.type == 'LightningCannon') then + weaponData.radius = 70 * weaponDef.size + weaponData.beam = true + elseif (weaponDef.type == 'BeamLaser') then + weaponData.radius = 16 * (weaponDef.size * weaponDef.size * weaponDef.size) + weaponData.beam = true + if weaponDef.beamTTL > 2 then + weaponData.fadeTime = weaponDef.beamTTL + weaponData.fadeOffset = 0 + end + end + + if customParams.light_opacity then + lightMultiplier = customParams.light_opacity + end + if customParams.light_mult ~= nil then + recalcRGB = true + lightMultiplier = lightMultiplier * tonumber(customParams.light_mult) + end + + -- For long lasers or projectiles + if customParams.light_beam_mult then + weaponData.beamOffset = 1 + weaponData.beam = true + weaponData.beamMult = tonumber(customParams.light_beam_mult) + weaponData.beamMultFrames = tonumber(customParams.light_beam_mult_frames) + end + + if customParams.light_fade_time and customParams.light_fade_offset then + weaponData.fadeTime = tonumber(customParams.light_fade_time) + weaponData.fadeOffset = tonumber(customParams.light_fade_offset) + end + + if customParams.light_radius then + weaponData.radius = tonumber(customParams.light_radius) + end + + if customParams.light_radius_mult then + weaponData.radius = weaponData.radius * tonumber(customParams.light_radius_mult) + if weaponData.radius1 and weaponData.radius2 then + weaponData.radius1 = weaponData.radius * tonumber(customParams.light_radius_mult) + weaponData.radius2 = weaponData.radius * tonumber(customParams.light_radius_mult) + end + end + + if customParams.light_ground_height then + weaponData.groundHeightLimit = tonumber(customParams.light_ground_height) + end + + if customParams.light_camera_height then + weaponData.cameraHeightLimit = tonumber(customParams.light_camera_height) + end + + if customParams.light_beam_start then + weaponData.beamStartOffset = tonumber(customParams.light_beam_start) + end + + if customParams.light_beam_offset then + weaponData.beamOffset = tonumber(customParams.light_beam_offset) + end + + if customParams.light_color then + local colorList = Split(customParams.light_color, " ") + r = colorList[1] + g = colorList[2] + b = colorList[3]*bMult + end + + if recalcRGB or globalLightMult ~= 1 or globalLightMultLaser ~= 1 then + local laserMult = 1 + if (weaponDef.type == 'BeamLaser' or weaponDef.type == 'LightningCannon' or weaponDef.type == 'LaserCannon') then + laserMult = globalLightMultLaser + end + weaponData.r = (r + 0.1) * lightMultiplier * globalLightMult * laserMult + weaponData.g = (g + 0.1) * lightMultiplier * globalLightMult * laserMult + weaponData.b = (b + 0.1) * lightMultiplier*bMult * globalLightMult * laserMult + end + + + if (weaponDef.type == 'Cannon') then + weaponData.glowradius = weaponData.radius + end + + weaponData.radius = weaponData.radius * globalRadiusMult + if (weaponDef.type == 'BeamLaser' or weaponDef.type == 'LightningCannon' or weaponDef.type == 'LaserCannon') then + weaponData.radius = weaponData.radius * globalRadiusMultLaser + end + + + if not skip and weaponData ~= nil and weaponData.radius > 0 and customParams.fake_weapon == nil then + + plighttable[weaponDefID] = weaponData + end + end + + return plighttable +end + + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Utilities + +local function InterpolateBeam(x, y, z, dx, dy, dz) + local finalDx, finalDy, finalDz = 0, 0, 0 + for i = 1, 10 do + local h = Spring.GetGroundHeight(x + dx + finalDx, z + dz + finalDz) + local mult + dx, dy, dz = dx*0.5, dy*0.5, dz*0.5 + if h < y + dy + finalDy then + finalDx, finalDy, finalDz = finalDx + dx, finalDy + dy, finalDz + dz + end + end + return finalDx, finalDy, finalDz +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Projectile Collection + +local function GetCameraHeight() + local camX, camY, camZ = Spring.GetCameraPosition() + return camY - math.max(Spring.GetGroundHeight(camX, camZ), 0) +end + +local function ProjectileLevelOfDetailCheck(param, proID, fps, height) + if param.cameraHeightLimit and param.cameraHeightLimit < height then + if param.cameraHeightLimit*3 > height then + local fraction = param.cameraHeightLimit/height + if fps < 60 then + fraction = fraction*fps/60 + end + local ratio = 1/fraction + return (proID%ratio < 1) + else + return false + end + end + + if param.beam then + return true + end + + if fps < 60 then + local fraction = fps/60 + local ratio = 1/fraction + return (proID%ratio < 1) + end + return true +end + +local function GetBeamLights(lightParams, pID, x, y, z) + local deltax, deltay, deltaz = spGetProjectileVelocity(pID) -- for beam types, this returns the endpoint of the beam] + local timeToLive + + if lightParams.beamMult then + local mult = lightParams.beamMult + if lightParams.beamMultFrames then + timeToLive = timeToLive or Spring.GetProjectileTimeToLive(pID) + if (not lightParams.maxTTL) or lightParams.maxTTL < timeToLive then + lightParams.maxTTL = timeToLive + end + mult = mult * (1 - math.min(1, (timeToLive - (lightParams.maxTTL - lightParams.beamMultFrames))/lightParams.beamMultFrames)) + end + deltax, deltay, deltaz = mult*deltax, mult*deltay, mult*deltaz + end + + if y + deltay < -800 then + -- The beam has fallen through the world + deltax, deltay, deltaz = InterpolateBeam(x, y, z, deltax, deltay, deltaz) + end + + if lightParams.beamOffset then + local m = lightParams.beamOffset + x, y, z = x - deltax*m, y - deltay*m, z - deltaz*m + end + if lightParams.beamStartOffset then + local m = lightParams.beamStartOffset + x, y, z = x + deltax*m, y + deltay*m, z + deltaz*m + deltax, deltay, deltaz = deltax*(1 - m), deltay*(1 - m), deltaz*(1 - m) + end + + local light = { + pID = pID, + px = x, py = y, pz = z, + dx = deltax, dy = deltay, dz = deltaz, + param = (doOverride and overrideParam) or lightParams, + beam = true + } + + if lightParams.fadeTime then + timeToLive = timeToLive or Spring.GetProjectileTimeToLive(pID) + light.colMult = math.max(0, (timeToLive + lightParams.fadeOffset)/lightParams.fadeTime) + else + light.colMult = 1 + end + + return light +end + +local function GetProjectileLight(lightParams, pID, x, y, z) + local light = { + pID = pID, + px = x, py = y, pz = z, + param = (doOverride and overrideParam) or lightParams + } + -- Use the following to check heatray fadeout parameters. + --local timeToLive = Spring.GetProjectileTimeToLive(pID) + --Spring.MarkerAddPoint(x,y,z,timeToLive) + + if lightParams.fadeTime and lightParams.fadeOffset then + local timeToLive = Spring.GetProjectileTimeToLive(pID) + light.colMult = math.max(0, (timeToLive + lightParams.fadeOffset)/lightParams.fadeTime) + else + light.colMult = 1 + end + + return light +end + +local function GetProjectileLights(beamLights, beamLightCount, pointLights, pointLightCount) + local cx, cy, cz = Spring.GetCameraPosition() + + if not enableDeferred then return {}, 0, {}, 0 end + + local projectiles = spGetVisibleProjectiles() + local projectileCount = #projectiles + if (not projectileFade) and projectileCount == 0 then + return beamLights, beamLightCount, pointLights, pointLightCount + end + + local fps = Spring.GetFPS() + local cameraHeight = math.floor(GetCameraHeight()*0.01)*100 + --Spring.Echo("cameraHeight", cameraHeight, "fps", fps) + local projectilePresent = {} + local projectileDrawParams = projectileFade and {} + + for i = 1, projectileCount do + local pID = projectiles[i] + local x, y, z = spGetProjectilePosition(pID) + --Spring.Echo("projectilepos = ", x, y, z, 'id', pID) + projectilePresent[pID] = true + local weapon, piece = spGetProjectileType(pID) + if piece then + local explosionflags = spGetPieceProjectileParams(pID) + if explosionflags and (explosionflags%32) > 15 then --only stuff with the FIRE explode tag gets a light + --Spring.Echo('explosionflag = ', explosionflags) + local drawParams = {pID = pID, px = x, py = y, pz = z, param = (doOverride and overrideParam) or gibParams, colMult = 1} + if drawParams.param.gib == true or drawParams.param.gib == nil then + pointLightCount = pointLightCount + 1 + pointLights[pointLightCount] = drawParams + if projectileDrawParams then + projectileDrawParams[#projectileDrawParams + 1] = drawParams + end + end + end + else + lightParams = projectileLightTypes[spGetProjectileDefID(pID)] + if lightParams and (not useLOD or ProjectileLevelOfDetailCheck(lightParams, pID, fps, cameraHeight)) then + if lightParams.beam then --BEAM type + local drawParams = GetBeamLights(lightParams, pID, x, y, z) + beamLightCount = beamLightCount + 1 + beamLights[beamLightCount] = drawParams + if projectileDrawParams then + -- Don't add beams (for now?) + --projectileDrawParams[#projectileDrawParams + 1] = drawParams + end + else -- point type + if not (lightParams.groundHeightLimit and lightParams.groundHeightLimit < (y - math.max(Spring.GetGroundHeight(y, y), 0))) then + local drawParams = GetProjectileLight(lightParams, pID, x, y, z) + if lightParams.radius2 ~= nil then + local dirX,dirY,dirZ = Spring.GetProjectileDirection(pID) + if dirX == 0 and dirZ == 0 then + drawParams.param.radius = lightParams.radius1 + else + drawParams.param.radius = lightParams.radius2 + end + end + pointLightCount = pointLightCount + 1 + pointLights[pointLightCount] = drawParams + if projectileDrawParams then + projectileDrawParams[#projectileDrawParams + 1] = drawParams + end + if enableHeatDistortion and WG['Lups'] then + local weaponDefID = Spring.GetProjectileDefID(pID) + if weaponDefID and weaponConf[weaponDefID] and not weaponConf[weaponDefID].noheatdistortion and Spring.IsSphereInView(x,y,z,100) then + if weaponConf[weaponDefID].wtype == 'DGun' then + local distance = math.diag(x-cx, y-cy, z-cz) + local strengthMult = 1 / (distance*0.001) + + WG['Lups'].AddParticles('JitterParticles2', { + layer = -35, + life = weaponConf[weaponDefID].heatlife/4, + pos = {x,y,z}, + size = weaponConf[weaponDefID].heatradius*1.5, + sizeGrowth = 0.2, + strength = (weaponConf[weaponDefID].heatstrength*0.5)*strengthMult, + animSpeed = 1.3, + heat = 1, + force = {0,0.35,0}, + }) + end + end + end + end + end + end + end + end + + local frame = Spring.GetGameFrame() + if projectileFade then + if previousProjectileDrawParams then + for i = 1, #previousProjectileDrawParams do + local pID = previousProjectileDrawParams[i].pID + if not projectilePresent[pID] then + local params = previousProjectileDrawParams[i] + params.startColMul = params.colMul or 1 + params.py = params.py + 10 + fadeProjectiles[#fadeProjectiles + 1] = params + fadeProjectileTimes[#fadeProjectileTimes + 1] = frame + FADE_TIME + end + end + end + + local i = 1 + while i <= #fadeProjectiles do + local strength = (fadeProjectileTimes[i] - frame)/FADE_TIME + if strength <= 0 then + fadeProjectileTimes[i] = fadeProjectileTimes[#fadeProjectileTimes] + fadeProjectileTimes[#fadeProjectileTimes] = nil + fadeProjectiles[i] = fadeProjectiles[#fadeProjectiles] + fadeProjectiles[#fadeProjectiles] = nil + else + local params = fadeProjectiles[i] + params.colMult = strength*params.startColMul + if params.beam then + beamLightCount = beamLightCount + 1 + beamLights[beamLightCount] = params + else + pointLightCount = pointLightCount + 1 + pointLights[pointLightCount] = params + end + i = i + 1 + end + end + + previousProjectileDrawParams = projectileDrawParams + end + + -- add explosion lights + for i, params in pairs(explosionLights) do + local progress = 1-((frame-params.frame)/params.life) + progress = ((progress * (progress*progress)) + (progress*1.4)) / 2.4 -- fade out fast, but ease out at the end + params.colMult = params.orgMult * progress + if params.colMult <= 0 then + explosionLights[i] = nil + else + pointLightCount = pointLightCount + 1 + pointLights[pointLightCount] = params + end + end + + return beamLights, beamLightCount, pointLights, pointLightCount +end + + +-- function called by explosion_lights gadget +function GadgetWeaponExplosion(px, py, pz, weaponID, ownerID) + if weaponConf[weaponID] ~= nil then + local params = { + life = weaponConf[weaponID].life, + orgMult = weaponConf[weaponID].orgMult, + frame = Spring.GetGameFrame(), + px = px, + py = py + 16 + (weaponConf[weaponID].radius/35), + pz = pz, + param = { + type = 'explosion', + r = weaponConf[weaponID].r, + g = weaponConf[weaponID].g, + b = weaponConf[weaponID].b, + radius = weaponConf[weaponID].radius, + }, + } + + if not enableDeferred then + if WG['Lups'] then + WG['Lups'].AddParticles('GroundFlash', { + worldspace = true, + layer = -35, + life = weaponConf[weaponID].life, + pos = {px,py+10,pz}, + size = weaponConf[weaponID].radius/2.2, + sizeGrowth = 0, + colormap = { {weaponConf[weaponID].r, weaponConf[weaponID].g, weaponConf[weaponID].b, weaponConf[weaponID].orgMult*1.33} }, + texture = 'LuaUI/Images/glow2.dds', + }) + end + else + explosionLightsCount = explosionLightsCount + 1 + explosionLights[explosionLightsCount] = params + end + + if py > 0 and enableHeatDistortion and WG['Lups'] and params.param.radius > 80 and not weaponConf[weaponID].noheatdistortion and Spring.IsSphereInView(px,py,pz,100) then + + local strength,animSpeed,life,heat,sizeGrowth,size,force + + local cx, cy, cz = Spring.GetCameraPosition() + local distance = math.diag(px-cx, py-cy, pz-cz) + local strengthMult = 1 / (distance*0.001) + + if weaponConf[weaponID].type == 'paralyzer' then + strength = 10 + animSpeed = 0.1 + life = params.life*0.6 + (params.param.radius/80) + sizeGrowth = 0 + heat = 15 + size = params.param.radius/16 + force = {0,0.15,0} + else + animSpeed = 1.3 + sizeGrowth = 0.6 + if weaponConf[weaponID].type == 'flame' then + strength = 1 + (params.life/25) + size = params.param.radius/2.35 + life = params.life*0.64 + (params.param.radius/90) + force = {1,5.5,1} + heat = 8 + else + strength = weaponConf[weaponID].heatstrength + size = weaponConf[weaponID].heatradius + life = weaponConf[weaponID].heatlife + force = {0,0.35,0} + heat = 1 + end + end + if size*strengthMult > 5 then + WG['Lups'].AddParticles('JitterParticles2', { + layer = -35, + life = life, + pos = {px,py+10,pz}, + size = size, + sizeGrowth = sizeGrowth, + strength = strength*strengthMult, + animSpeed = animSpeed, + heat = heat, + force = force, + }) + end + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Shutdown() + WG['lighteffects'] = nil +end + +function widget:Initialize() + loadWeaponDefs() + + widgetHandler:RegisterGlobal('GadgetWeaponExplosion', GadgetWeaponExplosion) + if WG.DeferredLighting_RegisterFunction then + WG.DeferredLighting_RegisterFunction(GetProjectileLights) + projectileLightTypes = GetLightsFromUnitDefs() + end + + WG['lighteffects'] = {} + WG['lighteffects'].getGlobalBrightness = function() + return globalLightMult + end + WG['lighteffects'].getGlobalRadius = function() + return globalRadiusMult + end + WG['lighteffects'].getGlobalBrightness = function() + return globalLightMultLaser + end + WG['lighteffects'].getLaserRadius = function() + return globalRadiusMultLaser + end + WG['lighteffects'].getLife = function() + return globalLifeMult + end + WG['lighteffects'].getHeatDistortion = function() + return enableHeatDistortion + end + WG['lighteffects'].getDeferred = function() + return enableDeferred + end + WG['lighteffects'].setGlobalBrightness = function(value) + globalLightMult = value + projectileLightTypes = GetLightsFromUnitDefs() + loadWeaponDefs() + end + WG['lighteffects'].setGlobalRadius = function(value) + globalRadiusMult = value + projectileLightTypes = GetLightsFromUnitDefs() + loadWeaponDefs() + end + WG['lighteffects'].setLaserBrightness = function(value) + globalLightMultLaser = value + projectileLightTypes = GetLightsFromUnitDefs() + end + WG['lighteffects'].setLaserRadius = function(value) + globalRadiusMultLaser = value + projectileLightTypes = GetLightsFromUnitDefs() + end + WG['lighteffects'].setLife = function(value) + globalLifeMult = value + loadWeaponDefs() + end + WG['lighteffects'].setHeatDistortion = function(value) + enableHeatDistortion = value + end + WG['lighteffects'].setDeferred = function(value) + enableDeferred = value + end + +end + + +function widget:GetConfigData(data) + local savedTable = { + globalLightMult = globalLightMult, + globalRadiusMult = globalRadiusMult, + globalLightMultLaser = globalLightMultLaser, + globalRadiusMultLaser = globalRadiusMultLaser, + globalLifeMult = globalLifeMult, + enableHeatDistortion = enableHeatDistortion, + enableDeferred = enableDeferred, + resetted = 1, + } + return savedTable +end + +function widget:SetConfigData(data) + if data.globalLifeMult ~= nil and data.resetted ~= nil and data.resetted == 1 then + if data.globalLightMult ~= nil then + globalLightMult = data.globalLightMult + end + if data.globalRadiusMult ~= nil then + globalRadiusMult = data.globalRadiusMult + end + if data.globalLightMultLaser ~= nil then + globalLightMultLaser = data.globalLightMultLaser + end + if data.globalRadiusMultLaser ~= nil then + globalRadiusMultLaser = data.globalRadiusMultLaser + end + if data.globalLifeMult ~= nil then + globalLifeMult = data.globalLifeMult + end + if data.enableHeatDistortion ~= nil then + enableHeatDistortion = data.enableHeatDistortion + end + if data.enableDeferred ~= nil then + enableDeferred = data.enableDeferred + end + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_lups_manager.lua b/LuaUI/Widgets_Evo/gfx_lups_manager.lua index 513d7f3aa..188621f49 100644 --- a/LuaUI/Widgets_Evo/gfx_lups_manager.lua +++ b/LuaUI/Widgets_Evo/gfx_lups_manager.lua @@ -77,6 +77,7 @@ end -------------------------------------------------------------------------------- local UnitEffects = {} +local registeredUnits = {} -- all finished units - prevents partial unbuild then rebuild from being treated as two UnitFinished events local function AddFX(unitname,fx) local ud = UnitDefNames[unitname] @@ -142,7 +143,8 @@ local tryloading = 1 --// try to activate lups if it isn't found local function ClearFxs(unitID) if (particleIDs[unitID]) then - for _,fxID in ipairs(particleIDs[unitID]) do + for i=1,#particleIDs[unitID] do + local fxID = particleIDs[unitID][i] Lups.RemoveParticles(fxID) end particleIDs[unitID] = nil @@ -153,7 +155,8 @@ end local function ClearFx(unitID, fxIDtoDel) if (particleIDs[unitID]) then local newTable = {} - for _,fxID in ipairs(particleIDs[unitID]) do + for i=1,#particleIDs[unitID] do + local fxID = particleIDs[unitID][i] if fxID == fxIDtoDel then Lups.RemoveParticles(fxID) else @@ -183,6 +186,10 @@ end -------------------------------------------------------------------------------- local function UnitFinished(_,unitID,unitDefID) + if registeredUnits[unitID] then + return + end + registeredUnits[unitID] = true if (unitDefID == cormexDefID) then cormexes[unitID] = 0 @@ -193,15 +200,23 @@ local function UnitFinished(_,unitID,unitDefID) local effects = UnitEffects[unitDefID] if (effects) then - for _,fx in ipairs(effects) do + for i=1,#effects do + local fx = effects[i] if (not fx.options) then - Spring.Echo("LUPS DEBUG GRRR", UnitDefs[unitDefID].name, fx and fx.class) + Spring.Log(widget:GetInfo().name, LOG.ERROR, "LUPS DEBUG GRRR", UnitDefs[unitDefID].name, fx and fx.class) return end if (fx.class=="GroundFlash") then - fx.options.pos = { Spring.GetUnitBasePosition(unitID) } + fx.options.pos = { Spring.GetUnitPosition(unitID) } + end + if (fx.options.heightFactor) then + local pos = fx.options.pos or {0, 0, 0} + fx.options.pos = { pos[1], Spring.GetUnitHeight(unitID)*fx.options.heightFactor, pos[3] } end + if (fx.options.radiusFactor) then + fx.options.size = Spring.GetUnitRadius(unitID)*fx.options.radiusFactor + end fx.options.unit = unitID AddFxs( unitID,LupsAddFX(fx.class,fx.options) ) fx.options.unit = nil @@ -211,6 +226,7 @@ end local function UnitDestroyed(_,unitID,unitDefID) + registeredUnits[unitID] = nil if (unitDefID == cormexDefID) then cormexes[unitID] = nil end @@ -224,6 +240,13 @@ local function UnitEnteredLos(_,unitID) if (spec and fullSpec) then return end + + --[[ + if registeredUnits[unitID] then + return + end + registeredUnits[unitID] = true + ]] if (unitDefID == cormexDefID) then cormexes[unitID] = 1 @@ -235,9 +258,10 @@ local function UnitEnteredLos(_,unitID) local unitDefID = spGetUnitDefID(unitID) local effects = UnitEffects[unitDefID] if (effects) then - for _,fx in ipairs(effects) do + for i=1,#effects do + local fx = effects[i] if (fx.class=="GroundFlash") then - fx.options.pos = { Spring.GetUnitBasePosition(unitID) } + fx.options.pos = { Spring.GetUnitPosition(unitID) } end fx.options.unit = unitID AddFxs( unitID,LupsAddFX(fx.class,fx.options) ) @@ -251,6 +275,7 @@ local function UnitLeftLos(_,unitID) local spec, fullSpec = spGetSpectatingState() if (spec and fullSpec) then return end + --registeredUnits[unitID] = nil if (unitDefID == cormexDefID) then cormexes[unitID] = nil end @@ -297,7 +322,8 @@ local function PlayerChanged(_,playerID) if (playerID == Spring.GetMyPlayerID()) then --// clear all FXs for _,unitFxIDs in pairs(particleIDs) do - for _,fxID in ipairs(unitFxIDs) do + for i=1,#unitFxIDs do + local fxID = unitFxIDs[i] Lups.RemoveParticles(fxID) end end @@ -350,7 +376,7 @@ function widget:Update() tryloading=-1 return else - Spring.Echo("LuaParticleSystem (Lups) couldn't be loaded!") + Spring.Log(widget:GetInfo().name, LOG.ERROR, "LuaParticleSystem (Lups) couldn't be loaded!") widgetHandler:RemoveWidgetCallIn("Update",self) return end @@ -406,8 +432,8 @@ end function widget:Shutdown() if (initialized) then for _,unitFxIDs in pairs(particleIDs) do - for _,fxID in ipairs(unitFxIDs) do - Lups.RemoveParticles(fxID) + for i=1,#unitFxIDs do + local fxID = unitFxIDs[i] end end particleIDs = {} diff --git a/LuaUI/Widgets_Evo/gfx_lups_units_on_fire.lua b/LuaUI/Widgets_Evo/gfx_lups_units_on_fire.lua new file mode 100644 index 000000000..938e2d82f --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_lups_units_on_fire.lua @@ -0,0 +1,147 @@ +-- $Id: gfx_lups_units_on_fire.lua 3171 2008-11-06 09:06:29Z det $ + +function widget:GetInfo() + return { + name = "Units on Fire", + desc = "Graphical effect for burning units", + author = "jK/quantum", + date = "Sep, 2008", + license = "GNU GPL, v2 or later", + layer = 10, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function MergeTable(outtable,intable) + for i,v in pairs(intable) do + if (outtable[i]==nil) then + if (type(v)=='table') then + if (type(outtable[i])~='table') then outtable[i] = {} end + MergeTable(outtable[i],v) + else + outtable[i] = v + end + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local flameFX = { + layer = 0, + speed = 0.65, + life = 30, + lifeSpread = 10, + delaySpread = 20, + colormap = { {0, 0, 0, 0.}, + {0.4, 0.4, 0.4, 0.01}, + {0.35, 0.15, 0.15, 0.20}, + {0, 0, 0, 0} }, + partpos = "a,b,c | a=10*(rand()-0.5),b=10*(rand()-0.5),c=10*(rand()-0.5)", + rotSpeed = 1, + rotSpeedSpread = -2, + rotSpread = 360, + size = 22, + sizeSpread = 1, + sizeGrowth = 0.9, + emitVector = {0,1,0}, + emitRotSpread = 60, + texture = 'bitmaps/GPL/flame.png', + count = 5, +} + +local smokeFX = { + layer = 1, + + life = 50, + lifeSpread = 20, + + colormap = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0.15, 0.1, 0.1, 0.4}, {0.03, 0.03, 0.03, 0.25}, {0, 0, 0, 0} }, + + texture = 'bitmaps/GPL/smoke_orange.png', +} + +--// merge with shared data in flameLarge +MergeTable(smokeFX, flameFX) + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local Lups -- Lua Particle System +local AddParticles +local particleIDs = {} + +local random,pi = math.random,math.pi +local sin,cos = math.sin,math.cos + +local GetWind = Spring.GetWind +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitRadius = Spring.GetUnitRadius + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + widgetHandler:RegisterGlobal('onFire', onFire) +end + +function widget:Shutdown() + widgetHandler:DeregisterGlobal('onFire', onFire) + if (initialized) then + Lups = WG['Lups'] + for _,particleID in pairs(particleIDs) do + Lups.RemoveParticles(particleID) + end + end +end + +local t = 1 +local totalFxCount = 0 --// total lups effects +function widget:Update() + if (t>2) then + Lups = WG['Lups'] + if (Lups) then + totalFxCount = Lups.GetStats() + AddParticles = Lups.AddParticles + end + t=1 + end + t=t+1 +end + + +function onFire(burningUnits) + if (Lups==nil)or(totalFxCount>175) then return end + + --// get wind and random values + local alpha = 2*pi*random() + local r = 20*random() + local wx, wy, wz = GetWind() + wx, wy, wz = wx*0.09, wy*0.09, wz*0.09 + flameFX.force = {wx,wy+3,wz} + smokeFX.force = flameFX.force + + for i=1,#burningUnits do + local unitID = burningUnits[i] + + --// send particles to LUPS + local x, y, z = spGetUnitPosition(unitID) + local r = spGetUnitRadius(unitID) + if (r and x) then + flameFX.pos = {x,y,z} + flameFX.partpos = "r*sin(alpha),0,r*cos(alpha) | alpha=rand()*2*pi, r=rand()*0.6*" .. r + flameFX.size = r * 0.35 + particleIDs[#particleIDs+1] = AddParticles('SimpleParticles2',flameFX) + + --smokeFX.pos = flameFX.pos + --smokeFX.partpos = flameFX.partpos + --smokeFX.size = flameFX.size + --particleIDs[#particleIDs+1] = AddParticles('SimpleParticles2',smokeFX) + end + + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_move_window_position.lua b/LuaUI/Widgets_Evo/gfx_move_window_position.lua new file mode 100644 index 000000000..817c0cb6e --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_move_window_position.lua @@ -0,0 +1,285 @@ + +local widgetName = "Move Window Position" +function widget:GetInfo() + return { + name = widgetName, + desc = "Move around window position with the arrow keys or by dragging", + author = "Floris", + date = "August 2018", + license = "GPL v2 or later", + layer = -math.huge, + enabled = false, + handler = true, + } +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 50 +local fontfileOutlineSize = 16 +local fontfileOutlineStrength = 1.5 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local vsx, vsy = gl.GetViewSizes() +local customScale = 1.2 +local widgetScale = (1 + (vsx*vsy / 4000000)) * customScale + +local windowPosX = tonumber(Spring.GetConfigInt("WindowPosX",1) or 0) +local windowPosY = tonumber(Spring.GetConfigInt("WindowPosY",1) or 0) +local initialWindowPosX = windowPosX +local initialWindowPosY = windowPosY +local dlistPosX = windowPosX +local dlistPosY = windowPosY + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local function DrawRectRound(px,py,sx,sy,cs) + + local csx = cs + local csy = cs + if sx-px < (cs*2) then + csx = (sx-px)/2 + if csx < 0 then csx = 0 end + end + if sy-py < (cs*2) then + csy = (sy-py)/2 + if csy < 0 then csy = 0 end + end + cs = math.min(csx, csy) + + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +function DrawWindow() + dlistPosX = windowPosX + dlistPosY = windowPosY + if WG['guishader'] then + WG['guishader'].InsertRect(0,0,vsx,vsy, 'movewindowpos') + WG['guishader'].setScreenBlur(true) + end + font:Begin() + gl.Color(0,0,0,0.6) + gl.Rect(0,0,vsx,vsy) + font:Print("\255\170\170\170Move window position with the \255\255\255\255arrow keys\255\170\170\170 or \255\255\255\255drag\255\170\170\170 using the mouse.", vsx/2, (vsy/2)+(50*widgetScale), 12*widgetScale, "ocn") + font:Print("\255\222\255\222x = "..windowPosX.." y = "..windowPosY, vsx/2, (vsy/2), 14*widgetScale, "ocn") + local buttonText = ' Apply ' + local buttonX = vsx/2 + local buttonY = (vsy/2)-(36*widgetScale) + local buttonFontsize = 15*widgetScale + local buttonWidth = font:GetTextWidth(buttonText)*buttonFontsize + local buttonHeight = buttonFontsize*2.2 + font:Print("\255\255\255\255ESCAPE\255\170\170\170 key will cancel changes", vsx/2, (vsy/2)-(50*widgetScale)-buttonHeight, 12*widgetScale, "ocn") + if initialWindowPosX ~= dlistPosX or initialWindowPosY ~= dlistPosY then + applyButtonPos = {buttonX-(buttonWidth/2), buttonY-(buttonHeight/2), buttonX+(buttonWidth/2), buttonY+(buttonHeight/2),buttonFontsize/5} + gl.Color(0,0.33,0,0.8) + RectRound(applyButtonPos[1],applyButtonPos[2],applyButtonPos[3],applyButtonPos[4],applyButtonPos[5]) + local padding = 2*widgetScale + gl.Color(1,1,1,0.1) + RectRound(applyButtonPos[1]+padding,applyButtonPos[2]+padding,applyButtonPos[3]-padding,applyButtonPos[4]-padding,applyButtonPos[5]*0.66) + font:Print("\255\222\255\222"..buttonText, buttonX, buttonY-(buttonFontsize*0.27), buttonFontsize, "ocn") + else + applyButtonPos = nil + end + font:End() +end + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (1 + (vsx*vsy / 4000000)) * customScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) +end + +function widget:Initialize() + widget:ViewResize() +end + +function widget:Update(dt) + if (changeClock and changeClock < os.clock()-0.7) or escape or applyChanges then + if changeClock then + Spring.SetConfigInt("WindowPosX", windowPosX) + Spring.SetConfigInt("WindowPosY", windowPosY) + Spring.SendCommands("Fullscreen 1") --tonumber(Spring.GetConfigInt("Fullscreen",1) or 1) + Spring.SendCommands("Fullscreen 0") + changeClock = nil + end + if applyChanges then + widgetHandler:DisableWidget(widgetName) + end + if escape then + if initialWindowPosX ~= dlistPosX or initialWindowPosY ~= dlistPosY then + Spring.SetConfigInt("WindowPosX", initialWindowPosX) + Spring.SetConfigInt("WindowPosY", initialWindowPosY) + Spring.SendCommands("Fullscreen 1") --tonumber(Spring.GetConfigInt("Fullscreen",1) or 1) + Spring.SendCommands("Fullscreen 0") + end + widgetHandler:DisableWidget(widgetName) + end + end +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY +end + +function widget:MousePress(x, y, button) + if applyButtonPos and IsOnRect(x, y, applyButtonPos[1],applyButtonPos[2],applyButtonPos[3],applyButtonPos[4]) then + applyChanges = true + return true + end + dragging = true + draggingStartX = x + draggingStartY = y + return true +end + +function widget:MouseRelease(x, y, button) + if dragging then + dragging = nil + windowPosX = windowPosX + (x-draggingStartX) + windowPosY = windowPosY + (draggingStartY-y) + if initialWindowPosX ~= dlistPosX or initialWindowPosY ~= dlistPosY then + changeClock = os.clock()-1 + end + end + return true +end + +function widget:MouseMove(x, y) + windowPosX = windowPosX + (x-draggingStartX) + windowPosY = windowPosY + (draggingStartY-y) + draggingStartX = x + draggingStartY = y + if dlistPosX ~= windowPosX or dlistPosY ~= windowPosY then + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end + return true +end + +function widget:KeyPress(key) + if key == 27 then -- ESC + escape = true + end + if key == 273 then -- UP then + windowPosY = windowPosY - 1 + changeClock = os.clock() + end + if key == 274 then -- DOWN then + windowPosY = windowPosY + 1 + changeClock = os.clock() + end + if key == 275 then -- RIGHT then + windowPosX = windowPosX + 1 + changeClock = os.clock() + end + if key == 276 then -- LEFT then + windowPosX = windowPosX - 1 + changeClock = os.clock() + end + if dlistPosX ~= windowPosX or dlistPosY ~= windowPosY then + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end + return true +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + gl.CallList(windowList) + + local x,y,b = Spring.GetMouseState() + if applyButtonPos and IsOnRect(x, y, applyButtonPos[1],applyButtonPos[2],applyButtonPos[3],applyButtonPos[4]) then + gl.Color(0.25,1,0.25,0.15) + RectRound(applyButtonPos[1],applyButtonPos[2],applyButtonPos[3],applyButtonPos[4],applyButtonPos[5]) + end +end + +function widget:Shutdown() + if WG['guishader'] then + WG['guishader'].RemoveRect('movewindowpos') + WG['guishader'].setScreenBlur(false) + end + if windowList then gl.DeleteList(windowList) end + widgetHandler:DisableWidget(widgetName) + gl.DeleteFont(font) +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_outline.lua b/LuaUI/Widgets_Evo/gfx_outline.lua deleted file mode 100644 index d5cac0c35..000000000 --- a/LuaUI/Widgets_Evo/gfx_outline.lua +++ /dev/null @@ -1,337 +0,0 @@ --- $Id: gfx_outline.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: gfx_outline.lua --- brief: Displays a nice cartoon like outline around units --- author: jK --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Outline", - desc = "Displays a nice cartoon like outline around units.", - author = "jK", - date = "Dec 06, 2007", - license = "GNU GPL, v2 or later", - layer = -10, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---//textures -local offscreentex -local depthtex -local blurtex - ---//shader -local depthShader -local blurShader_h -local blurShader_v -local uniformScreenXY, uniformScreenX, uniformScreenY - ---// geometric -local vsx, vsy = 0,0 -local resChanged = false - ---// display lists -local enter2d,leave2d - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local GL_DEPTH_BITS = 0x0D56 - -local GL_DEPTH_COMPONENT = 0x1902 -local GL_DEPTH_COMPONENT16 = 0x81A5 -local GL_DEPTH_COMPONENT24 = 0x81A6 -local GL_DEPTH_COMPONENT32 = 0x81A7 - ---// speed ups -local ALL_UNITS = Spring.ALL_UNITS -local GetVisibleUnits = Spring.GetVisibleUnits - -local GL_MODELVIEW = GL.MODELVIEW -local GL_PROJECTION = GL.PROJECTION -local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT - -local glUnit = gl.Unit -local glCopyToTexture = gl.CopyToTexture -local glRenderToTexture = gl.RenderToTexture -local glCallList = gl.CallList - -local glUseShader = gl.UseShader -local glUniform = gl.Uniform -local glUniformInt = gl.UniformInt - -local glClear = gl.Clear -local glTexRect = gl.TexRect -local glColor = gl.Color -local glTexture = gl.Texture - -local glResetMatrices = gl.ResetMatrices -local glMatrixMode = gl.MatrixMode -local glPushMatrix = gl.PushMatrix -local glLoadIdentity = gl.LoadIdentity -local glPopMatrix = gl.PopMatrix - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - vsx, vsy = widgetHandler:GetViewSizes() - - depthShader = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - uniform vec2 screenXY; - - void main(void) - { - vec2 texCoord = vec2( gl_FragCoord.x/screenXY.x , gl_FragCoord.y/screenXY.y ); - float depth = texture2D(tex0, texCoord ).z; - - if (depth <= gl_FragCoord.z) { - discard; - } - gl_FragColor = gl_Color; - } - ]], - uniformInt = { - tex0 = 0, - }, - uniform = { - screenXY = {vsx,vsy}, - }, - }) - - blurShader_h = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - uniform int screenX; - - const vec2 kernel = vec2(0.6,0.7); - - void main(void) { - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int i; - int n = 1; - float pixelsize = 1.0/float(screenX); - for(i = 1; i < 3; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); - --n; - } - - gl_FragColor += texture2D(tex0, texCoord ); - - n = 0; - for(i = -2; i < 0; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); - ++n; - } - } - ]], - uniformInt = { - tex0 = 0, - screenX = vsx, - }, - }) - - - blurShader_v = gl.CreateShader({ - fragment = [[ uniform sampler2D tex0; - uniform int screenY; - - const vec2 kernel = vec2(0.6,0.7); - - void main(void) { - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int i; - int n = 1; - float pixelsize = 1.0/float(screenY); - for(i = 0; i < 2; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); - --n; - } - - gl_FragColor += texture2D(tex0, texCoord ); - - n = 0; - for(i = -2; i < 0; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); - ++n; - } - } - ]], - uniformInt = { - tex0 = 0, - screenY = vsy, - }, - }) - - if (depthShader == nil) then - Spring.Echo("Halo widget: depthcheck shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - if (blurShader_h == nil) then - Spring.Echo("Halo widget: hblur shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - if (blurShader_v == nil) then - Spring.Echo("Halo widget: vblur shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - - uniformScreenXY = gl.GetUniformLocation(depthShader, 'screenXY') - uniformScreenX = gl.GetUniformLocation(blurShader_h, 'screenX') - uniformScreenY = gl.GetUniformLocation(blurShader_v, 'screenY') - - self:ViewResize(widgetHandler:GetViewSizes()) - - enter2d = gl.CreateList(function() - glUseShader(0) - glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity() - glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity() - end) - leave2d = gl.CreateList(function() - glMatrixMode(GL_PROJECTION); glPopMatrix() - glMatrixMode(GL_MODELVIEW); glPopMatrix() - glTexture(false) - glUseShader(0) - end) -end - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY - - gl.DeleteTexture(depthtex or 0) - gl.DeleteTextureFBO(offscreentex or 0) - gl.DeleteTextureFBO(blurtex or 0) - - depthtex = gl.CreateTexture(vsx,vsy, { - border = false, - format = GL_DEPTH_COMPONENT24, - min_filter = GL.NEAREST, - mag_filter = GL.NEAREST, - }) - - offscreentex = gl.CreateTexture(vsx,vsy, { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - fboDepth = true, - }) - - blurtex = gl.CreateTexture(vsx,vsy, { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - resChanged = true -end - - -function widget:Shutdown() - gl.DeleteTexture(depthtex) - if (gl.DeleteTextureFBO) then - gl.DeleteTextureFBO(offscreentex) - gl.DeleteTextureFBO(blurtex) - end - - if (gl.DeleteShader) then - gl.DeleteShader(depthShader or 0) - gl.DeleteShader(blurShader_h or 0) - gl.DeleteShader(blurShader_v or 0) - end - - gl.DeleteList(enter2d) - gl.DeleteList(leave2d) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function DrawVisibleUnits() - local visibleUnits = GetVisibleUnits(ALL_UNITS,nil,true) - for i=1,#visibleUnits do - glUnit(visibleUnits[i],true) - end -end - -local MyDrawVisibleUnits = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glPushMatrix() - glResetMatrices() - glColor(0,0,0,0.4) - DrawVisibleUnits() - glColor(1,1,1,1) - glPopMatrix() -end - -local blur_h = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glUseShader(blurShader_h) - glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) -end - -local blur_v = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glUseShader(blurShader_v) - glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) -end - -function widget:DrawWorldPreUnit() - glCopyToTexture(depthtex, 0, 0, 0, 0, vsx, vsy) - glTexture(depthtex) - - if (resChanged) then - resChanged = false - if (vsx==1) or (vsy==1) then return end - glUseShader(depthShader) - glUniform(uniformScreenXY, vsx,vsy ) - glUseShader(blurShader_h) - glUniformInt(uniformScreenX, vsx ) - glUseShader(blurShader_v) - glUniformInt(uniformScreenY, vsy ) - end - - glUseShader(depthShader) - glRenderToTexture(offscreentex,MyDrawVisibleUnits) - - glTexture(offscreentex) - glRenderToTexture(blurtex, blur_h) - glTexture(blurtex) - glRenderToTexture(offscreentex, blur_v) - - glCallList(enter2d) - glTexture(offscreentex) - glTexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - glCallList(leave2d) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_outline_shader.lua b/LuaUI/Widgets_Evo/gfx_outline_shader.lua new file mode 100644 index 000000000..b382ddb70 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_outline_shader.lua @@ -0,0 +1,415 @@ +local wiName = "Outline (deferred)" +function widget:GetInfo() + return { + name = wiName, + desc = "Displays small outline around units based on deferred g-buffer", + author = "ivand", + date = "2019", + license = "GNU GPL, v2 or later", + layer = math.huge, + enabled = true -- loaded by default? + } +end + +----------------------------------------------------------------- +-- Accel +----------------------------------------------------------------- +local glMatrixMode = gl.MatrixMode +local glPushMatrix = gl.PushMatrix +local glLoadIdentity = gl.LoadIdentity +local glPopMatrix = gl.PopMatrix +local glDepthTest = gl.DepthTest +local glDepthMask = gl.DepthMask +local glBlending = gl.Blending +local glBlendFunc = gl.BlendFunc +local glTexture = gl.Texture +local glActiveFBO = gl.ActiveFBO +local glCallList = gl.CallList + +local GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA = GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA +local GL_MODELVIEW, GL_PROJECTION = GL.MODELVIEW, GL.PROJECTION + +----------------------------------------------------------------- +-- Constants +----------------------------------------------------------------- + +local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 + +----------------------------------------------------------------- +-- Configuration Constants +----------------------------------------------------------------- + +local MIN_FPS = 15 +local MIN_FPS_DELTA = 10 +local AVG_FPS_ELASTICITY = 0.15 +local AVG_FPS_ELASTICITY_INV = 1.0 - AVG_FPS_ELASTICITY + +local BLUR_HALF_KERNEL_SIZE = 4 -- (BLUR_HALF_KERNEL_SIZE + BLUR_HALF_KERNEL_SIZE + 1) samples are used to perform the blur. +local BLUR_PASSES = 1 -- number of blur passes +local BLUR_SIGMA = 3 -- Gaussian sigma of a single blur pass, other factors like BLUR_HALF_KERNEL_SIZE, BLUR_PASSES and DOWNSAMPLE affect the end result gaussian shape too + +local OUTLINE_COLOR = {0.0, 0.0, 0.0, 1.0} +local OUTLINE_STRENGTH = 2.0 -- make it much smaller for softer edges + +local USE_MATERIAL_INDICES = true -- for future material indices based SSAO evaluation + + +----------------------------------------------------------------- +-- File path Constants +----------------------------------------------------------------- + +local shadersDir = "LuaUI/Widgets_Evo/Shaders/" +local luaShaderDir = "LuaUI/Widgets_Evo/Include/" + +----------------------------------------------------------------- +-- Global Variables +----------------------------------------------------------------- + +local LuaShader = VFS.Include(luaShaderDir.."LuaShader.lua") + +local vsx, vsy, vpx, vpy + +local screenQuadList +local screenWideList + + +local shapeTex +local blurTexes = {} + +local shapeFBO +local blurFBOs = {} + +local shapeShader +local gaussianBlurShader +local applicationShader + +local show = true + +----------------------------------------------------------------- +-- Local Functions +----------------------------------------------------------------- + +local function G(x, sigma) + return ( 1 / ( math.sqrt(2 * math.pi) * sigma ) ) * math.exp( -(x * x) / (2 * sigma * sigma) ) +end + +local function GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, valMult) + local weights = {} + local offsets = {} + + weights[1] = G(0, sigma) + local sum = weights[1] + + for i = 1, kernelHalfSize - 1 do + weights[i + 1] = G(i, sigma) + sum = sum + 2.0 * weights[i + 1] + end + + for i = 0, kernelHalfSize - 1 do --normalize so the weights sum up to valMult + weights[i + 1] = weights[i + 1] / sum * valMult + offsets[i + 1] = i + end + return weights, offsets +end + +--see http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ +local function GetGaussLinearWeightsOffsets(sigma, kernelHalfSize, valMult) + local dWeights, dOffsets = GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, 1.0) + + local weights = {dWeights[1]} + local offsets = {dOffsets[1]} + + for i = 1, (kernelHalfSize - 1) / 2 do + local newWeight = dWeights[2 * i] + dWeights[2 * i + 1] + weights[i + 1] = newWeight * valMult + offsets[i + 1] = (dOffsets[2 * i] * dWeights[2 * i] + dOffsets[2 * i + 1] * dWeights[2 * i + 1]) / newWeight + end + return weights, offsets +end + +----------------------------------------------------------------- +-- Widget Functions +----------------------------------------------------------------- + +function widget:ViewResize() + widget:Shutdown() + widget:Initialize() +end + +function widget:Initialize() + local canContinue = LuaShader.isDeferredShadingEnabled and LuaShader.GetAdvShadingActive() + if not canContinue then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, "Deferred shading is not enabled or advanced shading is not active")) + end + + local configName = "AllowDrawModelPostDeferredEvents" + if Spring.GetConfigInt(configName, 0) == 0 then + Spring.Echo(string.format("Warning in [%s] widget: %s", wiName, "AllowDrawModelPostDeferredEvents is not enabled, enabling it now")) + Spring.SetConfigInt(configName, 1) --required to enable receiving DrawUnitsPostDeferred/DrawFeaturesPostDeferred + end + + vsx, vsy, vpx, vpy = Spring.GetViewGeometry() + + local commonTexOpts = { + target = GL_TEXTURE_2D, + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.LINEAR, + + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, + } + + shapeTex = gl.CreateTexture(vsx, vsy, commonTexOpts) + + for i = 1, 2 do + blurTexes[i] = gl.CreateTexture(vsx, vsy, commonTexOpts) + end + + + + shapeFBO = gl.CreateFBO({ + color0 = shapeTex, + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + }) + + if not gl.IsValidFBO(shapeFBO) then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, "Invalid shapeFBO")) + end + + for i = 1, 2 do + blurFBOs[i] = gl.CreateFBO({ + color0 = blurTexes[i], + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + }) + if not gl.IsValidFBO(blurFBOs[i]) then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, string.format("Invalid blurFBOs[%d]", i))) + end + end + + + local identityShaderVert = VFS.LoadFile(shadersDir.."identity.vert.glsl") + + local shapeShaderFrag = VFS.LoadFile(shadersDir.."outlineShape.frag.glsl") + + shapeShaderFrag = shapeShaderFrag:gsub("###USE_MATERIAL_INDICES###", tostring((USE_MATERIAL_INDICES and 1) or 0)) + + shapeShader = LuaShader({ + vertex = identityShaderVert, + fragment = shapeShaderFrag, + uniformInt = { + -- be consistent with gfx_deferred_rendering.lua + -- glTexture(1, "$model_gbuffer_zvaltex") + modelDepthTex = 1, + modelMiscTex = 2, + mapDepthTex = 3, + }, + uniformFloat = { + outlineColor = OUTLINE_COLOR, + }, + }, wiName..": Shape drawing") + shapeShader:Initialize() + + local gaussianBlurFrag = VFS.LoadFile(shadersDir.."gaussianBlur.frag.glsl") + + gaussianBlurFrag = gaussianBlurFrag:gsub("###BLUR_HALF_KERNEL_SIZE###", tostring(BLUR_HALF_KERNEL_SIZE)) + + gaussianBlurShader = LuaShader({ + vertex = identityShaderVert, + fragment = gaussianBlurFrag, + uniformInt = { + tex = 0, + }, + uniformFloat = { + viewPortSize = {vsx, vsy}, + }, + }, wiName..": Gaussian Blur") + gaussianBlurShader:Initialize() + + local gaussWeights, gaussOffsets = GetGaussLinearWeightsOffsets(BLUR_SIGMA, BLUR_HALF_KERNEL_SIZE, OUTLINE_STRENGTH) + + gaussianBlurShader:ActivateWith( function() + gaussianBlurShader:SetUniformFloatArrayAlways("weights", gaussWeights) + gaussianBlurShader:SetUniformFloatArrayAlways("offsets", gaussOffsets) + end) + + local applicationFrag = VFS.LoadFile(shadersDir.."outlineApplication.frag.glsl") + + applicationShader = LuaShader({ + vertex = identityShaderVert, + fragment = applicationFrag, + uniformInt = { + tex = 0, + modelDepthTex = 1, + }, + uniformFloat = { + viewPortSize = {vsx, vsy}, + }, + }, wiName..": Outline Application") + applicationShader:Initialize() + + screenQuadList = gl.CreateList(gl.TexRect, -1, -1, 1, 1) + screenWideList = gl.CreateList(gl.TexRect, -1, -1, 1, 1, false, true) +end + +function widget:Shutdown() + if screenQuadList then + gl.DeleteList(screenQuadList) + end + + if screenWideList then + gl.DeleteList(screenWideList) + end + + gl.DeleteTexture(shapeTex) + + for i = 1, 2 do + gl.DeleteTexture(blurTexes[i]) + end + + gl.DeleteFBO(shapeFBO) + for i = 1, 2 do + gl.DeleteFBO(blurFBOs[i]) + end + + shapeShader:Finalize() + gaussianBlurShader:Finalize() + applicationShader:Finalize() +end + +local function PrepareOutline() + glDepthTest(false) + glDepthMask(false) + + glActiveFBO(shapeFBO, function() + shapeShader:ActivateWith( function () + glTexture(1, "$model_gbuffer_zvaltex") + if USE_MATERIAL_INDICES then + glTexture(2, "$model_gbuffer_misctex") + end + glTexture(3, "$map_gbuffer_zvaltex") + + glCallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + + --glTexture(1, false) --will reuse later + if USE_MATERIAL_INDICES then + glTexture(2, false) + end + glTexture(3, false) + end) + end) + + glTexture(0, shapeTex) + + for i = 1, BLUR_PASSES do + gaussianBlurShader:ActivateWith( function () + + gaussianBlurShader:SetUniform("dir", 1.0, 0.0) --horizontal blur + glActiveFBO(blurFBOs[1], function() + glCallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + end) + glTexture(0, blurTexes[1]) + + gaussianBlurShader:SetUniform("dir", 0.0, 1.0) --vertical blur + glActiveFBO(blurFBOs[2], function() + glCallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + end) + glTexture(0, blurTexes[2]) + + end) + end + + glTexture(0, false) + glTexture(1, false) +end + +local function DrawOutline(strength, dupd) + glBlending(true) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) --alpha NO pre-multiply + + if dupd then + glDepthTest(false) + glDepthMask(false) + end + + glTexture(0, blurTexes[2]) + glTexture(1, "$model_gbuffer_zvaltex") + + applicationShader:ActivateWith( function () + applicationShader:SetUniformFloat("strength", strength or 1.0) + glCallList(screenWideList) + end) + + if dupd then + glBlending(false) + glDepthTest(true) + glDepthMask(true) + end + + glTexture(0, false) + glTexture(1, false) +end + + +local accuTime = 0 +local lastTime = 0 +local averageFPS = MIN_FPS + MIN_FPS_DELTA + +function widget:Update(dt) + accuTime = accuTime + dt + if accuTime >= lastTime + 1 then + lastTime = accuTime + averageFPS = AVG_FPS_ELASTICITY_INV * averageFPS + AVG_FPS_ELASTICITY * Spring.GetFPS() + if averageFPS < MIN_FPS then + show = false + elseif averageFPS > MIN_FPS + MIN_FPS_DELTA then + show = true + end + end +end + +local function EnterLeaveScreenSpace(functionName, ...) + glMatrixMode(GL_MODELVIEW) + glPushMatrix() + glLoadIdentity() + + glMatrixMode(GL_PROJECTION) + glPushMatrix() + glLoadIdentity(); + + functionName(...) + + glMatrixMode(GL_PROJECTION) + glPopMatrix() + + glMatrixMode(GL_MODELVIEW) + glPopMatrix() +end + +function widget:DrawUnitsPostDeferred() + if not show then + return + end + EnterLeaveScreenSpace( function() + PrepareOutline() + DrawOutline(1.0, true) + end) + widgetHandler:RemoveCallIn("DrawWorldPreUnit") +end + +function widget:DrawWorldPreUnit() + if not show then + return + end + EnterLeaveScreenSpace( function() + PrepareOutline() + DrawOutline(1.0, false) + end) +end + +function widget:DrawWorld() + if not show then + return + end + EnterLeaveScreenSpace(DrawOutline, 0.25, false) +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gfx_rain.lua b/LuaUI/Widgets_Evo/gfx_rain.lua new file mode 100644 index 000000000..fd34ba2b7 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_rain.lua @@ -0,0 +1,562 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: precipitation.lua +-- brief: precipitation shader gadget +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "GFX Rain", + desc = "Precipitation shader widget", + author = "trepan, Argh, The_Yak", + date = "August 27, 2009, Aug 2, 2013", + license = "GNU GPL, v2 or later", + layer = -24, + enabled = true -- loaded by default? + } +end + +local timeCyclesWeatherEffects = Spring.GetConfigInt("evo_timecyclesweathereffects", 0) +if timeCyclesWeatherEffects ~= 1 then + return false +end + +------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +b = 1 +local particleType = 1 -- 1 for rain, 2 for snow, 3 for clouds (when they finally work) +local particleDensity = 0 -- how many particles? Limit for performance! +f = 0 +nbPlayers = 0 +X = Game.mapSizeX +Z = Game.mapSizeZ +r = 1 +aparticleDensity = 1 +function GameStart() +r = 1 +roster = Spring.GetPlayerRoster(2) +nbPlayers = 0 +for i,isSpec in pairs(roster) do +if isSpec[5] == false then +nbPlayers = nbPlayers + 1 +end +end +end + +function widget:UnitDamaged(_,_,_,da) + +if da >= 1500 then +da = 1500 +end +b = b + da +--Spring.Echo(particleDensity) +end + +--Rain Color Control +local function ColorFunc() + local rainColorR = 0.2*((15000-particleDensity)/15000) + local rainColorG = math.random(2,5)/10*((15000-particleDensity)/15000) + local rainColorB = 0.5*((15000-particleDensity)/15000) + local rainAlpha = (1*(particleDensity/15000))^(1/4) + -- Spring.Echo(rainColorR) + -- Spring.Echo(rainColorG) + -- Spring.Echo(rainColorB) + -- Spring.Echo(rainAlpha) + return rainColorR,rainColorG,rainColorB,rainAlpha +end + +--particleOne +local particleOneGravity = 50 -- how fast does it fall? +local particleOneDriftX = -20 -- how fast does it move on the X axis? Can be positive or negative. +local particleOneDriftZ = -20 -- how fast does it move on the Z axis? Can be positive or negative. +local particleOneTexture = 'LuaUI/Widgets/snowflake1.tga' -- what bitmap are we using? +local particleOneScale = 4000 -- scale, see GLSL for details + +local particleTwoGravity = 40 -- how fast does it fall? +local particleTwoDriftX = -40 -- how fast does it move on the X axis? Can be positive or negative. +local particleTwoDriftZ = 20 -- how fast does it move on the Z axis? Can be positive or negative. +local particleTwoTexture = 'LuaUI/Widgets/snowflake2.tga' -- what bitmap are we using? +local particleTwoScale = 3000 -- scale, see GLSL for details + +local particleThreeGravity = 60 -- how fast does it fall? +local particleThreeDriftX = -60 -- how fast does it move on the X axis? Can be positive or negative. +local particleThreeDriftZ = 20 -- how fast does it move on the Z axis? Can be positive or negative. +local particleThreeTexture = 'LuaUI/Widgets/snowflake3.tga' -- what bitmap are we using? +local particleThreeScale = 2500 -- scale, see GLSL for details + +local math_random = math.random +local math_randomseed = math.randomseed + +local shader +local rainshader +local shaderTimeLoc +local shaderCamPosLoc +local shaderScaleLoc +local shaderSpeedLoc + +local startTimer = Spring.GetTimer() +local diffTime = 0 + +local rainparticleOneList +local rainparticleTwoList +local rainparticleThreeList + +local firstPos = 0 +local secondPos = 0 +local thirdPos = 0 +local camX,camY,camZ + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +--OpenGL stuff. + local glBeginEnd = gl.BeginEnd + local glVertex = gl.Vertex + local glColor = gl.Color + local glBlending = gl.Blending + local glTranslate = gl.Translate + local glCallList = gl.CallList + local glDepthTest = gl.DepthTest + local glCreateList = gl.CreateList + local glDeleteList = gl.DeleteList + local glTexture = gl.Texture + local glGetShaderLog = gl.GetShaderLog + local glCreateShader = gl.CreateShader + local glDeleteShader = gl.DeleteShader + local glUseShader = gl.UseShader + local glUniformMatrix = gl.UniformMatrix + local glUniformInt = gl.UniformInt + local glUniform = gl.Uniform + local glGetUniformLocation = gl.GetUniformLocation + local glGetActiveUniforms = gl.GetActiveUniforms + local glBeginEnd = gl.BeginEnd + local glPointSprite = gl.PointSprite + local glPointSize = gl.PointSize + local glPointParameter = gl.PointParameter + local glResetState = gl.ResetState + local GL_POINTS = GL.POINTS + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function widget:Shutdown() + --glDeleteList(particleOneSubList) + glDeleteList(particleOneList) +end + +local function CreateParticleOneList() + particleOneList = gl.CreateList(function() + local tmpRand = math.random() + math.randomseed(1) + gl.BeginEnd(GL.POINTS, function() + for i = 1, aparticleDensity do + local x = math.random() + local y = math.random() + local z = math.random() + local w = math.random() + gl.Vertex(x, y, z, w) + end + end) + math.random(1e9 * tmpRand) + end) +end + +local function CreateParticleTwoList() + particleTwoList = gl.CreateList(function() + local tmpRand = math.random() + math.randomseed(2) + gl.BeginEnd(GL.POINTS, function() + for i = 1, aparticleDensity do + local x = math.random() + local y = math.random() + local z = math.random() + local w = math.random() + gl.Vertex(x, y, z, w) + end + end) + math.random(1e9 * tmpRand) + end) +end + +local function CreateParticleThreeList() + particleThreeList = gl.CreateList(function() + local tmpRand = math.random() + math.randomseed(3) + gl.BeginEnd(GL.POINTS, function() + for i = 1, aparticleDensity do + local x = math.random() + local y = math.random() + local z = math.random() + local w = math.random() + gl.Vertex(x, y, z, w) + end + end) + math.random(1e9 * tmpRand) + end) +end + +local function CreateCloudList() + cloudOneList = gl.CreateList(function() + + gl.BeginEnd(GL.POINTS, function() +glVertex(-30,0,40) +glVertex(-40,30,-20) +glVertex(-40,-20,0) +glVertex(-30,-40,30) +glVertex(-30,10,-20) +glVertex(-20,0,-20) +glVertex(-10,-20,-30) +glVertex(-20,50,50) +glVertex(-20,40,0) +glVertex(-20,-30,40) +glVertex(-30,-50,10) +glVertex(30,10,30) +glVertex(30,-30,10) +glVertex(20,-10,40) +glVertex(20,-50,30) +glVertex(30,50,-10) +glVertex(20,20,-20) +glVertex(20,-20,10) +glVertex(0,70,-50) +glVertex(0,-40,30) +glVertex(0,-10,10) +glVertex(0,-20,-20) +glVertex(0,-60,50) +glVertex(0,-40,0) +glVertex(0,-30,80) +glVertex(0,20,0) +glVertex(0,40,60) +glVertex(0,-20,30) + end) + end) +end + + +local function CreateRainDrops() + rainparticleOneList = glCreateList(function() + local tmpRand = math_random() + math_randomseed(6) + glBeginEnd(GL.LINES, function() + for i = 1, particleDensity do + local x = math_random(-3000,3000) + local y = math_random(-5000,10000) + local z = math_random(-3000,3000) + glColor(ColorFunc()) + glVertex(x,y,z) + glVertex(x,y- math_random(20,40),z) + end + end) + math_random(1e9 * tmpRand) + end) + + rainparticleTwoList = glCreateList(function() + local tmpRand = math_random() + math_randomseed(6) + glBeginEnd(GL.LINES, function() + for i = 1, particleDensity do + local x = math_random(-3000,3000) + local y = math_random(-5000,20000) + local z = math_random(-3000,3000) + glColor(ColorFunc()) + glVertex(x,y,z) + glVertex(x,y- math_random(20,40),z) + end + end) + math_random(1e9 * tmpRand) + end) + + rainparticleThreeList = glCreateList(function() + local tmpRand = math_random() + math_randomseed(6) + glBeginEnd(GL.LINES, function() + for i = 1, particleDensity do + local x = math_random(-3000,3000) + local y = math_random(-5000,30000) + local z = math_random(-3000,3000) + glColor(ColorFunc()) + glVertex(x,y,z) + glVertex(x,y- math_random(20,40),z) + end + end) + math_random(1e9 * tmpRand) + end) + + if (rainparticleOneList == nil) then + return false + end + return true +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Update(dt) +t = t + dt + +r = r + 2000*dt + f = f +1 + -- Spring.Echo(f) +if r >= b then +r = b +end +K = (X*Z/3500)*nbPlayers +-- Spring.Echo(rfx) +p = 1-(math.exp(-r/K)) +particleDensity = 15000*(1-gl.GetAtmosphere("fogStart")) +-- Spring.Echo(aparticleDensity) +aparticleDensity = 15000*(p) +if particleDensity >= 15000 then +particleDensity = 15000 +end + +if aparticleDensity >= 15000 then +aparticleDensity = 15000 +end + b = b * 0.9995^(dt*30) + -- Spring.Echo(dt*30) + +if f%150 == 0 then + if (Spring.GetMapOptions().alt == "0") then + widgetHandler:RemoveWidget() + return + end + if (glCreateShader == nil) then + Spring.Echo("[Weather Particles:Initialize] no shader support") + widgetHandler:RemoveWidget() + return + end +CreateRainDrops() + -- CreateParticleOneList() + -- CreateParticleTwoList() + -- CreateParticleThreeList() + + -- Spring.Echo("Finished Snow / Rain Shader") + end +end + +function widget:Initialize() +t = 0 +f = 0 +rfx = 0 +roster = Spring.GetPlayerRoster(2) +nbPlayers = 0 +for i,isSpec in pairs(roster) do +if isSpec[5] == false then +nbPlayers = nbPlayers + 1 +end +end + + if (Spring.GetMapOptions().alt == "0") then + widgetHandler:RemoveWidget() + return + end + if (glCreateShader == nil) then + Spring.Echo("[Weather Particles:Initialize] no shader support") + widgetHandler:RemoveWidget() + return + end + + shader = glCreateShader({ + + vertex = [[ + uniform float time; + uniform float scale; + uniform vec3 speed; + uniform vec3 camPos; + void main(void) + { + vec3 scalePos = vec3(gl_Vertex) * scale; + + gl_FrontColor = vec4(0.8,0.8,0.9,0.0 + 0.8 * cos(scalePos.y)); + + vec3 pos = scalePos - mod(camPos, scale); + pos.y -= time * 0.5 * (speed.x * (2.0 + gl_Vertex.w)); + pos.x += (sin(time)*10.0) + (time * speed.y); + pos.z += (cos(time)*10.0) + (time * speed.z); + pos = mod(pos, scale) - (scale * 0.5) + camPos; + if (pos.y < 0.0) { + gl_FrontColor *= 1.0 + 2.0 * (pos.y / scale); + pos.y = 0.0; + } + vec4 eyePos = gl_ModelViewMatrix * vec4(pos, 1.0); + + gl_PointSize = (1.0 + gl_Vertex.w) * 5000.0 / length(eyePos); + + gl_Position = gl_ProjectionMatrix * eyePos; + } + ]], + uniform = { + time = diffTime, + scale = 0, + speed = {0,0,0}, + camPos = {0,0,0}, + }, + }) + +rainshader = glCreateShader({ + vertex = [[ + void main(void) + { + gl_FrontColor = gl_Color; + gl_Position = ftransform(); + } + ]], + }) + +cloudshader = glCreateShader({ + vertex = [[ + uniform vec3 camPos; + void main(void) + { + + //float myLength = distance(gl_Vertex.xyz, camPos.xyz); + //gl_PointSize = 100.0 / myLength / 1000; + gl_Position = ftransform(); + + } + ]], + uniform = { + camPos = {0,0,0}, + }, + }) + + if (shader == nil) then + Spring.Echo("[Weather Particles:Initialize] particle shader compilation failed") + Spring.Echo(glGetShaderLog()) + widgetHandler:RemoveWidget() + return + end + + if (rainshader == nil) then + Spring.Echo("[Weather Particles:Initialize] rain shader compilation failed") + Spring.Echo(glGetShaderLog()) + widgetHandler:RemoveWidget() + return + end + + if (cloudshader == nil) then + Spring.Echo("[Weather Particles:Initialize] cloud shader compilation failed") + Spring.Echo(glGetShaderLog()) + widgetHandler:RemoveWidget() + return + end + + shaderTimeLoc = glGetUniformLocation(shader, 'time') + shaderCamPosLoc = glGetUniformLocation(shader, 'camPos') + + shaderScaleLoc = glGetUniformLocation(shader, 'scale') + shaderSpeedLoc = glGetUniformLocation(shader, 'speed') + + cloudShaderCamPosLoc = glGetUniformLocation(cloudshader, 'camPos') + + CreateParticleOneList() + CreateParticleTwoList() + CreateParticleThreeList() + CreateCloudList() + CreateRainDrops() + + Spring.Echo("Finished Snow / Rain Shader") + +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function widget:DrawWorld() + + + if particleType == 1 then + camX,camY,camZ = Spring.GetCameraPosition() + glDepthTest(GL.LEQUAL) + glBlending(GL.SRC_ALPHA, GL.ONE) + gl.DepthMask(false) + glUseShader(rainshader) + + firstPos = firstPos - particleOneGravity + if firstPos <= camY-10000 then + firstPos = camY + 100 + end + + gl.Translate(camX,firstPos,camZ) + glCallList(rainparticleOneList) + + secondPos = secondPos - particleTwoGravity + if secondPos <= camY-20000 then + secondPos = camY + 300 + end + gl.Translate(camX,secondPos,camZ) + glCallList(rainparticleTwoList) + + + thirdPos = thirdPos - particleThreeGravity + if thirdPos <= camY-30000 then + thirdPos = camY + 500 + end + gl.Translate(camX,thirdPos,camZ) + glCallList(rainparticleThreeList) + + glUseShader(shader) + camX,camY,camZ = Spring.GetCameraPosition() + diffTime = Spring.DiffTimers(Spring.GetTimer(), startTimer) + --Spring.Echo(diffTime,camX,camY,camZ) + glUniform(shaderTimeLoc,diffTime * 1) + glUniform(shaderCamPosLoc, camX, camY, camZ) + + glDepthTest(true) + glBlending(GL.SRC_ALPHA, GL.ONE) + + gl.PointSprite(true, true) + gl.PointSize(10.0) + gl.PointParameter(0, 0, 0.001, 0, 1e9, 1) + + glTexture(particleOneTexture) + glUniform(shaderScaleLoc, particleOneScale) + glUniform(shaderSpeedLoc, particleOneGravity,particleOneDriftX, particleOneDriftZ) + glCallList(particleOneList) + + + glTexture(particleTwoTexture) + glUniform(shaderScaleLoc, particleTwoScale) + glUniform(shaderSpeedLoc, particleTwoGravity, particleTwoDriftX, particleTwoDriftZ) + glCallList(particleTwoList) + + glTexture(particleThreeTexture) + glUniform(shaderScaleLoc, particleThreeScale) + glUniform(shaderSpeedLoc, particleThreeGravity, particleThreeDriftX, particleThreeDriftZ) + glCallList(particleThreeList) + end + + + + if particleType == 3 then + glColor(1.0,1.0,1.0,1.0) + glUseShader(cloudshader) + camX,camY,camZ = Spring.GetCameraPosition() + glUniform(cloudShaderCamPosLoc, camX, camY, camZ) + diffTime = Spring.DiffTimers(Spring.GetTimer(), startTimer) + + --glUniform(shaderTimeLoc,diffTime * 1) + glDepthTest(true) + --glTexture(cloudTextureThree) + glBlending(GL.SRC_ALPHA, GL.ONE) + + gl.PointSprite(true, true) + gl.PointSize(1) + gl.PointParameter(0, 0, 0, 0, 1, 1) + gl.Translate(500,1500,500) + glCallList(cloudOneList) + end + + gl.PointParameter(1, 0, 0, 0, 1e9, 1) + gl.PointSize(1.0) + gl.PointSprite(false, false) + glResetState() + glUseShader(0) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gfx_settings_high.lua b/LuaUI/Widgets_Evo/gfx_settings_high.lua deleted file mode 100644 index a413958d7..000000000 --- a/LuaUI/Widgets_Evo/gfx_settings_high.lua +++ /dev/null @@ -1,34 +0,0 @@ -function widget:GetInfo() - return { - name = "Graphics Settings (4 - High)", - desc = "Sets graphics settings for you to predefined settings", - author = "Forboding Angel", - date = "01-21-2014", - license = "GPL v2 or later", - layer = 5, - enabled = false - } -end - -function widget:Initialize() - Spring.SendCommands("3dtrees 1") - Spring.SendCommands("advmapshading 1") - Spring.SendCommands("advsky 0") - Spring.SendCommands("advmodelshading 1") - Spring.SendCommands("dynamicsky 0") - Spring.SendCommands("dynamicsun 1") - Spring.SendCommands("dynamicsunminelevation 0.3") - Spring.SendCommands("fsaalevel 2") - Spring.SendCommands("featuredrawdistance 999999") - Spring.SendCommands("featurefadedistance 999999") - Spring.SendCommands("grassdetail 0") - Spring.SendCommands("grounddetail 60") - Spring.SendCommands("maxnanoparticles 2000") - Spring.SendCommands("maxparticles 5000") - Spring.SendCommands("maxsounds 128") - Spring.SendCommands("water 4") - Spring.SendCommands("shadows 2 8192") - - widgetHandler:RemoveWidget() -end - diff --git a/LuaUI/Widgets_Evo/gfx_settings_low.lua b/LuaUI/Widgets_Evo/gfx_settings_low.lua deleted file mode 100644 index accace24c..000000000 --- a/LuaUI/Widgets_Evo/gfx_settings_low.lua +++ /dev/null @@ -1,34 +0,0 @@ -function widget:GetInfo() - return { - name = "Graphics Settings (2 - Low)", - desc = "Sets graphics settings for you to predefined settings", - author = "Forboding Angel", - date = "01-21-2014", - license = "GPL v2 or later", - layer = 5, - enabled = false - } -end - -function widget:Initialize() - Spring.SendCommands("3dtrees 0") - Spring.SendCommands("advmapshading 0") - Spring.SendCommands("advsky 0") - Spring.SendCommands("advmodelshading 1") - Spring.SendCommands("dynamicsky 0") - Spring.SendCommands("dynamicsun 0") - Spring.SendCommands("dynamicsunminelevation 0.3") - Spring.SendCommands("fsaalevel 0") - Spring.SendCommands("featuredrawdistance 1000") - Spring.SendCommands("featurefadedistance 1500") - Spring.SendCommands("grassdetail 0") - Spring.SendCommands("grounddetail 32") - Spring.SendCommands("maxnanoparticles 1000") - Spring.SendCommands("maxparticles 2500") - Spring.SendCommands("maxsounds 64") - Spring.SendCommands("water 4") - Spring.SendCommands("shadows 0") - - widgetHandler:RemoveWidget() -end - diff --git a/LuaUI/Widgets_Evo/gfx_settings_medium.lua b/LuaUI/Widgets_Evo/gfx_settings_medium.lua deleted file mode 100644 index 4b4d06446..000000000 --- a/LuaUI/Widgets_Evo/gfx_settings_medium.lua +++ /dev/null @@ -1,34 +0,0 @@ -function widget:GetInfo() - return { - name = "Graphics Settings (3 - Medium)", - desc = "Sets graphics settings for you to predefined settings", - author = "Forboding Angel", - date = "01-21-2014", - license = "GPL v2 or later", - layer = 5, - enabled = false - } -end - -function widget:Initialize() - Spring.SendCommands("3dtrees 1") - Spring.SendCommands("advmapshading 1") - Spring.SendCommands("advsky 0") - Spring.SendCommands("advmodelshading 1") - Spring.SendCommands("dynamicsky 0") - Spring.SendCommands("dynamicsun 0") - Spring.SendCommands("dynamicsunminelevation 0.3") - Spring.SendCommands("fsaalevel 0") - Spring.SendCommands("featuredrawdistance 999999") - Spring.SendCommands("featurefadedistance 999999") - Spring.SendCommands("grassdetail 0") - Spring.SendCommands("grounddetail 32") - Spring.SendCommands("maxnanoparticles 2000") - Spring.SendCommands("maxparticles 5000") - Spring.SendCommands("maxsounds 128") - Spring.SendCommands("water 4") - Spring.SendCommands("shadows 2 2048") - - widgetHandler:RemoveWidget() -end - diff --git a/LuaUI/Widgets_Evo/gfx_settings_ultra_low.lua b/LuaUI/Widgets_Evo/gfx_settings_ultra_low.lua deleted file mode 100644 index 1e3081b2a..000000000 --- a/LuaUI/Widgets_Evo/gfx_settings_ultra_low.lua +++ /dev/null @@ -1,34 +0,0 @@ -function widget:GetInfo() - return { - name = "Graphics Settings (1 - Ultra Low)", - desc = "Sets graphics settings for you to predefined settings", - author = "Forboding Angel", - date = "01-21-2014", - license = "GPL v2 or later", - layer = 5, - enabled = false - } -end - -function widget:Initialize() - Spring.SendCommands("3dtrees 0") - Spring.SendCommands("advmapshading 0") - Spring.SendCommands("advsky 0") - Spring.SendCommands("advmodelshading 0") - Spring.SendCommands("dynamicsky 0") - Spring.SendCommands("dynamicsun 0") - Spring.SendCommands("dynamicsunminelevation 0.3") - Spring.SendCommands("fsaalevel 0") - Spring.SendCommands("featuredrawdistance 1000") - Spring.SendCommands("featurefadedistance 1500") - Spring.SendCommands("grassdetail 0") - Spring.SendCommands("grounddetail 32") - Spring.SendCommands("maxnanoparticles 500") - Spring.SendCommands("maxparticles 2000") - Spring.SendCommands("maxsounds 64") - Spring.SendCommands("water 0") - Spring.SendCommands("shadows 0") - - widgetHandler:RemoveWidget() -end - diff --git a/LuaUI/Widgets_Evo/gfx_snow.lua b/LuaUI/Widgets_Evo/gfx_snow.lua new file mode 100644 index 000000000..3da632f17 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_snow.lua @@ -0,0 +1,606 @@ + +function widget:GetInfo() + return { + name = "Snow", + desc = "Lets it automaticly snow on snow maps! - also togglable with /snow (remembers per map)", + author = "Floris (original: trepan, Argh)", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = -24, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- /snow -- toggles snow on current map (also remembers this) + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local minFps = 22 -- stops snowing at +local maxFps = 55 -- max particles at +local particleSteps = 14 -- max steps in diminishing number of particles (dont use too much steps, creates extra dlist for each step) +local particleMultiplier = 0.005 -- amount of particles +local customParticleMultiplier = 1 +local windMultiplier = 4.5 +local maxWindSpeed = 25 -- to keep it real +local gameFrameCountdown = 120 -- on launch: wait this many frames before adjusting the average fps calc +local particleScaleMultiplier = 1 + +-- pregame info message +local autoReduce = true +local fadetime = 13 +local fadetimeThreshold = 30 +local textStartOpacity = 0.6 + +local fpsDifference = (maxFps-minFps)/particleSteps -- fps difference need before changing the dlist to one with fewer particles + +local snowTexFolder = "LuaUI/Images/snow/" + +local snowKeywords = {'snow','frozen','cold','winter','ice','icy','arctic','frost','melt','glacier','mosh_pit','blindside','northernmountains','amarante','cervino'} + +local snowMaps = {} + +-- disable for maps that have a keyword but are not snowmaps +snowMaps['sacrifice_v1'] = false + +-- disable for maps already containing a snow widget +snowMaps['xenolithic_v4'] = false +snowMaps['thecoldplace'] = false + + +local particleTypes = {} +table.insert(particleTypes, { + texture = 'snow1.dds', + gravity = 50, + scale = 5500 +}) +table.insert(particleTypes, { + texture = 'snow2.dds', + gravity = 44, + scale = 5500 +}) +table.insert(particleTypes, { + texture = 'snow3.dds', + gravity = 58, + scale = 5500 +}) +table.insert(particleTypes, { + texture = 'snow4.dds', + gravity = 62, + scale = 6600 +}) +table.insert(particleTypes, { + texture = 'snow5.dds', + gravity = 47, + scale = 6600 +}) +table.insert(particleTypes, { + texture = 'snow6.dds', + gravity = 54, + scale = 6600 +}) + +local avgFpsInit = false + +local math_random = math.random +local math_randomseed = math.randomseed + +local shader +local shaderTimeLoc +local shaderCamPosLoc +local shaderScaleLoc +local shaderSpeedLoc + +local startTimer = Spring.GetTimer() +local diffTime = 0 + +local spGetFPS = Spring.GetFPS +local averageFps = 60 +local spGetVisibleUnits = Spring.GetVisibleUnits +local spGetVisibleFeatures = Spring.GetVisibleFeatures + +local firstPos = 0 +local secondPos = 0 +local thirdPos = 0 +local camX,camY,camZ +local vsx, vsy = gl.GetViewSizes() +local particleScale = 1 +local startTime = os.clock() + +local offsetX = 0 +local offsetZ = 0 +local prevOsClock = os.clock() +local gameStarted = false + +local enabled = false +local previousFps = (maxFps + minFps) / 1.75 +local particleStep = math.floor(particleSteps / 1.33) +if particleStep < 1 then particleStep = 1 end +local currentMapname = Game.mapName:lower() +local particleLists = {} +local particleDensityMax = 0 +local particleDensity = 0 +local previousParticleAmount = particleDensity + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local spGetWind = Spring.GetWind +local spGetGameFrame = Spring.GetGameFrame + +local glBeginEnd = gl.BeginEnd +local glVertex = gl.Vertex +local glColor = gl.Color +local glBlending = gl.Blending +local glTranslate = gl.Translate +local glCallList = gl.CallList +local glDepthTest = gl.DepthTest +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glTexture = gl.Texture +local glGetShaderLog = gl.GetShaderLog +local glCreateShader = gl.CreateShader +local glDeleteShader = gl.DeleteShader +local glUseShader = gl.UseShader +local glUniformMatrix = gl.UniformMatrix +local glUniformInt = gl.UniformInt +local glUniform = gl.Uniform +local glGetUniformLocation = gl.GetUniformLocation +local glGetActiveUniforms = gl.GetActiveUniforms +local glBeginEnd = gl.BeginEnd +local glPointSprite = gl.PointSprite +local glPointSize = gl.PointSize +local glPointParameter = gl.PointParameter +local glResetState = gl.ResetState +local GL_POINTS = GL.POINTS + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +local windDirX, _, windDirZ, _ = spGetWind() +local startOsClock = os.clock() + + +function widget:Shutdown() + removeSnow() + WG['snow'] = nil +end + +function removeSnow() + removeParticleLists() + if shader ~= nil then + glDeleteShader(shader) + end +end + +function removeParticleLists() + if particleLists[1] ~= nil then + for layer=1, 3 do + for step=1, particleSteps do + glDeleteList(particleLists[layer][step]) + end + end + particleLists = {} + end +end + +-- creating multiple lists per particleType so we can switch to less particles without causing lag +local function CreateParticleLists() + removeParticleLists() + particleDensityMax = math.floor(((vsx * vsy) * (particleMultiplier*customParticleMultiplier)) / #particleTypes) + particleDensity = particleDensityMax * ((averageFps-minFps) / maxFps) + for particleType, pt in pairs(particleTypes) do + particleLists[particleType] = {} + for step=1, particleSteps do + --local density = (particleDensityMax/particleSteps) * step + local particles = math.floor(((particleDensityMax/particleSteps) * step) / (((particleSteps+(particleSteps/2)) - step) / (particleSteps/2))) + particleLists[particleType][step] = gl.CreateList(function() + local tmpRand = math.random() + math.randomseed(particleType) + gl.BeginEnd(GL.POINTS, function() + for i = 1, particles do + local x = math.random() + local y = math.random() + local z = math.random() + local w = math.random() + local w = 1 + gl.Vertex(x, y, z, w) + end + end) + math.random(1e9 * tmpRand) + end) + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function init() + + -- abort if not enabled + if enabled == false then return end + + if (glCreateShader == nil) then + Spring.Echo("[Snow widget:Initialize] no shader support") + widgetHandler:RemoveWidget(self) + return + end + + shader = glCreateShader({ + vertex = [[ + #version 150 compatibility + uniform float time; + uniform float scale; + uniform vec3 speed; + uniform vec3 camPos; + void main(void) + { + vec3 scalePos = vec3(gl_Vertex) * scale; + + gl_FrontColor = vec4(0.8,0.8,0.9,0.66 * cos(scalePos.y)); + + vec3 pos = scalePos - mod(camPos, scale); + pos.y -= time * 0.5 * (speed.x * (2.0 + gl_Vertex.w)); + + pos.x += (sin(time*1.5)*3) + speed.y; + pos.z += (cos(time*1.5)*3) + speed.z; + + if (pos.x >= 1) { + pos.x -= 1; + } + if (pos.x < 0) { + pos.x += 1; + } + if (pos.z >= 1) { + pos.z -= 1; + } + if (pos.z < 0) { + pos.z += 1; + } + pos = mod(pos, scale) - (scale * 0.5) + camPos; + + vec4 eyePos = gl_ModelViewMatrix * vec4(pos, 1.0); + + gl_PointSize = (1.0 + gl_Vertex.w) * 5000.0 / length(eyePos); + + gl_Position = gl_ProjectionMatrix * eyePos; + } + ]], + uniform = { + time = diffTime, + scale = 0, + speed = {0,0,0}, + camPos = {0,0,0}, + }, + }) + + if (shader == nil) then + Spring.Echo("[Snow widget:Initialize] particle shader compilation failed") + Spring.Echo(glGetShaderLog()) + widgetHandler:RemoveWidget(self) + return + end + + shaderTimeLoc = glGetUniformLocation(shader, 'time') + shaderCamPosLoc = glGetUniformLocation(shader, 'camPos') + + shaderScaleLoc = glGetUniformLocation(shader, 'scale') + shaderSpeedLoc = glGetUniformLocation(shader, 'speed') + + if particleLists[1] == nil then + CreateParticleLists() + end +end + + +function getWindSpeed() + windDirX, _, windDirZ, _ = spGetWind() + + -- cap windspeed while preserving direction + if windDirX > maxWindSpeed and windDirX > windDirZ then + windDirZ = (windDirZ / windDirX) * maxWindSpeed + windDirX = maxWindSpeed + elseif windDirZ > maxWindSpeed and windDirZ > windDirX then + windDirX = (windDirX / windDirZ) * maxWindSpeed + windDirZ = maxWindSpeed + end +end + +function widget:Initialize() + + WG['snow'] = {} + WG['snow'].getSnowMap = function() + if enabled or widgetDisabledSnow then + return true + else + return false + end + end + WG['snow'].setMultiplier = function(value) + customParticleMultiplier = value + if enabled or widgetDisabledSnow then + CreateParticleLists() + end + end + WG['snow'].setAutoReduce = function(value) + autoReduce = value + if autoReduce == false then + enabled = true + particleStep = particleSteps + widgetDisabledSnow = false + else + avgFpsInit = true + averageFps = spGetFPS() + end + end + WG['snow'].setSnowMap = function(value) + snowMaps[currentMapname] = value + enabled = value + if value then + init() + else + removeSnow() + end + end + + if spGetGameFrame() > 0 then + gameStarted = true + end + + drawinfolist = gl.CreateList( function() + local text = "Snowing less when FPS gets lower \n" + local text2 = "/snow to toggle snow... for this map \n".."disable 'Snow' widget... for all maps " + local fontSize = 30 + --local textWidth = font:GetTextWidth(text)*fontSize + local textHeight = font:GetTextHeight(text)*fontSize + --gl.Text(text, -textWidth/2, -textHeight/2, fontSize, "") + font:Begin() + font:Print(text, 0, textHeight/2, fontSize, "c") + font:Print(text2, 0, -textHeight/1.6, fontSize*0.8, "c") + font:End() + end) + + startOsClock = os.clock() + -- check for keywords + local keywordFound = false + for _,keyword in pairs(snowKeywords) do + if string.find(currentMapname, keyword) then + enabled = true + keywordFound = true + break + end + end + -- check for remembered snow state + if snowMaps[currentMapname] ~= nil then + if snowMaps[currentMapname] == true then + enabled = true + elseif snowMaps[currentMapname] == false then + enabled = false + end + end + -- save enabled snow state + if enabled and keywordFound then + snowMaps[currentMapname] = true + end + + getWindSpeed() + init() +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local widgetDisabledSnow = false +function widget:GameFrame(gameFrame) + if gameFrame == 1 then + gameStarted = true + if drawinfolist ~= nil then + gl.DeleteList(drawinfolist) + end + end + + if not enabled and not widgetDisabledSnow then return end + + if gameFrameCountdown <= 0 then + if gameFrame%31==0 then + getWindSpeed() + end + if gameFrame%44==0 then + averageFps = ((averageFps * 19) + spGetFPS()) / 20 + if averageFps < 1 then averageFps = 1 end + --Spring.Echo(particleStep.." avg fps: "..averageFps) + end + if gameFrame%88==0 and autoReduce then + if averageFps >= previousFps+fpsDifference or averageFps <= previousFps-fpsDifference then + local particleAmount = (averageFps-minFps) / (maxFps-minFps) + if particleAmount > 1 then + particleAmount = 1 + end + if previousParticleAmount ~= particleAmount then + previousParticleAmount = particleAmount + previousFps = averageFps + if particleAmount <= 1/particleSteps then + enabled = false + widgetDisabledSnow = true + else + particleDensity = math.floor(particleDensityMax * particleAmount) + if particleDensity > particleDensityMax then particleDensity = particleDensityMax end + particleStep = math.floor(particleDensity / (particleDensityMax / particleSteps)) + if particleStep < 1 then particeStep = 1 end + enabled = true + widgetDisabledSnow = false + end + end + end + end + else + gameFrameCountdown = gameFrameCountdown - 1 + end +end + +function widget:Shutdown() + enabled = false + if drawinfolist ~= nil then + gl.DeleteList(drawinfolist) + end + gl.DeleteFont(font) +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not enabled or not autoReduce then return end + + if not gameStarted and snowMaps[currentMapname] ~= nil and snowMaps[currentMapname] then + if not avgFpsInit then + avgFpsInit = true + averageFps = spGetFPS() + end + local now = os.clock() + local opacityMultiplier = (((startTime+fadetimeThreshold) - now) / fadetime) + if opacityMultiplier > 1 then opacityMultiplier = 1 end + + if opacityMultiplier > 0 then + gl.PushMatrix() + gl.Translate(vsx/2, vsy/1.5, 0) + gl.Scale(widgetScale,widgetScale,0) + gl.Color(1,1,1,textStartOpacity*opacityMultiplier) + gl.CallList(drawinfolist) + gl.PopMatrix() + end + end +end + +local pausedTime = 0 +local lastFrametime = Spring.GetTimer() +function widget:DrawWorld() + if not enabled then return end + + local _, _, isPaused = Spring.GetGameSpeed() + if isPaused then + pausedTime = pausedTime + Spring.DiffTimers(Spring.GetTimer(), lastFrametime) + end + lastFrametime = Spring.GetTimer() + if os.clock() - startOsClock > 0.5 then -- delay to prevent no textures being shown + if shader ~= nil and particleLists[#particleTypes] ~= nil and particleLists[#particleTypes][particleStep] ~= nil then + glUseShader(shader) + camX,camY,camZ = Spring.GetCameraPosition() + diffTime = Spring.DiffTimers(lastFrametime, startTimer) - pausedTime + + glUniform(shaderTimeLoc,diffTime * 1) + glUniform(shaderCamPosLoc, camX, camY, camZ) + + glDepthTest(true) + glBlending(GL.SRC_ALPHA, GL.ONE) + + gl.PointSprite(true, true) + gl.PointSize(10.0) + gl.PointParameter(0, 0, 0.001, 0, 1e9, 1) + + local osClock = os.clock() + local timePassed = osClock - prevOsClock + prevOsClock = osClock + + if not isPaused then + offsetX = offsetX + ((windDirX * windMultiplier) * timePassed) + offsetZ = offsetZ + ((windDirZ * windMultiplier) * timePassed) + end + + for particleType, pt in pairs(particleTypes) do + glTexture(snowTexFolder..pt.texture) + glUniform(shaderScaleLoc, pt.scale*particleScale) + glUniform(shaderSpeedLoc, pt.gravity, offsetX, offsetZ) + glCallList(particleLists[particleType][particleStep]) + glTexture(false) + end + + gl.PointParameter(1, 0, 0, 0, 1e9, 1) + gl.PointSize(1.0) + gl.PointSprite(false, false) + glResetState() + glUseShader(0) + end + end +end + +function widget:ViewResize(newX,newY) + vsx, vsy = newX, newY + widgetScale = (0.55 + (vsx*vsy / 10000000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + if particleLists[#particleTypes] ~= nil then + CreateParticleLists() + gameFrameCountdown = 80 + --particleScale = (0.60 + (vsx*vsy / 8000000)) * particleScaleMultiplier + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetConfigData(data) + savedTable = {} + savedTable.snowMaps = snowMaps + savedTable.averageFps = math.floor(averageFps) + savedTable.particleStep = particleStep + savedTable.gameframe = Spring.GetGameFrame() + savedTable.customParticleMultiplier = customParticleMultiplier + savedTable.autoReduce = autoReduce + return savedTable +end + +function widget:SetConfigData(data) + if data.snowMaps ~= nil then snowMaps = data.snowMaps end + if data.customParticleMultiplier ~= nil then customParticleMultiplier = data.customParticleMultiplier end + if data.autoReduce ~= nil then autoReduce = data.autoReduce end + if data.gameframe ~= nil and data.gameframe > 0 then + if data.averageFps ~= nil then + averageFps = data.averageFps + avgFpsInit = true + end + if data.particleStep ~= nil and data.gameframe ~= nil and Spring.GetGameFrame() > 0 then + particleStep = data.particleStep + if particleStep < 1 then particleStep = 1 end + if particleStep > particleSteps then particleStep = particleSteps end + end + end +end + +function widget:TextCommand(command) + if (string.find(command, "snow") == 1 and string.len(command) == 4) then + if snowMaps[currentMapname] == nil or snowMaps[currentMapname] == false then + snowMaps[currentMapname] = true + enabled = true + Spring.Echo("Snow widget: snow enabled for this map. (Snow wont show when average fps is below "..minFps..".)") + init() + else + snowMaps[currentMapname] = false + enabled = false + Spring.Echo("Snow widget: snow disabled for this map.") + removeSnow() + end + end +end diff --git a/LuaUI/Widgets_Evo/gfx_ssao.lua b/LuaUI/Widgets_Evo/gfx_ssao.lua new file mode 100644 index 000000000..7616d7626 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_ssao.lua @@ -0,0 +1,548 @@ +local wiName = "SSAO" +function widget:GetInfo() + return { + name = wiName, + version = 2.0, + desc = "Screen-Space Ambient Occlusion", + author = "ivand", + date = "2019", + license = "GPL", + layer = math.huge, + enabled = true, --true + } +end + +----------------------------------------------------------------- +-- Constants +----------------------------------------------------------------- + +local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 +local GL_COLOR_ATTACHMENT1_EXT = 0x8CE1 +local GL_COLOR_ATTACHMENT2_EXT = 0x8CE2 + +local GL_RGB16F = 0x881B + +local GL_RGB8_SNORM = 0x8F96 + +local GL_RGBA8 = 0x8058 + +local GL_FUNC_ADD = 0x8006 +local GL_FUNC_REVERSE_SUBTRACT = 0x800B + +----------------------------------------------------------------- +-- Configuration Constants +----------------------------------------------------------------- + +local SSAO_KERNEL_SIZE = 24 -- how many samples are used for SSAO spatial sampling +local SSAO_RADIUS = 5 -- world space maximum sampling radius +local SSAO_MIN = 1.0 -- minimum depth difference between fragment and sample depths to trigger SSAO sample occlusion. Absolute value in world space coords. +local SSAO_MAX = 1.0 -- maximum depth difference between fragment and sample depths to trigger SSAO sample occlusion. Percentage of SSAO_RADIUS. +local SSAO_ALPHA_POW = 3.0 -- consider this as SSAO effect strength + +local BLUR_HALF_KERNEL_SIZE = 4 -- (BLUR_HALF_KERNEL_SIZE + BLUR_HALF_KERNEL_SIZE + 1) samples are used to perform the blur +local BLUR_PASSES = 3 -- number of blur passes +local BLUR_SIGMA = 1.8 -- Gaussian sigma of a single blur pass, other factors like BLUR_HALF_KERNEL_SIZE, BLUR_PASSES and DOWNSAMPLE affect the end result gaussian shape too + +local DOWNSAMPLE = 2 -- increasing downsapling will reduce GPU RAM occupation (a little bit), increase performace (a little bit), introduce occlusion blockiness + +local MERGE_MISC = false -- for future material indices based SSAO evaluation +local DEBUG_SSAO = false -- use for debug + + +----------------------------------------------------------------- +-- File path Constants +----------------------------------------------------------------- + +local shadersDir = "LuaUI/Widgets_Evo/Shaders/" +local luaShaderDir = "LuaUI/Widgets_Evo/Include/" + +----------------------------------------------------------------- +-- Global Variables +----------------------------------------------------------------- + +local LuaShader = VFS.Include(luaShaderDir.."LuaShader.lua") + +local vsx, vsy, vpx, vpy +local firstTime + +local screenQuadList +local screenWideList + +local gbuffFuseFBO +local ssaoFBO +local ssaoBlurFBOs = {} + +local gbuffFuseViewPosTex +local gbuffFuseViewNormalTex +local gbuffFuseMiscTex +local ssaoTex +local ssaoBlurTexes = {} + +local ssaoShader +local gbuffFuseShader +local gaussianBlurShader + +----------------------------------------------------------------- +-- Local Functions +----------------------------------------------------------------- + +local function G(x, sigma) + return ( 1 / ( math.sqrt(2 * math.pi) * sigma ) ) * math.exp( -(x * x) / (2 * sigma * sigma) ) +end + +local function GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, valMult) + local weights = {} + local offsets = {} + + weights[1] = G(0, sigma) + local sum = weights[1] + + for i = 1, kernelHalfSize - 1 do + weights[i + 1] = G(i, sigma) + sum = sum + 2.0 * weights[i + 1] + end + + for i = 0, kernelHalfSize - 1 do --normalize so the weights sum up to valMult + weights[i + 1] = weights[i + 1] / sum * valMult + offsets[i + 1] = i + end + return weights, offsets +end + +--see http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ +local function GetGaussLinearWeightsOffsets(sigma, kernelHalfSize, valMult) + local dWeights, dOffsets = GetGaussDiscreteWeightsOffsets(sigma, kernelHalfSize, 1.0) + + local weights = {dWeights[1]} + local offsets = {dOffsets[1]} + + for i = 1, (kernelHalfSize - 1) / 2 do + local newWeight = dWeights[2 * i] + dWeights[2 * i + 1] + weights[i + 1] = newWeight * valMult + offsets[i + 1] = (dOffsets[2 * i] * dWeights[2 * i] + dOffsets[2 * i + 1] * dWeights[2 * i + 1]) / newWeight + end + return weights, offsets +end + + +-- quick port of GLSL. +--[[ + for (int i = 0; i < SSAO_KERNEL_SIZE; i++) { + vec3 tmp = hash31( float(i) ); + tmp.xy = NORM2SNORM(tmp.xy); + tmp = normalize(tmp); + float scale = float(i)/float(SSAO_KERNEL_SIZE); + scale = clamp(scale * scale, 0.1, 1.0); + tmp *= scale; + samplingKernel[i] = tmp; + } +]]-- +-- I do so because of according GLSL spec gl_MaxVertexOutputComponents = 64; and gl_MaxFragmentUniformComponents = 1024; +-- so bigger SSAO kernel size can be supported if they are conveyed via uniforms vs varyings +local function GetSamplingVectorArray(kernelSize) + local result = {} + math.randomseed(kernelSize) -- for repeatability + for i = 0, kernelSize - 1 do + local x, y, z = math.random(), math.random(), math.random() -- [0, 1]^3 + + x, y = 2.0 * x - 1.0, 2.0 * y - 1.0 -- xy:[-1, 1]^2, z:[0, 1] + + local l = math.sqrt(x * x + y * y + z * z) --norm + x, y, z = x / l, y / l, z / l --normalize + + local scale = i / (kernelSize - 1) + scale = scale * scale -- shift most samples closer to the origin + scale = math.min(math.max(scale, 0.1), 1.0) --clamp + + x, y, z = x * scale, y * scale, z * scale -- scale + result[i] = {x = x, y = y, z = z} + end + return result +end + +----------------------------------------------------------------- +-- Widget Functions +----------------------------------------------------------------- + +function widget:ViewResize() + widget:Shutdown() + widget:Initialize() +end + +function widget:Initialize() + WG['ssao'] = {} + WG['ssao'].getStrength = function() + return SSAO_ALPHA_POW + end + WG['ssao'].setStrength = function(value) + SSAO_ALPHA_POW = value + widget:Shutdown() + widget:Initialize() + end + WG['ssao'].getRadius = function() + return SSAO_RADIUS + end + WG['ssao'].setRadius = function(value) + SSAO_RADIUS = value + widget:Shutdown() + widget:Initialize() + end + local canContinue = LuaShader.isDeferredShadingEnabled and LuaShader.GetAdvShadingActive() + if not canContinue then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, "Deferred shading is not enabled or advanced shading is not active")) + end + + firstTime = true + vsx, vsy, vpx, vpy = Spring.GetViewGeometry() + + local commonTexOpts = { + target = GL_TEXTURE_2D, + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + + wrap_s = GL.CLAMP_TO_EDGE, + wrap_t = GL.CLAMP_TO_EDGE, + } + + commonTexOpts.format = GL_RGB16F + gbuffFuseViewPosTex = gl.CreateTexture(vsx, vsy, commonTexOpts) + + commonTexOpts.format = GL_RGB8_SNORM + gbuffFuseViewNormalTex = gl.CreateTexture(vsx, vsy, commonTexOpts) + + if MERGE_MISC then + commonTexOpts.format = GL_RGBA8 + gbuffFuseMiscTex = gl.CreateTexture(vsx, vsy, commonTexOpts) + end + + commonTexOpts.min_filter = GL.LINEAR + commonTexOpts.mag_filter = GL.LINEAR + + commonTexOpts.format = GL_RGBA8 + ssaoTex = gl.CreateTexture(vsx / DOWNSAMPLE, vsy / DOWNSAMPLE, commonTexOpts) + + commonTexOpts.format = GL_RGBA8 + for i = 1, 2 do + ssaoBlurTexes[i] = gl.CreateTexture(vsx / DOWNSAMPLE, vsy / DOWNSAMPLE, commonTexOpts) + end + + if MERGE_MISC then + gbuffFuseFBO = gl.CreateFBO({ + color0 = gbuffFuseViewPosTex, + color1 = gbuffFuseViewNormalTex, + color2 = gbuffFuseMiscTex, + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT}, + }) + else + gbuffFuseFBO = gl.CreateFBO({ + color0 = gbuffFuseViewPosTex, + color1 = gbuffFuseViewNormalTex, + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT}, + }) + end + + if not gl.IsValidFBO(gbuffFuseFBO) then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, "Invalid gbuffFuseFBO")) + end + + ssaoFBO = gl.CreateFBO({ + color0 = ssaoTex, + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + }) + if not gl.IsValidFBO(ssaoFBO) then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, "Invalid ssaoFBO")) + end + + for i = 1, 2 do + ssaoBlurFBOs[i] = gl.CreateFBO({ + color0 = ssaoBlurTexes[i], + drawbuffers = {GL_COLOR_ATTACHMENT0_EXT}, + }) + if not gl.IsValidFBO(ssaoBlurFBOs[i]) then + Spring.Echo(string.format("Error in [%s] widget: %s", wiName, string.format("Invalid ssaoBlurFBOs[%d]", i))) + end + end + + + local gbuffFuseShaderVert = VFS.LoadFile(shadersDir.."identity.vert.glsl") + local gbuffFuseShaderFrag = VFS.LoadFile(shadersDir.."gbuffFuse.frag.glsl") + + gbuffFuseShaderFrag = gbuffFuseShaderFrag:gsub("###DEPTH_CLIP01###", tostring((Platform.glSupportClipSpaceControl and 1) or 0)) + gbuffFuseShaderFrag = gbuffFuseShaderFrag:gsub("###MERGE_MISC###", tostring((MERGE_MISC and 1) or 0)) + + gbuffFuseShader = LuaShader({ + vertex = gbuffFuseShaderVert, + fragment = gbuffFuseShaderFrag, + uniformInt = { + -- be consistent with gfx_deferred_rendering.lua + -- glTexture(0, "$model_gbuffer_normtex") + -- glTexture(1, "$model_gbuffer_zvaltex") + -- glTexture(2, "$map_gbuffer_normtex") + -- glTexture(3, "$map_gbuffer_zvaltex") + modelNormalTex = 0, + modelDepthTex = 1, + mapNormalTex = 2, + mapDepthTex = 3, + + modelMiscTex = 4, + mapMiscTex = 5, + }, + uniformFloat = { + viewPortSize = {vsx, vsy}, + }, + }, wiName..": G-buffer Fuse") + gbuffFuseShader:Initialize() + + + local ssaoShaderVert = VFS.LoadFile(shadersDir.."identity.vert.glsl") + local ssaoShaderFrag = VFS.LoadFile(shadersDir.."ssao.frag.glsl") + + ssaoShaderFrag = ssaoShaderFrag:gsub("###SSAO_KERNEL_SIZE###", tostring(SSAO_KERNEL_SIZE)) + + ssaoShaderFrag = ssaoShaderFrag:gsub("###SSAO_RADIUS###", tostring(SSAO_RADIUS)) + ssaoShaderFrag = ssaoShaderFrag:gsub("###SSAO_MIN###", tostring(SSAO_MIN)) + ssaoShaderFrag = ssaoShaderFrag:gsub("###SSAO_MAX###", tostring(SSAO_MAX)) + + ssaoShaderFrag = ssaoShaderFrag:gsub("###SSAO_ALPHA_POW###", tostring(SSAO_ALPHA_POW)) + + ssaoShader = LuaShader({ + vertex = ssaoShaderVert, + fragment = ssaoShaderFrag, + uniformInt = { + viewPosTex = 0, + viewNormalTex = 1, + }, + uniformFloat = { + viewPortSize = {vsx / DOWNSAMPLE, vsy / DOWNSAMPLE}, + }, + }, wiName..": Processing") + ssaoShader:Initialize() + + ssaoShader:ActivateWith( function() + local samplingKernel = GetSamplingVectorArray(SSAO_KERNEL_SIZE) + for i = 0, SSAO_KERNEL_SIZE - 1 do + local sv = samplingKernel[i] + ssaoShader:SetUniformFloatAlways(string.format("samplingKernel[%d]", i), sv.x, sv.y, sv.z) + end + end) + + + local gaussianBlurVert = VFS.LoadFile(shadersDir.."identity.vert.glsl") + local gaussianBlurFrag = VFS.LoadFile(shadersDir.."gaussianBlur.frag.glsl") + + gaussianBlurFrag = gaussianBlurFrag:gsub("###BLUR_HALF_KERNEL_SIZE###", tostring(BLUR_HALF_KERNEL_SIZE)) + + gaussianBlurShader = LuaShader({ + vertex = gaussianBlurVert, + fragment = gaussianBlurFrag, + uniformInt = { + tex = 0, + }, + uniformFloat = { + viewPortSize = {vsx / DOWNSAMPLE, vsy / DOWNSAMPLE}, + }, + }, wiName..": Gaussian Blur") + gaussianBlurShader:Initialize() + + local gaussWeights, gaussOffsets = GetGaussLinearWeightsOffsets(BLUR_SIGMA, BLUR_HALF_KERNEL_SIZE, 1.0) + + gaussianBlurShader:ActivateWith( function() + gaussianBlurShader:SetUniformFloatArrayAlways("weights", gaussWeights) + gaussianBlurShader:SetUniformFloatArrayAlways("offsets", gaussOffsets) + end) + + widget:SunChanged() +end + +function widget:SunChanged() + ssaoShader:ActivateWith( function() + local shadowDensity = gl.GetSun("shadowDensity", "unit") + ssaoShader:SetUniformFloatAlways("shadowDensity", shadowDensity) + end) +end + +function widget:Shutdown() + firstTime = nil + + if screenQuadList then + gl.DeleteList(screenQuadList) + end + + if screenWideList then + gl.DeleteList(screenWideList) + end + + + gl.DeleteTexture(ssaoTex) + gl.DeleteTexture(gbuffFuseViewPosTex) + gl.DeleteTexture(gbuffFuseViewNormalTex) + if MERGE_MISC then + gl.DeleteTexture(gbuffFuseMiscTex) + end + + for i = 1, 2 do + gl.DeleteTexture(ssaoBlurTexes[i]) + end + + gl.DeleteFBO(ssaoFBO) + gl.DeleteFBO(gbuffFuseFBO) + for i = 1, 2 do + gl.DeleteFBO(ssaoBlurFBOs[i]) + end + + ssaoShader:Finalize() + gbuffFuseShader:Finalize() + gaussianBlurShader:Finalize() +end + +local function DoDrawSSAO(isScreenSpace) + gl.DepthTest(false) + gl.DepthMask(false) + gl.Blending(false) + + + if firstTime then + screenQuadList = gl.CreateList(gl.TexRect, -1, -1, 1, 1) + if isScreenSpace then + screenWideList = gl.CreateList(gl.TexRect, 0, vsy, vsx, 0) + else + screenWideList = gl.CreateList(gl.TexRect, -1, -1, 1, 1, false, true) + end + firstTime = false + end + + gl.ActiveFBO(gbuffFuseFBO, function() + gbuffFuseShader:ActivateWith( function () + + gbuffFuseShader:SetUniformMatrix("invProjMatrix", "projectioninverse") + gbuffFuseShader:SetUniformMatrix("viewMatrix", "view") + + gl.Texture(0, "$model_gbuffer_normtex") + gl.Texture(1, "$model_gbuffer_zvaltex") + gl.Texture(2, "$map_gbuffer_normtex") + gl.Texture(3, "$map_gbuffer_zvaltex") + + if MERGE_MISC then + gl.Texture(4, "$model_gbuffer_misctex") + gl.Texture(5, "$map_gbuffer_misctex") + end + + + gl.CallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + --gl.TexRect(-1, -1, 1, 1) + + gl.Texture(0, false) + gl.Texture(1, false) + gl.Texture(2, false) + gl.Texture(3, false) + if MERGE_MISC then + gl.Texture(4, false) + gl.Texture(5, false) + end + end) + end) + + gl.ActiveFBO(ssaoFBO, function() + ssaoShader:ActivateWith( function () + ssaoShader:SetUniformMatrix("projMatrix", "projection") + + gl.Texture(0, gbuffFuseViewPosTex) + gl.Texture(1, gbuffFuseViewNormalTex) + gl.CallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + --gl.TexRect(-1, -1, 1, 1) + + gl.Texture(0, false) + gl.Texture(1, false) + end) + end) + + gl.Texture(0, ssaoTex) + + for i = 1, BLUR_PASSES do + gaussianBlurShader:ActivateWith( function () + + gaussianBlurShader:SetUniform("dir", 1.0, 0.0) --horizontal blur + gl.ActiveFBO(ssaoBlurFBOs[1], function() + gl.CallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + end) + gl.Texture(0, ssaoBlurTexes[1]) + + gaussianBlurShader:SetUniform("dir", 0.0, 1.0) --vertical blur + gl.ActiveFBO(ssaoBlurFBOs[2], function() + gl.CallList(screenQuadList) -- gl.TexRect(-1, -1, 1, 1) + end) + gl.Texture(0, ssaoBlurTexes[2]) + + end) + end + + + if DEBUG_SSAO then + gl.Blending(false) + else + gl.BlendEquation(GL_FUNC_REVERSE_SUBTRACT) + --gl.Blending("alpha") + gl.Blending(true) + gl.BlendFuncSeparate(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ZERO, GL.ONE) + --gl.BlendFunc(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) --alpha NO pre-multiply + --gl.BlendFunc(GL.ONE, GL.ONE_MINUS_SRC_ALPHA) --alpha pre-multiply + --gl.BlendFunc(GL.ZERO, GL.ONE) + end + + -- Already bound + --gl.Texture(0, ssaoBlurTexes[1]) + + gl.CallList(screenWideList) + + if not DEBUG_SSAO then + gl.BlendEquation(GL_FUNC_ADD) + end + + + + + gl.Texture(0, false) + gl.Texture(1, false) + gl.Texture(2, false) + gl.Texture(3, false) + + + gl.Blending("alpha") + --gl.DepthMask(true) + --gl.DepthTest(true) +end + +function widget:DrawWorld() + gl.MatrixMode(GL.MODELVIEW) + gl.PushMatrix() + gl.LoadIdentity() + + gl.MatrixMode(GL.PROJECTION) + gl.PushMatrix() + gl.LoadIdentity(); + + DoDrawSSAO(false) + + gl.MatrixMode(GL.PROJECTION) + gl.PopMatrix() + + gl.MatrixMode(GL.MODELVIEW) + gl.PopMatrix() +end + +function widget:GetConfigData(data) + savedTable = {} + savedTable.strength = SSAO_ALPHA_POW + savedTable.radius = SSAO_RADIUS + return savedTable +end + +function widget:SetConfigData(data) + if data.strength ~= nil then + SSAO_ALPHA_POW = data.strength + end + if data.strength ~= nil then + SSAO_RADIUS = data.radius + end +end diff --git a/LuaUI/Widgets_Evo/gfx_stereo3d.lua b/LuaUI/Widgets_Evo/gfx_stereo3d.lua deleted file mode 100644 index 58ee9de23..000000000 --- a/LuaUI/Widgets_Evo/gfx_stereo3d.lua +++ /dev/null @@ -1,668 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Stereo3D", - desc = "v0.12 Stereo 3D rendering.", - author = "CarRepairer, with assistance of jK", - date = "2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- todo: --- * add chroma depth: --- * http://www.chromatek.com/Image_Design/Color_Lookup_Functions/color_lookup_functions.shtml --- * http://eclecti.cc/computergraphics/cheap-3d-in-opengl-with-a-chromadepth-glsl-shader - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local spSendCommands = Spring.SendCommands -local spSetCameraOffset = Spring.SetCameraOffset -local spSetCameraState = Spring.SetCameraState -local spGetCameraState = Spring.GetCameraState -local spGetCameraPosition = Spring.GetCameraPosition -local spGetCameraDirection = Spring.GetCameraDirection -local spTraceScreenRay = Spring.TraceScreenRay -local spGetMouseState = Spring.GetMouseState -local abs = math.abs - -local glClear = gl.Clear -local glColorMask = gl.ColorMask -local glBlending = gl.Blending -local glLoadIdentity = glLoadIdentity -local glResetState = gl.ResetState -local glMatrixMode = gl.MatrixMode -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glLoadIdentity = gl.LoadIdentity -local glRect = gl.Rect -local glCopyToTexture = gl.CopyToTexture -local glActiveTexture = gl.ActiveTexture -local glTexture = gl.Texture -local glTexRect = gl.TexRect -local glUseShader = gl.UseShader -local glBeginEnd = gl.BeginEnd -local glLineWidth = gl.LineWidth -local glColor = gl.Color -local glVertex = gl.Vertex -local glDrawGroundCircle = gl.DrawGroundCircle - -local GL_ONE = GL.ONE -local GL_OR = GL.OR -local GL_DEPTH_BUFFER_BIT = GL.DEPTH_BUFFER_BIT -local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT -local GL_ACCUM_BUFFER_BIT = GL.ACCUM_BUFFER_BIT -local GL_PROJECTION = GL.PROJECTION -local GL_MODELVIEW = GL.MODELVIEW -local GL_LINES = GL.LINES - -local echo = Spring.Echo - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local sep = 5 -local conv = 0.003 -local mode = 'anaglyph' -local hideCursorKeyCombo = false - -local vsx = 1 -- current viewport width -local vsy = 1 -- current viewport height - -local mpos - -local lefttext -local righttext - -local left = true - -local nx, ny, nz=0,0,0 -local lx, ly, lz=0,0,0 - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local canShader = (gl.CreateShader ~= nil) -local stereoShader -local stereoShaderPara -local stereoShaderInt -local selected_stereoShader -local init = false - -local colorMatrixLeftLoc -local colorMatrixRightLoc - -local ColorMatrices = { - anaglyph = { - left = { - 1, 0, 0, - 0, 0, 0, - 0, 0, 0, - }, - right = { - 0, 0, 0, - 0, 1, 0, - 0, 0, 1, - } - }, - - anaglyphdubois = { - left = { - 0.456, -0.04, -0.015, - 0.5, -0.038, -0.021, - 0.176, -0.016, -0.005, - }, - right = { - -0.043, 0.378, -0.072, - -0.088, 0.734, -0.113, - -0.002,-0.018, 1.226 - } - }, - - anaglyphhalfcol = { - left = { - 0.299, 0, 0, - 0.587, 0, 0, - 0.114, 0, 0, - }, - right = { - 0, 0, 0, - 0, 1, 0, - 0, 0, 1, - } - }, - - anaglyphbw = { - left = { - 0.33, 0, 0, - 0.33, 0, 0, - 0.33, 0, 0, - }, - right = { - 0, 0.33, 0.33, - 0, 0.33, 0.33, - 0, 0.33, 0.33, - } - }, - - anaglyphblueyellow = { - --[[ - left = { - 1, 0, 0, - 0, 0.8, 0, - 0, 0, 0, - }, - right = { - 0, 0, 0, - 0, 0, 0.2, - 0, 0, 1, - } - --]] - left = { - 1, 0, 0, - 0, 1, 0, - 0, 0, 0, - }, - right = { - 0, 0, 0, - 0, 0, 0, - 0, 0, 1, - } - }, - - anaglyphbluered = { - left = { - 1, 0, 0, - 0, 0, 0, - 0, 0, 0, - }, - right = { - 0, 0, 0, - 0, 0, 0, - 0, 0, 1, - } - }, -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local possibleRenderer = { - { - key = 'anaglyph', - name = 'Anaglyph', - --desc = 'Normal game mode', - desc = 'Basic red/cyan anaglyph.' - }, - { - key = 'anaglyph2', - name = 'Anaglyph (No Shaders)', - desc = 'Use this mode if your video card is just not very good.' - }, - { - key = 'anaglyphbw', - name = 'Anaglyph - B&W', - desc = 'Red/cyan anaglyph with no color information - easy on the eyes.' - }, - { - key = 'anaglyphhalfcol', - name = 'Anaglyph - Half Color', - desc = 'Red/cyan anaglyph with less color information - easy on the eyes.' - }, - { - key = 'anaglyphdubois', - name = 'Anaglyph - Dubois', - desc = 'Red/cyan anaglyph with less color information - easy on the eyes.' - }, - { - key = 'anaglyphbluered', - name = 'Anaglyph - Blue/Red', - desc = 'Red/blue anaglyph.' - }, - { - key = 'anaglyphblueyellow', - name = 'Anaglyph - Blue/Yellow', - desc = 'Blue/yellow anaglyph.' - }, - { - key = 'interlaced', - name = 'Interlaced', - desc = 'Left and right images are interlaced.' - }, - { - key = 'parallel', - name = 'Parallel (unfinished)', - desc = 'Left and right images are side by side.' - }, -} - -if (not canShader) then - possibleRenderer = { - { - key = 'anaglyph2', - name = 'Anaglyph (No Shaders)', - desc = 'Your video card is not very good and this is the only mode you can do.' - }, - } -end - -local function UpdateConvSep() - local swap = options.swapeyes.value == true and -1 or 1 - - sep = options.sep.value * swap - conv = options.conv.value * swap -end - -options_path = 'Settings/Effects/Stereo3D' -options_order = { 'toggle3d', 'helpwindow', 'lblblank1', 'lblsettings', 'swapeyes', 'lasersight', 'hidecursor', 'sep', 'conv', 'lblblank2', 's3dmode', 'lblblank3', } -options = { - - toggle3d = { - name = 'Toggle Stereo 3D', - type = 'bool', - value = false, - desc = 'Turn Stereo3D vision on or off.' - }, - - helpwindow = { - name = 'Stereo3D Help', - type = 'text', - value = [[ - - Press alt+ctrl+shift to toggle the mouse cursor (doesn't work if gui is hidden). - - Use "Anaglyph (No Shader)" mode if you are having trouble with your video. - - Convergence setting only applies when there's a rotatable camera. - - Issues: - - Facing straight down will not show a 3D effect. - - Some widgets such as IceUI will interfere with "Anaglyph (No Shader)" mode. Turn them off or try other modes. - ]], - }, - - lblsettings = {name='Settings', type='label'}, - - swapeyes = { - name = 'Swap Eyes', - type = 'bool', - value = false, - OnChange = UpdateConvSep, - }, - lasersight = { - name = 'Laser Sight', - type = 'bool', - value = true, - desc = 'Enable Laser sight for cursor.' - }, - - hidecursor = { - name = 'Hide Cursor', - type = 'bool', - value = false, - }, - - sep = { - name = 'Separation', - type = 'number', - value = sep, - min=0,max=30,step=0.1, - desc = 'How far apart your eyes are.', - OnChange = UpdateConvSep, - }, - - conv = { - name = 'Convergence', - type = 'number', - value = conv, - min=0,max=0.05,step=0.001, - desc = 'How crosseyed you are.', - OnChange = UpdateConvSep, - }, - - - s3dmode = { - name = '3D Modes', - type = 'list', - items = possibleRenderer, - OnChange = function() - mode = options.s3dmode.value - widget:UpdateCallIns() - end, - value = 'anaglyph', - }, - - --[[ - viewta = { name = 'TA Cam', type = 'button', OnChange = function() spSendCommands{'viewta'} end, hotkey = {key=109, mod='ac'} }, - viewfree = { name = 'Free Cam', type = 'button', OnChange = function() spSendCommands{'viewfree'} end, }, - viewrot = { name = 'Rotatable Overhead', type = 'button', OnChange = function() spSendCommands{'viewrot'} end }, - --]] - - --[[ - camera = { - name = 'Camera Type', - type = 'list', - items = { - {name = 'Total Annihilation', key = 'viewta'}, - {name = 'Free', key = 'viewfree'}, - {name = 'Rotatable Overhead', key = 'viewrot'}, - {name = 'Total War', key = 'viewtw'}, - }, - value = 'viewta', - OnChange = function() - spSendCommands{options.camera.value} - end - }, - --]] - lblblank1 = {name='', type='label'}, - lblblank2 = {name='', type='label'}, - lblblank3 = {name='', type='label'}, - -} - ---options.toggle3d.value = true ---options.s3dmode.value = 'anaglyph' ---mode = options.s3dmode.value - - -function options.toggle3d:OnChange() - widget:UpdateCallIns() -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:SetConfigData(data) -end -function widget:GetConfigData() -end - -local function cross(x1,y1,z1,x2,y2,z2) - return y1*z2 - z1*y2, z1*x2 - x1*z2, x1*y2 - y1*x2 -end - -local function drawCursor(x1,y1,z1,x2,y2,z2) - glVertex( x1,y1,z1 ) - glVertex( x2,y2,z2 ) -end - -function widget:DrawScreen3D() - if options.lasersight.value and options.hidecursor.value and mpos then - Spring.SetMouseCursor("none") - end -end -function widget:DrawWorld3D() - if options.lasersight.value then - if mpos then - local px, py, pz = mpos[1], mpos[2], mpos[3] - glLineWidth(2) - glColor(1, 1, 1, 0.3) - glBeginEnd(GL_LINES, drawCursor, lx,ly,lz, px, py, pz) - glDrawGroundCircle(px, py, pz, 20, 32) - glLineWidth(1) - glColor(1,1,1,1) - end - end -end - -local function CopyEyeToTex() - if left then - local cs = spGetCameraState() - nx,ny,nz = cross(cs.dx, cs.dy, cs.dz, 0,1,0) - cs.px = cs.px + nx*sep - cs.py = cs.py + ny*sep - cs.pz = cs.pz + nz*sep - cs.ry = cs.ry and cs.ry + conv or conv - spSetCameraState(cs,0) - - gl.CopyToTexture(lefttext, 0, 0, 0, 0, vsx, vsy) - - local mx, my = spGetMouseState() - _, mpos = spTraceScreenRay(mx, my, true) - - if cs.name == 'ta' then - local cx,cy,cz = spGetCameraPosition() - lx = cx +20 - ly = cy -20 - lz = cz -20 - else - lx = cs.px - cs.dx*sep - ly = cs.py - cs.dy*sep - 20 - lz = cs.pz - cs.dz*sep - end - - else --if right - local cs = spGetCameraState() - cs.px = cs.px - nx*sep - cs.py = cs.py - ny*sep - cs.pz = cs.pz - nz*sep - cs.ry = cs.ry and cs.ry - conv or - conv - spSetCameraState(cs,0) - - gl.CopyToTexture(righttext, 0, 0, 0, 0, vsx, vsy) - end - - left = not left -end - -function widget:DrawScreenEffectsAnaglyphNoShader() - CopyEyeToTex() - glTexture(false) - gl.Blending(false) - glColor(1, 1, 1, 1) - - if (not left) then - gl.ColorMask(false,true,true,true) - glTexture(righttext) - glTexRect(0,vsy,vsx,0) - else - gl.ColorMask(true,false,false,true) - glTexture(lefttext) - glTexRect(0,vsy,vsx,0) - end - - glTexture(false) - glColor(1, 1, 1, 1) - gl.ColorMask(true,true,true,true) - gl.Blending(true) -end - -function widget:DrawScreenEffectsShader() - CopyEyeToTex() - glTexture(false) - gl.Blending(false) - - glUseShader(selected_stereoShader) - glTexture(0,lefttext); glTexture(0,false) - glTexture(1,righttext); glTexture(1,false) - glTexRect(0,vsy,vsx,0) - glUseShader(0) - - gl.Blending(true) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function ToggleStereo3D(_,_,words) - options.toggle3d.value = not options.toggle3d.value - widget:UpdateCallIns() -end - -function Mode(_,_,words) - mode = words[1] - widget:UpdateCallIns() -end - -function widget:Initialize() - if (canShader) then - stereoShader = gl.CreateShader({ - fragment = [[ - uniform mat3 colorleft; - uniform mat3 colorright; - - uniform sampler2D texLeft; - uniform sampler2D texRight; - void main(void) - { - gl_FragColor.rgb = colorleft * texture2D(texLeft, gl_TexCoord[0].xy).rgb; - gl_FragColor.rgb += colorright * texture2D(texRight, gl_TexCoord[0].xy).rgb; - gl_FragColor.a = 1.0; - } - ]], - uniformInt = { texLeft= 0, texRight= 1, } - }) - - if (not stereoShader) then - Spring.Echo("Stereo3D widget: shader0 error:" .. gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return; - end - - colorMatrixLeftLoc = gl.GetUniformLocation(stereoShader, "colorleft") - colorMatrixRightLoc = gl.GetUniformLocation(stereoShader, "colorright") - - stereoShaderPara = gl.CreateShader({ - fragment = [[ - uniform sampler2D texLeft; - uniform sampler2D texRight; - void main(void) - { - if(gl_TexCoord[0].x>0.5) { - gl_FragColor = texture2D(texLeft, gl_TexCoord[0].xy * vec2(2.0,1.0)); - } else { - gl_FragColor = texture2D(texRight, (gl_TexCoord[0].xy - vec2(0.5,0.0)) * vec2(2.0,1.0)); - } - } - ]], - uniformInt = { texLeft= 0, texRight= 1, } - }) - - if (not stereoShaderPara) then - Spring.Echo("Stereo3D widget: shader1 error:" .. gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return; - end - - stereoShaderInt = gl.CreateShader({ - fragment = [[ - uniform sampler2D texLeft; - uniform sampler2D texRight; - void main(void) - { - if(mod(floor(gl_FragCoord.y),2.0)>=1.0) { - gl_FragColor = texture2D(texLeft, gl_TexCoord[0].xy); - } else { - gl_FragColor = texture2D(texRight, gl_TexCoord[0].xy); - } - } - ]], - uniformInt = { texLeft= 0, texRight= 1, } - }) - - if (not stereoShaderInt) then - Spring.Echo("Stereo3D widget: shader2 error:" .. gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return; - end - end - - widget:ViewResize(widgetHandler:GetViewSizes()) - init = true - widget:UpdateCallIns() - - widgetHandler:AddAction("stereo3d_toggle3d", ToggleStereo3D, nil, "t") - widgetHandler:AddAction("stereo3d_mode", Mode, nil, "t") - -end - -function widget:Shutdown() - if (lefttext) then - gl.DeleteTexture(lefttext) - end - if (righttext) then - gl.DeleteTexture(righttext) - end - if (stereoShader) then - gl.DeleteShader(stereoShader) - end - if (stereoShaderParallel) then - gl.DeleteShader(stereoShaderParallel) - end -end - -function widget:UpdateCallIns() - if not init then return end --crash if called before init, due to stereoShader - --self:ViewResize(vsx, vsy) - - if not options.toggle3d.value then - self.DrawWorld = function() end - self.DrawScreen = function() end - self.DrawScreenEffects = function() end - return - end - self.DrawWorld = DrawWorld3D - self.DrawScreen = DrawScreen3D - - self.DrawScreenEffects = DrawScreenEffectsShader - if (mode == 'anaglyph2')or(not canShader) then - self.DrawScreenEffects = DrawScreenEffectsAnaglyphNoShader - elseif (mode == 'interlaced') then - selected_stereoShader = stereoShaderInt - elseif (mode == 'parallel') then - selected_stereoShader = stereoShaderPara - else - selected_stereoShader = stereoShader - gl.ActiveShader(stereoShader, function() - gl.UniformMatrix(colorMatrixLeftLoc, unpack(ColorMatrices[mode].left)) - gl.UniformMatrix(colorMatrixRightLoc,unpack(ColorMatrices[mode].right)) - end) - end - widgetHandler:UpdateCallIn("DrawScreenEffects") - widgetHandler:UpdateCallIn("DrawScreenEffects") --bug need to call it twice! - widgetHandler:UpdateCallIn("DrawWorld") - widgetHandler:UpdateCallIn("DrawWorld") - widgetHandler:UpdateCallIn("DrawScreen") - widgetHandler:UpdateCallIn("DrawScreen") -end - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY - - if (lefttext) then - gl.DeleteTexture(lefttext) - end - if (righttext) then - gl.DeleteTexture(righttext) - end - - lefttext = gl.CreateTexture(vsx, vsy, { - border = false, - min_filter = GL.NEAREST, mag_filter = GL.NEAREST, - }) - righttext = gl.CreateTexture(vsx, vsy, { - border = false, - min_filter = GL.NEAREST, mag_filter = GL.NEAREST, - }) -end - -function widget:Update() - local alt,ctrl,meta, shift = Spring.GetModKeyState() - if (ctrl and alt and shift) then - if not hideCursorKeyCombo then - hideCursorKeyCombo = true - options.hidecursor.value = not options.hidecursor.value - end - else - hideCursorKeyCombo = false - end -end diff --git a/LuaUI/Widgets_Evo/gfx_undercontruction.lua b/LuaUI/Widgets_Evo/gfx_undercontruction.lua new file mode 100644 index 000000000..773ccd3d6 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_undercontruction.lua @@ -0,0 +1,233 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_highlight_unit.lua +-- brief: highlights the unit/feature under the cursor +-- author: Dave Rodgers, modified by zwzsg +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Under construction gfx", + desc = "", + author = "Floris", + date = "May 2018", + license = "GPL", + layer = 50, + enabled = true + } +end + +local highlightAlpha = 0.4 +local useHighlightShader = true +local maxShaderUnits = 100 +local edgeExponent = 5 + +local spIsUnitIcon = Spring.IsUnitIcon +local spIsUnitInView = Spring.IsUnitInView +local spGetTeamColor = Spring.GetTeamColor +local spGetUnitTeam = Spring.GetUnitTeam +local myPlayerID = Spring.GetMyPlayerID() +local prevMyAllyTeamID = Spring.GetMyAllyTeamID() +local mySpec, prevMyFullView = Spring.GetSpectatingState() +local unitList = {} +local unitListCount = 0 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function CreateHighlightShader() + if shader then + gl.DeleteShader(shader) + end + shader = gl.CreateShader({ + + uniform = { + edgeExponent = edgeExponent/(0.8+highlightAlpha), + plainAlpha = highlightAlpha*0.8, + }, + + vertex = [[ + // Application to vertex shader + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + uniform mat4 camera; + uniform mat4 caminv; + + void main() + { + vec4 P = gl_ModelViewMatrix * gl_Vertex; + + eyeVec = P.xyz; + + normal = gl_NormalMatrix * gl_Normal; + + color = gl_Color.rgb; + + gl_Position = gl_ProjectionMatrix * P; + } + ]], + + fragment = [[ + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + + uniform float edgeExponent; + uniform float plainAlpha; + + void main() + { + float opac = dot(normalize(normal), normalize(eyeVec)); + opac = 1.0 - abs(opac); + opac = pow(opac, edgeExponent)*0.45; + + gl_FragColor.rgb = color + (opac*1.3); + gl_FragColor.a = plainAlpha + opac; + + } + ]], + }) +end +-------------------------------------------------------------------------------- + +function ResetUnderConstructionUnits() + local allUnits = Spring.GetAllUnits() + unitList = {} + unitListCount = 0 + for _, unitID in pairs(allUnits) do + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress=Spring.GetUnitHealth(unitID) + if buildProgress and buildProgress < 1 then + --local unitDefID = Spring.GetUnitDefID(unitID) + unitList[unitID] = spGetUnitTeam(unitID) + unitListCount = unitListCount + 1 + end + end +end + +function widget:Initialize() + WG['underconstructiongfx'] = {} + WG['underconstructiongfx'].getOpacity = function() + return highlightAlpha + end + WG['underconstructiongfx'].setOpacity = function(value) + highlightAlpha = value + CreateHighlightShader() + end + WG['underconstructiongfx'].getShader = function() + return useHighlightShader + end + WG['underconstructiongfx'].setShader = function(value) + useHighlightShader = value + CreateHighlightShader() + end + + if gl.CreateShader ~= nil then + CreateHighlightShader() + end + + ResetUnderConstructionUnits() +end + + +function widget:Shutdown() + if shader then + gl.DeleteShader(shader) + end + WG['underconstructiongfx'] = nil +end + + +function widget:UnitCreated(unitID, unitDefID, unitTeam) + unitList[unitID] = unitTeam + unitListCount = unitListCount + 1 +end + +function widget:UnitDestroyed(unitID, unitDefID, unitTeam) + if unitList[unitID] then + unitList[unitID] = nil + unitListCount = unitListCount - 1 + end +end + +function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + if unitList[unitID] then + unitList[unitID] = unitTeam + end +end + +function widget:UnitFinished(unitID, unitDefID, unitTeam) + if unitList[unitID] then + unitList[unitID] = nil + unitListCount = unitListCount - 1 + end +end + + +-------------------------------------------------------------------------------- + +function widget:DrawWorld() + --if Spring.IsGUIHidden() then return end + + if Spring.GetMyAllyTeamID() ~= prevMyAllyTeamID or select(2,Spring.GetSpectatingState()) ~= prevMyFullView then + prevMyAllyTeamID = Spring.GetMyAllyTeamID() + ResetUnderConstructionUnits() + end + + gl.DepthTest(true) + gl.PolygonOffset(-1, -1) + --gl.Blending(GL.SRC_ALPHA, GL.ONE) + + if useHighlightShader and shader and unitListCount < maxShaderUnits then + gl.UseShader(shader) + end + local teamID, prevTeamID, r,g,b + for unitID,teamID in pairs(unitList) do + if not spIsUnitIcon(unitID) and spIsUnitInView(unitID) then + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress=Spring.GetUnitHealth(unitID) + if maxHealth ~= nil then + if teamID ~= prevTeamID then + r,g,b = spGetTeamColor(teamID) + end + prevTeamID = teamID + gl.Color(r*0.8,g*0.8,b*0.8,highlightAlpha - (highlightAlpha*buildProgress)) + gl.Unit(unitID, true) + end + end + end + + if useHighlightShader and shader and unitListCount < maxShaderUnits then + gl.UseShader(0) + end + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.PolygonOffset(false) + gl.DepthTest(false) +end + + +widget.DrawWorldReflection = widget.DrawWorld + +widget.DrawWorldRefraction = widget.DrawWorld + + + +function widget:GetConfigData() + return {highlightAlpha=highlightAlpha, useHighlightShader=useHighlightShader} +end + +function widget:SetConfigData(data) + if data.useHighlightShader ~= nil then highlightAlpha = data.highlightAlpha end + if data.useHighlightShader ~= nil then useHighlightShader = data.useHighlightShader end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gfx_weather.lua b/LuaUI/Widgets_Evo/gfx_weather.lua new file mode 100644 index 000000000..729ec4b62 --- /dev/null +++ b/LuaUI/Widgets_Evo/gfx_weather.lua @@ -0,0 +1,228 @@ +function widget:GetInfo() + return { + name = "Weather", + desc = "Darkens map, with more red colors while the total damages dealt in game increase to give a warfare feeling", + author = "Doo", + date = "25 april 2015", + version = "133.7", + license = "GNU GPL, v2 or later", + layer = -4, + enabled = true, -- loaded by default? + } +end + +local timeCyclesWeatherEffects = Spring.GetConfigInt("evo_timecyclesweathereffects", 0) +if timeCyclesWeatherEffects ~= 1 then + return false +end + +lightningcolor = 0 + +function widget:Initialize() + spx,spy,spz = gl.GetSun() + r = 1 + b = 1 + f = 0 + t = 0 + diffuse = {} + ambient = {} + specular = {} + fogColor = {} + sunColor = {} + skyColor = {} + cloudColor = {} + + newdiffuse = {} + newambient = {} + newspecular = {} + newfogColor = {} + newsunColor = {} + newskyColor = {} + newcloudColor = {} + + X = Game.mapSizeX + Z = Game.mapSizeZ + shadowDensity = gl.GetSun("shadowDensity") + diffuse.r, diffuse.g, diffuse.b = gl.GetSun("diffuse") + ambient.r, ambient.g, ambient.b = gl.GetSun("ambient") + specular.r, specular.g, specular.b = gl.GetSun("specular") + + fogStart = gl.GetAtmosphere("fogStart") + fogEnd = gl.GetAtmosphere("fogEnd") + fogColor.r, fogColor.g, fogColor.b = gl.GetAtmosphere("fogColor") + + sunColor.r, sunColor.g, sunColor.b = gl.GetAtmosphere("sunColor") + skyColor.r, skyColor.g, skyColor.b = gl.GetAtmosphere("skyColor") + cloudColor.r, cloudColor.g, cloudColor.b = gl.GetAtmosphere("cloudColor") + + --water + -- waterBase = {} + -- waterAbsorb = {} + -- waterMin = {} + -- waterSurface = {} + -- waterSpecular = {} + -- waterPlane = {} + -- newwaterBase = {} + -- newwaterAbsorb = {} + -- newwaterMin = {} + -- newwaterSurface = {} + -- newwaterSpecular = {} + -- newwaterPlane = {} + + -- waterBase.r, waterBase.g, waterBase.b = Game.waterBaseColor[1], Game.waterBaseColor[2], Game.waterBaseColor[3] + -- waterAbsorb.r, waterAbsorb.g, waterAbsorb.b = Game.waterAbsorb[1], Game.waterAbsorb[2], Game.waterAbsorb[3] + -- waterMin.r, waterMin.g, waterMin.b = Game.waterMinColor[1], Game.waterMinColor[2], Game.waterMinColor[3] + -- waterSurface.r, waterSurface.g, waterSurface.b = Game.waterSurfaceColor[1], Game.waterSurfaceColor[2], Game.waterSurfaceColor[3] + -- waterSpecular.r, waterSpecular.g, waterSpecular.b = Game.waterSpecularColor[1], Game.waterSpecularColor[2], Game.waterSpecularColor[3] + -- waterPlane.r, waterPlane.g, waterPlane.b = Game.waterPlaneColor[1], Game.waterSpecularColor[2], Game.waterSpecularColor[3] + rain = 0 + roster = Spring.GetPlayerRoster(2) + nbPlayers = 0 + for i,isSpec in pairs(roster) do + if isSpec[5] == false then + nbPlayers = nbPlayers + 1 + end + end +end + +function widget:UnitDestroyed(unitID) + explosion = UnitDefs[Spring.GetUnitDefID(unitID)].deathExplosion + maxlightningcolor = (WeaponDefs[WeaponDefNames[explosion].id].damages[1]^0.001 * WeaponDefs[WeaponDefNames[explosion].id].damageAreaOfEffect)/160 + --Spring.Echo(maxlightningcolor) + lightning = false +end + +function GameStart() + spx,spy,spz = gl.GetSun() + r = 1 + roster = Spring.GetPlayerRoster(2) + nbPlayers = 0 + for i,isSpec in pairs(roster) do + if isSpec[5] == false then + nbPlayers = nbPlayers + 1 + end + end +end + +function widget:UnitDamaged(_,_,_,da) +-- if da >= 1500 then +-- da = 1500 +-- end +-- b = b + da +end +sunframe = 0 +function widget:Update(dt) + sunframe = sunframe + dt * 0.15 + lightningcolor = 0 + if n == nil or n == 150 then + n = 1 + lightning = false + end + + if lightning == true then + -- Spring.Echo(lightningcolor) + lightningcolor = (maxlightningcolor/n)/2 + if lightningcolor >= 1 then lightningcolor = 1 end + if lightningcolor <= 0.025 then lightningcolor = 0 end + n = n + 1 + end + -- Spring.Echo(b) + -- Spring.Echo(r) + -- Spring.Echo(p) + -- Spring.Echo(b) + -- Spring.Echo(r) + -- Spring.Echo(p) + r = r + 2000*dt + -- Spring.Echo(X) + -- Spring.Echo(Z) + -- Spring.Echo(X*Z/1000) + -- Spring.Echo(K) + K = (X*Z/3500)*nbPlayers + t = t + dt + if r>=b then + r = b + end + -- Spring.Echo(w) + b = b * 0.9995^(dt*30) + + f = f+1 + px,py,pz = gl.GetSun() + -- Spring.SetSunManualControl(true) + Spring.SetSunDirection(math.cos(sunframe/15), 1+math.sin(sunframe/16), math.sin(sunframe/15)) + normpx, normpy, normpz = px/math.sqrt(px^2+py^2+pz^2),py/math.sqrt(px^2+py^2+pz^2),pz/math.sqrt(px^2+py^2+pz^2) + -- Spring.Echo(px) + if normpy <= 0 then + normpy = 0 + end + -- Spring.Echo(normpy) + -- Spring.Echo(pz) + p = (1-(normpy)) + w = 1-(math.exp(-r/K)) + rain = (((1 + math.sin(t/50))/2.3)-0.7)*5.7 + if rain < 0 then rain = 0 end + + -- Spring.Echo(p) + -- Spring.Echo(b) + -- Spring.Echo(p) + if p >= 1 then + p = 1 + end + if w >= 1 then + w = 1 + end + + -- Spring.Echo((1-p)*shadowDensity) + newshadowDensity = (1-p)*shadowDensity + newdiffuse.r, newdiffuse.g, newdiffuse.b = diffuse.r*(1-p)*(1-w)*(1-rain) + 0.035*1*p*(1-w)*(1-rain) + 0.23*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), diffuse.g*(1-p)*(1-w)*(1-rain)+0.035*1*p*(1-w)*(1-rain)+ 0.07*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), diffuse.b*(1-p)*(1-w)*(1-rain)+0.07*1*p*(1-w)*(1-rain)+ 0.035*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w) + + newambient.r, newambient.g, newambient.b = ambient.r, ambient.g, ambient.b -- Use this if it gets too dark + + --newambient.r, newambient.g, newambient.b = ambient.r*(1-p)*(1-w)*(1-rain)+ 0.15*1*p*(1-w)*(1-rain)+ 0.69*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), ambient.g*(1-p)*(1-rain)*(1-w)+0.30*1*p*(1-rain)*(1-w)+ 0.30*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), ambient.b*(1-p)*(1-w)*(1-rain)+0.65*1*p*(1-w)*(1-rain)+ 0.15*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w) -- This is better, but sometimes it gets pitch black + + newspecular.r, newspecular.g, newspecular.b = specular.r*(1-p)*(1-w)+0.2*0.60*1*p*(1-w)*(1-rain) + 0.5*rain*(1-p)*(1-w), specular.g*(1-p)*(1-w)+0.2*0.60*1*p*(1-w)*(1-rain) + 0.5*rain*(1-p)*(1-w), specular.b*(1-p)*(1-w)+0.2*1*1*p*(1-w)*(1-rain) + 0.5*rain*(1-p)*(1-w) + + newfogStart = 1-(math.max(rain, w)) + newfogEnd = 15 + newfogColor.r, newfogColor.g, newfogColor.b, newfogColor["alpha"] = fogColor.r*(1-p)*(1-w)*(1-rain)+0.03*1*p*(1-w)*(1-rain)+ 0.07*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), fogColor.g*(1-p)*(1-w)*(1-rain)+0.06*1*p*(1-w)*(1-rain)+ 0.05*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), fogColor.b*(1-p)*(1-w)*(1-rain)+0.20*1*p*(1-w)*(1-rain)+ 0.05*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), 0 + + newsunColor.r, newsunColor.g, newsunColor.b = sunColor.r*(1-p)*(1-w)*(1-rain)+0.6*1*p*(1-w)*(1-rain)+ 1*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), sunColor.g*(1-p)*(1-w)*(1-rain)+0.95*1*p*(1-w)*(1-rain)+ 0.95*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), sunColor.b*(1-p)*(1-w)*(1-rain)+0.1*1*p*(1-w)*(1-rain)+ 0.60*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w) + newskyColor.r, newskyColor.g, newskyColor.b = skyColor.r*(1-p)*(1-w)*(1-rain)+0.03*1*p*(1-w)*(1-rain)+ 0.2*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), skyColor.g*(1-p)*(1-w)*(1-rain)+0.06*1*p*(1-w)*(1-rain)+ 0.06*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w), skyColor.b*(1-p)*(1-w)*(1-rain)+0.2*1*p*(1-w)*(1-rain)+ 0.03*w*(1-p)*(1-rain) + 0.5*rain*(1-p)*(1-w) + newcloudColor.r, newcloudColor.g, newcloudColor.b = cloudColor.r*(1-p)*(1-w) + 0.5*rain*(1-p)*(1-w), cloudColor.g*(1-p)*(1-w) + 0.5*rain*(1-p)*(1-w), cloudColor.b*(1-p)*(1-w) + 0.5*rain*(1-p)*(1-w) + + if (newdiffuse.r + newdiffuse.g + newdiffuse.b) <= 1.5 then + factor = 1.5/(newdiffuse.r + newdiffuse.g + newdiffuse.b) + newdiffuse.r = newdiffuse.r * factor + newdiffuse.g = newdiffuse.g * factor + newdiffuse.b = newdiffuse.b * factor + end + + if (newambient.r + newambient.g + newambient.b) <= 1.5 then + factor = 1.5/(newdiffuse.r + newdiffuse.g + newdiffuse.b) + newambient.r = newambient.r * factor + newambient.g = newambient.g * factor + newambient.b = newambient.b * factor + end + -- Spring.Echo(rain) + -- Spring.Echo(newfogStart) + + Spring.SetSunLighting({groundAmbientColor = {newambient.r + lightningcolor, newambient.g + lightningcolor, newambient.b + lightningcolor} , groundDiffuseColor = {newdiffuse.r + lightningcolor, newdiffuse.g + lightningcolor, newdiffuse.b + lightningcolor}, groundSpecularColor = {newspecular.r, newspecular.g, newspecular.b}, unitAmbientColor = {newambient.r + lightningcolor, newambient.g + lightningcolor, newambient.b + lightningcolor} , unitDiffuseColor = {newdiffuse.r + lightningcolor, newdiffuse.g + lightningcolor, newdiffuse.b + lightningcolor}, unitSpecularColor = {newspecular.r, newspecular.g, newspecular.b}}) + Spring.SetAtmosphere({fogStart = newfogStart, fogEnd = newfogEnd, fogColor = {newfogColor.r+ lightningcolor, newfogColor.g+ lightningcolor, newfogColor.b+ lightningcolor, 0}, sunColor = {newsunColor.r+ lightningcolor, newsunColor.g+ lightningcolor, newsunColor.b+ lightningcolor}, skyColor = {newskyColor.r , newskyColor.g, newskyColor.b}, cloudColor = {newcloudColor.r+ lightningcolor, newcloudColor.g+ lightningcolor, newcloudColor.b+ lightningcolor}}) + --WATER + + -- Spring.Echo(waterBase.r) + -- newwaterBase.r, newwaterBase.g, newwaterBase.b = waterBase.r*(1-p)+0.23*p, waterBase.g*(1-p)+0.07*p, waterBase.b*(1-p)+0.035*p + -- newwaterAbsorb.r, newwaterAbsorb.g, newwaterAbsorb.b = waterAbsorb.r*(1+p), waterAbsorb.g*(1+p), waterAbsorb.b*(1+p) + -- newwaterMin.r, newwaterMin.g, newwaterMin.b = waterMin.r*(1-p), waterMin.g*(1-p), waterMin.b*(1-p) + -- newwaterSurface.r, newwaterSurface.g, newwaterSurface.b = waterSurface.r*(1-p)+0.23*p, waterSurface.g*(1-p)+0.07*p, waterSurface.b*(1-p)+0.035*p + -- newwaterSpecular.r, newwaterSpecular.g, newwaterSpecular.b = waterSpecular.r*(1-p)+0.05*p, waterSpecular.g*(1-p)+0.05*p, waterSpecular.b*(1-p)+0.05*p + -- newwaterPlane.r, newwaterPlane.g, newwaterPlane.b = waterPlane.r*(1-p)+0.2*p, waterPlane.g*(1-p)+0.06*p, waterPlane.b*(1-p)+0.03*p + + -- Spring.SetWaterParams( + -- {absorb = {newwaterAbsorb.r, newwaterAbsorb.g, newwaterAbsorb.b}, baseColor = {newwaterBase.r, newwaterBase.g, newwaterBase.b}, minColor = {newwaterMin.r, newwaterMin.g, newwaterMin.b}, surfaceColor = {newwaterSurface.r, newwaterSurface.g, newwaterSurface.b}, diffuseColor = {newdiffuse.r, newdiffuse.g, newdiffuse.b}, specularColor = {newwaterSpecular.r, newwaterSpecular.g, newwaterSpecular.b}, planeColor = {newwaterPlane.r, newwaterPlane.g, newwaterPlane.b}}) + + +end +function widget:Shutdown() + Spring.SetSunLighting({groundAmbientColor = {ambient.r, ambient.g, ambient.b} , groundDiffuseColor = {diffuse.r, diffuse.g, diffuse.b}, groundSpecularColor = {specular.r, specular.g, specular.b}, unitAmbientColor = {ambient.r, ambient.g, ambient.b} , unitDiffuseColor = {diffuse.r, diffuse.g, diffuse.b}, unitSpecularColor = {specular.r, specular.g, specular.b}}) + Spring.SetAtmosphere({fogStart = fogStart, fogEnd = fogEnd, fogColor = {fogColor.r, fogColor.g, fogColor.b, fogColor.alpha}, sunColor = {sunColor.r, sunColor.g, sunColor.b}, skyColor = {skyColor.r, skyColor.g, skyColor.b}, cloudColor = {cloudColor.r, cloudColor.g, cloudColor.b}}) +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/grabinput.lua b/LuaUI/Widgets_Evo/grabinput.lua deleted file mode 100644 index d4ab9349f..000000000 --- a/LuaUI/Widgets_Evo/grabinput.lua +++ /dev/null @@ -1,18 +0,0 @@ -function widget:GetInfo() - return { - name = "Grabinput", - desc = "Enables GrabInput in Windowed mode", - author = "abma", - date = "2012-08-11", - license = "GPL v2 or later", - layer = 5, - enabled = false - } -end - -function widget:Initialize() - if Spring.GetConfigInt("GrabInput", 1) == 1 then - Spring.SendCommands("grabinput 1") - end -end - diff --git a/LuaUI/Widgets_Evo/grabinput_local.lua b/LuaUI/Widgets_Evo/grabinput_local.lua new file mode 100644 index 000000000..ac7c09251 --- /dev/null +++ b/LuaUI/Widgets_Evo/grabinput_local.lua @@ -0,0 +1,22 @@ +function widget:GetInfo() + return { + name = "Grabinput Local", + desc = "Enables GrabInput in Windowed mode", + author = "abma", + date = "2012-08-11", + license = "GPL v2 or later", + layer = 5, + enabled = true + } +end + +function widget:Initialize() + Spring.SendCommands("grabinput 1") +end + +function widget:GameFrame(n) +-- send grabinput every 30 seconds + if n%960 == 1 then + Spring.SendCommands("grabinput 1") + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_FactoryExitIndicator.lua b/LuaUI/Widgets_Evo/gui_FactoryExitIndicator.lua index d39f61f24..b93b93b1d 100644 --- a/LuaUI/Widgets_Evo/gui_FactoryExitIndicator.lua +++ b/LuaUI/Widgets_Evo/gui_FactoryExitIndicator.lua @@ -91,7 +91,14 @@ function widget:Update() end end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawWorld() + if chobbyInterface then return end drawOrientation() ResetGl() diff --git a/LuaUI/Widgets_Evo/gui_advplayerslist.lua b/LuaUI/Widgets_Evo/gui_advplayerslist.lua new file mode 100644 index 000000000..03eb8426d --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_advplayerslist.lua @@ -0,0 +1,4142 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Copyright (C) 2008. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + + +function widget:GetInfo() + return { + name = "AdvPlayersList", + desc = "Playerlist. Use tweakmode (ctrl+F11) to customize.", + author = "Marmoth. (spiced up by Floris)", + date = "25 april 2015", + version = "22.0", + license = "GNU GPL, v2 or later", + layer = -4, + enabled = true, -- loaded by default? + } +end + +--Changelog +-- before v8.0 developed outside of BA by Marmoth +-- v9.0 (Bluestone): modifications to deal with twice as many players/specs; specs are rendered in a small font and cpu/ping does not show for them. +-- v9.1 ([teh]decay): added notification about shared resources +-- v10 (Bluestone): Better use of opengl for a big speed increase & less spaghetti +-- v11 (Bluestone): Get take info from cmd_idle_players +-- v11.1 (Bluestone): Added TrueSkill column +-- v11.2 (Bluestone): Remove lots of hardcoded crap about module names/pictures +-- v11.3 (Bluestone): More cleaning up +-- v11.4 (Bluestone): Mute people with ctrl+click on their name +-- v12 (Floris): Restyled looks + added imageDirectory var + HD-ified rank and some other icons +-- v13 (Floris): Added scale buttons. Added grey cpu/ping icons for spectators. Resized elements. Textured bg. Spec label click to unfold/fold. Added guishader. Lockcamera on doubleclick. Ping in ms/sec/min. Shows dot icon in front of tracked player. HD-ified lots of other icons. Speccing/dead player keep their color. Improved e/m share gui responsiveness. + removed the m_spec option +-- v14 (Floris): Added country flags + Added camera icons for locked camera + specs show bright when they are broadcasting new lockcamera positions + bugfixed lockcamera for specs. Added small gaps between in tweakui icons. Auto scales with resolution changes. +-- v15 (Floris): Integrated LockCamers widget code +-- v16 (Floris): Added chips next to gambling-spectators for betting system +-- v17 (Floris): Added alliances display and button and /cputext option +-- v18 (Floris): Player system shown on tooltip + added FPS counter + replaced allycursor data with activity gadget data (all these features need gadgets too) +-- v19 (Floris): added player resource bars +-- v20 (Floris): added /alwayshidespecs + fixed drawing when playerlist is at the leftside of the screen +-- v21 (Floris): toggles LoS and /specfullview when camera tracking a player +-- v22 (Floris): added auto collapse function + +-------------------------------------------------------------------------------- +-- Config +-------------------------------------------------------------------------------- + +local customScale = 1.05 +local customScaleStep = 0.025 +local pointDuration = 40 +local cpuText = false +local drawAlliesLabel = false +local alwaysHideSpecs = false +local lockcameraHideEnemies = true -- specfullview +local lockcameraLos = true -- togglelos +local collapsable = false + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.35 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local fontfileScale2 = fontfileScale * 1.25 +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + +-------------------------------------------------------------------------------- +-- SPEED UPS +-------------------------------------------------------------------------------- + +local Spring_GetGameSeconds = Spring.GetGameSeconds +local Spring_GetGameFrame = Spring.GetGameFrame +local Spring_GetAllyTeamList = Spring.GetAllyTeamList +local Spring_GetTeamInfo = Spring.GetTeamInfo +local Spring_GetTeamList = Spring.GetTeamList +local Spring_GetPlayerInfo = Spring.GetPlayerInfo +local Spring_GetPlayerList = Spring.GetPlayerList +local Spring_GetTeamColor = Spring.GetTeamColor +local Spring_GetLocalAllyTeamID = Spring.GetLocalAllyTeamID +local Spring_GetLocalTeamID = Spring.GetLocalTeamID +local Spring_GetLocalPlayerID = Spring.GetLocalPlayerID +local Spring_ShareResources = Spring.ShareResources +local Spring_GetTeamUnitCount = Spring.GetTeamUnitCount +local Echo = Spring.Echo +local Spring_GetTeamResources = Spring.GetTeamResources +local Spring_SendCommands = Spring.SendCommands +local Spring_GetConfigInt = Spring.GetConfigInt +local Spring_GetMouseState = Spring.GetMouseState +local Spring_GetAIInfo = Spring.GetAIInfo +local Spring_GetTeamRulesParam = Spring.GetTeamRulesParam +local Spring_IsGUIHidden = Spring.IsGUIHidden +local Spring_GetDrawFrame = Spring.GetDrawFrame +local Spring_GetMyTeamID = Spring.GetMyTeamID +local Spring_AreTeamsAllied = Spring.AreTeamsAllied + +local GetCameraState = Spring.GetCameraState +local SetCameraState = Spring.SetCameraState +local GetCameraNames = Spring.GetCameraNames + +local gl_Texture = gl.Texture +local gl_Rect = gl.Rect +local gl_TexRect = gl.TexRect +local gl_Color = gl.Color +local gl_CreateList = gl.CreateList +local gl_BeginEnd = gl.BeginEnd +local gl_DeleteList = gl.DeleteList +local gl_CallList = gl.CallList +local gl_Text = gl.Text + +-------------------------------------------------------------------------------- +-- IMAGES +-------------------------------------------------------------------------------- + +local imageDirectory = ":n:"..LUAUI_DIRNAME.."Images/advplayerslist/" + +local flagsDirectory = imageDirectory.."flags/" + +local bgcorner = LUAUI_DIRNAME.."Images/bgcorner.png" + +local pics = { + chipPic = imageDirectory.."chip.dds", + currentPic = imageDirectory.."indicator.dds", + unitsPic = imageDirectory.."units.dds", + energyPic = imageDirectory.."energy.dds", + metalPic = imageDirectory.."metal.dds", + notFirstPic = imageDirectory.."notfirst.dds", + notFirstPicWO = imageDirectory.."notfirstwo.png", + pingPic = imageDirectory.."ping.dds", + cpuPic = imageDirectory.."cpu.dds", + selectPic = imageDirectory.."select.png", + barPic = imageDirectory.."bar.png", + amountPic = imageDirectory.."amount.png", + pointPic = imageDirectory.."point.dds", + lowPic = imageDirectory.."low.dds", + arrowPic = imageDirectory.."arrow.dds", + arrowdPic = imageDirectory.."arrowd.png", + takePic = imageDirectory.."take.dds", + crossPic = imageDirectory.."cross.dds", + pointbPic = imageDirectory.."pointb.png", + takebPic = imageDirectory.."takeb.png", + seespecPic = imageDirectory.."seespec.png", + indentPic = imageDirectory.."indent.png", + cameraPic = imageDirectory.."camera.dds", + countryPic = imageDirectory.."country.dds", + readyTexture = imageDirectory.."indicator.dds", + drawPic = imageDirectory.."draw.dds", + allyPic = imageDirectory.."ally.dds", + resourcesPic = imageDirectory.."res.png", + resbarPic = imageDirectory.."resbar.png", + resbarBgPic = imageDirectory.."resbarBg.png", + barGlowCenterPic= imageDirectory.."barglow-center.png", + barGlowEdgePic = imageDirectory.."barglow-edge.png", + + cpuPingPic = imageDirectory.."cpuping.dds", + specPic = imageDirectory.."spec.png", + chatPic = imageDirectory.."chat.dds", + sidePic = imageDirectory.."side.dds", + sharePic = imageDirectory.."share.dds", + namePic = imageDirectory.."name.dds", + idPic = imageDirectory.."id.dds", + tsPic = imageDirectory.."ts.dds", + sizednPic = imageDirectory.."sizedn.dds", + sizeupPic = imageDirectory.."sizeup.dds", + + rank0 = imageDirectory.."ranks/rank0.dds", + rank1 = imageDirectory.."ranks/rank1.dds", + rank2 = imageDirectory.."ranks/rank2.dds", + rank3 = imageDirectory.."ranks/rank3.dds", + rank4 = imageDirectory.."ranks/rank4.dds", + rank5 = imageDirectory.."ranks/rank5.dds", + rank6 = imageDirectory.."ranks/rank6.dds", + rank7 = imageDirectory.."ranks/rank7.dds", + rank8 = imageDirectory.."ranks/rank_unknown.dds", +} + +local sidePics = {} -- loaded in SetSidePics function +local sidePicsWO = {} -- loaded in SetSidePics function +local originalColourNames = {} -- loaded in SetOriginalColourNames, format is originalColourNames['name'] = colourString + +local apiAbsPosition = {0,0,0,0,1,1,false} + +-------------------------------------------------------------------------------- +-- Colors +-------------------------------------------------------------------------------- + +local pingCpuColors = { + [1] = {r = 0.11, g = 0.82, b = 0.11}, + [2] = {r = 0.4, g = 0.75, b = 0.2}, + [3] = {r = 0.72, g = 0.72, b = 0.2}, + [4] = {r = 0.82, g = 0.27, b = 0.18}, + [5] = {r = 1, g = 0.15, b = 0.3} +} + +-------------------------------------------------------------------------------- +-- Time Variables +-------------------------------------------------------------------------------- + +local blink = true +local lastTime = 0 +local blinkTime = 0 +local now = 0 + +local lastRequestTime = -1 +local interRequestTime = 1 -- seconds + +-------------------------------------------------------------------------------- +-- LockCamera variables +-------------------------------------------------------------------------------- + +local transitionTime = 0.6 --how long it takes the camera to move when trackign a player +local listTime = 14 --how long back to look for recent broadcasters + +local myPlayerID = Spring.GetMyPlayerID() +local lockPlayerID + +local lastBroadcasts = {} +local recentBroadcasters = {} +local newBroadcaster = false +local totalTime = 0 +local playerScores = {} + +local aliveAllyTeams = {} + +local myLastCameraState + + +-------------------------------------------------------------------------------- +-- +-------------------------------------------------------------------------------- +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) +local playSounds = true +local buttonclick = LUAUI_DIRNAME..'Sounds/buildbar_waypoint.wav' +local sliderdrag = LUAUI_DIRNAME..'Sounds/buildbar_rem.wav' + +local lastActivity = {} +local lastFpsData = {} +local lastSystemData = {} +local lastGpuMemData = {} + +-------------------------------------------------------------------------------- +-- Tooltip +-------------------------------------------------------------------------------- + +local tipText + +-------------------------------------------------------------------------------- +-- Players counts and info +-------------------------------------------------------------------------------- + +-- local player info +local myAllyTeamID +local myTeamID +local mySpecStatus,fullView,_ = Spring.GetSpectatingState() + +--General players/spectator count and tables +local player = {} +local playerSpecs = {} +local playerReadyState = {} +local numberOfSpecs = 0 + +--To determine faction at start +local sideOneDefID = UnitDefNames.ecommander.id +local sideTwoDefID = UnitDefNames.ecommander.id + +local teamSideOne = "evorts" +local teamSideTwo = "evorts" + +--Name for absent/resigned players +local absentName = " --- " + +--Did the game start yet? +local gameStarted = false +-------------------------------------------------------------------------------- +-- Button check variable +-------------------------------------------------------------------------------- + +local clickToMove = nil -- click detection for moving the widget +local moveStart = nil -- position of the cursor before dragging the widget + +local energyPlayer = nil -- player to share energy with (nil when no energy sharing) +local metalPlayer = nil -- player to share metal with(nil when no metal sharing) +local amountEM = 0 -- amount of metal/energy to share/ask +local amountEMMax = nil -- max amount of metal/energy to share/ask +local sliderPosition = 0 -- slider position in metal and energy sharing +local sliderOrigin = nil -- position of the cursor before dragging the widget + +local firstclick = 0 -- + +local dblclickPeriod = 0.4 +local backgroundMargin = 7 +local widgetRelRight = 0 + +local desiredLosmodeChanged = 0 + +-------------------------------------------------------------------------------- +-- GEOMETRY VARIABLES +-------------------------------------------------------------------------------- + +local widgetTop = 0 +local widgetRight = 1 +local widgetHeight = 0 +local widgetWidth = 0 +local widgetPosX = vsx-200 +local widgetPosY = 0 +local widgetScale = 0 + +local expandDown = false +local expandLeft = true +local right + +local activePlayers = {} +local labelOffset = 18 +local separatorOffset = 4 +local playerOffset = 17 +local specOffset = 12 +local drawList = {} +local teamN +local prevClickTime = os.clock() +local specListShow = true + +local collapsed = false +local collapsedHeight = 42 + +-------------------------------------------------- +-- Modules +-------------------------------------------------- + + +local modules = {} +local modulesCount = 0 +local m_indent; modulesCount = modulesCount + 1 +local m_rank; modulesCount = modulesCount + 1 +local m_side; modulesCount = modulesCount + 1 +local m_ID; modulesCount = modulesCount + 1 +local m_name; modulesCount = modulesCount + 1 +local m_share; modulesCount = modulesCount + 1 +local m_chat; modulesCount = modulesCount + 1 +local m_cpuping; modulesCount = modulesCount + 1 +local m_diplo; modulesCount = modulesCount + 1 +local m_sizedn; modulesCount = modulesCount + 1 +local m_sizeup; modulesCount = modulesCount + 1 + +-- these are not considered as normal module since they dont take any place and wont affect other's position +-- (they have no module.width and are not part of modules) +local m_point; modulesCount = modulesCount + 1 +local m_take; modulesCount = modulesCount + 1 +local m_seespec; modulesCount = modulesCount + 1 + +local position = 1 +m_indent = { + name = "indent", + spec = true, --display for specs? + play = true, --display for players? + active = true, --display? (overrides above) + default = true, --display by default? + width = 9, + position = position, + posX = 0, + pic = pics["indentPic"], + noPic = true, +} +position = position + 1 + +m_ID = { + name = "id", + spec = true, + play = true, + active = false, + width = 17, + position = position, + posX = 0, + pic = pics["idPic"], +} +position = position + 1 + +m_rank = { + name = "rank", + spec = true, --display for specs? + play = true, --display for players? + active = true, --display? (overrides above) + default = false, --display by default? + width = 18, + position = position, + posX = 0, + pic = pics["rank6"], +} +position = position + 1 + +m_country = { + name = "country", + spec = true, + play = true, + active = true, + default = true, + width = 20, + position = position, + posX = 0, + pic = pics["countryPic"], +} +position = position + 1 + +m_side = { + name = "side", + spec = true, + play = true, + active = false, + width = 18, + position = position, + posX = 0, + pic = pics["sidePic"], +} +position = position + 1 + +m_skill = { + name = "skill", + spec = true, + play = true, + active = true, + width = 18, + position = position, + posX = 0, + pic = pics["tsPic"], +} +position = position + 1 + +m_name = { + name = "name", + spec = true, + play = true, + active = true, + alwaysActive = true, + width = 10, + position = position, + posX = 0, + pic = pics["namePic"], + noPic = true, + picGap = 7, +} +position = position + 1 + +m_cpuping = { + name = "cpuping", + spec = true, + play = true, + active = true, + width = 24, + position = position, + posX = 0, + pic = pics["cpuPingPic"], +} +position = position + 1 + +m_resources = { + name = "resources", + spec = true, + play = true, + active = true, + width = 28, + position = position, + posX = 0, + pic = pics["resourcesPic"], + picGap = 7, +} +position = position + 1 + +m_share = { + name = "share", + spec = false, + play = true, + active = true, + width = 50, + position = position, + posX = 0, + pic = pics["sharePic"], +} +position = position + 1 + +m_chat = { + name = "chat", + spec = false, + play = true, + active = false, + width = 18, + position = position, + posX = 0, + pic = pics["chatPic"], +} +position = position + 1 + +local fixedallies = tonumber(Spring.GetModOptions().fixedallies) +local drawAllyButton = (not fixedallies or fixedallies == 0) +m_alliance = { + name = "ally", + spec = false, + play = true, + active = true, + width = 16, + position = position, + posX = 0, + pic = pics["allyPic"], + noPic = false, +} +if not drawAllyButton then + m_alliance.width = 0 +end + +position = position + 1 + +m_sizedn = { + name = "sizedn", + spec = true, + play = true, + active = true, + alwaysActive = true, + width = 0, + position = position, + posX = 0, + pic = pics["sizednPic"], +} +position = position + 1 + +m_sizeup = { + name = "sizeup", + spec = true, + play = true, + active = true, + alwaysActive = true, + width = 0, + position = position, + posX = 0, + pic = pics["sizeupPic"], +} +position = position + 1 + +modules = { + m_indent, + m_rank, + m_country, + m_ID, + m_side, + m_name, + m_skill, + m_resources, + m_cpuping, + m_alliance, + m_share, + m_chat, + m_sizedn, + m_sizeup, +} + +m_point = { + active = true, + defaut = true, -- defaults dont seem to be accesible on widget data load + pic = pics["pointbPic"], +} + +m_take = { + active = true, + default = true, + pic = pics["takePic"], +} + +m_seespec = { + active = true, + default = true, + pic = pics["seespecPic"], +} + + +local specsLabelOffset = 0 +local teamsizeVersusText = "" + + +--------------------------------------------------------------------------------------------------- +-- Geometry +--------------------------------------------------------------------------------------------------- + +function SetModulesPositionX() + m_name.width = SetMaxPlayerNameWidth() + table.sort(modules, function(v1,v2) + return v1.position < v2.position + end) + pos = 1 + for _,module in ipairs(modules) do + module.posX = pos + if module.active == true then + if mySpecStatus == true then + if module.spec == true then + pos = pos + module.width + end + else + if module.play == true then + pos = pos + module.width + end + end + end + + widgetWidth = pos + 1 + if widgetWidth < 20 then + widgetWidth = 20 + end + + if widgetWidth + widgetPosX > vsx then + widgetPosX = vsx - (widgetWidth * widgetScale) - widgetRelRight + end + if widgetRight - widgetWidth < 0 then + widgetRight = widgetWidth + end + if expandLeft == true then + widgetPosX = vsx - (widgetWidth * widgetScale) - widgetRelRight + else + widgetRight = widgetPosX + widgetWidth + end + end +end + +function SetMaxPlayerNameWidth() + -- determines the maximal player name width (in order to set the width of the widget) + local t = Spring_GetPlayerList() + local maxWidth = 14*font2:GetTextWidth(absentName) + 8 -- 8 is minimal width + local name = '' + local spec = false + local version = '' + local teamID = 0 + local nextWidth = 0 + for _,wplayer in ipairs(t) do + name,_,spec,teamID = Spring_GetPlayerInfo(wplayer) + if select(4,Spring_GetTeamInfo(teamID,false)) then -- is AI? + _,_,_,_,name, version = Spring_GetAIInfo(teamID) + if type(version) == "string" then + name = "AI:" .. name .. "-" .. version + else + name = "AI:" .. name + end + if Spring.GetGameRulesParam(teamID, 'ainame') then + name = Spring.GetGameRulesParam(teamID, 'ainame') .. ' (AI)' + end + end + local charSize + if spec then charSize = 11 else charSize = 14 end + nextWidth = charSize*font2:GetTextWidth(name)+8 + if nextWidth > maxWidth then + maxWidth = nextWidth + end + end + return maxWidth +end + +function GetNumberOfSpecs() + local pList = Spring_GetPlayerList() + local count = 0 + local name = "" + for _,playerID in ipairs(pList) do + _,active,spec = Spring_GetPlayerInfo(playerID) + if spec and active then count = count + 1 end + end + return count +end + +function GeometryChange() + --check if disappeared off the edge of screen + widgetRight = widgetWidth + widgetPosX + if widgetRight > vsx-(backgroundMargin * widgetScale) then + widgetRight = vsx - (backgroundMargin * widgetScale) + widgetPosX = vsx - ((widgetWidth + backgroundMargin) * widgetScale) - widgetRelRight + end + if widgetPosX + widgetWidth/2 > vsx/2 then + right = true + else + right = false + end +end + + +local function UpdateAlliances() + playerList = Spring_GetPlayerList() + teamList = Spring_GetTeamList() + for _,playerID in pairs (playerList) do + if not player[playerID].spec then + local alliances = {} + for _,player2ID in pairs (playerList) do + if not player[playerID].spec and not player[player2ID].spec and playerID ~= player2ID and player[playerID].team ~= nil and player[player2ID].team ~= nil and player[playerID].allyteam ~= player[player2ID].allyteam and Spring_AreTeamsAllied(player[player2ID].team, player[playerID].team) then + alliances[#alliances+1] = player2ID + end + end + player[playerID].alliances = alliances + end + end +end + +function toPixels(str) + local chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ !@#$%^&*()_+-=[]{};:,./<>?~|`'\"\\" + local pixels = {} + for i=1, string.len(str) do + if i%3 == 1 then + pixels[#pixels+1] = {} + end + local char = string.sub(str,i,i) + for ci=1, string.len(chars) do + if char == string.sub(chars,ci,ci) then + pixels[#pixels][#pixels[#pixels]+1] = (ci-1)/string.len(chars) + break + end + end + end + return pixels +end + +-- only being called for devs registered in gadget +function PlayerDataBroadcast(playerName, msg) + local data = '' + local count = 0 + local startPos = 0 + for i=1, string.len(msg) do + if string.sub(msg, i, i) == ';' then + count = count + 1 + if count == 1 then + startPos = i+1 + playerName = string.sub(msg,1,i-1) + elseif count == 2 then + msgType = string.sub(msg,startPos,i-1) + data = string.sub(msg, i+1) + break + end + end + end + if data then + if msgType == 'screenshot' then + data = VFS.ZlibDecompress(data) + count = 0 + for i=1, string.len(data) do + if string.sub(data, i, i) == ';' then + count = count + 1 + if count == 1 then + local finished = string.sub(data,1,i-1) + if finished == '1' then + screenshotFinished = true + else + screenshotFinished = false + end + startPos = i+1 + elseif count == 2 then + screenshotWidth = string.sub(data,startPos,i-1) + startPos = i+1 + elseif count == 3 then + screenshotHeight = string.sub(data,startPos,i-1) + startPos = i+1 + elseif count == 4 then + screenshotGameframe = tonumber(string.sub(data,startPos,i-1)) + if not screenshotData then + screenshotData = string.sub(data, i+1) + else + screenshotData = screenshotData .. string.sub(data, i+1) + end + break + end + end + end + data = nil + screenshotDataLast = totalTime + + if screenshotFinished or totalTime-4000 > screenshotDataLast then + screenshotFinished = true + local map = Game.mapName + local datetable = os.date('*t') + local frame = Spring.GetGameFrame() + local minutes = math.floor((screenshotGameframe / 30 / 60)) + local seconds = math.floor((screenshotGameframe - ((minutes*60)*30)) / 30) + if seconds == 0 then + seconds = '00' + elseif seconds < 10 then + seconds = '0'..seconds + end + local time = minutes..':'..seconds + local yyyy = datetable.year + local m = datetable.month + local d = datetable.day + local h = datetable.hour + local min = datetable.min + local s = datetable.sec + local yyyy = tostring(yyyy) + local mm = ((m > 9 and tostring(m)) or (m <10 and ("0"..tostring(m)))) + local dd = ((d > 9 and tostring(d)) or (d <10 and ("0"..tostring(d)))) + local hh = ((h > 9 and tostring(h)) or (h <10 and ("0"..tostring(h)))) + local minmin = ((min > 9 and tostring(min)) or (min <10 and ("0"..tostring(min)))) + local ss = ((s > 9 and tostring(s)) or (s <10 and ("0"..tostring(s)))) + local engine = Engine.versionFull + + screenshotPixels = toPixels(screenshotData) + screenshotPlayer = playerName + screenshotFilename = yyyy..mm..dd.."_"..hh..minmin..ss.."_" ..minutes..'.'..seconds.."_"..playerName + screenshotSaved = nil + screenshotSaveQueued = true + screenshotPosX = widgetPosX-(backgroundMargin+30+screenshotWidth*widgetScale) + screenshotPosY = widgetPosY + screenshotDlist = gl_CreateList(function() + gl.PushMatrix() + gl.Translate(screenshotPosX, screenshotPosY,0) + gl.Scale(widgetScale,widgetScale,0) + + gl_Color(0,0,0,0.66) + local margin = 2 + RectRound(-margin,-margin,screenshotWidth+margin+margin,screenshotHeight+15+margin+margin, 6, true) + gl_Color(1,1,1,0.025) + RectRound(0,0,screenshotWidth,screenshotHeight+12+margin+margin, 4.5, true) + + font:Begin() + font:Print(screenshotPlayer, 4, screenshotHeight+6.5, 11, "on") + font:End() + + local row = 0 + local col = 0 + for p=1, #screenshotPixels do + col = col + 1 + if p%screenshotWidth == 1 then + row = row + 1 + col = 1 + end + gl.Color(screenshotPixels[p][1], screenshotPixels[p][2], screenshotPixels[p][3], 1) + gl.Rect(col, row, col+1, row+1) + end + gl.PopMatrix() + + end) + screenshotPixels = nil + screenshotData = nil + screenshotFinished = nil + end + elseif msgType == 'infolog' or msgType == 'config' then + local playerID + for i=1, string.len(data) do + if string.sub(data, i, i) == ';' then + playerID = tonumber(string.sub(data,1,i-1)) + startPos = i+1 + data = string.sub(data, i+1) + break + end + end + if playerID == myPlayerID then + local datetable = os.date('*t') + local yyyy = datetable.year + local m = datetable.month + local d = datetable.day + local h = datetable.hour + local min = datetable.min + local yyyy = tostring(yyyy) + local mm = ((m > 9 and tostring(m)) or (m <10 and ("0"..tostring(m)))) + local dd = ((d > 9 and tostring(d)) or (d <10 and ("0"..tostring(d)))) + local hh = ((h > 9 and tostring(h)) or (h <10 and ("0"..tostring(h)))) + local minmin = ((min > 9 and tostring(min)) or (min <10 and ("0"..tostring(min)))) + + local filename = 'playerdata_'..msgType..'s.txt' + local filedata = '' + if VFS.FileExists(filename) then + filedata = tostring(VFS.LoadFile(filename)) + end + local file = assert(io.open(filename, 'w'), 'Unable to save '..filename) + file:write(filedata .. '-----------------------------------------------------\n---- '.. yyyy..'-'..mm..'-'..dd.." "..hh..'.'..minmin .. ' ' .. playerName .. '\n-----------------------------------------------------\n' .. VFS.ZlibDecompress(data) .. "\n\n\n\n\n\n") + file:close() + Spring.Echo('Added '..msgType..' to '..filename) + end + end + end +end + +--------------------------------------------------------------------------------------------------- +-- LockCamera stuff +--------------------------------------------------------------------------------------------------- + + + +local function UpdateRecentBroadcasters() + recentBroadcasters = {} + local i = 1 + for playerID, info in pairs(lastBroadcasts) do + lastTime = info[1] + if (totalTime - lastTime <= listTime or playerID == lockPlayerID) then + if (totalTime - lastTime <= listTime) then + recentBroadcasters[playerID] = totalTime - lastTime + end + i = i + 1 + end + end +end + +local function LockCamera(playerID) + + if playerID and playerID ~= myPlayerID and playerID ~= lockPlayerID then + if lockcameraHideEnemies and not select(3,Spring_GetPlayerInfo(playerID)) then + Spring.SendCommands("specteam "..select(4,Spring_GetPlayerInfo(playerID))) + if not fullView then + sceduledSpecFullView = 1 -- this is needed else the minimap/world doesnt update properly + Spring.SendCommands("specfullview") + else + sceduledSpecFullView = 2 -- this is needed else the minimap/world doesnt update properly + Spring.SendCommands("specfullview") + end + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()~="los" then + desiredLosmode = 'los' + desiredLosmodeChanged = os.clock() + end + elseif lockcameraHideEnemies and select(3,Spring_GetPlayerInfo(playerID)) then + if not fullView then + Spring.SendCommands("specfullview") + end + desiredLosmode = 'normal' + desiredLosmodeChanged = os.clock() + end + lockPlayerID = playerID + myLastCameraState = myLastCameraState or GetCameraState() + local info = lastBroadcasts[lockPlayerID] + if info then + SetCameraState(info[2], transitionTime) + end + else + if myLastCameraState then + SetCameraState(myLastCameraState, transitionTime) + myLastCameraState = nil + end + if lockcameraHideEnemies and lockPlayerID and not select(3,Spring_GetPlayerInfo(lockPlayerID)) then + if not fullView then + Spring.SendCommands("specfullview") + end + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()=="los" then + desiredLosmode = 'normal' + desiredLosmodeChanged = os.clock() + end + end + lockPlayerID = nil + end + UpdateRecentBroadcasters() +end + +function GpuMemEvent(playerID, percentage) + lastGpuMemData[playerID] = percentage +end + +function FpsEvent(playerID, fps) + lastFpsData[playerID] = fps + + WG.playerFPS = WG.playerFPS or {} + WG.playerFPS[playerID] = fps +end + +function SystemEvent(playerID, system) + local lines, length = 0, 0 + local function helper(line) lines=lines+1; if string.len(line) then length = string.len(line) end return "" end + helper((system:gsub("(.-)\r?\n", helper))) + lastSystemData[playerID] = system + + WG.playerSystemData = WG.playerSystemData or {} + WG.playerSystemData[playerID] = system +end + +function ActivityEvent(playerID) + lastActivity[playerID] = os.clock() +end + +function CameraBroadcastEvent(playerID,cameraState) + + --if cameraState is empty then transmission has stopped + if not cameraState then + if lastBroadcasts[playerID] then + lastBroadcasts[playerID] = nil + newBroadcaster = true + end + if lockPlayerID == playerID then + LockCamera() + end + return + end + + if not lastBroadcasts[playerID] and not newBroadcaster then + newBroadcaster = true + end + + lastBroadcasts[playerID] = {totalTime, cameraState} + + if playerID == lockPlayerID then + SetCameraState(cameraState, transitionTime) + end +end + +--------------------------------------------------------------------------------------------------- +-- Init/GameStart (creating players) +--------------------------------------------------------------------------------------------------- + +--[[function RecvPlayerScores(newPlayerScores) + playerScores = newPlayerScores or {} +end]]-- + +function widget:Initialize() + widget:ViewResize(gl.GetViewSizes()) + + --widgetHandler:RegisterGlobal('getPlayerScoresAdvplayerslist', RecvPlayerScores) + widgetHandler:RegisterGlobal('CameraBroadcastEvent', CameraBroadcastEvent) + widgetHandler:RegisterGlobal('ActivityEvent', ActivityEvent) + widgetHandler:RegisterGlobal('FpsEvent', FpsEvent) + widgetHandler:RegisterGlobal('GpuMemEvent', GpuMemEvent) + widgetHandler:RegisterGlobal('SystemEvent', SystemEvent) + widgetHandler:RegisterGlobal('PlayerDataBroadcast', PlayerDataBroadcast) + UpdateRecentBroadcasters() + + mySpecStatus,fullView,_ = Spring.GetSpectatingState() + if Spring.GetGameFrame() <= 0 then + if mySpecStatus and not alwaysHideSpecs then + specListShow = true + else + specListShow = false + end + end + if (Spring.GetConfigInt("ShowPlayerInfo")==1) then + Spring.SendCommands("info 0") + end + + if Spring.GetGameFrame()>0 then + gameStarted = true + end + + GeometryChange() + SetModulesPositionX() + SetSidePics() + InitializePlayers() + SortList() + + WG['advplayerlist_api'] = {} + WG['advplayerlist_api'].GetPosition = function() + return apiAbsPosition + end + WG['advplayerlist_api'].GetCollapsable = function() + return collapsable + end + WG['advplayerlist_api'].SetCollapsable = function(value) + collapsable = value + if not collapsable and collapsed then + collapsed = false + CreateBackground() + end + end + + WG['advplayerlist_api'].GetLockPlayerID = function() + return lockPlayerID + end + WG['advplayerlist_api'].SetLockPlayerID = function(playerID) + LockCamera(playerID) + end + WG['advplayerlist_api'].GetLockHideEnemies = function() + return lockcameraHideEnemies + end + WG['advplayerlist_api'].SetLockHideEnemies = function(value) + lockcameraHideEnemies = value + if lockPlayerID and not select(3,Spring_GetPlayerInfo(lockPlayerID)) then + if not lockcameraHideEnemies then + if not fullView then + Spring.SendCommands("specfullview") + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()=="los" then + desiredLosmode = 'normal' + desiredLosmodeChanged = os.clock() + Spring.SendCommands("togglelos") + end + end + else + if fullView then + Spring.SendCommands("specfullview") + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()~="los" then + desiredLosmode = 'los' + desiredLosmodeChanged = os.clock() + Spring.SendCommands("togglelos") + end + end + end + end + end + WG['advplayerlist_api'].GetLockTransitionTime = function() + return transitionTime + end + WG['advplayerlist_api'].SetLockTransitionTime = function(value) + transitionTime = value + end + WG['advplayerlist_api'].GetLockLos = function() + return lockcameraLos + end + WG['advplayerlist_api'].SetLockLos = function(value) + lockcameraLos = value + if lockcameraHideEnemies and mySpecStatus and lockPlayerID and not select(3,Spring_GetPlayerInfo(lockPlayerID)) then + if lockcameraLos and Spring.GetMapDrawMode()~="los" then + desiredLosmode = 'los' + desiredLosmodeChanged = os.clock() + Spring.SendCommands("togglelos") + elseif not lockcameraLos and Spring.GetMapDrawMode()=="los" then + desiredLosmode = 'normal' + desiredLosmodeChanged = os.clock() + Spring.SendCommands("togglelos") + end + end + end +end + +function widget:GameFrame(n) + if n > 0 and not gameStarted and not collapsed then + if mySpecStatus and not alwaysHideSpecs then + specListShow = true + else + specListShow = false + end + + gameStarted = true + SetSidePics() + InitializePlayers() + SetOriginalColourNames() + SortList() + end +end + + +function widget:Shutdown() + if WG['guishader'] then + WG['guishader'].RemoveDlist('advplayerlist') + --WG['guishader'].RemoveRect('advplayerlist') + WG['guishader'].RemoveRect('advplayerlist_screenshot') + end + WG['advplayerlist_api'] = nil + widgetHandler:DeregisterGlobal('CameraBroadcastEvent') + widgetHandler:DeregisterGlobal('ActivityEvent') + widgetHandler:DeregisterGlobal('FpsEvent') + widgetHandler:DeregisterGlobal('GpuMemEvent') + widgetHandler:DeregisterGlobal('SystemEvent') + if ShareSlider then + gl_DeleteList(ShareSlider) + end + if MainList then + gl_DeleteList(MainList) + end + if Background then + gl_DeleteList(Background) + end + if screenshotDlist then + gl_DeleteList(screenshotDlist) + end + gl.DeleteFont(font) + if lockPlayerID then + LockCamera() + end +end + +function widget:GameOver() + if lockPlayerID then + LockCamera() + end +end + + +function SetSidePics() + --record readyStates + playerList = Spring.GetPlayerList() + for _,playerID in pairs (playerList) do + playerReadyState[playerID] = Spring.GetGameRulesParam("player_" .. tostring(playerID) .. "_readyState") + end + + --set factions, from TeamRulesParam when possible and from initial info if not + teamList = Spring_GetTeamList() + for _, team in ipairs(teamList) do + local teamSide + if Spring_GetTeamRulesParam(team, 'startUnit') then + local startunit = Spring_GetTeamRulesParam(team, 'startUnit') + if startunit == sideOneDefID then + teamSide = teamSideOne + end + if startunit == sideOneDefID then + teamSide = teamSideTwo + end + else + _,_,_,_,teamSide = Spring_GetTeamInfo(team,false) + end + + if teamSide then + sidePics[team] = imageDirectory..teamSide.."_default.png" + sidePicsWO[team] = imageDirectory..teamSide.."wo_default.png" + else + sidePics[team] = imageDirectory.."default.png" + sidePicsWO[team] = imageDirectory.."defaultwo.png" + end + end +end + + +function InitializePlayers() + myPlayerID = Spring_GetLocalPlayerID() + myTeamID = Spring_GetLocalTeamID() + myAllyTeamID = Spring_GetLocalAllyTeamID() + for i = 0, 128 do + player[i] = {} + end + GetAllPlayers() +end + +function GetAllPlayers() + local noplayer + local tplayerCount = 0 + local allteams = Spring_GetTeamList() + teamN = table.maxn(allteams) - 1 --remove gaia + for i = 0,teamN-1 do + local teamPlayers = Spring_GetPlayerList(i, true) + player[i + 64] = CreatePlayerFromTeam(i) + for _,playerID in ipairs(teamPlayers) do + player[playerID] = CreatePlayer(playerID) + tplayerCount = tplayerCount + 1 + end + + local _,_,_,isAiTeam = Spring.GetTeamInfo(teamN,false) + local isLuaAI = (Spring.GetTeamLuaAI(teamN) ~= "") + if not (isAiTeam or isLuaAI) then + if tplayerCount > 0 then + playerSpecs[i] = true -- (this isnt correct when team consists of only AI) + end + tplayerCount = 0 + end + end + specPlayers = Spring_GetTeamList() + for _,playerID in ipairs(specPlayers) do + local active,_,spec = Spring_GetPlayerInfo(playerID,false) + if spec == true then + if active == true then + player[playerID] = CreatePlayer(playerID) + end + end + end +end + + +function GetAliveAllyTeams() + aliveAllyTeams = {} + local allteams = Spring_GetTeamList() + teamN = table.maxn(allteams) - 1 --remove gaia + for i = 0,teamN-1 do + local _,_, isDead, _, _, tallyteam = Spring_GetTeamInfo(i,false) + if not isDead then + aliveAllyTeams[tallyteam] = true + end + end +end + + +function round(num, idp) + local mult = 10^(idp or 0) + return math.floor(num * mult + 0.5) / mult +end + +function GetSkill(playerID) + + local customtable = select(11,Spring.GetPlayerInfo(playerID)) + local tsMu = customtable.skill + local tsSigma = customtable.skilluncertainty + local tskill = "" + if tsMu then + tskill = tsMu and tonumber(tsMu:match("%d+%.?%d*")) or 0 + tskill = round(tskill,0) + if string.find(tsMu, ")") then + tskill = "\255"..string.char(190)..string.char(140)..string.char(140) .. tskill -- ')' means inferred from lobby rank + else + + -- show privacy mode + local priv = "" + if string.find(tsMu, "~") then -- '~' means privacy mode is on + priv = "\255"..string.char(200)..string.char(200)..string.char(200) .. "*" + end + + --show sigma + if tsSigma then -- 0 is low sigma, 3 is high sigma + tsSigma=tonumber(tsSigma) + local tsRed, tsGreen, tsBlue + if tsSigma > 2 then + tsRed, tsGreen, tsBlue = 190, 130, 130 + elseif tsSigma == 2 then + tsRed, tsGreen, tsBlue = 140, 140, 140 + elseif tsSigma == 1 then + tsRed, tsGreen, tsBlue = 195, 195, 195 + elseif tsSigma < 1 then + tsRed, tsGreen, tsBlue = 250, 250, 250 + end + tskill = priv .. "\255"..string.char(tsRed)..string.char(tsGreen)..string.char(tsBlue) .. tskill + else + tskill = priv .. "\255"..string.char(195)..string.char(195)..string.char(195) .. tskill --should never happen + end + end + else + tskill = "\255"..string.char(160)..string.char(160)..string.char(160) .. "?" + end + return tskill +end + + +function CreatePlayer(playerID) + + --generic player data + local tname,_, tspec, tteam, tallyteam, tping, tcpu, tcountry, trank = Spring_GetPlayerInfo(playerID,false) + local _,_,_,_, tside, tallyteam = Spring_GetTeamInfo(tteam,false) + local tred, tgreen, tblue = Spring_GetTeamColor(tteam) + + --skill + local tskill + tskill = GetSkill(playerID) + + --cpu/ping + tpingLvl = GetPingLvl(tping) + tcpuLvl = GetCpuLvl(tcpu) + tping = tping * 1000 - ((tping * 1000) % 1) + tcpu = tcpu * 100 - ((tcpu * 100) % 1) + + -- resources + local energy, energyStorage, energyIncome, metal, metalStorage, metalIncome = 0,1,0,1,0,0 + if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then + energy, energyStorage,_, energyIncome = Spring_GetTeamResources(tteam, "energy") + metal, metalStorage,_, metalIncome = Spring_GetTeamResources(tteam, "metal") + if energy then + energy = math.floor(energy) + metal = math.floor(metal) + if energy < 0 then energy = 0 end + if metal < 0 then metal = 0 end + else + energy = 0 + metal = 0 + end + end + + return { + rank = trank, + skill = tskill, + name = tname, + team = tteam, + allyteam = tallyteam, + red = tred, + green = tgreen, + blue = tblue, + dark = GetDark(tred,tgreen,tblue), + side = tside, + pingLvl = tpingLvl, + cpuLvl = tcpuLvl, + ping = tping, + cpu = tcpu, + country = tcountry, + dead = false, + spec = tspec, + ai = false, + energy = energy, + energyStorage = energyStorage, + metal = metal, + metalStorage = metalStorage, + } + +end + + + +function CreatePlayerFromTeam(teamID) -- for when we don't have a human player occupying the slot, also when a player changes team (dies) + + local _,_, isDead, isAI, tside, tallyteam = Spring_GetTeamInfo(teamID,false) + local tred, tgreen, tblue = Spring_GetTeamColor(teamID) + local tname, ttotake, tskill + local tdead = true + + if isAI then + + local version + + _,_,_,_, tname, version = Spring_GetAIInfo(teamID) + + if type(version) == "string" then + tname = "AI:" .. tname .. "-" .. version + else + tname = "AI:" .. tname + end + if Spring.GetGameRulesParam('ainame_'..teamID) then + tname = Spring.GetGameRulesParam('ainame_'..teamID)..' (AI)' + end + + ttotake = false + tdead = false + tai = true + + else + + if Spring_GetGameSeconds() < 0.1 then + tname = absentName + ttotake = false + tdead = false + else + ttotake = IsTakeable(teamID) + end + + tai = false + end + + if tname == nil then + tname = absentName + end + + tskill = "" + + -- resources + local energy, energyStorage, energyIncome, metal, metalStorage, metalIncome = 0,1,0,1,0,0 + if aliveAllyTeams[tallyteam] ~= nil and (mySpecStatus or myAllyTeamID == tallyteam) then + energy, energyStorage,_, energyIncome = Spring_GetTeamResources(teamID, "energy") or 0 + metal, metalStorage,_, metalIncome = Spring_GetTeamResources(teamID, "metal") or 0 + energy = math.floor(energy or 0) + metal = math.floor(metal or 0) + if energy < 0 then energy = 0 end + if metal < 0 then metal = 0 end + end + + return{ + rank = 8, -- "don't know which" value + skill = tskill, + name = tname, + team = teamID, + allyteam = tallyteam, + red = tred, + green = tgreen, + blue = tblue, + dark = GetDark(tred, tgreen, tblue), + side = tside, + totake = ttotake, + dead = tdead, + spec = false, + ai = tai, + energy = energy, + energyStorage = energyStorage, + metal = metal, + metalStorage = metalStorage, + } + +end + +function UpdatePlayerResources() + local energy, energyStorage, metal, metalStorage = 0, 1, 0 ,1 + for playerID,_ in pairs(player) do + if player[playerID].name and not player[playerID].spec and player[playerID].team then + if aliveAllyTeams[player[playerID].allyteam] ~= nil and (mySpecStatus or myAllyTeamID == player[playerID].allyteam) then + energy, energyStorage,_, energyIncome = Spring_GetTeamResources(player[playerID].team, "energy") + metal, metalStorage,_, metalIncome = Spring_GetTeamResources(player[playerID].team, "metal") + if energy == nil then -- need to be there for when you do /specfullview + energy, energyStorage, energyIncome, metal, metalStorage, metalIncome = 0, 0, 0, 0, 0, 0 + else + energy = math.floor(energy) + metal = math.floor(metal) + if energy < 0 then energy = 0 end + if metal < 0 then metal = 0 end + end + player[playerID].energy = energy + player[playerID].energyIncome = energyIncome + player[playerID].energyStorage = energyStorage + player[playerID].metal = metal + player[playerID].metalIncome = metalIncome + player[playerID].metalStorage = metalStorage + end + end + end +end + +function GetDark(red,green,blue) + -- Determines if the player color is dark (i.e. if a white outline for the sidePic is needed) + if red + green*1.2 + blue*0.4 < 0.8 then return true end + return false +end + + +function SetOriginalColourNames() + -- Saves the original team colours associated to team teamID + for playerID,_ in pairs(player) do + if player[playerID].name then + if player[playerID].spec then + originalColourNames[playerID] = "\255\255\255\255" + else + originalColourNames[playerID] = colourNames(player[playerID].team) + end + end + end +end + + + + +--------------------------------------------------------------------------------------------------- +-- Sorting player data +-- note: SPADS ensures that order of playerIDs/teams/allyteams as appropriate reflects TS (mu) order +--------------------------------------------------------------------------------------------------- + + +function SortList() + local teamList + local myOldSpecStatus = mySpecStatus + + mySpecStatus = select(3,Spring_GetPlayerInfo(myPlayerID,false)) + + -- checks if a team has died + if mySpecStatus ~= myOldSpecStatus then + if mySpecStatus then + teamList = Spring_GetTeamList() + for _, team in ipairs(teamList) do + if not select(3,Spring_GetTeamInfo(team,false)) then -- not dead + Spec(team) + break + end + end + end + end + + myAllyTeamID = Spring_GetLocalAllyTeamID() + myTeamID = Spring_GetLocalTeamID() + + drawList = {} + drawListOffset = {} + vOffset = 0 + + -- calls the (cascade) sorting for players + vOffset = SortAllyTeams(vOffset) + + -- calls the sortings for specs if see spec is on + --if m_chat.active == true then + vOffset = SortSpecs(vOffset) + --end + + -- set the widget height according to space needed to show team + widgetHeight = vOffset + 3 + + + -- move the widget if list is too long + if widgetHeight + widgetPosY > vsy then + widgetPosY = vsy - widgetHeight + end + + if widgetTop - widgetHeight < 0 then + --widgetTop = widgetHeight + end + + -- set the widget Y position or the top of the widget according to expand direction + if expandDown == true then + widgetPosY = widgetTop - widgetHeight + else + widgetTop = widgetPosY + widgetHeight + end + +end + + +function SortAllyTeams(vOffset) + -- adds ally teams to the draw list (own ally team first) + -- (labels and separators are drawn) + local allyTeamID + local allyTeamList = Spring_GetAllyTeamList() + local firstenemy = true + local isFirstDrawnTeam = true + allyTeamsCount = table.maxn(allyTeamList)-1 + + --find own ally team + vOffset = 12/2.66 + for allyTeamID = 0, allyTeamsCount - 1 do + if allyTeamID == myAllyTeamID then + vOffset = vOffset + labelOffset - 3 + if drawAlliesLabel then + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -2 -- "Allies" label + vOffset = SortTeams(allyTeamID, vOffset)+2 -- Add the teams from the allyTeam + else + vOffset = SortTeams(allyTeamID, vOffset-labelOffset) + end + break + end + end + + + -- add the others + for allyTeamID = 0, allyTeamsCount-1 do + if allyTeamID ~= myAllyTeamID then + if firstenemy == true then + vOffset = vOffset + 13 + + vOffset = vOffset + labelOffset - 3 + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -3 -- "Enemies" label + firstenemy = false + else + vOffset = vOffset + separatorOffset + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -4 -- Enemy teams separator + end + vOffset = SortTeams(allyTeamID, vOffset)+2 -- Add the teams from the allyTeam + end + end + + + return vOffset +end + +local deadPlayerHeightReduction = 10 +function SortTeams(allyTeamID, vOffset) + -- Adds teams to the draw list (own team first) + --(teams are not visible as such unless they are empty or AI) + local teamID + local teamsList = Spring_GetTeamList(allyTeamID) + + --add teams + for _,teamID in ipairs(teamsList) do + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -1 + vOffset = SortPlayers(teamID,allyTeamID,vOffset) -- adds players form the team + if select(3,Spring_GetTeamInfo(teamID,false)) then + vOffset = vOffset - (deadPlayerHeightReduction/2) + end + end + + return vOffset +end + +function SortPlayers(teamID,allyTeamID,vOffset) + -- Adds players to the draw list (self first) + + local playersList = Spring_GetPlayerList(teamID,true) + local noPlayer = true + + -- add own player (if not spec) + if myTeamID == teamID then + if player[myPlayerID].name ~= nil then + if mySpecStatus == false then + vOffset = vOffset + playerOffset + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = myPlayerID -- new player (with ID) + player[myPlayerID].posY = vOffset + noPlayer = false + end + end + end + + -- add other players (if not spec) + for _,playerID in ipairs(playersList) do + if playerID ~= myPlayerID then + if player[playerID].name ~= nil then + if player[playerID].spec ~= true then + vOffset = vOffset + playerOffset + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = playerID -- new player (with ID) + player[playerID].posY = vOffset + noPlayer = false + end + end + end + end + + -- add AI teams + if select(4,Spring_GetTeamInfo(teamID,false)) then -- is AI + vOffset = vOffset + playerOffset + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = 64 + teamID -- new AI team (instead of players) + player[64 + teamID].posY = vOffset + noPlayer = false + end + + -- add no player token if no player found in this team at this point + if noPlayer == true then + vOffset = vOffset + playerOffset - (deadPlayerHeightReduction/2) + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = 64 + teamID -- no players team + player[64 + teamID].posY = vOffset + if Spring_GetGameFrame() > 0 then + player[64+teamID].totake = IsTakeable(teamID) + end + end + + return vOffset +end + +function SortSpecs(vOffset) + -- Adds specs to the draw list + local playersList = Spring_GetPlayerList(-1,true) + local noSpec = true + for _,playerID in ipairs(playersList) do + _,active,spec = Spring_GetPlayerInfo(playerID,false) + if spec and active then + if player[playerID].name ~= nil then + + -- add "Specs" label if first spec + if noSpec == true then + vOffset = vOffset + 13 + vOffset = vOffset + labelOffset - 2 + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -5 + noSpec = false + specJoinedOnce = true + vOffset = vOffset + 4 + end + + -- add spectator + if specListShow == true then + vOffset = vOffset + specOffset + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = playerID + player[playerID].posY = vOffset + noPlayer = false + end + end + end + end + + -- add "Specs" label + if specJoinedOnce and noSpec then + vOffset = vOffset + 13 + vOffset = vOffset + labelOffset - 2 + drawListOffset[#drawListOffset+1] = vOffset + drawList[#drawList+1] = -5 + vOffset = vOffset + 4 + end + + return vOffset +end + + + +--------------------------------------------------------------------------------------------------- +-- Draw control +--------------------------------------------------------------------------------------------------- + +local PrevGameFrame +local MainList +local Background +local ShareSlider + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + if Spring_IsGUIHidden() then return end + + local mouseX,mouseY,mouseButtonL = Spring_GetMouseState() + if not collapsed then + -- update lists frequently if there is mouse interaction + local NeedUpdate = false + if (mouseX > widgetPosX + m_name.posX + m_name.width - 5) and (mouseX < widgetPosX + widgetWidth) and (mouseY > widgetPosY - 16) and (mouseY < widgetPosY + widgetHeight) then + local DrawFrame = Spring_GetDrawFrame() + local CurGameFrame = Spring_GetGameFrame() + if PrevGameFrame == nil then PrevGameFrame = CurGameFrame end + if (DrawFrame%5==0) or (CurGameFrame>PrevGameFrame+1) then + --Echo(DrawFrame) + NeedUpdate = true + end + end + + if NeedUpdate then + --Spring.Echo("DS APL update") + CreateLists() + PrevGameFrame = CurGameFrame + end + end + -- draws the background + if Background then + gl_CallList(Background) + else + CreateBackground() + end + + local scaleDiffX = -((widgetPosX*widgetScale)-widgetPosX)/widgetScale + local scaleDiffY = -((widgetPosY*widgetScale)-widgetPosY)/widgetScale + gl.Scale(widgetScale,widgetScale,0) + gl.Translate(scaleDiffX,scaleDiffY,0) + + if not collapsed then + -- draws the main list + if MainList then + gl_CallList(MainList) + else + CreateMainList() + end + + -- draws share energy/metal sliders + if ShareSlider then + gl_CallList(ShareSlider) + else + CreateShareSlider() + end + end + + local scaleReset = widgetScale / widgetScale / widgetScale + gl.Translate(-scaleDiffX,-scaleDiffY,0) + gl.Scale(scaleReset,scaleReset,0) + + + if screenshotDlist then + gl_CallList(screenshotDlist) + local margin = 1.9*widgetScale + local left = screenshotPosX-margin + local bottom = screenshotPosY-margin + local width = (screenshotWidth*widgetScale)+margin+margin+margin + local height = (screenshotHeight*widgetScale)+margin+margin+margin+(15*widgetScale) + if screenshotSaveQueued then + if WG['guishader'] then + WG['guishader'].InsertRect(left,bottom,left+width,bottom+height,'advplayerlist_screenshot') + screenshotGuishader = true + end + if not screenshotSaved then + screenshotSaved = 'next' + elseif screenshotSaved == 'next' then + screenshotSaved = 'done' + local file = 'screenshots/'..screenshotFilename..'.png' + gl.SaveImage(left,bottom,width,height,file) + Spring.Echo('Screenshot saved to: '..file) + screenshotSaveQueued = nil + end + end + if screenshotWidth and IsOnRectPlain(mouseX,mouseY, screenshotPosX,screenshotPosY,screenshotPosX+(screenshotWidth*widgetScale),screenshotPosY+(screenshotHeight*widgetScale)) then + if mouseButtonL then + gl_DeleteList(screenshotDlist) + if WG['guishader'] then + WG['guishader'].RemoveRect('advplayerlist_screenshot') + end + screenshotDlist = nil + else + gl.Color(0,0,0,0.25) + RectRound(screenshotPosX,screenshotPosY,screenshotPosX+(screenshotWidth*widgetScale),screenshotPosY+(screenshotHeight*widgetScale), 2*widgetScale, true) -- close button + local size = (screenshotHeight*widgetScale)*1.2 + local width = size*0.011 + gl.Color(1,1,1,0.66) + gl.PushMatrix() + gl.Translate(screenshotPosX+((screenshotWidth*widgetScale)/2), screenshotPosY+((screenshotHeight*widgetScale)/2),0) + gl.Rotate(-60,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(120,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.PopMatrix() + end + end + end +end + + +function CreateLists() + + CheckTime() --this also calls CheckPlayers + + UpdateRecentBroadcasters() + UpdateAlliances() + GetAliveAllyTeams() + + if m_resources.active then + UpdateResources() + end + UpdatePlayerResources() + + --Create lists + CreateBackground() + CreateMainList() + CreateShareSlider() +end + +--------------------------------------------------------------------------------------------------- +-- Background gllist +--------------------------------------------------------------------------------------------------- + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +function CreateBackground() + + if Background then + gl_DeleteList(Background) + end + local margin = backgroundMargin + + + local BLcornerX = widgetPosX - margin + local BLcornerY = widgetPosY - margin + local TRcornerX = widgetPosX + widgetWidth + margin + local TRcornerY = widgetPosY + widgetHeight - 1 + margin + + if collapsed then + TRcornerY = widgetPosY - margin + collapsedHeight + end + + local absLeft = math.floor(BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale-1))) + local absBottom = math.floor(BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale-1))) + local absRight = math.ceil(TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale-1))) + local absTop = math.ceil(TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale-1))) + apiAbsPosition = {absTop,absLeft,absBottom,absRight,widgetScale,right,collapsed} + + local padding = 3*widgetScale + local paddingBottom = padding + local paddingRight = padding + local paddingTop = padding + local paddingLeft = padding + if absBottom <= 0.2 then paddingBottom = 0 end + if absRight >= vsx-0.2 then paddingRight = 0 end + if absTop <= 0.2 then paddingTop = 0 end + if absLeft <= 0.2 then paddingLeft = 0 end + + if WG['guishader'] then + BackgroundGuishader = gl_CreateList( function() + RectRound(absLeft,absBottom,absRight,absTop,padding*2, math.min(paddingLeft,paddingTop), math.min(paddingTop,paddingRight), math.min(paddingRight,paddingBottom), math.min(paddingBottom,paddingLeft)) + end) + WG['guishader'].InsertDlist(BackgroundGuishader, 'advplayerlist') + --WG['guishader'].InsertRect(absLeft,absBottom,absRight,absTop,'advplayerlist') + end + Background = gl_CreateList(function() + + gl_Color(0,0,0,ui_opacity) + RectRound(absLeft,absBottom,absRight,absTop,padding*2, math.min(paddingLeft,paddingTop), math.min(paddingTop,paddingRight), math.min(paddingRight,paddingBottom), math.min(paddingBottom,paddingLeft)) + gl_Color(1,1,1,ui_opacity*0.055) + RectRound(absLeft+paddingLeft,absBottom+paddingBottom,absRight-paddingRight,absTop-paddingTop,padding*1.66, math.min(paddingLeft,paddingTop), math.min(paddingTop,paddingRight), math.min(paddingRight,paddingBottom), math.min(paddingBottom,paddingLeft)) + if collapsed then + font:Begin() + local text = 'Playerlist' + local yOffset = collapsedHeight*0.5 + local xOffset = collapsedHeight/6 + font:SetTextColor(0,0,0,0.2) + font:Print(text, widgetPosX - 1 + xOffset, TRcornerY-padding -yOffset, 13, "") + font:Print(text, widgetPosX + 1 + xOffset, TRcornerY-padding -yOffset, 13, "") + font:SetTextColor(0.9,0.9,0.9,0.75) + font:Print(text, widgetPosX + xOffset, TRcornerY-padding -yOffset+0.8, 13, "n") + font:End() + end + + gl_Color(1,1,1,1) + end) + +end + +--------------------------------------------------------------------------------------------------- +-- Main (player) gllist +--------------------------------------------------------------------------------------------------- + + +function UpdateResources() + if energyPlayer ~= nil then + if energyPlayer.team == myTeamID then + local current,storage = Spring_GetTeamResources(myTeamID,"energy") + amountEMMax = storage - current + amountEM = amountEMMax*sliderPosition/39 + amountEM = amountEM-(amountEM%1) + else + amountEMMax = Spring_GetTeamResources(myTeamID,"energy") + amountEM = amountEMMax*sliderPosition/39 + amountEM = amountEM-(amountEM%1) + end + end + if metalPlayer ~= nil then + if metalPlayer.team == myTeamID then + local current, storage = Spring_GetTeamResources(myTeamID,"metal") + amountEMMax = storage - current + amountEM = amountEMMax*sliderPosition/39 + amountEM = amountEM-(amountEM%1) + else + amountEMMax = Spring_GetTeamResources(myTeamID,"metal") + amountEM = amountEMMax*sliderPosition/39 + amountEM = amountEM-(amountEM%1) + end + end +end + +function CheckTime() + local period = 0.5 + now = os.clock() + if now > (lastTime + period) then + lastTime = now + CheckPlayersChange() + if blink == true then + blink = false + else + blink = true + end + for playerID =0, 63 do + if player[playerID] ~= nil then + if player[playerID].pointTime ~= nil then + if player[playerID].pointTime <= now then + player[playerID].pointX = nil + player[playerID].pointY = nil + player[playerID].pointZ = nil + player[playerID].pointTime = nil + end + end + end + end + end +end + + +function CreateMainList(tip) + + --Spring.Echo("List Updated") + + numberOfSpecs = GetNumberOfSpecs() + + local mouseX,mouseY = Spring_GetMouseState() + local leader + + if MainList then + gl_DeleteList(MainList) + end + tipText = nil + MainList = gl_CreateList(function() + drawTipText = nil + for i, drawObject in ipairs(drawList) do + if drawObject == -5 then + specsLabelOffset = drawListOffset[i] + local specAmount = numberOfSpecs + if numberOfSpecs == 0 or (specListShow and numberOfSpecs < 10) then + specAmount = "" + end + DrawLabel(" Spectators "..specAmount, drawListOffset[i], specListShow) + if Spring.GetGameFrame() <= 0 then + if specListShow then + DrawLabelTip("(click to hide specs)", drawListOffset[i], 95) + else + DrawLabelTip("(click to show specs)", drawListOffset[i], 95) + end + end + elseif drawObject == -4 then + DrawSeparator(drawListOffset[i]) + elseif drawObject == -3 then + DrawLabel(" Enemies", drawListOffset[i], true) + elseif drawObject == -2 then + DrawLabel(" Allies", drawListOffset[i], true) + if Spring.GetGameFrame() <= 0 then + DrawLabelTip("(dbl-click playername to track)", drawListOffset[i], 46) + end + elseif drawObject == -1 then + leader = true + else + DrawPlayer(drawObject, leader, drawListOffset[i], mouseX, mouseY) + end + + -- draw player tooltip later so they will be on top of players drawn below + if tipText ~= nil then + drawTipText = tipText + drawTipMouseX = mouseX + drawTipMouseY = mouseY + end + + end + if drawTipText ~= nil then + tipText = drawTipText + if not WG['tooltip'] then -- else use tooltip widget (in widget:update) + DrawTip(drawTipMouseX, drawTipMouseY) + end + end + end) + +end + +function DrawLabel(text, vOffset, drawSeparator) + if widgetWidth < 67 then + text = string.sub(text, 0, 1) + end + font:Begin() + --font:SetTextColor(0,0,0,0.2) + --font:Print(text, widgetPosX - 1, widgetPosY + widgetHeight -vOffset+6.6, 12, "") + --font:Print(text, widgetPosX + 1, widgetPosY + widgetHeight -vOffset+6.6, 12, "") + font:SetTextColor(0.9,0.9,0.9,0.75) + font:Print(text, widgetPosX, widgetPosY + widgetHeight -vOffset+7.5, 12, "on") + font:End() + if drawSeparator then + --DrawSeparator(vOffset) + end +end + +function DrawLabelTip(text, vOffset, xOffset) + if widgetWidth < 67 then + text = string.sub(text, 0, 1) + end + font:Begin() + --font:SetTextColor(0,0,0,0.08) + --font:Print(text, widgetPosX + xOffset - 1, widgetPosY + widgetHeight -vOffset+6.8, 10, "") + --font:Print(text, widgetPosX + xOffset + 1, widgetPosY + widgetHeight -vOffset+6.8, 10, "") + font:SetTextColor(0.9,0.9,0.9,0.35) + font:Print(text, widgetPosX + xOffset, widgetPosY + widgetHeight -vOffset+7.5, 10, "on") + font:End() +end + +function DrawSeparator(vOffset) + vOffset = vOffset - 2 + gl_Color(0.55,0.55,0.55,0.45) + gl_Rect(widgetPosX+2, widgetPosY + widgetHeight -vOffset+(1/widgetScale), widgetPosX + widgetWidth-2, widgetPosY + widgetHeight -vOffset) + gl_Color(0,0,0,0.3) + gl_Rect(widgetPosX+2, widgetPosY + widgetHeight -vOffset, widgetPosX + widgetWidth-2, widgetPosY + widgetHeight -vOffset-(1/widgetScale)) + gl_Color(1,1,1) +end + +function DrawLabelRightside(text, vOffset) + local textLength = (font:GetTextWidth(text)*12)*widgetScale + font:Begin() + font:SetTextColor(1,1,1,0.13) + font:Print(text, widgetRight - textLength, widgetPosY + widgetHeight -vOffset+7.5, 12, "n") + font:End() +end + + + +function DrawPlayer(playerID, leader, vOffset, mouseX, mouseY) + tipY = nil + local rank = player[playerID].rank + local skill = player[playerID].skill + local name = player[playerID].name + local team = player[playerID].team + local allyteam = player[playerID].allyteam + local side = player[playerID].side + local red = player[playerID].red + local green = player[playerID].green + local blue = player[playerID].blue + local dark = player[playerID].dark + local pingLvl = player[playerID].pingLvl + local cpuLvl = player[playerID].cpuLvl + local ping = player[playerID].ping + local cpu = player[playerID].cpu + local country = player[playerID].country + local spec = player[playerID].spec + local totake = player[playerID].totake + local needm = player[playerID].needm + local neede = player[playerID].neede + local dead = player[playerID].dead + local ai = player[playerID].ai + local alliances = player[playerID].alliances + local posY = widgetPosY + widgetHeight - vOffset + local tipPosY = widgetPosY + ((widgetHeight - vOffset)*widgetScale) + + local alpha = 0.44-- alpha used to show inactivity for specs + + if WG['betfrontend'] ~= nil then + playerScores = WG['betfrontend'].GetPlayerScores() + end + + alpha = 0.33 + local alphaActivity = 0 + -- keyboard/mouse activity + if lastActivity[playerID] ~= nil and type(lastActivity[playerID]) == "number" then + alphaActivity = (8 - math.floor(now-lastActivity[playerID])) / 5.5 + if alphaActivity > 1 then alphaActivity = 1 end + if alphaActivity < 0 then alphaActivity = 0 end + alphaActivity = 0.33 + (alphaActivity*0.21) + alpha = alphaActivity + end + -- camera activity + if recentBroadcasters[playerID] ~= nil and type(recentBroadcasters[playerID]) == "number" then + local alphaCam = (13 - math.floor(recentBroadcasters[playerID])) / 8.5 + if alphaCam > 1 then alphaCam = 1 end + if alphaCam < 0 then alphaCam = 0 end + alpha = 0.33 + (alphaCam*0.42) + if alpha < alphaActivity then alpha = alphaActivity end + end + + + if mouseY >= tipPosY and mouseY <= tipPosY + (16*widgetScale) then tipY = true end + + + if (lockPlayerID ~= nil and lockPlayerID == playerID) then -- active + DrawCamera(posY, true) + end + + if spec == false then --player + if not dead and alliances ~= nil and #alliances > 0 then + DrawAlliances(alliances, posY) + end + if leader == true then -- take / share buttons + if mySpecStatus == false then + if allyteam == myAllyTeamID then + if m_take.active == true then + if totake == true then + DrawTakeSignal(posY) + if tipY == true then TakeTip(mouseX) end + end + end + if m_share.active == true and dead ~= true then + DrawShareButtons(posY, needm, neede) + if tipY == true then ShareTip(mouseX, playerID) end + end + end + if drawAllyButton and dead ~= true then + if tipY == true then AllyTip(mouseX, playerID) end + end + else + if m_indent.active == true and Spring_GetMyTeamID() == team then + DrawDot(posY) + end + end + gl_Color(red,green,blue,1) + if m_ID.active == true then + DrawID(team, posY, dark, dead) + end + if m_skill.active == true then + DrawSkill(skill, posY, dark, name) + end + end + gl_Color(red,green,blue,1) + if m_rank.active == true then + DrawRank(rank, posY) + end + if m_country.active == true and country ~= "" then + DrawCountry(country, posY) + end + --gl_Color(red,green,blue,1) + gl_Color(1,1,1,0.45) + if name ~= absentName and m_side.active == true then + DrawSidePic(team, playerID, posY, leader, dark, ai) + end + gl_Color(red,green,blue,1) + if m_name.active == true then + DrawName(name, team, posY, dark, playerID) + end + if m_alliance.active == true and drawAllyButton and not mySpecStatus and not dead and team ~= myTeamID then + DrawAlly(posY, player[playerID].team) + end + + if m_resources.active and aliveAllyTeams[allyteam] ~= nil and player[playerID].energy ~= nil then + if mySpecStatus or myAllyTeamID == allyteam then + local e = player[playerID].energy + local es = player[playerID].energyStorage + local ei = player[playerID].energyIncome + local m = player[playerID].metal + local ms = player[playerID].metalStorage + local mi = player[playerID].metalIncome + if es > 0 then + DrawResources(e, es, m, ms, posY, dead) + if tipY == true then ResourcesTip(mouseX, e, es, ei, m, ms, mi) end + end + end + end + else -- spectator + gl_Color(1,1,1,1) + if specListShow == true and m_name.active == true then + + if playerSpecs[playerID] ~= nil and (lockPlayerID ~= nil and lockPlayerID ~= playerID or lockPlayerID == nil) then + if recentBroadcasters[playerID] ~= nil and type(recentBroadcasters[playerID]) == "number" then + DrawCamera(posY, false) + end + end + if playerScores[playerID] ~= nil then + DrawChips(playerID, posY) + end + DrawSmallName(name, team, posY, false, playerID, alpha) + end + + end + + if m_cpuping.active == true then + if cpuLvl ~= nil then -- draws CPU usage and ping icons (except AI and ghost teams) + DrawPingCpu(pingLvl,cpuLvl,posY,spec,1,cpu,lastFpsData[playerID]) + if tipY == true then PingCpuTip(mouseX, ping, cpu, lastFpsData[playerID], lastGpuMemData[playerID], lastSystemData[playerID], name) end + end + end + + gl_Color(1,1,1,1) + if playerID < 64 then + + if m_chat.active == true and mySpecStatus == false and spec == false then + if playerID ~= myPlayerID then + DrawChatButton(posY) + end + end + + if m_point.active then + if player[playerID].pointTime ~= nil then + if player[playerID].allyteam == myAllyTeamID or mySpecStatus == true then + --if blink == true then + DrawPoint(posY, player[playerID].pointTime-now) + --end + if tipY == true then PointTip(mouseX) end + end + end + end + + end + leader = false + gl_Texture(false) +end + +function DrawTakeSignal(posY) + + if blink == true then -- Draws a blinking rectangle if the player of the same team left (/take option) + if right then + gl_Color(0.7,0.7,0.7) + gl_Texture(pics["arrowPic"]) + DrawRect(widgetPosX - 14, posY, widgetPosX, posY + 16) + gl_Color(1,1,1) + gl_Texture(pics["takePic"]) + DrawRect(widgetPosX - 57, posY - 15, widgetPosX - 12, posY + 32) + else + local leftPosX = widgetPosX + widgetWidth + gl_Color(0.7,0.7,0.7) + gl_Texture(pics["arrowPic"]) + DrawRect(leftPosX + 14, posY, leftPosX, posY + 16) + gl_Color(1,1,1) + gl_Texture(pics["takePic"]) + DrawRect(leftPosX + 12, posY - 15, leftPosX + 57, posY + 32) + end + end +end + +function DrawShareButtons(posY, needm, neede) + gl_Color(1,1,1,1) + gl_Texture(pics["unitsPic"]) -- Share UNIT BUTTON + DrawRect(m_share.posX + widgetPosX + 1, posY, m_share.posX + widgetPosX + 17, posY + 16) + gl_Texture(pics["energyPic"]) -- share ENERGY BUTTON + DrawRect(m_share.posX + widgetPosX + 17, posY, m_share.posX + widgetPosX + 33, posY + 16) + gl_Texture(pics["metalPic"]) -- share METAL BUTTON + DrawRect(m_share.posX + widgetPosX + 33, posY, m_share.posX + widgetPosX + 49, posY + 16) + gl_Texture(pics["lowPic"]) + if needm == true then + DrawRect(m_share.posX + widgetPosX + 33, posY, m_share.posX + widgetPosX + 49, posY + 16) + end + if neede == true then + DrawRect(m_share.posX + widgetPosX + 17, posY, m_share.posX + widgetPosX + 33, posY + 16) + end + gl_Texture(false) +end + + +function DrawChatButton(posY) + gl_Texture(pics["chatPic"]) + DrawRect(m_chat.posX + widgetPosX + 1, posY, m_chat.posX + widgetPosX + 17, posY + 16) +end + +function DrawResources(energy, energyStorage, metal, metalStorage, posY, dead) + local paddingLeft = 2 + local paddingRight = 2 + local barWidth = m_resources.width - paddingLeft - paddingRight + local y1Offset = 7 + local y2Offset = 5 + if dead then + y1Offset = 7.4 + y2Offset = 6 + end + gl_Color(1,1,1,0.14) + gl_Texture(pics["resbarBgPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + barWidth, posY + y2Offset) + gl_Color(1,1,1,1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/metalStorage)*metal), posY + y2Offset) + + if ((barWidth/metalStorage)*metal) > 0.8 then + local glowsize = 10 + gl_Color(1,1,1.2,0.08) + gl_Texture(pics["barGlowCenterPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/metalStorage)*metal), posY + y2Offset-glowsize) + + gl_Texture(pics["barGlowEdgePic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft-(glowsize*1.8), posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset-glowsize) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth/metalStorage)*metal)+(glowsize*1.8), posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/metalStorage)*metal), posY + y2Offset-glowsize) + end + + if not dead then + y1Offset = 11 + y2Offset = 9 + else + y1Offset = 10 + y2Offset = 8.6 + end + gl_Color(1,1,0,0.14) + gl_Texture(pics["resbarBgPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + barWidth, posY + y2Offset) + gl_Color(1,1,0,1) + gl_Texture(pics["resbarPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/energyStorage)*energy), posY + y2Offset) + + if ((barWidth/energyStorage)*energy) > 0.8 then + local glowsize = 10 + gl_Color(1,1,0.2,0.08) + gl_Texture(pics["barGlowCenterPic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft, posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/energyStorage)*energy), posY + y2Offset-glowsize) + + gl_Texture(pics["barGlowEdgePic"]) + DrawRect(m_resources.posX + widgetPosX + paddingLeft-(glowsize*1.8), posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft, posY + y2Offset-glowsize) + DrawRect(m_resources.posX + widgetPosX + paddingLeft + ((barWidth/energyStorage)*energy)+(glowsize*1.8), posY + y1Offset+glowsize, m_resources.posX + widgetPosX + paddingLeft + ((barWidth/energyStorage)*energy), posY + y2Offset-glowsize) + end +end + +function DrawChips(playerID, posY) + local xPos = m_name.posX + widgetPosX - 6 + font:Begin() + font:SetTextColor(0.75,0.75,0.75,0.8) + font:Print(playerScores[playerID].score, xPos-5, posY+4, 9.5, "r") + font:End() + gl_Color(1,1,1,1) + gl_Texture(pics["chipPic"]) + DrawRect(xPos+4, posY+3.5, xPos-2.5, posY + 10) +end + +function DrawSidePic(team, playerID, posY, leader, dark, ai) + if gameStarted then + if leader == true then + gl_Texture(sidePics[team]) -- sets side image (for leaders) + else + gl_Texture(pics["notFirstPic"]) -- sets image for not leader of team players + end + DrawRect(m_side.posX + widgetPosX + 2, posY+1, m_side.posX + widgetPosX + 16, posY + 15) -- draws side image + --[[if dark == true then -- draws outline if player color is dark + gl_Color(1,1,1) + if leader == true then + gl_Texture(sidePicsWO[team]) + else + gl_Texture(notFirstPicWO) + end + DrawRect(m_side.posX + widgetPosX + 2, posY+1,m_side.posX + widgetPosX + 16, posY + 15) + gl_Texture(false) + end + ]]-- + gl_Texture(false) + else + DrawState(playerID, m_side.posX + widgetPosX, posY) + end +end + +function DrawRank(rank, posY) + if rank == 0 then + DrawRankImage(pics["rank0"], posY) + elseif rank == 1 then + DrawRankImage(pics["rank1"], posY) + elseif rank == 2 then + DrawRankImage(pics["rank2"], posY) + elseif rank == 3 then + DrawRankImage(pics["rank3"], posY) + elseif rank == 4 then + DrawRankImage(pics["rank4"], posY) + elseif rank == 5 then + DrawRankImage(pics["rank5"], posY) + elseif rank == 6 then + DrawRankImage(pics["rank6"], posY) + elseif rank == 7 then + DrawRankImage(pics["rank7"], posY) + else + --DrawRankImage(rank8, posY) + end + gl_Color(1,1,1,1) +end + +function DrawRankImage(rankImage, posY) + gl_Color(1,1,1) + gl_Texture(rankImage) + DrawRect(m_rank.posX + widgetPosX + 3, posY+1, m_rank.posX + widgetPosX + 17, posY + 15) +end + + +local function RectQuad(px,py,sx,sy) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o,1-o) + gl.Vertex(px, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) +end +function DrawRect(px,py,sx,sy) + --local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + gl.BeginEnd(GL.QUADS, RectQuad, px,py,sx,sy) +end + +function DrawAlly(posY, team) + if Spring_AreTeamsAllied(team, myTeamID) then + gl_Color(0,1,0, 0.44) + else + gl_Color(1,0,0, 0.44) + end + gl_Texture(pics["allyPic"]) + DrawRect(m_alliance.posX + widgetPosX + 3, posY+1, m_alliance.posX + widgetPosX + 17, posY + 15) +end + +function DrawCountry(country, posY) + if country ~= nil and country ~= "??" then + gl_Texture(flagsDirectory..string.upper(country)..".dds") + gl_Color(1,1,1) + DrawRect(m_country.posX + widgetPosX + 3, posY+1, m_country.posX + widgetPosX + 17, posY + 15) + end +end + +function DrawDot(posY) + gl_Color(1,1,1,0.70) + gl_Texture(pics["currentPic"]) + DrawRect(m_indent.posX + widgetPosX-1 , posY+3, m_indent.posX + widgetPosX + 7, posY + 11) +end + +function DrawCamera(posY,active) + if active ~= nil and active then + gl_Color(1,1,1,0.7) + else + gl_Color(1,1,1,0.13) + end + gl_Texture(pics["cameraPic"]) + DrawRect(m_indent.posX + widgetPosX-1.5 , posY+2, m_indent.posX + widgetPosX + 9, posY + 12.4) +end + +function colourNames(teamID) + nameColourR,nameColourG,nameColourB,nameColourA = Spring_GetTeamColor(teamID) + R255 = math.floor(nameColourR*255) --the first \255 is just a tag (not colour setting) no part can end with a zero due to engine limitation (C) + G255 = math.floor(nameColourG*255) + B255 = math.floor(nameColourB*255) + if ( R255%10 == 0) then + R255 = R255+1 + end + if( G255%10 == 0) then + G255 = G255+1 + end + if ( B255%10 == 0) then + B255 = B255+1 + end + return "\255"..string.char(R255)..string.char(G255)..string.char(B255) --works thanks to zwzsg +end + +function DrawState(playerID, posX, posY) +-- note that adv pl list uses a phantom pID for absent players, so this will always show unready for players not ingame + local ready = (playerReadyState[playerID]==1) or (playerReadyState[playerID]==2) or (playerReadyState[playerID]==-1) + local hasStartPoint = (playerReadyState[playerID]==4) + if ai then + gl_Color(0.1,0.1,0.97,1) + else + if ready then + gl_Color(0.1,0.95,0.2,1) + else + if hasStartPoint then + gl_Color(1,0.65,0.1,1) + else + gl_Color(0.8,0.1,0.1,1) + end + end + end + gl_Texture(pics["readyTexture"]) + DrawRect(posX, posY - 1 , posX + 16, posY + 16) + gl_Color(1,1,1,1) +end + +function DrawAlliances(alliances, posY) -- still a problem is that teams with the same/similar color can be misleading + local posX = widgetPosX + m_name.posX + local width = m_name.width / #alliances + local padding = 2 + for i,playerID in pairs(alliances) do + if player[playerID] ~= nil and player[playerID].red ~= nil then + gl_Color(0,0,0,0.25) + RectRound(posX+(width*(i-1)), posY - 3 , posX + (width*i), posY + 19, 2) + gl_Color(player[playerID].red, player[playerID].green, player[playerID].blue, 0.5) + RectRound(posX+(width*(i-1)) + padding, posY - 3 + padding , posX + (width*i)- padding, posY + 19 - padding, 2) + end + end + gl_Color(1,1,1,1) +end + +function DrawName(name, team, posY, dark, playerID) + local willSub = "" + local ignored = WG.ignoredPlayers and WG.ignoredPlayers[name] + if not gameStarted then + if playerID>=64 then + willSub = (Spring.GetGameRulesParam("Player" .. (playerID-64) .. "willSub")==1) and " (sub)" or "" --pID-64 because apl uses dummy playerIDs for absent players + else + willSub = (Spring.GetGameRulesParam("Player" .. (playerID) .. "willSub")==1) and " (sub)" or "" + end + end + local nameText = name .. willSub + + + local nameColourR,nameColourG,nameColourB,nameColourA = Spring_GetTeamColor(team) + local xPadding = 0 + + -- includes readystate icon if factions arent shown + if not gameStarted and not m_side.active then + xPadding = 16 + DrawState(playerID, m_name.posX + widgetPosX, posY) + end + if (nameColourR + nameColourG*1.2 + nameColourB*0.4) < 0.8 then + font2:Begin() + font2:Print(colourNames(team) .. nameText, m_name.posX + widgetPosX + 3 + xPadding, posY + 4, 14, "o") + font2:End() + else + font2:Begin() + font2:SetTextColor(0,0,0,0.4) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(nameText, m_name.posX + widgetPosX + 2 + xPadding, posY + 3, 14, "n") -- draws name + font2:Print(nameText, m_name.posX + widgetPosX + 4 + xPadding, posY + 3, 14, "n") -- draws name + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,1) + font2:Print(colourNames(team) .. nameText, m_name.posX + widgetPosX + 3 + xPadding, posY + 4, 14, "n") + font2:End() + end + if ignored then + gl_Color(1,1,1,0.9) + local x = m_name.posX + widgetPosX + 2 + xPadding + local y = posY + 7 + local w = font:GetTextWidth(nameText) * 14 + 2 + local h = 2 + gl_Texture(false) + DrawRect(x,y,x+w,y+h) + end + gl_Color(1,1,1) +end + + +function DrawSmallName(name, team, posY, dark, playerID, alpha) + if team == nil then + return + end + + local ignored = WG.ignoredPlayers and WG.ignoredPlayers[name] + if originalColourNames[playerID] then + name = originalColourNames[playerID] .. name + end + + local textindent = 4 + local explayerindent = -3 + if m_indent.active or m_rank.active or m_side.active or m_ID.active then + textindent = 0 + end + local nameColourR,nameColourG,nameColourB,nameColourA = 1,1,1,1 + + if playerSpecs[playerID] ~= nil then + nameColourR,nameColourG,nameColourB,nameColourA = Spring_GetTeamColor(team) + if (nameColourR + nameColourG*1.2 + nameColourB*0.4) < 0.8 then + font2:Begin() + font2:Print(colourNames(team) .. name, m_name.posX + textindent + explayerindent + widgetPosX + 3, posY + 4, 11, "o") + font2:End() + else + font2:Begin() + font2:SetTextColor(0,0,0,0.3) + font2:SetOutlineColor(0,0,0,0.3) + font2:Print(name, m_name.posX + textindent + explayerindent + widgetPosX + 2, posY + 3.2, 11, "n") -- draws name + font2:Print(name, m_name.posX + textindent + explayerindent + widgetPosX + 4, posY + 3.2, 11, "n") -- draws name + font2:SetTextColor(1,1,1,0.78) + font2:SetOutlineColor(0,0,0,0.3) + --gl_Color(nameColourR,nameColourG,nameColourB,0.78) + font2:Print(colourNames(team) .. name, m_name.posX + textindent + explayerindent + widgetPosX + 3, posY + 4, 11, "n") + font2:End() + end + else + font2:Begin() + font2:SetTextColor(0,0,0,0.3) + font2:SetOutlineColor(0,0,0,0.3) + font2:Print(name, m_name.posX + textindent + widgetPosX + 2.2, posY + 3.3, 10, "n") + font2:Print(name, m_name.posX + textindent + widgetPosX + 3.8, posY + 3.3, 10, "n") + font2:SetTextColor(1,1,1,alpha) + font2:Print(name, m_name.posX + textindent + widgetPosX + 3, posY + 4, 10, "n") + font2:End() + end + if ignored then + gl_Color(1,1,1,0.7) + local x = m_name.posX + textindent + widgetPosX + 2.2 + local y = posY + 6 + local w = font:GetTextWidth(name) * 10 + 2 + local h = 2 + gl_Texture(false) + DrawRect(x,y,x+w,y+h) + end + gl_Color(1,1,1) +end + +function DrawID(playerID, posY, dark, dead) + local spacer = "" + if playerID < 10 then + spacer = " " + end + local fontSize = 11 + local deadspace = 0 + font:Begin() + --if dead then + -- fontSize = 8 + -- deadspace = 1.5 + -- font:SetTextColor(0,0,0,0.4) + --else + -- font:SetTextColor(0,0,0,0.6) + --end + --gl_Text(colourNames(playerID) .. " ".. playerID .. "", m_ID.posX + widgetPosX+4.5, posY + 5, 11, "o") + --font:Print(spacer .. playerID .. "", m_ID.posX + deadspace + widgetPosX+4.5, posY + 4.1, fontSize, "n") + if dead then + font:SetTextColor(1,1,1,0.4) + else + font:SetTextColor(1,1,1,0.66) + end + font:Print(spacer .. playerID .. "", m_ID.posX + deadspace + widgetPosX+4.5, posY + 5, fontSize, "on") + font:End() +end + +function DrawSkill(skill, posY, dark) + font:Begin() + font:Print(skill, m_skill.posX + widgetPosX + m_skill.width - 2, posY + 5.3, 9.5, "or") + font:End() +end + +function DrawPingCpu(pingLvl, cpuLvl, posY, spec, alpha, cpu, fps) + gl_Texture(pics["pingPic"]) + if spec then + local grayvalue = 0.3 + (pingLvl / 15) + gl_Color(grayvalue,grayvalue,grayvalue,(0.2*pingLvl)) + DrawRect(m_cpuping.posX + widgetPosX + 12, posY+1, m_cpuping.posX + widgetPosX + 21, posY + 14) + else + gl_Color(pingCpuColors[pingLvl].r,pingCpuColors[pingLvl].g,pingCpuColors[pingLvl].b) + DrawRect(m_cpuping.posX + widgetPosX + 12, posY+1, m_cpuping.posX + widgetPosX + 24, posY + 15) + end + + grayvalue = 0.7 + (cpu/135) + + font:Begin() + if cpuText ~= nil and cpuText then + if type(cpu) == "number" then + if cpu > 99 then + cpu = 99 + end + if spec then + --font:SetTextColor(0,0,0,0.1+(grayvalue*0.4)) + --font:Print(cpu, m_cpuping.posX + widgetPosX+11, posY + 4.3, 9, "r") + font:SetTextColor(grayvalue,grayvalue,grayvalue,0.66*alpha*grayvalue) + font:Print(cpu, m_cpuping.posX + widgetPosX+11, posY + 5.3, 9, "ro") + else + --font:SetTextColor(0,0,0,0.12+(grayvalue*0.44)) + --font:Print(cpu, m_cpuping.posX + widgetPosX+11, posY + 4.3, 9.5, "r") + font:SetTextColor(grayvalue,grayvalue,grayvalue,0.8*alpha*grayvalue) + font:Print(cpu, m_cpuping.posX + widgetPosX+11, posY + 5.3, 9.5, "ro") + end + end + else + + if fps ~= nil then + if fps > 99 then + fps = 99 + end + grayvalue = 0.95 - (fps/195) + if fps < 0 then + fps = 0 + greyvalue = 1 + end + if spec then + --font:SetTextColor(0,0,0,0.1+(grayvalue*0.4)) + --font:Print(fps, m_cpuping.posX + widgetPosX+11, posY + 4.3, 9, "r") + font:SetTextColor(grayvalue,grayvalue,grayvalue,0.77*alpha*grayvalue) + font:Print(fps, m_cpuping.posX + widgetPosX+11, posY + 5.3, 9, "ro") + else + --font:SetTextColor(0,0,0,0.12+(grayvalue*0.44)) + --font:Print(fps, m_cpuping.posX + widgetPosX+11, posY + 4.3, 9.5, "r") + font:SetTextColor(grayvalue,grayvalue,grayvalue,alpha*grayvalue) + font:Print(fps, m_cpuping.posX + widgetPosX+11, posY + 5.3, 9.5, "ro") + end + else + gl_Texture(pics["cpuPic"]) + if spec then + gl_Color(grayvalue,grayvalue,grayvalue,0.1+(0.14*cpuLvl)) + DrawRect(m_cpuping.posX + widgetPosX + 2 , posY+1, m_cpuping.posX + widgetPosX + 13, posY + 14) + else + gl_Color(pingCpuColors[cpuLvl].r,pingCpuColors[cpuLvl].g,pingCpuColors[cpuLvl].b) + DrawRect(m_cpuping.posX + widgetPosX + 1, posY+1, m_cpuping.posX + widgetPosX + 14, posY + 15) + end + gl_Color(1,1,1,1) + end + end + font:End() +end + +function DrawPoint(posY,pointtime) + if right == true then + gl_Color(1,0,0,pointtime/pointDuration) + gl_Texture(pics["arrowPic"]) + DrawRect(widgetPosX - 18, posY, widgetPosX - 2, posY+ 14) + gl_Color(1,1,1,pointtime/pointDuration) + gl_Texture(pics["pointPic"]) + DrawRect(widgetPosX - 33, posY-1, widgetPosX - 17, posY + 15) + else + leftPosX = widgetPosX + widgetWidth + gl_Color(1,0,0,pointtime/pointDuration) + gl_Texture(pics["arrowPic"]) + DrawRect(leftPosX + 18, posY, leftPosX + 2, posY + 14) + gl_Color(1,1,1,pointtime/pointDuration) + gl_Texture(pics["pointPic"]) + DrawRect(leftPosX + 33, posY-1, leftPosX + 17, posY + 15) + end + gl_Color(1,1,1,1) +end + +function TakeTip(mouseX) + if right == true then + if mouseX >= widgetPosX - 57 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then + tipText = "Click to take abandoned units" + end + else + local leftPosX = widgetPosX + widgetWidth + if mouseX >= leftPosX + 1 * widgetScale and mouseX <= leftPosX + 57 * widgetScale then + tipText = "Click to take abandoned units" + end + end +end + +function ShareTip(mouseX, playerID) + if playerID == myPlayerID then + if mouseX >= widgetPosX + (m_share.posX + 1) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 17) * widgetScale then + tipText = "Double click to ask for Unit support" + elseif mouseX >= widgetPosX + (m_share.posX + 19) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 35) * widgetScale then + tipText = "Click and drag to ask for Energy" + elseif mouseX >= widgetPosX + (m_share.posX + 37) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 53) * widgetScale then + tipText = "Click and drag to ask for Metal" + end + else + if mouseX >= widgetPosX + (m_share.posX + 1) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 17) * widgetScale then + tipText = "Double click to share Units" + elseif mouseX >= widgetPosX + (m_share.posX + 19) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 35) * widgetScale then + tipText = "Click and drag to share Energy" + elseif mouseX >= widgetPosX + (m_share.posX + 37) * widgetScale and mouseX <= widgetPosX + (m_share.posX + 53) * widgetScale then + tipText = "Click and drag to share Metal" + end + end +end + + +function AllyTip(mouseX, playerID) + if mouseX >= widgetPosX + (m_alliance.posX + 1) * widgetScale and mouseX <= widgetPosX + (m_alliance.posX + 11) * widgetScale then + if Spring_AreTeamsAllied(player[playerID].team, myTeamID) then + tipText = "Click to become enemy" + else + tipText = "Click to become ally" + end + end +end + + +function ResourcesTip(mouseX, e, es, ei, m, ms, mi) + if mouseX >= widgetPosX + (m_resources.posX + 1) * widgetScale and mouseX <= widgetPosX + (m_resources.posX + m_resources.width) * widgetScale then + if e > 1000 then + e = math.floor(e / 100) * 100 + else + e = math.floor(e / 10) * 10 + end + if m > 1000 then + m = math.floor(m / 100) * 100 + else + m = math.floor(m / 10) * 10 + end + if ei == nil then + ei = 0 + mi = 0 + end + ei = math.floor(ei) + mi = math.floor(mi) + if ei > 1000 then + ei = math.floor(ei / 100) * 100 + elseif ei > 100 then + ei = math.floor(ei / 10) * 10 + end + if mi > 200 then + mi = math.floor(mi / 10) * 10 + end + if e >= 10000 then e = math.floor(e/1000).."k" end + if m >= 10000 then e = math.floor(m/1000).."k" end + if ei >= 10000 then ei = math.floor(ei/1000).."k" end + if mi >= 10000 then ei = math.floor(mi/1000).."k" end + tipText = "\255\255\255\000+"..ei.."\n\255\255\255\000"..e.."\n\255\255\255\255"..m.."\n\255\255\255\255+"..mi + end +end + + +function PingCpuTip(mouseX, pingLvl, cpuLvl, fps, gpumem, system, name) + if mouseX >= widgetPosX + (m_cpuping.posX + 13) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + 23) * widgetScale then + if pingLvl < 2000 then + pingLvl = pingLvl.." ms" + elseif pingLvl >= 2000 and pingLvl < 60000 then + pingLvl = round(pingLvl/1000,0).." sec" + elseif pingLvl >= 60000 then + pingLvl = round(pingLvl/60000,0).." min" + end + tipText = "sPing (Buffered, NOT actual latency!): "..pingLvl + elseif mouseX >= widgetPosX + (m_cpuping.posX + 1) * widgetScale and mouseX <= widgetPosX + (m_cpuping.posX + 11) * widgetScale then + tipText = "Cpu: "..cpuLvl.."%" + if fps ~= nil then + tipText = "FPS: "..fps.." "..tipText + end + if gpumem ~= nil then + tipText = tipText.." Gpu mem: "..gpumem.."%" + end + if system ~= nil then + tipText = "\255\000\000\000"..name.."\n\255\233\180\180"..tipText.."\n\255\240\240\240"..system + end + end +end + +function PointTip(mouseX) + if right == true then + if mouseX >= widgetPosX - 28 * widgetScale and mouseX <= widgetPosX - 1 * widgetScale then + tipText = "Click to reach the last point set by the player" + end + else + local leftPosX = widgetPosX + widgetWidth + if mouseX >= leftPosX + 1 * widgetScale and mouseX <= leftPosX + 28 * widgetScale then + tipText = "Click to reach the last point set by the player" + end + end +end + + +function stringToLines(str) + local t = {} + local function helper(line) t[#t+1] = line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + + +function DrawTip(mouseX, mouseY) + + local scaleDiffX = -((widgetPosX*widgetScale)-widgetPosX)/widgetScale + local scaleDiffY = -((widgetPosY*widgetScale)-widgetPosY)/widgetScale + local scaleReset = widgetScale / widgetScale / widgetScale + gl.Translate(-scaleDiffX,-scaleDiffY,0) + gl.Scale(scaleReset,scaleReset,0) + + text = tipText --this is needed because we're inside a gllist + if text ~= nil then + local fontSize = 14*widgetScale + local tw = fontSize*font:GetTextWidth(text) + (20*widgetScale) + local _, lines = string.gsub(text, "\n", "") + lines = lines + 1 + + local lineHeight = fontSize + (fontSize/4.5) + local th = lineHeight * lines + (fontSize*0.75) + + local oldWidgetScale = widgetScale + widgetScale = 1 + + local bottomY = mouseY-(th-(26*oldWidgetScale)) + local ycorrection = 0 + if bottomY < 0 then ycorrection = (15*widgetScale)-bottomY end + + local padding = -1.8*oldWidgetScale + + local xoffset = -15*oldWidgetScale + if right then + gl_Color(0.8,0.8,0.8,0.75) + RectRound(mouseX-tw+padding+xoffset, bottomY+ycorrection+padding, mouseX+xoffset-padding, (mouseY+(26*oldWidgetScale)+ycorrection)-padding, 4.5*oldWidgetScale) + + padding = 0*oldWidgetScale + gl_Color(0,0,0,0.28) + RectRound(mouseX-tw+padding+xoffset, bottomY+ycorrection+padding, mouseX+xoffset-padding, (mouseY+(26*oldWidgetScale)+ycorrection)-padding, 3.5*oldWidgetScale) + else + xoffset = 22*oldWidgetScale + gl_Color(0.8,0.8,0.8,0.75) + RectRound(mouseX+padding+xoffset, bottomY+ycorrection+padding, mouseX+tw+xoffset-padding, (mouseY+(26*oldWidgetScale)+ycorrection)-padding, 4.5*oldWidgetScale) + + padding = 0*oldWidgetScale + gl_Color(0,0,0,0.28) + RectRound(mouseX+padding+xoffset, bottomY+ycorrection+padding, mouseX+tw+xoffset+padding, (mouseY+(26*oldWidgetScale)+ycorrection)-padding, 3.5*oldWidgetScale) + end + widgetScale = oldWidgetScale + + -- draw text + local textLines = stringToLines(text) + th = 0 + font:Begin() + for i, line in ipairs(textLines) do + if right then + font:Print('\255\244\244\244'..line, mouseX+xoffset+(8*widgetScale)-tw, mouseY+(8*widgetScale)+ycorrection+th, fontSize, "o") + else + font:Print('\255\244\244\244'..line, mouseX+xoffset+(8*widgetScale), mouseY+(8*widgetScale)+ycorrection+th, fontSize, "o") + end + th = th - lineHeight + end + font:End() + end + tipText = nil + + gl.Color(1,1,1,1) + gl.Scale(widgetScale,widgetScale,0) + gl.Translate(scaleDiffX,scaleDiffY,0) +end + +--------------------------------------------------------------------------------------------------- +-- Share slider gllist +--------------------------------------------------------------------------------------------------- + +function CreateShareSlider() + + if ShareSlider then + gl_DeleteList(ShareSlider) + end + + ShareSlider = gl_CreateList(function() + + font:Begin() + local posY + if energyPlayer ~= nil then + posY = widgetPosY + widgetHeight - energyPlayer.posY + gl_Texture(pics["barPic"]) + DrawRect(m_share.posX + widgetPosX + 16,posY-3,m_share.posX + widgetPosX + 34,posY+58) + gl_Texture(pics["energyPic"]) + DrawRect(m_share.posX + widgetPosX + 17,posY+sliderPosition,m_share.posX + widgetPosX + 33,posY+16+sliderPosition) + gl_Texture(pics["amountPic"]) + if right == true then + DrawRect(m_share.posX + widgetPosX - 28,posY-1+sliderPosition, m_share.posX + widgetPosX + 19,posY+17+sliderPosition) + gl_Texture(false) + font:Print(amountEM.."", m_share.posX + widgetPosX - 5,posY+3+sliderPosition, 14, "on") + else + DrawRect(m_share.posX + widgetPosX + 76,posY-1+sliderPosition, m_share.posX + widgetPosX + 31,posY+17+sliderPosition) + gl_Texture(false) + font:Print(amountEM.."", m_share.posX + widgetPosX + 55,posY+3+sliderPosition, 14, "on") + end + elseif metalPlayer ~= nil then + posY = widgetPosY + widgetHeight - metalPlayer.posY + gl_Texture(pics["barPic"]) + DrawRect(m_share.posX + widgetPosX + 32,posY-3,m_share.posX + widgetPosX + 50,posY+58) + gl_Texture(pics["metalPic"]) + DrawRect(m_share.posX + widgetPosX + 33, posY+sliderPosition,m_share.posX + widgetPosX + 49,posY+16+sliderPosition) + gl_Texture(pics["amountPic"]) + if right == true then + DrawRect(m_share.posX + widgetPosX - 12,posY-1+sliderPosition, m_share.posX + widgetPosX + 35,posY+17+sliderPosition) + gl_Texture(false) + font:Print(amountEM.."", m_share.posX + widgetPosX + 11,posY+3+sliderPosition, 14, "on") + else + DrawRect(m_share.posX + widgetPosX + 88,posY-1+sliderPosition, m_share.posX + widgetPosX + 47,posY+17+sliderPosition) + gl_Texture(false) + font:Print(amountEM.."", m_share.posX + widgetPosX + 71,posY+3+sliderPosition, 14, "on") + end + end + font:End() + + end) +end + +function GetCpuLvl(cpuUsage) + + -- set the 5 cpu usage levels (green to red) + + if cpuUsage < 0.15 then return 1 + elseif cpuUsage < 0.3 then return 2 + elseif cpuUsage < 0.45 then return 3 + elseif cpuUsage < 0.65 then return 4 + else return 5 + end + +end + +function GetPingLvl(ping) + + -- set the 5 ping levels (green to red) + + if ping < 0.15 then return 1 + elseif ping < 0.3 then return 2 + elseif ping < 0.7 then return 3 + elseif ping < 1.5 then return 4 + else return 5 + end +end + + +--------------------------------------------------------------------------------------------------- +-- Mouse +--------------------------------------------------------------------------------------------------- + +local prevClickedName +local clickedName + +function widget:MousePress(x,y,button) --super ugly code here + + if collapsed then return end + + local t = false -- true if the object is a team leader + local clickedPlayer + local posY + local clickTime = os.clock() + if button == 1 then + local alt,ctrl,meta,shift = Spring.GetModKeyState() + sliderPosition = 0 + amountEM = 0 + -- spectators label onclick + posY = widgetPosY + widgetHeight - specsLabelOffset + if numberOfSpecs > 0 and IsOnRect(x, y, widgetPosX + 2, posY+2, widgetPosX + widgetWidth - 2, posY+20) then + specListShow = not specListShow + SetModulesPositionX() --why? + SortList() + CreateLists() + return true + end + + for _,i in ipairs(drawList) do -- i = object # + if i > -1 then + clickedPlayer = player[i] + clickedPlayer.id = i + clickedName = clickedPlayer.name + posY = widgetPosY + widgetHeight - clickedPlayer.posY + end + + if mySpecStatus == true then + + if i == -1 then + t = true + else + t = false + if m_point.active then + if i > -1 and i < 64 then + if clickedPlayer.pointTime ~= nil then + if right == true then + if IsOnRect(x,y, widgetPosX - 33, posY - 2,widgetPosX - 17, posY + 16) then --point button + Spring.SetCameraTarget(clickedPlayer.pointX,clickedPlayer.pointY,clickedPlayer.pointZ,1) -- -- + return true -- + end -- + else -- + if IsOnRect(x,y, widgetPosX + widgetWidth + 17, posY-2,widgetPosX + widgetWidth + 33, posY + 16) then -- + Spring.SetCameraTarget(clickedPlayer.pointX,clickedPlayer.pointY,clickedPlayer.pointZ,1) -- + return true + end + end + end + end + end + end + if i>-1 and i<64 then + if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, m_name.posX + widgetPosX +1, posY, m_name.posX + widgetPosX + m_name.width, posY+16) then + if ctrl then + Spring_SendCommands{"toggleignore "..clickedPlayer.name} + return true + end + + if (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedName == prevClickedName then + LockCamera(i) + prevClickedName = '' + SortList() + CreateLists() + return true + end + prevClickedName = clickedName + end + end + + else + if t == true then + if clickedPlayer.allyteam == myAllyTeamID then + if m_take.active == true then + if clickedPlayer.totake == true then + if right == true then + if IsOnRect(x,y, widgetPosX - 57, posY ,widgetPosX - 12, posY + 17) then --take button + Take(clickedPlayer.team, clickedPlayer.name, i) -- + return true -- + end -- + else -- + if IsOnRect(x,y, widgetPosX + widgetWidth + 12, posY ,widgetPosX + widgetWidth + 57, posY + 17) then -- + Take(clickedPlayer.team, clickedPlayer.name, i) -- + return true + end + end + end + end + if m_share.active == true and clickedPlayer.dead ~= true then + if IsOnRect(x, y, m_share.posX + widgetPosX +1, posY, m_share.posX + widgetPosX +17,posY+16) then -- share units button + if release ~= nil then -- + if release >= now then -- + if clickedPlayer.team == myTeamID then -- + Spring_SendCommands("say a: I need unit support!") -- (ask) + else -- + local suc = Spring.GetSelectedUnitsCount() + Spring_SendCommands("say a: I gave "..suc.." units to "..clickedPlayer.name..".") + local su = Spring.GetSelectedUnits() + for _,uid in ipairs(su) do + local ux,uy,uz = Spring.GetUnitPosition(uid) + Spring.MarkerAddPoint(ux,uy,uz) + end + Spring_ShareResources(clickedPlayer.team, "units") -- + end + end + release = nil + else + firstclick = now+1 + end + return true + end + if IsOnRect(x, y, m_share.posX + widgetPosX +17, posY, m_share.posX + widgetPosX +33,posY+16) then -- share energy button (initiates the slider) + energyPlayer = clickedPlayer + return true + end + if IsOnRect(x, y, m_share.posX + widgetPosX +33, posY, m_share.posX + widgetPosX +49,posY+16) then -- share metal button (initiates the slider) + metalPlayer = clickedPlayer + return true + end + end + end + end + if i == -1 then + t = true + else + t = false + if i > -1 and i < 64 then + --chat button + if m_chat.active == true then + if IsOnRect(x, y, m_chat.posX + widgetPosX +1, posY, m_chat.posX + widgetPosX +17,posY+16) then + Spring_SendCommands("chatall","pastetext /w "..clickedPlayer.name..' \1') + return true + end + end + --ally button + if m_alliance.active == true and drawAllyButton and not mySpecStatus and player[i] ~= nil and player[i].dead ~= true and i ~= myPlayerID then + if IsOnRect(x, y, m_alliance.posX + widgetPosX +1, posY, m_alliance.posX + widgetPosX + m_alliance.width,posY+16) then + if Spring_AreTeamsAllied(player[i].team, myTeamID) then + Spring_SendCommands("ally "..player[i].allyteam.." 0") + else + Spring_SendCommands("ally "..player[i].allyteam.." 1") + end + return true + end + end + --point + if m_point.active then + if clickedPlayer.pointTime ~= nil then + if clickedPlayer.allyteam == myAllyTeamID then + if right == true then + if IsOnRect(x,y, widgetPosX - 28, posY - 1,widgetPosX - 12, posY + 17) then + Spring.SetCameraTarget(clickedPlayer.pointX,clickedPlayer.pointY,clickedPlayer.pointZ,1) + return true + end + else + if IsOnRect(x,y, widgetPosX + widgetWidth + 12, posY-1,widgetPosX + widgetWidth + 28, posY + 17) then + Spring.SetCameraTarget(clickedPlayer.pointX,clickedPlayer.pointY,clickedPlayer.pointZ,1) + return true + end + end + end + end + end + --name + if m_name.active and clickedPlayer.name ~= absentName and IsOnRect(x, y, m_name.posX + widgetPosX +1, posY, m_name.posX + widgetPosX + m_name.width, posY+12) then + if ctrl then + Spring_SendCommands{"toggleignore "..clickedPlayer.name} + SortList() + CreateLists() + return true + end + if (mySpecStatus or player[i].allyteam == myAllyTeamID) and clickTime - prevClickTime < dblclickPeriod and clickedName == prevClickedName then + LockCamera(clickedPlayer.team) + prevClickedName = '' + SortList() + CreateLists() + return true + end + prevClickedName = clickedName + end + end + end + end + end + end + prevClickTime = clickTime +end + +local mouseX, mouseY = 0,0 +function widget:MouseMove(x,y,dx,dy,button) + + if collapsed then return end + + mouseX, mouseY = x, y + local moveStartX, moveStartY + if energyPlayer ~= nil or metalPlayer ~= nil then -- move energy/metal share slider + if sliderOrigin == nil then + sliderOrigin = y + end + sliderPosition = (y-sliderOrigin) * (1/widgetScale) + if sliderPosition < 0 then sliderPosition = 0 end + if sliderPosition > 39 then sliderPosition = 39 end + local prevAmountEM = amountEM + UpdateResources() + if playSounds and (lastSliderSound == nil or os.clock() - lastSliderSound > 0.05) and amountEM ~= prevAmountEM then + lastSliderSound = os.clock() + Spring.PlaySoundFile(sliderdrag, 0.3, 'ui') + end + end +end + +function widget:MouseRelease(x,y,button) + + if collapsed then return end + + if button == 1 then + if firstclick ~= nil then -- double click system for share units + release = firstclick + firstclick = nil + else + release = nil + end + if energyPlayer ~= nil then -- share energy/metal mouse release + if energyPlayer.team == myTeamID then + if amountEM == 0 then + Spring_SendCommands("say a: I need Energy!") + else + Spring_SendCommands("say a: I need "..amountEM.." Energy!") + end + elseif amountEM > 0 then + Spring_ShareResources(energyPlayer.team, "energy", amountEM) + Spring_SendCommands("say a: I sent "..amountEM.." energy to "..energyPlayer.name) + end + sliderOrigin = nil + amountEMMax = nil + sliderPosition = nil + amountEM = nil + energyPlayer = nil + end + + if metalPlayer ~= nil then + if metalPlayer.team == myTeamID then + if amountEM == 0 then + Spring_SendCommands("say a: I need Metal!") + else + Spring_SendCommands("say a: I need "..amountEM.." Metal!") + end + elseif amountEM > 0 then + Spring_ShareResources(metalPlayer.team, "metal", amountEM) + Spring_SendCommands("say a: I sent "..amountEM.." metal to "..metalPlayer.name) + end + sliderOrigin = nil + amountEMMax = nil + sliderPosition = nil + amountEM = nil + metalPlayer = nil + end + end +end + +function Spec(teamID) + Spring_SendCommands{"specteam "..teamID} + specTarget = teamID + SortList() +end + + +--------------------------------------------------------------------------------------------------- +-- Tweak mode +--------------------------------------------------------------------------------------------------- + +function IsOnRectPlain(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- calc scale offset + BLcornerX = BLcornerX - ((widgetPosX - BLcornerX) * (widgetScale-1)) + BLcornerY = BLcornerY - ((widgetPosY - BLcornerY) * (widgetScale-1)) + TRcornerX = TRcornerX - ((widgetPosX - TRcornerX) * (widgetScale-1)) + TRcornerY = TRcornerY - ((widgetPosY - TRcornerY) * (widgetScale-1)) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY +end + +local function DrawGreyRect() + gl_Color(0.2,0.2,0.2,0.25) + gl_Rect(widgetPosX, widgetPosY, widgetPosX + widgetWidth, widgetPosY + widgetHeight) + gl_Color(1,1,1,1) +end + +local function DrawTweakButton(module, localLeft, localOffset, localBottom) + gl_Texture(module.pic) + DrawRect(localLeft + localOffset, localBottom + 11, localLeft + localOffset + 16, localBottom + 27) + if module.active ~= true and module.alwaysActive == nil then + gl_Texture(pics["crossPic"]) + DrawRect(localLeft + localOffset, localBottom + 11, localLeft + localOffset + 16, localBottom + 27) + end +end + +local function DrawTweakButtons() + + local minSize = (modulesCount-1) * 16 + 2 + local localLeft = widgetPosX + local localBottom = widgetPosY + widgetHeight - 28 + local localOffset = 1 --see func above, these track how far right we've got TODO: pass values + + gl_Color(0,0,0,0.5) + RectRound(localLeft-3, localBottom + 8, localLeft + widgetWidth+3, localBottom + 30, 5, true) + + gl_Color(1,1,1,1) + --if localLeft + minSize > vsx then localLeft = vsx - minSize end + if localBottom < 0 then localBottom = 0 end + + for n,module in pairs(modules) do + if module.noPic == nil or module.noPic == false then + if mySpecStatus == false or mySpecStatus == true and module.spec then + DrawTweakButton(module, localLeft, localOffset, localBottom) + localOffset = localOffset + 16 + end + end + if module.picGap ~= nil then + if mySpecStatus == false or mySpecStatus == true and module.spec then + localOffset = localOffset + module.picGap + end + end + end + +end + +local function DrawArrows() + gl_Color(1,1,1,0.4) + gl_Texture(pics["arrowdPic"]) + if expandDown == true then + DrawRect(widgetPosX, widgetPosY - 15, widgetRight, widgetPosY - 1) + else + DrawRect(widgetPosX, widgetTop + 15, widgetRight, widgetTop + 1) + end + gl_Texture(pics["arrowPic"]) + if expandLeft == true then + DrawRect(widgetPosX - 1, widgetPosY, widgetPosX - 15, widgetTop) + else + DrawRect(widgetRight + 1, widgetPosY, widgetRight + 15, widgetTop) + end + gl_Color(1,1,1,1) + gl_Texture(false) +end + +function widget:TweakDrawScreen() + + if collapsed then return end + + local scaleDiffX = -((widgetPosX*widgetScale)-widgetPosX)/widgetScale + local scaleDiffY = -((widgetPosY*widgetScale)-widgetPosY)/widgetScale + gl.Scale(widgetScale,widgetScale,0) + gl.Translate(scaleDiffX,scaleDiffY,0) + + --DrawGreyRect() + DrawTweakButtons() + --DrawArrows() + + CreateMainList() + CreateBackground() + + local scaleReset = widgetScale / widgetScale / widgetScale + gl.Translate(-scaleDiffX,-scaleDiffY,0) + gl.Scale(scaleReset,scaleReset,0) +end + +function checkButton(module, x, y, localLeft, localOffset, localBottom) + if IsOnRect(x, y, localLeft + localOffset, localBottom + 11, localLeft + localOffset + 16, localBottom + 27) then + if module.alwaysActive == nil then + module.active = not module.active + SetModulesPositionX() --why? + SortList() + -- adjust because of widget scaling + local widthDiff = (module.width * widgetScale) - module.width + if module.active then + widgetRight = widgetRight - widthDiff + else + widgetRight = widgetRight + widthDiff + end + else + if module.name == "sizedn" then + customScaleDown() + elseif module.name == "sizeup" then + customScaleUp() + end + end + CreateLists() + return true + else + return false + end +end + +function widget:TweakMousePress(x,y,button) + + if collapsed then return end + + if button == 1 then + local localLeft = widgetPosX + local localBottom = widgetPosY + widgetHeight - 28 + local localOffset = 1 + if localBottom < 0 then localBottom = 0 end + --if localLeft + 181 > vsx then localLeft = vsx - 181 end + + for _,module in pairs(modules) do + if module.noPic == nil or module.noPic == false then + if mySpecStatus == false or mySpecStatus == true and module.spec then + if checkButton(module,x,y,localLeft,localOffset,localBottom) then return true end + localOffset = localOffset + 16 + end + end + if module.picGap ~= nil then + if mySpecStatus == false or mySpecStatus == true and module.spec then + localOffset = localOffset + module.picGap + end + end + end + elseif button == 2 or button == 3 then + if IsOnRect(x, y, widgetPosX, widgetPosY, widgetPosX + widgetWidth, widgetPosY + widgetHeight) then + clickToMove = true + return true + end + + end +end + + +function widget:TweakMouseMove(x,y,dx,dy,button) + + if collapsed then return end + + if clickToMove ~= nil then + if moveStartX == nil then -- move widget on y axis + moveStartX = x - widgetPosX + end + if moveStartY == nil then -- move widget on y axis + moveStartY = y - widgetPosY + end + widgetPosX = widgetPosX + dx + widgetPosY = widgetPosY + dy + + if widgetPosY <= (backgroundMargin*widgetScale) then + widgetPosY = (backgroundMargin*widgetScale) + expandDown = false --expandDown=false only if we are right on the bottom of the screen + end + if widgetPosY + (widgetHeight * widgetScale) >= vsy -(backgroundMargin*widgetScale) then + widgetPosY = vsy - (widgetHeight * widgetScale) -(backgroundMargin*widgetScale) + expandDown = true + end + if widgetPosX <= (backgroundMargin*widgetScale) then --expandLeft=false only when we are precisely on the left edge of the screen + widgetPosX = (backgroundMargin*widgetScale) + expandLeft = false + end + if widgetPosX + (widgetWidth * widgetScale) >= vsx-(backgroundMargin*widgetScale) then + widgetPosX = vsx - (widgetWidth * widgetScale) - (backgroundMargin*widgetScale) + expandLeft = true + end + widgetTop = widgetPosY + widgetHeight + widgetRight = widgetPosX + widgetWidth + widgetRelRight = vsx - (widgetPosX + (widgetWidth*widgetScale)) + if widgetPosX + widgetWidth/2 > vsx/2 then + right = true + else + right = false + end + end +end + +function widget:TweakMouseRelease(x,y,button) + + if collapsed then return end + + clickToMove = nil -- ends the share slider process +end + +--------------------------------------------------------------------------------------------------- +-- Save/load +--------------------------------------------------------------------------------------------------- + +function widget:GetConfigData(data) -- save + if m_side ~= nil then + + --put module.active into a table + local m_active_Table = {} + for n,module in pairs(modules) do + m_active_Table[module.name] = module.active + end + + local settings = { + --view + customScale = customScale, + vsx = vsx, + vsy = vsy, + widgetRelRight = widgetRelRight, + widgetPosX = widgetPosX, + widgetPosY = widgetPosY, + widgetRight = widgetRight, + widgetTop = widgetTop, + expandDown = expandDown, + expandLeft = expandLeft, + specListShow = specListShow, + m_pointActive = m_point.active, + m_takeActive = m_take.active, + m_seespecActive = m_seespec.active, + m_active_Table = m_active_Table, + cpuText = cpuText, + lockPlayerID = lockPlayerID, + specListShow = specListShow, + gameFrame = Spring.GetGameFrame(), + lastSystemData = lastSystemData, + alwaysHideSpecs = alwaysHideSpecs, + collapsable = collapsable, + transitionTime = transitionTime, + lockcameraHideEnemies = lockcameraHideEnemies, + lockcameraLos = lockcameraLos, + } + + return settings + end +end + +function widget:SetConfigData(data) -- load + if data.customScale ~= nil then + customScale = data.customScale + end + + if data.specListShow ~= nil then + specListShow = data.specListShow + end + + if data.alwaysHideSpecs ~= nil then + alwaysHideSpecs = data.alwaysHideSpecs + end + + if data.lockcameraHideEnemies ~= nil then + lockcameraHideEnemies = data.lockcameraHideEnemies + end + + if data.lockcameraLos ~= nil then + lockcameraLos = data.lockcameraLos + end + + if data.lockcameraLos ~= nil then + transitionTime = data.transitionTime + end + + if data.collapsable ~= nil then + collapsable = data.collapsable + end + + --view + if data.expandDown ~= nil and data.widgetRight ~= nil then + expandDown = data.expandDown + expandLeft = data.expandLeft + specListShow = data.specListShow + local oldvsx = data.vsx + local oldvsy = data.vsy + if oldvsx == nil then + oldvsx = vsx + oldvsy = vsy + end + local dx = vsx - oldvsx + local dy = vsy - oldvsy + if expandDown == true then + widgetTop = data.widgetTop + dy + if widgetTop > vsy then + widgetTop = vsy + end + else + widgetPosY = data.widgetPosY + end + if expandLeft == true then + widgetRelRight = data.widgetRelRight or 0 + widgetRight = vsx - (widgetWidth * (widgetScale-1)) - widgetRelRight --align right of widget to right of screen + widgetPosX = widgetRight - (widgetWidth*widgetScale) + if widgetRight > vsx then + widgetRight = vsx + end + else + widgetPosX = data.widgetPosX --align left of widget to left of screen + end + end + if data.lockPlayerID ~= nil and Spring.GetGameFrame()>0 then + lockPlayerID = data.lockPlayerID + if lockPlayerID and not select(3,Spring_GetPlayerInfo(lockPlayerID),false) then + if not lockcameraHideEnemies then + if not fullView then + Spring.SendCommands("specfullview") + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()=="los" then + desiredLosmode = 'normal' + desiredLosmodeChanged = os.clock() + end + end + else + if fullView then + Spring.SendCommands("specfullview") + if lockcameraLos and mySpecStatus and Spring.GetMapDrawMode()~="los" then + desiredLosmode = 'los' + desiredLosmodeChanged = os.clock() + end + end + end + end + end + if data.cpuText ~= nil then + cpuText = data.cpuText + end + + --not technically modules + m_point.active = true -- m_point.default doesnt work + if data.m_pointActive ~= nil then + m_point.active = data.m_pointActive + end + m_take.active = true -- m_take.default doesnt work + if data.m_takeActive ~= nil then + m_take.active = data.m_takeActive + end + m_seespec.active = true -- m_seespec.default doesnt work + if data.m_seespecActive ~= nil then + m_seespec.active = data.m_seespecActive + end + --load module.active from table + local m_active_Table = data.m_active_Table or {} + for name,active in pairs(m_active_Table) do + --find module with matching name + for _,module in pairs(modules) do + if module.name == name then + if name == "ally" then -- needs to be always active (some aready stored it as false before, this makes sure its corrected) + module.active = true + else + module.active = module.default + if active ~= nil then + module.active = active + end + end + end + end + end + + SetModulesPositionX() + + if data.lastSystemData ~= nil and data.gameFrame ~= nil and data.gameFrame <= Spring.GetGameFrame() and data.gameFrame > Spring.GetGameFrame()-300 then + lastSystemData = data.lastSystemData + end +end + +function widget:TextCommand(command) + if (string.find(command, "cputext") == 1 and string.len(command) == 7) then + cpuText = not cpuText + end + if (string.find(command, "alwayshidespecs") == 1 and string.len(command) == 15) then + alwaysHideSpecs = not alwaysHideSpecs + if alwaysHideSpecs then + Spring.Echo("AdvPlayersList: always hiding specs") + specListShow = false + else + Spring.Echo("AdvPlayersList: not always hiding specs") + end + end +end + +--------------------------------------------------------------------------------------------------- +-- Player related changes +--------------------------------------------------------------------------------------------------- + +function CheckPlayersChange() + local sorting = false + for i = 0,63 do + local name,active,spec,teamID,allyTeamID,pingTime,cpuUsage, country, rank = Spring_GetPlayerInfo(i,false) + if active == false then + if player[i].name ~= nil then -- NON SPEC PLAYER LEAVING + if player[i].spec==false then + if table.maxn(Spring_GetPlayerList(player[i].team,true)) == 0 then + player[player[i].team + 64] = CreatePlayerFromTeam(player[i].team) + sorting = true + end + end + player[i].name = nil + player[i] = {} + sorting = true + end + elseif active == true and name ~= nil then + if spec ~= player[i].spec then -- PLAYER SWITCHING TO SPEC STATUS + if spec == true then + if table.maxn(Spring_GetPlayerList(player[i].team,true)) == 0 then -- (update the no players team) + player[player[i].team + 64] = CreatePlayerFromTeam(player[i].team) + end + player[i].team = nil -- remove team + end + player[i].spec = spec -- consider player as spec + sorting = true + end + if teamID ~= player[i].team then -- PLAYER CHANGING TEAM + if table.maxn(Spring_GetPlayerList(player[i].team,true)) == 0 then -- check if there is no more player in the team + update + player[player[i].team + 64] = CreatePlayerFromTeam(player[i].team) + end + player[i].team = teamID + player[i].red, player[i].green, player[i].blue = Spring_GetTeamColor(teamID) + player[i].dark = GetDark(player[i].red, player[i].green, player[i].blue) + player[i].skill = GetSkill(i) + sorting = true + end + if player[i].name == nil then + player[i] = CreatePlayer(i) + end + if allyTeamID ~= player[i].allyteam then + player[i].allyteam = allyTeamID + updateTake(allyTeamID) + sorting = true + end + + -- Update stall / cpu / ping info for each player + if player[i].spec == false then + player[i].needm = GetNeed("metal",player[i].team) + player[i].neede = GetNeed("energy",player[i].team) + player[i].rank = rank + else + player[i].needm = false + player[i].neede = false + end + player[i].pingLvl = GetPingLvl(pingTime) + player[i].cpuLvl = GetCpuLvl(cpuUsage) + player[i].ping = pingTime*1000-((pingTime*1000)%1) + player[i].cpu = cpuUsage*100-((cpuUsage*100)%1) + end + + if teamID and Spring_GetGameFrame() > 0 then + local totake = IsTakeable(teamID) + player[i].totake = totake + if totake then + sorting = true + else + player[i].name = name + end + end + end + + if sorting == true and not collapsed then -- sorts the list again if change needs it + SortList() + SetModulesPositionX() -- change the X size if needed (change of widest name) + end + +end + + + +function GetNeed(resType,teamID) + local current, _, pull, income = Spring_GetTeamResources(teamID, resType) + if current == nil then return false end + local loss = pull - income + if loss > 0 then + if loss*5 > current then + return true + end + end + return false +end + +local reportTake = false +local tookTeamID +local tookTeamName +local tookFrame = -120 + +function updateTake(allyTeamID) + for i = 0,teamN-1 do + if player[i + 64].allyTeam == allyTeamID then + player[i + 64] = CreatePlayerFromTeam(i) + end + end +end + +function Take(teamID,name, i) + + -- sends the /take command to spring + reportTake = true + tookTeamID = teamID + tookTeamName = name + tookFrame = Spring.GetGameFrame() + + Spring_SendCommands("luarules take2 " .. teamID) + return +end + +function widget:TeamDied(teamID) + player[teamID+64] = CreatePlayerFromTeam(teamID) + SortList() +end + +--------------------------------------------------------------------------------------------------- +-- Take related stuff +--------------------------------------------------------------------------------------------------- + +function IsTakeable(teamID) + if Spring_GetTeamRulesParam(teamID, "numActivePlayers") == 0 then + local units = Spring_GetTeamUnitCount(teamID) + local energy = Spring_GetTeamResources(teamID,"energy") + local metal = Spring_GetTeamResources(teamID,"metal") + if units and energy and metal then + if (units > 0) or (energy > 1000) or (metal > 100) then + return true + end + end + else + return false + end +end + + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + +--timers +local timeCounter = 0 +local updateRate = 0.75 +local updateRatePreStart = 0.25 +local lastTakeMsg = -120 +local uiOpacitySec = 0.5 +local hoverPlayerlist = false +function widget:Update(delta) --handles takes & related messages + + local mx,my = Spring.GetMouseState() + hoverPlayerlist = false + if isInBox(mx, my, {apiAbsPosition[2]-1,apiAbsPosition[3]-1,apiAbsPosition[4]+1,apiAbsPosition[1]+1}) then + hoverPlayerlist = true + if tipText and WG['tooltip'] then + WG['tooltip'].ShowTooltip('advplayerlist', tipText) + end + end + + + uiOpacitySec = uiOpacitySec + delta + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + CreateBackground() + end + end + + if collapsable then + if collapsed and hoverPlayerlist then + collapsed = false + CreateBackground() + elseif not collapsed and not energyPlayer and not metalPlayer then + local graceDistance = 85*widgetScale + if not isInBox(mx, my, {apiAbsPosition[2]-graceDistance,apiAbsPosition[3]-graceDistance,apiAbsPosition[4]+graceDistance,apiAbsPosition[1]+graceDistance}) then + collapsed = true + CreateBackground() + end + end + end + + if collapsed then return end + + totalTime = totalTime + delta + timeCounter = timeCounter + delta + curFrame = Spring_GetGameFrame() + mySpecStatus,fullView,_ = Spring.GetSpectatingState() + + if sceduledSpecFullView ~= nil then -- this is needed else the minimap/world doesnt update properly + Spring.SendCommands("specfullview") + sceduledSpecFullView = sceduledSpecFullView - 1 + if sceduledSpecFullView == 0 then + sceduledSpecFullView = nil + end + end + if lockcameraLos then + if desiredLosmodeChanged+1 > os.clock() then + if lockPlayerID ~= nil then + if desiredLosmode ~= Spring.GetMapDrawMode() then -- this is needed else the minimap/world doesnt update properly + Spring.SendCommands("togglelos") + end + elseif mySpecStatus and Spring.GetMapDrawMode() == 'los' then + Spring.SendCommands("togglelos") + end + end + end + + if lockPlayerID ~= nil then + Spring.SetCameraState(Spring.GetCameraState(), transitionTime) + end + + if energyPlayer ~= nil or metalPlayer ~= nil then + CreateShareSlider() + end + + if curFrame >= 30 + tookFrame then + if lastTakeMsg + 120 < tookFrame and reportTake then + local teamID = tookTeamID + local afterE = Spring_GetTeamResources(teamID,"energy") + local afterM = Spring_GetTeamResources(teamID, "metal") + local afterU = Spring_GetTeamUnitCount(teamID) + + local toSay = "say a: I took " .. tookTeamName .. ". " + + if afterE and afterM and afterU then + if afterE > 1.0 or afterM > 1.0 or afterU > 0 then + toSay = toSay .. "Left " .. math.floor(afterU) .. " units, " .. math.floor(afterE) .. " energy and " .. math.floor(afterM) .. " metal." + end + end + + Spring_SendCommands(toSay) + + for j = 0,127 do + if player[j].allyteam == myAllyTeamID then + if player[j].totake == true then + player[j] = CreatePlayerFromTeam(player[j].team) + SortList() + end + end + end + + lastTakeMsg = tookFrame + reportTake = false + else + reportTake = false + end + end + + -- update lists to take account of allyteam faction changes before gamestart + if not curFrame or curFrame <=0 then + if timeCounter < updateRatePreStart then + return + else + timeCounter = 0 + SetSidePics() --if the game hasn't started, update factions + CreateLists() + end + end + + -- update lists every now and then, just to make sure + if timeCounter < updateRate then + return + else + timeCounter = 0 + CreateLists() + end +end + + +--------------------------------------------------------------------------------------------------- +-- Other callins +--------------------------------------------------------------------------------------------------- + +function updateWidgetScale() + if customScale < 0.6 then + customScale = 0.6 + end + widgetScale = (0.75 + (vsx*vsy / 5000000)) * customScale +end + +function customScaleUp() + widgetPosX = widgetPosX - (widgetWidth*customScaleStep) + widgetRight = widgetPosX + widgetWidth + customScale = customScale + customScaleStep + updateWidgetScale() +end + +function customScaleDown() + widgetPosX = widgetPosX + (widgetWidth*customScaleStep) + widgetRight = widgetPosX + widgetWidth + customScale = customScale - customScaleStep + updateWidgetScale() +end + + +function widget:ViewResize(viewSizeX, viewSizeY) + local dx, dy = vsx - viewSizeX, vsy - viewSizeY + + --local vsxDiff = 1 / (vsx/viewSizeX) + --local vsyDiff = 1 / (vsy/viewSizeY) + + vsx, vsy = viewSizeX, viewSizeY + + --local oldWidgetScale = widgetScale + updateWidgetScale() + --local scaleDiff = 1 / (vsx/widgetScale) + + if expandDown == true then + widgetTop = widgetTop - dy + widgetPosY = widgetTop - widgetHeight + end + if expandLeft == true then + widgetRight = widgetRight - dx + widgetPosX = vsx - (widgetWidth * widgetScale) - widgetRelRight + end + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + fontfileScale2 = newFontfileScale * 1.25 + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + end +end + +function widget:MapDrawCmd(playerID, cmdType, px, py, pz) -- get the points drawn (to display point indicator) + if m_point.active then + if cmdType == "point" then + player[playerID].pointX = px + player[playerID].pointY = py + player[playerID].pointZ = pz + player[playerID].pointTime = now + pointDuration + end + end + + local osClock = os.clock() + if cmdType == 'line' then + --mapDrawNicknameTime[playerID] = osClock + --AddCommandSpotter('map_draw', x, y, z, osClock, false, playerID) + end +end diff --git a/LuaUI/Widgets_Evo/gui_advplayerslist_displayinfo.lua b/LuaUI/Widgets_Evo/gui_advplayerslist_displayinfo.lua new file mode 100644 index 000000000..da2901c41 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_advplayerslist_displayinfo.lua @@ -0,0 +1,292 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_musicPlayer.lua +-- brief: yay music +-- author: cake +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "AdvPlayersList info", + desc = "Displays current gametime, fps and gamespeed", + author = "Floris", + date = "april 2017", + license = "GNU GPL, v2 or later", + layer = -3, + enabled = true, -- loaded by default? + } +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 5.75 +local fontfileOutlineStrength = 1.33 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) +local bgcorner = ":n:LuaUI/Images/bgcorner.png" + +local widgetScale = 1 +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glColor = gl.Color +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local drawlist = {} +local advplayerlistPos = {} +local widgetHeight = 23 +local top, left, bottom, right = 0,0,0,0 + +local volume + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + updatePosition() + WG['displayinfo'] = {} + WG['displayinfo'].GetPosition = function() + return {top,left,bottom,right,widgetScale} + end + Spring.SendCommands("fps 0") + Spring.SendCommands("clock 0") + Spring.SendCommands("speed 0") +end + + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +local function updateValues() + + local textsize = 11*widgetScale + local textYPadding = 8*widgetScale + local textXPadding = 7*widgetScale + + if drawlist[2] ~= nil then + glDeleteList(drawlist[2]) + end + drawlist[2] = glCreateList( function() + local _,gamespeed,_ = Spring.GetGameSpeed() + gamespeed = string.format("%.2f", gamespeed) + local fps = Spring.GetFPS() + local titleColor = '\255\185\185\185' + local valueColor = '\255\230\230\230' + local gameframe = Spring.GetGameFrame() + local minutes = math.floor((gameframe / 30 / 60)) + local seconds = math.floor((gameframe - ((minutes*60)*30)) / 30) + if seconds == 0 then + seconds = '00' + elseif seconds < 10 then + seconds = '0'..seconds + end + local time = minutes..':'..seconds + + font:Begin() + font:Print(titleColor..'time '..valueColor..time..titleColor..' speed '..valueColor..gamespeed..titleColor..' fps '..valueColor..fps, left+textXPadding, bottom+textYPadding, textsize, 'no') + font:End() + end) +end + +local function createList() + if drawlist[3] ~= nil then + glDeleteList(drawlist[3]) + end + if WG['guishader'] then + drawlist[3] = glCreateList( function() + RectRound(left, bottom, right, top, 5.5*widgetScale) + end) + WG['guishader'].InsertDlist(drawlist[3], 'displayinfo') + end + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + end + drawlist[1] = glCreateList( function() + glColor(0, 0, 0, ui_opacity) + RectRound(left, bottom, right, top, 5.5*widgetScale) + + local borderPadding = 3*widgetScale + local borderPaddingRight = borderPadding + if right >= vsx-0.2 then + borderPaddingRight = 0 + end + local borderPaddingLeft = borderPadding + if left <= 0.2 then + borderPaddingLeft = 0 + end + glColor(1,1,1,ui_opacity*0.055) + RectRound(left+borderPaddingLeft, bottom+borderPadding, right-borderPaddingRight, top-borderPadding, borderPadding*1.66) + + end) + updateValues() +end + + +function widget:Shutdown() + if WG['guishader'] then + WG['guishader'].RemoveDlist('displayinfo') + end + for i=1,#drawlist do + glDeleteList(drawlist[i]) + end + gl.DeleteFont(font) + Spring.SendCommands("fps 1") + Spring.SendCommands("clock 1") + Spring.SendCommands("speed 1") + WG['displayinfo'] = nil +end + +local guishaderEnabled = (WG['guishader']) + +local passedTime = 0 +local passedTime2 = 0 +local uiOpacitySec = 0.5 +function widget:Update(dt) + + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) or guishaderEnabled ~= (WG['guishader']) then + guishaderEnabled = (WG['guishader']) + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + createList() + end + end + passedTime = passedTime + dt + passedTime2 = passedTime2 + dt + if passedTime > 0.1 then + passedTime = passedTime - 0.1 + updatePosition() + end + if passedTime2 > 1 then + updateValues() + passedTime2 = passedTime2 - 1 + end +end + + +function updatePosition(force) + if (WG['advplayerlist_api'] ~= nil) then + local prevPos = advplayerlistPos + advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + + if WG['music'] and WG['music'].GetPosition and WG['music'].GetPosition() then + advplayerlistPos = WG['music'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + end + --if widgetScale ~= advplayerlistPos[5] then + -- local fontScale = widgetScale/2 + -- font = gl.LoadFont(fontfile, 52*fontScale, 17*fontScale, 1.25) + --end + left = advplayerlistPos[2] + bottom = advplayerlistPos[1] + right = advplayerlistPos[4] + top = math.ceil(advplayerlistPos[1]+(widgetHeight*advplayerlistPos[5])) + widgetScale = advplayerlistPos[5] + if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then + createList() + end + end +end + +function widget:ViewResize(newX,newY) + vsx, vsy = newX, newY + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if drawlist[1] ~= nil then + glPushMatrix() + glCallList(drawlist[1]) + glCallList(drawlist[2]) + glPopMatrix() + end +end diff --git a/LuaUI/Widgets_Evo/gui_allySelectedUnits.lua b/LuaUI/Widgets_Evo/gui_allySelectedUnits.lua new file mode 100644 index 000000000..b0cc82834 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_allySelectedUnits.lua @@ -0,0 +1,725 @@ +include("keysym.h.lua") +local versionNumber = "2.03" + +function widget:GetInfo() + return { + name = "Ally Selected Units", + desc = "Shows units selected by teammates [v" .. string.format("%s", versionNumber ) .. "]", + author = "very_bad_soldier", + date = "August 1, 2008", + license = "GNU GPL v2", + layer = -10, + enabled = true + } +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +--callin driven +--"hot" units + +local floor = math.floor +local abs = math.abs + +local udefTab = UnitDefs +local spGetUnitDefID = Spring.GetUnitDefID +local spEcho = Spring.Echo +local spGetUnitPosition = Spring.GetUnitPosition +local spGetUnitBasePosition = Spring.GetUnitBasePosition +local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetLocalTeamID = Spring.GetLocalTeamID +local spGetUnitDefDimensions = Spring.GetUnitDefDimensions +local spSelectUnitMap = Spring.SelectUnitMap +local spGetTeamColor = Spring.GetTeamColor +local spGetGroundHeight = Spring.GetGroundHeight +local spIsSphereInView = Spring.IsSphereInView +local spGetSpectatingState = Spring.GetSpectatingState +local spGetGameSeconds = Spring.GetGameSeconds +local spIsGUIHidden = Spring.IsGUIHidden +local glColor = gl.Color +local glDepthTest = gl.DepthTest +local glUnitShape = gl.UnitShape +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glText = gl.Text +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glBillboard = gl.Billboard +local glLineWidth = gl.LineWidth +local glBeginEnd = gl.BeginEnd +local glScale = gl.Scale +local glVertex = gl.Vertex +local glCallList = gl.CallList +local glDrawListAtUnit = gl.DrawListAtUnit + +local GL_LINE_LOOP = GL.LINE_LOOP + +local spec = false +local showGui = false + +---------------------------------------------------------------- + +local scaleMultiplier = 1.05 +local maxAlpha = 0.45 +local hotFadeTime = 0.25 +local lockTeamUnits = false --disallow selection of units selected by teammates +local showAlly = true --also show allies (besides coop) +local useHotColor = false --use RED for all hot units, if false use playerColor starting with transparency +local showAsSpectator = true +local circleDivsCoop = 32 --nice circle +local circleDivsAlly = 5 --aka pentagon +local selectPlayerUnits = true + +local hotColor = { 1.0, 0.0, 0.0, 1.0 } + +local playerColorPool = {} +playerColorPool[1] = { 0.0, 1.0, 0.0 } +playerColorPool[2] = { 1.0, 1.0, 0.0 } +playerColorPool[3] = { 0.0, 0.0, 1.0 } +playerColorPool[4] = { 0.6, 0.0, 0.0 } --reserve full-red for hot units +playerColorPool[5] = { 0.0, 1.0, 1.0 } +playerColorPool[6] = { 1.0, 0.0, 1.0 } +playerColorPool[7] = { 1.0, 0.0, 0.0 } +playerColorPool[8] = { 1.0, 0.0, 0.0 } + +local xRelPos, yRelPos = 0.835, 0.88 -- (only used here for now) +local vsx, vsy = gl.GetViewSizes() +local xPos, yPos = xRelPos*vsx, yRelPos*vsy + +local panelWidth = 200; +local panelHeight = 55; + +local bgcorner = "LuaUI/Images/bgcorner.png" +local sizeMultiplier = 1 + +--Internals------------------------------------------------------ +local playerColors = {} +local nextPlayerPoolId = 1 +local myTeamID = Spring.GetMyTeamID() +local myPlayerID = Spring.GetMyPlayerID() +local playerSelectedUnits = {} +local hotUnits = {} +local circleLinesCoop +local circleLinesAlly +local lockPlayerID + +local unitConf ={} +------------------------------------------------------------------ + + + +function SetUnitConf() + -- preferred to keep these values the same as other widgets + local scaleFactor = 2.6 + local rectangleFactor = 3.25 + + for udid, unitDef in pairs(UnitDefs) do + local xsize, zsize = unitDef.xsize, unitDef.zsize + local scale = scaleFactor*( xsize^2 + zsize^2 )^0.5 + local shape, xscale, zscale + + if (unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0) then + shape = 'square' + xscale, zscale = rectangleFactor * xsize, rectangleFactor * zsize + elseif (unitDef.isAirUnit) then + shape = 'triangle' + xscale, zscale = scale*1.07, scale*1.07 + elseif (unitDef.modCategories["ship"]) then + shape = 'circle' + xscale, zscale = scale*0.82, scale*0.82 + else + shape = 'circle' + xscale, zscale = scale, scale + end + + local radius = Spring.GetUnitDefDimensions(udid).radius + xscale = (xscale*0.7) + (radius/5) + zscale = (zscale*0.7) + (radius/5) + + unitConf[udid] = {shape=shape, xscale=xscale, zscale=zscale} + end +end + +function widget:Initialize() + SetUnitConf() + circleLinesCoop = calcCircleLines(circleDivsCoop) + circleLinesAlly = calcCircleLines(circleDivsAlly) + + setPlayerColours() + + widget:PlayerChanged(myPlayerID) + + widgetHandler:RegisterGlobal('selectedUnitsRemove', selectedUnitsRemove) + widgetHandler:RegisterGlobal('selectedUnitsClear', selectedUnitsClear) + widgetHandler:RegisterGlobal('selectedUnitsAdd', selectedUnitsAdd) + spec = spGetSpectatingState() + + WG['allyselectedunits'] = {} + WG['allyselectedunits'].getOpacity = function() + return maxAlpha + end + WG['allyselectedunits'].setOpacity = function(value) + maxAlpha = value + end + WG['allyselectedunits'].getSelectPlayerUnits = function() + return selectPlayerUnits + end + WG['allyselectedunits'].setSelectPlayerUnits = function(value) + selectPlayerUnits = value + Spring.Echo(selectPlayerUnits) + end +end + +function widget:Shutdown() + widgetHandler:DeregisterGlobal('selectedUnitsRemove') + widgetHandler:DeregisterGlobal('selectedUnitsClear') + widgetHandler:DeregisterGlobal('selectedUnitsAdd') + if guiList ~= nil then + gl.DeleteList(guiList) + end + if circleLinesCoop ~= nil then + gl.DeleteList(circleLinesCoop) + end + if circleLinesAlly ~= nil then + gl.DeleteList(circleLinesAlly) + end + gl.DeleteFont(font) + if WG['guishader'] then + WG['guishader'].RemoveRect('allyselectedunits') + end +end + +function widget:PlayerAdded(playerID) + local playerTeam = select(4,spGetPlayerInfo(playerID,false)) + if not playerSelectedUnits[ playerID ] then + playerSelectedUnits[ playerID ] = { + ["units"]={}, + ["coop"]=(playerTeam == myTeamID), + ["todraw"] = DoDrawPlayer(playerID), + } + end + --grab color from color pool for new teammate + --no color yet + getPlayerColour(playerID,playerTeam) +end + +function getPlayerColour(playerID,teamID) + if playerSelectedUnits[ playerID ]["coop"] and not spec then + if not playerColorPool[ nextPlayerPoolId ] then + playerColors[ playerID ] = playerColorPool[ 1 ] --we have only 8 colors, take color 1 as default + else + playerColors[ playerID ] = playerColorPool[ nextPlayerPoolId ] + end + nextPlayerPoolId = nextPlayerPoolId + 1 + else + playerColors[ playerID ] = { spGetTeamColor( teamID ) }--he is only ally, use his color + end +end + +function setPlayerColours() + playerColors = {} + for _, playerID in pairs(Spring.GetPlayerList()) do + widget:PlayerAdded(playerID) + end +end + +function widget:PlayerChanged(playerID) + if not spec and spGetSpectatingState() then + spec = true + setPlayerColours() + if not showAsSpectator then + widgetHandler:RemoveWidget(self) + return + end + end + myTeamID = spGetLocalTeamID() + local playerTeam = select(4,spGetPlayerInfo(playerID,false)) + local oldCoopStatus = playerSelectedUnits[ playerID ]["coop"] + playerSelectedUnits[ playerID ]["coop"] = (teamID == myTeamID) + playerSelectedUnits[ playerID ]["todraw"] = DoDrawPlayer(playerID) + + --grab color from color pool for new teammate + if oldCoopStatus ~= playerSelectedUnits[ playerID ]["coop"] then + getPlayerColour(playerID,playerTeam) + end +end + +function calcCircleLines(divs) + local circleOffset = 0 + local lines = gl.CreateList(function() + gl.BeginEnd(GL.LINE_LOOP, function() + local radstep = (2.0 * math.pi) / divs + for i = 1, divs do + local a = (i * radstep) + gl.Vertex(math.sin(a), circleOffset, math.cos(a)) + end + end) + end) + + return lines +end + + +function widget:CommandsChanged( id, params, options ) + if ( lockTeamUnits ) then + deselectAllTeamSelected() + end +end + +function widget:UnitDestroyed(unitID) + hotUnits[ unitID ] = nil + + for playerID, selUnits in pairs( playerSelectedUnits ) do + selUnits["units"][ unitID ] = nil + end +end + +function newHotUnit( unitId, coop, playerID ) + if not playerSelectedUnits[playerID]["todraw"] then + return + end + local udef = spGetUnitDefID( unitId ) + if ( udef ~= nil ) then + local realDefRadius = unitConf[udef].xscale*1.5 + if ( realDefRadius ~= nil ) then + local defRadius = realDefRadius * scaleMultiplier + hotUnits[ unitId ] = { ts = os.clock(), coop = coop, defRadius = defRadius, playerID = playerID } + end + end +end + + +function selectedUnitsClear(playerID) + isSpec = select(3,spGetPlayerInfo(playerID),false) + if not isSpec or (lockPlayerID ~= nil and playerID == lockPlayerID) then + if not playerSelectedUnits[ playerID ] then + widget:PlayerAdded(playerID) + end + --make all hot + for unitId, defRadius in pairs(playerSelectedUnits[ playerID ]["units"]) do + newHotUnit( unitId, playerSelectedUnits[ playerID ]["coop"], playerID ) + end + --clear all + playerSelectedUnits[ playerID ]["units"] = {} + end + if lockPlayerID ~= nil and playerID == lockPlayerID and selectPlayerUnits then + selectPlayerSelectedUnits(lockPlayerID) + end +end + +function selectedUnitsAdd(playerID,unitID) + isSpec = select(3,spGetPlayerInfo(playerID),false) + if not isSpec or (lockPlayerID ~= nil and playerID == lockPlayerID) then + if not playerSelectedUnits[ playerID ] then + widget:PlayerAdded(playerID) + end + --add unit + local udefID = spGetUnitDefID(unitID) + if spGetUnitDefID(unitID) ~= nil then + local realDefRadius = unitConf[udefID].xscale*1.5 + if realDefRadius then + playerSelectedUnits[ playerID ]["units"][ unitID] = realDefRadius * scaleMultiplier + --un-hot it + hotUnits[ unitID ] = nil + end + end + end + if lockPlayerID ~= nil and playerID == lockPlayerID and selectPlayerUnits then + selectPlayerSelectedUnits(lockPlayerID) + end +end + +function selectedUnitsRemove(playerID,unitID) + isSpec = select(3,spGetPlayerInfo(playerID),false) + if not isSpec or (lockPlayerID ~= nil and playerID == lockPlayerID) then + if not playerSelectedUnits[ playerID ] then + widget:PlayerAdded(playerID) + end + --remove unit + playerSelectedUnits[ playerID ]["units"][unitID] = nil + --make it hot + newHotUnit( unitID, playerSelectedUnits[ playerID ]["coop"], playerID ) + end + if lockPlayerID ~= nil and playerID == lockPlayerID and selectPlayerUnits then + selectPlayerSelectedUnits(lockPlayerID) + end +end + +function DoDrawPlayer(playerID,teamID) + if playerID == myPlayerID then + return false + end + if teamID ~= myTeamID and not showAlly then + return false + end + return true + +end + +function deselectAllTeamSelected() + local selectedUnits = array2Table( spGetSelectedUnits() ) + for playerID, selUnits in pairs( playerSelectedUnits ) do + for unitId, defRadius in pairs( selUnits["units"] ) do + selectedUnits[unitId] = nil + end + end + spSelectUnitMap( selectedUnits ) +end + +function array2Table( arr ) + tab = {} + for i,v in ipairs(arr) do + tab[v] = true + end + return tab +end + +local updateTime = 0 +local checkLockPlayerInterval = 1 +function widget:Update(dt) + if (WG['advplayerlist_api'] ~= nil) then + updateTime = updateTime + dt + if updateTime > checkLockPlayerInterval then + lockPlayerID = WG['advplayerlist_api'].GetLockPlayerID() + if lockPlayerID ~= nil and selectPlayerUnits then + selectPlayerSelectedUnits(lockPlayerID) + end + updateTime = 0 + end + end +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + xPos, yPos = xRelPos*vsx, yRelPos*vsy + sizeMultiplier = 0.55 + (vsx*vsy / 8000000) +end + +function selectPlayerSelectedUnits(playerID) + local units = {} + local count = 0 + for pID, selUnits in pairs( playerSelectedUnits ) do + if pID == playerID then + for unitId, _ in pairs( selUnits["units"] ) do + count = count + 1 + units[count] = unitId + end + end + end + Spring.SelectUnitArray(units) +end + +local function createGuiList() + if guiList ~= nil then + gl.DeleteList(guiList) + end + guiList = gl.CreateList(function() + glColor(0, 0, 0, 0.6) + RectRound(xPos, yPos, xPos + (panelWidth*sizeMultiplier), yPos + (panelHeight*sizeMultiplier), 8*sizeMultiplier) + font:Begin() + font:Print("Ally Selected Units", xPos + (10*sizeMultiplier), yPos + ((panelHeight - 19)*sizeMultiplier), 13*sizeMultiplier, "n") + font:End() + glColor(1, 1, 1, 0.2) + drawCheckbox(xPos + (12*sizeMultiplier), yPos + (10*sizeMultiplier), selectPlayerUnits, "Select tracked player units") + if WG['guishader'] then + WG['guishader'].InsertRect(xPos, yPos, xPos + (panelWidth*sizeMultiplier), yPos + (panelHeight*sizeMultiplier), 'allyselectedunits') + end + end) +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if spIsGUIHidden() then return end + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- disable layer blending + DrawSelectedUnits() + DrawHotUnits() +end + +--local vsx,vsy = Spring.GetViewGeometry() +--local lineScale = (0.75 + (vsx*vsy / 7500000)) +--function widget:ViewResize() +-- local vsx,vsy = Spring.GetViewGeometry() +-- lineScale = (0.75 + (vsx*vsy / 7500000)) +--end + +function DrawSelectedUnits() + glColor(0.0, 1.0, 0.0, 1.0) + glLineWidth(2) + gl.PointSize(1) + local now = spGetGameSeconds() + for playerID, selUnits in pairs( playerSelectedUnits ) do + + if lockPlayerID == nil or lockPlayerID ~= playerID or (lockPlayerID == playerID and not selectPlayerUnits) then + if selUnits["todraw"] then + glColor( playerColors[ playerID ][1], playerColors[ playerID ][2], playerColors[ playerID ][3], maxAlpha) + for unitID, defRadius in pairs( selUnits["units"] ) do + local x, y, z = spGetUnitBasePosition(unitID) + local inView = false + if ( z ~= nil ) then --checking z should be enough insteady of x,y,z + inView = spIsSphereInView( x, y, z, defRadius ) + end + if ( inView ) then + --glPushMatrix() + --glTranslate( x, y, z) + --glScale( defRadius, 1, defRadius) + --if ( selUnits["coop"] == true and not spec) then + -- glCallList(circleLinesCoop) + --else + -- glCallList(circleLinesAlly) + --end + --glPopMatrix() + if ( selUnits["coop"] == true and not spec) then + glDrawListAtUnit(unitID, circleLinesCoop, false, defRadius,defRadius,defRadius) + else + glDrawListAtUnit(unitID, circleLinesAlly, false, defRadius,defRadius,defRadius) + end + end + end + end + end + end + + glColor(1, 1, 1, 1) + glLineWidth(1) +end + + +function DrawHotUnits() + glDepthTest(false) + glLineWidth( 2 ) + + local toDelete = {} + + for unitID, val in pairs( hotUnits ) do + if lockPlayerID == nil or val.playerID ~= lockPlayerID or (val.playerID == lockPlayerID and not selectPlayerUnits) then + local x, y, z = spGetUnitBasePosition(unitID) + local defRadius = val["defRadius"] + local inView = false + if ( z ~= nil ) then --checking z should be enough insteady of x,y,z + inView = spIsSphereInView( x, y, z, defRadius ) + end + if ( inView ) then + local timeDiff = (os.clock() - val["ts"]) + + if ( timeDiff <= hotFadeTime ) then + if ( useHotColor ) then + hotColor[4] = 1.0 - ( timeDiff / hotFadeTime ) + glColor( hotColor ) + else + local cl = playerColors[ val["playerID"] ] + cl[4] = maxAlpha - maxAlpha * ( timeDiff / hotFadeTime ) + glColor( cl ) + end + else + toDelete[unitID] = true + end + + if ( toDelete[unitID] == nil ) then + local lines = circleLinesAlly + if ( val["coop"] == true and not spec) then + lines = circleLinesCoop + end + + glPushMatrix() + glTranslate(x,y,z) + glScale( defRadius, 1, defRadius) + glCallList(lines) + glPopMatrix() + end + end + end + end + + for unitID, val in pairs( toDelete ) do + hotUnits[unitID] = nil + end + + glDepthTest(false) + glColor(1, 1, 1, 1) + glLineWidth( 1 ) +end + + + +function widget:GetConfigData() + return { + maxAlpha = maxAlpha, + selectPlayerUnits = selectPlayerUnits, + xRelPos = xRelPos, yRelPos = yRelPos, + version = 1.1 + } +end + +function widget:SetConfigData(data) + if data.version ~= nil and data.version == 1.1 then + maxAlpha = data.maxAlpha or maxAlpha + selectPlayerUnits = data.selectPlayerUnits or selectPlayerUnits + xRelPos = data.xRelPos or xRelPos + yRelPos = data.yRelPos or yRelPos + xPos = xRelPos * vsx + yPos = yRelPos * vsy + end +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + + +if showGui then + + function widget:DrawScreen() + if chobbyInterface then return end + if lockPlayerID ~= nil then + if not guiList then + createGuiList() + end + glCallList(guiList) + else + if WG['guishader'] then + WG['guishader'].RemoveRect('allyselectedunits') + end + end + end + + local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + local o = offset + -- top left + --if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + --if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + --if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + --if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) + end + + function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) + end + + function drawCheckbox(x, y, state, text) + glPushMatrix() + glTranslate(x, y, 0) + glColor(1, 1, 1, 0.2) + RectRound(0, 0, 16*sizeMultiplier, 16*sizeMultiplier, 3*sizeMultiplier) + glColor(1, 1, 1, 1) + if state then + glTexture('LuaUI/Images/tick.png') + glTexRect(0, 0, 16*sizeMultiplier, 16*sizeMultiplier) + glTexture(false) + end + font:Begin() + font:Print(text, 23*sizeMultiplier, 4*sizeMultiplier, 12*sizeMultiplier, "n") + font:End() + glPopMatrix() + end + + function widget:IsAbove(mx, my) + if lockPlayerID == nil then return end + return mx > xPos and my > yPos and mx < xPos + (panelWidth*sizeMultiplier) and my < yPos + (panelHeight*sizeMultiplier) + end + + function widget:MousePress(mx, my, mb) + if lockPlayerID ~= nil then + if mb == 1 then + if mx > xPos + (12*sizeMultiplier) and my > yPos + (10*sizeMultiplier) and mx < (xPos + ((panelWidth - 12)*sizeMultiplier)) and my < (yPos + ((10 + 16)*sizeMultiplier)) then + selectPlayerUnits = not selectPlayerUnits + createGuiList() + end + if lockPlayerID ~= nil and widget:IsAbove(mx,my) then + return false + end + end + end + end + + function widget:TweakMousePress(mx, my, mb) + if lockPlayerID ~= nil and (mb == 2 or mb == 3) and widget:IsAbove(mx,my) then + return true + end + end + + function widget:TweakMouseMove(mx, my, dx, dy) + if xPos + dx >= -1 and xPos + (panelWidth*sizeMultiplier) + dx - 1 <= vsx then + xRelPos = xRelPos + dx/vsx + end + if yPos + dy >= -1 and yPos + (panelHeight*sizeMultiplier) + dy - 1<= vsy then + yRelPos = yRelPos + dy/vsy + end + xPos, yPos = xRelPos * vsx,yRelPos * vsy + createGuiList() + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_ally_cursors.lua b/LuaUI/Widgets_Evo/gui_ally_cursors.lua index f6f81bdfe..1d0e56a5c 100644 --- a/LuaUI/Widgets_Evo/gui_ally_cursors.lua +++ b/LuaUI/Widgets_Evo/gui_ally_cursors.lua @@ -1,22 +1,22 @@ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. -- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function widget:GetInfo() - return { - name = "AllyCursors", - desc = "Shows the mouse pos of allied players", - author = "jK", - date = "May,2008", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true - } + return { + name = "AllyCursors", + desc = "Shows the mouse pos of allied players", + author = "Floris,jK,TheFatController", + date = "31 may 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, + } end -------------------------------------------------------------------------------- @@ -24,256 +24,452 @@ end -- configs -local sendPacketEvery = 0.8 -local numMousePos = 2 --//num mouse pos in 1 packet +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local cursorSize = 11 +local drawNamesCursorSize = 8.5 + +local dlistAmount = 5 -- number of dlists generated for each player (# available opacity levels) + +local sendPacketEvery = 0.6 +local numMousePos = 2 --//num mouse pos in 1 packet + +local showSpectatorName = true +local showPlayerName = true +local drawNamesScaling = true +local drawNamesFade = true + +local fontSizePlayer = 18 +local fontOpacityPlayer = 0.68 +local fontSizeSpec = 14 +local fontOpacitySpec = 0.48 + +local NameFadeStartDistance = 4800 +local NameFadeEndDistance = 7200 +local idleCursorTime = 30 -- fade time cursor (specs only) + +-- tweak ui +local buttonsize = 18 +local rowgap = 6 +local leftmargin = 20 +local buttontab = 200 +local vsx, vsy = gl.GetViewSizes() +local tweakUiWidth, tweakUiHeight = 240, 215 +local tweakUiPosX, tweakUiPosY = 500, 550 + +-- images +local allyCursor = ":n:LuaUI/Images/allycursor.dds" -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --- locals +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local fontScale = widgetScale/2 + font = gl.LoadFont(fontfile, 52*fontScale, 17*fontScale, 1.5) +end -local pairs = pairs +function widget:TextCommand(command) + local mycommand = false + if (string.find(command, "allycursorspecname") == 1 and string.len(command) == 18) then showSpectatorName = not showSpectatorName end -local GetMouseState = Spring.GetMouseState -local TraceScreenRay = Spring.TraceScreenRay -local SendLuaUIMsg = Spring.SendLuaUIMsg -local GetGameFrame = Spring.GetGameFrame -local GetGroundHeight = Spring.GetGroundHeight -local GetPlayerInfo = Spring.GetPlayerInfo -local GetTeamColor = Spring.GetTeamColor -local IsSphereInView = Spring.IsSphereInView -local GetSpectatingState = Spring.GetSpectatingState + if (string.find(command, "allycursorplayername") == 1 and string.len(command) == 20) then showPlayerName = not showPlayerName end -local glTexCoord = gl.TexCoord -local glVertex = gl.Vertex -local glPolygonOffset = gl.PolygonOffset -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local glColor = gl.Color -local glBeginEnd = gl.BeginEnd + if showPlayerName then + usedCursorSize = drawNamesCursorSize + end +end + +function widget:GetConfigData(data) + savedTable = {} + savedTable.showSpectatorName = showSpectatorName + savedTable.showPlayerName = showPlayerName + return savedTable +end -local floor = math.floor -local tanh = math.tanh -local GL_QUADS = GL.QUADS +function widget:SetConfigData(data) + if data.showSpectatorName ~= nil then showSpectatorName = data.showSpectatorName end + if data.showPlayerName ~= nil then showPlayerName = data.showPlayerName end + + if showPlayerName then + usedCursorSize = drawNamesCursorSize + end +end -local clock = os.clock -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local function CubicInterpolate2(x0,x1,mix) - local mix2 = mix*mix; - local mix3 = mix2*mix; +local spGetGroundHeight = Spring.GetGroundHeight +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetTeamColor = Spring.GetTeamColor +local spIsSphereInView = Spring.IsSphereInView +local spGetCameraPosition = Spring.GetCameraPosition +local spGetCameraDirection = Spring.GetCameraDirection +local spIsGUIHidden = Spring.IsGUIHidden + +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local floor = math.floor +local min = math.min +local diag = math.diag +local GL_QUADS = GL.QUADS +local clock = os.clock +local Button = {} +local Panel = {} +local alliedCursorsPos = {} +local prevCursorPos = {} +local alliedCursorsTime = {} -- for API purpose +local usedCursorSize = cursorSize +local prevMouseX,prevMouseY = 0 +local allycursorDrawList = {} +local myPlayerID = Spring.GetMyPlayerID() + + +local specList = {} +function updateSpecList() + specList = {} + local t = Spring.GetPlayerList() + for _,playerID in ipairs(t) do + specList[playerID] = select(3,spGetPlayerInfo(playerID,false)) + end +end - return x0*(2*mix3-3*mix2+1) + x1*(3*mix2-2*mix3); +function widget:Initialize() + widgetHandler:RegisterGlobal('MouseCursorEvent', MouseCursorEvent) + + if showPlayerName then + usedCursorSize = drawNamesCursorSize + end + updateSpecList() + + WG['allycursor_api'] = {} + WG['allycursor_api'].GetCursorTimes = function() + return alliedCursorsTime + end + + local now = clock() + local pList = Spring.GetPlayerList() + for _,playerID in ipairs(pList) do + alliedCursorsTime[playerID] = now + end +end + + +function widget:Shutdown() + widgetHandler:DeregisterGlobal('MouseCursorEvent') + for playerID, dlists in pairs(allycursorDrawList) do + for opacityMultiplier, dlist in pairs(dlists) do + gl.DeleteList(allycursorDrawList[playerID][opacityMultiplier]) + end + end + gl.DeleteFont(font) end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local alliedCursorsPos = {} +local function CubicInterpolate2(x0,x1,mix) + local mix2 = mix*mix; + local mix3 = mix2*mix; -local newPos = {} -function widget:RecvLuaMsg(msg, playerID) - if (msg:sub(1,1)=="%") - then - if (playerID==Spring.GetMyPlayerID()) then return true; end - local xz = msg:sub(3) - - local l = xz:len()*0.25 - if (l==numMousePos) then - for i=0,numMousePos-1 do - local x = VFS.UnpackU16(xz:sub(i*4+1,i*4+2)) - local z = VFS.UnpackU16(xz:sub(i*4+3,i*4+4)) - newPos[i*2+1] = x - newPos[i*2+2] = z - end - - if (alliedCursorsPos[playerID]) then + return x0*(2*mix3-3*mix2+1) + x1*(3*mix2-2*mix3); +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local playerPos = {} +function MouseCursorEvent(playerID,x,z,click) + if myPlayerID == playerID then + return true + end + local playerPosList = playerPos[playerID] or {} + playerPosList[#playerPosList+1] = {x=x,z=z,click=click} + playerPos[playerID] = playerPosList + if #playerPosList < numMousePos then + return + end + playerPos[playerID] = {} + + if alliedCursorsPos[playerID] then local acp = alliedCursorsPos[playerID] acp[(numMousePos)*2+1] = acp[1] acp[(numMousePos)*2+2] = acp[2] for i=0,numMousePos-1 do - acp[i*2+1] = newPos[i*2+1] - acp[i*2+2] = newPos[i*2+2] + acp[i*2+1] = playerPosList[i+1].x + acp[i*2+2] = playerPosList[i+1].z end acp[(numMousePos+1)*2+1] = clock() - acp[(numMousePos+1)*2+2] = (msg:sub(2,2)=="1") - else + acp[(numMousePos+1)*2+2] = playerPosList[#playerPosList].click + else local acp = {} alliedCursorsPos[playerID] = acp for i=0,numMousePos-1 do - acp[i*2+1] = newPos[i*2+1] - acp[i*2+2] = newPos[i*2+2] + acp[i*2+1] = playerPosList[i+1].x + acp[i*2+2] = playerPosList[i+1].z end - acp[(numMousePos)*2+1] = newPos[(numMousePos-2)*2+1] - acp[(numMousePos)*2+2] = newPos[(numMousePos-2)*2+2] + acp[(numMousePos)*2+1] = playerPosList[(numMousePos-2)*2+1].x + acp[(numMousePos)*2+2] = playerPosList[(numMousePos-2)*2+1].z acp[(numMousePos+1)*2+1] = clock() - acp[(numMousePos+1)*2+2] = (msg:sub(2,2)=="1") - _,_,_,acp[(numMousePos+1)*2+3] = GetPlayerInfo(playerID) - end + acp[(numMousePos+1)*2+2] = playerPosList[#playerPosList].click + acp[(numMousePos+1)*2+3] = select(4,spGetPlayerInfo(playerID,false)) + end + + + -- check if there has been changes + wx,wz = alliedCursorsPos[playerID][1*2+1],alliedCursorsPos[playerID][1*2+1] + + if prevCursorPos[playerID] == nil or wx ~= prevCursorPos[playerID].wx or wz ~= prevCursorPos[playerID].wz then + alliedCursorsTime[playerID] = clock() + end + + if prevCursorPos[playerID] == nil then + prevCursorPos[playerID] = {} end - return true - end + prevCursorPos[playerID].wx = wx + prevCursorPos[playerID].wz = wz end -------------------------------------------------------------------------------- -local updateTimer = 0 -local poshistory = {} - -local saveEach = sendPacketEvery/numMousePos +local function DrawGroundquad(wx,gy,wz,size) + gl.TexCoord(0,0) + gl.Vertex(wx-size,gy+size,wz-size) + gl.TexCoord(0,1) + gl.Vertex(wx-size,gy+size,wz+size) + gl.TexCoord(1,1) + gl.Vertex(wx+size,gy+size,wz+size) + gl.TexCoord(1,0) + gl.Vertex(wx+size,gy+size,wz-size) +end -local n = 0 +local teamColors = {} +local color +local time,wx,wz,lastUpdateDiff,scale,iscale,fscale,gy --keep memory always allocated for these since they are referenced so frequently +local notIdle = {} + +local function SetTeamColor(teamID,playerID,a) + color = teamColors[playerID] + if color then + gl.Color(color[1],color[2],color[3],color[4]*a) + return + end + + --make color + local r, g, b = spGetTeamColor(teamID) + if specList[playerID] then + color = {1, 1, 1, 0.6} + elseif r and g and b then + color = {r, g, b, 0.75} + end + teamColors[playerID] = color + gl.Color(color) + return +end -function widget:Update(t) - updateTimer = updateTimer + t +local sec = 0 +local updateTime = 2 +function widget:Update(dt) + sec = sec+dt + if sec > updateTime then + sec = 0 + updateSpecList() + end +end - if (updateTimer%saveEach<0.2) then - local mx,my = GetMouseState() - local _,pos = TraceScreenRay(mx,my,true) - if (pos~=nil) then - poshistory[n*2] = VFS.PackU16(floor(pos[1])) - poshistory[n*2+1] = VFS.PackU16(floor(pos[3])) +function widget:PlayerChanged(playerID) + local _, _, isSpec, teamID = spGetPlayerInfo(playerID,false) + specList[playerID] = isSpec + local r, g, b = spGetTeamColor(teamID) + local color + if isSpec then + color = {1, 1, 1, 0.6} + elseif r and g and b then + color = {r, g, b, 0.75} end + teamColors[playerID] = color + allycursorDrawList[playerID] = nil +end +function widget:PlayerAdded(playerID) + widget:PlayerChanged(playerID) +end +function widget:PlayerRemoved(playerID, reason) + specList[playerID] = nil +end - n = n + 1 - end - - if (updateTimer>sendPacketEvery)and(n>=numMousePos) then - updateTimer = 0 - n=0 - local posStr = "0" - local _,_,l,m,r = Spring.GetMouseState() - if (l or r) then posStr = "1" end - for i=numMousePos,1,-1 do - local xStr = poshistory[i*2] - local zStr = poshistory[i*2+1] - if (xStr and zStr) then posStr = posStr .. xStr .. zStr end +function createCursorDrawList(playerID, opacityMultiplier) + local name,_,spec,teamID = spGetPlayerInfo(playerID,false) + local r, g, b = spGetTeamColor(teamID) + local wx,gy,wz = 0,0,0 + local quadSize = usedCursorSize + if spec then + quadSize = usedCursorSize * 0.77 end - SendLuaUIMsg("%" .. posStr,"allies") - end - - if (GetSpectatingState()) then - widgetHandler:RemoveCallIn("Update") - return - end + SetTeamColor(teamID,playerID,1) + + if not spec and not showPlayerName or spec and not showSpectatorName then + --draw a cursor + gl.Texture(allyCursor) + gl.BeginEnd(GL.QUADS,DrawGroundquad,wx,gy,wz,quadSize) + gl.Texture(false) + else + if not spec then + --draw a cursor + gl.Texture(allyCursor) + gl.BeginEnd(GL.QUADS,DrawGroundquad,wx,gy,wz,quadSize) + gl.Texture(false) + end + + --draw the nickname + gl.PushMatrix() + gl.Translate(wx, gy, wz) + gl.Rotate(-90,1,0,0) + + font:Begin() + if spec then + font:SetTextColor(1,1,1,fontOpacitySpec*opacityMultiplier) + font:Print(name, 0, 0, fontSizeSpec, "cn") + else + local verticalOffset = usedCursorSize + 8 + local horizontalOffset = usedCursorSize + 1 + -- text shadow + font:SetTextColor(0,0,0,fontOpacityPlayer*0.62*opacityMultiplier) + font:Print(name, horizontalOffset-(fontSizePlayer/50), verticalOffset-(fontSizePlayer/42), fontSizePlayer, "n") + font:Print(name, horizontalOffset+(fontSizePlayer/50), verticalOffset-(fontSizePlayer/42), fontSizePlayer, "n") + -- text + font:SetTextColor(r,g,b,fontOpacityPlayer*opacityMultiplier) + font:Print(name, horizontalOffset, verticalOffset, fontSizePlayer, "n") + end + font:End() + gl.PopMatrix() + end end -local function DrawGroundquad(wx,gy,wz) - -- get ground heights - local gy_tl,gy_tr = GetGroundHeight(wx-16,wz-16),GetGroundHeight(wx+16,wz-16) - local gy_bl,gy_br = GetGroundHeight(wx-16,wz+16),GetGroundHeight(wx+16,wz+16) - local gy_t,gy_b = GetGroundHeight(wx,wz-16),GetGroundHeight(wx,wz+16) - local gy_l,gy_r = GetGroundHeight(wx-16,wz),GetGroundHeight(wx+16,wz) - - --topleft - glTexCoord(0,0) - glVertex(wx-16,gy_bl,wz-16) - glTexCoord(0,0.5) - glVertex(wx-16,gy_l,wz) - glTexCoord(0.5,0.5) - glVertex(wx,gy,wz) - glTexCoord(0.5,0) - glVertex(wx,gy_t,wz-16) - - --topright - glTexCoord(0.5,0) - glVertex(wx,gy_t,wz-16) - glTexCoord(0.5,0.5) - glVertex(wx,gy,wz) - glTexCoord(1,0.5) - glVertex(wx+16,gy_r,wz) - glTexCoord(1,0) - glVertex(wx+16,gy_tr,wz-16) - - --bottomright - glTexCoord(0.5,0.5) - glVertex(wx,gy,wz) - glTexCoord(0.5,1) - glVertex(wx,gy_b,wz+16) - glTexCoord(1,1) - glVertex(wx+16,gy_br,wz+16) - glTexCoord(1,0.5) - glVertex(wx+16,gy_r,wz) - - --bottomleft - glTexCoord(0.5,0) - glVertex(wx-16,gy_l,wz) - glTexCoord(1,0) - glVertex(wx-16,gy_bl,wz+16) - glTexCoord(1,0.5) - glVertex(wx,gy_b,wz+16) - glTexCoord(0.5,0.5) - glVertex(wx,gy,wz) + + +local camDistance, glScale + +local function DrawCursor(playerID,wx,wz,camX,camY,camZ,opacity) + local gy = spGetGroundHeight(wx,wz) + if not (spIsSphereInView(wx,gy,wz,usedCursorSize)) then + return + end + + --calc scale + camDistance = diag(camX-wx, camY-gy, camZ-wz) + glScale = 0.83 + camDistance / 5000 + + -- calc opacity + local opacityMultiplier = 1 + if drawNamesFade and camDistance > NameFadeStartDistance then + opacityMultiplier = (1 - (camDistance-NameFadeStartDistance) / (NameFadeEndDistance-NameFadeStartDistance)) + if opacityMultiplier > 1 then + opacityMultiplier = 1 + end + end + + if opacity >= 1 then + opacityMultiplier = math.floor(opacityMultiplier * dlistAmount)/dlistAmount + else -- if (spec and) fading out due to idling + opacityMultiplier = math.floor(opacityMultiplier * (opacity * dlistAmount))/dlistAmount + end + + if opacityMultiplier > 0.11 then + if allycursorDrawList[playerID] == nil then + allycursorDrawList[playerID] = {} + end + if allycursorDrawList[playerID][opacityMultiplier] == nil then + allycursorDrawList[playerID][opacityMultiplier] = glCreateList(createCursorDrawList, playerID, opacityMultiplier) + end + + local rotValue = 0 + gl.PushMatrix() + gl.Translate(wx, gy, wz) + gl.Rotate(rotValue,0,1,0) + if drawNamesScaling then + gl.Scale(glScale,0,glScale) + end + glCallList(allycursorDrawList[playerID][opacityMultiplier]) + if drawNamesScaling then + gl.Scale(-glScale,0,-glScale) + end + gl.PopMatrix() + end end - -local teamColors = {} -local function SetTeamColor(teamID,a) - local color = teamColors[teamID] - if (color) then - color[4]=a - glColor(color) - return - end - local r, g, b = Spring.GetTeamColor(teamID) - if (r and g and b) then - color = { r, g, b } - teamColors[teamID] = color - glColor(color) - return - end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end end - function widget:DrawWorldPreUnit() - glDepthTest(true) - glTexture('LuaUI/Images/AlliedCursors.png') - glPolygonOffset(-7,-10) - local time = clock() - - for playerID,data in pairs(alliedCursorsPos) do - local teamID = data[#data] - for n=0,5 do - local wx,wz = data[1],data[2] - local lastUpdatedDiff = time-data[#data-2] + n*0.025 - - if (lastUpdatedDiff (time-idleCursorTime) then + local opacity = 1 + if specList[playerID] then + opacity = 1 - ((time - alliedCursorsTime[playerID]) / idleCursorTime) + if opacity > 1 then opacity = 1 end + end + if opacity > 0.1 then + DrawCursor(playerID,wx,wz,camX,camY,camZ,opacity) + end else - SetTeamColor(teamID,n*0.2) + --mark a player as notIdle as soon as they move (and keep them always set notIdle after this) + if wx and wz and wz_old and wz_old and(math.abs(wx_old-wx)>=1 or math.abs(wz_old-wz)>=1) then --math.abs is needed because of floating point used in interpolation + notIdle[playerID] = true + wx_old = nil + wz_old = nil + else + wx_old = wx + wz_old = wz + end + end - glBeginEnd(GL_QUADS,DrawGroundquad,wx,gy,wz) - end end - end - - glPolygonOffset(false) - glTexture(false) - glDepthTest(false) -end + --gl.EndText + gl.PolygonOffset(false) + gl.Texture(false) + gl.DepthTest(false) +end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_ally_res-1.83a2.lua b/LuaUI/Widgets_Evo/gui_ally_res-1.83a2.lua deleted file mode 100644 index 1f2ed2de4..000000000 --- a/LuaUI/Widgets_Evo/gui_ally_res-1.83a2.lua +++ /dev/null @@ -1,1138 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: gui_allu_res.lua --- brief: Shows your allies resources and allows quick resource transfer --- author: Owen Martindell --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Ally Resource Bars 1.83 Alpha 2", - desc = "Shows your allies resources, thresholds, capacities and allows resource transfer", - author = "TheFatController & AF & BD", - date = "Feb 22, 2009", - license = "MIT/x11", - layer = -9, - enabled = false -- loaded by default? - } -end - --- mono's changes since 1.6: --- 1.83 Alpha 2: fixed cpu hogging during window movement due to creating additional windows without fully deleting the old ones --- 1.83: a Chili window as background when Chili is detected --- 1.82: fixed the Chili options save/load conflicting with set/get configdata, added a size option to Chili menu (exclusive to Chili for now) --- 1.81: initial Chili support --- 1.80 alpha 3: fixed the incorrect placement of names bug with jK's help --- 1.80 alpha 2: fixed a nasty luaUI-crashing bug with saveY, added metal/energy request from players on right click, re-added TOOL_TIPS player name drawing when player names are not drawn --- 1.80: added options menu, hopefully fixed the player mode mis-positioned name drawing --- Alpha 2: cleanup, added option to control the drawing of the list of teams (DRAW_TEAMS), updated default location --- 1.72 Alpha 1: added team separators, added players list from other teams without bars for both spectator and player modes --- 1.71: players list is drawn at all times --- Alpha 6: added actual numeric resource amount and capacity as tooltip on the right --- Alpha 5: fixed movement from player to spectator only showing the players from the player's team --- Alpha 4: "fixed" the bug that prevented plugin from activating after being deactivated --- (but it will be loaded before game start because the initialize function is used for this for now) --- fixed save/load position for spectator mode and added proper boundary checks --- Alpha 3: hopefully fixed the display of the empty player when in player mode, myID now only calculated in player mode --- if spectator mode position donesn't exist, load the player mode position for spectator mode, the other way around for player mode --- and only when none exist load the default position that is calculated at load --- added unloading when only one player in the team --- Alpha 2: added table cleanups in teamdied --- Alpha 1: should now correctly sort the playerlist for both player and spectator modes - --- mono's changes since 1.3/1.5: --- major thanks to: smoth, aegis, quantum, lurker and the testers: Malicus, [war]duckomen --- version mono.40 beta 22: a few cleanups and maybe fixed the position bug --- version mono.40 beta 21: hopefully fixed the drifting y-axis for save position and spectator mode not set before setupteam executes bugs --- version mono.40 beta 20: capacity indicators positions are no longer constantly recalculated unless plugin is moved --- capacity indicators color determination now uses non-float numbers --- rearranged the if nest of capacity indicators in GL section (chances are higher for > 6000/3000 energy/metal capacity then the chances for < 100) --- added save and restore plugin location on the screen --- added save and restore plugin location on the screen independently for spectator and player modes --- version mono.40 beta 17: removed the useless function call ViewResize which caused all the debugging and programming headaches in updateBars --- optimized drawscreen by moving isguihidden into gameframe (there is no need to call the function so many times) --- all myID filtering is hopefully permanently removed from inner loops without the bug of drawing before game start --- version mono.40 beta 16: another updateBars inner loop optimization: removed the root conditional --- threshold indicators position should now remain correct independently of it's size --- removed the root conditional from all teamList for loops --- hopefully fixed the bug when only one allied player exists but is not shown --- version mono.40 beta 15: hopefully fixed the "-1 player" being drawn in the list of players bug --- version mono.40 beta 14: fixed threshold indicators lag when moving --- version mono.40 beta 13: removed the if moving conditional in updateBars and placed content in mousemove --- fixed bug showing own (non-player) resources when spectator/replay --- optimized inner updateBars loop and mousepress to not make function calls to determine spectator/replay state --- by using UnitCreated for all spectator state tracking --- one more optimization to threshold indicators - reduce the math done in parameters (x2 of threshold indicators is not updated 30*numallied players per sec) --- version mono.40 beta 12: reverted to the old tooltips method, fixed bug with height inscreasing after every time the plugin is reloaded --- version mono.40 beta 11: merged with latest released work of others (AF, BD), reverted beta 6 changes --- version mono.40 beta 10: fixed bug with resource bar plus v2.0 affecting alpha of bar backgrounds --- version 1.40 beta 9: colors on the right of the bars instead of alpha of background for capacity indication --- version 1.40 beta 8: reduce one more instruction in GL section of updateBars, increased number of alpha values for capacity indication --- that however comes with the same penalty of lag as the threshold indicators when the toggle state changes --- version 1.40 beta 7: prevent resource from drawing outside of the bar sizes, don't calculate share threshold by default of players who are no longer members of the team --- version 1.40 beta 6: correctly position the bars based on player's resolution without resorting to hacks --- version 1.40: added alpha-coded storage capacities bar background controllable with right mouse button --- version 1.37: 6 more optimizations to updateBars: draw the background from the amount of current resource instead of from beginning --- side effect makes it easier to see players which are no longer part of the team --- remove ex1 and use xoffset directly, move ex2 outside of the loop, update them only when they change --- eliminated the 2 redundant reassignments eCur and mCur --- version 1.36: added option to draw share threshold even if allies are not sharing and middle mouse toggle --- version 1.35: one more indicators optimization: remove function calls and nil checks from unitcreated --- version 1.34: 2 more indicators optimizations: updates only allies and updates ALL allies when any unit is created --- version 1.33: yet more optimizations for indicators (moved to UnitCreated, removed esx2/msx2, made xoffset loop invariant in updateBars) --- version 1.32: optimizations (mostly in the indicators but also a few others) --- version 1.31: added energy and metal share threshold indicators --------------------------------------------------------------------------------- ------------------------------- Function Speedups ------------------------------- - -local GetPlayerList = Spring.GetPlayerList -local GetPlayerInfo = Spring.GetPlayerInfo -local GetTeamResources = Spring.GetTeamResources -local GetMyTeamID = Spring.GetMyTeamID -local GetMouseState = Spring.GetMouseState -local GetSpectatingState = Spring.GetSpectatingState -local IsGUIHidden = Spring.IsGUIHidden -local ShareResources = Spring.ShareResources -local GetGameFrame = Spring.GetGameFrame -local GetAllyTeamList = Spring.GetAllyTeamList -local GetTeamList = Spring.GetTeamList -local GetTeamColor = Spring.GetTeamColor -local GetMyAllyTeamID = Spring.GetMyAllyTeamID -local GetTeamInfo = Spring.GetTeamInfo -- used to find the -1 teamID and remove it from the teamList -local SendCommands = Spring.SendCommands - --------------------------- Lua Math Function Speedups -------------------------- -local mathMin = math.min ----------------------------------- GL Speedups --------------------------------- -local sF = string.format -local gl, GL = gl, GL -local glText = gl.Text -local glRect = gl.Rect -local glColor = gl.Color -local glBlending = gl.Blending -local glPushMatrix = gl.PushMatrix -local glCallList = gl.CallList -local glPopMatrix = gl.PopMatrix -local glDeleteList = gl.DeleteList -local glCreateList = gl.CreateList -local GetTextWidth = fontHandler.GetTextWidth -local UseFont = fontHandler.UseFont -local TextDraw = fontHandler.Draw -local TextDrawCentered = fontHandler.DrawCentered -local TextDrawRight = fontHandler.DrawRight - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local displayList -local staticList -local optionsList = nil -- the options menu ---local optionsList = glCreateList( function() end) -local BAR_HEIGHT = 6 -local BAR_SPACER = 3 -local BAR_WIDTH = 120 -local BAR_GAP = 7 -local TOTAL_BAR_HEIGHT = (BAR_SPACER + BAR_HEIGHT + BAR_HEIGHT) -local TOP_HEIGHT = (BAR_GAP + BAR_GAP) -local BAR_OFFSET = (TOP_HEIGHT + BAR_SPACER) -local START_HEIGHT = (TOTAL_BAR_HEIGHT + BAR_GAP + TOP_HEIGHT) -local FULL_BAR = (BAR_WIDTH + BAR_GAP + BAR_GAP + BAR_SPACER) -local w = (BAR_WIDTH + BAR_OFFSET + BAR_GAP) -local h = START_HEIGHT -local x1 = 0 -local y1 = 0 -local saveY = 0 -local xoffset = 0 -local x2 = 0 -local capstart = 0 -local capend = 0 -local size = 1 -local viewSizeX, viewSizeY = gl.GetViewSizes() -local replay = Spring.IsReplay() -local initspec = GetSpectatingState() -if replay then initspec = true end -if initspec then - x1 = viewSizeX - w - y1, saveY = ((viewSizeY / 1000) * 999) + (- h - ((viewSizeY / 100) * 20)) -else - if 1750 <= viewSizeX then - x1 = ((viewSizeX / 1000) * 267) - w - y1, saveY = viewSizeY - h --- this is the nice place for high resolution players - else - x1 = viewSizeX - w - 100 - y1, saveY = ((viewSizeY / 1000) * 999) + (- h - ((viewSizeY / 100) * 3)) - end -end - -local mx, my = 0,0 -local sentSomething = false -local enabled = false -local transferring = false -local transferTeam -local transferType -local teamList = {} -local teamListA = {} -local teamColors = {} -local teamIcons = {} -local deadTeams = {} -local sendEnergy = {} -local sendMetal = {} -local trnsEnergy = {} -local trnsMetal = {} -local labelText = {} -local labelTextname = {} -local separators = {} -local sentEnergy = 0 -local sentMetal = 0 - --------------------------------------------------------------------------------- -local THRESH_SIZE = 3 -- size (width) of the threshold indicators -local teamResES = {} -local teamResMS = {} -local teamResSE = {} -local teamResSM = {} -local eShare = {} -local mShare = {} -local eMax = {} -local mMax = {} -local drawAll = false -- draw share threshold when player is not sharing ? -local DRAW_TEAMS = true -local draw_player_names = true -local capcolors = true -local TOOL_TIPS = true - ---local windows = {} ---local Window ---local ScrollPanel ---local Chili ---local lab ---local tx = "Many of your fathers and brothers have perished valiantly in the face of a contemptible enemy. We must never forget what the Federation has done to our people! My brother, Garma Zabi, has shown us these virtues through our own valiant sacrifice. By focusing our anger and sorrow, we are finally in a position where victory is within our grasp, and once again, our most cherished nation will flourish. Victory is the greatest tribute we can pay those who sacrifice their lives for us! Rise, our people, Rise! Take your sorrow and turn it into anger! Zeon thirsts for the strength of its people! SIEG ZEON!!! SIEG ZEON!!! SIEG ZEON!!" ---local btn ---local scrollpanel1 ---local redlabel ---local bluelabel ---local scrolllabel ---local drawAll = options.drawAll.value ---local DRAW_TEAMS = options.DRAW_TEAMS.value ---local draw_player_names = options.draw_player_names.value ---local capcolors = options.capcolors.value ---local TOOL_TIPS = options.TOOL_TIPS.value --------------------------------------------------------------------------------- - -options = { - drawAll = { - name = 'forced thresh', - desc = 'draw share thresholds even when the player is not sharing', - type = 'bool', - value = false - }, - capcolors = { - name = 'capacity rects', - desc = 'reclangles to indicate storage capacity', - type = 'bool', - value = true - }, - DRAW_TEAMS = { - name = 'player teams', - desc = 'draw players from other teams', - type = 'bool', - value = true - }, - draw_player_names = { - name = 'player names', - desc = 'draw player names next to resource bars', - type = 'bool', - value = true - }, - TOOL_TIPS = { - name = 'Tool Tips', --- desc = 'If there are multiple builders of the same type, only one icon will be shown.', - type = 'bool', - value = true - }, - size = { - name = 'Size', - desc = 'Scaling factor of the widget', - type = 'number', - value = 1, - min = 0.4, - max = 2.0, - step = 0.1 - } - -} - -options_path = 'Settings/Interface/Ally Resource Bars 1.83 Alpha 2' - -function options.size:OnChange() - options.size.value = self.value - --size = self.value - BAR_HEIGHT = 6 * self.value - BAR_SPACER = 3 * self.value - BAR_WIDTH = 120 * self.value - BAR_GAP = 7 * self.value - TOTAL_BAR_HEIGHT = (BAR_SPACER + BAR_HEIGHT + BAR_HEIGHT) - TOP_HEIGHT = (BAR_GAP + BAR_GAP) - BAR_OFFSET = (TOP_HEIGHT + BAR_SPACER) - START_HEIGHT = (TOTAL_BAR_HEIGHT + BAR_GAP + TOP_HEIGHT) - FULL_BAR = (BAR_WIDTH + BAR_GAP + BAR_GAP + BAR_SPACER) - w = (BAR_WIDTH + BAR_OFFSET + BAR_GAP) - h = START_HEIGHT - xoffset = (x1+BAR_OFFSET) - x2 = (xoffset+BAR_WIDTH) - capstart = x2+1 - capend = x2 + (BAR_GAP - 1) - THRESH_SIZE = 3 * self.value - for teamIndex,teamID in pairs(teamList) do - -- update position of the thresholds only if they already have a position, eliminates the if myID - -- and the rest of the conditionals for determining is they do have a threshold, it is still only updated at the UnitCreated frequency - if teamResES[teamID] ~= nil then - teamResES[teamID] = {esx1 = xoffset+(BAR_WIDTH * eShare[teamID]) - THRESH_SIZE / 2} - teamResES[teamID].esx2 = teamResES[teamID].esx1+THRESH_SIZE - end - if teamResMS[teamID] ~= nil then - teamResMS[teamID] = {msx1 = xoffset+(BAR_WIDTH * mShare[teamID]) - THRESH_SIZE / 2} - teamResMS[teamID].msx2 = teamResMS[teamID].msx1+THRESH_SIZE - end - end - if started and enabled then - updateStatics() - updateBars() - end -end - -function options.drawAll:OnChange() - options.drawAll.value = self.value - drawAll = self.value -end - -function options.capcolors:OnChange() - options.capcolors.value = self.value - capcolors = self.value -end - -function options.DRAW_TEAMS:OnChange() - options.DRAW_TEAMS.value = self.value - DRAW_TEAMS = self.value -end - -function options.draw_player_names:OnChange() - options.draw_player_names.value = self.value - draw_player_names = self.value -end - -function options.TOOL_TIPS:OnChange() - options.TOOL_TIPS.value = self.value - TOOL_TIPS = self.value -end - -local function getTeamNames() - local teamNames = {} - local playerList = GetPlayerList() - for _,playerID in ipairs(playerList) do - local name,_,spec,teamID = GetPlayerInfo(playerID) - if not spec then - if name and teamID then - --Spring.Echo(name) - teamNames[teamID] = name - end - end - end - return teamNames -end - -function widget:Shutdown() - glDeleteList(displayList) - for i=1,#windows do - (windows[i]):Dispose() - end -end - -local function setUpTeam() - teamList = {} - teamListA = {} - teamRes = {} - teamColors = {} - local getTeams = nil - local teamCount = 0 - Ispec = GetSpectatingState() - if Ispec then - teamListA = nil - local alist = GetAllyTeamList() - for _,allyID in pairs(alist) do - getTeams = GetTeamList(allyID) - if getTeams ~= nil then - local removedead = 0 - for _,teamID in ipairs(getTeams) do --ipairs appears to return the teams better sorted than pairs - _,p,dead = GetTeamInfo(teamID) - if (not deadTeams[teamID]) and (p ~= -1) and (not dead) then --and (used ~= 0) and (produced ~= 0) and (excessed ~= 0) and (received ~=0) and (sent ~=0) then --and (teamID ~= 16) then - teamCount = (teamCount + 1) - teamList[teamCount] = teamID - else - removedead = removedead + 1 - end - end - local temp = _-1 - separators[_] = (separators[temp] or 0) + (#getTeams - removedead) - end - - end - else - myID = GetMyTeamID() -- this is only needed here and in transfer resources, but in spectator mode resources cannot be transfered - getTeams = GetTeamList(GetMyAllyTeamID()) - local removedead = 0 - for _,teamID in ipairs(getTeams) do - local eCur = GetTeamResources(teamID, "energy") - if eCur and (not deadTeams[teamID]) and (teamID ~= myID) then --and (not dead) then - teamCount = (teamCount + 1) - teamList[teamCount] = teamID - else - removedead = removedead + 1 - end - end - separators[1] = #getTeams - removedead - local alist = GetAllyTeamList() - local teamCountA = 0 - for _,allyID in pairs(alist) do - if allyID ~= GetMyAllyTeamID() then getTeams = GetTeamList(allyID) end - local removedead = 0 - if getTeams ~= nil then - for _,teamID in ipairs(getTeams) do --ipairs appears to return the teams better sorted than pairs - _,p,dead = GetTeamInfo(teamID) - if (not deadTeams[teamID]) and (p ~= -1) and (not dead) and (teamID ~= myID) then --and (used ~= 0) and (produced ~= 0) and (excessed ~= 0) and (received ~=0) and (sent ~=0) then --and (teamID ~= 16) then - teamCountA = (teamCountA + 1) - teamListA[teamCountA] = teamID - else - removedead = removedead + 1 - end - end - local temp = _-1 - separators[_] = (separators[temp] or 0) + (#getTeams - removedead) - end - end - end - - for teamIndex,teamID in pairs(teamList) do - local r,g,b = GetTeamColor(teamID) - teamColors[teamID] = {r=r,g=g,b=b} - end - if teamListA ~= nil then - for teamIndex,teamID in pairs(teamListA) do - local r,g,b = GetTeamColor(teamID) - teamColors[teamID] = {r=r,g=g,b=b} - end - end - - if (teamCount > 0) then - enabled = true - return true - else - enabled = false - Spring.Echo("Ally Resource Bars: No allies, unloading") - widgetHandler:RemoveWidget() -- without this, setUpTeam is continuously executed in solo mode, probably from gameframe's elseif - return false - end -end - -local function updateStatics() - if (staticList) then glDeleteList(staticList) end - staticList = glCreateList( function() - glBlending(true) - - if (WG.Chili) then - --for i=1,#windows do -- delete existing window - -- (windows[i]):Dispose() - --end - --windows = {} -- delete existing windows part 2 - if window0 ~= nil then window0:Dispose() end - - --local Chili = WG.Chili - --local Window = Chili.Window - --local screen0 = WG.Chili.Screen0 - --window0 = {} - window0 = WG.Chili.Window:New{ - x = x1, - y = viewSizeY - y1 - h, - dockable = false, - --parent = screen0, - parent = WG.Chili.Screen0, - draggable = false, - resizable = false, - dragUseGrip = false, - clientWidth = w - 20, - clientHeight = h - 25, - } - --windows[1] = window0 - else - glColor(0.2, 0.2, 0.2, 0.8) - glRect(x1, y1, x1+w,y1+h) - end - - local height = h - TOP_HEIGHT - local teamNames = getTeamNames() - teamIcons = {} - for teamIndex,teamID in pairs(teamList) do - glColor(teamColors[teamID].r,teamColors[teamID].g,teamColors[teamID].b,1) - glRect(x1+BAR_GAP,y1+height,x1+TOP_HEIGHT,y1+height-TOTAL_BAR_HEIGHT) - teamIcons[teamID] = - { - name = teamNames[teamID] or "No Player", - iy1 = y1+height, - iy2 = y1+height-TOTAL_BAR_HEIGHT, - } - labelTextname[teamID] = - { - label=teamIcons[teamID].name, - x=x1-BAR_SPACER, - --y=teamIcons[teamID].iy2+1, - y=y1+height-TOTAL_BAR_HEIGHT, - size=TOTAL_BAR_HEIGHT, - config="orn", - } - height = (height - TOTAL_BAR_HEIGHT - BAR_GAP) - end - height = (height + TOTAL_BAR_HEIGHT + BAR_GAP) * #teamList - if teamListA ~= nil then - for teamIndex,teamID in pairs(teamListA) do - teamIcons[teamID] = - { - name = teamNames[teamID] or "No Player", - iy1 = y1+height, - iy2 = y1+height-TOTAL_BAR_HEIGHT, - } - labelTextname[teamID] = - { - label=teamIcons[teamID].name, - x=x1-BAR_SPACER, - y=teamIcons[teamID].iy2+1, - size=TOTAL_BAR_HEIGHT, - config="orn", - } - height = (height - TOTAL_BAR_HEIGHT - BAR_GAP) - end - end - - end) -end - -local function updateBars() - local eCur, mCur --, eShare, mShare - local height = h - TOP_HEIGHT - for teamIndex,teamID in pairs(teamList) do - eCur, eMax[teamID], _, _, _, eShare[teamID], _ = GetTeamResources(teamID, "energy") - mCur, mMax[teamID], _, _, _, mShare[teamID], _ = GetTeamResources(teamID, "metal") - - teamRes[teamID] = - { - ey1 = y1+height, - ex2b = xoffset+(BAR_WIDTH * ((eCur + (sendEnergy[teamID] or 0)) / eMax[teamID])), - ey2 = y1+height-BAR_HEIGHT, - my1 = y1+height-BAR_HEIGHT-BAR_SPACER, - mx2b = xoffset+(BAR_WIDTH * ((mCur + (sendMetal[teamID] or 0)) / mMax[teamID])), - my2 = y1+height-TOTAL_BAR_HEIGHT, - } - - if (teamID == transferTeam) then - if (transferType == "energy") then - teamRes[teamID].eRec = true - else - teamRes[teamID].mRec = true - end - end - height = (height - TOTAL_BAR_HEIGHT - BAR_GAP) - end - if (height ~= 0) then - h = (h - height) - y1 = (y1 + height) - updateStatics() - end - if (displayList) then glDeleteList(displayList) end - displayList = glCreateList( function() - for _,d in pairs(teamRes) do - glColor(1, 1, 0, 1) - if d.ex2b > x2 then d.ex2b = x2 end -- bug fix for bars drawing outside borders - glRect(xoffset,d.ey1,d.ex2b,d.ey2) -- draw the amount of the resource from the offset to the relative capacity position on screen - if d.eRec then - glColor(0.8, 0, 0, 0.8) - else - glColor(0.8, 0.8, 0, 0.3) - end - glRect(d.ex2b,d.ey1,x2,d.ey2) -- draw the rest of the unused relative capacity on screen from the current capacity (ex2b) to the end of the bar (x2) - if teamResSE[_] ~= nil then - if teamResSE[_] == 2 then - glColor(0, 0.8, 0, 1) - elseif teamResSE[_] == 3 then - glColor(0, 0, 0.8, 1) - elseif teamResSE[_] == 1 then - glColor(0.6, 0.2, 0, 1) - end - glRect(capstart,d.ey1,capend,d.ey2) -- draw the capacity indicator from the end of the bar (x2+1) to x size of plugin - 1 - end - if teamResES[_] ~= nil then - glColor(1, 0.2, 0, 0.8) - glRect(teamResES[_].esx1,d.ey1,teamResES[_].esx2,d.ey2) - end - glColor(1, 1, 1, 1) - if d.mx2b > x2 then d.mx2b = x2 end - glRect(xoffset,d.my1,d.mx2b,d.my2) - if d.mRec then - glColor(0.8, 0, 0, 0.8) - else - glColor(0.8, 0.8, 0.8, 0.3) - end - glRect(d.mx2b,d.my1,x2,d.my2) - if teamResSM[_] ~= nil then - if teamResSM[_] == 2 then - glColor(0, 0.8, 0, 1) - elseif teamResSM[_] == 3 then - glColor(0, 0, 0.8, 1) - elseif teamResSM[_] == 1 then - glColor(0.6, 0.2, 0, 1) - end - glRect(capstart,d.my1,capend,d.my2) - end - if teamResMS[_] ~= nil then - glColor(1, 0.2, 0.2, 0.8) - glRect(teamResMS[_].msx1,d.my1,teamResMS[_].msx2,d.my2) - end - end - end) -end - -function widget:Initialize() - if saveY == nil then saveY = y1 end - xoffset = x1+BAR_OFFSET - x2 = xoffset+BAR_WIDTH - capstart = x2+1 - capend = x2 + (BAR_GAP - 1) - if setUpTeam() then - updateStatics() - updateBars() - end -end - -function widget:TeamDied(teamID) - deadTeams[teamID] = true - -- these tables will otherwise still contain data that is no longer relevant - -- the unitcreated else cleanup will only cleanup from the list of current teams created by setupteam - -- it will not clean the ID's of the previous teamList - teamResES[teamID] = nil - teamResMS[teamID] = nil - teamResSE[teamID] = nil - teamResSM[teamID] = nil - eShare[teamID] = nil - mShare[teamID] = nil - eMax[teamID] = nil - mMax[teamID] = nil - - if setUpTeam() then - updateStatics() - updateBars() - end -end - -function widget:UnitCreated(unitID, unitDefID, unitTeam) - if deadTeams[unitTeam] then - deadTeams[unitTeam] = nil - if setUpTeam() then - updateStatics() - updateBars() - end - end - if enabled then - for teamIndex,teamID in ipairs(teamList) do -- makes it faster without keeping information about non-allied teams - if capcolors then - if eMax[teamID] <= 100 then teamResSE[teamID] = nil - elseif (eMax[teamID] > 100) and (eMax[teamID] < 1000) then teamResSE[teamID] = 1 - elseif (eMax[teamID] >= 1000) and (eMax[teamID] < 6000) then teamResSE[teamID] = 2 - elseif eMax[teamID] >= 6000 then teamResSE[teamID] = 3 end - - if mMax[teamID] <= 100 then teamResSM[teamID] = nil - elseif (mMax[teamID] > 100) and (mMax[teamID] < 1000) then teamResSM[teamID] = 1 - elseif (mMax[teamID] >= 1000) and (mMax[teamID] < 3000) then teamResSM[teamID] = 2 - elseif mMax[teamID] >= 3000 then teamResSM[teamID] = 3 end - else - teamResSE[teamID] = nil - teamResSM[teamID] = nil - end - if drawAll or ((not deadTeams[teamID]) and (eShare[teamID] < 0.94)) then - teamResES[teamID] = {esx1 = xoffset+(BAR_WIDTH * eShare[teamID]) - THRESH_SIZE / 2} - teamResES[teamID].esx2 = teamResES[teamID].esx1+THRESH_SIZE - else teamResES[teamID] = nil end - if drawAll or ((not deadTeams[teamID]) and (mShare[teamID] < 0.99)) then - teamResMS[teamID] = {msx1 = xoffset+(BAR_WIDTH * mShare[teamID]) - THRESH_SIZE / 2} - teamResMS[teamID].msx2 = teamResMS[teamID].msx1+THRESH_SIZE - else teamResMS[teamID] = nil end - end - end -end - -local function transferResources(n) - local sCur, sMax = GetTeamResources(transferTeam, transferType) - local lCur, _, _, lInc, _, _, _, lRec = GetTeamResources(myID, transferType) - if (transferType == "metal") then - lCur = (lCur - sentMetal) - sCur = sCur + (sendMetal[transferTeam] or 0) - else - lCur = (lCur - sentEnergy) - sCur = sCur + (sendEnergy[transferTeam] or 0) - end - local send = mathMin(mathMin((sMax-sCur),((lInc+lRec)*0.3)),lCur) ---local send = 100 - if (send > 0) then - if (transferType == "energy") then - if sendEnergy[transferTeam] then - sendEnergy[transferTeam] = (sendEnergy[transferTeam] + send) - else - sendEnergy[transferTeam] = send - sentSomething = true - end - sentEnergy = (sentEnergy + send) - trnsEnergy[transferTeam] = (send * 30) - else - if sendMetal[transferTeam] then - sendMetal[transferTeam] = (sendMetal[transferTeam] + send) - else - sendMetal[transferTeam] = send - sentSomething = true - end - sentMetal = (sentMetal + send) - trnsMetal[transferTeam] = (send * 30) - end - end -end - -function widget:GameFrame(n) - if enabled then - updateBars() - if transferTeam then - transferResources(n) - end - if sentSomething and ((n % 16) == 0) then - for teamID,send in pairs(sendEnergy) do - ShareResources(teamID,"energy",send) - end - for teamID,send in pairs(sendMetal) do - ShareResources(teamID,"metal",send) - end - sendEnergy = {} - sendMetal = {} - trnsEnergy = {} - trnsMetal = {} - sentEnergy = 0 - sentMetal = 0 - sentSomething = false - end - if TOOL_TIPS then - local x, y = GetMouseState() - if (mx ~= x) or (my ~= y) or transferring or ((n % 15) == 0) then - mx = x - my = y - if (x > x1 + BAR_GAP) and (y > y1 + BAR_GAP) and (x < (x1 + FULL_BAR)) and (y < (y1 + h - TOP_HEIGHT)) then - for teamID,defs in pairs(teamIcons) do - if (y < defs.iy1) and (y >= defs.iy2) then - local eAmount, eCapacity, _, eInc, _, _, _, eRec = GetTeamResources(teamID, "energy") - local mAmount, mCapacity, _, mInc, _, _, _, mRec = GetTeamResources(teamID, "metal") - eRec = eRec + (trnsEnergy[teamID] or 0) - mRec = mRec + (trnsMetal[teamID] or 0) - if (Ispec and (draw_player_names == false)) or ((not Ispec) and (draw_player_names == false) and (DRAW_TEAMS == false)) then - labelText[1] = - { - label=defs.name, - x=x1-BAR_SPACER, - y=defs.iy2-1, - size=TOTAL_BAR_HEIGHT, - config="orn", - } - end - labelText[2] = - { - label="(E: +"..sF("%.1f",eInc+eRec) ..", M: +"..sF("%.2f",mInc+mRec)..")", - x=x1-BAR_SPACER, - y=defs.iy2-TOTAL_BAR_HEIGHT, - size=TOTAL_BAR_HEIGHT/1.25, - config="orn", - } - labelText[3] = - { - label="(E: "..sF("%d",eAmount) .." / "..sF("%d",eCapacity)..")", - x=x2+BAR_SPACER+BAR_GAP, - --x=x1-BAR_SPACER, - y=defs.iy2+11, - --size=TOTAL_BAR_HEIGHT/1.25, - config="oln", - } - labelText[4] = - { - label="(M: "..sF("%d",mAmount) .." / "..sF("%d",mCapacity)..")", - --x=x1-BAR_SPACER, - y=defs.iy2+11+BAR_SPACER-TOTAL_BAR_HEIGHT, - --size=TOTAL_BAR_HEIGHT/1.25, - --config="oln", - } - labelText[5] = -- options - { - --label="(M: "..sF("%d",mAmount) .." / "..sF("%d",mCapacity)..")", - label="Options >", - --x=x1-BAR_SPACER, - x=x1+w, - --y=defs.iy2+11+BAR_SPACER-TOTAL_BAR_HEIGHT, - y=y1-10, - size=TOTAL_BAR_HEIGHT/1.25, - config="oln", - } - return - end - end - if (labelText) then labelText = {} end - elseif (labelText) then labelText = {} end - end - end - elseif (#GetTeamList(GetMyAllyTeamID()) > 1) then - setUpTeam() - updateStatics() - updateBars() - end - if not IsGUIHidden() then started = true end -end - -function widget:GameStart() - enabled = true - setUpTeam() - updateStatics() -end - -function widget:DrawScreen() - if enabled and started then - glPushMatrix() - glCallList(staticList) - glCallList(displayList) - --glCallList(optionsList) - if optionsList then glCallList(optionsList) end - if (labelText[1]) then - glColor(1, 1, 1, 0.8) - glText(labelText[1].label,labelText[1].x,labelText[1].y,labelText[1].size,labelText[1].config) - end - if (labelText[2]) then - glColor(0.8, 0.8, 0.8, 0.8) - glText(labelText[2].label,labelText[2].x,labelText[2].y,labelText[2].size,labelText[2].config) - glText(labelText[3].label,labelText[3].x,labelText[3].y,labelText[2].size,labelText[3].config) - glText(labelText[4].label,labelText[3].x,labelText[4].y,labelText[2].size,labelText[3].config) - end - if (not WG.Chili) then glText("Options >",x1+w,y1+h-TOP_HEIGHT/1.3,TOTAL_BAR_HEIGHT/1.25,"orn") end -- options - if draw_player_names == true then - for teamIndex,teamID in pairs(teamList) do - glColor(teamColors[teamID].r,teamColors[teamID].g,teamColors[teamID].b,1) - TextDrawRight(labelTextname[teamID].label,labelTextname[teamID].x,labelTextname[teamID].y) - if Ispec then - for i=1,#separators-1 do -- search the list for last player of the team indexes that need to be separated and find out if the current is one of them - if (separators[i] == teamIndex) then - glColor(1, 1, 1, 0.8) - glRect(x1,labelTextname[teamID].y-5,labelTextname[teamID].x-100,labelTextname[teamID].y-4) -- draw the separator relative to that player's position - end - end - end - end - end - - if DRAW_TEAMS and (teamListA ~= nil) then - -- this list is needed only in player mode to draw all the other teams and their separators - for teamIndex,teamID in pairs(teamListA) do - glColor(teamColors[teamID].r,teamColors[teamID].g,teamColors[teamID].b,1) - TextDrawRight(labelTextname[teamID].label,labelTextname[teamID].x,labelTextname[teamID].y) - for i=1,#separators-1 do - if (separators[i] == teamIndex) then - glColor(1, 1, 1, 0.8) - glRect(x1,labelTextname[teamID].y-5,labelTextname[teamID].x-100,labelTextname[teamID].y-4) - end - end - --end - end - end - - glPopMatrix() - end -end - -local function options() - --posX = x1 - --posY = y1 - glDeleteList(optionsList) - optionsList = glCreateList( function() - glColor(0.8, 0.8, 0.8, 0.8) - glRect(x1, y1, x1+w,y1+1) -- separator - - glColor(0.2, 0.2, 0.2, 0.8) - glRect(x1, y1, x1+w,y1-90) -- background - - glText("capacity rects : ",x1+5,y1-20,TOTAL_BAR_HEIGHT,"oln") - if capcolors == true then - state = "on" - else - state = "off" - end - glText(state,x1+w-5,y1-20,TOTAL_BAR_HEIGHT,"orn") - - glText("forced thresh : ",x1+5,y1-35,TOTAL_BAR_HEIGHT,"oln") - if drawAll == true then - state = "on" - else - state = "off" - end - glText(state,x1+w-5,y1-35,TOTAL_BAR_HEIGHT,"orn") - - glText("player names : ",x1+5,y1-50,TOTAL_BAR_HEIGHT,"oln") - if draw_player_names == true then - state = "on" - else - state = "off" - end - glText(state,x1+w-5,y1-50,TOTAL_BAR_HEIGHT,"orn") - - glText("player teams : ",x1+5,y1-65,TOTAL_BAR_HEIGHT,"oln") - if DRAW_TEAMS == true then - state = "on" - else - state = "off" - end - glText(state,x1+w-5,y1-65,TOTAL_BAR_HEIGHT,"orn") - - glText("tool tips : ",x1+5,y1-80,TOTAL_BAR_HEIGHT,"oln") - if TOOL_TIPS == true then - state = "on" - else - state = "off" - end - glText(state,x1+w-5,y1-80,TOTAL_BAR_HEIGHT,"orn") - end) - options_menu_active = true -end - -function widget:MouseMove(x, y, dx, dy, button) - if (enabled) then - if moving then - x1 = x1 + dx - y1 = y1 + dy - saveY = (saveY + dy) or y1 - xoffset = (x1+BAR_OFFSET) - x2 = (xoffset+BAR_WIDTH) - capstart = x2+1 - capend = x2 + (BAR_GAP - 1) - if options_menu_active == true then options() end - for teamIndex,teamID in pairs(teamList) do - -- update position of the thresholds only if they already have a position, eliminates the if myID - -- and the rest of the conditionals for determining is they do have a threshold, it is still only updated at the UnitCreated frequency - if teamResES[teamID] ~= nil then - teamResES[teamID] = {esx1 = xoffset+(BAR_WIDTH * eShare[teamID]) - THRESH_SIZE / 2} - teamResES[teamID].esx2 = teamResES[teamID].esx1+THRESH_SIZE - end - if teamResMS[teamID] ~= nil then - teamResMS[teamID] = {msx1 = xoffset+(BAR_WIDTH * mShare[teamID]) - THRESH_SIZE / 2} - teamResMS[teamID].msx2 = teamResMS[teamID].msx1+THRESH_SIZE - end - end - updateBars() - updateStatics() - elseif transferring then - transferTeam = nil - if (x > (x1+BAR_OFFSET)) and (x < (x1+BAR_OFFSET+BAR_WIDTH)) then - if (transferType == "energy") then - for teamID,defs in pairs(teamRes) do - if (y < defs.ey1) and (y > defs.ey2) then - transferTeam = teamID - return - end - end - else - for teamID,defs in pairs(teamRes) do - if (y < defs.my1) and (y > defs.my2) then - transferTeam = teamID - return - end - end - end - end - end - end -end - - - -function widget:MousePress(x, y, button) - if (not WG.Chili) then - if (options_menu_active == true) and (enabled) and ((x > x1) and (y > y1-20) and (x < (x1 + w)) and (y <= (y1 - 5))) then - capcolors = not capcolors - options() - end - - if (options_menu_active == true) and (enabled) and ((x > x1) and (y > y1-35) and (x < (x1 + w)) and (y <= (y1 - 20))) then - drawAll = not drawAll - options() - end - - if (options_menu_active == true) and (enabled) and ((x > x1) and (y > y1-50) and (x < (x1 + w)) and (y <= (y1 - 35))) then - draw_player_names = not draw_player_names - options() - end - - if (options_menu_active == true) and (enabled) and ((x > x1) and (y > y1-65) and (x < (x1 + w)) and (y <= (y1 - 50))) then - DRAW_TEAMS = not DRAW_TEAMS - options() - end - - if (options_menu_active == true) and (enabled) and ((x > x1) and (y > y1-80) and (x < (x1 + w)) and (y <= (y1 - 65))) then - TOOL_TIPS = not TOOL_TIPS - options() - end - if (enabled) and ((x > x1 + w/1.65) and (y > (y1 + h - TOP_HEIGHT)) and (x < (x1 + w)) and (y < (y1 + h))) then - if button == 1 then - if options_menu_active == true then - options_menu_active = false - glDeleteList(optionsList) - optionsList = nil - --optionsList = glCreateList( function() end) - else - options() - end - end - end - end - if (enabled) and ((((x > x1) and (y > (y1 + h - TOP_HEIGHT)) and (x < (x1 + w/1.65)) and (y < (y1 + h) )) or ((x > x1) and (y > y1) and (x < (x1 + w)) and (y < (y1 + h - TOP_HEIGHT)))) or ((WG.Chili) and ((x > x1) and (y > (y1 + h - TOP_HEIGHT)) and (x < x1 + w) and (y < (y1 + h) )))) then - if button == 1 and (y > (y1 + h - TOP_HEIGHT)) then - capture = true - moving = true - return capture - end - if (x > (x1+BAR_OFFSET)) and (x < (x1+BAR_OFFSET+BAR_WIDTH)) then - for teamID,defs in pairs(teamRes) do - if (y < defs.ey1) and (y >= defs.ey2) then - if Ispec or replay then - SendCommands('specteam '..teamID) - elseif button == 1 then - transferTeam = teamID - transferType = "energy" - transferring = true - elseif button == 3 then - SendCommands{"say a: would you give me some energy "..teamIcons[teamID].name.." ?"} - end - return true - elseif (y < defs.my1) and (y >= defs.my2) then - if Ispec or replay then - SendCommands('specteam '..teamID) - elseif button == 1 then - transferTeam = teamID - transferType = "metal" - transferring = true - elseif button == 3 then - SendCommands{"say a: would you give me some metal "..teamIcons[teamID].name.." ?"} - end - return true - end - end - end - end - return false -end - -function widget:MouseRelease(x, y, button) - capture = nil - moving = nil - transferring = false - transferTeam = nil - return capture -end - -function widget:GetConfigData(data) - if (not WG.Chili) then - if initspec then - return { - sx = x1, - sy = saveY, -- this variable is used to make sure we are saving the position of the plugin before the value has changed in updatebars loops - x = x, - y = y, - capcolors = capcolors, - drawAll = drawAll, - pnames = draw_player_names, - DRAW_TEAMS = DRAW_TEAMS, - TT = TOOL_TIPS, - } - else - return { - sx = sx, - sy = sy, - x = x1, - y = saveY, - capcolors = capcolors, - drawAll = drawAll, - pnames = draw_player_names, - DRAW_TEAMS = DRAW_TEAMS, - TT = TOOL_TIPS, - } - end - else - if initspec then - return { - sx = x1, - sy = saveY, -- this variable is used to make sure we are saving the position of the plugin before the value has changed in updatebars loops - x = x, - y = y, - } - else - return { - sx = sx, - sy = sy, - x = x1, - y = saveY, - } - end - - end -end - -function widget:SetConfigData(data) - if initspec then - if data.sx and data.sy then - x1 = data.sx - y1 = data.sy - elseif data.x and data.y then - x1 = data.x - y1 = data.y - end - if data.x then - x = data.x - end - if data.y then - y = data.y - end - else - if data.x and data.y then - x1 = data.x - y1 = data.y - elseif data.sx and data.sy then - x1 = data.sx - y1 = data.sy - end - if data.sx then - sx = data.sx - end - if data.sy then - sy = data.sy - end - end - if x1 > (viewSizeX - w) then x1 = viewSizeX - w - elseif x1 < 1 then x1 = 0 end - if y1 > (viewSizeY - h) then y1 = viewSizeY - h - elseif y1 < 1 then y1 = 0 end - saveY = saveY or y1 - if (not WG.Chili) then - if data.capcolors ~= nil then capcolors = data.capcolors else capcolors = true end - if data.TT ~= nil then TOOL_TIPS = data.TT else TOOL_TIPS = true end - if data.drawAll ~= nil then drawAll = data.drawAll else drawAll = false end - if data.pnames ~= nil then draw_player_names = data.pnames else draw_player_names = true end - if data.DRAW_TEAMS ~= nil then DRAW_TEAMS = data.DRAW_TEAMS else DRAW_TEAMS = true end - end -end diff --git a/LuaUI/Widgets_Evo/gui_attack_aoe.lua b/LuaUI/Widgets_Evo/gui_attack_aoe.lua index 55f167013..8178dddee 100644 --- a/LuaUI/Widgets_Evo/gui_attack_aoe.lua +++ b/LuaUI/Widgets_Evo/gui_attack_aoe.lua @@ -1,7 +1,7 @@ -- $Id: gui_attack_aoe.lua 3823 2009-01-19 23:40:49Z evil4zerggin $ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local versionNumber = "v3.1" +local versionNumber = "v3.1c" function widget:GetInfo() return { @@ -33,16 +33,14 @@ local pointSizeMult = 2048 -------------------------------------------------------------------------------- local aoeDefInfo = {} local dgunInfo = {} -local hasSelectionCallin = false +local hasSelection = false local aoeUnitDefID local dgunUnitDefID local aoeUnitID local dgunUnitID -local selUnitID local circleList local secondPart = 0 local mouseDistance = 1000 -local extraDrawRange -------------------------------------------------------------------------------- --speedups @@ -58,7 +56,7 @@ local GetUnitRadius = Spring.GetUnitRadius local GetUnitStates = Spring.GetUnitStates local TraceScreenRay = Spring.TraceScreenRay local CMD_ATTACK = CMD.ATTACK -local CMD_MANUALFIRE = CMD.MANUALFIRE +local CMD_DGUN = CMD.MANUALFIRE local g = Game.gravity local GAME_SPEED = 30 local g_f = g / GAME_SPEED / GAME_SPEED @@ -166,100 +164,84 @@ end --initialization -------------------------------------------------------------------------------- -local function getWeaponInfo(weaponDef, unitDef) - - local retData - - local weaponType = weaponDef.type - local scatter = weaponDef.accuracy + weaponDef.sprayAngle - local aoe = weaponDef.damageAreaOfEffect - local cost = unitDef.cost - local mobile = unitDef.speed > 0 - local waterWeapon = weaponDef.waterWeapon - local ee = weaponDef.edgeEffectiveness - if (weaponDef.cylinderTargetting >= 100) then - retData = {type = "orbital", scatter = scatter} - elseif (weaponType == "Cannon") then - retData = {type = "ballistic", scatter = scatter, v = (weaponDef.customParams.weaponvelocity or 0),range = weaponDef.range, - mygravity = weaponDef.customParams and weaponDef.customParams.mygravity and weaponDef.customParams.mygravity*800 - } - elseif (weaponType == "MissileLauncher") then - local turnRate = 0 - if (weaponDef.tracks) then - turnRate = weaponDef.turnRate - end - if (weaponDef.wobble > turnRate * 1.4) then - scatter = (weaponDef.wobble - weaponDef.turnRate) * (weaponDef.customParams.weaponvelocity or 0) * 16 - local rangeScatter = (8 * weaponDef.wobble - weaponDef.turnRate) - retData = {type = "wobble", scatter = scatter, rangeScatter = rangeScatter, range = weaponDef.range} - elseif (weaponDef.wobble > turnRate) then - scatter = (weaponDef.wobble - weaponDef.turnRate) * (weaponDef.customParams.weaponvelocity or 0) * 16 - retData = {type = "wobble", scatter = scatter} - elseif (weaponDef.tracks) then - retData = {type = "tracking"} - else - retData = {type = "direct", scatter = scatter, range = weaponDef.range} - end - elseif (weaponType == "AircraftBomb") then - retData = {type = "dropped", scatter = scatter, v = unitDef.speed, h = unitDef.wantedHeight, salvoSize = weaponDef.salvoSize, salvoDelay = weaponDef.salvoDelay} - elseif (weaponType == "StarburstLauncher") then - if (weaponDef.tracks) then - retData = {type = "tracking"} - else - retData = {type = "cruise"} - end - elseif (weaponType == "TorpedoLauncher") then - if (weaponDef.tracks) then - retData = {type = "tracking"} - else - retData = {type = "direct", scatter = scatter, range = weaponDef.range} - end - elseif (weaponType == "Flame" or weaponDef.noExplode) then - retData = {type = "noexplode", range = weaponDef.range} - else - retData = {type = "direct", scatter = scatter, range = weaponDef.range} - end - - if not weaponDef.impactOnly then - retData.aoe = aoe - else - retData.aoe = 0 - end - retData.cost = cost - retData.mobile = mobile - retData.waterWeapon = waterWeapon - retData.ee = ee - - return retData -end - local function SetupUnitDef(unitDefID, unitDef) if (not unitDef.weapons) then return end local maxSpread = minSpread local maxWeaponDef - for num, weapon in ipairs(unitDef.weapons) do + for _, weapon in ipairs(unitDef.weapons) do if (weapon.weaponDef) then local weaponDef = WeaponDefs[weapon.weaponDef] if (weaponDef) then - local aoe = weaponDef.damageAreaOfEffect - if (num == 3 and unitDef.canManualFire) then - dgunInfo[unitDefID] = getWeaponInfo(weaponDef, unitDef) - elseif (not weaponDef.isShield + if (weaponDef.canAttackGround + and not (weaponDef.type == "Shield") and not ToBool(weaponDef.interceptor) - and (aoe > maxSpread or weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle) > maxSpread )) then - maxSpread = max(aoe, weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle)) + and (weaponDef.damageAreaOfEffect > maxSpread or weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle) > maxSpread ) + and not string.find(weaponDef.name, "flak")) then + maxSpread = max(weaponDef.damageAreaOfEffect, weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle)) maxWeaponDef = weaponDef end end end end - if (maxWeaponDef) then - aoeDefInfo[unitDefID] = getWeaponInfo(maxWeaponDef, unitDef) + if (not maxWeaponDef) then return end + + local weaponType = maxWeaponDef.type + local scatter = maxWeaponDef.accuracy + maxWeaponDef.sprayAngle + local aoe = maxWeaponDef.damageAreaOfEffect + local cost = unitDef.cost + local mobile = unitDef.speed > 0 + local waterWeapon = maxWeaponDef.waterWeapon + local ee = maxWeaponDef.edgeEffectiveness + + if (maxWeaponDef.cylinderTargeting >= 100) then + aoeDefInfo[unitDefID] = {type = "orbital", scatter = scatter} + elseif (weaponType == "Cannon") then + aoeDefInfo[unitDefID] = {type = "ballistic", scatter = scatter, v = maxWeaponDef.projectilespeed * 30, range = maxWeaponDef.range} + elseif (weaponType == "MissileLauncher") then + local turnRate = 0 + if (maxWeaponDef.tracks) then + turnRate = maxWeaponDef.turnRate + end + if (maxWeaponDef.wobble > turnRate * 1.4) then + scatter = (maxWeaponDef.wobble - maxWeaponDef.turnRate) * maxWeaponDef.projectilespeed * 30 * 16 + local rangeScatter = (8 * maxWeaponDef.wobble - maxWeaponDef.turnRate) + aoeDefInfo[unitDefID] = {type = "wobble", scatter = scatter, rangeScatter = rangeScatter, range = maxWeaponDef.range} + elseif (maxWeaponDef.wobble > turnRate) then + scatter = (maxWeaponDef.wobble - maxWeaponDef.turnRate) * maxWeaponDef.projectilespeed * 30 * 16 + aoeDefInfo[unitDefID] = {type = "wobble", scatter = scatter} + elseif (maxWeaponDef.tracks) then + aoeDefInfo[unitDefID] = {type = "tracking"} + else + aoeDefInfo[unitDefID] = {type = "direct", scatter = scatter, range = maxWeaponDef.range} + end + elseif (weaponType == "AircraftBomb") then + aoeDefInfo[unitDefID] = {type = "dropped", scatter = scatter, v = unitDef.speed, h = unitDef.wantedHeight, salvoSize = maxWeaponDef.salvoSize, salvoDelay = maxWeaponDef.salvoDelay} + elseif (weaponType == "StarburstLauncher") then + if (maxWeaponDef.tracks) then + aoeDefInfo[unitDefID] = {type = "tracking"} + else + aoeDefInfo[unitDefID] = {type = "cruise"} + end + elseif (weaponType == "TorpedoLauncher") then + if (maxWeaponDef.tracks) then + aoeDefInfo[unitDefID] = {type = "tracking"} + else + aoeDefInfo[unitDefID] = {type = "direct", scatter = scatter, range = maxWeaponDef.range} + end + elseif (weaponType == "Flame" ) then + aoeDefInfo[unitDefID] = {type = "noexplode", range = maxWeaponDef.range} + else + aoeDefInfo[unitDefID] = {type = "direct", scatter = scatter, range = maxWeaponDef.range} end + aoeDefInfo[unitDefID].aoe = aoe + aoeDefInfo[unitDefID].cost = cost + aoeDefInfo[unitDefID].mobile = mobile + aoeDefInfo[unitDefID].waterWeapon = waterWeapon + aoeDefInfo[unitDefID].ee = ee end local function SetupDisplayLists() @@ -279,20 +261,19 @@ end local function UpdateSelection() local sel = GetSelectedUnitsSorted() - + local maxCost = 0 dgunUnitDefID = nil aoeUnitDefID = nil dgunUnitID = nil aoeUnitID = nil + hasSelection = false for unitDefID, unitIDs in pairs(sel) do - if unitDefID == "n" then - break - end if (dgunInfo[unitDefID]) then dgunUnitDefID = unitDefID dgunUnitID = unitIDs[1] + hasSelection = true end if (aoeDefInfo[unitDefID]) then @@ -301,13 +282,10 @@ local function UpdateSelection() maxCost = currCost aoeUnitDefID = unitDefID aoeUnitID = GetRepUnitID(unitIDs) + hasSelection = true end end - extraDrawRange = UnitDefs[unitDefID] and UnitDefs[unitDefID].customParams and UnitDefs[unitDefID].customParams.extradrawrange - if extraDrawRange then - selUnitID = GetRepUnitID(unitIDs) - end - end + end end -------------------------------------------------------------------------------- @@ -366,9 +344,10 @@ end --ballistics -------------------------------------------------------------------------------- -local function GetBallisticVector(v, mg, dx, dy, dz, trajectory, range) +local function GetBallisticVector(v, dx, dy, dz, trajectory, range) local dr_sq = dx*dx + dz*dz local dr = sqrt(dr_sq) + if (dr > range) then return nil end local d_sq = dr_sq + dy*dy @@ -377,10 +356,10 @@ local function GetBallisticVector(v, mg, dx, dy, dz, trajectory, range) return 0, v * trajectory, 0 end - local root1 = v*v*v*v - 2*v*v*mg*dy - mg*mg*dr_sq + local root1 = v*v*v*v - 2*v*v*g*dy - g*g*dr_sq if (root1 < 0) then return nil end - local root2 = 2*dr_sq*d_sq*(v*v - mg*dy - trajectory*sqrt(root1)) + local root2 = 2*dr_sq*d_sq*(v*v - g*dy - trajectory*sqrt(root1)) if (root2 < 0) then return nil end @@ -389,7 +368,7 @@ local function GetBallisticVector(v, mg, dx, dy, dz, trajectory, range) if (r == 0 or vr == 0) then vy = v - else vy = vr*dy/dr + dr*mg/(2*vr) + else vy = vr*dy/dr + dr*g/(2*vr) end local bx = dx*vr/dr @@ -430,16 +409,14 @@ end --v: weaponvelocity --trajectory: +1 for high, -1 for low -local function DrawBallisticScatter(scatter, v, mygravity ,fx, fy, fz, tx, ty, tz, trajectory, range) +local function DrawBallisticScatter(scatter, v, fx, fy, fz, tx, ty, tz, trajectory, range) if (scatter == 0) then return end local dx = tx - fx local dy = ty - fy local dz = tz - fz if (dx == 0 and dz == 0) then return end - - local mg = mygravity or g - - local bx, by, bz = GetBallisticVector(v, mg, dx, dy, dz, trajectory, range) + + local bx, by, bz = GetBallisticVector(v, dx, dy, dz, trajectory, range) --don't draw anything if out of range if (not bx) then return end @@ -483,14 +460,14 @@ local function DrawBallisticScatter(scatter, v, mygravity ,fx, fy, fz, tx, ty, t end glLineWidth(scatterLineWidthMult / mouseDistance) - -- FIXME ATIBUG glPointSize(pointSizeMult / mouseDistance) + glPointSize(pointSizeMult / mouseDistance) glColor(scatterColor) glDepthTest(false) glBeginEnd(GL_LINES, VertexList, bars) glBeginEnd(GL_POINTS, VertexList, vertices) glDepthTest(true) glColor(1,1,1,1) - -- FIXME ATIBUG glPointSize(1) + glPointSize(1) glLineWidth(1) end @@ -592,6 +569,14 @@ end --callins -------------------------------------------------------------------------------- +function widget:MousePress() + UpdateSelection() +end + +function widget:KeyPress() + UpdateSelection() +end + function widget:Initialize() for unitDefID, unitDef in pairs(UnitDefs) do SetupUnitDef(unitDefID, unitDef) @@ -603,51 +588,59 @@ function widget:Shutdown() DeleteDisplayLists() end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawWorld() - if (not hasSelectionCallin) then + if chobbyInterface then return end + + if not hasSelection then return end + local _, cmd, _ = GetActiveCommand() + + if (cmd == CMD_DGUN and dgunUnitDefID) then + mouseDistance = GetMouseDistance() or 1000 + local tx, ty, tz = GetMouseTargetPosition() + if (not tx) then return end + local info = dgunInfo[dgunUnitDefID] + local fx, fy, fz = GetUnitPosition(dgunUnitID) + if (not fx) then return end + local angle = math.atan2(fx-tx,fz-tz) + (math.pi/2.1) + local offset_x = (sin(angle)*13) + local offset_z = (cos(angle)*13) + local dx = fx + offset_x + local dz = fz + offset_z + DrawNoExplode(info.aoe, dx, fy, dz, tx, ty, tz, info.range) + glColor(1, 0, 0, 0.75) + glLineWidth(1) + glDrawGroundCircle(fx, fy, fz, info.range, circleDivs) + glColor(1,1,1,1) + return + end + + if (cmd ~= CMD_ATTACK or not aoeUnitDefID) then UpdateSelection() + return end mouseDistance = GetMouseDistance() or 1000 - local tx, ty, tz = GetMouseTargetPosition() if (not tx) then return end - local _, cmd, _ = GetActiveCommand() - local info, unitID - - if extraDrawRange and selUnitID and cmd == CMD_ATTACK then - local fx, fy, fz = GetUnitPosition(selUnitID) - if fx then - glColor(1, 0.35, 0.35, 0.75) - glLineWidth(1) - glDrawGroundCircle(fx, fy, fz, extraDrawRange, 50) - glColor(1,1,1,1) - end - end - if (cmd == CMD_ATTACK and aoeUnitDefID) then - info = aoeDefInfo[aoeUnitDefID] - unitID = aoeUnitID - elseif (cmd == CMD_MANUALFIRE and dgunUnitDefID) then - info = dgunInfo[dgunUnitDefID] - unitID = dgunUnitID - else - return - end - - local fx, fy, fz = GetUnitPosition(unitID) + local info = aoeDefInfo[aoeUnitDefID] + local fx, fy, fz = GetUnitPosition(aoeUnitID) if (not fx) then return end - if (not info.mobile) then fy = fy + GetUnitRadius(unitID) end + if (not info.mobile) then fy = fy + GetUnitRadius(aoeUnitID) end if (not info.waterWeapon) then ty = max(0, ty) end local weaponType = info.type - if (weaponType == "noexplode") then - DrawNoExplode(info.aoe, fx, fy, fz, tx, ty, tz, info.range) - elseif (weaponType == "ballistic") then - local states = GetUnitStates(unitID) + if (weaponType == "ballistic") then + local states = GetUnitStates(aoeUnitID) local trajectory if (states.trajectory) then trajectory = 1 @@ -655,12 +648,14 @@ function widget:DrawWorld() trajectory = -1 end DrawAoE(tx, ty, tz, info.aoe, info.ee) - DrawBallisticScatter(info.scatter, info.v, info.mygravity, fx, fy, fz, tx, ty, tz, trajectory, info.range) + DrawBallisticScatter(info.scatter, info.v, fx, fy, fz, tx, ty, tz, trajectory, info.range) + elseif (weaponType == "noexplode") then + DrawNoExplode(info.aoe, fx, fy, fz, tx, ty, tz, info.range) elseif (weaponType == "tracking") then DrawAoE(tx, ty, tz, info.aoe, info.ee) elseif (weaponType == "direct") then DrawAoE(tx, ty, tz, info.aoe, info.ee) - DrawDirectScatter(info.scatter, fx, fy, fz, tx, ty, tz, info.range, GetUnitRadius(unitID)) + DrawDirectScatter(info.scatter, fx, fy, fz, tx, ty, tz, info.range, GetUnitRadius(aoeUnitID)) elseif (weaponType == "dropped") then DrawDroppedScatter(info.aoe, info.ee, info.scatter, info.v, fx, info.h, fz, tx, ty, tz, info.salvoSize, info.salvoDelay) elseif (weaponType == "wobble") then @@ -669,27 +664,24 @@ function widget:DrawWorld() elseif (weaponType == "orbital") then DrawAoE(tx, ty, tz, info.aoe, info.ee) DrawOrbitalScatter(info.scatter, tx, ty, tz) - elseif (weaponType == "dontdraw") then - -- don't draw anything foo else DrawAoE(tx, ty, tz, info.aoe, info.ee) end - - if (cmd == CMD_MANUALFIRE) then - glColor(1, 0, 0, 0.75) - glLineWidth(1) - glDrawGroundCircle(fx, fy, fz, info.range, circleDivs) - glColor(1,1,1,1) - end - end function widget:SelectionChanged(sel) - hasSelectionCallin = true - UpdateSelection() + selectionChanged = true end +local selChangedSec = 0 function widget:Update(dt) secondPart = secondPart + dt secondPart = secondPart - floor(secondPart) -end \ No newline at end of file + + selChangedSec = selChangedSec + dt + if selectionChanged and selChangedSec>0.15 then + selChangedSec = 0 + selectionChanged = nil + UpdateSelection() + end +end diff --git a/LuaUI/Widgets_Evo/gui_build_eta.lua b/LuaUI/Widgets_Evo/gui_build_eta.lua index d1ee30b62..e6b58e5fa 100644 --- a/LuaUI/Widgets_Evo/gui_build_eta.lua +++ b/LuaUI/Widgets_Evo/gui_build_eta.lua @@ -5,7 +5,9 @@ -- brief: display estimated time of arrival for builds -- author: Dave Rodgers -- --- Copyright (C) 2007. +-- >> modified by: jK << +-- +-- Copyright (C) 2007,2008. -- Licensed under the terms of the GNU GPL, v2 or later. -- -------------------------------------------------------------------------------- @@ -15,10 +17,10 @@ function widget:GetInfo() return { name = "BuildETA", desc = "Displays estimated time of arrival for builds", - author = "trepan", - date = "Feb 04, 2007", + author = "trepan (modified by jK)", + date = "Feb, 2008", license = "GNU GPL, v2 or later", - layer = -1, + layer = -9, enabled = true -- loaded by default? } end @@ -26,18 +28,31 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -local gl = gl -- use a local copy for faster access +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) -local etaTable = {} +local gl = gl -- use a local copy for faster access +local Spring = Spring +local table = table +local etaTable = {} +local etaMaxDist= 10000000 -- max dist at which to draw ETA +--------------------------- -------------------------------------------------------------------------------- local vsx, vsy = widgetHandler:GetViewSizes() -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local fontScale = widgetScale/2 + font = gl.LoadFont(fontfile, 52*fontScale, 17*fontScale, 1.5) end @@ -57,7 +72,7 @@ local function MakeETA(unitID,unitDefID) lastProg = buildProgress, rate = nil, timeLeft = nil, - yoffset = ud.height + 14 --dims.height - (dims.midy - dims.miny) + 5 + yoffset = ud.height+14 } end @@ -65,12 +80,6 @@ end -------------------------------------------------------------------------------- function widget:Initialize() - if (UnitDefs[1].height == nil) then - for udid, ud in ipairs(UnitDefs) do - ud.height = Spring.GetUnitDefDimensions(udid).radius - end - end - local myUnits = Spring.GetTeamUnits(Spring.GetMyTeamID()) for _,unitID in ipairs(myUnits) do local _,_,_,_,buildProgress = Spring.GetUnitHealth(unitID) @@ -86,6 +95,7 @@ end local lastGameUpdate = Spring.GetGameSeconds() function widget:Update(dt) + if chobbyInterface then return end local userSpeed,_,pause = Spring.GetGameSpeed() if (pause) then @@ -99,10 +109,12 @@ function widget:Update(dt) lastGameUpdate = gs local killTable = {} + local count = 0 for unitID,bi in pairs(etaTable) do local _,_,_,_,buildProgress = Spring.GetUnitHealth(unitID) if ((not buildProgress) or (buildProgress >= 1.0)) then - table.insert(killTable, unitID) + count = count + 1 + killTable[count] = unitID else local dp = buildProgress - bi.lastProg local dt = gs - bi.lastTime @@ -149,7 +161,7 @@ function widget:Update(dt) end end end - for _,unitID in ipairs(killTable) do + for _,unitID in pairs(killTable) do etaTable[unitID] = nil end end @@ -158,7 +170,8 @@ end -------------------------------------------------------------------------------- function widget:UnitCreated(unitID, unitDefID, unitTeam) - if (unitTeam == Spring.GetMyTeamID()) then + local spect,spectFull = Spring.GetSpectatingState() + if Spring.AreTeamsAllied(unitTeam,Spring.GetMyTeamID()) or (spect and spectFull) then etaTable[unitID] = MakeETA(unitID,unitDefID) end end @@ -178,40 +191,66 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) etaTable[unitID] = nil end - +function widget:Shutdown() + gl.DeleteFont(font) +end -------------------------------------------------------------------------------- -function widget:DrawWorld() -if not Spring.IsGUIHidden() then - gl.DepthTest(true) - - gl.Color(1, 1, 1) - --fontHandler.UseDefaultFont() - - for unitID, bi in pairs(etaTable) do - gl.DrawFuncAtUnit(unitID, true, function(timeLeft,yoffset) - local etaStr - if (timeLeft == nil) then - etaStr = '\255\1\1\255???' - else - if (timeLeft > 0) then - etaStr = string.format('\255\1\255\1%.1f', timeLeft) - else - etaStr = string.format('\255\255\1\1%.1f', -timeLeft) - end - end - etaStr = "\255\255\255\1ETA\255\255\255\255:" .. etaStr - - gl.Translate(0, yoffset,0) - gl.Billboard() - gl.Translate(0, 5 ,0) - --fontHandler.DrawCentered(etaStr) - gl.Text(etaStr, 0, 0, 8, "c") - end, bi.timeLeft,bi.yoffset) +local function DrawEtaText(timeLeft,yoffset) + local etaStr + if (timeLeft == nil) then + etaStr = '\255\255\255\1ETA\255\255\255\255:\255\1\1\255???' + else + if (timeLeft > 60) then + etaStr = "\255\255\255\1ETA\255\255\255\255:" .. string.format('\255\1\255\1%d', timeLeft / 60) .. "m, " .. string.format('\255\1\255\1%.1f', timeLeft % 60) .. "s" + elseif (timeLeft > 0) then + etaStr = "\255\255\255\1ETA\255\255\255\255:" .. string.format('\255\1\255\1%.1f', timeLeft) .. "s" + else + etaStr = "\255\255\255\1ETA\255\255\255\255:" .. string.format('\255\255\1\1%.1f', -timeLeft) .. "s" + end end - gl.DepthTest(false) + gl.Translate(0, yoffset,10) + gl.Billboard() + gl.Translate(0, 5 ,0) + --fontHandler.DrawCentered(etaStr) + font:Begin() + font:Print(etaStr, 0, 0, 5.75, "co") + font:End() end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if Spring.IsGUIHidden() == false then + gl.DepthTest(true) + + gl.Color(1, 1, 1,0.1) + --fontHandler.UseDefaultFont() + local cx, cy, cz = Spring.GetCameraPosition() + for unitID, bi in pairs(etaTable) do + local ux,uy,uz = Spring.GetUnitViewPosition(unitID) + if ux~=nil then + local dx, dy, dz = ux-cx, uy-cy, uz-cz + local dist = dx*dx + dy*dy + dz*dz + if dist < etaMaxDist then + local unitName = UnitDefs[Spring.GetUnitDefID(unitID)].name + if unitName == "armomex" or unitName == "coromoex" then + bi.yoffset = 25 + end + gl.DrawFuncAtUnit(unitID, false, DrawEtaText, bi.timeLeft,bi.yoffset) + end + end + end + + gl.Color(1, 1, 1,1) + gl.DepthTest(false) + end end diff --git a/LuaUI/Widgets_Evo/gui_chili_buildordermenu.lua b/LuaUI/Widgets_Evo/gui_chili_buildordermenu.lua new file mode 100644 index 000000000..859c1d104 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_chili_buildordermenu.lua @@ -0,0 +1,767 @@ +function widget:GetInfo() + return { + version = "0.1", + name = "chiliBuildOrderMenu", + desc = "Build/Order menu implemented with chili ui", + author = "Adrianulima", + date = "WIP", + license = "GNU GPL, v2 or later", + layer = 1, + enabled = true, --false, + handler = true, + } +end + +local vsx,vsy = Spring.GetViewGeometry() +local widgetScale = (0.5 + (vsx*vsy / 5700000)) + +-------------------------------------------------------------------------------- +-- Hotkeys +VFS.Include("luaui/configs/evo_buildHotkeysConfig.lua") +local sGetKeySymbol = Spring.GetKeySymbol +local function getKeySymbol(k) + if k >= 97 and k <= 122 then return string.char(k):upper() end + -- basically unused + local keySymbol = sGetKeySymbol(k) + return keySymbol:sub(1, 1):upper() .. keySymbol:sub(2) +end +local nameToKeySymbols = {} +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + local trimmedName = ud.name + if trimmedName:find("_up", -5) then trimmedName = trimmedName:sub(1, -5) end + if nameToKeyCode[trimmedName] then + -- local str = "" + -- local leng = #nameToKeyCode[name] + -- for i = 1, leng do + -- str = str .. getKeySymbol(nameToKeyCode[name][i]) + -- if i < leng then str = str .. " + " end + -- end + -- nameToKeySymbols[name] = str + nameToKeySymbols[ud.name] = {} + for i = 1, #nameToKeyCode[trimmedName] do + nameToKeySymbols[ud.name][i] = getKeySymbol(nameToKeyCode[trimmedName][i]) + end + end +end +local hotkeyLabels = {} +-------------------------------------------------------------------------------- +-- Localize +local sForceLayoutUpdate = Spring.ForceLayoutUpdate +local sSetActiveCommand = Spring.SetActiveCommand +local sGetCmdDescIndex = Spring.GetCmdDescIndex +local sGetActiveCommand = Spring.GetActiveCommand +local sGetWindowGeometry = Spring.GetWindowGeometry + +local stringfind = string.find +local stringsub = string.sub +local stringgsub = string.gsub +local mathceil = math.ceil +local mathmax = math.max +local mathmin = math.min + +local glGetTextWidth = gl.GetTextWidth + +-- Chili classes +local Chili, Window, Image, Button, Grid, Label, ScrollPanel, color2incolor + +-- Global vars +local orderWindow, buildWindow, orderGrid, buildGrid, updateRequired, tooltip, btWidth +local chiliCache = {} +local vsx, vsy = sGetWindowGeometry() + +local sGetConfigInt = Spring.GetConfigInt +local buildOrderUI = sGetConfigInt("evo_buildorderui", 2) +local showCost = sGetConfigInt("evo_showcost", 1) == 1 +local showTechReq = sGetConfigInt("evo_showtechreq", 1) == 1 +local showHotkeys = sGetConfigInt("evo_showhotkeys", 1) == 1 +WG.buildOrderUI = {updateConfigInt = false} + +local fontSize = 12 * widgetScale + + +--Horizontal +if buildOrderUI == 0 or buildOrderUI == nil then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 13, columns = 2, + x = '0%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 3, columns = 10, + x = '21.2%', y = '57.5%', + width = '60%', height = '20%', + orientation = 'horizontal', + --maxWidth = 420, + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +--Compact Horizontal +if buildOrderUI == 1 then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 13, columns = 2, + x = '0%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 3, columns = 10, + x = '32%', y = '66%', + width = '40%', height = '15%', + orientation = 'horizontal', + --maxWidth = 420, + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +--Traditional +if buildOrderUI == 2 then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 6, columns = 4, + x = '0%', y = '24%', + width = '50%', height = '25%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 5, columns = 5, + x = '0%', y = '50%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +--Traditional (SxS) +if buildOrderUI == 3 then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 13, columns = 2, + x = '0%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 7, columns = 5, + x = '21%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +--Right Side +if buildOrderUI == 4 then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 13, columns = 2, + x = '0%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 7, columns = 5, + x = '79.75%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +--Right Side Compact +if buildOrderUI == 5 then + Config = { + ordermenu = { + name = 'ordermenu', + rows = 13, columns = 2, + x = '0%', y = '35%', + width = '50%', height = '50%', + orientation = 'horizontal', + maxWidth = 390, + padding = {5, 5, 5, 5}, -- outer panel + }, + buildmenu = { + name = 'buildmenu', + rows = 7, columns = 5, + x = '85%', y = '35%', + width = '15%', height = '30%', + orientation = 'horizontal', + padding = {5, 5, 5, 5}, + }, + labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + }, + hiddenCMDs = { + timewait = true, deathwait = true, squadwait = true, gatherwait = true, + loadonto = true, selfd = false, settargetnoground = true, + }, + } +end + +-------------------------------------------------------------------------------- +-- Helpers +local function deepEquals(t1, t2, ignore_mt) + if t1 == t2 then return true end + local ty1 = type(t1) + local ty2 = type(t2) + if ty1 ~= ty2 then return false end + -- non-table types can be directly compared + if ty1 ~= 'table' and ty2 ~= 'table' then return t1 == t2 end + -- as well as tables which have the metamethod __eq + local mt = getmetatable(t1) + if not ignore_mt and mt and mt.__eq then return t1 == t2 end + for k1,v1 in pairs(t1) do + local v2 = t2[k1] + if v2 == nil or not deepEquals(v1, v2) then return false end + end + for k2,v2 in pairs(t2) do + local v1 = t1[k2] + if v1 == nil or not deepEquals(v1, v2) then return false end + end + return true +end --deepEquals + +local function processRelativeCoord(code, total) + local num = tonumber(code) + if (type(code) == "string") then + local percent = tonumber(code:sub(1,-2)) or 0 + if (percent<0) then + percent = 0 + elseif (percent>100) then + percent = 100 + end + return math.floor(total * percent/100) + elseif (num)and((1/num)<0) then + return math.floor(total + num) + else + return math.floor(num or 0) + end +end --processRelativeCoord + +local function createGridWindow(config) + local scroll = ScrollPanel:New{ + name = 'scroll_' .. config.name, + x = '0%', y = '0%', + width = '100%', height = '100%', + padding = config.padding, + } + local grid = Grid:New{ + name = 'grid_' .. config.name, + x = '0%', y = '0%', + width = '100%', height = '100%', + rows = config.rows, + columns = config.columns, + orientation = config.orientation, + padding = {0, 0, 0, 0}, + } + local gridWindow = Window:New{ + name = 'window_' .. config.name, + parent = Chili.Screen0, + x = config.x, y = config.y, + height = config.height, width = config.width, + maxWidth = config.maxWidth, + children = {grid}, + bringToFrontOnClick = true, dockable = false, draggable = false, + resizable = false, tweakDraggable = true, tweakResizable = false, + padding = config.padding, + } + + local function updateGrid() + local rowsNeeded = mathceil(#grid.children / grid.columns) + if rowsNeeded > grid.rows then + local ratio = (gridWindow.height / config.rows) / (gridWindow.width / config.columns) + grid:SetPos(nil, nil, nil, (grid.width / grid.columns) * ratio * rowsNeeded) + grid.rows = rowsNeeded + if grid.parent and grid.parent.name == gridWindow.name then + gridWindow:RemoveChild(grid) + gridWindow:AddChild(scroll) + scroll:AddChild(grid) + end + elseif rowsNeeded <= config.rows then + grid:SetPos(nil, nil, nil, gridWindow.height - gridWindow.padding[2] - gridWindow.padding[4]) + grid.rows = config.rows + if scroll.parent and scroll.parent.name == gridWindow.name then + scroll:RemoveChild(grid) + gridWindow:RemoveChild(scroll) + gridWindow:AddChild(grid) + end + end + end + + grid.updateGrid = updateGrid + gridWindow:Hide() + return grid, gridWindow +end --createGridWindow + +local function applyHighlightHandler(button, cmd) + local selected = {0.85, 0.65, 0, 0.5} + local hovered = {0.75, 0.75, 0.75, 0.25} + local out = {0, 0, 0, 0} + local disabled = {0, 0, 0, 0.6} + + local highlight = chiliCache['highlight' .. button.cmdID] or Image:New{ + name = 'highlight' .. button.cmdID, + parent = button, + file = 'LuaUI/Images/button-highlight.dds', + width = '100%', height = '100%', + fixedRatio = false, keepAspect = false, + color = out, + } + chiliCache['highlight' .. button.cmdID] = highlight + local function updateSelection(cmdID) + local function checkColor(color) + if highlight.color ~= color then + highlight.color = color + highlight:Invalidate() + end + end + + if cmd.disabled then + checkColor(disabled) + if button.state.hovered then + tooltip = stringgsub(cmd.tooltip, "Metal cost %d*\nEnergy cost %d*\n", "") + end + elseif button.cmdID == cmdID then checkColor(selected) + elseif button.state.hovered then + tooltip = stringgsub(cmd.tooltip, "Metal cost %d*\nEnergy cost %d*\n", "") + checkColor(hovered) + else checkColor(out) + end + end + button.updateSelection = updateSelection + updateSelection() + return button +end --applyHighlightHandler + +local function applyStateHandler(button, cmd) + local stateCount = #cmd.params - 1 + local state = cmd.params[1] + 1 + + local function curve(c) return -0.5 * c * (c - 4) end -- makes yellow more vivid + local function getStateColor(i) + local g = (i - 1) / (stateCount - 1) + return (i == state) and {curve(1 - g), curve(g), 0, 1} or {0.9, 0.9, 0.9, 0.3} + end + + local stateButtons = {} + for i = 1, stateCount do + local pad = 7 + local sx = (100 - pad * (stateCount + 3)) / stateCount + local px = pad + i * pad + (i - 1) * sx + stateButtons[i] = chiliCache['stateButton_' .. cmd.id .. '_' .. i] or Image:New{ + name = 'stateButton_' .. cmd.id .. '_' .. i, + parent = button, + file = 'LuaUI/Images/button-highlight.dds', + x = px .. '%', y = '75%', + width = sx .. '%', maxHeight = 6, + keepAspect = false, + color = getStateColor(i), + } + chiliCache['stateButton_' .. cmd.id .. '_' .. i] = stateButtons[i] + end + local oldUpdateSelection = button.updateSelection + local function updateSelection(cmdID) + oldUpdateSelection(cmdID) + for i = 1, stateCount do stateButtons[i].color = getStateColor(i) end + end + button.updateSelection = updateSelection + return button +end --applyStateHandler +-------------------------------------------------------------------------------- +local function InitializeControls() + orderGrid, orderWindow = createGridWindow(Config.ordermenu) + buildGrid, buildWindow = createGridWindow(Config.buildmenu) +end --InitializeControls + +local function ActionCommand(self, x, y, mouse, mods) + local index = sGetCmdDescIndex(self.cmdID) + if index then + local left, right = mouse == 1, mouse == 3 + local alt, ctrl, meta, shift = mods.alt, mods.ctrl, mods.meta, mods.shift + sSetActiveCommand(index, mouse, left, right, alt, ctrl, meta, shift) + end +end --ActionCommand + +local function addOrderCommand(cmd) + local button = chiliCache['button' .. cmd.id] or Button:New{ + name = 'button' .. cmd.id, + --parent = orderGrid, + cmdID = cmd.id, + caption = cmd.name, + textPadding = 9, --8, (MaDDoX) + padding = {0, 0, 0, 0}, + margin = {2, 2, 2, 2}, + OnClick = {function() end}, + OnMouseDown = {ActionCommand} + } + if cmd.name == "Repair" then button:SetCaption("Build") + else button:SetCaption(cmd.name) end + chiliCache['button' .. cmd.id] = button + local s = (btWidth - button.textPadding * 2) / glGetTextWidth(button.caption) + button.font:SetSize(mathmin(s, Config.labels.captionFontMaxSize)) + applyHighlightHandler(button, cmd) + orderGrid:AddChild(button) +end --addOrderCommand + +local function addStateCommand(cmd) + local button = chiliCache['button' .. cmd.id] or Button:New{ + name = 'button' .. cmd.id, + cmdID = cmd.id, + caption = cmd.params[cmd.params[1] + 2], + textPadding = 12, --8, + padding = {0, 0, 0, 0}, + margin = {2, 2, 2, 2}, + OnClick = {function() end}, + OnMouseDown = {ActionCommand} + } + button:SetCaption(cmd.params[cmd.params[1] + 2]) + chiliCache['button' .. cmd.id] = button + local s = (btWidth - button.textPadding * 2) / glGetTextWidth(button.caption) + button.font:SetSize(mathmin(s, Config.labels.captionFontMaxSize)) + applyHighlightHandler(button, cmd) + applyStateHandler(button, cmd) + orderGrid:AddChild(button) +end --addStateCommand + +local function addBuildCommand(cmd) + local image = chiliCache['button' .. cmd.id] or Image:New{ + name = 'button' .. cmd.id, + cmdID = cmd.id, + width = '100%', height = '100%', + file = '#' .. cmd.id * -1, + padding = {0, 0, 0, 0}, + margin = {2, 2, 2, 2}, + OnClick = {function() end}, + OnMouseDown = {ActionCommand} + } + chiliCache['button' .. cmd.id] = image + + if cmd.params[1] then + if (not chiliCache['queueLabel' .. cmd.id]) then + chiliCache['queueLabel' .. cmd.id] = Label:New{ + name = 'queueLabel' .. cmd.id, + parent = image, + right = '5%', y = '5%', + align = 'right', + valign = 'top', + --caption = tostring(cmd.params[1] or ''), + font = { + size = Config.labels.queueFontSize, + outline = true, shadow = true, + outlineWidth = 4, outlineWeight = 4, + }, + } + end + end + if chiliCache['queueLabel' .. cmd.id] then + chiliCache['queueLabel' .. cmd.id]:SetCaption(tostring(cmd.params[1] or '')) + end + + local str = '' + if showCost then + local s, e = 0, 0 + local comma = color2incolor(1,1,1) .. ',' + s, e = stringfind(cmd.tooltip, 'Uses %+%d* Supply') + if s then str = str .. color2incolor(1,0.5,0) .. stringsub(cmd.tooltip, s + 6, e - 7) .. comma end + s, e = stringfind(cmd.tooltip, 'Energy cost %d*') + str = str .. color2incolor(1,1,0) .. stringsub(cmd.tooltip, s + 12, e) .. comma + s, e = stringfind(cmd.tooltip, 'Metal cost %d*') + str = str .. color2incolor(0.53,0.77,0.89) .. stringsub(cmd.tooltip, s + 11, e) .. comma + end + local techReqColors = {color2incolor(1,0.5,0), color2incolor(0,0.8,1), color2incolor(1,0,1), color2incolor(0,1,0)} + if showTechReq and cmd.disabled then + if stringfind(cmd.tooltip, 'Requires') and not stringfind(cmd.tooltip, 'Provides') then + local s, e = stringfind(cmd.tooltip, 'tech%d*') + if s then + local techLevel = stringsub(cmd.tooltip, s + 4, e) + str = techReqColors[tonumber(techLevel) + 1] .. "T" .. techLevel .. '\n' .. str + end + end + end + if str ~= '' then + if (not chiliCache['costLabel' .. cmd.id]) then + chiliCache['costLabel' .. cmd.id] = Label:New{ + name = 'costLabel' .. cmd.id, + parent = image, + x = '5%', bottom = '5%', + valign = 'bottom', + --caption = metalCost .. line .. energyCost, + font = { + size = Config.labels.costFontSize, + outline = true, shadow = true, + outlineWidth = 4, outlineWeight = 4, + }, + } + end + chiliCache['costLabel' .. cmd.id]:SetCaption(str:sub(1, -2)) + elseif chiliCache['costLabel' .. cmd.id] then + chiliCache['costLabel' .. cmd.id]:SetCaption(str) + end + + if showHotkeys and widgetHandler.orderList["EvoRTS Build Hotkeys"] and widgetHandler.orderList["EvoRTS Build Hotkeys"] ~= 0 then + if nameToKeySymbols[cmd.name] then + if not chiliCache['hotkeyLabel' .. cmd.id] then + chiliCache['hotkeyLabel' .. cmd.id] = Label:New{ + name = 'hotkeyLabel' .. cmd.id, + parent = image, + x = '5%', y = '5%', + valign = 'top', + --caption = metalCost .. line .. energyCost, + font = { + size = Config.labels.costFontSize, + outline = true, shadow = true, + outlineWidth = 4, outlineWeight = 4, + }, + } + end + -- chiliCache['hotkeyLabel' .. cmd.id]:SetCaption(color2incolor(1,1,1) .. nameToKeySymbols[cmd.name]) + local function updateLabel() + local str = color2incolor(1,1,1) + local leng = #nameToKeySymbols[cmd.name] + local getLengKeysPressed = WG.buildHotkeys and #WG.buildHotkeys.keysPressed or 0 + local matching = true + for i = 1, leng do + if i <= getLengKeysPressed and matching then + if nameToKeySymbols[cmd.name][i] == WG.buildHotkeys.keysPressed[i] then str = str .. color2incolor(0,1,0) + else matching = false end + end + str = str .. nameToKeySymbols[cmd.name][i] + if i < leng then str = str .. color2incolor(1,1,1) .. ' + ' end + end + chiliCache['hotkeyLabel' .. cmd.id]:SetCaption(str) + end + chiliCache['hotkeyLabel' .. cmd.id].updateLabel = updateLabel + updateLabel() + hotkeyLabels[cmd.id] = chiliCache['hotkeyLabel' .. cmd.id] + end + elseif chiliCache['hotkeyLabel' .. cmd.id] then + chiliCache['hotkeyLabel' .. cmd.id].updateLabel = nil + chiliCache['hotkeyLabel' .. cmd.id]:SetCaption('') + end + + applyHighlightHandler(image, cmd) + buildGrid:AddChild(image) + end --addBuildCommand + +local function processCommand(cmd) + if UnitDefNames[cmd.name] then return 3 + elseif #cmd.params > 1 then return 1 + else return 2 end +end --processCommand + +local lastCommands +local function processAllCommands(flush) + if (deepEquals(lastCommands, widgetHandler.commands)) and not flush then + return + end + lastCommands = widgetHandler.commands + + buildGrid:ClearChildren() + orderGrid:ClearChildren() + --chiliCache = {} -- clears all cached chili elements + + local haveCmd = 0 + local commands = { [1] = {}, [2] = {}, [3] = {} } + for _,cmd in ipairs(lastCommands) do + if cmd.name ~= '' and not (Config.hiddenCMDs[cmd.name] or Config.hiddenCMDs[cmd.action]) then + local grid = processCommand(cmd) + haveCmd = mathmax(haveCmd, grid) + commands[grid][#commands[grid]+1] = cmd + end + end + + local gridFunc = { [1] = addStateCommand, [2] = addOrderCommand, [3] = addBuildCommand } + for grid,cmds in ipairs(commands) do + for i = 1, #cmds do gridFunc[grid](cmds[i]) end + end + + orderGrid.updateGrid() + buildGrid.updateGrid() + + if haveCmd > 0 and orderWindow.hidden then orderWindow:Show() + elseif haveCmd == 0 and orderWindow.visible then orderWindow:Hide() end + if haveCmd > 2 and buildWindow.hidden then buildWindow:Show() + elseif haveCmd <= 2 and buildWindow.visible then buildWindow:Hide() end +end --processAllCommands + +local function updateSelection() + tooltip = nil + local _,cmdID = sGetActiveCommand() + for _, bt in ipairs(buildGrid.children) do + if bt.updateSelection then bt.updateSelection(cmdID) end + end + for _, bt in ipairs(orderGrid.children) do + if bt.updateSelection then bt.updateSelection(cmdID) end + end +end --updateSelection +local function updateLabel() + for _, label in pairs(hotkeyLabels) do + if label.updateLabel then label.updateLabel() end + end +end --updateLabel + +local function OverrideDefaultMenu() + local function layoutHandler(xIcons, yIcons, cmdCount, commands) + widgetHandler.commands = commands + widgetHandler.commands.n = cmdCount + widgetHandler:CommandsChanged() + local customCmds = widgetHandler.customCommands + return '', xIcons, yIcons, {}, customCmds, {}, {}, {}, {}, {}, {[1337]=9001} + end + widgetHandler:ConfigLayoutHandler(layoutHandler) + sForceLayoutUpdate() +end --OverrideDefaultMenu +-------------------------------------------------------------------------------- +function widget:Initialize() + if not WG.Chili then + widgetHandler:RemoveWidget() + return + end + OverrideDefaultMenu() + + Chili = WG.Chili + Window = Chili.Window + Grid = Chili.Grid + Image = Chili.Image + Button = Chili.Button + Label = Chili.Label + ScrollPanel = Chili.ScrollPanel + color2incolor = Chili.color2incolor + + btWidth = processRelativeCoord(Config.ordermenu.width, vsx/Config.ordermenu.columns) + + InitializeControls() +end --Initialize + +function widget:CommandsChanged() + updateRequired = true +end --CommandsChanged + +function widget:Update() + if WG['topbar'] and WG['topbar'].showingQuit() then + return + end + if updateRequired then + processAllCommands() + updateRequired = false + end + updateSelection() + + if WG.buildHotkeys and WG.buildHotkeys.hasUpdated then + updateLabel() + WG.buildHotkeys.hasUpdated = false + end + if WG.buildOrderUI and WG.buildOrderUI.updateConfigInt then + WG.buildOrderUI.updateConfigInt = false + showCost = sGetConfigInt("evo_showcost", 1) == 1 + showTechReq = sGetConfigInt("evo_showtechreq", 1) == 1 + showHotkeys = sGetConfigInt("evo_showhotkeys", 1) == 1 + processAllCommands(true) + end +end --Update + +function widget:WorldTooltip(ttType,data1,data2,data3) + return tooltip +end --WorldTooltip + +function widget:ViewResize(newX,newY) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + if Config then + Config.labels = { + captionFontMaxSize = fontSize, + queueFontSize = fontSize, --32 (MaDDoX) + costFontSize = fontSize, + } + end + -- TODO: implement config for this resize and make a reusable helper function to handle it + Config.buildmenu.height = buildWindow.width * (Config.buildmenu.rows / Config.buildmenu.columns) + buildWindow:SetPos(nil, nil, nil,Config.buildmenu.height) +end --ViewResize + +function widget:Shutdown() + orderWindow:Dispose() + buildWindow:Dispose() + widgetHandler:ConfigLayoutHandler(nil) + chiliCache = nil + sForceLayoutUpdate() +end --Shutdown diff --git a/LuaUI/Widgets_Evo/gui_chili_chat2_1.lua b/LuaUI/Widgets_Evo/gui_chili_chat2_1.lua deleted file mode 100644 index 73959449e..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_chat2_1.lua +++ /dev/null @@ -1,974 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- TODO : extract code that can be shared between widgets (parsing) and maybe move it to cawidget and add new callin --- TODO (maybe) : extract code that can be shared between similar chat widgets (message formatting, hidden+highlight detection) so only chili/ScrollPanel+TextBoxen stuff remain in there --- TODO : test replay message formats (and change pattern matcher/parseCommand() to remove duplication in message definitions) --- TODO : check that private (whisper) messages work as expected --- TODO FIXME : reformat all messages when simpleColors is toggled or when colors are changed --- TODO FIXME : when some messages are hidden... make sure we dont destroy too many stack_console control children --- TODO : add message highlight options (never, only ally, all messages) + highlight format (currently surrounds message with #### in highlight color) --- FIXME : fix (probable) bug while shrinking max_lines option - -function widget:GetInfo() - return { - name = "Chili Chat 2.1", - desc = "v0.909 Alternate Chili Chat Console.", - author = "CarRepairer, Licho, Shaun", - date = "2012-06-12", - license = "GNU GPL, v2 or later", - layer = 50, - experimental = false, - enabled = true, - detailsDefault = 1 - } -end - -include("keysym.h.lua") - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- message rules - widget stuff ---[[ -each message definition can have: - - either 1 format - - either name + output, output containing pairs of { name = '', format = '' } -all the names are used when displaying the options - -format syntax: -- #x : switch to color 'x' where 'x' can be: - - a : ally (option) - - e : everyone (option) - - o : other (option) - - s : spec (option) - - h : highlight (option) - - p : color of the player who sent message (dynamic) -- $var : gets replaced by msg['var'] ; interesting vars: - - playername - - argument for messages, this is only the message part; for labels, this is the caption - - msgtype type of message as identified by parseMessage() - - priority as received by widget:AddConsoleLine() - - text full message, as received by widget:AddConsoleLine() - ---]] -local MESSAGE_RULES = { - player_to_allies = { - name = "Player to allies message", - output = { - { - name = "Only bracket in player's color, message in 'ally' color", - format = '#p<#e$playername#p> #a$argument' - }, - { - name = "Playername in his color, message in 'ally' color", - format = '#p<$playername> #a$argument', - default = true - }, - { - name = "Playername and message in player's color", - format = '#p<$playername> $argument' - }, - } - }, - player_to_player_received = { format = '#p*$playername* $argument' }, - player_to_player_sent = { format = '#p -> *$playername* $argument' }, -- NOTE: #p will be color of destination player! - player_to_specs = { format = '#p<$playername> #s$argument' }, - player_to_everyone = { format = '#p<$playername> #e$argument' }, - - spec_to_specs = { format = '#s[$playername] $argument' }, - spec_to_allies = { format = '#s[$playername] $argument' }, -- TODO is there a reason to differentiate spec_to_specs and spec_to_allies?? - spec_to_everyone = { format = '#s[$playername] #e$argument' }, - - -- shameful copy-paste -- TODO remove this duplication - replay_spec_to_specs = { format = '#s[$playername (replay)] $argument' }, - replay_spec_to_allies = { format = '#s[$playername (replay)] $argument' }, -- TODO is there a reason to differentiate spec_to_specs and spec_to_allies?? - replay_spec_to_everyone = { format = '#s[$playername (replay)] #e$argument' }, - - label = { format = '#p *** $playername added label \'$argument\'' }, - point = { format = '#p *** $playername added point' }, - autohost = { format = '#o> $argument', noplayername = true }, - other = { format = '#o$text' } -- no pattern... will match anything else -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local SOUNDS = { - ally = "sounds/talk.wav", - label = "sounds/talk.wav", - highlight = "LuaUI/Sounds/communism/cash-register-01.wav" -- TODO find a better sound :) -} - -local function PlaySound(id, condition) - if condition ~= nil and not condition then - return - end - local file = SOUNDS[id] - if file then - Spring.PlaySoundFile(file, 1, 'ui') - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local HIGHLIGHT_SURROUND_SEQUENCE = ' #### ' -local DEDUPE_SUFFIX = 'x ' - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local screen0 -local myName -- my console name -local myAllyTeamId - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local MIN_HEIGHT = 150 -local MIN_WIDTH = 300 - -local stack_console -local window_console -local scrollpanel1 -local inputspace -WG.enteringText = false -WG.chat = WG.chat or {} - --- redefined in Initialize() -local function showConsole() end -local function hideConsole() end -WG.chat.hideConsole = hideConsole -WG.chat.showConsole = showConsole - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local incolor_dup -local incolor_highlight -local incolors = {} -- incolors indexed by playername + special #a/#e/#o/#s/#h colors based on config - -local messages = {} -- message buffer -local highlightPattern -- currently based on player name -- TODO add configurable list of highlight patterns - -local visible = false -local firstEnter = true --used to activate ally-chat at game start. To run once -local noAlly = false --used to skip the ally-chat above. eg: if 1vs1 skip ally-chat - -local wasSimpleColor = nil -- variable: indicate if simple color was toggled on or off. Used to trigger refresh. - -local time_opened = nil - -local GetTimer = Spring.GetTimer -local DiffTimers = Spring.DiffTimers - ----- - -options_path = "Settings/HUD Panels/Chat/Console" -options_order = { - 'autohide', 'autohide_time', 'mousewheel', 'clickable_points', - 'hideSpec', 'hideAlly', 'hidePoint', 'hideLabel', 'defaultAllyChat', - 'text_height', 'highlighted_text_height', 'max_lines', - 'color_background', 'color_chat', 'color_ally', 'color_other', 'color_spec', - 'dedupe_messages', 'dedupe_points','color_dup', - 'highlight_all_private', 'highlight_filter_allies', 'highlight_filter_enemies', 'highlight_filter_specs', 'highlight_filter_other', - 'highlight_surround', 'highlight_sound', 'color_highlight' -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function onOptionsChanged() - RemakeConsole() -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options = { - text_height = { - name = 'Text Size', - type = 'number', - value = 14, - min = 8, max = 30, step = 1, - OnChange = onOptionsChanged, - }, - highlighted_text_height = { - name = 'Highlighted Text Size', - type = 'number', - value = 16, - min = 8, max = 30, step = 1, - OnChange = onOptionsChanged, - }, - clickable_points = { - name = "Clickable points and labels", - type = 'bool', - value = true, - OnChange = onOptionsChanged, - advanced = true, - }, - - -- TODO work in progress - dedupe_messages = { - name = "Dedupe messages", - type = 'bool', - value = true, - OnChange = onOptionsChanged, - advanced = true, - }, - dedupe_points = { - name = "Dedupe points and labels", - type = 'bool', - value = true, - OnChange = onOptionsChanged, - advanced = true, - }, - highlight_all_private = { - name = "Highlight all private messages", - type = 'bool', - value = true, - advanced = true, - }, - highlight_filter_allies = { - name = "Check allies messages for highlight", - type = 'bool', - value = true, - advanced = true, - }, - highlight_filter_enemies = { - name = "Check enemy messages for highlight", - type = 'bool', - value = true, - advanced = true, - }, - highlight_filter_specs = { - name = "Check spec messages for highlight", - type = 'bool', - value = true, - advanced = true, - }, - highlight_filter_other = { - name = "Check other messages for highlight", - type = 'bool', - value = false, - advanced = true, - }, ---[[ - highlight_filter = { - name = 'Highlight filter', - type = 'list', - OnChange = onOptionsChanged, -- NO NEED - value = 'allies', - items = { - { key = 'disabled', name = "Disabled" }, - { key = 'allies', name = "Highlight only allies messages" }, - { key = 'all', name = "Highlight all messages" }, - }, - advanced = true, - }, ---]] - - highlight_surround = { - name = "Surround highlighted messages", - type = 'bool', - value = true, - OnChange = onOptionsChanged, - advanced = true, - }, - highlight_sound = { - name = "Sound for highlighted messages", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - advanced = true, - }, - hideSpec = { - name = "Hide Spectator Chat", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - advanced = true, - }, - hideAlly = { - name = "Hide Ally Chat", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - advanced = true, - }, - hidePoint = { - name = "Hide Points", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - advanced = true, - }, - hideLabel = { - name = "Hide Labels", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - advanced = true, - }, - max_lines = { - name = 'Maximum Lines (20-300)', - type = 'number', - value = 60, - min = 20, max = 100, step = 1, - OnChange = onOptionsChanged, - }, - - color_chat = { - name = 'Everyone chat text', - type = 'colors', - value = { 1, 1, 1, 1 }, - OnChange = onOptionsChanged, - }, - color_ally = { - name = 'Ally text', - type = 'colors', - value = { 0.2, 1, 0.2, 1 }, - OnChange = onOptionsChanged, - }, - color_other = { - name = 'Other text', - type = 'colors', - value = { 0.6, 0.6, 0.6, 1 }, - OnChange = onOptionsChanged, - }, - color_spec = { - name = 'Spectator text', - type = 'colors', - value = { 0.8, 0.8, 0.8, 1 }, - OnChange = onOptionsChanged, - }, - color_dup = { - name = 'Duplicate message mark', - type = 'colors', - value = { 1, 0.2, 0.2, 1 }, - OnChange = onOptionsChanged, - }, - color_highlight = { - name = 'Highlight mark', - type = 'colors', - value = { 1, 1, 0.2, 1 }, - OnChange = onOptionsChanged, - }, - color_background = { - name = "Background color", - type = "colors", - value = { 0, 0, 0, 0}, - OnChange = function(self) - scrollpanel1.backgroundColor = self.value - scrollpanel1.borderColor = self.value - scrollpanel1:Invalidate() - inputspace.backgroundColor = self.value - inputspace.borderColor = self.value - inputspace:Invalidate() - end, - }, - mousewheel = { - name = "Scroll with mousewheel", - type = 'bool', - value = false, - OnChange = function(self) scrollpanel1.ignoreMouseWheel = not self.value; end, - }, - defaultAllyChat = { - name = "Default ally chat", - desc = "Sets default chat mode to allies at game start", - type = 'bool', - value = true, - }, - autohide = { - name = "Autohide chat", - desc = "Hides the chat when not in use", - type = 'bool', - value = false, - OnChange = onOptionsChanged, - }, - autohide_time = { - name = "Autohide time", - desc = "Time to leave chat visible", - type = 'number', - value = 4, - min = 1, max = 10, step = 1, - OnChange = onOptionsChanged, - }, - -} --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- TODO : should these pattern/escape functions be moved to some shared file/library? - -local function nocase(s) - return string.gsub(s, "%a", function (c) - return string.format("[%s%s]", string.lower(c), string.upper(c)) - end - ) -end - -local function escapePatternMatchChars(s) - return string.gsub(s, "(%W)", "%%%1") -end - -local function caseInsensitivePattern(s) - return nocase(escapePatternMatchChars(s)) -end - --- local widget only -function getMessageRuleOptionName(msgtype, suboption) - return msgtype .. "_" .. suboption -end - -for msgtype,rule in pairs(MESSAGE_RULES) do - if rule.output and rule.name then -- if definition has multiple output formats, make associated config option - local option_name = getMessageRuleOptionName(msgtype, "output_format") - options_order[#options_order + 1] = option_name - local o = { - name = "Format for " .. rule.name, - type = 'list', - OnChange = function (self) - Spring.Echo('Selected: ' .. self.value) - onOptionsChanged() - end, - value = '1', -- may be overriden - items = {}, - advanced = true, - } - - for i, output in ipairs(rule.output) do - o.items[i] = { key = i, name = output.name } - if output.default then - o.value = i - end - end - options[option_name] = o - end -end - -local function getOutputFormat(msgtype) - local rule = MESSAGE_RULES[msgtype] - if not rule then - Spring.Echo("UNKNOWN MESSAGE TYPE: " .. msgtype or "NiL") - return - elseif rule.output then -- rule has multiple user-selectable output formats - local option_name = getMessageRuleOptionName(msgtype, "output_format") - local value = options[option_name].value - return rule.output[value].format - else -- rule has only 1 format defined - return rule.format - end -end - -local function getSource(spec, allyTeamId) - return (spec and 'spec') - or ((Spring.GetMyTeamID() == allyTeamId) and 'ally') - or 'enemy' -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- TODO get rid of bogus color2incolor - http://springrts.com/phpbb/viewtopic.php?f=23&t=28208 --- move to LuaUI/Chili/headers/util.lua or to LuaUI/modfonts.lua? --- also competing with bubbles::GetColorChar() -local function color2textColor(r, g, b, a) - - local function colorComponent(x) - local c = string.char(x * 255) - -- use lookup table to weed out other unwanted output values? - if c == '\0' then - c = '\1' - end - return c - end - - if not r then - return '' -- '\255\255\255\255' - end - - if type(r) == 'table' then - r, g, b, a = unpack(r) - end - - return '\255' .. colorComponent(r) .. colorComponent(g) .. colorComponent(b) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function detectHighlight(msg) - -- must handle case where we are spec and message comes from player - - if msg.msgtype == 'player_to_player_received' and options.highlight_all_private.value then - msg.highlight = true - return - end - --- Spring.Echo("msg.source = " .. (msg.source or 'NiL')) - - if msg.source == 'ally' and not options.highlight_filter_allies.value - or msg.source == 'enemy' and not options.highlight_filter_enemies.value - or msg.source == 'spec' and not options.highlight_filter_specs.value - or msg.source == 'other' and not options.highlight_filter_other.value then - return - end - - if (msg.argument and msg.argument:find(highlightPattern)) then - msg.highlight = true - end -end - -local function formatMessage(msg) - local format = getOutputFormat(msg.msgtype) or getOutputFormat("other") - - local formatted, _ = format:gsub('([#%$]%w+)', function(parameter) -- FIXME pattern too broad for 1-char color specifiers - if parameter:sub(1,1) == '$' then - return msg[parameter:sub(2,parameter:len())] - elseif parameter == '#p' then - if msg.playername and incolors[msg.playername] then - return incolors[msg.playername] - else - return incolors['#o'] -- should not happen... - end - else - return incolors[parameter] - end - end) - msg.formatted = formatted -end - -local function hideMessage(msg) - return (msg.msgtype == "spec_to_everyone" and options.hideSpec.value) -- can only hide spec when playing - or (msg.msgtype == "player_to_allies" and options.hideAlly.value) - or (msg.msgtype == "point" and options.hidePoint.value) - or (msg.msgtype == "label" and options.hideLabel.value) -end - -local function displayMessage(msg, remake) - if hideMessage(msg) or (not WG.Chili) then - return - end - - -- TODO betterify this / make configurable - local highlight_sequence = (msg.highlight and options.highlight_surround.value and (incolor_highlight .. HIGHLIGHT_SURROUND_SEQUENCE) or '') - local text = (msg.dup > 1 and (incolor_dup .. msg.dup .. DEDUPE_SUFFIX) or '') .. highlight_sequence .. msg.formatted .. highlight_sequence - - if (msg.dup > 1 and not remake) then - local last = stack_console.children[#(stack_console.children)] - if last then - last:SetText(text) - -- UpdateClientArea() is not enough - last message keeps disappearing until new message is added - last:Invalidate() - end - else - local textbox = WG.Chili.TextBox:New{ - width = '100%', - align = "left", - fontsize = (msg.highlight and options.highlighted_text_height.value or options.text_height.value), - valign = "ascender", - lineSpacing = 0, - padding = { 0, 0, 0, 0 }, - text = text, - --fontShadow = true, - --[[ - autoHeight=true, - autoObeyLineHeight=true, - --]] - - font = { - outlineWidth = 3, - outlineWeight = 10, - outline = true - } - } - - if msg.point and options.clickable_points.value then - textbox.OnMouseDown = {function(self, x, y, mouse) - local click_on_text = x <= textbox.font:GetTextWidth(self.text); -- use self.text instead of text to include dedupe message prefix - if (mouse == 1 and click_on_text) then - Spring.SetCameraTarget(msg.point.x, msg.point.y, msg.point.z, 1) - end - --[[ testing - CarRep - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() --make epic Chili menu appear. - --]] - - end} - function textbox:HitTest(x, y) -- copied this hack from chili bubbles - return self - end - --[[ testing - CarRep - else - textbox.OnMouseDown = {function(self, x, y, mouse) - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() --make epic Chili menu appear. - - end} - function textbox:HitTest(x, y) -- copied this hack from chili bubbles - return self - end - --]] - end - - stack_console:AddChild(textbox, false) - stack_console:UpdateClientArea() - end - -- open timer (for autohide) - time_opened = GetTimer() -end - - -local function setupColors() - --local textColorizer = WG.Chili.color2incolor - local textColorizer = color2textColor - - incolor_dup = textColorizer(options.color_dup.value) - incolor_highlight = textColorizer(options.color_highlight.value) - incolors['#h'] = incolor_highlight - incolors['#a'] = textColorizer(options.color_ally.value) - incolors['#e'] = textColorizer(options.color_chat.value) - incolors['#o'] = textColorizer(options.color_other.value) - incolors['#s'] = textColorizer(options.color_spec.value) -end - -local function setupPlayers() - --local textColorizer = WG.Chili.color2incolor - local textColorizer = color2textColor - --- local myallyteamid = Spring.GetMyAllyTeamID() - - local playerroster = Spring.GetPlayerList() - - for i, id in ipairs(playerroster) do - local name, _, spec, teamId, allyTeamId = Spring.GetPlayerInfo(id) --- players[name] = { id = id, spec = spec, allyTeamId = allyTeamId } --- Spring.Echo('################## ' .. id .. " name " .. name .. " teamId " .. teamId .. " ally " .. allyTeamId) - incolors[name] = spec and incolors['#s'] or textColorizer(Spring.GetTeamColor(teamId)) - end -end - -local function setupMyself() - myName, _, _, _, myAllyTeamId = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) -- or do it in the loop? - highlightPattern = caseInsensitivePattern(myName) -end - -local function setup() - setupMyself() - setupColors() - setupPlayers() -end - - -function RemakeConsole() - setup() - stack_console:ClearChildren() - for i = 1, #messages do -- FIXME : messages collection changing while iterating (if max_lines option has been shrinked) - local msg = messages[i] - displayMessage(msg, true) - end - -- set initial state for the chat, hide the dock for autohide - if (options.autohide.value) then - hideConsole() - else - showConsole() - end -end - - ------------------------------------------------------------------------ - -function widget:KeyPress(key, modifier, isRepeat) - if (key == KEYSYMS.RETURN) then - -- time chat opened (for autohide) - time_opened = GetTimer() - - if noAlly then - firstEnter = false --skip the default-ally-chat initialization if there's no ally. eg: 1vs1 - end - if firstEnter then - if (not (modifier.Shift or modifier.Ctrl)) and options.defaultAllyChat.value then - Spring.SendCommands("chatally") - end - firstEnter = false - end - WG.enteringText = true - if not visible then - showConsole() - end - else - WG.enteringText = false - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:MapDrawCmd(playerId, cmdType, px, py, pz, caption) --- Spring.Echo("########### MapDrawCmd " .. playerId .. " " .. cmdType .. " coo="..px..","..py..","..pz .. (caption and (" caption " .. caption) or '')) - if (cmdType == 'point') then - widget:AddMapPoint(playerId, px, py, pz, caption) -- caption may be an empty string - -- FIXME return true or false? - end -end - -function widget:AddMapPoint(playerId, px, py, pz, caption) - local playerName, active, spec, teamId, allyTeamId = Spring.GetPlayerInfo(playerId) - - widget:AddConsoleMessage({ - msgtype = ((caption:len() > 0) and 'label' or 'point'), - playername = playerName, - source = getSource(spec, allyTeamId), - text = 'MapDrawCmd ' .. caption, - argument = caption, - priority = 0, -- just in case ... probably useless - point = { x = px, y = py, z = pz } - }) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- new callin! will remain in widget -function widget:AddConsoleMessage(msg) - if ((msg.msgtype == "point" or msg.msgtype == "label") and options.dedupe_points.value or options.dedupe_messages.value) - and #messages > 0 and messages[#messages].text == msg.text then - -- update MapPoint position with most recent, as it is probably more relevant - messages[#messages].point = msg.point - messages[#messages].dup = messages[#messages].dup + 1 - displayMessage(messages[#messages]) - return - end - - msg.dup = 1 - - detectHighlight(msg) - formatMessage(msg) -- does not handle dedupe or highlight - - messages[#messages + 1] = msg - displayMessage(msg) - - if msg.highlight and options.highlight_sound.value then - PlaySound("highlight") - elseif (msg.msgtype == "player_to_allies") then -- FIXME not for sent messages - PlaySound("ally") - elseif msg.msgtype == "label" then - PlaySound("label") - end - - -- TODO differentiate between children and messages (because some messages may be hidden, thus no associated children/TextBox) - while #messages > options.max_lines.value do - stack_console:RemoveChild(stack_console.children[1]) - table.remove(messages, 1) - --stack_console:UpdateLayout() - end - - if playername == myName then - if WG.enteringText then - WG.enteringText = false - hideConsole() - end - end -end - ------------------------------------------------------------------------ - -local timer = 0 - --- FIXME wtf is this obsessive function? -function widget:Update(s) - - if (options.autohide.value) then - local time_now = GetTimer() - if (time_opened) and (DiffTimers(time_now, time_opened) < options.autohide_time.value) then - showConsole() - else - hideConsole() - end - end - - timer = timer + s - if timer > 2 then - timer = 0 - Spring.SendCommands({string.format("inputtextgeo %f %f 0.02 %f", - window_console.x / screen0.width + 0.004, - 1 - (window_console.y + window_console.height) / screen0.height + 0.005, - window_console.width / screen0.width)}) --- CheckColorScheme() - end -end - ------------------------------------------------------------------------ - -function widget:PlayerAdded(playerID) - setup() -end - ------------------------------------------------------------------------ -function widget:LocalColorRegister() - if WG.LocalColor and WG.LocalColor.RegisterListener then - WG.LocalColor.RegisterListener(widget:GetInfo().name, onOptionsChanged) - end -end - -function widget:LocalColorUnregister() - if WG.LocalColor and WG.LocalColor.UnregisterListener then - WG.LocalColor.UnregisterListener(widget:GetInfo().name) - end -end - ------------------------------------------------------------------------ - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget() - return - end - local spectating = Spring.GetSpectatingState() - local myAllyTeamID = Spring.GetMyAllyTeamID() -- get my alliance ID - local teams = Spring.GetTeamList(myAllyTeamID) -- get list of teams in my alliance - if #teams == 1 and (not spectating) then -- if I'm alone and playing (no ally), then no need to set default-ally-chat during gamestart . eg: 1vs1 - noAlly = true - end - - screen0 = WG.Chili.Screen0 - - hideConsole = function() - if visible then - screen0:RemoveChild(window_console) - visible = false - return true - end - return false - end - - -- only used by Crude, and by autohide (to unhide) - showConsole = function() - if not visible then - screen0:AddChild(window_console) - visible = true - end - end - WG.chat.hideConsole = hideConsole - WG.chat.showConsole = showConsole - - Spring.SendCommands("bind Any+enter chat") - - local inputsize = 33 - - local screenWidth, screenHeight = Spring.GetWindowGeometry() - - stack_console = WG.Chili.StackPanel:New{ - margin = { 0, 0, 0, 0 }, - padding = { 0, 0, 0, 0 }, - x = 0, - y = 0, - width = '100%', - height = 10, - resizeItems = false, - itemPadding = { 1, 1, 1, 1 }, - itemMargin = { 1, 1, 1, 1 }, - autosize = true, - preserveChildrenOrder = true, - } - inputspace = WG.Chili.ScrollPanel:New{ - x = 0, - bottom = 0, - right = 5, - height = inputsize, - backgroundColor = options.color_background.value, - borderColor = options.color_background.value, - --backgroundColor = {1,1,1,1}, - } - - scrollpanel1 = WG.Chili.ScrollPanel:New{ - --margin = {5,5,5,5}, - padding = { 5, 5, 5, 5 }, - x = 0, - y = 0, - width = '100%', - bottom = inputsize + 2, -- This line is temporary until chili is fixed so that ReshapeConsole() works both times! -- TODO is it still required?? - verticalSmartScroll = true, --- DISABLED FOR CLICKABLE TextBox disableChildrenHitTest = true, - backgroundColor = options.color_background.value, - borderColor = options.color_background.value, - ignoreMouseWheel = not options.mousewheel.value, - children = { - stack_console, - }, - } - - window_console = WG.Chili.Window:New{ - margin = { 0, 0, 0, 0 }, - padding = { 0, 0, 0, 0 }, - dockable = true, - name = "Chat", - y = 0, - right = 425, -- epic/resbar width - width = screenWidth * 0.30, - height = screenHeight * 0.20, - --parent = screen0, - --visible = false, - --backgroundColor = settings.col_bg, - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - minimizable = true, - selfImplementedMinimizable = - function (show) - if show then - -- update this in case autohide is enabled - time_opened = GetTimer() - showConsole() - else - time_opened = nil - hideConsole() - end - end, - minWidth = MIN_WIDTH, - minHeight = MIN_HEIGHT, - color = { 0, 0, 0, 0 }, - children = { - scrollpanel1, - inputspace, - }, - OnMouseDown = { - function(self) --//click on scroll bar shortcut to "Settings/HUD Panels/Chat/Console". - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() --make epic Chili menu appear. - return true - end - }, - } - - RemakeConsole() - local buffer = widget:ProcessConsoleBuffer(nil, options.max_lines.value) - for i=1,#buffer do - widget:AddConsoleMessage(buffer[i]) - end - - Spring.SendCommands({"console 0"}) - - self:LocalColorRegister() -end - ------------------------------------------------------------------------ - -function widget:Shutdown() - if (window_console) then - window_console:Dispose() - end - Spring.SendCommands({"console 1", "inputtextgeo default"}) -- not saved to spring's config file on exit - Spring.SetConfigString("InputTextGeo", "0.26 0.73 0.02 0.028") -- spring default values - - self:LocalColorUnregister() -end diff --git a/LuaUI/Widgets_Evo/gui_chili_deluxeplayerlist.lua b/LuaUI/Widgets_Evo/gui_chili_deluxeplayerlist.lua deleted file mode 100644 index c4c702840..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_deluxeplayerlist.lua +++ /dev/null @@ -1,1486 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Chili Deluxe Player List - Alpha 2.02 (Modified for Evolution RTS)", - desc = "v0.203 Chili Deluxe Player List, Alpha Release", - author = "CarRepairer, KingRaptor, CrazyEddie", - date = "2012-06-30", - license = "GNU GPL, v2 or later", - layer = 50, - enabled = true, - --detailsDefault = 1 - -- based on v1.31 Chili Crude Player List by CarRepairer, KingRaptor, et al - } -end - ---[[ -TODO: - * Fast-and-Easy switching between large and small views, and between a single view hidden or shown - * More granular control over which columns are displayed, and how (text vs. icons, etc) - * More and better tooltips, and options for controlling whether and how they are displayed - * Scaling x-axis dimensions proportionally with the fontsize - * Double-click on resource bars to share resources with allies - * Profiling and improving performance - * Tons of minor bugfixes, cosmetic enhancements, and code cleanup ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function SetupPlayerNames() end -function ToggleVisibility() end - -local echo = Spring.Echo -local spGetUnitIsStunned = Spring.GetUnitIsStunned - -local Chili -local Image -local Button -local Checkbox -local Window -local ScrollPanel -local StackPanel -local Label -local screen0 -local color2incolor -local incolor2color - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local window_cpl, scroll_cpl - -options_path = 'Settings/HUD Panels/PlayerList' -options_order = { 'visible', 'backgroundOpacity', 'text_height', 'name_width', 'round_elo', 'mousewheel', 'alignToTop', 'alignToLeft', 'showSummaries', 'show_stats', 'colorResourceStats', 'show_ccr', 'rank_as_text', 'cpu_ping_as_text', 'show_tooltips', 'list_size'} -options = { - visible = { - name = "Visible", - type = 'bool', - value = true, - desc = "Set a hotkey here to toggle the playerlist on and off", - OnChange = function() ToggleVisibility() end, - }, - backgroundOpacity = { - name = "Background Opacity", - type = "number", - value = 0.5, min = 0, max = 1, step = 0.01, - OnChange = function(self) - scroll_cpl.backgroundColor = {1,1,1,self.value} - scroll_cpl.borderColor = {1,1,1,self.value} - scroll_cpl:Invalidate() - end, - }, - text_height = { - name = 'Font Size (10-18)', - type = 'number', - value = 13, - min=10,max=18,step=1, - OnChange = function() SetupPanels() end, - advanced = true - }, - name_width = { - name = 'Name Width (50-200)', - type = 'number', - value = 120, - min=50,max=200,step=10, - OnChange = function() SetupPanels() end, - advanced = true - }, - round_elo = { - name = "Round Elo display", - type = 'bool', - value = true, - desc = "Round Elo display to the nearest 50 points", - OnChange = function() SetupPanels() end, - advanced = true - }, - mousewheel = { - name = "Scroll with mousewheel", - type = 'bool', - value = false, - OnChange = function(self) scroll_cpl.noMouseWheel = not self.value; end, - }, - alignToTop = { - name = "Align to top", - type = 'bool', - value = false, - desc = "Align to top and grow downwards (vs. align to bottom and grow upwards)", - OnChange = function() SetupPlayerNames() end, - }, - alignToLeft = { - name = "Align to left", - type = 'bool', - value = false, - desc = "Align to left and grow rightwards (vs. align to right and grow leftwards)", - OnChange = function() SetupScrollPanel() end, - }, - showSummaries = { - name = "Show team summaries", - type = 'bool', - value = true, - desc = "Display summary information for each team (note: even with this checked, summaries won't be displayed if all the teams are very small)", - OnChange = function() SetupPlayerNames() end, - }, - show_stats = { - name = "Show unit and income stats", - type = 'bool', - value = true, - desc = "Display resource statistics: metal in mobile units and static defenses; metal and energy income.", - OnChange = function() SetupPanels() end, - }, - colorResourceStats = { - name = "Show stats in color", - type = 'bool', - value = false, - desc = "Display resource statistics such as unit metal and income in each player's color (vs. white)", - OnChange = function() SetupPlayerNames() end, - }, - show_ccr = { - name = "Show clan/country/rank", - type = 'bool', - value = false, - desc = "Show the clan, country, and rank columns", - OnChange = function() SetupPanels() end, - }, - rank_as_text = { - name = "Show rank as text", - type = 'bool', - value = false, - desc = "Show rank as text (vs. as an icon)", - OnChange = function() SetupPlayerNames() end, - }, - cpu_ping_as_text = { - name = "Show ping/cpu as text", - type = 'bool', - value = false, - desc = "Show ping and cpu stats as text (vs. as an icon)", - OnChange = function() SetupPanels() end, - }, - show_tooltips = { - name = "Show tooltips", - type = 'bool', - value = true, - desc = "Show tooltips where available (vs. hiding all tooltips)", - OnChange = function() SetupPanels() end, - }, - list_size = { - name = 'List Size: Who should be included?', - type = 'list', - value = 3, - items = { - { key = 0, name = "Nobody" }, - { key = 1, name = "Just you" }, - { key = 2, name = "Just your team" }, - { key = 3, name = "All players" }, - { key = 4, name = "All players and spectators" }, - }, - OnChange = function() SetupPlayerNames() end, - }, -} - -local name_width - -local green = '' -local red = '' -local orange = '' -local yellow = '' -local cyan = '' -local white = '' - -local IsMission -if VFS.FileExists("mission.lua") then - IsMission = true -else - IsMission = false -end - -local localTeam = 0 -local localAlliance = 0 -local myID -local myName -local amSpec - -myID = Spring.GetMyPlayerID() -myName,_,amSpec = Spring.GetPlayerInfo(myID) -localTeam = Spring.GetMyTeamID() -localAlliance = Spring.GetMyAllyTeamID() - --- This is awkward, but it's okay for now. --- I'll make it elegant when I implement x-scaling with fontsize --- -local x_icon_clan -local x_icon_country -local x_icon_rank -local x_elo -local x_cf -local x_status -local x_name -local x_share -local x_m_mobiles -local x_m_defense -local x_m_income -local x_e_income -local x_m_fill -local x_e_fill -local x_cpu -local x_ping -local x_postping -local x_bound -local x_windowbound - -local function CalculateWidths() - name_width = options.name_width.value or 120 - x_icon_clan = 10 - x_icon_country = x_icon_clan + 18 - x_icon_rank = x_icon_country + 20 - x_elo = options.show_ccr.value and x_icon_rank + 16 or x_icon_clan - x_cf = x_elo + 32 - x_status = cf and x_cf + 20 or x_cf - x_name = x_status + 12 - x_share = x_name + name_width - x_m_mobiles = not amSpec and x_share + 12 or x_share - x_m_defense = x_m_mobiles + 34 - x_m_income = x_m_defense + 40 - x_e_income = x_m_income + 30 - x_m_fill = options.show_stats.value and x_e_income + 26 or x_m_mobiles - x_e_fill = x_m_fill + 30 - x_cpu = x_e_fill + (options.cpu_ping_as_text.value and 52 or 30) - x_ping = x_cpu + (options.cpu_ping_as_text.value and 46 or 16) - x_bound = x_ping + 28 - x_windowbound = x_bound + 0 -end -CalculateWidths() - -local UPDATE_FREQUENCY = 0.8 -- seconds - -local cfCheckBoxes = {} - -local allyTeams = {} -- [id] = {team1, team2, ...} -local teams = {} -- [id] = {leaderName = name, roster = {entity1, entity2, ...}} -local teamZeroPlayers = {} - --- entity = player (including specs) or bot --- ordered list; contains isAI, isSpec, playerID, teamID, name, namelabel, cpuImg, pingImg -local entities = {} -local allyTeamEntities = {} -local allyTeamOrderRank = {} -local allyTeamsDead = {} -local allyTeamsElo = {} -local playerTeamStatsCache = {} -local finishedUnits = {} -local numBigTeams = 0 -local existsVeryBigTeam = nil -local myTeamIsVeryBig = nil -local specTeam = {roster = {}} - -local sharePic = ":n:"..LUAUI_DIRNAME.."Images/playerlist/share.png" -local cpuPic = ":n:"..LUAUI_DIRNAME.."Images/playerlist/cpu.png" -local pingPic = ":n:"..LUAUI_DIRNAME.."Images/playerlist/ping.png" - -local row -local fontsize -local list_size -local timer = 0 -local lastSizeX -local lastSizeY -local lastChosenSizeX = 0 -include("keysym.h.lua") - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function ShareUnits(playername, team) - local selcnt = Spring.GetSelectedUnitsCount() - if selcnt > 0 then - Spring.SendCommands("say a: I gave "..selcnt.." units to "..playername..".") - Spring.ShareResources(team, "units") - else - echo 'Player List: No units selected to share.' - end -end - --- makes a color char from a color table --- explanation for string.char: http://springrts.com/phpbb/viewtopic.php?f=23&t=24952 -local function GetColorChar(colorTable) - if colorTable == nil then return string.char(255,255,255,255) end - local col = {} - for i=1,4 do - col[i] = math.ceil(colorTable[i]*255) - end - return string.char(col[4],col[1],col[2],col[3]) -end - -local function FormatPingCpu(ping,cpu) - -- guard against being called with nils - ping = ping or 0 - cpu = cpu or 0 - -- guard against silly values - ping = math.max(math.min(ping,999),0) - cpu = math.max(math.min(cpu,9.99),0) - - local pingMult = 2/3 -- lower = higher ping needed to be red - local pingCpuColors = { - {0, 1, 0, 1}, - {0.7, 1, 0, 1}, - {1, 1, 0, 1}, - {1, 0.6, 0, 1}, - {1, 0, 0, 1} - } - - local pingCol = pingCpuColors[ math.ceil( math.min(ping * pingMult, 1) * 5) ] or {.85,.85,.85,1} - local cpuCol = pingCpuColors[ math.ceil( math.min(cpu, 1) * 5 ) ] or {.85,.85,.85,1} - - local pingText - if ping < 1 then - pingText = (math.floor(ping*1000) ..'ms') - else - pingText = ('' .. (math.floor(ping*100)/100)):sub(1,4) .. 's' - end - - local cpuText = math.round(cpu*100) .. '%' - - return pingCol,cpuCol,pingText,cpuText -end - -local function FormatMetalStats(stat,k) --- if k then --- stat = 1000 * math.floor((stat/1000) + .5) --- return string.format("%.0f", stat/1000) .. "k" --- else --- stat = 50 * math.floor((stat/50) + .5) - return stat < 1000 - and string.format("%.0f", stat) - or string.format("%.1f", stat/1000) .. "k" --- end -end - -local function FormatElo(elo,full) - local mult = full and 1 or 50 - local elo_out = mult * math.floor((elo/mult) + .5) - local eloCol = {} - - local top = 1800 - local mid = 1600 - local bot = 1400 - local tc = {1,1,1,1} - local mc = {1,1,0,1} - local bc = {1,.2,.2,1} - - if elo_out >= top then eloCol = tc - elseif elo_out >= mid then - local r = (elo_out-mid)/(top-mid) - for i = 1,4 do - eloCol[i] = (r * tc[i]) + ((1-r) * mc[i]) - end - elseif elo_out >= bot then - local r = (elo_out-bot)/(mid-bot) - for i = 1,4 do - eloCol[i] = (r * mc[i]) + ((1-r) * bc[i]) - end - else eloCol = bc - end - - return elo_out, eloCol -end - -local function ProcessUnit(unitID, unitDefID, unitTeam, remove) - local stats = playerTeamStatsCache[unitTeam] - if UnitDefs[unitDefID] and stats then -- shouldn't need to guard against nil here, but I've had it happen - local metal = UnitDefs[unitDefID].metalCost - local speed = UnitDefs[unitDefID].speed - local unarmed = UnitDefs[unitDefID].springCategories.unarmed - local isbuilt = not select(3, spGetUnitIsStunned(unitID)) - if metal and metal < 1000000 then -- tforms show up as 1million cost, so ignore them - if remove then - metal = -metal - end - -- for mobiles, count only completed units - if speed and speed ~= 0 then - if remove then - finishedUnits[unitID] = nil - stats.mMobs = stats.mMobs + metal - -- [f=0087651] [cawidgets.lua] Error: Error in UnitGiven(): [string "LuaUI/Widgets/gui_chili_deluxeplayerlist.lu..."]:410: attempt to index local 'stats' (a nil value) - elseif isbuilt then - finishedUnits[unitID] = true - stats.mMobs = stats.mMobs + metal - end - -- for static defense, include full cost of unfinished units so you can see when your teammates are trying to build too much - elseif not unarmed then - stats.mDefs = stats.mDefs + metal - end - end - end -end - -local function GetPlayerTeamStats(teamID) - if not playerTeamStatsCache[teamID] then - playerTeamStatsCache[teamID] = {mMobs = 0, mDefs = 0} - local units = Spring.GetTeamUnits(teamID) - for i=1,#units do - local unitID = units[i] - local unitDefID = Spring.GetUnitDefID(unitID) - ProcessUnit(unitID, unitDefID, teamID) - end - end - - local stats = playerTeamStatsCache[teamID] - - local eCurr, eStor, ePull, eInco, eExpe, eShar, eSent, eReci = Spring.GetTeamResources(teamID, "energy") - local mCurr, mStor, mPull, mInco, mExpe, mShar, mSent, mReci = Spring.GetTeamResources(teamID, "metal") - - -- guard against dividing by zero later, when the fill bar percentage is calculated - -- these probably aren't ever going to be zero, but better safe than sorry - if mStore and mStore == 0 then mStore = 1000 end - if eStore and eStore == 0 then eStore = 1000 end - - -- Default these to 1 if the value is nil for some reason. - -- These should never be 1 in normal play, so if you see - -- them showing up as 1 then that means that something got nil, - -- which should perhaps then be looked into further. - -- Whereas it's quite reasonable for them to sometimes be zero. - stats.mInco = mInco or 1 - stats.eInco = eInco or 1 - stats.mCurr = mCurr or 1 - stats.mStor = mStor or 1 - stats.eCurr = eCurr or 1 - stats.eStor = eStor or 1 - - return playerTeamStatsCache[teamID] -end - --- ceasefire button tooltip -local function CfTooltip(allyTeam) - local tooltip = '' - - if Spring.GetGameRulesParam('cf_' .. localAlliance .. '_' .. allyTeam) == 1 then - tooltip = tooltip .. green .. 'Ceasefire in effect.' .. white - else - local theyOffer = Spring.GetGameRulesParam('cf_offer_' .. localAlliance .. '_' .. allyTeam) == 1 - local youOffer = Spring.GetGameRulesParam('cf_offer_' .. allyTeam.. '_' .. localAlliance) == 1 - if theyOffer then - tooltip = tooltip .. yellow .. 'They have offered a ceasefire.' .. white .. '\n' - end - if youOffer then - tooltip = tooltip .. cyan .. 'Your team has offered a ceasefire.' .. white .. '\n' - end - - tooltip = tooltip .. red .. 'No ceasefire in effect.' .. white - end - - tooltip = tooltip .. '\n\n' - - tooltip = tooltip .. 'Your team\'s votes: \n' - local teamList = Spring.GetTeamList(localAlliance) - for _,teamID in ipairs(teamList) do - local _,playerID = Spring.GetTeamInfo(teamID) - local name = Spring.GetPlayerInfo(playerID) or '-' - local vote = Spring.GetTeamRulesParam(teamID, 'cf_vote_' ..allyTeam)==1 and green..'Y'..white or red..'N'..white - local teamColor = color2incolor(Spring.GetTeamColor(teamID)) - tooltip = tooltip .. teamColor .. ' <' .. name .. '> ' .. white.. vote ..'\n' - end - - tooltip = tooltip .. '\n' - - tooltip = tooltip .. 'Check this box to vote for a ceasefire with '.. yellow ..''..white..'. \n\n' - ..'If everyone votes Yes, an offer will be made. If there is a ceasefire, ' - ..'unchecking the box will break it.' - - return tooltip -end - - -local function MakeSpecTooltip() - - if (not options.show_tooltips.value) or list_size == 4 or (list_size == 3 and #specTeam.roster == 0) then - scroll_cpl.tooltip = nil - return - end - - local windowTooltip - local players = {} - local spectators = {} - - local playerlist = Spring.GetPlayerList() - for i=1, #playerlist do - local playerID = playerlist[i] - local name,active,spectator,teamID,allyTeamID,pingTime,cpuUsage,country,rank,customKeys = Spring.GetPlayerInfo(playerID) - local pingCol, cpuCol, pingText, cpuText = FormatPingCpu(pingTime,cpuUsage) - local cpuColChar = GetColorChar(cpuCol) - local pingColChar = GetColorChar(pingCol) - if active and not spectator then - players[#players+1] = { name = name, pingText = pingText, cpuText = cpuText, pingColChar = pingColChar, cpuColChar = cpuColChar } - elseif spectator then - spectators[#spectators+1] = { name = name, pingText = pingText, cpuText = cpuText, pingColChar = pingColChar, cpuColChar = cpuColChar } - end - end - - table.sort (players, function(a,b) - return a.name:lower() < b.name:lower() - end - ) - - table.sort (spectators, function(a,b) - return a.name:lower() < b.name:lower() - end - ) - - if list_size <= 2 then - windowTooltip = windowTooltip or "PLAYERS" - for i=1, #players do - windowTooltip = windowTooltip .. "\n\t"..players[i].name.."\t"..players[i].cpuColChar..(players[i].cpuText)..'\008' .. "\t"..players[i].pingColChar..(players[i].pingText).."\008" - end - end - - if #spectators ~= 0 then - windowTooltip = windowTooltip and (windowTooltip .. "\n\n") or "" - windowTooltip = windowTooltip .. "SPECTATORS" - for i=1, #spectators do - windowTooltip = windowTooltip .. "\n\t"..spectators[i].name.."\t"..spectators[i].cpuColChar..(spectators[i].cpuText)..'\008' .. "\t"..spectators[i].pingColChar..(spectators[i].pingText).."\008" - end - end - - scroll_cpl.tooltip = windowTooltip -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function MakeNewLabel(entity,name,o) -- "o" is for options - -- pass in x, width, caption, textColor - -- pass in any optional params like align - -- pass in anything to override these defaults: - o.y = o.y or (fontsize+1) * row - o.fontsize = o.fontsize or fontsize - o.fontShadow = o.fontShadow or true - o.autosize = o.autosize or false - - local newLabel = Label:New(o) - entity[name] = newLabel - scroll_cpl:AddChild(newLabel) -end - -local function MakeNewBar(entity,name,o) - -- pass in x, width, color, value - -- pass in anything to override these defaults: - o.y = o.y or ((fontsize+1) * row) + 6 - o.height = o.height or 5 - o.min = o.min or 0 - o.max = o.max or 1 - o.autosize = o.autosize or false - - local newBar = Chili.Progressbar:New(o) - entity[name] = newBar - scroll_cpl:AddChild(newBar) -end - -local function MakeNewIcon(entity,name,o) - -- pass in x, file - -- pass in anything to override these defaults: - o.y = o.y or ((fontsize+1) * row) + 2 - o.width = o.width or fontsize + 3 - o.height = o.height or fontsize + 3 - - o.tooltip = options.show_tooltips.value and o.tooltip or nil - - local newIcon = Chili.Image:New(o) - entity[name] = newIcon - scroll_cpl:AddChild(newIcon) -end - -local function AccumulatePlayerTeamStats(r,s) - r.eCurr = r.eCurr + s.eCurr - r.eStor = r.eStor + s.eStor - r.eInco = r.eInco + s.eInco - r.mCurr = r.mCurr + s.mCurr - r.mStor = r.mStor + s.mStor - r.mInco = r.mInco + s.mInco - r.mMobs = r.mMobs + s.mMobs - r.mDefs = r.mDefs + s.mDefs -end - -local function DrawPlayerTeamStats(entity,teamcolor,s) - if not options.colorResourceStats.value then teamcolor = {.85,.85,.85,1} end - if options.show_stats.value then - MakeNewLabel(entity,"m_mobilesLabel",{x=x_m_mobiles,width=36,caption = FormatMetalStats(s.mMobs,true),textColor = teamcolor,align = 'right',}) - MakeNewLabel(entity,"m_defenseLabel",{x=x_m_defense,width=36,caption = FormatMetalStats(s.mDefs),textColor = teamcolor,align = 'right',}) - MakeNewLabel(entity,"m_incomeLabel",{x=x_m_income,width=24,caption = string.format("%." .. (0) .. "f", s.mInco),textColor = teamcolor,align = 'right',}) - MakeNewLabel(entity,"e_incomeLabel",{x=x_e_income,width=24,caption = string.format("%." .. (0) .. "f", s.eInco),textColor = teamcolor,align = 'right',}) - end - MakeNewBar(entity,"m_fillBar",{x=x_m_fill + 6,width=24,color = {.7,.75,.9,1},value = s.mCurr/s.mStor,}) - MakeNewBar(entity,"e_fillBar",{x=x_e_fill + 2,width=24,color = {1,1,0,1}, value = s.eCurr/s.eStor,}) -end - -local function UpdatePlayerTeamStats(entity,s) - if entity.m_mobilesLabel then entity.m_mobilesLabel:SetCaption(FormatMetalStats(s.mMobs,true)) end - if entity.m_defenseLabel then entity.m_defenseLabel:SetCaption(FormatMetalStats(s.mDefs)) end - if entity.e_incomeLabel then entity.e_incomeLabel:SetCaption(string.format("%." .. (0) .. "f", s.eInco)) end - if entity.m_incomeLabel then entity.m_incomeLabel:SetCaption(string.format("%." .. (0) .. "f", s.mInco)) end - if entity.m_fillBar then entity.m_fillBar:SetValue(s.mCurr/s.mStor) end - if entity.e_fillBar then entity.e_fillBar:SetValue(s.eCurr/s.eStor) end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function UpdatePingCpu(entity,pingTime,cpuUsage,pstatus) - pingTime = pingTime or 0 - cpuUsage = cpuUsage or 0 - if pstatus == 'gone' then - pingTime = 0 - cpuUsage = 0 - end - local pingCol, cpuCol, pingText, cpuText = FormatPingCpu(pingTime,cpuUsage) - if options.cpu_ping_as_text.value then - if entity.cpuLabel then entity.cpuLabel.font:SetColor(cpuCol) ; entity.cpuLabel:SetCaption(cpuText) end - if entity.pingLabel then entity.pingLabel.font:SetColor(pingCol) ; entity.pingLabel:SetCaption(pingText) end - else - if entity.cpuImg then - entity.cpuImg.color = cpuCol - if options.show_tooltips.value then entity.cpuImg.tooltip = ('CPU: ' .. cpuText) end - entity.cpuImg:Invalidate() - end - if entity.pingImg then - entity.pingImg.color = pingCol - if options.show_tooltips.value then entity.pingImg.tooltip = ('Ping: ' .. pingText) end - entity.pingImg:Invalidate() - end - end -end - --- updates as needed: status, name, ping, cpu, resource stats, etc. -local function UpdatePlayerInfo() - for i=1,#entities do - local teamID - if entities[i].isAI then - teamID = entities[i].teamID - else - local playerID = entities[i].playerID - local name,active,spectator,localteamID,allyTeamID,pingTime,cpuUsage = Spring.GetPlayerInfo(playerID) - teamID = localteamID - local teamcolor = teamID and {Spring.GetTeamColor(teamID)} or {1,1,1,1} - - -- status (player status and team status) - local pstatus = nil - local tstatus = '' - local tstatuscolor = {1,1,1,1} - - if not active then - if Spring.GetGameSeconds() < 0.1 or cpuUsage > 1 then tstatus = '?' ; tstatuscolor = teamcolor - else pstatus = 'gone' - end - elseif spectator and (teamID ~= 0 or teamZeroPlayers[playerID]) then - pstatus = 'spec' - end - - if pstatus == 'spec' or pstatus == 'gone' then - if Spring.GetTeamUnitCount(teamID) > 0 then - tstatus = '!!' - tstatuscolor = {1,1,0,1} - else - tstatus = 'X' - tstatuscolor = {1,0,0,1} - end - end - - local displayname - local whitestring = GetColorChar({1,1,1,1}) - local greystring = GetColorChar({.5,.5,.5,1}) - local teamcolorstring = GetColorChar(teamcolor) - -- these were part of a failed experiment that I might try to fix later - - if pstatus == 'spec' then displayname = (" ss: " .. name) - elseif pstatus == 'gone' then displayname = (" xx: " .. name) - else displayname = (name) - end - - if entities[i].nameLabel then entities[i].nameLabel:SetCaption(displayname) end - if entities[i].statusLabel then entities[i].statusLabel:SetCaption(tstatus) ; entities[i].statusLabel.font:SetColor(tstatuscolor) end - - UpdatePingCpu(entities[i],pingTime,cpuUsage,pstatus) - end -- if not isAI - - -- update the resource stats for all entities, including AIs - local s = GetPlayerTeamStats(teamID) - UpdatePlayerTeamStats(entities[i],s) - - end -- for entities - - -- update ping and cpu for the spectators - if #specTeam.roster ~= 0 then - for i = 1,#specTeam.roster do - local playerID = specTeam.roster[i].playerID - local name,active,spectator,localteamID,allyTeamID,pingTime,cpuUsage = Spring.GetPlayerInfo(playerID) - specTeam.roster[i].pingTime = pingTime - specTeam.roster[i].cpuUsage = cpuUsage - if list_size == 4 then - UpdatePingCpu(specTeam.roster[i],pingTime,cpuUsage) - end - end - end - MakeSpecTooltip() - - for allyTeam, cb in pairs(cfCheckBoxes) do - cb.tooltip = CfTooltip(allyTeam) - end - - -- update resource totals for the allyTeams - if allyTeamEntities then - for k,v in pairs(allyTeamEntities) do - local r = { eCurr = 0, eStor = 0, eInco = 0, mCurr = 0, mStor = 0, mInco = 0, mMobs = 0, mDefs = 0 } - if allyTeams[k] then - for j=1,#allyTeams[k] do - local teamID = allyTeams[k][j] - if teamID then - local s = GetPlayerTeamStats(teamID) - AccumulatePlayerTeamStats(r,s) - end - end - end - UpdatePlayerTeamStats(v,r) - end - end - -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function AddTableHeaders() - if cf then - scroll_cpl:AddChild( Label:New{ x=x_cf, y=(fontsize+1) * row, caption = 'CF', fontShadow = true, fontsize = fontsize, } ) - end - if options.show_stats.value then - scroll_cpl:AddChild( Image:New{ x=x_m_mobiles - 10, y=((fontsize+1) * row) + 3, height = (fontsize)+1, color = {1, .3, .3, 1}, file = 'LuaUI/Images/commands/Bold/attack.png',} ) - scroll_cpl:AddChild( Image:New{ x=x_m_defense - 7, y=((fontsize+1) * row) + 3, height = (fontsize)+1, color = {.3, .3, 1, 1}, file = 'LuaUI/Images/commands/Bold/guard.png',} ) - scroll_cpl:AddChild( Image:New{ x=x_e_income - 15, y=((fontsize+1) * row) + 3, height = (fontsize)+1, file = 'LuaUI/Images/energy.png',} ) - scroll_cpl:AddChild( Image:New{ x=x_m_income - 15, y=((fontsize+1) * row) + 3, height = (fontsize)+1, file = 'LuaUI/Images/ibeam.png',} ) - end - scroll_cpl:AddChild( Label:New{ x=x_cpu, y=(fontsize+1) * row, caption = 'C', fontShadow = true, fontsize = fontsize,} ) - scroll_cpl:AddChild( Label:New{ x=x_ping, y=(fontsize+1) * row, caption = 'P', fontShadow = true, fontsize = fontsize,} ) -end - -local function AddCfCheckbox(allyTeam) - local fontsize = options.text_height.value - if cf and allyTeam ~= -1 and allyTeam ~= localAlliance then - local cfCheck = Checkbox:New{ - x=x_cf,y=(fontsize+1) * row + 3,width=20, - caption='', - checked = Spring.GetTeamRulesParam(localTeam, 'cf_vote_' ..allyTeam)==1, - tooltip = CfTooltip(allyTeam), - OnChange = { function(self) - Spring.SendLuaRulesMsg('ceasefire:'.. (self.checked and 'n' or 'y') .. ':' .. allyTeam) - self.tooltip = CfTooltip(allyTeam) - end }, - } - scroll_cpl:AddChild(cfCheck) - cfCheckBoxes[allyTeam] = cfCheck - end - -end - --- adds all the entity information -local function AddEntity(entity, teamID, allyTeamID) - local teamcolor = (teamID and teamID ~= -1) and {Spring.GetTeamColor(teamID)} or {1,1,1,1} - - if entity.isAI then - MakeNewLabel(entity,"nameLabel",{x=x_name,width=name_width,caption = entity.name,textColor = teamcolor,}) - - else - - -- clan/faction emblems, level, country, elo - local icon = nil - local icRank = nil - local elo = nil - local eloCol = nil - local icCountry = entity.country and entity.country ~= '' and entity.country ~= '??' and "LuaUI/Images/flags/" .. (entity.country) .. ".png" or nil - if options.show_ccr.value then - if entity.clan and entity.clan ~= "" then - icon = "LuaUI/Configs/Clans/" .. entity.clan ..".png" - elseif entity.faction and entity.faction ~= "" then - icon = "LuaUI/Configs/Factions/" .. entity.faction ..".png" - end - if entity.level and entity.level ~= "" then - icRank = "LuaUI/Images/Ranks/" .. math.min((1+math.floor((entity.level or 0)/10)),9) .. ".png" - end - if icCountry then MakeNewIcon(entity,"countryIcon",{x=x_icon_country,file=icCountry,}) end - if options.rank_as_text.value then - if entity.level then MakeNewLabel(entity,"rankLabel",{x=x_icon_rank,width=14,caption = math.min(entity.level,99),textColor = {0.85,0.85,0.85,1},align = 'right',}) end - else - if icRank then MakeNewIcon(entity,"rankIcon",{x=x_icon_rank,file=icRank,}) end - end - if icon then MakeNewIcon(entity,"clanIcon",{x=x_icon_clan,file=icon,y=((fontsize+1)*row)+5,width=fontsize-1,height=fontsize-1}) end - end - if entity.elo and entity.elo ~= "" then - elo, eloCol = FormatElo(entity.elo, not options.round_elo.value) - end - if elo then MakeNewLabel(entity,"eloLabel",{x=x_elo,caption = elo,textColor = eloCol,}) end - - -- status (player status and team status) - local pstatus = nil - local tstatus = '' - local tstatuscolor = {1,1,1,1} - - if teamID ~= -1 then - if not entity.isActive then - if Spring.GetGameSeconds() < 0.1 or entity.cpuUsage > 1 then tstatus = '?' ; tstatuscolor = teamcolor - else pstatus = 'gone' - end - elseif entity.isSpec and (teamID ~= 0 or teamZeroPlayers[entity.playerID]) then - pstatus = 'spec' - end - end - - if pstatus == 'spec' or pstatus == 'gone' then - if Spring.GetTeamUnitCount(teamID) > 0 then - tstatus = '!!' - tstatuscolor = {1,1,0,1} - else - tstatus = 'X' - tstatuscolor = {1,0,0,1} - end - end - - MakeNewLabel(entity,"statusLabel",{x=x_status,width=16,caption = tstatus,textColor = tstatuscolor,}) - - -- name, including player status designators - local displayname - local whitestring = GetColorChar({1,1,1,1}) - local greystring = GetColorChar({.5,.5,.5,1}) - local teamcolorstring = GetColorChar(teamcolor) - -- these were part of a failed experiment that I might try to fix later - - if pstatus == 'spec' then displayname = (" ss: " .. entity.name) - elseif pstatus == 'gone' then displayname = (" xx: " .. entity.name) - else displayname = (entity.name) - end - - MakeNewLabel(entity,"nameLabel",{x=x_name,width=name_width,caption = displayname,textColor = teamcolor,}) - - -- ping and cpu icons / labels - local pingCol, cpuCol, pingText, cpuText = FormatPingCpu(pstatus == 'gone' and 0 or entity.pingTime,pstatus == 'gone' and 0 or entity.cpuUsage) - if options.cpu_ping_as_text.value then - MakeNewLabel(entity,"cpuLabel",{x=x_cpu,width = (fontsize+3)*10/16,caption = cpuText,textColor = cpuCol,align = 'right',}) - MakeNewLabel(entity,"pingLabel",{x=x_ping,width = (fontsize+3)*10/16,caption = pingText,textColor = pingCol,align = 'right',}) - else - MakeNewIcon(entity,"cpuImg",{x=x_cpu,file=cpuPic,width = (fontsize+3)*10/16,keepAspect = false,tooltip = 'CPU: ' .. cpuText,}) - MakeNewIcon(entity,"pingImg",{x=x_ping,file=pingPic,width = (fontsize+3)*10/16,keepAspect = false,tooltip = 'Ping: ' .. pingText,}) - entity.cpuImg.color = cpuCol - entity.pingImg.color = pingCol - function entity.cpuImg:HitTest(x,y) return self end - function entity.pingImg:HitTest(x,y) return self end - end - - end -- if not isAI - - -- share button - if teamID ~= -1 and (teams[teamID] and (teams[teamID].isPlaying and not teams[teamID].isDead)) and allyTeamID == localAlliance and teamID ~= localTeam and not amSpec then - scroll_cpl:AddChild( - Button:New{ - x=x_share, - y=(fontsize+1) * (row+0.5)-2.5, - height = fontsize, - width = fontsize, - tooltip = options.show_tooltips.value and 'Double click to share selected units to ' .. entity.name or nil, - caption = '', - padding ={0,0,0,0}, - OnDblClick = { function(self) ShareUnits(entity.name, teamID) end, }, - children = { - Image:New{ - x=0,y=0, - height='100%', - width='100%', - file = sharePic, - }, - }, - } - ) - end - - -- mobile and defence metal, metal and energy income, resource bars - if teamID ~= -1 and (allyTeamID == localAlliance or amSpec) then - local s = GetPlayerTeamStats(teamID) - DrawPlayerTeamStats(entity,teamcolor,s) - end - - row = row + 1 -end - -local function AddAllAllyTeamSummaries(allyTeamsSorted) - local allyTeamResources - for i=1,#allyTeamsSorted do - local allyTeamID = allyTeamsSorted[i] - if allyTeams[allyTeamID] then - for j=1,#allyTeams[allyTeamID] do - local teamID = allyTeams[allyTeamID][j] - if teamID then - local s = GetPlayerTeamStats(teamID) - allyTeamResources = allyTeamResources or {} - allyTeamResources[allyTeamID] = allyTeamResources[allyTeamID] or { eCurr = 0, eStor = 0, eInco = 0, mCurr = 0, mStor = 0, mInco = 0, mMobs = 0, mDefs = 0 } - AccumulatePlayerTeamStats(allyTeamResources[allyTeamID],s) - end - end - end - end - if allyTeamResources then - for i=1,#allyTeamsSorted do - local allyTeamID = allyTeamsSorted[i] - if allyTeamResources[allyTeamID] and allyTeams[allyTeamID] then - allyTeamEntities[allyTeamID] = allyTeamEntities[allyTeamID] or {} - local allyTeamColor - local elo - local eloCol - if allyTeamsElo[allyTeamID] then - elo, eloCol = FormatElo(allyTeamsElo[allyTeamID].total / allyTeamsElo[allyTeamID].count, true) - end - if (localTeam ~= 0 or teamZeroPlayers[myID]) and allyTeamID == localAlliance then - allyTeamColor = {Spring.GetTeamColor(localTeam)} - else - allyTeamColor = {Spring.GetTeamColor(allyTeams[allyTeamID][1])} - end - MakeNewLabel(allyTeamEntities[allyTeamID],"nameLabel",{x=x_name,width=150,caption = ("Team " .. allyTeamID+1),textColor = allyTeamColor,}) - DrawPlayerTeamStats(allyTeamEntities[allyTeamID],allyTeamColor,allyTeamResources[allyTeamID]) - if elo then MakeNewLabel(allyTeamEntities[allyTeamID],"eloLabel",{x=x_elo,caption = elo,textColor = eloCol,}) end - AddCfCheckbox(allyTeamID) - if allyTeamsDead[allyTeamID] then MakeNewLabel(allyTeamEntities[allyTeamID],"statusLabel",{x=x_status,width=16,caption = "X",textColor = {1,0,0,1},}) end - row = row + 1 - end - end - end -end - -local function AlignScrollPanel() - local height = math.ceil(row * (fontsize+1.5) + 16) --Adjusting this fixes the bad sizing of the initial box - scroll_cpl.height = math.min(height, window_cpl.height) - if not (options.alignToTop.value) then - scroll_cpl.y = (window_cpl.height) - scroll_cpl.height - else - scroll_cpl.y = 0 - end -end - -SetupPlayerNames = function() - entities = {} - teams = {} - allyTeams = {} - allyTeamsElo = {} - - specTeam = {roster = {}} - playerTeamStatsCache = {} - - fontsize = options.text_height.value - scroll_cpl:ClearChildren() - - local playerlist = Spring.GetPlayerList() - local teamsSorted = Spring.GetTeamList() - local allyTeamsSorted = Spring.GetAllyTeamList() - - list_size = options.list_size.value or 3 - if not (localTeam ~= 0 or teamZeroPlayers[myID]) then - if list_size == 1 then list_size = 0 end - if list_size == 2 then list_size = 3 end - end - - -- register any AIs as entities, assign teams to allyTeams - for i=1,#teamsSorted do - local teamID = teamsSorted[i] - if teamID ~= Spring.GetGaiaTeamID() then - teams[teamID] = teams[teamID] or {roster = {}} - local _,leader,isDead,isAI,_,allyTeamID = Spring.GetTeamInfo(teamID) - if isAI then - local skirmishAIID, name, hostingPlayerID, shortName, version, options = Spring.GetAIInfo(teamID) - if (IsMission == false) then - name = '<'.. name ..'> '.. shortName - end - local entityID = #entities + 1 - entities[entityID] = {name = name, teamID = teamID, isAI = true} - local index = #teams[teamID].roster + 1 - teams[teamID].roster[index] = entities[entityID] - teams[teamID].isPlaying = true - end - teams[teamID].leader = leader - allyTeams[allyTeamID] = allyTeams[allyTeamID] or {} - allyTeams[allyTeamID][#allyTeams[allyTeamID]+1] = teamID - if isDead then - teams[teamID].isDead = true - end - end --if teamID ~= Spring.GetGaiaTeamID() - end --for each team - - -- go through all players, register as entities, assign to teams - -- also store the data needed later to calculate the team average elo - for i=1, #playerlist do - local playerID = playerlist[i] - local name,active,spectator,teamID,allyTeamID,pingTime,cpuUsage,country,rank,customKeys = Spring.GetPlayerInfo(playerID) - local clan, faction, level, elo - if customKeys then - clan = customKeys.clan - faction = customKeys.faction - level = customKeys.level - elo = customKeys.elo - end - - if teamID == 0 and not spectator then - teamZeroPlayers[playerID] = true - end - if teamID ~= 0 or teamZeroPlayers[playerID] then - local entityID = #entities + 1 - entities[entityID] = { - playerID = playerID, - name = name, - isActive = active, - isSpec = spectator, - teamID = teamID, - pingTime = pingTime, - cpuUsage = cpuUsage, - country = country, - rank = rank, - clan = clan, - faction = faction, - level = level, - elo = elo, - } - local index = #teams[teamID].roster + 1 - teams[teamID].roster[index] = entities[entityID] - if not (spectator or (not active and Spring.GetGameSeconds() > 0.1 and cpuUsage < 1)) then - teams[teamID].isPlaying = true - if allyTeamID and elo then - if allyTeamsElo[allyTeamID] then - allyTeamsElo[allyTeamID].total = allyTeamsElo[allyTeamID].total + elo - allyTeamsElo[allyTeamID].count = allyTeamsElo[allyTeamID].count + 1 - else - allyTeamsElo[allyTeamID] = { ["total"] = elo, ["count"] = 1} - end - end - end - end - if spectator and active then - specTeam.roster[#(specTeam.roster) + 1] = { - playerID = playerID, - name = name, - isActive = active, - isSpec = spectator, - teamID = teamID, - pingTime = pingTime, - cpuUsage = cpuUsage, - country = country, - rank = rank, - clan = clan, - faction = faction, - level = level, - elo = elo, - } - end - - end - - -- sort each playerteam's roster: self first, then by elo, and alphabetically otherwise - for i=1,#teams do - if teams[i].roster then - table.sort (teams[i].roster, function(a,b) - if localTeam ~= 0 or teamZeroPlayers[myID] then - if a.playerID == myID then return true end - if b.playerID == myID then return false end - end - return a.elo > b.elo - end - ) - end - end - - -- sort each allyteam's list of playerteams: - -- own pteam first, then by elo of the first player on the pteam, and alphabetically otherwise - -- dead pteams (even your own) come after alive pteams - -- dead pteams whose first player is speccing come before dead pteams whose first player is gone - for i=1,#allyTeamsSorted do -- for every ally team - local allyTeamID = allyTeamsSorted[i] - if allyTeams[allyTeamID] then - table.sort (allyTeams[allyTeamID], function(a,b) - if not teams[a] or not teams[b] then - Spring.Echo(' Critical Error #1!') - return a > b - else - if (teams[a].isDead or not teams[a].isPlaying) and not (teams[b].isDead or not teams[b].isPlaying) then return false end - if (teams[b].isDead or not teams[b].isPlaying) and not (teams[a].isDead or not teams[a].isPlaying) then return true end - if (teams[a].isDead or not teams[a].isPlaying) and (teams[b].isDead or not teams[b].isPlaying) then - if teams[a].roster[1].isActive and not teams[b].roster[1].isActive then return true end - if teams[b].roster[1].isActive and not teams[a].roster[1].isActive then return false end - end - if localTeam ~= 0 or teamZeroPlayers[myID] then - if a == localTeam then return true end - if b == localTeam then return false end - end - if teams[a].roster[1].elo and teams[b].roster[1].elo then - return teams[a].roster[1].elo > teams[b].roster[1].elo - end - return a > b - end - end - ) - end - end - - -- if we haven't ever done so before, build the ally team sort order - -- ally teams are sorted by total elo, so larger teams will be above smaller teams - -- ally team sort order is determined at the very start, and doesn't change even if - -- the team composition changes (except that dead teams will fall to the bottom) - -- - -- while we're at it, determine whether or not to show the ally team summary lines - -- - if #allyTeamOrderRank == 0 then - if #allyTeams[localAlliance] > 2 then myTeamIsVeryBig = true end - for i=1,#allyTeamsSorted do -- for every ally team - local allyTeamID = allyTeamsSorted[i] - allyTeamOrderRank[allyTeamID] = 0 - if allyTeams[allyTeamID] then - if #allyTeams[allyTeamID] > 2 then existsVeryBigTeam = true end - if #allyTeams[allyTeamID] > 1 then numBigTeams = numBigTeams + 1 end - for j=1,#allyTeams[allyTeamID] do -- for every player team on the ally team - local teamID = allyTeams[allyTeamID][j] - if teams[teamID] and teams[teamID].roster then - for k=1,#teams[teamID].roster do -- for every player on the player team - if teams[teamID].roster[k].elo then allyTeamOrderRank[allyTeamID] = allyTeamOrderRank[allyTeamID] + teams[teamID].roster[k].elo end - end - end - end - end - end - end - - -- find out which ally teams are dead - allyTeamsDead = {} - for i=1,#allyTeamsSorted do -- for every ally team - local allyTeamID = allyTeamsSorted[i] - allyTeamsDead[allyTeamID] = true - if allyTeams[allyTeamID] then - for j=1,#allyTeams[allyTeamID] do -- for every player team on the ally team - local teamID = allyTeams[allyTeamID][j] - if teams[teamID] and not (teams[teamID].isDead or not teams[teamID].isPlaying) then - allyTeamsDead[allyTeamID] = nil - end - end - end - end - - -- sort allyteams: own at top, others in order by total elo, dead teams at bottom - table.sort(allyTeamsSorted, function(a,b) - if allyTeamsDead[a] and not allyTeamsDead[b] then return false end - if allyTeamsDead[b] and not allyTeamsDead[a] then return true end - if allyTeamsDead[b] and allyTeamsDead[a] and allyTeams[a] and allyTeams[b] then - local teamIDa = allyTeams[a][1] - local teamIDb = allyTeams[b][1] - if teamIDa and teamIDb and teams[teamIDa].roster and teams[teamIDb].roster and teams[teamIDa].roster[1] and teams[teamIDb].roster[1] then - if teams[teamIDa].roster[1].isActive and not teams[teamIDb].roster[1].isActive then return true end - if teams[teamIDb].roster[1].isActive and not teams[teamIDa].roster[1].isActive then return false end - end - end - if localTeam ~= 0 or teamZeroPlayers[myID] then - if a == localAlliance then return true end - if b == localAlliance then return false end - end - return allyTeamOrderRank[a] > allyTeamOrderRank[b] - end - ) - - -- sort the specteam - table.sort(specTeam.roster, function(a,b) - return a.name:lower() < b.name:lower() - end) - - row = 0 - AddTableHeaders() - row = row + 1 - - -- add the team summaries - if cf then - AddAllAllyTeamSummaries(allyTeamsSorted) - row = row + 0.5 - elseif options.showSummaries.value then - if amSpec then - if existsVeryBigTeam or numBigTeams > 2 then - AddAllAllyTeamSummaries(allyTeamsSorted) - row = row + 0.5 - end - else - if myTeamIsVeryBig or cf then - AddAllAllyTeamSummaries({localTeam}) - row = row + 0.5 - end - end - end - - -- add the player entities - if list_size ~= 0 then - for i=1,#allyTeamsSorted do -- for every ally team - local allyTeamID = allyTeamsSorted[i] - if allyTeams[allyTeamID] and (list_size >= 3 or allyTeamID == localAlliance) then - --AddCfCheckbox(allyTeamID) - for j=1,#allyTeams[allyTeamID] do -- for every player team on the ally team - local teamID = allyTeams[allyTeamID][j] - if teams[teamID] and teams[teamID].roster and (list_size >= 2 or teamID == localTeam) then - for k=1,#teams[teamID].roster do -- for every player on the player team - AddEntity(teams[teamID].roster[k], teamID, allyTeamID) - end - end - end - if existsVeryBigTeam or numBigTeams > 1 then row = row + 0.35 end - end - end - end - - -- add the spectator entities - if list_size == 4 and #specTeam.roster ~= 0 then - teams[-1] = specTeam - allyTeams[-1] = {-1} - for k=1,#specTeam.roster do - AddEntity(specTeam.roster[k], -1, -1) - end - end - MakeSpecTooltip() - - AlignScrollPanel() -end - -SetupScrollPanel = function () - if scroll_cpl then scroll_cpl:Dispose() end - local scpl = { - parent = window_cpl, - --width = "100%", - --height = "100%", - backgroundColor = {1,1,1,options.backgroundOpacity.value}, - borderColor = {1,1,1,options.backgroundOpacity.value}, - padding = {0, 5, 0, 5}, - --autosize = true, - --right = 0, - scrollbarSize = 6, - width = x_bound, - horizontalScrollbar = false, - hitTestAllowEmpty = true, - noMouseWheel = not options.mousewheel.value, - } - if options.alignToLeft.value then - scpl.left = 0 - else - scpl.right = 0 - end - scroll_cpl = ScrollPanel:New(scpl) - SetupPlayerNames() -end - -SetupPanels = function () - - CalculateWidths() - local x,y,height,width - if window_cpl then - y = window_cpl.y - height = window_cpl.height - width = math.max(x_windowbound, lastChosenSizeX) - x = options.alignToLeft.value and window_cpl.x or (window_cpl.x + window_cpl.width - width) - window_cpl:Dispose() - else - x = screen0.width - x_windowbound - y = screen0.height - 150 - width = x_windowbound - height = 150 - end - lastSizeX = width - - window_cpl = Window:New{ - dockable = true, - name = "Player List", - color = {0,0,0,0}, - x = x, - y = y, - width = width, - height = height, - padding = {0, 0, 0, 0}; - parent = screen0, - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - minimizable = false, - minWidth = x_windowbound, - OnMouseDown={ function(self) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() - return true - end }, - } - - SetupScrollPanel() - -end - -function ToggleVisibility() - if window_cpl and scroll_cpl then - if options.visible.value then - window_cpl:AddChild(scroll_cpl) - else - window_cpl:RemoveChild(scroll_cpl) - end - end -end - -function PlayersChanged() - if amSpec then - SetupPlayerNames() - else - local _,_,amNowSpec = Spring.GetPlayerInfo(myID) - if amNowSpec then - amSpec = amNowSpec - SetupPanels() - else - SetupPlayerNames() - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Shutdown() - Spring.SendCommands({"info 1"}) -end - --- Part of an experiment to try to improve performance, will come back to it later --- local updateModulus = 8 --- local updateCount = 0 - -function widget:Update(s) - timer = timer + s - if timer > UPDATE_FREQUENCY then - timer = 0 - if (lastSizeX ~= window_cpl.width or lastSizeY ~= window_cpl.height) then --//if user resize the player-list - AlignScrollPanel() - lastChosenSizeX = window_cpl.width - lastSizeX = window_cpl.width - lastSizeY = window_cpl.height - else --- for i=updateCount+1,#playerTeamStatsCache,updateModulus do --- playerTeamStatsCache[i] = nil --- end --- updateCount = (updateCount + 1) % updateModulus - if (not scroll_cpl.parent) then return end --//don't update when window is hidden - UpdatePlayerInfo() - end - - end -end - -function widget:PlayerChanged(playerID) - PlayersChanged() -end - -function widget:PlayerAdded(playerID) - PlayersChanged() -end - -function widget:PlayerRemoved(playerID) - PlayersChanged() -end - -function widget:TeamDied(teamID) - PlayersChanged() -end - -function widget:TeamChanged(teamID) - PlayersChanged() -end - --- workaround for stupidity -function widget:GameStart() - SetupPanels() -end - ------------------------------------------------------------------------ --- we need both UnitCreated and UnitFinished because mobiles and static defense aren't treated the same >:< -function widget:UnitCreated(unitID, unitDefID, unitTeam) - local speed = UnitDefs[unitDefID].speed - local unarmed = UnitDefs[unitDefID].springCategories.unarmed - if (speed == nil or speed == 0) and not unarmed then -- is static-d - ProcessUnit(unitID, unitDefID, unitTeam) - end -end - -function widget:UnitFinished(unitID, unitDefID, unitTeam) - local speed = UnitDefs[unitDefID].speed - local unarmed = UnitDefs[unitDefID].springCategories.unarmed - if speed and speed ~= 0 and (not finishedUnits[unitID]) then -- mobile unit - ProcessUnit(unitID, unitDefID, unitTeam) - end -end - -function widget:UnitDestroyed(unitID, unitDefID, unitTeam) - local speed = UnitDefs[unitDefID].speed - local unarmed = UnitDefs[unitDefID].springCategories.unarmed - if speed and speed ~= 0 then -- mobile unit - if finishedUnits[unitID] then - ProcessUnit(unitID, unitDefID, unitTeam, true) - end - elseif not unarmed then -- static defense - ProcessUnit(unitID, unitDefID, unitTeam, true) - end -end - -function widget:UnitGiven(unitID, unitDefID, newTeamID, teamID) - -- doing this twice is a bit inefficient but bah - ProcessUnit(unitID, unitDefID, teamID, true) - ProcessUnit(unitID, unitDefID, newTeamID) -end - ------------------------------------------------------------------------ - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget() - return - end - - Chili = WG.Chili - Image = Chili.Image - Button = Chili.Button - Checkbox = Chili.Checkbox - Window = Chili.Window - ScrollPanel = Chili.ScrollPanel - StackPanel = Chili.StackPanel - Label = Chili.Label - screen0 = Chili.Screen0 - color2incolor = Chili.color2incolor - incolor2color = Chili.incolor2color - - green = color2incolor(0,1,0,1) - red = color2incolor(1,0,0,1) - orange = color2incolor(1,0.4,0,1) - yellow = color2incolor(1,1,0,1) - cyan = color2incolor(0,1,1,1) - white = color2incolor(1,1,1,1) - - SetupPanels() - - Spring.SendCommands({"info 0"}) - lastSizeX = window_cpl.width - lastSizeY = window_cpl.height - - self:LocalColorRegister() -end - -function widget:Shutdown() - self:LocalColorUnregister() -end - -function widget:LocalColorRegister() - if WG.LocalColor and WG.LocalColor.RegisterListener then - WG.LocalColor.RegisterListener(widget:GetInfo().name, SetupPlayerNames) - end -end - -function widget:LocalColorUnregister() - if WG.LocalColor and WG.LocalColor.UnregisterListener then - WG.LocalColor.UnregisterListener(widget:GetInfo().name) - end -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_chili_docking.lua b/LuaUI/Widgets_Evo/gui_chili_docking.lua deleted file mode 100644 index b6ce090bf..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_docking.lua +++ /dev/null @@ -1,395 +0,0 @@ -function widget:GetInfo() - return { - name = "Chili Docking", - desc = "Provides docking and position saving for chili windows", - author = "Licho", - date = "@2010", - license = "GNU GPL, v2 or later", - layer = 50, - experimental = false, - enabled = true -- loaded by default? - } -end - -local Chili -local Window -local screen0 - -local forceUpdate = false -options_path = 'Settings/HUD Panels/Docking' -options_order = { 'dockEnabled', 'dockThreshold', } -options = { - dockThreshold = { - name = "Docking distance", - type = 'number', - advanced = true, - value = 5, - min=1,max=50,step=1, - OnChange = {function() - forceUpdate = true - end }, - }, - - dockEnabled = { - name = 'Use docking', - advanced = false, - type = 'bool', - value = true, - desc = 'Dock windows to screen edges and each other to prevent overlaps', - }, -} - - - -local lastPos = {} -- "windows" indexed array of {x,y,x2,y2} -local settings = {} -- "window name" indexed array of {x,y,x2,y,2} -local buttons = {} -- "window name" indexed array of minimize buttons - - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget() - return - end - - -- setup Chili - Chili = WG.Chili - Window = Chili.Window - screen0 = Chili.Screen0 -end - -local frameCounter = 0 - - - --- returns snap orientation of box A compared to box B and distance of their edges - orientation = L/R/T/D and distance of snap -local function GetBoxRelation(boxa, boxb) - local mpah = 0 -- midposition a horizontal - local mpbh = 0 - local mpav = 0 - local mpbv = 0 - - local snaph, snapv - - if not (boxa[2] > boxb[4] or boxa[4] < boxb[2]) then -- "vertical collision" they are either to left or to right - mpah = (boxa[3] + boxa[1])/2 -- gets midpos - mpbh = (boxb[3] + boxb[1])/2 - snaph = true - end - - if not (boxa[1] > boxb[3] or boxa[3] screen0.width) then return end - if newAxis == 'R' and (winPos[1] + dist < 0 or winPos[3] + dist > screen0.width) then return end - if newAxis == 'T' and (winPos[2] - dist < 0 or winPos[4] - dist > screen0.height) then return end - if newAxis == 'D' and (winPos[2] + dist < 0 or winPos[4] + dist > screen0.height) then return end - minDist = dist - minAxis = newAxis - end - end - - CheckAxis(winPos[1], 'L') - CheckAxis(winPos[2], 'T') - CheckAxis(screen0.width - winPos[3], 'R') - CheckAxis(screen0.height - winPos[4], 'D') - if (minDist < dockDist and minDist ~= 0) then - return minAxis, minDist -- screen edges have priority ,dont check anything else - end - - for w, dp in pairs(dockWindows) do - if win ~= w then - local a, d = GetBoxRelation(winPos, dp) - if a ~= nil then - CheckAxis(d, a) - end - end - end - - - if minDist < dockDist and minDist ~= 0 then - return minAxis, minDist - else - return nil, nil - end -end - - --- snaps box data with axis and distance -local function SnapBox(wp, a,d) - if a == 'L' then - wp[1] = wp[1] - d - wp[3] = wp[3] - d - elseif a== 'R' then - wp[1] = wp[1] + d - wp[3] = wp[3] + d - elseif a== 'T' then - wp[2] = wp[2] - d - wp[4] = wp[4] - d - elseif a== 'D' then - wp[2] = wp[2] + d - wp[4] = wp[4] + d - end -end - - -local lastCount = 0 -local lastWidth = 0 -local lastHeight= 0 - -local function GetButtonPos(win) - local size = 5 -- button thickness - local mindist = win.x*5000 + win.height - local mode = 'L' - - local dist = win.y*5000 + win.width - if dist < mindist then - mindist = dist - mode = 'T' - end - - dist = (screen0.width - win.x - win.width)*5000 + win.height - if dist < mindist then - mindist = dist - mode = 'R' - end - - dist = (screen0.height - win.y - win.height)*5000 + win.width - if dist < mindist then - mindist = dist - mode = 'B' - end - - - if mode == 'L' then - return {x=win.x-3, y= win.y, width = size, height = win.height} - elseif mode =='T' then - return {x=win.x, y= win.y-3, width = win.width, height = size} - elseif mode =='R' then - return {x=win.x + win.width - size-3, y= win.y, width = size, height = win.height} - elseif mode=='B' then - return {x=win.x, y= win.y + win.height - size-3, width = win.width, height = size} - end -end - -function widget:DrawScreen() - frameCounter = frameCounter +1 - if (frameCounter % 88 ~= 87 and #screen0.children == lastCount) then return end - lastCount = #screen0.children - - local posChanged = false -- has position changed since last check - - if (screen0.width ~= lastWidth or screen0.height ~= lastHeight) then - forceUpdate = true - lastWidth = screen0.width - lastHeight = screen0.height - end - - local present = {} - local names = {} - for _, win in ipairs(screen0.children) do -- NEEDED FOR MINIMIZE BUTTONS: table.shallowcopy( - if (win.dockable) then - names[win.name] = win - present[win] = true - local lastWinPos = lastPos[win] - if lastWinPos==nil then -- new window appeared - posChanged = true - local settingsPos = settings[win.name] - if settingsPos ~= nil then -- and we have setings stored for new window, apply it - local w = settingsPos[3] - settingsPos[1] - local h = settingsPos[4] - settingsPos[2] - - if win.fixedRatio then - local limit = 0 - if (w > h) then limit = w else limit = h end - if (win.width > win.height) then - w = limit - h = limit*win.height/win.width - else - h = limit - w = limit*win.width/win.height - end - end - - if win.resizable or win.tweakResizable then - win:Resize(w, h, false, false) - end - win:SetPos(settingsPos[1], settingsPos[2]) - if not options.dockEnabled.value then - lastPos[win] = { win.x, win.y, win.x + win.width, win.y + win.height } - end - end - elseif lastWinPos[1] ~= win.x or lastWinPos[2] ~= win.y or lastWinPos[3] ~= win.x+win.width or lastWinPos[4] ~= win.y + win.height then -- window changed position - posChanged = true - end - end - end - - for win, _ in pairs(lastPos) do -- delete those not present atm - if not present[win] then lastPos[win] = nil end - end - - -- BUTTONS to minimize stuff - -- FIXME HACK use object:IsDescendantOf(screen0) from chili to detect visibility, not this silly hack stuff with button.winVisible - for name, win in pairs(names) do - if win.minimizable then - local button = buttons[name] - if not button then - button = Chili.Button:New{x = win.x, y = win.y; width=50; height=20; - caption='';dockable=false,winName = win.name, tooltip='Minimize ' .. win.name, backgroundColor={0,1,0,1}, - OnClick = { - function(self) - if button.winVisible then - win.hidden = true -- todo this is needed for minimap to hide self, remove when windows can detect if its on the sreen or not - button.tooltip = 'Expand ' .. button.winName - button.backgroundColor={1,0,0,1} - if not win.selfImplementedMinimizable then - screen0:RemoveChild(win) - else - win.selfImplementedMinimizable(false) - end - else - win.hidden = false - button.tooltip = 'Minimize ' .. button.winName - button.backgroundColor={0,1,0,1} - if not win.selfImplementedMinimizable then - screen0:AddChild(win) - else - win.selfImplementedMinimizable(true) - end - end - button.winVisible = not button.winVisible - end - } - } - screen0:AddChild(button) - button:BringToFront() - buttons[name] = button - end - local pos = GetButtonPos(win) - button:SetPos(pos.x,pos.y, pos.width, pos.height) - if not button.winVisible then - button.winVisible = true - win.hidden = false - button.tooltip = 'Minimize ' .. button.winName - button.backgroundColor={0,1,0,1} - button:Invalidate() - end - end - end - - for name, button in pairs(buttons) do - if not names[name] and button.winVisible then -- widget hid externally - button.winVisible = false - button.tooltip = 'Expand ' .. button.winName - button.backgroundColor={1,0,0,1} - button:Invalidate() - end - end - - - if forceUpdate or (posChanged and options.dockEnabled.value) then - forceUpdate = false - local dockWindows = {} -- make work array of windows - for _, win in ipairs(screen0.children) do - local dock = win.collide or win.dockable - if (dock) then - dockWindows[win] = {win.x, win.y, win.x + win.width, win.y + win.height} - end - end - - -- dock windows - local mc = 2 - repeat - for win, wp in pairs(dockWindows) do - local numTries = 5 - repeat - --Spring.Echo("box "..wp[1].. " " ..wp[2] .. " " ..wp[3] .. " " .. wp[4]) - local a,d = GetClosestAxis(wp,dockWindows, win) - if a~=nil then - SnapBox(wp,a,d) - --Spring.Echo("snap "..a .. " " ..d) - end - numTries = numTries - 1 - until a == nil or numTries == 0 - - win:SetPos(wp[1], wp[2]) - local winPos = { win.x, win.y, win.x + win.width, win.y + win.height } - lastPos[win] = winPos - settings[win.name] = winPos - end - - mc = mc -1 - until mc == 0 - - end -end - - - - -function widget:ViewResize(vsx, vsy) - scrW = vsx - scrH = vsy -end - - - - -function widget:SetConfigData(data) - settings = data -end - -function widget:GetConfigData() - return settings -end - - diff --git a/LuaUI/Widgets_Evo/gui_chili_endgraph.lua b/LuaUI/Widgets_Evo/gui_chili_endgraph.lua index 70522171b..420e05c4f 100644 --- a/LuaUI/Widgets_Evo/gui_chili_endgraph.lua +++ b/LuaUI/Widgets_Evo/gui_chili_endgraph.lua @@ -492,19 +492,19 @@ function loadWindow() if WG.BarMenu then WG.BarMenu.AddControl('Graph', control0) else - Chili.Button:New{ - parent = control0, - caption = 'Quit', - right = 0, - y = 0, - width = 50, - height = 25, - OnMouseUp = { - function() - Spring.SendCommands{'quit'} - end - }, - } + -- Chili.Button:New{ + -- parent = control0, + -- caption = 'Quit', + -- right = 0, + -- y = 0, + -- width = 50, + -- height = 25, + -- OnMouseUp = { + -- function() + -- Spring.SendCommands{'QuitForce'} + -- end + -- }, + -- } Chili.Window:New{ parent = Chili.Screen0, x = '20%', diff --git a/LuaUI/Widgets_Evo/gui_chili_integral_menu.lua b/LuaUI/Widgets_Evo/gui_chili_integral_menu.lua deleted file mode 100644 index d57c5c0b4..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_integral_menu.lua +++ /dev/null @@ -1,1496 +0,0 @@ --- TODO: commandschanged gets called 2x for some reason, investigate --- TODO: proper tooltips for queue buttons - -function widget:GetInfo() - return { - name = "Chili Integral Menu", - desc = "v0.36 Integral Command Menu", - author = "Licho, KingRaptor, Google Frog", - date = "12.10.2010", - license = "GNU GPL, v2 or later", - layer = math.huge-1, - enabled = true, - handler = true, - } -end - -include("keysym.h.lua") ---[[ -for i,v in pairs(KEYSYMS) do - Spring.Echo(i.."\t"..v) -end ---]] ---[[ -HOW IT WORKS: - Main window (invisible) is parent of a fake window. - Tabs are buttons in main window, just above fake window. - Currently selected tab is highlighted, when tab is changed all tabs are removed and regenerated. - - Two parent Panels (children of fake window), a column for normal commands and a row for state commands. - (or ) StackPanels are nested in each of the parents, at right angles. - When sorting commands, it splits commands into batches of and assigns them to children - so if there are 10 commands, it puts 6 in first row and 4 in second row - Build orders work a little differently, they have a predefined row in the config. - Ditto for states, except it uses MAX_STATE_ROWS - - If unit tab is selected and third command row is free, build queue of first selected factory found in array returned by SelectionChanged is displayed. - The queue shows up to batches of units and their exact sequence. - - All items resize with main window. - -NOTE FOR OTHER GAME DEVS: - ZK uses WG.GetBuildIconFrame to draw the unit type border around buildpics. - If you're not using them (likely), remove all lines containing that function. ---]] - ------------------------- --- CONFIG ------------------------- ------------------------- -options_path = 'Settings/HUD Panels/Integral Menu' -options_order = { 'disablesmartselect', 'hidetabs', 'unitstabhotkey', 'unitshotkeyrequiremeta', 'unitshotkeyaltaswell', 'tab_factory', 'tab_economy', 'tab_defence', 'tab_special' } -options = { - disablesmartselect = { - name = 'Disable Smart Tab Select', - type = 'bool', - value = false, - }, - hidetabs = { - name = 'Hide Tab Row', - type = 'bool', - advanced = true, - value = false, - }, - unitstabhotkey = { - name = 'Hotkey for Units tab', - type = 'bool', - value = true, - }, - unitshotkeyrequiremeta = { - name = 'Units tab hotkeys require Meta', - type = 'bool', - value = true, - }, - unitshotkeyaltaswell = { - name = 'Units tab can use Alt as Meta', - type = 'bool', - value = false, - }, - tab_factory = { - name = "Factory Tab", - desc = "Switches to factory tab, enables grid hotkeys", - type = 'button', - }, - tab_economy = { - name = "Economy Tab", - desc = "Switches to economy tab, enables grid hotkeys", - type = 'button', - }, - tab_defence = { - name = "Defence Tab", - desc = "Switches to defence tab, enables grid hotkeys", - type = 'button', - }, - tab_special = { - name = "Special Tab", - desc = "Switches to special tab, enables grid hotkeys", - type = 'button', - }, -} - - ------------------------- ---speedups -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitHealth = Spring.GetUnitHealth -local spGetFullBuildQueue = Spring.GetFullBuildQueue -local spGetUnitIsBuilding = Spring.GetUnitIsBuilding - -local push = table.insert - -local CMD_PAGES = 60 - -local common_commands, states_commands, factory_commands, econ_commands, defense_commands, special_commands, globalCommands, overrides, custom_cmd_actions = include("Configs/integral_menu_commands.lua") - -local function CapCase(str) - local str = str:lower() - str = str:gsub( '_', ' ' ) - str = str:sub(1,1):upper() .. str:sub(2) - - str = str:gsub( ' (.)', - function(x) return (' ' .. x):upper(); end - ) - return str -end - -local function AddHotkeyOptions() - local options_order_tmp_cmd = {} - local options_order_tmp_cmd_instant = {} - local options_order_tmp_states = {} - for cmdname, number in pairs(custom_cmd_actions) do - - local cmdnamel = cmdname:lower() - local cmdname_disp = CapCase(cmdname) - options[cmdnamel] = { - name = cmdname_disp, - type = 'button', - action = cmdnamel, - path = 'Game/Commands', - } - if number == 2 then - options_order_tmp_states[#options_order_tmp_states+1] = cmdnamel - --options[cmdnamel].isUnitStateCommand = true - elseif number == 3 then - options_order_tmp_cmd_instant[#options_order_tmp_cmd_instant+1] = cmdnamel - --options[cmdnamel].isUnitInstantCommand = true - else - options_order_tmp_cmd[#options_order_tmp_cmd+1] = cmdnamel - --options[cmdnamel].isUnitCommand = true - end - end - - options.lblcmd = { type='label', name='Targeted Commands', path = 'Game/Commands',} - options.lblcmdinstant = { type='label', name='Instant Commands', path = 'Game/Commands',} - options.lblstate = { type='label', name='State Commands', path = 'Game/Commands',} - - - table.sort(options_order_tmp_cmd) - table.sort(options_order_tmp_cmd_instant) - table.sort(options_order_tmp_states) - - options_order[#options_order+1] = 'lblcmd' - for i=1, #options_order_tmp_cmd do - options_order[#options_order+1] = options_order_tmp_cmd[i] - end - - options_order[#options_order+1] = 'lblcmdinstant' - for i=1, #options_order_tmp_cmd_instant do - options_order[#options_order+1] = options_order_tmp_cmd_instant[i] - end - - options_order[#options_order+1] = 'lblstate' - for i=1, #options_order_tmp_states do - options_order[#options_order+1] = options_order_tmp_states[i] - end -end - -AddHotkeyOptions() - - -local MAX_COLUMNS = 6 -local MAX_STATE_ROWS = 5 -local MIN_HEIGHT = 150 -local MIN_WIDTH = 300 -local COMMAND_SECTION_WIDTH = 74 -- percent -local STATE_SECTION_WIDTH = 24 -- percent - -local numRows = 3 -local numStateColumns = 3 - -local forceUpdateFrequency = 0.2 -- seconds - -local selectedFac -- unitID -local alreadyRemovedTag = {} - -local hotkeyMode = false -local recentlyInitialized = false - -local gridKeyMap = { - [KEYSYMS.Q] = {1,1}, - [KEYSYMS.W] = {1,2}, - [KEYSYMS.E] = {1,3}, - [KEYSYMS.R] = {1,4}, - [KEYSYMS.T] = {1,5}, - [KEYSYMS.Y] = {1,6}, - [KEYSYMS.A] = {2,1}, - [KEYSYMS.S] = {2,2}, - [KEYSYMS.D] = {2,3}, - [KEYSYMS.F] = {2,4}, - [KEYSYMS.G] = {2,5}, - [KEYSYMS.H] = {2,6}, - [KEYSYMS.Z] = {3,1}, - [KEYSYMS.X] = {3,2}, - [KEYSYMS.C] = {3,3}, - [KEYSYMS.V] = {3,4}, - [KEYSYMS.B] = {3,5}, - [KEYSYMS.N] = {3,6}, -} - -local gridMap = { - [1] = { - [1] = "Q", - [2] = "W", - [3] = "E", - [4] = "R", - [5] = "T", - [6] = "Y", - }, - [2] = { - [1] = "A", - [2] = "S", - [3] = "D", - [4] = "F", - [5] = "G", - [6] = "H", - }, - [3] = { - [1] = "Z", - [2] = "X", - [3] = "C", - [4] = "V", - [5] = "B", - [6] = "N", - }, -} - --- Chili classes -local Chili -local Button -local Label -local Colorbars -local Checkbox -local Window -local Panel -local StackPanel -local TextBox -local Image -local Progressbar -local Control - --- Chili instances -local screen0 -local window --main window (invisible) -local fakewindow --visible Panel -local menuTabRow --parent row of tabs -local menuTabs = {} --buttons -local commands_main --parent column of command buttons -local sp_commands = {} --buttons -local states_main --parent row of state buttons -local sp_states = {} --buttons -local buildRow --row of build queue buttons -local buildRowButtons = {} --contains arrays indexed by number 1 to MAX_COLUMNS, each of which contains three subobjects: button, label and image -local buildProgress --Progressbar, child of buildRowButtons[1].image; updates every gameframe - -local buildRow_visible = false -local buildQueue = {} --build order table of selectedFac -local buildQueueUnsorted = {} --puts all units of same type into single index; thus no sequence - -local gridLocation = {} - --- arrays with commands to be displayed -local n_common = {} -local n_factories = {} -local n_econ = {} -local n_defense = {} -local n_special = {} -local n_units = {} -local n_states = {} - ---shortcuts -local menuChoices = { - [1] = { array = n_common, name = "Order", hotkeyName = "Order" }, - [2] = { array = n_factories, name = "Factory", hotkeyName = "Factory", config = factory_commands, actionName = "epic_chili_integral_menu_tab_factory" }, - [3] = { array = n_econ, name = "Econ", hotkeyName = "Econ", config = econ_commands, actionName = "epic_chili_integral_menu_tab_economy" }, - [4] = { array = n_defense, name = "Defense", hotkeyName = "Defense", config = defense_commands, actionName = "epic_chili_integral_menu_tab_defence" }, - [5] = { array = n_special, name = "Special", hotkeyName = "Special", config = special_commands, actionName = "epic_chili_integral_menu_tab_special" }, - [6] = { array = n_units, name = "Units", hotkeyName = "Units" }, -} - -local menuChoice = 1 -local lastBuildChoice = 2 - --- command id indexed field of items - each item is button, label and image -local commandButtons = {} ------------------------------------ COMMAND COLORS - from cmdcolors.txt - default coloring -local cmdColors = {} - --- default config -local config = { -} - - ------------------------- --- FUNCTIONS ------------------------- --- this gets invoked when button is clicked -local function ClickFunc(button) - local _,_,left,_,right = Spring.GetMouseState() - local alt,ctrl,meta,shift = Spring.GetModKeyState() - local index = Spring.GetCmdDescIndex(button.cmdid) - if (left) then - Spring.SetActiveCommand(index,1,left,right,alt,ctrl,meta,shift) - end - if (right) then - Spring.SetActiveCommand(index,3,left,right,alt,ctrl,meta,shift) - end -end - ------------------------- --- Generates or updates chili button - either image or text or both based - container is parent of button, cmd is command desc structure ------------------------- -local function MakeButton(container, cmd, insertItem, index) - local isState = (cmd.type == CMDTYPE.ICON_MODE and #cmd.params > 1) or states_commands[cmd.id] --is command a state toggle command? - local isBuild = (cmd.id < 0) - local gridHotkeyed = not isState and menuChoice ~= 1 and menuChoice ~= 6 - local text - local texture - local countText = '' - local tooltip = cmd.tooltip - - local myTeamID = Spring.GetMyTeamID() - local disableString = "disallowed_" .. (-cmd.id) - local disabled = cmd.disabled or (Spring.GetTeamRulesParam(myTeamID, disableString) == 1) - - local te = overrides[cmd.id] -- command overrides - - -- text - if te and te.text then - text = te.text - elseif isState then - text = cmd.params[cmd.params[1]+2] - elseif isBuild then - text = '' - else - text = cmd.name - end - - local hotkey = cmd.action and WG.crude.GetHotkey(cmd.action) or '' - - if (options.unitstabhotkey.value and menuChoice == 6 and selectedFac and container.i_am_sp_commands) then - if options.unitshotkeyrequiremeta.value then - local alt,ctrl,meta,shift = Spring.GetModKeyState() - if meta or (alt and options.unitshotkeyaltaswell.value) then - hotkey = gridMap[container.index][index] or '' - end - else - hotkey = gridMap[container.index][index] or '' - end - end - if gridHotkeyed and hotkeyMode then - hotkey = gridMap[container.index][index] or '' - end - - if not isState and hotkey ~= '' then - text = '\255\0\255\0' .. hotkey - end - - --count label (for factory build options) - if menuChoice == 6 and isBuild and buildQueueUnsorted[-cmd.id] then - countText = tostring(buildQueueUnsorted[-cmd.id]) - end - - --texture - if te ~= nil and te.texture then - if (isState) then - texture = te.texture[cmd.params[1]+1] - else - texture = te.texture - end - elseif isBuild then - texture = '#'..-cmd.id - else - texture = cmd.texture - end - - -- tooltip - if te and te.tooltip then - tooltip = te.tooltip - else - tooltip = cmd.tooltip - end - if isBuild and selectedFac then - local ud = UnitDefs[-cmd.id] - tooltip = "Build Unit: " .. ud.humanName .. " - " .. ud.tooltip .. "\n" -- for special options - end - - if hotkey ~= '' then - tooltip = tooltip .. ' (\255\0\255\0' .. hotkey .. '\008)' - end - - -- get cached menu item - local item = commandButtons[cmd.id] - if not item then -- no item, create one - if not insertItem then - Spring.SendMessage("CommandBar - internal error, unexpectedly adding item!") - end - -- decide color ---[[ local color = {1,1,1,1} - if te ~= nil and te.color ~= nil then - color = te.color - elseif cmd.name ~= nil then - local nl = cmd.name:lower() - if cmdColors[nl] then - color = cmdColors[nl] - color[4] = color[4] + 0.2 - end - end]] - - local button = Button:New { - parent=container; - padding = {5, 5, 5, 5}, - margin = {0, 0, 0, 0}, - caption=""; - isDisabled = disabled; - tooltip = tooltip; - cmdid = cmd.id; - OnMouseDown = {ClickFunc} --activate the clicked command - } - if cmd.OnClick then - button.OnMouseDown = cmd.OnClick - end - if (isState) then - button.padding = {4,4,2.5,2} --- button.backgroundColor = {0,0,0,0} - end - if (isBuild) then - button.padding = {1,1,1,1} - end - - local label - if (not cmd.onlyTexture and text and text ~= '') or gridHotkeyed or menuChoice == 6 then - label = Label:New { - width="100%"; - height="100%"; - autosize=false; - align="left"; - valign="top"; - caption = text; - fontSize = 11; - fontShadow = true; - parent = button; - } - end - - local image - if (texture and texture ~= "") then - image= Image:New { - width="90%"; - height= (not isBuild) and nil or "90%"; - bottom = (isBuild) and 10 or nil; - y="5%"; - x="5%"; --- color = color; - keepAspect = not isBuild, --true, --isState; - file = texture; - parent = button; - } - if isBuild then - image.file2 = WG.GetBuildIconFrame(UnitDefs[-cmd.id]) - end - - if isState then - height = "100%" - y = 0 - end - else - if label~=nil then label.valign="center" end - end - - local countLabel - if isBuild then - countLabel = Label:New { - parent = image, - autosize=false; - width="100%"; - height="100%"; - align="right"; - valign="bottom"; - caption = countText; - fontSize = 16; - fontShadow = true; - } - local costLabel = Label:New { - parent = button, - right = 0; - y = 0; - x = 3; - bottom = 3; - autosize=false; - align="left"; - valign="bottom"; - caption = string.format("%d m", UnitDefs[-cmd.id].metalCost); - fontSize = 11; - fontShadow = true; - } - end - - - --if button is disabled, set effect accordingly - if button.isDisabled then - button.backgroundColor = {0,0,0,1}; - image.color = {0.3, 0.3, 0.3, 1} - end - - item = { - button = button, - image = image, - label = label, - countLabel = countLabel, - } - commandButtons[cmd.id] = item - else - if insertItem then - container:AddChild(item.button) - end - end - - -- update item if something changed - if (disabled ~= item.button.isDisabled) then - if disabled then - item.button.backgroundColor = {0,0,0,1}; - item.image.color = {0.3, 0.3, 0.3, 1} - else - item.button.backgroundColor = {1,1,1,0.7}; - item.image.color = {1, 1, 1, 1} - end - item.button:Invalidate() - item.image:Invalidate() - item.button.isDisabled = disabled - end - - if (not cmd.onlyTexture and item.label and text ~= item.label.caption) then - item.label:SetCaption(text) - end - - if (item.countLabel and countText ~= item.countLabel.caption) then - item.countLabel:SetCaption(countText) - end - - if (item.image and (texture ~= item.image.file or isState) ) then - item.image.file = texture - item.image:Invalidate() - end - - if (item.button.tooltip and tooltip ~= item.button.tooltip) then - item.button.tooltip = tooltip - end -end - ---sorts commands into categories -local function ProcessCommand(cmd) - if not cmd.hidden and cmd.id ~= CMD_PAGES then - -- state icons - if (cmd.type == CMDTYPE.ICON_MODE and cmd.params ~= nil and #cmd.params > 1) then - n_states[#n_states+1] = cmd - elseif common_commands[cmd.id] then - n_common[#n_common+1] = cmd - elseif factory_commands[cmd.id] then - n_factories[#n_factories+1] = cmd - elseif econ_commands[cmd.id] then - n_econ[#n_econ+1] = cmd - elseif defense_commands[cmd.id] then - n_defense[#n_defense+1] = cmd - elseif special_commands[cmd.id] then - n_special[#n_special+1] = cmd - elseif UnitDefs[-(cmd.id)] then - n_units[#n_units+1] = cmd - else - n_common[#n_common+1] = cmd --shove unclassified stuff in common - end - end -end - -local function RemoveChildren(container) - for i = 1, #container.children do - container:RemoveChild(container.children[1]) - end -end - --- compared real chili container with new commands and update accordingly -local function UpdateContainer(container, nl, columns) - if not columns then columns = MAX_COLUMNS end - local cnt = 0 - local needUpdate = false - local dif = {} - for i =1, #container.children do - if container.children[i].isEmpty then - break - end - cnt = cnt + 1 - dif[container.children[i].cmdid] = true - end - - if cnt ~= #nl then -- different counts, we update fully - needUpdate = true - else -- check if some items are different - for i=1, #nl do - dif[nl[i].id] = nil - end - - for _, _ in pairs(dif) do -- different item found, we do full update - needUpdate = true - break - end - end - - if needUpdate then - RemoveChildren(container) - for i=1, #nl do - MakeButton(container, nl[i], true, i) - end - for i = 1, columns - #container.children do - Control:New { - isEmpty = true, - parent = container - } - end - else - for i=1, #nl do - MakeButton(container, nl[i], false, i) - end - end -end - -local function BuildRowButtonFunc(num, cmdid, left, right) - buildQueue = spGetFullBuildQueue(selectedFac) - local alt,ctrl,meta,shift = Spring.GetModKeyState() - local pos = 1 - local numInput = 1 --number of times to send the order - - local function BooleanMult(int, bool) - if bool then return int - else return 0 end - end - - --Spring.Echo(CMD.OPT_META) = 4 - --Spring.Echo(CMD.OPT_RIGHT) = 16 - --Spring.Echo(CMD.OPT_SHIFT) = 32 - --Spring.Echo(CMD.OPT_CTRL) = 64 - --Spring.Echo(CMD.OPT_ALT) = 128 - - --it's not using the options, even though it's receiving them correctly - --so we have to do it manually - if shift then numInput = numInput * 5 end - if ctrl then numInput = numInput * 20 end - - --local options = BooleanMult(CMD.OPT_SHIFT, shift) + BooleanMult(CMD.OPT_ALT, alt) + BooleanMult(CMD.OPT_CTRL, ctrl) + BooleanMult(CMD.OPT_META, meta) + BooleanMult(CMD.OPT_RIGHT, right) - - --insertion position is by unit rather than batch, so we need to add up all the units in front of us to get the queue - - for i=1,num-1 do - for _,units in pairs(buildQueue[i]) do - pos = pos + units - end - end - - -- skip over the commands with an id of 0, left behind by removal - local commands = Spring.GetFactoryCommands(selectedFac) - local i = 1 - while i <= pos do - if commands[i].id == 0 then - pos = pos + 1 - end - i = i + 1 - end - - --Spring.Echo(cmdid) - if not right then - for i = 1, numInput do - Spring.GiveOrderToUnit(selectedFac, CMD.INSERT, {pos, cmdid, 0 }, {"alt", "ctrl"}) - end - else - -- delete from back so that the order is not canceled while under construction - local i = 0 - while commands[i+pos] and commands[i+pos].id == cmdid and not alreadyRemovedTag[commands[i+pos].tag] do - i = i + 1 - end - i = i - 1 - j = 0 - while commands[i+pos] and commands[i+pos].id == cmdid and j < numInput do - Spring.GiveOrderToUnit(selectedFac, CMD.REMOVE, {commands[i+pos].tag}, {"ctrl"}) - alreadyRemovedTag[commands[i+pos].tag] = true - j = j + 1 - i = i - 1 - end - end -end - -local function UpdateFactoryBuildQueue() - buildQueue = spGetFullBuildQueue(selectedFac) - buildQueueUnsorted = {} - for i=1, #buildQueue do - for udid, count in pairs(buildQueue[i]) do - buildQueueUnsorted[udid] = (buildQueueUnsorted[udid] or 0) + count - --Spring.Echo(udid .. "\t" .. buildQueueUnsorted[udid]) - end - end -end - ---uses its own function for more fine control -local function ManageBuildRow() - --if (menuChoice ~= 6) or (not buildRow_visible) or (not selectedFac) then return end - local overrun = false - RemoveChildren(buildRow) - if buildQueue[MAX_COLUMNS + 1] then - overrun = true - end - - for i=1, MAX_COLUMNS do - local buttonArray = buildRowButtons[i] - if buttonArray.button then - RemoveChildren(buttonArray.button) - end - if buildQueue[i] then --adds button for queued unit - local udid, count, caption - for id, num in pairs(buildQueue[i]) do - udid = id - count = num - break - end - buildRowButtons[i].cmdid = -udid - if overrun and i == MAX_COLUMNS then - caption = tostring(#buildQueue - MAX_COLUMNS + 1) - elseif count > 1 then caption = tostring(count) - else caption = '' end - buttonArray.button = Button:New{ - parent = buildRow; - x = (i-1)*(100/MAX_COLUMNS).."%", - y = 0, - width = (100/MAX_COLUMNS).."%", - height = "100%", - --caption = '', - OnMouseDown = { function () - local _,_,left,_,right = Spring.GetMouseState() - BuildRowButtonFunc(i, buildRowButtons[i].cmdid, left, right) - end}, - padding = {1,1,1,1}, - --keepAspect = true, - } - if overrun and i == MAX_COLUMNS then - buttonArray.button.caption = '...' - buttonArray.button.OnMouseDown = nil - end - buttonArray.button.backgroundColor[4] = 0.3 - - if not (overrun and i == MAX_COLUMNS) then - buttonArray.button.tooltip = 'Add to/subtract from queued batch' - buttonArray.image = Image:New { - parent = buttonArray.button, - width="90%"; - height="90%"; - x="5%"; - y="5%"; - file = '#'..udid, - file2 = WG.GetBuildIconFrame(UnitDefs[udid]), - keepAspect = false, - } - buttonArray.label = Label:New { - parent = buttonArray.image, - width="100%"; - height="100%"; - autosize=false; - --x = "70%", - --y = "70%", - align="right"; - valign="bottom"; - --caption = caption; - fontSize = 16; - fontShadow = true; - } - buttonArray.label:SetCaption(caption) -- do it here as workaround for vanishing text - end - - if i == 1 then - buttonArray.image:AddChild(buildProgress) - --Spring.Echo("Adding build progress bar") - end - end - end -end - ---these two functions place the items into their rows -local function ManageStateIcons() - local stateCols = { } - for i=1, numStateColumns do - stateCols[i] = {} - for v=(MAX_STATE_ROWS * (i-1)) + 1, (MAX_STATE_ROWS*i) do - stateCols[i][v - MAX_STATE_ROWS*(i-1)] = n_states[v] - end - end - for i=1, numStateColumns do - UpdateContainer(sp_states[i], stateCols[i], MAX_STATE_ROWS) - end -end - -local function ManageCommandIcons(useRowSort) - local sourceArray = menuChoices[menuChoice].array - local configArray = menuChoices[menuChoice].config - --update factory data - if menuChoice == 6 and selectedFac then - UpdateFactoryBuildQueue() - end - local commandRows = { } - --most commands don't use row sorting; econ, defense and special do - if not useRowSort then - for i=1, numRows do - commandRows[i] = {} - for v=(MAX_COLUMNS * (i-1)) + 1, (MAX_COLUMNS*i) do - commandRows[i][v - MAX_COLUMNS*(i-1)] = sourceArray[v] - end - end - else - for i=1, numRows do - commandRows[i] = {} - for v=1,#sourceArray do - if configArray[sourceArray[v].id].row == i then - commandRows[i][#commandRows[i]+1] = sourceArray[v] - end - end - end - end - for i=1, numRows do - UpdateContainer(sp_commands[i], commandRows[i], MAX_COLUMNS) - end - - --manage factory queue if needed - if menuChoice == 6 and selectedFac and #commandRows[numRows] == 0 then - if not buildRow_visible then - commands_main:AddChild(buildRow) - buildRow_visible = true - end - ManageBuildRow() - else - commands_main:RemoveChild(buildRow) - buildRow_visible = false - end -end - -local function Update(buttonpush) - local commands = widgetHandler.commands - local customCommands = widgetHandler.customCommands - --most commands don't use row sorting; econ, defense and special do - local useRowSort = (menuChoice == 3 or menuChoice == 4 or menuChoice == 5) - - if menuChoice == 1 then - hotkeyMode = false - end - - --if (#commands + #customCommands == 0) then - ---screen0:RemoveChild(window); - --window_visible = false; - -- return - --else - --if not window_visible then - --screen0:AddChild(window); - --window_visible = true; - --end - --end - - n_common = {} - n_factories = {} - n_econ = {} - n_defense = {} - n_special = {} - n_units = {} - n_states = {} - - --Spring.Echo(#commands) - for i = 1, #commands do ProcessCommand(commands[i]) end - for i = 1, #customCommands do ProcessCommand(customCommands[i]) end - for i = 1, #globalCommands do ProcessCommand(globalCommands[i]) end - - menuChoices[1].array = n_common - menuChoices[2].array = n_factories - menuChoices[3].array = n_econ - menuChoices[4].array = n_defense - menuChoices[5].array = n_special - menuChoices[6].array = n_units - - --[[ - local function Sort(a, b, array) - return array[a.id] < array[b.id] - end - - table.sort(n_factories, Sort(a,b, factory_commands)) - table.sort(n_econ, Sort(a,b, econ_commands)) - table.sort(n_defense, Sort(a,b, defense_commands)) - ]]-- - - --sorting isn't strictly needed, it uses the same order as listed in buildoptions - table.sort(n_factories, function(a,b) return factory_commands[a.id].order < factory_commands[b.id].order end ) - table.sort(n_econ, function(a,b) return econ_commands[a.id].order < econ_commands[b.id].order end) - table.sort(n_defense, function(a,b) return defense_commands[a.id].order < defense_commands[b.id].order end) - table.sort(n_special, function(a,b) return special_commands[a.id].order < special_commands[b.id].order end) - - ManageStateIcons() - ManageCommandIcons(useRowSort) -end - -local function MakeMenuTab(i, alpha) - local button = Button:New{ - parent = menuTabRow; - y = 0, - height = "100%", --- font = { --- shadow = true --- }, - - caption = hotkeyMode and menuChoices[i].name or menuChoices[i].hotkeyName, - OnClick = { - function() - menuChoice = i - if i >= 2 and i <= 5 then lastBuildChoice = i end - Update(true) - ColorTabs(i) - end - }, - } - button.backgroundColor[4] = alpha or 1 - return button -end - ---need to recreate the tabs completely because chili is dumb ---also needs to be non-local so MakeMenuTab can call it -function ColorTabs(arg) - arg = arg or menuChoice - RemoveChildren(menuTabRow) - for i=1,6 do - if i == arg then - menuTabs[arg] = MakeMenuTab(arg, 1) - else - menuTabs[i] = MakeMenuTab(i, 0.4) - end - end -end - -local function SmartTabSelect() - Update() - if options.hidetabs.value then - menuChoice = 1 - ColorTabs(1) - elseif options.disablesmartselect.value then - return - elseif #n_units > 0 and #n_econ == 0 then - menuChoice = 6 --selected factory, jump to units - ColorTabs(6) - elseif #n_econ > 0 and menuChoice == 6 then - menuChoice = lastBuildChoice --selected non-fac and in units menu, jump to last build menu - ColorTabs(lastBuildChoice) - elseif #n_factories + #n_econ + #n_defense + #n_units == 0 then - menuChoice = 1 --selected non-builder, jump to common - ColorTabs(1) - end -end - -local function CopyTable(outtable,intable) - for i,v in pairs(intable) do - if (type(v)=='table') then - if (type(outtable[i])~='table') then outtable[i] = {} end - CopyTable(outtable[i],v) - else - outtable[i] = v - end - end -end - --- force update every 0.2 seconds ---[[ -local timer = 0 -function widget:Update(dt) - timer = timer + dt - if timer >= forceUpdateFrequency then - Update() - timer = 0 - end -end -]]-- --- layout handler - its needed for custom commands to work and to delete normal spring menu -local function LayoutHandler(xIcons, yIcons, cmdCount, commands) - widgetHandler.commands = commands - widgetHandler.commands.n = cmdCount - widgetHandler:CommandsChanged() - local reParamsCmds = {} - local customCmds = {} - - local cnt = 0 - - local AddCommand = function(command) - local cc = {} - CopyTable(cc,command ) - cnt = cnt + 1 - cc.cmdDescID = cmdCount+cnt - if (cc.params) then - if (not cc.actions) then --// workaround for params - local params = cc.params - for i=1,#params+1 do - params[i-1] = params[i] - end - cc.actions = params - end - reParamsCmds[cc.cmdDescID] = cc.params - end - --// remove api keys (custom keys are prohibited in the engine handler) - cc.pos = nil - cc.cmdDescID = nil - cc.params = nil - - customCmds[#customCmds+1] = cc - end - - - --// preprocess the Custom Commands - for i=1,#widgetHandler.customCommands do - AddCommand(widgetHandler.customCommands[i]) - end - - for i=1,#globalCommands do - AddCommand(globalCommands[i]) - end - - Update() - return "", xIcons, yIcons, {}, customCmds, {}, {}, {}, {}, reParamsCmds, {[1337]=9001} -end - -local function ScrollTabRight() - menuChoice = menuChoice + 1 - if menuChoice > #menuChoices then menuChoice = 1 end - if menuChoice >= 2 and menuChoice <= 5 then lastBuildChoice = menuChoice end - Update(true) - ColorTabs() -end - -local function ScrollTabLeft() - menuChoice = menuChoice - 1 - if menuChoice < 1 then menuChoice = #menuChoices end - if menuChoice >= 2 and menuChoice <= 5 then lastBuildChoice = menuChoice end - Update(true) - ColorTabs() -end - --------------------------------------- --- Hotkey Mode - -function widget:KeyPress(key, modifier, isRepeat) - if (hotkeyMode) and not isRepeat then - local thingsDone = false - local pos = gridKeyMap[key] - if pos and sp_commands[pos[1]] and sp_commands[pos[1]].children[pos[2]] then - local cmdid = sp_commands[pos[1]].children[pos[2]] - if cmdid then - cmdid = cmdid.cmdid - if cmdid then - local index = Spring.GetCmdDescIndex(cmdid) - if index then - Spring.SetActiveCommand(index,1,true,false,false,false,false,false) - thingsDone = true - end - end - end - end - hotkeyMode = false - menuChoice = 1 -- auto-return to orders to make it clear hotkey time is over - Update(true) - ColorTabs() - return thingsDone - elseif menuChoice == 6 and options.unitstabhotkey.value and selectedFac then - local pos = gridKeyMap[key] - if pos and pos[1] ~= 3 and sp_commands[pos[1]] and sp_commands[pos[1]].children[pos[2]] then - local cmdid = sp_commands[pos[1]].children[pos[2]] - if cmdid then - cmdid = cmdid.cmdid - if cmdid then - local index = Spring.GetCmdDescIndex(cmdid) - if index then - local alt,ctrl,meta,shift = Spring.GetModKeyState() - if (meta or (alt and options.unitshotkeyaltaswell.value) or not options.unitshotkeyrequiremeta.value) and not ctrl then - local opts = 0 - if alt then - opts = opts + CMD.OPT_ALT - end - if shift then - opts = opts + CMD.OPT_SHIFT - end - Spring.GiveOrderToUnit(selectedFac, cmdid, {0}, opts) - if WG.sounds_gaveOrderToUnit then - WG.sounds_gaveOrderToUnit(selectedFac, true) - end - -- does not work with meta held - --Spring.SetActiveCommand(index,1,true,false,alt,false,false,shift) - return true - end - end - end - end - end - end - - if (key == KEYSYMS.SPACE or ((key == KEYSYMS.RALT or key == KEYSYMS.LALT) and options.unitshotkeyaltaswell.value)) and selectedFac and menuChoice == 6 and options.unitshotkeyrequiremeta.value and options.unitstabhotkey.value then - Update(true) - end -end - -function widget:KeyRelease(key, modifier, isRepeat) - if (key == KEYSYMS.SPACE or ((key == KEYSYMS.RALT or key == KEYSYMS.LALT) and options.unitshotkeyaltaswell.value)) and selectedFac and menuChoice == 6 and options.unitshotkeyrequiremeta.value and options.unitstabhotkey.value then - Update(true) - end -end - - --Spring.Echo(CMD.OPT_META) = 4 - --Spring.Echo(CMD.OPT_RIGHT) = 16 - --Spring.Echo(CMD.OPT_SHIFT) = 32 - --Spring.Echo(CMD.OPT_CTRL) = 64 - --Spring.Echo(CMD.OPT_ALT) = 128 - -local function HotkeyTabFactory() - menuChoice = 2 - hotkeyMode = true - Update(true) - ColorTabs() -end - -local function HotkeyTabEconomy() - menuChoice = 3 - hotkeyMode = true - Update(true) - ColorTabs() -end - -local function HotkeyTabDefence() - menuChoice = 4 - hotkeyMode = true - Update(true) - ColorTabs() -end - -local function HotkeyTabSpecial() - menuChoice = 5 - hotkeyMode = true - Update(true) - ColorTabs() -end - -options.tab_factory.OnChange = HotkeyTabFactory -options.tab_economy.OnChange = HotkeyTabEconomy -options.tab_defence.OnChange = HotkeyTabDefence -options.tab_special.OnChange = HotkeyTabSpecial - -local function AddAction(cmd, func, data, types) - return widgetHandler.actionHandler:AddAction(widget, cmd, func, data, types) -end -local function RemoveAction(cmd, types) - return widgetHandler.actionHandler:RemoveAction(widget, cmd, types) -end - -local function updateTabName(num, choice) - local hotkey = WG.crude.GetHotkey(choice.actionName) - if hotkey ~= '' then - choice.hotkeyName = choice.name .. '(\255\0\255\0' .. hotkey .. '\008)' - choice.name = choice.name .. '(' .. hotkey .. ')' - end -end - --- INITS -function widget:Initialize() - widgetHandler:ConfigLayoutHandler(LayoutHandler) - Spring.ForceLayoutUpdate() - - recentlyInitialized = true - - RemoveAction("nextmenu") - RemoveAction("prevmenu") - AddAction("nextmenu", ScrollTabRight, nil, "p") - AddAction("prevmenu", ScrollTabLeft, nil, "p") - - --[[local f,it,isFile = nil,nil,false - f = io.open('cmdcolors.txt','r') - if f then - it = f:lines() - isFile = true - else - f = VFS.LoadFile('cmdcolors.txt') - it = string.gmatch(f, "%a+.-\n") - end - - local wp = '%s*([^%s]+)' -- word pattern - local cp = '^'..wp..wp..wp..wp..wp -- color pattern - local sp = '^'..wp..wp -- single value pattern like queuedLineWidth - - for line in it do - local _, _, n, r, g, b, a = string.find(line, cp) - - r = tonumber(r or 1.0) - g = tonumber(g or 1.0) - b = tonumber(b or 1.0) - a = tonumber(a or 1.0) - - if n then - cmdColors[n]= { r, g,b,a} - else - _, _, n, r= string.find(line:lower(), sp) - if n then - cmdColors[n]= r - end - end - end]]-- - - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Colorbars = Chili.Colorbars - Checkbox = Chili.Checkbox - Window = Chili.Window - Panel = Chili.Panel - StackPanel = Chili.StackPanel - TextBox = Chili.TextBox - Image = Chili.Image - Progressbar = Chili.Progressbar - Control = Chili.Control - screen0 = Chili.Screen0 - - --create main Chili elements - local screenWidth,screenHeight = Spring.GetWindowGeometry() - local height = tostring(math.floor(screenWidth/screenHeight*0.35*0.35*100)) .. "%" - local y = tostring(math.floor((1-screenWidth/screenHeight*0.35*0.35)*100)) .. "%" - - --Spring.Echo(height) - --Spring.Echo(y) - - window = Window:New{ - parent = screen0, - name = 'integralwindow'; - color = {0, 0, 0, 0}, - width = "36.4%"; - height = "25.9%"; -- keep an aspect ratio regardless of screen ratio - x = 0; - bottom = 0; - dockable = true; - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - minWidth = MIN_WIDTH, - minHeight = MIN_HEIGHT, - padding = {0, 0, 0, 0}, - --itemMargin = {0, 0, 0, 0}, - OnMouseDown={ function(self) --// click+ space on integral-menu tab will open a Game-menu. - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end --allow button to continue its function - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() --make epic Chili menu appear. - return false - end }, - } - - fakewindow = Panel:New{ - parent = window, - x = 0, - y = '15%', - width = "100%"; - height = "85%"; - --disableChildrenHitTest = false, - --itemMargin = {0, 0, 0, 0}, - dockable = false; - draggable = false, - resizable = false, - padding = {0, 0, 0, 0}, - --backgroundColor = {0.1, 0.1, 0.1, 1}, --- skinName = "DarkGlass", - - OnMouseDown={ function(self) --// click+ space on any button on the integral-menu will open a Game-menu. - -- local forwardSlash = Spring.GetKeyState(0x02F) --reference: uikeys.txt - -- if not forwardSlash then return false end - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end --allow button to continue its function - WG.crude.OpenPath('Game/Commands') - WG.crude.ShowMenu() --make epic Chili menu appear. - return false - end }, - } - - menuTabRow = StackPanel:New{ - parent = window, - resizeItems = true; - columns = 6; - orientation = "horizontal"; - height = "15%"; - width = "99%"; - x = '1%'; - y = 0; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - } - - for i=1,6 do - menuTabs[i] = MakeMenuTab(i, 1) - end - ColorTabs() - - commands_main = Panel:New{ - parent = fakewindow, - backgroundColor = {0, 0, 0, 0}, - height = "98%"; - width = COMMAND_SECTION_WIDTH.."%"; - x = "1.5%"; - y = "1.5%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - } - for i=1,numRows do - sp_commands[i] = StackPanel:New{ - parent = commands_main, - resizeItems = true; - orientation = "horizontal"; - height = math.floor(100/numRows).."%"; - width = "100%"; - x = "0%"; - y = math.floor(100/numRows)*(i-1).."%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - index = i, - i_am_sp_commands = true, - } - --Spring.Echo("Command row "..i.." created") - end - - states_main = Panel:New{ - parent = fakewindow, - backgroundColor = {0, 0, 0, 0}, - height = "96%"; - width = (STATE_SECTION_WIDTH).."%"; - --x = tostring(100-STATE_SECTION_WIDTH).."%"; - right = 4; - y = "3%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - } - for i=1, numStateColumns do - sp_states[i] = StackPanel:New { - parent = states_main, - resizeItems = true; - orientation = "vertical"; - height = "100%"; - width = math.floor(100/numStateColumns).."%"; - x = (100 - (math.floor(100/numStateColumns))*i).."%"; - y = "0%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - OnMouseDown={ function(self) --// click+ space on any unit-State button will open Unit-AI menu, it overrides similar function above. - -- local forwardSlash = Spring.GetKeyState(0x02F) --reference: uikeys.txt - -- if not forwardSlash then return false end - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end --allow button to continue its function - WG.crude.OpenPath('Game/Unit AI') - WG.crude.ShowMenu() --make epic Chili menu appear. - return true --stop the button's function, else unit-state button will look bugged. - end }, - } - end - - buildRow = Panel:New{ - parent = commands_main, - orientation = "horizontal"; - height = (math.floor(100/numRows)).."%"; - width = "100%"; - x = "0%"; - y = (math.floor(100/numRows))*(numRows-1).."%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - backgroundColor = {0, 0, 0, 0} - } - - buildProgress = Progressbar:New{ - value = 0.0, - name = 'prog'; - max = 1; - color = {0.7, 0.7, 0.4, 0.6}, - backgroundColor = {1, 1, 1, 0.01}, - width = "92%", - height = "92%", - x = "4%", - y = "4%", - skin=nil, - skinName='default', - }, - - commands_main:RemoveChild(buildRow) - for i=1,MAX_COLUMNS do - buildRowButtons[i] = {} - end -end - -local lastCmd = nil -- last active command -local lastColor = nil -- original color of button with last active command -local lastFocusColor = nil - --- this is needed to highlight active command -function widget:DrawScreen() - local _,cmdid,_,cmdname = Spring.GetActiveCommand() - if cmdid ~= lastCmd then - if cmdid and commandButtons[cmdid] then - local but = commandButtons[cmdid].button - lastColor = but.backgroundColor - lastFocusColor = but.focusColor - but.backgroundColor = {0.8, 0, 0, 1} - but.focusColor = {0.8, 0, 0, 1} - but:Invalidate() - end - if lastCmd ~= nil and commandButtons[lastCmd] then - local but = commandButtons[lastCmd].button - but.backgroundColor = lastColor - but.focusColor = lastFocusColor - but:Invalidate() - end - lastCmd = cmdid - end -end - --- Make the hotkeys appear on the menu tabs -function widget:Update() - if recentlyInitialized then - for i = 2, 5 do - updateTabName(i, menuChoices[i]) - end - recentlyInitialized = false - ColorTabs(1) - end -end - -function widget:GameFrame(n) - --set progress bar - if n%6 == 0 then - if menuChoice == 6 and selectedFac and buildRowButtons[1] and buildRowButtons[1].image then - local progress - local unitBuildID = spGetUnitIsBuilding(selectedFac) - if unitBuildID then - progress = select(5, spGetUnitHealth(unitBuildID)) - end - buildProgress:SetValue(progress or 0) - end - end -end - -function widget:SelectionChanged(newSelection) - --get new selected fac, if any - for i=1,#newSelection do - local id = newSelection[i] - if UnitDefs[spGetUnitDefID(id)].isFactory then - if selectedFac ~= id then - alreadyRemovedTag = {} - end - selectedFac = id - SmartTabSelect() - return - end - end - selectedFac = nil - SmartTabSelect() -end - -function widget:Shutdown() - widgetHandler:ConfigLayoutHandler(nil) - Spring.ForceLayoutUpdate() -end - -options.hidetabs.OnChange = function(self) - fakewindow:SetPosRelative(_, self.value and 0 or '15%', _, self.value and '100%' or '86%') - fakewindow:SetPosRelative(_, self.value and 0 or '15%', _, self.value and '100%' or '86%') - - if self.value then - window:RemoveChild(menuTabRow) - else - window:AddChild(menuTabRow) - end - menuChoice = 1 - ColorTabs(1) -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_chili_minimap.lua b/LuaUI/Widgets_Evo/gui_chili_minimap.lua deleted file mode 100644 index 5653f11bb..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_minimap.lua +++ /dev/null @@ -1,549 +0,0 @@ -function widget:GetInfo() - return { - name = "Chili Minimap", - desc = "v0.890 Chili Minimap", - author = "Licho, CarRepairer", - date = "@2010", - license = "GNU GPL, v2 or later", - layer = -100000, - experimental = false, - enabled = true, -- loaded by default? - detailsDefault = 1 - } -end - -local window_minimap -local map_panel -local Chili -local glDrawMiniMap = gl.DrawMiniMap -local glResetState = gl.ResetState -local glResetMatrices = gl.ResetMatrices -local echo = Spring.Echo - -local iconsize = 20 -local bgColor_panel = {nil,nil,nil,1} - -local tabbedMode = false ---local init = true - -local function toggleTeamColors() - if WG.LocalColor and WG.LocalColor.localTeamColorToggle then - WG.LocalColor.localTeamColorToggle() - else --- Spring.SendCommands("luaui enablewidget Local Team Colors") - end -end - -local ar = Game.mapX/Game.mapY -local mapIsWider = Game.mapX > Game.mapY -local function AdjustToMapAspectRatio(w,h) - if mapIsWider then - return w, w/ar +iconsize - end - return h*ar, h+iconsize -end - -local function AdjustMapAspectRatioToWindow(x,y,w,h) - local newW, newH = w,h - local newX, newY = x,y - if w/h > ar then - newW = ar*h - newX = (w-newW)/2 - else - newH = w/ar - newY = (h-newH)/2 - end - return newX, newY, newW, newH -end - -local function MakeMinimapWindow() -end - -options_path = 'Settings/Interface/Map' -local minimap_path = 'Settings/HUD Panels/Minimap' ---local radar_path = 'Settings/Interface/Map/Radar View Colors' -local radar_path = 'Settings/Interface/Map' -options_order = { 'use_map_ratio', 'hidebuttons', 'initialSensorState', 'lastmsgpos', 'clearmapmarks', 'opacity', -'lblViews', 'viewheightmap', 'viewblockmap', 'lblLos', 'viewfow', -'radar_view_colors_label1', 'radar_view_colors_label2', 'radar_fog_color', 'radar_los_color', 'radar_radar_color', 'radar_jammer_color', -'radar_preset_blue_line', 'radar_preset_blue_line_dark_fog', 'radar_preset_green', 'radar_preset_only_los'} -options = { - use_map_ratio = { - name = 'Keep Aspect Ratio', - type = 'radioButton', - value = 'arwindow', - items={ - {key='arwindow', name='Aspect Ratio Window'}, - {key='armap', name='Aspect Ratio Map'}, - {key='arnone', name='Map Fills Window'}, - }, - OnChange = function(self) - local arwindow = self.value == 'arwindow' - window_minimap.fixedRatio = arwindow - if arwindow then - local w,h = AdjustToMapAspectRatio(328,308+iconsize) - window_minimap:Resize(w,h,false,false) - end - - end, - path = minimap_path, - }, - --[[ - simpleMinimapColors = { - name = 'Simplified Minimap Colors', - type = 'bool', - desc = 'Show minimap blips as green for you, teal for allies and red for enemies (only minimap will use this simple color scheme).', - springsetting = 'SimpleMiniMapColors', - OnChange = function(self) Spring.SendCommands{"minimap simplecolors " .. (self.value and 1 or 0) } end, - }, - --]] - - initialSensorState = { - name = "Initial LOS state", - desc = "Game starts with LOS enabled", - type = 'bool', - value = true, - }, - - lblViews = { type = 'label', name = 'Views', }, - - --[[ this option was secretly removed - viewstandard = { - name = 'Clear map drawings', - type = 'button', - action = 'showstandard', - }, - --]] - clearmapmarks = { - name = 'Clear map drawings', - type = 'button', - action = 'clearmapmarks', - }, - viewheightmap = { - name = 'Toggle Height Map', - type = 'button', - action = 'showelevation', - }, - viewblockmap = { - name = 'Toggle Pathing Map', - desc = 'Select unit then click this to see where it can go.', - type = 'button', - action = 'showpathtraversability', - }, - - lastmsgpos = { - name = 'Last Message Position', - type = 'button', - action = 'lastmsgpos', - }, - - lblLos = { type = 'label', name = 'Line of Sight', }, - - viewfow = { - name = 'Toggle Fog of War View', - type = 'button', - action = 'togglelos', - }, - - radar_view_colors_label1 = { type = 'label', name = 'Radar View Colors', path = radar_path,}, - radar_view_colors_label2 = { type = 'label', name = '* Note: These colors are additive.', path = radar_path,}, - - radar_fog_color = { - name = "Fog Color", - type = "colors", - value = { 0.4, 0.4, 0.4, 1}, - OnChange = function() updateRadarColors() end, - path = radar_path, - }, - radar_los_color = { - name = "LOS Color", - type = "colors", - value = { 0.15, 0.15, 0.15, 1}, - OnChange = function() updateRadarColors() end, - path = radar_path, - }, - radar_radar_color = { - name = "Radar Color", - type = "colors", - value = { 0, 0, 1, 1}, - OnChange = function() updateRadarColors() end, - path = radar_path, - }, - radar_jammer_color = { - name = "Jammer Color", - type = "colors", - value = { 0.1, 0, 0, 1}, - OnChange = function() updateRadarColors() end, - path = radar_path, - }, - - radar_preset_blue_line = { - name = 'Blue Outline Radar (default)', - type = 'button', - OnChange = function() - options.radar_fog_color.value = { 0.4, 0.4, 0.4, 1} - options.radar_los_color.value = { 0.15, 0.15, 0.15, 1} - options.radar_radar_color.value = { 0, 0, 1, 1} - options.radar_jammer_color.value = { 0.1, 0, 0, 1} - updateRadarColors() - end, - path = radar_path, - }, - - radar_preset_blue_line_dark_fog = { - name = 'Blue Outline Radar with dark fog', - type = 'button', - OnChange = function() - options.radar_fog_color.value = { 0.05, 0.05, 0.05, 1} - options.radar_los_color.value = { 0.5, 0.5, 0.5, 1} - options.radar_radar_color.value = { 0, 0, 1, 1} - options.radar_jammer_color.value = { 0.1, 0, 0, 1} - updateRadarColors() - end, - path = radar_path, - }, - - radar_preset_green = { - name = 'Green Area Radar', - type = 'button', - OnChange = function() - options.radar_fog_color.value = { 0.25, 0.2, 0.25, 0} - options.radar_los_color.value = { 0.2, 0.13, 0.2, 0} - options.radar_radar_color.value = { 0, 0.17, 0, 0} - options.radar_jammer_color.value = { 0.18, 0, 0, 0} - updateRadarColors() - end, - path = radar_path, - }, - - radar_preset_only_los = { - name = 'Only LOS', - type = 'button', - OnChange = function() - options.radar_fog_color.value = { 0.40, 0.40, 0.40, 0} - options.radar_los_color.value = { 0.15, 0.15, 0.15, 0} - options.radar_radar_color.value = { 0, 0, 0, 0} - options.radar_jammer_color.value = { 0, 0, 0, 0} - updateRadarColors() - end, - path = radar_path, - }, - - hidebuttons = { - name = 'Hide Minimap Buttons', - type = 'bool', - advanced = true, - OnChange= function(self) iconsize = self.value and 0 or 20; MakeMinimapWindow() end, - value = false, - path = minimap_path, - }, - opacity = { - name = "Opacity", - type = "number", - value = 0, min = 0, max = 1, step = 0.01, - OnChange = function(self) - if self.value == 0 then - bgColor_panel = {nil,nil,nil,1} - else - bgColor_panel = {nil,nil,nil,0} - end - MakeMinimapWindow() - - window_minimap:Invalidate() - end, - path = minimap_path, - }, - -} - -function updateRadarColors() - local fog = options.radar_fog_color.value - local los = options.radar_los_color.value - local radar = options.radar_radar_color.value - local jam = options.radar_jammer_color.value - Spring.SetLosViewColors( - { fog[1], los[1], radar[1], jam[1]}, - { fog[2], los[2], radar[2], jam[2]}, - { fog[3], los[3], radar[3], jam[3]} - ) -end - -function setSensorState(newState) - local losEnabled = Spring.GetMapDrawMode() == "los" - if losEnabled ~= newState then - Spring.SendCommands('togglelos') - end -end - -function widget:Update() --Note: these run-once codes is put here (instead of in Initialize) because we are waiting for epicMenu to initialize the "options" value first. - setSensorState(options.initialSensorState.value) - updateRadarColors() - widgetHandler:RemoveCallIn("Update") -- remove update call-in since it only need to run once. ref: gui_ally_cursors.lua by jK -end - -local function MakeMinimapButton(file, pos, params) - local option = params.option - local name, desc, action, hotkey - if option then - name = options[option].name - desc = options[option].desc and (' (' .. options[option].desc .. ')') or '' - action = WG.crude.GetActionName(options_path, options[option]) - end - name = name or params.name or "" - desc = desc or params.desc or "" - action = action or params.action - hotkey = WG.crude.GetHotkey(action) - - if hotkey ~= '' then - hotkey = ' (\255\0\255\0' .. hotkey:upper() .. '\008)' - end - - return Chili.Button:New{ - height=iconsize, width=iconsize, --- file=file, - caption="", - margin={0,0,0,0}, - padding={4,3,2,2}, - bottom=iconsize*0.3, - right=iconsize*pos+5, - - tooltip = (name .. desc .. hotkey ), - - --OnClick={ function(self) options[option].OnChange() end }, - OnClick={ function(self) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - if meta then - WG.crude.OpenPath(options_path) --click + space will shortcut to option-menu - WG.crude.ShowMenu() --make epic Chili menu appear. - return true - end - Spring.SendCommands( action ) - end }, - children={ - Chili.Image:New{ - file=file, - width="100%"; - height="100%"; - x="0%"; - y="0%"; - } - }, - } -end - -MakeMinimapWindow = function() - if (window_minimap) then - window_minimap:Dispose() - end - - --init = true - - local screenWidth,screenHeight = Spring.GetWindowGeometry() - - --local w,h = screenWidth*0.32,screenHeight*0.4+iconsize - local w,h = 328,308+iconsize - if (options.use_map_ratio.value == 'arwindow') then - w,h = AdjustToMapAspectRatio(w,h) - end - - if h > 0 and w > 0 and screenHeight > 0 and screenWidth > 0 then - if w/h > screenWidth/screenHeight then - screenHeight = h*screenWidth/w - else - screenWidth = w*screenHeight/h - end - end - - map_panel = Chili.Panel:New {bottom = (iconsize*1.3), x = 0, y = 0, right = 0, - margin={0,0,0,0}, - padding = {8,5,8,8}, - backgroundColor = bgColor_panel - } - window_minimap = Chili.Window:New{ - dockable = true, - name = "Minimap", - x = 0, - y = 0, - color = {nil, nil, nil, options.opacity.value}, - padding = {0,0,0,0}, - margin = {0,0,0,0}, - width = w, - height = h, - parent = Chili.Screen0, - draggable = false, - tweakDraggable = true, - resizable = true, - tweakResizable = true, - minimizable = true, - fixedRatio = options.use_map_ratio.value == 'arwindow', - dragUseGrip = false, - minWidth = iconsize*10, - maxWidth = screenWidth*0.8, - maxHeight = screenHeight*0.8, - children = { - --- Chili.Panel:New {bottom = (iconsize), x = 0, y = 0, right = 0, margin={0,0,0,0}, padding = {0,0,0,0}, skinName="DarkGlass"}, - map_panel, - - MakeMinimapButton( 'LuaUI/images/Crystal_Clear_action_flag.png', 1, {option = 'lastmsgpos'} ), - --MakeMinimapButton( 'LuaUI/images/map/standard.png', 2.5, option = {'viewstandard'} ), - MakeMinimapButton( 'LuaUI/images/drawingcursors/eraser.png', 2.5, {option = 'clearmapmarks'} ), - MakeMinimapButton( 'LuaUI/images/map/heightmap.png', 3.5, {option = 'viewheightmap'} ), - MakeMinimapButton( 'LuaUI/images/map/blockmap.png', 4.5, {option = 'viewblockmap'} ), - MakeMinimapButton( 'LuaUI/images/map/metalmap.png', 5.5, {name = "Toggle Eco Display", action = 'showeco', desc = " (show metal, geo spots and pylon fields)"}), -- handled differently because command is registered in another widget - MakeMinimapButton( 'LuaUI/images/map/fow.png', 7, {option = 'viewfow'} ), - - Chili.Button:New{ - height=iconsize, width=iconsize, - caption="", - margin={0,0,0,0}, - padding={4,3,2,2}, - bottom=iconsize*0.3, - right=iconsize*8.5, - - tooltip = "Toggle simplified teamcolours", - - --OnClick={ function(self) options[option].OnChange() end }, - OnClick = {toggleTeamColors}, - children={ - Chili.Image:New{ - file='LuaUI/images/map/minimap_colors_simple.png', - width="100%"; - height="100%"; - x="0%"; - y="0%"; - } - }, - }, - }, - } -end -function widget:MousePress(x, y, button) - if not Spring.IsAboveMiniMap(x, y) then - return false - end - local alt, ctrl, meta, shift = Spring.GetModKeyState() - if not meta then --//skip epicMenu when user didn't press the Spacebar - return false - end - if Spring.GetActiveCommand() == 0 then --//activate epicMenu when user didn't have active command & Spacebar+click on the minimap - WG.crude.OpenPath(minimap_path) --click + space will shortcut to option-menu - WG.crude.ShowMenu() --make epic Chili menu appear. - return true - else --//skip epicMenu when user have active command. User might be trying to queue/insert command using the minimap. - return false - end -end - ---[[function widget:Update(dt) - local mode = Spring.GetCameraState()["mode"] - if mode == 7 and not tabbedMode then - tabbedMode = true - Chili.Screen0:RemoveChild(window_minimap) - end - if mode ~= 7 and tabbedMode then - Chili.Screen0:AddChild(window_minimap) - tabbedMode = false - end -end ---]] - - --// similar properties to "widget:Update(dt)" above but update less often. -function widget:KeyRelease(key, mods, label, unicode) - if key == 0x009 then --// "0x009" is equal to "tab". Reference: uikeys.txt - local mode = Spring.GetCameraState()["mode"] - if mode == 7 and not tabbedMode then - Chili.Screen0:RemoveChild(window_minimap) - tabbedMode = true - end - if mode ~= 7 and tabbedMode then - Chili.Screen0:AddChild(window_minimap) - tabbedMode = false - end - end -end - -function widget:Initialize() - if (Spring.GetMiniMapDualScreen()) then - Spring.Echo("ChiliMinimap: auto disabled (DualScreen is enabled).") - widgetHandler:RemoveWidget() - return - end - - if (not WG.Chili) then - widgetHandler:RemoveWidget() - return - end - - Chili = WG.Chili - - MakeMinimapWindow() - - gl.SlaveMiniMap(true) -end - -function widget:Shutdown() - --// reset engine default minimap rendering - gl.SlaveMiniMap(false) - Spring.SendCommands("minimap geo " .. Spring.GetConfigString("MiniMapGeometry")) - - --// free the chili window - if (window_minimap) then - window_minimap:Dispose() - end -end - - -local lx, ly, lw, lh - -function widget:DrawScreen() - if (window_minimap.hidden) then - gl.ConfigMiniMap(0,0,0,0) --// a phantom map still clickable if this is not present. - lx = 0 - ly = 0 - lh = 0 - lw = 0 - return - end - local cx,cy,cw,ch = Chili.unpack4(map_panel.clientArea) - - if (options.use_map_ratio.value == 'armap') then - cx,cy,cw,ch = AdjustMapAspectRatioToWindow(cx,cy,cw,ch) - end - - --if (lw ~= window_minimap.width or lh ~= window_minimap.height or lx ~= window_minimap.x or ly ~= window_minimap.y) or init then - if (lw ~= cx or lh ~= ch or lx ~= cx or ly ~= cy) then - --[[ - if init then - window_minimap:Update() --required otherwise size stackpanel is calculated wrong when first loaded - init = false - end - --]] - - lx = cx - ly = cy - lh = ch - lw = cw - - cx,cy = window_minimap:LocalToScreen(cx,cy) - local vsx,vsy = gl.GetViewSizes() - gl.ConfigMiniMap(cx,vsy-ch-cy,cw,ch) - - - end - - gl.PushAttrib(GL.ALL_ATTRIB_BITS) - gl.MatrixMode(GL.PROJECTION) - gl.PushMatrix() - gl.MatrixMode(GL.MODELVIEW) - gl.PushMatrix() - - glDrawMiniMap() - - gl.MatrixMode(GL.PROJECTION) - gl.PopMatrix() - gl.MatrixMode(GL.MODELVIEW) - gl.PopMatrix() - gl.PopAttrib() -end - diff --git a/LuaUI/Widgets_Evo/gui_chili_rejoin_progress.lua b/LuaUI/Widgets_Evo/gui_chili_rejoin_progress.lua deleted file mode 100644 index 5200ef71d..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_rejoin_progress.lua +++ /dev/null @@ -1,378 +0,0 @@ -function widget:GetInfo() - return { - name = "Chili Rejoining Progress Bar", - desc = "v1.131 Show the progress of rejoining and temporarily turn-off Text-To-Speech while rejoining", - author = "msafwan (use UI from KingRaptor's Chili-Vote) ", - date = "Oct 10, 2012", - license = "GNU GPL, v2 or later", - layer = 0, - experimental = false, - enabled = true, -- loaded by default? - --handler = true, -- allow this widget to use 'widgetHandler:FindWidget()' - } -end --------------------------------------------------------------------------------- ---Crude Documentation----------------------------------------------------------- ---How it meant to work: ---1) GameProgress return serverFrame --> IF I-am-behind THEN activate chili UI ELSE de-activate chili UI --> Update the estimated-time-of-completion every second. ---2) LuaRecvMsg return timeDifference --> IF I-am-behind THEN activate chili UI ELSE nothing ---> Update the estimated-time-of-completion every second. ---3) at GameStart send LuaMsg containing GameStart's UTC. - ---Others: some tricks to increase efficiency, bug fix, ect --------------------------------------------------------------------------------- ---Localize Spring function------------------------------------------------------ -local spGetSpectatingState = Spring.GetSpectatingState --------------------------------------------------------------------------------- ---Chili Variable----------------------------------------------------------------- ref: gui_chili_vote.lua by KingRaptor -local Chili -local Button -local Label -local Window -local Panel -local TextBox -local Image -local Progressbar -local Control -local Font - --- elements -local window, stack_main, label_title -local stack_vote, label_vote, button_vote, progress_vote - -local voteCount, voteMax --------------------------------------------------------------------------------- ---Calculator Variable------------------------------------------------------------ -local serverFrameRate_G = 30 --//constant: assume server run at x1.0 gamespeed. -local serverFrameNum1_G = nil --//variable: get the latest server's gameFrame from GameProgress() and do work with it. -local oneSecondElapsed_G = 0 --//variable: a timer for 1 second, used in Update(). Update UI every 1 second. -local myGameFrame_G = 0 --//variable: get latest my gameFrame from GameFrame() and do work with it. -local myLastFrameNum_G = 0 --//variable: used to calculate local game-frame rate. -local ui_active_G = false --//variable:indicate whether UI is shown or hidden. -local averageLocalSpeed_G = {sumOfSpeed= 0, sumCounter= 0} --//variable: store the local-gameFrame speeds so that an average can be calculated. -local defaultAverage_G = 30 --//constant: Initial/Default average is set at 30gfps (x1.0 gameSpeed) -local simpleMovingAverageLocalSpeed_G = {storage={},index = 1, runningAverage=defaultAverage_G} --//variable: for calculating rolling average. Initial/Default average is set at 30gfps (x1.0 gameSpeed) --------------------------------------------------------------------------------- ---Variable for fixing GameProgress delay at rejoin------------------------------ -local myTimestamp_G = 0 --//variable: store my own timestamp at GameStart -local serverFrameNum2_G = nil --//variable: the expected server-frame of current running game -local submittedTimestamp_G = {} --//variable: store all timestamp at GameStart submitted by original players (assuming we are rejoining) -local functionContainer_G = function(x) end --//variable object: store a function -local myPlayerID_G = 0 -local gameProgressActive_G = false --//variable: signal whether GameProgress has been updated. -local iAmReplay_G = false --------------------------------------------------------------------------------- ---For testing GUI--------------------------------------------------------------- -local forceDisplay = nil --------------------------------------------------------------------------------- ---[[ -if VFS.FileExists("Luaui/Config/ZK_data.lua") then - local configFile = VFS.Include("Luaui/Config/ZK_data.lua") - ttsControlEnabled_G = configFile["EPIC Menu"].config.epic_Text_To_Speech_Control_enable - if ttsControlEnabled_G == nil then - ttsControlEnabled_G = true - end -end --]] - - -local function ActivateGUI_n_TTS (frameDistanceToFinish, ui_active, ttsControlEnabled, altThreshold) - if frameDistanceToFinish >= (altThreshold or 120) then - if not ui_active then - screen0:AddChild(window) - ui_active = true - if ttsControlEnabled then - Spring.Echo(Spring.GetPlayerInfo(myPlayerID_G) .. " DISABLE TTS") --eg: output " DISABLE TTS" - end - end - elseif frameDistanceToFinish < (altThreshold or 120) then - if ui_active then - screen0:RemoveChild(window) - ui_active = false - if ttsControlEnabled then - Spring.Echo(Spring.GetPlayerInfo(myPlayerID_G) .. " ENABLE TTS") - end - end - end - return ui_active -end - -function widget:GameProgress(serverFrameNum) --this function run 3rd. It read the official serverFrameNumber - local myGameFrame = myGameFrame_G - local ui_active = ui_active_G - -----localize-- - - local ttsControlEnabled = CheckTTSwidget() - local serverFrameNum1 = serverFrameNum - local frameDistanceToFinish = serverFrameNum1-myGameFrame - ui_active = ActivateGUI_n_TTS (frameDistanceToFinish, ui_active, ttsControlEnabled) - - -----return-- - serverFrameNum1_G = serverFrameNum1 - ui_active_G = ui_active - gameProgressActive_G = true -end - -function widget:Update(dt) --this function run 4th. It update the progressBar - if ui_active_G then - oneSecondElapsed_G = oneSecondElapsed_G + dt - if oneSecondElapsed_G >= 1 then --wait for 1 second period - -----var localize----- - local serverFrameNum1 = serverFrameNum1_G - local serverFrameNum2 = serverFrameNum2_G - local oneSecondElapsed = oneSecondElapsed_G - local myLastFrameNum = myLastFrameNum_G - local serverFrameRate = serverFrameRate_G - local myGameFrame = myGameFrame_G - local simpleMovingAverageLocalSpeed = simpleMovingAverageLocalSpeed_G - -----localize - - local serverFrameNum = serverFrameNum1 or serverFrameNum2 --use FrameNum from GameProgress if available, else use FrameNum derived from LUA_msg. - serverFrameNum = serverFrameNum + serverFrameRate*oneSecondElapsed -- estimate Server's frame number after each widget:Update() while waiting for GameProgress() to refresh with actual value. - local frameDistanceToFinish = serverFrameNum-myGameFrame - - local myGameFrameRate = (myGameFrame - myLastFrameNum) / oneSecondElapsed - --Method1: simple average - --[[ - averageLocalSpeed_G.sumOfSpeed = averageLocalSpeed_G.sumOfSpeed + myGameFrameRate -- try to calculate the average of local gameFrame speed. - averageLocalSpeed_G.sumCounter = averageLocalSpeed_G.sumCounter + 1 - myGameFrameRate = averageLocalSpeed_G.sumOfSpeed/averageLocalSpeed_G.sumCounter -- using the average to calculate the estimate for time of completion. - --]] - --Method2: simple moving average - myGameFrameRate = SimpleMovingAverage(myGameFrameRate, simpleMovingAverageLocalSpeed) -- get our average frameRate - - local timeToComplete = frameDistanceToFinish/myGameFrameRate -- estimate the time to completion. - local timeToComplete_string = "?/?" - if timeToComplete > 75 then - local minute, second = math.modf(timeToComplete/60) --second divide by 60sec-per-minute, then saperate result from its remainder - second = 60*second --multiply remainder with 60sec-per-minute to get second back. - timeToComplete_string = string.format ("%.0f minute, %.0f second(s) left.",minute, second) - else - timeToComplete_string = string.format ("%.1f second(s) left.",timeToComplete) - end - progress_vote:SetCaption(timeToComplete_string) - progress_vote:SetValue(myGameFrame/serverFrameNum) - - oneSecondElapsed = 0 - myLastFrameNum = myGameFrame - - if serverFrameNum1 then serverFrameNum1 = serverFrameNum --update serverFrameNum1 if value from GameProgress() is used, - else serverFrameNum2 = serverFrameNum end --update serverFrameNum2 if value from LuaRecvMsg() is used. - -----return - serverFrameNum1_G = serverFrameNum1 - serverFrameNum2_G = serverFrameNum2 - oneSecondElapsed_G = oneSecondElapsed - myLastFrameNum_G = myLastFrameNum - simpleMovingAverageLocalSpeed_G = simpleMovingAverageLocalSpeed - end - end -end - -local function RemoveLUARecvMsg(n) - if n > 150 then - iAmReplay_G = nil - spGetSpectatingState = nil --de-reference the function so that garbage collector can clean it up. - widgetHandler:RemoveCallIn("RecvLuaMsg") --remove unused method for increase efficiency after frame> timestampLimit (150frame or 5 second). - functionContainer_G = function(x) end --replace this function with an empty function/method - end -end - -function widget:GameFrame(n) --this function run at all time. It update current gameFrame - myGameFrame_G = n - functionContainer_G(n) --function that are able to remove itself. Reference: gui_take_reminder.lua (widget by EvilZerggin, modified by jK) -end - ---//thanks to Rafal[0K] for pointing to the rolling average idea. -function SimpleMovingAverage(myGameFrameRate, simpleMovingAverageLocalSpeed) - --//remember current frameRate, and advance table index by 1 - local index = (simpleMovingAverageLocalSpeed.index) --retrieve current index. - simpleMovingAverageLocalSpeed.storage[index] = myGameFrameRate --remember current frameRate at current index. - simpleMovingAverageLocalSpeed.index = simpleMovingAverageLocalSpeed.index +1 --advance index by 1. - --//wrap table index around. Create a circle - local poolingSize = 10 --//number of sample. note: simpleMovingAverage() is executed every second, so the value represent an average spanning 10 second. - if (simpleMovingAverageLocalSpeed.index == (poolingSize + 2)) then --when table out-of-bound: - simpleMovingAverageLocalSpeed.index = 1 --wrap the table index around (create a circle of 150 + 1 (ie: poolingSize plus 1 space) entry). - end - --//update averages - index = (simpleMovingAverageLocalSpeed.index) --retrieve an index advanced by 1. - local oldAverage = (simpleMovingAverageLocalSpeed.storage[index] or defaultAverage_G) --retrieve old average or use initial/default average as old average. - simpleMovingAverageLocalSpeed.runningAverage = simpleMovingAverageLocalSpeed.runningAverage + myGameFrameRate/poolingSize - oldAverage/poolingSize --calculate average: add new value, remove old value. Ref: http://en.wikipedia.org/wiki/Moving_average#Simple_moving_average - local avgGameFrameRate = simpleMovingAverageLocalSpeed.runningAverage -- replace myGameFrameRate with its average value. - - return avgGameFrameRate, simpleMovingAverageLocalSpeed -end - -function CheckTTSwidget() - local ttsValue - --[[ - local widget = widgetHandler:FindWidget("Text To Speech Control") --find widget. Reference: gui_epicmenu.lua by Carrepairer/Wagonrepairer - if widget then --get all variable from TTS control widget. - ttsValue = widget.options.enable.value --get the value - else --If widget is not found, then 'Rejoin Progress widget' will not try to disable/enable TTS. It became neutral. - ttsValue = false --disable TTS control - end - --]] - if WG.textToSpeechCtrl then - ttsValue = WG.textToSpeechCtrl.ttsEnable --retrieve Text-To-Speech widget settings from global table. - else - ttsValue = false - end - return ttsValue -end - ----------------------------------------------------------- ---Chili-------------------------------------------------- -function widget:Initialize() - functionContainer_G = RemoveLUARecvMsg - myPlayerID_G = Spring.GetMyPlayerID() - iAmReplay_G = Spring.IsReplay() - - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Colorbars = Chili.Colorbars - Window = Chili.Window - StackPanel = Chili.StackPanel - Image = Chili.Image - Progressbar = Chili.Progressbar - Control = Chili.Control - screen0 = Chili.Screen0 - - --create main Chili elements - -- local screenWidth,screenHeight = Spring.GetWindowGeometry() - -- local height = tostring(math.floor(screenWidth/screenHeight*0.35*0.35*100)) .. "%" - -- local y = tostring(math.floor((1-screenWidth/screenHeight*0.35*0.35)*100)) .. "%" - - -- local labelHeight = 24 - -- local fontSize = 16 - - window = Window:New{ - --parent = screen0, - name = 'rejoinProgress'; - color = {0, 0, 0, 0}, - width = 260, - height = 60, - left = 2, --dock left? - y = "40%", --halfway on screen? - dockable = true, - draggable = false, --disallow drag to avoid capturing mouse click - resizable = false, - tweakDraggable = true, - tweakResizable = true, - minWidth = MIN_WIDTH, - minHeight = MIN_HEIGHT, - padding = {0, 0, 0, 0}, - savespace = true, --probably could save space? - --itemMargin = {0, 0, 0, 0}, - } - stack_main = StackPanel:New{ - parent = window, - resizeItems = true; - orientation = "vertical"; - height = "100%"; - width = "100%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - } - label_title = Label:New{ - parent = stack_main, - autosize=false; - align="center"; - valign="top"; - caption = ''; - height = 16, - width = "100%"; - } - --[[ - stack_vote = StackPanel:New{ - parent = stack_main, - resizeItems = true; - orientation = "horizontal"; - y = (40*(1-1))+15 ..'%', - height = "40%"; - width = "100%"; - padding = {0, 0, 0, 0}, - itemMargin = {0, 0, 0, 0}, - } - --]] - progress_vote = Progressbar:New{ - parent = stack_main, - x = "0%", - y = '40%', --position at 40% of the window's height - width = "100%"; --maximum width - height = "100%", - max = 1; - caption = "?/?"; - color = {0.9,0.15,0.2,1}; --Red, {0.2,0.9,0.3,1} --Green - } - progress_vote:SetValue(0) - voteCount = 0 - voteMax = 1 -- protection against div0 - label_title:SetCaption("Catching up.. Please Wait") - - if forceDisplay then - ActivateGUI_n_TTS (1, false, false, 0) --force GUI to display for testing - return - end -end - ----------------------------------------------------------- ---fix for Game Progress delay----------------------------- -function widget:RecvLuaMsg(bigMsg, playerID) --this function run 2nd. It read the LUA timestamp - if forceDisplay then - ActivateGUI_n_TTS (1, false, false, 0) --force GUI to display for testing - return - end - - if gameProgressActive_G or iAmReplay_G then --skip LUA message if gameProgress is already active OR game is a replay - return false - end - - local iAmSpec = spGetSpectatingState() - local myMsg = (playerID == myPlayerID_G) - if (myMsg or iAmSpec) then - if bigMsg:sub(1,9) == "rejnProg " then --check for identifier - -----var localize----- - local ui_active = ui_active_G - local submittedTimestamp = submittedTimestamp_G - local myTimestamp = myTimestamp_G - -----localize - - local timeMsg = bigMsg:sub(10) --saperate time-message from the identifier - local systemSecond = tonumber(timeMsg) - --Spring.Echo(systemSecond .. " B") - submittedTimestamp[#submittedTimestamp +1] = systemSecond --store all submitted timestamp from each players - local sumSecond= 0 - for i=1, #submittedTimestamp,1 do - sumSecond = sumSecond + submittedTimestamp[i] - end - --Spring.Echo(sumSecond .. " C") - local avgSecond = sumSecond/#submittedTimestamp - --Spring.Echo(avgSecond .. " D") - local secondDiff = myTimestamp - avgSecond - --Spring.Echo(secondDiff .. " E") - local frameDiff = secondDiff*30 - - local serverFrameNum2 = frameDiff --this value represent the estimate difference in frame when everyone was submitting their timestamp at game start. Therefore the difference in frame will represent how much frame current player are ahead of us. - local ttsControlEnabled = CheckTTSwidget() - ui_active = ActivateGUI_n_TTS (frameDiff, ui_active, ttsControlEnabled, 1800) - - -----return - ui_active_G = ui_active - serverFrameNum2_G = serverFrameNum2 - submittedTimestamp_G = submittedTimestamp - end - end -end - -function widget:GameStart() --this function run 1st, before any other function. It send LUA timestamp - --local format = "%H:%M" - local currentTime = os.date("!*t") --ie: clock on "gui_epicmenu.lua" (widget by CarRepairer), UTC & format: http://lua-users.org/wiki/OsLibraryTutorial - local systemSecond = currentTime.hour*3600 + currentTime.min*60 + currentTime.sec - local myTimestamp = systemSecond - --Spring.Echo(systemSecond .. " A") - local timestampMsg = "rejnProg " .. systemSecond --currentTime --create a timestamp message - Spring.SendLuaUIMsg(timestampMsg) --this message will remain in server's cache as a LUA message which rejoiner can intercept. Thus allowing the game to leave a clue at game start for latecomer. The latecomer will compare the previous timestamp with present and deduce the catch-up time. - - ------return - myTimestamp_G = myTimestamp -end diff --git a/LuaUI/Widgets_Evo/gui_chili_resource_bars.lua b/LuaUI/Widgets_Evo/gui_chili_resource_bars.lua deleted file mode 100644 index 6d2aeb044..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_resource_bars.lua +++ /dev/null @@ -1,491 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Chili Resource Bars", - desc = "", - author = "jK", - date = "2010", - license = "GNU GPL, v2 or later", - layer = 0, - experimental = false, - enabled = true - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -include("colors.h.lua") - -WG.energyWasted = 0 -WG.energyForOverdrive = 0 ---[[ -WG.windEnergy = 0 -WG.highPriorityBP = 0 -WG.lowPriorityBP = 0 ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local abs = math.abs -local echo = Spring.Echo -local GetMyTeamID = Spring.GetMyTeamID -local GetTeamResources = Spring.GetTeamResources -local GetTimer = Spring.GetTimer -local DiffTimers = Spring.DiffTimers -local Chili - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local col_metal = {136/255,214/255,251/255,1} -local col_energy = {1,1,0,1} -local col_buildpower = {0.8, 0.8, 0.2, 1} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local window -local bar_metal -local bar_energy -local bar_buildpower -local lbl_metal -local lbl_energy -local lbl_m_expense -local lbl_e_expense -local lbl_m_income -local lbl_e_income - -local blink = 0 -local blink_periode = 1 -local blink_alpha = 1 -local blinkM_status = 0 -local blinkE_status = 0 -local time_old = 0 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local builderDefs = {} -for id,ud in pairs(UnitDefs) do - if ud.isBuilder then - builderDefs[#builderDefs+1] = id - elseif (ud.buildSpeed > 0) then - builderDefs[#builderDefs+1] = id - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options_path = 'Settings/Interface/Resource Bars' - -local function option_workerUsageUpdate() - DestroyWindow() - CreateWindow() -end - -options = { - eexcessflashalways = {name='Always Flash On Energy Excess', type='bool', value=false}, - onlyShowExpense = {name='Only Show Expense', type='bool', value=true}, - workerUsage = {name = "Show Worker Usage", type = "bool", value=false, OnChange = option_workerUsageUpdate}, - energyFlash = {name = "Energy Stall Flash", type = "number", value=0.1, min=0,max=1,step=0.02}, - opacity = { - name = "Opacity", - type = "number", - value = 0, min = 0, max = 1, step = 0.01, - OnChange = function(self) window.color = {1,1,1,self.value}; window:Invalidate() end, - } -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Update(s) - - if not window then return end - - local myTeamID = GetMyTeamID() - - local eCurr, eStor, ePull, eInco, eExpe, eShar, eSent, eReci = GetTeamResources(myTeamID, "energy") - local mCurr, mStor, mPull, mInco, mExpe, mShar, mSent, mReci = GetTeamResources(myTeamID, "metal") - --- eStor = eStor - 10000 -- reduce by hidden storage - if eCurr > eStor then eCurr = eStor end -- cap by storage - if options.onlyShowExpense.value then - eExpe = eExpe - WG.energyWasted -- if there is energy wastage, dont show it as used pull energy - else - ePull = ePull - WG.energyWasted - end - - blink = (blink + s)%blink_periode - blink_alpha = math.abs(blink_periode/2 - blink) - - --// BLINK WHEN EXCESSING OR ON LOW ENERGY - local wastingM = mCurr >= mStor * 0.9 - if wastingM then - blinkM_status = true - bar_metal:SetColor( 136/255,214/255,251/255,0.65 + 0.35*blink_alpha ) - -- fade to green - --bar_metal:SetColor( 136/255*blink_alpha,214/255,251/255*blink_alpha,1) - elseif (blinkM_status) then - blinkM_status = false - bar_metal:SetColor( col_metal ) - end - - local wastingE = false - if options.eexcessflashalways.value then - wastingE = (WG.energyWasted > 0) - else - wastingE = (WG.energyWasted > eInco*0.05) and (WG.energyWasted > 15) - end - local stallingE = (eCurr <= eStor * options.energyFlash.value) and (eCurr < 1000) and (eCurr >= 0) - if stallingE or wastingE then - blinkE_status = true - bar_energy:SetValue( 100 ) - if wastingE then - bar_energy:SetColor(1,1,0,0.65 + 0.35 *blink_alpha) - -- blink between energy color and green - --bar_energy:SetColor(blink_alpha,1,0,1) - else - -- flash red if stalling - bar_energy:SetColor(1,0,0,blink_alpha) - end - elseif (blinkE_status) then - blinkE_status = false - bar_energy:SetColor( col_energy ) - end - - - local mPercent = 100 * mCurr / mStor - local ePercent = 100 * eCurr / eStor - - bar_metal:SetValue( mPercent ) - if wastingM then - bar_metal:SetCaption( (GreenStr.."%i/%i"):format(mCurr, mStor) ) - else - bar_metal:SetCaption( ("%i/%i"):format(mCurr, mStor) ) - end - - if (not blinkE_status) then - bar_energy:SetValue( ePercent ) - end - if stallingE then - bar_energy:SetCaption( (RedStr.."%i/%i"):format(eCurr, eStor) ) - elseif wastingE then - bar_energy:SetCaption( (GreenStr.."%i/%i"):format(eCurr, eStor) ) - else - bar_energy:SetCaption( ("%i/%i"):format(eCurr, eStor) ) - end - - - --// UPDATE THE LABELS JUST ONCE PER SECOND! - local time_now = GetTimer() - local diff = DiffTimers(time_now, time_old) - if (diff < 1) then return end - time_old = time_now - - local mTotal = mInco - mExpe - if options.onlyShowExpense.value then - mTotal = mInco - mExpe - else - mTotal = mInco - mPull - end - - if (mTotal >= 2) then - lbl_metal.font:SetColor(0,1,0,1) - elseif (mTotal > 0.1) then - lbl_metal.font:SetColor(1,0.7,0,1) - else - lbl_metal.font:SetColor(1,0,0,1) - end - local abs_mTotal = abs(mTotal) - if (abs_mTotal <0.1) then - lbl_metal:SetCaption( "\1770" ) - elseif (abs_mTotal >=10)and((abs(mTotal%1)<0.1)or(abs_mTotal>99)) then - lbl_metal:SetCaption( ("%+.0f"):format(mTotal) ) - else - lbl_metal:SetCaption( ("%+.1f"):format(mTotal) ) - end - - local eTotal - if options.onlyShowExpense.value then - eTotal = eInco - eExpe - else - eTotal = eInco - ePull - end - - if (eTotal >= 2) then - lbl_energy.font:SetColor(0,1,0,1) - elseif (eTotal > 0.1) then - lbl_energy.font:SetColor(1,0.7,0,1) - --elseif ((eStore - eCurr) < 50) then --// prevents blinking when overdrive is active - -- lbl_energy.font:SetColor(0,1,0,1) - else - lbl_energy.font:SetColor(1,0,0,1) - end - local abs_eTotal = abs(eTotal) - if (abs_eTotal<0.1) then - lbl_energy:SetCaption( "\1770" ) - elseif (abs_eTotal>=10)and((abs(eTotal%1)<0.1)or(abs_eTotal>99)) then - lbl_energy:SetCaption( ("%+.0f"):format(eTotal) ) - else - lbl_energy:SetCaption( ("%+.1f"):format(eTotal) ) - end - - if options.onlyShowExpense.value then - lbl_m_expense:SetCaption( ("%.1f"):format(mExpe) ) - lbl_e_expense:SetCaption( ("%.1f"):format(eExpe) ) - else - lbl_m_expense:SetCaption( ("%.1f"):format(mPull) ) - lbl_e_expense:SetCaption( ("%.1f"):format(ePull) ) - end - lbl_m_income:SetCaption( ("%.1f"):format(mInco) ) - lbl_e_income:SetCaption( ("%.1f"):format(eInco) ) - - - if options.workerUsage.value then - local bp_aval = 0 - local bp_use = 0 - local builderIDs = Spring.GetTeamUnitsByDefs(GetMyTeamID(), builderDefs) - if (builderIDs) then - for i=1,#builderIDs do - local unit = builderIDs[i] - local ud = UnitDefs[Spring.GetUnitDefID(unit)] - - local _, metalUse, _,energyUse = Spring.GetUnitResources(unit) - bp_use = bp_use + math.max(abs(metalUse), abs(energyUse)) - bp_aval = bp_aval + ud.buildSpeed - end - end - local buildpercent = bp_use/bp_aval * 100 - if bp_aval == 0 then - bar_buildpower:SetValue(0) - bar_buildpower:SetCaption("no workers") - else - bar_buildpower:SetValue(buildpercent) - bar_buildpower:SetCaption(("%.1f%%"):format(buildpercent)) - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - Chili = WG.Chili - - if (not Chili) then - widgetHandler:RemoveWidget() - return - end - - widgetHandler:RegisterGlobal("MexEnergyEvent", MexEnergyEvent) - --widgetHandler:RegisterGlobal("SendWindProduction", SendWindProduction) - --widgetHandler:RegisterGlobal("PriorityStats", PriorityStats) - - time_old = GetTimer() - - Spring.SendCommands("resbar 0") - - CreateWindow() - -end - -function widget:Shutdown() - window:Dispose() - Spring.SendCommands("resbar 1") -end - -function CreateWindow() - - local bars = 2 - if options.workerUsage.value then - bars = 3 - end - local function p(a) - return tostring(a).."%" - end - --// WINDOW - window = Chili.Window:New{ - color = {1,1,1,options.opacity.value}, - parent = Chili.Screen0, - dockable = true, - name="ResourceBars", - right = 0, - y = 0, - clientWidth = 445, - clientHeight = 45, - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - } - - --// METAL - Chili.Image:New{ - parent = window, - height = p(100/bars), - width = 25, - y = p(100/bars), - right = 0, - file = 'LuaUI/Images/ibeam.png', - } - bar_metal = Chili.Progressbar:New{ - parent = window, - color = col_metal, - height = p(100/bars), - right = 26, - x = 110, - y = p(100/bars), - tooltip = "This shows your current metal reserves", - font = {color = {1,1,1,1}, outlineColor = {0,0,0,0.7}, }, - } - lbl_metal = Chili.Label:New{ - parent = window, - height = p(100/bars), - width = 60, - x = 10, - y = p(100/bars), - valign = "center", - align = "right", - caption = "0", - autosize = false, - font = {size = 19, outline = true, outlineWidth = 4, outlineWeight = 3,}, - tooltip = "Your metal gain.", - } - lbl_m_income = Chili.Label:New{ - parent = window, - height = p(50/bars), - width = 40, - x = 70, - y = p(100/bars), - caption = "10.0", - valign = "center", - align = "center", - autosize = false, - font = {size = 12, outline = true, color = {0,1,0,1}}, - tooltip = "Your metal income.", - } - lbl_m_expense = Chili.Label:New{ - parent = window, - height = p(50/bars), - width = 40, - x = 70, - y = p(1.5*100/bars), - caption = "10.0", - valign = "center", - align = "center", - autosize = false, - font = {size = 12, outline = true, color = {1,0,0,1}}, - tooltip = "Your metal expense.", - } - - - --// ENERGY - Chili.Image:New{ - parent = window, - height = p(100/bars), - width = 25, - right = 0, - y = 1, - file = 'LuaUI/Images/energy.png', - } - bar_energy = Chili.Progressbar:New{ - parent = window, - color = col_energy, - height = p(100/bars), - right = 26, - x = 110, - y = 1, - tooltip = "Shows your current energy reserves.\n Anything above 100% will be burned by 'mex overdrive'\n which increases production of your mines", - font = {color = {1,1,1,1}, outlineColor = {0,0,0,0.7}, }, - } - lbl_energy = Chili.Label:New{ - parent = window, - height = p(100/bars), - width = 60, - x = 10, - y = 1, - valign = "center", - align = "right", - caption = "0", - autosize = false, - font = {size = 19, outline = true, outlineWidth = 4, outlineWeight = 3,}, - tooltip = "Your energy gain.", - } - lbl_e_income = Chili.Label:New{ - parent = window, - height = p(50/bars), - width = 40, - x = 70, - y = 1, - caption = "10.0", - valign = "center", - align = "center", - autosize = false, - font = {size = 12, outline = true, color = {0,1,0,1}}, - tooltip = "Your energy income.", - } - lbl_e_expense = Chili.Label:New{ - parent = window, - height = p(50/bars), - width = 40, - x = 70, - y = p(50/bars), - caption = "10.0", - valign = "center", - align = "center", - autosize = false, - font = {size = 12, outline = true, color = {1,0,0,1}}, - tooltip = "Your energy expense.", - } - - if not options.workerUsage.value then return end - -- worker usage - bar_buildpower = Chili.Progressbar:New{ - parent = window, - color = col_buildpower, - height = "33%", - right = 6, - x = 120, - y = "66%", - tooltip = "", - font = {color = {1,1,1,1}, outlineColor = {0,0,0,0.7}, }, - } -end - -function DestroyWindow() - window:Dispose() - window = nil -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function MexEnergyEvent(teamID, energyWasted, energyForOverdrive, totalIncome, metalFromOverdrive) - if (Spring.GetLocalTeamID() == teamID) then - WG.energyWasted = energyWasted - --Spring.Echo("energyWasted " .. energyWasted) - WG.energyForOverdrive = energyForOverdrive - end -end - ---[[ -function SendWindProduction(teamID, value) - WG.windEnergy = value -end - - -function PriorityStats(teamID, highPriorityBP, lowPriorityBP) - WG.highPriorityBP = highPriorityBP - WG.lowPriorityBP = lowPriorityBP -end ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_chili_selections_and_cursortip.lua b/LuaUI/Widgets_Evo/gui_chili_selections_and_cursortip.lua deleted file mode 100644 index 0bf0f130b..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_selections_and_cursortip.lua +++ /dev/null @@ -1,2171 +0,0 @@ --------------------------------------------------------------------------------- -function widget:GetInfo() - return { - name = "Chili Selections & CursorTip", - desc = "v0.061 Chili Selection Window and Cursor Tooltip.", - author = "CarRepairer, jK", - date = "2009-06-02", - license = "GNU GPL, v2 or later", - layer = 0, - experimental = false, - enabled = true, - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local spGetCurrentTooltip = Spring.GetCurrentTooltip -local spGetUnitDefID = Spring.GetUnitDefID -local spGetFeatureDefID = Spring.GetFeatureDefID -local spGetFeatureTeam = Spring.GetFeatureTeam -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitHealth = Spring.GetUnitHealth -local spGetUnitResources = Spring.GetUnitResources -local spTraceScreenRay = Spring.TraceScreenRay -local spGetTeamInfo = Spring.GetTeamInfo -local spGetPlayerInfo = Spring.GetPlayerInfo -local spGetTeamColor = Spring.GetTeamColor -local spGetUnitTooltip = Spring.GetUnitTooltip -local spGetModKeyState = Spring.GetModKeyState -local spGetMouseState = Spring.GetMouseState -local spSendCommands = Spring.SendCommands -local spGetUnitIsStunned = Spring.GetUnitIsStunned -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetSelectedUnitsCounts = Spring.GetSelectedUnitsCounts -local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount -local spGetSelectedUnitsByDef = Spring.GetSelectedUnitsSorted - -local echo = Spring.Echo - -local glColor = gl.Color ---local glAlphaTest = gl.AlphaTest -local glTexture = gl.Texture -local glTexRect = gl.TexRect - - -local abs = math.abs -local strFormat = string.format - - -include("keysym.h.lua") - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Chili -local Button -local Label -local Window -local StackPanel -local Panel -local Grid -local TextBox -local Image -local Multiprogressbar -local Progressbar -local LayoutPanel -local Grid - -local screen0 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local icon_size = 20 -local stillCursorTime = 0 - -local scrH, scrW = 0,0 -local old_ttstr, old_data -local old_mx, old_my = -1,-1 -local mx, my = -1,-1 -local showExtendedTip = false -local changeNow = false - -local window_tooltip2 -local windows = {} -local tt_healthbar, tt_unitID, tt_fid, tt_ud, tt_fd -local stt_ud, stt_unitID -local controls = {} -local controls_icons = {} - -local stack_main, stack_leftbar -local globalitems = {} - -local ttFontSize = 12 - -local green = '\255\1\255\1' -local cyan = '\255\1\255\255' -local white = '\255\255\255\255' -local yellow = '\255\255\255\1' - -local windMin = 0 -local windMax = 2.5 - -local updateFrequency = 0.2 - -local timer = 0 -local tweakShow = false - -local window_height = 130 -local real_window_corner -local window_corner -local numSelectedUnits = 0 -local selectedUnitsByDefCounts = {} -local selectedUnitsByDef = {} -local selectedUnits = {} -local selectionSortOrder = {} - - -local color = {} - -local cursor_size = 24 -- pencil and eraser -local iconFormat = '' - -local iconTypesPath = LUAUI_DIRNAME.."Configs/icontypes.lua" -local icontypes = VFS.FileExists(iconTypesPath) and VFS.Include(iconTypesPath) - -local tildepressed, drawing, erasing - -local windTooltips = { - ["armwin"] = true, -} - -local terraCmds = { - Ramp=1, - Level=1, - Raise=1, - Smooth=1, - Restore=1, -} -local terraTips = {} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- group info - -local selectedUnits = {} -local numSelectedUnits = 0 - -local gi_count = 0 -local gi_cost = 0 -local gi_finishedcost = 0 -local gi_hp = 0 -local gi_maxhp = 0 -local gi_metalincome = 0 -local gi_metaldrain = 0 -local gi_energyincome = 0 -local gi_energydrain = 0 -local gi_usedbp = 0 -local gi_totalbp = 0 - -local gi_str --group info string -local gi_label --group info Chili label - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options_path = 'Settings/Interface/Tooltip' -options_order = { 'tooltip_delay', 'hpshort', 'featurehp', 'hide_for_unreclaimable', 'showdrawtooltip','showterratooltip', - 'groupalways', 'showgroupinfo', 'squarepics', -} - -local function option_Deselect() - -- unselect to prevent errors - Spring.SelectUnitMap({}, false) - window_height = options.squarepics.value and 140 or 115 -end - -options = { - tooltip_delay = { - name = 'Tooltip display delay (0 - 4s)', - desc = 'Determines how long you can leave the mouse idle until the tooltip is displayed.', - type = 'number', - min=0,max=4,step=0.1, - value = 0, - }, - --[[ This is causing it so playername is not always visible, too difficult to maintain. - fontsize = { - name = 'Font Size (10-20)', - desc = 'Resizes the font of the tip', - type = 'number', - min=10,max=20,step=1, - value = 10, - OnChange = FontChanged, - }, - --]] - hpshort = { - name = "HP Short Notation", - type = 'bool', - value = false, - desc = 'Shows short number for HP.', - }, - featurehp = { - name = "Show HP on Features", - type = 'bool', - advanced = true, - value = false, - desc = 'Shows healthbar for features.', - OnChange = function() - --fixme: dispose? - controls['feature']=nil; - controls['corpse']=nil; - end, - }, - hide_for_unreclaimable = { - name = "Hide Tooltip for Unreclaimables", - type = 'bool', - advanced = true, - value = false, - desc = 'Don\'t show the tooltip for unreclaimable features.', - }, - showdrawtooltip = { - name = "Show Map-drawing Tooltip", - type = 'bool', - value = true, - desc = 'Show map-drawing tooltip when holding down the tilde (~).', - }, - showterratooltip = { - name = "Show Terraform Tooltip", - type = 'bool', - value = true, - desc = 'Show terraform tooltip when performing terraform commands.', - }, - - groupalways = {name='Always Group Units', type='bool', value=false, OnChange = option_Deselect, - path = 'Settings/Interface/Selected Units Window', - }, - showgroupinfo = {name='Show Group Info', type='bool', value=true, OnChange = option_Deselect, - path = 'Settings/Interface/Selected Units Window', - }, - squarepics = {name='Square Buildpics', type='bool', value=false, OnChange = option_Deselect, - path = 'Settings/Interface/Selected Units Window', - }, -} - ---[[ -local function FontChanged() - controls = {} - controls_icons = {} - ttFontSize = options.fontsize.value -end ---]] - ---options.fontsize.OnChange = FontChanged - -local function GetHealthColor(fraction, returnType) - local midpt = (fraction > .5) - local r, g - if midpt then - r = ((1-fraction)/0.5) - g = 1 - else - r = 1 - g = (fraction)/0.5 - end - if returnType == "char" then - return string.char(255,math.floor(255*r),math.floor(255*g),0) - end - return {r, g, 0, 1} -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function round(num, idp) - if (not idp) then - return math.floor(num+.5) - else - local mult = 10^(idp or 0) - return math.floor(num * mult + 0.5) / mult - end -end - ---from rooms widget by quantum -local function ToSI(num) - if type(num) ~= 'number' then - return 'Tooltip wacky error #55' - end - if (num == 0) then - return "0" - else - local absNum = abs(num) - if (absNum < 0.001) then - return strFormat("%.1fu", 1000000 * num) - elseif (absNum < 1) then - return strFormat("%.1f", num) - elseif (absNum < 1000) then - return strFormat("%.0f", num) - elseif (absNum < 1000000) then - return strFormat("%.1fk", 0.001 * num) - else - return strFormat("%.1fM", 0.000001 * num) - end - end -end -local function ToSIPrec(num) -- more presise - if type(num) ~= 'number' then - return 'Tooltip wacky error #56' - end - if not options.hpshort.value then - return num - end - if (num == 0) then - return "0" - else - local absNum = abs(num) - if (absNum < 0.001) then - return strFormat("%.2fu", 1000000 * num) - elseif (absNum < 1) then - return strFormat("%.2f", num) - elseif (absNum < 1000) then - return strFormat("%.1f", num) - elseif (absNum < 1000000) then - return strFormat("%.2fk", 0.001 * num) - else - return strFormat("%.2fM", 0.000001 * num) - end - end -end - - -local function numformat(num, displayPlusMinus) - return comma_value(ToSIPrec(num), displayPlusMinus) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- group selection - ---updates cost, HP, and resourcing info for group info -local function UpdateDynamicGroupInfo() - gi_cost = 0 - gi_hp = 0 - gi_metalincome = 0 - gi_metaldrain = 0 - gi_energyincome = 0 - gi_energydrain = 0 - gi_usedbp = 0 - - for i = 1, numSelectedUnits do - local id = selectedUnits[i] - - local ud = UnitDefs[spGetUnitDefID(id) or 0] - if ud then - local name = ud.name - local hp, _, paradam, cap, build = spGetUnitHealth(id) - local mm,mu,em,eu = spGetUnitResources(id) - - if name ~= "terraunit" then - gi_cost = gi_cost + ud.metalCost*build - gi_hp = gi_hp + hp - - local stunned_or_inbuld = spGetUnitIsStunned(id) - if not stunned_or_inbuld then - if name == 'armmex' or name =='cormex' or name =='emetalextractor' or name =='euwmetalextractor' then -- mex case - local tooltip = spGetUnitTooltip(id) - - local baseMetal = 0.5 - local s = tooltip:match("Makes: ([^ ]+)") - if s ~= nil then - baseMetal = tonumber(s) - end - - s = tooltip:match("Overdrive: %+([0-9]+)") - local od = 0 - if s ~= nil then - od = tonumber(s) - end - - gi_metalincome = gi_metalincome + baseMetal + baseMetal * od / 100 - - s = tooltip:match("Energy: ([^ ]+)") - if s ~= nil then - gi_energydrain = gi_energydrain - (tonumber(s) or 0) - end - else - gi_metalincome = gi_metalincome + mm - gi_metaldrain = gi_metaldrain + mu - gi_energyincome = gi_energyincome + em - gi_energydrain = gi_energydrain + eu - end - - if ud.buildSpeed ~= 0 then - gi_usedbp = gi_usedbp + mu - end - end - end - end - - end - - gi_cost = numformat(gi_cost) - gi_hp = numformat(gi_hp) - gi_metalincome = numformat(gi_metalincome) - gi_metaldrain = numformat(gi_metaldrain) - gi_energyincome = numformat(gi_energyincome) - gi_energydrain = numformat(gi_energydrain) - gi_usedbp = numformat(gi_usedbp) -end - ---updates values that don't change over time for group info -local function UpdateStaticGroupInfo() - gi_count = numSelectedUnits - gi_finishedcost = 0 - gi_totalbp = 0 - gi_maxhp = 0 - - for i = 1, numSelectedUnits do - local ud = UnitDefs[spGetUnitDefID(selectedUnits[i]) or 0] - if ud then - local name = ud.name - if name ~= "terraunit" then - gi_totalbp = gi_totalbp + ud.buildSpeed - gi_maxhp = gi_maxhp + ud.health - gi_finishedcost = gi_finishedcost + ud.metalCost - end - end - end - gi_finishedcost = numformat(gi_finishedcost) - gi_totalbp = numformat(gi_totalbp) - gi_maxhp = numformat(gi_maxhp) -end - - - ---this is a separate function to allow group info to be regenerated without reloading the whole tooltip -local function WriteGroupInfo() - if not options.showgroupinfo.value then return end - if gi_label then - window_corner:RemoveChild(gi_label) - end - gi_str = - "Selected Units " .. gi_count .. "\n" .. - "Health " .. gi_hp .. " / " .. gi_maxhp .. "\n" .. - "Cost " .. gi_cost .. " / " .. gi_finishedcost .. "\n" .. - "Metal \255\0\255\0+" .. gi_metalincome .. "\255\255\255\255 / \255\255\0\0-" .. gi_metaldrain .. "\255\255\255\255\n" .. - "Energy \255\0\255\0+" .. gi_energyincome .. "\255\255\255\255 / \255\255\0\0-" .. gi_energydrain .. "\255\255\255\255\n" .. - "Build Power " .. gi_usedbp .. " / " .. gi_totalbp - - gi_label = Label:New{ - parent = window_corner; - y=5, - right=5, - x=window_corner.width-150, - height = '100%'; - width = 120, - caption = gi_str; - valign = 'top'; - fontSize = 12; - fontshadow = true, - fontOutline = true, - } -end - - ----------------------------------------------------------------- ----------------------------------------------------------------- - -local function Show(obj) - if (not obj:IsDescendantOf(screen0)) then - screen0:AddChild(obj) - end -end - - -local function GetUnitDesc(unitID, ud) - if not (unitID or ud) then return '' end - - local lang = WG.lang or 'en' - if lang == 'en' then - if unitID then - local tooltip = ud.tooltip - if windTooltips[ud.name] and not Spring.GetUnitRulesParam(unitID,"NotWindmill") and Spring.GetUnitRulesParam(unitID,"minWind") then - tooltip = tooltip .. "\nWind Range " .. string.format("%.1f", Spring.GetUnitRulesParam(unitID,"minWind")) .. " - " .. string.format("%.1f", Spring.GetGameRulesParam("WindMax") ) - end - return tooltip - end - return ud.tooltip - end - local suffix = ('_' .. lang) - local desc = ud.customParams and ud.customParams['description' .. suffix] or ud.tooltip or 'Description error' - if unitID then - - local tooltip = ud.tooltip - if windTooltips[ud.name] and not Spring.GetUnitRulesParam(unitID,"NotWindmill") then - tooltip = tooltip .. "\nWind Range " .. string.format("%.1f", Spring.GetUnitRulesParam(unitID,"minWind")) .. " - " .. Spring.GetGameRulesParam("WindMax") - end - return tooltip - end - return desc -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function AddSelectionIcon(barGrid,unitid,defid,unitids,counts) - local ud = UnitDefs[defid] - local item = LayoutPanel:New{ - name = unitid or defid; - parent = barGrid; - width = 50; - height = 62; - columns = 1; - padding = {0,0,0,0}; - itemPadding = {0,0,0,0}; - itemMargin = {0,0,0,1}; - resizeItems = false; - centerItems = false; - autosize = true; - } - local img = Image:New{ - parent = item; - tooltip = ud.humanName .. " - " .. ud.tooltip.. "\n\255\0\255\0Click: Select \nRightclick: Deselect \nAlt+Click: Select One \nCtrl+click: Select Type \nMiddle-click: Goto"; - file2 = (WG.GetBuildIconFrame)and(WG.GetBuildIconFrame(UnitDefs[defid])); - file = "#" .. defid; - keepAspect = true; - height = 50; - --height = 50; - width = 50; - padding = {0,0,0,0}; --FIXME something overrides the default in image.lua!!!! - OnClick = {function(_,_,_,button) - - local alt, ctrl, meta, shift = spGetModKeyState() - - if (button==3) then - if (unitid and not ctrl) then - --// deselect a single unit - for i=1,numSelectedUnits do - if (selectedUnits[i]==unitid) then - table.remove(selectedUnits,i) - break - end - end - else - --// deselect a whole unitdef block - for i=numSelectedUnits,1,-1 do - if (Spring.GetUnitDefID(selectedUnits[i])==defid) then - table.remove(selectedUnits,i) - if (alt) then - break - end - end - end - end - Spring.SelectUnitArray(selectedUnits) - --update selected units right now - local sel = Spring.GetSelectedUnits() - widget:SelectionChanged(sel) - elseif button == 1 then - if not ctrl then - if (alt) then - Spring.SelectUnitArray({ selectedUnitsByDef[defid][1] }) -- only 1 - else - Spring.SelectUnitArray(unitids) -- no modifier - select all - end - else - -- select all units of the icon type - Spring.SelectUnitArray(selectedUnitsByDef[defid]) - - --local sorted = Spring.GetTeamUnitsSorted(Spring.GetMyTeamID()) - --local units = sorted[defid] - --if units then Spring.SelectUnitArray(units) end - end - else --button2 (middle) - local x,y,z = Spring.GetUnitPosition( unitids[1] ) - Spring.SetCameraTarget(x,y,z, 1) - end - end} - }; - if ((counts or 1)>1) then - Label:New{ - parent = img; - align = "right"; - valign = "top"; - x = 8; - --y = 30; - y = 20; - width = 40; - fontsize = 20; - fontshadow = true; - fontOutline = true; - caption = counts; - }; - end - Progressbar:New{ - parent = item; - name = 'health'; - width = 50; - height = 5; - max = 1; - color = {0.0,0.99,0.0,1}; - }; -end - -local function MakeUnitGroupSelectionToolTip() - window_corner:ClearChildren(); - - local barGrid = LayoutPanel:New{ - name = 'Bars'; - resizeItems = false; - centerItems = false; - parent = window_corner; - height = "100%"; - x=0, - --width = "100%"; - right=options.showgroupinfo.value and 120 or 0, - --columns = 5; - itemPadding = {0,0,0,0}; - itemMargin = {0,0,2,2}; - tooltip = "Left Click: Just select clicked unit(s)\nRight Click: Deselect unit(s)"; - } - --if check is done in target function - --if options.showgroupinfo.value then - WriteGroupInfo() - --end - - if ((numSelectedUnits<8) and (not options.groupalways.value)) then - for i=1,numSelectedUnits do - local unitid = selectedUnits[i] - local defid = spGetUnitDefID(unitid) - local unitids = {unitid} - - AddSelectionIcon(barGrid,unitid,defid,unitids) - end - else - for i=1,#selectionSortOrder do - local defid = selectionSortOrder[i] - local unitids = selectedUnitsByDef[defid] - local counts = selectedUnitsByDefCounts[defid] - - AddSelectionIcon(barGrid,nil,defid,unitids,counts) - end - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -local function UpdateSelectedUnitsTooltip() - local selectedUnits = selectedUnits - if (numSelectedUnits>1) then - local barsContainer = window_corner.childrenByName['Bars'] - - if ((numSelectedUnits<8) and (not options.groupalways.value)) then - for i=1,numSelectedUnits do - local unitid = selectedUnits[i] - - local unitIcon = barsContainer.childrenByName[unitid] - --Spring.Echo(unitid) - local healthbar = unitIcon.childrenByName['health'] - local health, maxhealth = spGetUnitHealth(unitid) - if (health) then - healthbar:SetValue(health/maxhealth) - healthbar.tooltip = numformat(health) .. ' / ' .. numformat(maxhealth) - healthbar.color = GetHealthColor(health/maxhealth) - end - end - else - for defid,unitids in pairs(selectedUnitsByDef) do - local health = 0 - local maxhealth = 0 - for i=1,#unitids do - local uhealth, umaxhealth = spGetUnitHealth(unitids[i]) - health = health + (uhealth or 0) - maxhealth = maxhealth + (umaxhealth or 0) - end - - local unitGroup = barsContainer.childrenByName[defid] - local healthbar = unitGroup.childrenByName['health'] - healthbar:SetValue(health/maxhealth) - healthbar.tooltip = numformat(health) .. ' / ' .. numformat(maxhealth) - healthbar.color = GetHealthColor(health/maxhealth) - end - end - - - end -end - - - -function comma_value(amount, displayPlusMinus) - local formatted - - -- amount is a string when ToSI is used before calling this function - if type(amount) == "number" then - if (amount ==0) then formatted = "0" else - if (amount < 20 and (amount * 10)%10 ~=0) then - if displayPlusMinus then formatted = strFormat("%+.1f", amount) - else formatted = strFormat("%.1f", amount) end - else - if displayPlusMinus then formatted = strFormat("%+d", amount) - else formatted = strFormat("%d", amount) end - end - end - else - formatted = amount .. "" - end - - if options.hpshort.value then - local k - while true do - formatted, k = formatted:gsub("^(-?%d+)(%d%d%d)", '%1,%2') - if (k==0) then - break - end - end - end - return formatted -end - -local function AdjustWindow(window) - local nx - if (0 > window.x) then - nx = 0 - elseif (window.x + window.width > screen0.width) then - nx = screen0.width - window.width - end - - local ny - if (0 > window.y) then - ny = 0 - elseif (window.y + window.height > screen0.height) then - ny = screen0.height - window.height - end - - if (nx or ny) then - window:SetPos(nx,ny) - end - - --//FIXME If we don't do this the stencil mask of stack_rightside doesn't get updated, when we move the mouse (affects only if type(stack_rightside) == StackPanel) - stack_main:Invalidate() - stack_leftbar:Invalidate() - - if window_tooltip2:GetChildByName('leftbar') then - window_tooltip2:GetChildByName('leftbar'):Invalidate() - end - window_tooltip2:GetChildByName('main'):Invalidate() - -end - - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local UnitDefByHumanName_cache = {} -local function GetUnitDefByHumanName(humanName) - local cached_udef = UnitDefByHumanName_cache[humanName] - if (cached_udef ~= nil) then - return cached_udef - end - - for _,ud in pairs(UnitDefs) do - if ud.humanName == humanName then - UnitDefByHumanName_cache[humanName] = ud - return ud - end - end - UnitDefByHumanName_cache[humanName] = false - return false -end - -local function tooltipBreakdown(tooltip) - local unitname = nil - tooltip = tooltip:gsub('\r', '\n') - tooltip = tooltip:gsub('\n+', '\n') - - local requires, provides, consumes, unitDef, buildType, morph_data - if tooltip:find('Requires', 5, true) == 5 then - requires, tooltip = tooltip:match('....Requires([^\n]*)\n....(.*)') - end - - if tooltip:find('Provides', 1, true) == 1 then - provides, tooltip = tooltip:match('Provides([^\n]*)\n(.*)') - end - - if tooltip:find('Consumes', 5, true) == 5 then - --consumes, tooltip = tooltip:match('....Consumes([^\n]*)\n....(.*)') - end - - if tooltip:find('Build', 1, true) == 1 then - local start,fin = tooltip:find([[ - ]], 1, true) - if start and fin then - - local unitHumanName - - if (tooltip:find('Build Unit:', 1, true) == 1) then - buildType = 'buildunit' - unitHumanName = tooltip:sub(13,start-1) - else - buildType = 'build' - unitHumanName = tooltip:sub(8,start-1) - end - unitDef = GetUnitDefByHumanName(unitHumanName) - - tooltip = tooltip:sub(fin+1) - end - - elseif tooltip:find('Morph', 1, true) == 1 then - - local unitHumanName = tooltip:gsub('Morph into a (.*)(time).*', '%1'):gsub('[^%a \-]', '') - unitDef = GetUnitDefByHumanName(unitHumanName) - - local needunit - if tooltip:find('needs unit', 1, true) then - needunit = tooltip:gsub('.*needs unit: (.*)', '%1'):gsub('[^%a \-]', '') - end - morph_data = { - morph_time = tooltip:gsub('.*time:(.*)metal.*', '%1'):gsub('[^%d]', ''), - morph_cost = tooltip:gsub('.*metal: (.*)energy.*', '%1'):gsub('[^%d]', ''), - morph_prereq = needunit, - } - end - - return { - tooltip = tooltip, - unitDef = unitDef, - buildType = buildType, - morph_data = morph_data, - requires = requires, - provides = provides, - consumes = consumes, - } -end - ----------------------------------------------------------------- - -local function SetHealthbar(tt_healthbar,health, maxhealth) - if health then - - tt_health_fraction = health/maxhealth - tt_healthbar:SetValue(tt_health_fraction) - if options.hpshort.value then - tt_healthbar:SetCaption(numformat(health) .. ' / ' .. numformat(maxhealth)) - else - tt_healthbar:SetCaption(math.ceil(health) .. ' / ' .. math.ceil(maxhealth)) - end - - tt_healthbar.color = GetHealthColor(tt_health_fraction) - - else - tt_healthbar.color = {0,0,0.5, 1} - local maxhealth = (tt_fd and tt_fd.health) or (tt_ud and tt_ud.health) or 0 - tt_healthbar:SetValue(1) - if options.hpshort.value then - tt_healthbar:SetCaption('??? / ' .. numformat(maxhealth)) - else - tt_healthbar:SetCaption('??? / ' .. math.ceil(maxhealth)) - end - end -end - -local function SetHealthbars() - if - not ( tt_unitID or tt_fid or stt_unitID ) - then - return - end - local tt_healthbar_stack, tt_healthbar - - local health, maxhealth - if tt_unitID then - health, maxhealth = spGetUnitHealth(tt_unitID) - tt_healthbar = globalitems.hp_unit:GetChildByName('bar') - SetHealthbar(tt_healthbar,health, maxhealth) - elseif tt_fid then - health, maxhealth = Spring.GetFeatureHealth(tt_fid) - tt_healthbar_stack = tt_ud and globalitems.hp_corpse or globalitems.hp_feature - tt_healthbar = tt_healthbar_stack:GetChildByName('bar') - SetHealthbar(tt_healthbar,health, maxhealth) - end - - if stt_unitID then - health, maxhealth = spGetUnitHealth(stt_unitID) - tt_healthbar = globalitems.hp_selunit:GetChildByName('bar') - SetHealthbar(tt_healthbar,health, maxhealth) - end -end - - -local function KillTooltip(force) - old_ttstr = '' - tt_unitID = nil - - if window_tooltip2 and window_tooltip2:IsDescendantOf(screen0) then - screen0:RemoveChild(window_tooltip2) - end -end - -local function UpdateResourceStack(tooltip_type, unitID, ud, tooltip) - - local stack_children = {} - - local metal, energy = 0,0 - local color_m = {1,1,1,1} - local color_e = {1,1,1,1} - - local resource_tt_name = 'resources_' .. tooltip_type - - if tooltip_type == 'feature' or tooltip_type == 'corpse' then - metal = ud.metal - energy = ud.energy - - if unitID then - local m, _, e, _, _ = Spring.GetFeatureResources(unitID) - metal = m or metal - energy = e or energy - end - else --tooltip_type == 'unit' or 'selunit' - local metalMake, metalUse, energyMake, energyUse = Spring.GetUnitResources(unitID) - - if metalMake then - metal = metalMake - metalUse - end - if energyMake then - energy = energyMake - energyUse - end - - -- special cases for mexes - if ud.name=='cormex' or ud.name =='emetalextractor' or ud.name =='euwmetalextractor' then - local baseMetal = 0.5 - local s = tooltip:match("Makes: ([^ ]+)") - if s ~= nil then baseMetal = tonumber(s) end - - s = tooltip:match("Overdrive: %+([0-9]+)") - local od = 0 - if s ~= nil then od = tonumber(s) end - - metal = metal + baseMetal + baseMetal * od / 100 - - s = tooltip:match("Energy: ([^ \n]+)") - s = tonumber(s) - if s ~= nil and type(s) == 'number' then - energy = energy + tonumber(s) - end - end - - end - - if tooltip_type == 'feature' or tooltip_type == 'corpse' then - color_m = {1,1,1,1} - color_e = {1,1,1,1} - else - if metal > 0 then - color_m = {0,1,0,1} - elseif metal < 0 then - color_m = {1,0,0,1} - end - if energy > 0 then - color_e = {0,1,0,1} - elseif energy < 0 then - color_e = {1,0,0,1} - end - end - local displayPlusMinus = tooltip_type ~= 'feature' and tooltip_type ~= 'corpse' - - if globalitems[resource_tt_name] then - local metalcontrol = globalitems[resource_tt_name]:GetChildByName('metal') - local energycontrol = globalitems[resource_tt_name]:GetChildByName('energy') - - metalcontrol.font:SetColor(color_m) - energycontrol.font:SetColor(color_e) - - metalcontrol:SetCaption( numformat(metal, displayPlusMinus) ) - energycontrol:SetCaption( numformat(energy, displayPlusMinus) ) - return - end - - local lbl_metal2 = Label:New{ name='metal', caption = numformat(metal, displayPlusMinus), autosize=true, fontSize=ttFontSize, valign='center' } - local lbl_energy2 = Label:New{ name='energy', caption = numformat(energy, displayPlusMinus), autosize=true, fontSize=ttFontSize, valign='center' } - - local lbl_empty = Label:New{ name='blank', caption = ' ', autosize=true, fontSize=ttFontSize, valign='center' } - - globalitems[resource_tt_name] = StackPanel:New{ - centerItems = false, - autoArrangeV = true, - orientation='horizontal', - resizeItems=false, - width = '100%', - height = icon_size+1, - padding = {0,0,0,0}, - itemPadding = {0,0,0,0}, - itemMargin = {5,0,0,0}, - children = { - Image:New{file='LuaUI/images/ibeam.png',height= icon_size,width= icon_size, fontSize=ttFontSize,}, - lbl_metal2, - lbl_empty, - Image:New{file='LuaUI/images/energy.png',height= icon_size,width= icon_size, fontSize=ttFontSize,}, - lbl_energy2, - }, - } -end - -local function PlaceToolTipWindow2(x,y) - if not window_tooltip2 then return end - - if not window_tooltip2:IsDescendantOf(screen0) then - screen0:AddChild(window_tooltip2) - end - - local x = x - local y = scrH-y - window_tooltip2:SetPos(x,y) - AdjustWindow(window_tooltip2) - - window_tooltip2:BringToFront() -end - -local function UpdateMorphControl(morph_data) - - local morph_controls = {} - - local height = 0 - - local morph_time = '' - local morph_cost = '' - local morph_prereq = '' - if morph_data then - morph_time = morph_data.morph_time - morph_cost = morph_data.morph_cost - morph_prereq = morph_data.morph_prereq - height = icon_size+1 - - end - if globalitems.morphs then - globalitems.morphs.height=height - - globalitems.morphs:GetChildByName('time'):SetCaption(morph_time) - globalitems.morphs:GetChildByName('cost'):SetCaption(morph_cost) - globalitems.morphs:GetChildByName('prereq'):SetCaption(morph_prereq and ('Need Unit: '..morph_prereq) or '') - - --[[ - globalitems.morphs:GetChildByName('time').height=height - globalitems.morphs:GetChildByName('time'):Invalidate() - globalitems.morphs:Invalidate() - globalitems.morphs:UpdateLayout() - --]] - return - end - height = icon_size+1 - - morph_controls[#morph_controls + 1] = Label:New{ caption = 'Morph: ', height= icon_size, valign='center', textColor=color.tooltip_info, autosize=false, width=45, fontSize=ttFontSize,} - morph_controls[#morph_controls + 1] = Image:New{file='LuaUI/images/clock.png',height= icon_size,width= icon_size, fontSize=ttFontSize,} - morph_controls[#morph_controls + 1] = Label:New{ name='time', caption = morph_time, valign='center', textColor=color.tooltip_info, autosize=false, width=25, fontSize=ttFontSize,} - morph_controls[#morph_controls + 1] = Image:New{file='LuaUI/images/ibeam.png',height= icon_size,width= icon_size, fontSize=ttFontSize,} - morph_controls[#morph_controls + 1] = Label:New{ name='cost', caption = morph_cost, valign='center', textColor=color.tooltip_info, autosize=false, width=25, fontSize=ttFontSize,} - - --if morph_prereq then - --morph_controls[#morph_controls + 1] = Label:New{ 'prereq' caption = 'Need Unit: '..morph_prereq, valign='center', textColor=color.tooltip_info, autosize=false, width=180, fontSize=ttFontSize,} - morph_controls[#morph_controls + 1] = Label:New{ name='prereq', caption = morph_prereq and ('Need Unit: '..morph_prereq) or '', valign='center', textColor=color.tooltip_info, autosize=false, width=80, fontSize=ttFontSize,} - --end - - - globalitems.morphs = StackPanel:New { - centerItems = false, - autoArrangeV = true, - orientation='horizontal', - resizeItems=false, - width = '100%', - height = height, - padding = {0,0,0,0}, - itemPadding = {0,0,0,0}, - itemMargin = {0,0,0,0}, - children = morph_controls, - } -end - - -local function GetHelpText(tooltip_type) - local _,_,_,buildUnitName = Spring.GetActiveCommand() - if buildUnitName then - return '' - end - - local sc_caption = '' - if tooltip_type == 'build' then - sc_caption = 'Space+click: Show unit stats' - elseif tooltip_type == 'buildunit' then - if showExtendedTip then - - sc_caption = - 'Shift+click: x5 multiplier.\n'.. - 'Ctrl+click: x20 multiplier.\n'.. - 'Alt+click: Add units to front of queue. \n'.. - 'Rightclick: remove units from queue.\n'.. - 'Space+click: Show unit stats' - else - sc_caption = '(Hold Spacebar for help)' - end - - elseif tooltip_type == 'morph' then - sc_caption = 'Space+click: Show unit stats' - else - sc_caption = 'Space+click: Show unit stats' - end - --return TextBox:New{ text = sc_caption, textColor=color.tooltip_help, width=250, fontSize=ttFontSize, } - return sc_caption - -end - -local function MakeStack(ttname, ttstackdata, leftbar) - local children = {} - local height = 0 - - for i, item in ipairs( ttstackdata ) do - local stack_children = {} - local empty = false - - if item.directcontrol then - local directitem = globalitems[item.directcontrol] - stack_children[#stack_children+1] = directitem - - elseif item.text or item.icon then - local curFontSize = ttFontSize + (item.fontSize or 0) - if ttname == 'tt_text2' then - curFontSize = curFontSize +2 - end - - local itemtext = item.text or '' - local stackchildren = {} - - if item.icon then - controls_icons[ttname][item.name] = Image:New{ file = item.icon, height= icon_size,width= icon_size, fontSize=curFontSize,} - stack_children[#stack_children+1] = controls_icons[ttname][item.name] - end - - if item.wrap then - controls[ttname][item.name] = TextBox:New{ - name=item.name, - autosize=false, - text = itemtext , - width='100%', - valign="ascender", - font={ size=curFontSize }, - fontshadow = true, - fontOutline = true, - } - stack_children[#stack_children+1] = controls[ttname][item.name] - else - local rightmargin = item.icon and icon_size or 0 - local width = (leftbar and 50 or 230) - rightmargin - - --controls[ttname][item.name] = Label:New{ autosize=false, name=item.name, caption = itemtext, fontSize=curFontSize, valign='center', height=icon_size+5, width = width } - controls[ttname][item.name] = Label:New{ - fontShadow=true, - defaultHeight=0, - autosize=true, - name=item.name, - caption = itemtext, - fontSize=curFontSize, - fontshadow = true, - fontOutline = true, - valign='center', - height=icon_size+5, - x=icon_size+5, - right=1, - } - stack_children[#stack_children+1] = controls[ttname][item.name] - end - - if (not item.icon) and itemtext == '' then - controls[ttname][item.name]:Resize('100%',0) - end - - - else - empty = true - end - - if not empty then - children[#children+1] = StackPanel:New{ - centerItems = false, - autoArrangeV = true, - orientation='horizontal', - resizeItems=false, - width = '100%', - autosize=true, - padding = {1,1,1,1}, - itemPadding = {1,1,0,0}, - itemMargin = {4,0,0,0}, - children = stack_children, - } - end - end - return children -end - -local function UpdateStack(ttname, stack) - for i, item in ipairs( stack ) do - local name = item.name - - if item.directcontrol then - --local directitem = (type( item.directcontrol ) == 'string') and globalitems[item.directcontrol] or item.directcontrol - local directitem = globalitems[item.directcontrol] - --[[ - if hideitems[item.directcontrol] then - directitem:Resize('100%',0) - else - directitem:Resize('100%',globalitemheights[item.directcontrol]) - end - --]] - end - if controls[ttname][name] then - if item.wrap then - controls[ttname][name]:SetText( item.text ) - controls[ttname][name]:Invalidate() - else - controls[ttname][name]:SetCaption( item.text ) - end - end - if controls_icons[ttname][name] then - if item.icon then - controls_icons[ttname][name].file = item.icon - controls_icons[ttname][name]:Invalidate() - end - end - - end - -end - -local function SetTooltip(tt_window) - if not window_tooltip2 or window_tooltip2 ~= tt_window then - KillTooltip(true) - window_tooltip2 = tt_window - end - PlaceToolTipWindow2(mx+20,my-20) -end - -local function BuildTooltip2(ttname, ttdata, sel) - if not ttdata.main then - echo ' Missing ttdata.main' - return - end - if controls[ttname] and not sel then - UpdateStack(ttname, ttdata.main) - if ttdata.leftbar then - UpdateStack(ttname, ttdata.leftbar) - end - else - controls[ttname] = {} - controls_icons[ttname] = {} - local stack_leftbar_temp, stack_main_temp - local children_main = MakeStack(ttname, ttdata.main) - local leftside = false - if ttdata.leftbar then - children_leftbar = MakeStack(ttname, ttdata.leftbar) - - stack_leftbar_temp = - StackPanel:New{ - name = 'leftbar', - orientation='vertical', - padding = {0,0,0,0}, - itemPadding = {1,0,0,0}, - itemMargin = {0,0,0,0}, - resizeItems=false, - autosize=true, - width = 70, - children = children_leftbar, - } - leftside = true - else - stack_leftbar_temp = StackPanel:New{ width=10, } - end - - stack_main_temp = StackPanel:New{ - name = 'main', - autosize=true, - x = leftside and 60 or 0, - y = 0, - orientation='vertical', - centerItems = false, - width = 300, - padding = {0,0,0,0}, - itemPadding = {1,0,0,0}, - itemMargin = {0,0,0,0}, - resizeItems=false, - children = children_main, - } - if not sel then - windows[ttname] = Window:New{ - name = ttname, - --skinName = 'default', - useDList = false, - resizable = false, - draggable = false, - autosize = true, - --tweakDraggable = true, - backgroundColor = color.tooltip_bg, - children = { stack_leftbar_temp, stack_main_temp, } - } - end - if sel then - return stack_main_temp, stack_leftbar_temp - end - end - SetTooltip(windows[ttname]) -end - -local function GetUnitIcon(ud) - if not ud then return false end - return icontypes - and icontypes[(ud and ud.iconType or "default")].bitmap - or 'icons/'.. ud.iconType ..iconFormat -end - - -local function MakeToolTip_Text(text) - BuildTooltip2('tt_text2',{ - main = { - { name='text', text = text, wrap=true }, - } - }) -end - -local function UpdateBuildpic( ud, globalitem_name, unitID ) - if not ud then return end - - if not globalitems[globalitem_name] then - globalitems[globalitem_name] = Image:New{ - file = "#" .. ud.id, - file2 = (WG.GetBuildIconFrame)and(WG.GetBuildIconFrame(ud)), - keepAspect = true, - height = 55, - width = 55, - unitID = unitID, - - } - if globalitem_name == 'buildpic_selunit' then - globalitems[globalitem_name].OnClick = {function(self,_,_,button) - if (button==2) then - --button2 (middle) - local x,y,z = Spring.GetUnitPosition( self.unitID ) - if x then - Spring.SetCameraTarget(x,y,z, 1) - end - end - end} - end - return - end - - globalitems[globalitem_name].unitID = unitID - globalitems[globalitem_name].file = "#" .. ud.id - globalitems[globalitem_name].file2 = (WG.GetBuildIconFrame)and(WG.GetBuildIconFrame(ud)) - globalitems[globalitem_name]:Invalidate() -end - -local function MakeToolTip_UD(tt_table) - - local helptext = GetHelpText(tt_table.buildType) - local iconPath = GetUnitIcon(tt_table.unitDef) - - local tt_structure = { - leftbar = { - tt_table.morph_data - and { name= 'bp', directcontrol = 'buildpic_morph' } - or { name= 'bp', directcontrol = 'buildpic_ud' }, - { name = 'cost', icon = 'LuaUI/images/ibeam.png', text = cyan .. numformat(tt_table.unitDef.metalCost), }, - }, - main = { - { name = 'udname', icon = iconPath, text = tt_table.unitDef.humanName, fontSize=2 }, - { name = 'tt', text = tt_table.unitDef.tooltip, wrap=true }, - { name='health', icon = 'LuaUI/images/commands/Bold/health.png', text = numformat(tt_table.unitDef.health), }, - --[[ - { name = 'requires', text = tt_table.requires and ('REQUIRES' .. tt_table.requires) or '', }, - { name = 'provides', text = tt_table.provides and ('PROVIDES' .. tt_table.provides) or '', }, - { name = 'consumes', text = tt_table.consumes and ('CONSUMES' .. tt_table.consumes) or '', }, - --]] - tt_table.morph_data and { name='morph', directcontrol = 'morphs' } or {}, - { name='helptext', text = green .. helptext, wrap=true}, - - }, - } - - if tt_table.morph_data then - UpdateBuildpic( tt_table.unitDef, 'buildpic_morph' ) - UpdateMorphControl( tt_table.morph_data ) - - BuildTooltip2('morph2', tt_structure) - else - UpdateBuildpic( tt_table.unitDef, 'buildpic_ud' ) - BuildTooltip2('ud2', tt_structure) - end - -end - - -local function MakeToolTip_Unit(data, tooltip) - local unitID = data - local team, fullname - tt_unitID = unitID - team = spGetUnitTeam(tt_unitID) - tt_ud = UnitDefs[ spGetUnitDefID(tt_unitID) or -1] - - fullname = ((tt_ud and tt_ud.humanName) or "") - - if not (tt_ud) then - --fixme - return false - end - --local alliance = spGetUnitAllyTeam(tt_unitID) - local _, player = spGetTeamInfo(team) - local playerName = player and spGetPlayerInfo(player) or 'noname' - local teamColor = Chili.color2incolor(spGetTeamColor(team)) - ---local unittooltip = tt_unitID and spGetUnitTooltip(tt_unitID) or (tt_ud and tt_ud.tooltip) or "" - local unittooltip = GetUnitDesc(tt_unitID, tt_ud) - local iconPath = GetUnitIcon(tt_ud) - - UpdateResourceStack( 'unit', unitID, tt_ud, tooltip ) - - local tt_structure = { - leftbar = { - { name= 'bp', directcontrol = 'buildpic_unit' }, - { name= 'cost', icon = 'LuaUI/images/ibeam.png', text = cyan .. numformat((tt_ud and tt_ud.metalCost) or '0') }, - }, - main = { - { name='uname', icon = iconPath, text = fullname .. '\n(' .. teamColor .. playerName .. white ..')', fontSize=2, fontshadow = true, fontOutline = true,}, - { name='utt', text = unittooltip, wrap=true }, - { name='hp', directcontrol = 'hp_unit', }, - { name='res', directcontrol = 'resources_unit' }, - { name='help', text = green .. 'Space+click: Show unit stats', }, - }, - } - - UpdateBuildpic( tt_ud, 'buildpic_unit' ) - BuildTooltip2('unit2', tt_structure) -end - - -local function MakeToolTip_SelUnit(data, tooltip) - local unitID = data - local fullname - stt_unitID = unitID - stt_ud = UnitDefs[ spGetUnitDefID(stt_unitID) or -1] - - fullname = ((stt_ud and stt_ud.humanName) or "") - - if not (stt_ud) then - --fixme - return false - end - - local unittooltip = GetUnitDesc(stt_unitID, stt_ud) - local iconPath = GetUnitIcon(stt_ud) - - UpdateResourceStack( 'selunit', unitID, stt_ud, tooltip ) - - - - local tt_structure = { - leftbar = { - { name= 'bp', directcontrol = 'buildpic_selunit' }, - { name= 'cost', icon = 'LuaUI/images/ibeam.png', text = cyan .. numformat((stt_ud and stt_ud.metalCost) or '0') }, - }, - main = { - { name='uname', icon = iconPath, text = fullname, fontSize=2, fontshadow = true, fontOutline = true, }, - { name='utt', text = unittooltip, wrap=true }, - { name='hp', directcontrol = 'hp_selunit', }, - stt_ud.isBuilder and { name='bp', directcontrol = 'bp_selunit', } or {}, - { name='res', directcontrol = 'resources_selunit' }, - }, - } - - UpdateBuildpic( stt_ud, 'buildpic_selunit', stt_unitID ) - return BuildTooltip2('selunit2', tt_structure, true) -end - -local function MakeToolTip_Feature(data, tooltip) - local featureID = data - local tt_fd - local team, fullname - - tt_fid = featureID - team = spGetFeatureTeam(featureID) - local fdid = spGetFeatureDefID(featureID) - tt_fd = fdid and FeatureDefs[fdid or -1] - local feature_name = tt_fd and tt_fd.name - - local live_name - - if tt_fd and tt_fd.customParams and tt_fd.customParams.unit then - live_name = tt_fd.customParams.unit - else - live_name = feature_name:gsub('([^_]*).*', '%1') - end - - local desc = '' - if feature_name:find('dead2') or feature_name:find('heap') then - desc = ' (debris)' - elseif feature_name:find('dead') then - desc = ' (wreckage)' - end - tt_ud = UnitDefNames[live_name] - fullname = ((tt_ud and tt_ud.humanName .. desc) or tt_fd.tooltip or "") - - if not (tt_fd) then - --fixme - return false - end - - if options.hide_for_unreclaimable.value and not tt_fd.reclaimable then - return false - end - - --local alliance = spGetUnitAllyTeam(tt_unitID) - local _, player = spGetTeamInfo(team) - local playerName = player and spGetPlayerInfo(player) or 'noname' - local teamColor = Chili.color2incolor(spGetTeamColor(team)) - ---local unittooltip = tt_unitID and spGetUnitTooltip(tt_unitID) or (tt_ud and tt_ud.tooltip) or "" - local unittooltip = GetUnitDesc(tt_unitID, tt_ud) - local iconPath = GetUnitIcon(tt_ud) - - UpdateResourceStack( tt_ud and 'corpse' or 'feature', featureID, tt_ud or tt_fd, tooltip ) - - local tt_structure = { - leftbar = - tt_ud and - { - { name= 'bp', directcontrol = 'buildpic_feature' }, - { name='cost', icon = 'LuaUI/images/ibeam.png', text = cyan .. numformat((tt_ud and tt_ud.metalCost) or '0'), }, - } - or nil, - main = { - { name='uname', icon = iconPath, text = fullname .. ' (' .. teamColor .. playerName .. white ..')', fontSize=2, fontshadow = true, fontOutline = true, wrap = true, }, - { name='utt', text = unittooltip, wrap=true }, - ( options.featurehp.value - and { name='hp', directcontrol = (tt_ud and 'hp_corpse' or 'hp_feature'), } - or {}), - { name='res', directcontrol = tt_ud and 'resources_corpse' or 'resources_feature' }, - { name='help', text = tt_ud and (green .. 'Space+click: Show unit stats') or '', }, - }, - } - - - if tt_ud then - UpdateBuildpic( tt_ud, 'buildpic_feature' ) - BuildTooltip2('corpse2', tt_structure) - else - BuildTooltip2('feature2', tt_structure) - end - return true -end - - - -local function CreateHpBar(name) - --[[ - globalitems[name] = Progressbar:New { - name = name, - width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - color = {0,1,0,1}, - max=1, - caption = 'a', - - children = { - Image:New{file='LuaUI/images/commands/bold/health.png',height= icon_size,width= icon_size, x=0,y=0}, - }, - } - --]] - globalitems[name] = Panel:New { - orientation='horizontal', - name = name, - width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - backgroundColor = {0,0,0,0}, - - children = { - Image:New{file='LuaUI/images/commands/bold/health.png',height= icon_size,width= icon_size, x=0,y=0}, - Progressbar:New { - name = 'bar', - x=icon_size, - right=0, - --width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - color = {0,1,0,1}, - max=1, - caption = 'a', - }, - - - }, - } - -end - -local function CreateBpBar(name) - --[[ - globalitems[name] = Progressbar:New { - name = name, - width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - color = {0.8,0.8,0.2,1}; - max=1, - caption = 'a', - - children = { - Image:New{file='LuaUI/Images/commands/Bold/buildsmall.png',height= icon_size,width= icon_size, x=0,y=0}, - }, - } - --]] - globalitems[name] = Panel:New { - orientation='horizontal', - name = name, - width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - backgroundColor = {0,0,0,0}, - - children = { - Image:New{file='LuaUI/Images/commands/Bold/buildsmall.png',height= icon_size,width= icon_size, x=0,y=0}, - Progressbar:New { - name = 'bar', - x=icon_size, - right=0, - --width = '100%', - height = icon_size+2, - itemMargin = {0,0,0,0}, - itemPadding = {0,0,0,0}, - padding = {0,0,0,0}, - color = {0.8,0.8,0.2,1}; - max=1, - caption = 'a', - }, - - - }, - } -end - - -local function MakeToolTip_Draw() - local tt_structure = { - main = { - { name='lmb', icon = LUAUI_DIRNAME .. 'Images/drawingcursors/pencil.png', text = 'Left Mouse Button', }, - { name='rmb', icon = LUAUI_DIRNAME .. 'Images/drawingcursors/eraser.png', text = 'Right Mouse Button', }, - { name='mmb', icon = LUAUI_DIRNAME .. 'Images/Crystal_Clear_action_flag.png', text = 'Middle Mouse Button', }, - { name='dblclick', icon = LUAUI_DIRNAME .. 'Images/drawingcursors/flagtext.png', text = 'Double Click', }, - - }, - } - BuildTooltip2('drawing2', tt_structure) -end - -local function MakeToolTip_Terra(cmdName) - - local tt_structure = { - main = { - { name='cmdName', text = cyan..cmdName, wrap=false}, - { name='tips', text = terraTips[cmdName], wrap=true }, - }, - } - - BuildTooltip2('terra', tt_structure) -end - -local function MakeTooltip() - if options.showdrawtooltip.value and tildepressed and not (drawing or erasing) then - MakeToolTip_Draw() - return - end - - local index, cmd_id, cmd_type, cmd_name = Spring.GetActiveCommand() - local cmdDesc = Spring.GetActiveCmdDesc( index ) - if options.showterratooltip.value and cmdDesc then - if terraCmds[ cmdDesc.name ] then - MakeToolTip_Terra(cmdDesc.name) - return - end - end - - - local cur_ttstr = screen0.currentTooltip or spGetCurrentTooltip() - local type, data = spTraceScreenRay(mx, my) - if (not changeNow) and cur_ttstr ~= '' and old_ttstr == cur_ttstr and old_data == data then - PlaceToolTipWindow2(mx+20,my-20) - return - end - old_data = data - old_ttstr = cur_ttstr - - tt_unitID = nil - tt_ud = nil - - --chili control tooltip - if screen0.currentTooltip ~= nil - and not screen0.currentTooltip:find('Build') --detect if chili control shows build option - and not screen0.currentTooltip:find('Morph') --detect if chili control shows morph option - then - if cur_ttstr ~= '' and cur_ttstr:gsub(' ',''):len() > 0 then - MakeToolTip_Text(cur_ttstr) - else - KillTooltip() - end - return - end - - local tt_table = tooltipBreakdown(cur_ttstr) - local tooltip, unitDef = tt_table.tooltip, tt_table.unitDef - - if not tooltip then - KillTooltip() - return - elseif unitDef then - tt_ud = unitDef - MakeToolTip_UD(tt_table) - return - end - - -- empty tooltip - if (tooltip == '') or tooltip:gsub(' ',''):len() <= 0 then - KillTooltip() - return - end - - --unit(s) selected/pointed at - local unit_tooltip = tooltip:find('Experience %d+.%d+ Cost ') --shows on your units, not enemy's - or tooltip:find('TechLevel %d') --shows on units - or tooltip:find('Metal.*Energy') --shows on features - - --unit(s) selected/pointed at - if unit_tooltip then - -- pointing at unit/feature - if type == 'unit' then - MakeToolTip_Unit(data, tooltip) - return - elseif type == 'feature' then - if MakeToolTip_Feature(data, tooltip) then - return - end - end - - --holding meta or static tip - if (showExtendedTip) then - MakeToolTip_Text(tooltip) - else - KillTooltip() - end - return - end - - --tooltip that shows position - local pos_tooltip = tooltip:sub(1,4) == 'Pos ' - - -- default tooltip - if not pos_tooltip or showExtendedTip then - MakeToolTip_Text(tooltip) - return - end - - KillTooltip() - return - -end --function MakeTooltip - -local function SetupTerraTips() - terraTips = { - - } - - for cmdName, _ in pairs( terraCmds ) do - terraTips[cmdName] = - green.. 'Click&Drag'..white..': Free draw terraform. \n'.. - green.. 'Alt+Click&Drag'..white..': Box terraform. \n'.. - green.. 'Alt+Ctrl+Click&Drag'..white..': Hollow box terraform. \n'.. - green.. 'Ctrl+Click on unit' ..white..': Terraform around unit. \n'.. - '\n'.. - '' - end - - terraTips.Smooth = terraTips.Smooth .. - yellow..'[During Terraform Draw]\n'.. - green.. 'Ctrl'..white..': Draw straight line segment. \n'.. - '' - - terraTips.Ramp = - green.. 'Step 1'..white..': Click to start ramp \n OR click&drag to start a ramp at desired height. \n'.. - green.. 'Step 2'..white..': Click to set end of ramp \n OR click&drag to set end of ramp at desired height. \n Hold '..green..'Alt'..white..' to snap to certain levels of pathability. \n'.. - green.. 'Step 3'..white..': Move mouse to set ramp width, click to complete. \n'.. - '\n'.. - yellow..'[Any Time]\n'.. - green.. 'Space'..white..': Cycle through only raise/lower \n'.. - '\n'.. - yellow..'[Wireframe indicator colors]\n'.. - green.. 'Green'..white..': All units can traverse. \n'.. - green.. 'Yellow'..white..': Vehicles cannot traverse. \n'.. - green.. 'Red'..white..': Only all-terrain / spiders can traverse. \n'.. - '' - - - terraTips.Level = terraTips.Level .. - yellow..'[During Terraform Draw]\n'.. - green.. 'Ctrl'..white..': Draw straight line segment. \n'.. - '\n'.. - yellow..'[After Terraform Draw]\n'.. - green.. 'Alt'..white..': Snap to starting height / below water level (prevent ships) / below water level (prevent land units). \n'.. - green.. 'Ctrl'..white..': Hold and point at terrain to level to height pointed at.\n'.. - '\n'.. - yellow..'[Any Time]\n'.. - green.. 'Space'..white..': Cycle through only raise/lower \n'.. - '' - - terraTips.Raise = terraTips.Raise .. - yellow..'[During Terraform Draw]\n'.. - green.. 'Ctrl'..white..': Draw straight line segment. \n'.. - '\n'.. - yellow..'[After Terraform Draw]\n'.. - green.. 'Alt'..white..': Snap to steps of 15 height. \n'.. - green.. 'Ctrl'..white..': Snap to 0 height. \n'.. - '' - - terraTips.Restore = terraTips.Restore .. - '\n'.. - yellow..'[Any Time]\n'.. - green.. 'Space'..white..': Limit to only raise/lower \n'.. - '' - -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function widget:Update(dt) - if widgetHandler:InTweakMode() then - tweakShow = true - Show(real_window_corner) - elseif tweakShow then - tweakShow = false - widget:SelectionChanged(Spring.GetSelectedUnits()) - end - - timer = timer + dt - if timer >= updateFrequency then - UpdateSelectedUnitsTooltip() - UpdateDynamicGroupInfo() - WriteGroupInfo() - - SetHealthbars() - if stt_unitID then - local tt_table = tooltipBreakdown( spGetCurrentTooltip() ) - local tooltip, unitDef = tt_table.tooltip, tt_table.unitDef - UpdateResourceStack( 'selunit', stt_unitID, stt_ud, tooltip ) - - local nanobar_stack = globalitems['bp_selunit'] - local nanobar = nanobar_stack:GetChildByName('bar') - if nanobar then - local metalMake, metalUse, energyMake,energyUse = Spring.GetUnitResources(stt_unitID) - - if metalUse then - nanobar:SetValue(metalUse/stt_ud.buildSpeed,true) - nanobar:SetCaption(round(100*metalUse/stt_ud.buildSpeed)..'%') - else - nanobar:SetValue(1) - nanobar:SetCaption('??? / ' .. numformat(stt_ud.buildSpeed)) - end - end - - end - changeNow = true - timer = 0 - end - - old_mx, old_my = mx,my - alt,_,meta,_ = spGetModKeyState() - mx,my = spGetMouseState() - local mousemoved = (mx ~= old_mx or my ~= old_my) - - local show_cursortip = true - if meta then - if not showExtendedTip then changeNow = true end - showExtendedTip = true - - else - if (options.tooltip_delay.value > 0) and not tildepressed then - if not mousemoved then - stillCursorTime = stillCursorTime + dt - else - stillCursorTime = 0 - end - show_cursortip = stillCursorTime > options.tooltip_delay.value - end - - if showExtendedTip then changeNow = true end - showExtendedTip = false - - end - - if mousemoved or changeNow then - if not show_cursortip and not tildepressed then - KillTooltip() - return - end - MakeTooltip() - changeNow = false - end - - - -end - -function widget:ViewResize(vsx, vsy) - scrW = vsx - scrH = vsy -end - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget(widget) - return - end - - SetupTerraTips() - - Spring.SetDrawSelectionInfo(false) - - local VFSMODE = VFS.RAW_FIRST - _, iconFormat = VFS.Include(LUAUI_DIRNAME .. "Configs/chilitip_conf.lua" , nil, VFSMODE) - local confdata = VFS.Include(LUAUI_DIRNAME .. "Configs/epicmenu_conf.lua", nil, VFSMODE) - color = confdata.color - - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Window = Chili.Window - Panel = Chili.Panel - StackPanel = Chili.StackPanel - Grid = Chili.Grid - TextBox = Chili.TextBox - Image = Chili.Image - Multiprogressbar = Chili.Multiprogressbar - Progressbar = Chili.Progressbar - LayoutPanel = Chili.LayoutPanel - screen0 = Chili.Screen0 - - widget:ViewResize(Spring.GetViewGeometry()) - - CreateHpBar('hp_unit') - CreateHpBar('hp_selunit') - CreateHpBar('hp_feature') - CreateHpBar('hp_corpse') - - CreateBpBar('bp_selunit') - - stack_main = StackPanel:New{ - width=300, -- needed for initial tooltip - } - stack_leftbar = StackPanel:New{ - width=10, -- needed for initial tooltip - } - - window_tooltip2 = Window:New{ - --skinName = 'default', - useDList = false, - resizable = false, - draggable = false, - autosize = true, - backgroundColor = color.tooltip_bg, - children = { stack_leftbar, stack_main, }, - minHeight = 32, - minWidth = 32, - } - --FontChanged() - spSendCommands({"tooltip 0"}) - - - local screenWidth,screenHeight = Spring.GetWindowGeometry() - local y = tostring(math.floor(screenWidth/screenHeight*0.35*0.35*100 - window_height)) .. "%" - - real_window_corner = Window:New{ - name = 'real_window_corner'; - color = {0, 0, 0, 0}, - x = 0; - bottom = 280; - width = 550; - height = 220; - dockable = true; - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - padding = {0, 0, 0, 0}, - minWidth = 450, - minHeight = 160, - - } - - window_corner = Panel:New{ - parent = real_window_corner, - name = 'unitinfo2'; - x = 0, - y = 0, - width = "100%"; - height = "100%"; - dockable = false, - resizable = false; - draggable = false, - OnMouseDown={ function(self) - local _,_, meta,_ = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath('Settings/Interface/Selected Units Window') - WG.crude.ShowMenu() - return true --skip button function, else clicking on build pic will also select the unit. - end }, - } - - windMin = Spring.GetGameRulesParam("WindMin") - windMax = Spring.GetGameRulesParam("WindMax") - - for i=1,#UnitDefs do - local ud = UnitDefs[i] - if (ud.customParams.level) --// engine overrides commanders tooltips with playernames - or (ud.extractsMetal > 0) --// the Overdrive gadgets adds additional information to the tooltip, but the visualize it a different way - then - ud.chili_selections_useStaticTooltip = true - end - end - - option_Deselect() - -end - -function widget:Shutdown() - spSendCommands({"tooltip 1"}) - if (window_tooltip2) then - window_tooltip2:Dispose() - end - Spring.SetDrawSelectionInfo(true) -end - - - -function widget:KeyPress(key, modifier, isRepeat) - if key == KEYSYMS.BACKQUOTE then - if not tildepressed then - changeNow = true - end - tildepressed = true - end -end -function widget:KeyRelease(key) - if key == KEYSYMS.BACKQUOTE then - if tildepressed then - changeNow = true - end - tildepressed = false - end -end - -function widget:DrawScreen() - if not tildepressed then return end - local x, y, lmb, mmb, rmb = Spring.GetMouseState() - drawing = lmb - erasing = rmb - - local filefound - if drawing then - filefound = glTexture(LUAUI_DIRNAME .. 'Images/drawingcursors/pencil.png') - elseif erasing then - filefound = glTexture(LUAUI_DIRNAME .. 'Images/drawingcursors/eraser.png') - end - - if filefound then - --do teamcolor? - --glColor(0,1,1,1) - if drawing or erasing then - Spring.SetMouseCursor('none') - end - glTexRect(x, y-cursor_size, x+cursor_size, y) - glTexture(false) - --glColor(1,1,1,1) - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---lags like a brick due to being spammed constantly for unknown reason, moved all its behavior to SelectionChanged ---function widget:CommandsChanged() ---end --- - - -function widget:SelectionChanged(newSelection) - numSelectedUnits = spGetSelectedUnitsCount() - selectedUnits = newSelection - - if (numSelectedUnits>0) then - UpdateStaticGroupInfo() - UpdateDynamicGroupInfo() - selectedUnitsByDef = spGetSelectedUnitsByDef() - selectedUnitsByDef.n = nil -- REMOVE IN 0.83 - selectedUnitsByDefCounts = {} - for i,v in pairs(selectedUnitsByDef) do - selectedUnitsByDefCounts[i] = #v - end - - --// spGetSelectedUnitsByDef() doesn't save the order for the different defids, so we reconstruct it from spGetSelectedUnits() - --// else the sort order would change each time we select a new unit or deselect one! - selectionSortOrder = {} - local alreadyInList = {} - for i=1,#selectedUnits do - local defid = spGetUnitDefID(selectedUnits[i]) - if (not alreadyInList[defid]) then - alreadyInList[defid] = true - selectionSortOrder[#selectionSortOrder+1] = defid - end - end - - if (numSelectedUnits == 1) then - local tt_table = tooltipBreakdown( spGetCurrentTooltip() ) - local tooltip, unitDef = tt_table.tooltip, tt_table.unitDef - - local cur1, cur2 = MakeToolTip_SelUnit(selectedUnits[1], tooltip) - if cur1 then - window_corner:ClearChildren() - window_corner:AddChild(cur1) - window_corner:AddChild(cur2) - end - else - stt_unitID = nil - MakeUnitGroupSelectionToolTip() - end - Show(real_window_corner) - else - stt_unitID = nil - window_corner:ClearChildren() - screen0:RemoveChild(real_window_corner) - end -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function widget:Shutdown() - Spring.SetDrawSelectionInfo(true) -end diff --git a/LuaUI/Widgets_Evo/gui_chili_supplyDisplay.lua b/LuaUI/Widgets_Evo/gui_chili_supplyDisplay.lua deleted file mode 100644 index 1e6f33e2d..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_supplyDisplay.lua +++ /dev/null @@ -1,198 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Supply Bar", - desc = "", - author = "jK, KingRaptor", - date = "2010, 2013", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -include("colors.h.lua") - -WG.energyWasted = 0 -WG.energyForOverdrive = 0 -WG.allies = 1 ---[[ -WG.windEnergy = 0 -WG.highPriorityBP = 0 -WG.lowPriorityBP = 0 ---]] - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local abs = math.abs -local echo = Spring.Echo -local GetMyTeamID = Spring.GetMyTeamID -local GetTeamResources = Spring.GetTeamResources -local GetTimer = Spring.GetTimer -local DiffTimers = Spring.DiffTimers -local Chili - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local col_normal = {0.2, 0.8, 0.2, 1} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local window -local bar - -local blink = 0 -local blink_periode = 2 -local blink_alpha = 1 -local blink_status = false - -local isOverLimit = false - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local builderDefs = {} -for id,ud in pairs(UnitDefs) do - if (ud.isBuilder) then - builderDefs[#builderDefs+1] = id - elseif (ud.buildSpeed > 0) then - builderDefs[#builderDefs+1] = id - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options_path = 'Settings/HUD Panels/Resource Bars' - -options = { - opacity = { - name = "Opacity", - type = "number", - value = 0, min = 0, max = 1, step = 0.01, - OnChange = function(self) window.color = {1,1,1,self.value}; window:Invalidate() end, - } -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function CreateWindow() - local screenWidth,screenHeight = Spring.GetWindowGeometry() - - --// WINDOW - window = Chili.Window:New{ - color = {1,1,1,options.opacity.value}, - parent = Chili.Screen0, - dockable = true, - name = "supply_info", - padding = {5,10,10,5}, - right = 0, - y = 0, - width = 100, - clientWidth = 430, - clientHeight = 40, - draggable = false, - resizable = false, - tweakDraggable = true, - tweakResizable = true, - minimizable = false, - - OnMouseDown={ function(self) - local alt, ctrl, meta, shift = Spring.GetModKeyState() - if not meta then return false end - WG.crude.OpenPath(options_path) - WG.crude.ShowMenu() - return true - end }, - } - - Chili.Image:New{ - parent = window, - height = "100%", - width = 25, - y = 0, - right = 0, - file = 'LuaUI/Images/supplyicon.png', -- FIXME proper supply image - } - - bar = Chili.Progressbar:New{ - parent = window, - color = col_normal, - height = "100%", - right = 30, - x = 90, - caption = "0/0", - tooltip = "Supply used/supply available (default 100 maximum)", - font = {color = {1,1,1,1}, outlineColor = {0,0,0,0.7}, }, - } - - -- Activate tooltips for bars, they do not have them in default chili - function bar:HitTest(x,y) return self end -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -function widget:Update(s) - blink = (blink+s)%blink_periode - blink_alpha = math.abs(blink_periode/2 - blink) - - if blink_status then - bar:SetColor( 255,251/255*blink_alpha,214/119/255,0.65 + 0.3*blink_alpha ) - end -end - -function widget:GameFrame(n) - if (n%15 ~= 2) or not window then - return - end - - local myTeamID = GetMyTeamID() - local teamParams = Spring.GetTeamRulesParams(myTeamID) - - local supplyUsed = Spring.GetTeamRulesParam(myTeamID, "supplyUsed") or 0 - local supplyMax = Spring.GetTeamRulesParam(myTeamID, "supplyMax") or 0 - - local supplyFraction = 1 - if supplyMax > 0 then - supplyFraction = supplyUsed/supplyMax - end - - local wasOverLimit = isOverLimit - isOverLimit = supplyFraction > 1 - - bar:SetValue(100*supplyFraction) - if isOverLimit and (not wasOverLimit) then - bar.font:SetColor(1, 0.2, 0.2, 1) - elseif (not isOverLimit) and wasOverLimit then - bar.font:SetColor(1, 1, 1, 1) - end - bar:SetCaption(supplyUsed .. "/" .. supplyMax) - - local nearMax = supplyFraction > 0.8 - if nearMax then -- blink - blink_status = true - elseif (blink_status) then - blink_status = false - bar:SetColor( col_normal ) - end -end - -function widget:Initialize() - Chili = WG.Chili - - if (not Chili) then - widgetHandler:RemoveWidget() - return - end - CreateWindow() -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_chili_widgetselector.lua b/LuaUI/Widgets_Evo/gui_chili_widgetselector.lua deleted file mode 100644 index aa6884232..000000000 --- a/LuaUI/Widgets_Evo/gui_chili_widgetselector.lua +++ /dev/null @@ -1,422 +0,0 @@ -function widget:GetInfo() - return { - name = "Chili Widget Selector", --needs epic menu to dynamically update widget checkbox colors. - desc = "v1.01 Chili Widget Selector", - author = "CarRepairer", - date = "2012-01-11", --2013-04-25 (add crude filter/search capability) - license = "GNU GPL, v2 or later", - layer = -100000, - handler = true, - experimental = false, - enabled = true, - alwaysStart = true, - } -end - -function MakeWidgetList() end -function KillWidgetList() end -local window_widgetlist - -options_path = 'Settings/Misc' -options = -{ - widgetlist = { - name = 'Widget List', - type = 'button', - hotkey = {key='f11', mod=''}, - advanced = true, - OnChange = function(self) - if window_widgetlist then - KillWidgetList() - elseif not window_widgetlist then - MakeWidgetList() - end - end - } -} - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local echo = Spring.Echo - --------------------------------------------------------------------------------- - --- Config file data -local VFSMODE = VFS.RAW_FIRST - --------------------------------------------------------------------------------- - -local file = LUAUI_DIRNAME .. "Configs/epicmenu_conf.lua" -local confdata = VFS.Include(file, nil, VFSMODE) -local color = confdata.color - - --- Chili control classes -local Chili -local Button -local Label -local Colorbars -local Checkbox -local Window -local ScrollPanel -local StackPanel -local LayoutPanel -local Grid -local Trackbar -local TextBox -local Image -local Progressbar -local Colorbars -local screen0 - --------------------------------------------------------------------------------- --- Global chili controls - - -local widget_categorize = true -local filterUserInsertedTerm = "" --the term used to filter down the list of widget - --------------------------------------------------------------------------------- --- Misc -local B_HEIGHT = 26 -local C_HEIGHT = 16 - -local scrH, scrW = 0,0 - -local window_w -local window_h -local window_x -local window_y - - --------------------------------------------------------------------------------- ---For widget list -local widget_checks = {} -local green = {0,1,0,1} -local orange = {1,0.5,0,1} -local gray = {0.7,0.7,0.7,1} -local groupDescs = { - api = "For Developers", - camera = "Camera", - cmd = "Commands", - dbg = "For Developers", - gfx = "Effects", - gui = "GUI", - hook = "Commands", - ico = "GUI", - init = "Initialization", - map = "Map", - minimap = "Minimap", - mission = "Mission", - snd = "Sound", - test = "For Developers", - unit = "Units", - ungrouped = "Ungrouped", -} ----------------------------------------------------------------- ---May not be needed with new chili functionality -local function AdjustWindow(window) - local nx - if (0 > window.x) then - nx = 0 - elseif (window.x + window.width > screen0.width) then - nx = screen0.width - window.width - end - - local ny - if (0 > window.y) then - ny = 0 - elseif (window.y + window.height > screen0.height) then - ny = screen0.height - window.height - end - - if (nx or ny) then - window:SetPos(nx,ny) - end -end - --- Adding functions because of "handler=true" -local function AddAction(cmd, func, data, types) - return widgetHandler.actionHandler:AddAction(widget, cmd, func, data, types) -end -local function RemoveAction(cmd, types) - return widgetHandler.actionHandler:RemoveAction(widget, cmd, types) -end - - --- returns whether widget is enabled -local function WidgetEnabled(wname) - local order = widgetHandler.orderList[wname] - return order and (order > 0) -end - - - - - --- Update colors for labels of widget checkboxes in widgetlist window -local function checkWidget(widget) - local name = (type(widget) == 'string') and widget or widget.whInfo.name - - local wcheck = widget_checks[name] - if wcheck then - local wdata = widgetHandler.knownWidgets[name] - local hilite_color = (wdata.active and green) or (WidgetEnabled(name) and orange) or gray - wcheck.font:SetColor(hilite_color) - end -end - -WG.cws_checkWidget = function() end --function is declared in widget:Initialized() - --- Kill Widgetlist window -KillWidgetList = function() - if window_widgetlist then - window_x = window_widgetlist.x - window_y = window_widgetlist.y - - window_h = window_widgetlist.clientHeight - window_w = window_widgetlist.clientWidth - - end - window_widgetlist:Dispose() - window_widgetlist = nil - filterUserInsertedTerm = "" -end - --- Make widgetlist window -MakeWidgetList = function() - - widget_checks = {} - - if window_widgetlist then - window_widgetlist:Dispose() - end - - local widget_children = {} - local widgets_cats = {} - local listIsEmpty = true - - - local buttonWidth = window_w - 20 - - for name,data in pairs(widgetHandler.knownWidgets) do - if not data.alwaysStart then - local name = name - local name_display = name .. (data.fromZip and ' (mod)' or '') - local data = data - local _, _, category = string.find(data.basename, "([^_]*)") - - local lowercase_name = name:lower() - local lowercase_category = category:lower() - local lowercase_display = name_display:lower() - local lowercase_desc = data.desc:lower() - local lowercase_author = data.author:lower() - if filterUserInsertedTerm == "" or - lowercase_name:find(filterUserInsertedTerm) or - lowercase_display:find(filterUserInsertedTerm) or - lowercase_desc:find(filterUserInsertedTerm) or - lowercase_author:find(filterUserInsertedTerm) or - lowercase_category:find(filterUserInsertedTerm) then - - if not groupDescs[category] then - category = 'ungrouped' - end - local catdesc = groupDescs[category] - if not widget_categorize then - catdesc = 'Ungrouped' - end - widgets_cats[catdesc] = widgets_cats[catdesc] or {} - - widgets_cats[catdesc][#(widgets_cats[catdesc])+1] = - { - catname = catdesc, - name_display = name_display, - name = name, - active = data.active, - desc = data.desc, - author = data.author, - } - listIsEmpty = false - end - end - end - - local widgets_cats_i = {} - for catdesc, catwidgets in pairs(widgets_cats) do - widgets_cats_i[#widgets_cats_i + 1] = {catdesc, catwidgets} - end - - --Sort widget categories - table.sort(widgets_cats_i, function(t1,t2) - return t1[1] < t2[1] - end) - - for _, data in pairs(widgets_cats_i) do - local catdesc = data[1] - local catwidgets = data[2] - - --Sort widget names within this category - table.sort(catwidgets, function(t1,t2) - return t1.name_display < t2.name_display - end) - widget_children[#widget_children + 1] = - Label:New{ caption = '- '.. catdesc ..' -', textColor = color.sub_header, align='center', } - - for _, wdata in ipairs(catwidgets) do - local enabled = WidgetEnabled(wdata.name) - - --Add checkbox to table that is used to update checkbox label colors when widget becomes active/inactive - widget_checks[wdata.name] = Checkbox:New{ - caption = wdata.name_display, - checked = enabled, - tooltip = '(By ' .. tostring(wdata.author) .. ")\n" .. tostring(wdata.desc), - OnChange = { - function(self) - widgetHandler:ToggleWidget(wdata.name) - end, - }, - } - widget_children[#widget_children + 1] = widget_checks[wdata.name] - checkWidget(wdata.name) --sets color of label for this widget checkbox - end - end - if listIsEmpty then - widget_children[1] = - Label:New{ caption = "- no match for \"" .. filterUserInsertedTerm .."\" -", align='center', } - widget_children[2] = - Label:New{ caption = " ", align='center', } - end - - window_widgetlist = Window:New{ - x = window_x, - y = window_y, - clientWidth = window_w, - clientHeight = window_h, - parent = screen0, - backgroundColor = color.sub_bg, - caption = 'Widget List (F11)\nPress Enter to do Search', - minWidth = 300, - minHeight = 400, - - children = { - ScrollPanel:New{ - x=1, - y=15, - right=5, - bottom = C_HEIGHT*2, - - children = { - StackPanel:New{ - x=1, - y=1, - height = #widget_children*C_HEIGHT, - right = 1, - - itemPadding = {1,1,1,1}, - itemMargin = {0,0,0,0}, - children = widget_children, - }, - }, - }, - - --Close button - Button:New{ - caption = 'Close', - OnMouseUp = { KillWidgetList }, - backgroundColor=color.sub_close_bg, - textColor=color.sub_close_fg, - - x=1, - bottom=1, - width='40%', - height=C_HEIGHT, - - }, - --Categorization checkbox - Checkbox:New{ - caption = 'Categorize', - tooltip = 'List widgets by category', - OnMouseUp = { function() widget_categorize = not widget_categorize end, KillWidgetList, MakeWidgetList }, - textColor=color.sub_fg, - checked = widget_categorize, - x = '50%', - width = '30%', - height= C_HEIGHT, - bottom=1, - }, - - }, - } - AdjustWindow(window_widgetlist) -end - - -function widget:Initialize() - if (not WG.Chili) then - widgetHandler:RemoveWidget(widget) - return - end - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Colorbars = Chili.Colorbars - Checkbox = Chili.Checkbox - Window = Chili.Window - ScrollPanel = Chili.ScrollPanel - StackPanel = Chili.StackPanel - LayoutPanel = Chili.LayoutPanel - Grid = Chili.Grid - Trackbar = Chili.Trackbar - TextBox = Chili.TextBox - Image = Chili.Image - Progressbar = Chili.Progressbar - Colorbars = Chili.Colorbars - screen0 = Chili.Screen0 - - widget:ViewResize(Spring.GetViewGeometry()) - window_w = 200 - window_h = 300 - window_x = (scrW - window_w)/2 - window_y = (scrH - window_h)/2 - - Spring.SendCommands({ - "unbindkeyset f11" - }) - - WG.cws_checkWidget = function(widget) - checkWidget(widget) - end -end - -function widget:ViewResize(vsx, vsy) - scrW = vsx - scrH = vsy -end - - -function widget:Shutdown() - -- restore key binds - Spring.SendCommands({ - "bind f11 luaui selector" - }) -end - -function widget:TextCommand(command) - if window_widgetlist and command:sub(1,7) == "search:" then - filterUserInsertedTerm = command:sub(8) - filterUserInsertedTerm = filterUserInsertedTerm:lower() --Reference: http://lua-users.org/wiki/StringLibraryTutorial - Spring.Echo("Widget Selector: filtering \"" .. filterUserInsertedTerm.."\"") - MakeWidgetList() - return true - end - return false -end - -function widget:KeyRelease(key) - if window_widgetlist and key ==13 then --Note: "13" equal to "Enter". Could this be different in different keyboard? - Spring.SendCommands("PasteText /search:" ) - end -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_chiliguidemo.lua b/LuaUI/Widgets_Evo/gui_chiliguidemo.lua deleted file mode 100644 index 5271feb49..000000000 --- a/LuaUI/Widgets_Evo/gui_chiliguidemo.lua +++ /dev/null @@ -1,365 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "chiliGUIDemo", - desc = "GUI demo for robocracy", - author = "quantum", - date = "WIP", - license = "WIP", - layer = 1, - enabled = false -- loaded by default? - } -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- gui elements -local window0 -local window01 -local gridWindow0 -local gridWindow1 -local windowImageList -local window1 -local window2 -local window3 - -function widget:Initialize() - Chili = WG.Chili - - local function ToggleOrientation(self) - local panel = self:FindParent"layoutpanel" - panel.orientation = ((panel.orientation == "horizontal") and "vertical") or "horizontal" - panel:UpdateClientArea() - end - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local testText = - [[Bolivians are voting in a referendum on a new constitution that President Evo Morales says will empower the country's indigenous majority. - -The changes also include strengthening state control of Bolivia's natural resources, and no longer recognising Catholicism as the official religion. - -The constitution is widely expected to be approved. -Mr Morales, an Aymara Indian, has pursued political reform but has met fierce resistance from some sectors. -Opponents concentrated in Bolivia's eastern provinces, which hold rich gas deposits, argue that the new constitution would create two classes of citizenship - putting indigenous people ahead of others. - -The wrangling has spilled over into, at times, deadly violence. At least 30 peasant farmers were ambushed and killed on their way home from a pro-government rally in a northern region in September. - -President Morales has said the new constitution will pave the way for correcting the historic inequalities of Bolivian society, where the economic elite is largely of European descent. -]] - - local testText2 = - "\255\001\255\250Bolivians\b are voting in a referendum on a \255\255\255\000new\b constitution " - - local testText3 = - [[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod]] - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - local cs = { - Chili.Button:New{ - x = 20, - y = 20, - }, - Chili.Label:New{ - x = 20, - y = 50, - caption= 'FOOBAR', - }, - Chili.ScrollPanel:New{ - backgroundColor = {0,0,0,0.5}, - children = { - Chili.Button:New{caption="foo", width = 100, height = 100}, - } - }, - Chili.Checkbox:New{ - x = 20, - y = 70, - caption = 'foo', - }, - Chili.Trackbar:New{ - x = 20, - y = 90, - }, - Chili.Colorbars:New{ - x = 20, - y = 120, - }, - Chili.ComboBox:New{items = { "opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8", "opt9", "opt10", "opt11", "opt12", }}, - } - - window0 = Chili.Window:New{ - x = 200, - y = 450, - width = 200, - height = 200, - parent = Chili.Screen0, - - children = { - Chili.StackPanel:New{ - height = "100%"; - width = "100%"; - weightedResize = true; - children = { - Chili.Button:New{caption="height: 70%", weight = 7; width = "90%"}, - Chili.Button:New{caption="height: 30%", weight = 3}, - }; - } - }, - } - - local btn0 = Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me1", - } - btn0:Dispose() - - -- we need a container that supports margin if the control inside uses margins - window01 = Chili.Window:New{ - x = 200, - y = 200, - clientWidth = 200, - clientHeight = 200, - parent = Chili.Screen0, - } - - local panel1 = Chili.StackPanel:New{ - width = 200, - height = 200, - --resizeItems = false, - x=0, right=0, - y=0, bottom=0, - margin = {10, 10, 10, 10}, - parent = window01, - children = cs, - } - - local gridControl = Chili.Grid:New{ - name = 'foogrid', - width = 200, - height = 200, - children = { - Chili.Button:New{backgroundColor = {0,0.6,0,1}, textColor = {1,1,1,1}, caption = "Toggle", OnMouseUp = {ToggleOrientation}}, - Chili.Button:New{caption = "2"}, - Chili.Button:New{caption = "3"}, - Chili.Button:New{caption = "4", margin = {10, 10, 10, 10}}, - Chili.Button:New{caption = "5"}, - Chili.Button:New{caption = "6"}, - Chili.Button:New{caption = "7"}, - } - } - - gridWindow0 = Chili.Window:New{ - parent = Chili.Screen0, - x = 450, - y = 450, - clientWidth = 200, - clientHeight = 200, - children = { - gridControl - }, - } - - gridWindow1 = Chili.Window:New{ - parent = Chili.Screen0, - x = 650, - y = 750, - clientWidth = 200, - clientHeight = 200, - children = { - Chili.Button:New{right=0, bottom=0, caption = "2", OnClick={function() - --gridWindow1:GetObjectByName("tree_inspector") - end}}, - Chili.TextBox:New{x=0, right=0, y=0, text = testText2}, - Chili.EditBox:New{width = 200, y = 40, --[[autosize = true,]] text = testText3}, - Chili.ComboBox:New{right = 10, x = 0, y = 90, items = { "opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8", "opt9", "opt10", "opt11", "opt12", }}, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me2", - x="5%", y=70, - width = "90%", - OnClick = {function(self) self:Dispose() end}, - }, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me3", - x="5%", y=90, - width = "90%", - }, - Chili.Button:New{ - caption = "Dispose Me", - name = "btn_dispose_me4", - x=0, y=120, - }, - }, - } - gridWindow1:GetObjectByName("btn_dispose_me4"):Dispose() - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - windowImageList = Chili.Window:New{ - x = 700, - y = 200, - clientWidth = 410, - clientHeight = 400, - parent = Chili.Screen0, - } - - local control = Chili.ScrollPanel:New{ - x=0, right=0, - y=0, bottom=0, - parent = windowImageList, - children = { - --Button:New{width = 410, height = 400, anchors = {top=true,left=true,bottom=true,right=true}}, - Chili.ImageListView:New{ - name = "MyImageListView", - x=0, right=0, - y=0, bottom=0, - dir = "LuaUI/Images/", - OnSelectItem = { - function(obj,itemIdx,selected) - Spring.Echo("image selected ",itemIdx,selected) - end, - }, - OnDblClickItem = { - function(obj,itemIdx) - Spring.Echo("image dblclicked ",itemIdx) - end, - }, - OnDirChange = { - function(obj,itemIdx) - if obj.parent and obj.parent:InheritsFrom("scrollpanel") then - obj.parent:SetScrollPos(0,0) - end - end, - } - } - } - } - - - -------------------------------------------------------------------------------- - -------------------------------------------------------------------------------- - - window1 = Chili.Window:New{ - x = 450, - y = 200, - clientWidth = 200, - clientHeight = 200, - resizable = true, - draggable = true, - parent = Chili.Screen0, - dockable = true, - children = { - Chili.ScrollPanel:New{ - width = 200, - height = 200, - x=0, right=0, - y=0, bottom=0, - horizontalScrollbar = false, - children = { - Chili.TextBox:New{width = 200, x=0, right=0, y=0, bottom=0, text = testText} - }, - }, - } - } - - window2 = Chili.Window:New{ - x = 900, - y = 650, - width = 200, - height = 200, - parent = Chili.Screen0, - dockable = true, - - children = { - Chili.TabBar:New{ - x=0, right=0, - y=0, height=20, - minItemWidth = 50, - tabs = {"tab1", "tab2", "tab3",}, - }, - Chili.ScrollPanel:New{ - x=0, right=0, - y=30, bottom=0, - children = { - Chili.TreeView:New{ - x=0, right=0, - y=0, bottom=0, - defaultExpanded = true, - nodes = { - "foo", - { "bar" }, - "do", - { "re", {"mi"} }, - "la", - { "le", "lu" }, - }, - }, - }, - }, - }, - } - - local warnDispose = function(self) - local ref = 0 - for i,v in pairs(self._hlinks) do - ref = ref + 1 - end - Spring.Echo("Warning object disposed!", self.classname, self.name, ref) - end - - window3 = Chili.Window:New{ - caption = "autosize test", - x = 1200, - y = 650, - width = 200, - height = 200, - parent = Chili.Screen0, - autosize = true, - savespace = true, - --debug = true, - - children = { - Chili.Button:New{name = "btn_0", y = 20, width = 120, caption = "dispose btns below", OnClick = {function(self) - local btna = window3:GetObjectByName("btn_a"); - local btnb = window3:GetObjectByName("btn_b"); - window3:RemoveChild(btna); - window3:RemoveChild(btnb); - end}}, - Chili.Button:New{name = "btn_a", y = 50, width = 120, caption = "autosize", OnDispose = {warnDispose}, OnClick = {function(self) window3:GetObjectByName("btn_a"):ToggleVisibility(); window3:GetObjectByName("btn_b"):ToggleVisibility(); end}}, - Chili.Button:New{name = "btn_b", y = 80, width = 120, caption = "autosize", OnDispose = {warnDispose}, OnClick = {function(self) window3:GetObjectByName("btn_a"):ToggleVisibility(); window3:GetObjectByName("btn_b"):ToggleVisibility(); end}}, - }, - } - - window3:GetObjectByName("btn_b"):Hide() --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -end --Initialize - - -function widget:Update() - local btn = gridWindow1:GetObjectByName("btn_dispose_me3") - btn:Dispose() - widgetHandler:RemoveCallIn("Update") -end - - -function widget:Shutdown() - window0:Dispose() - window01:Dispose() - gridWindow0:Dispose() - gridWindow1:Dispose() - windowImageList:Dispose() - window1:Dispose() - window2:Dispose() - window3:Dispose() -end - diff --git a/LuaUI/Widgets_Evo/gui_clearmapmarks.lua b/LuaUI/Widgets_Evo/gui_clearmapmarks.lua new file mode 100644 index 000000000..832a607e4 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_clearmapmarks.lua @@ -0,0 +1,143 @@ +function widget:GetInfo() + return { + name = "Clearmapmarks button", + desc = "clears mapmarks, located next to advplayerlist", + author = "Floris", + date = "24 july 2016", + license = "GNU GPL, v2 or later", + layer = -3, -- set to -5 to draw mascotte on top of advplayerlist + enabled = true + } +end + +local iconTexture = ":n:LuaUI/Images/mapmarksfx/eraser.dds" +local iconSize = 19 + +local glTranslate = gl.Translate +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix + +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local drawlist = {} +local xPos = 0 +local yPos = 0 + +local mouseover = false + +local usedImgSize = iconSize + +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- + +local function RectQuad(px,py,sx,sy) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o,1-o) + gl.Vertex(px, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) +end + +function DrawRect(px,py,sx,sy) + gl.BeginEnd(GL.QUADS, RectQuad, px,py,sx,sy) +end + +local function createList(size) + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + end + drawlist[1] = glCreateList( function() + gl.Texture(iconTexture) + DrawRect(-usedImgSize, 0, 0, usedImgSize) + gl.Texture(false) + end) + if WG['tooltip'] ~= nil then + WG['tooltip'].AddTooltip('clearmapmarks', {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}, "clear mapmarks/drawings") + end +end + +local advplayerlistPos = {} +function updatePosition(force) + if (WG['advplayerlist_api'] ~= nil) then + local prevPos = advplayerlistPos + advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + usedImgSize = iconSize * advplayerlistPos[5] + if advplayerlistPos[6] == nil or advplayerlistPos[6] then + xPos = advplayerlistPos[2] - (5.3*advplayerlistPos[5]) + else + xPos = advplayerlistPos[4] + (5.3*advplayerlistPos[5]) + usedImgSize + end + yPos = advplayerlistPos[3] + if advplayerlistPos[3] < 0 then + yPos = 0 + end + yPos = yPos + (4*advplayerlistPos[5]) + if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then + createList(usedImgSize) + end + end +end + +function widget:Initialize() + updatePosition() +end + +function widget:Shutdown() + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + end +end + +local sec = 0 +function widget:Update(dt) + sec = sec + dt + if sec > 0.5 then + sec = 0 + updatePosition() + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if drawlist[1] ~= nil then + local mx,my = Spring.GetMouseState() + glPushMatrix() + glTranslate(xPos, yPos, 0) + if isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + gl.Color(1,1,1,1) + else + gl.Color(0.96,0.96,0.96,0.92) + end + glCallList(drawlist[1]) + glPopMatrix() + end +end + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + +function widget:MousePress(mx, my, mb) + if mb == 1 and isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + return true + end +end + +function widget:MouseRelease(mx, my, mb) + if mb == 1 and isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + Spring.SendCommands({"clearmapmarks"}) + updatePosition(true) + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_com_nametags.lua b/LuaUI/Widgets_Evo/gui_com_nametags.lua new file mode 100644 index 000000000..f802fb8ac --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_com_nametags.lua @@ -0,0 +1,430 @@ +function widget:GetInfo() + return { + name = "Commander Name Tags", + desc = "Displays a name tags above commanders.", + author = "Bluestone, Floris", + date = "20 february 2015", + license = "GNU GPL, v2 or later", + layer = -2, + enabled = true, -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-- config +-------------------------------------------------------------------------------- + +local drawForIcon = true -- note that commander icon still gets drawn on top of the name +local nameScaling = true +local useThickLeterring = true +local heightOffset = 50 +local fontSize = 15 -- not real fontsize, it will be scaled +local scaleFontAmount = 120 +local fontShadow = true -- only shows if font has a white outline +local shadowOpacity = 0.35 + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 50 +local fontfileOutlineSize = 10 +local fontfileOutlineStrength = 10 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local shadowFont = gl.LoadFont(fontfile, fontfileSize*fontfileScale, 35*fontfileScale, 1.6) +local fontfileScale2 = fontfileScale * 0.66 +local fonticon = gl.LoadFont(fontfile, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength*0.33) + +local singleTeams = false +if #Spring.GetTeamList()-1 == #Spring.GetAllyTeamList()-1 then + singleTeams = true +end + +local spec = Spring.GetSpectatingState() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local GetUnitTeam = Spring.GetUnitTeam +local GetPlayerInfo = Spring.GetPlayerInfo +local GetPlayerList = Spring.GetPlayerList +local GetTeamColor = Spring.GetTeamColor +local GetUnitDefID = Spring.GetUnitDefID +local GetAllUnits = Spring.GetAllUnits +local IsUnitInView = Spring.IsUnitInView +local GetCameraPosition = Spring.GetCameraPosition +local GetUnitPosition = Spring.GetUnitPosition + +local glDepthTest = gl.DepthTest +local glAlphaTest = gl.AlphaTest +local glColor = gl.Color +local glTranslate = gl.Translate +local glBillboard = gl.Billboard +local glDrawFuncAtUnit = gl.DrawFuncAtUnit +local GL_GREATER = GL.GREATER +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local glBlending = gl.Blending +local glScale = gl.Scale + +local glCallList = gl.CallList + +local diag = math.diag + +-------------------------------------------------------------------------------- + +local comms = {} +local comnameList = {} +local comnameIconList = {} +local drawScreenUnits = {} +local CheckedForSpec = false +local myTeamID = Spring.GetMyTeamID() +local myPlayerID = Spring.GetMyPlayerID() + +local comDefs = {} +for unitDefID, defs in pairs(UnitDefs) do + --For some reason spring throws errors if I write these statements in short form, so here I am being overly specific + if defs.customParams.iscommander and defs.customParams.shownametag == false then + + elseif defs.customParams.iscommander and defs.customParams.shownametag == nil or defs.customParams.iscommander and defs.customParams.shownametag == true then + comDefs[unitDefID] = true + end +end + +local sameTeamColors = false +if WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors ~= nil then + sameTeamColors = WG['playercolorpalette'].getSameTeamColors() +end + +-------------------------------------------------------------------------------- + +--gets the name, color, and height of the commander +local function GetCommAttributes(unitID, unitDefID) + local team = GetUnitTeam(unitID) + if team == nil then + return nil + end + + local name = '' + if Spring.GetGameRulesParam('ainame_'..team) then + name = Spring.GetGameRulesParam('ainame_'..team)..' (AI)' + else + local players = GetPlayerList(team) + name = (#players>0) and GetPlayerInfo(players[1],false) or '------' + for _,pID in ipairs(players) do + local pname,active,isspec = GetPlayerInfo(pID,false) + if active and not isspec then + name = pname + break + end + end + end + + local r, g, b, a = GetTeamColor(team) + local bgColor = {0,0,0,1} + if (r + g*1.2 + b*0.4) < 0.8 then -- try to keep these values the same as the playerlist + bgColor = {1,1,1,1} + end + + local height = UnitDefs[unitDefID].height + heightOffset + return {name, {r, g, b, a}, height, bgColor} +end + +local function RemoveLists() + for name, list in pairs(comnameList) do + gl.DeleteList(comnameList[name]) + end + for name, list in pairs(comnameIconList) do + gl.DeleteList(comnameIconList[name]) + end + comnameList = {} + comnameIconList = {} +end + +local function createComnameList(attributes) + if comnameList[attributes[1]] ~= nil then + gl.DeleteList(comnameList[attributes[1]]) + end + comnameList[attributes[1]] = gl.CreateList( function() + local outlineColor = {0,0,0,1} + if (attributes[2][1] + attributes[2][2]*1.2 + attributes[2][3]*0.4) < 0.8 then -- try to keep these values the same as the playerlist + outlineColor = {1,1,1,1} + end + if useThickLeterring then + if outlineColor[1] == 1 and fontShadow then + glTranslate(0, -(fontSize/44), 0) + shadowFont:Begin() + shadowFont:SetTextColor({0,0,0,shadowOpacity}) + shadowFont:SetOutlineColor({0,0,0,shadowOpacity}) + shadowFont:Print(attributes[1], 0, 0, fontSize, "con") + shadowFont:End() + glTranslate(0, (fontSize/44), 0) + end + font:SetTextColor(outlineColor) + font:SetOutlineColor(outlineColor) + + font:Print(attributes[1], -(fontSize/38), -(fontSize/33), fontSize, "con") + font:Print(attributes[1], (fontSize/38), -(fontSize/33), fontSize, "con") + end + font:Begin() + font:SetTextColor(attributes[2]) + font:SetOutlineColor(outlineColor) + font:Print(attributes[1], 0, 0, fontSize, "con") + font:End() + end) +end + +local sec = 0 +function widget:Update(dt) + sec = sec + dt + if WG['playercolorpalette'] ~= nil then + if WG['playercolorpalette'].getSameTeamColors and sameTeamColors ~= WG['playercolorpalette'].getSameTeamColors() then + sameTeamColors = WG['playercolorpalette'].getSameTeamColors() + RemoveLists() + CheckAllComs() + sec = 0 + end + elseif sameTeamColors == true then + sameTeamColors = false + RemoveLists() + CheckAllComs() + sec = 0 + end + if not singleTeams and WG['playercolorpalette'] ~= nil and WG['playercolorpalette'].getSameTeamColors() then + if myTeamID ~= Spring.GetMyTeamID() then + -- old + local name = GetPlayerInfo(select(2,Spring.GetTeamInfo(myTeamID,false)),false) + if comnameList[name] ~= nil then + gl.DeleteList(comnameList[name]) + comnameList[name] = nil + end + -- new + myTeamID = Spring.GetMyTeamID() + myPlayerID = Spring.GetMyPlayerID() + name = GetPlayerInfo(select(2,Spring.GetTeamInfo(myTeamID,false)),false) + if comnameList[name] ~= nil then + gl.DeleteList(comnameList[name]) + comnameList[name] = nil + end + CheckAllComs() + sec = 0 + end + end + if not spec and sec > 1.5 then + sec = 0 + CheckAllComs() + end +end + +local function DrawName(attributes) + if comnameList[attributes[1]] == nil then + createComnameList(attributes) + end + glTranslate(0, attributes[3], 0) + glBillboard() + if nameScaling then + glScale(usedFontSize/fontSize,usedFontSize/fontSize,usedFontSize/fontSize) + end + glCallList(comnameList[attributes[1]]) + + if nameScaling then + glScale(1,1,1) + end +end + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + RemoveLists() + CheckAllComs() + fontfileScale = newFontfileScale + fontfileScale2 = fontfileScale * 0.66 + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + shadowFont = gl.LoadFont(fontfile, fontfileSize*fontfileScale, 35*fontfileScale, 1.6) + fonticon = gl.LoadFont(fontfile, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength*0.33) + end +end + +local function createComnameIconList(unitID, attributes) + if comnameIconList[attributes[1]] ~= nil then + gl.DeleteList(comnameIconList[attributes[1]]) + end + comnameIconList[attributes[1]] = gl.CreateList( function() + local x,y,z = GetUnitPosition(unitID) + x,z = Spring.WorldToScreenCoords(x, y, z) + + local outlineColor = {0,0,0,1} + if (attributes[2][1] + attributes[2][2]*1.2 + attributes[2][3]*0.4) < 0.8 then -- try to keep these values the same as the playerlist + outlineColor = {1,1,1,1} + end + fonticon:Begin() + fonticon:SetTextColor(attributes[2]) + fonticon:SetOutlineColor(outlineColor) + fonticon:Print(attributes[1], 0, 0, fontSize*1.9, "con") + fonticon:End() + end) +end + +function widget:DrawScreenEffects() -- using DrawScreenEffects so that guishader will blur it when needed + if Spring.IsGUIHidden() then return end + + for unitID, attributes in pairs(drawScreenUnits) do + if not comnameIconList[attributes[1]] then + createComnameIconList(unitID, attributes) + end + local x,y,z = GetUnitPosition(unitID) + x,z = Spring.WorldToScreenCoords(x, y+50+heightOffset, z) + local scale = 1-(attributes[5]/25000) + if scale < 0.5 then scale = 0.5 end + gl.PushMatrix() + gl.Translate(x,z,0) + gl.Scale(scale,scale,scale) + gl.CallList(comnameIconList[attributes[1]]) + gl.PopMatrix() + end + drawScreenUnits = {} +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + -- untested fix: when you resign, to also show enemy com playernames (because widget:PlayerChanged() isnt called anymore) + if not CheckedForSpec and Spring.GetGameFrame() > 1 then + if spec then + CheckedForSpec = true + CheckAllComs() + end + end + + glDepthTest(true) + glAlphaTest(GL_GREATER, 0) + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + + local camX, camY, camZ = GetCameraPosition() + + for unitID, attributes in pairs(comms) do + + -- calc opacity + if IsUnitInView(unitID) then + local x,y,z = GetUnitPosition(unitID) + camDistance = diag(camX-x, camY-y, camZ-z) + + if drawForIcon and Spring.IsUnitIcon(unitID) then + attributes[5] = camDistance + drawScreenUnits[unitID] = attributes + else + usedFontSize = (fontSize*0.5) + (camDistance/scaleFontAmount) + glDrawFuncAtUnit(unitID, false, DrawName, attributes) + end + end + end + + glAlphaTest(false) + glColor(1,1,1,1) + glDepthTest(false) +end + +-------------------------------------------------------------------------------- + + + +function CheckCom(unitID, unitDefID, unitTeam) + if comDefs[unitDefID] then + comms[unitID] = GetCommAttributes(unitID, unitDefID) + end +end + +function CheckAllComs() + local allUnits = GetAllUnits() + for _, unitID in pairs(allUnits) do + local unitDefID = GetUnitDefID(unitID) + if comDefs[unitDefID] then + comms[unitID] = GetCommAttributes(unitID, unitDefID) + end + end +end + +function widget:Initialize() + WG['nametags'] = {} + WG['nametags'].getDrawForIcon = function() + return drawForIcon + end + WG['nametags'].setDrawForIcon = function(value) + drawForIcon = value + end + CheckAllComs() +end + +function widget:Shutdown() + RemoveLists() + gl.DeleteFont(font) +end + +function widget:PlayerChanged(playerID) + spec = Spring.GetSpectatingState() + local name,_ = GetPlayerInfo(playerID,false) + comnameList[name] = nil + CheckAllComs() -- handle substitutions, etc +end + +function widget:UnitCreated(unitID, unitDefID, unitTeam) + CheckCom(unitID, unitDefID, unitTeam) +end + +function widget:UnitDestroyed(unitID, unitDefID, unitTeam) + comms[unitID] = nil + + if comnameIconList[unitID] then + gl.DeleteList(comnameIconList[unitID]) + comnameIconList[unitID] = nil + end +end + +function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + CheckCom(unitID, unitDefID, unitTeam) + if comnameIconList[unitID] then + gl.DeleteList(comnameIconList[unitID]) + comnameIconList[unitID] = nil + end +end + +function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + CheckCom(unitID, unitDefID, unitTeam) + if comnameIconList[unitID] then + gl.DeleteList(comnameIconList[unitID]) + comnameIconList[unitID] = nil + end +end + +function widget:UnitEnteredLos(unitID, unitDefID, unitTeam) + CheckCom(unitID, unitDefID, unitTeam) +end + + +function toggleNameScaling() + nameScaling = not nameScaling +end + +function widget:GetConfigData() + return { + nameScaling = nameScaling, + drawForIcon = drawForIcon + } +end + +function widget:SetConfigData(data) --load config + widgetHandler:AddAction("comnamescale", toggleNameScaling) + if data.nameScaling ~= nil then + nameScaling = data.nameScaling + end + if data.drawForIcon ~= nil then + drawForIcon = data.drawForIcon + end +end diff --git a/LuaUI/Widgets_Evo/gui_commands_fx.lua b/LuaUI/Widgets_Evo/gui_commands_fx.lua new file mode 100644 index 000000000..1e01ed01f --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_commands_fx.lua @@ -0,0 +1,849 @@ +function widget:GetInfo() + return { + name = "Commands FX", + desc = "Shows commands given by allies", + author = "Floris (bluestone helped optimizing)", + date = "20 may 2015", + license = "GNU GPL, v2 or later", + layer = 2, + enabled = true, + } +end + +-- future: hotkey to show all current cmds? (like current shift+space) +-- handle set target +-- quickfade on cmd cancel + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local CMD_RAW_MOVE = 39812 +local CMD_ATTACK = CMD.ATTACK --icon unit or map +local CMD_CAPTURE = CMD.CAPTURE --icon unit or area +local CMD_FIGHT = CMD.FIGHT -- icon map +local CMD_GUARD = CMD.GUARD -- icon unit +local CMD_INSERT = CMD.INSERT +local CMD_LOAD_ONTO = CMD.LOAD_ONTO -- icon unit +local CMD_LOAD_UNITS = CMD.LOAD_UNITS -- icon unit or area +local CMD_MANUALFIRE = CMD.MANUALFIRE -- icon unit or map (cmdtype edited by gadget) +local CMD_MOVE = CMD.MOVE -- icon map +local CMD_PATROL = CMD.PATROL --icon map +local CMD_RECLAIM = CMD.RECLAIM --icon unit feature or area +local CMD_REPAIR = CMD.REPAIR -- icon unit or area +local CMD_RESTORE = CMD.RESTORE -- icon area +local CMD_RESURRECT = CMD.RESURRECT -- icon unit feature or area +-- local CMD_SET_TARGET = 34923 -- custom command, doesn't go through UnitCommand +local CMD_UNLOAD_UNIT = CMD.UNLOAD_UNIT -- icon map +local CMD_UNLOAD_UNITS = CMD.UNLOAD_UNITS -- icon unit or area +local BUILD = -1 + +local diag = math.diag +local pi = math.pi +local sin = math.sin +local cos = math.cos +local atan = math.atan +local random = math.random + +local glPushMatrix = gl.PushMatrix +local glUnitShape = gl.UnitShape +local glRotate = gl.Rotate +local glTranslate = gl.Translate +local glPopMatrix = gl.PopMatrix +local glTexture = gl.Texture +local glColor = gl.Color +local glBeginEnd = gl.BeginEnd +local glVertex = gl.Vertex +local glTexCoord = gl.TexCoord +local glUnit = gl.Unit +local GL_QUADS = GL.QUADS + +local GaiaTeamID = Spring.GetGaiaTeamID() + +-------------------------------------------------------------------------------- +-- Config +-------------------------------------------------------------------------------- + +local filterAIteams = true + +local drawBuildQueue = true +local drawLineTexture = true +local drawUnitHighlight = true +local drawUnitHighlightSkipFPS = 13 -- (0 to disable) skip drawing when framerate gets below this value + +local opacity = 1 +local duration = 2.6 + +local lineWidth = 7.8 +local lineOpacity = 0.75 +local lineDuration = 1 -- set a value <= 1 +local lineWidthEnd = 0.85 -- multiplier +local lineTextureLength = 4 +local lineTextureSpeed = 2.4 + +local groundGlow = true +local glowRadius = 26 +local glowDuration = 0.5 +local glowOpacity = 0.11 + +-- limit amount of effects to keep performance sane +local maxCommandCount = 500 -- dont draw more commands than this amount, but keep processing them +local maxTotalCommandCount = 850 -- dont add more commands above this amount +local maxGroundGlowCount = 50 +local drawUnitHightlightMaxUnits = 70 + +local glowImg = ":n:LuaUI/Images/commandsfx/glow.dds" +local lineImg = ":n:LuaUI/Images/commandsfx/line.dds" + +local ignoreUnits = {} +for udefID,def in ipairs(UnitDefs) do + if def.customParams['nohealthbars'] then + ignoreUnits[udefID] = true + end +end + +local mapX = Game.mapSizeX +local mapZ = Game.mapSizeZ + +local CONFIG = { + [CMD_ATTACK] = { + sizeMult = 1.4, + endSize = 0.28, + colour = {1.00, 0.20, 0.20, 0.30}, + }, + [CMD_CAPTURE] = { + sizeMult = 1.4, + endSize = 0.28, + colour = {1.00, 1.00, 0.30, 0.30}, + }, + [CMD_FIGHT] = { + sizeMult = 1.2, + endSize = 0.24, + colour = {0.30, 0.50, 1.00, 0.25}, + }, + [CMD_GUARD] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.10, 0.10, 0.50, 0.25}, + }, + [CMD_LOAD_ONTO] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.30, 1.00, 1.00 ,0.25}, + }, + [CMD_LOAD_UNITS] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.30, 1.00, 1.00, 0.30}, + }, + [CMD_MANUALFIRE] = { + sizeMult = 1.4, + endSize = 0.28, + colour = {1.00, 0.00, 0.00, 0.30}, + }, + [CMD_MOVE] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.00, 1.00, 0.00, 0.25}, + }, + [CMD_RAW_MOVE] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.00, 1.00, 0.00, 0.25}, + }, + [CMD_PATROL] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.10, 0.10, 1.00, 0.25}, + }, + [CMD_RECLAIM] = { + sizeMult = 1, + endSize = 0, + colour = {1.00, 0.20, 1.00, 0.4}, + }, + [CMD_REPAIR] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.30, 1.00, 1.00, 0.4}, + }, + [CMD_RESTORE] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.00, 0.50, 0.00, 0.25}, + }, + [CMD_RESURRECT] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.20, 0.60, 1.00, 0.25}, + }, + --[[ + [CMD_SET_TARGET] = { + sizeMult = 1, + endSize = 0.2, + colour = {1.00 ,0.75 ,1.00 ,0.25}, + }, + ]] + [CMD_UNLOAD_UNIT] = { + sizeMult = 1, + endSize = 0.2, + colour = {1.00, 1.00 ,0.00 ,0.25}, + }, + [CMD_UNLOAD_UNITS] = { + sizeMult = 1, + endSize = 0.2, + colour = {1.00, 1.00 ,0.00 ,0.25}, + }, + [BUILD] = { + sizeMult = 1, + endSize = 0.2, + colour = {0.00, 1.00 ,0.00 ,0.25}, + } +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local enabledTeams = {} +local commands = {} +local monitorCommands = {} +local minQueueCommand = 1 +local maxCommand = 0 +local totalCommands = 0 + +local unitCommand = {} -- most recent key in command table of order for unitID +local osClock + +local UNITCONF = {} +local shapes = {} + +local drawFrame = 0 +local gameframeDrawFrame = 0 + +local spGetUnitPosition = Spring.GetUnitPosition +local spGetCommandQueue = Spring.GetCommandQueue +local spIsUnitInView = Spring.IsUnitInView +local spIsSphereInView = Spring.IsSphereInView +local spIsUnitIcon = Spring.IsUnitIcon +local spValidUnitID = Spring.ValidUnitID +local spValidFeatureID = Spring.ValidFeatureID +local spGetFeaturePosition = Spring.GetFeaturePosition +local spIsUnitSelected = Spring.IsUnitSelected +local spIsGUIHidden = Spring.IsGUIHidden +local spTraceScreenRay = Spring.TraceScreenRay +local spIsUnitSelected = Spring.IsUnitSelected +local spGetUnitDefID = Spring.GetUnitDefID +local spLoadCmdColorsConfig = Spring.LoadCmdColorsConfig +local spGetFPS = Spring.GetFPS +local spGetMyTeamID = Spring.GetMyTeamID + +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_ONE = GL.ONE + +local MAX_UNITS = Game.maxUnits +local find = string.find + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function SetUnitConf() + local name, shape, xscale, zscale, scale, xsize, zsize, weaponcount + for udid, unitDef in pairs(UnitDefs) do + xsize, zsize = unitDef.xsize, unitDef.zsize + scale = ( xsize^2 + zsize^2 )^0.5 + name = unitDef.name + + if (unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0) then + shapeName = 'square' + shape = shapes.square + xscale, zscale = xsize, zsize + elseif (unitDef.isAirUnit) then + shapeName = 'triangle' + shape = shapes.triangle + xscale, zscale = scale, scale + else + shapeName = 'circle' + shape = shapes.circle + xscale, zscale = scale, scale + end + + UNITCONF[udid] = {name=name, shape=shape, shapeName=shapeName, xscale=xscale, zscale=zscale} + end +end + + +local function setCmdLineColors(alpha) + spLoadCmdColorsConfig('move 0.5 1.0 0.5 '..alpha) + spLoadCmdColorsConfig('attack 1.0 0.2 0.2 '..alpha) + spLoadCmdColorsConfig('fight 0.5 0.5 1.0 '..alpha) + spLoadCmdColorsConfig('wait 0.5 0.5 0.5 '..alpha) + spLoadCmdColorsConfig('build 0.0 1.0 0.0 '..alpha) + spLoadCmdColorsConfig('guard 0.3 0.3 1.0 '..alpha) + spLoadCmdColorsConfig('stop 0.0 0.0 0.0 '..alpha) + spLoadCmdColorsConfig('patrol 0.3 0.3 1.0 '..alpha) + spLoadCmdColorsConfig('capture 1.0 1.0 0.3 '..alpha) + spLoadCmdColorsConfig('repair 0.3 1.0 1.0 '..alpha) + spLoadCmdColorsConfig('reclaim 1.0 0.2 1.0 '..alpha) + spLoadCmdColorsConfig('restore 0.0 1.0 0.0 '..alpha) + spLoadCmdColorsConfig('resurrect 0.2 0.6 1.0 '..alpha) + spLoadCmdColorsConfig('load 0.3 1.0 1.0 '..alpha) + spLoadCmdColorsConfig('unload 1.0 1.0 0.0 '..alpha) + spLoadCmdColorsConfig('deathWatch 0.5 0.5 0.5 '..alpha) +end + +function resetEnabledTeams() + enabledTeams = {} + local t = Spring.GetTeamList() + for _,teamID in ipairs(t) do + if not filterAIteams or not select(4,Spring.GetTeamInfo(teamID,false)) then + enabledTeams[teamID] = true + end + end +end + +function widget:Initialize() + --SetUnitConf() + + --spLoadCmdColorsConfig('useQueueIcons 0 ') + spLoadCmdColorsConfig('queueIconScale 0.66 ') + spLoadCmdColorsConfig('queueIconAlpha 0.5 ') + + setCmdLineColors(0.5) + resetEnabledTeams() + + WG['commandsfx'] = {} + WG['commandsfx'].getOpacity = function() + return opacity + end + WG['commandsfx'].setOpacity = function(value) + opacity = value + end + WG['commandsfx'].getFilterAI = function() + return filterAIteams + end + WG['commandsfx'].setFilterAI = function(value) + filterAIteams = value + resetEnabledTeams() + end +end + +function widget:Shutdown() + --spLoadCmdColorsConfig('useQueueIcons 1 ') + spLoadCmdColorsConfig('queueIconScale 1 ') + spLoadCmdColorsConfig('queueIconAlpha 1 ') + + setCmdLineColors(0.7) +end + + + + +local function DrawLineEnd(x1,y1,z1, x2,y2,z2, width) + y1 = y2 + + local distance = diag(x2-x1, y2-y1, z2-z1) + + -- for 2nd rounding + local distanceDivider = distance / (width/2.25) + x1_2 = x2 - ((x1 - x2) / distanceDivider) + z1_2 = z2 - ((z1 - z2) / distanceDivider) + + -- for first rounding + distanceDivider = distance / (width/4.13) + x1 = x2 - ((x1 - x2) / distanceDivider) + z1 = z2 - ((z1 - z2) / distanceDivider) + + local theta = (x1~=x2) and atan((z2-z1)/(x2-x1)) or pi/2 + local zOffset = cos(pi-theta) * width / 2 + local xOffset = sin(pi-theta) * width / 2 + + local xOffset2 = xOffset / 1.35 + local zOffset2 = zOffset / 1.35 + + -- first rounding + glVertex(x1+xOffset2, y1, z1+zOffset2) + glVertex(x1-xOffset2, y1, z1-zOffset2) + + glVertex(x2-xOffset, y2, z2-zOffset) + glVertex(x2+xOffset, y2, z2+zOffset) + + -- second rounding + glVertex(x1+xOffset2, y1, z1+zOffset2) + glVertex(x1-xOffset2, y1, z1-zOffset2) + + xOffset2 = xOffset / 3.22 + zOffset2 = zOffset / 3.22 + + glVertex(x1_2-xOffset2, y1, z1_2-zOffset2) + glVertex(x1_2+xOffset2, y1, z1_2+zOffset2) +end + + +local function DrawLineEndTex(x1,y1,z1, x2,y2,z2, width, texLength, texOffset) + y1 = y2 + + local distance = diag(x2-x1, y2-y1, z2-z1) + + -- for 2nd rounding + local distanceDivider = distance / (width/2.25) + x1_2 = x2 - ((x1 - x2) / distanceDivider) + z1_2 = z2 - ((z1 - z2) / distanceDivider) + + -- for first rounding + local distanceDivider2 = distance / (width/4.13) + x1 = x2 - ((x1 - x2) / distanceDivider2) + z1 = z2 - ((z1 - z2) / distanceDivider2) + + local theta = (x1~=x2) and atan((z2-z1)/(x2-x1)) or pi/2 + local zOffset = cos(pi-theta) * width / 2 + local xOffset = sin(pi-theta) * width / 2 + + local xOffset2 = xOffset / 1.35 + local zOffset2 = zOffset / 1.35 + + -- first rounding + glTexCoord(0.2-texOffset,0) + glVertex(x1+xOffset2, y1, z1+zOffset2) + glTexCoord(0.2-texOffset,1) + glVertex(x1-xOffset2, y1, z1-zOffset2) + + glTexCoord(0.55-texOffset,0.85) + glVertex(x2-xOffset, y2, z2-zOffset) + glTexCoord(0.55-texOffset,0.15) + glVertex(x2+xOffset, y2, z2+zOffset) + + -- second rounding + glTexCoord(0.8-texOffset,0.7) + glVertex(x1+xOffset2, y1, z1+zOffset2) + glTexCoord(0.8-texOffset,0.3) + glVertex(x1-xOffset2, y1, z1-zOffset2) + + xOffset2 = xOffset / 3.22 + zOffset2 = zOffset / 3.22 + + glTexCoord(0.55-texOffset,0.15) + glVertex(x1_2-xOffset2, y1, z1_2-zOffset2) + glTexCoord(0.55-texOffset,0.85) + glVertex(x1_2+xOffset2, y1, z1_2+zOffset2) +end + +local function DrawLine(x1,y1,z1, x2,y2,z2, width) -- long thin rectangle + + local theta = (x1~=x2) and atan((z2-z1)/(x2-x1)) or pi/2 + local zOffset = cos(pi-theta) * width / 2 + local xOffset = sin(pi-theta) * width / 2 + + glVertex(x1+xOffset, y1, z1+zOffset) + glVertex(x1-xOffset, y1, z1-zOffset) + + glVertex(x2-xOffset, y2, z2-zOffset) + glVertex(x2+xOffset, y2, z2+zOffset) +end + +local function DrawLineTex(x1,y1,z1, x2,y2,z2, width, texLength, texOffset) -- long thin rectangle + + local distance = diag(x2-x1, y2-y1, z2-z1) + + local theta = (x1~=x2) and atan((z2-z1)/(x2-x1)) or pi/2 + local zOffset = cos(pi-theta) * width / 2 + local xOffset = sin(pi-theta) * width / 2 + + glTexCoord(((distance/width)/texLength)+1-texOffset, 1) + glVertex(x1+xOffset, y1, z1+zOffset) + glTexCoord(((distance/width)/texLength)+1-texOffset, 0) + glVertex(x1-xOffset, y1, z1-zOffset) + + glTexCoord(0-texOffset,0) + glVertex(x2-xOffset, y2, z2-zOffset) + glTexCoord(0-texOffset,1) + glVertex(x2+xOffset, y2, z2+zOffset) +end + +local function DrawGroundquad(x,y,z,size) + glTexCoord(0,0) + glVertex(x-size,y,z-size) + glTexCoord(0,1) + glVertex(x-size,y,z+size) + glTexCoord(1,1) + glVertex(x+size,y,z+size) + glTexCoord(1,0) + glVertex(x+size,y,z-size) +end + +------------------------------------------------------------------------------------ + +function RemovePreviousCommand(unitID) + if unitCommand[unitID] and commands[unitCommand[unitID]] then + commands[unitCommand[unitID]].draw = false + end +end + +local unprocessedCommands = {} +local unprocessedCommandsNum = 0 +function addUnitCommand(unitID, unitDefID, cmdID) + -- record that a command was given (note: cmdID is not used, but useful to record for debugging) + if unitID and (CONFIG[cmdID] or cmdID==CMD_INSERT or cmdID<0) then + unprocessedCommandsNum = unprocessedCommandsNum + 1 + unprocessedCommands[unprocessedCommandsNum] = {ID=cmdID,time=os.clock(),unitID=unitID,draw=false,selected=spIsUnitSelected(unitID),udid=unitDefID} -- command queue is not updated until next gameframe + end +end + +local newUnitCommands = {} +function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, _, _) + if enabledTeams[teamID] ~= nil then + if teamID ~= GaiaTeamID or not string.find(UnitDefs[unitDefID].name, "critter_") then + if ignoreUnits[unitDefID] == nil then + if newUnitCommands[unitID] == nil then -- only process the first in queue, else when super large queue order is given widget will hog memory and crash + addUnitCommand(unitID, unitDefID, cmdID) + newUnitCommands[unitID] = true + else + newUnitCommands[unitID] = {unitDefID, cmdID} + end + end + end + end +end + +function ExtractTargetLocation(a,b,c,d,cmdID) + -- input is first 4 parts of cmd.params table + local x,y,z + if c or d then + if cmdID==CMD_RECLAIM and a >= MAX_UNITS and spValidFeatureID(a-MAX_UNITS) then --ugh, but needed + x,y,z = spGetFeaturePosition(a-MAX_UNITS) + elseif cmdID==CMD_REPAIR and spValidUnitID(a) then + x,y,z = spGetUnitPosition(a) + else + x=a + y=b + z=c + end + elseif a then + if a >= MAX_UNITS then + x,y,z = spGetFeaturePosition(a-MAX_UNITS) + else + x,y,z = spGetUnitPosition(a) + end + end + return x,y,z +end + +function getCommandsQueue(unitID) + local q = spGetCommandQueue(unitID, 35) or {} --limit to prevent mem leak, hax etc + local our_q = {} + local cmd + for i=1, #q do + if CONFIG[q[i].id] or q[i].id < 0 then + if q[i].id < 0 then + q[i].buildingID = -q[i].id; + q[i].id = BUILD + if not q[i].params[4] then + q[i].params[4] = 0 --sometimes the facing param is missing (wtf) + end + end + our_q[#our_q+1] = q[i] + end + end + return our_q +end + +local prevGameframe = 0 +local sec = 0 +local lastUpdate = 0 +local sec2 = 0 +local lastUpdate2 = 0 +function widget:Update(dt) + sec = sec + dt + if sec > lastUpdate + 0.1 then + lastUpdate = sec + + -- process newly given commands (not done in widgetUnitCommand() because with huge build queue it eats memory and can crash lua) + for unitID,v in pairs(newUnitCommands) do + if v ~= true and ignoreUnits[v[1]] == nil then + addUnitCommand(unitID, v[1], v[2]) + end + end + newUnitCommands = {} + + -- process new commands (cant be done directly because at widget:UnitCommand() the queue isnt updated yet) + for k=1, #unprocessedCommands do + if totalCommands <= maxTotalCommandCount then + maxCommand = maxCommand + 1 + local i = maxCommand + commands[i] = unprocessedCommands[k] + totalCommands = totalCommands + 1 + + RemovePreviousCommand(unprocessedCommands[k].unitID) + unitCommand[unprocessedCommands[k].unitID] = i + + -- get pruned command queue + local our_q = getCommandsQueue(unprocessedCommands[k].unitID) + local qsize = #our_q + commands[i].queue = our_q + commands[i].queueSize = qsize + if qsize > 1 then + monitorCommands[i] = qsize + end + if qsize > 0 then + commands[i].highlight = CONFIG[our_q[1].id].colour + commands[i].draw = true + end + + -- get location of final command + local lastCmd = our_q[#our_q] + if lastCmd and lastCmd.params then + local x,y,z = ExtractTargetLocation(lastCmd.params[1],lastCmd.params[2],lastCmd.params[3],lastCmd.params[4],lastCmd.id) + if x then + commands[i].x = x + commands[i].y = y + commands[i].z = z + end + end + commands[i].time = os.clock() + end + end + unprocessedCommands = {} + unprocessedCommandsNum = 0 + + + if sec2 > lastUpdate2 + 0.3 then + lastUpdate2 = sec2 + if prevGameframe ~= Spring.GetGameFrame() then + prevGameframe = Spring.GetGameFrame() + -- update queue (in case unit has reached the nearest queue coordinate) + local qsize + for i=1, #monitorCommands do + if commands[i] ~= nil then + qsize = monitorCommands[i] + if commands[i].draw == false then + monitorCommands[i] = nil + else + local q = spGetCommandQueue(commands[i].unitID,35) or {} + if qsize ~= #q then + local our_q = getCommandsQueue(commands[i].unitID) + commands[i].queue = our_q + commands[i].queueSize = #our_q + if qsize > 1 then + monitorCommands[i] = qsize + else + monitorCommands[i] = nil + end + end + end + end + end + end + end + end +end + + +local function IsPointInView(x,y,z) + if x and y and z then + return spIsSphereInView(x,y,z,1) --better way of doing this? + end + return false +end + + +local prevTexOffset = 0 +local texOffset = 0 +local prevOsClock = os.clock() + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + drawFrame = drawFrame + 1 + + if spIsGUIHidden() then return end + + osClock = os.clock() + if drawLineTexture then + texOffset = prevTexOffset - ((osClock - prevOsClock)*lineTextureSpeed) + texOffset = texOffset - math.floor(texOffset) + prevTexOffset = texOffset + end + prevOsClock = os.clock() + + gl.DepthTest(false) + gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + + local groundGlowCount = 0 + local commandCount = 0 + local newCommands = {} + local newCommandsCount = 0 + + --for i=1, #commands do + for i, v in pairs(commands) do + local progress = (osClock - commands[i].time) / duration + local unitID = commands[i].unitID + + if progress >= 1 then + -- remove when duration has passed + --Spring.Echo("Removing " .. i) + commands[i] = nil + totalCommands = totalCommands - 1 + monitorCommands[i] = nil + if unitCommand[unitID] == i then + unitCommand[unitID] = nil + end + elseif commands[i].draw and (spIsUnitInView(unitID) or IsPointInView(commands[i].x,commands[i].y,commands[i].z)) then + --newCommandsCount = newCommandsCount + 1 + --newCommands[newCommandsCount] = commands[i] + --unitCommand[unitID] = newCommandsCount + --if monitorCommands[i] then + -- monitorCommands[newCommandsCount] = monitorCommands[i] + -- if i ~= newCommandsCount then + -- monitorCommands[i] = nil + -- end + --end + + local prevX, prevY, prevZ = spGetUnitPosition(unitID) + + -- draw set target command (TODO) + --[[ + if prevX and commands[i].set_target and commands[i].set_target.params and commands[i].set_target.params[1] then + local lineColour = CONFIG[CMD_SET_TARGET].colour + local lineAlpha = opacity * lineColour[4] * (1-progress) + glColor(lineColour[1],lineColour[2],lineColour[3],lineAlpha) + if commands[i].set_target.params[3] then + glBeginEnd(GL_QUADS, DrawLine, prevX,prevY,prevZ, commands[i].set_target.params[1], commands[i].set_target.params[2], commands[i].set_target.params[3], lineWidth) + else + local x,y,z = spGetUnitPosition(commands[i].set_target.params[1]) + if x then + glBeginEnd(GL_QUADS, DrawLine, prevX,prevY,prevZ, x,y,z, lineWidth) + end + end + end + ]] + + -- draw command queue + if commands[i].queueSize > 0 and prevX and commandCount < maxCommandCount then + + local lineAlphaMultiplier = 1 - (progress / lineDuration) + for j=1,commands[i].queueSize do + local X,Y,Z = ExtractTargetLocation(commands[i].queue[j].params[1], commands[i].queue[j].params[2], commands[i].queue[j].params[3], commands[i].queue[j].params[4], commands[i].queue[j].id) + local validCoord = X and Z and X>=0 and X<=mapX and Z>=0 and Z<=mapZ + -- draw + if X and validCoord then + commandCount = commandCount + 1 + -- lines + local usedLineWidth = lineWidth - (progress * (lineWidth - (lineWidth * lineWidthEnd))) + local lineColour = CONFIG[commands[i].queue[j].id].colour + local lineAlpha = opacity * lineOpacity * (lineColour[4] * 2) * lineAlphaMultiplier + if lineAlpha > 0 then + glColor(lineColour[1],lineColour[2],lineColour[3],lineAlpha) + if drawLineTexture then + + usedLineWidth = lineWidth - (progress * (lineWidth - (lineWidth * lineWidthEnd))) + glTexture(lineImg) + glBeginEnd(GL_QUADS, DrawLineTex, prevX,prevY,prevZ, X, Y, Z, usedLineWidth, lineTextureLength * (lineWidth / usedLineWidth), texOffset) + glTexture(false) + else + glBeginEnd(GL_QUADS, DrawLine, prevX,prevY,prevZ, X, Y, Z, usedLineWidth) + end + -- ghost of build queue + if drawBuildQueue and commands[i].queue[j].buildingID then + glPushMatrix() + glTranslate(X,Y+1,Z) + glRotate(90 * commands[i].queue[j].params[4], 0, 1, 0) + glUnitShape(commands[i].queue[j].buildingID, spGetMyTeamID(), true, false, false) + glRotate(-90 * commands[i].queue[j].params[4], 0, 1, 0) + glTranslate(-X,-Y-1,-Z) + glPopMatrix() + end + if j == 1 and not drawLineTexture then + -- draw startpoint rounding + glColor(lineColour[1],lineColour[2],lineColour[3],lineAlpha) + glBeginEnd(GL_QUADS, DrawLineEnd, X, Y, Z, prevX,prevY,prevZ, usedLineWidth) + end + end + if j==commands[i].queueSize then + + -- draw endpoint rounding + if drawLineTexture == false and lineAlpha > 0 then + if drawLineTexture then + glTexture(lineImg) + glColor(lineColour[1],lineColour[2],lineColour[3],lineAlpha) + glBeginEnd(GL_QUADS, DrawLineEndTex, prevX,prevY,prevZ, X, Y, Z, usedLineWidth, lineTextureLength, texOffset) + glTexture(false) + else + glColor(lineColour[1],lineColour[2],lineColour[3],lineAlpha) + glBeginEnd(GL_QUADS, DrawLineEnd, prevX,prevY,prevZ, X, Y, Z, usedLineWidth) + end + end + + -- ground glow + if groundGlow and groundGlowCount < maxGroundGlowCount then + groundGlowCount = groundGlowCount + 1 + local size = (glowRadius * CONFIG[commands[i].queue[j].id].sizeMult) + ((glowRadius * CONFIG[commands[i].queue[j].id].endSize - glowRadius * CONFIG[commands[i].queue[j].id].sizeMult) * progress) + local glowAlpha = (1 - progress) * glowOpacity * opacity + + if commands[i].selected then + glowAlpha = glowAlpha * 1.5 + end + glColor(lineColour[1],lineColour[2],lineColour[3],glowAlpha) + glTexture(glowImg) + glBeginEnd(GL_QUADS,DrawGroundquad,X,Y+3,Z,size) + glTexture(false) + end + + end + prevX, prevY, prevZ = X, Y, Z + end + end + end + end + end + --commands = newCommands + --maxCommand = #commands + --newCommands = nil + glColor(1,1,1,1) +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if spIsGUIHidden() then return end + + if drawUnitHighlightSkipFPS > 0 and spGetFPS() < drawUnitHighlightSkipFPS then return end + + -- highlight unit + if drawUnitHighlight then + gl.DepthTest(true) + gl.PolygonOffset(-2, -2) + gl.Blending(GL_SRC_ALPHA, GL_ONE) + local highlightUnitCounter = 0 + for i,_ in pairs(commands) do + if commands[i].draw and commands[i].highlight and not spIsUnitIcon(commands[i].unitID) then + local progress = (osClock - commands[i].time) / duration + glColor(commands[i].highlight[1],commands[i].highlight[2],commands[i].highlight[3],0.08*(1-progress)) + glUnit(commands[i].unitID, true) + highlightUnitCounter = highlightUnitCounter + 1 + end + if highlightUnitCounter >= drawUnitHightlightMaxUnits then + break + end + end + gl.Blending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + gl.PolygonOffset(false) + gl.DepthTest(false) + end +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.opacity = opacity + savedTable.filterAIteams = filterAIteams + return savedTable +end + +function widget:SetConfigData(data) + if data.opacity ~= nil then opacity = data.opacity end + if data.filterAIteams ~= nil then filterAIteams = data.filterAIteams end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_commands_info.lua b/LuaUI/Widgets_Evo/gui_commands_info.lua new file mode 100644 index 000000000..684f58be3 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_commands_info.lua @@ -0,0 +1,521 @@ + +function widget:GetInfo() +return { + name = "Commands info", + desc = "Leftmouse: scroll down, Rightmouse: scroll up, ctrl/shift/alt combi: speedup)", + author = "Floris", + date = "August 2015", + license = "Dental flush", + layer = -99990, + enabled = true, +} +end + +--local show = true + +local loadedFontSize = 32 + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfileScale2 = fontfileScale * 1.2 +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local changelogFile = VFS.LoadFile("commandlist.txt") + +local bgMargin = 6 + +local closeButtonSize = 30 +local screenHeight = 520-bgMargin-bgMargin +local screenWidth = 1050-bgMargin-bgMargin + +local textareaMinLines = 10 -- wont scroll down more, will show at least this amount of lines + +local customScale = 1 + +local startLine = 1 + +local vsx,vsy = Spring.GetViewGeometry() +local screenX = (vsx*0.5) - (screenWidth/2) +local screenY = (vsy*0.5) + (screenHeight/2) + +local spIsGUIHidden = Spring.IsGUIHidden +local showHelp = false + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glPolygonMode = gl.PolygonMode +local glRect = gl.Rect +local glText = gl.Text +local glShape = gl.Shape +local glGetTextWidth = gl.GetTextWidth +local glGetTextHeight = gl.GetTextHeight + +local bgColorMultiplier = 0 + +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glScale = gl.Scale + +local GL_FILL = GL.FILL +local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK +local GL_LINE_STRIP = GL.LINE_STRIP + +local widgetScale = 1 +local vsx, vsy = Spring.GetViewGeometry() + +local changelogLines = {} +local totalChangelogLines = 0 + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + screenX = (vsx*0.5) - (screenWidth/2) + screenY = (vsy*0.5) + (screenHeight/2) + widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + fontfileScale2 = fontfileScale * 1.2 + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + end + if changelogList then gl.DeleteList(changelogList) end + changelogList = gl.CreateList(DrawWindow) +end + +local myTeamID = Spring.GetMyTeamID() + +local showOnceMore = false -- used because of GUI shader delay + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + + +function DrawTextarea(x,y,width,height,scrollbar) + local scrollbarOffsetTop = 18 -- note: wont add the offset to the bottom, only to top + local scrollbarOffsetBottom = 12 -- note: wont add the offset to the top, only to bottom + local scrollbarMargin = 10 + local scrollbarWidth = 8 + local scrollbarPosWidth = 4 + local scrollbarPosMinHeight = 8 + local scrollbarBackgroundColor = {0,0,0,0.24 } + local scrollbarBarColor = {1,1,1,0.08} + + local fontSizeTitle = 17 -- is version number + local fontSizeDate = 13 + local fontSizeLine = 15 + local lineSeparator = 2 + + local fontColorTitle = {1,1,1,1} + local fontColorDate = {0.66,0.88,0.66,1} + local fontColorLine = {0.8,0.77,0.74,1} + local fontColorCommand = {0.86,0.66,0.2,1} + + local textRightOffset = scrollbar and scrollbarMargin+scrollbarWidth+scrollbarWidth or 0 + local maxLines = math.floor((height-5)/fontSizeLine) + + -- textarea scrollbar + if scrollbar then + if (totalChangelogLines > maxLines or startLine > 1) then -- only show scroll above X lines + local scrollbarTop = y-scrollbarOffsetTop-scrollbarMargin-(scrollbarWidth-scrollbarPosWidth) + local scrollbarBottom = y-scrollbarOffsetBottom-height+scrollbarMargin+(scrollbarWidth-scrollbarPosWidth) + local scrollbarPosHeight = math.max(((height-scrollbarMargin-scrollbarMargin) / totalChangelogLines) * ((height-scrollbarMargin-scrollbarMargin) / 25), scrollbarPosMinHeight) + if scrollbarPosHeight > scrollbarTop-scrollbarBottom then scrollbarPosHeight = scrollbarTop-scrollbarBottom end + local scrollbarPos = scrollbarTop + (scrollbarBottom - scrollbarTop) * ((startLine-1) / totalChangelogLines) + scrollbarPos = scrollbarPos + ((startLine-1) / totalChangelogLines) * scrollbarPosHeight -- correct position taking position bar height into account + + -- background + gl.Color(scrollbarBackgroundColor) + RectRound( + x+width-scrollbarMargin-scrollbarWidth, + scrollbarBottom-(scrollbarWidth-scrollbarPosWidth), + x+width-scrollbarMargin, + scrollbarTop+(scrollbarWidth-scrollbarPosWidth), + scrollbarWidth/2 + ) + -- bar + gl.Color(scrollbarBarColor) + RectRound( + x+width-scrollbarMargin-scrollbarWidth + (scrollbarWidth - scrollbarPosWidth), + scrollbarPos, + x+width-scrollbarMargin-(scrollbarWidth - scrollbarPosWidth), + scrollbarPos - (scrollbarPosHeight), + scrollbarPosWidth/2 + ) + end + end + + -- draw textarea + if changelogFile then + font:Begin() + local lineKey = startLine + local j = 1 + while j < maxLines do -- maxlines is not exact, just a failsafe + if (lineSeparator+fontSizeTitle)*j > height then + break; + end + if changelogLines[lineKey] == nil then + break; + end + + local line = changelogLines[lineKey] + if string.find(line, '^/([a-zA-Z0-9]*)') then + local cmd = string.match(line, '^(/[\+a-zA-Z0-9_-]*)') + local line = string.sub(line, string.len(string.match(line, '^/[a-zA-Z0-9_-]*[ \t]*'))) + line, numLines = font:WrapText(line, (width - 90 - textRightOffset)*(loadedFontSize/fontSizeLine)) + if (lineSeparator+fontSizeTitle)*(j+numLines-1) > height then + break; + end + + font:SetTextColor(fontColorCommand) + font:Print(cmd, x+20, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + + font:SetTextColor(fontColorLine) + font:Print(line, x+230, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + j = j + (numLines - 1) + else + -- line + font:SetTextColor(fontColorLine) + line = line + line, numLines = font:WrapText(line, (width-50)*(loadedFontSize/fontSizeLine)) + if (lineSeparator+fontSizeTitle)*(j+numLines-1) > height then + break; + end + font:Print(line, x+10, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + j = j + (numLines - 1) + end + + j = j + 1 + lineKey = lineKey + 1 + end + font:End() + end +end + + +function DrawWindow() + local vsx,vsy = Spring.GetViewGeometry() + local x = screenX --rightwards + local y = screenY --upwards + + -- background + gl.Color(0,0,0,0.8) + RectRound(x-bgMargin,y-screenHeight-bgMargin,x+screenWidth+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + gl.Color(0.33,0.33,0.33,0.15) + RectRound(x,y-screenHeight,x+screenWidth,y,6) + + -- close button + local size = closeButtonSize*0.7 + local width = size*0.055 + gl.Color(1,1,1,1) + gl.PushMatrix() + gl.Translate(screenX+screenWidth-(closeButtonSize/2),screenY-(closeButtonSize/2),0) + gl.Rotate(-45,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(90,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.PopMatrix() + + -- title + local title = "Commmands" + local titleFontSize = 18 + gl.Color(0,0,0,0.8) + titleRect = {x-bgMargin, y+bgMargin, x+(glGetTextWidth(title)*titleFontSize)+27-bgMargin, y+37} + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font2:End() + + -- textarea + DrawTextarea(x, y-10, screenWidth, screenHeight-24, 1) +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if spIsGUIHidden() then return end + + -- draw the help + if not changelogList then + changelogList = gl.CreateList(DrawWindow) + end + + if show or showOnceMore then + + -- draw the changelog panel + glPushMatrix() + glTranslate(-(vsx * (widgetScale-1))/2, -(vsy * (widgetScale-1))/2, 0) + glScale(widgetScale, widgetScale, 1) + glCallList(changelogList) + glPopMatrix() + if (WG['guishader'] ~= nil) then + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + WG['guishader'].InsertRect(rectX1, rectY2, rectX2, rectY1, 'commandslist') + --WG['guishader'].setBlurIntensity(0.0017) + --WG['guishader'].setScreenBlur(true) + end + showOnceMore = false + + else + if (WG['guishader'] ~= nil) then + local removed = WG['guishader'].RemoveRect('commandslist') + if removed then + --WG['guishader'].setBlurIntensity() + WG['guishader'].setScreenBlur(false) + end + end + end +end + +function widget:KeyPress(key) + if key == 27 then -- ESC + show = false + end +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY +end + +--function widget:IsAbove(x, y) +-- -- on window +-- if show then +-- local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) +-- local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) +-- local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) +-- local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) +-- return IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) +-- else +-- return false +-- end +--end +-- +--function widget:GetTooltip(mx, my) +-- if show and widget:IsAbove(mx,my) then +-- return string.format( +-- "\255\255\255\1Left mouse\255\255\255\255 on textarea to scroll down.\n".. +-- "\255\255\255\1Right mouse\255\255\255\255 on textarea to scroll up.\n\n".. +-- "Add CTRL or SHIFT to scroll faster, or combine CTRL+SHIFT (+ALT).") +-- end +--end + +function widget:MouseWheel(up, value) + + if show then + local addLines = value*-3 -- direction is retarded + + startLine = startLine + addLines + if startLine < 1 then startLine = 1 end + if startLine > totalChangelogLines - textareaMinLines then startLine = totalChangelogLines - textareaMinLines end + + if changelogList then + glDeleteList(changelogList) + end + + changelogList = gl.CreateList(DrawWindow) + return true + else + return false + end +end + +function widget:MouseMove(x, y) + if show then + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if not IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + end + end +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + +function mouseEvent(x, y, button, release) + if spIsGUIHidden() then return false end + + if show then + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + -- on close button + local brectX1 = rectX2 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + local brectY2 = rectY1 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + if IsOnRect(x, y, brectX1, brectY2, rectX2, rectY1) then + if release then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = not show + end + return true + end + + if button == 1 or button == 3 then + if button == 3 and release then + show = not show + end + return true + end + elseif titleRect == nil or not IsOnRect(x, y, (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2), (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2)) then + if release then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = false + end + return true + end + end +end + +function lines(str) + local t = {} + local function helper(line) t[#t+1] = line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + +function widget:Initialize() + if changelogFile then + + WG['commands'] = {} + WG['commands'].toggle = function(state) + if state ~= nil then + show = state + else + show = not show + end + end + WG['commands'].isvisible = function() + return show + end + + -- somehow there are a few characters added at the start that we need to remove + --changelogFile = string.sub(changelogFile, 4) + + -- store changelog into array + changelogLines = lines(changelogFile) + + for i, line in ipairs(changelogLines) do + totalChangelogLines = i + end + + else + Spring.Echo("Commands info: couldn't load the commandslist file") + widgetHandler:RemoveWidget(self) + end +end + +function widget:Shutdown() + if buttonGL then + glDeleteList(buttonGL) + buttonGL = nil + end + if changelogList then + glDeleteList(changelogList) + changelogList = nil + end + gl.DeleteFont(font) + gl.DeleteFont(font2) +end diff --git a/LuaUI/Widgets_Evo/gui_common_colors.lua b/LuaUI/Widgets_Evo/gui_common_colors.lua deleted file mode 100644 index 2d10c12aa..000000000 --- a/LuaUI/Widgets_Evo/gui_common_colors.lua +++ /dev/null @@ -1,267 +0,0 @@ -function widget:GetInfo() - return { - name = "Common Team Colors", - desc = "v0.004 Makes neat team color scheme and everyone using this widget will see the same colors", - author = "CarRepairer", - date = "2013-09-24", - license = "GPL v2", - layer = -10001, - enabled = true, - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -options_path = 'Settings/Interface/Common Team Colors' -options = { - simpleColors = { - name = "Simple Colors", - type = 'bool', - value = false, - desc = 'All allies are green, all enemies are red.', - OnChange = function() widget:Initialize() end - }, -} - -local echo = Spring.Echo --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- HTML color names, colors should be a "wheel" -colors = { - --- Car's per player randomizer kinda sucks, so we randomize the shit out of the lines. Sad, but effective. - ---[[ - {'Coffee', '#6F4E37'}; - {'Teal', '#008080'}; - {'Salmon', '#FA8072'}; - {'Plum', '#DDA0DD'}; - {'Aquamarine', '#7FFFD4'}; - {'Yellow', '#FFFF00'}; - {'SkyBlue', '#87CEEB'}; - {'Navy', '#000080'}; - {'NeonPink', '#F535AA'}; - {'Blue', '#1144AA'}; - {'Cyan', '#00FFFF'}; - {'Parchment', '#FFFFC2'}; - {'Indigo', '#4B0082'}; - {'Red', '#FF0000'}; - {'Orange', '#FFA500'}; - {'Lime', '#00FF00'}; - {'Maroon', '#800000'}; - {'DarkGreen', '#006400'}; - {'Green', '#00CC00'}; - {'Mustard', '#FFDB58'}; - {'Sienna', '#A0522D'}; -]]-- - - {'Orange', '#ff6600'}; - {'Parchment', '#FFFFC2'}; - {'Teal', '#009B95'}; - {'Red', '#FF0000'}; - {'Purple', '#3914AF'}; - {'Yellow', '#FFFF00'}; - {'Blue', '#1144AA'}; - {'Pink', '#C9007A'}; - {'Green', '#00CC00'}; - - -} - -local colorNames = {} -for _,v in ipairs(colors) do - colorNames[v[1]] = v[2] -end - -local myColor = colorNames.Green -local allyColor = colorNames.Yellow -local gaiaColor = '#CCCCCC' -local enemyColor = colorNames.Red - -WG.LocalColor = (type(WG.LocalColor) == "table" and WG.LocalColor) or {} -WG.LocalColor.listeners = WG.LocalColor.listeners or {} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local function color2incolor(r,g,b,a) - if type(r) == 'table' then - r,g,b,a = unpack4(r) - end - r = math.max(r, 0.01) - g = math.max(g, 0.01) - b = math.max(b, 0.01) - - local inColor = '\255\255\255\255' - if r then - inColor = string.char(255, r*255, g*255, b*255) - end - return inColor -end -local function HexToColor(hex) - - hex = hex:gsub('#', '') - local r = hex:sub(1,2) - local g = hex:sub(3,4) - local b = hex:sub(5,6) - - r = tonumber(r, 16) - g = tonumber(g, 16) - b = tonumber(b, 16) - - r = r / 255 - g = g / 255 - b = b / 255 - - return r,g,b - -end - -local function NumFromStr(str) - local num = 0 - for i = 1, #str do - local byteNum = string.byte(str,i,i); - num = math.bit_xor(num*2, byteNum) - end - return num -end - -local function RandomGameNumber() - --[[ - local strTable = {} - local players = Spring.GetPlayerList() - for i, playerID in ipairs(players) do - local name, _, spec = Spring.GetPlayerInfo(playerID) - if not spec then - strTable[#strTable+1] = name - strTable[#strTable+1] = playerID - end - end - local str = table.concat( strTable ) - --]] - local teams = Spring.GetTeamList() - local str = #teams .. Game.mapName - --echo (str) - return NumFromStr(str) -end - - - -local function SetNewTeamColors(offset) - local gaia = Spring.GetGaiaTeamID() - --Spring.SetTeamColor(gaia, unpack(gaiaColor)) - - local allyTeamList = Spring.GetAllyTeamList() - - local teams = Spring.GetTeamList() - local numTeams = #teams - local numColors = #colors - local skippable = numColors - numTeams - - - local i = offset - echo( '*** Common Colors ***' ) - for _, allianceID in ipairs(allyTeamList) do - - for _, teamID in ipairs(Spring.GetTeamList(allianceID)) do - if (teamID ~= gaia) then - i = (i % #colors) + 1 - - local r,g,b = HexToColor(colors[i][2]) - - local _, playerID = Spring.GetTeamInfo(teamID) - local name = playerID and Spring.GetPlayerInfo(playerID) or 'noname' - echo( ' - ' .. color2incolor(r,g,b,1) .. name .. ' (' .. colors[i][1] ..')' ) - Spring.SetTeamColor(teamID, r,g,b) - end - end --team - - if skippable > 0 then - i = (i % #colors) + 1 - skippable = skippable - 1 - end - - end --alliance - -end - -local function SetNewSimpleTeamColors() - local gaia = Spring.GetGaiaTeamID() - Spring.SetTeamColor(gaia, HexToColor(gaiaColor)) - - local myAlly = Spring.GetMyAllyTeamID() - local myTeam = Spring.GetMyTeamID() - - for _, teamID in ipairs(Spring.GetTeamList()) do - local _,_,_,_,_,allyID = Spring.GetTeamInfo(teamID) - if (allyID == myAlly) then - Spring.SetTeamColor(teamID, HexToColor(allyColor)) - elseif (teamID ~= gaia) then - Spring.SetTeamColor(teamID, HexToColor(enemyColor)) - end - end - Spring.SetTeamColor(myTeam, HexToColor(myColor)) -- overrides previously defined color -end - -local function ResetOldTeamColors() - for _,team in ipairs(Spring.GetTeamList()) do - Spring.SetTeamColor(team,Spring.GetTeamOrigColor(team)) - end -end - -local function NotifyColorChange() - for name,func in pairs(WG.LocalColor.listeners) do - if type(func) == "function" then -- because we don't trust other widget writers to not give us random junk - func() -- yeah we wouldn't even need to do this with static typing :( - else - Spring.Echo(" ERROR: Listener '" .. name .. "' is not a function!" ) - end - end -end - -function WG.LocalColor.localTeamColorToggle() - options.simpleColors.value = not options.simpleColors.value - widget:Initialize() -end - -function WG.LocalColor.RegisterListener(name, func) - WG.LocalColor.listeners[name] = func -end - -function WG.LocalColor.UnregisterListener(name) - WG.LocalColor.listeners[name] = nil -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - if options.simpleColors.value then - SetNewSimpleTeamColors() - else - SetNewTeamColors( RandomGameNumber() ) - end - - NotifyColorChange() -end - -function widget:Shutdown() - ResetOldTeamColors() - NotifyColorChange() - WG.LocalColor.localTeamColorToggle = nil -end - - -function widget:TextCommand(command) - --[[ - if (string.find(command, 'tc') == 1) then - SetNewTeamColors( command:sub(4,5) + 0 ) - NotifyColorChange() - end - --]] - if (string.find(command, 'commoncolors') == 1) then - SetNewTeamColors( RandomGameNumber() ) - end - -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_con_locater.lua b/LuaUI/Widgets_Evo/gui_con_locater.lua new file mode 100644 index 000000000..4eb9fe7cd --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_con_locater.lua @@ -0,0 +1,597 @@ +local version = "1.15" + +function widget:GetInfo() + return { + name = "Constructor locater", + desc = "Version " .. version .. ". Shows graphics around your constructors on demand to " .. + "make finding them faster" , + author = "Alcur", + date = "Aug 3, 2012", + license = "BSD 3-clause", + layer = 0, + enabled = true + } +end + +include"keysym.h.lua" + + + + + +-- options begin + +-- how many sides the marker "circles" will have +local circleDivs = 32 + +-- how fast the constructor-indicating graphics blink +local aniSpeedMultiplier = 4 + +-- color 1 for the constructor-indicating graphics +local red1 = 1 +local green1 = 1 +local blue1 = 0 + +-- color 2 for the constructor-indicating graphics +local red2 = 0 +local green2 = 1 +local blue2 = 0 + +-- if the camera aka. in-game view is below this height the constructor-indicating graphics +-- are disabled +local minActivationHeight = 1000 + +-- if the camera is above this height the constructor-indicating graphics are shown. +-- Type "false" or "nil" (without the quotation marks) to disable +local activationHeight = nil + +-- the keys that activate the constructor-indicating graphics +local activationKeyTable = { + --[KEYSYMS.C] = true, + --[KEYSYMS.Q] = true, + --[KEYSYMS.B] = true, + [KEYSYMS.SPACE] = true, +} + +-- enabling this means having your cursor on a constructor activates +-- the constructor-indicating graphics +local activateOnMouseOver = false + +-- enabling this causes the widget to draw only on the mini map +local miniMapOnly = false + +-- options end + + + + + +local widgetName = widget:GetInfo().name + +local abs = math.abs +local floor = math.floor +local pi = math.pi +local cos = math.cos +local sin = math.sin +local insert = table.insert +local remove = table.remove +local bit_inv = math.bit_inv + +local glDrawGroundCircle = gl.DrawGroundCircle +local glLineWidth = gl.LineWidth +local glColor = gl.Color +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList +local glVertex = gl.Vertex +local glDrawListAtUnit = gl.DrawListAtUnit +local glDrawFuncAtUnit = gl.DrawFuncAtUnit +local glBeginEnd = gl.BeginEnd +local glTranslate = gl.Translate +local glScale = gl.Scale +local glRotate = gl.Rotate +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix + +local IsGUIHidden = Spring.IsGUIHidden +local GetTeamUnits = Spring.GetTeamUnits +local myTeam = Spring.GetMyTeamID() +local GetUnitDefID = Spring.GetUnitDefID +local GetCameraPosition = Spring.GetCameraPosition +local GetGroundNormal = Spring.GetGroundNormal +local GetGroundHeight = Spring.GetGroundHeight +local TraceScreenRay = Spring.TraceScreenRay +local IsUnitInView = Spring.IsUnitInView +local IsUnitIcon = Spring.IsUnitIcon +local GetUnitPosition = Spring.GetUnitPosition +local GetUnitTeam = Spring.GetUnitTeam +local GetUnitBasePosition = Spring.GetUnitBasePosition +local GetFPS = Spring.GetFPS +local Echo = Spring.Echo + +local unitListIndex = 0 +local radstep = (2.0 * pi) / circleDivs +local radInDeg = 180/pi +local red = red1 +local green = green1 +local blue = blue1 +local mapSizeX, mapSizeZ = Game.mapSizeX, Game.mapSizeZ +local circleGlList +local aniFactor = 1 +local mobileConDefIdTable = {} +local conMemoTable = {} +local keyPressed = false +local above = false +local useSecColors = true +local lastTime +local aniSpeed +local aniDelta + + + +function append(list, value) + --Echo(widgetName .. ': entered "' .. debug.getinfo(1, "n").name .. '"') + list[#list+1] = value +end + +function contains(list, entry) + --Echo(widgetName .. ': entered "' .. debug.getinfo(1, "n").name .. '"') + for i = 1, #list do + if list[i] == entry then return true end + end + return false +end + +function radToDeg(rad) + return rad*radInDeg +end + +function makeCircle(x, y, z, scale) + function circleLines() + for i = 1, circleDivs do + local a = (i * radstep) + glVertex(sin(a)*scale + x, + y, cos(a)*scale + z) + end + end + + glBeginEnd(GL.LINE_LOOP, circleLines) +end + + +function isMobileCon(unitDef) + return unitDef.isBuilder and unitDef.canMove and not unitDef.isBuilding +end + + + +function worldToMiniMapPos(x, z, mmxsize, mmzsize) + + --Echo(widgetName .. ": sx*mmxsize/vxsize, sy*mmysize/vysize = " .. sx*mmxsize/vxsize .. ", " .. sy*mmysize/vysize) + + return x*mmxsize/mapSizeX, z*mmzsize/mapSizeZ + +end + +function areConditionsMet() + local cx, cy, cz = GetCameraPosition() + + if (keyPressed or above or (activationHeight and cy >= activationHeight)) and + cy >= minActivationHeight and not IsGUIHidden() then + return true + end + return false +end + + +function loadClasses() + + List = {} + + function List:new(contents) + local o = {} + + + + setmetatable(o, self) + + o.contents = contents or {} + o.locked = false + + + self.__index = function (table, key) + if type(key) == "number" then + return table:get(key) + else + return rawget(self, key) + end + end + + + return o + end + + function List:get(key) + if key == nil then + return self.contents + elseif type(key) == "number" then + return self.contents[key] + end + end + + + function List:len() + return #self:get() + end + + function List:insert(pos, val) + if not val then + self:append(pos) + else + insert(self:get(), pos, val) + end + end + + + function List:replace(pos, val) + if not val then + self:get()[self:len()] = val + else + self:get()[pos] = val + end + end + + function List:setContents(list) + self.contents = list + end + + function List:__newindex(key, value) + if type(key) == "number" then + self:replace(key, value) + else + rawset(self, key, value) + end + end + + function List:append(val) + append(self:get(), val) + end + + function List:remove(k) + if type(k) == "number" then + return remove(self:get(), k) + end + end + + function List:search(entry) + local value + local key + for i = 1, self:len() do + if self:get(i) == entry then value = entry; key = i end + end + return key, value + end + + function List:find(entry) + local tempT = self:get() + local value + local key + for i = 1, self:len() do + if tempT[i] == entry then value = entry; key = i end + end + return key, value + end + + function List:contains(entry) + local tempT = self:get() + for i = 1, self:len() do + if tempT[i] == entry then return true end + end + return false + end + + function List:removeByValue(entry) + local k, v = self:search(entry) + return self:remove(k) + end + + function List:lock() + if self:isLocked() then + error('unable to lock an already locked List object') + end + self.locked = true + end + + function List:unlock() + if not self:isLocked() then + error('unable to unlock an already unlocked List object') + end + self.locked = false + end + + function List:isLocked() + return self.locked + end + +end + +loadClasses() + + + + + + +local conList = List:new() + + + +function fillConList(unitIdList) + if conList[1] then return end + local unit + local unitDef + local unitDefId + local unitPos = {} + local curUnitIdList = unitIdList or Spring.GetTeamUnits(myTeam) + --Echo(widgetName .. ": #curUnitIdList = " .. #curUnitIdList) + for i = 1, #curUnitIdList do + unit = curUnitIdList[i] + unitDefId = GetUnitDefID(unit) + unitDef = UnitDefs[unitDefId] + if not conMemoTable[unit] and mobileConDefIdTable[unitDefId] then + --Echo(widgetName .. ": new builder found") + addToConTables(unit) + end + end + +end + +function addToConTables(unitId) + if not unitId then return end + conList:insert(unitId) + conMemoTable[unitId] = true +end + +function removeFromConTables(unitId, unitListIndex) + if unitListIndex then + conList:remove(unitListIndex) + elseif unitId then + conList:removeByValue(unitId) + else + return + end + conMemoTable[unitId] = nil + --Echo(widgetName .. ": removed " .. tostring(unitId) .. ", " .. + --tostring(unitListIndex)) +end + +function widget:Update(timeSinceLastUpdate) + aniSpeed = timeSinceLastUpdate*aniSpeedMultiplier +end + +function widget:DrawInMiniMap(sx, sy) + + + if areConditionsMet() then + + local cx, cy, cz = GetCameraPosition() + + glLineWidth(1) + + glColor(red, green, blue, aniFactor*0.4) + + local max = conList:len() + + for i = 1, max do + + local unit = conList[i] + --Echo(widgetName .. ": unit = " .. unit) + + if not unit then + --Echo(widgetName .. ": could not get unit id (DrawInMiniMap)") + else + + local ux, uy, uz = GetUnitBasePosition(unit) + + + if not ux then + --Echo(widgetName .. ": could not get unit coordinates (DrawInMiniMap)") + removeFromConTables(unit) + else + local mmux, mmuz = worldToMiniMapPos(ux, uz, sx, sy) + + gl.Rect(mmux - 5, sy-mmuz - 5, mmux + 5, sy-mmuz + 5) + + end + end + end + end +end + +function rewindAnimation() + if aniFactor < 1 then + aniFactor = 1 + useSecColors = true + aniDelta = aniSpeed + red = red1 + green = green1 + blue = blue1 + end +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + + + if not miniMapOnly and areConditionsMet() then + local cx, cy, cz = GetCameraPosition() + + + local camFactor + local camYDiff + + + if aniFactor < 0 then + aniDelta = aniSpeed + if useSecColors then + red = red2 + green = green2 + blue = blue2 + else + red = red1 + green = green1 + blue = blue1 + end + useSecColors = not useSecColors + elseif aniFactor >= 1 then + aniDelta = -aniSpeed + end + + aniFactor = aniFactor + aniDelta + + + glLineWidth(2.5) + + camFactor = cy/200+25 + + if camFactor < 50 then + camFactor = 50 + end + + glColor(red, green, blue, aniFactor) + + local max = conList:len() + + for i = 1, max do + + + local unit = conList[i] + + if not unit then + --Echo(widgetName .. ": could not get unit id (DrawWorld)") + else + --Echo(widgetName .. ": unit = " .. unit) + if IsUnitInView(unit) then + local ux, uy, uz = GetUnitBasePosition(unit) + + if not ux then + --Echo(widgetName .. ": could not get unit coordinates (DrawWorld)") + removeFromConTables(unit) + else + if IsUnitIcon(unit) then + --Echo(widgetName .. ": using inefficient drawing method") + makeCircle(ux, uy, uz, camFactor) + else + --Echo(widgetName .. ": using efficient drawing method") + glDrawListAtUnit(unit, circleGlList, false, camFactor, + camFactor, camFactor) + end + end + end + end + end + + + else + rewindAnimation() + end + +end + +function widget:KeyPress(key, mods, isRepeat) + + if activationKeyTable[key] and isRepeat == false then + + fillConList() + + keyPressed = true + end + +end + +function widget:KeyRelease(key) + + if activationKeyTable[key] then + keyPressed = false + rewindAnimation() + end + + + +end + + + +function widget:UnitDestroyed(unitId, unitDefId) + if conMemoTable[unitId] then + removeFromConTables(unitId) + end +end + + +function widget:UnitFinished(unitId, unitDefId) + if mobileConDefIdTable[unitDefId] and GetUnitTeam(unitId) == myTeam then + addToConTables(unitId) + end +end + +function widget:UnitTaken(unitId, unitDefId, unitTeam, newTeam) + --Echo(widgetName .. ": unit taken: " .. tostring(unitTeam) .. ", " .. tostring(newTeam)) + if mobileConDefIdTable[unitDefId] and newTeam == myTeam then + addToConTables(unitId) + end +end + +function widget:UnitGiven(unitId, unitDefId, unitTeam, oldTeam) + if conMemoTable[unitId] then + removeFromConTables(unitId) + end +end + +function widget:IsAbove(x, y) + + if not activateOnMouseOver then + return + end + + local class, info = TraceScreenRay(x, y) + + if class == "unit" then + local unitDefId = GetUnitDefID(info) + if mobileConDefIdTable[unitDefId] then + fillConList() + + above = true + end + + elseif above then + above = false + rewindAnimation() + end + +end + + + + + + +function widget:Initialize() + + circleGlList = glCreateList(makeCircle, 0, 0, 0, 1) + + for k,v in pairs(UnitDefs) do + if isMobileCon(v) then + mobileConDefIdTable[k] = true + --Echo(widgetName .. ": mobile con added to table") + end + end + +end diff --git a/LuaUI/Widgets_Evo/gui_contextmenu.lua b/LuaUI/Widgets_Evo/gui_contextmenu.lua deleted file mode 100644 index a8ed09ae0..000000000 --- a/LuaUI/Widgets_Evo/gui_contextmenu.lua +++ /dev/null @@ -1,974 +0,0 @@ -function widget:GetInfo() - return { - name = "Context Menu", - desc = "v0.084 Chili Context Menu\nPress [Space] while clicking for a context menu.", - author = "CarRepairer", - date = "2009-06-02", - license = "GNU GPL, v2 or later", - layer = 0, - experimental = false, - enabled = true, - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -include("keysym.h.lua") - -local spSendLuaRulesMsg = Spring.SendLuaRulesMsg -local spGetCurrentTooltip = Spring.GetCurrentTooltip -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitAllyTeam = Spring.GetUnitAllyTeam -local spGetUnitTeam = Spring.GetUnitTeam -local spTraceScreenRay = Spring.TraceScreenRay -local spGetTeamInfo = Spring.GetTeamInfo -local spGetPlayerInfo = Spring.GetPlayerInfo -local spGetTeamColor = Spring.GetTeamColor -local spGetModKeyState = Spring.GetModKeyState - -local abs = math.abs -local strFormat = string.format - -local echo = Spring.Echo - -local VFSMODE = VFS.RAW_FIRST -local ignoreweapon, iconFormat = VFS.Include(LUAUI_DIRNAME .. "Configs/chilitip_conf.lua" , nil, VFSMODE) -local confdata = VFS.Include(LUAUI_DIRNAME .. "Configs/epicmenu_conf.lua", nil, VFSMODE) -local color = confdata.color - -local iconTypesPath = LUAUI_DIRNAME.."Configs/icontypes.lua" -local icontypes = VFS.FileExists(iconTypesPath) and VFS.Include(iconTypesPath) - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local Chili -local Button -local Label -local Window -local ScrollPanel -local StackPanel -local Grid -local TextBox -local Image -local screen0 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local B_HEIGHT = 30 -local icon_size = 18 - -local scrH, scrW = 0,0 -local myAlliance = Spring.GetLocalAllyTeamID() -local myTeamID = Spring.GetLocalTeamID() - -local ceasefires = true -local marketandbounty = false - -local window_unitcontext, window_unitstats -local statswindows = {} - - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ---[[ -options = { -} -options_path = 'Settings/Interface' ---]] --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function tobool(val) - local t = type(val) - if (t == 'nil') then return false - elseif (t == 'boolean') then return val - elseif (t == 'number') then return (val ~= 0) - elseif (t == 'string') then return ((val ~= '0') and (val ~= 'false')) - end - return false -end - -if tobool(Spring.GetModOptions().noceasefire) or Spring.FixedAllies() then - ceasefires = false -end - -if tobool(Spring.GetModOptions().marketandbounty) then - marketandbounty = true -end - - -function comma_value(amount, displayPlusMinus) - local formatted - - -- amount is a string when ToSI is used before calling this function - if type(amount) == "number" then - if (amount ==0) then formatted = "0" else - if (amount < 20 and (amount * 10)%10 ~=0) then - if displayPlusMinus then formatted = strFormat("%+.1f", amount) - else formatted = strFormat("%.1f", amount) end - else - if displayPlusMinus then formatted = strFormat("%+d", amount) - else formatted = strFormat("%d", amount) end - end - end - else - formatted = amount .. "" - end - - return formatted -end - ---from rooms widget by quantum -local function ToSI(num) - if type(num) ~= 'number' then - return 'Tooltip wacky error #55' - end - if (num == 0) then - return "0" - else - local absNum = abs(num) - if (absNum < 0.001) then - return strFormat("%.1fu", 1000000 * num) - elseif (absNum < 1) then - return strFormat("%.1f", num) - elseif (absNum < 1000) then - return strFormat("%.0f", num) - elseif (absNum < 1000000) then - return strFormat("%.1fk", 0.001 * num) - else - return strFormat("%.1fM", 0.000001 * num) - end - end -end - -local function numformat(num) - return comma_value(num) -end - -local function AdjustWindow(window) - local nx - if (0 > window.x) then - nx = 0 - elseif (window.x + window.width > screen0.width) then - nx = screen0.width - window.width - end - - local ny - if (0 > window.y) then - ny = 0 - elseif (window.y + window.height > screen0.height) then - ny = screen0.height - window.height - end - - if (nx or ny) then - window:SetPos(nx,ny) - end -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function CloseButtonFunc(self) - self.parent.parent:Dispose() -end -local function CloseButtonFunc2(self) - self.parent.parent.parent:Dispose() -end - -local function CloseButton(width) - return Button:New{ - caption = 'Close', - OnMouseUp = { CloseButtonFunc }, - width=width, - height = B_HEIGHT, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } -end - -local UnitDefByHumanName_cache = {} -local function GetUnitDefByHumanName(humanName) - local cached_udef = UnitDefByHumanName_cache[humanName] - if (cached_udef ~= nil) then - return cached_udef - end - -- uncomment the altResult stuff to allow a non-exact match - --local altResult - - for _,ud in pairs(UnitDefs) do - if (ud.humanName == humanName) then - UnitDefByHumanName_cache[humanName] = ud - return ud - --elseif (ud.humanName:find(humanName)) then - -- altResult = altResult or ud - end - end - --if altResult then - -- UnitDefByHumanName_cache[humanName] = altResult - -- return altResult - --end - - UnitDefByHumanName_cache[humanName] = false - return false -end - - -local function getHelpText(unitDef, lang) - local suffix = (lang == 'en') and '' or ('_' .. lang) - return unitDef.customParams and unitDef.customParams['helptext' .. suffix] - or unitDef.customParams.helptext - or "No help text available for this unit." -end - - -local function getDescription(unitDef, lang) - if not lang or lang == 'en' then - return unitDef.tooltip - end - local suffix = ('_' .. lang) - return unitDef.customParams and unitDef.customParams['description' .. suffix] or unitDef.tooltip or 'Description error' -end - -local function weapons2Table(cells, weaponStats, ws, merw, index) - local cells = cells - local mainweapon = merw and merw[index] - if ws.isShield then - cells[#cells+1] = ws.wname - cells[#cells+1] = '' - cells[#cells+1] = ' - Strength:' - cells[#cells+1] = ws.power - cells[#cells+1] = ' - Regen:' - cells[#cells+1] = ws.regen - cells[#cells+1] = ' - Energy/second:' - cells[#cells+1] = ws.regenE - cells[#cells+1] = ' - Radius:' - cells[#cells+1] = ws.radius - - cells[#cells+1] = '' - cells[#cells+1] = '' - elseif not ws.slaveTo then - if mainweapon then - for i=1, #mainweapon do - wsm = weaponStats[mainweapon[i]] - ws.damw = ws.damw + wsm.bestTypeDamagew - ws.dpsw = ws.dpsw + wsm.dpsw - ws.dam = ws.dam + wsm.bestTypeDamage - ws.dps = ws.dps + wsm.dps - end - end - -- multiply paralyze damage by 3 due to armor.txt - ws.damw = ws.damw * 3 - ws.dpsw = ws.dpsw * 3 - - local dps_str, dam_str = '', '' - if ws.dps > 0 then - dam_str = dam_str .. numformat(ws.dam,2) - dps_str = dps_str .. numformat(ws.dps,2) - end - if ws.dpsw > 0 then - if dps_str ~= '' then - dps_str = dps_str .. ' || ' - dam_str = dam_str .. ' || ' - end - dam_str = dam_str .. numformat(ws.damw,2) .. ' (P)' - dps_str = dps_str .. numformat(ws.dpsw,2) .. ' (P)' - end - - cells[#cells+1] = ws.wname - cells[#cells+1] = '' - cells[#cells+1] = ' - Damage:' - cells[#cells+1] = dam_str - cells[#cells+1] = ' - Reloadtime:' - cells[#cells+1] = string.format("%.1f", ws.reloadtime) ..'s' - cells[#cells+1] = ' - Damage/second:' - cells[#cells+1] = dps_str - cells[#cells+1] = ' - Range:' - cells[#cells+1] = numformat(ws.range,2) - - cells[#cells+1] = '' - cells[#cells+1] = '' - - end - return cells -end - -local function printWeapons(unitDef) - local weaponStats = {} - local bestDamage, bestDamageIndex, bestTypeDamage = 0,0,0 - - local merw = {} - - local wd = WeaponDefs - if not wd then return false end - - for i=1, #unitDef.weapons do - local weapon = unitDef.weapons[i] - local weaponID = weapon.weaponDef - local weaponDef = WeaponDefs[weaponID] - - local weaponName = weaponDef.description - - if (weaponName) then - local wsTemp = {} - if weaponDef.isShield then - wsTemp.wname = weaponDef.description or 'NoName Weapon' - wsTemp.isShield = true - wsTemp.radius = weaponDef.shieldRadius - wsTemp.power = weaponDef.shieldPower - wsTemp.regen = weaponDef.shieldPowerRegen - wsTemp.regenE = weaponDef.shieldPowerRegenEnergy - else - wsTemp.slaveTo = (weapon.slavedTo ~= 0) and weapon.slavedTo or nil - - if wsTemp.slaveTo then - merw[wsTemp.slaveTo] = merw[wsTemp.slaveTo] or {} - merw[wsTemp.slaveTo][#(merw[wsTemp.slaveTo])+1] = i - end - wsTemp.bestTypeDamage = 0 - wsTemp.bestTypeDamagew = 0 - wsTemp.paralyzer = weaponDef.paralyzer - for key, val in pairs(weaponDef.damages) do - --[[ - if (wsTemp.bestTypeDamage <= (damage+0) and not wsTemp.paralyzer) - or (wsTemp.bestTypeDamagew <= (damage+0) and wsTemp.paralyzer) - then - - if wsTemp.paralyzer then - wsTemp.bestTypeDamagew = (damage+0) - else - wsTemp.bestTypeDamage = (damage+0) - end - --]] - if key == 0 then - if wsTemp.paralyzer then - wsTemp.bestTypeDamagew = val - else - wsTemp.bestTypeDamage = val - end - - wsTemp.burst = weaponDef.salvoSize or 1 - wsTemp.projectiles = weaponDef.projectiles or 1 - wsTemp.dam = 0 - wsTemp.damw = 0 - if wsTemp.paralyzer then - wsTemp.damw = wsTemp.bestTypeDamagew * wsTemp.burst * wsTemp.projectiles - else - wsTemp.dam = wsTemp.bestTypeDamage * wsTemp.burst * wsTemp.projectiles - end - wsTemp.reloadtime = weaponDef.reload or '' - wsTemp.airWeapon = weaponDef.toAirWeapon or false - wsTemp.range = weaponDef.range or '' - wsTemp.wname = weaponDef.description or 'NoName Weapon' - wsTemp.dps = 0 - wsTemp.dpsw = 0 - if wsTemp.reloadtime ~= '' and wsTemp.reloadtime > 0 then - if wsTemp.paralyzer then - wsTemp.dpsw = math.floor(wsTemp.damw/wsTemp.reloadtime + 0.5) - else - wsTemp.dps = math.floor(wsTemp.dam/wsTemp.reloadtime + 0.5) - end - end - --echo('test', unitDef.unitname, wsTemp.wname, wsTemp.bestTypeDamage, i) - if wsTemp.dam > bestDamage then - bestDamage = wsTemp.dam - bestDamageIndex = i - end - if wsTemp.damw > bestDamage then - bestDamage = wsTemp.damw - bestDamageIndex = i - end - - end - end - end - if not wsTemp.wname - or wsTemp.wname:find('fake') - or wsTemp.wname:find('Fake') - or wsTemp.wname:find('NoWeapon') - then - weaponStats[i] = false - else - weaponStats[i] = wsTemp - end - end - end - - local cells = {} - - for index,ws in pairs(weaponStats) do - --if not ignoreweapon[unitDef.name] or not ignoreweapon[unitDef.name][index] then - if ws then - cells = weapons2Table(cells, weaponStats, ws, merw, index) - end - --end - end - - return cells -end - -local function printunitinfo(ud, lang, buttonWidth) - local icons = { - Image:New{ - file2 = (WG.GetBuildIconFrame)and(WG.GetBuildIconFrame(ud)), - file = "#" .. ud.id, - keepAspect = true; - height = 40; - width = 40; - }, - } - if ud.iconType ~= 'default' then - icons[#icons + 1] = - Image:New{ - file=icontypes and icontypes[(ud and ud.iconType or "default")].bitmap - or 'icons/'.. ud.iconType ..iconFormat, - height=40, - width=40, - } - end - - local helptextbox = TextBox:New{ - text = getHelpText(ud, lang), - textColor = color.stats_fg, - width = '100%', - height = '100%', - padding = { 1, 1, 1, 1 }, - } - - local statschildren = {} - - -- stuff for modular commanders - local commModules, commCost - if ud.customParams.commtype then - commModules = WG.GetCommModules and WG.GetCommModules(ud.id) - commCost = ud.customParams.cost or (WG.GetCommUnitInfo and WG.GetCommUnitInfo(ud.id) and WG.GetCommUnitInfo(ud.id).cost) - end - local cost = numformat(ud.metalCost) - if commCost then - cost = cost .. ' (' .. numformat(commCost) .. ')' - end - - statschildren[#statschildren+1] = Label:New{ caption = 'STATS', textColor = color.stats_header, } - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header, } - - statschildren[#statschildren+1] = Label:New{ caption = 'Cost: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = cost, textColor = color.stats_fg, } - - statschildren[#statschildren+1] = Label:New{ caption = 'Max HP: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = numformat(ud.health), textColor = color.stats_fg, } - - if ud.speed > 0 then - statschildren[#statschildren+1] = Label:New{ caption = 'Speed: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = numformat(ud.speed/Game.gameSpeed,2), textColor = color.stats_fg, } - end - - if ud.energyMake > 0 then - statschildren[#statschildren+1] = Label:New{ caption = 'Energy: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = '+' .. numformat(ud.energyMake,2), textColor = color.stats_fg, } - end - if ud.energyUpkeep < 0 then - statschildren[#statschildren+1] = Label:New{ caption = 'Energy: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = '+' .. numformat(ud.energyUpkeep,2):sub(2), textColor = color.stats_fg, } - end - - if ud.buildSpeed > 0 then - statschildren[#statschildren+1] = Label:New{ caption = 'Buildpower: ', textColor = color.stats_fg, } - statschildren[#statschildren+1] = Label:New{ caption = numformat(ud.buildSpeed,2), textColor = color.stats_fg, } - end - - - if commModules then - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - statschildren[#statschildren+1] = Label:New{ caption = 'MODULES', textColor = color.stats_header, } - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - for i=1, #commModules do - statschildren[#statschildren+1] = Label:New{ caption = commModules[i], textColor = color.stats_fg,} - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_fg,} - end - end - - - local cells = printWeapons(ud) - - if cells and #cells > 0 then - - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - - statschildren[#statschildren+1] = Label:New{ caption = 'WEAPONS', textColor = color.stats_header,} - statschildren[#statschildren+1] = Label:New{ caption = '', textColor = color.stats_header,} - for i=1, #cells do - statschildren[#statschildren+1] = Label:New{ caption = cells[i], textColor = color.stats_fg, } - end - end - - local stack_icons = StackPanel:New{ - autoArrangeV = false, - padding = {1,1,1,1}, - itemPadding = {1,1,1,1}, - itemMargin = {1,1,1,1}, - height = 100, - width = 50, - resizeItems = false, - children = icons, - } - - local stack_stats = Grid:New{ - columns=2, - autoArrangeV = false, - --height = (#statschildren/2)*statschildren[1].height, - height = (#statschildren/2)*15, - - width = '100%', - children = statschildren, - y = 1, - padding = {1,1,1,1}, - itemPadding = {1,1,1,1}, - itemMargin = {1,1,1,1}, - } - - local helptext_stack = StackPanel:New{ - resizeItems = false, - orientation = 'vertical', - autoArrangeV = false, - autoArrangeH = false, - centerItems = false, - right = 60, - x = 1, - --width = 200, - --height = '100%', - autosize=true, - resizeItems = false, - children = { helptextbox, stack_stats, }, - } - return - { - StackPanel:New{ - resizeItems = false, - orientation = 'horizontal', - autoArrangeV = false, - autoArrangeH = false, - centerItems = false, - padding = {1,1,1,1}, - itemPadding = {1,1,1,1}, - itemMargin = {1,1,1,1}, - --height = 400 , - autosize=true, - y = 1, - width = '100%', - children = { helptext_stack, stack_icons, }, - }, - } - -end - -local function tooltipBreakdown(tooltip) - local unitname = nil - - if tooltip:find('Build', 1, true) == 1 then - local start,fin = tooltip:find([[ - ]], 1, true) - if start and fin then - local unitHumanName - local buildType - if (tooltip:find('Build Unit:', 1, true) == 1) then - buildType = 'buildunit' - unitHumanName = tooltip:sub(13,start-1) - else - buildType = 'build' - unitHumanName = tooltip:sub(8,start-1) - end - local udef = GetUnitDefByHumanName(unitHumanName) - - return udef or false - - end - - elseif tooltip:find('Morph', 1, true) == 1 then - local unitHumanName = tooltip:gsub('Morph into a (.*)(time).*', '%1'):gsub('[^%a \-]', '') - local udef = GetUnitDefByHumanName(unitHumanName) - return udef or false - - elseif tooltip:find('Selected', 1, true) == 1 then - local start,fin = tooltip:find([[ - ]], 1, true) - if start and fin then - local unitHumanName = tooltip:sub(11,start-1) - local udef = GetUnitDefByHumanName(unitHumanName) - return udef or false - end - end - - return false -end - ----------------------------------------------------------------- - -local function hideWindow(window) - if not window then return end - window:SetPos(-1000, -1000) - window.visible = false -end ---[[ -local function showWindow(window, x, y) - window.visible = true - if x then - window:SetPos(x,y) - end -end ---]] -local function KillStatsWindow(num) - statswindows[num]:Dispose() - statswindows[num] = nil -end - -local function MakeStatsWindow(ud, x,y) - hideWindow(window_unitcontext) - - local y = scrH-y - local x = x - - local window_width = 450 - local window_height = 450 - - local num = #statswindows+1 - - local children = { - ScrollPanel:New{ - --horizontalScrollbar = false, - x=0,y=15, - width='100%', - bottom = B_HEIGHT*2, - padding = {2,2,2,2}, - children = printunitinfo(ud, WG.lang or 'en', window_width) , - }, - Button:New{ - caption = 'Close', - OnMouseUp = { function(self) KillStatsWindow(num) end }, - - x=0, - height=B_HEIGHT, - right=10, - bottom=1, - - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } - } - - if window_unitstats then - window_unitstats:Dispose() - end - - statswindows[num] = Window:New{ - x = x, - y = y, - width = window_width, - height = window_height, - resizable = true, - parent = screen0, - backgroundColor = color.stats_bg, - - minWidth = 250, - minHeight = 300, - - caption = ud.humanName ..' - '.. getDescription(ud, WG.lang or 'en'), - - children = children, - } - AdjustWindow(statswindows[num]) - -end - -local function PriceWindow(unitID, action) - local window_width = 250 - - local header = 'Offer For Sale' - local command = '$sell:' - local cancelText = 'Cancel Sale' - if action == 'buy' then - header = 'Offer To Buy' - command = '$buy :' - cancelText = 'Cancel Offer' - elseif action == 'bounty' then - header = 'Place Bounty (Cannot cancel!)' - command = '$bounty:' - end - - local children = {} - children[#children+1] = Label:New{ caption = header, width=window_width, height=B_HEIGHT, textColor = color.context_header,} - - local grid_children = {} - - local dollar_amounts = {50,100,200,500,1000,2000,5000,10000, 0} - for i=1, #dollar_amounts do - local dollar_amount = dollar_amounts[i] - local caption, func - if action == 'bounty' then - if dollar_amount ~= 0 then - caption = '$' .. dollar_amount - func = function() spSendLuaRulesMsg( command .. unitID .. '|' .. dollar_amount ) end - end - else - caption = dollar_amount == 0 and cancelText or '$' .. dollar_amount - func = function() spSendLuaRulesMsg( command .. unitID .. '|' .. dollar_amount) end - end - if caption then - grid_children[#grid_children+1] = Button:New{ - caption = caption, - OnMouseUp = { func, CloseButtonFunc2 }, - width=window_width, - height=B_HEIGHT, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } - end - end - --local grid_height = (B_HEIGHT)* #grid_children /3 - local grid_height = (B_HEIGHT)* 3 - local price_grid = Grid:New{ - --rows = 3, - columns = 3, - resizeItems=true, - width = window_width, - height = grid_height, - padding = {0,0,0,0}, - itemPadding = {2,2,2,2}, - itemMargin = {0,0,0,0}, - - children = grid_children, - } - - children[#children+1] = price_grid - - children[#children+1] = Label:New{ caption = '', width=window_width, height=B_HEIGHT, autosize=false,} - - children[#children+1] = CloseButton(window_width) - - local window_height = (B_HEIGHT) * (#children-1) + grid_height - - local stack1 = StackPanel:New{ - centerItems = false, - resizeItems=false, - width = window_width, - height = window_height, - padding = {0,0,0,0}, - itemPadding = {2,2,2,2}, - itemMargin = {0,0,0,0}, - children = children, - } - - local window = Window:New{ - x = scrW/2, - y = scrH/2, - clientWidth = window_width, - clientHeight = window_height, - resizable = false, - parent = screen0, - backgroundColor = color.context_bg, - children = {stack1}, - } -end - -local function MakeUnitContextMenu(unitID,x,y) - --hideWindow(window_unitstats) - - local udid = spGetUnitDefID(unitID) - local ud = UnitDefs[udid] - if not ud then return end - local alliance = spGetUnitAllyTeam(unitID) - local team = spGetUnitTeam(unitID) - local _, player = spGetTeamInfo(team) - local playerName = spGetPlayerInfo(player) or 'noname' - local teamColor = {spGetTeamColor(team)} - - local window_width = 200 - --local buttonWidth = window_width - 0 - - - local children = { - Label:New{ caption = ud.humanName ..' - '.. getDescription(ud, WG.lang or 'en'), width=window_width, textColor = color.context_header,}, - Label:New{ caption = 'Player: ' .. playerName, width=window_width, textColor=teamColor }, - Label:New{ caption = 'Alliance - ' .. alliance .. ' Team - ' .. team, width=window_width ,textColor = color.context_fg,}, - - Button:New{ - caption = 'Unit Info', - OnMouseUp = { function() MakeStatsWindow(ud,x,y) end }, - width=window_width, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - }, - } - local y = scrH-y - local x = x - - if marketandbounty then - if team == myTeamID then - children[#children+1] = Button:New{ - caption = 'Offer For Sale', - OnMouseUp = { function(self) PriceWindow(unitID, 'sell') end }, - width=window_width, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } - else - children[#children+1] = Button:New{ - caption = 'Offer To Buy', - OnMouseUp = { function(self) PriceWindow(unitID, 'buy') end }, - width=window_width, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } - end - if myAlliance ~= alliance then - children[#children+1] = Button:New{ - caption = 'Place Bounty', - OnMouseUp = { function(self) PriceWindow(unitID, 'bounty') end }, - width=window_width, - backgroundColor=color.sub_back_bg, - textColor=color.sub_back_fg, - } - end - end - - - if ceasefires and myAlliance ~= alliance then - window_height = window_height + B_HEIGHT*2 - children[#children+1] = Button:New{ caption = 'Vote for ceasefire', OnMouseUp = { function() spSendLuaRulesMsg('cf:y'..alliance) end }, width=window_width} - children[#children+1] = Button:New{ caption = 'Break ceasefire/unvote', OnMouseUp = { function() spSendLuaRulesMsg('cf:n'..alliance) spSendLuaRulesMsg('cf:b'..alliance) end }, width=window_width} - end - children[#children+1] = CloseButton() - - local window_height = (B_HEIGHT)* #children - - if window_unitcontext then - window_unitcontext:Dispose() - end - local stack1 = StackPanel:New{ - centerItems = false, - --autoArrangeV = true, - --autoArrangeH = true, - resizeItems=true, - width = window_width, - height = window_height, - padding = {0,0,0,0}, - itemPadding = {2,2,2,2}, - itemMargin = {0,0,0,0}, - children = children, - } - - window_unitcontext = Window:New{ - x = x, - y = y, - clientWidth = window_width, - clientHeight = window_height, - resizable = false, - parent = screen0, - backgroundColor = color.context_bg, - children = {stack1}, - } - AdjustWindow(window_unitcontext) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function widget:MousePress(x,y,button) - - if button ~= 1 then return end - - local alt, ctrl, meta, shift = spGetModKeyState() - - if meta then - local cur_ttstr = screen0.currentTooltip or spGetCurrentTooltip() - local ud = tooltipBreakdown(cur_ttstr) - - local _,cmd_id = Spring.GetActiveCommand() - - if cmd_id then - return false - end - - if ud then - MakeStatsWindow(ud,x,y) - return true - end - - local type, data = spTraceScreenRay(x, y) - if (type == 'unit') then - local unitID = data - local ud = UnitDefs[Spring.GetUnitDefID(unitID)] - if ud then - MakeStatsWindow(ud,x,y) - end - -- FIXME enable later when does not show useless info MakeUnitContextMenu(unitID,x,y) - return true - elseif (type == 'feature') then - local fdid = Spring.GetFeatureDefID(data) - local fd = fdid and FeatureDefs[fdid] - local feature_name = fd and fd.name - if feature_name then - - local live_name - if fd and fd.customParams and fd.customParams.unit then - live_name = fd.customParams.unit - else - live_name = feature_name:gsub('([^_]*).*', '%1') - end - - local ud = UnitDefNames[live_name] - if ud then - MakeStatsWindow(ud,x,y) - return true - end - end - end - - end - - --[[ - if window_unitcontext and window_unitcontext.visible and (not screen0.hoveredControl or not screen0.hoveredControl:IsDescendantOf(window_unitcontext)) then - hideWindow(window_unitcontext) - return true - end - - if window_unitstats and window_unitstats.visible and (not screen0.hoveredControl or not screen0.hoveredControl:IsDescendantOf(window_unitstats)) then - hideWindow(window_unitstats) - return true - end - --]] -end - -function widget:ViewResize(vsx, vsy) - scrW = vsx - scrH = vsy -end - - -function widget:Initialize() - - if (not WG.Chili) then - widgetHandler:RemoveWidget(widget) - return - end - - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Window = Chili.Window - ScrollPanel = Chili.ScrollPanel - StackPanel = Chili.StackPanel - Grid = Chili.Grid - TextBox = Chili.TextBox - Image = Chili.Image - screen0 = Chili.Screen0 - - widget:ViewResize(Spring.GetViewGeometry()) - -end - -function widget:Shutdown() -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_damage_cursortip.lua b/LuaUI/Widgets_Evo/gui_damage_cursortip.lua index 4c444c619..3d8c22ccb 100644 --- a/LuaUI/Widgets_Evo/gui_damage_cursortip.lua +++ b/LuaUI/Widgets_Evo/gui_damage_cursortip.lua @@ -7,7 +7,7 @@ function widget:GetInfo() date = "4-11-2010", license = "GNU GPL v2", layer = 0, - enabled = false + enabled = true } end @@ -22,6 +22,28 @@ local drawString = false local attackText = "" local defendText = "" +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 4.75 +local fontfileOutlineStrength = 5 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +function widget:ViewResize(x,y) + vsx,vsy = Spring.GetViewGeometry() + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:Shutdown() + gl.DeleteFont(font) +end + local function UpdateSelection(newSelection) selectedHealth = {} @@ -122,9 +144,18 @@ function widget:Update(dt) end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if drawString then local x, y = Spring.GetMouseState() - gl.Text(attackText .. "\n" .. defendText, x+40, y, 15, "o") + font:Begin() + font:Print(attackText .. "\n" .. defendText, x+40, y, 15, "o") + font:End() end end diff --git a/LuaUI/Widgets_Evo/gui_darkening.lua b/LuaUI/Widgets_Evo/gui_darkening.lua deleted file mode 100644 index c19b3d1ea..000000000 --- a/LuaUI/Widgets_Evo/gui_darkening.lua +++ /dev/null @@ -1,121 +0,0 @@ --- $Id: gui_darkening.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Darkening", - desc = "Adds a new '/luaui darkening %float%' (and '/luaui inc_dark' & '/luaui dec_dark') command.", - author = "jK", - date = "Nov 22, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - }; -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local mapChanged = false; -local darkeningMap; -local darkening = 0; - -local LUA_BRIGHT_MAP_FILE = "LuaUI/Config/darkeningMap.lua"; - -local vsx, vsy; -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX; - vsy = viewSizeY; -end -widget:ViewResize(widgetHandler:GetViewSizes()); - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function UpdateCallins() - if (darkening>0) then - widgetHandler:UpdateCallIn('DrawWorldPreUnit'); - else - widgetHandler:RemoveCallIn('DrawWorldPreUnit'); - end -end - - -function SetDarkening(_,_,words) - mapChanged = true; - darkening = tonumber(words[1]); - darkeningMap[Game.mapName] = darkening; - UpdateCallins(); -end - -function IncDarkening() - mapChanged = true; - darkening = darkening + 0.1; - darkeningMap[Game.mapName] = darkening; - UpdateCallins(); -end - -function DecDarkening() - mapChanged = true; - darkening = darkening - 0.1; - darkeningMap[Game.mapName] = darkening; - UpdateCallins(); -end - - -function fileexists( file ) - local f = io.open( file, "r" ); - if f then - io.close( f ); - return true; - else - return false; - end -end - -function widget:Initialize() - if fileexists(LUA_BRIGHT_MAP_FILE) then - darkeningMap = include("Config/darkeningMap.lua"); - end - if (brightnessMap) then - darkening = darkeningMap[Game.mapName]; - else - darkeningMap = {}; - end - UpdateCallins(); - - local help = " [0..1]: sets map darkening"; - widgetHandler:AddAction("darkening", SetDarkening, nil, "t"); - widgetHandler:AddAction("inc_dark", IncDarkening, nil, "t"); - widgetHandler:AddAction("dec_dark", DecDarkening, nil, "t"); -end - - -function widget:Shutdown() - if mapChanged then - include("savetable.lua"); - table.save(darkeningMap, LUA_BRIGHT_MAP_FILE); - end - - widgetHandler:RemoveAction("darkening"); - widgetHandler:RemoveAction("inc_dark"); - widgetHandler:RemoveAction("dec_dark"); -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:DrawWorldPreUnit() - local drawMode = Spring.GetMapDrawMode() - if (drawMode=="height") or (drawMode=="path") then return end - - gl.MatrixMode(GL.PROJECTION); gl.PushMatrix(); gl.LoadIdentity() - gl.MatrixMode(GL.MODELVIEW); gl.PushMatrix(); gl.LoadIdentity() - - gl.Color(0,0,0,darkening); - gl.Rect(-1,1,1,-1); - - gl.MatrixMode(GL.PROJECTION); gl.PopMatrix() - gl.MatrixMode(GL.MODELVIEW); gl.PopMatrix() -end diff --git a/LuaUI/Widgets_Evo/gui_discord.lua b/LuaUI/Widgets_Evo/gui_discord.lua new file mode 100644 index 000000000..5f042fe7f --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_discord.lua @@ -0,0 +1,185 @@ +function widget:GetInfo() + return { + name = "Discord icon", + desc = "located next to advplayerlist", + author = "Floris", + date = "24 july 2016", + license = "GNU GPL, v2 or later", + layer = -4, -- set to -5 to draw mascotte on top of advplayerlist + enabled = false, + } +end + +local discordLink = 'discord.me/evolutionrts' + +local iconTexture = ":n:LuaUI/Images/discord.png" +local iconSize = 32 + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local spGetGameFrame = Spring.GetGameFrame + +local glText = gl.Text +local glGetTextWidth = gl.GetTextWidth +local glTranslate = gl.Translate +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix + +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local drawlist = {} +local xPos = 0 +local yPos = 0 + +local mouseover = false +local usedImgSize = iconSize + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +--------------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------------- + +local function RectQuad(px,py,sx,sy) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o,1-o) + gl.Vertex(px, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) +end + +function DrawRect(px,py,sx,sy) + gl.BeginEnd(GL.QUADS, RectQuad, px,py,sx,sy) +end + +local function createList(size) + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + end + drawlist[1] = glCreateList( function() + gl.Texture(iconTexture) + DrawRect(-usedImgSize, 0, 0, usedImgSize) + gl.Texture(false) + end) +end + +local parentPos = {} +function updatePosition(force) + if (WG['advplayerlist_api'] ~= nil) then + local prevPos = parentPos + if WG['displayinfo'] ~= nil then + parentPos = WG['displayinfo'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + elseif WG['music'] ~= nil then + parentPos = WG['music'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + else + parentPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + end + usedImgSize = iconSize * parentPos[5] + xPos = parentPos[4] + yPos = parentPos[1] + local vsx,vsy = Spring.GetViewGeometry() + if xPos > vsx then xPos = vsx end + if (prevPos[1] == nil or prevPos[1] ~= parentPos[1] or prevPos[2] ~= parentPos[2] or prevPos[5] ~= parentPos[5]) or force then + createList(usedImgSize) + end + end +end + +function widget:Initialize() + if spGetGameFrame() > 0 then widgetHandler:RemoveWidget(self) return end + updatePosition() +end + +function widget:Shutdown() + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + end + gl.DeleteFont(font) +end + +function widget:GameFrame(n) + if n > 0 then + widgetHandler:RemoveWidget(self) + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + updatePosition() + if drawlist[1] ~= nil then + glPushMatrix() + glTranslate(xPos, yPos, 0) + if mouseover then + gl.Color(1,1,1,1) + else + gl.Color(1,1,1,0.55) + end + glCallList(drawlist[1]) + local mx,my = Spring.GetMouseState() + if widget:IsAbove(mx,my) then + local textWidth = font:GetTextWidth(discordLink) * 13 + font:Begin() + font:Print(discordLink, -(textWidth+6+iconSize)*parentPos[5], 12*parentPos[5], 13*parentPos[5], "no") + font:End() + end + glPopMatrix() + mouseover = false + end +end + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + +function widget:MousePress(mx, my, mb) + if mb == 1 and isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + Spring.SendCommands("our discord server: https://"..discordLink) + widgetHandler:RemoveWidget(self) + return true + end +end + +function widget:MouseRelease(mx, my, mb) + if mb == 1 and isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + updatePosition(true) + end +end + +function widget:IsAbove(mx, my) + if isInBox(mx, my, {xPos-usedImgSize, yPos, xPos, yPos+usedImgSize}) then + mouseover = true + end + return mouseover +end + +function widget:GetTooltip(mx, my) + if widget:IsAbove(mx,my) then + return string.format("We have our own Discord server now!\nour central community hub (chat/voice/info)\n\n"..discordLink) + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_display_dps.lua b/LuaUI/Widgets_Evo/gui_display_dps.lua index 1995b28e7..1e0da38d7 100644 --- a/LuaUI/Widgets_Evo/gui_display_dps.lua +++ b/LuaUI/Widgets_Evo/gui_display_dps.lua @@ -19,19 +19,26 @@ function widget:GetInfo() date = "May 27, 2008", license = "GNU GPL, v2 or later", layer = 0, - enabled = true -- loaded by default? + enabled = false -- loaded by default? } end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + -- Speed Up local GetUnitDefID = Spring.GetUnitDefID local GetUnitDefDimensions = Spring.GetUnitDefDimensions local AreTeamsAllied = Spring.AreTeamsAllied -local GetMyTeamID = Spring.GetMyTeamID local GetGameSpeed = Spring.GetGameSpeed local GetGameSeconds = Spring.GetGameSeconds local GetUnitViewPosition = Spring.GetUnitViewPosition @@ -39,7 +46,6 @@ local GetUnitViewPosition = Spring.GetUnitViewPosition local glTranslate = gl.Translate local glColor = gl.Color local glBillboard = gl.Billboard -local glText = gl.Text local glDepthMask = gl.DepthMask local glDepthTest = gl.DepthTest local glAlphaTest = gl.AlphaTest @@ -47,6 +53,7 @@ local glBlending = gl.Blending local glDrawFuncAtUnit = gl.DrawFuncAtUnit local glPushMatrix = gl.PushMatrix local glPopMatrix = gl.PopMatrix +local glCallList = gl.CallList local GL_GREATER = GL.GREATER local GL_SRC_ALPHA = GL.SRC_ALPHA @@ -64,10 +71,21 @@ local lastTime = 0 local paused = false local changed = false local heightList = {} +local drawTextLists = {} +local drawTextListsDeath = {} +local drawTextListsEmp = {} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local fontScale = widgetScale/2 + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, 52*fontScale, 17*fontScale, 1.5) +end + local function unitHeight(unitDefID) if not heightList[unitDefID] then heightList[unitDefID] = (GetUnitDefDimensions(unitDefID).height * 0.9) @@ -82,39 +100,44 @@ function widget:UnitFinished(unitID, unitDefID, unitTeam) end local function getTextSize(damage, paralyze) - local sizeMod = 3 - if paralyze then sizeMod = 2.25 end - return math.floor(8 * (1 + sizeMod * (1 - (200 / (200 + damage))))) + --if paralyze then sizeMod = 2.25 end + return 15 + math.floor(3 * (2 * (1 - (100 / (100 + damage/10))))) end local function displayDamage(unitID, unitDefID, damage, paralyze) table.insert(damageTable,1,{}) - damageTable[1].unitID = unitID - damageTable[1].damage = math.ceil(damage - 0.5) - damageTable[1].height = unitHeight(unitDefID) - damageTable[1].offset = (6 - math.random(0,12)) - damageTable[1].textSize = getTextSize(damage, paralyze) - damageTable[1].heightOffset = 0 - damageTable[1].lifeSpan = 1 - damageTable[1].paralyze = paralyze - damageTable[1].fadeTime = math.max((0.03 - (damage / 333333)), 0.015) - damageTable[1].riseTime = (math.min((damage / 2500), 2) + 1) + damageTable[1] = { + unitID = unitID, + damage = math.ceil(damage - 0.5), + height = unitHeight(unitDefID), + offset = (10 - math.random(0,12)), + textSize = getTextSize(damage, paralyze), + heightOffset = 0, + lifeSpan = 1, + paralyze = paralyze, + fadeTime = math.max((0.03 - (damage / 333333)), 0.015), + riseTime = (math.min((damage / 2500), 2) + 1)/3, + } end function widget:UnitDestroyed(unitID, unitDefID, unitTeam) if unitDamage[unitID] then local ux, uy, uz = GetUnitViewPosition(unitID) - table.insert(deadList,1,{}) - local damage = math.ceil(unitDamage[unitID].damage - 0.5) - deadList[1].x = ux - deadList[1].y = (uy + unitHeight(unitDefID)) - deadList[1].z = uz - deadList[1].lifeSpan = 1 - deadList[1].fadeTime = math.max((0.03 - (damage / 333333)), 0.015) * 0.66 - deadList[1].riseTime = (math.min((damage / 2500), 2) + 1)* 1.33 - deadList[1].damage = damage - deadList[1].textSize = getTextSize(damage, false) - deadList[1].red = true + if ux ~= nil then + local damage = math.ceil(unitDamage[unitID].damage - 0.5) + table.insert(deadList,1,{}) + deadList[1] = { + x = ux, + y = (uy + unitHeight(unitDefID)), + z = uz, + lifeSpan = 1, + fadeTime = math.max((0.03 - (damage / 333333)), 0.015) * 0.5, + riseTime = (math.min((damage / 2500), 2) + 1)/3, + damage = damage, + textSize = getTextSize(damage, false), + red = true, + } + end end unitDamage[unitID] = nil unitParalyze[unitID] = nil @@ -122,16 +145,20 @@ function widget:UnitDestroyed(unitID, unitDefID, unitTeam) if (v.unitID == unitID) then if not v.paralyze then local ux, uy, uz = GetUnitViewPosition(unitID) - table.insert(deadList,1,{}) - deadList[1].x = ux + v.offset - deadList[1].y = uy + v.height + v.heightOffset - deadList[1].z = uz - deadList[1].lifeSpan = v.lifeSpan - deadList[1].fadeTime = v.fadeTime * 2.5 - deadList[1].riseTime = v.riseTime * 0.66 - deadList[1].damage = v.damage - deadList[1].textSize = v.textSize - deadList[1].red = false + if ux ~= nil then + table.insert(deadList,1,{}) + deadList[1] = { + x = ux + v.offset, + y = uy + v.height + v.heightOffset, + z = uz, + lifeSpan = v.lifeSpan, + fadeTime = v.fadeTime * 2.5, + riseTime = v.riseTime * 0.9, + damage = v.damage, + textSize = v.textSize, + red = false, + } + end end table.remove(damageTable,i) end @@ -148,18 +175,16 @@ function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) if (damage < 1.5) then return end if (UnitDefs[unitDefID] == nil) then return end - - if paralyzer then - if unitParalyze[unitID] then - unitParalyze[unitID].damage = (unitParalyze[unitID].damage + damage) - end + + if paralyzer and unitParalyze[unitID] then + unitParalyze[unitID].damage = (unitParalyze[unitID].damage + damage) return elseif unitDamage[unitID] then unitDamage[unitID].damage = (unitDamage[unitID].damage + damage) return end - if paralyze then + if paralyzer then unitParalyze[unitID] = {} unitParalyze[unitID].damage = damage unitParalyze[unitID].time = (lastTime + 0.1) @@ -192,15 +217,29 @@ local function drawDeathDPS(damage,ux,uy,uz,textSize,red,alpha) glTranslate(ux, uy, uz) glBillboard() gl.MultiTexCoord(1, 0.25 + (0.5 * alpha)) - + if red then - glColor(1, 0, 0) + if drawTextListsDeath[damage] == nil then + drawTextListsDeath[damage] = gl.CreateList(function() + font:Begin() + font:SetTextColor(1, 0.5, 0.5) + font:Print(damage, 0, 0, textSize, 'cnO') + font:End() + end) + end + glCallList(drawTextListsDeath[damage]) else - glColor(1, 1, 1) + if drawTextLists[damage] == nil then + drawTextLists[damage] = gl.CreateList(function() + font:Begin() + font:SetTextColor(1, 1, 1) + font:Print(damage, 0, 0, textSize, 'cnO') + font:End() + end) + end + glCallList(drawTextLists[damage]) end - glText(damage, 0, 0, textSize, "cno") - glPopMatrix() end @@ -209,16 +248,38 @@ local function DrawUnitFunc(yshift, xshift, damage, textSize, alpha, paralyze) glBillboard() gl.MultiTexCoord(1, 0.25 + (0.5 * alpha)) if paralyze then - glColor(0, 0, 1) - glText(damage, 0, 0, textSize, 'cnO') + if drawTextListsEmp[damage] == nil then + drawTextListsEmp[damage] = gl.CreateList(function() + font:Begin() + font:SetTextColor(0.5, 0.5, 1) + font:Print(damage, 0, 0, textSize, 'cnO') + font:End() + end) + end + glCallList(drawTextListsEmp[damage]) else - glColor(1, 1, 1) - glText(damage, 0, 0, textSize, 'cno') + if drawTextLists[damage] == nil then + drawTextLists[damage] = gl.CreateList(function() + font:Begin() + font:SetTextColor(1, 1, 1) + font:Print(damage, 0, 0, textSize, 'cnO') + font:End() + end) + end + glCallList(drawTextLists[damage]) end end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawWorld() -if not Spring.IsGUIHidden() then + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + local theTime = GetGameSeconds() if (theTime ~= lastTime) then @@ -242,7 +303,7 @@ if not Spring.IsGUIHidden() then glDepthTest(true) glAlphaTest(GL_GREATER, 0) glBlending(GL_SRC_ALPHA, GL_ONE) - gl.Texture(1, LUAUI_DIRNAME .. "images/gradient_alpha_2.png") + gl.Texture(1, "LuaUI/images/gradient_alpha_2.png") for i, damage in pairs(damageTable) do if (damage.lifeSpan <= 0) then @@ -251,15 +312,15 @@ if not Spring.IsGUIHidden() then glDrawFuncAtUnit(damage.unitID, false, DrawUnitFunc, (damage.height + damage.heightOffset), damage.offset, damage.damage, damage.textSize, damage.lifeSpan, damage.paralyze) if not paused then - if damage.paralyze then - damage.lifeSpan = (damage.lifeSpan - 0.05) - damage.textSize = (damage.textSize + 0.2) - else + --if damage.paralyze then + -- damage.lifeSpan = (damage.lifeSpan - 0.05) + -- damage.textSize = (damage.textSize + 0.2) + --else damage.heightOffset = (damage.heightOffset + damage.riseTime) if (damage.heightOffset > 25) then damage.lifeSpan = (damage.lifeSpan - damage.fadeTime) end - end + --end end end end @@ -282,6 +343,27 @@ if not Spring.IsGUIHidden() then glDepthTest(false) glDepthMask(false) end + + +--function widget:Initialize() +-- for damage=1, 200 do +-- drawTextLists[damage] = gl.CreateList(function() +-- glText(damage, 0, 0, getTextSize(damage, false), 'cnO') +-- end) +-- end +--end + +function widget:Shutdown() + for k,_ in pairs(drawTextLists) do + gl.DeleteList(drawTextLists[k]) + end + for k,_ in pairs(drawTextListsDeath) do + gl.DeleteList(drawTextListsDeath[k]) + end + for k,_ in pairs(drawTextListsEmp) do + gl.DeleteList(drawTextListsEmp[k]) + end + gl.DeleteFont(font) end -------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_ecostats.lua b/LuaUI/Widgets_Evo/gui_ecostats.lua deleted file mode 100644 index 9c891e8e0..000000000 --- a/LuaUI/Widgets_Evo/gui_ecostats.lua +++ /dev/null @@ -1,3054 +0,0 @@ -local versionNumber = "1.55" ---------------------------------------------------------------------------------------------------- - ----------------------------------------------------------------------------------------------------------------------------- --- Changelog - ------------------------- --- Version 1.54 ------------------------- --- * Bug fixes and performance improvements --- * Added TS values and better handling of screen position --- * Improved player list management and handling of dead players - ------------------------- --- Version 1.5 ------------------------- --- * Rewritten code to increase performance, fps cost down by 50% in normal usage scenario. --- * Now uses drawlists and gl.loadFont - ------------------------- --- Version 1.41 ------------------------- --- * Bug fixes and performance improvements - ------------------------- --- Version 1.4 ------------------------- --- * Performance improvements --- * Font improvements --- * Display extended info by pressing on i-button instead of overcomplicated arrows --- * Drag widget with right button; drag infopanel with left button and close with right (yes i know, maybe counter-intuitive) --- * Fixed opengl bugs - ------------------------- --- version 1.32 ------------------------- --- * Compatible with spring 95.0 --- * fixed bug with incorrect expand button location --- * fixed spam errors bc of old tags ------------------------- - -function widget:GetInfo() - return { - name = "Ecostats", - desc = "Display team eco", - author = "Jools", - date = "jan, 2014", - license = "GNU GPL, v2 or later", - layer = 99, - enabled = false - } -end - ---------------------------------------------------------------------------------------------------- --- Declarations ---------------------------------------------------------------------------------------------------- - -local bestTeam, bestKills, worstLosses -local killCounters = {} -local lossCounters = {} -local killedHP = {} -local lostHP = {} -local kMat = {} -- player to player kill matrix -local PmaxDmg = 0 -local comTable = {} -local teamData = {} -local allyData = {} -local pressedToMove, pressedHPlus, pressedHMinus, pressedWPlus, pressedWMinus -- click detection for moving the widget -local pressedExpandMove = false -local gamestarted = false -local gameover = false -local inSpecMode = false -local expandDown = false -local expandLeft = false -local isReplay = Spring.IsReplay() - -local infoButton = {} -local playerButton = {} -local options = {} -local expandMove = {} -local Teambutton = {} - -local lastPlayerChange = 0 -local lastDrawUpdate -local drawList - -local vsx,vsy = gl.GetViewSizes() -local right = true -local widgetHeight -local widgetWidth = 110 -local widgetPosX = vsx-widgetWidth -local widgetPosY = 600 -local widgetRight = widgetPosX + widgetWidth -local tH = 75 -- team row height -local WBadge = 14 -- width of player badge (side icon) -local iPosX, iPosY -local InfotablePosX, InfotablePosY -- Expand bar bottom left coordinates -local cW = 100 -- column width -local infoTableHeight = 520 -local ctrlDown = false -local textsize = 11 -local textlarge = 18 -local gaiaID = Spring.GetGaiaTeamID() -local gaiaAllyID = select(6,Spring.GetTeamInfo(gaiaID)) -local LIMITSPEED = 2.0 -- gamespseed under which to fully update dynamic graphics - ---------------------------------------------------------------------------------------------------- -local announcingOn = true -local soundsOn = true -- set true if you want sounds -local snd = "LuaUI/Sounds/ding.ogg" --path to sound file -if snd == nil then soundsOn = false end - -local fontPath = "LuaUI/Fonts/ebrima.ttf" -local font2Path = "LuaUI/Fonts/ebrima.ttf" -local myFont = gl.LoadFont("FreeSansBold.otf",textsize, 1.9, 40) --gl.LoadFont(fontPath,textsize,2,20) -local myFontBig = gl.LoadFont(font2Path,textlarge,5,40) - -local images = { - ["arm"] = "LuaUI/Images/ecostats/arm_default.png", - ["core"] = "LuaUI/Images/ecostats/core_default.png", - ["contrast"] = "LuaUI/Images/ecostats/contrast.png", - ["borderson"] = "LuaUI/Images/ecostats/borders.png", - ["bordersoff"] = "LuaUI/Images/ecostats/bordersOff.png", - ["checkboxon"] = "LuaUI/Images/ecostats/chkBoxOn.png", - ["checkboxoff"] = "LuaUI/Images/ecostats/chkBoxOff.png", - ["more"] = "LuaUI/Images/ecostats/ButtonMore.png", - ["less"] = "LuaUI/Images/ecostats/ButtonLess.png", - ["default"] = "LuaUI/Images/ecostats/default.png", - ["move"] = "LuaUI/Images/ecostats/move.png", - ["arrowleft"] = "LuaUI/Images/ecostats/arrowL.png", - ["arrowright"] = "LuaUI/Images/ecostats/arrowR.png", - ["info"] = "LuaUI/Images/ecostats/info.png", - ["dead"] = "LuaUI/Images/ecostats/cross.png", - } - -local AttackUnits = {} -local BuilderUnits = {} - ---------------------------------------------------------------------------------------------------- --- Speed ups ---------------------------------------------------------------------------------------------------- - -local Echo = Spring.Echo -local glText = gl.Text - ---------------------------------------------------------------------------------------------------- --- Start ---------------------------------------------------------------------------------------------------- - -function widget:Initialize() - if not (Spring.GetSpectatingState() or isReplay) then - inSpecMode = false - Echo("Ecostats: widget loaded in active player mode") - else - inSpecMode = true - Echo("Ecostats: widget loaded in spectator mode") - end - if Spring.GetGameSeconds() > 0 then gamestarted = true end - - Init() -end - -function widget:Shutdown() - gl.DeleteList(drawList) - gl.DeleteList(drawListDynamic) -end - -function Init() - local maxPlayers = getMaxPlayers() - bestKills = 0 - worstLosses = 0 - killCounters = {} - lossCounters = {} - killedHP = {} - lostHP = {} - kMat = {} - teamData = {} - allyData = {} - comTable = {} - infoButton = {} - expandMove = {} - playerButton = {} - iPosX = {} - iPosY = {} - iPanel = {} - Teambutton = {} - Teambutton["Next"] = {} - Teambutton["Prev"] = {} - right = widgetPosX/vsx > 0.5 - widgetHeight = getNbTeams()*tH+2 - - if right then - InfotablePosX = widgetPosX - (180 + cW*maxPlayers) - else - InfotablePosX = widgetPosX + widgetWidth - end - InfotablePosY = widgetPosY + widgetHeight - - if maxPlayers == 1 then - WBadge = 18 - elseif maxPlayers == 2 or maxPlayers == 3 then - WBadge = 16 - else - WBadge = 14 - end - if maxPlayers * WBadge + 30 > widgetWidth then - widgetWidth = 30 + maxPlayers * WBadge - - end - - for _,teamID in ipairs(Spring.GetTeamList()) do - if teamID ~= gaiaID then - killCounters[teamID] = 0 - lossCounters[teamID] = 0 - killedHP[teamID] = 0 - lostHP[teamID] = 0 - kMat[teamID] = {} - setPlayerTable(teamID) - playerButton[teamID] = {} - for sortindex,enemy in ipairs(Spring.GetTeamList()) do - kMat[teamID][sortindex] = {enemy,0} -- maintain association: 1 = pID, 2 = kills - end - end - end - - for id,unitDef in ipairs(UnitDefs) do - if unitDef.customParams.iscommander then - table.insert(comTable,id) - end - if #(unitDef.weapons) > 0 then - AttackUnits[id] = true - end - if unitDef.isBuilder then - BuilderUnits[id] = true - end - end - - local allyList = Spring.GetAllyTeamList() - for _,allyID in ipairs (allyList) do - if allyID ~= gaiaAllyID then - setAllyData(allyID) - local nbPlayers = getNbPlayers(allyID) - infoButton[allyID] = {} - expandMove[allyID] = {} - Teambutton["Next"][allyID] = {} - Teambutton["Prev"][allyID] = {} - infoButton[allyID]["mouse"] = false - infoButton[allyID]["click"] = false - expandMove[allyID]["mouseover"] = false - Teambutton["Next"][allyID]["mouse"] = false - Teambutton["Next"][allyID]["click"] = false - Teambutton["Prev"][allyID]["mouse"] = false - Teambutton["Prev"][allyID]["click"] = false - iPanel[allyID] = false - end - end - updateButtons() - UpdateTeams() - if not options.disable then - Echo("Ecostats:Options not loaded, using default settings. (This is normal during first run.)") - setDefaults() - end - - local frame = Spring.GetGameFrame() - lastPlayerChange = frame - - -end - -function Reinit() - - local maxPlayers = getMaxPlayers() - - if (not inSpecMode) and gamestarted then - if widgetWidth < 60 then widgetWidth = 60 end - if tH < 50 then tH = 50 end - else - if widgetWidth < 110 then widgetWidth = 110 end - if tH < 75 then tH = 75 end - end - - if maxPlayers == 1 then - WBadge = 18 - elseif maxPlayers == 2 or maxPlayers == 3 then - WBadge = 16 - else - WBadge = 14 - end - if maxPlayers * WBadge + 30 > widgetWidth then - widgetWidth = 30 + maxPlayers * WBadge - end - if widgetPosX + widgetWidth > vsx then widgetPosX = vsx-widgetWidth end - if widgetPosX < 0 then widgetPosX = 0 end - - local allyList = Spring.GetAllyTeamList() - UpdateTeams() - UpdateTeams() - updateButtons() - -end - ---------------------------------------------------------------------------------------------------- --- Save / Load ---------------------------------------------------------------------------------------------------- - -function setDefaults() - options = {} - options["contrastMore"] = {} - options["contrastLess"] = {} - options["contrast"] = 0.2 - options["borders"] = {} - options["borders"]["On"] = false - options["disable"] = {} - options["disable"]["On"] = false - options["FPBar1"] = {} - options["FPBar1"]["On"] = true - options["FPBar2"] = {} - options["FPBar2"]["On"] = true - options["BPBar1"] = {} - options["BPBar1"]["On"] = true - options["BPBar2"] = {} - options["BPBar2"]["On"] = true - options["kills1"] = {} - options["kills1"]["On"] = false - options["kills2"] = {} - options["kills2"]["On"] = true - options["widthInc"] = {} - options["widthDec"] = {} - options["heightInc"] = {} - options["heightDec"] = {} - options["Announce"] = {} - options["Announce"]["On"] = false - options["resText"] = {} - options["removeDead"] = {} - options["resText"]["On"] = true - options["removeDead"]["On"] = false - vsx,vsy = gl.GetViewSizes() - widgetWidth = 110 - widgetPosX = vsx-widgetWidth - widgetPosY = 600 - expandDown = true - expandLeft = true - right = true - tH = 60 - soundsOn = true -end - -function widget:GetConfigData(data) -- save - if options.Announce then - --Echo("Saving config data") - return { - vsx = vsx, - vsy = vsy, - widgetPosX = widgetPosX, - widgetPosY = widgetPosY, - widgetWidth = widgetWidth, - expandDown = expandDown, - expandLeft = expandLeft, - tH = tH, - announcingOn = options.Announce.On, - removeDeadOn = options.removeDead.On, - resTextOn = options.resText.On, - soundsOn = soundsOn, - bordersOn = options.borders.On, - contrast = options.contrast, - disableOn = options.disable.On, - FPBar1On = options.FPBar1.On, - FPBar2On = options.FPBar2.On, - BPBar1On = options.BPBar1.On, - BPBar2On = options.BPBar2.On, - kills1On = options.kills1.On, - kills2On = options.kills2.On, - vsx = vsx, - vsy = vsy, - widgetPosX = widgetPosX, - widgetPosY = widgetPosY, - widgetWidth = widgetWidth, - expandDown = expandDown, - expandLeft = expandLeft, - right = right, - tH = tH, - } - end -end - -function widget:SetConfigData(data) -- load - --Echo("Loading config data...") - options = {} - options["contrastMore"] = {} - options["contrastLess"] = {} - options["contrast"] = data.contrast or 0.3 - options["borders"] = {} - options["borders"]["On"] = data.bordersOn or false - options["disable"] = {} - options["disable"]["On"] = data.disableOn or false - options["FPBar1"] = {} - options["FPBar1"]["On"] = data.FPBar1On or false - options["FPBar2"] = {} - options["FPBar2"]["On"] = data.FPBar2On or false - options["BPBar1"] = {} - options["BPBar1"]["On"] = data.BPBar1On or false - options["BPBar2"] = {} - options["BPBar2"]["On"] = data.BPBar2On or false - options["kills1"] = {} - options["kills1"]["On"] = data.kills1On or false - options["kills2"] = {} - options["kills2"]["On"] = data.kills2On or false - options["widthInc"] = {} - options["widthDec"] = {} - options["heightInc"] = {} - options["heightDec"] = {} - options["Announce"] = {} - options["Announce"]["On"] = data.announcingOn or false - options["resText"] = {} - options["removeDead"] = {} - options["resText"]["On"] = data.resTextOn or false - options["removeDead"]["On"] = data.removeDeadOn or false - vsx = data.vsx or vsx - vsy = data.vsy or vsy - widgetPosX = data.widgetPosX or widgetPosX - widgetPosY = data.widgetPosY or widgetPosY - widgetWidth = data.widgetWidth or widgetWidth - expandDown = data.expandDown or expandDown - expandLeft = data.expandLeft or expandLeft - tH = data.tH or tH - soundsOn = data.soundsOn or soundsOn -end - ---------------------------------------------------------------------------------------------------- --- Local ---------------------------------------------------------------------------------------------------- - -local function firstToUpper(str) - return (str:sub(1,1):upper()..str:sub(2)) -end - -local function digitsep(amount) - local formatted = amount - while true do - formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1 %2') - if (k==0) then - break - end - end - return formatted -end - -local function round(num, idp) - local mult = 10^(idp or 0) - return math.floor(num * mult + 0.5) / mult -end - -local function friendlyName(teamID) - if teamID == nil then return "NONE" end - local _,_,_,isAIteam,side,_,_,_ = Spring.GetTeamInfo(teamID) - if isAIteam then - if side == "arm" then return "Arm" - elseif side == "core" then return "Core" - elseif not (side == nil or #side < 1) then return side - else return ("Team " .. teamID) - end - else - names=nil - for _,pid in ipairs(Spring.GetPlayerList(teamID,true)) do - local name,active,spectator,_,_,_,_,_,_ = Spring.GetPlayerInfo(pid) - if not spectator then - names=(names and names.."," or "").."" - end - end - if names == nil or #names < 1 then return ("Team " .. teamID) end - return (names and names or "") - end -end - -local function formatRes(number) - local label - if number > 10000 then - label = table.concat({math.floor(round(number/1000)),"k"}) - elseif number > 1000 then - label = table.concat({string.sub(round(number/1000,1),1,2+string.find(round(number/1000,1),".")),"k"}) - elseif number > 10 then - label = string.sub(round(number,0),1,3+string.find(round(number,0),".")) - else - label = string.sub(round(number,1),1,2+string.find(round(number,1),".")) - end - return tostring(label) -end - -local function formatRes1000(number) - local label - if number == nil then - Echo(Spring.GetGameFrame(),": formatRes1000 returned nil") - - return nil - end - if number > 10000 then - label = digitsep(round(number)) - elseif number > 1000 then - label = digitsep(round(number)) - elseif number > 10 then - label = string.sub(round(number,0),1,3+string.find(round(number,0),".")) - else - label = string.sub(round(number,1),1,2+string.find(round(number,1),".")) - end - return label -end - ---------------------------------------------------------------------------------------------------- --- General ---------------------------------------------------------------------------------------------------- - -function UpdateAllPlayers() - for _,teamID in ipairs(Spring.GetTeamList()) do - if teamID ~= gaiaID then - if inSpecMode then - setPlayerTable(teamID) - else - local allyID = teamData[teamID].allyID - if allyID == Spring.GetMyAllyTeamID() then setPlayerTable(teamID) end - end - end - end -end - -function UpdatePlayer(pID) - if pID ~= Spring.GetGaiaTeamID then - if inSpecMode then - setPlayerTable(pID) - else - local allyID = teamData[pID].allyID - if allyID == Spring.GetMyAllyTeamID() then setPlayerTable(pID) end - end - end -end - -function UpdateTeams() - local allyList = Spring.GetAllyTeamList() - for _,allyID in ipairs (allyList) do - if inSpecMode then - setAllyData(allyID) - else - if allyID == Spring.GetMyAllyTeamID() then - setAllyData(allyID) - end - end - end - -end - -function UpdateTeam(teamID) - if inSpecMode then - setAllyData(teamID) - else - if teamID == Spring.GetMyAllyTeamID() then - setAllyData(teamID) - end - end -end - -function setPlayerTable(pID) - - local side, tID, isDead, commanderAlive, minc, einc, kills, losses, x, y, kills2, losses2, leaderName, leaderID, active, unitCount, spectator, country, rank - _,leaderID,isDead,isAI,side,tID,_,_ = Spring.GetTeamInfo(pID) - leaderName,active,spectator,_,_,_,_,country,rank = Spring.GetPlayerInfo(leaderID) - - local tred, tgreen, tblue = Spring.GetTeamColor(pID) - local luminance = (tred * 0.299) + (tgreen * 0.587) + (tblue * 0.114) - if (luminance < 0.2) then - tred = tred + 0.25 - tgreen = tgreen + 0.25 - tblue = tblue + 0.25 - end - - kills2,losses2 = Spring.GetTeamUnitStats(pID) - _,_,_,minc = Spring.GetTeamResources(pID,"metal") - _,_,_,einc = Spring.GetTeamResources(pID,"energy") - x,_,y = Spring.GetTeamStartPosition(pID) - commanderAlive = checkCommander(pID) - kills = killCounters[pID] - losses = lossCounters[pID] - killedhp = killedHP[pID] - losthp = lostHP[pID] - unitCount = Spring.GetTeamUnitCount(pID) - - if not teamData[pID] then teamData[pID] = {} end - - teamData[pID]["playerID"] = pID - teamData[pID]["allyID"] = tID - teamData[pID]["red"] = tred - teamData[pID]["green"] = tgreen - teamData[pID]["blue"] = tblue - teamData[pID]["startx"] = x - teamData[pID]["starty"] = y - teamData[pID]["side"] = side - teamData[pID]["isDead"] = isDead - teamData[pID]["hasCom"] = commanderAlive - teamData[pID]["minc"] = minc - teamData[pID]["einc"] = einc - teamData[pID]["kills"] = kills - teamData[pID]["losses"] = losses - teamData[pID]["kills2"] = kills2 - teamData[pID]["losses2"] = losses2 - teamData[pID]["killedhp"] = killedhp - teamData[pID]["losthp"] = losthp - teamData[pID]["leaderID"] = leaderID - teamData[pID]["leaderName"] = leaderName - teamData[pID]["active"] = active - teamData[pID]["spectator"] = spectator - teamData[pID]["unitCount"] = unitCount - teamData[pID]["country"] = country - teamData[pID]["rank"] = rank - teamData[pID]["isAI"] = isAI - setPlayerFP(pID) - setPlayerBP(pID) - teamData[pID]["skill"] = GetSkill(pID) -end - -function setAllyData(allyID) - if allyID == gaiaAllyID then return end - local id = allyID + 1 - - local playerList = Spring.GetTeamList(allyID) - - if #playerList > 0 and isTeamAlive(allyID) then - for _,tID in ipairs (playerList) do - if tID ~= gaiaID then - setPlayerTable(tID) - end - end - - local player1 = playerList[1] --leader id - - if not allyData[id] then allyData[id] = {} end - - allyData[id]["tE"] = getTeamSum(allyID,"einc") - allyData[id]["tM"] = getTeamSum(allyID,"minc") - allyData[id]["tFP"] = getTeamSum(allyID,"firepower") - allyData[id]["tBP"] = getTeamSum(allyID,"buildpower") - allyData[id]["tFPM"] = getTeamSum(allyID,"firepowerMob") - allyData[id]["tBPA"] = getTeamSum(allyID,"buildpowerAir") - allyData[id]["x"] = getTeamSum(allyID,"startx") - allyData[id]["y"] = getTeamSum(allyID,"starty") - allyData[id]["validPlayers"] = getNbPlacedPositions(allyID) - allyData[id]["kills"] = getTeamSum(allyID,"kills") - allyData[id]["losses"] = getTeamSum(allyID,"losses") - allyData[id]["killedhp"] = getTeamSum(allyID,"killedhp") - allyData[id]["losthp"] = getTeamSum(allyID,"losthp") - allyData[id]["isAlive"] = isTeamAlive(allyID) - allyData[id]["leader"] = teamData[player1]["leaderName"] or "N/A" - allyData[id]["tFP"] = getTeamSum(allyID,"firepower") - allyData[id]["tFPM"] = getTeamSum(allyID,"firepowerMob") - allyData[id]["tBP"] = getTeamSum(allyID,"buildpower") - allyData[id]["tBPA"] = getTeamSum(allyID,"buildpowerAir") - allyData[id]["aID"] = allyID - else - if options["removeDead"]["On"] then - allyData[id] = nil - end - end - -end - -function getTeamSum(allyID,param) - local tValue = 0 - local teamList = Spring.GetTeamList(allyID) - - for _,tID in ipairs (teamList) do - if tID ~= gaiaID then - tValue = tValue + (teamData[tID][param] or 0) - end - end - - return tValue - -end - -function getTeamStarts(team) - - local x, y, active, leaderID, leaderName, isDead - local validPlayers = 0 - - for _,pID in ipairs (Spring.GetTeamList(team)) do - leaderID = teamData[pID].leaderID - x = teamData[pID].startx - y = teamData[pID].starty - active = teamData[pID].active - leaderName,active,spectator = Spring.GetPlayerInfo(leaderID) - isDead = teamData[pID].isDead - if leaderName and startx then - if active and startx >= 0 and starty >= 0 or isDead then - validPlayers = validPlayers +1 - x = x + x - y = y + y - end - end - end - if not validPlayers == 0 then - return math.floor(x/validPlayers), math.floor(y/validPlayers) - else - return nil - end -end - -function isTeamReal(allyID) - if allyID == nil then return false end - local leaderID, spectator, isDead, unitCount - - for _,tID in ipairs (Spring.GetTeamList(allyID)) do - _,leaderID,isDead = Spring.GetTeamInfo(tID) - unitCount = Spring.GetTeamUnitCount(tID) - leaderName,active,spectator = Spring.GetPlayerInfo(leaderID) - if leaderName ~= nil or isDead or unitCount > 0 then return true end - end - return false -end - -function isTeamAlive(teamID) - if teamID == nil then return false end - for _,pID in ipairs (Spring.GetTeamList(teamID)) do - if not teamData[pID]["isDead"] then return true end - end - return false -end - -function getNbTeams() - local nbTeams = 0 - for _,allyID in ipairs (Spring.GetAllyTeamList()) do - if isTeamReal(allyID) then nbTeams = nbTeams + 1 end - end - return nbTeams -end - -function getNbPlayers(teamID) - local nbPlayers = #(Spring.GetTeamList(teamID)) - return nbPlayers -end - -function getMaxPlayers() - local maxPlayers = 0 - local myNum - for _,allyID in ipairs(Spring.GetAllyTeamList()) do - myNum = getNbPlayers(allyID) - if myNum > maxPlayers then maxPlayers = myNum end - end - - return maxPlayers -end - -function getNbActivePlayers(teamID) - local nbPlayers = 0 - local leaderID,active,spectator,isDead, leaderName - - for _,pID in ipairs (Spring.GetTeamList(teamID)) do - leaderID = teamData[pID].leaderID - leaderName = teamData[pID].leaderName - active = teamData[pID].active - spectator = teamData[pID].spectator - isDead = teamData[pID].isDead - if not (spectator or isDead or leaderID == -1) and active then - nbPlayers = nbPlayers +1 - end - end - return nbPlayers -end - -function getNbPlacedPositions(teamID) - local nbPlayers = 0 - local startx, starty, active, leaderID, unitCount, leaderName, isDead - - for _,pID in ipairs (Spring.GetTeamList(teamID)) do - if teamData[pID] == nil then - Echo("getNbPlacedPositions returned nil:",teamID) - return nil - end - leaderID = teamData[pID].leaderID - if leaderID == nil then - Echo("getNbPlacedPositions returned nil:",teamID) - return nil - end - startx = teamData[pID].startx or -1 - starty = teamData[pID].starty or -1 - active = teamData[pID].active - leaderName,active,spectator = Spring.GetPlayerInfo(leaderID) - - isDead = teamData[pID].isDead - if (active and startx >= 0 and starty >= 0 and leaderName ~= nil) or isDead then - nbPlayers = nbPlayers +1 - end - end - return nbPlayers -end - -function checkCommander(pID) - local hasCom = false - for _, commanderID in ipairs (comTable) do - if Spring.GetTeamUnitDefCount(pID,commanderID) > 0 then hasCom = true end - end - return hasCom -end - -function setPlayerFP(pID) - local pFP = 0 - local pFPMob = 0 - - local team = teamData[pID].allyID - for _, unitID in ipairs(Spring.GetTeamUnits(pID)) do - local udid = Spring.GetUnitDefID(unitID) - if udid then - if AttackUnits[udid] and isUnitComplete(unitID) then - pFP = pFP + (Spring.GetUnitHealth(unitID) or 0) - if UnitDefs[udid].canMove then - pFPMob = pFPMob + (Spring.GetUnitHealth(unitID) or 0) - end - end - end - end - teamData[pID]["firepower"] = pFP - teamData[pID]["firepowerMob"] = pFPMob -end - -function setPlayerBP(pID) - local pBP = 0 - local pBPair = 0 - local team = teamData[pID].allyID - - for _, unitID in ipairs(Spring.GetTeamUnits(pID)) do - local udid = Spring.GetUnitDefID(unitID) - if udid then - if BuilderUnits[udid] and isUnitComplete(unitID) then - pBP = pBP + (UnitDefs[udid].buildSpeed or 0) - if UnitDefs[udid].canFly then - pBPair = pBPair + (UnitDefs[udid].buildSpeed or 0) - end - end - end - end - - teamData[pID]["buildpower"] = pBP - teamData[pID]["buildpowerAir"] = pBPair -end - -function setPlayerResources() - local minc, einc - - if inSpecMode then - for _,data in pairs(allyData) do - allyID = data.aID - data["tM"] = 0 - data["tE"] = 0 - for _, teamID in ipairs (Spring.GetTeamList(allyID)) do - if teamID ~= gaiaID then - minc = select(4,Spring.GetTeamResources(teamID,"metal")) or 0 - einc = select(4,Spring.GetTeamResources(teamID,"energy")) or 0 - teamData[teamID]["minc"] = minc - teamData[teamID]["einc"] = einc - data["tM"] = data["tM"] + minc - data["tE"] = data["tE"] + einc - end - end - end - else - local allyID = Spring.GetMyAllyTeamID() - local data = allyData[allyID+1] - data["tM"] = 0 - data["tE"] = 0 - for _, teamID in ipairs (Spring.GetTeamList(allyID)) do - if teamID ~= gaiaID then - minc = select(4,Spring.GetTeamResources(teamID,"metal")) or 0 - einc = select(4,Spring.GetTeamResources(teamID,"energy")) or 0 - teamData[teamID]["minc"] = minc - teamData[teamID]["einc"] = einc - data["tM"] = data["tM"] + minc - data["tE"] = data["tE"] + einc - end - end - end - drawStandard() - drawDynamic() -end - -function setPlayerActivestate() - local active - local leaderID - for tID,data in pairs(teamData) do - _,leaderID = Spring.GetTeamInfo(tID) - _,active = Spring.GetPlayerInfo(leaderID) - data["active"] = active - end -end - -function isUnitComplete(UnitID) - local health,maxHealth,paralyzeDamage,captureProgress,buildProgress=Spring.GetUnitHealth(UnitID) - if buildProgress and buildProgress>=1 then - return true - else - return false - end -end - -function GetSkill(playerID) - local customtable = select(10,Spring.GetPlayerInfo(playerID)) -- player custom table - - if not customtable then return "N/A" end - - local tsMu = customtable.skill - local tsSigma = customtable.skilluncertainty - local tskill = "" - if tsMu then - tskill = tsMu and tonumber(tsMu:match("%d+%.?%d*")) or 0 - tskill = round(tskill,0) - if string.find(tsMu, ")") then - tskill = "\255"..string.char(190)..string.char(140)..string.char(140) .. tskill -- ')' means inferred from lobby rank - else - - -- show privacy mode - local priv = "" - if string.find(tsMu, "~") then -- '~' means privacy mode is on - priv = "\255"..string.char(200)..string.char(200)..string.char(200) .. "*" - end - - --show sigma - if tsSigma then -- 0 is low sigma, 3 is high sigma - tsSigma=tonumber(tsSigma) - local tsRed, tsGreen, tsBlue - if tsSigma > 2 then - tsRed, tsGreen, tsBlue = 190, 130, 130 - elseif tsSigma == 2 then - tsRed, tsGreen, tsBlue = 140, 140, 140 - elseif tsSigma == 1 then - tsRed, tsGreen, tsBlue = 195, 195, 195 - elseif tsSigma < 1 then - tsRed, tsGreen, tsBlue = 250, 250, 250 - end - tskill = priv .. "\255"..string.char(tsRed)..string.char(tsGreen)..string.char(tsBlue) .. tskill - else - tskill = priv .. "\255"..string.char(195)..string.char(195)..string.char(195) .. tskill --should never happen - end - end - else - tskill = "\255"..string.char(160)..string.char(160)..string.char(160) .. "?" - end - return tskill -end - ---------------------------------------------------------------------------------------------------- --- User interface ---------------------------------------------------------------------------------------------------- - -function IsOnButton(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) - if BLcornerX == nil then return false end - -- check if the mouse is in a rectangle - - return x >= BLcornerX and x <= TRcornerX - and y >= BLcornerY - and y <= TRcornerY - -end - -function updateButtons() - - if widgetPosX < 0 then - widgetPosX = 0 - elseif widgetPosX + widgetWidth > vsx then - widgetPosX = vsx-widgetWidth - end - - if widgetPosY < 0 then - widgetPosY = 0 - elseif widgetPosY + widgetHeight > vsy then - widgetPosY = vsy - widgetHeight - end - - widgetRight = widgetPosX + widgetWidth - if widgetPosX + widgetWidth/2 > vsx/2 then - right = true - else - right = false - end - - local drawpos = 0 - - for _, data in pairs(allyData) do - local allyID = data.aID - - if allyID ~= gaiaAllyID then - - local w1 = 14 - local x1, y1, x2, y2 - local nbPlayers = getNbPlayers(allyID) - local maxPlayers = getMaxPlayers() - local lm = 20 - local w = 180 + cW*nbPlayers - - if inSpecMode then - widgetHeight = getNbTeams()*tH+2 - else - widgetHeight = tH+2 - end - - x1 = widgetPosX + 2 - - iPosX[allyID] = InfotablePosX - iPosY[allyID] = InfotablePosY - - if iPosX[allyID] < 0 then iPosX[allyID] = 0 end - if iPosX[allyID] + w > vsx then iPosX[allyID] = vsx - w end - if iPosY[allyID] - infoTableHeight < 0 then iPosY[allyID] = infoTableHeight end - if iPosY[allyID] > vsy then iPosY[allyID] = vsy end - - x2 = x1 + w1 - y1 = widgetPosY + widgetHeight - (drawpos)*tH - w1 - 3 - y2 = y1 + w1 - - --Echo("IB1",allyID,infoButton[allyID]) - - infoButton[allyID]["x1"] = x1 - infoButton[allyID]["y1"] = y1 - infoButton[allyID]["x2"] = x2 - infoButton[allyID]["y2"] = y2 - - --Echo("IB2",allyID,infoButton[allyID].y1) - - local x3, y3, x4, y4 - local w2 = 18 - - local x5, y5, x6, y6 - - x5 = iPosX[allyID] + lm - x6 = iPosX[allyID] + lm + 20 - y6 = iPosY[allyID] - 25 - y5 = y6 - 20 - - expandMove[allyID]["x1"] = x5 - expandMove[allyID]["y1"] = y5 - expandMove[allyID]["x2"] = x6 - expandMove[allyID]["y2"] = y6 - - local x7,x8,x9,x10,y7,y8,y9,y10 - - x7 = iPosX[allyID] + w/2 - 60 - x8 = x7 + 12 - y8 = iPosY[allyID] - 25 - y7 = y8 - 18 - - x9 = iPosX[allyID] + w/2 + 38 - x10 = x9 + 12 - y10 = iPosY[allyID] - 25 - y9 = y10 - 18 - - Teambutton["Prev"][allyID]["x1"] = x7 - Teambutton["Prev"][allyID]["x2"] = x8 - Teambutton["Next"][allyID]["x1"] = x9 - Teambutton["Next"][allyID]["x2"] = x10 - Teambutton["Prev"][allyID]["y1"] = y7 - Teambutton["Prev"][allyID]["y2"] = y8 - Teambutton["Next"][allyID]["y1"] = y9 - Teambutton["Next"][allyID]["y2"] = y10 - end - - for i,tID in ipairs(Spring.GetTeamList(allyID)) do - playerButton[tID]["x1"] = widgetPosX + WBadge*(i-1) + 25 + (WBadge-14)*4 - playerButton[tID]["x2"] = widgetPosX + WBadge*(i-1) + 25 + (WBadge-14)*4 + WBadge - playerButton[tID]["y1"] = widgetPosY + widgetHeight - tH*(drawpos) - 16 - (WBadge-14) - playerButton[tID]["y2"] = widgetPosY + widgetHeight - tH*(drawpos) - 16 - (WBadge-14) + WBadge - playerButton[tID]["pID"] = tID - - if not inSpecMode then - playerButton[tID]["x1"] = widgetPosX + WBadge*(i-1) + 25 + (WBadge-14)*4 - 10 - playerButton[tID]["x2"] = widgetPosX + WBadge*(i-1) + 25 + (WBadge-14)*4 + WBadge - 10 - - end - end - - if isTeamReal(allyID) and (allyID == Spring.GetMyAllyTeamID() or inSpecMode) then - drawpos = drawpos + 1 - end - data["drawpos"] = drawpos - end -end - ---------------------------------------------------------------------------------------------------- --- Call-ins ---------------------------------------------------------------------------------------------------- - -function widget:PlayerChanged(playerID) - local frame = Spring.GetGameFrame() - lastPlayerChange = frame - if not (Spring.GetSpectatingState() or isReplay) then - if inSpecMode then Echo("Ecostats: widget now in active player mode.") end - inSpecMode = false - UpdateTeams() - else - if not inSpecMode then Echo("Ecostats: widget now in spectator mode.") end - inSpecMode = true - Reinit() - end - drawStandard() - drawDynamic() -end - -function widget:UnitFinished(unitID, unitDefID, teamID) - team = teamData[teamID]["allyID"] - if teamID ~= nil and isUnitComplete(unitID) then - --Echo("Unit is finished. Parameters:",unitID, unitDefID, teamID) - UpdateTeam(team) - end -end - -function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - local newteam = teamData[newTeam]["allyID"] - local oldteam = teamData[unitTeam]["allyID"] - if newTeam ~= nil then UpdateTeam(newteam) end - if oldTeam ~= nil then UpdateTeam(oldteam) end -end - -function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - local newteam = teamData[unitTeam]["allyID"] - local oldteam = teamData[oldTeam]["allyID"] - if newTeam ~= nil then UpdateTeam(newteam) end - if oldTeam ~= nil then UpdateTeam(oldteam) end -end - -function widget:UnitDestroyed(u,ud,ut,a,ad,at) --unitID, unitDefID, teamID, attackerID - local uteam, ateam - a = Spring.GetUnitLastAttacker(u) - --Echo("Unit attacker",a) - if a then at = Spring.GetUnitTeam(a) end - if ut then - uteam = teamData[ut]["allyID"] - --Echo("Unit is destroyed!. Parameters:",ut,at) - UpdateTeam(uteam) - end - - if at then - ateam = teamData[at]["allyID"] - --Echo("Unit is destroyed!. Parameters:",ut,at) - UpdateTeam(ateam) - end - - local function sortByLargest(v1,v2) - return v1[2] > v2[2] - end - - local function sortByTeam(v1,v2) - return v1[1] < v2[1] - end - - if ut and at and (not Spring.AreTeamsAllied(ut,at)) and isUnitComplete(u) and u and a and u~=a then - local _,uhp = Spring.GetUnitHealth(u) - --local playerlist = Spring.GetTeamList() - killCounters[at]=killCounters[at]+1 - lossCounters[ut]=lossCounters[ut]+1 - killedHP[at] = killedHP[at] + uhp - lostHP[ut] = lostHP[ut] + uhp - - table.sort(kMat[at],sortByTeam) - - local sortindex = ut + 1 - - kMat[at][sortindex][2] = kMat[at][sortindex][2] + uhp - if kMat[at][sortindex][2] > PmaxDmg then PmaxDmg = kMat[at][sortindex][2] end - - table.sort(kMat[at],sortByLargest) - - if lossCounters[ut]>worstLosses then - worstLosses = lossCounters[ut] - end - if killCounters[at]>bestKills then - bestKills=killCounters[at] - if at~=bestTeam then - bestTeam=at - if options["Announce"]["On"] then - if soundsOn then Spring.PlaySoundFile(snd) end - Spring.SendMessage(friendlyName(bestTeam) .. " has taken the lead with " .. bestKills .. " kills.") - end - end - end - end -end - -function widget:GameStart() - gamestarted = true - UpdateAllPlayers() -end - -function widget:GameOver() - gameover = true - UpdateAllPlayers() -end - -function widget:TeamDied(TeamID) - local frame = Spring.GetGameFrame() - lastPlayerChange = frame - if not (Spring.GetSpectatingState() or isReplay) then - if inSpecMode then Echo("Ecostats: widget now in active player mode.") end - inSpecMode = false - UpdateTeams() - else - if not inSpecMode then Echo("Ecostats: widget now in spectator mode.") end - inSpecMode = true - Reinit() - end -end - -function widget:MapDrawCmd(playerID, cmdType, px, py, pz, labeltext) - if not gamestarted then - UpdateTeams() - drawStandard() - drawDynamic() - end -end - -function widget:TweakMouseMove(x,y,dx,dy,button) - if pressedToMove ~= nil then - if moveStartX == nil then -- move widget on y axis - moveStartX = x - widgetPosX - end - if moveStartY == nil then -- move widget on y axis - moveStartY = y - widgetPosY - end - widgetPosX = widgetPosX + dx - widgetPosY = widgetPosY + dy - - updateButtons() - drawStandard() - drawDynamic() - end -end - -function widget:TweakMousePress(x, y, button) - if button == 1 then - local x0, x1 - - if right then - x0 = widgetPosX-200 - else - x0 = widgetPosX - end - x1 = x0 + 200 + widgetWidth - - if IsOnButton(x, y, options["contrastLess"]["x1"],options["contrastLess"]["y1"],options["contrastLess"]["x2"],options["contrastLess"]["y2"]) then - options["contrast"] = options["contrast"] - 0.1 - if options["contrast"] < 0 then options["contrast"] = 0 end - Echo("Contrast = " .. formatRes1000(options["contrast"])) - return true - elseif IsOnButton(x, y, options["contrastMore"]["x1"],options["contrastMore"]["y1"],options["contrastMore"]["x2"],options["contrastMore"]["y2"]) then - options["contrast"] = options["contrast"] + 0.1 - if options["contrast"] > 1.0 then options["contrast"] = 1.0 end - Echo("Contrast = " .. formatRes1000(options["contrast"])) - return true - - elseif IsOnButton(x, y, options["borders"]["x1"],options["borders"]["y1"],options["borders"]["x2"],options["borders"]["y2"]) then - options["borders"]["On"] = not options["borders"]["On"] - return true - - elseif IsOnButton(x, y, options["widthInc"]["x1"],options["widthInc"]["y1"],options["widthInc"]["x2"],options["widthInc"]["y2"]) then - pressedWPlus = true - widgetWidth = widgetWidth + 5 - if widgetWidth > 500 then widgetWidth = 500 end - if widgetPosX + widgetWidth > vsx then widgetPosX = vsx - widgetWidth end - return true - - elseif IsOnButton(x, y, options["widthDec"]["x1"],options["widthDec"]["y1"],options["widthDec"]["x2"],options["widthDec"]["y2"]) then - pressedWMinus = true - widgetWidth = widgetWidth - 5 - if widgetWidth < 25 then widgetWidth = 25 end - return true - elseif IsOnButton(x, y, options["heightInc"]["x1"],options["heightInc"]["y1"],options["heightInc"]["x2"],options["heightInc"]["y2"]) then - pressedHPlus = true - tH = tH + 2 - if tH > 100 then tH = 100 end - return true - - elseif IsOnButton(x, y, options["heightDec"]["x1"],options["heightDec"]["y1"],options["heightDec"]["x2"],options["heightDec"]["y2"]) then - pressedHMinus = true - tH = tH - 2 - if tH < 4 then tH = 4 end - return true - - elseif IsOnButton(x, y, options["disable"]["x1"],options["disable"]["y1"],options["disable"]["x2"],options["disable"]["y2"]) then - options["disable"]["On"] = not options["disable"]["On"] - return true - elseif IsOnButton(x, y, options["Announce"]["x1"],options["Announce"]["y1"],options["Announce"]["x2"],options["Announce"]["y2"]) then - options["Announce"]["On"] = not options["Announce"]["On"] - return true - elseif IsOnButton(x, y, options["FPBar1"]["x1"],options["FPBar1"]["y1"],options["FPBar1"]["x2"],options["FPBar1"]["y2"]) then - options["FPBar1"]["On"] = not options["FPBar1"]["On"] - return true - elseif IsOnButton(x, y, options["FPBar2"]["x1"],options["FPBar2"]["y1"],options["FPBar2"]["x2"],options["FPBar2"]["y2"]) then - options["FPBar2"]["On"] = not options["FPBar2"]["On"] - return true - elseif IsOnButton(x, y, options["BPBar1"]["x1"],options["BPBar1"]["y1"],options["BPBar1"]["x2"],options["BPBar1"]["y2"]) then - options["BPBar1"]["On"] = not options["BPBar1"]["On"] - return true - elseif IsOnButton(x, y, options["BPBar2"]["x1"],options["BPBar2"]["y1"],options["BPBar2"]["x2"],options["BPBar2"]["y2"]) then - options["BPBar2"]["On"] = not options["BPBar2"]["On"] - return true - elseif IsOnButton(x, y, options["kills1"]["x1"],options["kills1"]["y1"],options["kills1"]["x2"],options["kills1"]["y2"]) then - options["kills1"]["On"] = not options["kills1"]["On"] - return true - elseif IsOnButton(x, y, options["kills2"]["x1"],options["kills2"]["y1"],options["kills2"]["x2"],options["kills2"]["y2"]) then - options["kills2"]["On"] = not options["kills2"]["On"] - return true - elseif IsOnButton(x, y, options["removeDead"]["x1"],options["removeDead"]["y1"],options["removeDead"]["x2"],options["removeDead"]["y2"]) then - options["removeDead"]["On"] = not options["removeDead"]["On"] - return true - elseif IsOnButton(x, y, options["resText"]["x1"],options["resText"]["y1"],options["resText"]["x2"],options["resText"]["y2"]) then - options["resText"]["On"] = not options["resText"]["On"] - return true - elseif IsOnButton(x, y, widgetPosX, widgetPosY, widgetPosX + widgetWidth, widgetPosY + widgetHeight) or - IsOnButton(x, y, x0, widgetPosY - 300, x1, widgetPosY) - then - pressedToMove = true - return true - end -- end Button == 1 - else - return false - end -end - -function widget:TweakMouseRelease(x,y,button) - pressedToMove = nil - pressedHPlus = false - pressedHMinus = false - pressedWPlus = false - pressedWMinus = false -end - -function widget:KeyPress(key, mods, isRepeat) - if (key == 0x132) and (not isRepeat) and not (mods.shift) and (not mods.alt) then -- ctrl - ctrlDown = true - end - return false -end - -function widget:KeyRelease(key) - if (key == 0x132) then -- ctrl - ctrlDown = false - end - return false -end - -function widget:MouseMove(x, y, dx, dy, button) - if pressedExpandMove then - for _,data in pairs (allyData) do - local allyID = data.aID - - if infoButton[allyID]["click"] then nbPlayers = getNbPlayers(allyID) end - end - - local w = 180 + cW*getMaxPlayers() - - InfotablePosX = InfotablePosX + dx - InfotablePosY = InfotablePosY + dy - - if InfotablePosX < 0 then - InfotablePosX = 0 - end - - if InfotablePosX + w > vsx then - InfotablePosX = vsx - w - end - - updateButtons() - setPlayerResources() - drawStandard() - drawDynamic() - return true - end - - if pressedToMove then - if moveStartX == nil then -- move widget on y axis - moveStartX = x - widgetPosX - end - if moveStartY == nil then -- move widget on y axis - moveStartY = y - widgetPosY - end - widgetPosX = widgetPosX + dx - widgetPosY = widgetPosY + dy - - updateButtons() - setPlayerResources() - drawStandard() - drawDynamic() - return true - end - return false -end - -function widget:MousePress(x, y, button) - ---------------- - -- LEFT BUTTON - ---------------- - - if button == 1 then - - local playerlist = Spring.GetTeamList() - local x1, x2, y1, y2 - local pressedExpand = false - local nbPlayers - local x7, y7, x8, y8, pID - local x9, y9, x10, y10 - local x11,x12,x13,x14,y11,y12,y13,y14 - local x15,x16,y15,y16 - - for _,data in pairs (allyData) do - local allyID = data.aID - local allyDataID = allyID+1 - if allyID ~= gaiaAllyID then - nbPlayers = getNbPlayers(allyID) - - -- info-button - x1 = infoButton[allyID]["x1"] - x2 = infoButton[allyID]["x2"] - y1 = infoButton[allyID]["y1"] - y2 = infoButton[allyID]["y2"] - - -- move infotable button - x9 = expandMove[allyID]["x1"] - x10 = expandMove[allyID]["x2"] - y9 = expandMove[allyID]["y1"] - y10 = expandMove[allyID]["y2"] - - -- prev/next allyID - x11 = Teambutton["Prev"][allyID]["x1"] - x12 = Teambutton["Prev"][allyID]["x2"] - y11 = Teambutton["Prev"][allyID]["y1"] - y12 = Teambutton["Prev"][allyID]["y2"] - - x13 = Teambutton["Next"][allyID]["x1"] - x14 = Teambutton["Next"][allyID]["x2"] - y13 = Teambutton["Next"][allyID]["y1"] - y14 = Teambutton["Next"][allyID]["y2"] - - -- infotable coords - x15 = iPosX[allyID] - y16 = iPosY[allyID] - x16 = x15 + 180 + cW*getNbPlayers(allyID) - y15 = y16 - infoTableHeight - - -- info-button - if IsOnButton(x, y, x1, y1, x2, y2) and (not options["removeDead"]["On"] or allyData[allyDataID]["isAlive"]) then - for _,data in pairs (allyData) do - local aID = data.aID - if aID ~= allyID then - infoButton[aID]["click"] = false - end - end - infoButton[allyID]["click"] = not infoButton[allyID]["click"] - drawStandard() - drawDynamic() - return true - end - - -- infotable active - if infoButton[allyID]["click"] then - - -- prev team - if IsOnButton(x, y, x11, y11, x12, y12) and inSpecMode then - if allyID > 0 then - local prevAlly = FindPrevAlly(allyID) - if prevAlly then - infoButton[allyID]["click"] = false - infoButton[prevAlly]["click"] = true - end - drawStandard() - drawDynamic() - return true - end - - -- next team - elseif IsOnButton(x, y, x13, y13, x14, y14) and inSpecMode then - if allyID < getNbTeams() - 1 then - local nextAlly = FindNextAlly(allyID) - if nextAlly then - infoButton[allyID]["click"] = false - infoButton[nextAlly]["click"] = true - end - drawStandard() - return true - end - - -- just move infotable - elseif IsOnButton(x, y, x9, y9, x10, y10) or IsOnButton(x, y, x15, y15, x16, y16) then - pressedExpandMove = true - drawStandard() - drawDynamic() - return true - end - end - end - end - - -- main widget buttons - for _,teamID in ipairs (playerlist) do - if teamID ~= gaiaID and not teamData[teamID].isDead then - local allyID = teamData[teamID].allyID - - if isTeamReal(allyID) and (allyID == Spring.GetMyAllyTeamID() or inSpecMode)then - x7 = playerButton[teamID]["x1"] - x8 = playerButton[teamID]["x2"] - y7 = playerButton[teamID]["y1"] - y8 = playerButton[teamID]["y2"] - - if IsOnButton(x, y, x7, y7, x8, y8) then - if ctrlDown and teamData[teamID].hasCom then - local com - for _, commanderID in ipairs (comTable) do - com = Spring.GetTeamUnitsByDefs(teamID,commanderID)[1] or com - end - - if com then - - local cx, cy, cz - local camState = Spring.GetCameraState() - cx, cy, cz = Spring.GetUnitPosition(com) - - if camState and cx then - camState["px"] = cx - camState["py"] = cy - camState["pz"] = cz - camState["height"] = 800 - Spring.SetCameraState(camState,2) - if inSpecMode then Spring.SelectUnitArray({com}) end - end - end - elseif not ctrlDown then - local sx = teamData[teamID].startx - local sz = teamData[teamID].starty - local sy = Spring.GetGroundHeight(sx,sz) - local camState = Spring.GetCameraState() - if camState and sx and sz and sx > 0 and sz > 0 then - camState["px"] = sx - camState["py"] = sy - camState["pz"] = sz - camState["height"] = 5000 - Spring.SetCameraState(camState,2) - end - end - end - end - end - end - - return false - ---------------- - -- RIGHT BUTTON - ---------------- - elseif button == 2 then - if IsOnButton(x,y,widgetPosX,widgetPosY,widgetPosX+widgetWidth,widgetPosY+widgetHeight) then - pressedToMove = true - return true - end - elseif button == 3 then - local x5, y5, x6, y6 - local w - - for _,data in pairs (allyData) do - local allyID = data.aID - - if allyID ~= gaiaAllyID then - w = 180 + cW*getNbPlayers(allyID) - - x5 = iPosX[allyID] - x6 = x5 + w - y6 = iPosY[allyID] - y5 = y6 - infoTableHeight - - - if infoButton[allyID]["click"] then - if IsOnButton(x, y, x5, y5, x6, y6) then - infoButton[allyID]["click"] = false - drawStandard() - drawDynamic() - return true - end - end - end - end - - -- second loop is needed for drag detection, because otherwise it returns true too soon - for _,data in pairs (allyData) do - local allyID = data.aID - if IsOnButton(x,y,widgetPosX,widgetPosY,widgetPosX+widgetWidth,widgetPosY+widgetHeight) then - pressedToMove = true - drawStandard() - drawDynamic() - return true - else - return false - end - end - else - return false - end -end - -function widget:MouseRelease(x,y,button) - if button == 1 then - pressedExpandMove = false - elseif button == 2 or button == 3 then - pressedToMove = nil -- ends move action - end -end - -function widget:IsAbove(x, y) - local allyList = Spring.GetAllyTeamList() - local playerlist = Spring.GetTeamList() - local x1, x2, y1, y2 - local x3, x4, y3, y4 - local x5, x6, y5, y6 - local x7, x8, y7, y8 - local x9, x10, y9, y10 - local x11, x12, y11, y12 - local w = 180 + cW*getMaxPlayers() - local speed,_,paused = Spring.GetGameSpeed() - - --player faction button - for _,teamID in ipairs (playerlist) do - if teamID ~= gaiaID then - x5 = playerButton[teamID]["x1"] - x6 = playerButton[teamID]["x2"] - y5 = playerButton[teamID]["y1"] - y6 = playerButton[teamID]["y2"] - - playerButton[teamID]["mouse"] = IsOnButton(x, y, x5, y5, x6, y6) - - if IsOnButton(x,y, x5,y5,x6,y6) then - if (not paused) and speed < LIMITSPEED and (not isReplay) then - drawDynamic() - end - return true - end - end - end - - --team infobutton - for _,allyID in ipairs (allyList) do - if allyID ~= gaiaAllyID then - - x1 = infoButton[allyID]["x1"] - x2 = infoButton[allyID]["x2"] - y1 = infoButton[allyID]["y1"] - y2 = infoButton[allyID]["y2"] - infoButton[allyID]["mouse"] = IsOnButton(x, y, x1, y1, x2, y2) - - if IsOnButton(x, y, x1, y1, x2, y2) then - if (not paused) and speed < LIMITSPEED and (not isReplay) then - drawDynamic() - end - return true - end - if infoButton[allyID]["click"] then - -- move expand table button - x7 = expandMove[allyID]["x1"] - x8 = expandMove[allyID]["x2"] - y7 = expandMove[allyID]["y1"] - y8 = expandMove[allyID]["y2"] - expandMove[allyID]["mouseover"] = IsOnButton(x, y, x7, y7, x8, y8) - - if IsOnButton(x, y, x7, y7, x8, y8) then - if (not paused) and speed < LIMITSPEED and (not isReplay) then - drawDynamic() - end - return true - end - - --next/prev team - x9 = Teambutton["Prev"][allyID]["x1"] - x10 = Teambutton["Prev"][allyID]["x2"] - y9 = Teambutton["Prev"][allyID]["y1"] - y10 = Teambutton["Prev"][allyID]["y2"] - - Teambutton["Prev"][allyID]["mouse"] = IsOnButton(x, y, x9, y9, x10, y10) - - if IsOnButton(x, y, x9, y9, x10, y10) then - if (not paused) and speed < LIMITSPEED and (not isReplay) then - drawDynamic() - end - return true - end - - x11 = Teambutton["Next"][allyID]["x1"] - x12 = Teambutton["Next"][allyID]["x2"] - y11 = Teambutton["Next"][allyID]["y1"] - y12 = Teambutton["Next"][allyID]["y2"] - Teambutton["Next"][allyID]["mouse"] = IsOnButton(x, y, x11, y11, x12, y12) - - if IsOnButton(x, y, x11, y11, x12, y12) then - if (not paused) and speed < LIMITSPEED and (not isReplay) then - drawDynamic() - end - return true - end - end - end - end - - for _,allyID in ipairs (allyList) do - if allyID ~= gaiaAllyID then - if IsOnButton(x,y, InfotablePosX, InfotablePosY-infoTableHeight, InfotablePosX + w, InfotablePosY) and infoButton[allyID]["click"] then - iPanel[allyID] = true - else - iPanel[allyID] = false - end - end - end - - return false -end - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx,vsy = gl.GetViewSizes() - Reinit() -end - -function FindNextAlly(allyID) - - local allyDataID = allyID+1 - for i=allyDataID,#allyData do - if allyData[i+1] then return i end - end - return false -end - -function FindPrevAlly(allyID) - - local allyDataID = allyID+1 - for i=allyDataID,1,-1 do - if allyData[i-1] then return i-2 end - end - return false -end - - ---------------------------------------------------------------------------------------------------- --- Draw ---------------------------------------------------------------------------------------------------- - -function drawDynamic() - - if (drawListDynamic) then gl.DeleteList(drawListDynamic) end - - -- - - local function drawFunction() - - local t = Spring.GetGameSeconds() - - for _, data in pairs(allyData) do - local aID = data.aID - local drawpos = data.drawpos - - if isTeamReal(aID) and (aID == Spring.GetMyAllyTeamID() or inSpecMode) and aID ~= gaiaAllyID then - - local posy = tH*(drawpos) - local label, isAlive, hasCom - - -- Infobutton - if not infoButton[aID]["click"] then - DrawInfoButton(aID, infoButton[aID]["mouse"],right,false) - else - DrawInfoButton(aID, infoButton[aID]["mouse"],right,true) - end - - -- Expand table border and buttons - if infoButton[aID]["click"] then - DrawExpandTableBorders(aID) - DrawExpandTableButtons(aID) - end - - local teamList = Spring.GetTeamList(aID) - - -- Player faction images - for i, tID in ipairs (teamList) do - if tID ~= gaiaID then - - local tData = teamData[tID] - local r = tData.red or 1 - local g = tData.green or 1 - local b = tData.blue or 1 - local alpha, sideImg - local side = tData.side - local posx = WBadge*(i-1) - - sideImg = images[side] or images["default"] - - data["isAlive"] = not tData.isDead - hasCom = tData.hasCom - - if Spring.GetGameSeconds() > 0 then - if not tData.isDead then - if tData.active then - alpha = 1 - else - alpha = 0.3 - end - - if hasCom then - DrawSideImage(sideImg,posx,posy, r, g, b,alpha,false,playerButton[tID]["mouse"],t, false)--big icon - else - DrawSideImage(sideImg,posx,posy, r, g, b,alpha,true,playerButton[tID]["mouse"],t, false) --small icon - end - else - sideImg = images["dead"] - DrawSideImage(sideImg,posx,posy, r, g, b,alpha,true,playerButton[tID]["mouse"],t, true) --dead, big icon - end - else - DrawBox( posx, posy, r, g, b) - end - end - end - end - end - end - - -- - - drawListDynamic = gl.CreateList(drawFunction) -end - -function drawStandard() - - if (drawList) then gl.DeleteList(drawList) end - - local function drawFunction() - - local maxMetal = 0 - local maxEnergy = 0 - local maxFP = 0 - local maxBP = 0 - local maxHP = 0 - local splits - - - if not gamestarted then updateButtons() end - - for _, data in pairs(allyData) do - local aID = data.aID - - if isTeamReal(aID) and (aID == Spring.GetMyAllyTeamID() or inSpecMode) and aID ~= gaiaAllyID then - - -- Expanded table - if infoButton[aID]["click"] then - --Echo("ET:",aID) - DrawExpandTable(aID) - end - - if data["tM"] and data["tM"] > maxMetal then - maxMetal = data["tM"] - end - if data["tE"] and data["tE"] > maxEnergy then - maxEnergy = data["tE"] - end - if data["tFP"] and data["tFP"] > maxFP then - maxFP = data["tFP"] - end - if data["tBP"] and data["tBP"] > maxBP then - maxBP = data["tBP"] - end - if data["killedhp"] and data["killedhp"] > maxHP then - maxHP = data["killedhp"] - end - if data["losthp"] and data["losthp"] > maxHP then - maxHP = data["losthp"] - end - end - end - - splits = math.floor(0.001*maxHP/widgetWidth) - - for _, data in pairs(allyData) do - local aID = data.aID - local drawpos = data.drawpos - - if isTeamReal(aID) and (aID == Spring.GetMyAllyTeamID() or inSpecMode) and aID ~= gaiaAllyID then - - local posy = tH*(drawpos) - if data["isAlive"] then DrawBackground(posy) end - - local t = Spring.GetGameSeconds() - if data["isAlive"] and t > 5 and gamestarted and not gameover then - DrawEBar(data["tE"]/maxEnergy,posy) - DrawEText(data["tE"],posy) - DrawKillDeathText(data["kills"],data["losses"],posy) - DrawKillBar(data["killedhp"],posy,splits) - DrawLossesBar(data["losthp"],posy,splits) - else - if gamestarted and t < 5 then - DrawLabelCT("(Go!)", posy,t) - elseif not gamestarted then - setPlayerActivestate() - local nbPlayers = getNbPlayers(aID) - local nbActive = getNbActivePlayers(aID) - local nbPlaced = getNbPlacedPositions(aID) - if nbActive > 0 then - if nbPlayers > 1 and nbPlaced > 0 then - DrawLabelCM("(On their marks)", posy) - DrawLabelCM2(table.concat({" ",nbPlaced,"/",nbPlayers}), posy) - elseif nbPlayers > 1 then - DrawLabelC("(Warming up)", posy) - elseif nbPlayers == 1 then - if nbPlaced == 1 then - DrawLabelCM("(On his marks)", posy) - else - DrawLabelC("(Warming up)", posy) - end - end - else - DrawLabelC("(No one here)", posy) - end - end - end - if data["isAlive"] and t > 5 and not gameover then - DrawMBar(data["tM"]/maxMetal,posy) - DrawMText(data["tM"],posy) - end - if data["tFP"] and data["tFP"] > 0 and not gameover then - DrawFPBar(data["tFP"]/maxFP,posy,data["tFPM"]/data["tFP"]) - end - if data["tBP"] and data["tBP"] > 0 and not gameover then - DrawBPBar(data["tBP"]/maxBP,posy,data["tBPA"]/data["tBP"]) - end - end - end - end - - drawList = gl.CreateList(drawFunction) -end - -function widget:TweakDrawScreen() - DrawOptionRibbon() - updateButtons() - drawStandard() - drawDynamic() -end - -function widget:DrawScreen() - - if Spring.IsGUIHidden() or (not inSpecMode and options["disable"]["On"]) then return end - - if not drawList then drawStandard() end - if not drawListDynamic then drawDynamic() end - - gl.PushMatrix() - gl.CallList(drawList) - gl.CallList(drawListDynamic) - gl.PopMatrix() - -end - -function widget:Update() - speed,_,paused = Spring.GetGameSpeed() - - if paused or (isReplay and speed < LIMITSPEED) then - drawDynamic() - end - - if not gamestarted then - drawStandard() - end -end - -function widget:GameFrame(frameNum) - - if frameNum < 5 * 30 then - drawStandard() - drawDynamic() - end - - if frameNum%32 == 0 then - updateButtons() - UpdateTeams() - setPlayerResources() - drawStandard() - drawDynamic() - end - - if frameNum - lastPlayerChange == 30 then - UpdateTeams() - updateButtons() - end - - if not gamestarted and frameNum > 0 then gamestarted = true end -end - -function DrawEText(numberE, vOffset) - if options["resText"]["On"] then - local label = table.concat({"+",formatRes(numberE)}) - myFont:Begin() - myFont:SetTextColor({1, 1, 0, 1}) - myFont:Print(label, widgetPosX + widgetWidth - 10, widgetPosY + widgetHeight -vOffset+tH-42,textsize,'rs') - myFont:End() - end -end - -function DrawMText(numberM, vOffset) - if options["resText"]["On"] then - local label = table.concat({"+",formatRes(numberM)}) - myFont:Begin() - myFont:SetTextColor({0.8,0.8,0.8,1}) - myFont:Print(label, widgetPosX + widgetWidth - 10, widgetPosY + widgetHeight -vOffset+tH-30,textsize,'rs') - myFont:End() - end -end - -function DrawEBar(tE,vOffset)-- where tE = team Energy = [0,1] - --Echo("Drawing E Bar:",tE) - local dx = 15 - local dy = tH-35 - gl.Color(0.3,0.3,0.3) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-1 - ) - gl.Color(1,1,0) --yellow 1 - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-1, - widgetPosX + dx + tE * (widgetWidth/2-5), - widgetPosY + widgetHeight -vOffset+dy-3 - ) - gl.Color(1,0.5,0) --yellow 2 - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-3, - widgetPosX + dx + tE * (widgetWidth/2-5), - widgetPosY + widgetHeight -vOffset+dy-4 - ) - gl.Color(0.3,0.3,0.3) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-4, - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Rect( - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx-4 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Rect( - widgetPosX + dx-1, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Color(1,1,1,1) -end - -function DrawMBar(tM,vOffset) -- where tM = team Metal = [0,1] - local dx = 15 - local dy = tH-25 - gl.Color(0.3,0.3,0.3) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-1 - ) - gl.Color(0.8,0.8,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-1, - widgetPosX + dx + tM * (widgetWidth/2-5), - widgetPosY + widgetHeight -vOffset+dy-3 - ) - gl.Color(0.6,0.6,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-3, - widgetPosX + dx + tM * (widgetWidth/2-5), - widgetPosY + widgetHeight -vOffset+dy-4 - ) - gl.Color(0.3,0.3,0.3) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-4, - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Rect( - widgetPosX + dx-5 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx-4 + widgetWidth/2, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Rect( - widgetPosX + dx-1, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy-5 - ) - gl.Color(1,1,1) -end - -function DrawFPBar(tFP,vOffset,sM)-- where tFP = team Firepower = [0,1] - if inSpecMode then - if not options["FPBar2"]["On"] then return end - else - if not options["FPBar1"]["On"] then return end - end - - local dx = 3 - local dy = tH-45 - local h = 22 - gl.Color(0.3,0.3,0.3) - gl.Rect(widgetPosX+dx-1, widgetPosY + widgetHeight -vOffset + dy + h + 1,widgetPosX+dx+7,widgetPosY + widgetHeight -vOffset + dy + h) - gl.Rect(widgetPosX+dx-1, widgetPosY + widgetHeight -vOffset + dy-1,widgetPosX+dx+7,widgetPosY + widgetHeight -vOffset + dy) - gl.Color(0,0,0) --blue 1 - gl.Rect( - widgetPosX+dx+1, - widgetPosY + widgetHeight -vOffset + dy, - widgetPosX + dx + 2, - widgetPosY + widgetHeight -vOffset + dy+ (1-sM)*tFP * h - ) - gl.Color(0,0.2,0.4) --blue 2 - gl.Rect( - widgetPosX+dx+2, - widgetPosY + widgetHeight -vOffset + dy, - widgetPosX + dx + 3, - widgetPosY + widgetHeight -vOffset + dy + (1-sM)*tFP * h - ) - gl.Color(0,0.4,0.8) -- violet 1 - gl.Rect( - widgetPosX+dx+1, - widgetPosY + widgetHeight -vOffset + dy + (1-sM)*tFP * h, - widgetPosX + dx + 2, - widgetPosY + widgetHeight -vOffset + dy+ tFP * h - ) - gl.Color(0,0.4,1) -- violet 2 - gl.Rect( - widgetPosX+dx+2, - widgetPosY + widgetHeight -vOffset + dy + (1-sM)*tFP * h, - widgetPosX + dx + 3, - widgetPosY + widgetHeight -vOffset + dy + tFP * h - ) - gl.Color(1,1,1) -end - -function DrawBPBar(tBP,vOffset,sA)-- where tE = team Buildpower = [0,1] - if inSpecMode then - if not options["BPBar2"]["On"] then return end - else - if not options["BPBar1"]["On"] then return end - end - - local dx = 7 - local dy = tH-45 - local h = 22 - gl.Color(0.3,0.3,0.3) - gl.Rect( - widgetPosX+dx-1, - widgetPosY + widgetHeight -vOffset + dy + h + 1, - widgetPosX+dx+7, - widgetPosY + widgetHeight -vOffset + dy + h - ) - gl.Rect( - widgetPosX+dx-1, - widgetPosY + widgetHeight -vOffset + dy-1, - widgetPosX+dx+7, - widgetPosY + widgetHeight -vOffset + dy - ) - gl.Color(0,0.8,0) -- green 1 - gl.Rect( - widgetPosX+dx+1, - widgetPosY + widgetHeight -vOffset + dy, - widgetPosX + dx + 2, - widgetPosY + widgetHeight -vOffset + dy + (1-sA) * tBP * h - ) - gl.Color(0,0.8,0.3) --green 2 - gl.Rect( - widgetPosX+dx+2, - widgetPosY + widgetHeight -vOffset + dy, - widgetPosX + dx + 3, - widgetPosY + widgetHeight -vOffset + dy + (1-sA) * tBP * h - ) - gl.Color(1,1,0) -- yellow 1 - gl.Rect( - widgetPosX+dx+1, - widgetPosY + widgetHeight -vOffset + dy + (1-sA) * tBP * h, - widgetPosX + dx + 2, - widgetPosY + widgetHeight -vOffset + dy+ tBP * h - ) - gl.Color(0.3,1,0) --yellow 2 - gl.Rect( - widgetPosX+dx+2, - widgetPosY + widgetHeight -vOffset + dy + (1-sA) * tBP * h, - widgetPosX + dx + 3, - widgetPosY + widgetHeight -vOffset + dy + tBP * h - ) - gl.Color(0.3,0.3,0.3) - gl.Color(1,1,1) -end - -function DrawKillBar(killedhp,vOffset,splits) -- where killedHP = abs. number - local dx = 1 - local dy = 1 - local len = 0.001*killedhp/(splits+1) - - gl.Color(0,0.3,0.9,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy+1, - widgetPosX + dx + len, - widgetPosY + widgetHeight -vOffset+dy - ) - gl.Color(0,0.2,0.5,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx + len, - widgetPosY + widgetHeight -vOffset+dy-1 - ) - gl.Color(1,1,1,1) -end - -function DrawLossesBar(losthp,vOffset,splits) - local dx = 1 - local dy = -1 - local len = 0.001*losthp/(splits+1) - - gl.Color(0.6,0.2,0.2,0.8) -- (1,0,0.3,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy+1, - widgetPosX + dx + len, - widgetPosY + widgetHeight -vOffset+dy - ) - gl.Color(0.3,0.1,0.1,0.8) -- (0.6,0,0.4,0.8) - gl.Rect( - widgetPosX + dx, - widgetPosY + widgetHeight -vOffset+dy, - widgetPosX + dx + len, - widgetPosY + widgetHeight -vOffset+dy-1 - ) - gl.Color(1,1,1,1) -end - -function DrawKillDeathText(kills, losses, vOffset) - if inSpecMode then - if not options["kills2"]["On"] then return end - else - if not options["kills1"]["On"] then return end - end - --Echo("K/L:",kills, losses, vOffset) - local dx = 6 - local dy = 68 - --local len = 1+math.floor(1+math.log(kills+1)+math.log(losses+1)) - local len = 7 * #(tostring(losses)) - local len2 = 7 * #(tostring(kills))+len - gl.Color(0.8,1,0.8,1) - if kills > 0 then glText(kills, widgetPosX + widgetWidth - 15 - dx - len2, widgetPosY + widgetHeight -vOffset+tH-dy+2,textsize) end - gl.Color(0.85,0.85,0.85,0.85) - if kills > 0 and losses > 0 then glText("/", widgetPosX + widgetWidth - 10 - dx - len, widgetPosY + widgetHeight -vOffset+tH-dy+2,textsize) end - gl.Color(1,0.8,0.8,1) - if losses > 0 then glText(losses, widgetPosX + widgetWidth - dx - len, widgetPosY + widgetHeight -vOffset+tH-dy+2,textsize) end - gl.Color(1,1,1,1) -end - -function DrawBackground(posY) - local y1 = widgetPosY - posY + widgetHeight - 1 - local y2 = widgetPosY - posY + tH + widgetHeight - 1 - gl.Color(0,0,0,options["contrast"]) - gl.Rect(widgetPosX,y1, widgetPosX + widgetWidth, y2) - if options["borders"]["On"] then - gl.Color(0,0,0,1) - gl.Rect(widgetPosX,y1 -1 , widgetPosX + widgetWidth, y1) --bottom - gl.Rect(widgetPosX,y2 - 1, widgetPosX + widgetWidth, y2) --top - gl.Rect(widgetPosX , y1-1, widgetPosX + 1, y2 - 1) --left - gl.Rect(widgetPosX + widgetWidth - 1, y1-1, widgetPosX + widgetWidth, y2 - 1)--right - end - - gl.Color(1,1,1,1) -end - -function DrawExpandTableBorders(teamID) - - local x1, x2, y1, y2 - local w = 180 + cW*getNbPlayers(teamID) -- infotable width - x1 = iPosX[teamID] - y2 = iPosY[teamID] - x2 = x1 + w - y1 = y2 - infoTableHeight - - if iPanel[teamID] then - gl.Color(0,0,0,1) -- highlight borders - else - gl.Color(0.3,0.3,0.3,1) - end - - gl.Rect(x1, y1-1, x2, y1) -- lower - gl.Rect(x1, y2, x2, y2+1) --upper - gl.Rect(x1-1, y1, x1, y2) --left - gl.Rect(x2, y1, x2+1, y2-1) --right -end - -function DrawExpandTableButtons(teamID) - - if expandMove[teamID]["mouseover"] then - gl.Color(1,1,1,1) - else - gl.Color(0.5,0.5,0.8,0.7) - end - - gl.Texture(images["move"]) - gl.TexRect(expandMove[teamID]["x1"], expandMove[teamID]["y1"] , expandMove[teamID]["x2"], expandMove[teamID]["y2"]) - gl.Texture(false) - - if Teambutton["Next"][teamID]["mouse"] then - if teamID < getNbTeams() - 1 and inSpecMode then - gl.Color(0.7,0.9,1,1) - else - gl.Color(1,0.7,0.7,1) - end - else - gl.Color(0.5,0.5,0.8,0.7) - end - - gl.Texture(images["arrowright"]) - gl.TexRect(Teambutton["Next"][teamID]["x1"], Teambutton["Next"][teamID]["y1"] , Teambutton["Next"][teamID]["x2"], Teambutton["Next"][teamID]["y2"]) - gl.Texture(false) - - if Teambutton["Prev"][teamID]["mouse"] then - if teamID > 0 and inSpecMode then - gl.Color(0.7,0.9,1,1) - else - gl.Color(1,0.7,0.7,1) - end - else - gl.Color(0.5,0.5,0.8,0.7) - end - - gl.Texture(images["arrowleft"]) - gl.TexRect(Teambutton["Prev"][teamID]["x1"], Teambutton["Prev"][teamID]["y1"] , Teambutton["Prev"][teamID]["x2"], Teambutton["Prev"][teamID]["y2"]) - gl.Texture(false) -end - -function DrawExpandTable(teamID) - - local nbTeams = getNbTeams() - local nbPlayers = getNbPlayers(teamID) - if nbPlayers > 5 then cW = 90 end - if nbPlayers > 8 then cW = 80 end - - local lm = 20 -- left margin - local rm = 35 --right margin - local dy = 35 -- top margin - local w = 180 + cW*nbPlayers -- infotable width - local j - local rs = 18 --row spacing - local hBar = 40 -- bottom bar height - local x1, y1, x2, y2 - local clr = {0.8, 0.8, 0.9 ,1} - - local posX = iPosX[teamID] - local posY = iPosY[teamID] - - local splits = math.floor(0.004*PmaxDmg/hBar) - local scale = splits*250 - - x1 = posX - y2 = posY - x2 = x1 + w - y1 = y2 - infoTableHeight - -------------- - -- Background -- - -------------- - gl.Texture(false) - - local hasCom - local active - local mycomlbl - local myactlbl - local r,b,g,s1, s2, s3, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17,s18, s19, rank, sStatus - - - gl.Color(0.1,0.1,0.1,0.85) - gl.Rect(x1, y1, x2, y2) - - local teamlbl = table.concat({"Team ",tostring(teamID)}) - - myFontBig:Begin() - myFontBig:SetTextColor({0.8,0.8,1,0.4}) - myFontBig:Print(teamlbl, posX + w/2 -30, posY - 38,textlarge,'o') - myFontBig:End() - - -------------- - -- Headings -- - ------------- - myFont:Begin() - myFont:SetTextColor({0.5,0.5,0.8,1}) - myFont:Print("Player:", posX + lm, posY - dy - 10 - 1*rs,textsize) - myFont:Print("Commander:", posX + lm, posY - dy - 10- 2*rs,textsize) - myFont:Print("Units:", posX + lm, posY - dy - 10 - 3*rs,textsize) - myFont:Print("Metal:", posX + lm, posY - dy - 10 - 4*rs,textsize) - myFont:Print("Energy:", posX + lm, posY - dy - 10 - 5*rs,textsize) - myFont:Print("Firepower:", posX + lm, posY - dy - 10 - 6*rs,textsize) - myFont:Print(".....mobile:", posX + lm, posY - dy - 5 - 7*rs,textsize) - myFont:Print("Buildpower:", posX + lm, posY - dy - 10 - 8*rs,textsize) - myFont:Print(".......air:", posX + lm, posY - dy - 5 - 9*rs,textsize) - myFont:Print("Kills:", posX + lm, posY - dy - 10 - 10*rs,textsize) - myFont:Print("Losses:", posX + lm, posY - dy - 10 - 11*rs,textsize) - myFont:Print("Killed HP:", posX + lm, posY - dy - 10 - 12*rs,textsize) - myFont:Print("Lost HP:", posX + lm, posY - dy - 10 - 13*rs,textsize) - myFont:Print("Active:", posX + lm, posY - dy - 10 - 14*rs,textsize) - myFont:Print("Faction:", posX + lm, posY - dy - 10 - 16*rs,textsize) - myFont:Print("Country:", posX + lm, posY - dy - 10 - 17*rs,textsize) - myFont:Print("Rank:", posX + lm, posY - dy - 10 - 18*rs,textsize,textsize) - myFont:Print("Skill:", posX + lm, posY - dy - 10 - 19*rs,textsize,textsize) - myFont:SetTextColor({0.4,0.4,0.2,1}) - myFont:Print("Kills:", posX + lm, posY - dy - 10 - 24*rs,textsize) - myFont:Print("0 HP", posX + 100, posY - dy - 10 - 24*rs - 2,textsize) - local s0 = table.concat({formatRes1000((1+splits)*hBar/4) or ""," kHP"}) - myFont:Print(s0, posX + 135 - #s0*7, posY - dy - 10 - 24*rs + hBar-2,textsize) - myFont:SetTextColor({0.5,0.5,0.8,0.3}) - myFont:Print("(Right-click to close)", posX + lm, posY - dy - 26*rs,textsize) - myFont:End() - --gl.Color(0.5,0.5,0.8,1) - - for i, pID in ipairs (Spring.GetTeamList(teamID)) do - j = nbPlayers - i - ------------ - -- Values -- - ------------ - r = teamData[pID].red - g = teamData[pID].green - b = teamData[pID].blue - - if r ~= nil then - local luminance = (r * 0.299) + (g * 0.587) + (b * 0.114) - if (luminance < 0.3) then - r = r + 0.2 - g = g + 0.2 - b = b + 0.2 - end - end - s1 = teamData[pID]["leaderName"] or "(Retired)" - if #s1 > cW/7 and nbPlayers > 1 then s1 = string.sub(s1,1,math.floor(cW/7)) end - s3 = tostring(teamData[pID]["unitCount"]) or "" - hasCom = teamData[pID]["hasCom"] - s5 = table.concat({"+", formatRes1000(teamData[pID]["minc"]) or ""}) - s6 = table.concat({"+", formatRes1000(teamData[pID]["einc"]) or ""}) - s7 = formatRes1000(teamData[pID]["firepower"]) or "" - if teamData[pID]["firepower"] > 0 then - s8 = table.concat({formatRes1000(100*(teamData[pID]["firepowerMob"]/teamData[pID]["firepower"])) or "","%"}) - else - s8 = "" - end - s9 = formatRes1000(teamData[pID]["buildpower"]) - if teamData[pID]["firepower"] > 0 then - s10 = table.concat({formatRes1000(100*(teamData[pID]["buildpowerAir"]/teamData[pID]["buildpower"]))or "","%"}) - else - s10 = "" - end - s11 = tostring(teamData[pID]["kills"]) - s12 = tostring(teamData[pID]["losses"]) - s13 = formatRes1000(teamData[pID]["killedhp"]) or "" - s14 = formatRes1000(teamData[pID]["losthp"]) or "" - active = teamData[pID]["active"] - s16 = firstToUpper(teamData[pID]["side"] or "") - s17 = string.upper(teamData[pID]["country"] or "") - rank = teamData[pID]["rank"] - if rank == 0 then - s18 = "Enlisted" - elseif rank == 1 then - s18 = "2nd Lieut." - elseif rank == 2 then - s18 = "Lieutenant" - elseif rank == 3 then - s18 = "Captain" - elseif rank == 4 then - s18 = "Major" - elseif rank == 5 then - s18 = "Lt.Colonel" - elseif rank == 6 then - s18 = "Colonel" - elseif rank == 7 then - s18 = "Brigadier" - elseif rank == 8 then - s18 = "Maj.General" - else - s18 = "" - end - s19 = teamData[pID]["skill"] - - ------------------ - -- Print values -- - ------------------ - myFont:Begin() - myFont:SetTextColor({r,g,b,1}) - myFont:Print(s1, posX + w - rm - j*cW, posY - dy - 10 - 1*rs,textsize,'r') - myFont:SetTextColor(clr) - if hasCom then - s2 = "Yes" - myFont:SetTextColor({0.7,1,0.7,1}) - else - s2 = "No" - myFont:SetTextColor({1,0.7,0.7,1}) - end - - myFont:Print(s2, posX + w - rm - j*cW, posY - dy - 10 - 2*rs,textsize,'r') - myFont:SetTextColor(clr) - if (teamData[pID]["isDead"]) then myFont:SetTextColor({0.5,0.5,0.5,0.8}) end - myFont:Print(s3, posX + w - rm - j*cW, posY - dy - 10 - 3*rs,textsize,'r') - myFont:SetTextColor({0.8,0.8,1,1}) - myFont:Print(s5, posX + w - rm - j*cW, posY - dy - 10 - 4*rs,textsize,'r') - myFont:SetTextColor({1,1,0,1}) - myFont:Print(s6, posX + w - rm - j*cW, posY - dy - 10 - 5*rs,textsize,'r') - myFont:SetTextColor(clr) - myFont:Print(s7, posX + w - rm - j*cW, posY - dy - 10 - 6*rs,textsize,'r') - myFont:Print(s8, posX + w - rm + 7 - j*cW, posY - dy - 5 - 7*rs,textsize,'r') - myFont:SetTextColor(clr) - myFont:Print(s9, posX + w - rm - j*cW, posY - dy - 10 - 8*rs,textsize,'r') - myFont:Print(s10, posX + w - rm + 7 - j*cW, posY - dy - 5 - 9*rs,textsize,'r') - myFont:SetTextColor(clr) - myFont:Print(s11, posX + w - rm - j*cW, posY - dy - 10 - 10*rs,textsize,'r') - myFont:Print(s12, posX + w - rm - j*cW, posY - dy - 10 - 11*rs,textsize,'r') - myFont:Print(s13, posX + w - rm - j*cW, posY - dy - 10 - 12*rs,textsize,'r') - myFont:Print(s14, posX + w - rm - j*cW, posY - dy - 10 - 13*rs,textsize,'r') - if active then - s15 = "Yes" - myFont:SetTextColor({0.7,1,0.7,1}) - else - s15 = "No" - myFont:SetTextColor({1,0.7,0.7,1}) - end - myFont:Print(s15, posX + w - rm - j*cW, posY - dy - 10 - 14*rs,textsize,'r') - myFont:SetTextColor(clr) - myFont:Print(s16, posX + w - rm - j*cW, posY - dy - 10 - 16*rs,textsize,'r') - myFont:Print(s17, posX + w - rm - j*cW, posY - dy - 10 - 17*rs,textsize,'r') - myFont:Print(s18, posX + w - rm - j*cW, posY - dy - 10 - 18*rs,textsize,'r') - myFont:Print(s19, posX + w - rm - j*cW, posY - dy - 10 - 19*rs,textsize,'r') - - if gamestarted then - if not teamData[pID]["active"] and teamData[pID]["unitCount"] > 0 then - myFont:SetTextColor({0.5,0.5,0.8,1}) - sStatus = "[MIA]" - elseif teamData[pID]["isDead"] then - myFont:SetTextColor({0.5,0.1,0.1,1}) - sStatus = "[KIA]" - else - myFont:SetTextColor({0.7,1,0.7,1}) - sStatus = "" - end - else - if not teamData[pID]["active"] then - myFont:SetTextColor({0.3,0.3,0.6,1}) - sStatus = "(Not here)" - elseif teamData[pID]["startx"] > 0 and teamData[pID]["starty"] > 0 then - myFont:SetTextColor({0.5,0.5,0.8,1}) - sStatus = "(Marked)" - elseif teamData[pID]["startx"] == -100 and teamData[pID]["starty"] == -100 then - myFont:SetTextColor({0.4,0.4,0.7,1}) - sStatus = "(Warming up)" - else - sStatus = "" - end - end - myFont:Print(sStatus, posX + w - rm - j*cW, posY - dy - 20 - 20*rs,textsize,'r') - myFont:End() - - for rank,_ in ipairs(Spring.GetTeamList()) do -- first player id in matrix is ranking, since table is sorted by most kills - if rank < 16 then - local r2,g2,n2,r3,g3,b3,r4,g4,b4 - local xi, yi, hi - local enemy = kMat[pID][rank][1] -- the associated player with rank is the actual player id that we want to plot - - if enemy ~= gaiaID then - r2 = teamData[enemy].red or 0 - g2 = teamData[enemy].green or 0 - b2 = teamData[enemy].blue or 0 - else - r2,g2,b2 = 1,1,1 - end - - local luminance = (r2 * 0.299) + (g2 * 0.587) + (b2 * 0.114) - - if luminance > 0.3 then - r3 = r2 - 0.25 * luminance - r4 = r3 - 0.25 * luminance - g3 = g2 - 0.25 * luminance - g4 = g3 - 0.25 * luminance - b3 = b2 - 0.25 * luminance - b4 = b3 - 0.25 * luminance - else - r3 = r2 + 0.5 * luminance - r4 = r3 + 0.5 * luminance - g3 = g2 + 0.5 * luminance - g4 = g3 + 0.5 * luminance - b3 = b2 + 0.5 * luminance - b4 = b3 + 0.5 * luminance - end - - hi = (kMat[pID][rank][2]/250)/(splits+1) or 0 - xi = posX + w - rm - (j+0.55)*cW - 10 + 9*rank - yi = posY - dy - 10 - 24*rs - - gl.Color(0.1,0.1,0.05,0.7) - --gl.Color(0.4,0.4,0.2,1) - gl.Rect(posX + w - rm - (j+0.66)*cW, yi-1, posX + w - rm - j*cW, yi) - gl.Rect(posX + w - rm - (j+0.66)*cW, yi+hBar, posX + w - rm - j*cW, yi+hBar+1) - - gl.Color(r2,g2,b2,1) - gl.Rect( - xi+1, - yi, - xi+2, - yi+hi - ) - gl.Color(r3,g3,b3,1) - gl.Rect( - xi+2, - yi, - xi+3, - yi+hi - ) - gl.Color(r4,g4,b4,1) - gl.Rect( - xi+3, - yi, - xi+4, - yi+hi - ) - end - end - - gl.Color(1,1,1,1) - gl.Texture(false) - end -end - -function DrawOptionRibbon() - local h = 300 - local dx = 200 - local x0 - local t = 12 - - if right then - x0 = widgetPosX-dx - x1 = x0 + dx + widgetWidth - else - x0 = widgetPosX - x1 = x0 + dx + widgetWidth - end - - options["contrastLess"]["x1"] = x0 + 80 - options["contrastLess"]["x2"] = x0 + 87 - options["contrastLess"]["y2"] = widgetPosY - 20 - options["contrastLess"]["y1"] = widgetPosY - 35 - - options["contrastMore"]["x1"] = x0 + 88 - options["contrastMore"]["x2"] = x0 + 95 - options["contrastMore"]["y2"] = widgetPosY - 20 - options["contrastMore"]["y1"] = widgetPosY - 35 - - options["borders"]["x1"] = x0 + 80 - options["borders"]["x2"] = x0 + 95 - options["borders"]["y2"] = widgetPosY - 40 - options["borders"]["y1"] = widgetPosY - 55 - - options["widthInc"]["x1"] = x0 + 200 - options["widthInc"]["x2"] = x0 + 215 - options["widthInc"]["y2"] = widgetPosY - 20 - options["widthInc"]["y1"] = widgetPosY - 35 - - options["widthDec"]["x1"] = x0 + 180 - options["widthDec"]["x2"] = x0 + 195 - options["widthDec"]["y2"] = widgetPosY - 20 - options["widthDec"]["y1"] = widgetPosY - 35 - - options["heightInc"]["x1"] = x0 + 200 - options["heightInc"]["x2"] = x0 + 215 - options["heightInc"]["y2"] = widgetPosY - 40 - options["heightInc"]["y1"] = widgetPosY - 55 - - options["heightDec"]["x1"] = x0 + 180 - options["heightDec"]["x2"] = x0 + 195 - options["heightDec"]["y2"] = widgetPosY - 40 - options["heightDec"]["y1"] = widgetPosY - 55 - - options["disable"]["x1"] = x0 + 220 - options["disable"]["x2"] = x0 + 220 + t - options["disable"]["y2"] = widgetPosY - 100 - options["disable"]["y1"] = widgetPosY - 100 - t - - options["FPBar1"]["x1"] = x0 + 180 - options["FPBar1"]["x2"] = x0 + 180 + t - options["FPBar1"]["y2"] = widgetPosY - 200 - options["FPBar1"]["y1"] = widgetPosY - 200 - t - - options["BPBar1"]["x1"] = x0 + 180 - options["BPBar1"]["x2"] = x0 + 180 + t - options["BPBar1"]["y2"] = widgetPosY - 220 - options["BPBar1"]["y1"] = widgetPosY - 220 - t - - options["FPBar2"]["x1"] = x0 + 220 - options["FPBar2"]["x2"] = x0 + 220 + t - options["FPBar2"]["y2"] = widgetPosY - 200 - options["FPBar2"]["y1"] = widgetPosY - 200 - t - - options["BPBar2"]["x1"] = x0 + 220 - options["BPBar2"]["x2"] = x0 + 220 + t - options["BPBar2"]["y2"] = widgetPosY - 220 - options["BPBar2"]["y1"] = widgetPosY - 220 - t - - options["kills1"]["x1"] = x0 + 180 - options["kills1"]["x2"] = x0 + 180 + t - options["kills1"]["y2"] = widgetPosY - 240 - options["kills1"]["y1"] = widgetPosY - 240 - t - - options["kills2"]["x1"] = x0 + 220 - options["kills2"]["x2"] = x0 + 220 + t - options["kills2"]["y2"] = widgetPosY - 240 - options["kills2"]["y1"] = widgetPosY - 240 - t - - options["Announce"]["x1"] = x0 + 220 - options["Announce"]["x2"] = x0 + 220 + t - options["Announce"]["y2"] = widgetPosY - 120 - options["Announce"]["y1"] = widgetPosY - 120 - t - - options["removeDead"]["x1"] = x0 + 220 - options["removeDead"]["x2"] = x0 + 220 + t - options["removeDead"]["y2"] = widgetPosY - 140 - options["removeDead"]["y1"] = widgetPosY - 140 - t - - options["resText"]["x1"] = x0 + 220 - options["resText"]["x2"] = x0 + 220 + t - options["resText"]["y2"] = widgetPosY - 160 - options["resText"]["y1"] = widgetPosY - 160 - t - - - gl.Color(0,0,0,0.4) -- draws background rectangle - gl.Rect(x0,widgetPosY, x1, widgetPosY -h) - gl.Color(0,0,0,1) - gl.Rect(x0,widgetPosY, x0+1, widgetPosY-h) - gl.Rect(x1 - 1,widgetPosY, x1, widgetPosY-h) - gl.Color(1,1,1,1) - glText("Adjust", x0+95, widgetPosY - 10,textsize) - glText("Options", x0+95, widgetPosY - 90,textsize) - gl.Rect(x0+95,widgetPosY - 12, x0 + 137, widgetPosY-13) - gl.Rect(x0+95,widgetPosY - 92, x0 + 145, widgetPosY-93) - gl.Color(0.8,0.8,1,0.8) - glText("Contrast:", x0+5, widgetPosY - 30,textsize) - glText("Borders:", x0+5, widgetPosY - 50,textsize) - glText("Width:", x0+125, widgetPosY - 30,textsize) - glText("Height:", x0+125, widgetPosY - 50,textsize) - gl.Color(1,1,1,1) - gl.Texture(images["contrast"]) - gl.TexRect( - options["contrastLess"]["x1"], - options["contrastLess"]["y1"], - options["contrastMore"]["x2"], - options["contrastMore"]["y2"] - ) - if options["borders"]["On"] then - gl.Texture(images["borderson"]) - else - gl.Texture(images["bordersoff"]) - end - gl.TexRect( - options["borders"]["x1"], - options["borders"]["y1"], - options["borders"]["x2"], - options["borders"]["y2"] - ) - gl.Color(0.8,0.8,1,0.8) - glText("Disable for non-spectators:", x0+5, widgetPosY - 110,textsize) - glText("Show firepower bar:", x0+5, widgetPosY - 210,textsize) - glText("Show buildpower bar:", x0+5, widgetPosY - 230,textsize) - glText("Show kills and losses:", x0+5, widgetPosY - 250,textsize) - glText("Show resource text:", x0+5, widgetPosY - 170,textsize) - glText("Announce kills:", x0+5, widgetPosY - 130,textsize) - glText("Remove dead teams:", x0+5, widgetPosY - 150,textsize) - glText("(Drag window to reposition)", x0+35, widgetPosY - 280,textsize) - gl.Color(1,1,1,1) - glText("Player", x0+160, widgetPosY - 192,textsize) - glText("Spec", x0+215, widgetPosY - 192,textsize) - if options["disable"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["disable"]["x1"], - options["disable"]["y1"], - options["disable"]["x2"], - options["disable"]["y2"] - ) - - if options["FPBar2"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["FPBar2"]["x1"], - options["FPBar2"]["y1"], - options["FPBar2"]["x2"], - options["FPBar2"]["y2"] - ) - - if options["BPBar2"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["BPBar2"]["x1"], - options["BPBar2"]["y1"], - options["BPBar2"]["x2"], - options["BPBar2"]["y2"] - ) - - if options["FPBar1"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["FPBar1"]["x1"], - options["FPBar1"]["y1"], - options["FPBar1"]["x2"], - options["FPBar1"]["y2"] - ) - - if options["BPBar1"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["BPBar1"]["x1"], - options["BPBar1"]["y1"], - options["BPBar1"]["x2"], - options["BPBar1"]["y2"] - ) - options["kills1"]["On"] = false - gl.Color(0.8,0.4,0.4,0.5) - glText("(N/A)", x0+170, widgetPosY - 250,textsize) - gl.Color(1,1,1,1) - - if options["kills2"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["kills2"]["x1"], - options["kills2"]["y1"], - options["kills2"]["x2"], - options["kills2"]["y2"] - ) - - if options["Announce"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["Announce"]["x1"], - options["Announce"]["y1"], - options["Announce"]["x2"], - options["Announce"]["y2"] - ) - - if options["resText"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["resText"]["x1"], - options["resText"]["y1"], - options["resText"]["x2"], - options["resText"]["y2"] - ) - - if options["removeDead"]["On"] then - gl.Texture(images["checkboxon"]) - else - gl.Texture(images["checkboxoff"]) - end - gl.TexRect( - options["removeDead"]["x1"], - options["removeDead"]["y1"], - options["removeDead"]["x2"], - options["removeDead"]["y2"] - ) - - gl.Texture(images["more"]) - gl.TexRect( - options["widthInc"]["x1"], - options["widthInc"]["y1"], - options["widthInc"]["x2"], - options["widthInc"]["y2"] - ) - gl.Texture(images["less"]) - gl.TexRect( - options["widthDec"]["x1"], - options["widthDec"]["y1"], - options["widthDec"]["x2"], - options["widthDec"]["y2"] - ) - gl.Texture(images["more"]) - gl.TexRect( - options["heightInc"]["x1"], - options["heightInc"]["y1"], - options["heightInc"]["x2"], - options["heightInc"]["y2"] - ) - gl.Texture(images["less"]) - gl.TexRect( - options["heightDec"]["x1"], - options["heightDec"]["y1"], - options["heightDec"]["x2"], - options["heightDec"]["y2"] - ) -end - -function DrawInfoButton (allyID, active, right, big) - - local allyDataID = allyID+1 - if options["removeDead"]["On"] then - if not allyData[allyDataID]["isAlive"] then return end - end - - local x1 = infoButton[allyID]["x1"] - local y1 = infoButton[allyID]["y1"] - local x2 = infoButton[allyID]["x2"] - local y2 = infoButton[allyID]["y2"] - - if big then - x2 = x2 + 5 - y2 = y2 + 5 - end - - if active then - gl.Color(0.8,0.8,0.2,1) - else - gl.Color(1,1,1,1) - end - gl.Texture(images["info"]) - gl.TexRect(x1,y1,x2,y2) - - gl.Color(1,1,1,1) - gl.Texture(false) -end - -function DrawLabelC(text, vOffset) - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end - gl.Color(0.55,0.55,0.8,0.7) - glText(text or "", widgetPosX + 15, widgetPosY + widgetHeight -vOffset+tH-42,textsize) -end - -function DrawLabelCM(text, vOffset) - local len = #text - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end - - myFont:Begin() - myFont:SetTextColor({0.8,0.8,1,0.8}) - myFont:Print(text or "", widgetPosX + 30-len*1.875, widgetPosY + widgetHeight -vOffset+tH-42,textsize,'s') - myFont:End() -end - -function DrawLabelCM2(text, vOffset) - local len = #text - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end - myFont:Begin() - myFont:SetTextColor({0.8,0.8,1,0.8}) - myFont:Print(text or "", widgetPosX + 30-len*1.875, widgetPosY + widgetHeight -vOffset+tH-62,textsize,'s') - myFont:End() -end - -function DrawLabelCT(text, vOffset,t) - if widgetWidth < 67 then - text = string.sub(text, 0, 1) - end - local gs - gs,_,_ = Spring.GetGameSpeed() or 1 - - myFont:Begin() - myFont:SetTextColor({1-0.5*math.sin(20*t/gs),1-0.5*math.sin(20*t/gs),1-0.25*math.sin(20*t/gs),0.8}) - if t < 3 then - myFont:Print(text or "", widgetPosX + 30, widgetPosY + widgetHeight -vOffset+tH-42,textsize,'s') - else - myFont:Print(text or "", widgetPosX + 30 + (t-3)^12, widgetPosY + widgetHeight -vOffset+tH-42,textsize,'s') - end - myFont:End() -end - -function DrawBox(hOffset, vOffset,r,g,b) - local dx = 20 - local dy = 58 - gl.Color(.2,.2,.2) - gl.Rect(widgetPosX+hOffset+dx+7, widgetPosY + widgetHeight -vOffset+dy+17, widgetPosX+hOffset+dx+8, widgetPosY + widgetHeight -vOffset+dy+3) - gl.Rect(widgetPosX+hOffset+dx+20, widgetPosY + widgetHeight -vOffset+dy+17, widgetPosX + hOffset + dx + 21, widgetPosY + widgetHeight -vOffset+dy+3) - gl.Rect(widgetPosX+hOffset+dx+7, widgetPosY + widgetHeight -vOffset+dy+17, widgetPosX + hOffset +dx + 21, widgetPosY + widgetHeight -vOffset+dy+16) - gl.Rect(widgetPosX+hOffset+dx+7, widgetPosY + widgetHeight -vOffset+dy+4, widgetPosX + hOffset + dx + 21, widgetPosY + widgetHeight -vOffset+dy+3) - gl.Color(r,g,b,0.5) - gl.Rect(widgetPosX+hOffset+dx+8, widgetPosY + widgetHeight -vOffset+dy+16, widgetPosX + hOffset + dx + 20, widgetPosY + widgetHeight -vOffset+dy+4) - gl.Color(1,1,1,1) -end - -function DrawSideImage(sideImage, hOffset, vOffset, r, g, b, a, small, mouseOn,t,isDead) - local w - local h - local dx - local dy - - if small then - w = 8 - h = 8 - dx = 28 + (WBadge-14)*4 - dy = tH - 12 - else - w = WBadge - h = WBadge - dx = 25 + (WBadge-14)*4 - dy = tH - 16 - (WBadge-14) - end - - if not inSpecMode then dx = dx -10 end - - if mouseOn and (not isDead) then - if ctrlDown then - gl.Color(1,1,1,a) - else - local gs - gs,_,_ = Spring.GetGameSpeed() or 1 - gl.Color(r-0.2*math.sin(10*t/gs),g-0.2*math.sin(10*t/gs),b,a) - end - else - gl.Color(r,g,b,a) - end - gl.Texture(sideImage) - gl.TexRect( - widgetPosX + hOffset + dx, - widgetPosY + widgetHeight - vOffset + dy, - widgetPosX + hOffset + dx + w, - widgetPosY + widgetHeight - vOffset + dy + h - ) - gl.Texture(false) - gl.Color(1,1,1,1) -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_epicmenu.lua b/LuaUI/Widgets_Evo/gui_epicmenu.lua deleted file mode 100644 index b2edae7ee..000000000 --- a/LuaUI/Widgets_Evo/gui_epicmenu.lua +++ /dev/null @@ -1,2442 +0,0 @@ -function widget:GetInfo() - return { - name = "EPIC Menu", - desc = "v1.314 Extremely Powerful Ingame Chili Menu.", - author = "CarRepairer", - date = "2009-06-02", --2013-04-10 - license = "GNU GPL, v2 or later", - layer = -100001, - handler = true, - experimental = false, - enabled = true, - alwaysStart = true, - } -end - ---CRUDE EXPLAINATION (third party comment) on how things work: (by Msafwan) ---1) first... a container called "OPTION" is shipped into epicMenuFactory from various sources (from widgets or epicmenu_conf.lua) ---Note: "OPTION" contain a smaller container called "OnChange" (which is the most important content). ---2) "OPTION" is then brought into epicMenuFactory\AddOption() which then attach a tracker which calls "SETTINGS" whenever "OnChange" is called. ---Note: "SETTINGS" is container which come and go from epicMenuFactory. Its destination is at CAWidgetFactory which save into "Zk_data.lua". ---4) "OPTION" are then brought into epicMenuFactory\MakeSubWindow() which then wrap the content(s) into regular buttons/checkboxes. This include the modified "OnChange" ---5) then Hotkey buttons is created in epicMenuFactory\MakeHotkeyedControl() and attached to regular buttons horizontally (thru 'StackPanel') which then sent back to epicMenuFactory\MakeSubWindow() ---6) then epicMenuFactory\MakeSubWindow() attaches all created button(s) to main "Windows" and finished the job. (now waiting for ChiliFactory to render them all). ---Note: hotkey button press is handled by Spring, but its registration & attachment with "OnChange" is handled by epicMenuFactory ---Note: all button rendering & clicking is handled by ChiliFactory (which receive button settings & call "OnChange" if button is pressed) - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local spGetConfigInt = Spring.GetConfigInt -local spSendCommands = Spring.SendCommands -local min = math.min -local max = math.max - -local echo = Spring.Echo - --------------------------------------------------------------------------------- - --- Config file data -local VFSMODE = VFS.RAW_FIRST -local file = LUAUI_DIRNAME .. "Configs/epicmenu_conf.lua" -local confdata = VFS.Include(file, nil, VFSMODE) -local epic_options = confdata.eopt -local color = confdata.color -local title_text = confdata.title -local title_image = confdata.title_image -local keybind_file = confdata.keybind_file or title_text .. '_keys.lua' -local file_return = VFS.Include(keybind_file, nil, VFS.ZIP) -local defaultkeybinds, defaultkeybind_date = file_return.keybinds, file_return.date -local useUiKeys = false ---file_return = nil - -local _, _, _, _, _, _, _, _, custom_cmd_actions = include("Configs/integral_menu_commands.lua") - --------------------------------------------------------------------------------- - --- Chili control classes -local Chili -local Button -local Label -local Colorbars -local Checkbox -local Window -local ScrollPanel -local StackPanel -local LayoutPanel -local Grid -local Trackbar -local TextBox -local Image -local Progressbar -local Colorbars -local screen0 - --------------------------------------------------------------------------------- --- Global chili controls -local window_crude -local window_exit -local window_flags -local window_help -local window_getkey -local lbl_gtime, lbl_fps, lbl_clock, img_flag -local cmsettings_index = -1 -local window_sub_cur - --------------------------------------------------------------------------------- --- Misc -local B_HEIGHT = 26 -local C_HEIGHT = 16 - -local scrH, scrW = 0,0 -local cycle = 1 -local curSubKey = '' -local curPath = '' - -local init = false -local myCountry = 'wut' - -local pathoptions = {} -local alloptions = {} - -local exitWindowVisible = false - --------------------------------------------------------------------------------- --- Key bindings --- KEY BINDINGS AND YOU: --- First, Epic Menu checks for a keybind bound to the action in LuaUI/Configs/zk_keys.lua. --- If the local copy has a lower date value than the one in the mod, --- it overwrites ALL conflicting keybinds in the local config. --- Else it just adds any action-key pairs that are missing from the local config. --- zk_keys.lua is written to at the end of loading LuaUI and on LuaUI shutdown. --- Next, if it's a widget command, it checks if the widget specified a default keybind. --- If so, it uses that command. --- Lastly, it checks uikeys.txt (read-only). - -include("keysym.h.lua") -local keysyms = {} -for k,v in pairs(KEYSYMS) do - keysyms['' .. v] = k -end ---[[ -for k,v in pairs(KEYSYMS) do - keysyms['' .. k] = v -end ---]] -local get_key = false -local kb_path -local kb_action - -local transkey = { - backquote = '`', - - leftbracket = '[', - rightbracket = ']', - --delete = 'del', - comma = ',', - period = '.', - slash = '/', - backslash = '\\', - equals = '=', - - quote = "'", - - kp_multiply = 'numpad*', - kp_divide = 'numpad/', - kp_plus = 'numpad+', - kp_minus = 'numpad-', - kp_period = 'numpad.', - - kp0 = 'numpad0', - kp1 = 'numpad1', - kp2 = 'numpad2', - kp3 = 'numpad3', - kp4 = 'numpad4', - kp5 = 'numpad5', - kp6 = 'numpad6', - kp7 = 'numpad7', - kp8 = 'numpad8', - kp9 = 'numpad9', -} - - - --------------------------------------------------------------------------------- --- Widget globals -WG.crude = {} -if not WG.Layout then - WG.Layout = {} -end - --------------------------------------------------------------------------------- --- Luaui config settings -local keybounditems = {} -local keybind_date = 0 - -local settings = { - versionmin = 50, - lang = 'en', - widgets = {}, - show_crudemenu = true, - music_volume = 0.5, -} - - - ----------------------------------------------------------------- --- Helper Functions --- [[ -local function to_string(data, indent) - local str = "" - - if(indent == nil) then - indent = 0 - end - local indenter = " " - -- Check the type - if(type(data) == "string") then - str = str .. (indenter):rep(indent) .. data .. "\n" - elseif(type(data) == "number") then - str = str .. (indenter):rep(indent) .. data .. "\n" - elseif(type(data) == "boolean") then - if(data == true) then - str = str .. "true" - else - str = str .. "false" - end - elseif(type(data) == "table") then - local i, v - for i, v in pairs(data) do - -- Check for a table in a table - if(type(v) == "table") then - str = str .. (indenter):rep(indent) .. i .. ":\n" - str = str .. to_string(v, indent + 2) - else - str = str .. (indenter):rep(indent) .. i .. ": " .. -to_string(v, 0) - end - end - elseif(type(data) == "function") then - str = str .. (indenter):rep(indent) .. 'function' .. "\n" - else - echo(1, "Error: unknown data type: %s", type(data)) - end - - return str -end ---]] - -local function CapCase(str) - local str = str:lower() - str = str:gsub( '_', ' ' ) - str = str:sub(1,1):upper() .. str:sub(2) - - str = str:gsub( ' (.)', - function(x) return (' ' .. x):upper(); end - ) - return str -end - - -local function explode(div,str) - if (div=='') then return false end - local pos,arr = 0,{} - -- for each divider found - for st,sp in function() return string.find(str,div,pos,true) end do - table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider - pos = sp + 1 -- Jump past current divider - end - table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider - return arr -end - - -local function GetIndex(t,v) local idx = 1; while (t[idx] 0) then - timeString = string.format('%02i:%02i:%02i', h, m, s) - else - timeString = string.format('%02i:%02i', m, s) - end - end - return timeString -end - -local function BoolToInt(bool) - return bool and 1 or 0 -end -local function IntToBool(int) - return int ~= 0 -end - --- cool new framework for ordered table that has keys -local function otget(t,key) - for i=1,#t do - if not t[i] then - return - end - if t[i][1] == key then --key stored in index 1, while value at index 2 - return t[i][2] - end - end - return nil -end -local function otset(t, key, val) - for i=1,#t do - if t[i][1] == key then --key stored in index 1, while value at index 2 - if val == nil then - table.remove( t, i ) - else - t[i][2] = val - end - return - end - end - if val ~= nil then - t[#t+1] = {key, val} - end -end -local function otvalidate(t) - for i=1,#t do - if not t[i] then - return false - end - end - return true -end ---end cool new framework - --------------------------------------------------------------------------------- - -WG.crude.SetSkin = function(Skin) - if Chili then - Chili.theme.skin.general.skinName = Skin - end -end - ---Reset custom widget settings, defined in Initialize -WG.crude.ResetSettings = function() end - ---Reset hotkeys, defined in Initialized -WG.crude.ResetKeys = function() end - ---Get hotkey by actionname, defined in Initialize() -WG.crude.GetHotkey = function() end - ---Set hotkey by actionname, defined in Initialize(). Is defined in Initialize() because trying to iterate pathoptions table here (at least if running epicmenu.lua in local copy) will return empty pathoptions table. -WG.crude.SetHotkey = function() end - ---Callin often used for space+click shortcut, defined in Initialize(). Is defined in Initialize() because it help with testing epicmenu.lua in local copy -WG.crude.OpenPath = function() end - ---Allow other widget to toggle-up/show Epic-Menu remotely, defined in Initialize() -WG.crude.ShowMenu = function() end --// allow other widget to toggle-up Epic-Menu which allow access to game settings' Menu via click on other GUI elements. - - ---[[ --- is this an improvement? -WG.crude.GetHotkey = function(actionName) - local hotkey = keybounditems[actionName] - if not hotkey then - local fallback = Spring.GetActionHotKeys(actionName) - if fallback and fallback[1] then - return CapCase(fallback[1]) - else - return '' - end - end - return GetReadableHotkey(hotkey) -end ---]] - -WG.GetWidgetOption = function(wname, path, key) -- still fails if path and key are un-concatenatable - --return (pathoptions and path and key and wname and pathoptions[path] and pathoptions[path][wname..key]) or {} - return (pathoptions and path and key and wname and pathoptions[path] and otget( pathoptions[path], wname..key ) ) or {} -end -WG.SetWidgetOption = function(wname, path, key, value) - if (pathoptions and path and key and wname and pathoptions[path] and otget( pathoptions[path], wname..key ) ) then - local option = alloptions[path..wname .. key] - option.OnChange(value) - end -end - - -local function SaveKeybinds() - local keybindfile_table = { keybinds = keybounditems, date=keybind_date } - --table.save( keybindfile_table, keybind_file ) - - local file = io.open (keybind_file, "w") - if (file== nil) then - Spring.Log(widget:GetInfo().name, "error", "Could not open keybind file " .. keybind_file .. " for writing") - return - end - - file:write ("return " .. WG.WriteTable(keybindfile_table, 0, true, true, true)) - file:flush() - file:close() - -end - -local function LoadKeybinds() - local loaded = false - if VFS.FileExists(keybind_file, VFS.RAW) then - local file_return = VFS.Include(keybind_file, nil, VFS.RAW) - if file_return then - keybounditems, keybind_date = file_return.keybinds, file_return.date - if keybounditems and keybind_date then - - if not otvalidate(keybounditems) then - keybounditems = {} - end - - loaded = true - keybind_date = keybind_date or defaultkeybind_date -- reverse compat - - --echo ('============OVERRIDE??', keybind_date, defaultkeybind_date) - - if not keybind_date or keybind_date == 0 or (keybind_date+0) < defaultkeybind_date then - keybind_date = defaultkeybind_date - for _,elem in ipairs(defaultkeybinds) do - local action = elem[1] - local keybind = elem[2] - otset( keybounditems, action, keybind)-- forcibly override any user changes to default binds - end - else - for _, elem in ipairs(defaultkeybinds) do - local action = elem[1] - local keybind = elem[2] - otset( keybounditems, action, otget( keybounditems, action ) or keybind ) - end - end - end - end - end - - if not loaded then - keybounditems = CopyTable(defaultkeybinds, true) - keybind_date = defaultkeybind_date - end - - if not otvalidate(keybounditems) then - keybounditems = {} - end - -end - ---[[ -local function ReadUserUiKeys() - local fileName = 'Configs/uikeys.txt' - local file = io.open (fileName, "r") - while true do - local line = file:read() - if not line then - break - end - if line:find() - end -end ---]] ----------------------------------------------------------------- ---May not be needed with new chili functionality -local function AdjustWindow(window) - local nx - if (0 > window.x) then - nx = 0 - elseif (window.x + window.width > screen0.width) then - nx = screen0.width - window.width - end - - local ny - if (0 > window.y) then - ny = 0 - elseif (window.y + window.height > screen0.height) then - ny = screen0.height - window.height - end - - if (nx or ny) then - window:SetPos(nx,ny) - end -end - - --- Adding functions because of "handler=true" -local function AddAction(cmd, func, data, types) - return widgetHandler.actionHandler:AddAction(widget, cmd, func, data, types) -end -local function RemoveAction(cmd, types) - return widgetHandler.actionHandler:RemoveAction(widget, cmd, types) -end - - -local function GetFullKey(path, option) - --local curkey = path .. '_' .. option.key - local fullkey = ('epic_'.. option.wname .. '_' .. option.key) - fullkey = fullkey:gsub(' ', '_') - return fullkey -end - -local function GetActionName(path, option) - local fullkey = GetFullKey(path, option):lower() - return option.action or fullkey -end - -WG.crude.GetActionName = GetActionName - -WG.crude.GetOptionHotkey = function(path, option) - return WG.crude.GetHotkey(GetActionName(path,option)) -end - - --- returns whether widget is enabled -local function WidgetEnabled(wname) - local order = widgetHandler.orderList[wname] - return order and (order > 0) -end - - --- Kill submenu window -local function KillSubWindow() - if window_sub_cur then - if window_sub_cur then - settings.sub_pos_x = window_sub_cur.x - settings.sub_pos_y = window_sub_cur.y - end - window_sub_cur:Dispose() - window_sub_cur = nil - curPath = '' - - end -end - --- Update colors for labels of widget checkboxes in widgetlist window -local function checkWidget(widget) - if WG.cws_checkWidget then - WG.cws_checkWidget(widget) - end -end - - -local function SetCountry(self) - echo('Setting country: "' .. self.country .. '" ') - - WG.country = self.country - settings.country = self.country - - WG.lang = self.countryLang - settings.lang = self.countryLang - - if img_flag then - img_flag.file = ":cn:".. LUAUI_DIRNAME .. "Images/flags/".. settings.country ..'.png' - img_flag:Invalidate() - end -end - ---Make country chooser window -local function MakeFlags() - - if window_flags then return end - - local countries = {} - local flagdir = 'LuaUI/Images/flags/' - local files = VFS.DirList(flagdir) - for i=1,#files do - local file = files[i] - local country = file:sub( #flagdir+1, -5 ) - countries[#countries+1] = country - end - - local country_langs = { - br='bp', - de='de', - es='es', - fi='fi', - fr='fr', - it='it', - my='my', - pl='pl', - pt='pt', - pr='es', - } - - local flagChildren = {} - - flagChildren[#flagChildren + 1] = Label:New{ caption='Flag', align='center' } - flagChildren[#flagChildren + 1] = Button:New{ - caption = 'Auto', - country = myCountry, - countryLang = country_langs[myCountry] or 'en', - width='50%', - textColor = color.sub_button_fg, - backgroundColor = color.sub_button_bg, - OnMouseUp = { SetCountry } - } - - - local flagCount = 0 - for i=1, #countries do - local country = countries[i] - local countryLang = country_langs[country] or 'en' - flagCount = flagCount + 1 - flagChildren[#flagChildren + 1] = Image:New{ file=":cn:".. LUAUI_DIRNAME .. "Images/flags/".. country ..'.png', } - flagChildren[#flagChildren + 1] = Button:New{ caption = country:upper(), - width='50%', - textColor = color.sub_button_fg, - backgroundColor = color.sub_button_bg, - country = country, - countryLang = countryLang, - OnMouseUp = { SetCountry } - } - end - local window_height = 300 - local window_width = 170 - window_flags = Window:New{ - caption = 'Choose Your Location...', - x = settings.sub_pos_x, - y = settings.sub_pos_y, - clientWidth = window_width, - clientHeight = window_height, - parent = screen0, - backgroundColor = color.sub_bg, - children = { - ScrollPanel:New{ - x=0,y=15, - right=5,bottom=0+B_HEIGHT, - - children = { - Grid:New{ - columns=2, - x=0,y=0, - width='100%', - height=#flagChildren/2*B_HEIGHT*1, - children = flagChildren, - } - } - }, - --close button - Button:New{ caption = 'Close', x=10, y=0-B_HEIGHT, bottom=5, right=5, - OnMouseUp = { function(self) window_flags:Dispose(); window_flags = nil; end }, - width=window_width-20, backgroundColor = color.sub_close_bg, textColor = color.sub_close_fg, - }, - } - } -end - ---Make help text window -local function MakeHelp(caption, text) - local window_height = 400 - local window_width = 400 - - window_help = Window:New{ - caption = caption or 'Help?', - x = settings.sub_pos_x, - y = settings.sub_pos_y, - clientWidth = window_width, - clientHeight = window_height, - parent = screen0, - backgroundColor = color.sub_bg, - children = { - ScrollPanel:New{ - x=0,y=15, - right=5, - bottom=B_HEIGHT, - height = window_height - B_HEIGHT*3 , - children = { - TextBox:New{ x=0,y=10, text = text, textColor = color.sub_fg, width = window_width - 40, } - } - }, - --Close button - Button:New{ caption = 'Close', OnMouseUp = { function(self) self.parent:Dispose() end }, x=10, bottom=1, right=50, height=B_HEIGHT, backgroundColor = color.sub_close_bg, textColor = color.sub_close_fg, }, - } - } -end - - -local function MakeSubWindow(key) -end - -local function GetReadableHotkeyMod(mod) - local modlowercase = mod:lower() - return (modlowercase:find('a%+') and 'Alt+' or '') .. - (modlowercase:find('c%+') and 'Ctrl+' or '') .. - (modlowercase:find('m%+') and 'Meta+' or '') .. - (modlowercase:find('s%+') and 'Shift+' or '') .. - '' -end - -local function HotKeyBreakdown(hotkey) --convert hotkey string into a standardized hotkey string - hotkey = hotkey:gsub('numpad%+', 'numpadplus') - local hotkey_table = explode('+', hotkey) - local alt, ctrl, meta, shift - - for i=1, #hotkey_table-1 do - local str2 = hotkey_table[i]:lower() - if str2 == 'a' or str2 == 'alt' then alt = true - elseif str2 == 'c' or str2 == 'ctrl' then ctrl = true - elseif str2 == 's' or str2 == 'shift' then shift = true - elseif str2 == 'm' or str2 == 'meta' then meta = true - end - end - - local mod = '' .. - (alt and 'A+' or '') .. - (ctrl and 'C+' or '') .. - (meta and 'M+' or '') .. - (shift and 'S+' or '') - - local key = hotkey_table[#hotkey_table] - key = key:gsub( 'numpadplus', 'numpad+') - - return mod, key -end -local function GetReadableHotkey(hotkey) - local mod, key = HotKeyBreakdown(hotkey) - return GetReadableHotkeyMod(mod) .. CapCase(key) -end - -local function GetActionHotkeys(action) - return Spring.GetActionHotKeys(action) -end - -local function GetActionHotkey(action) - local actionHotkeys = Spring.GetActionHotKeys(action) - if actionHotkeys and actionHotkeys[1] then - return (actionHotkeys[1]) - end - return nil -end - -local function AssignKeyBindAction(hotkey, actionName, verbose) - if verbose then - --local actions = Spring.GetKeyBindings(hotkey.mod .. hotkey.key) - local actions = Spring.GetKeyBindings(hotkey) - if (actions and #actions > 0) then - echo( 'Warning: There are other actions bound to this hotkey combo (' .. GetReadableHotkey(hotkey) .. '):' ) - for i=1, #actions do - for actionCmd, actionExtra in pairs(actions[i]) do - echo (' - ' .. actionCmd .. ' ' .. actionExtra) - end - end - end - echo( 'Hotkey (' .. GetReadableHotkey(hotkey) .. ') bound to action: ' .. actionName ) - end - - --actionName = actionName:lower() - if type(hotkey) == 'string' then - --otset( keybounditems, actionName, hotkey ) - - --echo("bind " .. hotkey .. " " .. actionName) - spSendCommands("bind " .. hotkey .. " " .. actionName) - - local buildCommand = actionName:find('buildunit_') - local isUnitCommand - local isUnitStateCommand - local isUnitInstantCommand - - if custom_cmd_actions[actionName] then - local number = custom_cmd_actions[actionName] - isUnitCommand = number == 1 - isUnitStateCommand = number == 2 - isUnitInstantCommand = number == 3 - end - - if custom_cmd_actions[actionName] or buildCommand then - -- bind shift+hotkey as well if needed for unit commands - local alreadyShift = hotkey:lower():find("s%+") or hotkey:lower():find("shift%+") - if not alreadyShift then - if isUnitCommand or buildCommand then - spSendCommands("bind S+" .. hotkey .. " " .. actionName) - elseif isUnitStateCommand or isUnitInstantCommand then - spSendCommands("bind S+" .. hotkey .. " " .. actionName .. " queued") - end - end - end - - end -end - ---create spring action for this option. Note: this is used by AddOption() -local function CreateOptionAction(path, option) - - local kbfunc = option.OnChange - - if option.type == 'bool' then - kbfunc = function() - - local wname = option.wname - -- [[ Note: following code between -- [[ and --]] is just to catch an exception. Is not part of code's logic. - if not pathoptions[path] or not otget( pathoptions[path], wname..option.key ) then - Spring.Echo("Warning, detected keybind mishap. Please report this info and help us fix it:") - Spring.Echo("Option path is "..path) - Spring.Echo("Option name is "..option.wname..option.key) - if pathoptions[path] then --pathoptions[path] table still intact, but option table missing - Spring.Echo("case: option table was missing") - --pathoptions[path][option.wname..option.key] = option --re-add option table - otset( pathoptions[path], option.wname..option.key, option ) --re-add option table - else --both option table & pathoptions[path] was missing, probably was never initialized - Spring.Echo("case: whole path was never initialized") - pathoptions[path] = {} - --pathoptions[path][option.wname..option.key] = option - otset( pathoptions[path], option.wname..option.key, option ) - end - -- [f=0088425] Error: LuaUI::RunCallIn: error = 2, ConfigureLayout, [string "LuaUI/Widgets/gui_epicmenu.lua"]:583: attempt to index field '?' (a nil value) - end - --]] - local pathoption = otget( pathoptions[path], wname..option.key ) - newval = not pathoption.value - pathoption.value = newval - otset( pathoptions[path], wname..option.key, pathoption ) - - option.OnChange({checked=newval}) - - if path == curPath then - MakeSubWindow(path) - end - end - end - local actionName = GetActionName(path, option) - AddAction(actionName, kbfunc, nil, "t") - - if option.hotkey then - local existingRegister = otget( keybounditems, actionName) --check whether existing actionname is already bound with a custom hotkey in zkkey - if existingRegister == nil then - Spring.Echo("Epicmenu: " .. option.hotkey .. " (" .. option.key .. ", " .. option.wname..")") --tell user (in infolog.txt) that a widget is adding hotkey - otset(keybounditems, actionName, option.hotkey ) --save new hotkey if no existing key found (not yet applied. Will be applied in IntegrateWidget()) - end - end -end - ---remove spring action for this option -local function RemoveOptionAction(path, option) - local actionName = GetActionName(path, option) - RemoveAction(actionName) -end - - --- Unsssign a keybinding from settings and other tables that keep track of related info -local function UnassignKeyBind(actionName, verbose) - local actionHotkeys = GetActionHotkeys(actionName) - if actionHotkeys then - for _,actionHotkey in ipairs(actionHotkeys) do - - --[[ - unbind and unbindaction don't work on a command+params, only on the command itself - --]] - - local actionName_split = explode(' ', actionName) - local actionName_cmd = actionName_split[1] - - --echo("unbind " .. actionHotkey .. ' ' .. actionName_cmd:lower()) - spSendCommands("unbind " .. actionHotkey .. ' ' .. actionName_cmd:lower()) -- must be lowercase when calling unbind - --spSendCommands("unbindaction " .. actionName ) --don't do this, unbinding one select would unbind all. - - if verbose then - echo( 'Unbound hotkeys from action: ' .. actionName ) - end - end - end - --otset( keybounditems, actionName, nil ) -end - ---unassign and reassign keybinds -local function ReApplyKeybinds() - --[[ - To migrate from uikeys: - Find/Replace: - bind\s*(\S*)\s*(.*) - { "\2", "\1" }, - ]] - --echo 'ReApplyKeybinds' - - if useUiKeys then - return - end - - for _,elem in ipairs(keybounditems) do - local actionName = elem[1] - local hotkey = elem[2] - --actionName = actionName:lower() - UnassignKeyBind(actionName, false) - - local hotkeyTable = type(hotkey) == 'table' and hotkey or {hotkey} - - for _,hotkey2 in ipairs(hotkeyTable) do - if hotkey2 ~= 'None' then - AssignKeyBindAction(hotkey2, actionName, false) - end - end - - --echo("unbindaction(1) ", actionName) - --echo("bind(1) ", hotkey, actionName) - end -end - -local function AddOption(path, option, wname ) --Note: this is used when loading widgets and in Initialize() - --echo(path, wname, option) - if not wname then - wname = path - end - - local path2 = path - if not option then - if not pathoptions[path] then - pathoptions[path] = {} - end - local pathexploded = explode('/',path) - local pathend = pathexploded[#pathexploded] - pathexploded[#pathexploded] = nil - path = table.concat(pathexploded, '/') - - option = { - type='button', - name=pathend .. '...', - OnChange = function(self) - MakeSubWindow(path2) - end, - desc=path2, - } - end - - if not pathoptions[path] then - AddOption( path ) - end - - if not option.key then - option.key = option.name - end - option.wname = wname - - local curkey = path .. '_' .. option.key - --local fullkey = ('epic_'.. curkey) - local fullkey = GetFullKey(path, option) - fullkey = fullkey:gsub(' ', '_') - - --get spring config setting - local valuechanged = false - local newval - if option.springsetting ~= nil then --nil check as it can be false but maybe not if springconfig only assumes numbers - newval = Spring.GetConfigInt( option.springsetting, 0 ) - if option.type == 'bool' then - newval = IntToBool(newval) - end - else - --load option from widget settings (LuaUI/Config/ZK_data.lua). - --Read/write is handled by widgethandler; see widget:SetConfigData and widget:GetConfigData - if settings.config[fullkey] ~= nil then --nil check as it can be false - newval = settings.config[fullkey] - end - end - - if option.type ~= 'button' and option.type ~= 'label' and option.default == nil then - if option.value ~= nil then - option.default = option.value - else - option.default = newval - end - end - - - if newval ~= nil and option.value ~= newval then --must nilcheck newval - valuechanged = true - option.value = newval - end - - - - local origOnChange = option.OnChange or function() end - - local controlfunc - if option.type == 'button' then - controlfunc = - function(self) - if option.action then --if keybindings supplied by widgets - spSendCommands{option.action} - end - end - elseif option.type == 'bool' then - - controlfunc = - function(self) - if self then - option.value = self.checked - end - if option.springsetting then --if widget supplies option for springsettings - Spring.SetConfigInt( option.springsetting, BoolToInt(option.value) ) - end - settings.config[fullkey] = option.value - end - - elseif option.type == 'number' then - if option.valuelist then - option.min = 1 - option.max = #(option.valuelist) - option.step = 1 - end - --option.desc_orig = option.desc or '' - controlfunc = - function(self) - if self then - if option.valuelist then - option.value = option.valuelist[self.value] - else - option.value = self.value - end - --self.tooltip = option.desc_orig .. ' - Current: ' .. option.value - end - - if option.springsetting then - if not option.value then - echo (' Error #444', fullkey) - else - Spring.SetConfigInt( option.springsetting, option.value ) - end - end - settings.config[fullkey] = option.value - end - - elseif option.type == 'colors' then - controlfunc = - function(self) - if self then - option.value = self.color - end - settings.config[fullkey] = option.value - end - - elseif option.type == 'list' then - controlfunc = - function(key) - option.value = key - settings.config[fullkey] = option.value - end - elseif option.type == 'radioButton' then - controlfunc = - function(key) - option.value = key - settings.config[fullkey] = option.value - - if path == curPath then - MakeSubWindow(path) --remake button/checkbox - end - end - end - option.OnChange = function(self) - controlfunc(self) --note: 'self' in this context will be refer to the button/checkbox/slider state provided by Chili UI - origOnChange(option) - end - - --call onchange once - if valuechanged and option.type ~= 'button' and (origOnChange ~= nil) - --and not option.springsetting --need a different solution - then - origOnChange(option) - end - - --Keybindings - if option.type == 'button' or option.type == 'bool' then - local actionName = GetActionName(path, option) - - --migrate from old logic, make sure this is done before setting orig_key - if option.hotkey and type(option.hotkey) == 'table' then - option.hotkey = option.hotkey.mod .. option.hotkey.key --change hotkey table into string - end - - if option.hotkey then - local orig_hotkey = '' - orig_hotkey = option.hotkey - option.orig_hotkey = orig_hotkey - end - - CreateOptionAction(path, option) - - --Keybinds for radiobuttons - elseif option.type == 'radioButton' then --if its a list of checkboxes: - for i=1, #option.items do --prepare keybinds for each of radioButton's checkbox - local item = {} - item.wname = wname.."radioButton" -- wname is needed by Hotkey to 'AddAction' - item.key = option.items[i].key - item.hotkey = option.items[i].hotkey - item.OnChange = function() option.OnChange(item.key) end --encapsulate OnChange() with a fixed input (item's key). Is needed for Hotkey - local actionName = GetActionName(path, item) - if item.hotkey then - local orig_hotkey = '' - orig_hotkey = item.hotkey - item.orig_hotkey = orig_hotkey - end - - CreateOptionAction(path,item) - - alloptions[path..wname..item.key] = item --is used to store options but will not be used to make button. Is for random stuff now. - end - end - - otset( pathoptions[path], wname..option.key, option )--is used for remake epicMenu's button(s) - alloptions[path..wname..option.key] = option --is used for random stuff now. - -end - -local function RemOption(path, option, wname ) - if not pathoptions[path] then - --this occurs when a widget unloads itself inside :init - --echo (' error #333 ', wname, path) - --echo (' ...error #333 ', (option and option.key) ) - return - end - RemoveOptionAction(path, option) - otset( pathoptions[path], wname..option.key, nil ) - alloptions[path..wname..option.key] = nil - if option.type == 'radioButton' then - for i=1, #option.items do - local itemsKey = option.items[i].key - alloptions[path..wname..itemsKey] = nil - end - end -end - - --- sets key and wname for each option so that GetOptionHotkey can work before widget initialization completes -local function PreIntegrateWidget(w) - - local options = w.options - if type(options) ~= 'table' then - return - end - - local wname = w.whInfo.name - local defaultpath = w.options_path or ('Settings/Misc/' .. wname) - - if w.options.order then - echo (" " .. wname .. ", don't index an option with the word 'order' please, it's too soon and I'm not ready.") - w.options.order = nil - end - - --Generate order table if it doesn't exist - if not w.options_order then - w.options_order = {} - for k,v in pairs(options) do - w.options_order[#(w.options_order) + 1] = k - end - end - - - for i=1, #w.options_order do - local k = w.options_order[i] - local option = options[k] - if not option then - Spring.Log(widget:GetInfo().name, "error", ' Error in loading custom widget settings in ' .. wname .. ', order table incorrect.' ) - return - end - - option.key = k - option.wname = wname - end -end - - ---(Un)Store custom widget settings for a widget -local function IntegrateWidget(w, addoptions, index) - - local options = w.options - if type(options) ~= 'table' then - return - end - - local wname = w.whInfo.name - local defaultpath = w.options_path or ('Settings/Misc/' .. wname) - - - --[[ - --If a widget disables itself in widget:Initialize it will run the removewidget before the insertwidget is complete. this fix doesn't work - if not WidgetEnabled(wname) then - return - end - --]] - - if w.options.order then - echo (" " .. wname .. ", don't index an option with the word 'order' please, it's too soon and I'm not ready.") - w.options.order = nil - end - - --Generate order table if it doesn't exist - if not w.options_order then - w.options_order = {} - for k,v in pairs(options) do - w.options_order[#(w.options_order) + 1] = k - end - end - - - for i=1, #w.options_order do - local k = w.options_order[i] - local option = options[k] - if not option then - Spring.Log(widget:GetInfo().name, "error", ' Error in loading custom widget settings in ' .. wname .. ', order table incorrect.' ) - return - end - - --Add empty onchange function if doesn't exist - if not option.OnChange or type(option.OnChange) ~= 'function' then - w.options[k].OnChange = function(self) end - end - - --store default - w.options[k].default = w.options[k].value - - - option.key = k - option.wname = wname - - local origOnChange = w.options[k].OnChange - - if option.type ~= 'button' then - option.OnChange = - function(self) - if self then - w.options[k].value = self.value - end - origOnChange(self) - end - else - option.OnChange = - function(self) - origOnChange(self) - end - end - - local path = option.path or defaultpath - - - -- [[ - local value = w.options[k].value - w.options[k].value = nil - w.options[k].priv_value = value - - --setmetatable( w.options[k], temp ) - --local temp = w.options[k] - --w.options[k] = {} - w.options[k].__index = function(t, key) - if key == 'value' then - --[[ - if( not wname:find('Chili Chat') ) then - echo ('get val', wname, k, key, t.priv_value) - end - --]] - --return t.priv_value - return t.priv_value - end - end - - w.options[k].__newindex = function(t, key, val) - -- For some reason this is called twice per click with the same parameters for most options - -- a few rare options have val = nil for their second call which resets the option. - - if key == 'value' then - if val ~= nil then -- maybe this isn't needed - --echo ('set val', wname, k, key, val) - t.priv_value = val - - local fullkey = GetFullKey(path, option) - fullkey = fullkey:gsub(' ', '_') - settings.config[fullkey] = option.value - end - else - rawset(t,key,val) - end - - end - - setmetatable( w.options[k], w.options[k] ) - --]] - if addoptions then - AddOption(path, option, wname ) - else - RemOption(path, option, wname ) - end - - end - - MakeSubWindow(curPath) - - - ReApplyKeybinds() --reapply keybinds when widget load/removed (incase widget alter keybinds) - -end - ---Store custom widget settings for all active widgets -local function AddAllCustSettings() - local cust_tree = {} - for i=1,#widgetHandler.widgets do - IntegrateWidget(widgetHandler.widgets[i], true, i) - end -end - -local function RemakeEpicMenu() -end - - --- Spring's widget list -local function ShowWidgetList(self) - spSendCommands{"luaui selector"} -end - --- Crudemenu's widget list -WG.crude.ShowWidgetList2 = function(self) - MakeWidgetList() -end - -WG.crude.ShowFlags = function() - MakeFlags() -end - ---Make little window to indicate user needs to hit a keycombo to save a keybinding -local function MakeKeybindWindow( path, option, hotkey ) - local window_height = 80 - local window_width = 300 - - get_key = true - kb_path = path - kb_action = GetActionName(path, option) - - UnassignKeyBind(kb_action, true) -- 2nd param = verbose - --otset( keybounditems, kb_action, nil ) - otset( keybounditems, kb_action, 'None' ) - - window_getkey = Window:New{ - caption = 'Set a HotKey', - x = (scrW-window_width)/2, - y = (scrH-window_height)/2, - clientWidth = window_width, - clientHeight = window_height, - parent = screen0, - backgroundColor = color.sub_bg, - resizable=false, - draggable=false, - children = { - Label:New{ y=10, caption = 'Press a key combo', textColor = color.sub_fg, }, - Label:New{ y=30, caption = '(Hit "Escape" to clear keybinding)', textColor = color.sub_fg, }, - } - } -end - ---Get hotkey action and readable hotkey string. Note: this is used in MakeHotkeyedControl() which make hotkey handled by Chili. -local function GetHotkeyData(path, option) - local actionName = GetActionName(path, option) - --local hotkey = keybounditems[actionName] - local hotkey = otget( keybounditems, actionName ) - if type(hotkey) == 'table' then - hotkey = hotkey[1] - end - if hotkey and hotkey ~= 'none' then --if ZKkey contain definitive hotkey: return zkkey's hotkey - if hotkey:find('%+%+') then - hotkey = hotkey:gsub( '%+%+', '+plus' ) - end - - return GetReadableHotkey(hotkey) - end - if (not hotkey ) and option.hotkey then --if widget supplied default hotkey: return widget's hotkey (this only effect hotkey on Chili menu) - return option.hotkey - end - - return 'None' --show "none" on epicmenu's menu -end - ---Make a stack with control and its hotkey button -local function MakeHotkeyedControl(control, path, option) - - local hotkeystring = GetHotkeyData(path, option) - local kbfunc = function() - if not get_key then - --MakeKeybindWindow( path, option, hotkey ) - MakeKeybindWindow( path, option ) - end - end - - local hklength = math.max( hotkeystring:len() * 10, 20) - local control2 = control - control.x = 0 - control.right = hklength+2 --room for hotkey button on right side? - control:DetectRelativeBounds() - - local hkbutton = Button:New{ - minHeight = 30, - --right=0, --Note: uncommenting this entry cause hotkey-button's position to overlap with control-button's position. It happen after Chili merge/update (???) - width = hklength, - --x=-30, - caption = hotkeystring, - OnMouseUp = { kbfunc }, - backgroundColor = color.sub_button_bg, - textColor = color.sub_button_fg, - tooltip = 'Hotkey: ' .. hotkeystring, - } - - return StackPanel:New{ - width = "100%", - orientation='horizontal', - resizeItems = false, - centerItems = false, - autosize = true, - itemMargin = {0,0,0,0}, - margin = {0,0,0,0}, - itemPadding = {2,0,-hklength-2,0}, --{left,top,right,bottom}. Note: removing -hklength-2 padding causes wide empty space to appear between control-buttons and hotkey-buttons. This happen after Chili update/merge (???) - padding = {0,0,0,0}, - children={ - control2, - hkbutton - }, - } -end - -local function ResetWinSettings(path) - for _,elem in ipairs(pathoptions[path]) do - local option = elem[2] - - if not ({button=1, label=1, menu=1})[option.type] then - if option.default ~= nil then --fixme : need default - if option.type == 'bool' or option.type == 'number' then - option.value = option.valuelist and GetIndex(option.valuelist, option.default) or option.default - option.checked = option.value - option.OnChange(option) - elseif option.type == 'list' or option.type == 'radioButton' then - option.value = option.default - option.OnChange(option.default) - elseif option.type == 'colors' then - option.color = option.default - option.OnChange(option) - end - else - Spring.Log(widget:GetInfo().name, "error", ' Error #627', option.name, option.type) - end - end - end -end - ---[[ WIP -WG.crude.MakeHotkey = function(path, optionkey) - local option = pathoptions[path][optionkey] - local hotkey, hotkeystring = GetHotkeyData(path, option) - if not get_key then - MakeKeybindWindow( path, option, hotkey ) - end - -end ---]] - --- Make submenu window based on index from flat window list ---local function MakeSubWindow(key) -MakeSubWindow = function(path) - - if not pathoptions[path] then return end - - local explodedpath = explode('/', path) - explodedpath[#explodedpath] = nil - local parent_path = table.concat(explodedpath,'/') - - local settings_height = #(pathoptions[path]) * B_HEIGHT - local settings_width = 270 - - local tree_children = {} - local hotkeybuttons = {} - - for _,elem in ipairs(pathoptions[path]) do - local option = elem[2] - - local optionkey = option.key - - --fixme: shouldn't be needed - if not option.OnChange then - option.OnChange = function(self) end - end - if not option.desc then - option.desc = '' - end - - - if option.advanced and not settings.config['epic_Settings_Show_Advanced_Settings'] then - --do nothing - elseif option.type == 'button' then - local hide = false - - if option.wname == 'epic' then --menu - local menupath = option.desc - if pathoptions[menupath] and #(pathoptions[menupath]) == 0 then - hide = true - settings_height = settings_height - B_HEIGHT - end - end - - if not hide then - local button = Button:New{ - x=0, - --right = 30, - minHeight = 30, - caption = option.name, - OnMouseUp = {option.OnChange}, - backgroundColor = color.sub_button_bg, - textColor = color.sub_button_fg, - tooltip = option.desc - } - tree_children[#tree_children+1] = MakeHotkeyedControl(button, path, option) - end - - elseif option.type == 'label' then - tree_children[#tree_children+1] = Label:New{ caption = option.value or option.name, textColor = color.sub_header, } - - elseif option.type == 'text' then - tree_children[#tree_children+1] = - Button:New{ - width = "100%", - minHeight = 30, - caption = option.name, - OnMouseUp = { function() MakeHelp(option.name, option.value) end }, - backgroundColor = color.sub_button_bg, - textColor = color.sub_button_fg, - tooltip=option.desc - } - - elseif option.type == 'bool' then - local chbox = Checkbox:New{ - x=0, - right = 35, - caption = option.name, - checked = option.value or false, - - OnMouseUp = { option.OnChange, }, - textColor = color.sub_fg, - tooltip = option.desc, - } - tree_children[#tree_children+1] = MakeHotkeyedControl(chbox, path, option) - - elseif option.type == 'number' then - settings_height = settings_height + B_HEIGHT - tree_children[#tree_children+1] = Label:New{ caption = option.name, textColor = color.sub_fg, } - if option.valuelist then - option.value = GetIndex(option.valuelist, option.value) - end - tree_children[#tree_children+1] = - Trackbar:New{ - width = "100%", - caption = option.name, - value = option.value, - trackColor = color.sub_fg, - min=option.min or 0, - max=option.max or 100, - step=option.step or 1, - OnMouseUp = { option.OnChange }, - tooltip=option.desc, - --useValueTooltip=true, - } - - elseif option.type == 'list' then - tree_children[#tree_children+1] = Label:New{ caption = option.name, textColor = color.sub_header, } - local items = {}; - for i=1, #option.items do - local item = option.items[i] - settings_height = settings_height + B_HEIGHT - tree_children[#tree_children+1] = Button:New{ - width = "100%", - caption = item.name, - OnMouseUp = { function(self) option.OnChange(item.key) end }, - backgroundColor = color.sub_button_bg, - textColor = color.sub_button_fg, - tooltip=item.desc, - } - end - --[[ - tree_children[#tree_children+1] = ComboBox:New { - items = items; - } - ]]-- - elseif option.type == 'radioButton' then - tree_children[#tree_children+1] = Label:New{ caption = option.name, textColor = color.sub_header, } - for i=1, #option.items do - local item = {} - item.wname = option.wname.."radioButton" -- wname is needed by Hotkey to 'AddAction' - item.name = option.items[i].name --is needed by checkbox caption - item.key = option.items[i].key --is needed to set checkbox status - item.desc = option.items[i].desc --is needed for checkbox tooltip - item.OnChange = function() option.OnChange(item.key) end --encapsulate OnChange() with a fixed input (item.key). Is needed for Hotkey - settings_height = settings_height + B_HEIGHT - tree_children[#tree_children+1] = MakeHotkeyedControl( - Checkbox:New{ - x=0, - right = 35, - caption = item.name, - checked = (option.value == item.key), - OnMouseUp = {function(self) option.OnChange(item.key) end}, - textColor = color.sub_fg, - tooltip=item.desc, - }, path, item) - end - elseif option.type == 'colors' then - settings_height = settings_height + B_HEIGHT*2.5 - tree_children[#tree_children+1] = Label:New{ caption = option.name, textColor = color.sub_fg, } - tree_children[#tree_children+1] = - Colorbars:New{ - width = "100%", - height = B_HEIGHT*2, - tooltip=option.desc, - color = option.value or {1,1,1,1}, - OnMouseUp = { option.OnChange, }, - } - - end - end - - local window_height = 400 - if settings_height < window_height then - window_height = settings_height+10 - end - local window_width = 300 - - - local window_children = {} - window_children[#window_children+1] = - ScrollPanel:New{ - x=0,y=15, - bottom=B_HEIGHT+20, - width = '100%', - children = { - StackPanel:New{ - x=0, - y=0, - right=0, - orientation = "vertical", - --width = "100%", - height = "100%", - backgroundColor = color.sub_bg, - children = tree_children, - itemMargin = {2,2,2,2}, - resizeItems = false, - centerItems = false, - autosize = true, - }, - - } - } - - window_height = window_height + B_HEIGHT - local backButton - --back button - if parent_path then - window_children[#window_children+1] = Button:New{ caption = 'Back', OnMouseUp = { KillSubWindow, function() MakeSubWindow(parent_path) end, }, - backgroundColor = color.sub_back_bg,textColor = color.sub_back_fg, x=0, bottom=1, width='33%', height=B_HEIGHT, } - end - - - --reset button - window_children[#window_children+1] = Button:New{ caption = 'Reset', OnMouseUp = { function() ResetWinSettings(path); RemakeEpicMenu(); end }, - textColor = color.sub_close_fg, backgroundColor = color.sub_close_bg, width='33%', x='33%', right='33%', bottom=1, height=B_HEIGHT, } - - - --close button - window_children[#window_children+1] = Button:New{ caption = 'Close', OnMouseUp = { KillSubWindow }, - textColor = color.sub_close_fg, backgroundColor = color.sub_close_bg, width='33%', x='66%', right=1, bottom=1, height=B_HEIGHT, } - - - - KillSubWindow() - curPath = path -- must be done after KillSubWindow - window_sub_cur = Window:New{ - caption=path, - x = settings.sub_pos_x, - y = settings.sub_pos_y, - clientWidth = window_width, - clientHeight = window_height+B_HEIGHT*4, - minWidth = 250, - minHeight = 350, - --resizable = false, - parent = settings.show_crudemenu and screen0 or nil, - backgroundColor = color.sub_bg, - children = window_children, - } - AdjustWindow(window_sub_cur) -end - --- Show or hide menubar -local function ShowHideCrudeMenu() - --WG.crude.visible = settings.show_crudemenu -- HACK set it to wg to signal to player list - if settings.show_crudemenu then - if window_crude then - screen0:AddChild(window_crude) - --WG.chat.showConsole() - --window_crude:UpdateClientArea() - end - if window_sub_cur then - screen0:AddChild(window_sub_cur) - end - else - if window_crude then - screen0:RemoveChild(window_crude) - --WG.chat.hideConsole() - end - if window_sub_cur then - screen0:RemoveChild(window_sub_cur) - end - end - if window_sub_cur then - AdjustWindow(window_sub_cur) - end -end - -local function MakeMenuBar() - local btn_padding = {4,3,2,2} - local btn_margin = {0,0,0,0} - local exit_menu_width = 210 - local exit_menu_height = 200 - local exit_menu_btn_width = 7*exit_menu_width/8 - local exit_menu_btn_height = max(exit_menu_height/8, 30) - local exit_menu_cancel_width = exit_menu_btn_width/2 - local exit_menu_cancel_height = 2*exit_menu_btn_height/3 - - local crude_width = 445 - local crude_height = B_HEIGHT+10 - - - lbl_fps = Label:New{ name='lbl_fps', caption = 'FPS:', textColor = color.sub_header, } - lbl_gtime = Label:New{ name='lbl_gtime', caption = 'Time:', width = 45, height=5, textColor = color.sub_header, } - lbl_clock = Label:New{ name='lbl_clock', caption = 'Clock:', width = 45, height=5, textColor = color.main_fg, } -- autosize=false, } - img_flag = Image:New{ tooltip='Choose Your Location', file=":cn:".. LUAUI_DIRNAME .. "Images/flags/".. settings.country ..'.png', width = 16,height = 11, OnClick = { MakeFlags }, margin={4,4,4,4} } - - local screen_width,screen_height = Spring.GetWindowGeometry() - - window_exit = Window:New{ - name='exitwindow', - x = screen_width/2 - exit_menu_width/2, - y = screen_height/2 - exit_menu_height/2, - dockable = false, - clientWidth = exit_menu_width, - clientHeight = exit_menu_height, - draggable = false, - tweakDraggable = true, - resizable = false, - minimizable = false, - backgroundColor = color.main_bg, - color = {nil,nil,nil,0.5}, - margin = {0,0,0,0}, - padding = {0,0,0,0}, - - children = { - - Label:New{ - caption = 'Would you like to quit?', - width = exit_menu_width, - x = 0, - y = 2*exit_menu_height/64, - align="center", - textColor = color.main_fg }, ---[[ - Button:New{ - caption = "Vote Resign", - OnMouseUp = { function() - spSendCommands("say !voteresign") --after this gui_chili_vote.lua will handle vote GUI - screen0:RemoveChild(window_exit) - exitWindowVisible = false - end, }, - tooltip = "Ask teammate to resign", - height=exit_menu_btn_height, - width=exit_menu_btn_width, - x = exit_menu_width/2 - exit_menu_btn_width/2, - y = 20*exit_menu_height/64 - exit_menu_btn_height/2, - }, -]]-- - Button:New{ - caption = "Resign and Spectate", - OnMouseUp = { function() - spSendCommands{"spectator"} - screen0:RemoveChild(window_exit) - exitWindowVisible = false - end, }, - tooltip = "Abandon team and become a spectator", - height=exit_menu_btn_height, - width=exit_menu_btn_width, - x = exit_menu_width/2 - exit_menu_btn_width/2, - y = 20*exit_menu_height/64 - exit_menu_btn_height/2, - }, - - - Button:New{ - caption = "Exit game", OnMouseUp = { function() spSendCommands{"quit","quitforce"} end, }, - tooltip = "Leave the game completely", - height=exit_menu_btn_height, - width=exit_menu_btn_width, - x = exit_menu_width/2 - exit_menu_btn_width/2, - y = 40*exit_menu_height/64 - exit_menu_btn_height/2, - }, - - Button:New{ - caption = "Cancel", - OnMouseUp = { function() - screen0:RemoveChild(window_exit) - exitWindowVisible = false - end, }, - - height=exit_menu_cancel_height, - width=exit_menu_cancel_width, - x = 4*exit_menu_width/8, -- exit_menu_cancel_width, - y = 58*exit_menu_height/64 - exit_menu_cancel_height/2, - }, - }, - } - - screen0:RemoveChild(window_exit) - - window_crude = Window:New{ - name='epicmenubar', - right = 0, - y = 70, -- resbar height - dockable = true, - clientWidth = crude_width, - clientHeight = crude_height, - draggable = false, - tweakDraggable = true, - resizable = false, - minimizable = false, - backgroundColor = color.main_bg, - color = {nil,nil,nil,0.5}, - margin = {0,0,0,0}, - padding = {0,0,0,0}, - - children = { - StackPanel:New{ - name='stack_main', - orientation = 'horizontal', - width = '100%', - height = '100%', - resizeItems = false, - padding = {0,0,0,0}, - itemPadding = {1,1,1,1}, - itemMargin = {1,1,1,1}, - autoArrangeV = false, - autoArrangeH = false, - - children = { - --GAME LOGO GOES HERE - Image:New{ tooltip = title_text, file = title_image, height=B_HEIGHT, width=B_HEIGHT, }, - - -- odd-number button width keeps image centered - Button:New{ - caption = "", OnMouseUp = { function() MakeSubWindow('Game') end, }, textColor=color.game_fg, height=B_HEIGHT+4, width=B_HEIGHT+5, - padding = btn_padding, margin = btn_margin, tooltip = 'Game Actions and Settings...', - children = { - Image:New{file=LUAUI_DIRNAME .. 'Images/epicmenu/game.png', height=B_HEIGHT-2,width=B_HEIGHT-2}, - }, - }, - Button:New{ - caption = "", OnMouseUp = { function() MakeSubWindow('Settings') end, }, textColor=color.menu_fg, height=B_HEIGHT+4, width=B_HEIGHT+5, - padding = btn_padding, margin = btn_margin, tooltip = 'General Settings...', - children = { - Image:New{ tooltip = 'Settings', file=LUAUI_DIRNAME .. 'Images/epicmenu/settings.png', height=B_HEIGHT-2,width=B_HEIGHT-2, }, - }, - }, - Button:New{ - caption = "", OnMouseUp = { function() spSendCommands{"luaui tweakgui"} end, }, textColor=color.menu_fg, height=B_HEIGHT+4, width=B_HEIGHT+5, - padding = btn_padding, margin = btn_margin, tooltip = "Move and resize parts of the user interface (\255\0\255\0Ctrl+F11\008) (Hit ESC to exit)", - children = { - Image:New{ file=LUAUI_DIRNAME .. 'Images/epicmenu/move.png', height=B_HEIGHT-2,width=B_HEIGHT-2, }, - }, - }, - - Grid:New{ - height = '100%', - width = 100, - columns = 2, - rows = 2, - resizeItems = false, - margin = {0,0,0,0}, - padding = {0,0,0,0}, - itemPadding = {1,1,1,1}, - itemMargin = {1,1,1,1}, - - - children = { - --Label:New{ caption = 'Vol', width = 20, textColor = color.main_fg }, - Image:New{ tooltip = 'Volume', file=LUAUI_DIRNAME .. 'Images/epicmenu/vol.png', width= 18,height= 18, }, - Trackbar:New{ - tooltip = 'Volume', - height=15, - width=70, - trackColor = color.main_fg, - value = spGetConfigInt("snd_volmaster", 50), - OnChange = { function(self) spSendCommands{"set snd_volmaster " .. self.value} end }, - }, - - Image:New{ tooltip = 'Music', file=LUAUI_DIRNAME .. 'Images/epicmenu/vol_music.png', width= 18,height= 18, }, - Trackbar:New{ - tooltip = 'Music', - height=15, - width=70, - min = 0, - max = 1, - step = 0.01, - trackColor = color.main_fg, - value = settings.music_volume or 0.5, - prevValue = settings.music_volume or 0.5, - OnChange = { - function(self) - if (WG.music_start_volume or 0 > 0) then - Spring.SetSoundStreamVolume(self.value / WG.music_start_volume) - else - Spring.SetSoundStreamVolume(self.value) - end - settings.music_volume = self.value - WG.music_volume = self.value - if (self.prevValue > 0 and self.value <=0) then widgetHandler:DisableWidget("Music Player") end - if (self.prevValue <=0 and self.value > 0) then widgetHandler:EnableWidget("Music Player") end - self.prevValue = self.value - end - }, - }, - }, - - }, - - - Grid:New{ - orientation = 'horizontal', - columns = 2, - rows = 2, - width = 140, - height = '100%', - --height = 40, - resizeItems = true, - autoArrangeV = true, - autoArrangeH = true, - padding = {0,0,0,0}, - itemPadding = {0,0,0,0}, - itemMargin = {0,0,0,0}, - - children = { - - lbl_fps, - StackPanel:New{ - orientation = 'horizontal', - width = 60, - height = '100%', - resizeItems = false, - autoArrangeV = false, - autoArrangeH = false, - padding = {0,0,0,0}, - itemMargin = {2,0,0,0}, - children = { - Image:New{ file= LUAUI_DIRNAME .. 'Images/epicmenu/game.png', width = 20,height = 20, }, - lbl_gtime, - }, - }, - - - img_flag, - StackPanel:New{ - orientation = 'horizontal', - width = 90, - height = '100%', - resizeItems = false, - autoArrangeV = false, - autoArrangeH = false, - padding = {0,0,0,0}, - itemMargin = {2,0,0,0}, - children = { - Image:New{ file= LUAUI_DIRNAME .. 'Images/clock.png', width = 20,height = 20, }, - lbl_clock, - }, - }, - - }, - }, - - Button:New{ - caption = "", OnMouseUp = { function() MakeSubWindow('Help') end, }, textColor=color.menu_fg, height=B_HEIGHT+4, width=B_HEIGHT+5, - padding = btn_padding, margin = btn_margin, tooltip = 'Help...', - children = { - Image:New{ file=LUAUI_DIRNAME .. 'Images/epicmenu/questionmark.png', height=B_HEIGHT-2,width=B_HEIGHT-2, }, - }, - }, - Button:New{ - caption = "", OnMouseUp = { function() - if not exitWindowVisible then - screen0:AddChild(window_exit) - exitWindowVisible = true - end - end, }, - textColor=color.menu_fg, height=B_HEIGHT+4, width=B_HEIGHT+5, - padding = btn_padding, margin = btn_margin, tooltip = 'Exit or Resign...', - children = { - Image:New{file=LUAUI_DIRNAME .. 'Images/epicmenu/quit.png', height=B_HEIGHT-2,width=B_HEIGHT-2, }, - }, - }, - } - } - } - } - ShowHideCrudeMenu() -end - ---Remakes crudemenu and remembers last submenu open -RemakeEpicMenu = function() - local lastPath = curPath - KillSubWindow() - if lastPath ~= '' then - MakeSubWindow(lastPath) - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:ViewResize(vsx, vsy) - scrW = vsx - scrH = vsy -end - - -function widget:Initialize() - - if (not WG.Chili) then - widgetHandler:RemoveWidget(widget) - return - end - init = true - - - spSendCommands("unbindaction hotbind") - spSendCommands("unbindaction hotunbind") - - - -- setup Chili - Chili = WG.Chili - Button = Chili.Button - Label = Chili.Label - Colorbars = Chili.Colorbars - Checkbox = Chili.Checkbox - Window = Chili.Window - ScrollPanel = Chili.ScrollPanel - StackPanel = Chili.StackPanel - LayoutPanel = Chili.LayoutPanel - Grid = Chili.Grid - Trackbar = Chili.Trackbar - TextBox = Chili.TextBox - Image = Chili.Image - Progressbar = Chili.Progressbar - Colorbars = Chili.Colorbars - screen0 = Chili.Screen0 - - - - widget:ViewResize(Spring.GetViewGeometry()) - - -- Set default positions of windows on first run - if not settings.sub_pos_x then - settings.sub_pos_x = scrW/2 - settings.sub_pos_y = scrH/2 - end - if not settings.wl_x then -- widget list - settings.wl_h = 0.7*scrH - settings.wl_w = 300 - - settings.wl_x = (scrW - settings.wl_w)/2 - settings.wl_y = (scrH - settings.wl_h)/2 - end - if not keybounditems then - keybounditems = {} - end - if not settings.config then - settings.config = {} - end - - if not settings.country or settings.country == 'wut' then - myCountry = select(8, Spring.GetPlayerInfo( Spring.GetLocalPlayerID() ) ) - if not myCountry or myCountry == '' then - myCountry = 'wut' - end - settings.country = myCountry - end - - WG.country = settings.country - WG.lang = settings.lang - - -- add custom widget settings to crudemenu - AddAllCustSettings() - - - --this is done to establish order the correct button order - AddOption('Settings/Reset Settings') - AddOption('Settings/Audio') - AddOption('Settings/Camera') - AddOption('Settings/Graphics') - AddOption('Settings/HUD Panels') - AddOption('Settings/Interface') - AddOption('Settings/Misc') - - - -- Add pre-configured button/options found in epicmenu config file - local options_temp = CopyTable(epic_options, true) - for i=1, #options_temp do - local option = options_temp[i] - AddOption(option.path, option) - end - - -- Clears all saved settings of custom widgets stored in crudemenu's config - WG.crude.ResetSettings = function() - for path, _ in pairs(pathoptions) do - ResetWinSettings(path) - end - RemakeEpicMenu() - echo 'Cleared all settings.' - end - - -- clear all keybindings - WG.crude.ResetKeys = function() - keybounditems = {} - keybounditems = CopyTable(defaultkeybinds, true) --restore with mods zkkey's default value - - --restore with widget's default value: - for path, subtable in pairs ( pathoptions) do - for _,element in ipairs(subtable) do - local option = element[2] - local defaultHotkey = option.orig_hotkey - if defaultHotkey then - option.hotkey = defaultHotkey --make chili menu display the default hotkey - local actionName = GetActionName(path, option) - otset( keybounditems, actionName, defaultHotkey) --save default hotkey to zkkey - end - end - end - - ReApplyKeybinds() --unbind all hotkey and re-attach with stuff in keybounditems table - echo 'Reset all hotkeys to default.' - end - - -- get hotkey - WG.crude.GetHotkey = function(actionName) --Note: declared here because keybounditems must not be empty - local actionHotkey = GetActionHotkey(actionName) - --local hotkey = keybounditems[actionName] or actionHotkey - local hotkey = otget( keybounditems, actionName ) or actionHotkey - if not hotkey or hotkey == 'none' then - return '' - end - if type(hotkey) == 'table' then - hotkey = hotkey[1] - end - return GetReadableHotkey(hotkey) - end - - -- set hotkey - WG.crude.SetHotkey = function(actionName, hotkey, func) --Note: declared here because pathoptions must not be empty - if hotkey then - hotkey = GetReadableHotkey(hotkey) --standardize hotkey (just in case stuff happen) - end - if hotkey == '' then - hotkey = nil --convert '' into NIL. - end - if func then - if hotkey then - AddAction(actionName, func, nil, "t") --attach function to action - else - RemoveAction(actionName) --detach function from action - end - end - if hotkey then - AssignKeyBindAction(hotkey, actionName, false) --attach action to keybinds - else - UnassignKeyBind(actionName,false) --detach action from keybinds - end - otset(keybounditems, actionName, hotkey) --update epicmenu's hotkey table - for path, subtable in pairs (pathoptions) do - for _,element in ipairs(subtable) do - local option = element[2] - local indirectActionName = GetActionName(path, option) - local directActionName = option.action - if indirectActionName==actionName or directActionName == actionName then - option.hotkey = hotkey or "None" --update pathoption hotkey for Chili menu display & prevent conflict with hotkey registerd by Chili . Note: LUA is referencing table, so we don't need to change same table elsewhere. - end - end - end - end - - -- Add custom actions for the following keybinds - AddAction("crudemenu", ActionMenu, nil, "t") - AddAction("exitwindow", ActionExitWindow, nil, "t") - - MakeMenuBar() - - useUiKeys = settings.config['epic_Settings/Misc_Use_uikeys.txt'] - - if not useUiKeys then - spSendCommands("unbindall") - else - echo('You have opted to use the engine\'s uikeys.txt. The menu keybind system will not be used.') - end - - LoadKeybinds() - ReApplyKeybinds() - - -- Override widgethandler functions for the purposes of alerting crudemenu - -- when widgets are loaded, unloaded or toggled - widgetHandler.OriginalInsertWidget = widgetHandler.InsertWidget - widgetHandler.InsertWidget = function(self, widget) - PreIntegrateWidget(widget) - - local ret = self:OriginalInsertWidget(widget) - - if type(widget) == 'table' and type(widget.options) == 'table' then - IntegrateWidget(widget, true) - if not (init) then - RemakeEpicMenu() - end - end - - - checkWidget(widget) - return ret - end - - widgetHandler.OriginalRemoveWidget = widgetHandler.RemoveWidget - widgetHandler.RemoveWidget = function(self, widget) - local ret = self:OriginalRemoveWidget(widget) - if type(widget) == 'table' and type(widget.options) == 'table' then - IntegrateWidget(widget, false) - if not (init) then - RemakeEpicMenu() - end - end - - checkWidget(widget) - return ret - end - - widgetHandler.OriginalToggleWidget = widgetHandler.ToggleWidget - widgetHandler.ToggleWidget = function(self, name) - local ret = self:OriginalToggleWidget(name) - - local w = widgetHandler:FindWidget(name) - if w then - checkWidget(w) - else - checkWidget(name) - end - return ret - end - init = false - - --intialize remote menu trigger - WG.crude.OpenPath = function(path) --Note: declared here so that it work in local copy - MakeSubWindow(path) - end - - --intialize remote menu trigger 2 - WG.crude.ShowMenu = function() --Note: declared here so that it work in local copy - if not settings.show_crudemenu then - settings.show_crudemenu = true - ShowHideCrudeMenu() - end - end -end - -function widget:Shutdown() - -- Restore widgethandler functions to original states - if widgetHandler.OriginalRemoveWidget then - widgetHandler.InsertWidget = widgetHandler.OriginalInsertWidget - widgetHandler.OriginalInsertWidget = nil - - widgetHandler.RemoveWidget = widgetHandler.OriginalRemoveWidget - widgetHandler.OriginalRemoveWidget = nil - - widgetHandler.ToggleWidget = widgetHandler.OriginalToggleWidget - widgetHandler.OriginalToggleWidget = nil - end - - - if window_crude then - screen0:RemoveChild(window_crude) - end - if window_sub_cur then - screen0:RemoveChild(window_sub_cur) - end - - RemoveAction("crudemenu") - - -- restore key binds - --[[ - spSendCommands({ - "bind esc quitmessage", - "bind esc quitmenu", -- FIXME made for licho, removed after 0.82 release - }) - --]] - spSendCommands("unbind esc crudemenu") -end - - -function widget:GetConfigData() - SaveKeybinds() - return settings -end - -function widget:SetConfigData(data) - if (data and type(data) == 'table') then - if data.versionmin and data.versionmin >= 50 then - settings = data - end - end - WG.music_volume = settings.music_volume or 0.5 - LoadKeybinds() -end - -function widget:Update() - cycle = cycle%32+1 - if cycle == 1 then - --Update clock, game timer and fps meter that show on menubar - if lbl_fps then - lbl_fps:SetCaption( 'FPS: ' .. Spring.GetFPS() ) - end - if lbl_gtime then - lbl_gtime:SetCaption( GetTimeString() ) - end - if lbl_clock then - --local displaySeconds = true - --local format = displaySeconds and "%H:%M:%S" or "%H:%M" - local format = "%H:%M" --fixme: running game for over an hour pushes time label down - --lbl_clock:SetCaption( 'Clock\n ' .. os.date(format) ) - lbl_clock:SetCaption( os.date(format) ) - end - end -end - - -function widget:KeyPress(key, modifier, isRepeat) - if key == KEYSYMS.LCTRL - or key == KEYSYMS.RCTRL - or key == KEYSYMS.LALT - or key == KEYSYMS.RALT - or key == KEYSYMS.LSHIFT - or key == KEYSYMS.RSHIFT - or key == KEYSYMS.LMETA - or key == KEYSYMS.RMETA - or key == KEYSYMS.SPACE - then - - return - end - - local modstring = - (modifier.alt and 'A+' or '') .. - (modifier.ctrl and 'C+' or '') .. - (modifier.meta and 'M+' or '') .. - (modifier.shift and 'S+' or '') - - --Set a keybinding - if get_key then - get_key = false - window_getkey:Dispose() - translatedkey = transkey[ keysyms[''..key]:lower() ] or keysyms[''..key]:lower() - --local hotkey = { key = translatedkey, mod = modstring, } - local hotkey = modstring .. translatedkey - - if key ~= KEYSYMS.ESCAPE then - --otset( keybounditems, kb_action, hotkey ) - AssignKeyBindAction(hotkey, kb_action, true) -- param4 = verbose - otset( keybounditems, kb_action, hotkey ) - - end - ReApplyKeybinds() - - if kb_path == curPath then - MakeSubWindow(kb_path) - end - - return true - end - -end - -function ActionExitWindow() - if exitWindowVisible then - screen0:RemoveChild(window_exit) - exitWindowVisible = false - else - screen0:AddChild(window_exit) - exitWindowVisible = true - end -end - -function ActionMenu() - settings.show_crudemenu = not settings.show_crudemenu - ShowHideCrudeMenu() -end - -function WG.crude.ShowMenu() --// allow other widget to toggle-up Epic-Menu. This'll enable access to game settings' Menu via click on other GUI elements. - if not settings.show_crudemenu then - settings.show_crudemenu = true - ShowHideCrudeMenu() - end -end - ---// [[ see comments in epicmenu conf (about "radioButton" camera option). UPDATE: propose re-enable "radioButton" camera option -do --Set our prefered camera mode when first screen frame is drawn. The engine always go to default TA at first screen frame, so we need to re-apply our camera settings. - if Spring.GetGameFrame() == 0 then --we check if this code is run at midgame (due to /reload). In that case we don't need to re-apply settings (the camera mode is already set at gui_epicmenu.lua\AddOption()). - local screenFrame = 0 - function widget:DrawScreen() --game event: Draw Screen - if screenFrame >= 1 then --detect frame no.2 - local option = alloptions["Settings/CameraSettings/CameraCamera Type"] --get camera option we saved earlier in gui_epicmenu.lua\AddOption() - option.OnChange(option.value) --re-apply our settings - Spring.Echo("Epicmenu: Switching to " .. option.value .. " camera mode") --notify in log what happen. - widgetHandler:RemoveWidgetCallIn("DrawScreen", self) --stop updating "widget:DrawScreen()" event. Note: this is a special "widgetHandler:RemoveCallin" for widget that use "handler=true". - end - screenFrame = screenFrame+1 - end - end -end ---]] \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_evo_defaultgui_layout.lua b/LuaUI/Widgets_Evo/gui_evo_defaultgui_layout.lua new file mode 100644 index 000000000..fcca550ed --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_evo_defaultgui_layout.lua @@ -0,0 +1,370 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_EVO_Layout.lua +-- author: jK +-- based heavily on code by: Dave Rodgers (aka trepan) +-- orig. filename: layout.lua +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "EVO Default Engine Gui Layout", + desc = "Sets the control panel to EVO default", + author = "jK and trepan, mixed by lurker and DeadnightWarrior", + date = "Feb 3, 2008", + license = "GNU GPL, v2 or later", + layer = -10, + handler = true, + enabled = false -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +include("colors.h.lua") + +local floor = math.floor +local glColor = gl.Color +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glBeginText = gl.BeginText +local glEndText = gl.EndText +local glText = gl.Text +local glTexture = gl.Texture + +local langSuffix = Spring.GetConfigString('Language', 'fr') +local l10nName = 'L10N/commands_' .. langSuffix .. '.lua' +local success, translations = pcall(VFS.Include, l10nName) +if (not success) then + translations = nil +end + +-- for DefaultHandler +local FrameTex = "bitmaps/icons/frame_slate_128x96.png" +local FrameScale = "&0.099x0.132&" +local PageNumTex = "bitmaps/icons/frame_slate_128x96.png" +local btns = {} + +if (false) then -- disable textured buttons? + FrameTex = "" + PageNumTex = "" +end + +local PageNumCmd = { + name = "1", + iconname = PageNumTexture, + tooltip = "Active Page Number\n(click to toggle buildiconsfirst)", + actions = { "buildiconsfirst", "firstmenu" } +} + +local engineVersion = (Game and Game.version) or (Engine and Engine.version) or "Engine version error" +if (engineVersion:find("0.75")==nil)or(engineVersion:find("svn")) then + PageNumCmd.texture = PageNumCmd.iconname + PageNumCmd.iconname = nil +end + +local X, Y +local TweakPosX, TweakPosY +local btnOffset, txtOffset +local bntTxtSize, TweakTitleSize +local rowSize, btnSize +-------------------------------------------------------------------------------- + +local function CustomLayoutHandler(xIcons, yIcons, cmdCount, commands) + + widgetHandler.commands = commands + --widgetHandler.commands.n = cmdCount + widgetHandler:CommandsChanged() + + -- FIXME: custom commands + if (cmdCount <= 0) then + return "", xIcons, yIcons, {}, {}, {}, {}, {}, {}, {}, {} + end + + local menuName = '' + local removeCmds = {} + local customCmds = widgetHandler.customCommands + local onlyTexCmds = {} + local reTexCmds = {} + local reNamedCmds = {} + local reTooltipCmds = {} + local reParamsCmds = {} + local iconList = {} + + local ipp + if cmdCount-2 > xIcons * (yIcons+1) then + ipp = (xIcons * yIcons) -- iconsPerPage + else + ipp = (xIcons * (yIcons + 1)) + end + + local activePage = Spring.GetActivePage() + + local prevCmd = cmdCount - 1 + local nextCmd = cmdCount - 0 + local prevPos = ipp - xIcons + local nextPos = ipp - 1 + if (prevCmd >= 1) then reTexCmds[prevCmd] = FrameTex end + if (nextCmd >= 1) then reTexCmds[nextCmd] = FrameTex end + + local pageNumCmd = -1 + local pageNumPos = (prevPos + nextPos) / 2 + if (xIcons > 2) then + local color + if (commands[1].id < 0) then color = GreenStr else color = RedStr end + local activePage = activePage or 0 + local pageNum = '' .. (activePage + 1) .. '' + PageNumCmd.name = color .. ' ' .. pageNum .. ' ' + table.insert(customCmds, PageNumCmd) + pageNumCmd = cmdCount + 1 + end + + local pos = 0; + local firstSpecial = ipp - xIcons + + for cmdSlot = 1, (cmdCount - 2) do + + -- fill the last row with special buttons + while (math.fmod(pos, ipp) >= firstSpecial) do + pos = pos + 1 + end + + local onLastRow = (math.abs(math.fmod(pos, ipp)) < 0.1) + + if (onLastRow) then + local pageStart = math.floor(ipp * math.floor(pos / ipp)) + if (pageStart > 0) then + iconList[prevPos + pageStart] = prevCmd + iconList[nextPos + pageStart] = nextCmd + if (pageNumCmd > 0) then + iconList[pageNumPos + pageStart] = pageNumCmd + end + end + if (pageStart == ipp) then + iconList[prevPos] = prevCmd + iconList[nextPos] = nextCmd + if (pageNumCmd > 0) then + iconList[pageNumPos] = pageNumCmd + end + end + end + + -- add the command icons to iconList + local cmd = commands[cmdSlot] + + if ((cmd ~= nil) and (cmd.hidden == false)) then + + iconList[pos] = cmdSlot + pos = pos + 1 + + local cmdTex = cmd.texture or "" -- FIXME 0.75b2 compatibility + + if (translations) then + local trans = translations[cmd.id] + if (trans) then + reTooltipCmds[cmdSlot] = trans.desc + if (not trans.params) then + if (cmd.id ~= CMD.STOCKPILE) then + reNamedCmds[cmdSlot] = trans.name + end + else + local num = tonumber(cmd.params[1]) + if (num) then + num = (num + 1) + cmd.params[num] = trans.params[num] + reParamsCmds[cmdSlot] = cmd.params + end + end + end + end + end + end + + return menuName, xIcons, yIcons, + removeCmds, customCmds, + onlyTexCmds, reTexCmds, + reNamedCmds, reTooltipCmds, reParamsCmds, + iconList +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local Echo = Spring.Echo + +local commonConfig = { +"outlinefont 1", +"dropShadows 1", +"useOptionLEDs 1", +"textureAlpha 1.0", +"frameAlpha 0.5", +"selectGaps 1", +"selectThrough 1", + +"xPos 0", +"yPos 0.097", +"ySelectionPos 0.094", +"prevPageSlot auto", +"deadIconSlot none", +"nextPageSlot auto", +"textBorder 0.0025", +"iconBorder 0.0005", +"frameBorder 0.000", + +} + +local config = {} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + widgetHandler:DisableWidget("Red Build/Order Menu") + if not btns.x or not btns.y then + btns = {x = 5, y = 11} + end + X, Y = Spring.GetViewGeometry() + local maxButSize=(1-0.097-0.31-4/Y)/btns.y-.0005 + TweakPosX = floor((maxButSize+0.0005)*btns.x*Y*1.12) + TweakPosY = floor(maxButSize*btns.y*Y) + btnOffset, txtOffset = floor(12*Y/1200), floor(48*Y/1200) + bntTxtSize = 22*Y/1200 + TweakTitleSize = 10*Y/1200 + rowSize, btnSize = floor(25*Y/1200), floor(80*Y/1200) + + + config = { + "xIcons " .. btns.x, + "yIcons " .. btns.y, + "xSelectionPos " .. TweakPosX/3/X, + "xIconSize " .. maxButSize*1.12*Y/X, + "yIconSize " .. maxButSize + } + + --[[ + -- 4:3 Screen aspect ratio + if (X/Y == 4/3) then + config = {"xIconSize 0.054375", "yIconSize 0.0725"} + + -- 5:4 Screen aspect ratio + elseif (X/Y == 5/4) then + config = {"xIconSize 0.05704", "yIconSize 0.0713"} + + -- 16:9 Screen aspect ratio + elseif ((X/Y == 16/9) or (X==1366 and Y==768)) then + config = {"xIconSize 0.040", "yIconSize 0.0643"} + + -- 16:10 Screen aspect ratio + elseif (X/Y == 16/10) then + config = {"xIconSize 0.044", "yIconSize 0.0675"} + else + Echo("Control Panel Widget doens't support your " ..X.. "x" ..Y.. " resolution.") + Echo("Call back your default Layout.") + Shutdown() + return + end + --]] + + local file = io.open(LUAUI_DIRNAME .. 'ctrlpanelImp.txt', 'w') + + for k, v in pairs(commonConfig) do + file:write(v .. '\n') + end + for k, v in pairs(config) do + file:write(v .. '\n') + end + + file:close() + Spring.SendCommands('ctrlpanel ' .. LUAUI_DIRNAME .. 'ctrlpanelImp.txt') + + widgetHandler:ConfigLayoutHandler(CustomLayoutHandler) +end + +function widget:Shutdown() + Spring.SendCommands({"ctrlpanel " .. LUAUI_DIRNAME .. "ctrlpanel.txt"}) + widgetHandler:ConfigLayoutHandler(true) +end + + +-- LuaUI Tweak mode + +local TweakAbove + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end --Tweak Mode doesn't work without it +end +function widget:TweakDrawScreen() + glPushMatrix() + glTranslate(TweakPosX, TweakPosY, 0) + glColor(0, 0, 0, 0.5) + for i=0,2 do + glRect(btnOffset,rowSize*i+i,btnSize,rowSize*(i+1)) + end + glColor(1, 1, 1, 1) + glBeginText() + glText('Select button configuration', btnOffset, 3*rowSize+3, TweakTitleSize, 'd') + glText('3 x 8', txtOffset, 2*rowSize, bntTxtSize, 'cd') + glText('4 x 9', txtOffset, rowSize, bntTxtSize, 'cd') + glText('5 x 11', txtOffset, 0, bntTxtSize, 'cd') + glEndText() + glPopMatrix() +end + +function widget:TweakIsAbove(x,y) + if x>TweakPosX and y>TweakPosY and x= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl, vsx,vsy) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl, vsx,vsy) + gl.Texture(false) +end + +-- icons +local useEnergyTexture = "ENERGY_TEXTURE" +local useMetalTexture = "METAL_TEXTURE" +local useSupplyTexture = "SUPPLY_TEXTURE" +local drawIcons = { + ENERGY_TEXTURE = LUAUI_DIRNAME.."Images/energy2.png", + METAL_TEXTURE = LUAUI_DIRNAME.."Images/metal.png", + SUPPLY_TEXTURE = LUAUI_DIRNAME.."Images/supply.png", +} +local function stringSplitIcons(str, convertIconStr, ...) + --[[ Usage notes: + returns a table in the format of { text, icon, text, ... } + length is always an odd number and there can be empty text + if convertIconStr is set to true, it converts strings meant for accessing icons like "SOME_ICON" into "someIcon" + ]] + local result = {} + local lengResult = 0 + local icons = {...} + local lengIcons = #icons + local i = 1 + local lengStr = #str + while true do + local minPos = math.huge + local lengChosenIcon = 0 + for j = 1, lengIcons do + local pos = str:find(icons[j], i) or math.huge + if minPos > pos then minPos, lengChosenIcon = pos, #icons[j] end + end + if minPos == math.huge then + lengResult = lengResult + 1 + result[lengResult] = str:sub(i, #str) + return result + else + lengResult = lengResult + 1 + result[lengResult] = str:sub(i, minPos - 1) + lengResult = lengResult + 1 + local iconStr = str:sub(minPos, minPos + lengChosenIcon - 1) + result[lengResult] = convertIconStr and iconStr:lower():gsub("_%a", function(input) return input:sub(2, 2):upper() end) or iconStr + i = minPos + lengChosenIcon + end + end +end +-- + +local TechColour = {"\255\0\205\255", "\255\255\0\255", "\255\0\255\0", "\255\255\0\0"} +local TechToStr = {TechColour[1].."Mark II", TechColour[2].."Mark III", TechColour[3].."Mark IV", TechColour[4].."Hive"} + +-- colours +local supplyColour = "\255\255\128\0" +local energyColour = "\255\255\255\1" +local metalColour = "\255\136\197\226" +local white = "\255\255\255\255" +local generateResColour = "\255\0\255\0" +local useResColour = "\255\255\0\0" +local weaponDamageColour = "\255\255\100\100" +local weaponParalyzeColour = "\255\100\255\255" +-- + +-- Hotkeys +VFS.Include("luaui/configs/evo_buildHotkeysConfig.lua") + +local sGetKeySymbol = Spring.GetKeySymbol +local function getKeySymbol(k) + if k >= 97 and k <= 122 then return string.char(k):upper() end + -- basically unused + local keySymbol = sGetKeySymbol(k) + return keySymbol:sub(1, 1):upper() .. keySymbol:sub(2) +end +local humanNameToKeySymbols = {} +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + local name = ud.name + if name:find("_up", -5) then name = name:sub(1, -5) end + if nameToKeyCode[name] then + local str = "" + local leng = #nameToKeyCode[name] + for i = 1, leng do + str = str .. getKeySymbol(nameToKeyCode[name][i]) + if i < leng then str = str .. " + " end + end + humanNameToKeySymbols[ud.humanName] = str + end +end +-- + +local weaponTypeToStr = { "Light", "Armored", "Building", "Air" } + +local frameSkip = 4 -- draw once every frameSkip+1 frames +local counter = 0 +--[[local xpArr = { +"", +"\255\255\100\0I", +"\255\255\120\50II", +"\255\240\140\75III", +"\255\220\150\100IV", +"\255\200\200\200V", +"\255\210\210\200VI", +"\255\220\220\200VII", +"\255\230\230\200VIII", +"\255\240\240\200IX", +"\255\255\255\200X" +}]] +local tempTooltip = nil +local min = math.min +local floor = math.floor +local ceil = math.ceil +local modf = math.modf +local GetMouseState = Spring.GetMouseState +local TraceScreenRay = Spring.TraceScreenRay +local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetUnitIsCloaked = Spring.GetUnitIsCloaked +local spGetUnitExperience = Spring.GetUnitExperience +local spGetUnitVelocity = Spring.GetUnitVelocity +local spGetUnitRulesParam = Spring.GetUnitRulesParam +local spGetTeamRulesParam = Spring.GetTeamRulesParam +local spGetUnitTeam = Spring.GetUnitTeam + +--local TRANSPORT_MASS_LIMIT_LIGHT = 1200 +--local TRANSPORT_MASS_LIMIT_HEAVY = 3000 + +local ONCE_RELOAD_THRESHOLD = 999 + +function widget:Initialize() + Spring.SendCommands({"tooltip 0"}) + + Spring.SetDrawSelectionInfo(false) + + -- find shield weapon and its max power + for _,ud in pairs(UnitDefs) do + ud.shieldPower = 0; + local shieldDefID = ud.shieldWeaponDef + ud.shieldPower = ((shieldDefID)and(WeaponDefs[shieldDefID].shieldPower))or(-1) + end +end + +local FontSize = math.max(8,3+vsy/80) +function widget:ViewResize(x,y) + vsx,vsy = Spring.GetViewGeometry() + + FontSize = math.max(8,3+vsy/80) + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:Shutdown() + Spring.SendCommands({"tooltip 1"}) + gl.DeleteFont(font) +end + +-- format number +-- TODO put this on a lib +function FormatNbr(x,digits) + if x then + local ret=string.format("%."..(digits or 0).."f",x) + if digits and digits>0 then + while true do + local last = string.sub(ret,string.len(ret)) + if last=="0" or last=="." then + ret = string.sub(ret,1,string.len(ret)-1) + end + if last~="0" then + break + end + end + end + return ret + else + return "" + end +end + +-- generates upgrade data string for player +--[[function GetTooltipUpgradeData(teamId) + local NewTooltip = "" + + -- get upgrades for team + local statusStr = spGetTeamRulesParam(teamId,"upgrade_status") + local listStr = spGetTeamRulesParam(teamId,"upgrade_list") + local modStr = spGetTeamRulesParam(teamId,"upgrade_modifiers") + + if (statusStr) then + NewTooltip = NewTooltip..statusStr.."\n" + end + if (listStr) then + NewTooltip = NewTooltip..listStr.."\n" + end + if (modStr) then + NewTooltip = NewTooltip.." \nEFFECTS\n"..modStr + end + + return NewTooltip +end]] + + +-- generates upgrade summary string for player +--[[function GetTooltipUpgradeLabel(teamId) + local NewTooltip = "" + + -- get upgrades for team + local labelStr = spGetTeamRulesParam(teamId,"upgrade_label") + + if (labelStr) then + NewTooltip = NewTooltip..labelStr + else + NewTooltip = NewTooltip.."Upgrades: \255\130\130\130[0] [0] [0]" + end + + return NewTooltip +end]] + +-- generates weapon data string for unit +local function GetUnitTotalDamageEnergyMaxRange(ud) + local damages, paralyzeDamages = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 } + damages[0], paralyzeDamages[0] = 0, 0 + local hasDamage, hasParalyzDamage = false, false + local maxRange, totalEnergyCost = 0, 0 + --if ud.weapons and ud.weapons[1] and ud.weapons[1].weaponDef then + for _,w in pairs(ud.weapons) do + local weap=WeaponDefs[w.weaponDef] + if weap.isShield == false and weap.description ~= "No Weapon" then + local reloadTime = weap.reload + local dpsConversion = (weap.projectiles*weap.salvoSize) / weap.reload + local energyPerSecond = weap.energyCost * dpsConversion + local isDisruptor = weap.damages and weap.damages.paralyzeDamageTime and weap.damages.paralyzeDamageTime>0 + + maxRange = maxRange < weap.range and weap.range or maxRange + totalEnergyCost = totalEnergyCost + energyPerSecond + for i = 0, #weap.damages do -- don't even bother asking exactly what attributes "damages" hold + if isDisruptor then + paralyzeDamages[i] = paralyzeDamages[i] + weap.damages[i] * dpsConversion + hasParalyzDamage = true + else + damages[i] = damages[i] + weap.damages[i] * dpsConversion + hasDamage = true + end + end + end + end + --end + return damages, paralyzeDamages, hasDamage, hasParalyzDamage, maxRange, totalEnergyCost -- 0 = default, 1, ... = damage types +end +function GetTooltipWeaponData(ud) + local NewTooltip = "" + + local xpMod, rangeMod, dmgMod = 1, 1, 1 + --[[if not rangeMod then + rangeMod = 1 + end + if not dmgMod then + dmgMod = 1 + end]] + + if ud.canKamikaze then + -- local weapname=ud.selfDExplosion + -- local weap=nil + -- for wid,weaponDef in pairs(WeaponDefs) do + -- if weaponDef.name==weapname then + -- weap=WeaponDefs[wid] + -- end + -- end + -- if weap then + -- local weapon_action="Damage" + -- if weap.damages and weap.damages.paralyzeDamageTime and weap.damages.paralyzeDamageTime>0 then + -- weapon_action="Paralyze" + -- end + -- NewTooltip = NewTooltip.."\n\255\255\213\213Damage: \255\255\170\170"..FormatNbr(dmgMod * weap.damages[Game.armorTypes.default],2).."/once" + -- end + elseif ud.weapons and ud.weapons[1] and ud.weapons[1].weaponDef then + -- local damages, paralyzeDamages, hasDamage, hasParalyzDamage, maxRange, totalEnergyCost = GetUnitTotalDamageEnergyMaxRange(ud) + -- if hasDamage then + -- NewTooltip = NewTooltip .. white .. "Damage/s: " + -- for i = 1, #damages do -- actually ignore default + -- local reorder = (i + 1) % 5 + 1 + -- if damages[reorder] > 0 then NewTooltip = NewTooltip .. weaponDamageColour .. FormatNbr(damages[reorder], 1) .. white .. " (" .. weaponTypeToStr[reorder] .. ") / " end + -- end + -- NewTooltip = NewTooltip:sub(1, -4) + -- end + -- if hasParalyzDamage then + -- NewTooltip = NewTooltip .. white .. "Paralyze/s: " + -- for i = 1, #paralyzeDamages do -- actually ignore default + -- local reorder = (i + 1) % 5 + 1 + -- if paralyzeDamages[reorder] > 0 then NewTooltip = NewTooltip .. weaponParalyzeColour .. FormatNbr(paralyzeDamages[reorder], 1) .. white .. " (" .. weaponTypeToStr[reorder] .. ") / " end + -- end + -- NewTooltip = NewTooltip:sub(1, -4) + -- end + -- if hasDamage or hasParalyzDamage then + -- NewTooltip = "\n" .. NewTooltip + -- NewTooltip = NewTooltip .. " Range: " .. FormatNbr(maxRange, 2) + -- if totalEnergyCost > 0 then NewTooltip = NewTooltip .. " " .. useEnergyTexture .. useResColour .. " -" .. FormatNbr(totalEnergyCost, 1) end + -- end + + + for _,w in pairs(ud.weapons) do + local weap=WeaponDefs[w.weaponDef] + --Spring.Echo(weap.damages[0],weap.damages[1],weap.damages[2],weap.damages[3]) -- default, armored, building, light + if weap.isShield == false and weap.description ~= "No Weapon" then + local weapon_action="Dmg/s" + local reloadTime = weap.reload / xpMod + local isBeamLaser = weap.type == "BeamLaser" + local damage = dmgMod * (weap.damages[Game.armorTypes.default] * (weap.projectiles*weap.salvoSize)) + local dps = damage / reloadTime + local energyPerSecond = (weap.energyCost * (weap.projectiles*weap.salvoSize)) / reloadTime + local isDisruptor = false + local actionStr = "" + + if weap.damages and weap.damages.paralyzeDamageTime and weap.damages.paralyzeDamageTime>0 then + weapon_action="Paralyze/s" + isDisruptor = true + end + if (reloadTime >= 2.5) then + actionStr = weapon_action..": \255\255\255\255"..(isDisruptor and "\255\100\255\255" or "")..FormatNbr(damage,0).."\255\255\255\255"..(reloadTime >= ONCE_RELOAD_THRESHOLD and " once" or ("/"..FormatNbr(reloadTime,2).."s")) + else + actionStr = weapon_action..": \255\255\255\255"..(isDisruptor and "\255\100\255\255" or "")..FormatNbr(dps,1).."\255\255\255\255" + end + + local range = weap.range * rangeMod + local damagetype = weap.customParams.damagetype + if damagetype == nil then + damagetype = "default" + end + + if damagetype == "light" or damagetype == "antilight" then damagetype = "Light" end + if damagetype == "turretantilight" then damagetype = "Light Mobile Units" end + if damagetype == "turretantiarmored" then damagetype = "Armored Mobile Units" end + if damagetype == "turretantilightarmored" then damagetype = "Light/Armored Mobile Units" end + if damagetype == "antiarmored" then damagetype = "Armored" end + if damagetype == "antilightarmored" then damagetype = "Light/Armored" end + if damagetype == "antilightbuilding" then damagetype = "Light/Buildings" end + if damagetype == "antibuilding" then damagetype = "Buildings" end + if damagetype == "antiair" then damagetype = "Aircraft" end + if damagetype == "antiarmoredbuilding" then damagetype = "Armored and Buildings" end + if damagetype == "antibuildingair" then damagetype = "Buildings and Aircraft" end + if damagetype == "antiarmoredair" then damagetype = "Armored and Aircraft" end + if damagetype == "Default" then damagetype = "None" end + + local AOE = weap.damageAreaOfEffect + + + NewTooltip = NewTooltip.."\n\255\255\255\255"..weap.description.." "..actionStr.." (+50% vs "..damagetype..") AoE: "..AOE.."(r) Range: "..FormatNbr(range,2) + + if energyPerSecond > 0 then + NewTooltip = NewTooltip.." \255\255\255\0E/s: "..FormatNbr(energyPerSecond,1) + end + + if weap.waterWeapon then + NewTooltip = NewTooltip.." \255\64\64\255WATER" + end + end + end + end + + return NewTooltip +end + +-- generates build power string in m/s as a function of build speed +function GetTooltipBuildPower(buildSpeed) + + -- time is 11 * weighted_cost_metal + -- time = 11 * (m + e/60) / spd + -- m + e/60 = time * spd / 11 + -- non-aircraft have 5x e cost as metal, so + -- m + 5m/60 = time * spd / 11 + -- 13m/12 = time * spd / 11 + -- m/time = 12*spd / (11*13) + + --return "\255\255\255\150Build Power: ".. FormatNbr(12 * buildSpeed / (11*13),1).." metal/s" + return "\255\255\255\150Build Power: ".. FormatNbr(buildSpeed * 4,1).." metal/s" +end + +-- get tooltip mass/transportability label +function GetTooltipTransportability(ud) + --[[if ud.speed > 0 then + local transpStr = "" + if ud.mass < TRANSPORT_MASS_LIMIT_LIGHT then + transpStr = "light" + elseif ud.mass < TRANSPORT_MASS_LIMIT_HEAVY then + transpStr = "heavy" + else + transpStr = "no transport" + end + + return " \255\200\200\200Mass: ".. FormatNbr(ud.mass,0).." ("..transpStr..")" + else + return "" + end ]] + if ud.canFly or ud.customParams.armortype == "building" or not ud.customParams.canbetransported then return "" end + --return " \255\200\200\200Transportable" + return "" +end + +-- get tooltip: supply energy metal cost +local function GetTooltipCost(sUse, sGive, e, m) + sUse, sGive = tonumber(sUse), tonumber(sGive) + local supplyStr = "" + --[[local sNet = sGive - sUse + local supplyStr = "" + if sNet > 0 then supplyStr = "Gives "..useSupplyTexture..supplyColour.." "..sNet..white.." " + elseif sNet < 0 then supplyStr = "Uses "..useSupplyTexture..supplyColour.." "..(-sNet)..white.." " end]] + if sGive > 0 then supplyStr = supplyStr .. "Gives "..useSupplyTexture..supplyColour.." "..sGive..white.." " end + if sUse > 0 then supplyStr = supplyStr .. "Uses "..useSupplyTexture..supplyColour.." "..sUse..white.." " end + local costStr = "Cost: " .. + useEnergyTexture..energyColour.." "..e..white.." / ".. + useMetalTexture..metalColour.." "..m + return supplyStr .. costStr +end +-- get tooltip for armor +local function GetTooltipArmor(ud) + -- TODO replace text with icons + local str = ud.customParams.armortype + if str == "light" then return "Light" + elseif str == "armored" then return "Armored" + elseif str == "building" then return "Building" + elseif str == "air" then return "Air" end + return "Default" +end +-- get tooltip for resource upkeeps +local function GetTooltipUpkeep(eMake, eUse, mMake, mUse) + return + useEnergyTexture..generateResColour.." +"..FormatNbr(eMake, 1)..white.." / "..useResColour..FormatNbr(-eUse, 1).." ".. + useMetalTexture..generateResColour.." +"..FormatNbr(mMake, 1)..white.." / "..useResColour..FormatNbr(-mUse, 1) +end +-- get tooltip for one unit +local function GetTooltipUnit(id) + local result = "" + local u=id + local ud=UnitDefs[Spring.GetUnitDefID(u)] + + local metalMake,metalUse,energyMake,energyUse = Spring.GetUnitResources(u) + local isFriendly = metalMake ~= nil -- assume only friendly units have this info + + -- build progress, health and shield + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress = Spring.GetUnitHealth(u) + stunned_or_beingbuilt, stunned, beingbuilt = Spring.GetUnitIsStunned(u) + result = result.."\n"..ud.humanName.." ("..ud.tooltip..")" + --[[local hpMod = spGetUnitRulesParam(u,"upgrade_hp") + if not hpMod then + hpMod = 1 + else + hpMod = 1 + hpMod + end + health = health * hpMod + maxHealth = maxHealth * hpMod]] + --[[ + -- experience + local xp = spGetUnitExperience(u) + local xpMod = 1 + if xp and xp>0 then + local xpIndex = math.min(10,math.max(floor(11*xp/(xp+1)),0))+1 + xpMod = 1+0.35*(xp/(xp+1)) + if(xpIndex > 1) then + result = result.."\255\255\255\255 Experience: "..xpArr[xpIndex] + end + end + ]] + --[[ + local dmgMod = spGetUnitRulesParam(u,"upgrade_damage") + if not dmgMod then + dmgMod = 1 + else + dmgMod = 1 + dmgMod + end + local rangeMod = spGetUnitRulesParam(u,"upgrade_range") + if not rangeMod then + rangeMod = 1 + else + rangeMod = 1 + rangeMod + end + ]] + + + -- paralysis + if stunned then + result = result.."\255\194\173\255 PARALYZED" + end + -- cloaking + if spGetUnitIsCloaked(u) then + result = result.."\255\170\170\170 CLOAKED" + end + -- alliance + if isFriendly == false then + result = result.." \255\255\0\0ENEMY" + end + result = result.."\n" + if buildProgress and buildProgress<1 then + result = result.."\255\213\213\255".."Build progress: ".."\255\170\170\255"..FormatNbr(100*buildProgress).."%\n" + end + + -- cost + --result = result.."\255\200\200\200Metal: "..ud.metalCost.." \255\255\255\0Energy: "..ud.energyCost.." "..GetTooltipTransportability(ud).."\n" + local unitsupplycost = ud.customParams.supply_cost or 0 + local unitsupplygive = ud.customParams.supply_granted or 0 + result = result..GetTooltipCost(unitsupplycost, unitsupplygive, ud.energyCost, ud.metalCost).." "..GetTooltipTransportability(ud).."\n" + + + --[[local armorTypeStr= "L" + if ( Game.armorTypes[ud.armorType] == "armor_heavy" ) then armorTypeStr = "H" + elseif ( Game.armorTypes[ud.armorType] == "armor_medium" ) then armorTypeStr = "M" end]] + local armorTypeStr = ud.customParams.armortype + if armorTypeStr == nil then + armorTypeStr = "None" + end + + local hasShield, ShieldPower=Spring.GetUnitShieldState(id) + local maxShieldPower = ud.shieldPower + if (health ~= nil) then + result = result.."\255\200\200\200Health: ".."\255\200\200\200"..floor(health).."\255\200\200\200/\255\200\200\200"..floor(maxHealth).." ("..armorTypeStr..")" + if hasShield then result=result.."\255\135\135\255 Shield: "..FormatNbr(math.min(ShieldPower,maxShieldPower)).."/"..FormatNbr(maxShieldPower) end + end + + -- energy and metal upkeep + if isFriendly then + --result = result.." \255\200\200\200Metal: \255\0\255\0+"..FormatNbr(metalMake,1).."\255\255\255\255/\255\255\0\0"..FormatNbr(-metalUse,1) + --result = result.." \255\255\255\0Energy: \255\0\255\0+"..FormatNbr(energyMake,1).."\255\255\255\255/\255\255\0\0"..FormatNbr(-energyUse,1) + -- result=result.."\255\255\255\0 +E/M ratio: "..FormatNbr(energyMake / ud.metalCost,4).."\n" + local upkeepStr = GetTooltipUpkeep(energyMake, energyUse, metalMake, metalUse) + result = result.." "..upkeepStr + end + + -- weapons + result = result..GetTooltipWeaponData(ud).."\n" + + -- build power + if ud.buildSpeed and ud.buildSpeed > 0 then + result = result.."\n"..GetTooltipBuildPower(ud.buildSpeed).. "\255\255\255\255\n" + end + + -- upgrades (upgrade centers only) + --[[local isUpgradeCenter = string.find(ud.name, "upgrade_center") + local teamId = spGetUnitTeam(u) + if isUpgradeCenter then + result = result..GetTooltipUpgradeData(teamId).."\n\n" + end]] + + -- speed + + --Disable Speed Readout + --if ud.speed and ud.speed>0 then + --[[local speedMod = spGetUnitRulesParam(u,"upgrade_speed") + if not speedMod then + speedMod = 1 + else + speedMod = 1 + speedMod + end]] + --local speedMod = 1 + + --local vx,vy,vz = spGetUnitVelocity(u) + --local speed = 30*math.sqrt(vx*vx+vz*vz) + --result = result.."\255\193\255\187Speed: \255\134\255\121"..FormatNbr(speed).."\255\193\255\187/\255\134\255\121"..FormatNbr(ud.speed*speedMod,2).."\255\255\255\255 " + --end + + --[[if ud.transportCapacity>0 and ud.transportMass>0 and isFriendly then + local currentCapacityUsage = 0 + local currentMassUsage = 0 + + -- get sum of mass and size for all transported units + for _,tUnit in pairs(Spring.GetUnitIsTransporting(u)) do + local tUd=UnitDefs[Spring.GetUnitDefID(tUnit)] + currentCapacityUsage = currentCapacityUsage + tUd.xsize + currentMassUsage = currentMassUsage + tUd.mass + end + + result = result.."\255\255\255\255Transport: "..FormatNbr(min(2,(currentCapacityUsage/ud.transportCapacity))*50,0).."% / "..FormatNbr((currentMassUsage/ud.transportMass)*100,0).."% " + end]] + + -- upgrade summary + --[[if not isUpgradeCenter then + result = result..GetTooltipUpgradeLabel(spGetUnitTeam(u)) + end]] + + --[[if ud.customParams.tip then + result = result.."\n\255\180\180\180"..ud.customParams.tip.."\255\255\255\255\n" + end]] + return result +end + +-- generates new tooltip +function GenerateNewTooltip() + local CurrentTooltip = Spring.GetCurrentTooltip() + + if tempTooltip and frameSkip > 0 then + counter = counter +1 + if (counter % (frameSkip+1) ~= 0) then + return tempTooltip + end + end + + local NewTooltip = "" + local HotkeyTooltip = "" + local FoundTooltipType = nil + local mx,my,gx,gy,gz,id + + mx,my = GetMouseState() + if mx and my then + local _,pos = TraceScreenRay(mx,my,true,true) + if pos then + gx,gy,gz=unpack(pos) + end + local kind,var1 = TraceScreenRay(mx,my,false,true) + if kind=="unit" then + id = var1 + end + end + + + if spGetSelectedUnitsCount()>1 then + NewTooltip=NewTooltip.."\255\255\255\255"..spGetSelectedUnitsCount().."\255\255\255\255 units selected\255\255\255\255\n" + end + + + local TerrainType = string.match(CurrentTooltip,"Terrain type: (.+)\nSpeeds T/K/H/S ") + local TerrainSpeeds = string.match(CurrentTooltip,"Speeds T/K/H/S (.+)\nHardness") + if TerrainType~=nil then + NewTooltip=NewTooltip.."\255\255\255\64"..TerrainType + if TerrainSpeeds~=nil then + TerrainSpeedList={} + for Speed in string.gmatch(TerrainSpeeds,"[0-7]+.[0-7]+") do + table.insert(TerrainSpeedList,Speed) + end + if #TerrainSpeedList>=1 then + local DiffSpeed = false + for _,Speeds in pairs(TerrainSpeedList) do + if Speeds~=TerrainSpeedList[1] then + DiffSpeed = true + end + end + for i=1,#TerrainSpeedList do + while true do + local last = string.sub(TerrainSpeedList[i],string.len(TerrainSpeedList[i])) + if last=="0" or last=="." then + TerrainSpeedList[i] = string.sub(TerrainSpeedList[i],1,string.len(TerrainSpeedList[i])-1) + end + if last~="0" then + break + end + end + end + if DiffSpeed then + --NewTooltip=NewTooltip.."\nSpeeds x "..TerrainSpeeds + else + --NewTooltip=NewTooltip.."\nSpeed x"..TerrainSpeedList[1] + end + end + end + if gx and gz then + --NewTooltip=NewTooltip.."\n\n("..(32)*floor((gx+16)/32)..","..(32)*floor((gz+16)/32)..")" + NewTooltip=NewTooltip.."\n\n("..floor(gx+0.5)..","..floor(gz+0.5)..")" + + local h = Spring.GetGroundHeight(gx,gz) + local airMeshH = Spring.GetSmoothMeshHeight(gx,gz) + NewTooltip=NewTooltip.."\n\nAltitude "..floor(h).."\n\nAir Mesh Altitude "..floor(airMeshH) + end + FoundTooltipType="terrain" + end + + local buildpower = 1 + + -- compute total buildpower of units selected + if spGetSelectedUnitsCount() >= 1 then + for _,u in pairs(spGetSelectedUnits()) do + local def=UnitDefs[Spring.GetUnitDefID(u)] + if def ~= nil then + buildpower = buildpower + def.buildSpeed + end + end + end + + -- selecting units to build + local unitpre = string.match(CurrentTooltip,"(.-)\nBuild:") or string.match(CurrentTooltip,"(.-)\n\255\255\255\255Build:") or "" + --local unitname = string.match(CurrentTooltip,"Build: (.+) %- ") + local unitname = string.match(CurrentTooltip,"Build: (.-) %- ") + local unitdesc = string.match(CurrentTooltip," %- (.+)\nHealth ") + local unithealth = string.match(CurrentTooltip,"Health (.+)\nMetal") or string.match(CurrentTooltip,"Health (.+)\nBuild time ") + local unitbuildtime = string.match(CurrentTooltip.."\n","Build time (.-)\n") + local unitmetalcost = string.match(CurrentTooltip,"Metal cost (.-)\nEnergy cost ") + local unitenergycost = string.match(CurrentTooltip,"\nEnergy cost (.-).Build time ") + + if unitname and unitdesc and unithealth and unitbuildtime then + local fud = nil + --local collisions = 0 + for _,ud in pairs(UnitDefs) do + --[[ + Spring.Echo("ud.humanName=",ud.humanName) + Spring.Echo("ud.tooltip=",ud.tooltip) + Spring.Echo("ud.health=",ud.health) + Spring.Echo("ud.buildTime=",ud.buildTime) + ]]-- + -- Note: used approximately equal to because Evo fucking sucks + if ud.humanName==unitname and ud.tooltip==unitdesc and math.abs(ud.health-tonumber(unithealth))<=1 then + --and ""..ud.buildTime==unitbuildtime then + fud=ud + break + end + --[[if ud.humanName==unitname or ud.tooltip==unitdesc then + Spring.Echo(ud.humanName,unitname,ud.humanName==unitname) + Spring.Echo(ud.tooltip,unitdesc,ud.tooltip==unitdesc) + Spring.Echo(ud.health,unithealth,ud.health==unithealth) + Spring.Echo(ud.buildTime,unitbuildtime) + --collisions = collisions + 1 + end]] + end + if fud then + --[[local armorTypeStr= "L" + if ( Game.armorTypes[fud.armorType] == "armor_heavy" ) then armorTypeStr = "H" + elseif ( Game.armorTypes[fud.armorType] == "armor_medium" ) then armorTypeStr = "M" end]] + + --[[NewTooltip = NewTooltip.."\n"..unitpre.."\n"..fud.humanName.." ("..fud.tooltip..")\n".. + "\255\200\200\200Metal: "..unitmetalcost.." \255\255\255\0Energy: "..unitenergycost.."".. + "\255\213\213\255".." Build time: ".."\255\170\170\255".. + floor((29+floor(31+fud.buildTime/(buildpower/32)))/30).."s".." "..GetTooltipTransportability(fud).."\n".. + "\255\200\200\200Health: ".."\255\200\200\200"..fud.health.."("..armorTypeStr..")" + if fud.shieldPower > 0 then NewTooltip=NewTooltip.."\255\135\135\255 Shield: "..FormatNbr(fud.shieldPower) end]] + + local hotkeyStr = "" + if humanNameToKeySymbols[unitname] then + hotkeyStr = " (" .. "\255\170\255\170" .. "Hotkey: " .. humanNameToKeySymbols[unitname] .. white .. ")" + end + + if unitpre ~= "" then + local techText = unitpre:sub(22, 22) + if techText == "0" or techText == nil then + unitpre = "" + else + -- unitpre = unitpre:sub(1, 13) .. TechColour[tonumber(techText)] .. "Tech " .. techText + end + end + + local unitsupplycost = fud.customParams.supply_cost or 0 + local unitsupplygive = fud.customParams.supply_granted or 0 + local costStr = GetTooltipCost(unitsupplycost, unitsupplygive, unitenergycost or fud.energyCost, unitmetalcost or fud.metalCost) + local armorTypeStr = GetTooltipArmor(fud) + NewTooltip = NewTooltip.."\n"..unitpre.."\n"..fud.humanName..hotkeyStr.." ("..fud.tooltip..")\n".. + costStr.."\255\213\213\255".." Build time: ".."\255\170\170\255".. + floor((29+floor(31+fud.buildTime/(buildpower/32)))/30).."s".." "..GetTooltipTransportability(fud).."\n".. + "\255\200\200\200Health: ".."\255\200\200\200"..fud.health.." ("..armorTypeStr..")" + if fud.shieldPower > 0 then NewTooltip=NewTooltip.."\255\135\135\255 Shield: "..FormatNbr(fud.shieldPower) end + + -- weapons + if fud.weapons and fud.weapons[1] and fud.weapons[1].weaponDef then + NewTooltip = NewTooltip..GetTooltipWeaponData(fud) + end + + -- build power + if fud.buildSpeed and fud.buildSpeed > 0 then + NewTooltip = NewTooltip.."\n"..GetTooltipBuildPower(fud.buildSpeed).."\255\255\255\255" + end + + -- speed + NewTooltip = NewTooltip.."\255\255\255\255\n" + if fud.speed and fud.speed>0 then + NewTooltip = NewTooltip.."\255\193\255\187Speed: \255\134\255\121"..FormatNbr(fud.speed,2).."\255\255\255\255" + end + FoundTooltipType="knownbuildbutton" + + if fud.windGenerator > 1 then + local minWindE = FormatNbr((fud.windGenerator/25)*Game.windMin,0) + local maxWindE = FormatNbr((fud.windGenerator/25)*Game.windMax,0) + NewTooltip = NewTooltip.."Generates \255\255\255\0"..minWindE.."-"..maxWindE.." E/s\255\255\255\255 (up to +20% on higher ground) \n" + elseif fud.tidalGenerator == 1 then + NewTooltip = NewTooltip.."Generates \255\255\255\0"..Game.tidal.." E/s\255\255\255\255\n" + end + + --[[if fud.customParams.tip then + NewTooltip = NewTooltip.."\n\255\180\180\180"..fud.customParams.tip.."\255\255\255\255\n" + end]] + else + NewTooltip = NewTooltip.."\n"..unitpre.."\n"..unitname.." ("..unitdesc..")\n".. + "\255\255\213\213Health: ".."\255\255\170\170"..unithealth.. + "\n\255\213\213\255Build time: ".."\255\170\170\255".. + floor((29+floor(31+unitbuildtime/(buildpower/32)))/30).."s".. + "\255\255\255\255\n" + --NewTooltip = "WTF IS THIS " .. unitname + --Spring.Echo("collisions",collisions) + FoundTooltipType="unknownbuildbutton" + end + end + + local isItLiveUnitTooltip = string.match(CurrentTooltip,"Experience (.+) Cost ") + if isItLiveUnitTooltip or CurrentTooltip=="" then + + -- id being calculated way above + --[[if not id and spGetSelectedUnitsCount()>=1 then + id = spGetSelectedUnits()[spGetSelectedUnitsCount()] + end]] + + -- many units + --if id and spGetSelectedUnitsCount()>1 then + if spGetSelectedUnitsCount()>1 then + + if id then NewTooltip = NewTooltip .. GetTooltipUnit(id) + else + local totalMetalMake = 0 + local totalMetalUse = 0 + local totalEnergyMake = 0 + local totalEnergyUse = 0 + local totalHealth = 0 + local totalMaxHealth = 0 + local totalShieldPower = 0 + local totalMaxShieldPower = 0 + local totalEnergyCost = 0 + local totalMetalCost = 0 + local totalSupplyCost = 0 + local totalSupplyGive = 0 + local anyShield = false + local highestTech = 0 + + for _,u in pairs(spGetSelectedUnits()) do + + --[[local hpMod = spGetUnitRulesParam(u,"upgrade_hp") + if not hpMod then + hpMod = 1 + else + hpMod = 1 + hpMod + end]] + local ud=UnitDefs[Spring.GetUnitDefID(u)] + local metalMake,metalUse,energyMake,energyUse = Spring.GetUnitResources(u) + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress = Spring.GetUnitHealth(u) + --[[health = health * hpMod + maxHealth = maxHealth * hpMod]] + health = health + maxHealth = maxHealth + local hasShield, ShieldPower=Spring.GetUnitShieldState(u) + local maxShieldPower = ud.shieldPower + if(hasShield) then + anyShield = true + end + + -- energy and metal cost + totalEnergyCost = totalEnergyCost + ud.energyCost + totalMetalCost = totalMetalCost + ud.metalCost + totalSupplyCost = totalSupplyCost + (ud.customParams.supply_cost or 0) + totalSupplyGive = totalSupplyGive + (ud.customParams.supply_granted or 0) + + -- Evo: upgrade levels + local upgradeLevel = ud.name:find("_up", -5) and tonumber(ud.name:sub(-1, -1)) or 0 + highestTech = highestTech < upgradeLevel and upgradeLevel or highestTech + + if (health and maxHealth) then + totalHealth = totalHealth + health + totalMaxHealth = totalMaxHealth + maxHealth + end + if (hasShield) then + totalShieldPower = totalShieldPower + ShieldPower + totalMaxShieldPower = totalMaxShieldPower + maxShieldPower + end + + -- energy and metal upkeep + if( metalMake and metalUse and energyMake and energyUse) then + totalMetalMake = totalMetalMake + metalMake + totalMetalUse = totalMetalUse + metalUse + totalEnergyMake = totalEnergyMake + energyMake + totalEnergyUse = totalEnergyUse + energyUse + end + end + + -- Evo: upgrade levels + local techStr = "" + if highestTech > 0 then techStr = white .. " Highest upgrade: " .. TechToStr[highestTech] end + + -- cost + --NewTooltip = NewTooltip.."\255\200\200\200Metal: "..totalMetalCost.." \255\255\255\0Energy: "..totalEnergyCost.."\n" + NewTooltip = NewTooltip..GetTooltipCost(totalSupplyCost, totalSupplyGive, totalEnergyCost, totalMetalCost)..techStr.."\n" + + -- health totals + NewTooltip = NewTooltip.."\255\200\200\200Health: ".."\255\200\200\200"..floor(totalHealth).."\255\200\200\200/\255\200\200\200"..floor(totalMaxHealth) + if anyShield then NewTooltip=NewTooltip.."\255\135\135\255 Shield: "..FormatNbr(math.min(totalShieldPower,totalMaxShieldPower)).."/"..FormatNbr(totalMaxShieldPower) end + + -- energy and metal upkeep totals + if true then + --NewTooltip = NewTooltip.."\n\255\200\200\200Metal: \255\0\255\0+"..FormatNbr(totalMetalMake,1).."\255\255\255\255/\255\255\0\0"..FormatNbr(-totalMetalUse,1) + --NewTooltip = NewTooltip.." \255\255\255\0Energy: \255\0\255\0+"..FormatNbr(totalEnergyMake,1).."\255\255\255\255/\255\255\0\0"..FormatNbr(-totalEnergyUse,1) + local upkeepStr = GetTooltipUpkeep(totalEnergyMake, totalEnergyUse, totalMetalMake, totalMetalUse) + NewTooltip = NewTooltip.."\n"..upkeepStr + end + end + + FoundTooltipType="liveunit" + + -- one unit + elseif id or spGetSelectedUnitsCount()==1 then + if not id then id = spGetSelectedUnits()[1] end + NewTooltip = NewTooltip .. GetTooltipUnit(id) + + FoundTooltipType="liveunit" + end + end + + local hotkeys = string.match(CurrentTooltip.."\n","Hotkeys: (.-)\n") + if hotkeys then + HotkeyTooltip = "\n\255\255\196\128Hotkeys: ".."\255\255\128\001"..hotkeys.."\255\255\255\255" + CurrentTooltip=string.gsub(CurrentTooltip.."\n","Hotkeys: .-\n","") + NewTooltip=NewTooltip..HotkeyTooltip + CurrentTooltip=CurrentTooltip..HotkeyTooltip + end + + -- default resource color (a,r,g,b) = (255, 255, 80, 1) + local _, metal = CurrentTooltip:find("Metal: ") + local _, energy = CurrentTooltip:find("Energy: ") + if metal and energy then + -- bad solution + local featureName = CurrentTooltip:match("(.+)\n") + local metalValue, _, energyValue = CurrentTooltip:match("(%d+)(.-)(%d+)") + if metalValue == "0" and energyValue == "0" then + CurrentTooltip = featureName + else + CurrentTooltip = CurrentTooltip:gsub("(%d+)(.-)(%d+)", "%3%2%1", 1) -- first swap metal and energy values for Evo (Supply, Energy, Metal) + CurrentTooltip = CurrentTooltip:sub(1, energy) .. CurrentTooltip:sub(energy + 5) -- remove default resource color + CurrentTooltip = CurrentTooltip:sub(1, metal) .. CurrentTooltip:sub(metal + 5) -- ditto + CurrentTooltip = CurrentTooltip:gsub("Metal: ", useEnergyTexture .. " " .. energyColour) -- swap the metal and energy strings to fit the values + CurrentTooltip = CurrentTooltip:gsub("Energy: ", useMetalTexture .. " " .. metalColour) + end + else + if CurrentTooltip == "Repair: Repairs another unit" then + CurrentTooltip = "Build: Builds unfinished structures" -- hack for Evo (no repair after construction completed) + end + + -- ignore sell command as well + if not CurrentTooltip:find("Refund amount") and not CurrentTooltip:find("Evolve into") then + -- Evo's Evolve tooltip is too cancer + --if CurrentTooltip:find("Evolve into") and not CurrentTooltip:find("turret") then CurrentTooltip = CurrentTooltip:sub(5) end + CurrentTooltip = CurrentTooltip:gsub("(.-: )", "\255\170\255\170%1"..white, 1) + end + + --[[local action = string.match(CurrentTooltip,"(.-)\n") + if action then + action = string.match(action,"(.-): ") + if action then + CurrentTooltip=string.gsub(CurrentTooltip,"(.-): ","",1) + CurrentTooltip="\255\170\255\170"..action..":\255\255\255\255 "..CurrentTooltip + end + end]] + end + + if FoundTooltipType ~= "liveunit" then + if WG.smartSelectTooltip and WG.smartSelectTooltip.active then + local tooltipOverride = WG.smartSelectTooltip.unitCount .. " unit" .. (WG.smartSelectTooltip.unitCount > 1 and "s" or "") .. " selected\n" + tooltipOverride = tooltipOverride .. GetTooltipCost(WG.smartSelectTooltip.totalSupplyCost, WG.smartSelectTooltip.totalSupplyGive, WG.smartSelectTooltip.totalEnergyCost, WG.smartSelectTooltip.totalMetalCost) + if WG.smartSelectTooltip.highestTech ~= 0 then tooltipOverride = tooltipOverride .. white .. " Highest upgrade: " .. TechToStr[WG.smartSelectTooltip.highestTech] end + tempTooltip = tooltipOverride + return tempTooltip + end + end + + --Spring.Echo(FoundTooltipType) + if FoundTooltipType then + tempTooltip = NewTooltip + return NewTooltip + else + tempTooltip = CurrentTooltip + return CurrentTooltip + end +end + + +local xTooltipSize = 0 +local yTooltipSize = 0 +local tooltipX, tooltipY = 0, 0 +local bgmargin = 4 + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + -- KP_ToolTip is probably deprecated + --WG.KP_ToolTip=nil + if Spring.IsGUIHidden() then + return + end + + if WG['topbar'] and WG['topbar'].showingQuit() then + return + end + + local nttString = GenerateNewTooltip() + local nttList = {} + local lengNttList = 0 + local maxWidth = 0 + for line in string.gmatch(nttString,"[^\r\n]+") do + --table.insert(nttList,"\255\255\255\255"..line) + lengNttList = lengNttList + 1 + nttList[lengNttList] = stringSplitIcons("\255\255\255\255"..line, false, useMetalTexture, useEnergyTexture, useSupplyTexture) + local width = FontSize * font:GetTextWidth(line) + for i = 2, #nttList[lengNttList], 2 do + width = width - FontSize * font:GetTextWidth(nttList[lengNttList][i]) + FontSize + end + if width > maxWidth then + maxWidth = width + end + end + + --xTooltipSize = FontSize*(1+maxWidth) + xTooltipSize = maxWidth + FontSize + yTooltipSize = FontSize*(1+lengNttList) + + -- Bottom left position by default + local x1,y1,x2,y2= tooltipX, tooltipY, tooltipX + xTooltipSize, tooltipY + yTooltipSize + + -- Note: this line is done even if the KP_ToolTip is devoid of text + -- The only case where KP_ToolTip is nil are when the widget is off or the GUI is hidden + --WG.KP_ToolTip={x1=x1,y1=y1,x2=x2,y2=y2,xSize=xTooltipSize,ySize=yTooltipSize,FontSize=FontSize} + + + gl.Blending(GL.SRC_ALPHA,GL.ONE_MINUS_SRC_ALPHA) -- default + if WG.MidKnightBG then + gl.Color(1,1,1,1) + gl.Texture("bitmaps/tooltipbg.png") + gl.TexRect(x1,y1,x2*1.2,y2*1.2,0.01,0.99,0.99,0.01) + gl.Texture(false) + else + local tl, tr, br, bl = (y2 >= vsy or x1 <= 0) and 0 or 1, (y2 >= vsy or x2 >= vsx) and 0 or 1, (y1 <= 0 or x2 >= vsx) and 0 or 1, (y1 <= 0 or x1 <= 0) and 0 or 1 + gl.Color(0.0,0.0,0.0,ui_opacity) --background + RectRound(x1, y1, x2, y2, 15,tl, tr, br, bl,vsx,vsy) + gl.Color(0.33,0.33,0.33,0.1*ui_opacity) + RectRound(x1 + bgmargin, y1 + bgmargin, x2 - bgmargin, y2 - bgmargin, 10,tl, tr, br, bl,vsx,vsy) + --[[gl.Rect(x1,y1,x2,y2) + gl.Color(0.0,0.0,0.0,1) --border + gl.LineWidth(1) + gl.Shape(GL.LINE_LOOP,{ + {v={x1,y2}},{v={x2,y2}}, + {v={x2,y1}},{v={x1,y1}},}) + ]] + gl.Color(1,1,1,1) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(x1, y1, x2, y2, 'evo_tooltip') + end + end + font:Begin() + for i = 1, lengNttList do + local iconStr = nttList[i] + local currX, currY = x1 + FontSize / 2, y1 + FontSize * (lengNttList + 0.5 - i) + for j = 1, #iconStr do + if j % 2 == 1 then + font:Print(iconStr[j], currX, currY, FontSize, 'o') + currX = currX + FontSize * font:GetTextWidth(iconStr[j]) + else + gl.Texture(drawIcons[iconStr[j]]) + -- Icon size = font size + gl.TexRect(currX, currY - FontSize * 0.2, currX + FontSize, currY - FontSize * 0.2 + FontSize, 0.2, 0.8, 0.8, 0.2) + currX = currX + FontSize + end + end + --font:Print(nttList[i], currX, currY, FontSize, 'o') + end + gl.Texture(false) + font:Print("\255\255\255\255 ",0,0,FontSize,'o') -- Reset color to white for other widgets using gl.Text + font:End() +end + + +local uiOpacitySec = 0 +function widget:Update(dt) + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + end + end +end + + +--[[ +-- tweaking UI position with ctrl+f11 +local widgetScale = 1 -- potential TODO +local tweakStartX, tweakStartY = 0, 0 +function widget:TweakMousePress(x, y, button) + local posxScaled = posx - (bgmargin*widgetScale) - ((vsx - posx) * (widgetScale-1)) + local posyScaled = posy - (bgmargin*widgetScale) - ((vsy - posy) * (widgetScale-1)) + if x >= posxScaled and x < posxScaled + ((width+bgmargin+bgmargin)*widgetScale) and y >= posyScaled and y < posyScaled + ((height+bgmargin+bgmargin)*widgetScale) then + tweakStartX = x - posx + tweakStartY = y - posy + return true + end +end + +function widget:TweakMouseMove(x, y, dx, dy, button) + posx = x - tweakStartX + posy = y - tweakStartY + if posx < 0 then + posx = 0 + end + if posx > vsx - width then + posx = vsx - width + end + if posy < 0 then + posy = 0 + end + if posy > vsy - height then + posy = vsy - height + end + generateDisplayList() + generateDisplayList3() +end + +-- save and load +function widget:GetConfigData(data) + return { + posx = posx, + posy = posy, + } +end + +function widget:SetConfigData(data) + posx = data.posx or posx + posy = data.posy or posy + generateDisplayList() + generateDisplayList3() +end + ]] + +--function widget:MouseWheel(up,value) +-- local xMouse,yMouse = GetMouseState() +-- if xMouse < xTooltipSize and yMouse < yTooltipSize and not Spring.IsGUIHidden() then +-- if up then +-- FontSize = math.max(FontSize - 1,2) +-- else +-- FontSize = FontSize + 1 +-- end +-- return true +-- end +-- return false +--end diff --git a/LuaUI/Widgets_Evo/gui_faction_change.lua b/LuaUI/Widgets_Evo/gui_faction_change.lua new file mode 100644 index 000000000..0d43c9f2a --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_faction_change.lua @@ -0,0 +1,347 @@ + +function widget:GetInfo() + return { + name = 'Faction Change', + desc = 'Adds buttons to switch faction', + author = 'Niobium', + date = 'May 2011', + license = 'GNU GPL v2', + layer = -100, + enabled = true, + } +end + +-------------------------------------------------------------------------------- +-- Var +-------------------------------------------------------------------------------- +local wWidth, wHeight = Spring.GetWindowGeometry() +local px, py = 0.42*wWidth, 0.42*wHeight + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +-------------------------------------------------------------------------------- +-- Speedups +-------------------------------------------------------------------------------- +local teamList = Spring.GetTeamList() +local myTeamID = Spring.GetMyTeamID() + +local glTexCoord = gl.TexCoord +local glVertex = gl.Vertex +local glColor = gl.Color +local glRect = gl.Rect +local glTexture = gl.Texture +local glTexRect = gl.TexRect +local glDepthTest = gl.DepthTest +local glBeginEnd = gl.BeginEnd +local GL_QUADS = GL.QUADS +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glBeginText = gl.BeginText +local glEndText = gl.EndText +local glText = gl.Text +local glCallList = gl.CallList +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList + +local spGetTeamStartPosition = Spring.GetTeamStartPosition +local spGetTeamRulesParam = Spring.GetTeamRulesParam +local spGetGroundHeight = Spring.GetGroundHeight +local spSendLuaRulesMsg = Spring.SendLuaRulesMsg +local spGetSpectatingState = Spring.GetSpectatingState + +local fedcomDefID = UnitDefNames.fedcommander.id +local lozcomDefID = UnitDefNames.lozcommander.id + +local commanderDefID = spGetTeamRulesParam(myTeamID, 'startUnit') +local amNewbie = (spGetTeamRulesParam(myTeamID, 'isNewbie') == 1) + +local factionChangeList + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (1.5 + (vsx*vsy / 5000000)) + +local bgcorner = "LuaUI/Images/bgcorner.png" + +-------------------------------------------------------------------------------- +-- Funcs +-------------------------------------------------------------------------------- + +local function QuadVerts(x, y, z, r) + glTexCoord(0, 0); glVertex(x - r, y, z - r) + glTexCoord(1, 0); glVertex(x + r, y, z - r) + glTexCoord(1, 1); glVertex(x + r, y, z + r) + glTexCoord(0, 1); glVertex(x - r, y, z + r) +end + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + --if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + --if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + --if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + --if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +function updateGuishader() + if WG['guishader'] then + if backgroundGuishader then + glDeleteList(backgroundGuishader) + end + backgroundGuishader = glCreateList( function() + RectRound(px+(2*widgetScale), py+(2*widgetScale), px+(190*widgetScale), py+(78*widgetScale), 6*widgetScale) + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'factionchange') + end +end + +-------------------------------------------------------------------------------- +-- Callins +-------------------------------------------------------------------------------- + +function widget:Initialize() + if spGetSpectatingState() or + Spring.GetGameFrame() > 0 or + amNewbie then + widgetHandler:RemoveWidget(self) + end +end + +function widget:Shutdown() + if WG['guishader'] then + WG['guishader'].DeleteDlist('factionchange') + end + if factionChangeList then + glDeleteList(factionChangeList) + end + gl.DeleteFont(font) +end + +function widget:DrawWorld() + if chobbyInterface then return end + glColor(1, 1, 1, 0.5) + glDepthTest(false) + for i = 1, #teamList do + local teamID = teamList[i] + local tsx, tsy, tsz = spGetTeamStartPosition(teamID) + if tsx and tsx > 0 then + if spGetTeamRulesParam(teamID, 'startUnit') == fedcomDefID then + glTexture('LuaUI/Images/ecommander.png') + glBeginEnd(GL_QUADS, QuadVerts, tsx, spGetGroundHeight(tsx, tsz), tsz, 80) + elseif spGetTeamRulesParam(teamID, 'startUnit') == lozcomDefID then + glTexture('LuaUI/Images/lozcommander.png') + glBeginEnd(GL_QUADS, QuadVerts, tsx, spGetGroundHeight(tsx, tsz), tsz, 64) + end + end + end + glTexture(false) +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + -- Spectator check + if spGetSpectatingState() then + widgetHandler:RemoveWidget(self) + return + end + + -- Positioning + glPushMatrix() + glTranslate(px, py, 0) + --call list + if factionChangeList then + glCallList(factionChangeList) + else + factionChangeList = glCreateList(GenerateFactionChangeList) + updateGuishader() + end + glPopMatrix() + + +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx, vsy = gl.GetViewSizes() + widgetScale = (1.5 + (vsx*vsy / 5000000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function GenerateFactionChangeList() + -- Panel + glColor(0, 0, 0, 0.66) + RectRound(0, 0, 192*widgetScale, 80*widgetScale,6*widgetScale) + glColor(1, 1, 1, 0.025) + RectRound(2*widgetScale, 2*widgetScale, 190*widgetScale, 78*widgetScale, 5*widgetScale) + + + -- Highlight + glColor(0.8, 0.8, 0.8, 0.3) + if commanderDefID == fedcomDefID then + RectRound(3*widgetScale, 3*widgetScale, 61*widgetScale, 61*widgetScale,4.5*widgetScale) + elseif commanderDefID == lozcomDefID then + RectRound(65*widgetScale, 3*widgetScale, 125*widgetScale, 61*widgetScale,4.5*widgetScale) + elseif commanderDefID == patterncomDefID then + RectRound(128*widgetScale, 3*widgetScale, 189*widgetScale, 61*widgetScale,4.5*widgetScale) + end + -- Icons + glColor(1, 1, 1, 1) + glTexture('LuaUI/Images/ecommander.png') + glTexRect(12*widgetScale, 17*widgetScale, 52*widgetScale, 59*widgetScale) + glTexture('LuaUI/Images/lozcommander.png') + glTexRect(76*widgetScale, 20*widgetScale, 116*widgetScale, 60*widgetScale) + glTexture(false) + + -- Text + font:Begin() + font:Print('Choose Your Faction', 96*widgetScale, 64*widgetScale, 11.5*widgetScale, 'ocd') + font:Print('Federation of Kala', 32*widgetScale, 4*widgetScale, 12*widgetScale, 'ocd') + font:Print('Loz Alliance', 96*widgetScale, 4*widgetScale, 12*widgetScale, 'ocd') + font:End() +end + + + +function widget:MousePress(mx, my, mButton) + + -- Check 3 of the 4 sides + if mx >= px and my >= py and my < py + (80*widgetScale) then + + -- Check buttons + if mButton == 1 then + + -- Spectator check before any action + if spGetSpectatingState() then + widgetHandler:RemoveWidget(self) + return false + end + + local newCom + -- Which button? + if mx < px + (64*widgetScale) then + newCom = fedcomDefID + elseif mx < px + (128*widgetScale) then + newCom = lozcomDefID + elseif mx < px + (192*widgetScale) then + newCom = patterncomDefID + end + if newCom then + commanderDefID = newCom + -- tell initial_spawn + spSendLuaRulesMsg("\138" .. tostring(commanderDefID)) + -- tell initial_queue + if WG["faction_change"] then + WG["faction_change"](commanderDefID) + end + + --Remake gui + if factionChangeList then + glDeleteList(factionChangeList) + end + factionChangeList = glCreateList(GenerateFactionChangeList) + updateGuishader() + + return true + end + + elseif (mButton == 2 or mButton == 3) and mx < px + (192*widgetScale) then + -- Dragging + return true + end + end +end + +function widget:MouseMove(mx, my, dx, dy, mButton) + -- Dragging + if mButton == 2 or mButton == 3 then + px = px + dx + py = py + dy + if factionChangeList then + glDeleteList(factionChangeList) + end + factionChangeList = glCreateList(FactionChangeList) + end +end + +function widget:GameStart() + widgetHandler:RemoveWidget(self) +end + diff --git a/LuaUI/Widgets_Evo/gui_fancy_selected_units.lua b/LuaUI/Widgets_Evo/gui_fancy_selected_units.lua new file mode 100644 index 000000000..64670fcb9 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_fancy_selected_units.lua @@ -0,0 +1,852 @@ +function widget:GetInfo() + return { + name = "Fancy Selected Units", --(took 'UnitShapes' widget as a base for this one) + desc = "Shows which units are selected", + author = "Floris", + date = "04.04.2014", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local currentRotationAngle = 0 +local currentRotationAngleOpposite = 0 +local previousOsClock = os.clock() + +local animationMultiplier = 1 +local animationMultiplierInner = 1 +local animationMultiplierAdd = true + +local clearquad +local shapes = {} +local degrot = {} + +local rad_con = 180 / math.pi +local math_acos = math.acos + +local UNITCONF = {} + +local selectedUnits = {} +local selectedUnitsInvisible = {} + +local maxSelectTime = 0 --time at which units "new selection" animation will end +local maxDeselectedTime = -1 --time at which units deselection animation will end + +local checkSelectionChanges = true +local limitDetails = false + +local glCallList = gl.CallList +local glDrawListAtUnit = gl.DrawListAtUnit + +local spIsUnitSelected = Spring.IsUnitSelected +local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local spGetSelectedUnitsSorted = Spring.GetSelectedUnitsSorted +local spGetUnitTeam = Spring.GetUnitTeam +local spLoadCmdColorsConfig = Spring.LoadCmdColorsConfig +local spGetUnitDirection = Spring.GetUnitDirection +local spGetCameraPosition = Spring.GetCameraPosition +local spGetUnitViewPosition = Spring.GetUnitViewPosition +local spGetUnitDefID = Spring.GetUnitDefID +local spIsGUIHidden = Spring.IsGUIHidden +local spGetTeamColor = Spring.GetTeamColor +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitIsCloaked = Spring.GetUnitIsCloaked +local spUnitInView = Spring.IsUnitInView +local spIsUnitVisible = Spring.IsUnitVisible + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local OPTIONS = { -- these will be loaded when switching style, but the style will overwrite the those values + showExtraComLine = true, -- extra circle lines for the commander unit + showExtraBuildingWeaponLine = true, + + teamcolorOpacity = 0.55, -- how much teamcolor used for the base platter + + -- opacity + spotterOpacity = 0.95, + baseOpacity = 0.15, -- setting to 0: wont be rendered + firstLineOpacity = 1, + + -- animation + selectionStartAnimation = true, + selectionStartAnimationTime = 0.05, + selectionStartAnimationScale = 0.82, + -- selectionStartAnimationScale = 1.17, + selectionEndAnimation = true, + selectionEndAnimationTime = 0.07, + selectionEndAnimationScale = 0.9, + --selectionEndAnimationScale = 1.17, + + -- animation + rotationSpeed = 2.5, + animationSpeed = 0.00045, -- speed of scaling up/down inner and outer lines + animateSpotterSize = true, + maxAnimationMultiplier = 1.012, + minAnimationMultiplier = 0.99, + + -- circle shape + solidCirclePieces = 32, + circlePieces = 64, + circlePieceDetail = 1, + circleSpaceUsage = 1, + circleInnerOffset = 0, + + -- size + innersize = 1.7, + selectinner = 1.66, + outersize = 1.8, +} + +------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------ + + +local function SetupCommandColors(state) + spLoadCmdColorsConfig('unitBox 0 1 0 ' .. (state and 1 or 0)) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Creating polygons: +local function CreateDisplayLists(callback) + local displayLists = {} + + displayLists.select = callback.fading(OPTIONS.outersize, OPTIONS.selectinner) + displayLists.inner = callback.solid({0, 0, 0, 0}, OPTIONS.innersize) + displayLists.large = callback.solid(nil, OPTIONS.selectinner) + displayLists.shape = callback.fading(OPTIONS.innersize, OPTIONS.selectinner) + + return displayLists +end + + + +local function DrawCircleLine(innersize, outersize) + gl.BeginEnd(GL.QUADS, function() + local detailPartWidth, a1,a2,a3,a4 + local width = OPTIONS.circleSpaceUsage + local detail = OPTIONS.circlePieceDetail + + local radstep = (2.0 * math.pi) / OPTIONS.circlePieces + for i = 1, OPTIONS.circlePieces do + for d = 1, detail do + + detailPartWidth = ((width / detail) * d) + a1 = ((i+detailPartWidth - (width / detail)) * radstep) + a2 = ((i+detailPartWidth) * radstep) + a3 = ((i+OPTIONS.circleInnerOffset+detailPartWidth - (width / detail)) * radstep) + a4 = ((i+OPTIONS.circleInnerOffset+detailPartWidth) * radstep) + + --outer (fadein) + gl.Vertex(math.sin(a4)*innersize, 1, math.cos(a4)*innersize) + gl.Vertex(math.sin(a3)*innersize, 1, math.cos(a3)*innersize) + --outer (fadeout) + gl.Vertex(math.sin(a1)*outersize, 1, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2)*outersize, 1, math.cos(a2)*outersize) + end + end + end) +end + +local function DrawCircleSolid(size) + gl.BeginEnd(GL.TRIANGLE_FAN, function() + local pieces = OPTIONS.solidCirclePieces + local radstep = (2.0 * math.pi) / pieces + local a1 + if (color) then + gl.Color(color) + end + gl.Vertex(0, 1, 0) + for i = 0, pieces do + a1 = (i * radstep) + gl.Vertex(math.sin(a1)*size, 1, math.cos(a1)*size) + end + end) +end + +local function CreateCircleLists() + local callback = {} + + function callback.fading(innersize, outersize) + return gl.CreateList(DrawCircleLine, innersize, outersize) + end + + function callback.solid(color, size) + return gl.CreateList(DrawCircleSolid, size) + end + + shapes.circle = CreateDisplayLists(callback) +end + + + +local function DrawSquareLine(innersize, outersize) + + gl.BeginEnd(GL.QUADS, function() + local radstep = (2.0 * math.pi) / 4 + local width, a1,a2,a2_2 + for i = 1, 4 do + -- straight piece + width = 0.7 + i = i + 0.65 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + + gl.Vertex(math.sin(a2)*innersize, 1, math.cos(a2)*innersize) + gl.Vertex(math.sin(a1)*innersize, 1, math.cos(a1)*innersize) + + gl.Vertex(math.sin(a1)*outersize, 1, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2)*outersize, 1, math.cos(a2)*outersize) + + -- corner piece + width = 0.3 + i = i + 3 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + i = i -0.6 + a2_2 = ((i+width) * radstep) + + gl.Vertex(math.sin(a2_2)*innersize, 1, math.cos(a2_2)*innersize) + gl.Vertex(math.sin(a1)*innersize, 1, math.cos(a1)*innersize) + + gl.Vertex(math.sin(a1)*outersize, 1, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2_2)*outersize, 1, math.cos(a2_2)*outersize) + end + end) +end + +local function DrawSquareSolid(size) + gl.BeginEnd(GL.TRIANGLE_FAN, function() + local width, a1,a2,a2_2 + local radstep = (2.0 * math.pi) / 4 + + for i = 1, 4 do + --straight piece + width = 0.7 + i = i + 0.65 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + + gl.Vertex(0, 0, 0) + gl.Vertex(math.sin(a2)*size, 1, math.cos(a2)*size) + gl.Vertex(math.sin(a1)*size, 1, math.cos(a1)*size) + + --corner piece + width = 0.3 + i = i + 3 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + i = i -0.6 + a2_2 = ((i+width) * radstep) + + gl.Vertex(0, 0, 0) + gl.Vertex(math.sin(a2_2)*size, 1, math.cos(a2_2)*size) + gl.Vertex(math.sin(a1)*size, 1, math.cos(a1)*size) + end + + end) +end + +local function CreateSquareLists() + + local callback = {} + + function callback.fading(innersize, outersize) + return gl.CreateList(DrawSquareLine, innersize, outersize) + end + + function callback.solid(color, size) + return gl.CreateList(DrawSquareSolid, size) + end + shapes.square = CreateDisplayLists(callback) +end + + + +local function DrawTriangleLine(innersize, outersize) + gl.BeginEnd(GL.QUADS, function() + local width, a1,a2,a2_2 + local radstep = (2.0 * math.pi) / 3 + + for i = 1, 3 do + --straight piece + width = 0.75 + i = i + 0.625 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + + gl.Vertex(math.sin(a2)*innersize, 1, math.cos(a2)*innersize) + gl.Vertex(math.sin(a1)*innersize, 1, math.cos(a1)*innersize) + + gl.Vertex(math.sin(a1)*outersize, 1, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2)*outersize, 1, math.cos(a2)*outersize) + + -- corner piece + width = 0.35 + i = i + 3 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + i = i -0.6 + a2_2 = ((i+width) * radstep) + + gl.Vertex(math.sin(a2_2)*innersize, 1, math.cos(a2_2)*innersize) + gl.Vertex(math.sin(a1)*innersize, 1, math.cos(a1)*innersize) + + gl.Vertex(math.sin(a1)*outersize, 1, math.cos(a1)*outersize) + gl.Vertex(math.sin(a2_2)*outersize, 1, math.cos(a2_2)*outersize) + end + + end) +end + +local function DrawTriangleSolid(size) + + gl.BeginEnd(GL.TRIANGLE_FAN, function() + + local width, a1,a2,a2_2 + local radstep = (2.0 * math.pi) / 3 + + for i = 1, 3 do + -- straight piece + width = 0.75 + i = i + 0.625 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + + gl.Vertex(0, 0, 0) + gl.Vertex(math.sin(a2)*size, 1, math.cos(a2)*size) + gl.Vertex(math.sin(a1)*size, 1, math.cos(a1)*size) + + -- corner piece + width = 0.35 + i = i + 3 + a1 = (i * radstep) + a2 = ((i+width) * radstep) + i = i -0.6 + a2_2 = ((i+width) * radstep) + + gl.Vertex(0, 0, 0) + gl.Vertex(math.sin(a2_2)*size, 1, math.cos(a2_2)*size) + gl.Vertex(math.sin(a1)*size, 1, math.cos(a1)*size) + end + + end) +end + +local function CreateTriangleLists() + + local callback = {} + + function callback.fading(innersize, outersize) + return gl.CreateList(DrawTriangleLine, innersize, outersize) + end + + function callback.solid(color, size) + return gl.CreateList(DrawTriangleSolid, size) + end + shapes.triangle = CreateDisplayLists(callback) +end + + +local function DestroyShape(shape) + gl.DeleteList(shape.select) + gl.DeleteList(shape.inner) + gl.DeleteList(shape.large) + gl.DeleteList(shape.shape) +end + + + +function widget:Initialize() + + loadConfig() + + clearquad = gl.CreateList(function() + local size = 1000 + gl.BeginEnd(GL.QUADS, function() + gl.Vertex( -size,0, -size) + gl.Vertex( Game.mapSizeX+size,0, -size) + gl.Vertex( Game.mapSizeX+size,0, Game.mapSizeZ+size) + gl.Vertex( -size,0, Game.mapSizeZ+size) + end) + end) + + currentClock = os.clock() + + WG['fancyselectedunits'] = {} + WG['fancyselectedunits'].getOpacity = function() + return OPTIONS.spotterOpacity + end + WG['fancyselectedunits'].setOpacity = function(value) + OPTIONS.spotterOpacity = value + OPTIONS.spotterOpacity = value + end + WG['fancyselectedunits'].getBaseOpacity = function() + return OPTIONS.baseOpacity + end + WG['fancyselectedunits'].setBaseOpacity = function(value) + OPTIONS.baseOpacity = value + OPTIONS.baseOpacity = value + end + WG['fancyselectedunits'].getTeamcolorOpacity = function() + return OPTIONS.teamcolorOpacity + end + WG['fancyselectedunits'].setTeamcolorOpacity = function(value) + OPTIONS.teamcolorOpacity = value + OPTIONS.teamcolorOpacity = value + end + + SetupCommandColors(false) +end + + +function loadConfig() + + CreateCircleLists() + CreateSquareLists() + CreateTriangleLists() + + SetUnitConf() +end + + +function SetUnitConf() + -- prefer not to change because other widgets use these values too (highlight_units, given_units, selfd_icons, ...) + local scaleFactor = 2.6 + local rectangleFactor = 3.25 + + local name, shape, xscale, zscale, scale, xsize, zsize, weaponcount, shapeName + for udid, unitDef in pairs(UnitDefs) do + xsize, zsize = unitDef.xsize, unitDef.zsize + scale = scaleFactor*( xsize^2 + zsize^2 )^0.5 + name = unitDef.name + + + if (unitDef.isBuilding or unitDef.isFactory or unitDef.speed==0) then + shapeName = 'square' + shape = shapes.square + xscale, zscale = rectangleFactor * xsize, rectangleFactor * zsize + elseif (unitDef.isAirUnit) then + shapeName = 'triangle' + shape = shapes.triangle + xscale, zscale = scale*1.07, scale*1.07 + elseif (unitDef.modCategories["ship"]) then + shapeName = 'circle' + shape = shapes.circle + xscale, zscale = scale*0.82, scale*0.82 + else + shapeName = 'circle' + shape = shapes.circle + xscale, zscale = scale, scale + end + + local radius = Spring.GetUnitDefDimensions(udid).radius + xscale = (xscale*0.7) + (radius/5) + zscale = (zscale*0.7) + (radius/5) + + weaponcount = table.getn(unitDef.weapons) + + UNITCONF[udid] = {name=name, shape=shape, shapeName=shapeName, xscale=xscale, zscale=zscale, weaponcount=weaponcount} + end +end + + +function widget:Shutdown() + if WG['teamplatter'] == nil and WG['highlightselunits'] == nil then + SetupCommandColors(true) + end + WG['fancyselectedunits'] = nil + + gl.DeleteList(clearquad) + + for _, shape in pairs(shapes) do + DestroyShape(shape) + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function GetUsedRotationAngle(unitID, shapeName, opposite) + if (shapeName == 'circle') then + if opposite then + return currentRotationAngleOpposite + else + return currentRotationAngle + end + else + return degrot[unitID] + end +end + + +local selectedUnitsSorted = Spring.GetSelectedUnitsSorted() +local selectedUnitsCount = Spring.GetSelectedUnitsCount() +function widget:SelectionChanged(sel) + checkSelectionChanges = true +end + + +local function updateSelectedUnitsData() + + -- re-add selected units that became visible again + for unitID, unitParams in pairs(selectedUnitsInvisible) do + if spIsUnitVisible(unitID) then + selectedUnits[unitParams.teamID][unitID] = unitParams + selectedUnitsInvisible[unitID] = nil + end + end + + -- remove deselected and out-of-view units + -- adjust unit direction + local clockDifference + local visibleUnitCount = 0 + for teamID,_ in pairs(selectedUnits) do + for unitID,_ in pairs(selectedUnits[teamID]) do + + -- remove deselected units + if not spIsUnitSelected(unitID) and selectedUnits[teamID][unitID].selected then + clockDifference = OPTIONS.selectionStartAnimationTime - (currentClock - selectedUnits[teamID][unitID].new) + if clockDifference < 0 then + clockDifference = 0 + end + selectedUnits[teamID][unitID].selected = false + selectedUnits[teamID][unitID].new = false + selectedUnits[teamID][unitID].old = currentClock - clockDifference + end + selectedUnits[teamID][unitID].visible = spIsUnitVisible(unitID) + + -- check if isnt visible + if not spIsUnitVisible(unitID) then + selectedUnitsInvisible[unitID] = selectedUnits[teamID][unitID] + selectedUnitsInvisible[unitID].teamID = teamID + selectedUnits[teamID][unitID] = nil + else + visibleUnitCount = visibleUnitCount + 1 + -- logs current unit direction (needs regular updates for air units, and for buildings only once) + local dirx, _, dirz = spGetUnitDirection(unitID) + if (dirz ~= nil) then + degrot[unitID] = 180 - math_acos(dirz) * rad_con + if dirx < 0 then + degrot[unitID] = 180 - math_acos(dirz) * rad_con + else + degrot[unitID] = 180 + math_acos(dirz) * rad_con + end + end + end + end + end + + -- add selected units + if selectedUnitsCount > 0 then + local units = selectedUnitsSorted + local clockDifference, unitID, teamID + for uDID,_ in pairs(units) do + if uDID ~= 'n' then --'n' returns table size + for i=1, #units[uDID] do + unitID = units[uDID][i] + if UNITCONF[uDID] then + teamID = spGetUnitTeam(unitID) + if teamID then + if not selectedUnits[teamID] then + selectedUnits[teamID] = {} + end + if not selectedUnitsInvisible[unitID] then + if not selectedUnits[teamID][unitID] then + selectedUnits[teamID][unitID] = {} + selectedUnits[teamID][unitID].new = currentClock + elseif selectedUnits[teamID][unitID].old then + clockDifference = OPTIONS.selectionEndAnimationTime - (currentClock - selectedUnits[teamID][unitID].old) + if clockDifference < 0 then + clockDifference = 0 + end + selectedUnits[teamID][unitID].new = currentClock - clockDifference + selectedUnits[teamID][unitID].old = nil + end + selectedUnits[teamID][unitID].selected = true + selectedUnits[teamID][unitID].udid = spGetUnitDefID(unitID) + selectedUnits[teamID][unitID].visible = spIsUnitVisible(unitID) + end + end + end + end + end + end + end +end + +local selChangedSec = 0 +function widget:Update(dt) + currentClock = os.clock() + maxSelectTime = currentClock - OPTIONS.selectionStartAnimationTime + maxDeselectedTime = currentClock - OPTIONS.selectionEndAnimationTime + + selChangedSec = selChangedSec + dt + if checkSelectionChanges and selChangedSec >= 0.05 then + selChangedSec = 0 + selectedUnitsSorted = Spring.GetSelectedUnitsSorted() + selectedUnitsCount = Spring.GetSelectedUnitsCount() + updateSelectedUnitsData() + checkSelectionChanges = false + end +end + + +do + local unitID, unit, draw, unitPosX, unitPosY, unitPosZ, changedScale, usedAlpha, usedScale, usedXScale, usedZScale, usedRotationAngle + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress + + function DrawSelectionSpottersPart(teamID, type, r,g,b,a,scale, opposite, relativeScaleSchrinking, changeOpacity, drawUnitStyles) + + for unitID,unitParams in pairs(selectedUnits[teamID]) do + + unit = UNITCONF[unitParams.udid] + changedScale = 1 + usedAlpha = a + + if (OPTIONS.selectionEndAnimation or OPTIONS.selectionStartAnimation) then + if changeOpacity then + gl.Color(r,g,b,a) + end + -- check if the unit is deselected + if (OPTIONS.selectionEndAnimation and not unitParams.selected) then + if (maxDeselectedTime < unitParams.old) then + changedScale = OPTIONS.selectionEndAnimationScale + (((unitParams.old - maxDeselectedTime) / OPTIONS.selectionEndAnimationTime)) * (1 - OPTIONS.selectionEndAnimationScale) + if (changeOpacity) then + usedAlpha = 1 - (((unitParams.old - maxDeselectedTime) / OPTIONS.selectionEndAnimationTime) * (1-a)) + gl.Color(r,g,b,usedAlpha) + end + else + selectedUnits[teamID][unitID] = nil + degrot[unitID] = nil + end + + -- check if the unit is newly selected + elseif (OPTIONS.selectionStartAnimation and unitParams.new > maxSelectTime) then + --spEcho(unitParams.new - maxSelectTime) + changedScale = OPTIONS.selectionStartAnimationScale + (((currentClock - unitParams.new) / OPTIONS.selectionStartAnimationTime)) * (1 - OPTIONS.selectionStartAnimationScale) + if (changeOpacity) then + usedAlpha = 1 - (((currentClock - unitParams.new) / OPTIONS.selectionStartAnimationTime) * (1-a)) + gl.Color(r,g,b,usedAlpha) + end + if not degrot[unitID] then + local dirx, _, dirz = spGetUnitDirection(unitID) + if (dirz ~= nil) then + degrot[unitID] = 180 - math_acos(dirz) * rad_con + if dirx < 0 then + degrot[unitID] = 180 - math_acos(dirz) * rad_con + else + degrot[unitID] = 180 + math_acos(dirz) * rad_con + end + end + end + end + end + + if selectedUnits[teamID][unitID] and unitParams.visible then + usedRotationAngle = GetUsedRotationAngle(unitID, unit.shapeName, opposite) + + if type == 'normal solid' then + + -- special style for coms + if drawUnitStyles and OPTIONS.showExtraComLine and (unit.name == 'corcom' or unit.name == 'armcom') then + gl.Color(r,g,b,(usedAlpha*usedAlpha)+0.22) + usedScale = scale * 1.25 + glDrawListAtUnit(unitID, unit.shape.inner, false, (unit.xscale*usedScale*changedScale)-((unit.xscale*changedScale-10)/10), 1.0, (unit.zscale*usedScale*changedScale)-((unit.zscale*changedScale-10)/10), currentRotationAngleOpposite, 0, degrot[unitID], 0) + usedScale = scale * 1.23 + gl.Color(r,g,b,(usedAlpha*usedAlpha)+0.08) + glDrawListAtUnit(unitID, unit.shape.large, false, (unit.xscale*usedScale*changedScale)-((unit.xscale*changedScale-10)/10), 1.0, (unit.zscale*usedScale*changedScale)-((unit.zscale*changedScale-10)/10), 0, 0, degrot[unitID], 0) + else + -- adding style for buildings with weapons + if drawUnitStyles and OPTIONS.showExtraBuildingWeaponLine and unit.shapeName == 'square' then + if (unit.weaponcount > 0) then + gl.Color(r,g,b,usedAlpha*(usedAlpha+0.2)) + usedScale = scale * 1.1 + glDrawListAtUnit(unitID, unit.shape.select, false, (unit.xscale*usedScale*changedScale)-((unit.xscale*changedScale-10)/7.5), 1.0, (unit.zscale*usedScale*changedScale)-((unit.zscale*changedScale-10)/7.5), usedRotationAngle, 0, degrot[unitID], 0) + end + gl.Color(r,g,b,usedAlpha) + end + + if relativeScaleSchrinking then + glDrawListAtUnit(unitID, unit.shape.select, false, (unit.xscale*scale*changedScale)-((unit.xscale*changedScale-5)/10), 1.0, (unit.zscale*scale*changedScale)-((unit.zscale*changedScale-5)/10), usedRotationAngle, 0, degrot[unitID], 0) + else + glDrawListAtUnit(unitID, unit.shape.select, false, unit.xscale*scale*changedScale, 1.0, unit.zscale*scale*changedScale, usedRotationAngle, 0, degrot[unitID], 0) + end + end + + elseif type == 'solid overlap' then + + if relativeScaleSchrinking then + glDrawListAtUnit(unitID, unit.shape.large, false, (unit.xscale*scale*changedScale)-((unit.xscale*changedScale-5)/50), 1.0, (unit.zscale*scale*changedScale)-((unit.zscale*changedScale-5)/50), usedRotationAngle, 0, degrot[unitID], 0) + else + glDrawListAtUnit(unitID, unit.shape.large, false, (unit.xscale*scale*changedScale)+((unit.xscale-15)/15), 1.0, (unit.zscale*scale*changedScale)+((unit.zscale-15)/15), usedRotationAngle, 0, degrot[unitID], 0) + end + + elseif type == 'base' then + usedXScale = unit.xscale + usedZScale = unit.zscale + if OPTIONS.showExtraComLine and (unit.name == 'corcom' or unit.name == 'armcom') then + usedXScale = usedXScale * 1.23 + usedZScale = usedZScale * 1.23 + elseif OPTIONS.showExtraBuildingWeaponLine and unit.shapeName == 'square' then + if (unit.weaponcount > 0) then + usedXScale = usedXScale * 1.14 + usedZScale = usedZScale * 1.14 + end + end + glDrawListAtUnit(unitID, unit.shape.large, false, (usedXScale*scale*changedScale)-((usedXScale*changedScale-10)/10), 1.0, (usedZScale*scale*changedScale)-((usedZScale*changedScale-10)/10), usedRotationAngle, 0, degrot[unitID], 0) + end + end + end + end +end --// end do + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if spIsGUIHidden() then return end + + local clockDifference = (os.clock() - previousOsClock) + previousOsClock = os.clock() + + -- animate rotation + if OPTIONS.rotationSpeed > 0 then + local angleDifference = (OPTIONS.rotationSpeed) * (clockDifference * 5) + currentRotationAngle = currentRotationAngle + (angleDifference*0.66) + if currentRotationAngle > 360 then + currentRotationAngle = currentRotationAngle - 360 + end + + currentRotationAngleOpposite = currentRotationAngleOpposite - angleDifference + if currentRotationAngleOpposite < -360 then + currentRotationAngleOpposite = currentRotationAngleOpposite + 360 + end + end + + -- animate scale + if OPTIONS.animateSpotterSize then + local addedMultiplierValue = OPTIONS.animationSpeed * (clockDifference * 50) + if (animationMultiplierAdd and animationMultiplier < OPTIONS.maxAnimationMultiplier) then + animationMultiplier = animationMultiplier + addedMultiplierValue + animationMultiplierInner = animationMultiplierInner - addedMultiplierValue + if (animationMultiplier > OPTIONS.maxAnimationMultiplier) then + animationMultiplier = OPTIONS.maxAnimationMultiplier + animationMultiplierInner = OPTIONS.minAnimationMultiplier + animationMultiplierAdd = false + end + else + animationMultiplier = animationMultiplier - addedMultiplierValue + animationMultiplierInner = animationMultiplierInner + addedMultiplierValue + if (animationMultiplier < OPTIONS.minAnimationMultiplier) then + animationMultiplier = OPTIONS.minAnimationMultiplier + animationMultiplierInner = OPTIONS.maxAnimationMultiplier + animationMultiplierAdd = true + end + end + end + + + local baseR, baseG, baseB, a, scale, scaleBase, scaleOuter + scale = 1 * animationMultiplierInner + scaleBase = scale * 1.133 + + gl.PushAttrib(GL.COLOR_BUFFER_BIT) + gl.DepthTest(false) + + -- loop teams + for teamID,_ in pairs(selectedUnits) do + + gl.ColorMask(false, false, false, true) + gl.BlendFunc(GL.ONE, GL.ONE) + gl.Color(1,1,1,1) + glCallList(clearquad) + + -- draw base background layer + if OPTIONS.baseOpacity > 0.009 then + if OPTIONS.teamcolorOpacity < 0.02 then + baseR,baseG,baseB = 1,1,1 + else + baseR,baseG,baseB = spGetTeamColor(teamID) + baseR = 1-OPTIONS.teamcolorOpacity + (baseR*OPTIONS.teamcolorOpacity) + baseG = 1-OPTIONS.teamcolorOpacity + (baseG*OPTIONS.teamcolorOpacity) + baseB = 1-OPTIONS.teamcolorOpacity + (baseB*OPTIONS.teamcolorOpacity) + end + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + DrawSelectionSpottersPart(teamID, 'base', baseR,baseG,baseB,0,scaleBase, false, false, false, false) + + -- Here the inner of the selected spotters are removed + gl.BlendFunc(GL.ONE, GL.ZERO) + a = 1 - (OPTIONS.baseOpacity) + DrawSelectionSpottersPart(teamID, 'base', baseR,baseG,baseB,a,scaleBase, false, false, true, false) + + -- Really draw the spotters now (This could be optimised if we could say Draw as much as DST_ALPHA * SRC_ALPHA is) + -- (without protecting form drawing them twice) + gl.ColorMask(true,true,true,true) + gl.BlendFunc(GL.ONE_MINUS_DST_ALPHA, GL.DST_ALPHA) + glCallList(clearquad) + end + + -- draw line layer + a = 1 - (OPTIONS.firstLineOpacity * OPTIONS.spotterOpacity) + + gl.ColorMask(false, false, false, true) + gl.BlendFunc(GL.ONE_MINUS_SRC_ALPHA, GL.SRC_ALPHA) + + gl.Color(1,1,1,a) + DrawSelectionSpottersPart(teamID, 'normal solid', 1,1,1,a,scale, false, false, true, false) + + -- Here the inner of the selected spotters are removed + gl.BlendFunc(GL.ONE, GL.ZERO) + gl.Color(1,1,1,1) + DrawSelectionSpottersPart(teamID, 'solid overlap', 1,1,1,a,scale, false, false, false, false) + + -- Really draw the spotters now (This could be optimised if we could say Draw as much as DST_ALPHA * SRC_ALPHA is) + -- (without protecting form drawing them twice) + gl.ColorMask(true, true, true, true) + gl.BlendFunc(GL.ONE_MINUS_DST_ALPHA, GL.DST_ALPHA) + + -- Does not need to be drawn per Unit anymore + glCallList(clearquad) + end + + gl.ColorMask(false,false,false,false) + gl.Color(1,1,1,1) + gl.PopAttrib() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Config related + +function widget:GetConfigData(data) + savedTable = {} + savedTable.spotterOpacity = OPTIONS.spotterOpacity + savedTable.baseOpacity = OPTIONS.baseOpacity + savedTable.teamcolorOpacity = OPTIONS.teamcolorOpacity + + return savedTable +end + +function widget:SetConfigData(data) + OPTIONS.spotterOpacity = data.spotterOpacity or OPTIONS.spotterOpacity + OPTIONS.baseOpacity = data.baseOpacity or OPTIONS.baseOpacity + OPTIONS.teamcolorOpacity = data.teamcolorOpacity or OPTIONS.teamcolorOpacity +end + diff --git a/LuaUI/Widgets_Evo/gui_fancy_teamplatter.lua b/LuaUI/Widgets_Evo/gui_fancy_teamplatter.lua deleted file mode 100644 index 7194b5f34..000000000 --- a/LuaUI/Widgets_Evo/gui_fancy_teamplatter.lua +++ /dev/null @@ -1,187 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: gui_fancy_teamplatter.lua --- brief: Draws transparant smoothed donuts under enemy units --- author: Dave Rodgers (orig. TeamPlatter edited by TradeMark) --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Fancy Teamplatter", - desc = "Draws transparant smoothed donuts under friendly and enemy units (using teamcolor)", - author = "TradeMark (Floris: added multiple ally color support) (Forboding Angel: removed extra FX stuff) (zoggop: made it use only team colors)", - date = "7.02.2014", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true -- loaded by default? - } -end - - - --------------------------------------------------------------------------------- --- Config --------------------------------------------------------------------------------- - -local drawWithHiddenGUI = true -- keep widget enabled when graphical user interface is hidden (when pressing F5) - -local circleSize = 1 -local circleDivs = 12 -- how precise circle? octagon by default -local circleOpacity = 0.5 -local innerSize = 1.35 -- circle scale compared to unit radius -local outerSize = 1.5 -- outer fade size compared to circle scale (1 = no outer fade) - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- Automatically generated local definitions - -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA -local glBlending = gl.Blending -local glBeginEnd = gl.BeginEnd -local glColor = gl.Color -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glDepthTest = gl.DepthTest -local glDrawListAtUnit = gl.DrawListAtUnit -local glPolygonOffset = gl.PolygonOffset -local glVertex = gl.Vertex -local spGetTeamColor = Spring.GetTeamColor -local spGetUnitDefDimensions = Spring.GetUnitDefDimensions -local spGetUnitDefID = Spring.GetUnitDefID -local spIsUnitSelected = Spring.IsUnitSelected -local spGetTeamList = Spring.GetTeamList -local spGetVisibleUnits = Spring.GetVisibleUnits -local spIsGUIHidden = Spring.IsGUIHidden -local spGetUnitTeam = Spring.GetUnitTeam - -local myTeamID = Spring.GetLocalTeamID() - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local realRadii = {} -local circlePolys = {} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Creating polygons: -function widget:Initialize() - - local teamList = spGetTeamList() - local numberOfTeams = #teamList - - for teamListIndex = 1, #teamList do - local teamID = teamList[teamListIndex] - local r,g,b,a = spGetTeamColor(teamID) - - circlePolys[teamID] = glCreateList(function() - glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) -- disable layer blending - - -- colored inner circle: - glBeginEnd(GL.TRIANGLES, function() - local radstep = (2.0 * math.pi) / circleDivs - for i = 1, circleDivs do - local a1 = (i * radstep) - local a2 = ((i+1) * radstep) - --(fadefrom) - glColor(r, g, b, 0) - glVertex(0, 0, 0) - --(colorSet) - glColor(r, g, b, circleOpacity) - glVertex(math.sin(a1), 0, math.cos(a1)) - glVertex(math.sin(a2), 0, math.cos(a2)) - end - end) - - if (outerSize ~= 1) then - -- colored outer circle: - glBeginEnd(GL.QUADS, function() - local radstep = (2.0 * math.pi) / circleDivs - for i = 1, circleDivs do - local a1 = (i * radstep) - local a2 = ((i+1) * radstep) - --(colorSet) - glColor(r, g, b, circleOpacity) - glVertex(math.sin(a1), 0, math.cos(a1)) - glVertex(math.sin(a2), 0, math.cos(a2)) - --(fadeto) - glColor(r, g, b, 0) - glVertex(math.sin(a2)*outerSize, 0, math.cos(a2)*outerSize) - glVertex(math.sin(a1)*outerSize, 0, math.cos(a1)*outerSize) - end - end) - end - end) - - end - -end - -function widget:Shutdown() - --glDeleteList(circlePolys) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Retrieving radius: -local function GetUnitDefRealRadius(udid) - local radius = realRadii[udid] - if (radius) then return radius end - local ud = UnitDefs[udid] - if (ud == nil) then return nil end - local dims = spGetUnitDefDimensions(udid) - if (dims == nil) then return nil end - local scale = ud.hitSphereScale -- missing in 0.76b1+ - scale = ((scale == nil) or (scale == 0.0)) and 1.0 or scale - radius = dims.radius / scale - realRadii[udid] = radius*circleSize - return radius -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - --- Drawing: -function widget:DrawWorldPreUnit() - if not drawWithHiddenGUI then - if spIsGUIHidden() then return end - end - glDepthTest(true) - glPolygonOffset(-100, -2) - local visibleUnits = spGetVisibleUnits() - if #visibleUnits then - for i=1, #visibleUnits do - local unitID = visibleUnits[i] - local teamID = spGetUnitTeam(unitID) - if circlePolys[teamID] ~= nil then - local unitDefIDValue = spGetUnitDefID(unitID) - if (unitDefIDValue) then - local radius = GetUnitDefRealRadius(unitDefIDValue) * circleSize - if (radius) then - glDrawListAtUnit(unitID, circlePolys[teamID], false, radius, 1.0, radius) - end - end - end - end - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_gameinfo.lua b/LuaUI/Widgets_Evo/gui_gameinfo.lua new file mode 100644 index 000000000..3694d22e9 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_gameinfo.lua @@ -0,0 +1,667 @@ + +function widget:GetInfo() + return { + name = "Game info", + desc = "", + author = "Floris", + date = "May 2017", + license = "", + layer = 2, + enabled = true, + } +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local loadedFontSize = fontfileSize*fontfileScale + +local bgcorner = "LuaUI/Images/bgcorner.png" + + +local titlecolor = "\255\255\205\100" +local keycolor = "" +local valuecolor = "\255\255\255\255" +local valuegreycolor = "\255\180\180\180" +local vcolor = valuegreycolor +local separator = "::" + +local teams = Spring.GetTeamList() +for i =1, #teams do + local luaAI = Spring.GetTeamLuaAI(teams[i]) + if luaAI and luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then + chickensEnabled = true + end +end + +local content = "" +content = content .. titlecolor..Game.gameName..valuegreycolor.." ("..Game.gameMutator..") "..titlecolor..Game.gameVersion.."\n" +content = content .. keycolor.."Engine"..separator..valuegreycolor..((Game and Game.version) or (Engine and Engine.version) or "Engine version error").."\n" +content = content .. "\n" + +-- map info +content = content .. titlecolor..Game.mapName.."\n" +content = content .. valuegreycolor..Game.mapDescription.."\n" +content = content .. keycolor.."Size"..separator..valuegreycolor..Game.mapX..valuegreycolor.." x "..valuegreycolor..Game.mapY.."\n" +content = content .. keycolor.."Gravity"..separator..valuegreycolor..Game.gravity.."\n" +content = content .. keycolor.."Hardness"..separator..valuegreycolor..Game.mapHardness.. keycolor.."\n" +tidal = Game.tidal +if Spring.GetModOptions() and Spring.GetModOptions().map_tidal then + map_tidal = Spring.GetModOptions().map_tidal + if map_tidal == "unchanged" then + elseif map_tidal == "low" then + tidal = 13 + elseif map_tidal == "medium" then + tidal = 18 + elseif map_tidal == "high" then + tidal = 23 + end +end +if Spring.GetTidal then + tidal = Spring.GetTidal() +end +content = content .. keycolor.."Tidal speed"..separator..valuegreycolor..tidal.. keycolor.."\n" + + +if Game.windMin == Game.windMax then + content = content .. keycolor.."Wind speed"..separator..valuegreycolor..Game.windMin..valuegreycolor.."\n" +else + content = content .. keycolor.."Wind speed"..separator..valuegreycolor..Game.windMin..valuegreycolor.." - "..valuegreycolor..Game.windMax.."\n" +end +if Game.waterDamage == 0 then + vcolor = valuegreycolor +else + vcolor = valuecolor +end +content = content .. keycolor.."Water damage"..separator..vcolor..Game.waterDamage .. keycolor.."\n" +content = content .. "\n" + +-- modoptions +local defaultModoptions = VFS.Include("modoptions.lua") +local modoptionsDefault = {} + +for key, value in pairs(defaultModoptions) do + local v = value.def + if value.def == false then + v = 0 + elseif value.def == true then + v = 1 + end + modoptionsDefault[tostring(value.key)] = tostring(v) +end +-- modoptions.lua doesnt contain engine modoptions: maxunits, pathfinder, startmetal, startenergy, disablemapdamage, fixedallies +modoptionsDefault['maxspeed'] = '3' +modoptionsDefault['minspeed'] = '0.3' +--modoptionsDefault['pathfinder'] = 'normal' +modoptionsDefault['startmetal'] = '1000' +modoptionsDefault['startenergy'] = '1000' +modoptionsDefault['fixedallies'] = '1' +modoptionsDefault['maxunits'] = '2000' +modoptionsDefault['disablemapdamage'] = '0' + +local modoptions = Spring.GetModOptions() +local vcolor = valuegreycolor +local changedModoptions = {} +local unchangedModoptions = {} +local changedChickenModoptions = {} +local unchangedChickenModoptions = {} + +for key, value in pairs(modoptions) do + if string.sub(key, 1, 8) == 'chicken_' then + if chickensEnabled then + if value == modoptionsDefault[key] then + unchangedChickenModoptions[key] = value + else + changedChickenModoptions[key] = value + end + end + modoptions[key] = nil -- filter chicken modoptions + end +end + +for key, value in pairs(modoptions) do + if value == modoptionsDefault[key] then + unchangedModoptions[key] = value + else + changedModoptions[key] = value + end +end +if chickensEnabled then -- filter chicken modoptions + content = content .. titlecolor.."Chicken options\n" + for key, value in pairs(changedChickenModoptions) do + content = content .. keycolor..string.sub(key, 9)..separator..valuecolor..value.."\n" + end + for key, value in pairs(unchangedChickenModoptions) do + content = content .. keycolor..string.sub(key, 9)..separator..valuegreycolor..value.."\n" + end + content = content .. "\n" +end +content = content .. titlecolor.."Mod options\n" +for key, value in pairs(changedModoptions) do + content = content .. keycolor..key..separator..valuecolor..value.."\n" +end +for key, value in pairs(unchangedModoptions) do + content = content .. keycolor..key..separator..valuegreycolor..value.."\n" +end + + +local bgMargin = 6 + +local closeButtonSize = 30 +local screenHeight = 520-bgMargin-bgMargin +local screenWidth = 400-bgMargin-bgMargin + +local textareaMinLines = 10 -- wont scroll down more, will show at least this amount of lines + +local customScale = 1 + +local startLine = 1 + +local vsx,vsy = Spring.GetViewGeometry() +local screenX = (vsx*0.5) - (screenWidth/2) +local screenY = (vsy*0.5) + (screenHeight/2) + +local spIsGUIHidden = Spring.IsGUIHidden +local showHelp = false + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glPolygonMode = gl.PolygonMode +local glRect = gl.Rect +local glText = gl.Text +local glShape = gl.Shape + +local bgColorMultiplier = 0 + +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glScale = gl.Scale + +local GL_FILL = GL.FILL +local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK +local GL_LINE_STRIP = GL.LINE_STRIP + +local widgetScale = 1 +local vsx, vsy = Spring.GetViewGeometry() + +local changelogLines = {} +local totalChangelogLines = 0 + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + screenX = (vsx*0.5) - (screenWidth/2) + screenY = (vsy*0.5) + (screenHeight/2) + widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + loadedFontSize = fontfileSize*fontfileScale + end + if changelogList then gl.DeleteList(changelogList) end + changelogList = gl.CreateList(DrawWindow) +end + +local myTeamID = Spring.GetMyTeamID() +local amNewbie = (Spring.GetTeamRulesParam(myTeamID, 'isNewbie') == 1) + +local showOnceMore = false -- used because of GUI shader delay + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +function DrawTextarea(x,y,width,height,scrollbar) + local scrollbarOffsetTop = 18 -- note: wont add the offset to the bottom, only to top + local scrollbarOffsetBottom = 12 -- note: wont add the offset to the top, only to bottom + local scrollbarMargin = 10 + local scrollbarWidth = 8 + local scrollbarPosWidth = 4 + local scrollbarPosMinHeight = 8 + local scrollbarBackgroundColor = {0,0,0,0.24 } + local scrollbarBarColor = {1,1,1,0.08} + + local fontSizeTitle = 17 -- is version number + local fontSizeDate = 13 + local fontSizeLine = 15 + local lineSeparator = 2 + + local fontColorTitle = {1,1,1,1} + local fontColorDate = {0.66,0.88,0.66,1} + local fontColorLine = {0.8,0.77,0.74,1} + local fontColorCommand = {0.9,0.6,0.2,1} + + local textRightOffset = scrollbar and scrollbarMargin+scrollbarWidth+scrollbarWidth or 0 + local maxLines = math.floor((height-5)/fontSizeLine) + + -- textarea scrollbar + if scrollbar then + if (totalChangelogLines > maxLines or startLine > 1) then -- only show scroll above X lines + local scrollbarTop = y-scrollbarOffsetTop-scrollbarMargin-(scrollbarWidth-scrollbarPosWidth) + local scrollbarBottom = y-scrollbarOffsetBottom-height+scrollbarMargin+(scrollbarWidth-scrollbarPosWidth) + local scrollbarPosHeight = math.max(((height-scrollbarMargin-scrollbarMargin) / totalChangelogLines) * ((height-scrollbarMargin-scrollbarMargin) / 25), scrollbarPosMinHeight) + if scrollbarPosHeight > scrollbarTop-scrollbarBottom then scrollbarPosHeight = scrollbarTop-scrollbarBottom end + local scrollbarPos = scrollbarTop + (scrollbarBottom - scrollbarTop) * ((startLine-1) / totalChangelogLines) + scrollbarPos = scrollbarPos + ((startLine-1) / totalChangelogLines) * scrollbarPosHeight -- correct position taking position bar height into account + + -- background + gl.Color(scrollbarBackgroundColor) + RectRound( + x+width-scrollbarMargin-scrollbarWidth, + scrollbarBottom-(scrollbarWidth-scrollbarPosWidth), + x+width-scrollbarMargin, + scrollbarTop+(scrollbarWidth-scrollbarPosWidth), + scrollbarWidth/2 + ) + -- bar + gl.Color(scrollbarBarColor) + RectRound( + x+width-scrollbarMargin-scrollbarWidth + (scrollbarWidth - scrollbarPosWidth), + scrollbarPos, + x+width-scrollbarMargin-(scrollbarWidth - scrollbarPosWidth), + scrollbarPos - (scrollbarPosHeight), + scrollbarPosWidth/2 + ) + end + end + + -- draw textarea + if content then + font:Begin() + local lineKey = startLine + local j = 1 + while j < maxLines do -- maxlines is not exact, just a failsafe + if (lineSeparator+fontSizeTitle)*j > height then + break; + end + if changelogLines[lineKey] == nil then + break; + end + + local line = changelogLines[lineKey] + if string.find(line, '::') then + local cmd = string.match(line, '^[ \+a-zA-Z0-9_-]*') -- escaping the escape: \\ doesnt work in lua !#$@&*()&5$# + local descr = string.sub(line, string.len(string.match(line, '^[ \+a-zA-Z0-9_-]*::'))+1) + descr, numLines = font:WrapText(descr, (width-scrollbarMargin-scrollbarWidth - 250 - textRightOffset)*(loadedFontSize/fontSizeLine)) + if (lineSeparator+fontSizeTitle)*(j+numLines-1) > height then + break; + end + + font:SetTextColor(fontColorCommand) + font:Print(cmd, x+20, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + + font:SetTextColor(fontColorLine) + font:Print(descr, x+250, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + j = j + (numLines - 1) + else + -- line + font:SetTextColor(fontColorLine) + line = "" .. line + line, numLines = font:WrapText(line, (width-scrollbarMargin-scrollbarWidth)*(loadedFontSize/fontSizeLine)) + if (lineSeparator+fontSizeTitle)*(j+numLines-1) > height then + break; + end + font:Print(line, x+10, y-(lineSeparator+fontSizeTitle)*j, fontSizeLine, "n") + j = j + (numLines - 1) + end + + j = j + 1 + lineKey = lineKey + 1 + end + font:End() + end +end + + +function DrawWindow() + local vsx,vsy = Spring.GetViewGeometry() + local x = screenX --rightwards + local y = screenY --upwards + + -- background + gl.Color(0,0,0,0.8) + RectRound(x-bgMargin,y-screenHeight-bgMargin,x+screenWidth+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + gl.Color(0.33,0.33,0.33,0.15) + RectRound(x,y-screenHeight,x+screenWidth,y,6) + + -- close button + local size = closeButtonSize*0.7 + local width = size*0.055 + gl.Color(1,1,1,1) + gl.PushMatrix() + gl.Translate(screenX+screenWidth-(closeButtonSize/2),screenY-(closeButtonSize/2),0) + gl.Rotate(-45,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(90,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.PopMatrix() + + -- title + local title = "Game info" + local titleFontSize = 18 + gl.Color(0,0,0,0.8) + titleRect = {x-bgMargin, y+bgMargin, x+(font2:GetTextWidth(title)*titleFontSize)+27-bgMargin, y+37} + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font2:End() + + -- textarea + DrawTextarea(x, y-10, screenWidth, screenHeight-24, 1) +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if spIsGUIHidden() then return end + if amNewbie then return end + + -- draw the help + if not changelogList then + changelogList = gl.CreateList(DrawWindow) + end + + if show or showOnceMore then + + -- draw the changelog panel + glPushMatrix() + glTranslate(-(vsx * (widgetScale-1))/2, -(vsy * (widgetScale-1))/2, 0) + glScale(widgetScale, widgetScale, 1) + glCallList(changelogList) + glPopMatrix() + if WG['guishader'] then + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if backgroundGuishader ~= nil then + glDeleteList(backgroundGuishader) + end + backgroundGuishader = glCreateList( function() + -- background + RectRound(rectX1, rectY2, rectX2, rectY1, 9*widgetScale, 0,1,1,1) + -- title + rectX1 = (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY1 = (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2) + rectX2 = (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY2 = (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2) + RectRound(rectX1, rectY1, rectX2, rectY2, 9*widgetScale, 1,1,0,0) + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'gameinfo') + end + showOnceMore = false + + else + if WG['guishader'] then + WG['guishader'].DeleteDlist('gameinfo') + end + end +end + +function widget:KeyPress(key) + if key == 27 then -- ESC + show = false + end +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY +end + +function widget:MouseWheel(up, value) + + if show then + local addLines = value*-3 -- direction is retarded + + startLine = startLine + addLines + if startLine < 1 then startLine = 1 end + if startLine > totalChangelogLines - textareaMinLines then startLine = totalChangelogLines - textareaMinLines end + + if changelogList then + glDeleteList(changelogList) + end + + changelogList = gl.CreateList(DrawWindow) + return true + else + return false + end +end + +function widget:MouseMove(x, y) + if show then + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if not IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + end + end +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + +function mouseEvent(x, y, button, release) + if spIsGUIHidden() then return false end + + if show then + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + -- on close button + local brectX1 = rectX2 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + local brectY2 = rectY1 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + if IsOnRect(x, y, brectX1, brectY2, rectX2, rectY1) then + if release then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = not show + end + return true + end + + if button == 1 or button == 3 then + if button == 3 and release then + show = not show + end + return true + end + elseif titleRect == nil or not IsOnRect(x, y, (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2), (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2)) then + if release then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = false + end + return true + end + end +end + +function lines(str) + local t = {} + local function helper(line) t[#t+1] = line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + + +local function hideWindows() + if (WG['options'] ~= nil) then + WG['options'].toggle(false) + end + if (WG['changelog'] ~= nil) then + WG['changelog'].toggle(false) + end + if (WG['keybinds'] ~= nil) then + WG['keybinds'].toggle(false) + end + if (WG['commands'] ~= nil) then + WG['commands'].toggle(false) + end + if (WG['teamstats'] ~= nil) then + WG['teamstats'].toggle(false) + end +end + +function toggle() + show = not show + if show then + hideWindows() + end +end + +function widget:Initialize() + if content then + + widgetHandler:AddAction("customgameinfo", toggle) + Spring.SendCommands("unbind any+i gameinfo") + Spring.SendCommands("unbind i gameinfo") + Spring.SendCommands("bind i customgameinfo") + + WG['gameinfo'] = {} + WG['gameinfo'].toggle = function(state) + if state ~= nil then + show = state + else + show = not show + end + if show then + hideWindows() + end + end + + -- somehow there are a few characters added at the start that we need to remove + --content = string.sub(content, 4) + + -- store changelog into array + changelogLines = lines(content) + + for i, line in ipairs(changelogLines) do + totalChangelogLines = i + end + + else + --Spring.Echo("Commands info: couldn't load the commandslist file") + widgetHandler:RemoveWidget(self) + end +end + +function widget:Shutdown() + Spring.SendCommands("unbind i customgameinfo") + Spring.SendCommands("bind any+i gameinfo") + Spring.SendCommands("bind i gameinfo") + widgetHandler:RemoveAction("customgameinfo", toggle) + + if buttonGL then + glDeleteList(buttonGL) + buttonGL = nil + end + if changelogList then + glDeleteList(changelogList) + changelogList = nil + end + if WG['guishader'] then + WG['guishader'].DeleteDlist('gameinfo') + end + gl.DeleteFont(font) + gl.DeleteFont(font2) +end diff --git a/LuaUI/Widgets_Evo/gui_given_units.lua b/LuaUI/Widgets_Evo/gui_given_units.lua new file mode 100644 index 000000000..d4ab75306 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_given_units.lua @@ -0,0 +1,210 @@ +function widget:GetInfo() + return { + name = "Given Units", + desc = "Tags given units with 'new' icon", + author = "Floris", + date = "24.04.2014", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true + } +end + + +--TODO +-- better icon because bloom makes the letters unreadable + + +-------------------------------------------------------------------------------- +-- Config +-------------------------------------------------------------------------------- + +OPTIONS = { + selectedFadeTime = 0.75, + timeoutTime = 6.5, + timeoutFadeTime = 3, +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local givenUnits = {} +local drawList +local unitConf = {} + +local glDrawListAtUnit = gl.DrawListAtUnit +local spIsGUIHidden = Spring.IsGUIHidden +local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local spGetUnitDefID = Spring.GetUnitDefID +local spIsUnitInView = Spring.IsUnitInView +local spGetCameraDirection = Spring.GetCameraDirection + +local myTeamID = Spring.GetLocalTeamID() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function SetUnitConf() + for udid, unitDef in pairs(UnitDefs) do + local xsize, zsize = unitDef.xsize, unitDef.zsize + local scale = 6*( xsize^2 + zsize^2 )^0.5 + unitConf[udid] = 7 + (scale/2.5) + end +end + + +function DrawIcon() + local iconSize = 1 + gl.Translate(0,1,1.4) + gl.Billboard() + gl.TexRect(-(iconSize/2), 0, (iconSize/2), iconSize) +end + + +-- add unit-icon to unit +function AddGivenUnit(unitID) + local unitDefID = spGetUnitDefID(unitID) + givenUnits[unitID] = {} + givenUnits[unitID].osClock = os.clock() + givenUnits[unitID].lastInViewClock = os.clock() + givenUnits[unitID].unitHeight = UnitDefs[unitDefID].height + givenUnits[unitID].unitScale = unitConf[unitDefID] + --givenUnits[unitID].lastInViewClock = Spring.GetGameSeconds() + OPTIONS.timeoutTime + --givenUnits[unitID].endSecs = Spring.GetGameSeconds() + OPTIONS.timeoutTime +end + +-------------------------------------------------------------------------------- +-- Engine Calls +-------------------------------------------------------------------------------- + +function maybeRemoveSelf() + if Spring.GetSpectatingState() and (Spring.GetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget(self) + end +end + +function widget:GameStart() + gameStarted = true + maybeRemoveSelf() +end + +function widget:PlayerChanged(playerID) + maybeRemoveSelf() +end + +function widget:Initialize() + if Spring.IsReplay() or Spring.GetGameFrame() > 0 then + maybeRemoveSelf() + end + SetUnitConf() + drawList = gl.CreateList(DrawIcon) +end + +function widget:Shutdown() + gl.DeleteList(drawList) +end + + +local sec = 0 +local prevCam = {spGetCameraDirection()} +function widget:Update(dt) + sec = sec + dt + if sec > 0.15 then + sec = 0 + + if commandsChangedCheck then + commandsChangedCheck = nil + for uDID,unit in pairs(Spring.GetSelectedUnitsSorted()) do + if uDID ~= 'n' then --'n' returns table size + for i=1,#unit do + local unitID = unit[i] + if givenUnits[unitID] then + local currentAlpha = 1 - ((os.clock() - (givenUnits[unitID].osClock + (OPTIONS.timeoutTime - OPTIONS.timeoutFadeTime))) / OPTIONS.timeoutFadeTime) + if currentAlpha > 1 then + currentAlpha = 1 + end + givenUnits[unitID].selected = os.clock() - (OPTIONS.selectedFadeTime * (1 - currentAlpha)) + --givenUnits[unitID].selectedGameSecs = Spring.GetGameSeconds() + UnitDefs[spGetUnitDefID(unitID)].selfDCountdown + else + -- uncomment line below for testing + -- AddGivenUnit(unitID) + end + end + end + end + end + + local camX, camY, camZ = spGetCameraDirection() + if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then + gl.DeleteList(drawList) + drawList = gl.CreateList(DrawIcon) + end + prevCam = {camX,camY,camZ } + end +end + + +-- draw icons +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if spIsGUIHidden() then return end + local osClock = os.clock() + --local gameSecs = Spring.GetGameSeconds() + + gl.DepthMask(true) + gl.DepthTest(true) + gl.Texture('LuaUI/Images/new.dds') + + local alpha + for unitID, unit in pairs(givenUnits) do + if unit.selected then + alpha = 1 - ((osClock - unit.selected) / OPTIONS.selectedFadeTime) + else + alpha = 1 - ((osClock - (unit.osClock + (OPTIONS.timeoutTime - OPTIONS.timeoutFadeTime))) / OPTIONS.timeoutFadeTime) + end + if spIsUnitInView(unitID) then + + if alpha <= 0 then + givenUnits[unitID] = nil + else + gl.Color(1,1,1,alpha) + glDrawListAtUnit(unitID, drawList, false, unit.unitScale, unit.unitScale, unit.unitScale) + end + else + if unit.selected then + givenUnits[unitID].selected = os.clock() + else + givenUnits[unitID].osClock = os.clock() + end + end + end + + gl.Color(1,1,1,1) + gl.Texture(false) + gl.DepthTest(false) + gl.DepthMask(false) +end + + +-- add given units +function widget:UnitGiven(unitID, unitDefID, newTeam, oldTeam) + if (newTeam == myTeamID) then + AddGivenUnit(unitID) + end +end + + +-- remove icons when the given units are selected +function widget:CommandsChanged() + + if spGetSelectedUnitsCount() > 0 then + commandsChangedCheck = true + end +end + diff --git a/LuaUI/Widgets_Evo/gui_group_recall_fix.lua b/LuaUI/Widgets_Evo/gui_group_recall_fix.lua index aa20aec7f..068028bb2 100644 --- a/LuaUI/Widgets_Evo/gui_group_recall_fix.lua +++ b/LuaUI/Widgets_Evo/gui_group_recall_fix.lua @@ -31,7 +31,7 @@ options = { timeoutlength = { name = "Double Press Speed", type = "number", - value = 0.4, + value = 0.2, min = 0, max = 5, step = 0.1, @@ -59,6 +59,7 @@ local groupNumber = { [KEYSYMS.N_7] = 7, [KEYSYMS.N_8] = 8, [KEYSYMS.N_9] = 9, + [KEYSYMS.N_0] = 0, } local function GroupRecallFix(key, modifier, isRepeat) diff --git a/LuaUI/Widgets_Evo/gui_healthbars.lua b/LuaUI/Widgets_Evo/gui_healthbars.lua new file mode 100644 index 000000000..90e397c93 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_healthbars.lua @@ -0,0 +1,1543 @@ + +function widget:GetInfo() + return { + name = "Health Bars", + desc = "Options: /healthbars_style, /healthbars_percentage", + author = "Floris (original plain bars by jK)", + date = "28 march 2015", + license = "GNU GPL, v2 or later", + layer = -10, + enabled = true + } +end + +-------------------------------------------------------------------------------- +-- Console commands +-------------------------------------------------------------------------------- + +-- /healthbars_percentage -- toggles rendering of the textual percentage beside each bar +-- /healthbars_compercentage -- toggles always rendering health precentagees for coms +-- /healthbars_style -- toggles different styles + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local barScale = 1 + +local barHeightOffset = 34 -- set value that healthbars for units that can unfold and become larger than its unitdef.height are still visible + +local barHeight = 5 +local barWidth = 24 --// (barWidth)x2 total width!!! +local barAlpha = 0.85 +local barOutlineAlpha = 0.8 +local barInnerAlpha = 0.5 +local barValueAlpha = 0.9 -- alpha of the colored part + +local featureBarHeight = 1.6 +local featureBarWidth = 7.5 +local featureBarAlpha = 0.6 + +local drawBarTitles = true -- (I disabled the healthbar text, cause that one doesnt need an explanation) +local titlesAlpha = 0.3*barAlpha + +local drawBarPercentage = 0 -- wont draw heath percentage text above this percentage +local alwaysDrawBarPercentageForComs = true +local drawFeatureBarPercentage = 0 -- true: commanders always will show health percentage number +local choppedCornerSize = 0.45 +local outlineSize = 0.75 +local drawFullHealthBars = false +local unitHpThreshold = 0.99 + +local drawFeatureHealth = true +local featureTitlesAlpha = featureBarAlpha * titlesAlpha/barAlpha +local featureHpThreshold = 0.85 + +local featureResurrectVisibility= true -- draw feature bars for resurrected features on same distance as normal unit bars +local featureReclaimVisibility = true -- draw feature bars for reclaimed features on same distance as normal unit bars + +local minPercentageDistance = 120000 -- always show health percentage text below this distance +local infoDistance = 800000 +local maxFeatureInfoDistance = 300000 --max squared distance at which text it drawn for features +local maxFeatureDistance = 550000 --max squared distance at which any info is drawn for features +local maxUnitDistance = 11000000 --max squared distance at which any info is drawn for units MUST BE LARGER THAN FOR FEATURES! + +local minReloadTime = 4 --// in seconds + +local destructableFeature = {} +local drawnFeature = {} +for i = 1, #FeatureDefs do + destructableFeature[i] = FeatureDefs[i].destructable + drawnFeature[i] = (FeatureDefs[i].drawTypeString=="model") +end + +local drawStunnedOverlay = true + +--// this table is used to shows the hp of perimeter defence, and filter it for default wreckages +local walls = {dragonsteeth=true,dragonsteeth_core=true,fortification=true,fortification_core=true,floatingteeth=true,floatingteeth_core=true} + +local stockpileH = 24 +local stockpileW = 12 + +local notificationTimeout = 0 + + +local OPTIONS = {} +OPTIONS[1] = { + choppedCorners = false, + showOutline = false, + showInnerBg = false, +} +OPTIONS[2] = { + choppedCorners = true, + showOutline = true, + showInnerBg = true, +} +local currentOption = 2 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--// colors +local bkBottom = { 0.25,0.25,0.25,barAlpha } +local bkTop = { 0.10,0.10,0.10,barAlpha } +local bkOutlineBottom = { 0.25,0.25,0.25,barOutlineAlpha } +local bkOutlineTop = { 0.10,0.10,0.10,barOutlineAlpha } +local bkInnerBottom = { 0.06,0.06,0.06,barInnerAlpha } +local bkInnerTop = { 0.33,0.33,0.33,barInnerAlpha*0.5 } +local hpcolormap = { {1, 0.0, 0.0, barValueAlpha}, {0.8, 0.60, 0.0, barValueAlpha}, {0.0,0.75,0.0,barValueAlpha} } +local bfcolormap = {} + +local fbkBottom = { 0.40,0.40,0.40,featureBarAlpha } +local fbkTop = { 0.06,0.06,0.06,featureBarAlpha } +local fhpcolormap = { {0.33, 0.33, 0.33, featureBarAlpha*1.5}, {0.33, 0.33, 0.33, featureBarAlpha*1.5}, {0.33,0.33,0.33,featureBarAlpha*1.5} } + +local barColors = { + emp = { 0.50,0.50,1.00,barValueAlpha }, + emp_p = { 0.40,0.40,0.80,barValueAlpha }, + emp_b = { 0.60,0.60,0.90,barValueAlpha }, + capture = { 1.00,0.50,0.00,barValueAlpha }, + build = { 0.75,0.75,0.75,barValueAlpha }, + stock = { 0.50,0.50,0.50,barValueAlpha }, + reload = { 0.05,0.60,0.60,barValueAlpha }, + shield = { 0.20,0.60,0.60,barValueAlpha }, + resurrect = { 1.00,0.50,0.00,barValueAlpha }, + reclaim = { 0.75,0.75,0.75,barValueAlpha }, +} + +local ignoreUnits = {} +for udefID,def in ipairs(UnitDefs) do + if def.customParams['nohealthbars'] then + ignoreUnits[udefID] = true + end +end +local ignoreFeatures = {} +for fdefID,def in pairs(FeatureDefs) do + if def.customParams['nohealthbars'] then + ignoreFeatures[fdefID] = true + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local blink = false; +local gameFrame = 0; + +local empDecline = 32/30/40; + +local cx, cy, cz = 0,0,0; --// camera pos +local smoothheight = 0 + +local paraUnits = {}; +local UnitMorphs = {}; + +local barShader; +local barDList; +local barFeatureDList; + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +--// speedup (there are a lot more localizations, but they are in limited scope cos we are running out of upvalues) +local glColor = gl.Color +local glMyText = gl.FogCoord +local floor = math.floor +local sub = string.sub +local GetUnitDefID = Spring.GetUnitDefID +local glDepthTest = gl.DepthTest + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +-- tiny perf improvement this way: +local unitsUnitDefCache = {} +function aGetUnitDefID(unitID) + if unitsUnitDefCache[unitID] == nil then + unitsUnitDefCache[unitID] = spGetUnitDefID(unitID) + end + return unitsUnitDefCache[unitID] +end +function widget:UnitDestroyed(unitID, unitDefID, unitTeam) + unitsUnitDefCache[unitID] = nil +end + + +do + local deactivated = false + function showhealthbars(cmd, line, words) + if ((words[1])and(words[1]~="0"))or(deactivated) then + widgetHandler:UpdateCallIn('DrawWorld') + deactivated = false + else + widgetHandler:RemoveCallIn('DrawWorld') + deactivated = true + end + end +end --//end do + + + +-- if you change code inside this function, then dont forget to change drawFeatureBarGl() aswell +function drawBarGl() + + local cs = choppedCornerSize + local heightAddition = 0 + if OPTIONS[currentOption].showOutline then + heightAddition = outlineSize + end + gl.PushMatrix() + gl.Scale(barScale,barScale,barScale) + + if (OPTIONS[currentOption].choppedCorners) then + gl.BeginEnd(GL.QUADS,function() + + + -- center background piece + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(barWidth-cs, 0-heightAddition, 0, 1); + gl.Vertex(barWidth-cs, 0-heightAddition, (barWidth*2)-cs*2, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(barWidth-cs, barHeight+heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs, barHeight+heightAddition, 0, 1); + + if OPTIONS[currentOption].showOutline and OPTIONS[currentOption].showInnerBg then + cs = choppedCornerSize + -- inner center background piece + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs-cs, 0, 0, 2); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 2); + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 2); + gl.Vertex(barWidth-cs-cs, barHeight, 0, 2); + + -- inner background right piece + local cs2 = cs + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs-cs+cs2, cs2, 0, 2); + gl.Vertex(barWidth-cs-cs, 0, 0, 2); + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs-cs, barHeight, 0, 2); + gl.Vertex(barWidth-cs-cs+cs2, barHeight-cs2, 0, 2); + end + + -- background right piece + if OPTIONS[currentOption].choppedCorners or OPTIONS[currentOption].showOutline then + local cs2 = cs + if OPTIONS[currentOption].showOutline then + cs2 = outlineSize + end + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(barWidth-cs+cs2, cs2-heightAddition, 0, 1); + gl.Vertex(barWidth-cs, 0-heightAddition, 0, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(barWidth-cs, barHeight+heightAddition, 0, 1); + gl.Vertex(barWidth-cs+cs2, barHeight+heightAddition-cs2, 0, 1); + + + if heightAddition > 0 then + cs = outlineSize + -- background left piece + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(-barWidth-cs, cs-heightAddition, 0, 1); + gl.Vertex(-barWidth, -heightAddition, 0, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(-barWidth, barHeight+heightAddition, 0, 1); + gl.Vertex(-barWidth-cs, barHeight+heightAddition-cs, 0, 1); + + cs = choppedCornerSize + -- top middle piece + local usedColor = bkOutlineTop[1]+((bkOutlineBottom[1]-bkOutlineTop[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,bkOutlineTop[4]); + gl.Vertex(-barWidth, barHeight, 0, 1); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1); + gl.Color(bkOutlineTop); + gl.Vertex(barWidth-cs, barHeight+heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(-barWidth, barHeight+heightAddition, 0, 1); + + -- bottom middle piece + usedColor = bkOutlineBottom[1]-((bkOutlineBottom[1]-bkOutlineTop[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,bkOutlineTop[4]); + gl.Vertex(-barWidth, 0, 0, 1); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1); + gl.Color(bkOutlineBottom); + gl.Vertex(barWidth-cs, -heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(-barWidth, -heightAddition, 0, 1); + end + end + + -- color (value part) mid piece + gl.Vertex(-barWidth+cs, 0, 0, 0); + gl.Vertex(-barWidth, 0, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth, barHeight, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth+cs, barHeight, 0, 0); + + -- color (value part) left piece + gl.Vertex(-barWidth, cs, 0, 0); + gl.Vertex(-barWidth+cs, 0, 0, 0); + gl.Vertex(-barWidth+cs, barHeight, 0, 0); + gl.Vertex(-barWidth, barHeight-cs, 0, 0); + + -- color (value part) right piece + gl.Vertex(-barWidth+cs,cs, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth,0, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth,barHeight, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth+cs,barHeight-cs,(barWidth*2)-cs*2, 0); + + end) + -- corner fillers + gl.BeginEnd(GL.TRIANGLES,function() + cs = choppedCornerSize + + local inputBottomColor = bkBottom + local inputTopColor = bkTop + if OPTIONS[currentOption].showOutline then + inputBottomColor = bkOutlineBottom + inputTopColor = bkOutlineTop + end + -- top right + local usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(barWidth-cs, barHeight-cs, (barWidth*2)-cs*2, 1); + + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs-cs, barHeight, (barWidth*2)-cs*2, 1); + + -- bottom right + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(barWidth-cs, cs, (barWidth*2)-cs*2, 1); + + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs-cs, 0, (barWidth*2)-cs*2, 1); + + -- inner background corners + if OPTIONS[currentOption].showOutline and OPTIONS[currentOption].showInnerBg then + -- top right + usedColor = bkInnerTop[1]-((bkInnerTop[1]-bkInnerBottom[1]) * ((cs)/(barHeight))) + gl.Color(usedColor,usedColor,usedColor,bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight-cs, (barWidth*2)-cs*2, 1.0000001); + + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1.0000001); + gl.Vertex(barWidth-cs-cs, barHeight, (barWidth*2)-cs*2, 1.0000001); + + -- bottom right + usedColor = bkInnerBottom[1]+((bkInnerTop[1]-bkInnerBottom[1]) * ((cs)/(barHeight))) + gl.Color(usedColor,usedColor,usedColor,bkInnerBottom[4]); + gl.Vertex(barWidth-cs, cs, (barWidth*2)-cs*2, 1.0000001); + + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1.0000001); + gl.Vertex(barWidth-cs-cs, 0, (barWidth*2)-cs*2, 1.0000001); + end + + if heightAddition > 0 then + -- top left + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(-barWidth, barHeight-cs, 0, 1); + + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(-barWidth, barHeight, 0, 1); + gl.Vertex(-barWidth+cs, barHeight, 0, 1); + + -- bottom left + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(-barWidth, cs, 0, 1); + + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(-barWidth, 0, 0, 1); + gl.Vertex(-barWidth+cs, 0, 0, 1); + end + end) + else + gl.BeginEnd(GL.QUADS,function() + gl.Vertex(-barWidth,0, 0,0); + gl.Vertex(-barWidth,0, barWidth*2,0); + gl.Vertex(-barWidth,barHeight,barWidth*2,0); + gl.Vertex(-barWidth,barHeight,0,0); + + gl.Color(bkBottom); + gl.Vertex(barWidth,0, 0, 1); + gl.Vertex(barWidth,0, barWidth*2,1); + gl.Color(bkTop); + gl.Vertex(barWidth,barHeight,barWidth*2,1); + gl.Vertex(barWidth,barHeight,0, 1); + end) + end + gl.PopMatrix() + +end + + +-- is a copy of drawBarGl(), some vars changed (only at top: barHeight, barWidth, bkBottom, bkTop) +function drawFeatureBarGl() + local barHeight = featureBarHeight + local barWidth = featureBarWidth + local bkBottom = fbkBottom + local bkTop = fbkTop + + local cs = choppedCornerSize + local heightAddition = 0 + + if OPTIONS[currentOption].showOutline then + heightAddition = outlineSize + end + + if (OPTIONS[currentOption].choppedCorners) then + gl.BeginEnd(GL.QUADS,function() + + + -- center background piece + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(barWidth-cs, 0-heightAddition, 0, 1); + gl.Vertex(barWidth-cs, 0-heightAddition, (barWidth*2)-cs*2, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(barWidth-cs, barHeight+heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs, barHeight+heightAddition, 0, 1); + + if OPTIONS[currentOption].showOutline and OPTIONS[currentOption].showInnerBg then + cs = choppedCornerSize + -- inner center background piece + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs-cs, 0, 0, 2); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 2); + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 2); + gl.Vertex(barWidth-cs-cs, barHeight, 0, 2); + + -- inner background right piece + local cs2 = cs + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs-cs+cs2, cs2, 0, 2); + gl.Vertex(barWidth-cs-cs, 0, 0, 2); + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs-cs, barHeight, 0, 2); + gl.Vertex(barWidth-cs-cs+cs2, barHeight-cs2, 0, 2); + end + + -- background right piece + if OPTIONS[currentOption].choppedCorners or OPTIONS[currentOption].showOutline then + local cs2 = cs + if OPTIONS[currentOption].showOutline then + cs2 = outlineSize + end + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(barWidth-cs+cs2, cs2-heightAddition, 0, 1); + gl.Vertex(barWidth-cs, 0-heightAddition, 0, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(barWidth-cs, barHeight+heightAddition, 0, 1); + gl.Vertex(barWidth-cs+cs2, barHeight+heightAddition-cs2, 0, 1); + + + if heightAddition > 0 then + cs = outlineSize + -- background left piece + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineBottom or bkBottom)); + gl.Vertex(-barWidth-cs, cs-heightAddition, 0, 1); + gl.Vertex(-barWidth, -heightAddition, 0, 1); + gl.Color((OPTIONS[currentOption].showOutline and bkOutlineTop or bkTop)); + gl.Vertex(-barWidth, barHeight+heightAddition, 0, 1); + gl.Vertex(-barWidth-cs, barHeight+heightAddition-cs, 0, 1); + + cs = choppedCornerSize + -- top middle piece + local usedColor = bkOutlineTop[1]+((bkOutlineBottom[1]-bkOutlineTop[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,bkOutlineTop[4]); + gl.Vertex(-barWidth, barHeight, 0, 1); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1); + gl.Color(bkOutlineTop); + gl.Vertex(barWidth-cs, barHeight+heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(-barWidth, barHeight+heightAddition, 0, 1); + + -- bottom middle piece + usedColor = bkOutlineBottom[1]-((bkOutlineBottom[1]-bkOutlineTop[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,bkOutlineTop[4]); + gl.Vertex(-barWidth, 0, 0, 1); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1); + gl.Color(bkOutlineBottom); + gl.Vertex(barWidth-cs, -heightAddition, (barWidth*2)-cs*2, 1); + gl.Vertex(-barWidth, -heightAddition, 0, 1); + end + end + + -- color (value part) mid piece + gl.Vertex(-barWidth+cs, 0, 0, 0); + gl.Vertex(-barWidth, 0, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth, barHeight, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth+cs, barHeight, 0, 0); + + -- color (value part) left piece + gl.Vertex(-barWidth, cs, 0, 0); + gl.Vertex(-barWidth+cs, 0, 0, 0); + gl.Vertex(-barWidth+cs, barHeight, 0, 0); + gl.Vertex(-barWidth, barHeight-cs, 0, 0); + + -- color (value part) right piece + gl.Vertex(-barWidth+cs,cs, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth,0, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth,barHeight, (barWidth*2)-cs*2, 0); + gl.Vertex(-barWidth+cs,barHeight-cs,(barWidth*2)-cs*2, 0); + + end) + -- corner fillers + gl.BeginEnd(GL.TRIANGLES,function() + cs = choppedCornerSize + + local inputBottomColor = bkBottom + local inputTopColor = bkTop + if OPTIONS[currentOption].showOutline then + inputBottomColor = bkOutlineBottom + inputTopColor = bkOutlineTop + end + -- top right + local usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(barWidth-cs, barHeight-cs, (barWidth*2)-cs*2, 1); + + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs-cs, barHeight, (barWidth*2)-cs*2, 1); + + -- bottom right + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(barWidth-cs, cs, (barWidth*2)-cs*2, 1); + + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1); + gl.Vertex(barWidth-cs-cs, 0, (barWidth*2)-cs*2, 1); + + -- inner background corners + if OPTIONS[currentOption].showOutline and OPTIONS[currentOption].showInnerBg then + -- top right + usedColor = bkInnerTop[1]-((bkInnerTop[1]-bkInnerBottom[1]) * ((cs)/(barHeight))) + gl.Color(usedColor,usedColor,usedColor,bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight-cs, (barWidth*2)-cs*2, 1.0000001); + + gl.Color(bkInnerTop[1],bkInnerTop[2],bkInnerTop[3],bkInnerTop[4]); + gl.Vertex(barWidth-cs, barHeight, (barWidth*2)-cs*2, 1.0000001); + gl.Vertex(barWidth-cs-cs, barHeight, (barWidth*2)-cs*2, 1.0000001); + + -- bottom right + usedColor = bkInnerBottom[1]+((bkInnerTop[1]-bkInnerBottom[1]) * ((cs)/(barHeight))) + gl.Color(usedColor,usedColor,usedColor,bkInnerBottom[4]); + gl.Vertex(barWidth-cs, cs, (barWidth*2)-cs*2, 1.0000001); + + gl.Color(bkInnerBottom[1],bkInnerBottom[2],bkInnerBottom[3],bkInnerBottom[4]); + gl.Vertex(barWidth-cs, 0, (barWidth*2)-cs*2, 1.0000001); + gl.Vertex(barWidth-cs-cs, 0, (barWidth*2)-cs*2, 1.0000001); + end + + if heightAddition > 0 then + -- top left + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(-barWidth, barHeight-cs, 0, 1); + + usedColor = inputTopColor[1]+((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputTopColor[4]); + gl.Vertex(-barWidth, barHeight, 0, 1); + gl.Vertex(-barWidth+cs, barHeight, 0, 1); + + -- bottom left + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * ((heightAddition+cs)/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(-barWidth, cs, 0, 1); + + usedColor = inputBottomColor[1]-((inputBottomColor[1]-inputTopColor[1]) * (heightAddition/(barHeight+heightAddition+heightAddition))) + gl.Color(usedColor,usedColor,usedColor,inputBottomColor[4]); + gl.Vertex(-barWidth, 0, 0, 1); + gl.Vertex(-barWidth+cs, 0, 0, 1); + end + end) + else + gl.BeginEnd(GL.QUADS,function() + gl.Vertex(-barWidth,0, 0,0); + gl.Vertex(-barWidth,0, barWidth*2,0); + gl.Vertex(-barWidth,barHeight,barWidth*2,0); + gl.Vertex(-barWidth,barHeight,0,0); + + gl.Color(bkBottom); + gl.Vertex(barWidth,0, 0, 1); + gl.Vertex(barWidth,0, barWidth*2,1); + gl.Color(bkTop); + gl.Vertex(barWidth,barHeight,barWidth*2,1); + gl.Vertex(barWidth,barHeight,0, 1); + end) + end + +end + + + +function init() + + --// find real primary weapon and its reloadtime + for _,ud in pairs(UnitDefs) do + ud.reloadTime = 0; + ud.primaryWeapon = 0; + ud.shieldPower = 0; + + for i=1,#ud.weapons do + local WeaponDefID = ud.weapons[i].weaponDef; + local WeaponDef = WeaponDefs[ WeaponDefID ]; + if (WeaponDef.reload>ud.reloadTime) then + ud.reloadTime = WeaponDef.reload; + ud.primaryWeapon = i; + end + end + local shieldDefID = ud.shieldWeaponDef + ud.shieldPower = ((shieldDefID)and(WeaponDefs[shieldDefID].shieldPower))or(-1) + end + + --// wow, using a buffered list can give 1-2 frames in extreme(!) situations :p + for hp=0,100 do + bfcolormap[hp] = {GetColor(hpcolormap,hp*0.01)} + end + + --// create bar shader + if (gl.CreateShader) then + + if (barShader) then + gl.DeleteShader(barShader) + end + barShader = gl.CreateShader({ + + vertex = [[ + #version 120 + #define barColor gl_MultiTexCoord1 + #define progress gl_MultiTexCoord2.x + #define offset gl_MultiTexCoord2.y + + void main() + { + // switch between font rendering and bar rendering + if (gl_FogCoord>0.5f) { + gl_TexCoord[0]= gl_TextureMatrix[0]*gl_MultiTexCoord0; + gl_FrontColor = gl_Color; + gl_Position = ftransform(); + //return; -- commenting out this line fixes glitchy healthbars on intel gfx + } + vec4 vertex = gl_Vertex; + if (vertex.w==1) { + gl_FrontColor = gl_Color; + if (vertex.z>0.0) { + vertex.x -= (1.0-progress)*gl_Vertex.z; + vertex.z = 0.0; + } + + }else if (vertex.w==-2 ) { + gl_FrontColor = vec4(barColor.rgb,barColor.a); + + if (gl_Vertex.z>1.0) { + vertex.x += progress*gl_Vertex.z; + vertex.z = 0.0; + } + vertex.w = 1; + + }else if (vertex.w==-3 ) { + gl_FrontColor = vec4(barColor.rgb,barColor.a); + + if (vertex.z>1.0) { + vertex.x += progress*gl_Vertex.z; + vertex.z = 0.0; + } + vertex.w = 1; + + }else if (vertex.w==-4 ) { + gl_FrontColor = vec4(barColor.rgb,0); + + if (gl_Vertex.z>1.0) { + vertex.x += progress*gl_Vertex.z; + vertex.z = 0.0; + } + vertex.w = 1; + + }else if (vertex.w>1 ) { + if (progress >= 0.92) { // smooth out because else the bar wil overlap and look ugly at the end point + gl_FrontColor = vec4(gl_Color[0]+(barColor.r/4),gl_Color[1]+(barColor.g/4),gl_Color[2]+(barColor.b/4),((0.08-(progress-0.92))*12.5)*gl_Color[3]); + }else{ + gl_FrontColor = vec4(gl_Color[0]+(barColor.r/4),gl_Color[1]+(barColor.g/4),gl_Color[2]+(barColor.b/4),gl_Color[3]); + } + + if (vertex.z>0.0) { + vertex.x -= (1.0-progress)*gl_Vertex.z; + vertex.z = 0.0; + } + vertex.w = 1.0; + + }else{ + if (vertex.y>0.0) { + gl_FrontColor = vec4(barColor.rgb*1.8,barColor.a); + }else{ + gl_FrontColor = vec4(barColor.rgb*0.85,barColor.a); + } + if (vertex.z>1.0) { + vertex.x += progress*gl_Vertex.z; + vertex.z = 0.0; + } + vertex.w = 1.0; + } + vertex.y += offset; + gl_Position = gl_ModelViewProjectionMatrix*vertex; + } + ]], + uniform = { + + }, + }); + + + if (barShader) then + if (barDList) then + gl.DeleteList(barDList) + gl.DeleteList(barFeatureDList) + end + barDList = gl.CreateList(drawBarGl) + barFeatureDList = gl.CreateList(drawFeatureBarGl) + end + end +end + + +local function toggleOption() + currentOption = currentOption + 1 + if not OPTIONS[currentOption] then + currentOption = 1 + end + init() +end + + +function widget:Initialize() + --// catch f9 + Spring.SendCommands({"showhealthbars 0"}) + Spring.SendCommands({"showrezbars 0"}) + widgetHandler:AddAction("showhealthbars", showhealthbars) + Spring.SendCommands({"unbind f9 showhealthbars"}) + Spring.SendCommands({"bind f9 luaui showhealthbars"}) + + --// link morph callins + widgetHandler:RegisterGlobal('MorphUpdate', MorphUpdate) + widgetHandler:RegisterGlobal('MorphFinished', MorphFinished) + widgetHandler:RegisterGlobal('MorphStart', MorphStart) + widgetHandler:RegisterGlobal('MorphStop', MorphStop) + + --// deactivate cheesy progress text + widgetHandler:RegisterGlobal('MorphDrawProgress', function() return true end) + + + WG['healthbars'] = {} + WG['healthbars'].getScale = function() + return barScale + end + WG['healthbars'].setScale = function(value) + barScale = value + init() + end + + init() +end + + +function widget:Shutdown() + --// catch f9 + widgetHandler:RemoveAction("showhealthbars", showhealthbars) + Spring.SendCommands({"unbind f9 luaui"}) + Spring.SendCommands({"bind f9 showhealthbars"}) + --Spring.SendCommands({"showhealthbars 1"}) -- don't re-enable, nobody ever uses engines built in healthbars + --Spring.SendCommands({"showrezbars 1"}) + + widgetHandler:DeregisterGlobal('MorphUpdate', MorphUpdate) + widgetHandler:DeregisterGlobal('MorphFinished', MorphFinished) + widgetHandler:DeregisterGlobal('MorphStart', MorphStart) + widgetHandler:DeregisterGlobal('MorphStop', MorphStop) + + widgetHandler:DeregisterGlobal('MorphDrawProgress') + + if (barShader) then + gl.DeleteShader(barShader) + end + if (barDList) then + gl.DeleteList(barDList) + gl.DeleteList(barFeatureDList) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function GetColor(colormap,slider) + local coln = #colormap + if (slider>=1) then + local col = colormap[coln] + return col[1],col[2],col[3],col[4] + end + if (slider<0) then slider=0 elseif(slider>1) then slider=1 end + local posn = 1+(coln-1) * slider + local iposn = floor(posn) + local aa = posn - iposn + local ia = 1-aa + + local col1,col2 = colormap[iposn],colormap[iposn+1] + + return col1[1]*ia + col2[1]*aa, col1[2]*ia + col2[2]*aa, + col1[3]*ia + col2[3]*aa, col1[4]*ia + col2[4]*aa +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local DrawUnitBar +local DrawFeatureBar +local DrawStockpile + +do + --//speedup + local GL_QUADS = GL.QUADS + local glVertex = gl.Vertex + local glBeginEnd = gl.BeginEnd + local glMultiTexCoord = gl.MultiTexCoord + local glTexRect = gl.TexRect + local glTexture = gl.Texture + local glCallList = gl.CallList + local glText = gl.Text + + local function DrawGradient(left,top,right,bottom,topclr,bottomclr) + + glColor(bottomclr) + glVertex(left,bottom) + glVertex(right,bottom) + glColor(topclr) + glVertex(right,top) + glVertex(left,top) + end + + local brightClr = {} + function DrawUnitBar(offsetY,percent,color) + if (barShader) then + glMultiTexCoord(1,color) + glMultiTexCoord(2,percent,offsetY) + glCallList(barDList,progress) + return; + end + + brightClr[1] = color[1]*1.5; brightClr[2] = color[2]*1.5; brightClr[3] = color[3]*1.5; brightClr[4] = color[4] + local progress_pos= -barWidth+barWidth*2*percent-1 + local bar_Height = barHeight+offsetY + if percent<1 then glBeginEnd(GL_QUADS,DrawGradient,progress_pos, bar_Height, barWidth, offsetY, bkTop,bkBottom) end + glBeginEnd(GL_QUADS,DrawGradient,-barWidth, bar_Height, progress_pos, offsetY,brightClr,color) + end + + function DrawFeatureBar(offsetY,percent,color) + if (barShader) then + glMultiTexCoord(1,color) + glMultiTexCoord(2,percent,offsetY) + glCallList(barFeatureDList) + return; + end + + brightClr[1] = color[1]*1.5; brightClr[2] = color[2]*1.5; brightClr[3] = color[3]*1.5; brightClr[4] = color[4] + local progress_pos = -featureBarWidth+featureBarWidth*2*percent + glBeginEnd(GL_QUADS,DrawGradient,progress_pos, featureBarHeight+offsetY, featureBarWidth, offsetY, fbkTop,fbkBottom) + glBeginEnd(GL_QUADS,DrawGradient,-featureBarWidth, featureBarHeight+offsetY, progress_pos, offsetY, brightClr,color) + end + + function DrawStockpile(numStockpiled,numStockpileQued) + --// DRAW STOCKPILED MISSLES + glColor(1,1,1,1) + glTexture("LuaUI/Images/nuke.png") + local xoffset = barWidth+16 + for i=1,((numStockpiled>3) and 3) or numStockpiled do + glTexRect(xoffset,-(11*barHeight-2)-stockpileH,xoffset-stockpileW,-(11*barHeight-2)) + xoffset = xoffset-8 + end + glTexture(false) + + glText(numStockpiled..'/'..numStockpileQued,barWidth+1.7,-(11*barHeight-2)-16,6.5,"cno") + end + +end --//end do + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local AddBar +local DrawBars +local barsN = 0 + +do + --//speedup + local glColor = gl.Color + local glText = gl.Text + + local maxBars = 20 + local bars = {} + local barHeightL = barHeight + 1.5 + (OPTIONS[currentOption].showOutline and outlineSize or 0) + + local barStart = -(barWidth + 1.5) - (OPTIONS[currentOption].showOutline and outlineSize or 0) + local fBarHeightL = featureBarHeight + 1.5 + (OPTIONS[currentOption].showOutline and outlineSize or 0) + local fBarStart = -(featureBarWidth + 1.5) - (OPTIONS[currentOption].showOutline and outlineSize or 0) + + for i=1,maxBars do bars[i] = {} end + + function AddBar(title,progress,color_index,text,color) + barsN = barsN + 1 + local barInfo = bars[barsN] + barInfo.title = title + barInfo.progress = progress + barInfo.color = color or barColors[color_index] + barInfo.text = text + end + + function DrawBars(fullText) + local yoffset = 0 + for i=1,barsN do + local barInfo = bars[i] + DrawUnitBar(yoffset,barInfo.progress,barInfo.color) + if (fullText) then + + gl.PushMatrix() + gl.Scale(barScale,barScale,barScale) + if (barShader) then + glMyText(1) + end + glColor(1,1,1,barAlpha) + glText(barInfo.text,barStart,yoffset-outlineSize,4,"ro") + if (drawBarTitles and barInfo.title ~= "health") then + glColor(1,1,1,titlesAlpha) + glText(barInfo.title,0,yoffset-outlineSize,4.70,"cdo") + end + if (barShader) then glMyText(0) end + gl.PopMatrix() + end + yoffset = yoffset - barHeightL + end + + barsN = 0 --//reset! + end + + function DrawBarsFeature(fullText) + local yoffset = 0 + for i=1,barsN do + local barInfo = bars[i] + DrawFeatureBar(yoffset,barInfo.progress,barInfo.color) + if (fullText) then + if (barShader) then glMyText(1) end + if (drawBarPercentage > 0) then + glColor(1,1,1,featureBarAlpha) + glText(barInfo.text,fBarStart,yoffset-outlineSize,4,"r") + end + if (drawBarTitles and barInfo.title ~= "health") then + glColor(1,1,1,featureTitlesAlpha) + glText(barInfo.title,0,yoffset-outlineSize,4.70,"cdo") + end + if (barShader) then glMyText(0) end + end + yoffset = yoffset - fBarHeightL + end + + barsN = 0 --//reset! + end + +end --//end do + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local DrawUnitInfos + +do + --//speedup + local glTranslate = gl.Translate + local glPushMatrix = gl.PushMatrix + local glPopMatrix = gl.PopMatrix + local glBillboard = gl.Billboard + local GetUnitIsStunned = Spring.GetUnitIsStunned + local GetUnitHealth = Spring.GetUnitHealth + local GetUnitWeaponState = Spring.GetUnitWeaponState + local GetUnitShieldState = Spring.GetUnitShieldState + local GetUnitViewPosition = Spring.GetUnitViewPosition + local GetUnitStockpile = Spring.GetUnitStockpile + local GetUnitRulesParam = Spring.GetUnitRulesParam + + local fullText + local ux, uy, uz + local dx, dy, dz, dist + local health,maxHealth,paralyzeDamage,capture,build + local hp, hp100, emp + local reload,reloaded,reloadFrame + local numStockpiled,numStockpileQued + + local customInfo = {} + local ci + + function DrawUnitInfos(unitID,unitDefID) + if ignoreUnits[unitDefID] ~= nil then return end + + if (not customInfo[unitDefID]) then + local ud = UnitDefs[unitDefID] + customInfo[unitDefID] = { + height = ud.height+barHeightOffset, + maxShield = ud.shieldPower, + canStockpile = ud.canStockpile, + reloadTime = ud.reloadTime, + primaryWeapon = ud.primaryWeapon, + } + end + ux, uy, uz = GetUnitViewPosition(unitID) + if ux == nil then + return + end + + ci = customInfo[unitDefID] + fullText = true + dx, dy, dz = ux-cx, uy-cy, uz-cz + dist = dx*dx + dy*dy + dz*dz + if (dist > infoDistance) then + if (dist > maxUnitDistance) then + return + end + fullText = false + end + + --// GET UNIT INFORMATION + health,maxHealth,paralyzeDamage,capture,build = GetUnitHealth(unitID) + --if (not health) then health=-1 elseif(health<1) then health=1 end + if (not maxHealth)or(maxHealth<1) then maxHealth=1 end + if (not build) then build=1 end + + emp = (paralyzeDamage or 0)/maxHealth + hp = (health or 0)/maxHealth + + --// BARS //----------------------------------------------------------------------------- + --// Shield + if (ci.maxShield>0) then + local shieldOn,shieldPower = GetUnitShieldState(unitID) + if (shieldOn)and(build==1)and(shieldPower=0.01)) then + hp100 = hp*100; hp100 = hp100 - hp100%1; --//same as floor(hp*100), but 10% faster + if (hp100<0) then hp100=0 elseif (hp100>100) then hp100=100 end + if (drawFullHealthBars)or(hp100<100) and not (hp<0) then + local infotext = '' + if (fullText and (hp100 and hp100 <= drawBarPercentage and hp100 > 0) or dist < minPercentageDistance) then + infotext = hp100..'%' + end + if alwaysDrawBarPercentageForComs then + local unitName = UnitDefs[GetUnitDefID(unitID)].name + if (unitName == 'corcom' or unitName == 'armcom') then + infotext = hp100..'%' + end + end + AddBar("health",hp,nil,infotext or '',bfcolormap[hp100]) + end + end + + --// BUILD + if (build<1) then + local infotext = '' + if (fullText and (drawBarPercentage > 0 or dist < minPercentageDistance)) then + infotext = floor(build*100)..'%' + end + AddBar("building",build,"build",infotext or '') + end + + --// STOCKPILE + if (ci.canStockpile) then + local stockpileBuild + numStockpiled,numStockpileQued,stockpileBuild = GetUnitStockpile(unitID) + if (numStockpiled) then + stockpileBuild = stockpileBuild or 0 + if (stockpileBuild>0) then + AddBar("stockpile",stockpileBuild,"stock",(fullText and floor(stockpileBuild*100)..'%') or '') + end + end + else + numStockpiled = false + end + + --// MORPHING + local morph = UnitMorphs[unitID] + if morph then + local infotext = '' + if (fullText and (drawBarPercentage > 0 or dist < minPercentageDistance)) then + infotext = floor(morph.progress*100)..'%' + end + AddBar("Evolving",morph.progress,"build",infotext or '') + end + + --// PARALYZE + if (emp>0.01)and(hp>0.01)and(emp<1e8)and(not morph) then + local stunned = GetUnitIsStunned(unitID) + local infotext = '' + if (stunned) then + paraUnits[#paraUnits+1]=unitID + if (fullText) then + infotext = floor((paralyzeDamage-maxHealth)/(maxHealth*empDecline)) .. 's' + end + emp = 1 + else + if (emp>1) then emp=1 end + if (fullText and drawBarPercentage > 0) then + infotext = floor(emp*100)..'%' + end + end + local empcolor_index = (stunned and ((blink and "emp_b") or "emp_p")) or ("emp") + AddBar("paralyze",emp,empcolor_index,infotext) + end + + --// CAPTURE + if ((capture or -1)>0) then + local infotext = '' + if (fullText and drawBarPercentage > 0) then + infotext = floor(capture*100)..'%' + end + AddBar("capture",capture,"capture",infotext or '') + end + + --// RELOAD + if (ci.reloadTime>=minReloadTime) then + _,reloaded,reloadFrame = GetUnitWeaponState(unitID,ci.primaryWeapon) + if (reloaded==false) then + reload = 1 - ((reloadFrame-gameFrame)/30) / ci.reloadTime; + reload = math.max(reload,0) + + local infotext = '' + if (fullText and drawBarPercentage > 0) then + infotext = reload..'%' + end + AddBar("reload",reload,"reload",infoText or '') + end + end + + if (barsN>0)or(numStockpiled) then + glPushMatrix() + glTranslate(ux, uy+ci.height, uz ) + glBillboard() + + --// DRAW BARS + DrawBars(fullText) + + --// STOCKPILE ICON + if (numStockpiled) then + if (barShader) then + glMyText(1) + DrawStockpile(numStockpiled,numStockpileQued) + glMyText(0) + else + DrawStockpile(numStockpiled,numStockpileQued) + end + end + + glPopMatrix() + end + end + +end --// end do + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local DrawFeatureInfos + +do + --//speedup + local glTranslate = gl.Translate + local glPushMatrix = gl.PushMatrix + local glPopMatrix = gl.PopMatrix + local glBillboard = gl.Billboard + local GetFeatureResources = Spring.GetFeatureResources + local GetFeatureHealth = Spring.GetFeatureHealth + + local featureDefID + local health,maxHealth,resurrect,reclaimLeft + local hp + + local customInfo = {} + local ci + + function DrawFeatureInfos(featureID,featureDefID,fullText,fx,fy,fz) + if ignoreFeatures[featureDefID] ~= nil then return end + + if (not customInfo[featureDefID]) then + local featureDef = FeatureDefs[featureDefID or -1] or {height=0,name=''} + customInfo[featureDefID] = { + height = featureDef.height+barHeightOffset, + wall = walls[featureDef.name], + } + end + ci = customInfo[featureDefID] + + health,maxHealth,resurrect = GetFeatureHealth(featureID) + if (health == nil or health<1) then return end + _,_,_,_,reclaimLeft = GetFeatureResources(featureID) + if (not resurrect) then resurrect=0 end + if (not reclaimLeft) then reclaimLeft=1 end + + hp = (health or 0)/(maxHealth or 1) + + --// filter all walls and none resurrecting features + if (resurrect == 0) and + (reclaimLeft == 1) and + (hp > featureHpThreshold) + then return end + + --// BARS //----------------------------------------------------------------------------- + --// HEALTH + if (hp0) then + AddBar("resurrect",resurrect,"resurrect",(fullText and floor(resurrect*100)..'%') or '') + end + + --// RECLAIMING + if (reclaimLeft>0 and reclaimLeft<1) then + AddBar("reclaim",reclaimLeft,"reclaim",(fullText and floor(reclaimLeft*100)..'%') or '') + end + + + if (barsN>0) then + glPushMatrix() + glTranslate(fx,fy+ci.height,fz) + glBillboard() + + --// DRAW BARS + DrawBarsFeature(fullText) + + glPopMatrix() + end + end + +end --// end do + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local DrawOverlays + +do + local GL_TEXTURE_GEN_MODE = GL.TEXTURE_GEN_MODE + local GL_EYE_PLANE = GL.EYE_PLANE + local GL_EYE_LINEAR = GL.EYE_LINEAR + local GL_T = GL.T + local GL_S = GL.S + local GL_ONE = GL.ONE + local GL_SRC_ALPHA = GL.SRC_ALPHA + local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA + local glUnit = gl.Unit + local glTexGen = gl.TexGen + local glTexCoord = gl.TexCoord + local glPolygonOffset = gl.PolygonOffset + local glBlending = gl.Blending + local glTexture = gl.Texture + local GetCameraVectors = Spring.GetCameraVectors + local abs = math.abs + + function DrawOverlays() + --// draw an overlay for stunned units + if (drawStunnedOverlay)and(#paraUnits>0) then + glDepthTest(true) + glPolygonOffset(-2, -2) + glBlending(GL_SRC_ALPHA, GL_ONE) + + + glColor(0.25,0.25,1,0.25) + for i=1,#paraUnits do + glUnit(paraUnits[i],true) + end + local shift = widgetHandler:GetHourTimer() / 15 + + glTexCoord(0,0) + glTexGen(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR) + local cvs = GetCameraVectors() + local v = cvs.right + glTexGen(GL_T, GL_EYE_PLANE, v[1]*0.008,v[2]*0.008,v[3]*0.008, shift) + glTexGen(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR) + v = cvs.forward + glTexGen(GL_S, GL_EYE_PLANE, v[1]*0.008,v[2]*0.008,v[3]*0.008, shift) + glTexture("LuaUI/Images/paralyzed.png") + + glColor(0.8,0.8,1,0.45) + for i=1,#paraUnits do + glUnit(paraUnits[i],true) + end + + glTexture(false) + glTexGen(GL_T, false) + glTexGen(GL_S, false) + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + glPolygonOffset(false) + glDepthTest(false) + + paraUnits = {} + end + + end + +end --//end do + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local visibleFeatures = {} +local visibleUnits = {} + +do + local GetCameraPosition = Spring.GetCameraPosition + local GetSmoothMeshHeight = Spring.GetSmoothMeshHeight + local IsGUIHidden = Spring.IsGUIHidden + local glDepthMask = gl.DepthMask + local GetFeatureHealth = Spring.GetFeatureHealth + local GetFeatureResources = Spring.GetFeatureResources + + function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + + if Spring.IsGUIHidden() then return end + + if (#visibleUnits+#visibleFeatures==0) then + return + end + + cx, cy, cz = GetCameraPosition() + + --if the camera is too far up, higher than maxDistance on smoothmesh, dont even call any visibility checks or nothing + local smoothheight=GetSmoothMeshHeight(cx,cz) --clamps x and z + if ((cy-smoothheight)^2 < maxUnitDistance) then + + glDepthTest(true) -- enabling this will make healthbars opague to other healthbars + glDepthMask(true) + + if (barShader) then gl.UseShader(barShader); glMyText(0); end + + --// draw bars of units + local unitID,unitDefID + for i=1,#visibleUnits do + unitID = visibleUnits[i] + unitDefID = GetUnitDefID(unitID) + if unitDefID then + DrawUnitInfos(unitID, unitDefID) + end + end + + --// draw bars for features + local drawFeatureInfo = false + if ((cy-smoothheight)^2 < maxFeatureDistance) then + drawFeatureInfo = true + end + local wx, wy, wz, dx, dy, dz, dist, featureInfo, resurrect, reclaimLeft + + if drawFeatureInfo or (featureResurrectVisibility or featureReclaimVisibility) then + for i=1,#visibleFeatures do + featureInfo = visibleFeatures[i] + if featureResurrectVisibility then + resurrect = select(3,GetFeatureHealth(featureInfo[4])) + end + if featureReclaimVisibility then + reclaimLeft = select(5,GetFeatureResources(featureInfo[4])) + end + if drawFeatureInfo or (featureResurrectVisibility and resurrect and resurrect > 0) or (featureReclaimVisibility and reclaimLeft and reclaimLeft < 1) then + wx, wy, wz = featureInfo[1],featureInfo[2],featureInfo[3] + dx, dy, dz = wx-cx, wy-cy, wz-cz + dist = dx*dx + dy*dy + dz*dz + if (dist < maxFeatureDistance or (((featureResurrectVisibility and resurrect and resurrect > 0) or (featureReclaimVisibility and reclaimLeft and reclaimLeft < 1)) and dist <= maxUnitDistance)) then + if (dist < maxFeatureInfoDistance) then + DrawFeatureInfos(featureInfo[4], featureInfo[5], true, wx,wy,wz) + else + DrawFeatureInfos(featureInfo[4], featureInfo[5], false, wx,wy,wz) + end + end + end + end + end + + if (barShader) then gl.UseShader(0) end + glDepthMask(false) + end + + DrawOverlays() + + glColor(1,1,1,1) + --glDepthTest(false) + end +end --//end do + +do + local GetGameFrame = Spring.GetGameFrame + local GetVisibleUnits = Spring.GetVisibleUnits + local GetVisibleFeatures = Spring.GetVisibleFeatures + local GetFeatureDefID = Spring.GetFeatureDefID + local GetFeaturePosition = Spring.GetFeaturePosition + local GetFeatureResources = Spring.GetFeatureResources + local select = select + + local sec = 0 + local sec1 = 0 + local sec2 = 0 + + function widget:Update(dt) + gameFrame = GetGameFrame() + + sec=sec+dt + blink = (sec%1)<0.5 + + sec1=sec1+dt + if (sec1>1/4) and ((cy-smoothheight)^2 < maxUnitDistance) then + sec1 = 0 + visibleUnits = GetVisibleUnits(-1,nil,false) -- expensive + end + + sec2=sec2+dt + if (sec2>1/2) and ((cy-smoothheight)^2 < maxFeatureDistance) then + sec2 = 0 + visibleFeatures = GetVisibleFeatures(-1,nil,false,false) + local cnt = #visibleFeatures + local featureID,featureDefID + + for i=cnt,1,-1 do + featureID = visibleFeatures[i] + featureDefID = GetFeatureDefID(featureID) or -1 + --// filter trees and none destructable features + if destructableFeature[featureDefID] and (drawnFeature[featureDefID] or (select(5,GetFeatureResources(featureID))<1)) then + local fx,fy,fz = GetFeaturePosition(featureID) + visibleFeatures[i] = {fx,fy,fz, featureID, featureDefID} + else + visibleFeatures[i] = visibleFeatures[cnt] + visibleFeatures[cnt] = nil + cnt = cnt-1 + end + end + end + + end + +end --//end do + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetConfigData(data) + savedTable = {} + savedTable.barScale = barScale + savedTable.drawBarPercentage = drawBarPercentage + savedTable.alwaysDrawBarPercentageForComs = alwaysDrawBarPercentageForComs + savedTable.currentOption = currentOption + return savedTable +end + +function widget:SetConfigData(data) + barScale = data.barScale or barScale + drawBarPercentage = data.drawBarPercentage or drawBarPercentage + alwaysDrawBarPercentageForComs = data.alwaysDrawBarPercentageForComs or alwaysDrawBarPercentageForComs + currentOption = data.currentOption or currentOption +end + +function widget:TextCommand(command) + if (string.find(command, "healthbars_percentage") == 1 and string.len(command) == 21) then + drawBarPercentage = (drawBarPercentage < 100 and 100 or 0) + end + if (string.find(command, "healthbars_compercentage") == 1 and string.len(command) == 24) then + alwaysDrawBarPercentageForComs = not alwaysDrawBarPercentageForComs + end + if (string.find(command, "healthbars_style") == 1 and string.len(command) == 16) then + toggleOption() + end +end + +function widget:GameFrame(n) + if n%30 == 1 then + notificationTimeout = notificationTimeout - 1 + --Spring.Echo(notificationTimeout) + end + if n%30 == 1 then + local spectator = Spring.GetSpectatingState() + resourcePrompts = Spring.GetConfigInt("evo_resourceprompts", 1) + + --Assume that if it isn't set, resourcePrompts is true + if resourcePrompts == nil then + resourcePrompts = 1 + end + + if spectator then + resourcePrompts = 0 + end + --Spring.Echo(resourcePrompts) + end +end + + +function MorphUpdate(morphTable) + UnitMorphs = morphTable +end + +function MorphStart(unitID,morphDef) + --return false +end + +function MorphStop(unitID) + UnitMorphs[unitID] = nil +end + +function MorphFinished(unitID) + if notificationTimeout > 0 then + UnitMorphs[unitID] = nil + else + if resourcePrompts == 1 then + Spring.PlaySoundFile("sounds/ui/evolutionfinished.wav", 1) + end + Spring.Echo("Your unit(s) have finished Evolving") + notificationTimeout = 10 + UnitMorphs[unitID] = nil + end +end diff --git a/LuaUI/Widgets_Evo/gui_highlight_geos.lua b/LuaUI/Widgets_Evo/gui_highlight_geos.lua deleted file mode 100644 index 37e75299f..000000000 --- a/LuaUI/Widgets_Evo/gui_highlight_geos.lua +++ /dev/null @@ -1,119 +0,0 @@ - -function widget:GetInfo() - return { - name = 'Highlight Geos', - desc = 'Highlights geothermal spots when in metal map view', - author = 'Niobium, modified by GoogleFrog', - version = '1.0', - date = 'Mar, 2011', - license = 'GNU GPL, v2 or later', - layer = 0, - enabled = true, -- loaded by default? - } -end - ----------------------------------------------------------------- --- Globals ----------------------------------------------------------------- -local geoDisplayList - ----------------------------------------------------------------- --- Speedups ----------------------------------------------------------------- -local glLineWidth = gl.LineWidth -local glDepthTest = gl.DepthTest -local glCallList = gl.CallList -local spGetMapDrawMode = Spring.GetMapDrawMode -local spGetActiveCommand = Spring.GetActiveCommand -local spGetGameFrame = Spring.GetGameFrame - - -local geoDefID = UnitDefNames["egeothermal"].id - -local mapX = Game.mapSizeX -local mapZ = Game.mapSizeZ -local mapXinv = 1/mapX -local mapZinv = 1/mapZ - -local size = math.max(mapX,mapZ) * 60/4096 - ----------------------------------------------------------------- --- Functions ----------------------------------------------------------------- -local function PillarVerts(x, y, z) - gl.Color(1, 1, 0, 1) - gl.Vertex(x, y, z) - gl.Color(1, 1, 0, 0) - gl.Vertex(x, y + 1000, z) -end - -local geos = {} - -local function HighlightGeos() - local features = Spring.GetAllFeatures() - for i = 1, #features do - local fID = features[i] - if FeatureDefs[Spring.GetFeatureDefID(fID)].geoThermal then - local fx, fy, fz = Spring.GetFeaturePosition(fID) - gl.BeginEnd(GL.LINE_STRIP, PillarVerts, fx, fy, fz) - geos[#geos+1] = {x = fx, z = fz} - end - end -end - ----------------------------------------------------------------- --- Callins ----------------------------------------------------------------- -local drawGeos = false - -function widget:Shutdown() - if geoDisplayList then - gl.DeleteList(geoDisplayList) - end -end - -function widget:DrawWorld() - - local _, cmdID = spGetActiveCommand() - drawGeos = spGetMapDrawMode() == 'metal' or -geoDefID == cmdID or spGetGameFrame() < 1 or (WG.GetWidgetOption and WG.GetWidgetOption('Chili Minimap','Settings/Interface/Map','alwaysDisplayMexes').value) - - if drawGeos then - - if not geoDisplayList then - geoDisplayList = gl.CreateList(HighlightGeos) - end - - glLineWidth(20) - glDepthTest(true) - glCallList(geoDisplayList) - glLineWidth(1) - end -end - -local function drawMinimapGeos(x,z) - gl.Vertex(x - size,0,z - size) - gl.Vertex(x + size,0,z + size) - gl.Vertex(x + size,0,z - size) - gl.Vertex(x - size,0,z + size) -end - -function widget:DrawInMiniMap() - - if drawGeos then - - gl.LoadIdentity() - gl.Translate(0,1,0) - gl.Scale(mapXinv , -mapZinv, 1) - gl.Rotate(270,1,0,0) - gl.LineWidth(2) - gl.Lighting(false) - gl.Color(1,1,0,0.7) - for i = 1, #geos do - local geo = geos[i] - gl.BeginEnd(GL.LINES,drawMinimapGeos,geo.x,geo.z) - end - - gl.LineWidth(0) - gl.Color(1,1,1,1) - end -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_highlight_geos.xlua b/LuaUI/Widgets_Evo/gui_highlight_geos.xlua new file mode 100644 index 000000000..095c5df93 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_highlight_geos.xlua @@ -0,0 +1,127 @@ + +function widget:GetInfo() + return { + name = 'Highlight Geos', + desc = 'Highlights geothermal spots when in metal map view', + author = 'Niobium, modified by GoogleFrog', + version = '1.0', + date = 'Mar, 2011', + license = 'GNU GPL, v2 or later', + layer = 0, + enabled = true, -- loaded by default? + } +end + +---------------------------------------------------------------- +-- Globals +---------------------------------------------------------------- +local geoDisplayList + +---------------------------------------------------------------- +-- Speedups +---------------------------------------------------------------- +local glLineWidth = gl.LineWidth +local glDepthTest = gl.DepthTest +local glCallList = gl.CallList +local spGetMapDrawMode = Spring.GetMapDrawMode +local spGetActiveCommand = Spring.GetActiveCommand +local spGetGameFrame = Spring.GetGameFrame + + +local geoDefID = UnitDefNames["egeothermal"].id + +local mapX = Game.mapSizeX +local mapZ = Game.mapSizeZ +local mapXinv = 1/mapX +local mapZinv = 1/mapZ + +local size = math.max(mapX,mapZ) * 60/4096 + +---------------------------------------------------------------- +-- Functions +---------------------------------------------------------------- +local function PillarVerts(x, y, z) + gl.Color(1, 1, 0, 1) + gl.Vertex(x, y, z) + gl.Color(1, 1, 0, 0) + gl.Vertex(x, y + 500, z) +end + +local geos = {} + +local function HighlightGeos() + local features = Spring.GetAllFeatures() + for i = 1, #features do + local fID = features[i] + if FeatureDefs[Spring.GetFeatureDefID(fID)].geoThermal then + local fx, fy, fz = Spring.GetFeaturePosition(fID) + gl.BeginEnd(GL.LINE_STRIP, PillarVerts, fx, fy, fz) + geos[#geos+1] = {x = fx, z = fz} + end + end +end + +---------------------------------------------------------------- +-- Callins +---------------------------------------------------------------- +local drawGeos = false + +function widget:Shutdown() + if geoDisplayList then + gl.DeleteList(geoDisplayList) + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + local _, cmdID = spGetActiveCommand() + drawGeos = spGetMapDrawMode() == 'metal' or -geoDefID == cmdID or spGetGameFrame() < 1 or (WG.GetWidgetOption and WG.GetWidgetOption('Chili Minimap','Settings/Interface/Map','alwaysDisplayMexes').value) + + --if drawGeos then + + if not geoDisplayList then + geoDisplayList = gl.CreateList(HighlightGeos) + end + + glLineWidth(2) + glDepthTest(true) + glCallList(geoDisplayList) + glLineWidth(1) + --end +end + +local function drawMinimapGeos(x,z) + gl.Vertex(x - size,0,z - size) + gl.Vertex(x + size,0,z + size) + gl.Vertex(x + size,0,z - size) + gl.Vertex(x - size,0,z + size) +end + +function widget:DrawInMiniMap() + + --if drawGeos then + + gl.LoadIdentity() + gl.Translate(0,1,0) + gl.Scale(mapXinv , -mapZinv, 1) + gl.Rotate(270,1,0,0) + gl.LineWidth(2) + gl.Lighting(false) + gl.Color(1,1,0,0.7) + for i = 1, #geos do + local geo = geos[i] + gl.BeginEnd(GL.LINES,drawMinimapGeos,geo.x,geo.z) + end + + gl.LineWidth(0.00000000001) + gl.Color(1,1,1,1) + --end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_highlight_selectedunits.lua b/LuaUI/Widgets_Evo/gui_highlight_selectedunits.lua new file mode 100644 index 000000000..476b89ea4 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_highlight_selectedunits.lua @@ -0,0 +1,238 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_highlight_unit.lua +-- brief: highlights the unit/feature under the cursor +-- author: Dave Rodgers, modified by zwzsg +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Highlight Selected Units", + desc = "Highlights the selelected units", + author = "Floris (original: zwzsg, from trepan HighlightUnit)", + date = "Apr 24, 2009", + license = "GNU GPL, v2 or later", + layer = -8, + enabled = false + } +end + +local useTeamcolor = false +local highlightAlpha = 0.1 +local useHighlightShader = true +local maxShaderUnits = 150 +local edgeExponent = 3 + +local spIsUnitIcon = Spring.IsUnitIcon +local spIsUnitInView = Spring.IsUnitInView +local spGetTeamColor = Spring.GetTeamColor +local spGetUnitTeam = Spring.GetUnitTeam + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +local function SetupCommandColors(state) + local alpha = state and 1 or 0 + local f = io.open('cmdcolors.tmp', 'w+') + if (f) then + f:write('unitBox 0 1 0 ' .. alpha) + f:close() + Spring.SendCommands({'cmdcolors cmdcolors.tmp'}) + end + os.remove('cmdcolors.tmp') +end + + +function CreateHighlightShader() + if shader then + gl.DeleteShader(shader) + end + if gl.CreateShader ~= nil then + shader = gl.CreateShader({ + + uniform = { + edgeExponent = edgeExponent/(0.8+highlightAlpha), + plainAlpha = highlightAlpha*0.8, + }, + + vertex = [[ + #version 150 compatibility + // Application to vertex shader + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + uniform mat4 camera; + uniform mat4 caminv; + + void main() + { + vec4 P = gl_ModelViewMatrix * gl_Vertex; + + eyeVec = P.xyz; + + normal = gl_NormalMatrix * gl_Normal; + + color = gl_Color.rgb; + + gl_Position = gl_ProjectionMatrix * P; + } + ]], + + fragment = [[ + #version 150 compatibility + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + + uniform float edgeExponent; + uniform float plainAlpha; + + void main() + { + float opac = dot(normalize(normal), normalize(eyeVec)); + opac = 1.0 - abs(opac); + opac = pow(opac, edgeExponent)*0.45; + + gl_FragColor.rgb = color + (opac*1.3); + gl_FragColor.a = plainAlpha + opac; + + } + ]], + }) + end +end +-------------------------------------------------------------------------------- + +function widget:Initialize() + WG['highlightselunits'] = {} + WG['highlightselunits'].getOpacity = function() + return highlightAlpha + end + WG['highlightselunits'].setOpacity = function(value) + highlightAlpha = value + CreateHighlightShader() + end + WG['highlightselunits'].getShader = function() + return useHighlightShader + end + WG['highlightselunits'].setShader = function(value) + if value and (Spring.GetConfigInt("ForceShaders") or 1) ~= 1 then + Spring.SetConfigInt("ForceShaders",1) + Spring.Echo('enabled lua shaders') + end + useHighlightShader = value + CreateHighlightShader() + end + WG['highlightselunits'].getTeamcolor = function() + return useTeamcolor + end + WG['highlightselunits'].setTeamcolor = function(value) + useTeamcolor = value + CreateHighlightShader() + end + + SetupCommandColors(false) + CreateHighlightShader() +end + + +function widget:Shutdown() + if shader then + gl.DeleteShader(shader) + end + if WG['teamplatter'] == nil and WG['fancyselectedunits'] == nil then + SetupCommandColors(true) + end + WG['highlightselunits'] = nil +end + + + +-------------------------------------------------------------------------------- + +local selectedUnits = Spring.GetSelectedUnits() +local selectedUnitsCount = Spring.GetSelectedUnitsCount() +function widget:SelectionChanged(sel) + selectedUnits = sel + selectedUnitsCount = Spring.GetSelectedUnitsCount() +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if not selectedUnits or Spring.IsGUIHidden() then return end + + gl.DepthTest(true) + gl.PolygonOffset(-0.5, -0.5) + gl.Blending(GL.SRC_ALPHA, GL.ONE) + + --local selectedUnits = Spring.GetSelectedUnits() + if useHighlightShader and shader and selectedUnitsCount < maxShaderUnits then + gl.UseShader(shader) + end + local teamID, prevTeamID, r,g,b + for _,unitID in ipairs(selectedUnits) do + if not spIsUnitIcon(unitID) and spIsUnitInView(unitID) then + local health,maxHealth,paralyzeDamage,captureProgress,buildProgress=Spring.GetUnitHealth(unitID) + if maxHealth ~= nil then + if useTeamcolor then + teamID = spGetUnitTeam(unitID) + if teamID ~= prevTeamID then + r,g,b = spGetTeamColor(teamID) + end + prevTeamID = teamID + gl.Color(r,g,b,highlightAlpha) + else + gl.Color( + health>maxHealth/2 and 2-2*health/maxHealth or 1, -- red + health>maxHealth/2 and 1 or 2*health/maxHealth, -- green + 0, -- blue + highlightAlpha + ) + end + gl.Unit(unitID, true) + end + end + end + + if useHighlightShader and shader and #selectedUnits < maxShaderUnits then + gl.UseShader(0) + end + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.PolygonOffset(false) + gl.DepthTest(false) +end + + +widget.DrawWorldReflection = widget.DrawWorld + +widget.DrawWorldRefraction = widget.DrawWorld + + + +function widget:GetConfigData() + return {highlightAlpha=highlightAlpha, useHighlightShader=useHighlightShader, useTeamcolor=useTeamcolor} +end + +function widget:SetConfigData(data) + if data.useHighlightShader ~= nil then highlightAlpha = data.highlightAlpha end + if data.useHighlightShader ~= nil then useHighlightShader = data.useHighlightShader end + if data.useHighlightShader ~= nil then useTeamcolor = data.useTeamcolor end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_highlight_unit.lua b/LuaUI/Widgets_Evo/gui_highlight_unit.lua new file mode 100644 index 000000000..57ff342ca --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_highlight_unit.lua @@ -0,0 +1,384 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_highlight_unit.lua +-- brief: highlights the unit/feature under the cursor +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + local grey = "\255\192\192\192" + local yellow = "\255\255\255\128" + return { + name = "Highlight Unit", + desc = "Highlights the unit or feature under the cursor\n", + author = "trepan", + date = "Apr 16, 2007", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true -- loaded by default? + } +end + +local drawFeatureHighlight = false +local unitAlpha = 0.2 +local featureAlpha = 0.14 + +local useShader = true +local edgeExponent = 1.25 +local shaderUnitAlphaMultiplier = 0.7 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local GL_BACK = GL.BACK +local GL_EYE_LINEAR = GL.EYE_LINEAR +local GL_EYE_PLANE = GL.EYE_PLANE +local GL_FRONT = GL.FRONT +local GL_INVERT = GL.INVERT +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_QUAD_STRIP = GL.QUAD_STRIP +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_T = GL.T +local GL_TEXTURE_GEN_MODE = GL.TEXTURE_GEN_MODE +local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN +local glBeginEnd = gl.BeginEnd +local glBlending = gl.Blending +local glCallList = gl.CallList +local glColor = gl.Color +local glCreateList = gl.CreateList +local glCulling = gl.Culling +local glDeleteList = gl.DeleteList +local glDepthTest = gl.DepthTest +local glFeature = gl.Feature +local glLogicOp = gl.LogicOp +local glPolygonOffset = gl.PolygonOffset +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glScale = gl.Scale +local glTexCoord = gl.TexCoord +local glTexGen = gl.TexGen +local glTexture = gl.Texture +local glTranslate = gl.Translate +local glUnit = gl.Unit +local glVertex = gl.Vertex +local spDrawUnitCommands = Spring.DrawUnitCommands +local spGetFeatureDefID = Spring.GetFeatureDefID +local spGetFeaturePosition = Spring.GetFeaturePosition +local spGetFeatureRadius = Spring.GetFeatureRadius +local spGetModKeyState = Spring.GetModKeyState +local spGetMouseState = Spring.GetMouseState +local spGetMyAllyTeamID = Spring.GetMyAllyTeamID +local spGetMyPlayerID = Spring.GetMyPlayerID +local spGetMyTeamID = Spring.GetMyTeamID +local spGetPlayerControlledUnit = Spring.GetPlayerControlledUnit +local spGetUnitAllyTeam = Spring.GetUnitAllyTeam +local spGetUnitTeam = Spring.GetUnitTeam +local spTraceScreenRay = Spring.TraceScreenRay + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +local texName = 'LuaUI/Images/highlight_strip.png' + +local cylDivs = 64 +local cylList = 0 + +local vsx, vsy = widgetHandler:GetViewSizes() +function widget:ViewResize(viewSizeX, viewSizeY) + vsx = viewSizeX + vsy = viewSizeY +end + + +function CreateHighlightShader() + if shader then + gl.DeleteShader(shader) + end + if gl.CreateShader ~= nil then + shader = gl.CreateShader({ + + uniform = { + edgeExponent = edgeExponent, + }, + + vertex = [[ + #version 150 compatibility + // Application to vertex shader + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + uniform mat4 camera; + uniform mat4 caminv; + + void main() + { + vec4 P = gl_ModelViewMatrix * gl_Vertex; + + eyeVec = P.xyz; + + normal = gl_NormalMatrix * gl_Normal; + + color = gl_Color.rgb; + + gl_Position = gl_ProjectionMatrix * P; + } + ]], + + fragment = [[ + #version 150 compatibility + varying vec3 normal; + varying vec3 eyeVec; + varying vec3 color; + + uniform float edgeExponent; + + void main() + { + float opac = dot(normalize(normal), normalize(eyeVec)); + opac = 1.0 - abs(opac); + opac = pow(opac, edgeExponent)*0.4; + + gl_FragColor.rgb = color + opac); + gl_FragColor.a = opac; + + } + ]], + }) + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + cylList = glCreateList(DrawCylinder, cylDivs) + CreateHighlightShader() +end + + +function widget:Shutdown() + glDeleteList(cylList) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function DrawCylinder(divs) + local cos = math.cos + local sin = math.sin + local divRads = (2.0 * math.pi) / divs + -- top + glBeginEnd(GL_TRIANGLE_FAN, function() + for i = 1, divs do + local a = i * divRads + glVertex(sin(a), 1.0, cos(a)) + end + end) + -- bottom + glBeginEnd(GL_TRIANGLE_FAN, function() + for i = 1, divs do + local a = -i * divRads + glVertex(sin(a), -1.0, cos(a)) + end + end) + -- sides + glBeginEnd(GL_QUAD_STRIP, function() + for i = 0, divs do + local a = i * divRads + glVertex(sin(a), 1.0, cos(a)) + glVertex(sin(a), -1.0, cos(a)) + end + end) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function HilightModel(drawFunc, drawData) + glDepthTest(true) + glPolygonOffset(-2, -2) + glBlending(GL_SRC_ALPHA, GL_ONE) + + local scale = 35 + local shift = (2 * widgetHandler:GetHourTimer()) % scale + glTexCoord(0, 0) + glTexGen(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR) + glTexGen(GL_T, GL_EYE_PLANE, 0, (1 / scale), 0, shift) + glTexture(texName) + + drawFunc(drawData) + + glTexture(false) + glTexGen(GL_T, false) + + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + glPolygonOffset(false) + glDepthTest(false) +end + + +-------------------------------------------------------------------------------- + +local function SetUnitColor(unitID, alpha) + local teamID = spGetUnitTeam(unitID) + if (teamID == nil) then + glColor(1.0, 0.0, 0.0, alpha) -- red + elseif (teamID == spGetMyTeamID()) then + glColor(1.0, 1.0, 1.0, alpha) -- white + elseif (spGetUnitAllyTeam(unitID) == spGetMyAllyTeamID()) then + glColor(0.0, 1.0, 0.0, alpha) -- green + else + glColor(1.0, 0.0, 0.0, alpha) -- red + end +end + + +local function SetFeatureColor(featureID, alpha) + glColor(1.0, 0.0, 1.0, alpha) -- purple + do return end -- FIXME -- wait for feature team/allyteam resolution + + local allyTeamID = spGetFeatureAllyTeam(featureID) + if ((allyTeamID == nil) or (allyTeamID < 0)) then + glColor(1.0, 1.0, 1.0, alpha) -- white + elseif (allyTeamID == spGetMyAllyTeamID()) then + glColor(1.0, 1.0, 1.0, alpha) -- white + else + glColor(1.0, 0.0, 0.0, alpha) -- red + end +end + + +local function UnitDrawFunc(unitID) + glUnit(unitID, true) +end + + +local function FeatureDrawFunc(featureID) + glFeature(featureID, true) +end + + +local function HilightUnit(unitID) + --local outline = (spGetUnitIsCloaked(unitID) ~= true) + SetUnitColor(unitID, (useShader and shader) and unitAlpha*shaderUnitAlphaMultiplier or unitAlpha) + HilightModel(UnitDrawFunc, unitID) +end + + +local function HilightFeatureModel(featureID) + SetFeatureColor(featureID, (useShader and shader) and featureAlpha*shaderUnitAlphaMultiplier or featureAlpha) + HilightModel(FeatureDrawFunc, featureID, true) +end + + +local function HilightFeature(featureID) + local fDefID = spGetFeatureDefID(featureID) + local fd = FeatureDefs[fDefID] + if (fd == nil) then return end + + if (fd.drawType == 0) then + HilightFeatureModel(featureID) + return + end + + local radius = spGetFeatureRadius(featureID) + if (radius == nil) then + return + end + + local px, py, pz = spGetFeaturePosition(featureID) + if (px == nil) then return end + + local yScale = 4 + glPushMatrix() + glTranslate(px, py, pz) + glScale(radius, yScale * radius, radius) + -- FIXME: needs an 'inside' check + + glDepthTest(true) + glLogicOp(GL_INVERT) + + glCulling(GL_FRONT) + glCallList(cylList) + + glCulling(GL_BACK) + glCallList(cylList) + + glLogicOp(false) + glCulling(false) + glDepthTest(false) + + glPopMatrix() +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local type, data -- for the TraceScreenRay() call + + +function widget:Update() + local mx, my = spGetMouseState() + type, data = spTraceScreenRay(mx, my) +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if (WG['topbar'] and WG['topbar'].showingQuit()) then + return + end + if Spring.IsGUIHidden() then return end + if drawFeatureHighlight and (type == 'feature') then + HilightFeature(data) + if useShader and shader then + gl.UseShader(shader) + HilightModel(FeatureDrawFunc, data) + gl.UseShader(0) + end + elseif (type == 'unit') then + local unitID = spGetPlayerControlledUnit(spGetMyPlayerID()) + if data ~= unitID and not Spring.IsUnitIcon(data) then + + HilightUnit(data) + + if useShader and shader then + gl.UseShader(shader) + HilightModel(UnitDrawFunc, data) + gl.UseShader(0) + end + -- also draw the unit's command queue + local a,c,m,s = spGetModKeyState() + if (m) then + spDrawUnitCommands(data) + end + end + end +end + + +widget.DrawWorldReflection = widget.DrawWorld + +widget.DrawWorldRefraction = widget.DrawWorld + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_idle_builders.lua b/LuaUI/Widgets_Evo/gui_idle_builders.lua new file mode 100644 index 000000000..7db08ef51 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_idle_builders.lua @@ -0,0 +1,742 @@ + +function widget:GetInfo() + return { + name = "Idle Builders", + desc = "Idle Indicator", + author = "Floris (original by Ray)", + date = "15 april 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = false -- loaded by default? + } +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local enabledAsSpec = false + +local MAX_ICONS = 10 +local iconsize = 37 +local ICON_SIZE_X = iconsize +local ICON_SIZE_Y = iconsize +local CONDENSE = false -- show one icon for all builders of same type +local POSITION_X = 0.5 -- horizontal centre of screen +local POSITION_Y = 0.095 -- near bottom +local NEAR_IDLE = 0 -- this means that factories with only X build items left will be shown as idle + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local bgcorner = "LuaUI/Images/bgcorner.png" +local cornerSize = 7 +local bgcornerSize = cornerSize + +local playSounds = true +local leftclick = 'LuaUI/Sounds/buildbar_add.wav' +local middleclick = 'LuaUI/Sounds/buildbar_click.wav' +local rightclick = 'LuaUI/Sounds/buildbar_rem.wav' + +local hoversize = 0 +local rot = 0 + +local X_MIN = 0 +local X_MAX = 0 +local Y_MIN = 0 +local Y_MAX = 0 +local drawTable = {} +local IdleList = {} +local activePress = false +local QCount = {} +local noOfIcons = 0 +local displayList = {} + +local spGetSpectatingState = Spring.GetSpectatingState +local enabled = true + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local glColor = gl.Color +local glShape = gl.Shape +local glDepthTest = gl.DepthTest +local glDepthMask = gl.DepthMask +local glCulling = gl.Culling +local glLighting = gl.Lighting +local glBlending = gl.Blending +local glMaterial = gl.Material +local glTranslate = gl.Translate +local glTexture = gl.Texture +local glScissor = gl.Scissor +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glUnitShape = gl.UnitShape +local glUnitShapeTextures = gl.UnitShapeTextures +local glClear = gl.Clear +local glText = gl.Text +local glUnit = gl.Unit +local glScale = gl.Scale +local glRotate = gl.Rotate +local glRect = gl.Rect +local glCallList = gl.CallList +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glBeginEnd = gl.BeginEnd +local glTexCoord = gl.TexCoord +local glVertex = gl.Vertex +local glLoadIdentity = gl.LoadIdentity +local glGetScreenViewTrans = gl.GetScreenViewTrans + +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_LINE_LOOP = GL.LINE_LOOP +local GL_FRONT = GL.FRONT +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE = GL.ONE +local GL_QUADS = GL.QUADS +local GL_DEPTH_BUFFER_BIT = GL.DEPTH_BUFFER_BIT + + +local GetUnitDefID = Spring.GetUnitDefID +local GetFullBuildQueue = Spring.GetFullBuildQueue +local GetUnitHealth = Spring.GetUnitHealth +local GetCommandQueue = Spring.GetCommandQueue +local GetMyTeamID = Spring.GetMyTeamID +local GetTeamUnitsSorted = Spring.GetTeamUnitsSorted +local GetMouseState = Spring.GetMouseState +local GetUnitPosition = Spring.GetUnitPosition +local SendCommands = Spring.SendCommands +local SelectUnitArray = Spring.SelectUnitArray +local GetModKeyState = Spring.GetModKeyState +local GetUnitDefDimensions = Spring.GetUnitDefDimensions + +local GetViewGeometry = Spring.GetViewGeometry +local ValidUnitID = Spring.ValidUnitID +local GetTeamUnitsSorted = Spring.GetTeamUnitsSorted +local GetGameFrame = Spring.GetGameFrame +local GetCameraPosition = Spring.GetCameraPosition +local GetCameraDirection = Spring.GetCameraDirection +local SetCameraTarget = Spring.SetCameraTarget + +local fmod = math.fmod +local math_sin = math.sin +local math_pi = math.pi + +local getn = table.getn + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local sizeMultiplier = 1 +local function init() + vsx,vsy = GetViewGeometry() + sizeMultiplier = 1 + (vsx*vsy / 4500000) + + ICON_SIZE_X = iconsize * sizeMultiplier + ICON_SIZE_Y = ICON_SIZE_X + bgcornerSize = cornerSize * (sizeMultiplier - 1) + noOfIcons = 0 -- this fixes positioning when resolution change +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + init() +end + +function widget:PlayerChanged(playerID) + if enabledAsSpec == false and Spring.GetGameFrame() > 0 and Spring.GetSpectatingState() then + widgetHandler:RemoveWidget(self) + end +end + +function widget:Initialize() + widget:PlayerChanged() + enabled = true + if not enabledAsSpec then + enabled = not spGetSpectatingState() + end + init() +end + +function widget:GameOver() + widgetHandler:RemoveWidget(self) +end + +local function IsIdleBuilder(unitID) + local udef = GetUnitDefID(unitID) + local ud = UnitDefs[udef] + local qCount = 0 + if ud.buildSpeed > 0 and ud.buildOptions[1] then --- can build + local bQueue = GetFullBuildQueue(unitID) + if not bQueue[1] then --- has no build queue + local _, _, _, _, buildProg = GetUnitHealth(unitID) + if buildProg == 1 then --- isnt under construction + if ud.isFactory then + return true + else + if GetCommandQueue(unitID,0) == 0 then + return true + end + end + end + elseif ud.isFactory then + for _, thing in ipairs(bQueue) do + for _, count in pairs(thing) do + qCount = qCount + count + end + end + if qCount <= NEAR_IDLE then + QCount[unitID] = qCount + return true + end + end + end + return false +end + +local function DrawBoxes(number) + glColor({ 0, 0, 0, 0.7}) + local X1 = X_MIN + local ct = 0 + while (ct < number) do + ct = ct + 1 + local X2 = X1+ICON_SIZE_X + + if widgetHandler:InTweakMode() then + glShape(GL_LINE_LOOP, { + { v = { X1, Y_MIN } }, + { v = { X2, Y_MIN } }, + { v = { X2, Y_MAX } }, + { v = { X1, Y_MAX } }, + }) + X1 = X2 + else + --DrawIconQuad((ct-1), { 0, 0, 0, 0.4 }, 1.2) + end + end + --Spring.Echo(X2) +end--]] + +local function CenterUnitDef(unitDefID) + local ud = UnitDefs[unitDefID] + if (not ud) then + return + end + if (not ud.dimensions) then + ud.dimensions = GetUnitDefDimensions(unitDefID) + end + if (not ud.dimensions) then + return + end + + local d = ud.dimensions + local xSize = (d.maxx - d.minx) + local ySize = (d.maxy - d.miny) + local zSize = (d.maxz - d.minz) + + local hSize -- maximum horizontal dimension + if (xSize > zSize) then hSize = xSize else hSize = zSize end + + -- aspect ratios + local mAspect = hSize / ySize + local vAspect = ICON_SIZE_X / ICON_SIZE_Y + + -- scale the unit to the box (maxspect) + local scale + if (mAspect > vAspect) then + scale = (ICON_SIZE_X / hSize) + else + scale = (ICON_SIZE_Y / ySize) + end + scale = scale * 0.8 + glScale(scale, scale, scale) + + -- translate to the unit's midpoint + local xMid = 0.5 * (d.maxx + d.minx) + local yMid = 0.5 * (d.maxy + d.miny) + local zMid = 0.5 * (d.maxz + d.minz) + glTranslate(-xMid, -yMid, -zMid) +end + + + +local function DrawUnitIcons(number) + if not drawTable then + return -1 + end + local ct = 0 + local X1, X2 + + local cpx, cpy, cpz = GetCameraPosition() + local ctx, cty, ctz = glGetScreenViewTrans() + + -- magic to keep UnitShape fog under control + SetCameraTarget(ctx, cty, ctz, -1.0) + + glTexture(false) + glScissor(true) + + while (ct < number) do + ct = ct + 1 + local unitID = drawTable[ct][2] + + if (type(unitID) == 'number' and ValidUnitID(unitID)) or type(unitID) == 'table' then + + X1 = X_MIN+(ICON_SIZE_X*(ct-1)) + X2 = X1+ICON_SIZE_X + + glPushMatrix() + glLoadIdentity() + glTranslate(ctx, cty, ctz) + + glScissor(X1, Y_MIN, X2 - X1, Y_MAX - Y_MIN) + + glTranslate(0.5*(X2+X1), 0.5*(Y_MAX+Y_MIN), 0) + glRotate(18, 1, 0, 0) + glRotate(rot, 0, 1, 0) + + CenterUnitDef(drawTable[ct][1]) + + --glUnitShapeTextures(drawTable[ct][1], true) + glUnitShape(drawTable[ct][1], GetMyTeamID(), false, true, true) + --glUnitShapeTextures(drawTable[ct][1], false) + + glScissor(false) + glPopMatrix() + + if CONDENSE then + local NumberCondensed = table.getn(drawTable[ct][2]) + if NumberCondensed > 1 then + font:Begin() + font:Print(NumberCondensed, X1, Y_MIN, 8*sizeMultiplier, "o") + font:End() + end + end + + if type(unitID) == 'table' then + unitID = unitID[1] + end + if ValidUnitID(unitID) and QCount[unitID] then + font:Begin() + font:Print(QCount[unitID], X1+(0.5*ICON_SIZE_X),Y_MIN,10*sizeMultiplier,"ocn") + font:End() + end + end + end + + SetCameraTarget(cpx, cpy, cpz, -1.0) +end + + +local function MouseOverIcon(x, y) + if not drawTable then return -1 end + + local NumOfIcons = table.getn(drawTable) + if (x < X_MIN) then return -1 end + if (x > X_MAX) then return -1 end + if (y < Y_MIN) then return -1 end + if (y > Y_MAX) then return -1 end + + local icon = math.floor((x-X_MIN)/ICON_SIZE_X) + if (icon < 0) then + icon = 0 + end + if (icon >= NumOfIcons) then + icon = (NumOfIcons - 1) + end + return icon +end + + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + glTexCoord(0.8,0.8) + glVertex(px+cs, py, 0) + glVertex(sx-cs, py, 0) + glVertex(sx-cs, sy, 0) + glVertex(px+cs, sy, 0) + + glVertex(px, py+cs, 0) + glVertex(px+cs, py+cs, 0) + glVertex(px+cs, sy-cs, 0) + glVertex(px, sy-cs, 0) + + glVertex(sx, py+cs, 0) + glVertex(sx-cs, py+cs, 0) + glVertex(sx-cs, sy-cs, 0) + glVertex(sx, sy-cs, 0) + + local offset = 0.03 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + glTexCoord(o,o) + glVertex(px, py, 0) + glTexCoord(o,1-offset) + glVertex(px+cs, py, 0) + glTexCoord(1-offset,1-offset) + glVertex(px+cs, py+cs, 0) + glTexCoord(1-offset,o) + glVertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + glTexCoord(o,o) + glVertex(sx, py, 0) + glTexCoord(o,1-offset) + glVertex(sx-cs, py, 0) + glTexCoord(1-offset,1-offset) + glVertex(sx-cs, py+cs, 0) + glTexCoord(1-offset,o) + glVertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + glTexCoord(o,o) + glVertex(px, sy, 0) + glTexCoord(o,1-offset) + glVertex(px+cs, sy, 0) + glTexCoord(1-offset,1-offset) + glVertex(px+cs, sy-cs, 0) + glTexCoord(1-offset,o) + glVertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + glTexCoord(o,o) + glVertex(sx, sy, 0) + glTexCoord(o,1-offset) + glVertex(sx-cs, sy, 0) + glTexCoord(1-offset,1-offset) + glVertex(sx-cs, sy-cs, 0) + glTexCoord(1-offset,o) + glVertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + glTexture(bgcorner) + glBeginEnd(GL_QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + glTexture(false) +end + + +function DrawIconQuad(iconPos, color, size) + local X1 = X_MIN + (ICON_SIZE_X * iconPos) + local X2 = X1 + (ICON_SIZE_X) + local corneradjust = (bgcornerSize / (3 + (math.abs(hoversize)))) * size + + glColor(color) + RectRound(X1-corneradjust, Y_MIN-corneradjust, X2+corneradjust, Y_MAX+corneradjust, bgcornerSize) + + if WG['guishader'] then + WG['guishader'].InsertDlist(glCreateList( function() RectRound(X1-corneradjust, Y_MIN-corneradjust, X2+corneradjust, Y_MAX+corneradjust, bgcornerSize) end), 'idlebuilders') + end + +end--]] + + +------------------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------------------ +local Clicks = {} +local mouseOnUnitID = nil + + + +function widget:GetConfigData(data) + return { + position_x = POSITION_X, + position_y = POSITION_Y, + max_icons = MAX_ICONS + } +end + + +function widget:SetConfigData(data) + POSITION_X = data.position_x or POSITION_X + POSITION_Y = data.position_y or POSITION_Y + MAX_ICONS = data.max_icons or MAX_ICONS +end + + +local sec = 0 +local doUpdate = true +function widget:Update(dt) + if chobbyInterface then return end + + if not enabled then return end + + local iconNum = MouseOverIcon(GetMouseState()) + if iconNum < 0 then + mouseOnUnitID = nil + else + local unitID = drawTable[iconNum+1][2] + local unitDefID = drawTable[iconNum+1][1] + if not Clicks[unitDefID] then + Clicks[unitDefID] = 1 + end + if type(unitID) == 'table' then + unitID = unitID[fmod(Clicks[unitDefID]+1, getn(unitID))+1] + end + mouseOnUnitID = unitID + end + + sec = sec + dt + hoversize = math_sin(math_pi*(sec)) + rot = 30* math_sin(math_pi*(sec/2.5)) + + if GetGameFrame() % 31 == 0 or doUpdate then + doUpdate = false + IdleList = {} + QCount = {} + local myUnits = GetTeamUnitsSorted(GetMyTeamID()) + local unitCount = 0 + for unitDefID, unitTable in pairs(myUnits) do + if type(unitTable) == 'table' then + for count, unitID in pairs(unitTable) do + if count ~= 'n' and IsIdleBuilder(unitID) then + unitCount = unitCount + 1 + if IdleList[unitDefID] then + IdleList[unitDefID][#IdleList[unitDefID]+1] = unitID + else + IdleList[unitDefID] = {unitID} + end + end + end + end + end + + if unitCount >= MAX_ICONS then + CONDENSE = true + else + CONDENSE = false + end + + oldNoOfIcons = noOfIcons + noOfIcons = 0 + drawTable = {} + + for unitDefID, units in pairs(IdleList) do + if CONDENSE then + drawTable[#drawTable+1] = {unitDefID, units} + noOfIcons = noOfIcons + 1 + else + for _, unitID in pairs(units) do + drawTable[#drawTable+1] = {unitDefID, unitID} + end + noOfIcons = noOfIcons + table.getn(units) + end + end + if noOfIcons > MAX_ICONS then + noOfIcons = MAX_ICONS + end + if noOfIcons ~= oldNoOfIcons then + calcSizes(noOfIcons) + end + end +end + +function calcSizes(numIcons) + X_MIN = POSITION_X*vsx-0.5*numIcons*ICON_SIZE_X + X_MAX = POSITION_X*vsx+0.5*numIcons*ICON_SIZE_X + Y_MIN = POSITION_Y*vsy-0.5*ICON_SIZE_Y + Y_MAX = POSITION_Y*vsy+0.5*ICON_SIZE_Y +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + if widgetHandler:InTweakMode() then + calcSizes(MAX_ICONS) + DrawBoxes(MAX_ICONS) + calcSizes(noOfIcons) + local line1 = "Idle cons tweak mode" + local line2 = "Click and drag here to move icons around, hover over icons and move mouse wheel to change max number of icons" + font:Begin() + font:Print(line1, POSITION_X*vsx, POSITION_Y*vsy, 15, "c") + font:Print(line2, POSITION_X*vsx, (POSITION_Y*vsy)-10, 10, "c") + font:End() + return + end + + if WG['guishader'] then + WG['guishader'].DeleteDlist('idlebuilders') + end + + if enabled and noOfIcons > 0 then + local x, y, lb, mb, rb = GetMouseState() + + if not WG['topbar'] or not WG['topbar'].showingQuit() then + local icon = MouseOverIcon(x, y) + if (icon >= 0) then + + if (lb or mb or rb) then + DrawIconQuad(icon, { 0.5, 0.2, 0, 0.5 }, 1.1) + else + DrawIconQuad(icon, { 0, 0, 0.1, 0.4 }, 1.1) + end + end + end + glClear(GL_DEPTH_BUFFER_BIT) + DrawUnitIcons(noOfIcons) + end +end + + +function widget:TweakMouseMove(x, y, dx, dy, button) + local right = (x + (0.5*MAX_ICONS*ICON_SIZE_X))/vsx + local left = (x - (0.5*MAX_ICONS*ICON_SIZE_X))/vsx + local top = (y + (0.5*ICON_SIZE_Y))/vsy + local bottom = (y - (0.5*ICON_SIZE_Y))/vsy + if right > 1 then + right = 1 + left = 1 - (MAX_ICONS*ICON_SIZE_X)/vsx + end + if left < 0 then + left = 0 + right = (MAX_ICONS*ICON_SIZE_X)/vsx + end + if top > 1 then + top = 1 + bottom = 1 - ICON_SIZE_Y/vsy + end + if bottom < 0 then + bottom = 0 + top = ICON_SIZE_Y/vsy + end + + POSITION_X = 0.5*(right+left) + POSITION_Y = 0.5*(top+bottom) +end + + +function widget:TweakMousePress(x, y, button) + local iconNum = MouseOverIcon(x, y) + if iconNum >= 0 then return true end +end + + +function widget:MouseWheel(up, value) + if not widgetHandler:InTweakMode() then return false end + + local x,y,_,_,_ = GetMouseState() + local iconNum = MouseOverIcon(x, y) + if iconNum < 0 then return false end + + if up then + MAX_ICONS = MAX_ICONS + 1 + else + MAX_ICONS = MAX_ICONS - 1 + if MAX_ICONS < 1 then MAX_ICONS = 1 end + end + return true +end + + +function widget:DrawInMiniMap(sx, sz) + if not mouseOnUnitID then return -1 end + + local ux, uy, uz = GetUnitPosition(mouseOnUnitID) + if (not ux or not uy or not uz) then + return + end + local xr = ux/(Game.mapSizeX) + local yr = 1 - uz/(Game.mapSizeZ) + glColor(1,0,0) + glRect(xr*sx, yr*sz, (xr*sx)+5, (yr*sz)+5) +end + + +function widget:MousePress(x, y, button) + local icon = MouseOverIcon(x, y) + activePress = (icon >= 0) + return activePress +end + + +function widget:MouseRelease(x, y, button) + if not activePress then return -1 end + activePress = false + + local iconNum = MouseOverIcon(x, y) + if iconNum < 0 then return -1 end + + local unitID = drawTable[iconNum+1][2] + local unitDefID = drawTable[iconNum+1][1] + + if type(unitID) == 'table' then + if Clicks[unitDefID] then + Clicks[unitDefID] = Clicks[unitDefID] + 1 + else + Clicks[unitDefID] = 1 + end + unitID = unitID[fmod(Clicks[unitDefID], getn(unitID))+1] + end + + local alt, ctrl, meta, shift = GetModKeyState() + + if (button == 1) then -- left mouse + SelectUnitArray({unitID}) + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, 'ui') + end + elseif (button == 2) then -- middle mouse + SelectUnitArray({unitID}) + SendCommands({"viewselection"}) + if playSounds then + Spring.PlaySoundFile(middleclick, 0.75, 'ui') + end + end + + return -1 +end + + +--function widget:GetTooltip(x, y) +-- local iconNum = MouseOverIcon(x, y) +-- local units = drawTable[iconNum+1][2] +-- if type(units) == 'table' then +-- units = units[1] +-- end +-- local unitDefID = GetUnitDefID(units) +-- local ud = UnitDefs[unitDefID] +-- if not ud then +-- return "" +-- end +-- return ud.humanName .. "\nLeft mouse: select unit\nMiddle mouse: move to unit\n" +--end +-- +-- +--function widget:IsAbove(x, y) +-- return MouseOverIcon(x, y) ~= -1 +--end + + +function widget:DrawWorld() + if chobbyInterface then return end + if mouseOnUnitID and (not WG['topbar'] or not WG['topbar'].showingQuit()) then + if widgetHandler:InTweakMode() then return -1 end + glColor(1,1,1,0.22) + glUnit(mouseOnUnitID, true) + end +end + +function widget:Shutdown() + gl.DeleteFont(font) + if WG['guishader'] then + WG['guishader'].DeleteDlist('idlebuilders') + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_idle_builders_new.lua b/LuaUI/Widgets_Evo/gui_idle_builders_new.lua deleted file mode 100644 index ce9df180e..000000000 --- a/LuaUI/Widgets_Evo/gui_idle_builders_new.lua +++ /dev/null @@ -1,524 +0,0 @@ - -function widget:GetInfo() - return { - name = "IdleBuildersNEW", - desc = "Adv Idle Indicator", - author = "Ray", - date = "Jul 23, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = false -- loaded by default? - } -end - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -include("colors.h.lua") - -local vsx, vsy = widgetHandler:GetViewSizes() - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY -end - -local MAX_ICONS = 5 -local ICON_SIZE_X = 70 -local ICON_SIZE_Y = 70 -local CONDENSE = false -- show one icon for all builders of same type -local POSITION_X = 0.5 -- horizontal centre of screen -local POSITION_Y = 0.05 -- near bottom -local NEAR_IDLE = 0 -- this means that factories with only 8 build items left will be shown as idle -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - - -local X_MIN = 0 -local X_MAX = 0 -local Y_MIN = 0 -local Y_MAX = 0 -local drawTable = {} -local IdleList = {} -local activePress = false -local QCount = {} -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- - -local function IsIdleBuilder(unitID) - local udef = Spring.GetUnitDefID(unitID) - local ud = UnitDefs[udef] - local qCount = 0 - if ud.buildSpeed > 0 then --- can build - local bQueue = Spring.GetFullBuildQueue(unitID) - if not bQueue[1] then --- has no build queue - local _, _, _, _, buildProg = Spring.GetUnitHealth(unitID) - if buildProg == 1 then --- isnt under construction - if ud.isFactory then - return true - else - local cQueue = Spring.GetCommandQueue(unitID) - if not cQueue[1] then - return true - end - end - end - elseif ud.isFactory then - for _, thing in ipairs(bQueue) do - for _, count in pairs(thing) do - qCount = qCount + count - end - end - if qCount <= NEAR_IDLE then - QCount[unitID] = qCount - return true - end - end - end - return false -end - -local function DrawBoxes(number) - gl.Color({ 0, 0, 0, 0.65 }) - X_MIN = POSITION_X*vsx-0.5*number*ICON_SIZE_X - X_MAX = POSITION_X*vsx+0.5*number*ICON_SIZE_X - Y_MIN = POSITION_Y*vsy-0.5*ICON_SIZE_Y - Y_MAX = POSITION_Y*vsy+0.5*ICON_SIZE_Y - local X1 = X_MIN - local ct = 0 - while (ct < number) do - ct = ct + 1 - local X2 = X1+ICON_SIZE_X - - gl.Shape(GL.LINE_LOOP, { - { v = { X1, Y_MIN } }, - { v = { X2, Y_MIN } }, - { v = { X2, Y_MAX } }, - { v = { X1, Y_MAX } }, - }) - X1 = X2 - - end -end--]] - -local function SetupModelDrawing() - gl.DepthTest(true) - gl.DepthMask(true) - gl.Culling(GL.FRONT) - gl.Lighting(true) - gl.Blending(false) - gl.Material({ - ambient = { 1.0, 1.0, 1.0, 1.0 }, - diffuse = { 1.0, 1.0, 1.0, 1.0 }, - emission = { 0.0, 0.0, 0.0, 1.0 }, - specular = { 0.3, 0.2, 0.2, 1.0 }, - shininess = 16.0 - }) -end - - -local function RevertModelDrawing() - gl.Blending(true) - gl.Lighting(false) - gl.Culling(false) - gl.DepthMask(false) - gl.DepthTest(false) -end - -local function CenterUnitDef(unitDefID) - local ud = UnitDefs[unitDefID] - if (not ud) then - return - end - if (not ud.dimensions) then - ud.dimensions = Spring.GetUnitDefDimensions(unitDefID) - end - if (not ud.dimensions) then - return - end - - local d = ud.dimensions - local xSize = (d.maxx - d.minx) - local ySize = (d.maxy - d.miny) - local zSize = (d.maxz - d.minz) - - local hSize -- maximum horizontal dimension - if (xSize > zSize) then hSize = xSize else hSize = zSize end - - -- aspect ratios - local mAspect = hSize / ySize - local vAspect = ICON_SIZE_X / ICON_SIZE_Y - - -- scale the unit to the box (maxspect) - local scale - if (mAspect > vAspect) then - scale = (ICON_SIZE_X / hSize) - else - scale = (ICON_SIZE_Y / ySize) - end - scale = scale * 0.8 - gl.Scale(scale, scale, scale) - - -- translate to the unit's midpoint - local xMid = 0.5 * (d.maxx + d.minx) - local yMid = 0.5 * (d.maxy + d.miny) - local zMid = 0.5 * (d.maxz + d.minz) - gl.Translate(-xMid, -yMid, -zMid) -end - - - -local function DrawUnitIcons(number) - if not drawTable then - return -1 - end - - local ct = 0 - local X1, X2 - gl.Texture(false) - SetupModelDrawing() - - gl.Scissor(true) - while (ct < number) do - ct = ct + 1 - - gl.PushMatrix() - X1 = X_MIN+(ICON_SIZE_X*(ct-1)) - X2 = X1+ICON_SIZE_X - - gl.Scissor(X1, Y_MIN, X2 - X1, Y_MAX - Y_MIN) - - gl.Translate(0.5*(X2+X1), 0.5*(Y_MAX+Y_MIN), 0) - gl.Rotate(15.0, 1, 0, 0) - - CenterUnitDef(drawTable[ct].unitDefID) - - gl.UnitShape(drawTable[ct].unitDefID, Spring.GetMyTeamID()) - - gl.Scissor(false) - gl.PopMatrix() - - if CONDENSE then - local NumberCondensed = table.getn(drawTable[ct].units) - if NumberCondensed > 1 then - gl.Text(NumberCondensed, X1, Y_MIN, 10, "o") - end - - end - - local unitID = drawTable[ct].units - if type(unitID) == 'table' then - unitID = unitID[1] - end - if QCount[unitID] then - gl.Text(QCount[unitID], X1+(0.5*ICON_SIZE_X),Y_MIN,15,"ocn") - end - - end - RevertModelDrawing() -end--]] - -local function MouseOverIcon(x, y) - if not drawTable then return -1 end - - local NumOfIcons = table.getn(drawTable) - if (x < X_MIN) then return -1 end - if (x > X_MAX) then return -1 end - if (y < Y_MIN) then return -1 end - if (y > Y_MAX) then return -1 end - - local icon = math.floor((x-X_MIN)/ICON_SIZE_X) - if (icon < 0) then - icon = 0 - end - if (icon >= NumOfIcons) then - icon = (NumOfIcons - 1) - end - return icon -end--]] - - -function DrawIconQuad(iconPos, color) - local X1 = X_MIN + (ICON_SIZE_X * iconPos) - local X2 = X1 + ICON_SIZE_X - - gl.Color(color) - gl.Blending(GL.SRC_ALPHA, GL.ONE) - gl.Shape(GL.QUADS, { - { v = { X1, Y_MIN } }, - { v = { X2, Y_MIN } }, - { v = { X2, Y_MAX } }, - { v = { X1, Y_MAX } }, - }) - - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -end--]] - - ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- -local Clicks = {} -local mouseOnUnitID = nil - - -function widget:Initialize() - local _, _, spec = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) - if spec then - -- widgetHandler:RemoveWidget() - -- return false - end - - -end - -function widget:GetConfigData(data) - return { - position_x = POSITION_X, - position_y = POSITION_Y, - max_icons = MAX_ICONS - } -end - -function widget:SetConfigData(data) - POSITION_X = data.position_x or POSITION_X - POSITION_Y = data.position_y or POSITION_Y - MAX_ICONS = data.max_icons or MAX_ICONS -end - - -function widget:Update() - IdleList = {} - QCount = {} - local myUnits = Spring.GetTeamUnitsSorted(Spring.GetMyTeamID()) - local unitCount = 0 - for unitDefID, unitTable in pairs(myUnits) do - if type(unitTable) == 'table' then - for count, unitID in pairs(unitTable) do - if count ~= 'n' and IsIdleBuilder(unitID) then - unitCount = unitCount + 1 - if IdleList[unitDefID] then - table.insert(IdleList[unitDefID], unitID) - else - IdleList[unitDefID] = {unitID} - end - end - end - else - - end - end - - if unitCount >= MAX_ICONS then - CONDENSE = true - else - CONDENSE = false - end - -end - - - -function widget:TweakMouseMove(x, y, dx, dy, button) - local right = (x + (0.5*MAX_ICONS*ICON_SIZE_X))/vsx - local left = (x - (0.5*MAX_ICONS*ICON_SIZE_X))/vsx - local top = (y + (0.5*ICON_SIZE_Y))/vsy - local bottom = (y - (0.5*ICON_SIZE_Y))/vsy - if right > 1 then - right = 1 - left = 1 - (MAX_ICONS*ICON_SIZE_X)/vsx - end - if left < 0 then - left = 0 - right = (MAX_ICONS*ICON_SIZE_X)/vsx - end - if top > 1 then - top = 1 - bottom = 1 - ICON_SIZE_Y/vsy - end - if bottom < 0 then - bottom = 0 - top = ICON_SIZE_Y/vsy - end - - POSITION_X = 0.5*(right+left) - POSITION_Y = 0.5*(top+bottom) -end - -function widget:TweakMousePress(x, y, button) - local iconNum = MouseOverIcon(x, y) - if iconNum >= 0 then return true end -end - -function widget:MouseWheel(up, value) - if not widgetHandler:InTweakMode() then return false end - - local x,y,_,_,_ = Spring.GetMouseState() - local iconNum = MouseOverIcon(x, y) - if iconNum < 0 then return false end - - if up then - MAX_ICONS = MAX_ICONS + 1 - else - MAX_ICONS = MAX_ICONS - 1 - if MAX_ICONS < 1 then MAX_ICONS = 1 end - end - return true -end - -function widget:DrawScreen() - - if widgetHandler:InTweakMode() then - DrawBoxes(MAX_ICONS) - local line1 = "Idle cons tweak mode" - local line2 = "Click and drag here to move icons around, hover over icons and move mouse wheel to change max number of icons" - gl.Text(line1, POSITION_X*vsx, POSITION_Y*vsy, 15, "c") - gl.Text(line2, POSITION_X*vsx, (POSITION_Y*vsy)-10, 10, "c") - return - end - - local noOfIcons = 0 - drawTable = {} - - for unitDefID, units in pairs(IdleList) do - if CONDENSE then - table.insert(drawTable, {unitDefID = unitDefID, units = units}) - noOfIcons = noOfIcons + 1 - else - for _, unitID in pairs(units) do - table.insert(drawTable, {unitDefID = unitDefID, units = unitID}) - end - noOfIcons = noOfIcons + table.getn(units) - end - - - end - if noOfIcons > MAX_ICONS then - noOfIcons = MAX_ICONS - elseif noOfIcons == 0 then - return - end - gl.Clear(GL.DEPTH_BUFFER_BIT) - - DrawBoxes(noOfIcons) - DrawUnitIcons(noOfIcons) - - - local x, y, lb, mb, rb = Spring.GetMouseState() - local icon = MouseOverIcon(x, y) - if (icon >= 0) then - if (lb or mb or rb) then - DrawIconQuad(icon, { 1, 0, 0, 0.333 }) - else - DrawIconQuad(icon, { 0, 0.1, 0.8, 0.433 }) - end - end - -end - ---]] - -function widget:DrawWorld() - if widgetHandler:InTweakMode() then return -1 end - - local x,y,_,_,_ = Spring.GetMouseState() - local iconNum = MouseOverIcon(x, y) - if iconNum < 0 then - mouseOnUnitID = nil - return -1 - end - - local unitID = drawTable[iconNum+1].units - local unitDefID = drawTable[iconNum+1].unitDefID - if Clicks[unitDefID] == nil then - Clicks[unitDefID] = 1 - end - if type(unitID) == 'table' then - unitID = unitID[math.fmod(Clicks[unitDefID]+1, table.getn(unitID))+1] - end - - mouseOnUnitID = unitID - -- hilight the unit we are about to click on - gl.Unit(unitID, true) -end - - -function widget:DrawInMiniMap(sx, sz) - if not mouseOnUnitID then return -1 end - - local ux, uy, uz = Spring.GetUnitPosition(mouseOnUnitID) - if (not ux or not uy or not uz) then - return - end - local xr = ux/(Game.mapX*512) - local yr = 1 - uz/(Game.mapY*512) - gl.Color(1,0,0) - gl.Rect(xr*sx, yr*sz, (xr*sx)+5, (yr*sz)+5) -end - - -function widget:MousePress(x, y, button) - local icon = MouseOverIcon(x, y) - activePress = (icon >= 0) - return activePress -end - - -function widget:MouseRelease(x, y, button) - if not activePress then return -1 end - activePress = false - - local iconNum = MouseOverIcon(x, y) - if iconNum < 0 then return -1 end - - local unitID = drawTable[iconNum+1].units - local unitDefID = drawTable[iconNum+1].unitDefID - - if type(unitID) == 'table' then - if Clicks[unitDefID] then - Clicks[unitDefID] = Clicks[unitDefID] + 1 - else - Clicks[unitDefID] = 1 - end - unitID = unitID[math.fmod(Clicks[unitDefID], table.getn(unitID))+1] - end - - local alt, ctrl, meta, shift = Spring.GetModKeyState() - - if (button == 1) then -- left mouse - Spring.SelectUnitArray({unitID}) - elseif (button == 2) then -- middle mouse - Spring.SelectUnitArray({unitID}) - Spring.SendCommands({"viewselection"}) - end - - return -1 -end - -function widget:GetTooltip(x, y) - local iconNum = MouseOverIcon(x, y) - local units = drawTable[iconNum+1].units - if type(units) == 'table' then - units = units[1] - end - local unitDefID = Spring.GetUnitDefID(units) - local ud = UnitDefs[unitDefID] - return ud.humanName .. "\nLeft mouse: select unit\nMiddle mouse: move to unit\n" -end - -function widget:IsAbove(x, y) - if MouseOverIcon(x, y) == -1 then - return false - else - return true - end -end - -function echo(msg) - if type(msg) == 'string' or type(msg) == 'number' then - Spring.SendCommands({"echo " .. msg}) - elseif type(msg) == 'table' then - Spring.SendCommands({"echo echo failed on table"}) - else - Spring.SendCommands({"echo broke :-"}) - end -end diff --git a/LuaUI/Widgets_Evo/gui_keybind_info.lua b/LuaUI/Widgets_Evo/gui_keybind_info.lua new file mode 100644 index 000000000..febf71f15 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_keybind_info.lua @@ -0,0 +1,377 @@ + +function widget:GetInfo() +return { + name = "Keybind/Mouse Info", + desc = "Provides information on the controls", + author = "Bluestone", + date = "April 2015", + license = "Mouthwash", + layer = -99990, + enabled = true, +} +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local bgMargin = 6 + +local closeButtonSize = 30 +local screenHeight = 520-bgMargin-bgMargin +local screenWidth = 1050-bgMargin-bgMargin + +local customScale = 1 + +local spIsGUIHidden = Spring.IsGUIHidden +local showHelp = false + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glPolygonMode = gl.PolygonMode +local glRect = gl.Rect +local glText = gl.Text +local glShape = gl.Shape + +local bgColorMultiplier = 0 + +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glScale = gl.Scale + +local GL_FILL = GL.FILL +local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK +local GL_LINE_STRIP = GL.LINE_STRIP + +local widgetScale = 1 +local vsx, vsy = Spring.GetViewGeometry() + +local vsx,vsy = Spring.GetViewGeometry() +local screenX = (vsx*0.5) - (screenWidth/2) +local screenY = (vsy*0.5) + (screenHeight/2) + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + screenX = (vsx*0.5) - (screenWidth/2) + screenY = (vsy*0.5) + (screenHeight/2) + widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + if keybinds then gl.DeleteList(keybinds) end + keybinds = gl.CreateList(DrawWindow) +end + +local myTeamID = Spring.GetMyTeamID() +local showOnceMore = false + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +-- keybind info + +include("configs/EVO_HotkeyInfo.lua") +local bindColor = "\255\235\185\070" +local titleColor = "\255\254\254\254" +local descriptionColor = "\255\192\190\180" + +function DrawTextTable(t,x,y) + local j = 0 + local height = 0 + local width = 0 + font:Begin() + for _,t in pairs(t) do + if t.blankLine then + -- nothing here + elseif t.title then + -- title line + local title = t[1] or "" + local line = " " .. titleColor .. title -- a WTF whitespace is needed here, the colour doesn't show without it... + font:Print(line, x+4, y-((13)*j)+5, 14) + screenWidth = math.max(font:GetTextWidth(line)*13,screenWidth) + else + -- keybind line + local bind = string.upper(t[1]) or "" + local effect = t[2] or "" + local line = " " .. bindColor .. bind .. " " .. descriptionColor .. effect + font:Print(line, x+14, y-(13)*j, 11) + width = math.max(font:GetTextWidth(line)*11,width) + end + height = height + 13 + + j = j + 1 + end + font:End() + --screenHeight = math.max(screenHeight, height) + --screenWidth = screenWidth + width + return x,j +end + +function DrawWindow() + local vsx,vsy = Spring.GetViewGeometry() + local x = screenX --rightwards + local y = screenY --upwards + + -- background + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(x-bgMargin,y-screenHeight-bgMargin,x+screenWidth+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + gl.Color(0.33,0.33,0.33,0.15) + RectRound(x,y-screenHeight,x+screenWidth,y,8) + + -- close button + local size = closeButtonSize*0.7 + local width = size*0.055 + gl.Color(1,1,1,1) + gl.PushMatrix() + gl.Translate(screenX+screenWidth-(closeButtonSize/2),screenY-(closeButtonSize/2),0) + gl.Rotate(-45,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(90,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.PopMatrix() + + -- title background + local title = "Keybinds" + local titleFontSize = 18 + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + titleRect = {x-bgMargin, y+bgMargin, x-bgMargin+(font2:GetTextWidth(title)*titleFontSize)+27, y+37} + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + -- title + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font2:End() + + DrawTextTable(General,x,y-24) + x = x + 350 + DrawTextTable(Units_I_II,x,y-24) + x = x + 350 + DrawTextTable(Units_III,x,y-24) + + gl.Color(1,1,1,1) + font:Begin() + font:Print("These keybinds are set by default. If you remove/replace hotkey widgets, or use your own uikeys, they might stop working!", screenX+12, y-screenHeight + 14, 12.5) + font:End() +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if spIsGUIHidden() then return end + + -- draw the help + if not keybinds then + keybinds = gl.CreateList(DrawWindow) + end + + if show or showOnceMore then + glPushMatrix() + glTranslate(-(vsx * (widgetScale-1))/2, -(vsy * (widgetScale-1))/2, 0) + glScale(widgetScale, widgetScale, 1) + glCallList(keybinds) + glPopMatrix() + if WG['guishader'] then + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if backgroundGuishader ~= nil then + glDeleteList(backgroundGuishader) + end + backgroundGuishader = glCreateList( function() + -- background + RectRound(rectX1, rectY2, rectX2, rectY1, 9*widgetScale, 0,1,1,1) + -- title + rectX1 = (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY1 = (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2) + rectX2 = (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY2 = (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2) + RectRound(rectX1, rectY1, rectX2, rectY2, 9*widgetScale, 1,1,0,0) + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'keybindinfo') + end + showOnceMore = false + else + if WG['guishader'] then + WG['guishader'].DeleteDlist('keybindinfo') + end + end +end + +function widget:KeyPress(key) + if key == 27 then -- ESC + show = false + end +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + +function mouseEvent(x, y, button, release) + if spIsGUIHidden() then return false end + + if show then + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + -- on close button + rectX1 = rectX2 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + rectY2 = rectY1 - ((closeButtonSize+bgMargin+bgMargin) * widgetScale) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + if release then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = not show + end + return true + end + return true + elseif titleRect == nil or not IsOnRect(x, y, (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2), (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2)) then + if release then + showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it + show = false + end + return true + end + end +end + +function widget:Initialize() + + WG['keybinds'] = {} + WG['keybinds'].toggle = function(state) + if state ~= nil then + show = state + else + show = not show + end + end + WG['keybinds'].isvisible = function() + return show + end +end + +function widget:Shutdown() + if keybinds then + glDeleteList(keybinds) + keybinds = nil + end + if WG['guishader'] then + WG['guishader'].DeleteDlist('keybindinfo') + end + gl.DeleteFont(font) + gl.DeleteFont(font2) +end diff --git a/LuaUI/Widgets_Evo/gui_los.lua b/LuaUI/Widgets_Evo/gui_los.lua deleted file mode 100644 index d7c592a1f..000000000 --- a/LuaUI/Widgets_Evo/gui_los.lua +++ /dev/null @@ -1,160 +0,0 @@ -function widget:GetInfo() - return { - name = "Fog of War", - desc = "Draw fog of war", - author = "Knorke", - date = "Mar 2011, 2011", - license = "Public Domain", - layer = -3, - enabled = false - } -end - -local DspLst=nil -local res = 75 --75 50 to 200, multiple of 8 work better eg 64 -local TileMaxX = Game.mapSizeX/res +1 -local TileMaxZ = Game.mapSizeZ/res +1 -local unexplored = 0 -local visible = 1 -local explored = 2 -local FOG = {} -local localAllyID = Spring.GetLocalAllyTeamID () -local updateRate = 15 --15 to 30,lower=faster updating -local fogAlpha = 0.25 --0.7 ----magical speedups--- -local Spring_GetGroundHeight = Spring.GetGroundHeight -local Spring_IsPosInLos = Spring.IsPosInLos -local gl_Vertex = gl.Vertex -local gl_Color = gl.Color -local gl_CreateList = gl.CreateList -local gl_BeginEnd = gl.BeginEnd -local gl_DepthMask = gl.DepthMask ----------------------- - -local function updateFOG() - for x=1,TileMaxX do - mx=x*res - for z=1,TileMaxZ do - mz=z*res - local los = Spring_IsPosInLos (mx, Spring_GetGroundHeight(x,z), mz, localAllyID) - if (los==true) then FOG[x][z] = 1 end - if (los==false) then - if (FOG[x][z]==visible) then FOG[x][z] = explored end - --FOG[x][z] = 2 - end - end - end -end - -function widget:GameFrame (f) - if (f%updateRate==0) then - updateFOG() - ForceRefresh() - end -end - -function widget:Initialize (f) - checkToDisable () - for x=1,TileMaxX do - FOG[x] = {} - for z=1,TileMaxZ do - FOG[x][z] = unexplored --0 - end - end - updateFOG() -end - -local function TilesVerticesOutside(h) - for x=1,TileMaxX,1 do - for z=1,TileMaxZ,1 do - if (x >= 1 and z >= 1 and x < TileMaxX and z < TileMaxZ) then - --if (false) then - if (FOG[x][z]~=nil) then - if (FOG[x][z] == unexplored) then gl_Color(0,0,0,fogAlpha/2) end - if (FOG[x][z] == explored) then gl_Color(0,0,0,fogAlpha/2) end - if (FOG[x][z] ~= visible) then - gl_Vertex(res*(x-1),h+Spring.GetGroundHeight(res*(x-1),res*z),res*z) - gl_Vertex(res*x,h+Spring_GetGroundHeight(res*x,res*z),res*z) - gl_Vertex(res*x,h+Spring_GetGroundHeight(res*x,res*(z-1)),res*(z-1)) - gl_Vertex(res*(x-1),h+Spring_GetGroundHeight(res*(x-1),res*(z-1)),res*(z-1)) - end - end - else - local a = math.random (0,10)/64 --math.abs (math.sin (x*z)) - gl_Color(a,a,a,fogAlpha) --a,a,a for black&white - gl_Vertex(res*(x-1),Spring.GetGroundHeight(res*(x-1),res*z),res*z) - gl_Vertex(res*x,Spring_GetGroundHeight(res*x,res*z),res*z) - gl_Vertex(res*x,Spring_GetGroundHeight(res*x,res*(z-1)),res*(z-1)) - gl_Vertex(res*(x-1),Spring_GetGroundHeight(res*(x-1),res*(z-1)),res*(z-1)) - end - end - end -end - -local function TilesVertices(h) - for x=1,TileMaxX do - for z=1,TileMaxZ do - if (FOG[x][z]~=nil) then - if (FOG[x][z] == unexplored) then gl_Color(0,0,0,fogAlpha) end - --if (FOG[x][z] == visible) then gl_Color(0,0,0,0) end - if (FOG[x][z] == explored) then gl_Color(0,0,0,fogAlpha/2) end - if (FOG[x][z] ~= visible) then - --if (x > TileMaxX or z > TileMaxZ) then - local a = math.random (0,10)/10 - gl_Color(a,a,a,fogAlpha) - --end - gl_Vertex(res*(x-1),h+Spring.GetGroundHeight(res*(x-1),res*z),res*z) - gl_Vertex(res*x,h+Spring_GetGroundHeight(res*x,res*z),res*z) - gl_Vertex(res*x,h+Spring_GetGroundHeight(res*x,res*(z-1)),res*(z-1)) - gl_Vertex(res*(x-1),h+Spring_GetGroundHeight(res*(x-1),res*(z-1)),res*(z-1)) - end - end - end - end -end - -local function DrawTiles() - gl.PushAttrib(GL.ALL_ATTRIB_BITS) - gl.DepthTest(true) - gl_DepthMask(true) - --gl.Texture(":a:foggy.png") - --r = math.random(0,100)/100 - gl_Color(1,1,1,1) - --gl_BeginEnd(GL.QUADS,TilesVertices,8) - gl_BeginEnd(GL.QUADS,TilesVerticesOutside,50) - --gl_BeginEnd(GL.TRIANGLES,TilesVertices,8) - gl.Texture(false) - gl_DepthMask(false) - gl.DepthTest(false) - gl_Color(1,1,1,1) - gl.PopAttrib() -end - ---function widget:DrawWorldPreUnit() -function widget:DrawWorld() ---function widget:DrawInMiniMap() - if not DspLst then - DspLst=gl_CreateList(DrawTiles) - end - gl.CallList(DspLst)-- Or maybe you want to keep it cached but not draw it everytime. - -- Maybe you want Spring.SetDrawGround(false) somewhere -end - - -function ForceRefresh() - if DspLst then - gl.DeleteList(DspLst) - DspLst=nil - end -end - - -function checkToDisable () - if (Spring.IsReplay() or Spring.GetSpectatingState ()) then - widgetHandler:RemoveWidget() - end -end - -function widget:PlayerChanged (playerID) - checkToDisable () -end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_lups_stats.lua b/LuaUI/Widgets_Evo/gui_lups_stats.lua index eae86f5ff..57e161709 100644 --- a/LuaUI/Widgets_Evo/gui_lups_stats.lua +++ b/LuaUI/Widgets_Evo/gui_lups_stats.lua @@ -42,7 +42,7 @@ local yposf = 0.010 local ypos = yposf * vsy + 40 local sizef = 0.015 local size = sizef * vsy -local font = "LuaUI/Fonts/FreeSansBold_14" +local font = "LuaUI/Fonts/JosefinSans-SemiBold(OTF)" local format = "orn" local fh = (font ~= nil) @@ -53,7 +53,14 @@ local fh = (font ~= nil) -- Rendering -- +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end gl.Color(color) local fxcount, fxlayers, fx = WG['Lups'].GetStats() diff --git a/LuaUI/Widgets_Evo/gui_mapinfo.lua b/LuaUI/Widgets_Evo/gui_mapinfo.lua new file mode 100644 index 000000000..7c6befe7a --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_mapinfo.lua @@ -0,0 +1,310 @@ +local versionNumber = "0.6" + +function widget:GetInfo() + return { + name = "Map Info", + desc = versionNumber .." Draws map info on the bottom left of the map. Toggle vertical position with /mapinfo_floor", + author = "Floris", + date = "20 May 2015", + license = "GNU GPL, v2 or later", + layer = -10, + enabled = true, -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-- Console commands +-------------------------------------------------------------------------------- + +--/mapinfo_floor -- toggles placement at ground-height, or map floor + +-------------------------------------------------------------------------------- +-- config +-------------------------------------------------------------------------------- + +local scale = 1 +local offset = 5 +local stickToFloor = false +local thickness = 6 +local fadeStartHeight = 800 +local fadeEndHeight = 4800 +local dlistAmount = 20 -- amount of dlists created, one for each opacity value + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + + +-------------------------------------------------------------------------------- +-- speed-ups +-------------------------------------------------------------------------------- + +local spGetCameraPosition = Spring.GetCameraPosition +local spGetGroundHeight = Spring.GetGroundHeight +local spIsAABBInView = Spring.IsAABBInView +--local spGetCameraState = Spring.GetCameraState + +local glColor = gl.Color +local glScale = gl.Scale +local glText = gl.Text +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTranslate = gl.Translate +local glBeginEnd = gl.BeginEnd +local glVertex = gl.Vertex +local glGetTextWidth = gl.GetTextWidth +local glBlending = gl.Blending +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local glDepthTest = gl.DepthTest +local glAlphaTest = gl.AlphaTest +local glTexture = gl.Texture +local glRotate = gl.Rotate + +local mapInfo = {} +local mapInfoWidth = 400 -- minimum width +local mapinfoList = {} + +-------------------------------------------------------------------------------- +-- Functions +-------------------------------------------------------------------------------- + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + for opacity, list in pairs(mapinfoList) do + glDeleteList(list) + mapinfoList[opacity] = nil + end +end + +local function createMapinfoList(opacityMultiplier) + mapinfoList[opacityMultiplier] = gl.CreateList( function() + local textOpacity = 0.85 + local textSize = 12 + local textOffsetX = 11 + local textOffsetY = 16 + local usedTextOffsetY = textOffsetY + (offset/2) + local length = math.max(mapInfoWidth, (font:GetTextWidth(Game.mapDescription)*textSize) + 45) + + glDepthTest(true) + glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + + if stickToFloor then + glTranslate(offset, offset, Game.mapSizeZ+0.01) + else + glTranslate(offset, mapInfoBoxHeight-offset, Game.mapSizeZ+0.01) + end + + glPushMatrix() + + glScale(scale,scale,scale) + glRotate(90,0,-1,0) + glRotate(180,1,0,0) + + --Spring.Echo(font:GetTextWidth(Game.mapDescription)) + + local height = 90 + local thickness = -(thickness*scale) + glBeginEnd(GL.QUADS,function() + glColor(0.12,0.12,0.12,0.4*opacityMultiplier*opacityMultiplier) + glVertex( height, 0 , 0); -- Top Right Of The Quad (Top) + glVertex( 0 , 0 , 0); -- Top Left Of The Quad (Top) + glVertex( 0 , 0 , length); -- Bottom Left Of The Quad (Top) + glVertex( height, 0 , length); -- Bottom Right Of The Quad (Top) + + glVertex( height, 0 , length); -- Top Right Of The Quad (Front) + glVertex( 0 , 0 , length); -- Top Left Of The Quad (Front) + glVertex( 0 ,-thickness, length); -- Bottom Left Of The Quad (Front) + glVertex( height,-thickness, length); -- Bottom Right Of The Quad (Front) + + glVertex( height,-thickness, 0); -- Top Right Of The Quad (Back) + glVertex( 0 ,-thickness, 0); -- Top Left Of The Quad (Back) + glVertex( 0 , 0 , 0); -- Bottom Left Of The Quad (Back) + glVertex( height, 0 , 0); -- Bottom Right Of The Quad (Back) + + glVertex( 0 , 0 , length); -- Top Right Of The Quad (Left) + glVertex( 0 , 0 , 0); -- Top Left Of The Quad (Left) + glVertex( 0 ,-thickness, 0); -- Bottom Left Of The Quad (Left) + glVertex( 0 ,-thickness, length); -- Bottom Right Of The Quad (Left) + + glVertex( height, 0 , 0); -- Top Right Of The Quad (Right) + glVertex( height, 0 , length); -- Top Left Of The Quad (Right) + glVertex( height,-thickness, length); -- Bottom Left Of The Quad (Right) + glVertex( height,-thickness, 0); -- Bottom Right Of The Quad (Right) + + + glColor(0.05,0.05,0.05,0.4*opacityMultiplier*opacityMultiplier) + glVertex( height,-thickness, length); -- Top Right Of The Quad (Bottom) + glVertex( 0 ,-thickness, length); -- Top Left Of The Quad (Bottom) + glVertex( 0 ,-thickness, 0); -- Bottom Left Of The Quad (Bottom) + glVertex( height,-thickness, 0); -- Bottom Right Of The Quad (Bottom) + end) + + glRotate(180,1,0,0) + glRotate(90,0,1,0) + + glRotate(90,1,0,0) + glTranslate(0,3,0) + + glRotate(180,1,0,0) + + -- map name + font:Begin() + local text = Game.mapName + font:SetTextColor(1,1,1,(textOpacity*1.12)*opacityMultiplier) + font:Print(text, textOffsetX,-usedTextOffsetY,14,"n") + font:SetTextColor(0,0,0,textOpacity*0.12*opacityMultiplier) + font:Print(text, textOffsetX+0.5,-usedTextOffsetY-0.9,14,"n") + + --map description + usedTextOffsetY = usedTextOffsetY+textOffsetY + text = Game.mapDescription + font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) + font:Print(text, textOffsetX,-usedTextOffsetY,textSize,"n") + + --map size + usedTextOffsetY = usedTextOffsetY+textOffsetY + text = Game.mapDescription + font:SetTextColor(1,1,1,textOpacity*0.6*opacityMultiplier) + font:Print("Size: "..Game.mapX.. " x "..Game.mapY, textOffsetX,-usedTextOffsetY+0.8,textSize,"n") + font:End() + + --[[ + usedTextOffsetY = usedTextOffsetY+textOffsetY + text = "Waterdamage: "..math.floor(Game.waterDamage) + glColor(1,1,1,textOpacity*0.6*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY,textSize,"n") + glColor(0,0,0,textOpacity*0.6*0.17*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY-1,textSize,"n") + + textOffsetX = textOffsetX + 120 + text = "Gravity: "..math.floor(Game.gravity) + glColor(1,1,1,textOpacity*0.6*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY,textSize,"n") + glColor(0,0,0,textOpacity*0.6*0.17*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY-1,textSize,"n") + textOffsetX = textOffsetX - 120 + + textOffsetX = textOffsetX + 210 + text = "Tidal: "..math.floor(Game.tidal) + glColor(1,1,1,textOpacity*0.6*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY,textSize,"n") + glColor(0,0,0,textOpacity*0.6*0.17*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY-1,textSize,"n") + textOffsetX = textOffsetX - 210 + + -- game name + usedTextOffsetY = usedTextOffsetY+textOffsetY+textOffsetY+textOffsetY + text = Game.gameName.." "..Game.gameVersion + glColor(1,1,1,textOpacity*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY,textSize,"n") + glColor(0,0,0,textOpacity*0.17*opacityMultiplier) + glText(text, textOffsetX,-usedTextOffsetY-1,textSize,"n") + ]]-- + + glPopMatrix() + + if stickToFloor then + glTranslate(-offset, -offset, -Game.mapSizeZ) + else + glTranslate(-offset, -mapInfoBoxHeight-offset, -Game.mapSizeZ) + end + glColor(1,1,1,1) + glScale(1,1,1) + glDepthTest(false) + end) +end + + +function Init() + + if (font:GetTextWidth(Game.mapDescription) * 12) > mapInfoWidth then + --mapInfoWidth = (font:GetTextWidth(Game.mapDescription) * 12) + 33 + end + if stickToFloor then + mapInfoBoxHeight = 0 + else + mapInfoBoxHeight = spGetGroundHeight(0,Game.mapSizeZ) + end + + -- find the lowest map height + if not stickToFloor then + for i=math.floor(offset*scale), math.floor((mapInfoWidth+offset)*scale) do + if spGetGroundHeight(i,Game.mapSizeZ) < mapInfoBoxHeight then + mapInfoBoxHeight = spGetGroundHeight(i,Game.mapSizeZ) + end + end + end +end +-------------------------------------------------------------------------------- +-- callins +-------------------------------------------------------------------------------- + +function widget:Initialize() + Init() +end + +function widget:Shutdown() + for opacity, list in pairs(mapinfoList) do + glDeleteList(mapinfoList[opacity]) + mapinfoList[opacity] = nil + end + gl.DeleteFont(font) +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + if spIsAABBInView(offset, mapInfoBoxHeight, Game.mapSizeZ, mapInfoWidth*scale, mapInfoBoxHeight+(thickness*scale), Game.mapSizeZ) then + local camX, camY, camZ = spGetCameraPosition() + local camDistance = math.diag(camX - (mapInfoWidth/2)*scale, camY - mapInfoBoxHeight, camZ - Game.mapSizeZ) + local opacityMultiplier = (1 - (camDistance-fadeStartHeight) / (fadeEndHeight-fadeStartHeight)) + if opacityMultiplier > 1 then + opacityMultiplier = 1 + end + if opacityMultiplier > 0.05 then + opacityMultiplier = math.floor(opacityMultiplier * dlistAmount)/dlistAmount + + if mapinfoList[opacityMultiplier] == nil then + createMapinfoList(opacityMultiplier) + end + glCallList(mapinfoList[opacityMultiplier]) + end + end +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.stickToFloor = stickToFloor + return savedTable +end + +function widget:SetConfigData(data) + if data.stickToFloor ~= nil then stickToFloor = data.stickToFloor end +end + +function widget:TextCommand(command) + if (string.find(command, "mapinfo_floor") == 1 and string.len(command) == 13) then + stickToFloor = not stickToFloor + Init() + end +end diff --git a/LuaUI/Widgets_Evo/gui_mapmarks_fx.lua b/LuaUI/Widgets_Evo/gui_mapmarks_fx.lua new file mode 100644 index 000000000..5d1d77b45 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_mapmarks_fx.lua @@ -0,0 +1,292 @@ +function widget:GetInfo() + return { + name = "Mapmarks FX", + desc = "Adds glow/rings at map marks", + author = "Floris", + date = "7 june 2015", + license = "GNU GPL, v2 or later", + layer = 2, + enabled = true, + } +end + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local commands = {} +local mapDrawNicknameTime = {} -- this table is used to filter out previous map drawing nicknames if user has drawn something new +local mapEraseNicknameTime = {} + +local ownPlayerID = Spring.GetMyPlayerID() + +-- spring vars +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetTeamColor = Spring.GetTeamColor + +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local nicknameOpacityMultiplier = 6 -- multiplier applied to the given color opacity of the type: 'map_draw' + +local generalSize = 28 -- overall size +local generalOpacity = 0.8 -- overall opacity +local generalDuration = 1.2 -- overall duration + +local ringStartSize = 9 +local ringScale = 0.75 + +local imageDir = ":n:LuaUI/Images/mapmarksfx/" + +local types = { + map_mark = { + size = 3.2, + endSize = 2.25, + duration = 14, + glowColor = {1.00 ,1.00 ,1.00 ,0.20}, + ringColor = {1.00 ,1.00 ,1.00 ,0.75} + }, + map_draw = { + size = 0.75, + endSize = 0.2, + duration = 2, + glowColor = {1.00 ,1.00 ,1.00 ,0.15}, + ringColor = {1.00 ,1.00 ,1.00 ,0.00} + }, + map_erase = { + size = 3.5, + endSize = 0.7, + duration = 4, + glowColor = {1.00 ,1.00 ,1.00 ,0.10}, + ringColor = {1.00 ,1.00 ,1.00 ,0.00} + } +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local commandCount = 0 +local glowDlist + + +local function DrawGroundquad(x,y,z,size) + gl.TexCoord(0,0) + gl.Vertex(x-size,y,z-size) + gl.TexCoord(0,1) + gl.Vertex(x-size,y,z+size) + gl.TexCoord(1,1) + gl.Vertex(x+size,y,z+size) + gl.TexCoord(1,0) + gl.Vertex(x+size,y,z-size) +end + +local function AddEffect(cmdType, x, y, z, osClock, unitID, playerID) + if not playerID then + playerID = false + end + local nickname,_,spec,teamID = spGetPlayerInfo(playerID,false) + local teamcolor = {} + teamcolor[1],teamcolor[2],teamcolor[3] = spGetTeamColor(teamID) + + commandCount = commandCount + 1 + commands[commandCount] = { + cmdType = cmdType, + x = x, + y = y, + z = z, + osClock = osClock, + playerID = playerID, + color = teamcolor, + spec = spec, + nickname = nickname + } +end + + +------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------ + +-- Engine Triggers + +------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------ + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:Initialize() + + glowDlist = glCreateList(function() + gl.Texture(imageDir..'glow.dds') + gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(false) + end) + pencilDlist = glCreateList(function() + gl.Texture(imageDir..'pencil.dds') + gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(false) + end) + eraserDlist = glCreateList(function() + gl.Texture(imageDir..'eraser.dds') + gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(false) + end) + ringDlist = glCreateList(function() + gl.Texture(imageDir..'ring.dds') + gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(false) + end) +end + + +function widget:Shutdown() + glDeleteList(glowDlist) + glDeleteList(pencilDlist) + glDeleteList(eraserDlist) + glDeleteList(ringDlist) + gl.DeleteFont(font) +end + + +function widget:MapDrawCmd(playerID, cmdType, x, y, z, a, b, c) + local osClock = os.clock() + if cmdType == 'point' then + AddEffect('map_mark', x, y, z, osClock, false, playerID) + elseif cmdType == 'line' then + mapDrawNicknameTime[playerID] = osClock + AddEffect('map_draw', x, y, z, osClock, false, playerID) + elseif cmdType == 'erase' then + mapEraseNicknameTime[playerID] = osClock + AddEffect('map_erase', x, y, z, osClock, false, playerID) + end +end + + +function Round(num, idp) + local mult = 10^(idp or 0) + return math.floor(num * mult + 0.5) / mult +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + local osClock = os.clock() + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.DepthTest(false) + gl.PushMatrix() + + local duration, durationProcess, size, a, glowColor, ringColor, aRing, ringSize, iconSize + + for cmdKey, cmdValue in pairs(commands) do + + duration = types[cmdValue.cmdType].duration * generalDuration + durationProcess = (osClock - cmdValue.osClock) / duration + + -- remove when duration has passed + if osClock - cmdValue.osClock > duration then + + commands[cmdKey] = nil + + -- remove nicknames when user has drawn something new + elseif cmdValue.cmdType == 'map_draw' and mapDrawNicknameTime[cmdValue.playerID] ~= nil and cmdValue.osClock < mapDrawNicknameTime[cmdValue.playerID] then + + commands[cmdKey] = nil + + -- draw all + elseif types[cmdValue.cmdType].glowColor[4] > 0 or types[cmdValue.cmdType].ringColor[4] > 0 then + size = generalSize * types[cmdValue.cmdType].size + ((generalSize * types[cmdValue.cmdType].endSize - generalSize * types[cmdValue.cmdType].size) * durationProcess) + a = (1 - durationProcess) * generalOpacity + + if cmdValue.spec then + glowColor = {1,1,1,types[cmdValue.cmdType].glowColor[4]} + ringColor = {1,1,1,types[cmdValue.cmdType].ringColor[4]} + else + glowColor = {cmdValue.color[1],cmdValue.color[2],cmdValue.color[3],types[cmdValue.cmdType].glowColor[4]} + ringColor = {cmdValue.color[1],cmdValue.color[2],cmdValue.color[3],types[cmdValue.cmdType].ringColor[4]} + end + + aRing = a * ringColor[4] + a = a * glowColor[4] + + + gl.Translate(cmdValue.x, cmdValue.y, cmdValue.z) + + -- glow + if glowColor[4] > 0 then + gl.Color(glowColor[1],glowColor[2],glowColor[3],a) + gl.Scale(size*0.8,1,size*0.8) + glCallList(glowDlist) + gl.Scale(1/(size*0.8),1,1/(size*0.8)) + end + -- ring + if aRing > 0 then + gl.Color(ringColor[1],ringColor[2],ringColor[3],aRing) + ringSize = ringStartSize + (size * ringScale) * durationProcess + gl.Scale(ringSize,1,ringSize) + glCallList(ringDlist) + gl.Scale(1/ringSize,1,1/ringSize) + end + + -- draw + erase: nickname / draw icon + if cmdValue.playerID and cmdValue.playerID ~= ownPlayerID and (cmdValue.cmdType == 'map_draw' or cmdValue.cmdType == 'map_erase' and cmdValue.osClock >= mapEraseNicknameTime[cmdValue.playerID]) then + + if (cmdValue.spec) then + iconSize = 11 + gl.Color(glowColor[1],glowColor[2],glowColor[3], a * nicknameOpacityMultiplier) + + if cmdValue.cmdType == 'map_draw' then + gl.Scale(iconSize,1,iconSize) + glCallList(pencilDlist) + gl.Scale(1/iconSize,1,1/iconSize) + else + gl.Scale(iconSize,1,iconSize) + glCallList(eraserDlist) + gl.Scale(1/iconSize,1,1/iconSize) + end + + gl.PushMatrix() + gl.Billboard() + font:Begin() + font:Print(cmdValue.nickname, 0, -28, 20, "cn") + font:End() + gl.PopMatrix() + end + end + + gl.Translate(-cmdValue.x, -cmdValue.y, -cmdValue.z) + end + end + + gl.PopMatrix() + gl.Color(1,1,1,1) +end + diff --git a/LuaUI/Widgets_Evo/gui_messages.lua b/LuaUI/Widgets_Evo/gui_messages.lua new file mode 100644 index 000000000..05578d3ef --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_messages.lua @@ -0,0 +1,527 @@ +function widget:GetInfo() + return { + name = "Messages", + desc = "Typewrites messages at the center-bottom of the screen (missions, tutorials)", + author = "Floris", + date = "September 2019", + license = "GNU GPL, v2 or later", + layer = 30000, + enabled = true + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Widgets can call: WG['messages'].addMessage('message text') +-- Gadgets (unsynced) can call: Script.LuaUI.GadgetAddMessage('message text') +-- plain text (without markup) via: /addmessage message text + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local vsx,vsy = Spring.GetViewGeometry() + +local posY = 0.16 + +local showTestMessages = false + +local charSize = 19.5 - (3.5 * ((vsx/vsy) - 1.78)) +local charDelay = 0.022 +local maxLines = 6 +local maxLinesScroll = 9 +local lineTTL = 14 +local fadeTime = 0.4 +local fadeDelay = 0.25 -- need to hover this long in order to fadein and respond to CTRL +local backgroundOpacity = 0.18 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 38 +local fontfileOutlineSize = 7 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local ui_scale = tonumber(Spring.GetConfigFloat("ui_scale",1) or 1) + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (((vsx+vsy) / 2000) * 0.55) * (1+(ui_scale-1)/1.5) + +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glDeleteList = gl.DeleteList +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glTranslate = gl.Translate +local glColor = gl.Color + +local messageLines = {} +local activationArea = {0,0,0,0} +local activatedHeight = 0 +local currentLine = 0 +local currentTypewriterLine = 0 +local scrolling = false +local lineMaxWidth = 0 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function lines(str) + local t = {} + local function helper(line) t[#t+1] = line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl, c1,c2) + local csyMult = 1 / ((sy-py)/cs) + + if c2 then + gl.Color(c1[1],c1[2],c1[3],c1[4]) + end + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + if c2 then + gl.Color(c2[1],c2[2],c2[3],c2[4]) + end + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + -- left side + if c2 then + gl.Color(c1[1]*(1-csyMult)+(c2[1]*csyMult),c1[2]*(1-csyMult)+(c2[2]*csyMult),c1[3]*(1-csyMult)+(c2[3]*csyMult),c1[4]*(1-csyMult)+(c2[4]*csyMult)) + end + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + if c2 then + gl.Color(c2[1]*(1-csyMult)+(c1[1]*csyMult),c2[2]*(1-csyMult)+(c1[2]*csyMult),c2[3]*(1-csyMult)+(c1[3]*csyMult),c2[4]*(1-csyMult)+(c1[4]*csyMult)) + end + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + -- right side + if c2 then + gl.Color(c1[1]*(1-csyMult)+(c2[1]*csyMult),c1[2]*(1-csyMult)+(c2[2]*csyMult),c1[3]*(1-csyMult)+(c2[3]*csyMult),c1[4]*(1-csyMult)+(c2[4]*csyMult)) + end + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + if c2 then + gl.Color(c2[1]*(1-csyMult)+(c1[1]*csyMult),c2[2]*(1-csyMult)+(c1[2]*csyMult),c2[3]*(1-csyMult)+(c1[3]*csyMult),c2[4]*(1-csyMult)+(c1[4]*csyMult)) + end + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.15 -- texture offset, because else gaps could show + + -- bottom left + if c2 then + gl.Color(c1[1],c1[2],c1[3],c1[4]) + end + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then + gl.Vertex(px, py, 0) + else + gl.Vertex(px+cs, py, 0) + end + gl.Vertex(px+cs, py, 0) + if c2 then + gl.Color(c1[1]*(1-csyMult)+(c2[1]*csyMult),c1[2]*(1-csyMult)+(c2[2]*csyMult),c1[3]*(1-csyMult)+(c2[3]*csyMult),c1[4]*(1-csyMult)+(c2[4]*csyMult)) + end + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px, py+cs, 0) + -- bottom right + if c2 then + gl.Color(c1[1],c1[2],c1[3],c1[4]) + end + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then + gl.Vertex(sx, py, 0) + else + gl.Vertex(sx-cs, py, 0) + end + gl.Vertex(sx-cs, py, 0) + if c2 then + gl.Color(c1[1]*(1-csyMult)+(c2[1]*csyMult),c1[2]*(1-csyMult)+(c2[2]*csyMult),c1[3]*(1-csyMult)+(c2[3]*csyMult),c1[4]*(1-csyMult)+(c2[4]*csyMult)) + end + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx, py+cs, 0) + -- top left + if c2 then + gl.Color(c2[1],c2[2],c2[3],c2[4]) + end + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then + gl.Vertex(px, sy, 0) + else + gl.Vertex(px+cs, sy, 0) + end + gl.Vertex(px+cs, sy, 0) + if c2 then + gl.Color(c2[1]*(1-csyMult)+(c1[1]*csyMult),c2[2]*(1-csyMult)+(c1[2]*csyMult),c2[3]*(1-csyMult)+(c1[3]*csyMult),c2[4]*(1-csyMult)+(c1[4]*csyMult)) + end + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + -- top right + if c2 then + gl.Color(c2[1],c2[2],c2[3],c2[4]) + end + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then + gl.Vertex(sx, sy, 0) + else + gl.Vertex(sx-cs, sy, 0) + end + gl.Vertex(sx-cs, sy, 0) + if c2 then + gl.Color(c2[1]*(1-csyMult)+(c1[1]*csyMult),c2[2]*(1-csyMult)+(c1[2]*csyMult),c2[3]*(1-csyMult)+(c1[3]*csyMult),c2[4]*(1-csyMult)+(c1[4]*csyMult)) + end + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl, c1,c2) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(false) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl, c1,c2) +end + +function IsOnRect(x, y, leftX, bottomY,rightX,TopY) + return x >= leftX and x <= rightX and y >= bottomY and y <= TopY +end + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + lineMaxWidth = lineMaxWidth / widgetScale + widgetScale = (((vsx+vsy) / 2000) * 0.55) * (1+(ui_scale-1)/1.5) + lineMaxWidth = lineMaxWidth * widgetScale + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + for i, _ in ipairs(messageLines) do + if messageLines[i][6] then + glDeleteList(messageLines[i][6]) + messageLines[i][6] = nil + end + end + + activationArea = { + (vsx * 0.31)-(charSize*widgetScale), (vsy * posY)+(charSize*0.15*widgetScale), + (vsx * 0.6), (vsy * (posY+0.077)) + } + lineMaxWidth = math.max(lineMaxWidth, activationArea[3] - activationArea[1]) + activatedHeight = (1+maxLinesScroll)*charSize*1.15*widgetScale +end + +function addMessage(text) + if text then + + -- determine text typing start time + local startTime = os.clock() + if messageLines[#messageLines] then + if startTime < messageLines[#messageLines][1] + messageLines[#messageLines][3]*charDelay then + startTime = messageLines[#messageLines][1] + messageLines[#messageLines][3]*charDelay + else + currentTypewriterLine = currentTypewriterLine + 1 + end + else + currentTypewriterLine = currentTypewriterLine + 1 + end + + -- convert /n into lines + local textLines = lines(text) + + -- word wrap text into lines + local wordwrappedText = {} + local wordwrappedTextCount = 0 + for i, line in ipairs(textLines) do + local words = {} + local wordsCount = 0 + local linebuffer = '' + for w in line:gmatch("%S+") do + wordsCount = wordsCount + 1 + words[wordsCount] = w + end + for wi, word in ipairs(words) do + if font:GetTextWidth(linebuffer..' '..word)*charSize*widgetScale > lineMaxWidth then + wordwrappedTextCount = wordwrappedTextCount + 1 + wordwrappedText[wordwrappedTextCount] = linebuffer + linebuffer = '' + end + if linebuffer == '' then + linebuffer = word + else + linebuffer = linebuffer..' '..word + end + end + if linebuffer ~= '' then + wordwrappedTextCount = wordwrappedTextCount + 1 + wordwrappedText[wordwrappedTextCount] = linebuffer + end + end + local messageLinesCount = #messageLines + for i, line in ipairs(wordwrappedText) do + lineMaxWidth = math.max(lineMaxWidth, font:GetTextWidth(line)*charSize*widgetScale) + messageLinesCount = messageLinesCount + 1 + messageLines[messageLinesCount] = { + startTime, + line, + string.len(line), + 0, -- num typed chars + 0, -- time passed during typing chars (used to calc 'num typed chars') + glCreateList(function() end), + 0 -- num chars the displaylist contains + } + startTime = startTime + (string.len(line)*charDelay) + end + + if currentTypewriterLine > messageLinesCount then + currentTypewriterLine = messageLinesCount + end + if not scrolling then + currentLine = currentTypewriterLine + end + end +end + +function widget:Initialize() + widget:ViewResize(vsx,vsy) + widgetHandler:RegisterGlobal('GadgetAddMessage', addMessage) + WG['messages'] = {} + WG['messages'].addMessage = function(text) + addMessage(text) + end +end + +local sec = 0 +local testmessaged = 0 +local uiSec = 0 +function widget:Update(dt) + uiSec = uiSec + dt + if uiSec > 0.5 then + uiSec = 0 + if ui_scale ~= Spring.GetConfigFloat("ui_scale",1) then + ui_scale = Spring.GetConfigFloat("ui_scale",1) + widget:ViewResize(vsx,vsy) + end + end + + local x,y,b = Spring.GetMouseState() + if WG['topbar'] and WG['topbar'].showingQuit() then + scrolling = false + elseif IsOnRect(x, y, activationArea[1], activationArea[2], activationArea[3], activationArea[4]) then + local alt, ctrl, meta, shift = Spring.GetModKeyState() + if ctrl and startFadeTime and os.clock() > startFadeTime+fadeDelay then + scrolling = true + else + --scrolling = false + end + elseif scrolling and IsOnRect(x, y, activationArea[1], activationArea[2], activationArea[1]+lineMaxWidth+(charSize*2*widgetScale), activationArea[2]+activatedHeight) then + + else + scrolling = false + currentLine = #messageLines + end + + -- delayed test msg + if showTestMessages and not dataRestored and Spring.GetGameFrame() > 30 then + sec = sec + dt + if testmessaged < 1 and sec > 3.5 then + testmessaged = 1 + addMessage("\nStandby we will keep you updated.\nGood luck!") + end + if testmessaged < 2 and sec > 12 then --and Spring.GetGameFrame() < 30*11 then + testmessaged = 2 + addMessage("\n\nEnemies have been detected in your vicinity!\nBetter expand quick.") + end + end + + if messageLines[currentTypewriterLine] ~= nil then + -- continue typewriting line + if messageLines[currentTypewriterLine][4] <= messageLines[currentTypewriterLine][3] then + messageLines[currentTypewriterLine][5] = messageLines[currentTypewriterLine][5] + dt + messageLines[currentTypewriterLine][4] = math.ceil(messageLines[currentTypewriterLine][5]/charDelay) + + -- typewrite next line when complete + if messageLines[currentTypewriterLine][4] >= messageLines[currentTypewriterLine][3] then + currentTypewriterLine = currentTypewriterLine + 1 + if currentTypewriterLine > #messageLines then + currentTypewriterLine = #messageLines + end + end + end + end +end + +function processLine(i) + if messageLines[i][6] == nil or messageLines[i][4] ~= messageLines[i][7] then + messageLines[i][7] = messageLines[i][4] + local text = string.sub(messageLines[i][2], 1, messageLines[i][4]) + glDeleteList(messageLines[i][6]) + messageLines[i][6] = glCreateList(function() + font:Begin() + lineMaxWidth = math.max(lineMaxWidth, font:GetTextWidth(text)*charSize*widgetScale) + font:Print(text, 0, 0, charSize*widgetScale, "o") + font:End() + end) + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not messageLines[1] then return end + + local x,y,b = Spring.GetMouseState() + if IsOnRect(x, y, activationArea[1], activationArea[2], activationArea[3], activationArea[4]) or (scrolling and IsOnRect(x, y, activationArea[1], activationArea[2], activationArea[1]+lineMaxWidth+(charSize*2*widgetScale), activationArea[2]+activatedHeight)) then + hovering = true + if not startFadeTime then + startFadeTime = os.clock() + end + if scrolling then + glColor(0,0,0,backgroundOpacity) + RectRound(activationArea[1], activationArea[2], activationArea[1]+lineMaxWidth+(charSize*2*widgetScale), activationArea[2]+activatedHeight, 6.5*widgetScale) + else + local opacity = ((os.clock() - (startFadeTime+fadeDelay)) / fadeTime) * backgroundOpacity + if opacity > backgroundOpacity then + opacity = backgroundOpacity + end + glColor(0,0,0,opacity) + RectRound(activationArea[1], activationArea[2], activationArea[3], activationArea[4], 6.5*widgetScale) + end + + else + + if hovering then + local opacityPercentage = (os.clock() - (startFadeTime+fadeDelay)) / fadeTime + startFadeTime = os.clock() - math.max((1-opacityPercentage)*fadeTime, 0) + end + hovering = false + if startFadeTime then + local opacity = backgroundOpacity - (((os.clock() - startFadeTime) / fadeTime) * backgroundOpacity) + if opacity > 1 then + opacity = 1 + end + if opacity <= 0 then + startFadeTime = nil + else + glColor(0,0,0,opacity) + RectRound(activationArea[1], activationArea[2], activationArea[3], activationArea[4], 6.5*widgetScale) + end + end + scrolling = false + currentLine = #messageLines + end + + if messageLines[currentLine] then + glPushMatrix() + glTranslate((vsx * 0.31), (vsy * posY), 0) + local displayedLines = 0 + local i = currentLine + local usedMaxLines = maxLines + if scrolling then + usedMaxLines = maxLinesScroll + end + while i > 0 do + glTranslate(0, (charSize*1.15*widgetScale), 0) + if scrolling or os.clock() - messageLines[i][1] < lineTTL then + processLine(i) + glCallList(messageLines[i][6]) + end + displayedLines = displayedLines + 1 + if displayedLines >= usedMaxLines then + break + end + i = i - 1 + end + glPopMatrix() + + -- show newly written line when in scrolling mode + if scrolling and currentLine < #messageLines and os.clock() - messageLines[currentTypewriterLine][1] < lineTTL then + glPushMatrix() + glTranslate((vsx * 0.31), (vsy * (posY-0.02)), 0) + processLine(currentTypewriterLine) + glCallList(messageLines[currentTypewriterLine][6]) + glPopMatrix() + end + + end +end + +function widget:MouseWheel(up, value) + if scrolling then + if up then + currentLine = currentLine - 1 + if currentLine < maxLinesScroll then + currentLine = maxLinesScroll + end + else + currentLine = currentLine + 1 + if currentLine > #messageLines then + currentLine = #messageLines + end + end + return true + else + return false + end +end + +function widget:WorldTooltip(ttType,data1,data2,data3) + local x,y,_ = Spring.GetMouseState() + if #messageLines > 0 and IsOnRect(x, y, activationArea[1],activationArea[2],activationArea[3],activationArea[4]) then + return "Press\255\255\255\001 CTRL \255\255\255\255to activate chatlog viewing/scrolling" + end +end + +function widget:GameStart() + if showTestMessages then + addMessage("\255\230\255\200Commander,\nWe're in a peculiar situation so you have to begin on your own...\nInitiate a base and we'll redirect reinforcements right after...") + end +end + +function widget:GameOver() + --widgetHandler:RemoveWidget(self) +end + +function widget:Shutdown() + WG['messages'] = nil + gl.DeleteFont(font) + for i, _ in ipairs(messageLines) do + if messageLines[i][6] then + glDeleteList(messageLines[i][6]) + messageLines[i][6] = nil + end + end + widgetHandler:DeregisterGlobal('GadgetAddMessage') +end + +function widget:TextCommand(command) + if string.sub(command,1, 11) == "addmessage " then + addMessage(string.sub(command, 11)) + end +end + +function widget:GetConfigData(data) + for i, _ in ipairs(messageLines) do + messageLines[i][6] = nil + end + savedTable = {} + savedTable.messageLines = messageLines + return savedTable +end + +function widget:SetConfigData(data) + if Spring.GetGameFrame() > 0 and data.messageLines ~= nil then + messageLines = data.messageLines + currentLine = #messageLines + currentTypewriterLine = currentLine + dataRestored = true + end +end diff --git a/LuaUI/Widgets_Evo/gui_mission_briefing.lua b/LuaUI/Widgets_Evo/gui_mission_briefing.lua deleted file mode 100644 index af0491ce7..000000000 --- a/LuaUI/Widgets_Evo/gui_mission_briefing.lua +++ /dev/null @@ -1,340 +0,0 @@ - ---[[ -=============== -Specification: ------------------------ -* For missions makers: ------------------------ -Two optional fields in missions startscripts: - MissionTitle = "A short line"; - MissionBriefing = "A lengthy description. May use newlines\n tabs\t and colors, such as \255\255\180\180red, \255\180\255\180green, \255\180\180\255blue, etc..\ndefault is \255\255\255\255white, so only use light colors as the background will likely be dark.\nIn case it's not obvious, to change color, there is first a 255 to indicate color code escape sequence, then the R,V,B values."; -You can have a MissionBriefing without a MissionTitle, in this case ingame it will show the mission filename in place of the title. - ----------------------- -* For GUI Lua coders: ----------------------- -Three modoptions: -"missionscript": Always there when it's a mission. Contain the filename (maybe with path) of the mission. -"missiontitle": Optional. Short string describing the mission. -"missionbriefing": Optional and not available when game starts. Contains a lengthy briefing, with newlines and color codes. - -Have somewhere in your GUI a place to display the mission title. You probably want to prefix it by "Mission: " to make it clearer. When mouse-overing it, expand it to show the briefing as well. Or just present those two info in whatever way you want. Maybe you prefer to use tooltip. Maybe you have a menu in your GUI where it'd fit. But make sure it's in an obvious and easy to access place, so even a newb can read it back in the middle of a game. - -In the future, missions should be allowed to change the title and briefing midgame, to reflect change of objectives. There is no mechanism yet for that, but make sure your GUI will easily allow that. - -Because of the bug with overlong startscript, the ModOptions "missiontitle" and "missionbriefing" maybe not be available immediatly when game starts, you have may to wait some gameframes for Spring.GetModOptions()["missionbriefing"] to eventually return something. - -The missions maker should be allowed to have set a MissionBriefing and no MissionTitle, a MissionTitle and no MissionBriefing, or neither. - -If there's no mission title, then in place of it use the mission filename, which is stored in Spring.GetModOptions()["missionscript"] and which by design will always be there if it's a mission. However, before displaying it, you have to prettify it by: -- Removing everything before (and including) the last / or \ -- Removing the file extension: .sav, .txt, .whatever -- Replace every _ by space -- Redo the capitalisation: Start Each Word With Capital Case. Or maybe just the first. - -If there is no "MissionBriefing", either disable showing the full briefing, or use a default text like "No Briefs. Sorry, you'll have to fight in the bare!" - -If there is no Spring.GetModOptions()["missionscript"], then it's not a mission and the GUI should disable the mission title/briefing display entirely. - -Looks like I told the mission makers to enclose MissionTitle and MissionBriefing in quotes. Make sure to have code to detect and remove extra quotation or double-quotation marks. Had to write an UnQuoteString function. - -Looks like the antislash in modoptions are printed literally. I had to write an EscapeString function to switch them back to their escape sequence roles. - -]]-- - - -function widget:GetInfo() - return { - name = "Mission Briefing", - desc = "Show the mission title and briefing", - author = "zwzsg", - date = "July 23th, 2010", - license = "Public Domain", - version = "1.1", - layer = 0, - enabled = true - } -end - -local function UnQuoteString(str)-- Remove the pairs of " and ' at the extremities of a string - if type(str)=="string" then - repeat - local len=string.len(str) - local last=string.sub(str,len,len) - local first=string.sub(str,1,1) - if first==last and (first=="'" or last=='"') then - str=string.sub(str,2,len-1) - end - until len==string.len(str) - end - return str -end - -local function Capitalize(str)-- Put a capital letter at the beginning of every word - if type(str)=="string" then - return string.gsub(str,"(%w)(%w*)",function(a,b) return string.upper(a) .. b end) - else - return str - end -end - -local function EscapeString(str)-- Put escape sequence back in place of literal antislashes - if type(str)=="string" then - local ListOfEscapes={ - ["a"]="\a", - ["b"]="\b", - ["f"]="\f", - ["n"]="\n", - ["r"]="\r", - ["t"]="\t", - ["v"]="\v", - ["\\"]="\\", - ["\""]="\"", - ["\'"]="\'", - ["["]="[", - } - local zero,nine=string.byte("0"),string.byte("9") - local bin={string.byte(str,1,-1)} - for k=#bin-1,1,-1 do - if bin[k]==string.byte("\\") then - if bin[k+1]>=zero and bin[k+1]<=nine then - if bin[k+2]>=zero and bin[k+2]<=nine then - if bin[k+3]>=zero and bin[k+3]<=nine then - bin[k]=(bin[k+1]-zero)*100+(bin[k+2]-zero)*10+bin[k+3]-zero - table.remove(bin,k+3) - table.remove(bin,k+2) - table.remove(bin,k+1) - else - bin[k]=(bin[k+1]-zero)*10+bin[k+2]-zero - table.remove(bin,k+2) - table.remove(bin,k+1) - end - else - bin[k]=bin[k+1]-zero - table.remove(bin,k+1) - end - else - for pat,tar in pairs(ListOfEscapes) do - if string.byte(pat)==bin[k+1] then - bin[k]=string.byte(tar) - table.remove(bin,k+1) - break - end - end - end - end - end - return string.char(unpack(bin)) - else - return str - end -end - -local function FileNameToPrettyName(n) - if type(n)~="string" then - return nil - else - local e=(string.find(n,".",string.len(n)-4,true) or 1+string.len(n))-1 - local b=1 - repeat - local s=string.find(n,"/",b,true) or string.find(n,"\\",b,true) - b=s and s+1 or b - until not s - return Capitalize(string.gsub(string.sub(n,b,e),"[_]"," ")) - end -end - -local function GetMissionTitle() - return EscapeString(UnQuoteString(Spring.GetModOptions()["missiontitle"])) - or FileNameToPrettyName(Spring.GetModOptions()["missionscript"]) -end - -local function GetMissionBriefing() - return EscapeString(UnQuoteString(Spring.GetModOptions()["missionbriefing"])) -end - -function widget:Initialize() - WG.MissionInfoBox=nil - if not Spring.GetModOptions()["missionscript"] then - widgetHandler:RemoveWidget() - end -end - -function widget:Shutdown() - WG.MissionInfoBox=nil -end - -local function IsAbove() - if WG.MissionInfoBox then - local xMouse,yMouse = Spring.GetMouseState() - if WG.MissionInfoBox.Title and (xMouse > WG.MissionInfoBox.Title.x1 and xMouse < WG.MissionInfoBox.Title.x2 and yMouse > WG.MissionInfoBox.Title.y1 and yMouse < WG.MissionInfoBox.Title.y2) then - return true - elseif WG.MissionInfoBox.Briefing and (xMouse > WG.MissionInfoBox.Briefing.x1 and xMouse < WG.MissionInfoBox.Briefing.x2 and yMouse > WG.MissionInfoBox.Briefing.y1 and yMouse < WG.MissionInfoBox.Briefing.y2) then - return true - else - return false - end - else - return nil - end -end - -local function GetLines(str) - local nttList = {} - local maxWidth = 0 - for line in string.gmatch(str,"[^\r\n]+") do - table.insert(nttList,"\255\255\255\255"..line) - if gl.GetTextWidth(line)>maxWidth then - maxWidth=gl.GetTextWidth(line) - end - end - return nttList,maxWidth -end - -function widget:DrawScreenEffects(vsx,vsy) - - if Spring.IsGUIHidden() then - WG.MissionInfoBox=nil - return - else - WG.MissionInfoBox=WG.MissionInfoBox or {} - end - - local TextWidthFixHack = 1 - if tonumber(string.sub(Game.version,1,4))<=0.785 and string.sub(Game.version,1,5)~="0.78+" then - TextWidthFixHack = (vsx/vsy)*(4/3) - end - - -- First, the mission title: - local FontSize=WG.MissionInfoBox.FontSize or math.max(13,4+vsy/100) - local xSize, ySize = 0, 0 - local lines,maxWidth - if WG.MissionInfoBox.Title and WG.MissionInfoBox.Title.lines then - lines,maxWidth = WG.MissionInfoBox.Title.lines, WG.MissionInfoBox.Title.maxWidth - else - lines,maxWidth = GetLines("\255\182\254\213Mission:\255\255\255\255 "..(GetMissionTitle() or "?")) - end - xSize = FontSize*(1+maxWidth*TextWidthFixHack) - ySize = FontSize*(1+#lines) - - -- Top left position by default - local x1,y1,x2,y2=0,vsy-ySize,xSize,vsy - - local MiniMap={Spring.GetMiniMapGeometry()} - MiniMap={x=MiniMap[1],y=MiniMap[2],sx=MiniMap[3],sy=MiniMap[4],minimized=MiniMap[5],maximized=MiniMap[6]} - - if not MiniMap.maximized then - if MiniMap.sy>vsy*0.75 then -- left/right of minimap - if MiniMap.x+MiniMap.sx/2vsy/2 then -- below minimap - x1 = MiniMap.x - x2 = x1+xSize - y2 = MiniMap.y-4 - y1 = y2-ySize - else -- above minimap - x1 = MiniMap.x - x2 = x1+xSize - y1 = MiniMap.y+MiniMap.sy+3 - y2 = y1+ySize - end - end - end - - -- Saving the position of MissionInfoBox.title - WG.MissionInfoBox.FontSize=FontSize - WG.MissionInfoBox.Title={x1=math.min(x1,x2),y1=math.min(y1,y2),x2=math.max(x1,x2),y2=math.max(y1,y2),xSize=math.abs(x2-x1),ySize=math.abs(y2-y1),lines=lines,maxWidth=maxWidth} - - local r,g,b = 0.4,0.4,0.6 - gl.Blending(GL.SRC_ALPHA,GL.ONE_MINUS_SRC_ALPHA) -- default - gl.Color(r,g,b,0.5) - gl.Rect(x1,y1,x2,y2) - gl.Color(r,g,b,1) - gl.LineWidth(1) - gl.Shape(GL.LINE_LOOP,{ - {v={x1,y2}},{v={x2,y2}}, - {v={x2,y1}},{v={x1,y1}},}) - gl.Color(1,1,1,1) - for k=1,#lines do - gl.Text(lines[k],x1+FontSize/2,y2-FontSize*(0.5+k),FontSize,'od') - end - gl.Text("\255\255\255\255 ",0,0,FontSize,'o') -- Reset color to white for other widgets using gl.Text - gl.Color(r,g,b,0.15) - gl.Rect(x1,y1,x2,y2) - gl.Color(1,1,1,1) - - if IsAbove() then - -- Then, the mission briefing: - xSize, ySize = 0, 0 - if WG.MissionInfoBox.Briefing and WG.MissionInfoBox.Briefing.lines then - lines,maxWidth = WG.MissionInfoBox.Briefing.lines, WG.MissionInfoBox.Briefing.maxWidth - else - WG.MissionInfoBox.Title.lines=nil - lines,maxWidth = GetLines(GetMissionBriefing() or "< No Intel Available >") - end - xSize = FontSize*(1+maxWidth*TextWidthFixHack) - ySize = FontSize*(1+#lines) - - -- Place briefing below title - x1 = WG.MissionInfoBox.Title.x1 - y2 = WG.MissionInfoBox.Title.y1 - x2 = x1+xSize - y1 = y2-ySize - if WG.MissionInfoBox.Title.x2 == MiniMap.x-3 then -- left of minimap - x1 = MiniMap.x-xSize - x2 = x1+xSize - elseif WG.MissionInfoBox.Title.y1 == MiniMap.y+MiniMap.sy+2 then -- above minimap - y1=WG.MissionInfoBox.Title.y2 - y2=y1+ySize - end - - -- Saving the position of MissionInfoBox.briefing - WG.MissionInfoBox.Briefing={x1=math.min(x1,x2),y1=math.min(y1,y2),x2=math.max(x1,x2),y2=math.max(y1,y2),xSize=math.abs(x2-x1),ySize=math.abs(y2-y1),lines=lines,maxWidth=maxWidth} - - local r,g,b = 0.76,0.9,0.6 - gl.Blending(GL.SRC_ALPHA,GL.ONE_MINUS_SRC_ALPHA) -- default - gl.Color(r,g,b,0.5) - gl.Rect(x1,y1,x2,y2) - gl.Color(r,g,b,1) - gl.LineWidth(1) - gl.Shape(GL.LINE_LOOP,{ - {v={x1,y2}},{v={x2,y2}}, - {v={x2,y1}},{v={x1,y1}},}) - gl.Color(1,1,1,1) - for k=1,#lines do - gl.Text(lines[k],x1+FontSize/2,y2-FontSize*(0.5+k),FontSize,'od') - end - gl.Text("\255\255\255\255 ",0,0,FontSize,'od') -- Reset color to white for other widgets using gl.Text - gl.Color(r,g,b,0.15) - gl.Rect(x1,y1,x2,y2) - gl.Color(1,1,1,1) - else - WG.MissionInfoBox.Briefing=nil - end - -end - -function widget:MouseWheel(up,value) - if IsAbove() then - if up then - WG.MissionInfoBox.FontSize = math.max(WG.MissionInfoBox.FontSize - 1,2) - else - WG.MissionInfoBox.FontSize = WG.MissionInfoBox.FontSize + 1 - end - return true - end - return false -end - - - diff --git a/LuaUI/Widgets_Evo/gui_mouse_fx.lua b/LuaUI/Widgets_Evo/gui_mouse_fx.lua new file mode 100644 index 000000000..aac1be7ad --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_mouse_fx.lua @@ -0,0 +1,242 @@ +function widget:GetInfo() + return { + name = "Mouse FX", + desc = "Adds glow effect at mouse clicks", + author = "Floris", + date = "13 may 2015", + license = "GNU GPL, v2 or later", + layer = 2, + enabled = true, + } +end + + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local commands = {} +local mapDrawNicknameTime = {} -- this table is used to filter out previous map drawing nicknames if user has drawn something new +local mapEraseNicknameTime = {} + +local ownPlayerID = Spring.GetMyPlayerID() + +-- spring vars +local spGetCameraPosition = Spring.GetCameraPosition +local spGetPlayerInfo = Spring.GetPlayerInfo +local spTraceScreenRay = Spring.TraceScreenRay +local spLoadCmdColorsConfig = Spring.LoadCmdColorsConfig +local spGetTeamColor = Spring.GetTeamColor +local spGetMouseState = Spring.GetMouseState + +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local diag = math.diag + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local nicknameOpacityMultiplier = 6 -- multiplier applied to the given color opacity of the type: 'map_draw' +local scaleWithCamera = true +local showMouseclicks = true + +local generalSize = 30 -- overall size +local generalOpacity = 0.8 -- overall opacity +local generalDuration = 1.2 -- overall duration + +local imageDir = ":n:LuaUI/Images/" + +local types = { + leftclick = { + size = 0.82, + endSize = 0.25, + duration = 0.85, + baseColor = {0.66 ,1 ,0.15 ,0.5} + }, + rightclick = { + size = 0.82, + endSize = 0.25, + duration = 0.85, + baseColor = {1.00 ,0.85 ,0.15 ,0.55} + }, + leftclick2 = { + size = 1.33, + endSize = 0.82, + duration = 1.65, + baseColor = {0.7 ,1 ,0.15 ,0.18} + }, + rightclick2 = { + size = 1.33, + endSize = 0.82, + duration = 1.65, + baseColor = {1.00 ,0.85 ,0.15 ,0.20} + } +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local commandCount = 0 +local partCache = {} +local mouseButton = false +local baseDlist + + +local function DrawGroundquad(x,y,z,size) + gl.TexCoord(0,0) + gl.Vertex(x-size,y,z-size) + gl.TexCoord(0,1) + gl.Vertex(x-size,y,z+size) + gl.TexCoord(1,1) + gl.Vertex(x+size,y,z+size) + gl.TexCoord(1,0) + gl.Vertex(x+size,y,z-size) +end + + +local function AddCommandSpotter(cmdType, x, y, z, osClock) + commandCount = commandCount + 1 + commands[commandCount] = { + cmdType = cmdType, + x = x, + y = y, + z = z, + osClock = osClock + } +end + + +------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------ + +-- Engine Triggers + +------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------ + + +function widget:Initialize() + + baseDlist = glCreateList(function() + gl.Texture(imageDir..'glow.dds') + gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,1) + gl.Texture(false) + end) +end + + +function widget:Shutdown() + + glDeleteList(baseDlist) +end + + +function widget:MousePress(x, y, button) + if button == 1 then + mouseButton = button + end + local traceType, tracedScreenRay = spTraceScreenRay(x, y, true) + if button == 3 and tracedScreenRay and tracedScreenRay[3] then + AddCommandSpotter('rightclick', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + AddCommandSpotter('rightclick2', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + end +end + + +function mouseRelease(x, y, button) + if showMouseclicks then + local traceType, tracedScreenRay = spTraceScreenRay(x, y, true) + if button == 1 and tracedScreenRay and tracedScreenRay[3] then + AddCommandSpotter('leftclick', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + AddCommandSpotter('leftclick2', tracedScreenRay[1], tracedScreenRay[2], tracedScreenRay[3], os.clock()) + end + end +end + +function widget:Update() + if mouseButton ~= false then + local x,y,m1,m2,m3 = spGetMouseState() + if m1 == false and m3 == false then + mouseRelease(x,y, mouseButton) + mouseButton = false + end + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + + local osClock = os.clock() + local camX, camY, camZ = spGetCameraPosition() + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + --gl.Blending(GL.SRC_ALPHA, GL.ONE) + gl.DepthTest(false) + gl.PushMatrix() + + for cmdKey, cmdValue in pairs(commands) do + + local duration = types[cmdValue.cmdType].duration * generalDuration + local durationProcess = (osClock - cmdValue.osClock) / duration + + -- remove when duration has passed + if osClock - cmdValue.osClock > duration then + commands[cmdKey] = nil + + -- remove nicknames when user has drawn something new + elseif cmdValue.cmdType == 'map_draw' and mapDrawNicknameTime[cmdValue.playerID] ~= nil and cmdValue.osClock < mapDrawNicknameTime[cmdValue.playerID] then + + commands[cmdKey] = nil + + -- draw all + elseif types[cmdValue.cmdType].baseColor[4] > 0 then + local size = generalSize * types[cmdValue.cmdType].size + ((generalSize * types[cmdValue.cmdType].endSize - generalSize * types[cmdValue.cmdType].size) * durationProcess) + --local size = generalSize * types[cmdValue.cmdType].size + local a = (1 - durationProcess) * generalOpacity + + local baseColor = types[cmdValue.cmdType].baseColor + + a = a * baseColor[4] + + gl.Translate(cmdValue.x, cmdValue.y, cmdValue.z) + + local camDistance = diag(camX-cmdValue.x, camY-cmdValue.y, camZ-cmdValue.z) + + -- set scale (based on camera distance) + local scale = 1 + if scaleWithCamera and camZ then + scale = 0.82 + camDistance / 20000 + gl.Scale(scale,scale,scale) + end + + -- base glow + if baseColor[4] > 0 then + gl.Color(baseColor[1],baseColor[2],baseColor[3],a) + gl.Scale(size,1,size) + glCallList(baseDlist) + gl.Scale(1/size,1,1/size) + --gl.Texture(imageDir..'glow.dds') + --gl.BeginEnd(GL.QUADS,DrawGroundquad,0,0,0,size) + --gl.Texture(false) + end + if scaleWithCamera and camZ then + gl.Scale(1/scale,1/scale,1/scale) + end + gl.Translate(-cmdValue.x, -cmdValue.y, -cmdValue.z) + + end + end + + gl.PopMatrix() + gl.Scale(1,1,1) + gl.Color(1,1,1,1) +end + diff --git a/LuaUI/Widgets_Evo/gui_musicPlayer_Dynamic_Advanced.lua b/LuaUI/Widgets_Evo/gui_musicPlayer_Dynamic_Advanced.lua new file mode 100644 index 000000000..40dbaf92f --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_musicPlayer_Dynamic_Advanced.lua @@ -0,0 +1,851 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_musicPlayer.lua +-- brief: yay music +-- author: cake +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +math.randomseed( os.time() - os.clock() * 1000 ) +math.random() math.random() math.random() + +function widget:GetInfo() + return { + name = "Music Player - Dynamic Advanced", + desc = "Plays music and offers volume controls with dynamic swells and fades based upon what is happening in the game.", + author = "Forboding Angel, Floris, Damgam", + date = "november 2016", + license = "GNU GPL, v2 or later", + layer = -4, + enabled = true -- loaded by default? + } +end + +local pauseWhenPaused = false + + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 36 +local fontfileOutlineSize = 8.5 +local fontfileOutlineStrength = 1.33 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) + +local guishaderEnabled = (WG['guishader']) + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Unfucked volumes finally. Instead of setting the volume in Spring.PlaySoundStream. you need to call Spring.PlaySoundStream and then immediately call Spring.SetSoundStreamVolume +-- This widget desperately needs to be reorganized + +local buttons = {} + +local previousTrack = '' +local curTrack = "no name" + +local peaceTracks = VFS.DirList('luaui/Widgets_Evo/Music/peace', '*.ogg') +local warTracks = VFS.DirList('luaui/Widgets_Evo/Music/war', '*.ogg') +local warCutTracks = VFS.DirList('luaui/Widgets_Evo/Music/warcut', '*.ogg') +local silenceTracks = VFS.DirList('luaui/Widgets_Evo/Music/silence', '*.ogg') +local loadingTracks = VFS.DirList('luaui/Widgets_Evo/Music/loading', '*.ogg') + + +--We check to make sure that we can function properly without crashing due to missing music tracks +local next = next +if next(peaceTracks) == nil then + Spring.Echo("[Music Player] No Peace tracks were found (you must have at least 2)! Add some and try again!") + return false +end + +if next(warTracks) == nil then + Spring.Echo("[Music Player] No War tracks were found (you must have at least 2)! Add some and try again!") + return false +end + +if next(warCutTracks) == nil then + warCutTracks = warTracks +end + +--local tracks = peaceTracks +local tracks = loadingTracks + +local firstTime = false +local wasPaused = false +local firstFade = true +local gameOver = false +local playing = true + +local playedTime, totalTime = Spring.GetSoundStreamTime() +local playTex = ":n:"..LUAUI_DIRNAME.."Images/music/play.png" +local pauseTex = ":n:"..LUAUI_DIRNAME.."Images/music/pause.png" +local nextTex = ":n:"..LUAUI_DIRNAME.."Images/music/next.png" +local musicTex = ":n:"..LUAUI_DIRNAME.."Images/music/music.png" +local volumeTex = ":n:"..LUAUI_DIRNAME.."Images/music/volume.png" +local buttonTex = ":n:"..LUAUI_DIRNAME.."Images/button.dds" +local buttonHighlightTex = ":n:"..LUAUI_DIRNAME.."Images/button-highlight.dds" +local bgcorner = ":n:"..LUAUI_DIRNAME.."Images/bgcorner.png" + +local widgetScale = 1 +local glBlending = gl.Blending +local glScale = gl.Scale +local glRotate = gl.Rotate +local glTranslate = gl.Translate +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glColor = gl.Color +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glTexture = gl.Texture +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local drawlist = {} +local advplayerlistPos = {} +local widgetHeight = 23 +local top, left, bottom, right = 0,0,0,0 +local borderPadding = 5 + +local shown = false +local mouseover = false +local volume + +local warMeter = 0 +local buildMeter = false +local buildTimer = 0 +local fadelvl = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 or 0.2 +local fadeOut = false +local fadeIn = false +local endFade = false +local maxWarMeter = 1500 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + + MyTeamID = Spring.GetMyTeamID() + + volume = Spring.GetConfigInt("snd_volmaster", 100) + music_volume_set = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 + music_volume_target = music_volume_set + + musicInitialValue = Spring.GetConfigInt("evo_musicInitialValue", 0) + if musicInitialValue ~= 1 then + Spring.SetConfigInt("snd_volmusic", 20) + Spring.SetConfigInt("evo_musicInitialValue", 1) + end + + music_volume = Spring.GetConfigInt("snd_volmusic", 20) + + if #tracks == 0 then + Spring.Echo("[Music Player] No music was found, Shutting Down") + widgetHandler:RemoveWidget() + end + + updatePosition() + + WG['music'] = {} + WG['music'].GetPosition = function() + return {top,left,bottom,right,widgetScale} + end +end + + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +local function createList() + + local padding = 3*widgetScale -- button background margin + local padding2 = 2.5*widgetScale -- inner icon padding + local volumeWidth = 50*widgetScale + + buttons['playpause'] = {left+padding, bottom+padding, left+(widgetHeight*widgetScale)-padding, top-padding} + + buttons['next'] = {buttons['playpause'][3]+padding, bottom+padding, buttons['playpause'][3]+((widgetHeight*widgetScale)-padding), top-padding} + + buttons['musicvolumeicon'] = {buttons['next'][3]+padding+padding, bottom+padding, buttons['next'][3]+((widgetHeight*widgetScale)), top-padding} + buttons['musicvolume'] = {buttons['musicvolumeicon'][3]+padding, bottom+padding, buttons['musicvolumeicon'][3]+padding+volumeWidth, top-padding} + buttons['musicvolume'][5] = buttons['musicvolume'][1] + (buttons['musicvolume'][3] - buttons['musicvolume'][1]) * (music_volume/100) + + buttons['volumeicon'] = {buttons['musicvolume'][3]+padding+padding+padding, bottom+padding, buttons['musicvolume'][3]+((widgetHeight*widgetScale)), top-padding} + buttons['volume'] = {buttons['volumeicon'][3]+padding, bottom+padding, buttons['volumeicon'][3]+padding+volumeWidth, top-padding} + buttons['volume'][5] = buttons['volume'][1] + (buttons['volume'][3] - buttons['volume'][1]) * (volume/100) + + local textsize = 11*widgetScale + local textYPadding = 8*widgetScale + local textXPadding = 7*widgetScale + local maxTextWidth = right-buttons['next'][3]-textXPadding-textXPadding + + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + glDeleteList(drawlist[2]) + glDeleteList(drawlist[3]) + end + if (WG['guishader'] ~= nil) then + WG['guishader'].InsertRect(left, bottom, right, top,'music') + end + drawlist[1] = glCreateList( function() + glColor(0, 0, 0, ui_opacity) + RectRound(left, bottom, right, top, 5.5*widgetScale) + + borderPadding = 3*widgetScale + borderPaddingRight = borderPadding + if right >= vsx-0.2 then + borderPaddingRight = 0 + end + borderPaddingLeft = borderPadding + if left <= 0.2 then + borderPaddingLeft = 0 + end + glColor(1,1,1,ui_opacity*0.055) + RectRound(left+borderPaddingLeft, bottom+borderPadding, right-borderPaddingRight, top-borderPadding, borderPadding*1.66) + end) + drawlist[2] = glCreateList( function() + + local button = 'playpause' + glColor(1,1,1,0.7) + glTexture(buttonTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + glColor(1,1,1,0.4) + if playing then + glTexture(pauseTex) + else + glTexture(playTex) + end + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'next' + glColor(1,1,1,0.7) + glTexture(buttonTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + glColor(1,1,1,0.4) + glTexture(nextTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + end) + drawlist[3] = glCreateList( function() + + -- track name + glColor(0.45,0.45,0.45,1) + + local trackname = string.gsub(curTrack, ".ogg", "") + local text = '' + --local charactersToCut = GetPathLenght() + charactersInPath = 23 + if tracks and tracks == peaceTracks then + charactersInPath = charactersInPath + 8 + elseif tracks and tracks == warTracks then + charactersInPath = charactersInPath + 6 + elseif tracks and tracks == warCutTracks then + charactersInPath = charactersInPath + 9 + elseif tracks and tracks == silenceTracks then + charactersInPath = 999 + elseif tracks and tracks == loadingTracks then + charactersInPath = charactersInPath + 10 + end + for i=charactersInPath, #trackname do + local c = string.sub(trackname, i,i) + local width = font:GetTextWidth(text..c)*textsize + if width > maxTextWidth then + break + else + text = text..c + end + end + font:Begin() + font:Print('\255\255\255\135'..text, buttons['next'][3]+textXPadding, bottom+textYPadding, textsize, 'no') + font:End() + + end) + drawlist[4] = glCreateList( function() + + ---glColor(0,0,0,0.5) + --RectRound(left, bottom, right, top, 5.5*widgetScale) + + local sliderWidth = 3.3*widgetScale + local sliderHeight = 3.3*widgetScale + local lineHeight = 0.8*widgetScale + local lineOutlineSize = 0.85*widgetScale + + button = 'musicvolumeicon' + local sliderY = buttons[button][2] + (buttons[button][4] - buttons[button][2])/2 + glColor(0.66,0.66,0.66,1) + glTexture(musicTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'musicvolume' + glColor(0,0,0,0.12) + RectRound(buttons[button][1]-lineOutlineSize, sliderY-lineHeight-lineOutlineSize, buttons[button][3]+lineOutlineSize, sliderY+lineHeight+lineOutlineSize, (lineHeight/2.2)*widgetScale) + glColor(0.45,0.45,0.45,1) + RectRound(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight, (lineHeight/2.2)*widgetScale) + glColor(0,0,0,0.12) + RectRound(buttons[button][5]-sliderWidth-lineOutlineSize, sliderY-sliderHeight-lineOutlineSize, buttons[button][5]+sliderWidth+lineOutlineSize, sliderY+sliderHeight+lineOutlineSize, (sliderWidth/4)*widgetScale) + glColor(0.66,0.66,0.66,1) + RectRound(buttons[button][5]-sliderWidth, sliderY-sliderHeight, buttons[button][5]+sliderWidth, sliderY+sliderHeight, (sliderWidth/4)*widgetScale) + + + button = 'volumeicon' + glColor(0.66,0.66,0.66,1) + glTexture(volumeTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'volume' + glColor(0,0,0,0.12) + RectRound(buttons[button][1]-lineOutlineSize, sliderY-lineHeight-lineOutlineSize, buttons[button][3]+lineOutlineSize, sliderY+lineHeight+lineOutlineSize, (lineHeight/2.2)*widgetScale) + glColor(0.45,0.45,0.45,1) + RectRound(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight, (lineHeight/2.2)*widgetScale) + glColor(0,0,0,0.12) + RectRound(buttons[button][5]-sliderWidth-lineOutlineSize, sliderY-sliderHeight-lineOutlineSize, buttons[button][5]+sliderWidth+lineOutlineSize, sliderY+sliderHeight+lineOutlineSize, (sliderWidth/4)*widgetScale) + glColor(0.66,0.66,0.66,1) + RectRound(buttons[button][5]-sliderWidth, sliderY-sliderHeight, buttons[button][5]+sliderWidth, sliderY+sliderHeight, (sliderWidth/4)*widgetScale) + + end) +end + +function getSliderValue(draggingSlider, x) + local sliderWidth = buttons[draggingSlider][3] - buttons[draggingSlider][1] + local value = (x - buttons[draggingSlider][1]) / (sliderWidth) + if value < 0 then value = 0 end + if value > 1 then value = 1 end + return value +end + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + + +function widget:MouseMove(x, y) + if draggingSlider ~= nil then + if draggingSlider == 'musicvolume' then + changeMusicVolume(getSliderValue('musicvolume', x) * 100) + fadelvl = getSliderValue('musicvolume', x) + --Spring.Echo("Music volume set to: " .. (getSliderValue('musicvolume', x) * 100)) + end + if draggingSlider == 'volume' then + changeVolume(getSliderValue('volume', x) * 100) + --Spring.Echo("Global volume set to: " .. changeVolume(getSliderValue('volume', x) * 100)) + end + end +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + +function changeMusicVolume(value) + music_volume = value + Spring.SetConfigInt("snd_volmusic", music_volume) + createList() +end + +function changeVolume(value) + volume = value + Spring.SetConfigInt("snd_volmaster", volume) + createList() +end + +function mouseEvent(x, y, button, release) + if Spring.IsGUIHidden() then return false end + + if not release then + local sliderWidth = (3.3*widgetScale) -- should be same as in createlist() + local button = 'musicvolume' + if isInBox(x, y, {buttons[button][1]-sliderWidth, buttons[button][2], buttons[button][3]+sliderWidth, buttons[button][4]}) then + draggingSlider = button + changeMusicVolume(getSliderValue(button, x) * 100) + end + button = 'volume' + if isInBox(x, y, {buttons[button][1]-sliderWidth, buttons[button][2], buttons[button][3]+sliderWidth, buttons[button][4]}) then + draggingSlider = button + changeVolume(getSliderValue(button, x) * 100) + end + end + if release and draggingSlider ~= nil then + draggingSlider = nil + end + if button == 1 and not release and isInBox(x, y, {left, bottom, right, top}) then + if button == 1 and buttons['playpause'] ~= nil and isInBox(x, y, {buttons['playpause'][1], buttons['playpause'][2], buttons['playpause'][3], buttons['playpause'][4]}) then + playing = not playing + Spring.PauseSoundStream() + createList() + return true + end + if button == 1 and buttons['next'] ~= nil and isInBox(x, y, {buttons['next'][1], buttons['next'][2], buttons['next'][3], buttons['next'][4]}) then + fadeIn = false + fadeOut = false + PlayNewTrack() + return true + end + return true + end + +end + +function widget:IsAbove(mx, my) + if isInBox(mx, my, {left, bottom, right, top}) then + local curVolume = Spring.GetConfigInt("snd_volmaster", 100) + if volume ~= curVolume then + volume = curVolume + createList() + end + mouseover = true + end + return mouseover +end + +function widget:GetTooltip(mx, my) + if widget:IsAbove(mx,my) then + return string.format("Music info and controls") + end +end + +function widget:Shutdown() + Spring.StopSoundStream() + + if (WG['guishader'] ~= nil) then + WG['guishader'].RemoveRect('music') + end + + for i=1,#drawlist do + glDeleteList(drawlist[i]) + end + WG['music'] = nil + gl.DeleteFont(font) +end + +function widget:UnitDamaged() + warMeter = maxWarMeter + if warMeter > maxWarMeter then + warMeter = maxWarMeter + end +end + + +function widget:GameFrame(n) + --Spring.Echo([[Warmeter: ]] ..warMeter) + --This is a little messy, but we need to be able to update these values on the fly so I see no better way + if n%120 == 0 and tracks ~= loadingTracks then + music_volume_set = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 + music_volume_target = music_volume_set + end + if music_volume_set > 0.02 then + + prevfadelvl = fadelvl + --VolumeTargets + if tracks == warTracks or tracks == warCutTracks then + local playedTime, totalTime = Spring.GetSoundStreamTime() + if fadelvl and fadelvl < music_volume_set*0.4 and playedTime > 10 then + music_volume_target = 0 + elseif warMeter > 0 then + music_volume_target = music_volume_set + else + music_volume_target = 0 + end + elseif tracks == peaceTracks then + if warMeter > 0 or buildTimer <= 0 then + music_volume_target = 0 + else + music_volume_target = music_volume_set + end + elseif gameOver then + music_volume_target = music_volume_set + elseif tracks == loadingTracks then + music_volume_target = 0 + end + + --BuildMeter + local mc, ms, mp, mi, me = Spring.GetTeamResources(MyTeamID, "metal") + + if me and me > 1 then + buildMeter = true + else + buildMeter = false + end + + if buildMeter == false then + if buildTimer > 0 then + buildTimer = buildTimer - 1 + end + elseif buildMeter == true then + buildTimer = 450 + end + --Spring.Echo("BuildMeter: " .. buildMeter) + + --WarMeter + if warMeter <= 0 then + warMeter = 0 + elseif warMeter >= 0 then + warMeter = warMeter - 1 + end + + --80's fadeout when a track is almost finished + local playedTime, totalTime = Spring.GetSoundStreamTime() + playedTime = math.floor(playedTime) + totalTime = math.floor(totalTime) + + if totalTime ~= nil then + --Spring.Echo("Total time is :" .. playedTime .."/".. totalTime) + if playedTime >= totalTime - 2 then + --Spring.Echo("Fading out now!") + if Spring.GetGameFrame() >= 1 then + endFade = true + + end + if Spring.GetGameFrame() == 0 then + PlayNewTrack() + end + end + end + + --This has become the preferred handler of playing new tracks instead of calling the PlayNewTrack() function, set fadeOut = true + + --endfade + if endFade == true then + warMeter = 0 + fadelvl = fadelvl - 0.01 + Spring.SetSoundStreamVolume(fadelvl) + end + + --volumecontrol + if endFade == false then + if fadelvl < 0 then + fadelvl = 0 + end + if fadelvl < music_volume_target then + if tracks == peaceTracks then + fadelvl = fadelvl + 0.001 + elseif playedTime < 5 then + fadelvl = fadelvl + 0.03 + else + fadelvl = fadelvl + 0.003 + end + Spring.SetSoundStreamVolume(fadelvl) + end + if fadelvl > music_volume_target then + if tracks == peaceTracks and warMeter > 0 then + fadelvl = fadelvl - 0.01 + else + fadelvl = fadelvl - 0.001 + end + Spring.SetSoundStreamVolume(fadelvl) + end + end + + --playnewtrack + if fadelvl <= 0 then + PlayNewTrack() + end + + if tracks == silenceTracks then + if warMeter > 0 or buildTimer > 0 then + PlayNewTrack() + end + end + + if gameOver and tracks ~= loadingTracks then + PlayNewTrack() + end + end +end + +function PlayNewTrack() + local oldPlayedTime, oldTotalTime = Spring.GetSoundStreamTime() + Spring.StopSoundStream() + endFade = false + fadelvl = 0.02 + if warMeter < 100 then + warMeter = 0 + else + warMeter = 200 + end + + --Spring.Echo("Unit Death Count is (Gameframe): " .. warMeter) + if gameOver then + tracks = loadingTracks + fadelvl = music_volume_set + warMeter = 0 + buildTimer = 450 + elseif Spring.GetGameFrame() == 0 then + tracks = peaceTracks + fadelvl = music_volume_set + elseif warMeter <= 0 then + if buildTimer > 10 then + tracks = peaceTracks + --Spring.Echo("Current tracklist is : Peace Tracks") + else + tracks = silenceTracks + --Spring.Echo("Current tracklist is : Silence Tracks") + end + else + if tracks == peaceTracks or tracks == silenceTracks then + local r = math.random(0,4) + if r ~= 0 and oldPlayedTime > 10 then + tracks = warCutTracks + --Spring.Echo("Current tracklist is : WarCut Tracks") + else + tracks = warTracks + --Spring.Echo("Current tracklist is : War Tracks") + end + + else + tracks = warTracks + --Spring.Echo("Current tracklist is : War Tracks") + end + end + local newTrack = previousTrack + repeat + newTrack = tracks[math.random(1, #tracks)] + until newTrack ~= previousTrack + firstFade = false + previousTrack = newTrack + curTrack = newTrack + Spring.PlaySoundStream(newTrack) + Spring.SetSoundStreamVolume(fadelvl or 0.5) + if playing == false then + Spring.PauseSoundStream() + end + createList() +end + +local uiOpacitySec = 0 +function widget:Update(dt) + if gameOver then + return + end + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) or guishaderEnabled ~= (WG['guishader']) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + guishaderEnabled = (WG['guishader']) + createList() + end + end + local playedTime, totalTime = Spring.GetSoundStreamTime() + playedTime = math.floor(playedTime) + totalTime = math.floor(totalTime) + if music_volume_set > 0.02 then + if (not firstTime) then + if Spring.GetGameFrame() >= 1 then + fadelvl = 0.02 + end + --if Spring.GetGameFrame() == 0 then + --PlayNewTrack() + --end + firstTime = true -- pop this cherry + end + + if playedTime >= totalTime then -- both zero means track stopped in 8 + if Spring.GetGameFrame() >= 1 then + fadelvl = 0 + end + if Spring.GetGameFrame() == 0 then + PlayNewTrack() + end + if gameOver then + PlayNewTrack() + end + end + + if (pauseWhenPaused and Spring.GetGameSeconds()>=0) then + local _, _, paused = Spring.GetGameSpeed() + if (paused ~= wasPaused) then + Spring.PauseSoundStream() + wasPaused = paused + end + end + elseif playedTime > 0 and totalTime > 0 then + Spring.StopSoundStream() + end +end + +function updatePosition(force) + if (WG['advplayerlist_api'] ~= nil) then + local prevPos = advplayerlistPos + advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + + left = advplayerlistPos[2] + bottom = advplayerlistPos[1] + right = advplayerlistPos[4] + top = advplayerlistPos[1]+(widgetHeight*advplayerlistPos[5]) + widgetScale = advplayerlistPos[5] + + if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then + createList() + end + end +end + +function widget:ViewResize(newX,newY) + vsx, vsy = newX, newY + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + updatePosition() + if drawlist[1] ~= nil then + glPushMatrix() + glCallList(drawlist[1]) + glCallList(drawlist[2]) + local mx, my, mlb = Spring.GetMouseState() + if not mouseover and not draggingSlider or isInBox(mx, my, {buttons['playpause'][1], buttons['next'][2], buttons['next'][3], buttons['next'][4]}) then + glCallList(drawlist[3]) + else + glCallList(drawlist[4]) + end + if mouseover then + + -- display play progress + local progressPx = ((right-left)*(playedTime/totalTime)) + if progressPx > 1 then + if progressPx < borderPadding*5 then + progressPx = borderPadding*5 + end + glColor(1,1,1,ui_opacity*0.09) + RectRound(left+borderPaddingLeft, bottom+borderPadding, left-borderPaddingRight+progressPx , top-borderPadding, borderPadding*1.66) + end + + local color = {1,1,1,0.25} + local colorHighlight = {1,1,1,0.33} + local button = 'playpause' + if buttons[button] ~= nil and isInBox(mx, my, {buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]}) then + if mlb then + glColor(colorHighlight) + else + glColor(color) + end + glTexture(buttonHighlightTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + end + button = 'next' + if buttons[button] ~= nil and isInBox(mx, my, {buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]}) then + if mlb then + glColor(colorHighlight) + else + glColor(color) + end + glTexture(buttonHighlightTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + end + end + glPopMatrix() + mouseover = false + end +end + +function widget:GetConfigData(data) + --local playedTime, totalTime = Spring.GetSoundStreamTime() + local savedTable = {} + --savedTable.curTrack = curTrack + --savedTable.playedTime = playedTime + savedTable.playing = playing + return savedTable +end + +-- would be great if there is be a way to continue track where we left off after a /luaui reload +function widget:SetConfigData(data) + if data.playing ~= nil then + playing = data.playing + end +end + +function widget.GameOver() + gameOver = true +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_musicPlayer_Traditional.lua b/LuaUI/Widgets_Evo/gui_musicPlayer_Traditional.lua new file mode 100644 index 000000000..a779c4782 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_musicPlayer_Traditional.lua @@ -0,0 +1,687 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_musicPlayer_traditional.lua +-- brief: yay music +-- author: cake +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Music Player (Traditional)", + desc = "Plays music and offers volume controls", + author = "Forboding Angel, Floris, Damgam", + date = "november 2016", + license = "GNU GPL, v2 or later", + layer = -4, + enabled = false -- loaded by default? + } +end + +local pauseWhenPaused = false + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Unfucked volumes finally. Instead of setting the volume in Spring.PlaySoundStream. you need to call Spring.PlaySoundStream and then immediately call Spring.SetSoundStreamVolume +-- This widget desperately needs to be reorganized + +local buttons = {} + +local previousTrack = '' +local curTrack = "no name" + +local peaceTracks = VFS.DirList('luaui/Widgets_Evo/music/peace', '*.ogg') +local warTracks = VFS.DirList('luaui/Widgets_Evo/music/war', '*.ogg') + +--We check to make sure that we can function properly without crashing due to missing music tracks +local next = next +if next(peaceTracks) == nil then + Spring.Echo("[Music Player] No Peace tracks were found (you must have at least 2)! Add some and try again!") + return false +end + +if next(warTracks) == nil then + Spring.Echo("[Music Player] No War tracks were found (you must have at least 2)! Add some and try again!") + return false +end + +local tracks = peaceTracks + +local charactersInPath = 24 + +local firstTime = false +local wasPaused = false +local firstFade = true +local gameOver = false +local playing = true + +local vsx, vsy = widgetHandler:GetViewSizes() + +local playTex = ":n:"..LUAUI_DIRNAME.."Images/music/play.png" +local pauseTex = ":n:"..LUAUI_DIRNAME.."Images/music/pause.png" +local nextTex = ":n:"..LUAUI_DIRNAME.."Images/music/next.png" +local musicTex = ":n:"..LUAUI_DIRNAME.."Images/music/music.png" +local volumeTex = ":n:"..LUAUI_DIRNAME.."Images/music/volume.png" +local buttonTex = ":n:"..LUAUI_DIRNAME.."Images/button.dds" +local buttonHighlightTex = ":n:"..LUAUI_DIRNAME.."Images/button-highlight.dds" +local bgcorner = ":n:"..LUAUI_DIRNAME.."Images/bgcorner.png" + +local widgetScale = 1 +local glText = gl.Text +local glGetTextWidth = gl.GetTextWidth +local glBlending = gl.Blending +local glScale = gl.Scale +local glRotate = gl.Rotate +local glTranslate = gl.Translate +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glColor = gl.Color +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glTexture = gl.Texture +local glCreateList = gl.CreateList +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +local drawlist = {} +local advplayerlistPos = {} +local widgetHeight = 23 +local top, left, bottom, right = 0,0,0,0 + +local shown = false +local mouseover = false +local volume + +local dynamicMusic = Spring.GetConfigInt("evo_dynamicmusic", 1) +local interruptMusic = Spring.GetConfigInt("evo_interruptmusic", 1) +local warMeter = 0 +local fadelvl = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 +local fadeOut = false + +--Assume that if it isn't set, dynamic music is true +if dynamicMusic == nil then + dynamicMusic = 1 +end + +--Assume that if it isn't set, interrupt music is true +if interruptMusic == nil then + interruptMusic = 1 +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + + volume = Spring.GetConfigInt("snd_volmaster", 100) + music_volume_percentage = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 + + musicInitialValue = Spring.GetConfigInt("evo_musicInitialValue", 0) + if musicInitialValue ~= 1 then + Spring.SetConfigInt("snd_volmusic", 20) + Spring.SetConfigInt("evo_musicInitialValue", 1) + end + + music_volume = Spring.GetConfigInt("snd_volmusic", 20) + + if #tracks == 0 then + Spring.Echo("[Music Player] No music was found, Shutting Down") + widgetHandler:RemoveWidget() + end + + updatePosition() + + WG['music'] = {} + WG['music'].GetPosition = function() + return {top,left,bottom,right,widgetScale} + end +end + + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +local function createList() + + local padding = 3*widgetScale -- button background margin + local padding2 = 2.5*widgetScale -- inner icon padding + local volumeWidth = 50*widgetScale + + buttons['playpause'] = {left+padding, bottom+padding, left+(widgetHeight*widgetScale)-padding, top-padding} + + buttons['next'] = {buttons['playpause'][3]+padding, bottom+padding, buttons['playpause'][3]+((widgetHeight*widgetScale)-padding), top-padding} + + buttons['musicvolumeicon'] = {buttons['next'][3]+padding+padding, bottom+padding, buttons['next'][3]+((widgetHeight*widgetScale)), top-padding} + buttons['musicvolume'] = {buttons['musicvolumeicon'][3]+padding, bottom+padding, buttons['musicvolumeicon'][3]+padding+volumeWidth, top-padding} + buttons['musicvolume'][5] = buttons['musicvolume'][1] + (buttons['musicvolume'][3] - buttons['musicvolume'][1]) * (music_volume/100) + + buttons['volumeicon'] = {buttons['musicvolume'][3]+padding+padding+padding, bottom+padding, buttons['musicvolume'][3]+((widgetHeight*widgetScale)), top-padding} + buttons['volume'] = {buttons['volumeicon'][3]+padding, bottom+padding, buttons['volumeicon'][3]+padding+volumeWidth, top-padding} + buttons['volume'][5] = buttons['volume'][1] + (buttons['volume'][3] - buttons['volume'][1]) * (volume/100) + + local textsize = 11*widgetScale + local textYPadding = 8*widgetScale + local textXPadding = 7*widgetScale + local maxTextWidth = right-buttons['next'][3]-textXPadding-textXPadding + + if drawlist[1] ~= nil then + glDeleteList(drawlist[1]) + glDeleteList(drawlist[2]) + glDeleteList(drawlist[3]) + end + if (WG['guishader_api'] ~= nil) then + WG['guishader_api'].InsertRect(left, bottom, right, top,'music') + end + drawlist[1] = glCreateList( function() + glColor(0, 0, 0, 0.66) + RectRound(left, bottom, right, top, 5.5*widgetScale) + + local borderPadding = 2.75*widgetScale + glColor(1,1,1,0.022) + RectRound(left+borderPadding, bottom+borderPadding, right-borderPadding, top-borderPadding, 4.4*widgetScale) + + end) + drawlist[2] = glCreateList( function() + + local button = 'playpause' + glColor(1,1,1,0.7) + glTexture(buttonTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + glColor(1,1,1,0.4) + if playing then + glTexture(pauseTex) + else + glTexture(playTex) + end + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'next' + glColor(1,1,1,0.7) + glTexture(buttonTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + glColor(1,1,1,0.4) + glTexture(nextTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + end) + drawlist[3] = glCreateList( function() + + -- track name + glColor(0.45,0.45,0.45,1) + local trackname = string.gsub(curTrack, ".ogg", "") + local text = '' + for i=charactersInPath, #trackname do + local c = string.sub(trackname, i,i) + local width = glGetTextWidth(text..c)*textsize + if width > maxTextWidth then + break + else + text = text..c + end + end + glText('\255\135\135\135'..text, buttons['next'][3]+textXPadding, bottom+textYPadding, textsize, 'no') + + end) + drawlist[4] = glCreateList( function() + + ---glColor(0,0,0,0.5) + --RectRound(left, bottom, right, top, 5.5*widgetScale) + + local sliderWidth = 3.3*widgetScale + local sliderHeight = 3.3*widgetScale + local lineHeight = 0.8*widgetScale + local lineOutlineSize = 0.85*widgetScale + + button = 'musicvolumeicon' + local sliderY = buttons[button][2] + (buttons[button][4] - buttons[button][2])/2 + glColor(0.66,0.66,0.66,1) + glTexture(musicTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'musicvolume' + glColor(0,0,0,0.12) + RectRound(buttons[button][1]-lineOutlineSize, sliderY-lineHeight-lineOutlineSize, buttons[button][3]+lineOutlineSize, sliderY+lineHeight+lineOutlineSize, (lineHeight/2.2)*widgetScale) + glColor(0.45,0.45,0.45,1) + RectRound(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight, (lineHeight/2.2)*widgetScale) + glColor(0,0,0,0.12) + RectRound(buttons[button][5]-sliderWidth-lineOutlineSize, sliderY-sliderHeight-lineOutlineSize, buttons[button][5]+sliderWidth+lineOutlineSize, sliderY+sliderHeight+lineOutlineSize, (sliderWidth/4)*widgetScale) + glColor(0.66,0.66,0.66,1) + RectRound(buttons[button][5]-sliderWidth, sliderY-sliderHeight, buttons[button][5]+sliderWidth, sliderY+sliderHeight, (sliderWidth/4)*widgetScale) + + + button = 'volumeicon' + glColor(0.66,0.66,0.66,1) + glTexture(volumeTex) + glTexRect(buttons[button][1]+padding2, buttons[button][2]+padding2, buttons[button][3]-padding2, buttons[button][4]-padding2) + + button = 'volume' + glColor(0,0,0,0.12) + RectRound(buttons[button][1]-lineOutlineSize, sliderY-lineHeight-lineOutlineSize, buttons[button][3]+lineOutlineSize, sliderY+lineHeight+lineOutlineSize, (lineHeight/2.2)*widgetScale) + glColor(0.45,0.45,0.45,1) + RectRound(buttons[button][1], sliderY-lineHeight, buttons[button][3], sliderY+lineHeight, (lineHeight/2.2)*widgetScale) + glColor(0,0,0,0.12) + RectRound(buttons[button][5]-sliderWidth-lineOutlineSize, sliderY-sliderHeight-lineOutlineSize, buttons[button][5]+sliderWidth+lineOutlineSize, sliderY+sliderHeight+lineOutlineSize, (sliderWidth/4)*widgetScale) + glColor(0.66,0.66,0.66,1) + RectRound(buttons[button][5]-sliderWidth, sliderY-sliderHeight, buttons[button][5]+sliderWidth, sliderY+sliderHeight, (sliderWidth/4)*widgetScale) + + end) +end + +function getSliderValue(draggingSlider, x) + local sliderWidth = buttons[draggingSlider][3] - buttons[draggingSlider][1] + local value = (x - buttons[draggingSlider][1]) / (sliderWidth) + if value < 0 then value = 0 end + if value > 1 then value = 1 end + return value +end + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + + +function widget:MouseMove(x, y) + if draggingSlider ~= nil then + if draggingSlider == 'musicvolume' then + changeMusicVolume(getSliderValue('musicvolume', x) * 100) + end + if draggingSlider == 'volume' then + changeVolume(getSliderValue('volume', x) * 100) + end + end +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + +function changeMusicVolume(value) + music_volume = value + Spring.SetConfigInt("snd_volmusic", music_volume) + createList() +end + +function changeVolume(value) + volume = value + Spring.SetConfigInt("snd_volmaster", volume) + createList() +end + +function mouseEvent(x, y, button, release) + if Spring.IsGUIHidden() then return false end + + if not release then + local sliderWidth = (3.3*widgetScale) -- should be same as in createlist() + local button = 'musicvolume' + if isInBox(x, y, {buttons[button][1]-sliderWidth, buttons[button][2], buttons[button][3]+sliderWidth, buttons[button][4]}) then + draggingSlider = button + changeMusicVolume(getSliderValue(button, x) * 100) + end + button = 'volume' + if isInBox(x, y, {buttons[button][1]-sliderWidth, buttons[button][2], buttons[button][3]+sliderWidth, buttons[button][4]}) then + draggingSlider = button + changeVolume(getSliderValue(button, x) * 100) + end + end + if release and draggingSlider ~= nil then + draggingSlider = nil + end + if button == 1 and not release and isInBox(x, y, {left, bottom, right, top}) then + if button == 1 and buttons['playpause'] ~= nil and isInBox(x, y, {buttons['playpause'][1], buttons['playpause'][2], buttons['playpause'][3], buttons['playpause'][4]}) then + playing = not playing + Spring.PauseSoundStream() + createList() + return true + end + if button == 1 and buttons['next'] ~= nil and isInBox(x, y, {buttons['next'][1], buttons['next'][2], buttons['next'][3], buttons['next'][4]}) then + if fadeIn ~= true and fadeOut ~= true then + fadeOut = true + fadelvl = music_volume_percentage + --PlayNewTrack() + end + return true + end + return true + end + +end +function widget:IsAbove(mx, my) + if isInBox(mx, my, {left, bottom, right, top}) then + local curVolume = Spring.GetConfigInt("snd_volmaster", 100) + if volume ~= curVolume then + volume = curVolume + createList() + end + mouseover = true + end + return mouseover +end + +function widget:GetTooltip(mx, my) + if widget:IsAbove(mx,my) then + return string.format("Music info and controls") + end +end + +function widget:Shutdown() + Spring.StopSoundStream() + + if (WG['guishader_api'] ~= nil) then + WG['guishader_api'].RemoveRect('music') + end + + for i=1,#drawlist do + glDeleteList(drawlist[i]) + end + WG['music'] = nil +end + +function widget:UnitDamaged(_, _, _, damage) + warMeter = warMeter + damage +end + +function widget:GameFrame(n) + if n%30 == 4 then + --This is a little messy, but we need to be able to update these values on the fly so I see no better way + music_volume_percentage = Spring.GetConfigInt("snd_volmusic", 20) * 0.01 + + dynamicMusic = Spring.GetConfigInt("evo_dynamicmusic", 1) + interruptMusic = Spring.GetConfigInt("evo_interruptmusic", 1) + + --Assume that if it isn't set, dynamic music is true + if dynamicMusic == nil then + dynamicMusic = 1 + end + + --Assume that if it isn't set, interrupt music is true + if interruptMusic == nil then + interruptMusic = 1 + end + end + if n%5 == 4 then + if dynamicMusic == 1 then + --Spring.Echo("[Music Player] Unit Death Count is currently: ".. warMeter) + if warMeter <= 1 then + warMeter = 0 + elseif warMeter >= 3000 then + warMeter = warMeter - 500 + elseif warMeter >= 1000 then + warMeter = warMeter - 100 + elseif warMeter >= 0 then + warMeter = warMeter - 3 + end + if interruptMusic == 1 then + if tracks == peaceTracks and warMeter >= 200 then + fadeOut = true + elseif tracks == warTracks and warMeter <= 0 then + fadeOut = true + end + end + end + + --80's fadeout when a track is almost finished + local playedTime, totalTime = Spring.GetSoundStreamTime() + playedTime = math.floor(playedTime) + totalTime = math.floor(totalTime) + + if totalTime ~= nil then + --Spring.Echo("Total time is :" .. totalTime) + if playedTime > totalTime - music_volume * 0.05 then + --Spring.Echo("Fading out now!") + fadeOut = true + end + end + + --This has become the preferred handler of playing new tracks instead of calling the PlayNewTrack() function, set fadeOut = true + if fadeOut == true and fadelvl >= 0.01 then + fadelvl = fadelvl - 0.05 + --Spring.Echo(fadelvl) + Spring.SetSoundStreamVolume(fadelvl) + else + fadeOut = false + end + if fadeOut == false and fadelvl <= 0.005 then + fadelvl = music_volume_percentage * 0.01 + PlayNewTrack() + --Spring.Echo("Playing a new song now") + end + + if fadeIn == true and fadelvl <= music_volume_percentage then + fadelvl = fadelvl + 0.05 + --Spring.Echo(fadelvl) + Spring.SetSoundStreamVolume(fadelvl) + else + fadeIn = false + end + end +end + +function PlayNewTrack() + Spring.StopSoundStream() + if Spring.GetGameFrame() >= 1 then + fadelvl = 0 + fadeIn = true + end + --Spring.Echo(dynamicMusic) + + if dynamicMusic == 0 then + --Spring.Echo("Choosing a random track") + r = math.random(0,1) + if r == 0 then + tracks = peaceTracks + else + tracks = warTracks + end + end + + if dynamicMusic == 1 then + --Spring.Echo("Unit Death Count is (Gameframe): " .. warMeter) + if warMeter <= 3 then + tracks = peaceTracks + --Spring.Echo("Current tracklist is : Peace Tracks") + else + tracks = warTracks + --Spring.Echo("Current tracklist is : War Tracks") + end + end + local newTrack = previousTrack + repeat + newTrack = tracks[math.random(1, #tracks)] + until newTrack ~= previousTrack + firstFade = false + previousTrack = newTrack + curTrack = newTrack + local musicVolScaled = music_volume * 0.01 + Spring.PlaySoundStream(newTrack) + Spring.SetSoundStreamVolume(musicVolScaled or 0.33) + if playing == false then + Spring.PauseSoundStream() + end + createList() +end + +function widget:Update(dt) + if gameOver then + return + end + + if (not firstTime) then + fadelvl = 0 + fadeOut = true + firstTime = true -- pop this cherry + end + + local playedTime, totalTime = Spring.GetSoundStreamTime() + playedTime = math.floor(playedTime) + totalTime = math.floor(totalTime) + + if playedTime >= totalTime then -- both zero means track stopped in 8 + fadelvl = 0 + fadeOut = true + end + + if (pauseWhenPaused and Spring.GetGameSeconds()>=0) then + local _, _, paused = Spring.GetGameSpeed() + if (paused ~= wasPaused) then + Spring.PauseSoundStream() + wasPaused = paused + end + end +end + +function updatePosition(force) + if (WG['advplayerlist_api'] ~= nil) then + local prevPos = advplayerlistPos + advplayerlistPos = WG['advplayerlist_api'].GetPosition() -- returns {top,left,bottom,right,widgetScale} + + left = advplayerlistPos[2] + bottom = advplayerlistPos[1] + right = advplayerlistPos[4] + top = advplayerlistPos[1]+(widgetHeight*advplayerlistPos[5]) + widgetScale = advplayerlistPos[5] + + if (prevPos[1] == nil or prevPos[1] ~= advplayerlistPos[1] or prevPos[2] ~= advplayerlistPos[2] or prevPos[5] ~= advplayerlistPos[5]) or force then + createList() + end + end +end + +function widget:ViewResize(newX,newY) + vsx, vsy = newX, newY +end + +function widget:DrawScreen() + updatePosition() + if drawlist[1] ~= nil then + glPushMatrix() + glCallList(drawlist[1]) + glCallList(drawlist[2]) + local mx, my, mlb = Spring.GetMouseState() + if not mouseover and not draggingSlider or isInBox(mx, my, {buttons['playpause'][1], buttons['next'][2], buttons['next'][3], buttons['next'][4]}) then + glCallList(drawlist[3]) + else + glCallList(drawlist[4]) + end + if mouseover then + local color = {1,1,1,0.25} + local colorHighlight = {1,1,1,0.33} + local button = 'playpause' + if buttons[button] ~= nil and isInBox(mx, my, {buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]}) then + if mlb then + glColor(colorHighlight) + else + glColor(color) + end + glTexture(buttonHighlightTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + end + button = 'next' + if buttons[button] ~= nil and isInBox(mx, my, {buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]}) then + if mlb then + glColor(colorHighlight) + else + glColor(color) + end + glTexture(buttonHighlightTex) + glTexRect(buttons[button][1], buttons[button][2], buttons[button][3], buttons[button][4]) + end + end + glPopMatrix() + mouseover = false + end +end + +function widget:GetConfigData(data) + --local playedTime, totalTime = Spring.GetSoundStreamTime() + local savedTable = {} + --savedTable.curTrack = curTrack + --savedTable.playedTime = playedTime + savedTable.playing = playing + return savedTable +end + +-- would be great if there is be a way to continue track where we left off after a /luaui reload +function widget:SetConfigData(data) + if data.playing ~= nil then + playing = data.playing + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_nukeButton.lua b/LuaUI/Widgets_Evo/gui_nukeButton.lua deleted file mode 100644 index 2fa763cc6..000000000 --- a/LuaUI/Widgets_Evo/gui_nukeButton.lua +++ /dev/null @@ -1,555 +0,0 @@ -local versionNumber = "1.1" - -function widget:GetInfo() - return { - name = "Nuke Button", - desc = "[v" .. string.format("%s", versionNumber ) .. "] Displays Nuke Button", - author = "very_bad_soldier", - date = "July 19, 2009", - license = "GNU GPL v2", - layer = 0, - enabled = true - } -end - - --- CONFIGURATION -local debug = false --generates debug message -local updateInt = 1 --seconds for the ::update loop -local baseFontSize = 14 - - -local intConfig = {} -intConfig["fontSize"] = 12 -intConfig["buttonSize"] = 25 --half the width -intConfig["defaultScreenResY"] = 1050 --do not change -intConfig["buttonCoords"] = {} -intConfig["buttonCoords"][1] = {} -intConfig["buttonCoords"][2] = {} -intConfig["buttonCoords"]["progress"] = {} -intConfig["mouseOver"] = false -intConfig["nextNuke"] = nil --unitID of nextNuketoFire -intConfig["leftClickTime"] = 0 -intConfig["screenx"], intConfig["screeny"] = widgetHandler:GetViewSizes() --- END OF CONFIG - --- Internal temp vars -local readyNukeCount = 0 -local highProgress = -1 -local lastTime -local nukeList = {} -local curUnitList - - -local config = {} -config["buttonXPer"] = 0.935 -config["buttonYPer"] = 0.765 - - ---Game Config ------------------------------------ -local unitList = {} -unitList["EVORTS"] = {} --initialize table -unitList["EVORTS"]["esilo"] = {} - ---End - -local upper = string.upper -local floor = math.floor -local max = math.max -local min = math.min - -local udefTab = UnitDefs -local glColor = gl.Color -local glDepthTest = gl.DepthTest -local glTexture = gl.Texture -local glTexEnv = gl.TexEnv -local glLineWidth = gl.LineWidth -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glTranslate = gl.Translate -local glFeatureShape = gl.FeatureShape -local spGetGameSeconds = Spring.GetGameSeconds -local spGetMyPlayerID = Spring.GetMyPlayerID -local spGetPlayerInfo = Spring.GetPlayerInfo -local spGetAllFeatures = Spring.GetAllFeatures -local spGetFeaturePosition = Spring.GetFeaturePosition -local spGetFeatureDefID = Spring.GetFeatureDefID -local spGetMyAllyTeamID = Spring.GetMyAllyTeamID -local spGetFeatureAllyTeam = Spring.GetFeatureAllyTeam -local spGetFeatureTeam = Spring.GetFeatureTeam -local spGetUnitHealth = Spring.GetUnitHealth -local spGetFeatureHealth = Spring.GetFeatureHealth -local spGetFeatureResurrect = Spring.GetFeatureResurrect -local spGetPositionLosState = Spring.GetPositionLosState -local spGetUnitStockpile = Spring.GetUnitStockpile -local spIsUnitAllied = Spring.IsUnitAllied -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitHealth = Spring.GetUnitHealth -local spEcho = Spring.Echo -local spGetUnitDefID = Spring.GetUnitDefID -local spGetTeamUnits = Spring.GetTeamUnits -local spGetMyTeamID = Spring.GetMyTeamID -local spGetMouseState = Spring.GetMouseState -local spGiveOrderToUnit = Spring.GiveOrderToUnit -local spSelectUnitArray = Spring.SelectUnitArray -local spGetGameSpeed = Spring.GetGameSpeed -local spSetActiveCommand = Spring.SetActiveCommand -local DrawGhostFeatures -local DrawGhostSites -local ScanFeatures -local DeleteGhostFeatures -local DeleteGhostSites -local ResetGl -local CheckSpecState -local printDebug - - -local GL_FILL = GL.FILL -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_TRIANGLE_STRIP = GL_TRIANGLE_STRIP -local glTexEnv = gl.TexEnv -local glUnitShape = gl.UnitShape -local glFeatureShape = gl.FeatureShape -local glBeginEnd = gl.BeginEnd -local glBillboard = gl.Billboard -local glColor = gl.Color -local glDepthTest = gl.DepthTest -local glDrawGroundCircle = gl.DrawGroundCircle -local glDrawGroundQuad = gl.DrawGroundQuad -local glLineWidth = gl.LineWidth -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glTexRect = gl.TexRect -local glText = gl.Text -local glTexture = gl.Texture -local glTranslate = gl.Translate -local glVertex = gl.Vertex -local glAlphaTest = gl.AlphaTest -local glBlending = gl.Blending -local glRect = gl.Rect - - -function widget:Initialize() - ResizeButtonsToScreen() - - myPlayerID = spGetMyPlayerID() --spGetLocalTeamID() - curModID = upper(Game.modShortName or "") - - if ( unitList[curModID] == nil ) then - spEcho(" Unsupported Game, shutting down...") - widgetHandler:RemoveWidget() - return - end - - curUnitList = unitList[curModID] - - --add all already existing nukes - searchAndAddNukes() -end - - - -function widget:Update() - local timef = spGetGameSeconds() - local time = floor(timef) - - -- update timers once every seconds - if (time % updateInt == 0 and time ~= lastTime) then - lastTime = time - --do update stuff: - - if ( CheckSpecState() == false ) then - return false - end - - highestLoadCount = 0 - readyNukeCount = 0 - highProgress = -1 --magic value: no active nukes - for unitID, udefID in pairs( nukeList ) do - local numStockpiled, numStockPQue, buildPercent = spGetUnitStockpile( unitID) - - if ( buildPercent == nil ) then - --unit seems to be gone, delete it - deleteNuke( unitID ) - else - --save highest nuke stockpile progress - readyNukeCount = readyNukeCount + numStockpiled - if ( numStockPQue > 0 ) then - highProgress = max( highProgress, buildPercent ) - end - end - - if ( numStockpiled > highestLoadCount ) then - intConfig["nextNuke"] = unitID - highestLoadCount = numStockpiled - end - end - - printDebug("HighProgress: " .. highProgress ) - - updateProgressLayer() - end -end - -function updateProgressLayer() - --progress layer - --fuck, replace half of the "buttonCurrentWidth" by "buttonCurrentHeight" - intConfig["buttonCoords"]["progress"] = {} - table.insert( intConfig["buttonCoords"]["progress"], { 0, 0 } ) - table.insert( intConfig["buttonCoords"]["progress"], { 0, intConfig["buttonCurrentWidth"] } ) - - local localHP = highProgress - localHP = max( 0, localHP ) - if ( localHP < 0.875 ) then - table.insert( intConfig["buttonCoords"]["progress"], { -intConfig["buttonCurrentWidth"], intConfig["buttonCurrentWidth"] } ) - end - if ( localHP < 0.625 ) then - table.insert( intConfig["buttonCoords"]["progress"], { -intConfig["buttonCurrentWidth"], -intConfig["buttonCurrentWidth"] } ) - end - if ( localHP < 0.375 ) then - table.insert( intConfig["buttonCoords"]["progress"], { intConfig["buttonCurrentWidth"], -intConfig["buttonCurrentWidth"] } ) - end - if ( localHP < 0.125 ) then - table.insert( intConfig["buttonCoords"]["progress"], { intConfig["buttonCurrentWidth"], intConfig["buttonCurrentWidth"] } ) - end - - local x=0 - local y=0 - if ( localHP < 0.125 ) then - y = intConfig["buttonCurrentWidth"] - x = intConfig["buttonCurrentWidth"] * localHP / 0.125 - elseif ( localHP < 0.375 ) then - y = intConfig["buttonCurrentWidth"] - 2 * intConfig["buttonCurrentWidth"] * ( localHP - 0.125 ) / 0.25 - x = intConfig["buttonCurrentWidth"] - elseif ( localHP < 0.625 ) then - y = -intConfig["buttonCurrentWidth"] - x = intConfig["buttonCurrentWidth"] - 2 * intConfig["buttonCurrentWidth"] * ( localHP - 0.375 ) / 0.25 - elseif ( localHP < 0.875 ) then - y = -intConfig["buttonCurrentWidth"] + 2* intConfig["buttonCurrentWidth"] * ( localHP - 0.625 ) / 0.25 - x = -intConfig["buttonCurrentWidth"] - elseif ( localHP < 1.0 ) then - y = intConfig["buttonCurrentWidth"] - x = -intConfig["buttonCurrentWidth"] + intConfig["buttonCurrentWidth"] * ( localHP - 0.875 ) / 0.125 - end - table.insert( intConfig["buttonCoords"]["progress"], { x,y } ) -end - -function isMouseOver( mx, my ) - if ( mx > intConfig["buttonCoords"][1]["x"] and mx < intConfig["buttonCoords"][2]["x"] ) then - if ( my < intConfig["buttonCoords"][1]["y"] and my > intConfig["buttonCoords"][2]["y"] ) then - return true - end - end - - return false -end - --- needed for GetTooltip -function widget:IsAbove(x, y) - if (not isMouseOver(x, y)) then - return false - end - return true -end - -function widget:GetTooltip(x, y) - local text = "" - if ( readyNukeCount > 0 ) then - text = "Left-Click: Select next nuke\nDouble-Click: Aim next nuke" - else - text = "Loading Nuke: " .. string.format("%.2f", highProgress * 100) .. "%" - end - - return text -end - - -function widget:DrawScreen() - --printDebug("Count: " .. lastTime ) - local mx,my,lmb,mmb,rmb = spGetMouseState() - intConfig["mouseOver"] = false - - if ( isMouseOver( mx, my ) ) then - intConfig["mouseOver"] = true - end - - if ( highProgress > -1 or readyNukeCount > 0 ) then - - drawButton( ) - end -end - - -function widget:MousePress(x, y, button) - if ( isMouseOver( x, y ) and readyNukeCount > 0 and button == 1 ) then - local timeNow = spGetGameSeconds() - spSelectUnitArray( { intConfig["nextNuke"] } , false ) - - local _,speedfac, _ = spGetGameSpeed() - if ( timeNow < intConfig["leftClickTime"] + (0.5 * speedfac ) ) then - --Spring.GiveOrderToUnit ( intConfig["nextNuke"], CMD.ATTACK, {500,500,500}, {} ) - spSetActiveCommand( "Attack" ) - end - intConfig["leftClickTime"] = timeNow - - return true - end -end - - -function widget:UnitDestroyed( unitID, unitDefID, unitTeam ) - deleteNuke( unitID ) -end - - -function widget:UnitFinished( unitID, unitDefID, unitTeam ) - if ( unitTeam == spGetMyTeamID() ) then - addPossibleNuke( unitID, unitDefID ) - end -end - ---End OF Callins - -function searchAndAddNukes() - local allUnits = spGetTeamUnits(spGetMyTeamID()) - for _, unitID in pairs(allUnits) do - local unitDefID = spGetUnitDefID(unitID) - if ( unitDefID ~= nil ) then - addPossibleNuke( unitID, unitDefID ) - end - end -end - ---delete nuke from list if we know it -function deleteNuke( unitID ) - if ( nukeList[unitID] ~= nil ) then - nukeList[unitID] = nil - end -end - -function addPossibleNuke( unitID, unitDefID ) - local udef = UnitDefs[unitDefID] - printDebug( "Name: " .. udef.name .. " UnitID: " .. unitID .. "udefid: " .. unitDefID ) - - if ( curUnitList[udef.name] ~= nil ) then - printDebug("Nuke added!") - nukeList[unitID] = udef.name - end -end - - -local buttonConfig = {} -buttonConfig["borderColor"] = { 0, 0, 0, 1.0 } -buttonConfig["highlightColor"] = { 1.0, 0.0, 0.0, 1.0 } - -function widget:ViewResize(viewSizeX, viewSizeY) - intConfig["screenx"] = viewSizeX - intConfig["screeny"] = viewSizeY - - borderizeButtons() - ResizeButtonsToScreen() -end - -function ResizeButtonsToScreen() - --printDebug("Old Width:" .. ButtonWidthOrg .. " vsy: " .. vsy ) - intConfig["buttonCurrentWidth"] = ( intConfig["screeny"] / intConfig["defaultScreenResY"] ) * intConfig["buttonSize"] - intConfig["buttonCurrentHeight"] = intConfig["buttonCurrentWidth"] - - intConfig["buttonCoords"][1]["x"] = intConfig["screenx"] * config["buttonXPer"] - intConfig["buttonCurrentWidth"] - intConfig["buttonCoords"][1]["y"] = intConfig["screeny"] * config["buttonYPer"] + intConfig["buttonCurrentHeight"] - - intConfig["buttonCoords"][2]["x"] = intConfig["screenx"] * config["buttonXPer"] + intConfig["buttonCurrentWidth"] - intConfig["buttonCoords"][2]["y"] = intConfig["screeny"] * config["buttonYPer"] - intConfig["buttonCurrentHeight"] - - intConfig["fontSize"] = baseFontSize * ( intConfig["screeny"] / intConfig["defaultScreenResY"] ) - printDebug("Resizing: " .. intConfig["buttonCoords"][1]["x"] ) - - updateProgressLayer() -end - - -function drawButton( ) - xmax = intConfig["buttonCoords"][1]["x"] - ymax = intConfig["buttonCoords"][1]["y"] - - xmin = intConfig["buttonCoords"][2]["x"] - ymin = intConfig["buttonCoords"][2]["y"] - - -- draw button body - local bgColor = { 0.0, 0.0, 0.0 } - - -- draw colored background rectangle - glColor( bgColor ) - glTexture(false) - glTexRect( xmin, ymin, xmax, ymax ) - - -- draw icon - glColor( { 1.0, 1.0, 1.0} ) - - glTexture( ":n:LuaUI/Images/nuke_button_64.png" ) - - local texBorder = 0.75 - glTexRect( xmin, ymin, xmax, ymax, 0.0, texBorder, texBorder, 0.0 ) - glTexture(false) - - --draw the progress - if ( highProgress >= 0 ) then - DrawButtonProgress( intConfig["buttonCoords"][1]["x"] + intConfig["buttonCurrentWidth"], intConfig["buttonCoords"][1]["y"] - intConfig["buttonCurrentHeight"] ) - end - - -- draw the outline - if ( intConfig["mouseOver"] and readyNukeCount > 0 ) then - glColor(buttonConfig["highlightColor"]) - else - glColor(buttonConfig["borderColor"]) - end - - local function Draw() - glVertex(xmin, ymin) - glVertex(xmax, ymin) - glVertex(xmax, ymax) - glVertex(xmin, ymax) - end - - glBeginEnd(GL_LINE_LOOP, Draw) - - local centerx = xmin - intConfig["buttonCurrentWidth"] - gl.Color(1,0,0, alpha or 1) - gl.Text( readyNukeCount, centerx, ymin + intConfig["buttonCurrentHeight"], intConfig["fontSize"], "nc") - gl.Color(1,1,1,1) - - if ( highProgress >= 0 ) then - gl.Color(1 - highProgress, 1 * highProgress,0, alpha or 1) - gl.Text( string.format( "%.0f", highProgress * 100 ) .. "%", centerx + 0.1 * intConfig["buttonCurrentWidth"], ymin + 0.1 * intConfig["buttonCurrentHeight"], 0.9 * intConfig["fontSize"], "nc") - gl.Color(1,1,1,1) - end -end - - - - -function DrawButtonProgress( xcenter, ycenter ) - glTexture(false) - glColor( { .0, .0, .0, 0.7} ) - - local function Draw() - for id, point in pairs( intConfig["buttonCoords"]["progress"] ) do - glVertex( xcenter + point[1], ycenter + point[2] ) - end - end - - glBeginEnd(GL.TRIANGLE_FAN, Draw) -end - ---Commons -function ResetGl() - glColor( { 1.0, 1.0, 1.0, 1.0 } ) - glLineWidth( 1.0 ) - glDepthTest(false) - glTexture(false) -end - -function CheckSpecState() - local playerID = spGetMyPlayerID() - local _, _, spec, _, _, _, _, _ = spGetPlayerInfo(playerID) - - if ( spec == true ) then - spEcho(" Spectator mode. Widget removed.") - widgetHandler:RemoveWidget() - return false - end - - return true -end - -function printDebug( value ) - if ( debug ) then - if ( type( value ) == "boolean" ) then - if ( value == true ) then spEcho( "true" ) - else spEcho("false") end - elseif ( type(value ) == "table" ) then - spEcho("Dumping table:") - for key,val in pairs(value) do - spEcho(key,val) - end - else - spEcho( value ) - end - end -end - - - ---SAVE / LOAD CONFIG FILE -function widget:GetConfigData() - return config -end - -function widget:SetConfigData(data) - if (data ~= nil) then - config = data - ResizeButtonsToScreen() - borderizeButtons() - ResizeButtonsToScreen() - end -end ---END OF LOAD SAVE - ---TWEAK MODE -local inTweakDrag = false -function widget:TweakMousePress(x,y,button) - inTweakDrag = isMouseOver(x, y) --allows button movement when mouse moves - return inTweakDrag -end - -function widget:TweakMouseMove(x,y,dx,dy,button) - if ( inTweakDrag == false ) then - return - end - - printDebug("Tweak") - - config["buttonXPer"] = config["buttonXPer"] + ( dx / intConfig["screenx"] ) - config["buttonYPer"] = config["buttonYPer"] + ( dy / intConfig["screeny"] ) - - borderizeButtons() - - ResizeButtonsToScreen() -end - -function borderizeButtons() - if ( config["buttonXPer"] * intConfig["screenx"] - intConfig["buttonCurrentWidth"] < 0.0 ) then - config["buttonXPer"] = 0.0 - elseif( config["buttonXPer"] * intConfig["screenx"] + intConfig["buttonCurrentWidth"] > intConfig["screenx"] ) then - config["buttonXPer"] = ( intConfig["screenx"] - intConfig["buttonCurrentWidth"] ) / intConfig["screenx"] - end - - if ( config["buttonYPer"] * intConfig["screeny"] - intConfig["buttonCurrentHeight"] < 0.0 ) then - config["buttonYPer"] = 0.0 - elseif( config["buttonYPer"] * intConfig["screeny"] + intConfig["buttonCurrentHeight"] > intConfig["screeny"] ) then - config["buttonYPer"] = ( intConfig["screeny"] - intConfig["buttonCurrentHeight"] ) / intConfig["screeny"] - end -end - -function widget:TweakMouseRelease(x,y,button) - inTweakDrag = false -end - -function widget:TweakDrawScreen() - drawButton() - - glColor(0.0,0.0,1.0,0.5) - glRect( intConfig["buttonCoords"][1]["x"], intConfig["buttonCoords"][2]["y"], intConfig["buttonCoords"][2]["x"], intConfig["buttonCoords"][1]["y"]) - glColor(1,1,1,1) -end - -function widget:TweakIsAbove(x,y) - return isMouseOver(x,y) -end - -function widget:TweakGetTooltip(x,y) - return 'Click and hold left mouse button\n'.. - 'over button to drag\n' -end - ---END OF TWEAK MODE diff --git a/LuaUI/Widgets_Evo/gui_options.lua b/LuaUI/Widgets_Evo/gui_options.lua new file mode 100644 index 000000000..e5a0ee57c --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_options.lua @@ -0,0 +1,3064 @@ + +function widget:GetInfo() +return { + name = "Options", + desc = "", + author = "Floris", + date = "September 2016", + layer = 20000, + enabled = true, + handler = true, +} +end + +--[[ +-- Add option, at: +-- function init +-- +-- Apply new option value: +-- function applyOptionValue +-- +-- Load widget data (to get settings for when widget is disabled): +-- function loadAllWidgetData +-- +]]-- + +local cameraTransitionTime = 0.2 +local cameraPanTransitionTime = 0.03 + +local playSounds = true +local buttonclick = 'LuaUI/Sounds/tock.wav' +local paginatorclick = 'LuaUI/Sounds/buildbar_waypoint.wav' +local sliderdrag = 'LuaUI/Sounds/buildbar_rem.wav' +local selectclick = 'LuaUI/Sounds/buildbar_click.wav' +local selectunfoldclick = 'LuaUI/Sounds/buildbar_hover.wav' +local selecthoverclick = 'LuaUI/Sounds/hover.wav' +local toggleonclick = 'LuaUI/Sounds/switchon.wav' +local toggleoffclick = 'LuaUI/Sounds/switchoff.wav' + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfileScale2 = fontfileScale * 1.2 +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + +local bgcorner = "LuaUI/Images/bgcorner.png" +local backwardTex = "LuaUI/Images/backward.dds" +local forwardTex = "LuaUI/Images/forward.dds" +local glowTex = "LuaUI/Images/glow2.dds" + +local bgMargin = 6 + +local closeButtonSize = 30 +local screenHeight = 520-bgMargin-bgMargin +local screenWidth = 1050-bgMargin-bgMargin + +local changesRequireRestart = false +local textareaMinLines = 10 -- wont scroll down more, will show at least this amount of lines + +local customScale = 1 + +local startLine = 1 + +local customMapSunPos = {} + +local screenX = (vsx*0.5) - (screenWidth/2) +local screenY = (vsy*0.5) + (screenHeight/2) + +local wsx,wsy,wpx,wpy = Spring.GetWindowGeometry() +local ssx,ssy,spx,spy = Spring.GetScreenGeometry() + +local spIsGUIHidden = Spring.IsGUIHidden + +local glColor = gl.Color +local glLineWidth = gl.LineWidth +local glPolygonMode = gl.PolygonMode +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glRotate = gl.Rotate +local glTexture = gl.Texture +local glText = gl.Text +local glShape = gl.Shape + +local bgColorMultiplier = 0 + +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glTranslate = gl.Translate +local glScale = gl.Scale + +local GL_FILL = GL.FILL +local GL_FRONT_AND_BACK = GL.FRONT_AND_BACK +local GL_LINE_STRIP = GL.LINE_STRIP + +local vsx, vsy = Spring.GetViewGeometry() +local widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale +WG.uiScale = widgetScale +local resolutionX, resolutionY = Spring.GetScreenGeometry() + + +local myTeamID = Spring.GetMyTeamID() +local amNewbie = (Spring.GetTeamRulesParam(myTeamID, 'isNewbie') == 1) + +local defaultMapSunPos = {gl.GetSun("pos")} + +local options = {} +local optionGroups = {} +local optionButtons = {} +local optionHover = {} +local optionSelect = {} + +local widgetOptionColor = '\255\160\160\160' + +local luaShaders = tonumber(Spring.GetConfigInt("ForceShaders",1) or 0) + +local presetNames = {'lowest','low','medium','high','ultra'} -- defined so these get listed in the right order +local presets = { + lowest = { + msaa = 0, + bloom = false, + bloomhighlights = false, + ssao = false, + water = 1, + mapedgeextension = false, + lighteffects = false, + lups = false, + snow = false, + xrayshader = false, + particles = 5000, + nanoparticles = 500, + grassdetail = 0, + treeradius = 0, + advsky = false, + timecyclesweathereffects = false, + outline = false, + guishader = false, + shadows = false, + advmapshading = false, + advmodelshading = false, + decals = 0, + grounddetail = 64, + darkenmap_darkenfeatures = false, + enemyspotter_highlight = false, + }, + low = { + msaa = 2, + bloom = false, + bloomhighlights = false, + ssao = false, + water = 2, + mapedgeextension = false, + lighteffects = false, + lups = true, + snow = false, + xrayshader = false, + particles = 10000, + nanoparticles = 800, + grassdetail = 0, + treeradius = 200, + advsky = false, + timecyclesweathereffects = false, + outline = false, + guishader = false, + shadows = false, + advmapshading = true, + advmodelshading = true, + decals = 0, + grounddetail = 64, + darkenmap_darkenfeatures = false, + enemyspotter_highlight = false, + }, + medium = { + msaa = 4, + bloom = true, + bloomhighlights = false, + ssao = false, + water = 3, + mapedgeextension = true, + lighteffects = true, + lups = true, + snow = true, + xrayshader = false, + particles = 15000, + nanoparticles = 1200, + grassdetail = 0, + treeradius = 400, + advsky = false, + timecyclesweathereffects = false, + outline = false, + guishader = false, + shadows = true, + advmapshading = true, + advmodelshading = true, + decals = 1, + grounddetail = 64, + darkenmap_darkenfeatures = false, + enemyspotter_highlight = false, + }, + high = { + msaa = 8, + bloom = true, + bloomhighlights = false, + ssao = true, + water = 3, + mapedgeextension = true, + lighteffects = true, + lups = true, + snow = true, + xrayshader = false, + particles = 20000, + nanoparticles = 2000, + grassdetail = 0, + treeradius = 800, + advsky = true, + timecyclesweathereffects = false, + outline = true, + guishader = true, + shadows = true, + advmapshading = true, + advmodelshading = true, + decals = 2, + grounddetail = 64, + darkenmap_darkenfeatures = false, + enemyspotter_highlight = false, + }, + ultra = { + msaa = 16, + bloom = true, + bloomhighlights = true, + ssao = true, + water = 3, + mapedgeextension = true, + lighteffects = true, + lups = true, + snow = true, + xrayshader = false, + particles = 25000, + nanoparticles = 5000, + grassdetail = 0, + treeradius = 800, + advsky = true, + timecyclesweathereffects = false, + outline = true, + guishader = true, + shadows = true, + advmapshading = true, + advmodelshading = true, + decals = 3, + grounddetail = 64, + darkenmap_darkenfeatures = true, + enemyspotter_highlight = true, + }, +} +local customPresets = {} + +--if VFS.FileExists("LuaUI/configs/options.lua",VFS.ZIP) then +----if io.open("LuaUI/configs/options.lua",'r') ~= nil then -- file exists? +-- Spring.Echo("Options: loading external options config") +-- include("configs/options.lua") +--end + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + screenX = (vsx*0.5) - (screenWidth/2) + screenY = (vsy*0.5) + (screenHeight/2) + widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + WG.uiScale = widgetScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + fontfileScale2 = fontfileScale * 1.2 + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale2, fontfileOutlineSize*fontfileScale2, fontfileOutlineStrength) + end + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) +end + +local showOnceMore = false -- used because of GUI shader delay + +local showOptionsToggleButton = false +local textSize = 1 +local textMargin = 0.25 +local lineWidth = 0.0625 + +local posX = 0.947 +local posY = 0.965 +local buttonGL +local startPosX = posX + + +local engineVersion = 100 -- just filled this in here incorrectly but old engines arent used anyway +if Engine and Engine.version then + local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results + end + engineVersion = Split(Engine.version, '-') + if engineVersion[2] ~= nil and engineVersion[3] ~= nil then + engineVersion = tonumber(string.gsub(engineVersion[1], '%.', '')..engineVersion[2]) + else + engineVersion = tonumber(Engine.version) + end +elseif Game and Game.version then + engineVersion = tonumber(Game.version) +end + + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +function lines(str) + local t = {} + local function helper(line) t[#t+1]=line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + +function tableMerge(t1, t2) + for k,v in pairs(t2) do + if type(v) == "table" then + if type(t1[k] or false) == "table" then + tableMerge(t1[k] or {}, t2[k] or {}) + else + t1[k] = v + end + else + t1[k] = v + end + end + return t1 +end + +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy +end + +function getOptionByID(id) + for i, option in pairs(options) do + if option.id == id then + return i + end + end + return false +end + + +function orderOptions() + local groupOptions = {} + for id,group in pairs(optionGroups) do + groupOptions[group.id] = {} + end + for oid,option in pairs(options) do + if option.type ~= 'label' then + groupOptions[option.group][#groupOptions[option.group]+1] = option + end + end + local newOptions = {} + local newOptionsCount = 0 + for id,group in pairs(optionGroups) do + grOptions = groupOptions[group.id] + if #grOptions > 0 then + local name = group.name + if group.id == 'gfx' then + name = group.name..' \255\130\130\130'..vsx..' x '..vsy + end + newOptionsCount = newOptionsCount +1 + newOptions[newOptionsCount] = {id="group_"..group.id, name=name, type="label"} + end + for oid,option in pairs(grOptions) do + newOptionsCount = newOptionsCount +1 + newOptions[newOptionsCount] = option + end + end + options = deepcopy(newOptions) +end + + +function mouseoverGroupTab(id) + if optionGroups[id].id == currentGroupTab then return end + + local tabFontSize = 16 + local groupMargin = bgMargin/1.7 + gl.Color(0.4,0.4,0.4,0.3) + RectRound(groupRect[id][1]+groupMargin, groupRect[id][2], groupRect[id][3]-groupMargin, groupRect[id][4]-groupMargin, groupMargin*1.8, 1,1,0,0) + font2:Begin() + font2:SetTextColor(1,0.85,0.55,1) + font2:SetOutlineColor(0.4,0.3,0.15,0.4) + font2:Print(optionGroups[id].name, groupRect[id][1]+((groupRect[id][3]-groupRect[id][1])/2), screenY+bgMargin+8, tabFontSize, "con") + font2:End() +end + +local startColumn = 1 -- used for navigation +local maxShownColumns = 3 +local maxColumnRows = 0 -- gets calculated +local totalColumns = 0 -- gets calculated +function DrawWindow() + + orderOptions() + + local x = screenX --rightwards + local y = screenY --upwards + -- background + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(x-bgMargin,y-screenHeight-bgMargin,x+screenWidth+bgMargin,y+bgMargin,8, 0,1,1,1) + -- content area + if currentGroupTab then + gl.Color(0.4,0.4,0.4,0.15) + else + gl.Color(0.33,0.33,0.33,0.15) + end + RectRound(x,y-screenHeight,x+screenWidth,y,6) + + --[[ close button + local size = closeButtonSize*0.7 + local width = size*0.055 + gl.Color(1,1,1,1) + gl.PushMatrix() + gl.Translate(screenX+screenWidth-(closeButtonSize/2),screenY-(closeButtonSize/2),0) + gl.Rotate(-45,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.Rotate(90,0,0,1) + gl.Rect(-width,size/2,width,-size/2) + gl.PopMatrix()]]-- + + -- title + local title = "Settings" + local titleFontSize = 18 + titleRect = {x-bgMargin, y+bgMargin, x+(font2:GetTextWidth(title)*titleFontSize)+27-bgMargin, y+37 } + + -- group tabs + local tabFontSize = 16 + local xpos = titleRect[3] + local groupMargin = bgMargin/1.7 + groupRect = {} + for id,group in pairs(optionGroups) do + groupRect[id] = {xpos, y+(bgMargin/2), xpos+(font2:GetTextWidth(group.name)*tabFontSize)+27, y+37} + xpos = groupRect[id][3] + if currentGroupTab == nil or currentGroupTab ~= group.id then + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(groupRect[id][1], groupRect[id][2]+(bgMargin/2), groupRect[id][3], groupRect[id][4], 8, 1,1,0,0) + gl.Color(0.62,0.5,0.22,0.18) + RectRound(groupRect[id][1]+groupMargin, groupRect[id][2], groupRect[id][3]-groupMargin, groupRect[id][4]-groupMargin, groupMargin*1.8, 1,1,0,0) + font2:Begin() + font2:SetTextColor(0.6,0.51,0.38,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(group.name, groupRect[id][1]+((groupRect[id][3]-groupRect[id][1])/2), y+bgMargin+8, tabFontSize, "con") + font2:End() + else + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(groupRect[id][1], groupRect[id][2]+(bgMargin/2), groupRect[id][3], groupRect[id][4], 8, 1,1,0,0) + gl.Color(0.4,0.4,0.4,0.15) + RectRound(groupRect[id][1]+groupMargin, groupRect[id][2]+(bgMargin/2)-bgMargin, groupRect[id][3]-groupMargin, groupRect[id][4]-groupMargin, groupMargin*1.8, 1,1,0,0) + font2:Begin() + font2:SetTextColor(1,0.75,0.4,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(group.name, groupRect[id][1]+((groupRect[id][3]-groupRect[id][1])/2), y+bgMargin+8, tabFontSize, "con") + font2:End() + end + end + + -- title drawing + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(titleRect[1], titleRect[2], titleRect[3], titleRect[4], 8, 1,1,0,0) + + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on") + font2:End() + + font:Begin() + local width = screenWidth/3 + --gl.Color(0.66,0.66,0.66,0.08) + --RectRound(x+width+width+6,y-screenHeight,x+width+width+width,y,6) + + -- description background + --gl.Color(0.55,0.48,0.22,0.14) + gl.Color(1,0.85,0.55,0.04) + RectRound(x,y-screenHeight,x+width+width,y-screenHeight+90,6) + + -- draw options + local oHeight = 15 + local oPadding = 6 + y = y - oPadding - 11 + local oWidth = (screenWidth/3)-oPadding-oPadding + local yHeight = screenHeight-102-oPadding + local xPos = x + oPadding + 5 + local xPosMax = xPos + oWidth - oPadding - oPadding + local yPosMax = y-yHeight + local boolPadding = 3.5 + local boolWidth = 40 + local sliderWidth = 110 + local selectWidth = 140 + local i = 0 + local rows = 0 + local column = 1 + local drawColumnPos = 1 + + maxColumnRows = math.floor((y-yPosMax+oPadding) / (oHeight+oPadding+oPadding)) + local numOptions = #options + if currentGroupTab ~= nil then + numOptions = 0 + for oid,option in pairs(options) do + if option.group == currentGroupTab then + numOptions = numOptions + 1 + end + end + end + totalColumns = math.ceil(numOptions / maxColumnRows) + + optionButtons = {} + optionHover = {} + + + -- draw navigation... backward/forward + if totalColumns > maxShownColumns then + local buttonSize = 52 + local buttonMargin = 18 + local startX = x+screenWidth + local startY = screenY-screenHeight+buttonMargin + + glColor(1,1,1,1) + + if (startColumn-1) + maxShownColumns < totalColumns then + optionButtonForward = {startX-buttonSize-buttonMargin, startY, startX-buttonMargin, startY+buttonSize} + glColor(1,1,1,1) + glTexture(forwardTex) + glTexRect(optionButtonForward[1], optionButtonForward[2], optionButtonForward[3], optionButtonForward[4]) + else + optionButtonForward = nil + end + + font:SetTextColor(1,1,1,0.4) + font:Print(math.ceil(startColumn/maxShownColumns)..' / '..math.ceil(totalColumns/maxShownColumns), startX-(buttonSize*2.6)-buttonMargin, startY+buttonSize/2.6, buttonSize/2.9, "rn") + if startColumn > 1 then + if optionButtonForward == nil then + optionButtonBackward = {startX-buttonSize-buttonMargin, startY, startX-buttonMargin, startY+buttonSize } + else + optionButtonBackward = {startX-(buttonSize*2)-buttonMargin-(buttonMargin/1.5), startY, startX-(buttonSize*1)-buttonMargin-(buttonMargin/1.5), startY+buttonSize} + end + glColor(1,1,1,1) + glTexture(backwardTex) + glTexRect(optionButtonBackward[1], optionButtonBackward[2], optionButtonBackward[3], optionButtonBackward[4]) + else + optionButtonBackward = nil + end + end + + -- require restart notification + if changesRequireRestart then + font:SetTextColor(1,0.35,0.35,1) + font:SetOutlineColor(0,0,0,0.4) + font:Print("...made changes that require restart", x+screenWidth-3, screenY-screenHeight+3, 15, "rn") + end + + -- draw options + for oid,option in pairs(options) do + if currentGroupTab == nil or option.group == currentGroupTab then + yPos = y-(((oHeight+oPadding+oPadding)*i)-oPadding) + if yPos-oHeight < yPosMax then + i = 0 + column = column + 1 + if column >= startColumn and rows > 0 then + drawColumnPos = drawColumnPos + 1 + end + if drawColumnPos > 3 then + break + end + if rows > 0 then + xPos = x + (( (screenWidth/3))*(drawColumnPos-1)) + xPosMax = xPos + oWidth + end + yPos = y-(((oHeight+oPadding+oPadding)*i)-oPadding) + end + + if column >= startColumn then + rows = rows + 1 + --option name + color = '\255\225\225\225 ' + if option.type == 'label' then + color = '\255\235\200\125' + end + + font:SetTextColor(1,1,1,1) + font:Print(color..option.name, xPos+(oPadding/2), yPos-(oHeight/3)-oPadding, oHeight, "no") + + -- define hover area + optionHover[oid] = {xPos, yPos-oHeight-oPadding, xPosMax, yPos+oPadding} + + -- option controller + local rightPadding = 4 + if option.type == 'bool' then + optionButtons[oid] = {} + optionButtons[oid] = {xPosMax-boolWidth-rightPadding, yPos-oHeight, xPosMax-rightPadding, yPos} + glColor(1,1,1,0.11) + RectRound(xPosMax-boolWidth-rightPadding, yPos-oHeight, xPosMax-rightPadding, yPos, 2) + if option.value == true then + glColor(0.66,0.92,0.66,1) + RectRound(xPosMax-oHeight+boolPadding-rightPadding, yPos-oHeight+boolPadding, xPosMax-boolPadding-rightPadding, yPos-boolPadding, 1) + local boolGlow = boolPadding*3.5 + glColor(0.66,1,0.66,0.5) + glTexture(glowTex) + glTexRect(xPosMax-oHeight+boolPadding-rightPadding-boolGlow, yPos-oHeight+boolPadding-boolGlow, xPosMax-boolPadding-rightPadding+boolGlow, yPos-boolPadding+boolGlow) + glColor(0.55,1,0.55,0.09) + glTexture(glowTex) + glTexRect(xPosMax-oHeight+boolPadding-rightPadding-(boolGlow*3), yPos-oHeight+boolPadding-(boolGlow*3), xPosMax-boolPadding-rightPadding+(boolGlow*3), yPos-boolPadding+(boolGlow*3)) + elseif option.value == 0.5 then + glColor(0.91,0.82,0.66,1) + RectRound(xPosMax-(boolWidth/1.9)+boolPadding-rightPadding, yPos-oHeight+boolPadding, xPosMax-(boolWidth/1.9)+oHeight-boolPadding-rightPadding, yPos-boolPadding, 1) + else + glColor(0.9,0.66,0.66,1) + RectRound(xPosMax-boolWidth+boolPadding-rightPadding, yPos-oHeight+boolPadding, xPosMax-boolWidth+oHeight-boolPadding-rightPadding, yPos-boolPadding, 1) + end + + elseif option.type == 'slider' then + local sliderSize = oHeight*0.75 + local sliderPos = 0 + if option.steps then + local min, max = option.steps[1], option.steps[1] + for k, v in ipairs(option.steps) do + if v > max then max = v end + if v < min then min = v end + end + sliderPos = (option.value-min) / (max-min) + else + sliderPos = (option.value-option.min) / (option.max-option.min) + end + glColor(1,1,1,0.11) + RectRound(xPosMax-(sliderSize/2)-sliderWidth-rightPadding, yPos-((oHeight/7)*4.2), xPosMax-(sliderSize/2)-rightPadding, yPos-((oHeight/7)*2.8), 1) + glColor(0.8,0.8,0.8,1) + RectRound(xPosMax-(sliderSize/2)-sliderWidth+(sliderWidth*sliderPos)-(sliderSize/2)-rightPadding, yPos-oHeight+((oHeight-sliderSize)/2), xPosMax-(sliderSize/2)-sliderWidth+(sliderWidth*sliderPos)+(sliderSize/2)-rightPadding, yPos-((oHeight-sliderSize)/2), 1) + optionButtons[oid] = {xPosMax-(sliderSize/2)-sliderWidth+(sliderWidth*sliderPos)-(sliderSize/2)-rightPadding, yPos-oHeight+((oHeight-sliderSize)/2), xPosMax-(sliderSize/2)-sliderWidth+(sliderWidth*sliderPos)+(sliderSize/2)-rightPadding, yPos-((oHeight-sliderSize)/2)} + optionButtons[oid].sliderXpos = {xPosMax-(sliderSize/2)-sliderWidth-rightPadding, xPosMax-(sliderSize/2)-rightPadding} + + elseif option.type == 'select' then + optionButtons[oid] = {xPosMax-selectWidth-rightPadding, yPos-oHeight, xPosMax-rightPadding, yPos} + glColor(1,1,1,0.11) + RectRound(xPosMax-selectWidth-rightPadding, yPos-oHeight, xPosMax-rightPadding, yPos, 2) + if option.options[tonumber(option.value)] ~= nil then + if option.id == 'font2' then + font:End() + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:Print(option.options[tonumber(option.value)], xPosMax-selectWidth+5-rightPadding, yPos-(oHeight/3)-oPadding, oHeight*0.85, "no") + font2:End() + font:Begin() + else + font:SetTextColor(1,1,1,1) + font:Print(option.options[tonumber(option.value)], xPosMax-selectWidth+5-rightPadding, yPos-(oHeight/3)-oPadding, oHeight*0.85, "no") + end + end + glColor(1,1,1,0.11) + RectRound(xPosMax-oHeight-rightPadding, yPos-oHeight, xPosMax-rightPadding, yPos, 1) + glColor(1,1,1,0.16) + glTexture(bgcorner) + glPushMatrix() + glTranslate(xPosMax-(oHeight*0.5)-rightPadding, yPos-(oHeight*0.33), 0) + glRotate(-45,0,0,1) + glTexRect(-(oHeight*0.25),-(oHeight*0.25),(oHeight*0.25),(oHeight*0.25)) + glPopMatrix() + end + end + i = i + 1 + end + end + font:End() +end + + +function correctMouseForScaling(x,y) + local interfaceScreenCenterPosX = (screenX+(screenWidth/2))/vsx + local interfaceScreenCenterPosY = (screenY-(screenHeight/2))/vsy + x = x - (((x/vsx)-interfaceScreenCenterPosX) * vsx)*((widgetScale-1)/widgetScale) + y = y - (((y/vsy)-interfaceScreenCenterPosY) * vsy)*((widgetScale-1)/widgetScale) + return x,y +end + +local sec = 0 +local lastUpdate = 0 +function widget:Update(dt) + if WG['advplayerlist_api'] and not WG['advplayerlist_api'].GetLockPlayerID() then + --if select(7, Spring.GetMouseState()) then -- when camera panning + -- Spring.SetCameraState(Spring.GetCameraState(), cameraPanTransitionTime) + --else + Spring.SetCameraState(Spring.GetCameraState(), cameraTransitionTime) + --end + end + sec = sec + dt + if show and (sec > lastUpdate + 0.5 or forceUpdate) then + forceUpdate = nil + lastUpdate = sec + local changes = true + for i, option in ipairs(options) do + if options[i].widget ~= nil and options[i].type == 'bool' and options[i].value ~= GetWidgetToggleValue(options[i].widget) then + options[i].value = GetWidgetToggleValue(options[i].widget) + changes = true + end + end + if changes then + if windowList then + gl.DeleteList(windowList) + end + windowList = gl.CreateList(DrawWindow) + end + --options[getOptionByID('sndvolmaster')].value = tonumber(Spring.GetConfigInt("snd_volmaster",40) or 40) -- update value because other widgets can adjust this too + --if getOptionByID('sndvolmusic') then + -- if WG['music'] and WG['music'].GetMusicVolume then + -- options[getOptionByID('sndvolmusic')].value = WG['music'].GetMusicVolume() + -- else + -- options[getOptionByID('sndvolmusic')].value = tonumber(Spring.GetConfigInt("snd_volmusic",20) or 20) + -- end + --end + end +end + +function widget:CommandNotify(cmdID, cmdParams, cmdOptions) + if show then + --on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local x,y,ml = Spring.GetMouseState() + local cx, cy = correctMouseForScaling(x,y) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + return true + elseif groupRect ~= nil then + for id,group in pairs(optionGroups) do + if IsOnRect(cx, cy, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then + return true + end + end + end + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + if spIsGUIHidden() then return end + + if showOptionsToggleButton then + glPushMatrix() + glTranslate(posX*vsx, posY*vsy, 0) + glScale(17*widgetScale, 17*widgetScale, 1) + glColor(0, 0, 0, (0.3*bgColorMultiplier)) + glCallList(buttonGL) + glPopMatrix() + end + + -- draw the window + if not windowList then + --windowList = gl.CreateList(DrawWindow) + end + + -- update new slider value + if sliderValueChanged then + gl.DeleteList(windowList) + windowList = gl.CreateList(DrawWindow) + sliderValueChanged = nil + end + + if selectOptionsList then + if WG['guishader'] then + WG['guishader'].RemoveScreenRect('options_select') + WG['guishader'].removeRenderDlist(selectOptionsList) + end + glDeleteList(selectOptionsList) + selectOptionsList = nil + end + + if show or showOnceMore then + + --on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local x,y,ml = Spring.GetMouseState() + local cx, cy = correctMouseForScaling(x,y) + if IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + Spring.SetMouseCursor('cursornormal') + elseif groupRect ~= nil then + for id,group in pairs(optionGroups) do + if IsOnRect(cx, cy, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then + Spring.SetMouseCursor('cursornormal') + break + end + end + elseif titleRect ~= nil and IsOnRect(cx, cy, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then + Spring.SetMouseCursor('cursornormal') + end + -- draw the options panel + glPushMatrix() + glTranslate(-(vsx * (widgetScale-1))/2, -(vsy * (widgetScale-1))/2, 0) + glScale(widgetScale, widgetScale, 1) + glCallList(windowList) + if WG['guishader'] then + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if backgroundGuishader ~= nil then + glDeleteList(backgroundGuishader) + end + backgroundGuishader = glCreateList( function() + -- background + RectRound(rectX1, rectY2, rectX2, rectY1, 9*widgetScale, 0,1,1,1) + -- title + rectX1 = (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY1 = (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2) + rectX2 = (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY2 = (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2) + RectRound(rectX1, rectY1, rectX2, rectY2, 9*widgetScale, 1,1,0,0) + -- tabs + for id,group in pairs(optionGroups) do + if groupRect[id] then + rectX1 = (groupRect[id][1] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY1 = (groupRect[id][2] * widgetScale) - ((vsy * (widgetScale-1))/2) + rectX2 = (groupRect[id][3] * widgetScale) - ((vsx * (widgetScale-1))/2) + rectY2 = (groupRect[id][4] * widgetScale) - ((vsy * (widgetScale-1))/2) + RectRound(rectX1, rectY1, rectX2, rectY2, 9*widgetScale, 1,1,0,0) + end + end + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'options') + end + showOnceMore = false + + -- draw button hover + local usedScreenX = (vsx*0.5) - ((screenWidth/2)*widgetScale) + local usedScreenY = (vsy*0.5) + ((screenHeight/2)*widgetScale) + + -- mouseover (highlight and tooltip) + + local description = '' + local x,y,ml = Spring.GetMouseState() + local cx, cy = correctMouseForScaling(x,y) + + if groupRect ~= nil then + for id,group in pairs(optionGroups) do + if IsOnRect(cx, cy, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then + mouseoverGroupTab(id) + end + end + end + if optionButtonForward ~= nil and IsOnRect(cx, cy, optionButtonForward[1], optionButtonForward[2], optionButtonForward[3], optionButtonForward[4]) then + if ml then + glColor(1,0.91,0.66,0.36) + else + glColor(1,1,1,0.14) + end + RectRound(optionButtonForward[1], optionButtonForward[2], optionButtonForward[3], optionButtonForward[4], (optionButtonForward[4]-optionButtonForward[2])/12) + end + if optionButtonBackward ~= nil and IsOnRect(cx, cy, optionButtonBackward[1], optionButtonBackward[2], optionButtonBackward[3], optionButtonBackward[4]) then + if ml then + glColor(1,0.91,0.66,0.36) + else + glColor(1,1,1,0.14) + end + RectRound(optionButtonBackward[1], optionButtonBackward[2], optionButtonBackward[3], optionButtonBackward[4], (optionButtonBackward[4]-optionButtonBackward[2])/12) + end + + if not showSelectOptions then + for i, o in pairs(optionHover) do + if IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) and options[i].type ~= 'label' then + glColor(1,1,1,0.055) + RectRound(o[1]-4, o[2], o[3]+4, o[4], 2) + font:Begin() + if options[i].description ~= nil then + description = options[i].description + font:Print('\255\235\190\122'..options[i].description, screenX+15, screenY-screenHeight+64.5, 16, "no") + end + font:SetTextColor(0.46,0.4,0.3,0.45) + font:Print('/option '..options[i].id, screenX+screenWidth*0.659, screenY-screenHeight+8, 14, "nr") + font:End() + end + end + for i, o in pairs(optionButtons) do + if IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + gl.Color(0,0,0,0.08) + RectRound(o[1], o[2], o[3], o[4], 1) + if WG['tooltip'] ~= nil and options[i].type == 'slider' then + local value = options[i].value + if options[i].steps then + value = NearestValue(options[i].steps, value) + else + local decimalValue, floatValue = math.modf(options[i].step) + if floatValue ~= 0 then + value = string.format("%."..string.len(string.sub(''..options[i].step, 3)).."f", value) -- do rounding via a string because floats show rounding errors at times + end + end + WG['tooltip'].ShowTooltip('options_showvalue', value) + end + end + end + end + + -- draw select options + if showSelectOptions ~= nil then + + -- highlight all that are affected by presets + if options[showSelectOptions].id == 'preset' then + glColor(1,1,1,0.07) + for optionID, _ in pairs(presets['lowest']) do + optionKey = getOptionByID(optionID) + if optionHover[optionKey] ~= nil then + RectRound(optionHover[optionKey][1], optionHover[optionKey][2]+1.33, optionHover[optionKey][3], optionHover[optionKey][4]-1.33, 1) + end + end + end + + local oHeight = optionButtons[showSelectOptions][4] - optionButtons[showSelectOptions][2] + local oPadding = 4 + y = optionButtons[showSelectOptions][4] -oPadding + local yPos = y + --Spring.Echo(oHeight) + optionSelect = {} + for i, option in pairs(options[showSelectOptions].options) do + yPos = y-(((oHeight+oPadding+oPadding)*i)-oPadding) + end + + selectOptionsList = glCreateList(function() + if WG['guishader'] then + glPushMatrix() + glTranslate(-(vsx * (widgetScale-1))/2, -(vsy * (widgetScale-1))/2, 0) + glScale(widgetScale, widgetScale, 1) + glColor(0.25,0.25,0.25,0.7) + else + glColor(0.25,0.25,0.25,0.85) + end + RectRound(optionButtons[showSelectOptions][1], yPos-oHeight-oPadding, optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4], 2) + glColor(1,1,1,0.07) + RectRound(optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4], 2) + for i, option in pairs(options[showSelectOptions].options) do + yPos = y-(((oHeight+oPadding+oPadding)*i)-oPadding) + if IsOnRect(cx, cy, optionButtons[showSelectOptions][1], yPos-oHeight-oPadding, optionButtons[showSelectOptions][3], yPos+oPadding) then + glColor(1,1,1,0.18) + RectRound(optionButtons[showSelectOptions][1], yPos-oHeight-oPadding, optionButtons[showSelectOptions][3], yPos+oPadding, 2) + if playSounds and (prevSelectHover == nil or prevSelectHover ~= i) then + Spring.PlaySoundFile(selecthoverclick, 0.04, 'ui') + end + prevSelectHover = i + end + optionSelect[#optionSelect+1] = {optionButtons[showSelectOptions][1], yPos-oHeight-oPadding, optionButtons[showSelectOptions][3], yPos+oPadding, i } + + if options[showSelectOptions].optionsFont and fontOption then + fontOption[i]:Begin() + fontOption[i]:Print('\255\255\255\255'..option, optionButtons[showSelectOptions][1]+7, yPos-(oHeight/2.25)-oPadding, oHeight*0.85, "no") + fontOption[i]:End() + else + font:Begin() + font:Print('\255\255\255\255'..option, optionButtons[showSelectOptions][1]+7, yPos-(oHeight/2.25)-oPadding, oHeight*0.85, "no") + font:End() + end + end + if WG['guishader'] then + glPopMatrix() + end + end) + if WG['guishader'] then + local interfaceScreenCenterPosX = (screenX+(screenWidth/2))/vsx + local interfaceScreenCenterPosY = (screenY-(screenHeight/2))/vsy + + -- translate coordinates to actual screen coords (because we applied glscale/gltranlate above) + local x1 = (vsx*interfaceScreenCenterPosX) - (((vsx/2) - optionButtons[showSelectOptions][1]) * widgetScale) + local x2 = (vsx*interfaceScreenCenterPosX) - (((vsx/2) - optionButtons[showSelectOptions][3]) * widgetScale) + local y1 = (vsy*interfaceScreenCenterPosY) - (((vsy/2) - (yPos-oHeight-oPadding)) * widgetScale) + local y2 = (vsy*interfaceScreenCenterPosY) - (((vsy/2) - optionButtons[showSelectOptions][4]) * widgetScale) + WG['guishader'].InsertScreenRect(x1, y1, x2, y2, 'options_select') + WG['guishader'].insertRenderDlist(selectOptionsList) + else + glCallList(selectOptionsList) + end + elseif prevSelectHover ~= nil then + prevSelectHover = nil + end + glPopMatrix() + else + if WG['guishader'] then + WG['guishader'].DeleteDlist('options') + + end + end + if checkedWidgetDataChanges == nil then + checkedWidgetDataChanges = true + loadAllWidgetData() + end +end + +function saveOptionValue(widgetName, widgetApiName, widgetApiFunction, configVar, configValue) + if widgetHandler.configData[widgetName] == nil then + widgetHandler.configData[widgetName] = {} + end + if widgetHandler.configData[widgetName][configVar[1]] == nil then + widgetHandler.configData[widgetName][configVar[1]] = {} + end + if configVar[2] ~= nil and widgetHandler.configData[widgetName][configVar[1]][configVar[2]] == nil then + widgetHandler.configData[widgetName][configVar[1]][configVar[2]] = {} + end + if configVar[2] ~= nil then + if configVar[3] ~= nil then + widgetHandler.configData[widgetName][configVar[1]][configVar[2]][configVar[3]] = configValue + else + widgetHandler.configData[widgetName][configVar[1]][configVar[2]] = configValue + end + else + widgetHandler.configData[widgetName][configVar[1]] = configValue + end + if widgetApiName ~= nil and WG[widgetApiName] ~= nil and WG[widgetApiName][widgetApiFunction] ~= nil then + WG[widgetApiName][widgetApiFunction](configValue) + end +end + +function applyOptionValue(i, skipRedrawWindow) + if options[i] == nil then return end + + if options[i].restart then + changesRequireRestart = true + end + + local id = options[i].id + if options[i].type == 'bool' then + local value = 0 + if options[i].value then + value = 1 + end + if id == 'advmapshading' then + Spring.SendCommands("AdvMapShading "..value) + Spring.SetConfigInt("AdvMapShading",value) + + elseif id == 'advmodelshading' then + Spring.SendCommands("AdvModelShading "..value) + Spring.SetConfigInt("AdvModelShading",value) + elseif id == 'normalmapping' then + Spring.SendCommands("luarules normalmapping "..value) + Spring.SetConfigInt("NormalMapping",value) + elseif id == 'lupsdynamic' then + Spring.SetConfigInt("DynamicLups",value) + elseif id == 'lupsreflectionrefraction' then + Spring.SetConfigInt("lupsreflectionrefraction",value) + elseif id == 'treewind' then + Spring.SendCommands("luarules treewind "..value) + Spring.SetConfigInt("TreeWind",value) + elseif id == 'advsky' then + Spring.SetConfigInt("AdvSky",value) + elseif id == 'timecyclesweathereffects' then + Spring.SetConfigInt("evo_timecyclesweathereffects",value) + Spring.SendCommands("luarules reloadluaui") + elseif id == 'shadows' then + Spring.SendCommands("Shadows "..value) + elseif id == 'vsync' then + Spring.SendCommands("Vsync "..value) + Spring.SetConfigInt("VSync",value) + elseif id == 'fullscreen' then + if value == 1 then + options[getOptionByID('borderless')].value = false + applyOptionValue(getOptionByID('borderless')) + local xres = tonumber(Spring.GetConfigInt('XResolutionWindowed',ssx)) + local yres = tonumber(Spring.GetConfigInt('YResolutionWindowed',ssy)) + Spring.SetConfigInt("XResolution", xres) + Spring.SetConfigInt("YResolution", yres) + else + local xres = tonumber(Spring.GetConfigInt('XResolution',ssx)) + local yres = tonumber(Spring.GetConfigInt('YResolution',ssy)) + Spring.SetConfigInt("XResolutionWindowed", xres) + Spring.SetConfigInt("YResolutionWindowed", yres) + end + Spring.SendCommands("Fullscreen "..value) + Spring.SetConfigInt("Fullscreen",value) + elseif id == 'borderless' then + Spring.SetConfigInt("WindowBorderless",value) + if value == 1 then + options[getOptionByID('fullscreen')].value = false + applyOptionValue(getOptionByID('fullscreen')) + Spring.SetConfigInt("WindowPosX",0) + Spring.SetConfigInt("WindowPosY",0) + Spring.SetConfigInt("WindowState",0) + else + Spring.SetConfigInt("WindowPosX",0) + Spring.SetConfigInt("WindowPosY",0) + Spring.SetConfigInt("WindowState",1) + end + elseif id == 'screenedgemove' then + Spring.SetConfigInt("FullscreenEdgeMove",value) + Spring.SetConfigInt("WindowedEdgeMove",value) + elseif id == 'scrollinverse' then + if value == 1 then + Spring.SetConfigInt("ScrollWheelSpeed",-options[getOptionByID('scrollspeed')].value) + else + Spring.SetConfigInt("ScrollWheelSpeed",options[getOptionByID('scrollspeed')].value) + end + elseif id == 'simpleminimapcolors' then + Spring.SendCommands("minimap simplecolors "..value) + Spring.SetConfigInt("SimpleMiniMapColors",value) + elseif id == 'hwcursor' then + Spring.SendCommands("HardwareCursor "..value) + Spring.SetConfigInt("HardwareCursor",value) + elseif id == 'fpstimespeed' then + Spring.SendCommands("fps "..value) + Spring.SendCommands("clock "..value) + Spring.SendCommands("speed "..value) + + elseif id == 'resourcebarcoloring' then + saveOptionValue('Top Bar', 'topbar', 'setResourceBgTint', {'resourcebarBgTint'}, options[i].value) + elseif id == 'playerlistcollapse' then + saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetCollapsable', {'collapsable'}, options[i].value) + elseif id == 'lockcamera_hideenemies' then + saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetLockHideEnemies', {'lockcameraHideEnemies'}, options[i].value) + elseif id == 'lockcamera_los' then + saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetLockLos', {'lockcameraLos'}, options[i].value) + elseif id == 'allyselunits_select' then + saveOptionValue('Ally Selected Units', 'allyselectedunits', 'setSelectPlayerUnits', {'selectPlayerUnits'}, options[i].value) + elseif id == 'voicenotifs_playtrackedplayernotifs' then + saveOptionValue('Voice Notifs', 'voicenotifs', 'setPlayTrackedPlayerNotifs', {'playTrackedPlayerNotifs'}, options[i].value) + elseif id == 'buildmenushortcuts' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigShortcutsInfo', {'shortcutsInfo'}, options[i].value) + elseif id == 'buildmenuprices' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigUnitPrice', {'drawPrice'}, options[i].value) + elseif id == 'buildmenuradaricons' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigUnitRadaricon', {'drawRadaricon'}, options[i].value) + elseif id == 'buildmenusounds' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigPlaySounds', {'playSounds'}, options[i].value) + elseif id == 'buildmenutooltip' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigUnitTooltip', {'drawTooltip'}, options[i].value) + elseif id == 'buildmenubigtooltip' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigUnitBigTooltip', {'drawBigTooltip'}, options[i].value) + elseif id == 'buildmenulargeicons' then + saveOptionValue('Red Build/Order Menu', 'red_buildmenu', 'setConfigLargeUnitIcons', {'largeUnitIons'}, options[i].value) + elseif id == 'nametags_icon' then + saveOptionValue('Commander Name Tags', 'nametags', 'setDrawForIcon', {'drawForIcon'}, options[i].value) + elseif id == 'sameteamcolors' then + saveOptionValue('Player Color Palette', 'playercolorpalette', 'setSameTeamColors', {'useSameTeamColors'}, options[i].value) + elseif id == 'commandsfxfilterai' then + saveOptionValue('Commands FX', 'commandsfx', 'setFilterAI', {'filterAIteams'}, options[i].value) + elseif id == 'snowmap' then + saveOptionValue('Snow', 'snow', 'setSnowMap', {'snowMaps',Game.mapName:lower()}, options[i].value) + elseif id == 'snowautoreduce' then + saveOptionValue('Snow', 'snow', 'setAutoReduce', {'autoReduce'}, options[i].value) + elseif id == 'dof_highquality' then + saveOptionValue('Depth of Field', 'dof', 'setHighQuality', {'highQuality'}, options[i].value) + elseif id == 'dof_autofocus' then + saveOptionValue('Depth of Field', 'dof', 'setAutofocus', {'autofocus'}, options[i].value) + elseif id == 'sun_reset' then + options[getOptionByID('sun_x')].value = defaultMapSunPos[1] + options[getOptionByID('sun_y')].value = defaultMapSunPos[2] + options[getOptionByID('sun_z')].value = defaultMapSunPos[3] + options[getOptionByID('sun_reset')].value = false + Spring.SetSunDirection(defaultMapSunPos[1],defaultMapSunPos[2],defaultMapSunPos[3]) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity")}) + Spring.Echo('resetted map sun defaults') + customMapSunPos[Game.mapName] = nil + elseif id == 'darkenmap_darkenfeatures' then + saveOptionValue('Darken map', 'darkenmap', 'setDarkenFeatures', {'darkenFeatures'}, options[i].value) + elseif id == 'teamplatter_skipownteam' then + saveOptionValue('TeamPlatter', 'teamplatter', 'setSkipOwnTeam', {'skipOwnTeam'}, options[i].value) + elseif id == 'enemyspotter_highlight' then + saveOptionValue('EnemySpotter', 'enemyspotter', 'setHighlight', {'useXrayHighlight'}, options[i].value) + elseif id == 'underconstructiongfx_shader' then + saveOptionValue('Highlight Selected Units', 'underconstructiongfx', 'setShader', {'useHighlightShader'}, options[i].value) + elseif id == 'highlightselunits_shader' then + saveOptionValue('Highlight Selected Units', 'highlightselunits', 'setShader', {'useHighlightShader'}, options[i].value) + elseif id == 'highlightselunits_teamcolor' then + saveOptionValue('Highlight Selected Units', 'highlightselunits', 'setTeamcolor', {'useTeamcolor'}, options[i].value) + elseif id == 'fancyselectedunits_secondline' then + saveOptionValue('Fancy Selected Units', 'fancyselectedunits', 'setSecondLine', {'showSecondLine'}, options[i].value) + elseif id == 'lighteffects_heatdistortion' then + saveOptionValue('Light Effects', 'lighteffects', 'setHeatDistortion', {'enableHeatDistortion'}, options[i].value) + elseif id == 'lighteffects_deferred' then + saveOptionValue('Light Effects', 'lighteffects', 'setDeferred', {'enableDeferred'}, options[i].value) + elseif id == 'highlightselunits_shader' then + if widgetHandler.configData["Highlight Selected Units"] == nil then + widgetHandler.configData["Highlight Selected Units"] = {} + end + widgetHandler.configData["Highlight Selected Units"].useShader = options[i].value + if WG['highlightselunits'] ~= nil then + WG['highlightselunits'].setShader(options[i].value) + end + elseif id == 'smartselect_includebuildings' then + saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuildings', {'selectBuildingsWithMobile'}, options[i].value) + elseif id == 'smartselect_includebuilders' then + saveOptionValue('SmartSelect', 'smartselect', 'setIncludeBuilders', {'includeBuilders'}, options[i].value) + elseif id == 'lighteffects' then + if value ~= 0 then + if widgetHandler.orderList["Deferred rendering"] ~= nil then + widgetHandler:EnableWidget("Deferred rendering") + end + widgetHandler:EnableWidget("Light Effects") + else + if widgetHandler.orderList["Deferred rendering"] ~= nil then + widgetHandler:DisableWidget("Deferred rendering") + end + widgetHandler:DisableWidget("Light Effects") + end + elseif id == 'autogroup_immediate' then + if widgetHandler.configData["Auto Group"] == nil then + widgetHandler.configData["Auto Group"] = {} + end + if widgetHandler.configData["Auto Group"].config == nil then + widgetHandler.configData["Auto Group"].config = {immediate={value=options[i].value}} + else + widgetHandler.configData["Auto Group"].config.immediate.value = options[i].value + end + saveOptionValue('Auto Group', 'autogroup', 'setImmediate', {'config','immediate','value'}, options[i].value) + elseif id == 'resourceprompts' then + Spring.SetConfigInt("evo_resourceprompts",value) + elseif string.sub(id, 1, 19) == 'voicenotifs_' then + local sound = string.sub(id, 20) + saveOptionValue('Voice Notifs', 'voicenotifs', 'setSound'..sound, {'soundList'}, options[i].value) + elseif id == 'musicplayer' then + if value then + Spring.StopSoundStream() + end + elseif id == 'simplifiedresourcebar' then + Spring.SetConfigInt("evo_simplifiedresourcebar",value) + elseif id == 'buildpichelp' then + Spring.SetConfigInt("evo_buildpichelp",value) + elseif id == 'dynamicmusic' then + Spring.SetConfigInt("evo_dynamicmusic", value) + elseif id == 'interruptmusic' then + Spring.SetConfigInt("evo_interruptmusic", value) + elseif id == 'showcost' then + Spring.SetConfigInt("evo_showcost", value) + if WG.buildOrderUI then WG.buildOrderUI.updateConfigInt = true end + elseif id == 'showtechreq' then + Spring.SetConfigInt("evo_showtechreq", value) + if WG.buildOrderUI then WG.buildOrderUI.updateConfigInt = true end + elseif id == 'showhotkeys' then + Spring.SetConfigInt("evo_showhotkeys", value) + if WG.buildOrderUI then WG.buildOrderUI.updateConfigInt = true end + elseif id == 'ctrl_dequeue' then + Spring.SetConfigInt("evo_ctrl_dequeue", value) + end + + if options[i].widget ~= nil then + if value == 1 then + if id == 'bloom' or id == 'guishader' or id == 'xrayshader' or id == 'snow' or id == 'mapedgeextension' then + if luaShaders ~= 1 and not enabledLuaShaders then + Spring.SetConfigInt("ForceShaders", 1) + enabledLuaShaders = true + end + end + end + if value == 1 then + if widgetHandler.orderList[options[i].widget] < 0.5 then + widgetHandler:EnableWidget(options[i].widget) + end + if id == "fancyselectedunits" and getOptionByID('fancyselectedunits_style') then + options[getOptionByID('fancyselectedunits_style')].options = WG['fancyselectedunits'].getStyleList() + end + else + if widgetHandler.orderList[options[i].widget] > 0 then + widgetHandler:ToggleWidget(options[i].widget) + else + widgetHandler:DisableWidget(options[i].widget) + end + end + forceUpdate = true + if id == "teamcolors" then + Spring.SendCommands("luarules reloadluaui") -- cause several widgets are still using old colors + end + end + + elseif options[i].type == 'slider' then + local value = options[i].value + if id == 'msaa' then + if value > 0 then + Spring.SetConfigInt("MSAALevel",1) + else + Spring.SetConfigInt("MSAALevel",0) + end + Spring.SetConfigInt("FSAALevel",0) -- engine deprecated it in 104.x + Spring.SetConfigInt("MSAALevel",value) + + elseif id == 'vsync2' then + Spring.SetConfigInt("VSync",value) + elseif id == 'shadowslider' then + local enabled = 1 + if value == options.min then + enabled = 0 + end + Spring.SendCommands("shadows "..enabled.." "..value) + Spring.SetConfigInt("shadows", value) + elseif id == 'shadows_maxquality' then + if value < options[getOptionByID('shadows_minquality')].value then + options[getOptionByID('shadows_minquality')].value = value + saveOptionValue('Shadow Quality Manager', 'shadowmanager', 'setMinQuality', {'maxQuality'}, value) + end + saveOptionValue('Shadow Quality Manager', 'shadowmanager', 'setMaxQuality', {'maxQuality'}, value) + elseif id == 'shadows_minquality' then + if value > options[getOptionByID('shadows_maxquality')].value then + options[getOptionByID('shadows_maxquality')].value = value + saveOptionValue('Shadow Quality Manager', 'shadowmanager', 'setMaxQuality', {'maxQuality'}, value) + end + saveOptionValue('Shadow Quality Manager', 'shadowmanager', 'setMinQuality', {'minQuality'}, value) + elseif id == 'shadows_disablefps' then + saveOptionValue('Shadow Quality Manager', 'shadowmanager', 'setDisableFps', {'disableFps'}, value) + elseif id == 'decals' then + Spring.SetConfigInt("GroundDecals", value) + Spring.SendCommands("GroundDecals "..value) + Spring.SetConfigInt("GroundScarAlphaFade", 1) + elseif id == 'scrollspeed' then + if options[getOptionByID('scrollinverse')].value then + Spring.SetConfigInt("ScrollWheelSpeed",-value) + else + Spring.SetConfigInt("ScrollWheelSpeed",value) + end + elseif id == 'disticon' then + if Spring.GetConfigInt("distdraw",1) < 10000 then + Spring.SendCommands("distdraw 10000") + end + Spring.SendCommands("disticon "..value) + elseif id == 'featuredrawdist' then + if getOptionByID('featurefadedist') and value < options[getOptionByID('featurefadedist')].value then + options[getOptionByID('featurefadedist')].value = value + Spring.SetConfigInt("FeatureFadeDistance",value) + end + Spring.SetConfigInt("FeatureDrawDistance",value) + elseif id == 'featurefadedist' then + if getOptionByID('featuredrawdist') and value > options[getOptionByID('featuredrawdist')].value then + options[getOptionByID('featuredrawdist')].value = value + Spring.SetConfigInt("FeatureDrawDistance",value) + end + Spring.SetConfigInt("FeatureFadeDistance",value) + elseif id == 'iconscale' then + Spring.SendCommands("luarules uniticonscale "..value) + elseif id == 'treeradius' then + Spring.SetConfigInt("TreeRadius",value) + elseif id == 'particles' then + Spring.SetConfigInt("MaxParticles",value) + + + elseif id == 'nanobeamamount' then + Spring.SetConfigInt("NanoBeamAmount",value) + elseif id == 'nanoparticles' then + maxNanoParticles = value + if getOptionByID('nanoeffect') and options[getOptionByID('nanoeffect')].value == 2 then + Spring.SetConfigInt("MaxNanoParticles",value) + end + + elseif id == 'grassdetail' then + Spring.SetConfigInt("GrassDetail",value) + elseif id == 'grounddetail' then + Spring.SetConfigInt("GroundDetail", value) + Spring.SendCommands("GroundDetail "..value) + elseif id == 'sndvolmaster' then + Spring.SetConfigInt("snd_volmaster", value) + elseif id == 'sndvolbattle' then + Spring.SetConfigInt("snd_volbattle", value) + elseif id == 'sndvolgeneral' then + Spring.SetConfigInt("snd_volgeneral", value) + elseif id == 'sndvolui' then + Spring.SetConfigInt("snd_volui", value) + elseif id == 'sndvolunitreply' then + Spring.SetConfigInt("snd_volunitreply", value) + elseif id == 'sndairabsorption' then + Spring.SetConfigFloat("snd_airAbsorption", value) + elseif id == 'sndvolmusic' then + if WG['music'] and WG['music'].SetMusicVolume then + WG['music'].SetMusicVolume(value) + else + Spring.SetConfigInt("snd_volmusic", value) + end + elseif id == 'crossalpha' then + Spring.SendCommands("cross "..tonumber(Spring.GetConfigInt("CrossSize",1) or 10).." "..value) + elseif id == 'darkenmap' then + saveOptionValue('Darken map', 'darkenmap', 'setMapDarkness', {'maps',Game.mapName:lower()}, value) + elseif id == 'iconadjuster' then + saveOptionValue('Icon adjuster', 'iconadjuster', 'setScale', {'iconScale'}, value) + elseif id == 'healthbarsscale' then + saveOptionValue('Health Bars', 'healthbars', 'setScale', {'barScale'}, value) + elseif id == 'ssao_strength' then + saveOptionValue('SSAO', 'ssao', 'setStrength', {'strength'}, value) + elseif id == 'ssao_radius' then + saveOptionValue('SSAO', 'ssao', 'setRadius', {'radius'}, value) + elseif id == 'bloomdeferredbrightness' then + saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setBrightness', {'glowAmplifier'}, value) + elseif id == 'bloomdeferredsize' then + saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setBlursize', {'globalBlursizeMult'}, value) + elseif id == 'bloombrightness' then + saveOptionValue('Bloom Shader', 'bloom', 'setBrightness', {'basicAlpha'}, value) + elseif id == 'bloomsize' then + saveOptionValue('Bloom Shader', 'bloom', 'setBlursize', {'globalBlursizeMult'}, value) + elseif id == 'consolemaxlines' then + saveOptionValue('Red Console (In-game chat only)', 'red_chatonlyconsole', 'setMaxLines', {'Config','console','maxlines'}, value) + saveOptionValue('Red Console (old)', 'red_console', 'setMaxLines', {'Config','console','maxlines'}, value) + elseif id == 'consolefontsize' then + saveOptionValue('Red Console (In-game chat only)', 'red_chatonlyconsole', 'setFontsize', {'fontsizeMultiplier'}, value) + saveOptionValue('Red Console (old)', 'red_console', 'setFontsize', {'fontsizeMultiplier'}, value) + elseif id == 'guishaderintensity' then + saveOptionValue('GUI Shader', 'guishader', 'setBlurIntensity', {'blurIntensity'}, value) + elseif id == 'guiopacity' then + Spring.SetConfigFloat("ui_opacity", value) + elseif id == 'snowamount' then + saveOptionValue('Snow', 'snow', 'setMultiplier', {'customParticleMultiplier'}, value) + elseif id == 'dof_focusdepth' then + saveOptionValue('Depth of Field', 'dof', 'setFocusDepth', {'focusDepth'}, value) + elseif id == 'dof_fstop' then + saveOptionValue('Depth of Field', 'dof', 'setFstop', {'fStop'}, value) + elseif id == 'sun_x' then + local sunX,sunY,sunZ = gl.GetSun("pos") + sunX = value + if sunX < options[getOptionByID('sun_x')].min then + sunX = options[getOptionByID('sun_x')].min + end + if sunX > options[getOptionByID('sun_x')].max then + sunX = options[getOptionByID('sun_x')].max + end + options[getOptionByID('sun_x')].value = sunX + Spring.SetSunDirection(sunX,sunY,sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity")}) + customMapSunPos[Game.mapName] = {gl.GetSun("pos")} + elseif id == 'sun_y' then + local sunX,sunY,sunZ = gl.GetSun("pos") + sunY = value + if sunY < options[getOptionByID('sun_y')].min then + sunY = options[getOptionByID('sun_y')].min + end + if sunY > options[getOptionByID('sun_y')].max then + sunY = options[getOptionByID('sun_y')].max + end + options[getOptionByID('sun_y')].value = sunY + Spring.SetSunDirection(sunX,sunY,sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity")}) + customMapSunPos[Game.mapName] = {gl.GetSun("pos")} + elseif id == 'sun_z' then + local sunX,sunY,sunZ = gl.GetSun("pos") + sunZ = value + if sunZ < options[getOptionByID('sun_z')].min then + sunZ = options[getOptionByID('sun_z')].min + end + if sunZ > options[getOptionByID('sun_z')].max then + sunZ = options[getOptionByID('sun_z')].max + end + options[getOptionByID('sun_z')].value = sunZ + Spring.SetSunDirection(sunX,sunY,sunZ) + -- just so that map/model lighting gets updated + Spring.SetSunLighting({groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity")}) + customMapSunPos[Game.mapName] = {gl.GetSun("pos")} + elseif id == 'shadows_opacity' then + Spring.SetSunLighting({groundShadowDensity = value, modelShadowDensity = value}) + elseif id == 'fog_start' then + Spring.SetAtmosphere({fogStart = value}) + if value >= gl.GetAtmosphere("fogEnd") then + value = value + 0.0001 + options[getOptionByID('fog_end')].value = value + Spring.SetAtmosphere({fogEnd = value}) + end + elseif id == 'fog_end' then + Spring.SetAtmosphere({fogEnd = value}) + if value <= gl.GetAtmosphere("fogStart") then + value = value - 0.0001 + options[getOptionByID('fog_start')].value = value + Spring.SetAtmosphere({fogStart = value}) + end + elseif id == 'commandsfxopacity' then + saveOptionValue('Commands FX', 'commandsfx', 'setOpacity', {'opacity'}, value) + elseif id == 'minimapiconsize' then + minimapIconsize = value + Spring.SetConfigFloat("MinimapIconScale", value) + Spring.SendCommands("minimap unitsize "..value) -- spring wont remember what you set with '/minimap iconssize #' + elseif id == 'lighteffects_brightness' then + saveOptionValue('Light Effects', 'lighteffects', 'setGlobalBrightness', {'globalLightMult'}, value) + elseif id == 'lighteffects_radius' then + saveOptionValue('Light Effects', 'lighteffects', 'setGlobalRadius', {'globalRadiusMult'}, value) + elseif id == 'lighteffects_laserbrightness' then + saveOptionValue('Light Effects', 'lighteffects', 'setLaserBrightness', {'globalLightMultLaser'}, value) + elseif id == 'lighteffects_laserradius' then + saveOptionValue('Light Effects', 'lighteffects', 'setLaserRadius', {'globalRadiusMultLaser'}, value) + elseif id == 'lighteffects_life' then + saveOptionValue('Light Effects', 'lighteffects', 'setLife', {'globalLifeMult'}, value) + elseif id == 'teamplatter_opacity' then + saveOptionValue('TeamPlatter', 'teamplatter', 'setOpacity', {'spotterOpacity'}, value) + elseif id == 'enemyspotter_opacity' then + saveOptionValue('EnemySpotter', 'enemyspotter', 'setOpacity', {'spotterOpacity'}, value) + elseif id == 'outline_size' then + saveOptionValue('Outline', 'outline', 'setSize', {'BLUR_SIGMA'}, value) + elseif id == 'outline_strength' then + saveOptionValue('Outline', 'outline', 'setStrength', {'OUTLINE_STRENGTH'}, value) + elseif id == 'underconstructiongfx_opacity' then + saveOptionValue('Highlight Selected Units', 'underconstructiongfx', 'setOpacity', {'highlightAlpha'}, value) + elseif id == 'highlightselunits_opacity' then + saveOptionValue('Highlight Selected Units', 'highlightselunits', 'setOpacity', {'highlightAlpha'}, value) + elseif id == 'fancyselectedunits_opacity' then + saveOptionValue('Fancy Selected Units', 'fancyselectedunits', 'setOpacity', {'spotterOpacity'}, value) + elseif id == 'fancyselectedunits_baseopacity' then + saveOptionValue('Fancy Selected Units', 'fancyselectedunits', 'setBaseOpacity', {'baseOpacity'}, value) + elseif id == 'fancyselectedunits_teamcoloropacity' then + saveOptionValue('Fancy Selected Units', 'fancyselectedunits', 'setTeamcolorOpacity', {'teamcolorOpacity'}, value) + elseif id == 'voicenotifs_volume' then + saveOptionValue('Voice Notifs', 'voicenotifs', 'setVolume', {'volume'}, value) + elseif id == 'lockcamera_transitiontime' then + saveOptionValue('AdvPlayersList', 'advplayerlist_api', 'SetLockTransitionTime', {'transitionTime'}, value) + elseif id == 'playertv_countdown' then + saveOptionValue('Player-TV', 'playertv', 'SetPlayerChangeDelay', {'playerChangeDelay'}, value) + elseif id == 'camerasmoothness' then + cameraTransitionTime = value + elseif id == 'camerapansmoothness' then + cameraPanTransitionTime = value + elseif id == 'fov' then + local current_cam_state = Spring.GetCameraState() + if (current_cam_state.fov) then + current_cam_state.fov = value + Spring.SetCameraState(current_cam_state,0) + end + end + + elseif options[i].type == 'select' then + local value = options[i].value + if id == 'preset' then + Spring.Echo('Loading preset: '..options[i].options[value]) + options[i].value = 0 + loadPreset(presetNames[value]) + elseif id == 'buildordermenu' then + Spring.SetConfigInt("evo_buildorderui",(value-1)) + Spring.SendCommands("luarules reloadluaui") + elseif id == 'water' then + Spring.SendCommands("water "..(value-1)) + Spring.SendCommands("water "..(value-1)) + elseif id == 'lupseffectlevel' then + if WG.Lups then + Spring.SetConfigInt("LupsPriority",value) + --Spring.Echo("option for lups",value,WG.LupsPriority) + end + elseif id == 'font' then + if VFS.FileExists(LUAUI_DIRNAME..'fonts/'..options[i].optionsFont[value]) then + Spring.SetConfigString("ui_font", options[i].optionsFont[value]) + Spring.SendCommands("luarules reloadluaui") + end + elseif id == 'font2' then + if VFS.FileExists(LUAUI_DIRNAME..'fonts/'..options[i].optionsFont[value]) then + Spring.SetConfigString("ui_font2", options[i].optionsFont[value]) + Spring.SendCommands("luarules reloadluaui") + end + elseif id == 'nanoeffect' then + Spring.SetConfigInt("NanoEffect",value) + if value == 1 then + Spring.SetConfigInt("MaxNanoParticles",0) + else + Spring.SetConfigInt("MaxNanoParticles",maxNanoParticles) + end + elseif id == 'bloomdeferredquality' then + saveOptionValue('Bloom Shader Deferred', 'bloomdeferred', 'setPreset', {'qualityPreset'}, value) + elseif id == 'bloomquality' then + saveOptionValue('Bloom Shader', 'bloom', 'setPreset', {'qualityPreset'}, value) + elseif id == 'camera' then + Spring.SetConfigInt("CamMode",(value-1)) + if value == 1 then + Spring.SendCommands('viewfps') + elseif value == 2 then + Spring.SendCommands('viewta') + elseif value == 3 then + Spring.SendCommands('viewspring') + elseif value == 4 then + Spring.SendCommands('viewrot') + elseif value == 5 then + Spring.SendCommands('viewfree') + end + elseif id == 'cursor' then + saveOptionValue('Cursors', 'cursors', 'setcursor', {'cursorSet'}, options[i].options[value]) + elseif id == 'fancyselectedunits_style' then + saveOptionValue('Fancy Selected Units', 'fancyselectedunits', 'setStyle', {'currentOption'}, value) + elseif id == 'resolution' then + local resolutionX = string.match(options[i].options[options[i].value], '[0-9]*') + local resolutionY = string.gsub(string.match(options[i].options[options[i].value], 'x [0-9]*'), 'x ', '') + if tonumber(Spring.GetConfigInt("Fullscreen",1) or 1) == 1 then + Spring.SendCommands("Fullscreen 0") + Spring.SetConfigInt("XResolution", tonumber(resolutionX)) + Spring.SetConfigInt("YResolution", tonumber(resolutionY)) + Spring.SendCommands("Fullscreen 1") + else + Spring.SendCommands("Fullscreen 1") + Spring.SetConfigInt("XResolutionWindowed", tonumber(resolutionX)) + Spring.SetConfigInt("YResolutionWindowed", tonumber(resolutionY)) + Spring.SendCommands("Fullscreen 0") + end + --options[i].value = 0 + end + end + if skipRedrawWindow == nil then + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end +end + +function loadPreset(preset) + for optionID, value in pairs(presets[preset]) do + local i = getOptionByID(optionID) + if options[i] ~= nil then + options[i].value = value + applyOptionValue(i, true) + end + end + + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) +end + + +function widget:KeyPress(key) + if key == 27 then -- ESC + if showSelectOptions then + showSelectOptions = nil + else + show = false + end + end +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + + -- check if the mouse is in a rectangle + return x >= BLcornerX and x <= TRcornerX + and y >= BLcornerY + and y <= TRcornerY +end + + +function round(num, numDecimalPlaces) + local mult = 10^(numDecimalPlaces or 0) + if num >= 0 then return math.floor(num * mult + 0.5) / mult + else return math.ceil(num * mult - 0.5) / mult end +end + + +function NearestValue(table, number) + local smallestSoFar, smallestIndex + for i, y in ipairs(table) do + if not smallestSoFar or (math.abs(number-y) < smallestSoFar) then + smallestSoFar = math.abs(number-y) + smallestIndex = i + end + end + return table[smallestIndex] +end +function getSliderValue(draggingSlider, cx) + local sliderWidth = optionButtons[draggingSlider].sliderXpos[2] - optionButtons[draggingSlider].sliderXpos[1] + local value = (cx - optionButtons[draggingSlider].sliderXpos[1]) / sliderWidth + local min, max + if options[draggingSlider].steps then + min, max = options[draggingSlider].steps[1], options[draggingSlider].steps[1] + for k, v in ipairs(options[draggingSlider].steps) do + if v > max then max = v end + if v < min then min = v end + end + else + min = options[draggingSlider].min + max = options[draggingSlider].max + end + value = min + ((max - min) * value) + if value < min then value = min end + if value > max then value = max end + if options[draggingSlider].steps ~= nil then + value = NearestValue(options[draggingSlider].steps, value) + elseif options[draggingSlider].step ~= nil then + value = math.floor(value / options[draggingSlider].step) * options[draggingSlider].step + end + return value -- is a string now :( +end + +function widget:MouseWheel(up, value) + local x,y = Spring.GetMouseState() + local cx, cy = correctMouseForScaling(x,y) + if show then + return true + end +end + +function widget:MouseMove(x, y) + if draggingSlider ~= nil then + local cx, cy = correctMouseForScaling(x,y) + local newValue = getSliderValue(draggingSlider,cx) + if options[draggingSlider].value ~= newValue then + options[draggingSlider].value = newValue + sliderValueChanged = true + applyOptionValue(draggingSlider) + if playSounds and (lastSliderSound == nil or os.clock() - lastSliderSound > 0.04) then + lastSliderSound = os.clock() + Spring.PlaySoundFile(sliderdrag, 0.4, 'ui') + end + end + end +end + +function widget:MousePress(x, y, button) + return mouseEvent(x, y, button, false) +end + +function widget:MouseRelease(x, y, button) + return mouseEvent(x, y, button, true) +end + + +function mouseEvent(x, y, button, release) + if spIsGUIHidden() then return false end + + local cx, cy = correctMouseForScaling(x,y) + if show then + local cx, cy = correctMouseForScaling(x,y) + if button == 3 then + if titleRect ~= nil and IsOnRect(cx, cy, titleRect[1], titleRect[2], titleRect[3], titleRect[4]) then -- showhow rightmouse doesnt get triggered :S + --Spring.Echo(button..' '..math.random()) + return true + end + if showSelectOptions ~= nil and options[showSelectOptions].id == 'preset' then + for i, o in pairs(optionSelect) do + if IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + if presetNames[o[5]] and customPresets[presetNames[o[5]]] ~= nil then + deletePreset(presetNames[o[5]]) + if playSounds then + Spring.PlaySoundFile(selectclick, 0.5, 'ui') + end + if selectClickAllowHide ~= nil or not IsOnRect(cx, cy, optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4]) then + showSelectOptions = nil + selectClickAllowHide = nil + else + selectClickAllowHide = true + end + return + end + end + end + end + elseif button == 1 then + if release then + + -- navigation buttons + if optionButtonForward ~=nil and IsOnRect(cx, cy, optionButtonForward[1], optionButtonForward[2], optionButtonForward[3], optionButtonForward[4]) then + startColumn = startColumn + maxShownColumns + if startColumn > totalColumns + (maxShownColumns-1) then + startColumn = (totalColumns-maxShownColumns) + 1 + end + if playSounds then + Spring.PlaySoundFile(paginatorclick, 0.6, 'ui') + end + showSelectOptions = nil + selectClickAllowHide = nil + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + return + end + if optionButtonBackward ~= nil and IsOnRect(cx, cy, optionButtonBackward[1], optionButtonBackward[2], optionButtonBackward[3], optionButtonBackward[4]) then + startColumn = startColumn - maxShownColumns + if startColumn < 1 then startColumn = 1 end + if playSounds then + Spring.PlaySoundFile(paginatorclick, 0.6, 'ui') + end + showSelectOptions = nil + selectClickAllowHide = nil + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + return + end + + -- apply new slider value + if draggingSlider ~= nil then + options[draggingSlider].value = getSliderValue(draggingSlider,cx) + applyOptionValue(draggingSlider) + draggingSlider = nil + return + end + + -- select option + if showSelectOptions ~= nil then + for i, o in pairs(optionSelect) do + if IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + options[showSelectOptions].value = o[5] + applyOptionValue(showSelectOptions) + if playSounds then + Spring.PlaySoundFile(selectclick, 0.5, 'ui') + end + end + end + if selectClickAllowHide ~= nil or not IsOnRect(cx, cy, optionButtons[showSelectOptions][1], optionButtons[showSelectOptions][2], optionButtons[showSelectOptions][3], optionButtons[showSelectOptions][4]) then + showSelectOptions = nil + selectClickAllowHide = nil + else + selectClickAllowHide = true + end + return + end + end + + + local tabClicked = false + if show and groupRect ~= nil then + for id,group in pairs(optionGroups) do + if IsOnRect(cx, cy, groupRect[id][1], groupRect[id][2], groupRect[id][3], groupRect[id][4]) then + if not release then + currentGroupTab = group.id + startColumn = 1 + showSelectOptions = nil + selectClickAllowHide = nil + if playSounds then + Spring.PlaySoundFile(paginatorclick, 0.9, 'ui') + end + end + tabClicked = true + returnTrue = true + end + end + end + + -- on window + local rectX1 = ((screenX-bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY1 = ((screenY+bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + local rectX2 = ((screenX+screenWidth+bgMargin) * widgetScale) - ((vsx * (widgetScale-1))/2) + local rectY2 = ((screenY-screenHeight-bgMargin) * widgetScale) - ((vsy * (widgetScale-1))/2) + if tabClicked then + + elseif IsOnRect(x, y, rectX1, rectY2, rectX2, rectY1) then + + + if release then + + -- select option + if showSelectOptions == nil then + if showPresetButtons then + for preset, pp in pairs(presets) do + if IsOnRect(cx, cy, pp.pos[1], pp.pos[2], pp.pos[3], pp.pos[4]) then + loadPreset(preset) + end + end + end + + for i, o in pairs(optionButtons) do + if options[i].type == 'bool' and IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + options[i].value = not options[i].value + applyOptionValue(i) + if playSounds then + if options[i].value then + Spring.PlaySoundFile(toggleonclick, 0.75, 'ui') + else + Spring.PlaySoundFile(toggleoffclick, 0.75, 'ui') + end + end + elseif options[i].type == 'slider' and IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + + elseif options[i].type == 'select' and IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + end + end + end + else -- mousepress + + if not showSelectOptions then + for i, o in pairs(optionButtons) do + if options[i].type == 'slider' and (IsOnRect(cx, cy, o.sliderXpos[1], o[2], o.sliderXpos[2], o[4]) or IsOnRect(cx, cy, o[1], o[2], o[3], o[4])) then + draggingSlider = i + local newValue = getSliderValue(draggingSlider,cx) + if options[draggingSlider].value ~= newValue then + options[draggingSlider].value = getSliderValue(draggingSlider,cx) + applyOptionValue(draggingSlider) + if playSounds then + Spring.PlaySoundFile(sliderdrag, 0.3, 'ui') + end + end + elseif options[i].type == 'select' and IsOnRect(cx, cy, o[1], o[2], o[3], o[4]) then + + if playSounds then + Spring.PlaySoundFile(selectunfoldclick, 0.6, 'ui') + end + if showSelectOptions == nil then + showSelectOptions = i + elseif showSelectOptions == i then + --showSelectOptions = nil + end + end + end + end + end + + if button == 1 or button == 3 then + return true + end + -- on title + elseif titleRect ~= nil and IsOnRect(x, y, (titleRect[1] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[2] * widgetScale) - ((vsy * (widgetScale-1))/2), (titleRect[3] * widgetScale) - ((vsx * (widgetScale-1))/2), (titleRect[4] * widgetScale) - ((vsy * (widgetScale-1))/2)) then + --currentGroupTab = nil + --startColumn = 1 + returnTrue = true + elseif not tabClicked then + if release and draggingSlider == nil then + showOnceMore = true -- show once more because the guishader lags behind, though this will not fully fix it + show = false + end + return true + end + + if show then + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end + if returnTrue then + return true + end + end + elseif showOptionsToggleButton then + tx = (x - posX*vsx)/(17*widgetScale) + ty = (y - posY*vsy)/(17*widgetScale) + if tx < 0 or tx > 5.25 or ty < -0.25 or ty > 1.4 then return false end + if release then + showOnceMore = show -- show once more because the guishader lags behind, though this will not fully fix it + show = not show + end + if show then + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end + return true + end +end + +function GetWidgetToggleValue(widgetname) + if widgetHandler.orderList[widgetname] == nil or widgetHandler.orderList[widgetname] == 0 then + return false + elseif widgetHandler.orderList[widgetname] >= 1 + and widgetHandler.knownWidgets ~= nil + and widgetHandler.knownWidgets[widgetname] ~= nil then + if widgetHandler.knownWidgets[widgetname].active then + return true + else + return 0.5 + end + end +end + +-- configVar = table, add more entries the deeper the configdata table var is: example: {'Config','console','maxlines'} (limit = 3 deep) +function loadWidgetData(widgetName, optionId, configVar) + if widgetHandler.knownWidgets[widgetName] ~= nil then + if getOptionByID(optionId) and widgetHandler.configData[widgetName] ~= nil and widgetHandler.configData[widgetName][configVar[1]] ~= nil then + if configVar[2] ~= nil and widgetHandler.configData[widgetName][configVar[1]][configVar[2]] ~= nil then + if configVar[3] ~= nil and widgetHandler.configData[widgetName][configVar[1]][configVar[2]][configVar[3]] ~= nil then + options[getOptionByID(optionId)].value = widgetHandler.configData[widgetName][configVar[1]][configVar[2]][configVar[3]] + return true + else + options[getOptionByID(optionId)].value = widgetHandler.configData[widgetName][configVar[1]][configVar[2]] + return true + end + elseif options[getOptionByID(optionId)].value ~= widgetHandler.configData[widgetName][configVar[1]] then + options[getOptionByID(optionId)].value = widgetHandler.configData[widgetName][configVar[1]] + return true + end + end + end +end + + +-- loads values via stored game config in luaui/configs +function loadAllWidgetData() + loadWidgetData("Health Bars", "healthbarsscale", {'barScale'}) + + loadWidgetData("Shadow Quality Manager", "shadows_maxquality", {'maxQuality'}) + loadWidgetData("Shadow Quality Manager", "shadows_minquality", {'minQuality'}) + loadWidgetData("Shadow Quality Manager", "shadows_disablefps", {'disableFps'}) + + loadWidgetData("SSAO", "ssao_strength", {'strength'}) + loadWidgetData("SSAO", "ssao_radius", {'radius'}) + + loadWidgetData("Bloom Shader Deferred", "bloomdeferredbrightness", {'glowAmplifier'}) + loadWidgetData("Bloom Shader Deferred", "bloomdeferredsize", {'qualityBlursizeMult'}) + loadWidgetData("Bloom Shader Deferred", "bloomdeferredquality", {'qualityPreset'}) + + loadWidgetData("Bloom Shader", "bloombrightness", {'basicAlpha'}) + loadWidgetData("Bloom Shader", "bloomsize", {'globalBlursizeMult'}) + loadWidgetData("Bloom Shader", "bloomquality", {'qualityPreset'}) + + loadWidgetData("Red Console (In-game chat only)", "consolemaxlines", {'Config','console','maxlines'}) + loadWidgetData("Red Console (In-game chat only)", "consolefontsize", {'fontsizeMultiplier'}) + + loadWidgetData("AdvPlayersList", "lockcamera_hideenemies", {'lockcameraHideEnemies'}) + loadWidgetData("AdvPlayersList", "lockcamera_los", {'lockcameraLos'}) + loadWidgetData("AdvPlayersList", "lockcamera_transitiontime", {'transitionTime'}) + loadWidgetData("AdvPlayersList", "playerlistcollapse", {'collapsable'}) + + loadWidgetData("Top Bar", "resourcebarcoloring", {'resourcebarBgTint'}) + + loadWidgetData("Commander Name Tags", "nametags_icon", {'drawForIcon'}) + + loadWidgetData("Ally Selected Units", "allyselunits_select", {'selectPlayerUnits'}) + + loadWidgetData("Voice Notifs", "voicenotifs_playtrackedplayernotifs", {'playTrackedPlayerNotifs'}) + + loadWidgetData("GUI Shader", "guishaderintensity", {'blurIntensity'}) + + loadWidgetData("Depth of Field", "dof_focusdepth", {'focusDepth'}) + loadWidgetData("Depth of Field", "dof_fstop", {'fStop'}) + loadWidgetData("Depth of Field", "dof_highquality", {'highQuality'}) + loadWidgetData("Depth of Field", "dof_autofocus", {'autofocus'}) + + loadWidgetData("Snow", "snowamount", {'customParticleMultiplier'}) + loadWidgetData("Snow", "snowmap", {'snowMaps',Game.mapName:lower()}) + loadWidgetData("Snow", "snowautoreduce", {'autoReduce'}) + + loadWidgetData("Commands FX", "commandsfxopacity", {'opacity'}) + loadWidgetData("Commands FX", "commandsfxfilterai", {'filterAIteams'}) + + loadWidgetData("TeamPlatter", "teamplatter_opacity", {'spotterOpacity'}) + loadWidgetData("TeamPlatter", "teamplatter_skipownteam", {'skipOwnTeam'}) + + loadWidgetData("EnemySpotter", "enemyspotter_opacity", {'spotterOpacity'}) + loadWidgetData("EnemySpotter", "enemyspotter_highlight", {'useXrayHighlight'}) + + loadWidgetData("Outline", "outline_size", {'BLUR_SIGMA'}) + loadWidgetData("Outline", "outline_strength", {'OUTLINE_STRENGTH'}) + + loadWidgetData("Under construction gfx", "underconstructiongfx_opacity", {'highlightAlpha'}) + loadWidgetData("Under construction gfx", "underconstructiongfx_shader", {'useHighlightShader'}) + + loadWidgetData("Highlight Selected Units", "highlightselunits_opacity", {'highlightAlpha'}) + loadWidgetData("Highlight Selected Units", "highlightselunits_shader", {'useHighlightShader'}) + loadWidgetData("Highlight Selected Units", "highlightselunits_teamcolor", {'useTeamcolor'}) + + loadWidgetData("Fancy Selected Units", "fancyselectedunits_style", {'currentOption'}) + loadWidgetData("Fancy Selected Units", "fancyselectedunits_opacity", {'spotterOpacity'}) + loadWidgetData("Fancy Selected Units", "fancyselectedunits_baseopacity", {'baseOpacity'}) + loadWidgetData("Fancy Selected Units", "fancyselectedunits_teamcoloropacity", {'teamcolorOpacity'}) + loadWidgetData("Fancy Selected Units", "fancyselectedunits_secondline", {'showSecondLine'}) + + loadWidgetData("Voice Notifs", "voicenotifs_volume", {'volume'}) + + loadWidgetData("Defense Range", "defrange_allyair", {'enabled','ally','air'}) + loadWidgetData("Defense Range", "defrange_allyground", {'enabled','ally','ground'}) + loadWidgetData("Defense Range", "defrange_allynuke", {'enabled','ally','nuke'}) + loadWidgetData("Defense Range", "defrange_enemyair", {'enabled','enemy','air'}) + loadWidgetData("Defense Range", "defrange_enemyground", {'enabled','enemy','ground'}) + loadWidgetData("Defense Range", "defrange_enemynuke", {'enabled','enemy','nuke'}) + + loadWidgetData("Light Effects", "lighteffects_brightness", {'globalLightMult'}) + loadWidgetData("Light Effects", "lighteffects_radius", {'globalRadiusMult'}) + loadWidgetData("Light Effects", "lighteffects_laserbrightness", {'globalLightMultLaser'}) + loadWidgetData("Light Effects", "lighteffects_laserradius", {'globalRadiusMultLaser'}) + loadWidgetData("Light Effects", "lighteffects_life", {'globalLifeMult'}) + loadWidgetData("Light Effects", "lighteffects_heatdistortion", {'enableHeatDistortion'}) + loadWidgetData("Light Effects", "lighteffects_deferred", {'enableDeferred'}) + + loadWidgetData("Auto Group", "autogroup_immediate", {'config','immediate','value'}) + + return changes +end + +function lines(str) + local t = {} + local function helper(line) table.insert(t, line) return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + +function init() + + local supportedResolutions = {} + local infolog = VFS.LoadFile("infolog.txt") + if infolog then + local fileLines = lines(infolog) + for i, line in ipairs(fileLines) do + if addResolutions then + local resolution = string.match(line, '[0-9]*x[0-9]*') + if resolution and string.len(resolution) >= 7 then + local resolution = string.gsub(resolution, "x", " x ") + local resolutionX = string.match(resolution, '[0-9]*') + local resolutionY = string.gsub(string.match(resolution, 'x [0-9]*'), 'x ', '') + if tonumber(resolutionX) >= 640 and tonumber(resolutionY) >= 480 then + supportedResolutions[#supportedResolutions+1] = resolution + end + else + break + end + end + if string.find(line, ' display=') then + if addResolutions then + break + end + addResolutions = true + end + end + end + + -- if you want to add an option it should be added here, and in applyOptionValue(), if option needs shaders than see the code below the options definition + optionGroups = { + {id='gfx', name='Graphics'}, + {id='ui', name='Interface'}, + {id='snd', name='Sound'}, + {id='control', name='Control'}, + {id='game', name='Game'}, + } + if not currentGroupTab or Spring.GetGameFrame() == 0 then + currentGroupTab = optionGroups[1].id + else + -- check if group exists + local found = false + for id,group in pairs(optionGroups) do + if group.id == currentGroupTab then + found = true + break + end + end + if not found then + currentGroupTab = optionGroups[1].id + end + end + + options = { + -- PRESET + {id="preset", group="gfx", name="Load graphics preset", type="select", options=presetNames, value=0, description='This wont set the preset every time you restart a game. So feel free to adjust things.\n\nSave custom preset with /savepreset name\nRightclick to delete a custom preset'}, + + --GFX + {id="resolution", group="gfx", name="Resolution", type="select", options=supportedResolutions, value=0, description='WARNING: sometimes freezes game engine in windowed mode'}, + {id="fullscreen", group="gfx", name="Fullscreen", type="bool", value=tonumber(Spring.GetConfigInt("Fullscreen",1) or 1) == 1}, + {id="borderless", group="gfx", name="Borderless window", type="bool", value=tonumber(Spring.GetConfigInt("WindowBorderless",1) or 1) == 1, description="Changes will be applied next game.\n\n(dont forget to turn off the \'fullscreen\' option next game)"}, + {id="windowpos", group="gfx", widget="Move Window Position", name="Move window position", type="bool", value=GetWidgetToggleValue("Move Window Position"), description='Toggle and move window position with the arrow keys or by dragging'}, + {id="vsync", group="gfx", name="V-sync", type="bool", value=tonumber(Spring.GetConfigInt("VSync",1) or 1) == 1, description=''}, + {id="msaa", group="gfx", name="Anti Aliasing", type="slider", steps={0,1,2,4,8,16}, restart=true, value=tonumber(Spring.GetConfigInt("MSAALevel",1) or 8), description='Enables multisample anti-aliasing. NOTE: Can be expensive!\n\nChanges will be applied next game'}, + {id="advmapshading", group="gfx", name="Advanced map shading", type="bool", value=tonumber(Spring.GetConfigInt("AdvMapShading",1) or 1) == 1, description='When disabled: map shadows aren\'t rendered as well'}, + {id="advmodelshading", group="gfx", name="Advanced model shading", type="bool", value=tonumber(Spring.GetConfigInt("AdvModelShading",1) or 1) == 1}, + {id="advsky", group="gfx", name="Advanced sky", type="bool", restart=true, value=tonumber(Spring.GetConfigInt("AdvSky",1) or 1) == 1, description='Enables high resolution clouds\n\nChanges will be applied next game'}, + + -- only one of these shadow options are shown, depending if "Shadow Quality Manager" widget is active + {id="shadows", group="gfx", name="Shadows", type="bool", value=tonumber(Spring.GetConfigInt("Shadows",1) or 1) == 1, description='Shadow detail is currently controlled by "Shadow Quality Manager" widget\n...this widget will auto reduce detail when fps gets low.\n\nShadows requires "Advanced map shading" option to be enabled'}, + {id="shadowslider", group="gfx", name="Shadows", type="slider", steps={1024,2048,4096,8192}, value=tonumber(Spring.GetConfigInt("ShadowMapSize",1) or 4096), description='Set shadow detail'}, + {id="shadows_maxquality", group="gfx", name=widgetOptionColor.." max quality", min=1024, max=8192, step=1024, type="slider", value=8192, description='Maximum shadow detail when having high Frames Per Second'}, + {id="shadows_minquality", group="gfx", name=widgetOptionColor.." min quality", min=1024, max=8192, step=1024, type="slider", value=1024, description='Minimum shadow detail when having low Frames Per Second'}, + --{id="shadows_disablefps", group="gfx", name=widgetOptionColor.." disable at FPS", min=0, max=30, step=1, type="slider", value=0, description='Automaticly disables shadows at this average FPS value'}, + + {id="shadows_opacity", group="gfx", name=widgetOptionColor.." opacity", type="slider", min=0.3, max=1, step=0.01, value=gl.GetSun("shadowDensity"), description=''}, + + {id="decals", group="gfx", name="Ground decals", type="slider", min=0, max=5, step=1, value=tonumber(Spring.GetConfigInt("GroundDecals",1) or 1), description='Set how long map decals will stay.\n\nDecals are ground scars, footsteps/tracks and shading under buildings'}, + {id="grounddetail", group="gfx", name="Ground detail", type="slider", min=32, max=200, step=1, value=tonumber(Spring.GetConfigInt("GroundDetail",1) or 1), description='Set how detailed the map mesh/model is. Note that detail over 120 is largely unnoticeable.\n64 is a good default amount for playing that will not cost unnecessary fps.'}, + {id="water", group="gfx", name="Water type", type="select", options={'basic','reflective','dynamic','reflective&refractive','bump-mapped'}, value=(tonumber(Spring.GetConfigInt("Water",1) or 1)+1)}, + + {id="bloomdeferred", group="gfx", widget="Bloom Shader Deferred", name="Bloom (unit)", type="bool", value=GetWidgetToggleValue("Bloom Shader Deferred"), description='Unit highlights and lights will glow.\n\n(via deferred rendering = less lag)'}, + {id="bloomdeferredbrightness", group="gfx", name=widgetOptionColor.." brightness", type="slider", min=0.4, max=1.1, step=0.05, value=1, description=''}, + --{id="bloomdeferredsize", group="gfx", name=widgetOptionColor.." size", type="slider", min=0.8, max=1.5, step=0.05, value=1, description=''}, + --{id="bloomdeferredquality", group="gfx", name=widgetOptionColor.." quality", type="select", options={'low','medium'}, value=1, description='Render quality'}, + + {id="bloom", group="gfx", widget="Bloom Shader", name="Bloom (global)", type="bool", value=GetWidgetToggleValue("Bloom Shader"), description='Bloom will make the map and units glow\n\n(might result in more laggy experience)'}, + {id="bloombrightness", group="gfx", name=widgetOptionColor.." brightness", type="slider", min=0.15, max=0.5, step=0.05, value=0.25, description=''}, + --{id="bloomsize", group="gfx", name=widgetOptionColor.." size", type="slider", min=0.9, max=1.5, step=0.05, value=1.1, description=''}, + --{id="bloomquality", group="gfx", name=widgetOptionColor.." quality", type="select", options={'low','medium'}, value=1, description='Render quality'}, + + {id="mapedgeextension", group="gfx", widget="Map Edge Extension", name="Map edge extension", type="bool", value=GetWidgetToggleValue("Map Edge Extension"), description='Mirrors the map at screen edges and darkens and decolorizes them\n\nEnable shaders for best result'}, + --{id="grassdetail", group="gfx", name="Grass", type="slider", min=0, max=10, step=1, value=tonumber(Spring.GetConfigInt("GrassDetail",1) or 5), description='Amount of grass rendered\n\nChanges will be applied next game'}, + + {id="darkenmap", group="gfx", name="Darken map", min=0, max=0.5, step=0.01, type="slider", value=0, description='Darkens the whole map (not the units)\n\nRemembers setting per map\nUse /resetmapdarkness if you want to reset all stored map settings'}, + {id="darkenmap_darkenfeatures", group="gfx", name=widgetOptionColor.." darken features", type="bool", value=false, description='Darkens features (trees, wrecks, ect..) along with darken map slider above\n\nNOTE: Can be CPU intensive: it cycles through all visible features \nand renders them another time.'}, + + {id="sun_y", group="gfx", name="Sun height", type="slider", min=0.05, max=0.9999, step=0.0001, value=select(2,gl.GetSun("pos")), description=''}, + {id="sun_x", group="gfx", name=widgetOptionColor.." pos X", type="slider", min=-0.9999, max=0.9999, step=0.0001, value=select(1,gl.GetSun("pos")), description=''}, + {id="sun_z", group="gfx", name=widgetOptionColor.." pos Z", type="slider", min=-0.9999, max=0.9999, step=0.0001, value=select(3,gl.GetSun("pos")), description=''}, + {id="sun_reset", group="gfx", name=widgetOptionColor.." reset map default", type="bool", value=false, description=''}, + + {id="ssao", group="gfx", widget="SSAO", name="SSAO", type="bool", value=GetWidgetToggleValue("SSAO"), description='Screen-Space Ambient Occlusion.'}, + {id="ssao_strength", group="gfx", name=widgetOptionColor.." strength", type="slider", min=1, max=5, step=0.05, value=3.5, description=''}, + {id="ssao_radius", group="gfx", name=widgetOptionColor.." radius", type="slider", min=4, max=7, step=1, value=4, description=''}, + + {id="dof", group="gfx", widget="Depth of Field", name="Depth of Field", type="bool", value=GetWidgetToggleValue("Depth of Field"), description='Applies out of focus blur'}, + {id="dof_autofocus", group="gfx", name=widgetOptionColor.." autofocus", type="bool", value=true, description='Disable to have mouse position focus'}, + --{id="dof_focusdepth", group="gfx", name=widgetOptionColor.." focus depth", type="slider", min=0, max=2000, step=1, value=300, description=''}, + {id="dof_fstop", group="gfx", name=widgetOptionColor.." f-stop", type="slider", min=1, max=16, step=0.1, value=3, description='Set amount of blur\n\nOnly works if autofocus is off'}, + --{id="dof_highquality", group="gfx", name=widgetOptionColor.." high quality", type="bool", value=false, description=''}, + + {id="outline", group="gfx", widget="Outline", name="Unit outline", type="bool", value=GetWidgetToggleValue("Outline"), description='Adds a small outline to all units which makes them crisp.'}, + {id="outline_size", group="gfx", name=widgetOptionColor.." size", min=0.5, max=3, step=0.05, type="slider", value=1, description='Set the size of the outline'}, + --{id="outline_strength", group="gfx", name=widgetOptionColor.." opacity", min=1, max=6, step=0.05, type="slider", value=2.5, description='Set the opacity of the outline'}, + + {id="disticon", group="gfx", name="Strategic icon distance", type="slider", min=0, max=900, step=10, value=tonumber(Spring.GetConfigInt("UnitIconDist",1) or 400), description='Set a lower value to get better performance'}, + {id="iconscale", group="gfx", name=widgetOptionColor.." scale", type="slider", min=0.85, max=1.35, step=0.05, value=tonumber(Spring.GetConfigFloat("UnitIconScale",1.15) or 1.05), description='Note that the minimap icon size is affected as well'}, + {id="minimapiconsize", group="gfx", name=widgetOptionColor.." minimap scale", type="slider", min=1.5, max=5, step=0.25, value=tonumber(Spring.GetConfigFloat("MinimapIconScale",3.5) or 1), description=''}, + + {id="featuredrawdist", group="gfx", name="Feature draw distance", type="slider", min=2500, max=15000, step=500, value=tonumber(Spring.GetConfigInt("FeatureDrawDistance",6000) or 400), description='Features (trees, stones, wreckage) stop being displayed at this distance'}, + + {id="lighteffects", group="gfx", name="Light effects", type="bool", value=GetWidgetToggleValue("Light Effects"), description='Adds lights to projectiles, lasers and explosions.\n\nRequires shaders.'}, + --{id="lighteffects_deferred", group="gfx", name=widgetOptionColor.." real map and model lights", type="bool", value=true, description='Otherwise simple ground flashes instead of actual map and model lighting.\n\nExpensive for the gpu when lots of (big) lights are there or when you zoom in on them.'}, + --{id="lighteffects_heatdistortion", group="gfx", name=widgetOptionColor.." apply heat distortion", type="bool", value=true, description='Enables a distortion on top of explosions to simulate heat'}, + {id="lighteffects_life", group="gfx", name=widgetOptionColor.." lifetime", min=0.25, max=1, step=0.05, type="slider", value=0.6, description='lifetime of explosion lights'}, + {id="lighteffects_brightness", group="gfx", name=widgetOptionColor.." brightness", min=1, max=5, step=0.1, type="slider", value=2.5, description='Set the brightness of the lights'}, + {id="lighteffects_radius", group="gfx", name=widgetOptionColor.." radius", min=1, max=2, step=0.1, type="slider", value=1.2, description='Set the radius of the lights\n\nWARNING: the bigger the radius the heavier on the GPU'}, + {id="lighteffects_laserbrightness", group="gfx", name=widgetOptionColor.." laser brightness", min=0.4, max=2, step=0.1, type="slider", value=1.2, description='laser lights brightness RELATIVE to global light brightness set above'}, + {id="lighteffects_laserradius", group="gfx", name=widgetOptionColor.." laser radius", min=0.4, max=2, step=0.1, type="slider", value=1, description='laser lights radius RELATIVE to global light radius set above\n\nWARNING: the bigger the radius the heavier on the GPU'}, + + {id="lups", group="gfx", widget="LupsManager", name="Lups particle/shader effects", type="bool", value=GetWidgetToggleValue("LupsManager"), description='Toggle unit particle effects: jet beams, ground flashes, fusion energy balls'}, + + {id="xrayshader", group="gfx", widget="XrayShader", name="Unit xray shader", type="bool", value=GetWidgetToggleValue("XrayShader"), description='Highlights all units, highlight effect dissolves on close camera range.\n\nFades out and disables at low fps\nWorks less on dark teamcolors'}, + {id="particles", group="gfx", name="Max particles", type="slider", min=5000, max=25000, step=500, value=tonumber(Spring.GetConfigInt("MaxParticles",1) or 10000), description='Particles used for explosions, smoke, fire and missiletrails\n\nSetting a low value will mean that various effects wont show properly'}, + {id="nanoparticles", group="gfx", name="Max nano particles", type="slider", min=0, max=5000, step=100, value=tonumber(Spring.GetConfigInt("MaxNanoParticles",1) or 500), description='NOTE: Nano particles are more expensive regarding the CPU'}, + + --{id="treeradius", group="gfx", name="Tree render distance", type="slider", restart=true, min=0, max=2000, step=50, value=tonumber(Spring.GetConfigInt("TreeRadius",1) or 1000), description='Applies to SpringRTS engine default trees\n\nChanges will be applied next game'}, + + {id="timecyclesweathereffects", group="gfx", name="Day/Night/Weather Cycles", type="bool", value=tonumber(Spring.GetConfigInt("evo_timecyclesweathereffects",0) or 0) == 1, description='Enables Day/Night Cycles and Weather Effects\n\nTHIS IS HIGHLY EXPERIMENTAL!!! *Could Cause Crashes on older hardware!!!*\n*NOTE* This will cause all widgets to reload'}, + {id="snow", group="gfx", widget="Snow", name="Snow", type="bool", value=GetWidgetToggleValue("Snow"), description='Snow widget (By default.. maps with wintery names have snow applied)'}, + {id="snowmap", group="gfx", name=widgetOptionColor.." enabled on this map", type="bool", value=true, description='It will remember what you toggled for every map\n\n\(by default: maps with wintery names have this toggled)'}, + {id="snowautoreduce", group="gfx", name=widgetOptionColor.." auto reduce", type="bool", value=true, description='Automaticly reduce snow when average FPS gets lower\n\n(re-enabling this needs time to readjust to average fps again'}, + {id="snowamount", group="gfx", name=widgetOptionColor.." amount", type="slider", min=0.2, max=2, step=0.2, value=1, description='Tip: disable "auto reduce" option temporarily to see the max snow amount you have set'}, + + {id="dofintensity", group="gfx", name="DoF intensity", type="slider", min=0.05, max=5, step=0.01, value=1.5, description='Enable Depth of Field with F8 first'}, + + {id="resurrectionhalos", group="gfx", widget="Resurrection Halos", name="Resurrected unit halos", type="bool", value=GetWidgetToggleValue("Resurrection Halos"), description='Gives units have have been resurrected a little halo above it.'}, + {id="tombstones", group="gfx", widget="Tombstones", name="Tombstones", type="bool", value=GetWidgetToggleValue("Tombstones"), description='Displays tombstones where commanders died'}, + {id="rankicons", group="gfx", widget="Rank Icons", name="Rank icons", type="bool", value=GetWidgetToggleValue("Rank Icons"), description='Shows a rank icon depending on experience next to units'}, + + {id="underconstructiongfx", group="gfx", widget="Under construction gfx", name="Under construction highlight", type="bool", value=GetWidgetToggleValue("Under construction gfx"), description='Highlights unit models when under construction'}, + {id="underconstructiongfx_opacity", group="gfx", name=widgetOptionColor.." opacity", min=0.25, max=0.5, step=0.01, type="slider", value=0.2, description='Set the opacity of the highlight on selected units'}, + {id="underconstructiongfx_shader", group="gfx", name=widgetOptionColor.." use shader", type="bool", value=false, description='Highlight model edges a bit'}, + + -- SND + {id="sndvolmaster", group="snd", name="Master volume", type="slider", min=0, max=200, step=2, value=tonumber(Spring.GetConfigInt("snd_volmaster",1) or 100)}, + --{id="sndvolgeneral", group="snd", name="General volume", type="slider", min=0, max=100, step=2, value=tonumber(Spring.GetConfigInt("snd_volgeneral",1) or 100)}, + {id="sndvolbattle", group="snd", name="Battle volume", type="slider", min=0, max=100, step=2, value=tonumber(Spring.GetConfigInt("snd_volbattle",1) or 100)}, + {id="sndvolui", group="snd", name="Interface volume", type="slider", min=0, max=100, step=2, value=tonumber(Spring.GetConfigInt("snd_volui",1) or 100)}, + {id="sndvolunitreply", group="snd", name="Unit reply volume", type="slider", min=0, max=100, step=2, value=tonumber(Spring.GetConfigInt("snd_volunitreply",1) or 100)}, + {id="sndvolmusic", group="snd", name="Music volume", type="slider", min=0, max=100, step=2, value=tonumber(Spring.GetConfigInt("snd_volmusic",1) or 20)}, + {id="dynamicmusic", group="snd", name="Dynamic Music", type="bool", value=tonumber(Spring.GetConfigInt("evo_dynamicmusic",1) or 1) == 1, description="If enabled, Music trackks will dynamically switch between war and peace depending on what is going on at that moment."}, + {id="interruptmusic", group="snd", name="Dynamic Music Interruption", type="bool", value=tonumber(Spring.GetConfigInt("evo_interruptmusic",1) or 1) == 1, description="If enabled, Music tracks will fade out and switch from peace to war \nand vice versa at that moment instead of allowing the entire peace or war track to finish first."}, + --{id="sndairabsorption", group="snd", name="Air absorption", type="slider", min=0, max=0.5, step=0.01, value=tonumber(Spring.GetConfigInt("snd_airAbsorption",1) or.1)}, + {id="musicplayer", group="snd", widget="Music Player", name="Music player", type="bool", value=GetWidgetToggleValue("Music Player"), description='Shown on top of (adv)playerlist'}, + {id="buildmenusounds", group="snd", name="Buildmenu click sounds", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigPlaySounds~= nil and WG['red_buildmenu'].getConfigPlaySounds()), description='Plays a sound when clicking on orders or buildmenu icons'}, + + {id="voicenotifs", group="snd", widget="Voice Notifs", name="Voice notifications", type="bool", value=GetWidgetToggleValue("Voice Notifs"), description='Plays various voice notifications\n\nAdjust volume with the interface volume slider'}, + {id="voicenotifs_playtrackedplayernotifs", group="snd", name=widgetOptionColor.." tracked cam/player notifs",type="bool", value=(WG['voicenotifs']~=nil and WG['voicenotifs'].getPlayTrackedPlayerNotifs()), description='Play voice notifs from the perspective of the currently camera tracked player'}, + {id="voicenotifs_volume", group="snd", name=widgetOptionColor.." volume", type="slider", min=0.05, max=1, step=0.05, value=1, description='NOTE: It uses interface volume channel'}, + + -- CONTROL + {id="camera", group="control", name="Camera", type="select", options={'fps','overhead','spring','rot overhead','free'}, value=(tonumber((Spring.GetConfigInt("CamMode",1)+1) or 2))}, + {id="camerashake", group="control", widget="CameraShake", name="Camera shake", type="bool", value=GetWidgetToggleValue("CameraShake"), description='Shakes camera on explosions'}, + {id="camerasmoothness", group="control", name="Camera smoothing", type="slider", min=0, max=2, step=0.01, value=cameraTransitionTime, description="How smooth should the transitions between camera movement be?"}, + {id="lockcamera_transitiontime", group="control", name="Tracking cam smoothing", type="slider", min=0.4, max=1.5, step=0.01, value=(WG['advplayerlist_api']~=nil and WG['advplayerlist_api'].GetLockTransitionTime~=nil and WG['advplayerlist_api'].GetLockTransitionTime()), description="When viewing a players camera...\nhow smooth should the transitions between camera movement be?"}, + + {id="scrollspeed", group="control", name="Scroll zoom speed", type="slider", min=1, max=45, step=1, value=math.abs(tonumber(Spring.GetConfigInt("ScrollWheelSpeed",1) or 25)), description=''}, + {id="scrollinverse", group="control", name="Scroll inversed", type="bool", value=(tonumber(Spring.GetConfigInt("ScrollWheelSpeed",1) or 25) < 0), description=""}, + + {id="hwcursor", group="control", name="Hardware cursor", type="bool", value=tonumber(Spring.GetConfigInt("hardwareCursor",1) or 1) == 1, description="When disabled: the mouse cursor refresh rate will be the same as your ingame fps"}, + {id="crossalpha", group="control", name="Mouse cross alpha", type="slider", min=0, max=1, step=0.05, value=tonumber(Spring.GetConfigString("CrossAlpha",1) or 1), description='Opacity of mouse icon in center of screen when you are in camera pan mode\n\n(The\'icon\' has a dot in center with 4 arrows pointing in all directions)'}, + {id="screenedgemove", group="control", name="Screen edge moves camera", type="bool", restart=true, value=tonumber(Spring.GetConfigInt("FullscreenEdgeMove",1) or 1) == 1, description="If mouse is close to screen edge this will move camera\n\nChanges will be applied next game"}, + {id="containmouse", group="control", widget="Grabinput", name="Contain mouse inside window", type="bool", value=GetWidgetToggleValue("Grabinput"), description='When you are in windowed mode, this will keep your mouse from moving out of it'}, + {id="allyselunits_select", group="control", name="Select units of tracked player", type="bool", value=(WG['allyselectedunits']~=nil and WG['allyselectedunits'].getSelectPlayerUnits()), description="When viewing a players camera, this will also select the units the player has selected"}, + {id="lockcamera_hideenemies", group="control", name="Only show tracked player viewpoint", type="bool", value=(WG['advplayerlist_api']~=nil and WG['advplayerlist_api'].GetLockHideEnemies()), description="When viewing a players camera, this will only display what the tracked player sees"}, + {id="lockcamera_los", group="control", name=widgetOptionColor.." show tracked player LoS", type="bool", value=(WG['advplayerlist_api']~=nil and WG['advplayerlist_api'].GetLockLos()), description="When viewing a players camera and los, shows shaded los ranges too"}, + + -- UI + {id="buildordermenu", group="ui", name="Build Menu Preset", type="select", options={'Horizontal','Compact Horizontal','Traditional', 'Traditional (SxS)','Right Side','Right Side Compact'}, value=Spring.GetConfigInt("evo_buildorderui",0) + 1, description='Use these presets to change the build menu size and position.\nBuild and Order menus can further be custom positioned using TweakMode (ctrl+f11)\n\nNOTE: Changing this setting will cause the interface to be reloaded'}, + {id="showcost", group="ui", name="Show Cost", type="bool", value=Spring.GetConfigInt("evo_showcost",1) == 1, description='Show cost of units in the build icon'}, + {id="showtechreq", group="ui", name="Show Tech Requirement", type="bool", value=Spring.GetConfigInt("evo_showtechreq",1) == 1, description='Show tech requirement of units in the build icon'}, + {id="showhotkeys", group="ui", name="Show Build Hotkeys", type="bool", value=Spring.GetConfigInt("evo_showhotkeys",1) == 1, description='Show build hotkeys in the build icon'}, + + {id="teamcolors", group="ui", widget="Player Color Palette", name="Team colors based on a palette", type="bool", value=GetWidgetToggleValue("Player Color Palette"), description='Replaces lobby team colors for a color palette based one\n\nNOTE: reloads all widgets because these need to update their teamcolors'}, + {id="sameteamcolors", group="ui", name=widgetOptionColor.." same team colors", type="bool", value=(WG['playercolorpalette']~=nil and WG['playercolorpalette'].getSameTeamColors~=nil and WG['playercolorpalette'].getSameTeamColors()), description='Use the same teamcolor for all the players in a team\n\nNOTE: reloads all widgets because these need to update their teamcolors'}, + + {id="simpleminimapcolors", group="ui", name="Simple minimap colors", type="bool", value=tonumber(Spring.GetConfigInt("SimpleMiniMapColors",0) or 0) == 1, description="Enable simple minimap teamcolors\nRed is enemy,blue is ally and you are green!"}, + + {id="font", group="ui", name="Font", type="select", options={}, value=1, description='Regular read friendly font used for text'}, + {id="font2", group="ui", name="Font 2", type="select", options={}, value=1, description='Stylistic font mainly used for names/buttons/titles'}, + {id="guiopacity", group="ui", name="GUI opacity", type="slider", min=0, max=1, step=0.01, value=Spring.GetConfigFloat("ui_opacity",0.66), description=''}, + + {id="guishader", group="ui", widget="GUI Shader", name="GUI blur", type="bool", value=GetWidgetToggleValue("GUI Shader"), description='Blurs the world under every user interface element'}, + {id="guishaderintensity", group="ui", name=widgetOptionColor.." intensity", type="slider", min=0.001, max=0.003, step=0.0001, value=0.002, description=''}, + + {id="autoquit", group="ui", widget="Autoquit", name="Auto quit", type="bool", value=GetWidgetToggleValue("Autoquit"), description='Automatically quits after the game ends.\n...unless the mouse has been moved within a few seconds.'}, + + --{id="showbuilderqueue", group="ui", widget="Show Builder Queue", name="Show Builder Queue", type="bool", value=GetWidgetToggleValue("Show Builder Queue"), description='Shows ghosted buildings about to be built on the map'}, + + {id="healthbarsscale", group="ui", name="Health Bars Scale", type="slider", min=0.7, max=1.31, step=0.1, value=1, description=''}, + + {id="consolemaxlines", group="ui", name="Console max lines", type="slider", min=3, max=9, step=1, value=6, description=''}, + {id="consolefontsize", group="ui", name="Console font size", type="slider", min=0.9, max=1.1, step=0.05, value=1, description=''}, + + --{id="buildmenuoldicons", group="ui", name="Buildmenu old unit icons", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigOldUnitIcons()), description='Use the old unit icons in the buildmenu\n\n(reselect something to see the change applied)'}, + {id="buildmenushortcuts", group="ui", name="Buildmenu shortcuts", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigShortcutsInfo()), description='Enables and shows shortcut keys in the buildmenu\n\n(reselect something to see the change applied)'}, + {id="buildmenuprices", group="ui", name="Buildmenu prices", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigUnitPrice~=nil and WG['red_buildmenu'].getConfigUnitPrice()), description='Enables and shows unit prices in the buildmenu\n\n(reselect something to see the change applied)'}, + {id="buildmenulargeicons", group="ui", name="Buildmenu large icons", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigLargeUnitIcons~=nil and WG['red_buildmenu'].getConfigLargeUnitIcons()), description='Use large unit icons'}, + {id="buildmenutooltip", group="ui", name="Buildmenu tooltip", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigUnitTooltip~=nil and WG['red_buildmenu'].getConfigUnitTooltip()), description='Enables unit tooltip when hovering over unit in buildmenu'}, + {id="buildmenubigtooltip", group="ui", name=widgetOptionColor.." extensive unit info", type="bool", value=(WG['red_buildmenu']~=nil and WG['red_buildmenu'].getConfigUnitBigTooltip~=nil and WG['red_buildmenu'].getConfigUnitBigTooltip()), description='Displays elaborative unit description when availible'}, + {id="buildpichelp", group="ui", name="Flashing Buildpic Help", type="bool", value=tonumber(Spring.GetConfigInt("evo_buildpichelp",1) or 1) == 1, description="Flashes relevant build menu items when resources are in a crisis situation"}, + + {id="resourceprompts", group="ui", name="Audio/Visual Helper Prompts", type="bool", value=tonumber(Spring.GetConfigInt("evo_resourceprompts",1) or 1) == 1, description="If enabled, messages will be sent to the chat as well as\naudio cues when your resources need attention"}, + {id="simplifiedresourcebar", group="ui", name="Simplified Resource Bar", type="bool", value=tonumber(Spring.GetConfigInt("evo_simplifiedresourcebar",1) or 1) == 1, description="Removes extra information from the resource bar"}, + + --{id="fancyselunits", group="gfx", widget="Fancy Selected Units", name="Fancy Selected Units", type="bool", value=GetWidgetToggleValue("Fancy Selected Units"), description=''}, + + --{id="fpstimespeed", group="ui", name="Display FPS, GameTime and Speed", type="bool", value=tonumber(Spring.GetConfigInt("ShowFPS",1) or 1) == 1, description='Located at the top right of the screen\n\nIndividually toggle them with /fps /clock /speed'}, + {id="playerlistcollapse", group="ui", name="Playerlist auto collapses", type="bool", value=false, description='Auto collapses the playerlist, mouseover will show it again'}, + {id="fpstimespeed-widget", group="ui", widget="AdvPlayersList info", name="Playerlist time/speed/fps", type="bool", value=GetWidgetToggleValue("AdvPlayersList info"), description='Shows time, gamespeed and fps on top of the (adv)playerslist'}, + --{id="mascotte", group="ui", widget="AdvPlayersList mascotte", name="Playerlist mascotte", type="bool", value=GetWidgetToggleValue("AdvPlayersList mascotte"), description='Shows a mascotte on top of the (adv)playerslist'}, + + {id="displaydps", group="ui", widget="Display DPS", name="Display DPS", type="bool", value=GetWidgetToggleValue("Display DPS"), description='Display the \'Damage Per Second\' done where target are hit'}, + + {id="nametags_icon", group="ui", name="Commander name on icon", type="bool", value=(WG['nametags']~=nil and WG['nametags'].getDrawForIcon()), description='Show commander name when its displayed as icon'}, + + {id="idlebuilders", group="ui", widget="Idle Builders", name="List Idle builders", type="bool", value=GetWidgetToggleValue("Idle Builders"), description='Displays a row containing a list of idle builder units (if there are any)'}, + {id="betfrontend", group="ui", widget="Bet-Frontend", name="Bet interface", type="bool", value=GetWidgetToggleValue("Bet-Frontend"), description='When spectator: display a betting interface.\nIt allows betting on when you think a unit will be destroyed.\nBeware... you have a limited supply of chips.'}, + {id="commandsfx", group="ui", widget="Commands FX", name="Command FX", type="bool", value=GetWidgetToggleValue("Commands FX"), description='Shows unit target lines when you give orders\n\nThe commands from your teammates are shown as well'}, + {id="commandsfxfilterai", group="ui", name=widgetOptionColor.." filter AI teams", type="bool", value=true, description='Hide commands for AI teams'}, + {id="commandsfxopacity", group="ui", name=widgetOptionColor.." opacity", type="slider", min=0.3, max=1, step=0.1, value=1, description=''}, + + --{id="teamplatter", group="ui", widget="TeamPlatter", name="Unit team platters", type="bool", value=GetWidgetToggleValue("TeamPlatter"), description='Shows a team color platter above all visible units'}, + --{id="teamplatter_opacity", group="ui", name=widgetOptionColor.." opacity", min=0.15, max=0.4, step=0.01, type="slider", value=0.3, description='Set the opacity of the team spotters'}, + --{id="teamplatter_skipownteam", group="ui", name=widgetOptionColor.." skip own units", type="bool", value=false, description='Doesnt draw platters for yourself'}, + + --{id="enemyspotter", group="ui", widget="EnemySpotter", name="Enemy spotters", type="bool", value=GetWidgetToggleValue("EnemySpotter"), description='Draws smoothed circles under enemy units'}, + --{id="enemyspotter_opacity", group="ui", name=widgetOptionColor.." opacity", min=0.12, max=0.4, step=0.01, type="slider", value=0.15, description='Set the opacity of the enemy-spotter rings'}, + --{id="enemyspotter_highlight", group="ui", name=widgetOptionColor.." unit highlight", type="bool", value=false, description='Colorize/highlight enemy units'}, + + {id="highlightselunits", group="ui", widget="Highlight Selected Units", name="Highlight selected units", type="bool", value=GetWidgetToggleValue("Highlight Selected Units"), description='Highlights unit models when selected'}, + {id="highlightselunits_opacity", group="ui", name=widgetOptionColor.." opacity", min=0.08, max=0.3, step=0.01, type="slider", value=0.2, description='Set the opacity of the highlight on selected units'}, + {id="highlightselunits_shader", group="ui", name=widgetOptionColor.." use shader", type="bool", value=false, description='Highlight model edges a bit'}, + {id="highlightselunits_teamcolor", group="ui", name=widgetOptionColor.." use teamcolor", type="bool", value=false, description='Use teamcolor instead of unit health coloring'}, + + {id="fancyselectedunits", group="ui", widget="Fancy Selected Units", name="Fancy selected units", type="bool", value=GetWidgetToggleValue("Fancy Selected Units"), description='Draws a platter under selected units\n\n\NOTE: this widget can be heavy when having lots of units selected'}, + --{id="fancyselectedunits_style", group="ui", name=widgetOptionColor.." style", type="select", options={}, value=1}, + {id="fancyselectedunits_opacity", group="ui", name=widgetOptionColor.." line opacity", min=0.8, max=1, step=0.01, type="slider", value=0.9, description='Set the opacity of the highlight on selected units'}, + {id="fancyselectedunits_baseopacity", group="ui", name=widgetOptionColor.." base opacity", min=0, max=0.5, step=0.01, type="slider", value=0.25, description='Set the opacity of the highlight on selected units'}, + {id="fancyselectedunits_teamcoloropacity", group="ui", name=widgetOptionColor.." teamcolor opacity", min=0, max=1, step=0.01, type="slider", value=0.1, description='Set the amount of teamcolor used for the base platter'}, + --{id="fancyselectedunits_secondline", group="ui", name=widgetOptionColor.." add second line", type="bool", value=false, description='Adds a second line'}, + + {id="pausescreen", group="ui", widget="Pause Screen", name="Pause screen", type="bool", value=GetWidgetToggleValue("Pause Screen"), description='Displays an overlay when the game is paused'}, + {id="givenunits", group="ui", widget="Given Units", name="Given unit icons", type="bool", value=GetWidgetToggleValue("Given Units"), description='Tags given units with \'new\' icon'}, + + + -- GAME + {id="autoquit", group="game", widget="Autoquit", name="Auto quit", type="bool", value=GetWidgetToggleValue("Autoquit"), description='Automatically quits after the game ends.\n...unless the mouse has been moved within a few seconds.'}, + + {id="ctrl_dequeue", group="game", name="Ctrl to dequeue units", type="bool", value=Spring.GetConfigInt("evo_ctrl_dequeue",1) == 1, description='Use ctrl key to dequeue units for factory'}, + + {id="smartselect_includebuildings", group="game", name="Include structures in area-selection", type="bool", value=false, description='When rectangle-drag-selecting an area, include building units too?\n\ndisabled: non-mobile units will be excluded\n(except: nanos always will be selected)'}, + {id="smartselect_includebuilders", group="game", name=widgetOptionColor.." include builders (if above is off)", type="bool", value=true, description='When rectangle-drag-selecting an area, exclude builder units'}, + + {id="onlyfighterspatrol", group="game", widget="OnlyFightersPatrol", name="Only fighters patrol", type="bool", value=GetWidgetToggleValue("Autoquit"), description='Only fighters obey a factory\'s patrol route after leaving airlab.'}, + {id="fightersfly", group="game", widget="Set fighters on Fly mode", name="Set fighters on Fly mode", type="bool", value=GetWidgetToggleValue("Set fighters on Fly mode"), description='Setting fighters on Fly mode when created'}, + + {id="passivebuilders", group="game", widget="Passive builders", name="Passive builders", type="bool", value=GetWidgetToggleValue("Passive builders"), description='Sets builders (nanos, labs and cons) on passive mode\n\nPassive mode means that builders will only spend energy when its availible.\nUsage: You could set your most important builders on active and leave the rest on passive'}, + + {id="autogroup_immediate", group="game", name="Autogroup immediate mode", type="bool", value=(WG['autogroup']~=nil and WG['autogroup'].getImmediate~=nil and WG['autogroup'].getImmediate()), description='Units built/resurrected/received are added to autogroups immediately instead of waiting them to be idle.\n\n(add units to autogroup with ALT+number)'}, + + {id="factoryguard", group="game", widget="FactoryGuard", name="Factory guard (builders)", type="bool", value=GetWidgetToggleValue("FactoryGuard"), description='Newly created builders will assist their source factory'}, + {id="factoryholdpos", group="game", widget="Factory hold position", name="Factory hold position", type="bool", value=GetWidgetToggleValue("Factory hold position"), description='Sets new factories, and all units they build, to hold position automatically (not aircraft)'}, + {id="factoryrepeat", group="game", widget="Factory Auto-Repeat", name="Factory auto-repeat", type="bool", value=GetWidgetToggleValue("Factory Auto-Repeat"), description='Sets new factories on Repeat mode'}, + + {id="transportai", group="game", widget="Transport AI", name="Transport AI", type="bool", value=GetWidgetToggleValue("Transport AI"), description='Transport units automatically pick up new units going to factory waypoint.'}, + {id="settargetdefault", group="game", widget="Set target default", name="Set-target as default", type="bool", value=GetWidgetToggleValue("Set target default"), description='Replace default attack command to a set-target command\n(when rightclicked on enemy unit)'}, + } + + -- set lowest quality shadows for Intel GPU (they eat fps but dont show) + if Platform ~= nil and Platform.gpuVendor == 'Intel' then + options[getOptionByID('shadows_maxquality')] = nil + options[getOptionByID('shadows_minquality')] = nil + options[getOptionByID('shadowslider')] = nil + options[getOptionByID('shadows_opacity')] = nil + end + + if getOptionByID('fancyselectedunits_style') then + options[getOptionByID('fancyselectedunits_style')].options = WG['fancyselectedunits'].getStyleList() + end + + -- add fonts + if getOptionByID('font') then + local fonts = {} + local fontsFull = {} + local fontsn = {} + local files = VFS.DirList(LUAUI_DIRNAME..'fonts', '*') + fontOption = {} + for k, file in ipairs(files) do + local name = string.sub(file, 13) + local ext = string.sub(name, string.len(name) - 2) + if ext == 'otf' or ext == 'ttf' then + name = string.sub(name, 1, string.len(name) - 4) + if not fontsn[name:lower()] then + fonts[#fonts+1] = name + fontsFull[#fontsFull+1] = string.sub(file, 13) + fontsn[name:lower()] = true + local fontScale = (0.5 + (vsx*vsy / 5700000)) + fontOption[#fonts] = gl.LoadFont(LUAUI_DIRNAME .. "fonts/"..fontsFull[#fontsFull], 20*fontScale, 5*fontScale, 1.5) + end + end + end + + options[getOptionByID('font')].options = fonts + options[getOptionByID('font')].optionsFont = fontsFull + local fname = Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf"):lower() + options[getOptionByID('font')].value = getSelectKey(getOptionByID('font'), string.sub(fname, 1, string.len(fname) - 4)) + + options[getOptionByID('font2')].options = fonts + options[getOptionByID('font2')].optionsFont = fontsFull + local fname = Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf"):lower() + options[getOptionByID('font2')].value = getSelectKey(getOptionByID('font2'), string.sub(fname, 1, string.len(fname) - 4)) + end + + -- set sun minimal height + if getOptionByID('sun_y') then + if select(2,gl.GetSun("pos")) < options[getOptionByID('sun_y')].min then + Spring.SetSunDirection(select(1,gl.GetSun("pos")), options[getOptionByID('sun_y')].min, select(3,gl.GetSun("pos"))) + end + end + + -- set minimal shadow opacity + if getOptionByID('shadows_opacity') then + if gl.GetSun("shadowDensity") < options[getOptionByID('shadows_opacity')].min then + Spring.SetSunLighting({groundShadowDensity = options[getOptionByID('shadows_opacity')].min, modelShadowDensity = options[getOptionByID('shadows_opacity')].min}) + end + end + + -- fsaa is deprecated in 104.x + if tonumber(Spring.GetConfigInt("FSAALevel",0)) > 0 then + local fsaa = tonumber(Spring.GetConfigInt("FSAALevel",0)) + if fsaa > 4 then + fsaa = 8 + end + Spring.SetConfigInt("MSAALevel", 8) + Spring.SetConfigInt("FSAALevel", 0) + end + + -- remove engine particles if nano beams are enabled + if options[getOptionByID('nanoeffect')] and options[getOptionByID('nanoeffect')].value == 1 then + Spring.SetConfigInt("MaxNanoParticles", 0) + end + -- loads values via stored game config in luaui/configs + loadAllWidgetData() + + -- while we have set config-ints, that isnt enough to have these settings applied ingame + if savedConfig and Spring.GetGameFrame() == 0 then + for k, v in pairs(savedConfig) do + if getOptionByID(k) then + applyOptionValue(getOptionByID(k)) + end + end + changesRequireRestart = false + end + + -- detect AI + local aiDetected = false + local t = Spring.GetTeamList() + for _,teamID in ipairs(t) do + if select(4,Spring.GetTeamInfo(teamID,false)) then + aiDetected = true + end + end + if not aiDetected then + options[getOptionByID('commandsfxfilterai')] = nil + end + + if #supportedResolutions < 2 then + options[getOptionByID('resolution')] = nil + else + for id,res in pairs(options[getOptionByID('resolution')].options) do + if res == vsx..' x '..vsy then + options[getOptionByID('resolution')].value = id + break + end + end + + -- disable music volume slider + if widgetHandler.knownWidgets["Music Player"] == nil then + options[getOptionByID('sndvolmusic')] = nil + end + end + + -- add sound notification widget sound toggle options + if widgetHandler.knownWidgets["Voice Notifs"] then + local soundList + if WG['voicenotifs'] ~= nil then + soundList = WG['voicenotifs'].getSoundList() + elseif widgetHandler.configData["Voice Notifs"] ~= nil and widgetHandler.configData["Voice Notifs"].soundList ~= nil then + soundList = widgetHandler.configData["Voice Notifs"].soundList + end + if type(soundList) == 'table' then + local newOptions = {} + local count = 0 + for i, option in pairs(options) do + count = count + 1 + newOptions[count] = option + if option.id == 'voicenotifs_volume' then + for sound, enabled in pairs(soundList) do + count = count + 1 + newOptions[count] = {id="voicenotifs_snd_"..sound, group="snd", name=widgetOptionColor.." "..sound, type="bool", value=enabled, description=''} + end + end + end + options = newOptions + end + else + options[getOptionByID('voicenotifs')] = nil + options[getOptionByID('voicenotifs_volume')] = nil + options[getOptionByID('voicenotifs_playtrackedplayernotifs')] = nil + end + + if not widgetHandler.knownWidgets["Player-TV"] then + options[getOptionByID('playertv_countdown')] = nil + end + + + -- cursors + if (WG['cursors'] == nil) then + options[getOptionByID('cursor')] = nil + else + local cursorsets = {} + local cursor = 1 + local cursoroption + cursorsets = WG['cursors'].getcursorsets() + local cursorname = WG['cursors'].getcursor() + for i,c in pairs(cursorsets) do + if c == cursorname then + cursor = i + break + end + end + options[getOptionByID('cursor')].options = cursorsets + options[getOptionByID('cursor')].value = cursor + end + if widgetHandler.knownWidgets["SSAO"] == nil then + options[getOptionByID('ssao')] = nil + options[getOptionByID('ssao_strength')] = nil + options[getOptionByID('ssao_radius')] = nil + end + if widgetHandler.knownWidgets["Bloom Shader"] == nil then + options[getOptionByID('bloombrightness')] = nil + options[getOptionByID('bloomsize')] = nil + options[getOptionByID('bloomquality')] = nil + end + if widgetHandler.knownWidgets["Bloom Shader Deferred"] == nil then + options[getOptionByID('bloomdeferredbrightness')] = nil + options[getOptionByID('bloomdeferredsize')] = nil + options[getOptionByID('bloomdeferredquality')] = nil + end + + if (WG['healthbars'] == nil) then + options[getOptionByID('healthbarsscale')] = nil + elseif WG['healthbars'].getScale ~= nil then + options[getOptionByID('healthbarsscale')].value = WG['healthbars'].getScale() + end + + if (WG['smartselect'] == nil) then + options[getOptionByID('smartselect_includebuildings')] = nil + options[getOptionByID('smartselect_includebuilders')] = nil + else + options[getOptionByID('smartselect_includebuildings')].value = WG['smartselect'].getIncludeBuildings() + options[getOptionByID('smartselect_includebuilders')].value = WG['smartselect'].getIncludeBuilders() + end + + if WG['snow'] ~= nil and WG['snow'].getSnowMap ~= nil then + options[getOptionByID('snowmap')].value = WG['snow'].getSnowMap() + end + if (WG['LupsPriority'] ~= nil) then + options[getOptionByID('lupseffectlevel')].value = WG['LupsPriority'] + end + + if (WG['darkenmap'] == nil) then + options[getOptionByID('darkenmap')] = nil + options[getOptionByID('darkenmap_darkenfeatures')] = nil + else + options[getOptionByID('darkenmap')].value = WG['darkenmap'].getMapDarkness() + options[getOptionByID('darkenmap_darkenfeatures')].value = WG['darkenmap'].getDarkenFeatures() + end + + -- not sure if needed: remove vsync option when its done by monitor (freesync/gsync) -> config value is set as 'x' + if Spring.GetConfigInt("VSync",1) == 'x' then + options[getOptionByID('vsync')] = nil + end + + if not widgetHandler.knownWidgets["Commander Name Tags"] then + options[getOptionByID('nametags_icon')] = nil + end + + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigShortcutsInfo == nil then + options[getOptionByID('buildmenushortcuts')] = nil + end + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigUnitPrice == nil then + options[getOptionByID('buildmenuprices')] = nil + end + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigPlaySounds == nil then + options[getOptionByID('buildmenusounds')] = nil + end + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigUnitTooltip == nil then + options[getOptionByID('buildmenutooltip')] = nil + end + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigUnitBigTooltip == nil then + options[getOptionByID('buildmenubigtooltip')] = nil + end + if WG['red_buildmenu'] == nil or WG['red_buildmenu'].getConfigLargeUnitIcons == nil then + options[getOptionByID('buildmenulargeicons')] = nil + end + + if WG['playercolorpalette'] == nil or WG['playercolorpalette'].getSameTeamColors == nil then + options[getOptionByID('sameteamcolors')] = nil + end + + if WG['advplayerlist_api']==nil or WG['advplayerlist_api'].GetLockTransitionTime==nil then + options[getOptionByID('lockcamera_transitiontime')] = nil + end + + -- disable options when widget isnt availible + if widgetHandler.knownWidgets["Outline"] == nil then + options[getOptionByID('outline')] = nil + options[getOptionByID("outline_size")] = nil + options[getOptionByID("outline_strength")] = nil + end + + if widgetHandler.knownWidgets["Fancy Selected Units"] == nil then + options[getOptionByID('fancyselectedunits')] = nil + options[getOptionByID("fancyselectedunits_style")] = nil + options[getOptionByID("fancyselectedunits_opacity")] = nil + options[getOptionByID("fancyselectedunits_baseopacity")] = nil + options[getOptionByID("fancyselectedunits_teamcoloropacity")] = nil + options[getOptionByID("fancyselectedunits_secondline")] = nil + end + + if widgetHandler.knownWidgets["Auto Group"] == nil then + options[getOptionByID("autogroup_immediate")] = nil + end + + if widgetHandler.knownWidgets["Highlight Selected Units"] == nil then + options[getOptionByID('highlightselunits')] = nil + options[getOptionByID("highlightselunits_opacity")] = nil + options[getOptionByID("highlightselunits_shader")] = nil + options[getOptionByID("highlightselunits_teamcolor")] = nil + end + + if widgetHandler.knownWidgets["Under construction gfx"] == nil then + options[getOptionByID('underconstructiongfx')] = nil + options[getOptionByID("underconstructiongfx_opacity")] = nil + options[getOptionByID("underconstructiongfx_shader")] = nil + end + + if widgetHandler.knownWidgets["Light Effects"] == nil or widgetHandler.knownWidgets["Deferred rendering"] == nil then + options[getOptionByID('lighteffects')] = nil + options[getOptionByID("lighteffects_brightness")] = nil + options[getOptionByID("lighteffects_laserbrightness")] = nil + options[getOptionByID("lighteffects_radius")] = nil + options[getOptionByID("lighteffects_laserradius")] = nil + --options[getOptionByID("lighteffects_heatdistortion")] = nil + --options[getOptionByID("lighteffects_deferred")] = nil + end + + if widgetHandler.knownWidgets["TeamPlatter"] == nil then + options[getOptionByID('teamplatter_opacity')] = nil + options[getOptionByID('teamplatter_skipownunits')] = nil + end + + if widgetHandler.knownWidgets["EnemySpotter"] == nil then + options[getOptionByID('enemyspotter_opacity')] = nil + options[getOptionByID('enemyspotter_highlight')] = nil + end + + local processedOptions = {} + local processedOptionsCount = 0 + local insert = true + for oid,option in pairs(options) do + insert = true + if option.type == 'slider' and not option.steps then + if option.value < option.min then option.value = option.min end + if option.value > option.max then option.value = option.max end + end + if (option.id == "shadows" or option.id == "shadows_maxquality" or option.id == "shadows_minquality" or option.id == "shadows_disablefps") and (widgetHandler.knownWidgets["Shadow Quality Manager"] == nil or (widgetHandler.orderList["Shadow Quality Manager"] == 0)) then + insert = false + end + if option.id == "shadowslider" and widgetHandler.knownWidgets["Shadow Quality Manager"] ~= nil and (widgetHandler.orderList["Shadow Quality Manager"] > 0) then + insert = false + end + if option.widget ~= nil and widgetHandler.knownWidgets[option.widget] == nil then + insert = false + end + if insert then + processedOptionsCount = processedOptionsCount + 1 + processedOptions[processedOptionsCount] = option + end + end + options = processedOptions +end + + +function deletePreset(name) + Spring.Echo('deleted preset: '..name) + customPresets[name] = nil + presets[name] = nil + local newPresetNames = {} + for _, presetName in ipairs(presetNames) do + if presetName ~= name then + table.insert(newPresetNames, presetName) + end + end + presetNames = newPresetNames + options[getOptionByID('preset')].options = presetNames + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) +end + +function savePreset(name) + if name == nil then + name = 'custom' + local i = 1 + while customPresets[name] ~= nil do + i = i + 1 + name = 'custom'..i + end + end + if presets[name] ~= nil then + Spring.Echo("preset '"..name.."' already exists") + else + local preset = {} + for optionID, _ in pairs(presets['lowest']) do + if options[getOptionByID(optionID)] ~= nil then + preset[optionID] = options[getOptionByID(optionID)].value + end + end + customPresets[name] = preset + presets[name] = preset + table.insert(presetNames, name) + options[getOptionByID('preset')].options = presetNames + Spring.Echo('saved preset: '..name) + if windowList then gl.DeleteList(windowList) end + windowList = gl.CreateList(DrawWindow) + end +end + + +function widget:Initialize() + + if Spring.GetGameFrame() == 0 then + -- set minimum particle amount + if tonumber(Spring.GetConfigInt("MaxParticles",1) or 10000) <= 10000 then + Spring.SetConfigInt("MaxParticles",10000) + end + -- enable lua shaders + if not tonumber(Spring.GetConfigInt("ForceShaders",1) or 0) then + Spring.SetConfigInt("ForceShaders", 1) + end + -- enable map/model shading + if Spring.GetConfigInt("AdvMapShading",0) ~= 1 then + Spring.SetConfigInt("AdvMapShading",1) + end + if Spring.GetConfigInt("AdvModelShading",0) ~= 1 then + Spring.SetConfigInt("AdvModelShading",1) + end + -- enable normal mapping + --if Spring.GetConfigInt("NormalMapping",0) ~= 1 then + -- Spring.SetConfigInt("NormalMapping",1) + -- Spring.SendCommands("luarules normalmapping 1") + --end + -- disable clouds + --if Spring.GetConfigInt("AdvSky",0) ~= 0 then + -- Spring.SetConfigInt("AdvSky",0) + --end + -- disable grass + if Spring.GetConfigInt("GrassDetail",0) ~= 0 then + Spring.SetConfigInt("GrassDetail",0) + end + + --if Platform ~= nil and Platform.gpuVendor ~= 'Nvidia' then -- because UsePBO displays tiled map texture bug for ATI/AMD cards + --Spring.SetConfigInt("UsePBO",0) + --end + + -- enable shadows at gamestart + --if Spring.GetConfigInt("Shadows",0) ~= 1 then + -- Spring.SetConfigInt("Shadows",1) + -- Spring.SendCommands("Shadows 1") + --end + -- set lowest quality shadows for Intel GPU (they eat fps but dont really show, but without any shadows enables it looks glitchy) + if Platform ~= nil and Platform.gpuVendor == 'Intel' then + Spring.SendCommands("Shadows 1 1024") + end + + -- set custom user map sun position + if customMapSunPos[Game.mapName] and customMapSunPos[Game.mapName][1] then + Spring.SetSunDirection(customMapSunPos[Game.mapName][1],customMapSunPos[Game.mapName][2],customMapSunPos[Game.mapName][3]) + Spring.SetSunLighting({groundShadowDensity = gl.GetSun("shadowDensity"), modelShadowDensity = gl.GetSun("shadowDensity")}) + end + + -- disable fog + Spring.SetAtmosphere({fogStart = 0.99999, fogEnd = 1.0, fogColor = {1.0, 1.0, 1.0, 0.0}}) + end + + Spring.SendCommands("minimap unitsize "..(Spring.GetConfigFloat("MinimapIconScale", 3.5))) -- spring wont remember what you set with '/minimap iconssize #' + + Spring.SendCommands({"bind f10 options"}) + + WG['options'] = {} + WG['options'].toggle = function(state) + if state ~= nil then + show = state + else + show = not show + end + end + WG['options'].isvisible = function() + return show + end + WG['options'].getCameraSmoothness = function() + return cameraTransitionTime + end + + presets = tableMerge(presets, customPresets) + for preset,_ in pairs(customPresets) do + table.insert(presetNames, preset) + end + + init() +end + +function widget:Shutdown() + if buttonGL then + glDeleteList(buttonGL) + end + if windowList then + glDeleteList(windowList) + end + if fontOption then + for i, font in pairs(fontOption) do + gl.DeleteFont(fontOption[i]) + end + end + if WG['guishader'] then + WG['guishader'].DeleteDlist('options') + end + gl.DeleteFont(font) + gl.DeleteFont(font2) + WG['options'] = nil +end + + +local function Split(s, separator) + local results = {} + for part in s:gmatch("[^"..separator.."]+") do + results[#results + 1] = part + end + return results +end + +local lastOptionCommand = 0 +function widget:TextCommand(command) + if (string.find(command, "options") == 1 and string.len(command) == 7) then + show = not show + end + if os.clock() > lastOptionCommand+1 and string.sub(command, 1, 7) == "option " then -- clock check is needed because toggling widget will somehow do an identical call of widget:TextCommand(command) + local option = string.sub(command, 8) + local optionID = getOptionByID(option) + if optionID then + if options[optionID].type == 'bool' then + lastOptionCommand = os.clock() + options[optionID].value = not options[optionID].value + applyOptionValue(optionID) + else + show = true + end + else + option = Split(option, ' ') + optionID = option[1] + if optionID then + optionID = getOptionByID(optionID) + if optionID and option[2] then + lastOptionCommand = os.clock() + if options[optionID].type == 'select' then + local selectKey = getSelectKey(optionID, option[2]) + if selectKey then + options[optionID].value = selectKey + applyOptionValue(optionID) + end + elseif options[optionID].type == 'bool' then + if option[2] == '0' then + options[optionID].value = false + else + options[optionID].value = true + end + applyOptionValue(optionID) + else + options[optionID].value = tonumber(option[2]) + applyOptionValue(optionID) + end + end + end + end + end + if (string.find(command, "savepreset") == 1) then + local words = Split(command, ' ') + if words[2] then + savePreset(words[2]) + else + savePreset() + end + end +end + +function getSelectKey(i, value) + for k, v in pairs(options[i].options) do + if v == value then + return k + end + end + return false +end + + +function widget:GetConfigData(data) + savedTable = {} + savedTable.customPresets = customPresets + savedTable.cameraTransitionTime = cameraTransitionTime + savedTable.cameraPanTransitionTime = cameraPanTransitionTime + savedTable.maxNanoParticles = maxNanoParticles + savedTable.currentGroupTab = currentGroupTab + savedTable.show = show + savedTable.defaultMapSunPos = defaultMapSunPos + savedTable.mapName = Game.mapName + savedTable.customMapSunPos = customMapSunPos + savedTable.savedConfig = { + vsync = {'VSync', tonumber(Spring.GetConfigInt("VSync",1) or 1)}, + water = {'Water', tonumber(Spring.GetConfigInt("Water",1) or 1)}, + disticon = {'UnitIconDist', tonumber(Spring.GetConfigInt("UnitIconDist",1) or 400)}, + particles = {'MaxParticles', tonumber(Spring.GetConfigInt("MaxParticles",1) or 10000)}, + nanoparticles = {'MaxNanoParticles', tonumber(Spring.GetConfigInt("MaxNanoParticles",1) or 500)}, + decals = {'GroundDecals', tonumber(Spring.GetConfigInt("GroundDecals",1) or 1)}, + grounddetail = {'GroundDetail', tonumber(Spring.GetConfigInt("GroundDetail",1) or 1)}, + grassdetail = {'GrassDetail', tonumber(Spring.GetConfigInt("GrassDetail",1) or 5)}, + shadows = {'Shadows', tonumber(Spring.GetConfigInt("Shadows",1) or 1)}, + advsky = {'AdvSky', tonumber(Spring.GetConfigInt("AdvSky",1) or 1)}, + camera = {'CamMode', tonumber(Spring.GetConfigInt("CamMode",1) or 1)}, + advmodelshading = {'AdvModelShading', tonumber(Spring.GetConfigInt("AdvModelShading",1) or 1)}, + advmapshading = {'AdvMapShading', tonumber(Spring.GetConfigInt("AdvMapShading",1) or 1)}, + --normalmapping = {'NormalMapping', tonumber(Spring.GetConfigInt("NormalMapping",1) or 1)}, + --treewind = {'TreeWind', tonumber(Spring.GetConfigInt("TreeWind",1) or 1)}, + hwcursor = {'HardwareCursor', tonumber(Spring.GetConfigInt("HardwareCursor",1) or 1)}, + sndvolmaster = {'snd_volmaster', tonumber(Spring.GetConfigInt("snd_volmaster",1) or 50)}, + sndvolbattle = {'snd_volbattle', tonumber(Spring.GetConfigInt("snd_volbattle",1) or 50)}, + sndvolunitreply = {'snd_volunitreply', tonumber(Spring.GetConfigInt("snd_volunitreply",1) or 50)}, + sndvolmusic = {'snd_volmusic', tonumber(Spring.GetConfigInt("snd_volmusic",1) or 50)}, + } + return savedTable +end + +function widget:SetConfigData(data) + if data.customPresets ~= nil then + customPresets = data.customPresets + end + if data.cameraTransitionTime ~= nil then + cameraTransitionTime = data.cameraTransitionTime + end + if data.cameraPanTransitionTime ~= nil then + cameraPanTransitionTime = data.cameraPanTransitionTime + end + if data.maxNanoParticles ~= nil then + maxNanoParticles = data.maxNanoParticles + end + if data.currentGroupTab ~= nil then + currentGroupTab = data.currentGroupTab + end + if data.show ~= nil and Spring.GetGameFrame() > 0 then + show = data.show + end + if data.savedConfig ~= nil then + savedConfig = data.savedConfig + for k, v in pairs(savedConfig) do + Spring.SetConfigFloat(v[1],v[2]) + end + end + if data.defaultMapSunPos ~= nil and data.mapName == Game.mapName then + defaultMapSunPos = data.defaultMapSunPos + end + if data.customMapSunPos then + customMapSunPos = data.customMapSunPos + end +end diff --git a/LuaUI/Widgets_Evo/gui_pauseScreen.lua b/LuaUI/Widgets_Evo/gui_pauseScreen.lua index 3f52d0735..1f0498317 100644 --- a/LuaUI/Widgets_Evo/gui_pauseScreen.lua +++ b/LuaUI/Widgets_Evo/gui_pauseScreen.lua @@ -1,250 +1,312 @@ include("keysym.h.lua") -local versionNumber = "1.0" +local versionNumber = "1.34" function widget:GetInfo() - return { - name = "Pause Screen", - desc = "[v" .. string.format("%s", versionNumber ) .. "] Displays pause screen when game is paused.", - author = "very_bad_soldier", - date = "2009.08.16", - license = "GNU GPL v2", - layer = 0, - enabled = true - } + return { + name = "Pause Screen", + desc = "Displays an overlay when the game is paused", + author = "Floris", + date = "sept 2016", + license = "GNU GPL v2", + layer = 99999999, + enabled = true + } end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- -local spGetGameSeconds = Spring.GetGameSeconds -local spGetMouseState = Spring.GetMouseState -local spEcho = Spring.Echo - -local spGetGameSpeed = Spring.GetGameSpeed - -local max = math.max +local spGetGameSpeed = Spring.GetGameSpeed local glColor = gl.Color local glTexture = gl.Texture +local glScale = gl.Scale local glPopMatrix = gl.PopMatrix local glPushMatrix = gl.PushMatrix local glTranslate = gl.Translate -local glText = gl.Text -local glBeginEnd = gl.BeginEnd -local glTexRect = gl.TexRect -local glLoadFont = gl.LoadFont -local glDeleteFont = gl.DeleteFont -local glRect = gl.Rect -local glLineWidth = gl.LineWidth -local glDepthTest = gl.DepthTest - -local osClock = os.clock +local glTexRect = gl.TexRect +local glDeleteFont = gl.DeleteFont +local glRect = gl.Rect +local glUseShader = gl.UseShader +local glCopyToTexture = gl.CopyToTexture +local glUniform = gl.Uniform +local glGetUniformLocation = gl.GetUniformLocation + +local osClock = os.clock + ---------------------------------------------------------------------------------- + -- CONFIGURATION -local debug = false -local boxWidth = 300 -local boxHeight = 60 -local slideTime = 0.4 -local fadeTime = 1 -local wndBorderSize = 4 -local imgWidth = 160 --acording to the used png -local fontSizeHeadline = 36 -local fontSizeAddon = 24 -local windowIconPath = "LuaUI/Images/evologo.png" -local fontPath = "LuaUI/Fonts/MicrogrammaDBold.ttf" ---Color config in drawPause function - ----------------- -local screenx, screeny -local myFont -local clickTimestamp = 0 -local pauseTimestamp = 0 --start or end of pause + +local fontfile = LUAUI_DIRNAME .. "fonts/unlisted/MicrogrammaDBold.ttf" +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local sizeMultiplier = 1 +local maxAlpha = 0.65 +local maxShaderAlpha = 0.25 +local maxNonShaderAlpha = 0.12 --background alpha when shaders arent availible +local boxWidth = 200 +local boxHeight = 35 +local slideTime = 0.4 +local fadeToTextAlpha = 0.4 +local fontSizeHeadline = 24 +local autoFadeTime = 1 + +local blurScreen = false -- makes use of guishader api widget + +local vsx, vsy +local pauseTimestamp = -10 --start or end of pause local lastPause = false -local screenCenterX = nil -local screenCenterY = nil local wndX1 = nil local wndY1 = nil local wndX2 = nil local wndY2 = nil local textX = nil local textY = nil -local lineOffset = nil -local yCenter = nil -local xCut = nil +local usedSizeMultiplier = 1 +local vsx, vsy = Spring.GetWindowGeometry() +local widgetInitTime = osClock() +local previousDrawScreenClock = osClock() +local paused = false + +local shaderAlpha = 0 +local screencopy +local shaderProgram + +--intensity formula based on http://alienryderflex.com/hsp.html +local fragmentShaderSource = { + washed = [[ + uniform sampler2D screencopy; + uniform float alpha; + float getIntensity(vec4 color) { + vec3 intensityVector = color.rgb * vec3(0.66,0.66,0.66); + return length(intensityVector); + } + + void main() { + vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); + vec4 origColor = texture2D(screencopy, texCoord); + float intensity = getIntensity(origColor); + intensity = intensity * 1.15; + float multi = intensity * 0.9; + if (intensity > 1) intensity = 1; + if (intensity < 0.5) { + if (intensity < 0.2) { + gl_FragColor = vec4(multi*0.22, multi*0.22, multi*0.22, alpha); + } else if (intensity < 0.35) { + gl_FragColor = vec4(multi*0.32, multi*0.32, multi*0.32, alpha); + } else { + gl_FragColor = vec4(multi*0.55, multi*0.55, multi*0.55, alpha); + } + } else { + if (intensity < 0.75) { + gl_FragColor = vec4(multi*0.7, multi*0.7, multi*0.7, alpha); + } else { + gl_FragColor = vec4(multi*0.82, multi*0.82, multi*0.82, alpha); + } + } + } + ]], +} + +local gameover = false +function widget:GameOver() + gameover = true +end + +function widget:Update(dt) + local now = osClock() + previousDrawScreenClock = now + + local diffPauseTime = ( now - pauseTimestamp) + + if ( ( not paused and lastPause ) or ( paused and not lastPause ) ) then + --pause switch + pauseTimestamp = osClock() + if ( diffPauseTime <= slideTime ) then + pauseTimestamp = pauseTimestamp - ( slideTime - ( diffPauseTime / slideTime ) * slideTime ) + end + end + + if ( paused and not lastPause ) then + --new pause + if widgetInitTime + 5 > now then -- so if you do /luaui reload when paused, it wont re-animate + pauseTimestamp = now - (slideTime + autoFadeTime) + end + end + + lastPause = paused + + local _, _, isPaused = spGetGameSpeed() + if not gameover and isPaused then -- when host (admin) paused its just gamespeed 0 + paused = true + else + paused = false + end +end function widget:Initialize() - myFont = glLoadFont( fontPath, fontSizeHeadline ) - updateWindowCoords() + vsx, vsy = widgetHandler:GetViewSizes() + widget:ViewResize(vsx, vsy) + + + local _, gameSpeed, isPaused = spGetGameSpeed() + if isPaused or gameSpeed == 0 then -- when host admin paused its just gamespeed 0 + paused = true + end + + if gl.CreateShader and (Platform == nil or Platform.gpuVendor ~= 'Intel') then + shaderProgram = gl.CreateShader( + { + fragment = fragmentShaderSource.washed, + uniformInt = { + screencopy = 0, + }, + }) + if shaderProgram then + alphaLoc = glGetUniformLocation(shaderProgram, "alpha") + end + else + Spring.Echo(": GLSL not supported.") + end end function widget:Shutdown() - glDeleteFont( myFont ) + glDeleteFont( myFont ) + if shaderProgram then + gl.DeleteShader(shaderProgram) + end end -function widget:DrawScreen() - local now = osClock() - local _, _, paused = spGetGameSpeed() - local diffPauseTime = ( now - pauseTimestamp) - - if ( ( not paused and lastPause ) or ( paused and not lastPause ) ) then - --pause switch - pauseTimestamp = osClock() - if ( diffPauseTime <= slideTime ) then - pauseTimestamp = pauseTimestamp - ( slideTime - ( diffPauseTime / slideTime ) * slideTime ) - end - end - - if ( paused and not lastPause ) then - --new pause - clickTimestamp = nil - end - - lastPause = paused - - if ( paused or ( ( now - pauseTimestamp) <= slideTime ) ) then - drawPause() - end - - ResetGl() +function widget:GamePaused(playerID, isGamePaused) + paused = isGamePaused end -function widget:MousePress(x, y, button) - if ( not clickTimestamp ) then - if ( ( x > screenCenterX - boxWidth) and ( y < screenCenterY + boxHeight ) and - ( x < screenCenterX + boxWidth ) and ( y > screenCenterY - boxHeight ) ) then - printDebug("CLICK") - clickTimestamp = osClock() - return true +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') end - end +end - return false +function widget:DrawScreen() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end + local now = osClock() + + if ( paused or ( ( now - pauseTimestamp) <= slideTime ) ) then + showPauseScreen = true + drawPause() + if blurScreen and WG['guishader'] then + WG['guishader'].InsertRect(0,0,vsx,vsy, 'pausescreen') + end + else + showPauseScreen = false + if blurScreen and WG['guishader'] then + WG['guishader'].RemoveRect('pausescreen') + end + end end + function drawPause() - local _, _, paused = spGetGameSpeed() - local now = osClock() - local diffPauseTime = ( now - pauseTimestamp) - - local text = { 1.0, 1.0, 1.0, 1.0 } - local text2 = { 0.9, 0.9, 0.9, 1.0 } - local outline = { 0.4, 0.4, 0.4, 1.0 } - local colorWnd = { 0.0, 0.0, 0.0, 0.6 } - local colorWnd2 = { 0.5, 0.5, 0.5, 0.6 } - local iconColor = { 1.0, 1.0, 1.0, 1.0 } - - --adjust transparency when clicked - if ( clickTimestamp ~= nil ) then - local factor = ( 1.0 - ( now - clickTimestamp ) / fadeTime ) - factor = max( factor, 0.3 ) - colorWnd[4] = colorWnd[4] * factor - text[4] = text[4] * factor - text2[4] = text2[4] * factor - outline[4] = outline[4] * factor - iconColor[4] = iconColor[4] * factor - printDebug("fac: " .. factor) - end - local imgWidthHalf = imgWidth * 0.5 - - --draw window - glPushMatrix() - local group1XOffset = 0 - if ( diffPauseTime <= slideTime ) then - --we are sliding - if ( paused ) then - --sliding in - group1XOffset = ( screenx - wndX1 ) * ( 1.0 - ( diffPauseTime / slideTime ) ) - else - --sliding out - group1XOffset = ( screenx - wndX1 ) * ( ( diffPauseTime / slideTime ) ) - end - glTranslate( group1XOffset, 0, 0) - end - - glColor( colorWnd ) - glRect( wndX1, wndY1, wndX2, wndY2 ) - glColor( colorWnd ) - glRect( wndX1 - wndBorderSize, wndY1 + wndBorderSize, wndX2 + wndBorderSize, wndY2 - wndBorderSize) - glPopMatrix() - - --draw text - myFont:Begin() - myFont:SetOutlineColor( outline ) - - myFont:SetTextColor( text ) - myFont:Print( "GAME PAUSED", textX + group1XOffset, textY, fontSizeHeadline, "O" ) + local now = osClock() + local diffPauseTime = ( now - pauseTimestamp) + + local text = { 1.0, 1.0, 1.0, 0*maxAlpha } + local outline = { 0.0, 0.0, 0.0, 0*maxAlpha } + + if paused then + progress = ( now - pauseTimestamp ) / slideTime + else + progress = 1 - (( now - pauseTimestamp ) / slideTime ) + end + if progress > 1 then + progress = 1 + end + if progress < 0 then + progress = 0 + end + text[4] = (text[4] * (1-progress)) + fadeToTextAlpha + outline[4] = (outline[4] * (1-progress)) + (fadeToTextAlpha/2.25) - myFont:SetTextColor( text2 ) - myFont:Print( "Press 'Pause' to continue.", textX + group1XOffset, textY - lineOffset, fontSizeAddon, "O" ) - - myFont:End() - - --draw icon - glColor( iconColor ) - glTexture( ":n:" .. windowIconPath ) - glPushMatrix() - - if ( diffPauseTime <= slideTime ) then - --we are sliding - if ( paused ) then - --sliding in - glTranslate( 0, ( ( yCenter + imgWidthHalf ) * ( 1.0 - ( diffPauseTime / slideTime ) ) ), 0) - else - --sliding out - glTranslate( 0, ( yCenter + imgWidthHalf ) * ( diffPauseTime / slideTime ), 0) - end - end - - glTexRect( xCut - imgWidthHalf, yCenter + imgWidthHalf, xCut + imgWidthHalf, yCenter - imgWidthHalf, 0.0, 0.0, 1.0, 1.0 ) - glPopMatrix() - - glTexture(false) + shaderAlpha = progress * maxShaderAlpha + nonShaderAlpha = progress * maxNonShaderAlpha + + glPushMatrix() + + if not shaderProgram then + glColor(0,0,0,nonShaderAlpha) + glRect( 0, 0, vsx, vsy) + end + + glTranslate(-vsx*(usedSizeMultiplier-1)/2, -vsy*(usedSizeMultiplier-1)/2, 0) + glScale(usedSizeMultiplier,usedSizeMultiplier,1) + if ( diffPauseTime <= slideTime ) then + --we are sliding + if ( paused ) then + --sliding in + glTranslate( (( vsx - wndX1 ) / usedSizeMultiplier) * ( 1.0 - ( diffPauseTime / slideTime ) ), 0, 0) + else + --sliding out + glTranslate( (( vsx - wndX1 ) / usedSizeMultiplier) * ( ( diffPauseTime / slideTime ) ), 0, 0) + end + end + + --draw text + font:Begin() + font:SetOutlineColor( outline ) + font:SetTextColor( text ) + font:Print( "GAME PAUSED", textX, textY, fontSizeHeadline, "O" ) + font:End() + + glPopMatrix() end function updateWindowCoords() - screenx, screeny = widgetHandler:GetViewSizes() - - screenCenterX = screenx / 2 - screenCenterY = screeny / 2 - wndX1 = screenCenterX - boxWidth - wndY1 = screenCenterY + boxHeight - wndX2 = screenCenterX + boxWidth - wndY2 = screenCenterY - boxHeight - - textX = wndX1 + ( wndX2 - wndX1 ) * 0.35 - textY = wndY2 + ( wndY1 - wndY2 ) * 0.5 - lineOffset = ( wndY1 - wndY2 ) * 0.3 - - yCenter = wndY2 + ( wndY1 - wndY2 ) * 0.5 - xCut = wndX1 + ( wndX2 - wndX1 ) * 0.2 + wndX1 = (vsx / 2) - boxWidth + wndY1 = (vsy / 2) + boxHeight + wndX2 = (vsx / 2) + boxWidth + wndY2 = (vsy / 2) - boxHeight + + textX = wndX1 + ( wndX2 - wndX1 ) * 0.33 + textY = wndY2 + ( wndY1 - wndY2 ) * 0.4 end function widget:ViewResize(viewSizeX, viewSizeY) + vsx, vsy = viewSizeX, viewSizeY + usedSizeMultiplier = (0.5 + ((vsx*vsy)/5500000)) * sizeMultiplier + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + updateWindowCoords() - end - ---Commons -function ResetGl() - glColor( { 1.0, 1.0, 1.0, 1.0 } ) - glLineWidth( 1.0 ) - glDepthTest(false) - glTexture(false) + + screencopy = gl.CreateTexture(vsx, vsy, { + border = false, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) end - -function printDebug( value ) - if ( debug ) then - if ( type( value ) == "boolean" ) then - if ( value == true ) then spEcho( "true" ) - else spEcho("false") end - elseif ( type(value ) == "table" ) then - spEcho("Dumping table:") - for key,val in pairs(value) do - spEcho(key,val) - end - else - spEcho( value ) - end +function widget:DrawScreenEffects() + if Spring.IsGUIHidden() then return end + if shaderProgram and showPauseScreen then + glCopyToTexture(screencopy, 0, 0, 0, 0, vsx, vsy) + glTexture(0, screencopy) + glUseShader(shaderProgram) + glUniform(alphaLoc, shaderAlpha) + glTexRect(0,vsy,vsx,0) + glTexture(0, false) + glUseShader(0) end end - \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_pip.lua b/LuaUI/Widgets_Evo/gui_pip.lua index 4f260ad05..625f5c781 100644 --- a/LuaUI/Widgets_Evo/gui_pip.lua +++ b/LuaUI/Widgets_Evo/gui_pip.lua @@ -717,7 +717,14 @@ function widget:SetConfigData(data) usingSimpleColors = data.usingSimpleColors or usingSimpleColors end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if inMinMode then DrawPanel(minModeL, minModeL + buttonSize, minModeB, minModeB + buttonSize) @@ -845,7 +852,9 @@ function widget:DrawScreen() glColor(1, 1, 1, 1) end + function widget:DrawWorld() + if chobbyInterface then return end if inMinMode then return end glColor(1, 1, 0, 0.25) glLineWidth(1.49) diff --git a/LuaUI/Widgets_Evo/gui_pip_extra1.lua b/LuaUI/Widgets_Evo/gui_pip_extra1.lua index c89c06825..f3c9eb772 100644 --- a/LuaUI/Widgets_Evo/gui_pip_extra1.lua +++ b/LuaUI/Widgets_Evo/gui_pip_extra1.lua @@ -712,7 +712,14 @@ function widget:SetConfigData(data) usingSimpleColors = data.usingSimpleColors or usingSimpleColors end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if inMinMode then DrawPanel(minModeL, minModeL + buttonSize, minModeB, minModeB + buttonSize) diff --git a/LuaUI/Widgets_Evo/gui_pip_extra2.lua b/LuaUI/Widgets_Evo/gui_pip_extra2.lua index e2a91af57..890f12d8b 100644 --- a/LuaUI/Widgets_Evo/gui_pip_extra2.lua +++ b/LuaUI/Widgets_Evo/gui_pip_extra2.lua @@ -712,7 +712,14 @@ function widget:SetConfigData(data) usingSimpleColors = data.usingSimpleColors or usingSimpleColors end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if inMinMode then DrawPanel(minModeL, minModeL + buttonSize, minModeB, minModeB + buttonSize) diff --git a/LuaUI/Widgets_Evo/gui_point_tracker.lua b/LuaUI/Widgets_Evo/gui_point_tracker.lua index c46b03a07..a9e8847f7 100644 --- a/LuaUI/Widgets_Evo/gui_point_tracker.lua +++ b/LuaUI/Widgets_Evo/gui_point_tracker.lua @@ -95,7 +95,14 @@ function widget:Initialize() myPlayerID = Spring.GetMyPlayerID() end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawScreen() + if chobbyInterface then return end if (not on) then return end glLineWidth(lineWidth) diff --git a/LuaUI/Widgets_Evo/gui_power_range.lua b/LuaUI/Widgets_Evo/gui_power_range.lua index a3183181b..f89204a00 100644 --- a/LuaUI/Widgets_Evo/gui_power_range.lua +++ b/LuaUI/Widgets_Evo/gui_power_range.lua @@ -52,7 +52,14 @@ local function DrawTexturedGroundQuadFromU(u) DrawTexturedGroundQuadFromUdXZ(Spring.GetUnitDefID(u),x,z) end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + function widget:DrawWorldPreUnit() + if chobbyInterface then return end -- Units being placed local _,cmd=Spring.GetActiveCommand() diff --git a/LuaUI/Widgets_Evo/gui_radar_colors.lua b/LuaUI/Widgets_Evo/gui_radar_colors.lua deleted file mode 100644 index 489e558ce..000000000 --- a/LuaUI/Widgets_Evo/gui_radar_colors.lua +++ /dev/null @@ -1,25 +0,0 @@ - -function widget:GetInfo() - return { - name = "Radar Colours", - desc = "Enables an alternate LOS and radar view colouration", - author = "Google Frog", - date = "8 April 2012", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - -function widget:Initialize() - -- always, los, radar, jammer - Spring.SetLosViewColors( - { 0.25, 0.2, 0, 0.18 }, - { 0.2, 0.13, 0.17, 0 }, - { 0.25, 0.2, 0, 0 } - ) - widgetHandler:RemoveWidget() -end - - - diff --git a/LuaUI/Widgets_Evo/gui_red_battleroom.lua b/LuaUI/Widgets_Evo/gui_red_battleroom.lua new file mode 100644 index 000000000..70adc3089 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_red_battleroom.lua @@ -0,0 +1,960 @@ +-- disable as clipLine is very slow on headless +if (Spring.GetConfigInt('Headless', 0) ~= 0) then + return false +end + +function widget:GetInfo() + return { + name = "Red Console (Battle and autohosts)", --version 4.1 + desc = "Requires Red UI Framework", + author = "Regret + Doo edit", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, --enabled by default + handler = true, --can use widgetHandler:x() + } +end +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (1 + (vsx*vsy / 4000000)) + +local NeededFrameworkVersion = 8 +local SoundIncomingChat = 'sounds/ui/beep4.wav' +local SoundIncomingChatVolume = 1.0 + +local gameOver = false +local lastConnectionAttempt = '' +--todo: dont cut words apart when clipping text + + +local clock = os.clock +local slen = string.len +local ssub = string.sub +local sgsub = string.gsub +local sfind = string.find +local sformat = string.format +local schar = string.char +local sgsub = string.gsub +local mfloor = math.floor +local sbyte = string.byte +local sreverse = string.reverse +local mmax = math.max +local glGetTextWidth = gl.GetTextWidth +local sGetPlayerRoster = GetPlayerRoster +local sGetTeamColor = Spring.GetTeamColor +local sGetMyAllyTeamID = Spring.GetMyAllyTeamID +local sGetModKeyState = Spring.GetModKeyState +local spPlaySoundFile = Spring.PlaySoundFile +local sGetMyPlayerID = Spring.GetMyPlayerID + +local Config = { + console = { + px = vsx*0.3,py = vsy*0.05, --default start position + sx = vsx*0.4, --background size + + fontsize = 10*widgetScale, + + minlines = 3, --minimal number of lines to display + maxlines = 3, + maxlinesScrollmode = 3, + + maxage = 30, --max time for a message to be displayed, in seconds + + margin = 7*widgetScale, --distance from background border + + fadetime = 0.25, --fade effect time, in seconds + fadedistance = 1*widgetScale, --distance from cursor at which console shows up when empty + + filterduplicates = true, --group identical lines, f.e. ( 5x Nickname: blahblah) + + --note: transparency for text not supported yet + cothertext = {1,1,1,1}, --normal chat color + callytext = {0,1,0,1}, --ally chat + cspectext = {1,1,0,1}, --spectator chat + + cotherallytext = {1,0.5,0.5,1}, --enemy ally messages (seen only when spectating) + cmisctext = {0.78,0.78,0.78,1}, --everything else + cgametext = {0.4,1,1,1}, --server (autohost) chat + + cbackground = {0,0,0,0.0}, + cborder = {0,0,0,0}, + + dragbutton = {2,3}, --middle mouse button + tooltip = { + background ="In CTRL+F11 mode: Hold \255\255\255\1middle mouse button\255\255\255\255 to drag the console.\n".. + "- Press \255\255\255\1CTRL\255\255\255\255 while mouse is above the \nconsole to activate chatlog viewing.\n".. + "- Use mousewheel (+hold \255\255\255\1SHIFT\255\255\255\255 for speedup)\n to scroll through the chatlog.", + }, + }, +} + + +local function IncludeRedUIFrameworkFunctions() + New = WG.Red.New(widget) + Copy = WG.Red.Copytable + SetTooltip = WG.Red.SetTooltip + GetSetTooltip = WG.Red.GetSetTooltip + Screen = WG.Red.Screen + GetWidgetObjects = WG.Red.GetWidgetObjects +end + +local function RedUIchecks() + local color = "\255\255\255\1" + local passed = true + if (type(WG.Red)~="table") then + Spring.Echo(color..widget:GetInfo().name.." requires Red UI Framework.") + passed = false + elseif (type(WG.Red.Screen)~="table") then + Spring.Echo(color..widget:GetInfo().name..">> strange error.") + passed = false + elseif (WG.Red.Version < NeededFrameworkVersion) then + Spring.Echo(color..widget:GetInfo().name..">> update your Red UI Framework.") + passed = false + end + if (not passed) then + widgetHandler:ToggleWidget(widget:GetInfo().name) + return false + end + IncludeRedUIFrameworkFunctions() + return true +end + +local function GetPlayerRoster() +PlayerRoster = {} + if Engine and Engine.version then + PlayerList = Spring.GetPlayerList() + for ct,playerID in pairs(PlayerList) do + PlayerInfo = {Spring.GetPlayerInfo(playerID)} + PlayerRoster[ct] = {} + PlayerRoster[ct][1] = PlayerInfo[1] + PlayerRoster[ct][2] = playerID + PlayerRoster[ct][3] = PlayerInfo[4] + PlayerRoster[ct][4] = PlayerInfo[5] + PlayerRoster[ct][5] = PlayerInfo[3] + PlayerRoster[ct][6] = PlayerInfo[7] + PlayerRoster[ct][7] = PlayerInfo[6] + -- Spring.Echo(PlayerInfo) + end + return PlayerRoster + else + return Spring.GetPlayerRoster() + end +end + +local function AutoResizeObjects() --autoresize v2 + if (LastAutoResizeX==nil) then + LastAutoResizeX = vsx + LastAutoResizeY = vsy + end + local lx,ly = LastAutoResizeX,LastAutoResizeY + local vsx,vsy = Screen.vsx,Screen.vsy + if ((lx ~= vsx) or (ly ~= vsy)) then + local objects = GetWidgetObjects(widget) + local scale = vsy/ly + local skippedobjects = {} + for i=1,#objects do + local o = objects[i] + local adjust = 0 + if ((o.movableslaves) and (#o.movableslaves > 0)) then + adjust = (o.px*scale+o.sx*scale)-vsx + if (((o.px+o.sx)-lx) == 0) then + o._moveduetoresize = true + end + end + if (o.px) then o.px = o.px * scale end + if (o.py) then o.py = o.py * scale end + if (o.sx) then o.sx = o.sx * scale end + if (o.sy) then o.sy = o.sy * scale end + if (o.fontsize) then o.fontsize = o.fontsize * scale end + if (adjust > 0) then + o._moveduetoresize = true + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + elseif ((adjust < 0) and o._moveduetoresize) then + o._moveduetoresize = nil + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + end + end + LastAutoResizeX,LastAutoResizeY = vsx,vsy + end +end + + +local function createconsole(r) + local vars = {} + + local lines = {"text", + px=r.px+r.margin,py=r.py+r.margin, + fontsize=r.fontsize, + caption="", + options="o", --black outline + } + + local activationarea = {"area", + px=r.px-r.fadedistance,py=r.py-r.fadedistance, + sx=r.sx+r.fadedistance*2,sy=0, + + mousewheel=function(up,mx,my,self) + if (vars.browsinghistory) then + local alt,ctrl,meta,shift = Spring.GetModKeyState() + local step = 1 + if (shift) then + step = 5 + end + if (vars.historyoffset == nil) then + vars.historyoffset = 0 + end + if (up) then + vars.historyoffset = vars.historyoffset + step + vars._forceupdate = true + else + vars.historyoffset = vars.historyoffset - step + vars._forceupdate = true + end + if (vars.historyoffset > (#vars.consolehistory - r.maxlines)) then + vars.historyoffset = #vars.consolehistory - r.maxlines + elseif (vars.historyoffset < 0) then + vars.historyoffset = 0 + end + end + end, + } + + local background = {"rectanglerounded", + px=r.px,py=r.py, + sx=r.sx,sy=r.maxlines*r.fontsize+r.margin*2, + color=r.cbackground, + border=r.cborder, + movable=r.dragbutton, + + obeyscreenedge = true, + --overrideclick = {2}, + + movableslaves={lines,activationarea}, + + effects = { + fadein_at_activation = r.fadetime, + fadeout_at_deactivation = r.fadetime, + }, + } + + activationarea.onupdate=function(self) + local fadedistance = (self.sx-background.sx)/2 + self.sy = background.sy+fadedistance*2 + self.px = background.px-fadedistance + self.py = background.py-fadedistance + + if (not self._mousenotover) then + background.active = nil --activate + if (vars._empty) then + background.sy = (r.minlines*lines.fontsize + (lines.px-background.px)*2) + end + local alt,ctrl,meta,shift = Spring.GetModKeyState() + if (ctrl and not vars.browsinghistory) then + if (vars._skipagecheck == nil) then + vars._forceupdate = true + vars.nextupdate = -1 + vars.browsinghistory = true + vars.historyoffset = 0 + + self.overridewheel = true + end + vars._skipagecheck = true + vars._usecounters = false + end + else + if (vars._skipagecheck ~= nil) then + vars._forceupdate = true + vars.browsinghistory = nil + vars.historyoffset = 0 + + self.overridewheel = nil + vars._skipagecheck = nil + vars._usecounters = nil + end + end + + self._mousenotover = nil + end + activationarea.mousenotover=function(mx,my,self) + self._mousenotover = true + if (vars._empty) then + background.active = false + end + end + + New(activationarea) + New(background) + New(lines) + + local counters = {} + for i=1,r.maxlines do + local b = New(lines) + b.onupdate = function(self) + self.px = background.px - self.getwidth() - (lines.px-background.px) + end + b._count = 0 + b.active = false + b.py = b.py+(i-1)*r.fontsize + counters[#counters+1] = b + background.movableslaves[#background.movableslaves+1] = b + end + + --tooltip + background.mouseover = function(mx,my,self) SetTooltip(r.tooltip.background) end + + background.active = nil + + return { + ["background"] = background, + ["lines"] = lines, + ["counters"] = counters, + ["vars"] = vars + } +end + +local function lineColour(prevline) -- search prevline and find the final instance of a colour code + + local prevlineReverse = sreverse(prevline) + local newlinecolour = "" + + local colourCodePosReverse = sfind(prevlineReverse, "\255") --search string from back to front + + if colourCodePosReverse then + for i = 0,2 do + if ssub(prevlineReverse, colourCodePosReverse + 3 - i, colourCodePosReverse + 3 - i) == "\255" then + colourCodePosReverse = colourCodePosReverse + 3 - i + break + end + end + + local colourCodePos = slen(prevline) - colourCodePosReverse + 1 + if slen(ssub(prevline, colourCodePos)) >= 4 then + newlinecolour = ssub(prevline, colourCodePos, colourCodePos+3) + end + end + + return newlinecolour +end + +local function clipLine(line,fontsize,maxwidth) + local clipped = {} + + local firstclip = line:len() + local firstpass = true + while (1) do --loops over lines + local linelen = slen(line) + local i=1 + while (1) do -- loop through potential positions where we might need to clip + if (glGetTextWidth(ssub(line,1,i+1))*fontsize > maxwidth) then + local test = line + local newlinecolour = "" + + -- set colour of new clipped line + if firstpass == nil then + newlinecolour = lineColour(clipped[#clipped]) + end + + local newline = newlinecolour .. ssub(test,1,i) + + clipped[#clipped+1] = newline + line = ssub(line,i+1) + + if (firstpass) then + firstclip = i + firstpass = nil + end + + break + end + i=i+1 + if (i > linelen) then + break + end + end + + -- check if we need to clip again + local width = glGetTextWidth(line)*fontsize + if (width <= maxwidth) then + break + end + end + + -- put remainder of line into final clipped line + local newlinecolour = "" + if #clipped > 0 then + newlinecolour = lineColour(clipped[#clipped]) + end + clipped[#clipped+1] = newlinecolour .. line + + return clipped,firstclip +end + +local function clipHistory(g,oneline) + local history = g.vars.consolehistory + local maxsize = g.background.sx - (g.lines.px-g.background.px) + + local fontsize = g.lines.fontsize + + if (oneline) then + local line = history[#history] + local lines,firstclip = clipLine(line[1],fontsize,maxsize) + line[1] = ssub(line[1],1,firstclip) + for i=1,#lines do + if (i>1) then + history[#history+1] = {line[4]..lines[i],line[2],line[3],line[4],line[5]} + end + end + else + local clippedhistory = {} + for i=1,#history do + local line = history[i] + local lines,firstclip = clipLine(line[1],fontsize,maxsize) + lines[1] = ssub(line[1],1,firstclip) + for i=1,#lines do + if (i>1) then + clippedhistory[#clippedhistory+1] = {line[4]..lines[i],line[2],line[3],line[4],line[5]} + else + clippedhistory[#clippedhistory+1] = {lines[i],line[2],line[3],line[4],line[5]} + end + end + end + g.vars.consolehistory = clippedhistory + end +end + +local function convertColor(r,g,b) + return schar(255, (r*255), (g*255), (b*255)) +end + +local function processLine(line,g,cfg,newlinecolor) + + g.vars.nextupdate = 0 + + local roster = GetPlayerRoster() + --[[DEBUG + for i,el in pairs(roster) do + if i==1 then + Spring.Echo(#el) + for j,val in pairs(el) do + Spring.Echo(j,val) + end + end + Spring.Echo(i,el) + end + --]] + + local names = {} + for i=1,#roster do + names[roster[i][1]] = {roster[i][4],roster[i][5],roster[i][3],roster[i][2]} + -- Spring.Echo(roster[i][3]) + -- if roster[i][3] == Spring.GetMyPlayerID() then + -- Spring.Echo(Spring.GetMyPlayerID()) + -- myname = roster[i][1] + -- end + end + local name = "" + local text = "" + local linetype = 0 --other + if Initialized == true then + ignoreThisMessage = false + else + ignoreThisMessage = false + end + local playSound = false + + if sfind(line, "My player ID is") and sfind(line, regID) and not nameregistered then + -- Spring.SendCommands("say Registration ID found") + registermyname = true + ignoreThisMessage = true + end + + if sfind(line, "Input grabbing is ") then + ignoreThisMessage = true + end + + if (not newlinecolor) then + if (names[ssub(line,2,(sfind(line,"> ") or 1)-1)] ~= nil) then + ignoreThisMessage = true + linetype = 1 --playermessage + name = ssub(line,2,sfind(line,"> ")-1) + text = ssub(line,slen(name)+4) + if ssub(text,1,1) == "!" then + ignoreThisMessage = true + if myname and myname == name then + waitbotanswer = true + end + end + elseif (names[ssub(line,2,(sfind(line,"] ") or 1)-1)] ~= nil) then + ignoreThisMessage = true + linetype = 2 --spectatormessage + name = ssub(line,2,sfind(line,"] ")-1) + text = ssub(line,slen(name)+4) + if ssub(text,1,1) == "!" then + ignoreThisMessage = true + -- Spring.Echo(name) + -- Spring.Echo(myname) + if myname and myname == name then + waitbotanswer = true + end + end + elseif (names[ssub(line,2,(sfind(line,"(replay)") or 3)-3)] ~= nil) then + ignoreThisMessage = true + linetype = 2 --spectatormessage + name = ssub(line,2,sfind(line,"(replay)")-3) + text = ssub(line,slen(name)+13) + if ssub(text,1,1) == "!" then + ignoreThisMessage = true + if myname and myname == name then + waitbotanswer = true + end + end + elseif (names[ssub(line,1,(sfind(line," added point: ") or 1)-1)] ~= nil) then + ignoreThisMessage = true + linetype = 3 --playerpoint + name = ssub(line,1,sfind(line," added point: ")-1) + text = ssub(line,slen(name.." added point: ")+1) + elseif (ssub(line,1,1) == ">") then + linetype = 4 --gamemessage + playSound = true + text = ssub(line,3) + if sfind(text, "Invalid command" )or sfind(line, "not a valid") or sfind(text, "you cannot") or sfind(text, "You are not allowed") or (sfind(text, "Invalid") and sfind(text, "you are not allowed to vote for command")) or sfind(text, "Unable to") or sfind(text, "Could not find") or sfind(text, "Ringing") or sfind(text, " is no one to ring") then + ignoreThisMessage = true + playSound = false + if waitbotanswer then + playSound = true + ignoreThisMessage = false + waitbotanswer = nil + if sfind(text, myname) then + ignoreThisMessage = false + playSound = true + end + end + end + if sfind(text, "BAAlphatest1") then + playSound = true + text = ssub(text, sfind(text, "BAAlphatest1") + 15) + end + if sfind(text, "Ticot") then + playSound = true + text = ssub(text, sfind(text, "Ticot") + 8) + end + if sfind(text, "Pirateur") then + playSound = true + text = ssub(text, sfind(text, "Pirateur") + 11) + end + if sfind(text, "OverKillHost1") then + playSound = true + text = ssub(text, sfind(text, "OverKillHost1") + 15) + end + if sfind(text, "Pirine") then + playSound = true + text = ssub(text, sfind(text, "Pirine") + 9) + end + + --PROCESSS VOTES HERE-- + if sfind(text, "called a vote for command") then + -- vote start: "Didgeri[doo] called a vote for command "bKick Didgeri[doo]" [!vote y, !vote n, !vote b]" + local command = ssub(text, sfind(text,"called a vote for command") + 27, sfind(text, '" ')-1) + local user = ssub(text, 1, sfind(text,"called a vote for command")-1) + text = user.." started vote: "..command + elseif sfind(text, "Vote for command") then + -- vote end: "Vote for command "xxx" passed." + status = ssub(text, sfind(text, '" ')+2,sfind(text, '" ')+7) + text = "Vote "..status.."." + -- elseif sfind(text, [[Vote in progress: ]]) then + -- vote progress :"Vote in progress: "bKick Didgeri[doo]" [y:0/2, n:1/2] (39s remaining)" + -- local votes = ssub(text,sfind(text, [[y:]]), sfind(text, [[\(]])-1) + -- local timeremaining = ssub(text,sfind(text, [[ \(]]) + 2, sfind(text, [[ remaining]])-1) + -- text = "Vote: "..votes..", "..timeremaining.." seconds left." + end + + -- Will have to insert a basic autohosts list here, for now it's just available on tests hosts so let's not bother too much. + + if ssub(line,1,3) == "> <" then --player speaking in battleroom + ignoreThisMessage = true + if ssub(text,1,1) == "!" then + ignoreThisMessage = true + end + local i = sfind(ssub(line,4,slen(line)), ">") + if (i) then + name = ssub(line,4,i+2) + else + name = "unknown" + end + end + end + end + + if registermyname and not nameregistered then + myname = name + registermyname = false + nameregistered = true + ignoreThisMessage = true + -- Spring.SendCommands("wByNum "..regID.." Registered as "..myname) + end + + -- filter shadows config changes + if sfind(line,"^Set \"shadows\" config(-)parameter to ") then + ignoreThisMessage = true + end + + if sfind(line,"->") then + ignoreThisMessage = true + end + + -- filter hash messages: server= / client= + if sfind(line,"server=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") or sfind(line,"client=[0-9a-z][0-9a-z][0-9a-z][0-9a-z]") then + ignoreThisMessage = true + end + + -- filter Sync error when its a spectator + --if sfind(line,"^Sync error for ") then + -- name = ssub(line,16,sfind(line," in frame ")-1) + -- if names[name] ~= nil and names[name][2] ~= nil and names[name][2] and sGetMyPlayerID() ~= names[name][4] then -- when spec + -- ignoreThisMessage = true + -- end + --end + + -- filter Sync error when its a spectator + --if sfind(line,"^Error: %[DESYNC WARNING%] ") then + -- name = ssub(line,sfind(line," %(")+2,sfind(line,"%) ")-1) + -- if names[name] ~= nil and names[name][2] ~= nil and names[name][2] and sGetMyPlayerID() ~= names[name][4] then -- when spec + -- ignoreThisMessage = true + -- end + --end + + -- filter Connection attempts + --if sfind(line,"^Connection attempt from ") then + -- name = ssub(line,25) + -- lastConnectionAttempt = name + -- ignoreThisMessage = true + --end + + -- filter Connection established + --if sfind(line," Connection established") then + -- name = lastConnectionAttempt + -- ignoreThisMessage = true + --end + + + if linetype==0 then + --filter out some engine messages; + --2 lines (instead of 4) appears when player connects + if sfind(line,'-> Version') or sfind(line,'ClientReadNet') or sfind(line,'Address') then + ignoreThisMessage = true + end + + if sfind(line,"Wrong network version") then + local n,_ = sfind(line,"Message") + if n ~= nil then + line = ssub(line,1,n-3) --shorten so as these messages don't get clipped and can be detected as duplicates + end + end + + + if gameOver then + if sfind(line,'left the game') then + ignoreThisMessage = true + end + end + end + + + --ignore messages from muted-- + if WG.ignoredPlayers and WG.ignoredPlayers[name] then + ignoreThisMessage = true + --Spring.Echo ("blocked message by " .. name) + end + + local MyAllyTeamID = sGetMyAllyTeamID() + local textcolor = nil + + + if (linetype==1) then --playermessage + local c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + if (sfind(text,"Allies: ") == 1) then + text = ssub(text,9) + if (names[name][1] == MyAllyTeamID) then + c = cfg.callytext + else + c = cfg.cotherallytext + end + elseif (sfind(text,"Spectators: ") == 1) then + text = ssub(text,13) + c = cfg.cspectext + end + + textcolor = convertColor(c[1],c[2],c[3]) + local r,g,b,a = sGetTeamColor(names[name][3]) + local namecolor = convertColor(r,g,b) + + line = namecolor..name..misccolor..": "..textcolor..text + + playSound = true + + elseif (linetype==2) then --spectatormessage + local c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + if (sfind(text,"Allies: ") == 1) then + text = ssub(text,9) + c = cfg.cspectext + elseif (sfind(text,"Spectators: ") == 1) then + text = ssub(text,13) + c = cfg.cspectext + end + textcolor = convertColor(c[1],c[2],c[3]) + c = cfg.cspectext + local namecolor = convertColor(c[1],c[2],c[3]) + + line = namecolor.."(s) "..name..misccolor..": "..textcolor..text + + playSound = true + + elseif (linetype==3) then --playerpoint + local c = cfg.cspectext + local namecolor = convertColor(c[1],c[2],c[3]) + + local spectator = true + if (names[name] ~= nil) then + spectator = names[name][2] + end + if (spectator) then + name = "(s) "..name + else + local r,g,b,a = sGetTeamColor(names[name][3]) + namecolor = convertColor(r,g,b) + end + + c = cfg.cotherallytext + if (spectator) then + c = cfg.cspectext + elseif (names[name][1] == MyAllyTeamID) then + c = cfg.callytext + end + textcolor = convertColor(c[1],c[2],c[3]) + c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + + line = namecolor..name..misccolor.." * "..textcolor..text + + elseif (linetype==4) then --gamemessage + local c = cfg.cgametext + textcolor = convertColor(c[1],c[2],c[3]) + + line = textcolor.."> "..text + else --every other message + local c = cfg.cmisctext + textcolor = convertColor(c[1],c[2],c[3]) + + line = textcolor..line + end + + if (g.vars.consolehistory == nil) then + g.vars.consolehistory = {} + end + local history = g.vars.consolehistory + + if not Initialized then + ignoreThisMessage = false + end + + if (not ignoreThisMessage) then --mute-- + if (g.vars.browsinghistory) then + if (g.vars.historyoffset == nil) then + g.vars.historyoffset = 0 + end + g.vars.historyoffset = g.vars.historyoffset + 1 + end + local lineID = #history+1 + history[#history+1] = {line,clock(),lineID,textcolor,linetype} + + if ( playSound and not Spring.IsGUIHidden() ) then + spPlaySoundFile( SoundIncomingChat, SoundIncomingChatVolume, nil, "ui" ) + end + end + onelinedone = true + return history[#history] +end + +local function updateconsole(g,cfg) + local forceupdate = g.vars._forceupdate + local justforcedupdate = g.vars._justforcedupdate + + if (forceupdate and (not justforcedupdate)) then + g.vars._justforcedupdate = true + g.vars._forceupdate = nil + else + g.vars._justforcedupdate = nil + g.vars._forceupdate = nil + + if (g.vars.nextupdate == nil) then + g.vars.nextupdate = 0 + end + if ((g.vars.nextupdate < 0) or (clock() < g.vars.nextupdate)) then + return + end + end + + local skipagecheck = g.vars._skipagecheck + local usecounters = g.vars._usecounters + + local maxlines = cfg.maxlines + + local historyoffset = 0 + if (g.vars.browsinghistory) then + if (g.vars.historyoffset == nil) then + g.vars.historyoffset = 0 + end + historyoffset = g.vars.historyoffset + maxlines = cfg.maxlinesScrollmode + end + + if (usecounters == nil) then + usecounters = cfg.filterduplicates + end + + + local counters = {} + for i=1,maxlines do + counters[i] = 1 + if g.counters[i] == nil then + g.counters[i] = {} + end + g.counters[i].active = false + g.counters[i].caption = "" + end + + local maxage = cfg.maxage + local display = "" + local count = 0 + local i=0 + local lastID = 0 + local lastLine = "" + + local history = g.vars.consolehistory or {} + + while (count < maxlines) do + if (history[#history-i-historyoffset]) then + local line = history[#history-i-historyoffset] + if (skipagecheck or ((clock()-line[2]) <= maxage)) then + if (count == 0) then + count = count + 1 + display = line[1] + else + if (usecounters and (lastID > 0) and (lastID~=line[3]) and (line[1] == lastLine)) then + counters[count] = counters[count] + 1 + else + count = count + 1 + display = line[1].."\n"..display + end + end + + lastLine = line[1] + lastID = line[3] + + if (skipagecheck) then + g.vars.nextupdate = -1 + else + g.vars.nextupdate = line[2]+maxage + end + else + break + end + i=i+1 + else + break + end + end + + if (usecounters) then + for i=1,#counters do + if (counters[i] ~= 1) then + local counter = count-i+1 + g.counters[counter].active = nil + g.counters[counter].caption = counters[i].."x" + end + end + end + + if (count == 0) then + g.vars.nextupdate = -1 --no update until new console line + g.background.active = false + g.lines.active = false + g.vars._empty = true + g.background.sy = (cfg.minlines*g.lines.fontsize + (g.lines.px-g.background.px)*2 ) -(cfg.margin/3.5) + else + g.background.active = nil --activate + g.lines.active = nil --activate + g.vars._empty = nil + g.background.sy = (count*g.lines.fontsize + (g.lines.px-g.background.px)*2 ) -(cfg.margin/3.5) + end + + g.lines.caption = display + g.lines.sx = 100 +end + +function widget:Initialize() +regID = tostring(Spring.GetMyPlayerID()) + PassedStartupCheck = RedUIchecks() + if (not PassedStartupCheck) then return end + + console = createconsole(Config.console) + Spring.SendCommands("console 0") + Spring.SendCommands('inputtextgeo 0.26 0.73 0.02 0.028') + AutoResizeObjects() +end + +function widget:GameOver() + gameOver = true +end + +function widget:Shutdown() + Spring.SendCommands("console 1") +end + +function widget:AddConsoleLine(lines,priority) + lines = lines:match('^\[f=[0-9]+\] (.*)$') or lines + local textcolor + for line in lines:gmatch("[^\n]+") do + textcolor = processLine(line, console, Config.console, textcolor)[4] + end + clipHistory(console,true) +end + +function widget:Update() + updateconsole(console,Config.console) + AutoResizeObjects() +if not Initialized then + if onelinedone == true then +Initialized = true +regID = tostring(Spring.GetMyPlayerID()) +Spring.SendCommands("wByNum "..regID.." My player ID is "..regID) +end +end +end + +--save/load stuff +--currently only position +function widget:GetConfigData() --save config + if (PassedStartupCheck) then + local vsy = Screen.vsy + Config.console.px = console.background.px + Config.console.py = console.background.py + return {Config=Config} + end +end +function widget:SetConfigData(data) --load config + if (data.Config ~= nil) then + --Config.console.px = data.Config.console.px + --Config.console.py = data.Config.console.py + end +end diff --git a/LuaUI/Widgets_Evo/gui_red_buildordermenu-EvoRTS.lua b/LuaUI/Widgets_Evo/gui_red_buildordermenu-EvoRTS.lua new file mode 100644 index 000000000..e11f09536 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_red_buildordermenu-EvoRTS.lua @@ -0,0 +1,1413 @@ +function widget:GetInfo() + return { + version = "9.1", + name = "Red Build/Order Menu - EvoRTS", + desc = "Requires Red UI Framework", + author = "Regret, modified by CommonPlayer", + date = "29 may 2015", --modified by CommonPlayer, Oct 2016 + license = "GNU GPL, v2 or later", + layer = -10, + enabled = false, --enabled by default + handler = true, --can use widgetHandler:x() + } +end + +-- build hotkeys stuff +local building = -1 +local buildStartKey = 98 +local buildNextKey = 110 +local buildKeys = {113, 119, 101, 114, 116, 97, 115, 100, 102, 103, 122, 120, 99, 118, 98} +local buildLetters = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} +local highlightedIcons = {} +local highlightedIconsLeng = 0 + +local stateTexture = "LuaUI/Images/resbar.dds" +local buttonTexture = "LuaUI/Images/button.dds" +local barGlowCenterTexture = ":n:LuaUI/Images/barglow-center.png" +local barGlowEdgeTexture = ":n:LuaUI/Images/barglow-edge.png" + +local sound_queue_add = 'LuaUI/Sounds/buildbar_add.wav' +local sound_queue_rem = 'LuaUI/Sounds/buildbar_rem.wav' +local sound_button = 'LuaUI/Sounds/buildbar_waypoint.wav' + +local NeededFrameworkVersion = 9 +local CanvasX,CanvasY = 1272,734 --resolution in which the widget was made (for 1:1 size) +--1272,734 == 1280,768 windowed + +--todo: build categories (eco | labs | defences | etc) basically sublists of buildcmds (maybe for regular orders too) + +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) + +local playSounds = true +local iconScaling = true +local largeInfo = false +local shortcutsInfo = true +local highlightscale = true +local drawPrice = true +local drawTooltip = true +local drawBigTooltip = false +local largePrice = true +local oldUnitpics = false +local largeUnitIcons = false + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (1 + (vsx*vsy / 7500000)) + +local normalUnitIconSize = { + isx = 45,isy = 40, --icon size + ix = 5,iy = 8, --icons x/y +} +local largeUnitIconSize = { + isx = 50,isy = 45, --icon size + ix = 5,iy = 7, --icons x/y +} +local normalOrderIconSize = { + isx = 45,isy = 33, --icon size + ix = 5,iy = 4, --icons x/y +} +local largeOrderIconSize = { + isx = 50,isy = 33, --icon size + ix = 5,iy = 4, --icons x/y +} + +local buildPicHelp = Spring.GetConfigInt("evo_buildpichelp", 1) +--Assume that if it isn't set, buildPicHelp is true +if buildPicHelp == nil then + buildPicHelp = 1 +end + +local maxSupply = tonumber(Spring.GetModOptions().supplycap) or 400 + +local Config = { + buildmenu = { + menuname = "buildmenu", + px = 0,py = CanvasY - 415, --default start position + + isx = 45,isy = 40, --icon size + ix = 5,iy = 8, --icons x/y + + roundedPercentage = 0.2, -- 0.25 == iconsize / 4 == cornersize + + iconscale = 0.925, + iconhoverscale = 0.925, + ispreadx=0,ispready=0, --space between icons + + margin = 5, --distance from background border + + padding = 4*widgetScale, -- for border effect + color2 = {1,1,1,ui_opacity*0.045}, -- for border effect + + fadetime = 0.14, --fade effect time, in seconds + fadetimeOut = 0.022, --fade effect time, in seconds + + ctext = {1,1,1,1}, --color {r,g,b,alpha} + cbackground = {0,0,0,ui_opacity}, + cborder = {0,0,0,1}, + cbuttonbackground = {0.1,0.1,0.1,1}, + dragbutton = {2,3}, --middle mouse button + tooltip = { + background = "In CTRL+F11 mode: Hold \255\255\255\1middle mouse button\255\255\255\255 to drag the buildmenu.", + }, + }, + + ordermenu = { + menuname = "ordermenu", + px = 0,py = CanvasY - 415 - 145, + + isx = 45,isy = 33, + ix = 5,iy = 4, + + roundedPercentage = 0.2, -- 0.25 == iconsize / 4 == cornersize + + iconscale = 0.93, + iconhoverscale = 0.93, + ispreadx=0,ispready=0, + + margin = 5, + + padding = 4*widgetScale, -- for border effect + color2 = {1,1,1,0.025}, -- for border effect + + fadetime = 0.1, + fadetimeOut = 0.015, --fade effect time, in seconds + + ctext = {1,1,1,1}, + cbackground = {0,0,0,ui_opacity}, + cborder = {0,0,0,1}, + cbuttonbackground={0.1,0.1,0.1,1}, + + dragbutton = {2,3}, --middle mouse button + tooltip = { + background = "In CTRL+F11 mode: Hold \255\255\255\1middle mouse button\255\255\255\255 to drag the ordermenu.", + }, + }, +} + + +function widget:ViewResize(newX,newY) + vsx, vsy = gl.GetViewSizes() + widgetScale = (1 + (vsx*vsy / 7500000)) + Config.buildmenu.padding = 3*widgetScale + Config.ordermenu.padding = 3*widgetScale +end + +local guishaderEnabled = WG['guishader'] or false + +local sGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local sGetActiveCommand = Spring.GetActiveCommand +local sGetActiveCmdDescs = Spring.GetActiveCmdDescs +local ssub = string.sub + +local function IncludeRedUIFrameworkFunctions() + New = WG.Red.New(widget) + Copy = WG.Red.Copytable + SetTooltip = WG.Red.SetTooltip + GetSetTooltip = WG.Red.GetSetTooltip + Screen = WG.Red.Screen + GetWidgetObjects = WG.Red.GetWidgetObjects +end + +local function RedUIchecks() + local color = "\255\255\255\1" + local passed = true + if (type(WG.Red)~="table") then + Spring.Echo(color..widget:GetInfo().name.." requires Red UI Framework.") + passed = false + elseif (type(WG.Red.Screen)~="table") then + Spring.Echo(color..widget:GetInfo().name..">> strange error.") + passed = false + elseif (WG.Red.Version < NeededFrameworkVersion) then + Spring.Echo(color..widget:GetInfo().name..">> update your Red UI Framework.") + passed = false + end + if (not passed) then + widgetHandler:ToggleWidget(widget:GetInfo().name) + return false + end + IncludeRedUIFrameworkFunctions() + return true +end + +local function AutoResizeObjects() --autoresize v2 + if (LastAutoResizeX==nil) then + LastAutoResizeX = CanvasX + LastAutoResizeY = CanvasY + end + local lx,ly = LastAutoResizeX,LastAutoResizeY + local vsx,vsy = Screen.vsx,Screen.vsy + if ((lx ~= vsx) or (ly ~= vsy)) then + local objects = GetWidgetObjects(widget) + local scale = vsy/ly + local skippedobjects = {} + for i=1,#objects do + local o = objects[i] + local adjust = 0 + if ((o.movableslaves) and (#o.movableslaves > 0)) then + adjust = (o.px*scale+o.sx*scale)-vsx + if (((o.px+o.sx)-lx) == 0) then + o._moveduetoresize = true + end + end + if (o.px) then o.px = o.px * scale end + if (o.py) then o.py = o.py * scale end + if (o.sx) then o.sx = o.sx * scale end + if (o.sy) then o.sy = o.sy * scale end + if (o.fontsize) then o.fontsize = o.fontsize * scale end + if (adjust > 0) then + o._moveduetoresize = true + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + elseif ((adjust < 0) and o._moveduetoresize) then + o._moveduetoresize = nil + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + end + end + LastAutoResizeX,LastAutoResizeY = vsx,vsy + end +end + +local function esc(x) + return (x:gsub('%%', '%%%%') + :gsub('^%^', '%%^') + :gsub('%$$', '%%$') + :gsub('%(', '%%(') + :gsub('%)', '%%)') + :gsub('%.', '%%.') + :gsub('%[', '%%[') + :gsub('%]', '%%]') + :gsub('%*', '%%*') + :gsub('%+', '%%+') + :gsub('%-', '%%-') + :gsub('%?', '%%?')) +end + +function wrap(str, limit) + limit = limit or 72 + local here = 1 + local buf = "" + local t = {} + str:gsub("(%s*)()(%S+)()", + function(sp, st, word, fi) + if fi-here > limit then + --# Break the line + here = st + t[#t+1] = buf + buf = word + else + buf = buf..sp..word --# Append + end + end) + --# Tack on any leftovers + if(buf ~= "") then + t[#t+1] = buf + end + return t +end + WG.hoverID = nil +local function CreateGrid(r) + + local background2 = {"rectanglerounded", + px=r.px+r.padding,py=r.py+r.padding, + sx=(r.isx*r.ix+r.ispreadx*(r.ix-1) +r.margin*2) -r.padding -r.padding, + sy=(r.isy*(r.iy)+r.ispready*(r.iy) +r.margin*2) -r.padding -r.padding, + color=r.color2, + roundedsize=r.padding*1.45, + } + local background = {"rectanglerounded", + px=r.px,py=r.py, + sx=r.isx*r.ix+r.ispreadx*(r.ix-1) +r.margin*2, + sy=r.isy*(r.iy)+r.ispready*(r.iy) +r.margin*2, + color=r.cbackground, + border=r.cborder, + movable=r.dragbutton, + obeyscreenedge = true, + overrideclick = {1}, + + padding=r.padding, + + guishader=true, + effects = { + fadein_at_activation = r.fadetime, + fadeout_at_deactivation = r.fadetimeOut, + }, + onupdate=function(self) + background2.px = self.px + self.padding + background2.py = self.py + self.padding + background2.sx = self.sx - self.padding - self.padding + background2.sy = self.sy - self.padding - self.padding + end, + } + + local selecthighlight = {"rectanglerounded", + roundedsize = math.floor(r.isy*r.roundedPercentage), + px=0,py=0, + sx=r.isx,sy=r.isy, + iconscale=(iconScaling and ((not highlightscale and r.menuname == "buildmenu") or r.menuname ~= "buildmenu") and r.iconscale or 1), + color={1,0,0,0.26}, + border={0.8,0,0,0}, + glone=0.12, + texture = "LuaUI/Images/button-pushed.dds", + texturecolor={1,0,0,0.15}, + + active=false, + onupdate=function(self) + self.active = false + end, + } + + local mouseoverhighlight = Copy(selecthighlight,true) + mouseoverhighlight.color={1,1,1,0.08} + mouseoverhighlight.border={1,1,1,0} + mouseoverhighlight.texture = "LuaUI/Images/button-highlight.dds" + mouseoverhighlight.texturecolor={1,1,1,0.08} + + local heldhighlight = Copy(selecthighlight,true) + heldhighlight.color={1,0.75,0,0.06} + heldhighlight.border={1,1,0,0} + heldhighlight.texture = "LuaUI/Images/button-pushed.dds" + heldhighlight.texturecolor={1,0.75,0,0.06} + + local icon = {"rectangle", + px=0,py=0, + sx=r.isx,sy=r.isy, + iconscale=(iconScaling and r.iconscale or 1), + iconhoverscale=(iconScaling and r.iconhoverscale or 1), + iconnormalscale=(iconScaling and r.iconscale or 1), + roundedsize = math.floor(r.isy*r.roundedPercentage), + color={0,0,0,0}, + border={0,0,0,0}, + options="n", --disable colorcodes + captioncolor=r.ctext, + font2 = true, + + overridecursor = true, + overrideclick = {3}, + + mouseheld={ + {1,function(mx,my,self) + self.iconscale=(iconScaling and self.iconhoverscale or 1) + --if self.texture ~= nil and string.sub(self.texture, 1, 1) == '#' then + -- heldhighlight.iconscale = (iconScaling and ((not highlightscale and r.menuname == "buildmenu") or r.menuname ~= "buildmenu") and self.iconhoverscale or 1) + --else + -- heldhighlight.iconscale = self.iconscale + --end + heldhighlight.iconscale = self.iconscale + heldhighlight.color={1,0.75,0,0.06} + heldhighlight.px = self.px + heldhighlight.py = self.py + heldhighlight.active = nil + end}, + {3,function(mx,my,self) + self.iconscale=(iconScaling and self.iconhoverscale or 1) + --if self.texture ~= nil and string.sub(self.texture, 1, 1) == '#' then + -- heldhighlight.iconscale = (iconScaling and ((not highlightscale and r.menuname == "buildmenu") or r.menuname ~= "buildmenu") and self.iconhoverscale or 1) + --else + -- heldhighlight.iconscale = self.iconscale + --end + heldhighlight.iconscale = self.iconscale + heldhighlight.color={1,0.2,0,0.06} + heldhighlight.px = self.px + heldhighlight.py = self.py + heldhighlight.active = nil + end}, + }, + + --[[mouserelease={ + {1,function(mx,my,self) + if r.menuname == "buildmenu" then + self.iconscale=(iconScaling and self.iconhoverscale or 1) + if self.texture ~= nil and string.sub(self.texture, 1, 1) == '#' then + heldhighlight.iconscale = (iconScaling and ((not highlightscale and r.menuname == "buildmenu") or r.menuname ~= "buildmenu") and self.iconhoverscale or 1) + else + heldhighlight.iconscale = self.iconscale + end + heldhighlight.px = self.px + heldhighlight.py = self.py + heldhighlight.active = nil + end + end}, + },]]-- + + mouseover=function(mx,my,self) + self.iconscale=(iconScaling and self.iconhoverscale or 1) + mouseoverhighlight.iconscale=(iconScaling and self.iconhoverscale or 1) + mouseoverhighlight.px = self.px + mouseoverhighlight.py = self.py + mouseoverhighlight.active = nil + local tt = self.tooltip + if r.menuname == "buildmenu" then + if self.texture ~= nil and self.udid then--string.sub(self.texture, 1, 1) == '#' then + local udefid = self.udid --tonumber(string.sub(self.texture, 2)) + WG.hoverID = udefid + local alt, ctrl, meta, shift = Spring.GetModKeyState() + if not meta and drawTooltip and WG['tooltip'] ~= nil then + local text = "\255\215\255\215"..UnitDefs[udefid].humanName.."\n\255\240\240\240" + if drawBigTooltip and UnitDefs[udefid].customParams.description_long ~= nil then + local lines = wrap(UnitDefs[udefid].customParams.description_long, 58) + local description = '' + local newline = '' + for i, line in ipairs(lines) do + description = description..newline..line + newline = '\n' + end + text = text..description + else + text = text..UnitDefs[udefid].tooltip + end + WG['tooltip'].ShowTooltip('redui_buildmenu', text) + tt = string.gsub(tt, esc("Build: "..UnitDefs[udefid].humanName.." - "..UnitDefs[udefid].tooltip).."\n", "") + end + end + end + if drawPrice and tt ~= nil then + tt = string.gsub(tt, "Metal cost %d*\nEnergy cost %d*\n", "") + end + SetTooltip(tt) + if r.menuname == "ordermenu" then + mouseoverhighlight.texturecolor={1,1,1,0.02} + end + --[[ + if r.menuname == "buildmenu" then + local CurMouseState = {Spring.GetMouseState()} --{mx,my,m1,m2,m3} + if CurMouseState[3] or CurMouseState[5] then + if self.cmdid ~= nil then + Spring.SetActiveCommand(Spring.GetCmdDescIndex(self.cmdid),1,true,false,Spring.GetModKeyState()) + end + end + end]]-- + end, + + onupdate=function(self) + local _,_,_,curcmdname = sGetActiveCommand() + self.iconscale= (iconScaling and self.iconnormalscale or 1) + --selecthighlight.iconscale = (iconScaling and ((not highlightscale and r.menuname == "buildmenu") or r.menuname ~= "buildmenu") and self.iconhoverscale or 1) + selecthighlight.iconscale = (iconScaling and self.iconhoverscale or 1) + if (curcmdname ~= nil) then + if (self.cmdname == curcmdname) then + selecthighlight.px = self.px + selecthighlight.py = self.py + selecthighlight.active = nil + end + end + end, + + effects = background.effects, + + active=false, + } + + New(background) + New(background2) + + local backward = New(Copy(icon,true)) + backward.texture = "LuaUI/Images/backward.dds" + + local forward = New(Copy(icon,true)) + forward.texture = "LuaUI/Images/forward.dds" + + local indicator = New({"rectangle", + px=0,py=0, + sx=r.isx,sy=r.isy, + captioncolor=r.ctext, + options = "n", + + effects = background.effects, + }) + background.movableslaves={backward,forward,indicator} + + local icons = {} + for y=1,r.iy do + for x=1,r.ix do + local b = New(Copy(icon,true)) + b.px = background.px +r.margin + (x-1)*(r.ispreadx + r.isx) + b.py = background.py +r.margin + (y-1)*(r.ispready + r.isy) + background.movableslaves[#background.movableslaves+1] = b + icons[#icons+1] = b + if ((y==r.iy) and (x==r.ix)) then + backward.px = icons[#icons-r.ix+1].px + forward.px = icons[#icons].px + indicator.px = (forward.px + backward.px)/2 + + backward.py = icons[#icons-r.ix].py + r.isy + r.ispready + forward.py = backward.py + indicator.py = backward.py + end + end + end + + local text = {"rectangle", + px,py = 0, 0, + sx=r.isx,sy=r.isy, + captioncolor={0.8,0.8,0.8,1}, + caption = nil, + options = "on", + } + local texts = {} + for y=1,r.iy do + for x=1,r.ix do + local b = New(Copy(text,true)) + b.px = background.px +r.margin + (x-1)*(r.ispreadx + r.isx) + b.py = background.py +r.margin + (y-1)*(r.ispready + r.isy) + background.movableslaves[#background.movableslaves+1] = b + texts[#texts+1] = b + end + end + + local staterect = {"rectangle", + border = r.cborder, + texture = stateTexture, + texturecolor = r.cborder, + effects = background.effects, + } + local staterectangles = {} + local staterectanglesglow = {} + + New(selecthighlight) + New(mouseoverhighlight) + New(heldhighlight) + + --tooltip + background.mouseover = function(mx,my,self) SetTooltip(r.tooltip.background) end + + return { + ["menuname"] = r.menuname, + ["background"] = background, + ["background2"] = background2, + ["icons"] = icons, + ["backward"] = backward, + ["forward"] = forward, + ["indicator"] = indicator, + ["staterectangles"] = staterectangles, + ["staterectanglesglow"] = staterectanglesglow, + ["staterect"] = staterect, + ["texts"] = texts, + } +end + + +local function UpdateGrid(g,cmds,ordertype) + if (#cmds==0) then + g.background.active = false + g.background2.active = false + else + g.background.active = nil + g.background2.active = nil + end + + local curpage = g.page + local icons = g.icons + local page = {{}} + + + local visibleIconCount = #icons + if #cmds > #icons then + visibleIconCount = visibleIconCount - Config[g.menuname].ix + end + for i=1,#cmds do + local index = i-(#page-1)*visibleIconCount + page[#page][index] = cmds[i] + if ((i == (visibleIconCount*#page)) and (i~=#cmds)) then + page[#page+1] = {} + end + end + g.pagecount = #page + + + if (curpage > g.pagecount) then + curpage = 1 + end + + local iconsleft = (#icons-#page[curpage]) + if (iconsleft > 0) then + for i=iconsleft+#page[curpage],#page[curpage]+1,-1 do + icons[i].active = false --deactivate + end + end + + for i=1,#g.staterectangles do + g.staterectangles[i].active = false + end + local usedstaterectangles = 0 + + for i=1,#g.staterectanglesglow do + g.staterectanglesglow[i].active = false + end + local usedstaterectanglesglow = 0 + + for i=1,#g.texts do + local text = g.texts[i] + text.caption = nil + end + + for i=1,#page[curpage] do + local cmd = page[curpage][i] + local icon = icons[i] + icon.tooltip = cmd.tooltip + icon.active = nil --activate + icon.cmdname = cmd.name + if icon.cmdname == "Repair" then icon.cmdname = "Build" end -- hack for Evo + icon.cmdid = cmd.id + icon.texture = nil + if (cmd.texture) then + if (cmd.texture ~= "") then + icon.texture = cmd.texture + end + end + + local myTeamID = Spring.GetMyTeamID() + local disableString = "disallowed_" .. (-cmd.id) + local powerBlocked = cmd.disabled + local supplyBlocked = Spring.GetTeamRulesParam(myTeamID, disableString) == 1 + + if (powerBlocked or supplyBlocked) then + icon.texturecolor = {0.44,0.44,0.44,1} + else + icon.texturecolor = {1,1,1,1} + end + + icon.mouseclick = { + {1,function(mx,my,self) + mouseClicked = 2 + if playSounds then + Spring.PlaySoundFile(sound_queue_add, 0.75, 'ui') + end + Spring.SetActiveCommand(Spring.GetCmdDescIndex(cmd.id),1,true,false,Spring.GetModKeyState()) + end}, + {3,function(mx,my,self) + mouseClicked = 2 + if playSounds then + Spring.PlaySoundFile(sound_queue_rem, 0.75, 'ui') + end + Spring.SetActiveCommand(Spring.GetCmdDescIndex(cmd.id),3,false,true,Spring.GetModKeyState()) + end}, + } + + if (ordertype == 1) then --build icons + icon.texture = "#"..cmd.id*-1 + icon.udid = cmd.id*-1 + + if (cmd.params[1]) then + icon.options = "bs" + icon.caption = "\n"..cmd.params[1].." \n" + else + icon.caption = nil + end + --icon.texturecolor = {0.88,0.88,0.88,1} + + --text to show build hotkey + local white = "\255\255\255\255" + local offwhite = "\255\222\222\222" + local yellow = "\255\255\255\0" + local orange = "\255\255\135\0" + local green = "\255\0\255\0" + local red = "\255\255\0\0" + local skyblue = "\255\136\197\226" + + local s, e = string.find(cmd.tooltip, "Metal cost %d*") + local metalCost = string.sub(cmd.tooltip, s + 11, e) + local s, e = string.find(cmd.tooltip, "Energy cost %d*") + local energyCost = string.sub(cmd.tooltip, s + 12, e) + --local metalColor = "\255\136\197\226" + + + local text = g.texts[i] + text.px = icon.px + text.py = icon.py + if powerBlocked then + text.caption = red.."\nTech\nRequired\n\n" + elseif supplyBlocked then + text.caption = red.."\nSupply\nNeeded\n\n" + else + local captionColor = white + +-- If you don't want to display the metal or energy cost on the unit buildicon, then you can disable it here + + -- redui adjusts position based on text length, so adding spaces helps us putting it at the left side of the icon + --local str = tostring(math.max(metalCost, energyCost)) + --local addedSpaces = " " -- too bad 1 space isnt as wide as 1 number in the used font + --local infoNewline = '\n' + --if largeInfo then + -- addedSpaces = " " -- too bad 1 space isnt as wide as 1 number in the used font + -- infoNewline = '' + --end + --for digit in string.gmatch(str, "%d") do + -- addedSpaces = string.sub(addedSpaces, 0, -2) + --end + + local shotcutCaption = '' + if shortcutsInfo then + if i <= 15 then + if building == 0 then + captionColor = skyblue + end + text.caption = captionColor..buildLetters[buildStartKey-96]..offwhite.." → "..captionColor..buildLetters[buildKeys[i]-96].."\n\n\n\n"..skyblue.." M: "..metalCost..offwhite.."\n"..yellow.." E: "..energyCost + text.options = "bs" + elseif i <= 30 then + if building == 1 then + captionColor = skyblue + end + text.caption = captionColor..buildLetters[buildNextKey-96]..offwhite.." → "..captionColor..buildLetters[buildKeys[i-15]-96].."\n\n\n\n"..skyblue.." M: "..metalCost..offwhite.."\n"..yellow.." E: "..energyCost + text.options = "bs" + elseif i <= 45 then + if building == 2 then + captionColor = skyblue + end + text.caption = captionColor..buildLetters[buildNextKey-96]..offwhite.." → "..captionColor..buildLetters[buildNextKey-96]..offwhite.." → "..captionColor..buildLetters[buildKeys[i-30]-96].."\n\n\n\n"..skyblue.." M: "..metalCost..offwhite.."\n"..yellow.." E: "..energyCost + text.options = "bs" + else + text.caption = nil + end + end + end + else + if buttonTexture ~= nil then + icon.texture = buttonTexture + end + if (cmd.type == 5) then --state cmds (fire at will, etc) + icon.caption = " "..(cmd.params[cmd.params[1]+2] or icon.cmdname).." " + + local statecount = #cmd.params-1 --number of states for the cmd + local curstate = cmd.params[1]+1 + + local scale = icon.iconscale * 0.9 + local px = icon.px + ((icon.sx * (1-scale))/2) + local py = icon.py + ((icon.sy * (1-scale))/2) + local sx = icon.sx * scale + local sy = icon.sy * scale + local usr = nil + + for i=1,statecount do + usedstaterectangles = usedstaterectangles + 1 + local s = g.staterectangles[usedstaterectangles] + if (s == nil) then + s = New(Copy(g.staterect,true)) + g.staterectangles[usedstaterectangles] = s + g.background.movableslaves[#g.background.movableslaves+1] = s + end + s.active = nil --activate + + + local spread = 7 + s.sx = (sx-(spread*(statecount-1+2)))/statecount + s.sy = (sy/8.5) + s.px = px+spread + (s.sx+spread)*(i-1) + s.py = py + sy - s.sy - spread + + --s.sx = (icon.sx-(spread*(statecount-1+2)))/statecount + --s.sy = (icon.sy/7) + --s.px = icon.px+spread + (s.sx+spread)*(i-1) + --s.py = icon.py + icon.sy - s.sy -spread + s.border = {0.22,0.22,0.22,0.8} + + if (i == curstate) then + usr = usedstaterectangles + if (statecount < 4) then + if (i == 1) then + s.color = {0.93,0,0,1} + s.border = {0.93,0,0,1} + elseif (i == 2) then + if (statecount == 3) then + s.color = {0.93,0.93,0,1} + s.border = {0.93,0.93,0,1} + else + s.color = {0,0.93,0,1} + s.border = {0,0.93,0,1} + end + elseif (i == 3) then + s.color = {0,0.93,0,1} + s.border = {0,0.93,0,1} + end + else + s.color = {0.93,0.93,0.93,1} + s.border = {0.93,0.93,0.93,1} + end + s.border[4] = 0.3 + else + s.color = nil + end + if s.color == nil then + s.texturecolor = s.border + else + s.texturecolor = s.color + end + end + + -- add glow for current state + if (g.staterectangles[usr] ~= nil) then + s = g.staterectangles[usr] + usedstaterectanglesglow = usedstaterectanglesglow + 1 + local s2 = g.staterectanglesglow[usedstaterectanglesglow] + if (s2 == nil) then + s2 = New(Copy(g.staterectangles[usr],true)) + g.staterectanglesglow[usedstaterectanglesglow] = s2 + g.background.movableslaves[#g.background.movableslaves+1] = s2 + end + + local glowSize = s.sy * 6 + s2.sy = s.sy + glowSize + glowSize + s2.py = s.py - glowSize + s2.px = s.px + s2.sx = s.sx + s2.texture = barGlowCenterTexture + s2.border = {0,0,0,0} + s2.color = {s.color[1] * 10, s.color[2] * 10, s.color[3] * 10, 0} + s2.texturecolor = {s.texturecolor[1] * 10, s.texturecolor[2] * 10, s.texturecolor[3] * 10, 0.11} + s2.active = true + + usedstaterectanglesglow = usedstaterectanglesglow + 1 + local s3 = g.staterectanglesglow[usedstaterectanglesglow] + if (s3 == nil) then + s3 = New(Copy(s2,true)) + g.staterectanglesglow[usedstaterectanglesglow] = s3 + g.background.movableslaves[#g.background.movableslaves+1] = s3 + end + s3.sy = s.sy + glowSize + glowSize + s3.py = s.py - glowSize + s3.px = s.px - (glowSize * 2) + s3.sx = (glowSize * 2) + s3.texture = barGlowEdgeTexture + s3.border = s2.border + s3.color = s2.color + s3.texturecolor = s2.texturecolor + s3.active = true + + usedstaterectanglesglow = usedstaterectanglesglow + 1 + local s4 = g.staterectanglesglow[usedstaterectanglesglow] + if (s4 == nil) then + s4 = New(Copy(s2,true)) + g.staterectanglesglow[usedstaterectanglesglow] = s4 + g.background.movableslaves[#g.background.movableslaves+1] = s4 + end + s4.sy = s.sy + glowSize + glowSize + s4.py = s.py - glowSize + s4.px = s.px + s.sx + (glowSize * 2) + s4.sx = -(glowSize * 2) + s4.texture = barGlowEdgeTexture + s4.border = s2.border + s4.color = s2.color + s4.texturecolor = s2.texturecolor + s4.active = true + + end + else + icon.caption = " "..icon.cmdname.." " + end + end + end + + if (#page>1) then + g.forward.mouseclick={ + {1,function(mx,my,self) + g.page = g.page + 1 + if (g.page > g.pagecount) then + g.page = 1 + end + UpdateGrid(g,cmds,ordertype) + if playSounds then + Spring.PlaySoundFile(sound_button, 0.6, 'ui') + end + end}, + } + g.backward.mouseclick={ + {1,function(mx,my,self) + g.page = g.page - 1 + if (g.page < 1) then + g.page = g.pagecount + end + UpdateGrid(g,cmds,ordertype) + if playSounds then + Spring.PlaySoundFile(sound_button, 0.6, 'ui') + end + end}, + } + g.backward.active = nil --activate + g.forward.active = nil + g.indicator.active = nil + g.indicator.caption = " "..curpage.." / "..#page.." " + else + g.backward.active = false + g.forward.active = false + g.indicator.active = false + end +end + + +function widget:TextCommand(command) + if (string.find(command, "iconspace") == 1 and string.len(command) == 9) then + iconScaling = not iconScaling + --AutoResizeObjects() + Spring.ForceLayoutUpdate() + if iconScaling then + Spring.Echo("Build/order menu icon spacing: enabled") + else + Spring.Echo("Build/order menu icon spacing: disabled") + end + end + if (string.find(command, "icontooltip") == 1 and string.len(command) == 11) then + drawTooltip = not drawTooltip + --AutoResizeObjects() + Spring.ForceLayoutUpdate() + if drawTooltip then + Spring.Echo("Build menu icon tooltip: enabled") + else + Spring.Echo("Build menu icon tooltip: disabled") + end + end + if (string.find(command, "iconinfo") == 1 and string.len(command) == 8) then + largeInfo = not largeInfo + --AutoResizeObjects() + Spring.ForceLayoutUpdate() + if largeInfo then + Spring.Echo("Build/order menu icon info: large") + else + Spring.Echo("Build/order menu icon info: small") + end + end + if (string.find(command, "iconinfokeys") == 1 and string.len(command) == 12) then + shortcutsInfo = not shortcutsInfo + --AutoResizeObjects() + Spring.ForceLayoutUpdate() + if shortcutsInfo then + Spring.Echo("Build/order menu icon shortcut info: enabled") + else + Spring.Echo("Build/order menu icon shortcut info: disabled") + end + end + if (string.find(command, "buildmenusounds") == 1 and string.len(command) == 15) then + playSounds = not playSounds + --AutoResizeObjects() + Spring.ForceLayoutUpdate() + if playSounds then + Spring.Echo("Build/order menu sounds: enabled") + else + Spring.Echo("Build/order menu sounds: disabled") + end + end +end + +function tableMerge(t1, t2) + for k,v in pairs(t2) do + if type(v) == "table" then + if type(t1[k] or false) == "table" then + tableMerge(t1[k] or {}, t2[k] or {}) + else + t1[k] = v + end + else + t1[k] = v + end + end + return t1 +end + +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy +end + +function widget:Initialize() + PassedStartupCheck = RedUIchecks() + if (not PassedStartupCheck) then return end + + if largeUnitIcons then + Config.buildmenu = tableMerge(deepcopy(Config.buildmenu), deepcopy(largeUnitIconSize)) + Config.ordermenu = tableMerge(deepcopy(Config.ordermenu), deepcopy(largeOrderIconSize)) + else + Config.buildmenu = tableMerge(deepcopy(Config.buildmenu), deepcopy(normalUnitIconSize)) + Config.ordermenu = tableMerge(deepcopy(Config.ordermenu), deepcopy(normalOrderIconSize)) + end + + ordermenu = CreateGrid(Config.ordermenu) + ordermenu.page = 1 + buildmenu = CreateGrid(Config.buildmenu) + buildmenu.page = 1 + + AutoResizeObjects() --fix for displacement on crash issue + + + WG['red_buildmenu'] = {} + WG['red_buildmenu'].getConfigLargeInfo = function() + return largeInfo + end + WG['red_buildmenu'].getConfigUnitTooltip = function() + return drawTooltip + end + WG['red_buildmenu'].getConfigShortcutsInfo = function() + return shortcutsInfo + end + WG['red_buildmenu'].getConfigPlaySounds = function() + return playSounds + end + WG['red_buildmenu'].getConfigLargeUnitIcons = function() + return largeUnitIcons + end + WG['red_buildmenu'].setConfigLargeInfo = function(value) + largeInfo = value + end + WG['red_buildmenu'].setConfigUnitTooltip = function(value) + drawTooltip = value + end + WG['red_buildmenu'].getConfigPlaySounds = function() + return playSounds + end + WG['red_buildmenu'].setConfigShortcutsInfo = function(value) + shortcutsInfo = value + end + WG['red_buildmenu'].setConfigPlaySounds = function(value) + playSounds = value + end + WG['red_buildmenu'].setConfigLargeUnitIcons = function(value) + largeUnitIcons = value + Spring.SendCommands("luarules reloadluaui") + end +end + +local function onWidgetUpdate() --function widget:Update() + AutoResizeObjects() +end + +--save/load stuff +--currently only position +function widget:GetConfigData() --save config + if (PassedStartupCheck) then + local vsy = Screen.vsy + local unscale = CanvasY/vsy --needed due to autoresize, stores unresized variables + Config.buildmenu.px = buildmenu.background.px * unscale + Config.buildmenu.py = buildmenu.background.py * unscale + Config.ordermenu.px = ordermenu.background.px * unscale + Config.ordermenu.py = ordermenu.background.py * unscale + return {Config=Config, iconScaling=iconScaling, drawPrice=drawPrice, drawTooltip=drawTooltip, drawBigTooltip=drawBigTooltip, largePrice=largePrice, oldUnitpics=oldUnitpics, shortcutsInfo=shortcutsInfo, playSounds=playSounds, largeUnitIcons=largeUnitIcons} + end +end +function widget:SetConfigData(data) --load config + if (data.Config ~= nil) then + Config.buildmenu.px = data.Config.buildmenu.px + Config.buildmenu.py = data.Config.buildmenu.py + Config.ordermenu.px = data.Config.ordermenu.px + Config.ordermenu.py = data.Config.ordermenu.py + if (data.drawPrice ~= nil) then + drawPrice = data.drawPrice + end + if (data.drawTooltip ~= nil) then + drawTooltip = data.drawTooltip + end + if (data.drawTooltip ~= nil) then + drawBigTooltip = data.drawBigTooltip + end + if (data.iconScaling ~= nil) then + iconScaling = data.iconScaling + end + if (data.largeInfo ~= nil) then + largeInfo = data.largeInfo + end + if (data.shortcutsInfo ~= nil) then + shortcutsInfo = data.shortcutsInfo + end + if (data.largeUnitIcons ~= nil) then + largeUnitIcons = data.largeUnitIcons + end + if (data.playSounds ~= nil) then + playSounds = data.playSounds + end + end +end + + + + + + +--lots of hacks under this line ------------- overrides/disables default spring menu layout and gets current orders + filters out some commands +local hijackedlayout = false +function widget:Shutdown() + if (hijackedlayout) then + widgetHandler:ConfigLayoutHandler(true) + Spring.ForceLayoutUpdate() + end + WG['red_buildmenu'] = nil +end + +local function GetCommands() + local hiddencmds = { + [76] = true, --load units clone + [65] = true, --selfd + [9] = true, --gatherwait + [8] = true, --squadwait + [7] = true, --deathwait + [6] = true, --timewait + [39812] = true, --raw move + [34922] = true, -- set unit target + --[34923] = true, -- set target + } + local buildcmds = {} + local statecmds = {} + local othercmds = {} + local buildcmdscount = 0 + local statecmdscount = 0 + local othercmdscount = 0 + for index,cmd in pairs(sGetActiveCmdDescs()) do + if (type(cmd) == "table") then + if ( + (not hiddencmds[cmd.id]) and + (cmd.action ~= nil) and + --(not cmd.disabled) and + (not widgetHandler.commands[index].hidden) and --apparently GetActiveCmdDescs is bugged and returns hidden for every command + (cmd.type ~= 21) and + (cmd.type ~= 18) and + (cmd.type ~= 17) + ) then + if (((cmd.type == 20) --build building + or (ssub(cmd.action,1,10) == "buildunit_"))) then + buildcmdscount = buildcmdscount + 1 + buildcmds[buildcmdscount] = cmd + elseif (cmd.type == 5) then + statecmdscount = statecmdscount + 1 + statecmds[statecmdscount] = cmd + else + othercmdscount = othercmdscount + 1 + othercmds[othercmdscount] = cmd + end + end + end + end + local tempcmds = {} + for i=1,statecmdscount do + tempcmds[i] = statecmds[i] + end + for i=1,othercmdscount do + tempcmds[i+statecmdscount] = othercmds[i] + end + othercmdscount = othercmdscount + statecmdscount + othercmds = tempcmds + + return buildcmds,othercmds +end + + + +local selectionChanged = true +local function onNewCommands(force) + local buildcmds,othercmds = {},{} + if selectionChanged or force then + if (SelectedUnitsCount==0) then + buildmenu.page = 1 + ordermenu.page = 1 + else + buildcmds,othercmds = GetCommands() + end + UpdateGrid(ordermenu,othercmds,2) + UpdateGrid(buildmenu,buildcmds,1) + selectionChanged = false + end +end + +local function updateGrids() + local buildcmds,othercmds = {},{} + if (SelectedUnitsCount == 0) then + buildmenu.page = 1 + ordermenu.page = 1 + else + buildcmds,othercmds = GetCommands() + end + UpdateGrid(ordermenu,othercmds,2) + UpdateGrid(buildmenu,buildcmds,1) +end + +local hijackattempts = 0 +local layoutping = 54352 --random number +local function hijacklayout() + if (hijackattempts>5) then + Spring.Echo(widget:GetInfo().name.." failed to hijack config layout.") + widgetHandler:ToggleWidget(widget:GetInfo().name) + return + end + local function dummylayouthandler(xIcons, yIcons, cmdCount, commands) --gets called on selection change + WG.layoutpinghax = 54352 + widgetHandler.commands = commands + widgetHandler.commands.n = cmdCount + widgetHandler:CommandsChanged() --call widget:CommandsChanged() + local iconList = {[1337]=9001} + local custom_cmdz = widgetHandler.customCommands + return "", xIcons, yIcons, {}, custom_cmdz, {}, {}, {}, {}, {}, iconList + end + widgetHandler:ConfigLayoutHandler(dummylayouthandler) --override default build/ordermenu layout + Spring.ForceLayoutUpdate() + hijackedlayout = true + hijackattempts = hijackattempts + 1 +end +local updatehax = false +local updatehax2 = true +local firstupdate = true +local function haxlayout() + if (WG.layoutpinghax~=layoutping) then + hijacklayout() + end + WG.layoutpinghax = nil + updatehax = true +end +function widget:CommandsChanged() + haxlayout() +end + +local sec = 0 + +local guishaderCheckInterval = 1 +local oldSupplyMax = 0 +local uiOpacitySec = 0 +function widget:Update(dt) + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + ordermenu.background.color = {0,0,0,ui_opacity} + buildmenu.background.color = {0,0,0,ui_opacity} + ordermenu.background2.color = {1,1,1,ui_opacity*0.055} + buildmenu.background2.color = {1,1,1,ui_opacity*0.055} + end + end + sec=sec+dt + if (sec>1/guishaderCheckInterval) then + sec = 0 + if (WG['guishader'] ~= guishaderEnabled) then + guishaderEnabled = WG['guishader'] + if (guishaderEnabled) then + Config.buildmenu.fadetimeOut = 0.02 + Config.ordermenu.fadetimeOut = 0.02 + else + Config.buildmenu.fadetimeOut = Config.buildmenu.fadetime*0.66 + Config.ordermenu.fadetimeOut = Config.ordermenu.fadetime*0.66 + end + end + end + onWidgetUpdate() + if (updatehax or firstupdate) then + if (firstupdate) then + haxlayout() + firstupdate = nil + end + onNewCommands(mouseClicked>0) + mouseClicked = mouseClicked-1 + updatehax = false + updatehax2 = true + end + + -- refresh cause queue text could have changed + queueUpdateSec = queueUpdateSec + dt + if buildmenu.background.active == nil and queueUpdateSec > 0.5 then + queueUpdateSec = 0 + local buildcmds = GetCommands() + UpdateGrid(buildmenu,buildcmds,1) + end + + if (updatehax2) then + if (SelectedUnitsCount == 0) then + onNewCommands() --flush + updatehax2 = false + end + end +end + +function widget:SelectionChanged(sel) + selectionChanged = true + SelectedUnitsCount = sGetSelectedUnitsCount() +end + + +function widget:KeyPress(key, mods, isRepeat) + if shortcutsInfo then + if building ~= -1 then + if building == 1 and key == buildNextKey then + building = 2 + onNewCommands(true) + return true + end + local buildcmds, othercmds = GetCommands() + local found = -1 + for index = 1, #buildKeys do + if buildKeys[index] == key then + found = index + (15*building) + break + end + end + if found ~= -1 and buildcmds[found] ~= nil then + if playSounds then + Spring.PlaySoundFile(sound_queue_add, 0.75, 'ui') + end + Spring.SetActiveCommand(Spring.GetCmdDescIndex(buildcmds[found].id),1,true,false,Spring.GetModKeyState()) + end + building = -1 + onNewCommands(true) + return true + else + -- this prevents keys to be captured when you cannot build anything + local buildcmds = GetCommands() + if #buildcmds == 0 then return false end + + if key == buildStartKey then + building = 0 + onNewCommands(true) + return true + elseif key == buildNextKey then + building = 1 + onNewCommands(true) + return true + end + end + -- updates UI because hotkeys text changed color + onNewCommands(true) + return false + end +end + +function widget:GameFrame(n) + if n%450 == 4 then + _, _, spectator = Spring.GetPlayerInfo(Spring.GetMyTeamID()) + end +end + +-- highlights stuff for new players +local function setBrightness(condition, icon) + if condition and spectator == false then + local brightness = Spring.GetGameFrame() % 60 / 60 + if brightness < 0.5 then brightness = 0.5 + brightness -- lighter + else brightness = 1.5 - brightness end -- dimmer + icon.border = {brightness, brightness, 0, 1} + + highlightedIconsLeng = highlightedIconsLeng + 1 + highlightedIcons[highlightedIconsLeng] = icon + else + icon.border = {0, 0, 0, 0} + end +end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if buildPicHelp == 1 then + + --Legend for quick reference + + -- c currentLevel, + -- s storage, + -- p pull, + -- i income, + -- e expense, + -- sh share, + -- se sent, + -- r received + + -- copied from "gui_resourceBar.lua" + local myTeamID = Spring.GetMyTeamID() + local su, sm = math.round(Spring.GetTeamRulesParam(myTeamID, "supplyUsed") or 0), math.round(Spring.GetTeamRulesParam(myTeamID, "supplyMax") or 0) + local ec, es, ep, ei, ee = Spring.GetTeamResources(myTeamID, "energy") + local mc, ms, mp, mi, me = Spring.GetTeamResources(myTeamID, "metal") + local supplyWarning = (sm < 30 and su >= sm - 5) or (su > sm) or (sm >= 30 and su >= sm - 10 and su < sm and sm < maxSupply * 0.95) + local energyWarning = ec / es < 0.2 + local metalLowWarning = mc / ms < 0.2 + local metalHighWarning = mc / ms > 0.9 + + for i = 1, #highlightedIcons do + highlightedIcons[i].border = {0, 0, 0, 0} + end + highlightedIcons = {} + highlightedIconsLeng = 0 + + local icons = buildmenu.icons + for i=1,#icons do + local icon = icons[i] + if icon.active == nil then + if icon.cmdname == "estorage" then + setBrightness(supplyWarning, icon) + elseif icon.cmdname == "esolar2" or icon.cmdname == "egeothermal" or icon.cmdname == "efusion2" then + setBrightness(energyWarning, icon) + elseif icon.cmdname == "emetalextractor" then + setBrightness(metalLowWarning, icon) + elseif icon.cmdname == "eorb" then + setBrightness(metalHighWarning, icon) + end + end + end + end +end diff --git a/LuaUI/Widgets_Evo/gui_red_chatonlyconsole.lua b/LuaUI/Widgets_Evo/gui_red_chatonlyconsole.lua new file mode 100644 index 000000000..07893fa17 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_red_chatonlyconsole.lua @@ -0,0 +1,964 @@ +-- disable as clipLine is very slow on headless +if (Spring.GetConfigInt('Headless', 0) ~= 0) then + return false +end + +function widget:GetInfo() + return { + name = "Red Console (In-game chat only)", --version 4.1 + desc = "Requires Red UI Framework", + author = "Regret + Doo edit", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true, --enabled by default + handler = true, --can use widgetHandler:x() + } +end +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (1 + (vsx*vsy / 4000000)) + +local NeededFrameworkVersion = 8 +local SoundIncomingChat = 'sounds/ui/beep4.wav' +local SoundIncomingChatVolume = 1.0 + +local gameOver = false +local lastConnectionAttempt = '' +--todo: dont cut words apart when clipping text + + +local clock = os.clock +local slen = string.len +local ssub = string.sub +local sgsub = string.gsub +local sfind = string.find +local sformat = string.format +local schar = string.char +local sgsub = string.gsub +local mfloor = math.floor +local sbyte = string.byte +local sreverse = string.reverse +local mmax = math.max +local glGetTextWidth = gl.GetTextWidth +local sGetPlayerRoster = GetPlayerRoster +local sGetTeamColor = Spring.GetTeamColor +local sGetMyAllyTeamID = Spring.GetMyAllyTeamID +local sGetModKeyState = Spring.GetModKeyState +local spPlaySoundFile = Spring.PlaySoundFile +local sGetMyPlayerID = Spring.GetMyPlayerID + +local fontsize = 11.5 +local fontsizeMultiplier = 1 + +local showBackground = false +local showBackgroundOpacity = 0.19 + +local Config = { + console = { + px = vsx*0.3,py = vsy*0.105, --default start position + sx = vsx*0.4, --background size + + fontsize = fontsize*widgetScale, + + minlines = 2, --minimal number of lines to display + maxlines = 6, + maxlinesScrollmode = 10, + + maxage = 60, --max time for a message to be displayed, in seconds + + margin = 7*widgetScale, --distance from background border + + fadetime = 0.25, --fade effect time, in seconds + fadedistance = 1*widgetScale, --distance from cursor at which console shows up when empty + + filterduplicates = true, --group identical lines, f.e. ( 5x Nickname: blahblah) + + --note: transparency for text not supported yet + cothertext = {1,1,1,1}, --normal chat color + callytext = {0,1,0,1}, --ally chat + cspectext = {1,1,0,1}, --spectator chat + + cotherallytext = {1,0.5,0.5,1}, --enemy ally messages (seen only when spectating) + cmisctext = {0.78,0.78,0.78,1}, --everything else + cgametext = {0.4,1,1,1}, --server (autohost) chat + + cbackground = {0,0,0,0.0}, + cborder = {0,0,0,0}, + + dragbutton = {2,3}, --middle mouse button + tooltip = { + background ="In CTRL+F11 mode: Hold \255\255\255\1middle mouse button\255\255\255\255 to drag the console.\n".. + "- Press \255\255\255\1CTRL\255\255\255\255 while mouse is above the \nconsole to activate chatlog viewing.\n".. + "- Use mousewheel (+hold \255\255\255\1SHIFT\255\255\255\255 for speedup)\n to scroll through the chatlog.", + }, + }, +} + + +local function IncludeRedUIFrameworkFunctions() + New = WG.Red.New(widget) + Copy = WG.Red.Copytable + SetTooltip = WG.Red.SetTooltip + GetSetTooltip = WG.Red.GetSetTooltip + Screen = WG.Red.Screen + GetWidgetObjects = WG.Red.GetWidgetObjects +end + +local function RedUIchecks() + local color = "\255\255\255\1" + local passed = true + if (type(WG.Red)~="table") then + Spring.Echo(color..widget:GetInfo().name.." requires Red UI Framework.") + passed = false + elseif (type(WG.Red.Screen)~="table") then + Spring.Echo(color..widget:GetInfo().name..">> strange error.") + passed = false + elseif (WG.Red.Version < NeededFrameworkVersion) then + Spring.Echo(color..widget:GetInfo().name..">> update your Red UI Framework.") + passed = false + end + if (not passed) then + widgetHandler:ToggleWidget(widget:GetInfo().name) + return false + end + IncludeRedUIFrameworkFunctions() + return true +end + +local function GetPlayerRoster() +PlayerRoster = {} + if Engine and Engine.version then + PlayerList = Spring.GetPlayerList() + for ct,playerID in pairs(PlayerList) do + PlayerInfo = {Spring.GetPlayerInfo(playerID)} + PlayerRoster[ct] = {} + PlayerRoster[ct][1] = PlayerInfo[1] + PlayerRoster[ct][2] = playerID + PlayerRoster[ct][3] = PlayerInfo[4] + PlayerRoster[ct][4] = PlayerInfo[5] + PlayerRoster[ct][5] = PlayerInfo[3] + PlayerRoster[ct][6] = PlayerInfo[7] + PlayerRoster[ct][7] = PlayerInfo[6] + -- Spring.Echo(PlayerInfo) + end + return PlayerRoster + else + return Spring.GetPlayerRoster() + end +end + +local function AutoResizeObjects() --autoresize v2 + if (LastAutoResizeX==nil) then + LastAutoResizeX = vsx + LastAutoResizeY = vsy + end + local lx,ly = LastAutoResizeX,LastAutoResizeY + local vsx,vsy = Screen.vsx,Screen.vsy + if ((lx ~= vsx) or (ly ~= vsy)) then + local objects = GetWidgetObjects(widget) + local scale = vsy/ly + local skippedobjects = {} + for i=1,#objects do + local o = objects[i] + local adjust = 0 + if ((o.movableslaves) and (#o.movableslaves > 0)) then + adjust = (o.px*scale+o.sx*scale)-vsx + if (((o.px+o.sx)-lx) == 0) then + o._moveduetoresize = true + end + end + if (o.px) then o.px = o.px * scale end + if (o.py) then o.py = o.py * scale end + if (o.sx) then o.sx = o.sx * scale end + if (o.sy) then o.sy = o.sy * scale end + if (o.fontsize) then o.fontsize = o.fontsize * scale end + if (adjust > 0) then + o._moveduetoresize = true + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + elseif ((adjust < 0) and o._moveduetoresize) then + o._moveduetoresize = nil + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + end + end + LastAutoResizeX,LastAutoResizeY = vsx,vsy + end +end + + +local function createconsole(r) + local vars = {} + + local lines = {"text", + px=r.px+r.margin,py=r.py+r.margin, + fontsize=r.fontsize, + caption="", + options="o", --black outline + } + + local activationarea = {"area", + px=r.px-r.fadedistance,py=r.py-r.fadedistance, + sx=r.sx+r.fadedistance*2,sy=0, + + mousewheel=function(up,mx,my,self) + if (vars.browsinghistory) then + local alt,ctrl,meta,shift = Spring.GetModKeyState() + local step = 1 + if (shift) then + step = 5 + end + if (vars.historyoffset == nil) then + vars.historyoffset = 0 + end + if (up) then + vars.historyoffset = vars.historyoffset + step + vars._forceupdate = true + else + vars.historyoffset = vars.historyoffset - step + vars._forceupdate = true + end + if (vars.historyoffset > (#vars.consolehistory - r.maxlines)) then + vars.historyoffset = #vars.consolehistory - r.maxlines + elseif (vars.historyoffset < 0) then + vars.historyoffset = 0 + end + end + end, + } + + local background = {"rectanglerounded", + px=r.px,py=r.py, + sx=r.sx,sy=r.maxlines*r.fontsize+r.margin*2, + color=r.cbackground, + border=r.cborder, + movable=r.dragbutton, + + obeyscreenedge = true, + --overrideclick = {2}, + + movableslaves={lines,activationarea}, + + effects = { + fadein_at_activation = r.fadetime, + fadeout_at_deactivation = r.fadetime, + }, + } + + activationarea.onupdate=function(self) + local fadedistance = (self.sx-background.sx)/2 + self.sy = background.sy+fadedistance*2 + self.px = background.px-fadedistance + self.py = background.py-fadedistance + + if (not self._mousenotover) then + background.active = nil --activate + if (vars._empty) then + background.sy = (r.minlines*lines.fontsize + (lines.px-background.px)*2) + end + local alt,ctrl,meta,shift = Spring.GetModKeyState() + if (ctrl and not vars.browsinghistory) then + if (vars._skipagecheck == nil) then + vars._forceupdate = true + vars.nextupdate = -1 + vars.browsinghistory = true + vars.historyoffset = 0 + + self.overridewheel = true + end + vars._skipagecheck = true + vars._usecounters = false + end + else + if (vars._skipagecheck ~= nil) then + vars._forceupdate = true + vars.browsinghistory = nil + vars.historyoffset = 0 + + self.overridewheel = nil + vars._skipagecheck = nil + vars._usecounters = nil + end + end + + self._mousenotover = nil + end + activationarea.mousenotover=function(mx,my,self) + self._mousenotover = true + if (vars._empty) then + background.active = false + end + end + + New(activationarea) + New(background) + New(lines) + + local counters = {} + for i=1,r.maxlines do + local b = New(lines) + b.onupdate = function(self) + self.px = background.px - self.getwidth() - (lines.px-background.px) + end + b._count = 0 + b.active = false + b.py = b.py+(i-1)*r.fontsize + counters[#counters+1] = b + background.movableslaves[#background.movableslaves+1] = b + end + + --tooltip + background.mouseover = function(mx,my,self) SetTooltip(r.tooltip.background) end + + background.active = nil + + return { + ["background"] = background, + ["lines"] = lines, + ["counters"] = counters, + ["vars"] = vars + } +end + +local function lineColour(prevline) -- search prevline and find the final instance of a colour code + + local prevlineReverse = sreverse(prevline) + local newlinecolour = "" + + local colourCodePosReverse = sfind(prevlineReverse, "\255") --search string from back to front + + if colourCodePosReverse then + for i = 0,2 do + if ssub(prevlineReverse, colourCodePosReverse + 3 - i, colourCodePosReverse + 3 - i) == "\255" then + colourCodePosReverse = colourCodePosReverse + 3 - i + break + end + end + + local colourCodePos = slen(prevline) - colourCodePosReverse + 1 + if slen(ssub(prevline, colourCodePos)) >= 4 then + newlinecolour = ssub(prevline, colourCodePos, colourCodePos+3) + end + end + + return newlinecolour +end + +local function clipLine(line,fontsize,maxwidth) + local clipped = {} + + local firstclip = line:len() + local firstpass = true + while (1) do --loops over lines + local linelen = slen(line) + local i=1 + while (1) do -- loop through potential positions where we might need to clip + if (glGetTextWidth(ssub(line,1,i+1))*fontsize > maxwidth) then + local test = line + local newlinecolour = "" + + -- set colour of new clipped line + if firstpass == nil then + newlinecolour = lineColour(clipped[#clipped]) + end + + local newline = newlinecolour .. ssub(test,1,i) + + clipped[#clipped+1] = newline + line = ssub(line,i+1) + + if (firstpass) then + firstclip = i + firstpass = nil + end + + break + end + i=i+1 + if (i > linelen) then + break + end + end + + -- check if we need to clip again + local width = glGetTextWidth(line)*fontsize + if (width <= maxwidth) then + break + end + end + + -- put remainder of line into final clipped line + local newlinecolour = "" + if #clipped > 0 then + newlinecolour = lineColour(clipped[#clipped]) + end + clipped[#clipped+1] = newlinecolour .. line + + return clipped,firstclip +end + +local function clipHistory(g,oneline) + local history = g.vars.consolehistory + local maxsize = g.background.sx - (g.lines.px-g.background.px) + + local fontsize = g.lines.fontsize + + if (oneline) then + local line = history[#history] + local lines,firstclip = clipLine(line[1],fontsize,maxsize) + line[1] = ssub(line[1],1,firstclip) + for i=1,#lines do + if (i>1) then + history[#history+1] = {line[4]..lines[i],line[2],line[3],line[4],line[5]} + end + end + else + local clippedhistory = {} + for i=1,#history do + local line = history[i] + local lines,firstclip = clipLine(line[1],fontsize,maxsize) + lines[1] = ssub(line[1],1,firstclip) + for i=1,#lines do + if (i>1) then + clippedhistory[#clippedhistory+1] = {line[4]..lines[i],line[2],line[3],line[4],line[5]} + else + clippedhistory[#clippedhistory+1] = {lines[i],line[2],line[3],line[4],line[5]} + end + end + end + g.vars.consolehistory = clippedhistory + end +end + +local function convertColor(r,g,b) + return schar(255, (r*255), (g*255), (b*255)) +end + +local function processLine(line,g,cfg,newlinecolor) + + + g.vars.nextupdate = 0 + + local roster = GetPlayerRoster() + --[[DEBUG + for i,el in pairs(roster) do + if i==1 then + Spring.Echo(#el) + for j,val in pairs(el) do + Spring.Echo(j,val) + end + end + Spring.Echo(i,el) + end + --]] + + local names = {} + for i=1,#roster do + names[roster[i][1]] = {roster[i][4],roster[i][5],roster[i][3],roster[i][2]} + end + + local name = "" + local text = "" + local linetype = 0 --other + if Initialized == true then + bypassThisMessage = true + else + bypassThisMessage = false + end + local ignoreThisMessage = false + local ignoredText = "(ignored)" + + if sfind(line, "My player ID is") and sfind(line, regID) and not nameregistered then + -- Spring.SendCommands("say Registration ID found") + registermyname = true + bypassThisMessage = true + end + + if (not newlinecolor) then + if (names[ssub(line,2,(sfind(line,"> ") or 1)-1)] ~= nil) then + bypassThisMessage = false + linetype = 1 --playermessage + name = ssub(line,2,sfind(line,"> ")-1) + text = ssub(line,slen(name)+4) + if ssub(text,1,1) == "!" and ssub(text, 1,2) ~= "!!" then --bot command + bypassThisMessage = true + end + elseif (names[ssub(line,2,(sfind(line,"] ") or 1)-1)] ~= nil) then + bypassThisMessage = false + linetype = 2 --spectatormessage + name = ssub(line,2,sfind(line,"] ")-1) + text = ssub(line,slen(name)+4) + if ssub(text,1,1) == "!" and ssub(text, 1,2) ~= "!!" then --bot command + bypassThisMessage = true + end + elseif (names[ssub(line,2,(sfind(line,"(replay)") or 3)-3)] ~= nil) then + bypassThisMessage = false + linetype = 2 --spectatormessage + name = ssub(line,2,sfind(line,"(replay)")-3) + text = ssub(line,slen(name)+13) + if ssub(text,1,1) == "!" and ssub(text, 1,2) ~= "!!" then --bot command + bypassThisMessage = true + end + elseif (names[ssub(line,1,(sfind(line," added point: ") or 1)-1)] ~= nil) then + bypassThisMessage = false + linetype = 3 --playerpoint + name = ssub(line,1,sfind(line," added point: ")-1) + text = ssub(line,slen(name.." added point: ")+1) + if text == "" then + text = "Look here!" + end + elseif (ssub(line,1,1) == ">") then + linetype = 4 --gamemessage + text = ssub(line,3) + bypassThisMessage = true + if ssub(line,1,3) == "> <" then --player speaking in battleroom + bypassThisMessage = false + if ssub(text,1,1) == "!" and ssub(text, 1,2) ~= "!!" then --bot command + bypassThisMessage = true + end + local i = sfind(ssub(line,4,slen(line)), ">") + if (i) then + name = ssub(line,4,i+2) + else + name = "unknown" + end + + end + end + end + + if registermyname and not nameregistered then + myname = name + registermyname = false + nameregistered = true + bypassThisMessage = true + elseif sfind(line, "My player ID is") and sfind(line, regID) then + bypassThisMessage = true + end + + -- filter shadows config changes + if sfind(line,"^Set \"shadows\" config(-)parameter to ") then + bypassThisMessage = true + end + + + -- filter Sync error when its a spectator + if sfind(line,"^Sync error for ") then + name = ssub(line,16,sfind(line," in frame ")-1) + if names[name] ~= nil and names[name][2] ~= nil and names[name][2] and sGetMyPlayerID() ~= names[name][4] then -- when spec + bypassThisMessage = true + end + end + + -- filter Sync error when its a spectator + if sfind(line,"^Error: %[DESYNC WARNING%] ") then + name = ssub(line,sfind(line," %(")+2,sfind(line,"%) ")-1) + if names[name] ~= nil and names[name][2] ~= nil and names[name][2] and sGetMyPlayerID() ~= names[name][4] then -- when spec + bypassThisMessage = true + end + end + + -- filter Connection attempts + if sfind(line,"^Connection attempt from ") then + name = ssub(line,25) + lastConnectionAttempt = name + bypassThisMessage = true + end + + -- filter Connection established + if sfind(line," Connection established") then + name = lastConnectionAttempt + bypassThisMessage = true + end + + + if linetype==0 then + --filter out some engine messages; + --2 lines (instead of 4) appears when player connects + if sfind(line,'-> Version') or sfind(line,'ClientReadNet') or sfind(line,'Address') then + bypassThisMessage = true + end + + if sfind(line,"Wrong network version") then + local n,_ = sfind(line,"Message") + if n ~= nil then + line = ssub(line,1,n-3) --shorten so as these messages don't get clipped and can be detected as duplicates + end + end + + + if gameOver then + if sfind(line,'left the game') then + bypassThisMessage = true + end + end + end + + + --ignore messages from muted-- + if WG.ignoredPlayers and WG.ignoredPlayers[name] then + bypassThisMessage = true + --ignoreThisMessage = true + --Spring.Echo ("blocked message by " .. name) + end + + local MyAllyTeamID = sGetMyAllyTeamID() + local textcolor = nil + + local playSound = false + if (linetype==1) then --playermessage + local c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + if (sfind(text,"Allies: ") == 1) then + text = ssub(text,9) + if (names[name][1] == MyAllyTeamID) then + c = cfg.callytext + else + c = cfg.cotherallytext + end + elseif (sfind(text,"Spectators: ") == 1) then + text = ssub(text,13) + c = cfg.cspectext + end + + textcolor = convertColor(c[1],c[2],c[3]) + local r,g,b,a = sGetTeamColor(names[name][3]) + local namecolor = convertColor(r,g,b) + if ignoreThisMessage then text = ignoredText end + + line = namecolor..name..misccolor..": "..textcolor..text + + playSound = true + + elseif (linetype==2) then --spectatormessage + local c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + if (sfind(text,"Allies: ") == 1) then + text = ssub(text,9) + c = cfg.cspectext + elseif (sfind(text,"Spectators: ") == 1) then + text = ssub(text,13) + c = cfg.cspectext + end + textcolor = convertColor(c[1],c[2],c[3]) + c = cfg.cspectext + local namecolor = convertColor(c[1],c[2],c[3]) + if ignoreThisMessage then text = ignoredText end + + line = namecolor.."(s) "..name..misccolor..": "..textcolor..text + + playSound = true + + elseif (linetype==3) then --playerpoint + local c = cfg.cspectext + local namecolor = convertColor(c[1],c[2],c[3]) + + local spectator = true + if (names[name] ~= nil) then + spectator = names[name][2] + end + if (spectator) then + name = "(s) "..name + else + local r,g,b,a = sGetTeamColor(names[name][3]) + namecolor = convertColor(r,g,b) + end + + c = cfg.cotherallytext + if (spectator) then + c = cfg.cspectext + elseif (names[name][1] == MyAllyTeamID) then + c = cfg.callytext + end + textcolor = convertColor(c[1],c[2],c[3]) + c = cfg.cothertext + local misccolor = convertColor(c[1],c[2],c[3]) + if ignoreThisMessage then text = ignoredText end + + line = namecolor..name..misccolor.." * "..textcolor..text + + elseif (linetype==4) then --gamemessage + local c = cfg.cgametext + textcolor = convertColor(c[1],c[2],c[3]) + if ignoreThisMessage and name then -- ignored player talking in battleroom + line = textcolor.."> <"..name.."> "..ignoredText + else + line = textcolor.."> "..text + end + else --every other message + local c = cfg.cmisctext + textcolor = convertColor(c[1],c[2],c[3]) + + line = textcolor..line + end + + if (g.vars.consolehistory == nil) then + g.vars.consolehistory = {} + end + local history = g.vars.consolehistory + + + if (not bypassThisMessage == true) then --mute-- + if (g.vars.browsinghistory) then + if (g.vars.historyoffset == nil) then + g.vars.historyoffset = 0 + end + g.vars.historyoffset = g.vars.historyoffset + 1 + end + local lineID = #history+1 + history[#history+1] = {line,clock(),lineID,textcolor,linetype} + + if ( playSound ) and (not bypassThisMessage == true) and not Spring.IsGUIHidden() then + spPlaySoundFile( SoundIncomingChat, SoundIncomingChatVolume, nil, "ui" ) + end + end + onelinedone = true + return history[#history] +end + +local function updateconsole(g,cfg) + local forceupdate = g.vars._forceupdate + local justforcedupdate = g.vars._justforcedupdate + + if (forceupdate and (not justforcedupdate)) then + g.vars._justforcedupdate = true + g.vars._forceupdate = nil + else + g.vars._justforcedupdate = nil + g.vars._forceupdate = nil + + if (g.vars.nextupdate == nil) then + g.vars.nextupdate = 0 + end + if ((g.vars.nextupdate < 0) or (clock() < g.vars.nextupdate)) then + return + end + end + + local skipagecheck = g.vars._skipagecheck + local usecounters = g.vars._usecounters + + local maxlines = cfg.maxlines + + local historyoffset = 0 + if (g.vars.browsinghistory) then + if (g.vars.historyoffset == nil) then + g.vars.historyoffset = 0 + end + historyoffset = g.vars.historyoffset + maxlines = cfg.maxlinesScrollmode + end + + if (usecounters == nil) then + usecounters = cfg.filterduplicates + end + + + local counters = {} + for i=1,maxlines do + counters[i] = 1 + if g.counters[i] == nil then + g.counters[i] = {} + end + g.counters[i].active = false + g.counters[i].caption = "" + end + + local maxage = cfg.maxage + local display = "" + local count = 0 + local i=0 + local lastID = 0 + local lastLine = "" + + local history = g.vars.consolehistory or {} + + while (count < maxlines) do + if (history[#history-i-historyoffset]) then + local line = history[#history-i-historyoffset] + if (skipagecheck or ((clock()-line[2]) <= maxage)) then + if (count == 0) then + count = count + 1 + display = line[1] + else + if (usecounters and (lastID > 0) and (lastID~=line[3]) and (line[1] == lastLine)) then + counters[count] = counters[count] + 1 + else + count = count + 1 + display = line[1].."\n"..display + end + end + + lastLine = line[1] + lastID = line[3] + + if (skipagecheck) then + g.vars.nextupdate = -1 + else + g.vars.nextupdate = line[2]+maxage + end + else + break + end + i=i+1 + else + break + end + end + + if (usecounters) then + for i=1,#counters do + if (counters[i] ~= 1) then + local counter = count-i+1 + g.counters[counter].active = nil + g.counters[counter].caption = counters[i].."x" + end + end + end + + if (count == 0) then + g.vars.nextupdate = -1 --no update until new console line + g.background.active = false + g.lines.active = false + g.vars._empty = true + g.background.sy = (cfg.minlines*g.lines.fontsize + (g.lines.px-g.background.px)*2 ) -(cfg.margin/3.5) + else + g.background.active = nil --activate + g.lines.active = nil --activate + g.vars._empty = nil + g.background.sy = (count*g.lines.fontsize + (g.lines.px-g.background.px)*2 ) -(cfg.margin/3.5) + end + + g.lines.caption = display + g.lines.sx = 100 +end + +function widget:Initialize() + regID = tostring(Spring.GetMyPlayerID()) + PassedStartupCheck = RedUIchecks() + if (not PassedStartupCheck) then return end + + console = createconsole(Config.console) + Spring.SendCommands("console 0") + Spring.SendCommands('inputtextgeo 0.26 0.73 0.02 0.028') + AutoResizeObjects() + + WG['red_chatonlyconsole'] = {} + WG['red_chatonlyconsole'].getMaxLines = function() + return Config.console.maxlines + end + WG['red_chatonlyconsole'].setMaxLines = function(value) + Config.console.maxlines = value + if console ~= nil and console.vars ~= nil then + console.vars._forceupdate = true + end + end + WG['red_chatonlyconsole'].getFontsize = function() + return fontsizeMultiplier + end + WG['red_chatonlyconsole'].setFontsize = function(value) + fontsizeMultiplier = value + Config.console.fontsize = fontsize*widgetScale*fontsizeMultiplier + if console ~= nil and console.vars ~= nil then + console.lines.fontsize = Config.console.fontsize + end + end + WG['red_chatonlyconsole'].getShowBackground = function() + return showBackground + end + WG['red_chatonlyconsole'].setShowBackground = function(value) + showBackground = value + if showBackground then + Config.console.cbackground = {0,0,0,showBackgroundOpacity} + else + Config.console.cbackground = {0,0,0,0} + end + if console ~= nil and console.background ~= nil then + console.background.color = Config.console.cbackground + end + end +end + +function widget:GameOver() + gameOver = true +end + +function widget:Shutdown() + Initialized = false + Spring.SendCommands("console 1") + WG['red_chatonlyconsole'] = nil +end + +function widget:TextCommand(command) + if (string.find(command, "chatbackground") == 1 and string.len(command) == 14) then + WG['red_chatonlyconsole'].setShowBackground(not showBackground) + end +end + +function widget:AddConsoleLine(lines,priority) + lines = lines:match('^\[f=[0-9]+\] (.*)$') or lines + local textcolor + for line in lines:gmatch("[^\n]+") do + textcolor = processLine(line, console, Config.console, textcolor)[4] + end + clipHistory(console,true) +end + +function widget:Update() + updateconsole(console,Config.console) + AutoResizeObjects() + if not Initialized == true then + if onelinedone == true then + regID = tostring(Spring.GetMyPlayerID()) + Spring.SendCommands("wByNum "..regID.." My player ID is "..regID) + Initialized = true + end + end +end + +function widget:ViewResize() + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (1 + (vsx*vsy / 4000000)) + Config.console.fontsize = fontsize*fontsizeMultiplier*widgetScale + if console ~= nil and console.vars ~= nil then + console.vars._forceupdate = true + end +end + +--save/load stuff +--currently only position +function widget:GetConfigData() --save config + if (console ~= nil) then + local vsy = Screen.vsy + Config.console.px = console.background.px + Config.console.py = console.background.py + return {Config=Config, fontsizeMultiplier=fontsizeMultiplier, showBackground=showBackground} + end +end +function widget:SetConfigData(data) --load config + if (data.Config ~= nil) then + --Config.console.px = data.Config.console.px + --Config.console.py = data.Config.console.py + if data.Config.console.maxlines ~= nil then + Config.console.maxlines = data.Config.console.maxlines + end + if data.fontsizeMultiplier ~= nil then + fontsizeMultiplier = data.fontsizeMultiplier + Config.console.fontsize = fontsize*fontsizeMultiplier*widgetScale + end + if data.showBackground ~= nil then + showBackground = data.showBackground + if showBackground then + Config.console.cbackground = {0,0,0,showBackgroundOpacity} + else + Config.console.cbackground = {0,0,0,0} + end + end + end +end diff --git a/LuaUI/Widgets_Evo/gui_red_minimap.lua b/LuaUI/Widgets_Evo/gui_red_minimap.lua new file mode 100644 index 000000000..93fe8a9e4 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_red_minimap.lua @@ -0,0 +1,408 @@ +function widget:GetInfo() + return { + version = "2", + name = "Red Minimap", + desc = "Requires Red UI Framework", + author = "Regret", + date = "December 7, 2009", --last change December 11,2009 + license = "GNU GPL, v2 or later", + layer = -11, + enabled = true, --enabled by default + handler = true, --can use widgetHandler:x() + } +end +local vsx, vsy = gl.GetViewSizes() + +local rescalevalue = 1.26 +local buttonScale = 2 +local NeededFrameworkVersion = 8 +--local CanvasX,CanvasY = 1272/rescalevalue,734/rescalevalue --resolution in which the widget was made (for 1:1 size) +local CanvasX,CanvasY = vsx,vsy --resolution in which the widget was made (for 1:1 size) +--1272,734 == 1280,768 windowed + +local widgetScale = (1 + (vsx*vsy / 7500000)) + +local maxSx = CanvasX*0.275 +local maxSy = CanvasY*0.23 + +local Config = { + minimap = { + px = 0,py = 0, --default start position + sx = math.min(maxSy*(Game.mapX/Game.mapY), maxSx), sy = maxSy, --background size + + bsx = 15,bsy = 15, --button size + + fadetime = 0.25, --fade effect time, in seconds + fadedistance = 100, --distance from cursor at which console shows up when empty + + cresizebackground = {0.9,0.9,0.9,0.5}, --color {r,g,b,alpha} + cresizecolor = {1,1,1,1}, + + cmovebackground = {0,1,0,0.5}, + cmovecolor = {0.9,0.9,0.9,0.8}, + + cborder = {0,0,0,0}, + cbackground = {0,0,0,0.55}, + cbordersize = 2.25*widgetScale, + + dragbutton = {1}, --left mouse button + tooltip = { + --todo? kinda useless + }, + }, +} + +local sformat = string.format +local sSendCommands = Spring.SendCommands +local sGetMiniMapGeometry = Spring.GetMiniMapGeometry +local sGetCameraState = Spring.GetCameraState +local sceduleMinimapGeometry = false + + +function widget:ViewResize(newX,newY) + vsx, vsy = gl.GetViewSizes() + widgetScale = (1 + (vsx*vsy / 7500000)) + Config.minimap.cbordersize = 2.25*widgetScale +end + + +local function IncludeRedUIFrameworkFunctions() + New = WG.Red.New(widget) + Copy = WG.Red.Copytable + SetTooltip = WG.Red.SetTooltip + GetSetTooltip = WG.Red.GetSetTooltip + Screen = WG.Red.Screen + GetWidgetObjects = WG.Red.GetWidgetObjects +end + +local function RedUIchecks() + local color = "\255\255\255\1" + local passed = true + if (type(WG.Red)~="table") then + Spring.Echo(color..widget:GetInfo().name.." requires Red UI Framework.") + passed = false + elseif (type(WG.Red.Screen)~="table") then + Spring.Echo(color..widget:GetInfo().name..">> strange error.") + passed = false + elseif (WG.Red.Version < NeededFrameworkVersion) then + Spring.Echo(color..widget:GetInfo().name..">> update your Red UI Framework.") + passed = false + end + if (not passed) then + widgetHandler:ToggleWidget(widget:GetInfo().name) + return false + end + IncludeRedUIFrameworkFunctions() + return true +end + +local function AutoResizeObjects() --autoresize v2 + if (LastAutoResizeX==nil) then + LastAutoResizeX = CanvasX + LastAutoResizeY = CanvasY + end + local lx,ly = LastAutoResizeX,LastAutoResizeY + local vsx,vsy = Screen.vsx,Screen.vsy + if ((lx ~= vsx) or (ly ~= vsy)) then + local objects = GetWidgetObjects(widget) + local scale = vsy/ly + local skippedobjects = {} + for i=1,#objects do + local o = objects[i] + local adjust = 0 + if ((o.movableslaves) and (#o.movableslaves > 0)) then + adjust = (o.px*scale+o.sx*scale)-vsx + if (((o.px+o.sx)-lx) == 0) then + o._moveduetoresize = true + end + end + if (o.px) then o.px = o.px * scale end + if (o.py) then o.py = o.py * scale end + if (o.sx) then o.sx = o.sx * scale end + if (o.sy) then o.sy = o.sy * scale end + if (o.fontsize) then o.fontsize = o.fontsize * scale end + if (adjust > 0) then + o._moveduetoresize = true + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + elseif ((adjust < 0) and o._moveduetoresize) then + o._moveduetoresize = nil + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + end + end + LastAutoResizeX,LastAutoResizeY = vsx,vsy + end +end + +local function createminimap(r) + local minimap = {"rectangle", + px=r.px,py=r.py, + sx=r.sx,sy=r.sy, + border=r.cborder, + obeyscreenedge = true, + } + local minimapbg = {"rectanglerounded", + px=r.px-r.cbordersize,py=r.py, + sx=r.sx,sy=r.sy, + color=r.cbackground, + obeyscreenedge = true, + bordersize=r.cbordersize + } + + local resizebutton = {"rectangle", + px=r.px+r.sx-r.bsx,py=r.py+r.sy-1, + sx=r.bsx*buttonScale,sy=r.bsy*buttonScale, + + color=r.cresizebackground, + texturecolor=r.cmovecolor, + texture="LuaUI/Images/RedMinimap/resize.png", + border=r.cborder, + movable=r.dragbutton, + overridecursor = true, + overrideclick = r.dragbutton, + roundedsize = math.floor(r.bsy*0.15), + onlyTweakUi = false, + + effects = { + fadein_at_activation = r.fadetime, + fadeout_at_deactivation = r.fadetime, + }, + } + local offsetcorrection = r.bsx - ((r.bsx * buttonScale)) + local movebutton = {"rectangle", + px=r.px+r.sx-r.bsx*2+1 + offsetcorrection,py=r.py+r.sy-1, + sx=r.bsx*buttonScale,sy=r.bsy*buttonScale, + + color=r.cmovebackground, + texturecolor=r.cmovecolor, + texture="LuaUI/Images/RedMinimap/move.png", + + border=r.cborder, + movable=r.dragbutton, + obeyscreenedge = true, + overridecursor = true, + overrideclick = r.dragbutton, + roundedsize = math.floor(r.bsy*0.15), + onlyTweakUi = false, + + effects = { + fadein_at_activation = r.fadetime, + fadeout_at_deactivation = r.fadetime, + }, + } + + New(movebutton) + New(resizebutton) + New(minimap) + New(minimapbg) + + resizebutton.mouseover = function(mx,my,self) + self.active = nil + movebutton.active = nil + + if (not self._mouseover) then + self._color4 = self.color[4] + self.color[4] = 4 + end + + self._mouseover = true + end + resizebutton.mousenotover = function(mx,my,self) + if ((not minimap._mouseover) and (not movebutton._mouseover)) then + self.active = false --deactivate + end + + if (self._mouseover) then + self.color[4] = self._color4 + end + + self._mouseover = nil + end + + movebutton.mouseover = function(mx,my,self) + self.active = nil + resizebutton.active = nil + + if (not self._mouseover) then + self._color4 = self.color[4] + self.color[4] = 1 + end + + self._mouseover = true + end + movebutton.mousenotover = function(mx,my,self) + if ((not minimap._mouseover) and (not resizebutton._mouseover)) then + self.active = false --deactivate + end + + if (self._mouseover) then + self.color[4] = self._color4 + end + + self._mouseover = nil + end + + minimap.onupdate=function(self) + self.sx = resizebutton.px-self.px+resizebutton.sx + self.sy = resizebutton.py-self.py+1 + minimapbg.px = self.px - minimapbg.bordersize + minimapbg.py = self.py - minimapbg.bordersize + minimapbg.sx = self.sx + minimapbg.bordersize + minimapbg.bordersize + minimapbg.sy = self.sy + minimapbg.bordersize + minimapbg.bordersize + end + resizebutton.onupdate=function(self) + if (self._mouseover) then + self.minpx = minimap.px+r.bsx-1 + self.minpy = minimap.py+r.bsx + else + self.minpx = 0 + self.minpy = 0 + end + self.maxpx = Screen.vsx + self.maxpy = Screen.vsy + end + + minimap.mousenotover = function(mx,my,self) + self._mouseover = nil + end + + minimap.mouseover = function(mx,my,self) + self._mouseover = true + + movebutton.active = nil + resizebutton.active = nil + end + + minimap.movableslaves = { + movebutton, + } + movebutton.movableslaves = { + minimap,resizebutton, + } + resizebutton.movableslaves = { + movebutton, + } + + return minimap +end + +function widget:Initialize() + --oldMinimapGeometry = Spring.GetConfigString("MiniMapGeometry","2 2 200 200") -- store original geometry + oldMinimapGeometry = sGetMiniMapGeometry() + + PassedStartupCheck = RedUIchecks() + if (not PassedStartupCheck) then return end + + rMinimap = createminimap(Config.minimap) + + gl.SlaveMiniMap(true) + + AutoResizeObjects() --fix for displacement on crash issue +end + +local lastPos = {} + + +function widget:ViewResize(viewSizeX, viewSizeY) + sceduleMinimapGeometry = true +end + + +function widget:Update() + local _,_,_,_,minimized,maximized = sGetMiniMapGeometry() + if (maximized) then + --hack to reset state minimap + gl.SlaveMiniMap(false) + gl.SlaveMiniMap(true) + ---- + end + + if (minimized) then + rMinimap.active = false + --hack to reset state minimap + gl.SlaveMiniMap(false) + gl.SlaveMiniMap(true) + ---- + else + rMinimap.active = nil + end + + local st = sGetCameraState() + if (st.name == "ov") then --overview camera + rMinimap.active = false + else + rMinimap.active = nil + end + + AutoResizeObjects() + if ((lastPos.px ~= rMinimap.px) or (lastPos.py ~= rMinimap.py) or (lastPos.sx ~= rMinimap.sx) or (lastPos.sy ~= rMinimap.sy) or sceduleMinimapGeometry) then + sSendCommands(sformat("minimap geometry %i %i %i %i", + rMinimap.px, + rMinimap.py, + rMinimap.sx, + rMinimap.sy)) + sceduleMinimapGeometry = false + end + lastPos.px = rMinimap.px + lastPos.py = rMinimap.py + lastPos.sx = rMinimap.sx + lastPos.sy = rMinimap.sy +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + if (rMinimap.active ~= nil) then + return + end + -- this makes jK rage + gl.ResetState() + gl.ResetMatrices() + ---- + + --gl.SlaveMiniMap(true) + gl.DrawMiniMap() + --gl.SlaveMiniMap(false) + + -- this makes jK rage + gl.ResetState() + gl.ResetMatrices() + ---- +end + +function widget:Shutdown() + gl.SlaveMiniMap(false) + Spring.SendCommands("minimap geometry "..oldMinimapGeometry) +end + + +--save/load stuff +--currently only position +function widget:GetConfigData() --save config + if (PassedStartupCheck) then + local vsy = Screen.vsy + local unscale = CanvasY/vsy --needed due to autoresize, stores unresized variables + Config.minimap.px = rMinimap.px * unscale + Config.minimap.py = rMinimap.py * unscale + return {Config=Config} + end +end +function widget:SetConfigData(data) --load config + if (data.Config ~= nil) then + Config.minimap.px = data.Config.minimap.px + Config.minimap.py = data.Config.minimap.py + end +end diff --git a/LuaUI/Widgets_Evo/gui_red_tooltip.xlua b/LuaUI/Widgets_Evo/gui_red_tooltip.xlua new file mode 100644 index 000000000..280eba96b --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_red_tooltip.xlua @@ -0,0 +1,372 @@ +function widget:GetInfo() + return { + name = "Red Tooltip", + desc = "Toggle unitcounter with /unitcounter (Requires Red UI Framework)", + author = "Regret", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = -100, + enabled = true, --enabled by default + handler = true, --can use widgetHandler:x() + } +end +local NeededFrameworkVersion = 8 +local CanvasX,CanvasY = 1280,734 --resolution in which the widget was made (for 1:1 size) +--1272,734 == 1280,768 windowed + + +--todo: sy adjustment + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (1 + (vsx*vsy / 7500000)) +local Config = { + tooltip = { + px = -0.5,py = CanvasY-82, --default start position + sx = 270,sy = 82, --background size + + fontsize = 10.5, + + padding = 3*widgetScale, + color2 = {1,1,1,0.025}, + + margin = 11, --distance from background border + + cbackground = {0,0,0,0.66}, --color {r,g,b,alpha} + cborder = {0,0,0,0.2}, + + dragbutton = {2,3}, --middle mouse button + tooltip = { + background = "In CTRL+F11 mode: Hold \255\255\255\1middle mouse button\255\255\255\255 to drag this element.", + }, + unitCounterEnabled = false, + }, +} + +local totalUnits = 0 +local totalGaiaUnits = 0 + +local spGetTeamUnitCount = Spring.GetTeamUnitCount +local sGetCurrentTooltip = Spring.GetCurrentTooltip +local sGetSelectedUnitsCount = Spring.GetSelectedUnitsCount + +local GaiaTeamID = Spring.GetGaiaTeamID() + +-- Hotkeys +VFS.Include("luaui/configs/evo_buildHotkeysConfig.lua") + +local sGetKeySymbol = Spring.GetKeySymbol +local function getKeySymbol(k) + local keySymbol = sGetKeySymbol(k) + return keySymbol:sub(1, 1):upper() .. keySymbol:sub(2) +end +local humanNameToKeySymbols = {} +for unitDefID = 1, #UnitDefs do + local ud = UnitDefs[unitDefID] + local name = ud.name + if name:find("_up", -5) then name = name:sub(1, -5) end + if nameToKeyCode[name] then + local str = "" + local leng = #nameToKeyCode[name] + for i = 1, leng do + str = str .. getKeySymbol(nameToKeyCode[name][i]) + if i < leng then str = str .. ", " end + end + humanNameToKeySymbols[ud.humanName] = str + end +end +-- + + +local function IncludeRedUIFrameworkFunctions() + New = WG.Red.New(widget) + Copy = WG.Red.Copytable + SetTooltip = WG.Red.SetTooltip + GetSetTooltip = WG.Red.GetSetTooltip + Screen = WG.Red.Screen + GetWidgetObjects = WG.Red.GetWidgetObjects +end + +local function RedUIchecks() + local color = "\255\255\255\1" + local passed = true + if (type(WG.Red)~="table") then + Spring.Echo(color..widget:GetInfo().name.." requires Red UI Framework.") + passed = false + elseif (type(WG.Red.Screen)~="table") then + Spring.Echo(color..widget:GetInfo().name..">> strange error.") + passed = false + elseif (WG.Red.Version < NeededFrameworkVersion) then + Spring.Echo(color..widget:GetInfo().name..">> update your Red UI Framework.") + passed = false + end + if (not passed) then + widgetHandler:ToggleWidget(widget:GetInfo().name) + return false + end + IncludeRedUIFrameworkFunctions() + return true +end + +local function AutoResizeObjects() --autoresize v2 + if (LastAutoResizeX==nil) then + LastAutoResizeX = CanvasX + LastAutoResizeY = CanvasY + end + local lx,ly = LastAutoResizeX,LastAutoResizeY + local vsx,vsy = Screen.vsx,Screen.vsy + if ((lx ~= vsx) or (ly ~= vsy)) then + local objects = GetWidgetObjects(widget) + local scale = vsy/ly + local skippedobjects = {} + for i=1,#objects do + local o = objects[i] + local adjust = 0 + if ((o.movableslaves) and (#o.movableslaves > 0)) then + adjust = (o.px*scale+o.sx*scale)-vsx + if (((o.px+o.sx)-lx) == 0) then + o._moveduetoresize = true + end + end + if (o.px) then o.px = o.px * scale end + if (o.py) then o.py = o.py * scale end + if (o.sx) then o.sx = o.sx * scale end + if (o.sy) then o.sy = o.sy * scale end + if (o.fontsize) then o.fontsize = o.fontsize * scale end + if (adjust > 0) then + o._moveduetoresize = true + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + elseif ((adjust < 0) and o._moveduetoresize) then + o._moveduetoresize = nil + o.px = o.px - adjust + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + s.px = s.px - adjust/scale + end + end + end + LastAutoResizeX,LastAutoResizeY = vsx,vsy + end +end +local function getEditedCurrentTooltip() + local text = sGetCurrentTooltip() + if text == "Repair: Repairs another unit" then return "Build: Builds unfinished structures" end -- hack for Evo + -- Shows build hotkey + local buildTextPosition = text:find("Build: ") + if buildTextPosition then + local nameEndPosition = text:find("- ") + local humanName = text:sub(buildTextPosition + 7, nameEndPosition - 2) + if humanNameToKeySymbols[humanName] then + text = text:gsub("- ", "(Hotkey: " .. humanNameToKeySymbols[humanName] .. ") - ", 1) + end + end + --extract the exp value with regexp + local expPattern = "Experience (%d+%.%d%d)" + local currentExp = tonumber(text:match(expPattern)) + --replace with limexp: exp/(1+exp) since all spring exp effects are linear in limexp, multiply by 10 because people like big numbers instead of [0,1] + return currentExp and text:gsub(expPattern,string.format("Experience %.2f", 10*currentExp/(1+currentExp)) ) or text +end + +local function createtooltip(r) + local text = {"text", + px=r.px+r.margin,py=r.py+(r.margin/1.5), + fontsize=r.fontsize, + color={1,1,1,0.3}, + caption="", + options="o", + + onupdate=function(self) + local unitcount = sGetSelectedUnitsCount() + if (unitcount ~= 0) then + self.caption = "Selected units: "..unitcount.."\n" + else + self.caption = "\n" + end + + if (self._mouseoverself) then + self.caption = self.caption..r.tooltip.background + else + self.caption = self.caption..(getEditedCurrentTooltip() or sGetCurrentTooltip()) + end + end + } + + local unitcounter = {"text", + px=r.sx-(r.margin/2),py=r.py+(r.margin/2), + fontsize=r.fontsize/1.3, + color={1,1,1,0.2}, + caption="", + options="r", + + onupdate=function(self) + if Config.tooltip.unitCounterEnabled then + -- get total unit count + if Spring.GetGameFrame() % 60 == 0 then + totalUnits = 0 + totalGaiaUnits = 0 + local allyTeamList = Spring.GetAllyTeamList() + local numberOfAllyTeams = #allyTeamList + for allyTeamListIndex = 1, numberOfAllyTeams do + local allyID = allyTeamList[allyTeamListIndex] + local teamList = Spring.GetTeamList(allyID) + for _,teamID in pairs(teamList) do + totalUnits = totalUnits + spGetTeamUnitCount(teamID) + if teamID == GaiaTeamID then + totalGaiaUnits = totalGaiaUnits + spGetTeamUnitCount(teamID) + end + end + end + local alpha = (totalUnits/6600) + if alpha > 0.66 then alpha = 0.66 end + if alpha < 0.2 then alpha = 0.2 end + self.color={1,1,1,alpha} + end + self.caption = totalUnits.."\n"..totalGaiaUnits + vsx,vsy = gl.GetViewSizes() + + else + self.caption = "" + end + end + } + local background2 = {"rectanglerounded", + px=r.px+r.padding,py=r.py+r.padding, + sx=r.sx-r.padding-r.padding,sy=r.sy-r.padding-r.padding, + color=r.color2, + } + local background = {"rectanglerounded", + px=r.px,py=r.py, + sx=r.sx,sy=r.sy, + color=r.cbackground, + border=r.cborder, + + padding=r.padding, + + movable=r.dragbutton, + movableslaves={text,unitcounter,background2}, + + obeyscreenedge = true, + --overridecursor = true, + --overrideclick = {2}, + + onupdate=function(self) + if (self.px < (Screen.vsx/2)) then --left side of screen + if ((self.sx-r.margin*2) <= text.getwidth()) then + self.sx = (text.getwidth()+r.margin*2) -1 + else + self.sx = r.sx * Screen.vsy/CanvasY + end + text.px = self.px + r.margin + else --right side of screen + if ((self.sx-r.margin*2 -1) <= text.getwidth()) then + self.px = self.px - ((text.getwidth() + r.margin*2) - self.sx) + self.sx = (text.getwidth() + r.margin*2) + else + self.px = self.px - ((r.sx * Screen.vsy/CanvasY) - self.sx) + self.sx = r.sx * Screen.vsy/CanvasY + end + text.px = self.px + r.margin + end + unitcounter.px = self.sx - ((r.margin/2)* Screen.vsy/CanvasY) + background2.px = self.px + self.padding + background2.py = self.py + self.padding + background2.sx = self.sx - self.padding - self.padding + background2.sy = self.sy - self.padding - self.padding + end, + + mouseover=function(mx,my,self) + text._mouseoverself = true + end, + mousenotover=function(mx,my,self) + text._mouseoverself = nil + end, + } + + + New(background) + New(background2) + New(text) + New(unitcounter) + + return { + ["background"] = background, + ["background2"] = background2, + ["text"] = text, + ["unitcounter"] = unitcounter, + + margin = r.margin, + } +end + +function widget:Initialize() + PassedStartupCheck = RedUIchecks() + if (not PassedStartupCheck) then return end + + tooltip = createtooltip(Config.tooltip) + + Spring.SetDrawSelectionInfo(false) --disables springs default display of selected units count + Spring.SendCommands("tooltip 0") + AutoResizeObjects() +end + +function widget:Shutdown() + Spring.SendCommands("tooltip 1") +end + +function widget:Update() + AutoResizeObjects() +end + +function widget:GameFrame(n) + + -- get total unit count + if n % 120 == 0 then + totalUnits = 0 + local allyTeamList = Spring.GetAllyTeamList() + local numberOfAllyTeams = #allyTeamList + for allyTeamListIndex = 1, numberOfAllyTeams do + local allyID = allyTeamList[allyTeamListIndex] + local teamList = Spring.GetTeamList(allyID) + for _,teamID in pairs(teamList) do + totalUnits = totalUnits + spGetTeamUnitCount(teamID) + if teamID == GaiaTeamID then + totalGaiaUnits = totalGaiaUnits + 1 + end + end + end + end +end + +--save/load stuff +--currently only position +function widget:GetConfigData() --save config + if (PassedStartupCheck) then + local vsy = Screen.vsy + local unscale = CanvasY/vsy --needed due to autoresize, stores unresized variables + --Config.tooltip.px = tooltip.background.px * unscale + --Config.tooltip.py = tooltip.background.py * unscale + Config.tooltip.unitCounterEnabled = Config.tooltip.unitCounterEnabled + return {Config=Config} + end +end +function widget:SetConfigData(data) --load config + if (data.Config ~= nil) then + --Config.tooltip.px = data.Config.tooltip.px + --Config.tooltip.py = data.Config.tooltip.py + Config.tooltip.unitCounterEnabled = data.Config.tooltip.unitCounterEnabled + end +end + +function widget:TextCommand(command) + if (string.find(command, "unitcount") == 1 and string.len(command) == 11) then + Config.tooltip.unitCounterEnabled = not Config.tooltip.unitCounterEnabled + if Config.tooltip.unitCounterEnabled then + Spring.Echo("Total units counter: enabled") + else + Spring.Echo("Total units counter: disabled") + end + end +end diff --git a/LuaUI/Widgets_Evo/gui_replaybuttons.lua b/LuaUI/Widgets_Evo/gui_replaybuttons.lua new file mode 100644 index 000000000..9045fc66c --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_replaybuttons.lua @@ -0,0 +1,375 @@ +--http://springrts.com/phpbb/viewtopic.php?f=23&t=30560 +function widget:GetInfo() + return { + name = "replay buttons", + desc = "click buttons to change replay speed", + author = "knorke", + version = "1", + date = "June 2013", + license = "click button magic", + layer = 10, + enabled = true, + } +end + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local speedbuttons={} --the 1x 2x 3x etc buttons +local buttons={} --other buttons (atm only pause/play) +local wantedSpeed = nil +local speeds = {0.5, 1, 2, 3, 4, 5, 10, 20} +wPos = {x=0.00, y=0.15} +local isPaused = false +local isActive = true --is the widget shown and reacts to clicks? +local sceduleUpdate = true +local vsx,vsy = Spring.GetViewGeometry() +widgetScale = (0.5 + (vsx*vsy / 5700000)) + +function widget:Initialize() + if (not Spring.IsReplay()) then + Spring.Echo ("[Replay Control] Replay not detected, Shutting Down.") + widgetHandler:RemoveWidget(self) + return + end + + local dy = 0 + local h = 0.033 + for i = 1, #speeds do + dy=dy+h + add_button (speedbuttons, wPos.x, wPos.y+dy, 0.037, 0.033, " " .. speeds[i].."x", speeds[i], speedButtonColor (i)) + end + speedbuttons[2].color = {0.75,0,0,0.66} + dy=dy+h + local text = " skip" + if Spring.GetGameFrame() > 0 then + text = " ||" + end + add_button (buttons, wPos.x, wPos.y, 0.037, 0.033, text,"playpauseskip", {0,0,0,0.6}) + +end + +function widget:Shutdown() + if WG['guishader'] then + WG['guishader'].DeleteDlist('replaybuttons') + end + gl.DeleteList(speedButtonsList) + gl.DeleteList(buttonsList) + gl.DeleteFont(font) +end + +function speedButtonColor (i) + return{0,0,0,0.6} +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if WG['guishader'] then + if isActive then + local h = 0.033 + local dy = (#speeds +1) * h + + if backgroundGuishader then + gl.DeleteList(backgroundGuishader) + end + backgroundGuishader = gl.CreateList( function() + RectRound(sX(wPos.x), sY(wPos.y), sX(wPos.x+0.037), sY(wPos.y+dy), 6*widgetScale) + end) + WG['guishader'].InsertDlist(backgroundGuishader, 'replaybuttons') + else + WG['guishader'].DeleteDlist('replaybuttons') + end + end + + if not isActive then return end + if sceduleUpdate then + if speedButtonsList then + gl.DeleteList(speedButtonsList) + gl.DeleteList(buttonsList) + end + speedButtonsList = gl.CreateList(draw_buttons, speedbuttons) + buttonsList = gl.CreateList(draw_buttons, buttons) + sceduleUpdate = false + end + if speedButtonsList then + gl.CallList(speedButtonsList) + gl.CallList(buttonsList) + end + local mousex, mousey = Spring.GetMouseState() + local b = speedbuttons + local topbutton = #speedbuttons + if point_in_rect (buttons[1].x, buttons[1].y, b[topbutton].x+b[topbutton].w, b[topbutton].y+b[topbutton].h, uiX(mousex), uiY(mousey)) then + for i = 1, #b, 1 do + if (point_in_rect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h, uiX(mousex), uiY(mousey)) or i == active_button) then + gl.Color (0.4,0.4,0.4,0.6) + uiRect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h) + uiText (b[i].text, b[i].x, b[i].y+b[i].h/2, (0.0115), 'vo') + end + end + b = buttons + for i = 1, #b, 1 do + if (point_in_rect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h, uiX(mousex), uiY(mousey)) or i == active_button) then + gl.Color (0.4,0.4,0.4,0.6) + uiRect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h) + uiText (b[i].text, b[i].x, b[i].y+b[i].h/2, (0.0115), 'vo') + end + end + end +end + +function widget:MousePress(x,y,button) + if not isActive then return end + local cb,i = clicked_button (speedbuttons) + if cb ~= "NOBUTTONCLICKED" then + setReplaySpeed (speeds[i], i) + for i = 1, #speeds do --reset all buttons colors + speedbuttons[i].color = speedButtonColor (i) + end + speedbuttons[i].color = {0.75,0,0,0.66 } + sceduleUpdate = true + end + + local cb,i = clicked_button (buttons) + if cb == "playpauseskip" then + if Spring.GetGameFrame () > 1 then + if (isPaused) then + Spring.SendCommands ("pause 0") + buttons[i].text = " ||" + isPaused = false + else + Spring.SendCommands ("pause 1") + buttons[i].text = " >>" + isPaused = true + end + else + Spring.SendCommands ("skip 1") + buttons[i].text = " ||" + end + sceduleUpdate = true + end +end + +function setReplaySpeed (speed, i) + local s = Spring.GetGameSpeed() + --Spring.Echo ("setting speed to: " , speed , " current is " , s) + if (speed > s) then --speedup + Spring.SendCommands ("setminspeed " .. speed) + Spring.SendCommands ("setminspeed " ..0.1) + else --slowdown + wantedSpeed = speed + end +end + + +function widget:Update() + if (wantedSpeed) then + if (Spring.GetGameSpeed() > wantedSpeed) then + Spring.SendCommands ("slowdown") + else + wantedSpeed = nil + end + end + if #Spring.GetSelectedUnits () ~=0 then isActive = false else isActive = true end +end + +function widget:GameFrame (f) + if (f==1) then + buttons[1].text= " ||" + end +end + +------------------------------------------------------------------------------------------ +--a simple UI framework with buttons +--Feb 2011 by knorke +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix + +--UI coordinaten zu scalierten screen koordinaten +function sX (uix) + return uix*vsx +end +function sY (uiy) + return uiy*vsy +end +---...und andersrum! +function uiX (sX) + return sX/vsx +end +function uiY (sY) + return sY/vsy +end + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + sceduleUpdate = true + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +----zeichen funktionen--------- +function uiRect (x,y,x2,y2) + RectRound(sX(x), sY(y), sX(x2), sY(y2), 6) + --gl.Rect (sX(x), sY(y), sX(x2), sY(y2)) +end + +function uiText (text, x,y,s,options) + if (text==" " or text==" ") then return end --archivement: unlock +20 fps + font:Begin() + font:Print(text, sX(x), sY(y), sX(s), options) + font:End() +end +-------------------------------- +-----message boxxy----- +function drawmessagebox (msgbox, msg_n) + if (msgbox.messages==nil) then return end + local yoff = msgbox.textsize + if (msg_n==nil) then msg_n=100 end --*** + local start = #msgbox.messages-msg_n+1 + if (start < 1) then start = 1 end + local fade = 1 + for i = start, #msgbox.messages , 1 do + drawmessage (msgbox.messages[i], msgbox.x, msgbox.y-yoff, msgbox.textsize) + yoff=yoff+msgbox.textsize*1.2 + end +end + + +function drawmessage_simple (message, x, y, s) + offx=0 + font:Begin() + if (message.frame) then + font:Print(frame2time (message.frame), sX(x+offx), sY(y), sX(s/2), 'vo') + offx=offx+(2*s) + end + font:Print(message.text, sX(x+offx), sY(y), sX(s), 'vo') + font:End() +end + +--X, Y and size in UI scale +function drawmessage (message, x, y, s) + if (message.bgcolor) then + gl.Color (unpack(message.bgcolor)) + uiRect (x,y+s/2, x+1, y-s/2) + end + offx=0 + font:Begin() + if (message.frame) then + font:Print(frame2time (message.frame), sX(x+offx), sY(y), sX(s/2), 'vo') + offx=offx+(2*s) + end + if (message.icon) then + --****!!! irgendwie malt er danach keine Rechtecke mehr + --gl.PushMatrix() + gl.Color (1,1,1,1) + gl.Texture(message.icon) + gl.TexRect(sX(x+s*1.9),sY(y-s*0.8), sX(x+s*2.9),sY(y+s*0.8) ) + gl.Texture(false) + --gl.PopMatrix() + offx=offx+(s) + end + font:Print(message.text, sX(x+offx), sY(y), sX(s), 'vo') + font:End() +end + + +function addmessage (msgbox, text, bgcolor) + local newmessage = {} + --newmessage.frame = gameframe + if (bgcolor) then newmessage.bgcolor = bgcolor end---{0,0,0.8,0.5} + newmessage.text = text + table.insert (msgbox.messages, newmessage) +end +-------message boxxy end------ +------BUTTONS------ + +function RectRound(px,py,sx,sy,cs) + + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.floor(sx),math.floor(sy),math.floor(cs) + + gl.Rect(px+cs, py, sx-cs, sy) + gl.Rect(sx-cs, py+cs, sx, sy-cs) + gl.Rect(px+cs, py+cs, px, sy-cs) + + if py <= 0 or px <= 0 then gl.Texture(false) else gl.Texture(bgcorner) end + gl.TexRect(px, py+cs, px+cs, py) -- top left + + if py <= 0 or sx >= vsx then gl.Texture(false) else gl.Texture(bgcorner) end + gl.TexRect(sx, py+cs, sx-cs, py) -- top right + + if sy >= vsy or px <= 0 then gl.Texture(false) else gl.Texture(bgcorner) end + gl.TexRect(px, sy-cs, px+cs, sy) -- bottom left + + if sy >= vsy or sx >= vsx then gl.Texture(false) else gl.Texture(bgcorner) end + gl.TexRect(sx, sy-cs, sx-cs, sy) -- bottom right + + gl.Texture(false) +end + +function draw_buttons (b) + local mousex, mousey = Spring.GetMouseState() + for i = 1, #b, 1 do + if (b[i].color) then gl.Color (unpack(b[i].color)) else gl.Color (1 ,0,0,0.66) end + --if (point_in_rect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h, uiX(mousex), uiY(mousey)) or i == active_button) then + -- gl.Color (0.4,0.4,0.4,0.6) + --end + if (b[i].name == selected_missionid) then gl.Color (0,1,1,0.66) end --highlight selected mission, bit unnice this way w/e + + uiRect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h) + uiText (b[i].text, b[i].x, b[i].y+b[i].h/2, (0.0115), 'vo') + end +end + + + +function add_button (buttonlist, x,y, w, h, text, name, color) + local new_button = {} + new_button.x=x new_button.y=y new_button.w=w new_button.h=h new_button.text=text new_button.name=name + if(color) then new_button.color=color end + table.insert (buttonlist, new_button) +end + +function previous_button () + active_button = active_button -1 + if (active_button < 1) then active_button = #buttons end +end + +function next_button () + active_button = active_button +1 + if (active_button > #buttons) then active_button = 1 end +end + +function point_in_rect (x1, y1, x2, y2, px, py) + if (px > x1 and px < x2 and py > y1 and py < y2) then return true end + return false +end + +function clicked_button (b) + local mx, my,click = Spring.GetMouseState() + local mousex=uiX(mx) + local mousey=uiY(my) + for i = 1, #b, 1 do + if (click == true and point_in_rect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h, mousex, mousey)) then return b[i].name, i end + --if (mouse_was_down == false and click == true and point_in_rect (b[i].x, b[i].y, b[i].x+b[i].w, b[i].y+b[i].h, mousex, mousey)) then mouse_was_down = true end + end + --keyboard: + --if (enter_was_down and active_button > 0 and active_button < #buttons+1) then enter_was_down = false return b[active_button].name, active_button end + return "NOBUTTONCLICKED" +end diff --git a/LuaUI/Widgets_Evo/gui_resourceBar.lua b/LuaUI/Widgets_Evo/gui_resourceBar.lua new file mode 100644 index 000000000..a1eef5f0a --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_resourceBar.lua @@ -0,0 +1,702 @@ +function widget:GetInfo() + return { + name = "Resource Bar Display", + desc = "Displays economy parameters", + author = "Code_Man, CommonPlayer, Floris", + date = "11/4/2016", -- modified by CommonPlayer on Oct 2016 + license = "MIT X11", + layer = 1, + enabled = true + } +end + +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.33 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + + +--Disable Default Resources Bar +Spring.SendCommands({"resbar 0"}) + +-- configurable settings +local FontSize = 22 +local supplyOffset = 0 +local supplyBarWidth = 340 +local energyOffset = 350 +local energyBarWidth = 340 +local metalOffset = 700 +local metalBarWidth = 340 +local width, height = metalOffset+metalBarWidth+supplyBarWidth, 40 +local textOffsetX, textOffsetY = 5, 17 +local bgFlashPeriod = 45 +local maxBasicIncome = Spring.GetModOptions().maxbasicincome or 15 +-- resource bars: ON means the bars show percentage, OFF means they simply change color depending on state +local progressBars = true + +local maxSupply = tonumber(Spring.GetModOptions().supplycap) or 1000000 + +-- internal settings, do not touch +local white = "\255\255\255\255" +local yellow = "\255\255\255\1" +local orange = "\255\255\135\1" +local green = "\255\0\255\1" +local red = "\255\255\0\1" +local skyblue = "\255\136\197\226" + +local barTexture = LUAUI_DIRNAME.."Images/resbar.dds" +local barGlowCenterTexture = LUAUI_DIRNAME.."Images/barglow-center.dds" +local barGlowEdgeTexture = LUAUI_DIRNAME.."Images/barglow-edge.dds" +local energyTexture = LUAUI_DIRNAME.."Images/energy2.png" +local metalTexture = LUAUI_DIRNAME.."Images/metal.png" +local supplyTexture = LUAUI_DIRNAME.."Images/supply.png" + +local supplyWarning = false +local energyWarning = false +local metalWarning = false + +simplifiedResourceBar = Spring.GetConfigInt("evo_simplifiedresourcebar", 1) + +local energyNotificationTimeout = 60 +local metalNotificationTimeout = 60 +local supplyNotificationTimeout = 60 + +-- Avoids spamming of income increased notification +local incomeIncreased = false + +local increment = 0 +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (0.66 + (vsx*vsy / 9500000)) -- gets auto changed anyway +local bgmargin = 12 +local bgmargin2 = 6 +--local posx, posy = vsx - width * 1.59, vsy - height +local posx, posy = vsx - width * 1.59, vsy - height +local tweakStartX, tweakStartY = vsx - width * 1.59, vsy - height + +local modoptMincome = Spring.GetModOptions().mincome + +-- how long before metal income changes, in seconds (default 150s, or 2.5min) +local metalIncomeTimer = 150 + +-- how long before metal income stops increasing, in seconds (default 60s, or 10min, 4 times the metalIncomeTimer) +local incomeProgressionEndTimer = metalIncomeTimer * 4 + 5 + +local myPlayerID = Spring.GetMyPlayerID() + +--Spring.GetTeamResources +-- ( number teamID, string "metal" | "energy" ) -> +-- nil | number currentLevel, (mc) +-- number storage, (ms) +-- number pull, (mp) +-- number income, (mi) +-- number expense, (me) +-- number share, +-- number sent, +-- number received + + +local bgcorner = ":n:"..LUAUI_DIRNAME.."Images/bgcorner.png" +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + local o = offset + + -- bottom left + --if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + --if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, py+cs, 0) + -- top left + --if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(px, sy-cs, 0) + -- top right + --if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-o) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + +function widget:GameFrame(n) + if n%30 == 1 then + energyNotificationTimeout = energyNotificationTimeout - 1 + metalNotificationTimeout = metalNotificationTimeout - 1 + supplyNotificationTimeout = supplyNotificationTimeout - 1 + + --Spring.Echo("E " .. energyNotificationTimeout) + --Spring.Echo("M " .. metalNotificationTimeout) + --Spring.Echo("S " .. supplyNotificationTimeout) + end + + if n%30 == 1 then + local spectator = Spring.GetSpectatingState() + --Spring.Echo(spectator) + resourcePrompts = Spring.GetConfigInt("evo_resourceprompts", 1) + simplifiedResourceBar = Spring.GetConfigInt("evo_simplifiedresourcebar", 1) + + --Assume that if it isn't set, resourcePrompts is true + if resourcePrompts == nil then + resourcePrompts = 1 + end + + if spectator then + resourcePrompts = 0 + end + --Spring.Echo(resourcePrompts) + end + + -- background flashes when the player messed up their eco + if supplyWarning == true or energyWarning == true or metalWarning == true then + if increment == 0 then + countUp = true + end + + if increment < bgFlashPeriod and countUp == true then + increment = increment + 1 + if energyWarning == true then + + end + elseif increment > 0 then + if n%30 == 1 then + if energyWarning == true then + --Spring.Echo("EnergyWarning") + if resourcePrompts == 1 then + if energyNotificationTimeout <= 0 then + if metalNotificationTimeout <= 20 and supplyNotificationTimeout <= 20 then + energyNotificationTimeout = 30 + Spring.PlaySoundFile("sounds/ui/additionalgenerators.wav", 1) + Spring.Echo([[You must construct additional generators so you can build and evolve at full speed!]]) + end + end + end + end + if metalWarning == true then + --Spring.Echo("MetalWarning") + if resourcePrompts == 1 then + if metalNotificationTimeout <= 0 then + if energyNotificationTimeout <= 20 and supplyNotificationTimeout <= 20 then + metalNotificationTimeout = 30 + Spring.PlaySoundFile("sounds/ui/useyourmetal.wav", 1) + Spring.Echo([[You are excessing metal! Consider using O.R.B.s to build units faster and spend metal more effectively!]]) + end + end + end + end + if supplyWarning == true then + --Spring.Echo("SupplyWarning") + if resourcePrompts == 1 then + if supplyNotificationTimeout <= 0 then + if energyNotificationTimeout <= 20 and metalNotificationTimeout <= 20 then + supplyNotificationTimeout = 30 + Spring.PlaySoundFile("sounds/ui/constructadditionalpylons.wav", 1) + Spring.Echo([[You have no more available supply, build supply depots in order to increase the size of your army!]]) + end + end + end + end + end + countUp = false + increment = increment - 1 + end + end +end + +-- tweaking UI position with ctrl+f11 +function widget:TweakMousePress(x, y, button) + local posxScaled = posx - (bgmargin*widgetScale) - ((vsx - posx) * (widgetScale-1)) + local posyScaled = posy - (bgmargin*widgetScale) - ((vsy - posy) * (widgetScale-1)) + if x >= posxScaled and x < posxScaled + ((width+bgmargin+bgmargin)*widgetScale) and y >= posyScaled and y < posyScaled + ((height+bgmargin+bgmargin)*widgetScale) then + tweakStartX = x - posx + tweakStartY = y - posy + return true + end +end + +function widget:TweakMouseMove(x, y, dx, dy, button) + posx = x - tweakStartX + posy = y - tweakStartY + if posx < 0 then + posx = 0 + end + if posx > vsx - width then + posx = vsx - width + end + if posy < 0 then + posy = 0 + end + if posy > vsy - height then + posy = vsy - height + end + generateDisplayList() + generateDisplayList3() +end + +-- save and load +function widget:GetConfigData(data) + return { + posx = posx, + posy = posy, + } +end + +function widget:SetConfigData(data) + posx = data.posx or posx + posy = data.posy or posy + generateDisplayList() + generateDisplayList3() +end + + +local prevGameframe = 0 +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if Spring.GetGameFrame() ~= prevGameframe then + -- check resource status first + myTeamID = Spring.GetMyTeamID() + + su, sm = math.round(Spring.GetTeamRulesParam(myTeamID, "supplyUsed") or 0), math.round(Spring.GetTeamRulesParam(myTeamID, "supplyMax") or 0) + ec, es, ep, ei, ee = Spring.GetTeamResources(myTeamID, "energy") + mc, ms, mp, mi, me = Spring.GetTeamResources(myTeamID, "metal") + + local cockblocked = (Spring.GetTeamRulesParam(myTeamID, "supply_blocked") == 1) + + if sm < maxSupply and (cockblocked or su > sm) then + supplyWarning = true + bgSupplyR = 1 + bgSupplyG = increment/bgFlashPeriod + else + supplyWarning = false + bgSupplyR = 0 + bgSupplyG = 0 + end + + percentage = su / maxSupply + if percentage > 1 then percentage = 1 end + + energyPercentage = ec / es + if energyPercentage > 1 then energyPercentage = 1 end + if energyPercentage < 0.2 then + energyWarning = true + bgEnergyR = 1 + bgEnergyG = increment/bgFlashPeriod + else + energyWarning = false + bgEnergyR = 0 + bgEnergyG = 0 + end + + metalPercentage = mc / ms + if metalPercentage > 1 then metalPercentage = 1 end + if metalPercentage > 0.8 then + metalWarning = true + bgMetalR = 1 + bgMetalG = increment/bgFlashPeriod + else + metalWarning = false + bgMetalR = 0 + bgMetalG = 0 + end + + generateDisplayList2() + end + if displayList2 ~= nil then + gl.CallList(displayList) + gl.CallList(displayList2) + gl.CallList(displayList3) + end +end + +function widget:Initialize() + + if Spring.GetModOptions().basicincomeinterval ~= nil then + metalIncomeTimer = tonumber(Spring.GetModOptions().basicincomeinterval) * 60 + end + + local incomePerInterval = 3 + if Spring.GetModOptions().basicincome ~= nil then + incomePerInterval = Spring.GetModOptions().basicincome + end + local totalSteps = math.ceil(maxBasicIncome / incomePerInterval) - 1 + local incomeProgressionEndTimer = totalSteps * metalIncomeTimer + incomeProgressionEndTimer = incomeProgressionEndTimer + 5 -- five extra seconds to ensure it ends properly + + self:ViewResize(gl.GetViewSizes()) +end + + +function widget:Shutdown() + if (WG['guishader'] ~= nil) then + WG['guishader'].RemoveRect('resources') + end + + if displayList ~= nil then + gl.DeleteList(displayList) + gl.DeleteList(displayList2) + gl.DeleteList(displayList3) + end + gl.DeleteFont(font) + gl.DeleteFont(font2) +end +--------------------------------------------------------------------------------------------------------- + +function generateDisplayList() + if displayList ~= nil then + gl.DeleteList(displayList) + end + displayList = gl.CreateList( function() + + -- start drawing + gl.PushMatrix() + + -- set position + gl.Translate(posx, posy, 0) + + -- apply scaling + gl.Translate(-(width*widgetScale)/3, -((height+bgmargin-2) * (widgetScale-1)), 0) + gl.Scale(widgetScale, widgetScale, 1) + + -- background + gl.Color(0,0,0,ui_opacity) + RectRound(supplyOffset-bgmargin, -bgmargin, metalOffset+metalBarWidth+bgmargin, height+bgmargin, 10) + + if (WG['guishader'] ~= nil) then + local scaleDiffX = -((posx*widgetScale)-posx)/widgetScale + local scaleDiffY = -((posy*widgetScale)-posy)/widgetScale + WG['guishader'].InsertRect( + posx+(-(width*widgetScale)/3) + supplyOffset-bgmargin, + posy+(-((height+bgmargin-2) * (widgetScale-1))) - ((bgmargin)*widgetScale), + posx+(-(width*widgetScale)/3) + ((metalOffset+metalBarWidth+bgmargin)*widgetScale), + posy+(-((height+bgmargin-2) * (widgetScale-1))) + ((height+bgmargin)*widgetScale), + 'resources' + ) + end + + -- content area + gl.Color(0.33,0.33,0.33,0.15) + RectRound(supplyOffset-bgmargin2, -bgmargin2, metalOffset+metalBarWidth+bgmargin2, height+bgmargin2,9) + + font2:Begin() + font2:Print(yellow .. "Energy", energyOffset+textOffsetX+29, textOffsetY, FontSize, "on") + font2:Print(green .. "Supply", supplyOffset+textOffsetX+29, textOffsetY, FontSize, "on") + font2:Print(skyblue .. "Metal", metalOffset+textOffsetX+29, textOffsetY, FontSize, "on") + font2:End() + gl.Texture(false) + + end) +end + +function generateDisplayList2() + local energyIncomeColor = green + local metalIncomeColor = green + local energyPosNeg = "+" + local metalPosNeg = "+" + local supplyAvailableColor = white + if displayList2 ~= nil then + gl.DeleteList(displayList2) + end + displayList2 = gl.CreateList(function () + -- draw background (black / gray / black / ...) + -- background flashes when the player messed up their eco + local glowSize = (height/6) * 5 + local glowAlpha = 0.15 + + gl.Color(bgSupplyR,bgSupplyG,0,0.33) + gl.Texture(barTexture) + RectRound(supplyOffset,0,supplyOffset+supplyBarWidth,height, 5) + + gl.Color(bgEnergyR,bgEnergyG,0,0.33) + RectRound(energyOffset,0,energyOffset+energyBarWidth,height, 5) + + gl.Color(bgMetalR,bgMetalG,0,0.33) + RectRound(metalOffset,0,metalOffset+metalBarWidth,height, 5) + + -- supply bar + r, g, b = 0, 0, 0 + + if supplyWarning then + r = 1 + else + r, g, b = 1, 0.5, 0 + end + + gl.Texture(barTexture) + -- gray bar for locked supply, black bar for unlocked supply, last bar for used supply + gl.Color(0.5,0.5,0.5,1) + gl.TexRect(supplyOffset,0,supplyOffset+supplyBarWidth,height/6) + maxPercentage = sm / maxSupply + + gl.Color(0,1,0,1) + gl.TexRect(supplyOffset,0,supplyOffset+(supplyBarWidth*maxPercentage),height/6) + + gl.Color(r,g,b,glowAlpha) + gl.Texture(barGlowCenterTexture) + gl.TexRect(supplyOffset,-glowSize,supplyOffset+(supplyBarWidth*maxPercentage),(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(supplyOffset-glowSize-glowSize,-glowSize,supplyOffset,(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(supplyOffset+(supplyBarWidth*maxPercentage)+glowSize+glowSize,-glowSize,supplyOffset+(supplyBarWidth*maxPercentage),(height/6)+glowSize) + + gl.Texture(barTexture) + gl.Color(r,g,b,1) + + if not progressBars then + percentage = 1 + end + gl.TexRect(supplyOffset,0,supplyOffset+(supplyBarWidth*percentage),height/6) + + if simplifiedResourceBar == 1 then + supplyUsedColor = green + if su < (sm * 0.50) then + supplyUsedColor = green + elseif su > (sm * 0.50) then + supplyUsedColor = orange + if su >= (sm * 0.75) then + supplyUsedColor = red + end + end + if sm < maxSupply * 0.50 then + supplyAvailableColor = orange + elseif sm < maxSupply then + supplyAvailableColor = yellow + elseif sm == maxSupply then + supplyAvailableColor = green + end + + supplyStr = supplyUsedColor .. su .. white .. "/" .. supplyAvailableColor .. "∞" .. " " + --supplyStr = supplyUsedColor .. su .. white .. "/" .. supplyAvailableColor .. sm .. " " + + else + supplyStr = white .. su .. "/" .. "∞" .. " (" .. orange .. "±" .. tostring(sm - su) .. white .. "/" .. green .. "∞" .. white .. ") " + --supplyStr = white .. su .. "/" .. sm .. " (" .. orange .. "±" .. tostring(sm - su) .. white .. "/" .. green .. maxSupply .. white .. ") " + end + font2:Begin() + font2:Print(supplyStr, supplyOffset+supplyBarWidth, textOffsetY, FontSize, "onr") + + + -- energy bar + r, g, b = 0, 0, 0 + + if energyPercentage > 0.8 then + g = 0.9 + elseif energyPercentage < 0.2 then + r = 1 + else + r, g, b = 1, 0.9, 0 + end + + gl.Color(r,g,b,1) + if not progressBars then + energyPercentage = 1 + end + + gl.Texture(barTexture) + gl.TexRect(energyOffset,0,energyOffset+(energyBarWidth*energyPercentage),height/6) + + gl.Color(r,g,b,glowAlpha) + gl.Texture(barGlowCenterTexture) + gl.TexRect(energyOffset,-glowSize,energyOffset+(energyBarWidth*energyPercentage),(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(energyOffset-glowSize-glowSize,-glowSize,energyOffset,(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(energyOffset+(energyBarWidth*energyPercentage)+glowSize+glowSize,-glowSize,energyOffset+(energyBarWidth*energyPercentage),(height/6)+glowSize) + + gl.Texture(barTexture) + + if simplifiedResourceBar == 1 then + if ei > ep then + energyIncomeColor = green + energyPosNeg = "+" + else + energyIncomeColor = red + energyPosNeg = "" + end + energyStr = energyIncomeColor .. energyPosNeg .. tostring(math.round(ei - ep,1)) .. white .. " (" .. yellow .. tostring(math.round(ec)).. white .. "/" .. tostring(math.round(es)) .. ") " + else + energyStr = green .. "+" .. tostring(math.round(ei,1)) .. white .. "/" .. red .. "-" .. tostring(math.round(ep,1)) .. white .. " (" .. yellow .. tostring(math.round(ec)).. white .. "/" .. tostring(math.round(es)) .. ") " + end + font2:Print(energyStr, energyOffset+energyBarWidth, textOffsetY, FontSize, "onr") + + -- metal bar + r, g, b = 0, 0, 0 + + if metalPercentage > 0.8 then + g = 0.9 + elseif metalPercentage < 0.2 then + r = 1 + else + r, g, b = .53, .77, .89 + end + + gl.Color(r,g,b,1) + if not progressBars then + metalPercentage = 1 + end + gl.Texture(barTexture) + gl.TexRect(metalOffset,0,metalOffset+(metalBarWidth*metalPercentage),height/6) + + gl.Color(r,g,b,glowAlpha) + gl.Texture(barGlowCenterTexture) + gl.TexRect(metalOffset,-glowSize,metalOffset+(metalBarWidth*metalPercentage),(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(metalOffset-glowSize-glowSize,-glowSize,metalOffset,(height/6)+glowSize) + gl.Texture(barGlowEdgeTexture) + gl.TexRect(metalOffset+(metalBarWidth*metalPercentage)+glowSize+glowSize,-glowSize,metalOffset+(metalBarWidth*metalPercentage),(height/6)+glowSize) + + gl.Texture(barTexture) + + -- draw metal income timer + if modoptMincome ~= "disabled" then + timeElapsed = Spring.GetGameSeconds() + if timeElapsed < incomeProgressionEndTimer then + percentage = timeElapsed%metalIncomeTimer/metalIncomeTimer + gl.Color(1,0.5,0,1) + gl.Texture(barTexture) + gl.TexRect(metalOffset,0,metalOffset+(metalBarWidth*percentage),height/12) + if percentage == 0 and timeElapsed > 0 and (not incomeIncreased) then + if resourcePrompts ~= 0 then + Spring.PlaySoundFile("sounds/ui/metalincomeincrease.wav", 1) + Spring.Echo("Metal income has increased!") + end + incomeIncreased = true + end + if percentage > 0.5 and incomeIncreased then + incomeIncreased = false + end + end + end + + if simplifiedResourceBar == 1 then + if mi > mp then + metalIncomeColor = green + metalPosNeg = "+" + else + metalIncomeColor = red + metalPosNeg = "" + end + metalStr = metalIncomeColor .. metalPosNeg .. tostring(math.round(mi - mp,1)) .. white .. " (" .. skyblue .. tostring(math.round(mc)) .. white .. "/" .. tostring(math.round(ms)) .. ") " + else + metalStr = orange .. "±" .. tostring(math.round(mi - me)) .. green .. " +" .. tostring(math.round(mi,1)) .. white .. "/" .. red .. "-" .. tostring(math.round(mp)) .. white .. " (" .. skyblue .. tostring(math.round(mc)) .. white .. "/" .. tostring(math.round(ms)) .. ") " + end + font2:Print(metalStr, metalOffset+metalBarWidth, textOffsetY, FontSize, "onr") + font2:End() + gl.Texture(false) + + end) +end + +function generateDisplayList3() + if displayList3 ~= nil then + gl.DeleteList(displayList3) + end + displayList3 = gl.CreateList(function () + + -- draw icons + local iconSize = 32 + gl.Color(1,1,1,1) + gl.Texture(supplyTexture) + gl.TexRect(supplyOffset+1, height-iconSize, supplyOffset+iconSize+1, height) + + gl.Texture(energyTexture) + gl.TexRect(energyOffset+1, height-iconSize, energyOffset+iconSize+1, height) + + gl.Texture(metalTexture) + gl.TexRect(metalOffset+1, height-iconSize, metalOffset+iconSize+1, height) + + + gl.PopMatrix() + end) +end + +function widget:ViewResize(newX,newY) + vsx, vsy = newX, newY + widgetScale = (0.66 + (vsx*vsy / 9500000)) + --posx, posy = (vsx - width)/2, vsy - height - 10 + posx, posy = (vsx/2), vsy - (height+bgmargin-2) + tweakStartX, tweakStartY = vsx - width * 1.59, vsy - height + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + --tweakStartX, tweakStartY = vsx - ((width * 1.59)*widgetScale), vsy - (height*widgetScale) + generateDisplayList() + generateDisplayList3() +end + + +local uiOpacitySec = 0 +function widget:Update(dt) + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + generateDisplayList() + generateDisplayList3() + end + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_resource_energy_display.lua b/LuaUI/Widgets_Evo/gui_resource_energy_display.lua new file mode 100644 index 000000000..f511a29de --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_resource_energy_display.lua @@ -0,0 +1,94 @@ +function widget:GetInfo() + return { + name = "Resource: Energy Text Display", + desc = "Displays energy economy parameters as text", + author = "Code_Man", + date = "11/4/2016", + license = "MIT X11", + layer = 1, + enabled = false + } +end + +--Disable Default Resources Bar +Spring.SendCommands({"resbar 0"}) + +local white = "\255\255\255\255" +local yellow = "\255\255\255\0" +local orange = "\255\255\135\0" +local green = "\255\0\255\0" +local red = "\255\255\0\0" +local skyblue = "\255\136\197\226" + +local str = "" +local FontSize = 15 +local vsx, vsy = gl.GetViewSizes() +local posx, posy = vsx - 245, vsy -40 + +local increment = 0 + +--Spring.GetTeamResources +-- ( number teamID, string "metal" | "energy" ) -> +-- nil | number currentLevel, (ec) +-- number storage, (es) +-- number pull, (ep) +-- number income, (ei) +-- number expense, (ee) +-- number share, +-- number sent, +-- number received + +function widget:GameFrame(n) + local myTeamID = Spring.GetMyTeamID() + local ec, es, ep, ei, ee = Spring.GetTeamResources(myTeamID, "energy") + +--Normal Energy Display +-- str = yellow .. "Energy:" .. orange .. " ± " .. tostring(math.round(ei - ee)) .. green .. " +" .. tostring(math.round(ei)) .. white .. "/" .. red .. "-" .. tostring(math.round(ep)) .. white .. " (" .. tostring(math.round(ec)) .. "/" .. tostring(math.round(es)) .. ")" + +--Custom Evo Energy display + local warningColor = white -- If the word "energy" displays as white, something below isn't working correctly + if ec <= es * 0.2 then + warning = true + else + warning = false + end + + if warning == true then + if increment == 0 then + countUp = true + end + + if increment < 255 and countUp == true then + increment = increment + 15 + elseif increment > 0 then + countUp = false + increment = increment - 15 + end + + warningColor = "\255\255" .. string.char (increment) .. "\0" + + else + warningColor = yellow + end + + str = warningColor .. "Energy:" .. orange .. " ± " .. tostring(math.round(ei - ee)) .. green .. " +" .. tostring(math.round(ei)) .. white .. "/" .. red .. "-" .. tostring(math.round(ep)) .. white .. " (" .. yellow .. tostring(math.round(ec)).. white .. "/" .. tostring(math.round(es)) .. ")" +end + +function widget:TweakMousePress(x, y, button) + if x >= posx and x < posx + 100 and y >= posy and y < posy + FontSize * 2 then + return true + end +end + +function widget:TweakMouseMove(x, y, dx, dy, button) + if x >= 0 and x < vsx - 100 and y >= 0 and y < vsy then + posx = x + posy = y + end +end + +function DrawScreen() + local vsx, vsy = gl.GetViewSizes() + gl.Text(str, posx, posy, FontSize, "on") +end +--------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_resource_metal_display.lua b/LuaUI/Widgets_Evo/gui_resource_metal_display.lua new file mode 100644 index 000000000..53aabbed6 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_resource_metal_display.lua @@ -0,0 +1,93 @@ +function widget:GetInfo() + return { + name = "Resource: Metal Text Display", + desc = "Displays metal economy parameters as text", + author = "Code_Man", + date = "11/4/2016", + license = "MIT X11", + layer = 1, + enabled = false + } +end + +--Disable Default Resources Bar +Spring.SendCommands({"resbar 0"}) + +local white = "\255\255\255\255" +local yellow = "\255\255\255\0" +local orange = "\255\255\135\0" +local green = "\255\0\255\0" +local red = "\255\255\0\0" +local skyblue = "\255\136\197\226" + +local str = "" +local FontSize = 15 +local vsx, vsy = gl.GetViewSizes() +local posx, posy = vsx - 245, vsy - 20 + +local increment = 0 + +--Spring.GetTeamResources +-- ( number teamID, string "metal" | "energy" ) -> +-- nil | number currentLevel, (mc) +-- number storage, (ms) +-- number pull, (mp) +-- number income, (mi) +-- number expense, (me) +-- number share, +-- number sent, +-- number received + +function widget:GameFrame(n) + local myTeamID = Spring.GetMyTeamID() + local mc, ms, mp, mi, me = Spring.GetTeamResources(myTeamID, "metal") +--Normal metal display +-- str = "\255\136\197\226Metal: \255\255\135\0± " .. tostring(math.round(mi - me)) .. "\255\0\255\0 +" .. tostring(math.round(mi)) .. "\255\255\255\255/\255\255\0\0-" .. tostring(math.round(mp)) .. "\255\255\255\255 (" .. tostring(math.round(mc)) .. "/" .. tostring(math.round(ms)) .. "\255\255\255\255)" + +--Custom Evo metal display + local warningColor = white -- If the word "energy" displays as white, something below isn't working correctly + if mc >= ms * 0.8 then + warning = true + else + warning = false + end + + if warning == true then + if increment == 0 then + countUp = true + end + + if increment < 255 and countUp == true then + increment = increment + 15 + elseif increment > 0 then + countUp = false + increment = increment - 15 + end + + warningColor = "\255\255" .. string.char (increment) .. "\0" + + else + warningColor = skyblue + end + + str = warningColor .. "Metal: " .. orange .. "± " .. tostring(math.round(mi - me)) .. green .. " +" .. tostring(math.round(mi)) .. white .. "/" .. red .. "-" .. tostring(math.round(mp)) .. white .. " (" .. skyblue .. tostring(math.round(mc)) .. white .. "/" .. tostring(math.round(ms)) .. ")" +end + +function widget:TweakMousePress(x, y, button) + if x >= posx and x < posx + 100 and y >= posy and y < posy + FontSize * 2 then + return true + end +end + +function widget:TweakMouseMove(x, y, dx, dy, button) + if x >= 0 and x < vsx - 100 and y >= 0 and y < vsy then + posx = x + posy = y + end +end + +function DrawScreen() + local vsx, vsy = gl.GetViewSizes() + gl.Text(str, posx, posy, FontSize, "on") +end +--------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_resource_supply_display.lua b/LuaUI/Widgets_Evo/gui_resource_supply_display.lua new file mode 100644 index 000000000..d24498506 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_resource_supply_display.lua @@ -0,0 +1,80 @@ +function widget:GetInfo() + return { + name = "Resource: Supply Text Display", + desc = "Displays supply economy parameters as text", + author = "Code_Man", + date = "11/4/2016", + license = "MIT X11", + layer = 1, + enabled = false + } +end + +local white = "\255\255\255\255" +local yellow = "\255\255\255\0" +local orange = "\255\255\135\0" +local green = "\255\0\255\0" +local red = "\255\255\0\0" +local skyblue = "\255\136\197\226" + +local str = "" +local FontSize = 15 +local vsx, vsy = gl.GetViewSizes() +local posx, posy = vsx - 245, vsy - 60 +local maxSupply = 200 + +local increment = 0 + +function widget:GameFrame(n) + local myTeamID = Spring.GetMyTeamID() + --math.round(Spring.GetTeamRulesParam(myTeamID, "supplyUsed")) -- (su) + --math.round(Spring.GetTeamRulesParam(myTeamID, "supplyMax")) -- (sm) + local su, sm = math.round(Spring.GetTeamRulesParam(myTeamID, "supplyUsed")), math.round(Spring.GetTeamRulesParam(myTeamID, "supplyMax")) + if su <= maxSupply * 0.95 then + if su >= sm * 0.9 and sm ~= maxSupply then + warning = true + else + warning = false + end + + if warning == true then + if increment == 0 then + countUp = true + end + + if increment < 255 and countUp == true then + increment = increment + 15 + elseif increment > 0 then + countUp = false + increment = increment - 15 + end + + warningColor = "\255\255" .. string.char (increment) .. "\0" + + else + warningColor = green + end + else + warningColor = green + end + + str = warningColor .. "Supply: " .. white .. su .. "/" .. sm .. " (" .. orange .. "±" .. tostring(sm - su) .. white .. "/" .. green .. maxSupply .. white .. ")" +end + +function widget:TweakMousePress(x, y, button) + if x >= posx and x < posx + 100 and y >= posy and y < posy + FontSize * 2 then + return true + end +end + +function widget:TweakMouseMove(x, y, dx, dy, button) + if x >= 0 and x < vsx - 100 and y >= 0 and y < vsy then + posx = x + posy = y + end +end + +function DrawScreen() + local vsx, vsy = gl.GetViewSizes() + gl.Text(str, posx, posy, FontSize, "on") +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_selected_units_buttons.lua b/LuaUI/Widgets_Evo/gui_selected_units_buttons.lua new file mode 100644 index 000000000..b48cc149d --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_selected_units_buttons.lua @@ -0,0 +1,651 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: gui_selbuttons.lua +-- brief: adds a selected units button control panel +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Selected Units Buttons", + desc = "Buttons for the current selection", + author = "trepan, Floris", + date = "28 may 2015", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- Automatically generated local definitions + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + + +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA +local glBlending = gl.Blending +local glBeginEnd = gl.BeginEnd +local glClear = gl.Clear +local glColor = gl.Color +local glPopMatrix = gl.PopMatrix +local glPushMatrix = gl.PushMatrix +local glRect = gl.Rect +local glRotate = gl.Rotate +local glScale = gl.Scale +local glTexRect = gl.TexRect +local glText = gl.Text +local glTexture = gl.Texture +local glTranslate = gl.Translate +local glUnitDef = gl.UnitDef +local glVertex = gl.Vertex +local spGetModKeyState = Spring.GetModKeyState +local spGetMouseState = Spring.GetMouseState +local spGetMyTeamID = Spring.GetMyTeamID +local spGetSelectedUnits = Spring.GetSelectedUnits +local spGetSelectedUnitsCount = Spring.GetSelectedUnitsCount +local spGetSelectedUnitsCounts = Spring.GetSelectedUnitsCounts +local spGetSelectedUnitsSorted = Spring.GetSelectedUnitsSorted +local spGetTeamUnitsSorted = Spring.GetTeamUnitsSorted +local spSelectUnitArray = Spring.SelectUnitArray +local spSelectUnitMap = Spring.SelectUnitMap +local spSendCommands = Spring.SendCommands +local spIsGUIHidden = Spring.IsGUIHidden + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +local ui_opacityMultiplier = 0.6 +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) * ui_opacityMultiplier + +local bgcorner = ":n:LuaUI/Images/bgcorner.png" +local highlightImg = ":n:LuaUI/Images/button-highlight.dds" + +local iconsPerRow = 16 -- not functional yet, I doubt I will put this in + +local leftmouseColor = {1, 0.72, 0.25, 0.22} +local middlemouseColor = {1, 1, 1, 0.16} +local rightmouseColor = {1, 0.4, 0.4, 0.2} +--local hoverColor = { 1, 1, 1, 0.25 } + +local unitTypes = 0 +local countsTable = {} +local activePress = false +local mouseIcon = -1 +local currentDef = nil +local prevUnitCount = spGetSelectedUnitsCounts() +local oldUnitpics = false + +local iconSizeX = 76 +local iconSizeY = 76 +local iconImgMult = 0.85 + +local usedIconSizeX = iconSizeX +local usedIconSizeY = iconSizeY +local rectMinX = 0 +local rectMaxX = 0 +local rectMinY = 0 +local rectMaxY = 0 + +local backgroundDimentions = {} +local iconMargin = usedIconSizeX / 25 -- changed in ViewResize anyway +local fontSize = iconSizeY * 0.28 -- changed in ViewResize anyway +local picList + +local playSounds = true +local leftclick = 'LuaUI/Sounds/buildbar_add.wav' +local middleclick = 'LuaUI/Sounds/buildbar_click.wav' +local rightclick = 'LuaUI/Sounds/buildbar_rem.wav' + +local guishaderDisabled = true +if spGetSelectedUnitsCount() > 0 then + local checkSelectedUnits = true +end +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + + +local function updateGuishader() + if WG['guishader'] then + if not picList then + WG['guishader'].RemoveDlist('selectionbuttons') + guishaderDisabled = true + else + if backgroundDimentions[1] ~= nil then + if dlistGuishader ~= nil then + WG['guishader'].RemoveDlist('selectionbuttons') + gl.DeleteList(dlistGuishader) + end + dlistGuishader = gl.CreateList( function() + RectRound(backgroundDimentions[1], backgroundDimentions[2], backgroundDimentions[3], backgroundDimentions[4], usedIconSizeX / 8) + WG['guishader'].InsertDlist(dlistGuishader, 'selectionbuttons') + end) + guishaderDisabled = false + end + end + end +end + +local selectedUnits = Spring.GetSelectedUnits() +local selectedUnitsCount = Spring.GetSelectedUnitsCount() +local selectedUnitsCounts = Spring.GetSelectedUnitsCounts() +local selectionChanged = true +function widget:SelectionChanged(sel) + selectedUnits = sel + selectedUnitsCount = Spring.GetSelectedUnitsCount() + selectedUnitsCounts = Spring.GetSelectedUnitsCounts() + selectionChanged = true +end + + +local vsx, vsy = widgetHandler:GetViewSizes() +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + iconsPerRow = math.floor(8 * (vsx / vsy)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + usedIconSizeX = math.floor((iconSizeX/2) + ((vsx*vsy) / 115000)) + usedIconSizeY = math.floor((iconSizeY/2) + ((vsx*vsy) / 115000)) + fontSize = usedIconSizeY * 0.28 + iconMargin = usedIconSizeX / 25 + + if picList then + gl.DeleteList(picList) + picList = gl.CreateList(DrawPicList) + end +end + +function cacheUnitIcons() + if cached == nil then + gl.Color(1,1,1,0.001) + for id, unit in pairs(UnitDefs) do + gl.Texture('#' .. id) + gl.TexRect(-1,-1,0,0) + gl.Texture(false) + end + gl.Color(1,1,1,1) + cached = true + end +end + +local prevMouseIcon +local hoverClock = nil +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + cacheUnitIcons() -- else white icon bug happens + if picList then + if (spIsGUIHidden()) then return end + + if mouseIcon ~= prevMouseIcon then + gl.DeleteList(picList) + picList = gl.CreateList(DrawPicList) + prevMouseIcon = mouseIcon + end + gl.CallList(picList) + + -- draw the highlights + local x,y,lb,mb,rb = spGetMouseState() + mouseIcon = MouseOverIcon(x, y) + if (not widgetHandler:InTweakMode() and (mouseIcon >= 0)) then + if (lb or mb or rb) then + if lb then + DrawIconQuad(mouseIcon, leftmouseColor) -- click highlight + elseif mb then + DrawIconQuad(mouseIcon, middlemouseColor) -- click highlight + elseif rb then + DrawIconQuad(mouseIcon, rightmouseColor) -- click highlight + end + else + --DrawIconQuad(mouseIcon, hoverColor) -- hover highlight + end + if hoverClock == nil then hoverClock = os.clock() end + Spring.SetMouseCursor('cursornormal') + if WG['tooltip'] ~= nil and mouseIcon then + local unitName = ' --- ' + local i = 0 + for udid,count in pairs(selectedUnitsCounts) do + if type(udid) == 'number' then + if i == mouseIcon then + unitName = UnitDefs[udid].humanName + break + end + i = i + 1 + end + end + WG['tooltip'].ShowTooltip('selectedunitbuttons_unit', "\255\215\255\215"..unitName, x, backgroundDimentions[4]+(usedIconSizeY*0.37)) + end + if WG['tooltip'] ~= nil and os.clock() - hoverClock > 0.6 then + local text = "\255\215\255\215Selected units\n \255\255\255\255Left click\255\210\210\210: Select\n \255\255\255\255 + CTRL\255\210\210\210: Select units of this type on map\n \255\255\255\255 + ALT\255\210\210\210: Remove all by 1 unit of this unit type\n \255\255\255\255Right click\255\210\210\210: Remove\n \255\255\255\255 + CTRL\255\210\210\210: Remove only 1 unit from that unit type\n \255\255\255\255Middle click\255\210\210\210: Move to center location\n \255\255\255\255 + CTRL\255\210\210\210: Move to center off whole selection" + local textHeight, desc, numLines = font:GetTextHeight(text) + WG['tooltip'].ShowTooltip('selectedunitbuttons', text, vsx, backgroundDimentions[4]+(usedIconSizeY*1.3) + (textHeight*numLines*15*fontfileScale)) + end + else + hoverClock = nil + end + end +end + +function widget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) + if unitCounts ~= nil and unitCounts[unitDefID] ~= nil then + if unitCounts[unitDefID] > 1 then + unitCounts[unitDefID] = unitCounts[unitDefID] - 1 + else + unitCounts[unitDefID] = nil + end + checkSelectedUnits = true + skipGetUnitCounts = true + end +end + +local uiOpacitySec = 0 +local selChangedSec = 0 +function widget:Update(dt) + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= (Spring.GetConfigFloat("ui_opacity",0.66) * ui_opacityMultiplier) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) * ui_opacityMultiplier + gl.DeleteList(picList) + picList = gl.CreateList(DrawPicList) + end + end + + selChangedSec = selChangedSec + dt + if selectionChanged and selChangedSec>0.1 then + selChangedSec = 0 + selectionChanged = nil + if picList then + gl.DeleteList(picList) + picList = nil + end + if selectedUnitsCount > 0 then + picList = gl.CreateList(DrawPicList) + end + updateGuishader() + end +end + + +function widget:Initialize() + WG['selunitbuttons'] = {} + WG['selunitbuttons'].getOldUnitIcons = function() + return oldUnitpics + end + WG['selunitbuttons'].setOldUnitIcons = function(value) + oldUnitpics = value + end + widget:ViewResize(vsx, vsy) +end + +function widget:Shutdown() + if picList then + gl.DeleteList(picList) + end + gl.DeleteFont(font) + WG['selunitbuttons'] = nil + enabled = false + updateGuishader() +end + +local startFromIcon = 0 +function DrawPicList() + if selectedUnitsCount == 0 then return end + --Spring.Echo(Spring.GetGameFrame()..' '..math.random()) + + unitTypes = selectedUnitsCounts.n; + displayedUnitTypes = unitTypes + if displayedUnitTypes > iconsPerRow then + displayedUnitTypes = iconsPerRow + end + + if (unitTypes <= 0) then + countsTable = {} + activePress = false + currentDef = nil + return + end + + local xmid = vsx * 0.5 + local width = math.floor(usedIconSizeX * displayedUnitTypes) + rectMinX = math.floor(xmid - (0.5 * width)) + rectMaxX = math.floor(xmid + (0.5 * width)) + rectMinY = 0 + rectMaxY = math.floor(rectMinY + usedIconSizeY) + + -- draw background bar + local xmin = math.floor(rectMinX) + local xmax = math.floor(rectMinX + (usedIconSizeX * displayedUnitTypes)) + + + if unitTypes > 16 then + -- back button + if startFromIcon > 0 then + xmin = xmin - usedIconSizeX + end + -- forward button + if startFromIcon + iconsPerRow < unitTypes then + xmax = xmax + usedIconSizeX + end + end + + if ((xmax < 0) or (xmin > vsx)) then return end -- bail + local ymin = rectMinY + local ymax = rectMaxY + local xmid = (xmin + xmax) * 0.5 + local ymid = (ymin + ymax) * 0.5 + + backgroundDimentions = {xmin-iconMargin-0.5, ymin, xmax+iconMargin+0.5, ymax+iconMargin-1} + gl.Color(0,0,0,ui_opacity) + RectRound(backgroundDimentions[1],backgroundDimentions[2],backgroundDimentions[3],backgroundDimentions[4],usedIconSizeX / 8) + local borderPadding = iconMargin*1.4 + glColor(1,1,1,ui_opacity*0.055) + RectRound(backgroundDimentions[1]+borderPadding, backgroundDimentions[2]+borderPadding, backgroundDimentions[3]-borderPadding, backgroundDimentions[4]-borderPadding, usedIconSizeX / 14) + + -- back button + if startFromIcon > 0 then + + end + -- forward button + if startFromIcon + iconsPerRow < unitTypes then + + end + + -- draw the buildpics + local row = 0 + local icon = 0 + local displayedIcon = 0 + for udid,count in pairs(selectedUnitsCounts) do + if type(udid) == 'number' then + if icon >= startFromIcon then + --if icon % iconsPerRow == 0 then + -- row = row + 1 + --end + DrawUnitDefTexture(udid, icon, count, row) + displayedIcon = displayedIcon + 1 + if displayedIcon >= iconsPerRow then break end + end + icon = icon + 1 + end + end +end + + +function DrawUnitDefTexture(unitDefID, iconPos, count, row) + local usedIconImgMult = iconImgMult + local ypad2 = -usedIconSizeY/50 + local color = {1, 1, 1, 0.9 } + if (not WG['topbar'] or not WG['topbar'].showingQuit()) then + if mouseIcon ~= -1 then + color = {1, 1, 1, 0.7} + end + if iconPos == mouseIcon then + usedIconImgMult = iconImgMult*1.1 + color = {1, 1, 1, 1} + ypad2 = 0 + end + end + local yPad = (usedIconSizeY*(1-usedIconImgMult)) / 3 + local xPad = (usedIconSizeX*(1-usedIconImgMult)) / 3 + + local xmin = math.floor(rectMinX + (usedIconSizeX * iconPos)) + xPad + local xmax = xmin + usedIconSizeX - xPad - xPad + if ((xmax < 0) or (xmin > vsx)) then return end -- bail + + local ymin = rectMinY + yPad + local ymax = rectMaxY - yPad + local xmid = (xmin + xmax) * 0.5 + local ymid = (ymin + ymax) * 0.5 + + local ud = UnitDefs[unitDefID] + glColor(color) + glTexture('#' .. unitDefID) + glTexRect(math.floor(xmin+iconMargin), math.floor(ymin+iconMargin+ypad2), math.ceil(xmax-iconMargin), math.ceil(ymax-iconMargin+ypad2)) + glTexture(false) + + if count > 1 then + -- draw the count text + local offset = math.ceil((ymax - (ymin+iconMargin+iconMargin)) / 20) + font:Begin() + font:SetTextColor(0.85,0.85,0.85,1) + font:Print(count, xmax-(iconMargin*1.3)-offset, ymin+(iconMargin*2.2)+offset+(fontSize/16)-(yPad/2) , fontSize, "or") + font:End() + end +end + + +function RectRound(px,py,sx,sy,cs) + + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + glTexture(false) + glRect(px+cs, py, sx-cs, sy) + glRect(sx-cs, py+cs, sx, sy-cs) + glRect(px+cs, py+cs, px, sy-cs) + + if py <= 0 or px <= 0 then glTexture(false) else glTexture(bgcorner) end + glTexRect(px, py+cs, px+cs, py) -- top left + + if py <= 0 or sx >= vsx then glTexture(false) else glTexture(bgcorner) end + glTexRect(sx, py+cs, sx-cs, py) -- top right + + if sy >= vsy or px <= 0 then glTexture(false) else glTexture(bgcorner) end + glTexRect(px, sy-cs, px+cs, sy) -- bottom left + + if sy >= vsy or sx >= vsx then glTexture(false) else glTexture(bgcorner) end + glTexRect(sx, sy-cs, sx-cs, sy) -- bottom right + + glTexture(false) +end + +function DrawIconQuad(iconPos, color) + + local usedIconImgMult = iconImgMult*1.08 + + local yPad = (usedIconSizeY*(1-usedIconImgMult)) / 2 + local xPad = (usedIconSizeX*(1-usedIconImgMult)) / 2 + + local xmin = math.floor(rectMinX + (usedIconSizeX * iconPos)) + xPad + local xmax = xmin + usedIconSizeX - xPad - xPad + if ((xmax < 0) or (xmin > vsx)) then return end -- bail + + local ymin = rectMinY + local ymax = rectMaxY - yPad + local xmid = (xmin + xmax) * 0.5 + local ymid = (ymin + ymax) * 0.5 + + gl.Texture(highlightImg) + gl.Color(color) + glTexRect(xmin+iconMargin, ymin+iconMargin+iconMargin, xmax-iconMargin, ymax-iconMargin) + gl.Texture(false) + + RectRound(xmin+iconMargin, ymin+iconMargin+iconMargin, xmax-iconMargin, ymax-iconMargin, (xmax-xmin)/15) + glBlending(GL_SRC_ALPHA, GL_ONE) + gl.Color(color[1],color[2],color[3],color[4]/2) + RectRound(xmin+iconMargin, ymin+iconMargin+iconMargin, xmax-iconMargin, ymax-iconMargin, (xmax-xmin)/15) + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) +end + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +function widget:MousePress(x, y, button) + mouseIcon = MouseOverIcon(x, y) + activePress = (mouseIcon >= 0) + return activePress +end + +------------------------------------------------------------------------------- + +local function LeftMouseButton(unitDefID, unitTable) + local alt, ctrl, meta, shift = spGetModKeyState() + local acted = false + if (not ctrl) then + -- select units of icon type + if (alt or meta) then + acted = true + spSelectUnitArray({ unitTable[1] }) -- only 1 + else + acted = true + spSelectUnitArray(unitTable) + end + else + -- select all units of the icon type + local sorted = spGetTeamUnitsSorted(spGetMyTeamID()) + local units = sorted[unitDefID] + if (units) then + acted = true + spSelectUnitArray(units, shift) + end + end + if acted and playSounds then + Spring.PlaySoundFile(leftclick, 0.75, 'ui') + end +end + + +local function MiddleMouseButton(unitDefID, unitTable) + local alt, ctrl, meta, shift = spGetModKeyState() + -- center the view + if (ctrl) then + -- center the view on the entire selection + spSendCommands({"viewselection"}) + else + -- center the view on this type on unit + local selUnits = spGetSelectedUnits() + spSelectUnitArray(unitTable) + spSendCommands({"viewselection"}) + spSelectUnitArray(selUnits) + end + if playSounds then + Spring.PlaySoundFile(middleclick, 0.75, 'ui') + end +end + + +local function RightMouseButton(unitDefID, unitTable) + local alt, ctrl, meta, shift = spGetModKeyState() + -- remove selected units of icon type + local selUnits = spGetSelectedUnits() + local map = {} + for _,uid in ipairs(selUnits) do map[uid] = true end + for _,uid in ipairs(unitTable) do + map[uid] = nil + if (ctrl) then break end -- only remove 1 unit + end + spSelectUnitMap(map) + if playSounds then + Spring.PlaySoundFile(rightclick, 0.75, 'ui') + end +end + + +------------------------------------------------------------------------------- + + +function widget:MouseRelease(x, y, button) + if WG['smartselect'] and not WG['smartselect'].updateSelection then return end + if (not activePress) then + return -1 + end + activePress = false + local icon = MouseOverIcon(x, y) + + local units = spGetSelectedUnitsSorted() + if (units.n ~= unitTypes) then + return -1 -- discard this click + end + units.n = nil + + local unitDefID = -1 + local unitTable = nil + local index = 0 + for udid,uTable in pairs(units) do + if (index == icon) then + unitDefID = udid + unitTable = uTable + break + end + index = index + 1 + end + if (unitTable == nil) then + return -1 + end + + local alt, ctrl, meta, shift = spGetModKeyState() + + if (button == 1) then + LeftMouseButton(unitDefID, unitTable) + elseif (button == 2) then + MiddleMouseButton(unitDefID, unitTable) + elseif (button == 3) then + RightMouseButton(unitDefID, unitTable) + end + + return -1 +end + + +function MouseOverIcon(x, y) + if (unitTypes <= 0) then return -1 end + if (x < rectMinX) then return -1 end + if (x > rectMaxX) then return -1 end + if (y < rectMinY) then return -1 end + if (y > rectMaxY) then return -1 end + + local icon = math.floor((x - rectMinX) / usedIconSizeX) + -- clamp the icon range + if (icon < 0) then + icon = 0 + end + if (icon >= unitTypes) then + icon = (unitTypes - 1) + end + return icon +end + + +------------------------------------------------------------------------------- + + +function widget:GetConfigData() + return {oldUnitpics=oldUnitpics} +end + +function widget:SetConfigData(data) --load config + if (data.oldUnitpics ~= nil) then + oldUnitpics = data.oldUnitpics + end +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/gui_selfd_icons.lua b/LuaUI/Widgets_Evo/gui_selfd_icons.lua new file mode 100644 index 000000000..22194d7f0 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_selfd_icons.lua @@ -0,0 +1,212 @@ +function widget:GetInfo() + return { + name = "Self-Destruct icons", + desc = "", + author = "Floris", + date = "06.05.2014", + license = "GNU GPL, v2 or later", + layer = -50, + enabled = true + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +-- preferred to keep these values the same as fancy unit selections widget +local unitConf = {} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 45 +local fontfileOutlineSize = 4.5 +local fontfileOutlineStrength = 9 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local selfdUnits = {} +local drawLists = {} +local glDrawListAtUnit = gl.DrawListAtUnit + +local spIsGUIHidden = Spring.IsGUIHidden +local spGetUnitDefID = Spring.GetUnitDefID +local spIsUnitInView = Spring.IsUnitInView +local spGetUnitSelfDTime = Spring.GetUnitSelfDTime +local spGetAllUnits = Spring.GetAllUnits +local spGetCommandQueue = Spring.GetCommandQueue +local spIsUnitAllied = Spring.IsUnitAllied +local spGetCameraDirection = Spring.GetCameraDirection + +local spec = Spring.GetSpectatingState() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function DrawIcon(text) + local iconSize = 0.9 + gl.PushMatrix() + gl.Texture(':n:LuaUI/Images/skull.dds') + gl.Translate(0.32,1,1.4) + gl.Billboard() + gl.TexRect(-(iconSize+0.085), 0, -0.08, iconSize) + font:Begin() + font:Print(text,0,(iconSize/4),0.66,"oc") + font:End() + gl.PopMatrix() +end + + +function SetUnitConf() + for udid, unitDef in pairs(UnitDefs) do + local xsize, zsize = unitDef.xsize, unitDef.zsize + local scale = 6*( xsize^2 + zsize^2 )^0.5 + unitConf[udid] = 7 +(scale/2.5) + end +end + +-------------------------------------------------------------------------------- +-- Engine Calls +-------------------------------------------------------------------------------- + +function init() + spec = Spring.GetSpectatingState() + -- check all units for selfd cmd + selfdUnits = {} + local units = spGetAllUnits() + for _, unitID in ipairs(units) do + if spGetUnitSelfDTime(unitID) ~= nil then + if spGetUnitSelfDTime(unitID) > 0 then + selfdUnits[unitID] = true + end + -- check for queued selfd + local unitQueue = spGetCommandQueue(unitID,20) or {} + if (#unitQueue > 0) then + for _,cmd in ipairs(unitQueue) do + if cmd.id == CMD.SELFD then + selfdUnits[unitID] = true + end + end + end + end + end +end + +function widget:PlayerChanged(playerID) + init() +end + +function widget:Initialize() + SetUnitConf() + init() +end + + +function widget:Shutdown() + for k,_ in pairs(drawLists) do + gl.DeleteList(drawLists[k]) + end + gl.DeleteFont(font) +end + + +local sec = 0 +local prevCam = {spGetCameraDirection()} +function widget:Update(dt) + sec = sec + dt + if sec > 0.15 then + sec = 0 + local camX, camY, camZ = spGetCameraDirection() + if camX ~= prevCam[1] or camY ~= prevCam[2] or camZ ~= prevCam[3] then + for k,_ in pairs(drawLists) do + gl.DeleteList(drawLists[k]) + drawLists[k] = nil + end + end + prevCam = {camX,camY,camZ} + end +end + +-- draw icons +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorld() + if chobbyInterface then return end + if spIsGUIHidden() then return end + + gl.DepthTest(true) + gl.Color(0.9,0.9,0.9,1) + + local unitScale, countdown + for unitID, unitDefID in pairs(selfdUnits) do + if spIsUnitAllied(unitID) or spec then + if spIsUnitInView(unitID) then + unitScale = unitConf[unitDefID] + countdown = math.ceil(spGetUnitSelfDTime(unitID) / 2) + if not drawLists[countdown] then + drawLists[countdown] = gl.CreateList(DrawIcon, countdown) + end + glDrawListAtUnit(unitID, drawLists[countdown], false, unitScale,unitScale,unitScale) + end + else + selfdUnits[unitID] = nil + end + end + + gl.Color(1,1,1,1) + gl.Texture(false) + gl.DepthTest(false) +end + + +function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions) + + -- check for queued selfd (to check if queue gets cancelled) + if selfdUnits[unitID] then + local foundSelfdCmd = false + local unitQueue = spGetCommandQueue(unitID,20) or {} + if (#unitQueue > 0) then + for _,cmd in ipairs(unitQueue) do + if cmd.id == CMD.SELFD then + foundSelfdCmd = true + break + end + end + end + if foundSelfdCmd then + selfdUnits[unitID] = nil + end + end + + if cmdID == CMD.SELFD then + if spGetUnitSelfDTime(unitID) > 0 then -- since cmd hasnt been cancelled yet + selfdUnits[unitID] = nil + else + selfdUnits[unitID] = spGetUnitDefID(unitID) + end + end +end + + +function widget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam) + + if selfdUnits[unitID] then + selfdUnits[unitID] = nil + end +end diff --git a/LuaUI/Widgets_Evo/gui_smoothcam.lua b/LuaUI/Widgets_Evo/gui_smoothcam.lua deleted file mode 100644 index 189c098b9..000000000 --- a/LuaUI/Widgets_Evo/gui_smoothcam.lua +++ /dev/null @@ -1,30 +0,0 @@ -local versionNumber = "0.5" - -function widget:GetInfo() - return { - name = "SmoothCam", - desc = "[v" .. string.format("%s", versionNumber ) .. "] Moves camera smoothly", - author = "very_bad_soldier", - date = "August, 8, 2010", - license = "GNU GPL, v2 or later", - layer = 0, - handler = true, - enabled = false, - } -end - - --------------------------------------------------------------------------------- -----------------------------Configuration--------------------------------------- -local camSpeed = 0.35 --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local spGetCameraState = Spring.GetCameraState -local spSetCameraState = Spring.SetCameraState --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -function widget:Update(dt) - local cs = spGetCameraState() - spSetCameraState(cs, camSpeed) -end - diff --git a/LuaUI/Widgets_Evo/gui_spectate_selected.lua b/LuaUI/Widgets_Evo/gui_spectate_selected.lua index e4df2cc88..f37636819 100644 --- a/LuaUI/Widgets_Evo/gui_spectate_selected.lua +++ b/LuaUI/Widgets_Evo/gui_spectate_selected.lua @@ -23,7 +23,7 @@ function widget:CommandsChanged() local selUnits = spGetSelectedUnits() if #selUnits > 0 then local selTeam = spGetUnitTeam(selUnits[1]) - if selTeam ~= spGetMyTeamID() then + if selTeam and selTeam ~= spGetMyTeamID() then spSendCommands('specteam ' .. selTeam) end end diff --git a/LuaUI/Widgets_Evo/gui_startradius.lua b/LuaUI/Widgets_Evo/gui_startradius.lua index 128ad4cda..adf2aa91c 100644 --- a/LuaUI/Widgets_Evo/gui_startradius.lua +++ b/LuaUI/Widgets_Evo/gui_startradius.lua @@ -79,12 +79,13 @@ local function DrawPoints() if (sx == sxin and sy == syin and sz == szin) then - DrawGroundCircle(x, y, z, 1000, 128) + DrawGroundCircle(sx, sy, sz, 350, 128) count = count + 1 else - DrawGroundCircle(sx, sy, sz, 1000, 128) + + DrawGroundCircle(sx, sy, sz, 350, 128) end diff --git a/LuaUI/Widgets_Evo/gui_toggleLos.lua b/LuaUI/Widgets_Evo/gui_toggleLos.lua new file mode 100644 index 000000000..daec086f0 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_toggleLos.lua @@ -0,0 +1,40 @@ +local versionNumber = "0.7" +local widgetName = "Toggle LOS" + +function widget:GetInfo() + return { + name = widgetName, + desc = "[v" .. string.format("%s", versionNumber ) .. "] Automatically enables LOS view when the game begins.", + author = "very_bad_soldier", + date = "17.07.2010", + license = "GNU GPL v2", + layer = 0, + enabled = true + } +end + +-- tweaked by raaar to remove toggling radar and jammer state for spring 99.0 and later + +function widget:Initialize() + if ( CheckSpecState() == true ) then + RemoveItself() + end +end + +function widget:GameStart() + if (Spring.GetMapDrawMode() ~= "los") then + Spring.SendCommands("togglelos") + end + RemoveItself() +end + +function RemoveItself() + widgetHandler:RemoveWidget() +end + +function CheckSpecState() + local playerID = Spring.GetMyPlayerID() + local _, _, spec, _, _, _, _, _ = Spring.GetPlayerInfo(playerID) + + return spec +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_tooltip.lua b/LuaUI/Widgets_Evo/gui_tooltip.lua new file mode 100644 index 000000000..ecca9325b --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_tooltip.lua @@ -0,0 +1,279 @@ + +function widget:GetInfo() + return { + name = "Tooltip", + desc = "Shows tooltips", + author = "Floris", + date = "April 2017", + license = "GNU GPL, v2 or later", + layer = -9999999999, + enabled = true, -- loaded by default? + } +end + +------------------------------------------------------------------------------------ +-- Info +------------------------------------------------------------------------------------ +--[[ + +-- Availible API functions: +WG['tooltip'].AddTooltip(name, area, value, delay, x, y) -- area: {x1,y1,x2,y2} value: 'text' delay(optional): #seconds x/y(optional): display coordinates +WG['tooltip'].RemoveTooltip(name) + +WG['tooltip'].ShowTooltip(name, value, x, y) -- x/y (optional): display coordinates + +You can use 'AddTooltip' to add a screen area that will display a tooltip when you hover over it + +Use 'ShowTooltip' to directly show a tooltip, the name you give should be unique, and not one you desined in 'AddTooltip' +(the name will be deleted after use) + +]]-- +------------------------------------------------------------------------------------ +-- Config +------------------------------------------------------------------------------------ + +local defaultDelay = 0.4 +local usedFontSize = 15 +local xOffset = 35 +local yOffset = -35-usedFontSize + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 4.5 +local fontfileOutlineStrength = 1.8 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +------------------------------------------------------------------------------------ +-- Speedups +------------------------------------------------------------------------------------ + +local bgcorner = "LuaUI/Images/bgcorner.png" +local glColor = gl.Color +local glText = gl.Text +local glRect = gl.Rect +local glTranslate = gl.Translate + +local spGetModKeyState = Spring.GetModKeyState +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay +local spGetTooltip = Spring.GetCurrentTooltip + +local vsx, vsy = Spring.GetViewGeometry() + +local tooltips = {} + +------------------------------------------------------------------------------------ +-- Functions +------------------------------------------------------------------------------------ + +function RectRound(px,py,sx,sy,cs) + + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.floor(sx),math.floor(sy),math.floor(cs) + + gl.Rect(px+cs, py, sx-cs, sy) + gl.Rect(sx-cs, py+cs, sx, sy-cs) + gl.Rect(px+cs, py+cs, px, sy-cs) + + gl.Texture(bgcorner) + gl.TexRect(px, py+cs, px+cs, py) -- top left + gl.TexRect(sx, py+cs, sx-cs, py) -- top right + gl.TexRect(px, sy-cs, px+cs, sy) -- bottom left + gl.TexRect(sx, sy-cs, sx-cs, sy) -- bottom right + gl.Texture(false) +end + +function widget:Initialize() + init() +end + +function widget:Shutdown() + gl.DeleteFont(font) + if WG['guishader'] then + for name, tooltip in pairs(tooltips) do + WG['guishader'].DeleteScreenDlist('tooltip_'..name) + end + end + WG['tooltip'] = nil +end + +function init() + vsx, vsy = gl.GetViewSizes() + widgetScale = (0.60 + (vsx*vsy / 5000000)) + + if WG['tooltip'] == nil then + WG['tooltip'] = {} + WG['tooltip'].AddTooltip = function(name, area, value, delay) + if (value ~= nil and area[1]~=nil and area[2]~=nil and area[3]~=nil and area[4]~=nil) or tooltips[name] ~= nil and tooltips[name].value ~= nil then + if delay == nil then delay = defaultDelay end + if tooltips[name] == nil then + tooltips[name] = {} + end + tooltips[name].area = area + tooltips[name].delay = delay + if value ~= nil then + tooltips[name].value = tostring(value) + end + end + end + WG['tooltip'].RemoveTooltip = function(name) + if tooltips[name] ~= nil then + tooltips[name] = nil + end + end + WG['tooltip'].ShowTooltip = function(name, value, x, y) + if value ~= nil then + tooltips[name] = {value=tostring(value) } + if x ~= nil and y ~= nil then + tooltips[name].pos = {x,y} + end + end + end + end +end + + +function widget:ViewResize(x,y) + vsx,vsy = Spring.GetViewGeometry() + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + init() +end + + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY +end + + +function lines(str) + local t = {} + local function helper(line) t[#t+1]=line return "" end + helper((str:gsub("(.-)\r?\n", helper))) + return t +end + + +function drawTooltip(name, x, y) + --Spring.Echo('Showing tooltip: '..name) + + local paddingH = 7 *widgetScale + local paddingW = paddingH * 1.33 + local posX = x + paddingW + local posY = y + paddingH + + local fontSize = usedFontSize*widgetScale + local maxWidth = 0 + local maxHeight = 0 + local lineHeight = fontSize + (fontSize/4.5) + local lines = lines(tooltips[name].value) + + -- get text dimentions + for i, line in ipairs(lines) do + maxWidth = math.max(maxWidth, (font:GetTextWidth(line)*fontSize), maxWidth) + maxHeight = maxHeight + lineHeight + end + -- adjust position when needed + if posX+maxWidth+paddingW+paddingW > vsx then + posX = posX - maxWidth - paddingW - paddingW - (xOffset*widgetScale*2) + end + if posX - paddingW < 0 then + posX = 0 + paddingW + end + if posY + paddingH > vsy then + posY = (posY - (posY - vsy)) - paddingH + end + if posY-maxHeight-paddingH-paddingH < 0 then + posY = 0 + maxHeight + paddingH + paddingH + end + + -- draw background + local cornersize = 0 + glColor(0.85,0.85,0.85,(WG['guishader'] and 0.66 or 0.8)) + RectRound(posX-paddingW+cornersize, posY-maxHeight-paddingH+cornersize, posX+maxWidth+paddingW-cornersize, posY+paddingH-cornersize, 5*widgetScale) + if WG['guishader'] then + WG['guishader'].InsertScreenDlist( gl.CreateList( function() + RectRound(posX-paddingW+cornersize, posY-maxHeight-paddingH+cornersize, posX+maxWidth+paddingW-cornersize, posY+paddingH-cornersize, 5*widgetScale) + end), 'tooltip_'..name) + end + cornersize = 2.25*widgetScale + glColor(0,0,0,(WG['guishader'] and 0.22 or 0.3)) + RectRound(posX-paddingW+cornersize, + posY-maxHeight-paddingH+cornersize, + posX+maxWidth+paddingW-cornersize, + posY+paddingH-cornersize-0.06, 4.3*widgetScale) + + -- draw text + maxHeight = -fontSize*0.93 + glTranslate(posX, posY, 0) + font:Begin() + --font:SetTextColor(0.95,0.95,0.95,1) + --font:SetOutlineColor(0.3,0.3,0.3,0.3) + for i, line in ipairs(lines) do + font:Print('\255\244\244\244'..line, 0, maxHeight, fontSize, "o") + maxHeight = maxHeight - lineHeight + end + font:End() + glTranslate(-posX, -posY, 0) +end + +local cleanupGuishaderAreas = {} +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if (WG['topbar'] and WG['topbar'].showingQuit()) then + return + end + local x, y = spGetMouseState() + local now = os.clock() + + if WG['guishader'] then + for name, _ in pairs(cleanupGuishaderAreas) do + WG['guishader'].DeleteScreenDlist(name) + cleanupGuishaderAreas[name] = nil + end + end + for name, tooltip in pairs(tooltips) do + if tooltip.area == nil or (tooltip.area[4]~= nil and IsOnRect(x, y, tooltip.area[1], tooltip.area[2], tooltip.area[3], tooltip.area[4])) then + if tooltip.area == nil then + if tooltip.pos ~= nil then + drawTooltip(name, tooltip.pos[1], tooltip.pos[2]) + else + drawTooltip(name, x + (xOffset*widgetScale), y + (yOffset*widgetScale)) + end + tooltips[name] = nil + cleanupGuishaderAreas['tooltip_'..name] = true + else + if tooltip.displayTime == nil then + tooltip.displayTime = now + tooltip.delay + elseif tooltip.displayTime <= now then + if tooltip.pos ~= nil then + drawTooltip(name, tooltip.pos[1], tooltip.pos[2]) + else + drawTooltip(name, x + (xOffset*widgetScale), y + (yOffset*widgetScale)) + end + end + end + else + if tooltip.displayTime ~= nil then + tooltip.displayTime = nil + if WG['guishader'] then + WG['guishader'].DeleteScreenDlist('tooltip_'..name) + end + end + end + end +end + +------------------------------------------------------------------------------------ diff --git a/LuaUI/Widgets_Evo/gui_top_bar.lua b/LuaUI/Widgets_Evo/gui_top_bar.lua new file mode 100644 index 000000000..a54709d48 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_top_bar.lua @@ -0,0 +1,1888 @@ +function widget:GetInfo() + return { + name = "Top Bar", + desc = "Shows Resources, wind speed, commander counter, and various options.", + author = "Floris", + date = "Feb, 2017", + license = "GNU GPL, v2 or later", + layer = -9999999, + enabled = true, --enabled by default + handler = true, --can use widgetHandler:x() + } +end + +local ui_opacity = tonumber(Spring.GetConfigFloat("ui_opacity",0.66) or 0.66) + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.33 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local height = 38 +local relXpos = 0.3 +local borderPadding = 5 +local showConversionSlider = true +local bladeSpeedMultiplier = 0.2 +local bladeSpeedMultiplier = 0.22 + +--local armcomDefID = UnitDefNames.armcom.id +--local corcomDefID = UnitDefNames.corcom.id + +local playSounds = true +local leftclick = 'LuaUI/Sounds/tock.wav' +local resourceclick = 'LuaUI/Sounds/buildbar_click.wav' +local middleclick = 'LuaUI/Sounds/buildbar_click.wav' +local rightclick = 'LuaUI/Sounds/buildbar_rem.wav' + +local bgcorner = "LuaUI/Images/bgcorner.png" +local barbg = ":n:LuaUI/Images/resbar.dds" +local barGlowCenterTexture = ":n:LuaUI/Images/barglow-center.png" +local barGlowEdgeTexture = ":n:LuaUI/Images/barglow-edge.png" +local bladesTexture = ":c:LuaUI/Images/blades.png" +local poleTexture = "LuaUI/Images/pole.png" +local comTexture = "LuaUI/Images/comIcon.png" +local glowTexture = "LuaUI/Images/glow.dds" + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (0.80 + (vsx*vsy / 6000000)) +local xPos = vsx*relXpos +local currentWind = 0 +local currentMetalmaker = '' +local gameStarted = false +local displayComCounter = false + +local glTranslate = gl.Translate +local glColor = gl.Color +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glTexture = gl.Texture +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glText = gl.Text +local glRotate = gl.Rotate +local glCreateList = gl.CreateList +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList + +local spGetSpectatingState = Spring.GetSpectatingState +local spGetTeamResources = Spring.GetTeamResources +local spGetMyTeamID = Spring.GetMyTeamID +local sformat = string.format +local spGetMouseState = Spring.GetMouseState + +local spec = spGetSpectatingState() +local myAllyTeamID = Spring.GetMyAllyTeamID() +local myTeamID = Spring.GetMyTeamID() +local myPlayerID = Spring.GetMyPlayerID() +local isReplay = Spring.IsReplay() + +local spWind = Spring.GetWind +local minWind = Game.windMin +local maxWind = Game.windMax +local windRotation = 0 + +local startComs = 0 +local lastFrame = -1 +local gameFrame = 0 +local topbarArea = {} +local barContentArea = {} +local resbarArea = {metal={}, energy={}} +local resbarDrawinfo = {metal={}, energy={}} +local shareIndicatorArea = {metal={}, energy={}} +local dlistResbar = {metal={}, energy={}} +local energyconvArea = {} +local windArea = {} +local comsArea = {} +local metalmakerArea = {} +local rejoinArea = {} +local buttonsArea = {} +local dlistWindText = {} +local dlistResValues = {metal={},energy={}} +local currentResCap = {metal=1000,energy=1000} +local currentResValue = {metal=1000,energy=1000 } + +local r = {} +r['metal'] = {spGetTeamResources(spGetMyTeamID(),'metal') } +r['energy'] = {spGetTeamResources(spGetMyTeamID(),'energy') } + +local showOverflowTooltip = {} + +local allyComs = 0 +local enemyComs = 0 -- if we are counting ourselves because we are a spec +local enemyComCount = 0 -- if we are receiving a count from the gadget part (needs modoption on) +local prevEnemyComCount = 0 +local receiveCount = (tostring(Spring.GetModOptions().mo_enemycomcount) == "1") or false + +local guishaderEnabled = false +local guishaderCheckUpdateRate = 2 +local nextGuishaderCheck = guishaderCheckUpdateRate +local now = os.clock() +local gameFrame = Spring.GetGameFrame() + +local draggingShareIndicatorValue = {} + +local chobbyLoaded = false +if Spring.GetMenuName and string.find(string.lower(Spring.GetMenuName()), 'chobby') ~= nil then + chobbyLoaded = true + Spring.SendLuaMenuMsg("disableLobbyButton") +end +-------------------------------------------------------------------------------- +-- Rejoin +-------------------------------------------------------------------------------- +local serverFrameRate = 30 --//constant: assume server run at x1.0 gamespeed. +local oneSecondElapsed = 0 --//variable: a timer for 1 second, used in Update(). Update UI every 1 second. +local showRejoinUI = false --//variable:indicate whether UI is shown or hidden. +local averageLocalSpeed = {sumOfSpeed= 0, sumCounter= 0} --//variable: store the local-gameFrame speeds so that an average can be calculated. +local defaultAverage = 30 --//constant: Initial/Default average is set at 30gfps (x1.0 gameSpeed) +local simpleMovingAverageLocalSpeed = {storage={},index = 1, runningAverage=defaultAverage} --//variable: for calculating rolling average. Initial/Default average is set at 30gfps (x1.0 gameSpeed) + +--Variable for fixing GameProgress delay at rejoin------------------------------ +local myTimestamp = 0 --//variable: store my own timestamp at GameStart +local submittedTimestamp = {} --//variable: store all timestamp at GameStart submitted by original players (assuming we are rejoining) +local functionContainer = function(x) end --//variable object: store a function +local gameProgressActive = false --//variable: signal whether GameProgress has been updated. + +local serverFrameNum1 = 0 +local serverFrameNum2 = 0 +local myLastFrameNum = 0 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function isInBox(mx, my, box) + return mx > box[1] and my > box[2] and mx < box[3] and my < box[4] +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx, vsy = gl.GetViewSizes() + widgetScale = (vsy / height) * 0.043 -- using 734 because redui-console uses this value too + xPos = vsx*relXpos + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + + for n,_ in pairs(dlistWindText) do + glDeleteList(dlistWindText[n]) + end + dlistWindText = {} + for n,_ in pairs(dlistResValues['metal']) do + glDeleteList(dlistResValues['metal'][n]) + end + dlistResValues['metal'] = {} + for n,_ in pairs(dlistResValues['energy']) do + glDeleteList(dlistResValues['energy'][n]) + end + dlistResValues['energy'] = {} + + init() +end + +local function DrawRectRound(px,py,sx,sy,cs, tl,tr,br,bl) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + + -- bottom left + if ((py <= 0 or px <= 0) or (bl ~= nil and bl == 0)) and bl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- bottom right + if ((py <= 0 or sx >= vsx) or (br ~= nil and br == 0)) and br ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- top left + if ((sy >= vsy or px <= 0) or (tl ~= nil and tl == 0)) and tl ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- top right + if ((sy >= vsy or sx >= vsx) or (tr ~= nil and tr == 0)) and tr ~= 2 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end +function RectRound(px,py,sx,sy,cs, tl,tr,br,bl) -- (coordinates work differently than the RectRound func in other widgets) + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs, tl,tr,br,bl) + gl.Texture(false) +end + + +local function short(n,f) + if (f == nil) then + f = 0 + end + if (n > 9999999) then + return sformat("%."..f.."fm",n/1000000) + elseif (n > 9999) then + return sformat("%."..f.."fk",n/1000) + else + return sformat("%."..f.."f",n) + end +end + + +local function updateRejoin() + local area = rejoinArea + local catchup = gameFrame / serverFrameNum1 + + if serverFrameNum1 - gameFrame < 20 then + showRejoinUI = false + end + + if dlistRejoin ~= nil then + glDeleteList(dlistRejoin) + end + dlistRejoin = glCreateList( function() + + -- background + glColor(0,0,0,ui_opacity) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + local bgpadding = 3*widgetScale + glColor(1,1,1,0.055*ui_opacity) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3]-bgpadding, area[4], 5*widgetScale) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(area[1], area[2], area[3], area[4], 'topbar_rejoin') + end + + local barHeight = (height*widgetScale/10) + local barHeighPadding = 7*widgetScale --((height/2) * widgetScale) - (barHeight/2) + local barLeftPadding = 7* widgetScale + local barRightPadding = 7 * widgetScale + local barArea = {area[1]+barLeftPadding, area[2]+barHeighPadding, area[3]-barRightPadding, area[2]+barHeight+barHeighPadding} + local barWidth = barArea[3] - barArea[1] + + glColor(0.0,0.5,0,0.33) + glTexture(barbg) + glTexRect(barArea[1], barArea[2], barArea[3], barArea[4]) + + -- Bar value + glColor(0, 1, 0, 1) + glTexture(barbg) + glTexRect(barArea[1], barArea[2], barArea[1]+(catchup * barWidth), barArea[4]) + + -- Bar value glow + local glowSize = barHeight * 6 + glColor(0, 1, 0, 0.09) + glTexture(barGlowCenterTexture) + glTexRect(barArea[1], barArea[2] - glowSize, barArea[1]+(catchup * barWidth), barArea[4] + glowSize) + glTexture(barGlowEdgeTexture) + glTexRect(barArea[1]-(glowSize*2), barArea[2] - glowSize, barArea[1], barArea[4] + glowSize) + glTexRect((barArea[1]+(catchup * barWidth))+(glowSize*2), barArea[2] - glowSize, barArea[1]+(catchup * barWidth), barArea[4] + glowSize) + + -- Text + local fontsize = 12*widgetScale + glText('\255\225\255\225Catching up', area[1]+((area[3]-area[1])/2), area[2]+barHeight*2+fontsize, fontsize, 'cor') + + end) + if WG['tooltip'] ~= nil then + WG['tooltip'].AddTooltip('rejoin', area, "Displays the catchup progress") + end +end + + +local function updateButtons() + local area = buttonsArea + + local totalWidth = area[3] - area[1] + + local text = ' ' + if (WG['teamstats'] ~= nil) then text = text..'Stats ' end + if (WG['commands'] ~= nil) then text = text..'Cmd ' end + if (WG['keybinds'] ~= nil) then text = text..'Keys ' end + if (WG['changelog'] ~= nil) then text = text..'Changes ' end + if (WG['options'] ~= nil) then text = text..'Settings ' end + if chobbyLoaded then + text = text..'Lobby ' + else + text = text..'Quit ' + end + + local fontsize = totalWidth / font2:GetTextWidth(text) + if fontsize > (height*widgetScale)/3 then + fontsize = (height*widgetScale)/3 + end + + + -- add background blur + if dlistButtonsGuishader ~= nil then + if WG['guishader'] then + WG['guishader'].RemoveDlist('topbar_buttons') + end + glDeleteList(dlistButtonsGuishader) + end + dlistButtonsGuishader = glCreateList( function() + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + end) + + + if dlistButtons1 ~= nil then + glDeleteList(dlistButtons1) + end + dlistButtons1 = glCreateList( function() + + -- background + glColor(0,0,0,ui_opacity) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + local bgpadding = 3*widgetScale + glColor(1,1,1,ui_opacity*0.055) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3], area[4], bgpadding*1.25) + + if WG['guishader'] then + WG['guishader'].InsertDlist(dlistButtonsGuishader, 'topbar_buttons') + end + + if buttonsArea['buttons'] == nil then + buttonsArea['buttons'] = {} + + local margin = height*widgetScale / 11 + local offset = margin + local width = 0 + local buttons = 0 + + if (WG['teamstats'] ~= nil) then + buttons = buttons + 1 + if buttons > 1 then offset = offset+width end + width = font2:GetTextWidth(' Stats ') * fontsize + (buttons == 1 and 20 or 0) + buttonsArea['buttons']['stats'] = {area[1]+offset, area[2]+margin, area[1]+offset+width, area[4] } + end + if (WG['commands'] ~= nil) then + buttons = buttons + 1 + if buttons > 1 then offset = offset+width end + width = font2:GetTextWidth(' Cmd ') * fontsize + (buttons == 1 and 20 or 0) + buttonsArea['buttons']['commands'] = {area[1]+offset, area[2]+margin, area[1]+offset+width, area[4]} + end + if (WG['keybinds'] ~= nil) then + buttons = buttons + 1 + if buttons > 1 then offset = offset+width end + width = font2:GetTextWidth(' Keys ') * fontsize + (buttons == 1 and 20 or 0) + buttonsArea['buttons']['keybinds'] = {area[1]+offset, area[2]+margin, area[1]+offset+width, area[4]} + end + if (WG['changelog'] ~= nil) then + button = buttons + 1 + if buttons > 1 then offset = offset+width end + width = font2:GetTextWidth(' Changes ') * fontsize + (buttons == 1 and 20 or 0) + buttonsArea['buttons']['changelog'] = {area[1]+offset, area[2]+margin, area[1]+offset+width, area[4]} + end + if (WG['options'] ~= nil) then + buttons = buttons + 1 + if buttons > 1 then offset = offset+width end + width = font2:GetTextWidth(' Settings ') * fontsize + buttonsArea['buttons']['options'] = {area[1]+offset, area[2]+margin, area[1]+offset+width, area[4]} + end + if chobbyLoaded then + offset = offset+width + width = font2:GetTextWidth(' Lobby ') * fontsize + buttonsArea['buttons']['quit'] = {area[1]+offset, area[2]+margin, area[3], area[4]} + else + offset = offset+width + width = font2:GetTextWidth(' Quit ') * fontsize + buttonsArea['buttons']['quit'] = {area[1]+offset, area[2]+margin, area[3], area[4]} + end + end + end) + + if dlistButtons2 ~= nil then + glDeleteList(dlistButtons2) + end + dlistButtons2 = glCreateList( function() + font2:Begin() + font2:Print('\255\210\210\210'..text, area[1], area[2]+((area[4]-area[2])/2)-(fontsize/5), fontsize, 'o') + font2:End() + end) +end + + +local function updateMetalmaker() + local area = metalmakerArea + + if dlistMetalmaker1 ~= nil then + glDeleteList(dlistMetalmaker1) + end + dlistMetalmaker1 = glCreateList( function() + + -- background + glColor(0,0,0,0.7) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + local bgpadding = 3*widgetScale + glColor(1,1,1,0.03) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3]-bgpadding, area[4], 5*widgetScale) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(area[1], area[2], area[3], area[4], 'topbar_metalmaker') + end + end) + + if dlistMetalmaker2 ~= nil then + glDeleteList(dlistMetalmaker2) + end + dlistMetalmaker2 = glCreateList( function() + -- icon + local sizeHalf = (height/2.75)*widgetScale + --glTexture(comTexture) + --glTexRect(area[1]+((area[3]-area[1])/2)-sizeHalf, area[2]+((area[4]-area[2])/2)-sizeHalf, area[1]+((area[3]-area[1])/2)+sizeHalf, area[2]+((area[4]-area[2])/2)+sizeHalf) + --glTexture(false) + + -- Text + --local fontSize = (height/2.66)*widgetScale + --glText("\255\200\200\200"..currentMetalmaker, area[1]+((area[3]-area[1])/2), area[2]+((area[4]-area[2])/2.05)-(fontSize/5), fontSize, 'oc') + end) +end + + +local function updateComs(forceText) + local area = comsArea + + if dlistComs1 ~= nil then + glDeleteList(dlistComs1) + end + dlistComs1 = glCreateList( function() + + -- background + glColor(0,0,0,0.7) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + local bgpadding = 3*widgetScale + glColor(1,1,1,0.03) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3]-bgpadding, area[4], 5*widgetScale) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(area[1], area[2], area[3], area[4], 'topbar_coms') + end + end) + + if dlistComs2 ~= nil then + glDeleteList(dlistComs2) + end + dlistComs2 = glCreateList( function() + -- Commander icon + local sizeHalf = (height/2.75)*widgetScale + + glTexture(comTexture) + glTexRect(area[1]+((area[3]-area[1])/2)-sizeHalf, area[2]+((area[4]-area[2])/2)-sizeHalf, area[1]+((area[3]-area[1])/2)+sizeHalf, area[2]+((area[4]-area[2])/2)+sizeHalf) + glTexture(false) + + -- Text + if gameFrame > 0 or forceText then + local fontsize = (height/2.85)*widgetScale + local usedEnemyComs = enemyComs + if spec then + usedEnemyComs = enemyComs + elseif receiveCount then + usedEnemyComs = enemyComCount + else + usedEnemyComs = '?' -- dunno why it was set as 2 here before + end + glText('\255\255\000\000'..usedEnemyComs, area[3]-(2.8*widgetScale), area[2]+(4.5*widgetScale), fontsize, 'or') + + fontSize = (height/2.15)*widgetScale + glText("\255\000\255\000"..allyComs, area[1]+((area[3]-area[1])/2), area[2]+((area[4]-area[2])/2.05)-(fontSize/5), fontSize, 'oc') + end + end) + comcountChanged = nil + + if WG['tooltip'] ~= nil then + WG['tooltip'].AddTooltip('coms', area, "\255\215\255\215Commander Counter\n\255\240\240\240Displays the number of ally\nand enemy commanders") + end +end + + +local function updateWind() + local area = windArea + + local xPos = area[1] + local yPos = area[2] + ((area[4] - area[2])/3.5) + local oorx = 10*widgetScale + local oory = 13*widgetScale + + local bgpadding = 3*widgetScale + + local poleWidth = 6 * widgetScale + local poleHeight = 14 * widgetScale + + if dlistWind1 ~= nil then + glDeleteList(dlistWind1) + end + dlistWind1 = glCreateList( function() + + -- background + glColor(0,0,0,0.7) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + glColor(1,1,1,0.03) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3]-bgpadding, area[4], 5*widgetScale) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(area[1], area[2], area[3], area[4], 'topbar_wind') + end + + glPushMatrix() + glTranslate(xPos, yPos, 0) + glTranslate(11*widgetScale, -((height*widgetScale)/4.4), 0) -- Spacing of icon + glPushMatrix() -- Blades + glTranslate(1*widgetScale, 9*widgetScale, 0) + glTranslate(oorx, oory, 0) + end) + + if dlistWind2 ~= nil then + glDeleteList(dlistWind2) + end + dlistWind2 = glCreateList( function() + glTranslate(-oorx, -oory, 0) + glColor(1,1,1,0.3) + glTexture(bladesTexture) + glTexRect(0, 0, 27*widgetScale, 28*widgetScale) + glTexture(false) + glPopMatrix() + + x,y = 9*widgetScale, 2*widgetScale -- Pole + glTexture(poleTexture) + glTexRect(x, y, (7*widgetScale)+x, y+(18*widgetScale)) + glTexture(false) + glPopMatrix() + + -- min and max wind + local fontsize = (height/3.7)*widgetScale + glText("\255\130\130\130"..minWind, area[3]-(2.8*widgetScale), area[4]-(4.5*widgetScale)-(fontsize/2), fontsize, 'or') + glText("\255\130\130\130"..maxWind, area[3]-(2.8*widgetScale), area[2]+(4.5*widgetScale), fontsize, 'or') + glText("\255\130\130\130"..maxWind, area[3]-(2.8*widgetScale), area[2]+(4.5*widgetScale), fontsize, 'or') + + end) + + if WG['tooltip'] ~= nil then + WG['tooltip'].AddTooltip('wind', area, "\255\215\255\215Wind Display\n\255\240\240\240Displays current wind strength\n\255\240\240\240also minimum ("..minWind..") and maximum ("..maxWind.."\n\255\255\215\215Rather build solars when average\n\255\255\215\215wind is below 5 (arm) or 6 (core)") + end +end + + +local function updateResbarText(res) + if dlistResbar[res][3] ~= nil then + glDeleteList(dlistResbar[res][3]) + end + dlistResbar[res][3] = glCreateList( function() + -- Text: storage + glText("\255\150\150\150"..short(r[res][2]), resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[4], resbarDrawinfo[res].textStorage[5]) + -- Text: pull + glText("\255\210\100\100"..short(r[res][3]), resbarDrawinfo[res].textPull[2], resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[4], resbarDrawinfo[res].textPull[5]) + -- Text: income + glText("\255\100\210\100"..short(r[res][4]), resbarDrawinfo[res].textIncome[2], resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[4], resbarDrawinfo[res].textIncome[5]) + + -- display overflow notification + if not spec and r[res][1] >= r[res][2] and gameFrame > 90 then + if showOverflowTooltip[res] == nil then + showOverflowTooltip[res] = os.clock() + 1.5 + end + if showOverflowTooltip[res] < os.clock() then + local bgpadding = 2*widgetScale + local text = 'Overflowing' + local textWidth = (bgpadding*2) + 15 + (glGetTextWidth(text) * 10) * widgetScale + + -- background + glColor(0.3,0,0,0.55) + RectRound(resbarArea[res][3]-textWidth, resbarArea[res][4]-15.5*widgetScale, resbarArea[res][3], resbarArea[res][4], 4*widgetScale) + glColor(1,0.3,0.3,0.2) + RectRound(resbarArea[res][3]-textWidth+bgpadding, resbarArea[res][4]-15.5*widgetScale+bgpadding, resbarArea[res][3]-bgpadding, resbarArea[res][4]-bgpadding, 3*widgetScale) + + glText("\255\255\222\222"..text, resbarArea[res][3]-5*widgetScale, resbarArea[res][4]-10.5*widgetScale, 10*widgetScale, 'or') + end + else + showOverflowTooltip[res] = nil + end + end) +end + + +local function updateResbar(res) + local area = resbarArea[res] + + if dlistResbar[res][1] ~= nil then + glDeleteList(dlistResbar[res][1]) + glDeleteList(dlistResbar[res][2]) + end + local barHeight = (height*widgetScale/10) + local barHeighPadding = 7*widgetScale --((height/2) * widgetScale) - (barHeight/2) + --local barLeftPadding = 2 * widgetScale + local barLeftPadding = 33 * widgetScale + local barRightPadding = 7 * widgetScale + local barArea = {area[1]+(height*widgetScale)+barLeftPadding, area[2]+barHeighPadding, area[3]-barRightPadding, area[2]+barHeight+barHeighPadding} + local sliderHeightAdd = barHeight / 3.5 + local shareSliderWidth = barHeight + sliderHeightAdd + sliderHeightAdd + local barWidth = barArea[3] - barArea[1] + local glowSize = barHeight * 6 + + if resbarHover ~= nil and resbarHover == res then + sliderHeightAdd = barHeight/1.15 + shareSliderWidth = barHeight + sliderHeightAdd + sliderHeightAdd + end + + if res == 'metal' then + resbarDrawinfo[res].barColor = {1,1,1,1} + else + resbarDrawinfo[res].barColor = {1,1,0,1} + end + resbarDrawinfo[res].barArea = barArea + + resbarDrawinfo[res].barTexRect = {barArea[1], barArea[2], barArea[1]+((r[res][1]/r[res][2]) * barWidth), barArea[4]} + resbarDrawinfo[res].barGlowMiddleTexRect = {resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2] - glowSize, resbarDrawinfo[res].barTexRect[3], resbarDrawinfo[res].barTexRect[4] + glowSize} + resbarDrawinfo[res].barGlowLeftTexRect = {resbarDrawinfo[res].barTexRect[1]-(glowSize*2), resbarDrawinfo[res].barTexRect[2] - glowSize, resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[4] + glowSize} + resbarDrawinfo[res].barGlowRightTexRect = {resbarDrawinfo[res].barTexRect[3]+(glowSize*2), resbarDrawinfo[res].barTexRect[2] - glowSize, resbarDrawinfo[res].barTexRect[3], resbarDrawinfo[res].barTexRect[4] + glowSize} + + resbarDrawinfo[res].textCurrent = {short(r[res][1]), barArea[1]+barWidth/2, barArea[2]+barHeight*2, (height/2.75)*widgetScale, 'ocd'} + resbarDrawinfo[res].textStorage = {"\255\150\150\150"..short(r[res][2]), barArea[3], barArea[2]+barHeight*2, (height/3.2)*widgetScale, 'ord'} + --resbarDrawinfo[res].textPull = {"\255\200\100\100"..short(r[3]), barArea[1]+((barArea[3]-barArea[1])*0.2), barArea[2]+barHeight*2, (height/3.2)*widgetScale, 'od'} + --resbarDrawinfo[res].textIncome = {"\255\100\200\100"..short(r[4]), barArea[1], barArea[2]+barHeight*2, (height/3.2)*widgetScale, 'od'} + resbarDrawinfo[res].textPull = {"\255\210\100\100"..short(r[res][3]), barArea[1]-(7*widgetScale), barArea[2]-barHeight/1.2, (height/3.2)*widgetScale, 'ord'} + resbarDrawinfo[res].textIncome = {"\255\100\210\100"..short(r[res][4]), barArea[1]-(7*widgetScale), barArea[2]+barHeight*2.7, (height/3.2)*widgetScale, 'ord'} + + dlistResbar[res][1] = glCreateList( function() + + -- background + glColor(0,0,0,0.7) + RectRound(area[1], area[2], area[3], area[4], 5.5*widgetScale) + local bgpadding = 3*widgetScale + glColor(1,1,1,0.03) + RectRound(area[1]+bgpadding, area[2]+bgpadding, area[3]-bgpadding, area[4], 5*widgetScale) + + if (WG['guishader'] ~= nil) then + guishaderEnabled = true + WG['guishader'].InsertRect(area[1], area[2], area[3], area[4], 'topbar_'..res) + end + + -- Icon + glColor(1,1,1,1) + local iconPadding = (area[4] - area[2]) / 9 + if res == 'metal' then + glTexture("LuaUI/Images/metal.png") + else + glTexture("LuaUI/Images/energy.png") + end + glTexRect(area[1]+iconPadding, area[2]+iconPadding, area[1]+(height*widgetScale)-iconPadding, area[4]-iconPadding) + glTexture(false) + + -- Bar background + if res == 'metal' then + glColor(0.5,0.5,0.5,0.33) + else + glColor(0.5,0.5,0,0.33) + end + glTexture(barbg) + glTexRect(barArea[1], barArea[2], barArea[3], barArea[4]) + end) + + dlistResbar[res][2] = glCreateList( function() + -- Metalmaker Conversion slider + if showConversionSlider and res == 'energy' then + local convValue = Spring.GetTeamRulesParam(spGetMyTeamID(), 'mmLevel') + if draggingConversionIndicatorValue ~= nil then + convValue = draggingConversionIndicatorValue/100 + end + if convValue == nil then + convValue = 1 + end + conversionIndicatorArea = {barArea[1]+(convValue * barWidth)-(shareSliderWidth/2), barArea[2]-sliderHeightAdd, barArea[1]+(convValue * barWidth)+(shareSliderWidth/2), barArea[4]+sliderHeightAdd} + glTexture(barbg) + if resbarHover ~= nil and resbarHover == res then + local padding = shareSliderWidth/8 + glColor(0.8, 0.8, 0.5, 1) + RectRound(conversionIndicatorArea[1], conversionIndicatorArea[2], conversionIndicatorArea[3], conversionIndicatorArea[4],2.5*widgetScale) + glColor(0.7, 0.7, 0.47, 1) + RectRound(conversionIndicatorArea[1]+padding, conversionIndicatorArea[2]+padding, conversionIndicatorArea[3]-padding, conversionIndicatorArea[4]-padding,2.5*widgetScale) + else + glColor(0.85, 0.85, 0.55, 1) + glTexRect(conversionIndicatorArea[1], conversionIndicatorArea[2], conversionIndicatorArea[3], conversionIndicatorArea[4]) + end + end + -- Share slider + local value = r[res][6] + if draggingShareIndicatorValue[res] ~= nil then + value = draggingShareIndicatorValue[res] + end + shareIndicatorArea[res] = {barArea[1]+(value * barWidth)-(shareSliderWidth/2), barArea[2]-sliderHeightAdd, barArea[1]+(value * barWidth)+(shareSliderWidth/2), barArea[4]+sliderHeightAdd} + glTexture(barbg) + if resbarHover ~= nil and resbarHover == res then + local padding = shareSliderWidth/8 + glColor(0.66, 0, 0, 1) + RectRound(shareIndicatorArea[res][1], shareIndicatorArea[res][2], shareIndicatorArea[res][3], shareIndicatorArea[res][4],2.5*widgetScale) + glColor(0.6, 0, 0, 1) + RectRound(shareIndicatorArea[res][1]+padding, shareIndicatorArea[res][2]+padding, shareIndicatorArea[res][3]-padding, shareIndicatorArea[res][4]-padding,2.5*widgetScale) + else + glColor(0.8, 0, 0, 1) + glTexRect(shareIndicatorArea[res][1], shareIndicatorArea[res][2], shareIndicatorArea[res][3], shareIndicatorArea[res][4]) + end + glTexture(false) + end) + + -- add tooltips + if WG['tooltip'] ~= nil then + if res == 'energy' then + WG['tooltip'].AddTooltip(res..'_share_slider', {resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], conversionIndicatorArea[1], shareIndicatorArea[res][4]}, "\255\215\255\215"..res:sub(1,1):upper()..res:sub(2).." Share Slider\n\255\240\240\240Overflowing to your team when \n"..res.." goes beyond this point") + WG['tooltip'].AddTooltip(res..'_share_slider2', {conversionIndicatorArea[3], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4]}, "\255\215\255\215"..res:sub(1,1):upper()..res:sub(2).." Share Slider\n\255\240\240\240Overflowing to your team when \n"..res.." goes beyond this point") + + WG['tooltip'].AddTooltip(res..'_metalmaker_slider', conversionIndicatorArea, "\255\215\255\215Energy Conversion slider\n\255\240\240\240Excess energy beyond this point will be\nconverted to metal\n(by your Energy Convertor units)") + else + WG['tooltip'].AddTooltip(res..'_share_slider', {resbarDrawinfo[res].barArea[1], shareIndicatorArea[res][2], resbarDrawinfo[res].barArea[3], shareIndicatorArea[res][4]}, "\255\215\255\215"..res:sub(1,1):upper()..res:sub(2).." Share Slider\n\255\240\240\240Overflowing to your team when \n"..res.." goes beyond this point") + end + --WG['tooltip'].AddTooltip(res..'_pull', {resbarDrawinfo[res].textPull[2]-(resbarDrawinfo[res].textPull[4]*0.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2]+(resbarDrawinfo[res].textPull[4]*2), resbarDrawinfo[res].textPull[3]+resbarDrawinfo[res].textPull[4]}, ""..res.." usage") + --WG['tooltip'].AddTooltip(res..'_income', {resbarDrawinfo[res].textIncome[2]-(resbarDrawinfo[res].textIncome[4]*0.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2]+(resbarDrawinfo[res].textIncome[4]*2), resbarDrawinfo[res].textIncome[3]+resbarDrawinfo[res].textIncome[4]}, ""..res.." income") + WG['tooltip'].AddTooltip(res..'_pull', {resbarDrawinfo[res].textPull[2]-(resbarDrawinfo[res].textPull[4]*2.5), resbarDrawinfo[res].textPull[3], resbarDrawinfo[res].textPull[2]+(resbarDrawinfo[res].textPull[4]*0.5), resbarDrawinfo[res].textPull[3]+resbarDrawinfo[res].textPull[4]}, ""..res.." usage") + WG['tooltip'].AddTooltip(res..'_income', {resbarDrawinfo[res].textIncome[2]-(resbarDrawinfo[res].textIncome[4]*2.5), resbarDrawinfo[res].textIncome[3], resbarDrawinfo[res].textIncome[2]+(resbarDrawinfo[res].textIncome[4]*0.5), resbarDrawinfo[res].textIncome[3]+resbarDrawinfo[res].textIncome[4]}, ""..res.." income") + WG['tooltip'].AddTooltip(res..'_storage', {resbarDrawinfo[res].textStorage[2]-(resbarDrawinfo[res].textStorage[4]*2.75), resbarDrawinfo[res].textStorage[3], resbarDrawinfo[res].textStorage[2], resbarDrawinfo[res].textStorage[3]+resbarDrawinfo[res].textStorage[4]}, ""..res.." storage") + WG['tooltip'].AddTooltip(res..'_curent', {resbarDrawinfo[res].textCurrent[2]-(resbarDrawinfo[res].textCurrent[4]*1.75), resbarDrawinfo[res].textCurrent[3], resbarDrawinfo[res].textCurrent[2]+(resbarDrawinfo[res].textCurrent[4]*1.75), resbarDrawinfo[res].textCurrent[3]+resbarDrawinfo[res].textCurrent[4]}, "\255\215\255\215"..string.upper(res).."\n\255\240\240\240Share "..res.." to a specific player by...\n1) Using the (adv)playerlist,\n dragging up the "..res.." icon at the rightside.\n2) An interface brought up with the H key.") + end +end + + +function init() + + r['metal'] = {spGetTeamResources(spGetMyTeamID(),'metal') } + r['energy'] = {spGetTeamResources(spGetMyTeamID(),'energy') } + + topbarArea = {xPos, vsy-(borderPadding*widgetScale)-(height*widgetScale), vsx, vsy} + barContentArea = {xPos+(borderPadding*widgetScale), vsy-(height*widgetScale), vsx, vsy} + + local filledWidth = 0 + local totalWidth = barContentArea[3] - barContentArea[1] + local areaSeparator = (borderPadding*widgetScale) + + if dlistBackground then + glDeleteList(dlistBackground) + end + dlistBackground = glCreateList( function() + + --glColor(0, 0, 0, 0.66) + --RectRound(topbarArea[1], topbarArea[2], topbarArea[3], topbarArea[4], 6*widgetScale) + -- + --glColor(1,1,1,0.025) + --RectRound(barContentArea[1], barContentArea[2], barContentArea[3], barContentArea[4]+(10*widgetScale), 5*widgetScale) + + --if (WG['guishader'] ~= nil) then + -- guishaderEnabled = true3 + -- WG['guishader'].InsertRect(topbarArea[1]+((borderPadding*widgetScale)/2), topbarArea[2], topbarArea[3], topbarArea[4], 'topbar') + --end + end) + + -- metal + --local width = (totalWidth/4) + --resbarArea['metal'] = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + --filledWidth = filledWidth + width + areaSeparator + --updateResbar('metal') + + --energy + --resbarArea['energy'] = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + --filledWidth = filledWidth + width + areaSeparator + --updateResbar('energy') + + -- wind + --width = ((height*1.18)*widgetScale) + --windArea = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + --filledWidth = filledWidth + width + areaSeparator + --updateWind() + + -- metalmaker + --if currentMetalmaker ~= '' then + -- width = ((height*1.18)*widgetScale) + -- metalmakerArea = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + -- filledWidth = filledWidth + width + areaSeparator + -- updateMetalmaker() + --end + + -- coms + --if displayComCounter then + -- comsArea = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + -- filledWidth = filledWidth + width + areaSeparator + -- updateComs() + --end + + -- rejoin + width = (totalWidth/4) / 3.3 + rejoinArea = {barContentArea[1]+filledWidth, barContentArea[2], barContentArea[1]+filledWidth+width, barContentArea[4]} + filledWidth = filledWidth + width + areaSeparator + + -- buttons + width = (totalWidth/4) + buttonsArea = {barContentArea[3]-width, barContentArea[2], barContentArea[3], barContentArea[4]} + filledWidth = filledWidth + width + areaSeparator + updateButtons() + + WG['topbar'].GetPosition = function() + return {topbarArea[1], topbarArea[2], topbarArea[3], topbarArea[4], widgetScale, barContentArea[2]} + end + + --updateResbarText('metal') + --updateResbarText('energy') +end + +function checkStatus() + myAllyTeamID = Spring.GetMyAllyTeamID() + myTeamID = Spring.GetMyTeamID() + myPlayerID = Spring.GetMyPlayerID() +end + + +--function widget:GameStart() +-- gameStarted = true +-- checkStatus() +-- +-- if displayComCounter then +-- countComs() +-- if comsArea[1] ~= nil then +-- updateComs(true) +-- end +-- end +-- +-- -- code for rejoin +-- --local currentTime = os.date("!*t") --ie: clock on "gui_epicmenu.lua" (widget by CarRepairer), UTC & format: http://lua-users.org/wiki/OsLibraryTutorial +-- --local systemSecond = currentTime.hour*3600 + currentTime.min*60 + currentTime.sec +-- --local timestampMsg = "rejnProg " .. systemSecond --currentTime --create a timestamp message +-- --Spring.SendLuaUIMsg(timestampMsg, 's') --this message will remain in server's cache as a LUA message which rejoiner can intercept. Thus allowing the game to leave a clue at game start for latecomer. The latecomer will compare the previous timestamp with present and deduce the catch-up time. +-- --Spring.SendLuaUIMsg(timestampMsg, 'a') --this message will remain in server's cache as a LUA message which rejoiner can intercept. Thus allowing the game to leave a clue at game start for latecomer. The latecomer will compare the previous timestamp with present and deduce the catch-up time. +-- --myTimestamp = systemSecond +--end + + +function widget:GameFrame(n) + spec = spGetSpectatingState() + + --if n == 1 then + -- currentMetalmaker = getCurrentMetalmaker() + -- if currentMetalmaker ~= '' then + -- init() + -- end + --end + + --windRotation = windRotation + (currentWind * bladeSpeedMultiplier) + gameFrame = n + + --functionContainer(n) --function that are able to remove itself. Reference: gui_take_reminder.lua (widget by EvilZerggin, modified by jK) + -- + --if n % 30 == 1 then + -- updateResbarText('metal') + -- updateResbarText('energy') + -- + -- -- metalmaker + -- if currentMetalmaker ~= '' then + -- currentMetalmaker = getCurrentMetalmaker() + -- if dlistMetalmaker3 ~= nil then + -- glDeleteList(dlistMetalmaker3) + -- end + -- dlistMetalmaker3 = glCreateList( function() + -- local fontSize = (height/2.66)*widgetScale + -- glText("\255\200\200\200"..currentMetalmaker, metalmakerArea[1]+((metalmakerArea[3]-metalmakerArea[1])/2), metalmakerArea[2]+((metalmakerArea[4]-metalmakerArea[2])/2.05)-(fontSize/5), fontSize, 'oc') + -- end) + -- if WG['tooltip'] ~= nil then + -- WG['tooltip'].AddTooltip('metalmaker', metalmakerArea, "\255\215\255\215Metalmaker conversion value\nDisplays the number of ......") + -- end + -- end + --end +end + +local sec = 0 +local uiOpacitySec = 0 +function widget:Update(dt) + if chobbyInterface then return end + uiOpacitySec = uiOpacitySec + dt + if uiOpacitySec>0.5 then + uiOpacitySec = 0 + if ui_opacity ~= Spring.GetConfigFloat("ui_opacity",0.66) then + ui_opacity = Spring.GetConfigFloat("ui_opacity",0.66) + updateButtons() + end + end + + local mx,my = spGetMouseState() + + --sec = sec + dt + --if sec>0.33 then + -- sec = 0 + -- r['metal'] = {spGetTeamResources(spGetMyTeamID(),'metal') } + -- r['energy'] = {spGetTeamResources(spGetMyTeamID(),'energy') } + --end + + + now = os.clock() + if now > nextGuishaderCheck then + nextGuishaderCheck = now+guishaderCheckUpdateRate + if guishaderEnabled == false and widgetHandler.orderList["GUI-Shader"] ~= nil and (widgetHandler.orderList["GUI-Shader"] > 0) then + guishaderEnabled = true + init() + elseif guishaderEnabled and widgetHandler.orderList["GUI-Shader"] ~= nil and (widgetHandler.orderList["GUI-Shader"] == 0) then + guishaderEnabled = false + end + end + + --if not spec then + -- if isInBox(mx, my, resbarArea['energy']) then + -- if resbarHover == nil then + -- resbarHover = 'energy' + -- updateResbar('energy') + -- end + -- elseif resbarHover ~= nil and resbarHover == 'energy' then + -- resbarHover = nil + -- updateResbar('energy') + -- end + -- if isInBox(mx, my, resbarArea['metal']) then + -- if resbarHover == nil then + -- resbarHover = 'metal' + -- updateResbar('metal') + -- end + -- elseif resbarHover ~= nil and resbarHover == 'metal' then + -- resbarHover = nil + -- updateResbar('metal') + -- end + --elseif spec and myTeamID ~= spGetMyTeamID() then -- check if the team that we are spectating changed + -- draggingShareIndicatorValue = {} + -- draggingConversionIndicatorValue = nil + -- updateResbar('metal') + -- updateResbar('energy') + --end + + -- wind + --if (gameFrame ~= lastFrame) then + -- currentWind = sformat('%.1f', select(4,spWind())) + --end + + + -- coms + --if displayComCounter then + -- if spec and myTeamID ~= spGetMyTeamID() then -- check if the team that we are spectating changed + -- checkStatus() + -- countComs() + -- end + -- if not spec and receiveCount then -- check if we have received a TeamRulesParam from the gadget part + -- local newEnemyComCount = Spring.GetTeamRulesParam(myTeamID, "enemyComCount") + -- if type(newEnemyComCount) == 'number' then + -- enemyComCount = newEnemyComCount + -- if enemyComCount ~= prevEnemyComCount then + -- comcountChanged = true + -- prevEnemyComCount = enemyComCount + -- end + -- end + -- end + -- if comcountChanged then + -- updateComs() + -- end + --end + + -- rejoin + --if (gameFrame ~= lastFrame) then + -- if showRejoinUI then + -- oneSecondElapsed = oneSecondElapsed + dt + -- if oneSecondElapsed >= 1 then --wait for 1 second period + -- -----var localize----- + -- -----localize + -- + -- local serverFrameNum = serverFrameNum1 or serverFrameNum2 --use FrameNum from GameProgress if available, else use FrameNum derived from LUA_msg. + -- serverFrameNum = serverFrameNum + serverFrameRate*oneSecondElapsed -- estimate Server's frame number after each widget:Update() while waiting for GameProgress() to refresh with actual value. + -- local frameDistanceToFinish = serverFrameNum-gameFrame + -- + -- local myGameFrameRate = (gameFrame - myLastFrameNum) / oneSecondElapsed + -- --Method1: simple average + -- --[[ + -- averageLocalSpeed.sumOfSpeed = averageLocalSpeed.sumOfSpeed + myGameFrameRate -- try to calculate the average of local gameFrame speed. + -- averageLocalSpeed.sumCounter = averageLocalSpeed.sumCounter + 1 + -- myGameFrameRate = averageLocalSpeed.sumOfSpeed/averageLocalSpeed.sumCounter -- using the average to calculate the estimate for time of completion. + -- --]] + -- --Method2: simple moving average + -- myGameFrameRate = SimpleMovingAverage(myGameFrameRate, simpleMovingAverageLocalSpeed) -- get our average frameRate + -- + -- local timeToComplete = frameDistanceToFinish/myGameFrameRate -- estimate the time to completion. + -- local timeToComplete_string = "?/?" + -- + -- local minute, second = math.modf(timeToComplete/60) --second divide by 60sec-per-minute, then saperate result from its remainder + -- second = 60*second --multiply remainder with 60sec-per-minute to get second back. + -- timeToComplete_string = string.format ("Time Remaining: %d:%02d" , minute, second) + -- + -- oneSecondElapsed = 0 + -- myLastFrameNum = gameFrame + -- + -- if serverFrameNum1 then + -- serverFrameNum1 = serverFrameNum --update serverFrameNum1 if value from GameProgress() is used, + -- else + -- serverFrameNum2 = serverFrameNum + -- end --update serverFrameNum2 if value from LuaRecvMsg() is used. + -- + -- end + -- + -- if gameFrame / serverFrameNum1 < 1 then + -- updateRejoin() + -- end + -- end + -- + ----elseif dlistRejoin ~= nil then + ---- glDeleteList(dlistRejoin) + --end + + if (gameFrame ~= lastFrame) then + lastFrame = gameFrame + end +end + +function drawResbarValues(res) + local barWidth = resbarDrawinfo[res].barArea[3] - resbarDrawinfo[res].barArea[1] + local glowSize = (resbarDrawinfo[res].barArea[4] - resbarDrawinfo[res].barArea[2]) * 5.5 + + local cappedCurRes = r[res][1] -- limit so when production dies the value wont be much larger than what you can store + if r[res][1] > r[res][2]*1.07 then + cappedCurRes = r[res][2]*1.07 + end + if res == 'energy' then + glColor(1,1,0, 0.04) + glTexture(glowTexture) + local iconPadding = (resbarArea[res][4] - resbarArea[res][2]) + glTexRect(resbarArea[res][1]+iconPadding, resbarArea[res][2]+iconPadding, resbarArea[res][1]+(height*widgetScale)-iconPadding, resbarArea[res][4]-iconPadding) + end + + -- Bar value + glColor(resbarDrawinfo[res].barColor) + glTexture(barbg) + glTexRect(resbarDrawinfo[res].barTexRect[1], resbarDrawinfo[res].barTexRect[2], resbarDrawinfo[res].barTexRect[1]+((cappedCurRes/r[res][2]) * barWidth), resbarDrawinfo[res].barTexRect[4]) + + -- Bar value glow + glColor(resbarDrawinfo[res].barColor[1], resbarDrawinfo[res].barColor[2], resbarDrawinfo[res].barColor[3], 0.09) + glTexture(barGlowCenterTexture) + glTexRect(resbarDrawinfo[res].barGlowMiddleTexRect[1], resbarDrawinfo[res].barGlowMiddleTexRect[2], resbarDrawinfo[res].barGlowMiddleTexRect[1] + ((cappedCurRes/r[res][2]) * barWidth), resbarDrawinfo[res].barGlowMiddleTexRect[4]) + glTexture(barGlowEdgeTexture) + glTexRect(resbarDrawinfo[res].barGlowLeftTexRect[1], resbarDrawinfo[res].barGlowLeftTexRect[2], resbarDrawinfo[res].barGlowLeftTexRect[3], resbarDrawinfo[res].barGlowLeftTexRect[4]) + glTexRect((resbarDrawinfo[res].barGlowMiddleTexRect[1]+((cappedCurRes/r[res][2]) * barWidth))+(glowSize*2), resbarDrawinfo[res].barGlowRightTexRect[2], resbarDrawinfo[res].barGlowMiddleTexRect[1]+((cappedCurRes/r[res][2]) * barWidth), resbarDrawinfo[res].barGlowRightTexRect[4]) + + currentResValue[res] = short(cappedCurRes) + if currentResCap[res] ~= r[res][2] then + currentResCap[res] = r[res][2] + for n,_ in pairs(dlistResValues[res]) do + glDeleteList(dlistResValues[res][n]) + end + dlistResValues[res] = {} + end + if not dlistResValues[res][currentResValue[res]] then + dlistResValues[res][currentResValue[res]] = glCreateList( function() + -- Text: current + glColor(1, 1, 1, 1) + glText(currentResValue[res], resbarDrawinfo[res].textCurrent[2], resbarDrawinfo[res].textCurrent[3], resbarDrawinfo[res].textCurrent[4], resbarDrawinfo[res].textCurrent[5]) + end) + end + glCallList(dlistResValues[res][currentResValue[res]]) +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + local now = os.clock() + + glPushMatrix() + if dlistBackground then + glCallList(dlistBackground) + end + + local x,y,b = spGetMouseState() + + --local res = 'metal' + --if dlistResbar[res][1] and dlistResbar[res][2] and dlistResbar[res][3] then + -- glCallList(dlistResbar[res][1]) + -- drawResbarValues(res) + -- glCallList(dlistResbar[res][3]) + -- glCallList(dlistResbar[res][2]) + -- --if showOverflowTooltip[res] ~= nil and showOverflowTooltip[res] < now then + -- -- local text = 'Overflowing' + -- -- local textWidth = (8*2.66) + (glGetTextWidth(text) * 13) * widgetScale + -- -- WG['tooltip'].ShowTooltip(res..'_overflow_warning', text, resbarDrawinfo[res].barTexRect[3]+(8*widgetScale)-textWidth, resbarDrawinfo[res].barTexRect[4]-(24*widgetScale)) + -- --end + --end + --res = 'energy' + --if dlistResbar[res][1] and dlistResbar[res][2] and dlistResbar[res][3] then + -- glCallList(dlistResbar[res][1]) + -- drawResbarValues(res) + -- glCallList(dlistResbar[res][3]) + -- glCallList(dlistResbar[res][2]) + -- --if showOverflowTooltip[res] ~= nil and showOverflowTooltip[res] < now then + -- -- local text = 'Overflowing' + -- -- local textWidth = (8*2.66) + (glGetTextWidth(text) * 13) * widgetScale + -- -- WG['tooltip'].ShowTooltip(res..'_overflow_warning', text, resbarDrawinfo[res].barTexRect[3]+(8*widgetScale)-textWidth, resbarDrawinfo[res].barTexRect[4]-(24*widgetScale)) + -- --end + --end + -- + --if dlistWind1 then + -- glPushMatrix() + -- glCallList(dlistWind1) + -- glRotate(windRotation, 0, 0, 1) + -- glCallList(dlistWind2) + -- glPopMatrix() + -- -- current wind + -- if gameFrame > 0 then + -- local fontSize = (height/2.66)*widgetScale + -- if not dlistWindText[currentWind] then + -- dlistWindText[currentWind] = glCreateList( function() + -- glText("\255\255\255\255"..currentWind, windArea[1]+((windArea[3]-windArea[1])/2), windArea[2]+((windArea[4]-windArea[2])/2.05)-(fontSize/5), fontSize, 'oc') -- Wind speed text + -- end) + -- end + -- glCallList(dlistWindText[currentWind]) + -- else + -- if now < 30 and WG['tooltip'] ~= nil then + -- if (minWind + maxWind)/2 < 5.5 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Wind isnt worth', windArea[1], windArea[2]-13*widgetScale) + -- elseif (minWind + maxWind)/2 >= 5.5 and (minWind + maxWind)/2 < 7 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Wind is viable', windArea[1], windArea[2]-13*widgetScale) + -- elseif (minWind + maxWind)/2 >= 7 and (minWind + maxWind)/2 < 8.5 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Average wind is okay', windArea[1], windArea[2]-13*widgetScale) + -- elseif (minWind + maxWind)/2 >= 8.5 and (minWind + maxWind)/2 < 10 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Average wind is good', windArea[1], windArea[2]-13*widgetScale) + -- elseif (minWind + maxWind)/2 >= 10 and (minWind + maxWind)/2 < 15 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Average wind is really good', windArea[1], windArea[2]-13*widgetScale) + -- elseif (minWind + maxWind)/2 >= 15 then + -- WG['tooltip'].ShowTooltip('topbar_windinfo', 'Wind is insanely good', windArea[1], windArea[2]-13*widgetScale) + -- end + -- end + -- end + --end + --if currentMetalmaker ~= '' and dlistMetalmaker1 and dlistMetalmaker2 and dlistMetalmaker3 then + -- glCallList(dlistMetalmaker1) + -- glCallList(dlistMetalmaker2) + -- glCallList(dlistMetalmaker3) + --end + -- + --if displayComCounter and dlistComs1 then + -- glCallList(dlistComs1) + -- if allyComs == 1 and (gameFrame % 12 < 6) then + -- glColor(1,0.6,0,0.6) + -- else + -- glColor(1,1,1,0.3) + -- end + -- glCallList(dlistComs2) + --end + -- + --if dlistRejoin and showRejoinUI then + -- glCallList(dlistRejoin) + --elseif dlistRejoin ~= nil then + -- if dlistRejoin ~= nil then + -- glDeleteList(dlistRejoin) + -- dlistRejoin = nil + -- end + -- if WG['guishader'] ~= nil then + -- WG['guishader'].RemoveRect('topbar_rejoin') + -- end + -- if WG['tooltip'] ~= nil then + -- WG['tooltip'].RemoveTooltip('rejoin') + -- end + --end + + if dlistButtons1 then + glCallList(dlistButtons1) + -- hovered? + if not showQuitscreen and buttonsArea['buttons'] ~= nil and IsOnRect(x, y, buttonsArea[1], buttonsArea[2], buttonsArea[3], buttonsArea[4]) then + buttonsAreaHovered = nil + for button, pos in pairs(buttonsArea['buttons']) do + if IsOnRect(x, y, pos[1], pos[2], pos[3], pos[4]) then + if b then + glColor(1,1,1,0.32) + else + glColor(1,1,1,0.25) + end + RectRound(buttonsArea['buttons'][button][1], buttonsArea['buttons'][button][2], buttonsArea['buttons'][button][3], buttonsArea['buttons'][button][4], 3.5*widgetScale) + break + end + end + end + glCallList(dlistButtons2) + end + + if dlistQuit ~= nil then + if WG['guishader'] then + WG['guishader'].removeRenderDlist(dlistQuit) + end + glDeleteList(dlistQuit) + dlistQuit = nil + end + if showQuitscreen ~= nil then + local fadeoutBonus = 0 + local fadeTime = 0.2 + local fadeProgress = (now - showQuitscreen) / fadeTime + if fadeProgress > 1 then fadeProgress = 1 end + + Spring.SetMouseCursor('cursornormal') + + dlistQuit = glCreateList( function() + if WG['guishader'] then + glColor(0,0,0,(0.18*fadeProgress)) + else + glColor(0,0,0,(0.35*fadeProgress)) + end + glRect( 0, 0, vsx, vsy) + + if hideQuitWindow == nil then -- when terminating spring, keep the faded screen + + local width = vsx/5.8 + local height = width/3.5 + local padding = width/70 + local buttonPadding = width/100 + local buttonMargin = width/32 + local buttonHeight = height*0.55 + + quitscreenArea = {(vsx/2)-(width/2), (vsy/1.8)-(height/2), (vsx/2)+(width/2), (vsy/1.8)+(height/2)} + quitscreenResignArea = {(vsx/2)-(width/2)+buttonMargin, (vsy/1.8)-(height/2)+buttonMargin, (vsx/2)-(buttonMargin/2), (vsy/1.8)-(height/2)+buttonHeight-buttonMargin} + quitscreenQuitArea = {(vsx/2)+(buttonMargin/2), (vsy/1.8)-(height/2)+buttonMargin, (vsx/2)+(width/2)-buttonMargin, (vsy/1.8)-(height/2)+buttonHeight-buttonMargin} + + -- window + glColor(1,1,1,0.5+(0.36*fadeProgress)) + RectRound(quitscreenArea[1], quitscreenArea[2], quitscreenArea[3], quitscreenArea[4], 5.5*widgetScale) + glColor(0,0,0,0.035+(0.035*fadeProgress)) + RectRound(quitscreenArea[1]+padding, quitscreenArea[2]+padding, quitscreenArea[3]-padding, quitscreenArea[4]-padding, padding) + + local fontSize = height/6 + font:Begin() + font:SetTextColor(0,0,0,1) + if not spec then + font:Print("Want to resign or quit to desktop?", quitscreenArea[1]+((quitscreenArea[3]-quitscreenArea[1])/2), quitscreenArea[4]-padding-padding-padding-fontSize, fontSize, "cn") + else + font:Print("Really want to quit?", quitscreenArea[1]+((quitscreenArea[3]-quitscreenArea[1])/2), quitscreenArea[4]-padding-padding-padding-padding-fontSize, fontSize, "cn") + end + + -- quit button + if IsOnRect(x, y, quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4]) then + glColor(0.66,0.05,0.05,0.4+(0.5*fadeProgress)) + else + glColor(0.45,0,0,0.35+(0.4*fadeProgress)) + end + RectRound(quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4], 3.5*widgetScale) + glColor(0,0,0,0.07+(0.05*fadeProgress)) + RectRound(quitscreenQuitArea[1]+buttonPadding, quitscreenQuitArea[2]+buttonPadding, quitscreenQuitArea[3]-buttonPadding, quitscreenQuitArea[4]-buttonPadding, 2.8*widgetScale) + font:End() + + fontSize = fontSize*0.9 + font2:Begin() + font2:SetTextColor(1,1,1,1) + font2:SetOutlineColor(0,0,0,0.23) + font2:Print("Quit", quitscreenQuitArea[1]+((quitscreenQuitArea[3]-quitscreenQuitArea[1])/2), quitscreenQuitArea[2]+((quitscreenQuitArea[4]-quitscreenQuitArea[2])/2)-(fontSize/3), fontSize, "con") + + -- resign button + if not spec then + if IsOnRect(x, y, quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4]) then + glColor(0.55,0.55,0.55,0.4+(0.5*fadeProgress)) + else + glColor(0.3,0.3,0.3,0.4+(0.4*fadeProgress)) + end + RectRound(quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4], 3.5*widgetScale) + glColor(0,0,0,0.07+(0.05*fadeProgress)) + RectRound(quitscreenResignArea[1]+buttonPadding, quitscreenResignArea[2]+buttonPadding, quitscreenResignArea[3]-buttonPadding, quitscreenResignArea[4]-buttonPadding, 2.8*widgetScale) + + font2:Print("Resign", quitscreenResignArea[1]+((quitscreenResignArea[3]-quitscreenResignArea[1])/2), quitscreenResignArea[2]+((quitscreenResignArea[4]-quitscreenResignArea[2])/2)-(fontSize/3), fontSize, "con") + end + font2:End() + end + end) + + -- background + if WG['guishader'] then + WG['guishader'].setScreenBlur(true) + WG['guishader'].insertRenderDlist(dlistQuit) + else + glCallList(dlistQuit) + end + end + glColor(1,1,1,1) + glPopMatrix() +end + + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY +end + + +local function adjustSliders(x, y) + if draggingShareIndicator ~= nil and not spec then + local shareValue = (x - resbarDrawinfo[draggingShareIndicator]['barArea'][1]) / (resbarDrawinfo[draggingShareIndicator]['barArea'][3] - resbarDrawinfo[draggingShareIndicator]['barArea'][1]) + if shareValue < 0 then shareValue = 0 end + if shareValue > 1 then shareValue = 1 end + Spring.SetShareLevel(draggingShareIndicator, shareValue) + draggingShareIndicatorValue[draggingShareIndicator] = shareValue + updateResbar(draggingShareIndicator) + end + if showConversionSlider and draggingConversionIndicator and not spec then + local convValue = math.floor((x - resbarDrawinfo['energy']['barArea'][1]) / (resbarDrawinfo['energy']['barArea'][3] - resbarDrawinfo['energy']['barArea'][1]) * 100) + if convValue < 12 then convValue = 12 end + if convValue > 88 then convValue = 88 end + Spring.SendLuaRulesMsg(sformat(string.char(137)..'%i', convValue)) + draggingConversionIndicatorValue = convValue + updateResbar('energy') + end +end + +--function widget:MouseMove(x, y) +-- adjustSliders(x, y) +--end + + +local function hideWindows() + if (WG['options'] ~= nil) then + WG['options'].toggle(false) + end + if (WG['changelog'] ~= nil) then + WG['changelog'].toggle(false) + end + if (WG['keybinds'] ~= nil) then + WG['keybinds'].toggle(false) + end + if (WG['commands'] ~= nil) then + WG['commands'].toggle(false) + end + if (WG['gameinfo'] ~= nil) then + WG['gameinfo'].toggle(false) + end + if (WG['teamstats'] ~= nil) then + WG['teamstats'].toggle(false) + end + showQuitscreen = nil + if WG['guishader'] then + WG['guishader'].setScreenBlur(false) + end +end + +local function applyButtonAction(button) + + if playSounds then + Spring.PlaySoundFile(leftclick, 0.8, 'ui') + end + + local isvisible = false + if button == 'quit' then + if chobbyLoaded then + Spring.SendLuaMenuMsg("showLobby") + else + local oldShowQuitscreen + if showQuitscreen ~= nil then + oldShowQuitscreen = showQuitscreen + isvisible = true + end + hideWindows() + if oldShowQuitscreen ~= nil then + if isvisible ~= true then + showQuitscreen = oldShowQuitscreen + if WG['guishader'] then + WG['guishader'].setScreenBlur(true) + end + end + else + showQuitscreen = os.clock() + end + end + elseif button == 'options' then + if (WG['options'] ~= nil) then + isvisible = WG['options'].isvisible() + end + hideWindows() + if (WG['options'] ~= nil and isvisible ~= true) then + WG['options'].toggle() + end + elseif button == 'changelog' then + if (WG['changelog'] ~= nil) then + isvisible = WG['changelog'].isvisible() + end + hideWindows() + if (WG['changelog'] ~= nil and isvisible ~= true) then + WG['changelog'].toggle() + end + elseif button == 'keybinds' then + if (WG['keybinds'] ~= nil) then + isvisible = WG['keybinds'].isvisible() + end + hideWindows() + if (WG['keybinds'] ~= nil and isvisible ~= true) then + WG['keybinds'].toggle() + end + elseif button == 'commands' then + if (WG['commands'] ~= nil) then + isvisible = WG['commands'].isvisible() + end + hideWindows() + if (WG['commands'] ~= nil and isvisible ~= true) then + WG['commands'].toggle() + end + elseif button == 'stats' then + if (WG['teamstats'] ~= nil) then + isvisible = WG['teamstats'].isvisible() + end + hideWindows() + if (WG['teamstats'] ~= nil and isvisible ~= true) then + WG['teamstats'].toggle() + end + end +end + +function widget:MouseWheel(up,value) --up = true/false , value = -1/1 + if showQuitscreen ~= nil and quitscreenArea ~= nil then + return true + end +end + +function widget:KeyPress(key) + if key == 27 then -- ESC + hideWindows() + end + if showQuitscreen ~= nil and quitscreenArea ~= nil then + return true + end +end + +function widget:MousePress(x, y, button) + if button == 1 then + --if not spec then + -- if IsOnRect(x, y, shareIndicatorArea['metal'][1], shareIndicatorArea['metal'][2], shareIndicatorArea['metal'][3], shareIndicatorArea['metal'][4]) then + -- draggingShareIndicator = 'metal' + -- end + -- if IsOnRect(x, y, resbarDrawinfo['metal'].barArea[1], shareIndicatorArea['metal'][2], resbarDrawinfo['metal'].barArea[3], shareIndicatorArea['metal'][4]) then + -- draggingShareIndicator = 'metal' + -- adjustSliders(x, y) + -- end + -- if IsOnRect(x, y, shareIndicatorArea['energy'][1], shareIndicatorArea['energy'][2], shareIndicatorArea['energy'][3], shareIndicatorArea['energy'][4]) then + -- draggingShareIndicator = 'energy' + -- end + -- if draggingShareIndicator == nil and showConversionSlider and IsOnRect(x, y, conversionIndicatorArea[1], conversionIndicatorArea[2], conversionIndicatorArea[3], conversionIndicatorArea[4]) then + -- draggingConversionIndicator = true + -- end + -- if draggingConversionIndicator == nil and IsOnRect(x, y, resbarDrawinfo['energy'].barArea[1], shareIndicatorArea['energy'][2], resbarDrawinfo['energy'].barArea[3], shareIndicatorArea['energy'][4]) then + -- draggingShareIndicator = 'energy' + -- adjustSliders(x, y) + -- end + -- if draggingShareIndicator or draggingConversionIndicator then + -- if playSounds then + -- Spring.PlaySoundFile(resourceclick, 0.7, 'ui') + -- end + -- return true + -- end + --end + + if buttonsArea['buttons'] ~= nil then + for button, pos in pairs(buttonsArea['buttons']) do + if IsOnRect(x, y, pos[1], pos[2], pos[3], pos[4]) then + applyButtonAction(button) + return true + end + end + end + + if showQuitscreen ~= nil and quitscreenArea ~= nil then + + if IsOnRect(x, y, quitscreenArea[1], quitscreenArea[2], quitscreenArea[3], quitscreenArea[4]) then + + if IsOnRect(x, y, quitscreenQuitArea[1], quitscreenQuitArea[2], quitscreenQuitArea[3], quitscreenQuitArea[4]) then + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, 'ui') + end + Spring.SendCommands("QuitForce") + showQuitscreen = nil + hideQuitWindow = os.clock() + return true + end + if not spec and IsOnRect(x, y, quitscreenResignArea[1], quitscreenResignArea[2], quitscreenResignArea[3], quitscreenResignArea[4]) then + if playSounds then + Spring.PlaySoundFile(leftclick, 0.75, 'ui') + end + Spring.SendCommands("spectator") + showQuitscreen = nil + if WG['guishader'] then + WG['guishader'].setScreenBlur(false) + end + return true + end + return true + else + showQuitscreen = nil + if WG['guishader'] then + WG['guishader'].setScreenBlur(false) + end + return true + end + + return true + end + else + if showQuitscreen ~= nil and quitscreenArea ~= nil then + return true + end + end +end + +--function widget:MouseRelease(x, y, button) +-- if showQuitscreen ~= nil and quitscreenArea ~= nil then +-- return true +-- end +-- if draggingShareIndicator ~= nil then +-- adjustSliders(x, y) +-- draggingShareIndicator = nil +-- end +-- if draggingConversionIndicator ~= nil then +-- adjustSliders(x, y) +-- draggingConversionIndicator = nil +-- end +-- +-- --if button == 1 then +-- -- if buttonsArea['buttons'] ~= nil then -- reapply again because else the other widgets disable when there is a click outside of their window +-- -- for button, pos in pairs(buttonsArea['buttons']) do +-- -- if IsOnRect(x, y, pos[1], pos[2], pos[3], pos[4]) then +-- -- applyButtonAction(button) +-- -- end +-- -- end +-- -- end +-- --end +--end + +function widget:PlayerChanged() + spec = spGetSpectatingState() + checkStatus() + --if displayComCounter then + -- countComs() + --end + --if spec then + -- resbarHover = nil + --end +end + + +function isCom(unitID,unitDefID) + if not unitDefID and unitID then + unitDefID = Spring.GetUnitDefID(unitID) + end + if not unitDefID or not UnitDefs[unitDefID] or not UnitDefs[unitDefID].customParams then + return false + end + return UnitDefs[unitDefID].customParams.iscommander ~= nil +end + + +function countComs() + -- recount my own ally team coms + local prevAllyComs = allyComs + local prevEnemyComs = enemyComs + allyComs = 0 + local myAllyTeamList = Spring.GetTeamList(myAllyTeamID) + for _,teamID in ipairs(myAllyTeamList) do + allyComs = allyComs + Spring.GetTeamUnitDefCount(teamID, armcomDefID) + Spring.GetTeamUnitDefCount(teamID, corcomDefID) + end + comcountChanged = true + + if spec then + -- recount enemy coms + enemyComs = 0 + local allyTeamList = Spring.GetAllyTeamList() + for _,allyTeamID in ipairs(allyTeamList) do + if allyTeamID ~= myAllyTeamID then + local teamList = Spring.GetTeamList(allyTeamID) + for _,teamID in ipairs(teamList) do + enemyComs = enemyComs + Spring.GetTeamUnitDefCount(teamID, armcomDefID) + Spring.GetTeamUnitDefCount(teamID, corcomDefID) + end + end + end + end + + if allyComs ~= prevAllyComs or enemyComs ~= prevEnemyComs then + comcountChanged = true + end +end + +--function widget:UnitCreated(unitID, unitDefID, unitTeam) +-- if not isCom(unitID,unitDefID) then +-- return +-- end +-- --record com created +-- local _,_,_,_,_,allyTeamID = Spring.GetTeamInfo(unitTeam) +-- if allyTeamID == myAllyTeamID then +-- allyComs = allyComs + 1 +-- elseif spec then +-- enemyComs = enemyComs + 1 +-- end +-- comcountChanged = true +--end +-- +--function widget:UnitDestroyed(unitID, unitDefID, unitTeam) +-- if not isCom(unitID,unitDefID) then +-- return +-- end +-- --record com died +-- local _,_,_,_,_,allyTeamID = Spring.GetTeamInfo(unitTeam) +-- if allyTeamID == myAllyTeamID then +-- allyComs = allyComs - 1 +-- elseif spec then +-- enemyComs = enemyComs - 1 +-- end +-- comcountChanged = true +--end + + + +-- used for rejoin progress functionality +local function ActivateGUI_n_TTS (frameDistanceToFinish, ui_active, altThreshold) + if frameDistanceToFinish >= (altThreshold or 120) then + if not ui_active then + ui_active = true + end + elseif frameDistanceToFinish < (altThreshold or 120) then + if ui_active then + ui_active = false + end + end + return ui_active +end + +-- used for rejoin progress functionality +--function widget:GameProgress(serverFrameNum) --this function run 3rd. It read the official serverFrameNumber +-- local ui_active = showRejoinUI +-- +-- local frameDistanceToFinish = serverFrameNum-gameFrame +-- ui_active = ActivateGUI_n_TTS (frameDistanceToFinish, ui_active) +-- +-- serverFrameNum1 = serverFrameNum +-- showRejoinUI = ui_active +-- gameProgressActive = true +--end +-- +---- used for rejoin progress functionality +--function widget:RecvLuaMsg(bigMsg, playerID) --this function run 2nd. It read the LUA timestamp +-- +-- if gameProgressActive or isReplay then --skip LUA message if gameProgress is already active OR game is a replay +-- return false +-- end +-- +-- local myMsg = (playerID == myPlayerID) +-- if (myMsg or spec) then +-- if bigMsg:sub(1,9) == "rejnProg " then --check for identifier +-- -----var localize----- +-- local ui_active = showRejoinUI +-- -----localize +-- +-- local timeMsg = bigMsg:sub(10) --saperate time-message from the identifier +-- local systemSecond = tonumber(timeMsg) +-- --Spring.Echo(systemSecond .. " B") +-- submittedTimestamp[#submittedTimestamp +1] = systemSecond --store all submitted timestamp from each players +-- local sumSecond= 0 +-- for i=1, #submittedTimestamp,1 do +-- sumSecond = sumSecond + submittedTimestamp[i] +-- end +-- --Spring.Echo(sumSecond .. " C") +-- local avgSecond = sumSecond/#submittedTimestamp +-- --Spring.Echo(avgSecond .. " D") +-- local secondDiff = myTimestamp - avgSecond +-- --Spring.Echo(secondDiff .. " E") +-- local frameDiff = secondDiff*30 +-- +-- serverFrameNum2 = frameDiff --this value represent the estimate difference in frame when everyone was submitting their timestamp at game start. Therefore the difference in frame will represent how much frame current player are ahead of us. +-- ui_active = ActivateGUI_n_TTS (frameDiff, ui_active, 1800) +-- +-- -----return +-- showRejoinUI = ui_active +-- end +-- end +--end + + +function getCurrentMetalmaker() + local value = Spring.GetTeamRulesParam(myTeamID, "MMFactor") + if value == nil then + return '' + else + value = value*0.5 + end + + local decimalValue, floatValue = math.modf(value) + if floatValue ~= 0 then + value = string.format("%."..string.len(string.sub('0.00', 3)).."f", value) -- do rounding via a string because floats show rounding errors at times + end + return value +end + + +-- used for rejoin progress functionality +local function RemoveLUARecvMsg(n) + if n > 150 then + isReplay = nil + --widgetHandler:RemoveCallIn("RecvLuaMsg") --remove unused method for increase efficiency after frame> timestampLimit (150frame or 5 second). + functionContainer = function(x) end --replace this function with an empty function/method + end +end + +-- used for rejoin progress functionality +function SimpleMovingAverage(myGameFrameRate, simpleMovingAverageLocalSpeed) + --//remember current frameRate, and advance table index by 1 + local index = (simpleMovingAverageLocalSpeed.index) --retrieve current index. + simpleMovingAverageLocalSpeed.storage[index] = myGameFrameRate --remember current frameRate at current index. + simpleMovingAverageLocalSpeed.index = simpleMovingAverageLocalSpeed.index +1 --advance index by 1. + --//wrap table index around. Create a circle + local poolingSize = 10 --//number of sample. note: simpleMovingAverage() is executed every second, so the value represent an average spanning 10 second. + if (simpleMovingAverageLocalSpeed.index == (poolingSize + 2)) then --when table out-of-bound: + simpleMovingAverageLocalSpeed.index = 1 --wrap the table index around (create a circle of 150 + 1 (ie: poolingSize plus 1 space) entry). + end + --//update averages + index = (simpleMovingAverageLocalSpeed.index) --retrieve an index advanced by 1. + local oldAverage = (simpleMovingAverageLocalSpeed.storage[index] or defaultAverage) --retrieve old average or use initial/default average as old average. + simpleMovingAverageLocalSpeed.runningAverage = simpleMovingAverageLocalSpeed.runningAverage + myGameFrameRate/poolingSize - oldAverage/poolingSize --calculate average: add new value, remove old value. Ref: http://en.wikipedia.org/wiki/Moving_average#Simple_moving_average + local avgGameFrameRate = simpleMovingAverageLocalSpeed.runningAverage -- replace myGameFrameRate with its average value. + + return avgGameFrameRate, simpleMovingAverageLocalSpeed +end + + +--function widget:GameProgress(serverFrameNum) --this function run 3rd. It read the official serverFrameNumber +-- local ui_active = showRejoinUI +-- +-- serverFrameNum1 = serverFrameNum +-- local frameDistanceToFinish = serverFrameNum-gameFrame +-- ui_active = ActivateGUI_n_TTS (frameDistanceToFinish, ui_active) +-- +-- showRejoinUI = ui_active +-- gameProgressActive = true +--end + + +function widget:Initialize() + gameFrame = Spring.GetGameFrame() + --Spring.SendCommands("resbar 0") + + -- determine if we want to show comcounter + --local allteams = Spring.GetTeamList() + --local teamN = table.maxn(allteams) - 1 --remove gaia + --if teamN > 2 then + -- displayComCounter = true + --end + -- + --if displayComCounter and gameFrame > 0 then + -- countComs() + --end + -- + --if gameFrame > 0 then + -- widget:GameStart() + --end + + -- used for rejoin progress functionality + --functionContainer = RemoveLUARecvMsg + + --currentMetalmaker = getCurrentMetalmaker() + + WG['topbar'] = {} + WG['topbar'].showingRejoining = function() + return showRejoinUI + end + WG['topbar'].showingQuit = function() + return showQuitscreen + end + + init() +end + +function widget:Shutdown() + --Spring.SendCommands("resbar 1") + if dlistBackground ~= nil then + --glDeleteList(dlistBackground) + --glDeleteList(dlistResbar['metal'][1]) + --glDeleteList(dlistResbar['metal'][2]) + --glDeleteList(dlistResbar['metal'][3]) + --glDeleteList(dlistResbar['energy'][1]) + --glDeleteList(dlistResbar['energy'][2]) + --glDeleteList(dlistResbar['energy'][3]) + --glDeleteList(dlistWind1) + --glDeleteList(dlistWind2) + --glDeleteList(dlistComs1) + --glDeleteList(dlistComs2) + glDeleteList(dlistButtons1) + glDeleteList(dlistButtons2) + --glDeleteList(dlistRejoin) + --if dlistMetalmaker1 then + -- glDeleteList(dlistMetalmaker1) + -- glDeleteList(dlistMetalmaker2) + --end + -- + --for n,_ in pairs(dlistWindText) do + -- glDeleteList(dlistWindText[n]) + --end + --for n,_ in pairs(dlistResValues['metal']) do + -- glDeleteList(dlistResValues['metal'][n]) + --end + --for n,_ in pairs(dlistResValues['energy']) do + -- glDeleteList(dlistResValues['energy'][n]) + --end + end + gl.DeleteFont(font) + gl.DeleteFont(font2) + if WG['guishader'] then + --WG['guishader'].RemoveDlist('topbar_energy') + --WG['guishader'].RemoveDlist('topbar_metal') + --WG['guishader'].RemoveDlist('topbar_wind') + --WG['guishader'].RemoveDlist('topbar_coms') + WG['guishader'].RemoveDlist('topbar_buttons') + --WG['guishader'].RemoveDlist('topbar_rejoin') + end + --if WG['tooltip'] ~= nil then + -- WG['tooltip'].RemoveTooltip('coms') + -- WG['tooltip'].RemoveTooltip('wind') + -- WG['tooltip'].RemoveTooltip('metalmaker') + -- WG['tooltip'].RemoveTooltip('rejoin') + -- local res = 'energy' + -- WG['tooltip'].RemoveTooltip(res..'_share_slider') + -- WG['tooltip'].RemoveTooltip(res..'_share_slider2') + -- WG['tooltip'].RemoveTooltip(res..'_metalmaker_slider') + -- WG['tooltip'].RemoveTooltip(res..'_pull') + -- WG['tooltip'].RemoveTooltip(res..'_income') + -- WG['tooltip'].RemoveTooltip(res..'_storage') + -- WG['tooltip'].RemoveTooltip(res..'_curent') + -- res = 'metal' + -- WG['tooltip'].RemoveTooltip(res..'_share_slider') + -- WG['tooltip'].RemoveTooltip(res..'_share_slider2') + -- WG['tooltip'].RemoveTooltip(res..'_pull') + -- WG['tooltip'].RemoveTooltip(res..'_income') + -- WG['tooltip'].RemoveTooltip(res..'_storage') + -- WG['tooltip'].RemoveTooltip(res..'_curent') + --end + WG['topbar'] = nil +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_unit_stats.lua b/LuaUI/Widgets_Evo/gui_unit_stats.lua new file mode 100644 index 000000000..1b19429d3 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_unit_stats.lua @@ -0,0 +1,863 @@ + +function widget:GetInfo() + return { + name = "Unit Stats", + desc = "Shows detailed unit stats", + author = "Niobium", + date = "Jan 11, 2009", + version = 1.3, + license = "GNU GPL, v2 or later", + layer = -9999999999, + enabled = true, -- loaded by default? + } +end + +include("keysym.h.lua") + +---- v1.3 changes +-- Fix for 87.0 +-- Added display of experience effect (when experience >25%) + +---- v1.2 changes +-- Fixed drains for burst weapons (Removed 0.125 minimum) +-- Show remaining costs for units under construction + +---- v1.1 changes +-- Added extra text to help explain numbers +-- Added grouping of duplicate weapons +-- Added sonar radius +-- Fixed radar/jammer detection +-- Fixed stockpiling unit drains +-- Fixed turnrate/acceleration scale +-- Fixed very low reload times + +------------------------------------------------------------------------------------ +-- Globals +------------------------------------------------------------------------------------ +local fontSize = 13 +local useSelection = true + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local customFontSize = 13 + +local bgcornerSize = fontSize*0.45 +local bgpadding = fontSize*0.9 + +local cX, cY, cYstart + +local vsx, vsy = gl.GetViewSizes() +local widgetScale = (0.60 + (vsx*vsy / 5000000)) +local xOffset = (32 + (fontSize*0.9))*widgetScale +local yOffset = -((32 - (fontSize*0.9))*widgetScale) + +------------------------------------------------------------------------------------ +-- Speedups +------------------------------------------------------------------------------------ + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local white = '\255\255\255\255' +local grey = '\255\190\190\190' +local green = '\255\1\255\1' +local yellow = '\255\255\255\1' +local orange = '\255\255\128\1' +local blue = '\255\128\128\255' + +local metalColor = '\255\196\196\255' -- Light blue +local energyColor = '\255\255\255\128' -- Light yellow +local buildColor = '\255\128\255\128' -- Light green + +local simSpeed = Game.gameSpeed + +local max = math.max +local floor = math.floor +local ceil = math.ceil +local format = string.format +local char = string.char + +local glColor = gl.Color +local glText = gl.Text +local glTexture = gl.Texture +local glRect = gl.Rect +local glTexRect = gl.TexRect + +local spGetMyTeamID = Spring.GetMyTeamID +local spGetTeamResources = Spring.GetTeamResources +local spGetTeamInfo = Spring.GetTeamInfo +local spGetPlayerInfo = Spring.GetPlayerInfo +local spGetTeamColor = Spring.GetTeamColor +local spIsUserWriting = Spring.IsUserWriting +local spGetModKeyState = Spring.GetModKeyState +local spGetMouseState = Spring.GetMouseState +local spTraceScreenRay = Spring.TraceScreenRay + +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitExp = Spring.GetUnitExperience +local spGetUnitHealth = Spring.GetUnitHealth +local spGetUnitTeam = Spring.GetUnitTeam +local spGetUnitExperience = Spring.GetUnitExperience +local spGetUnitSensorRadius = Spring.GetUnitSensorRadius +local spGetUnitWeaponState = Spring.GetUnitWeaponState + +local uDefs = UnitDefs +local wDefs = WeaponDefs + +local triggerKey = KEYSYMS.SPACE + +local myTeamID = Spring.GetMyTeamID +local spGetTeamRulesParam = Spring.GetTeamRulesParam +local spGetTooltip = Spring.GetCurrentTooltip + +local vsx, vsy = Spring.GetViewGeometry() + +local maxWidth = 0 +local textBuffer = {} +local textBufferCount = 0 + +local spec = Spring.GetSpectatingState() + +------------------------------------------------------------------------------------ +-- Functions +------------------------------------------------------------------------------------ + + +function RectRound(px,py,sx,sy,cs) + + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.floor(sx),math.floor(sy),math.floor(cs) + + gl.Rect(px+cs, py, sx-cs, sy) + gl.Rect(sx-cs, py+cs, sx, sy-cs) + gl.Rect(px+cs, py+cs, px, sy-cs) + + gl.Texture(bgcorner) + gl.TexRect(px, py+cs, px+cs, py) -- top left + gl.TexRect(sx, py+cs, sx-cs, py) -- top right + gl.TexRect(px, sy-cs, px+cs, sy) -- bottom left + gl.TexRect(sx, sy-cs, sx-cs, sy) -- bottom right + gl.Texture(false) +end + +local function DrawText(t1, t2) + textBufferCount = textBufferCount + 1 + textBuffer[textBufferCount] = {t1,t2,cX,cY} + cY = cY - fontSize + maxWidth = max(maxWidth, (font:GetTextWidth(t1)*fontSize), (font:GetTextWidth(t2)*fontSize)+(fontSize*6.5)) +end + +local function DrawTextBuffer() + local num = #textBuffer + font:Begin() + for i=1, num do + font:Print(textBuffer[i][1], textBuffer[i][3], textBuffer[i][4], fontSize, "o") + font:Print(textBuffer[i][2], textBuffer[i][3] + (fontSize*6.5), textBuffer[i][4], fontSize, "o") + end + font:End() +end + +local function GetTeamColorCode(teamID) + + if not teamID then return "\255\255\255\255" end + + local R, G, B = spGetTeamColor(teamID) + + if not R then return "\255\255\255\255" end + + R = floor(R * 255) + G = floor(G * 255) + B = floor(B * 255) + + if (R < 11) then R = 11 end -- Note: char(10) terminates string + if (G < 11) then G = 11 end + if (B < 11) then B = 11 end + + return "\255" .. char(R) .. char(G) .. char(B) +end + +local function GetTeamName(teamID) + + if not teamID then return 'Error:NoTeamID' end + + local _, teamLeader = spGetTeamInfo(teamID,false) + if not teamLeader then return 'Error:NoLeader' end + + local leaderName = spGetPlayerInfo(teamLeader,false) + + if Spring.GetGameRulesParam('ainame_'..teamID) then + leaderName = Spring.GetGameRulesParam('ainame_'..teamID) + end + return leaderName or 'Error:NoName' +end + +local guishaderEnabled = false -- not a config var +function RemoveGuishader() + if guishaderEnabled and WG['guishader'] then + WG['guishader'].DeleteScreenDlist('unit_stats_title') + WG['guishader'].DeleteScreenDlist('unit_stats_data') + guishaderEnabled = false + end +end + +------------------------------------------------------------------------------------ +-- Code +------------------------------------------------------------------------------------ + +function widget:Initialize() + init() +end + +function widget:Shutdown() + gl.DeleteFont(font) + RemoveGuishader() +end + +function widget:PlayerChanged() + spec = Spring.GetSpectatingState() +end + +function init() + vsx, vsy = gl.GetViewSizes() + widgetScale = (0.60 + (vsx*vsy / 5000000)) + fontSize = customFontSize * widgetScale + + bgcornerSize = fontSize*0.45 + bgpadding = fontSize*0.9 + + xOffset = (32 + bgpadding)*widgetScale + yOffset = -((32 + bgpadding)*widgetScale) +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end + init() +end + +local selectedUnits = Spring.GetSelectedUnits() +local selectedUnitsCount = Spring.GetSelectedUnitsCount() +if useSelection then + function widget:SelectionChanged(sel) + selectedUnits = sel + selectedUnitsCount = Spring.GetSelectedUnitsCount() + end +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if (WG['topbar'] and WG['topbar'].showingQuit()) then + return + end + local alt, ctrl, meta, shift = spGetModKeyState() + if not meta or spIsUserWriting() then + WG.hoverID = nil + RemoveGuishader() + return + end + local mx, my = spGetMouseState() + local uID + local rType, unitID = spTraceScreenRay(mx, my) + if rType == 'unit' then + uID = unitID + end + if useSelection then + if selectedUnitsCount >= 1 then + uID = selectedUnits[1] + end + end + local useHoverID = false + local _, activeID = Spring.GetActiveCommand() + if not activeID then activeID = 0 end + if not uID and (not WG.hoverID) and not (activeID < 0) then + RemoveGuishader() return + elseif WG.hoverID and not (activeID < 0) then + uID = nil + useHoverID = true + elseif activeID < 0 then + uID = nil + useHoverID = false + end + local useExp = ctrl + local uDefID = (uID and spGetUnitDefID(uID)) or (useHoverID and WG.hoverID) or (UnitDefs[-activeID] and -activeID) + + if not uDefID then + RemoveGuishader() return + end + + local uDef = uDefs[uDefID] + local titleFontSize = fontSize*1.12 + local cornersize = ceil(bgpadding*0.21) + + if uID then + local uDef = uDefs[uDefID] + local uCurHp, uMaxHp, _, _, buildProg = spGetUnitHealth(uID) + uTeam = spGetUnitTeam(uID) + + maxWidth = 0 + + cX = mx + xOffset + cY = my + yOffset + cYstart = cY + + + cY = cY - 2 * titleFontSize + textBuffer = {} + textBufferCount = 0 + + ------------------------------------------------------------------------------------ + -- Units under construction + ------------------------------------------------------------------------------------ + if buildProg and buildProg < 1 then + + local myTeamID = spGetMyTeamID() + local mCur, mStor, mPull, mInc, mExp, mShare, mSent, mRec = spGetTeamResources(myTeamID, 'metal') + local eCur, eStor, ePull, eInc, eExp, eShare, eSent, eRec = spGetTeamResources(myTeamID, 'energy') + + local mTotal = uDef.metalCost + local eTotal = uDef.energyCost + local buildRem = 1 - buildProg + local mRem = mTotal * buildRem + local eRem = eTotal * buildRem + local mEta = (mRem - mCur) / (mInc + mRec) + local eEta = (eRem - eCur) / (eInc + eRec) + + DrawText("Prog:", format("%d%%", 100 * buildProg)) + DrawText("Metal:", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", mTotal * buildProg, mTotal, mRem, mEta)) + DrawText("Energy:", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", eTotal * buildProg, eTotal, eRem, eEta)) + --DrawText("MaxBP:", format(white .. '%d', buildRem * uDef.buildTime / math.max(mEta, eEta))) + cY = cY - fontSize + end + + ------------------------------------------------------------------------------------ + -- Generic information, cost, move, class + ------------------------------------------------------------------------------------ + + --DrawText('Height:', uDefs[spGetUnitDefID(uID)].height) + + DrawText("Cost:", format(metalColor .. '%d' .. white .. ' / ' .. + energyColor .. '%d' .. white .. ' / ' .. + buildColor .. '%d', uDef.metalCost, uDef.energyCost, uDef.buildTime) + ) + + if not (uDef.isBuilding or uDef.isFactory) then + DrawText("Move:", format("%.1f / %.1f / %.0f (Speed / Accel / Turn)", uDef.speed, 900 * uDef.maxAcc, simSpeed * uDef.turnRate * (180 / 32767))) + end + + + + if uDef.buildSpeed > 0 then DrawText('Build:', yellow .. uDef.buildSpeed) end + + cY = cY - fontSize + + ------------------------------------------------------------------------------------ + -- Sensors and Jamming + ------------------------------------------------------------------------------------ + local losRadius = spGetUnitSensorRadius(uID, 'los') or 0 + local airLosRadius = spGetUnitSensorRadius(uID, 'airLos') or 0 + local radarRadius = spGetUnitSensorRadius(uID, 'radar') or 0 + local sonarRadius = spGetUnitSensorRadius(uID, 'sonar') or 0 + local jammingRadius = spGetUnitSensorRadius(uID, 'radarJammer') or 0 + local sonarJammingRadius = spGetUnitSensorRadius(uID, 'sonarJammer') or 0 + local seismicRadius = spGetUnitSensorRadius(uID, 'seismic') or 0 + + DrawText('Los:', losRadius .. (airLosRadius > losRadius and format(' (AirLos: %d)', airLosRadius) or '')) + + if radarRadius > 0 then DrawText('Radar:', '\255\77\255\77' .. radarRadius) end + if sonarRadius > 0 then DrawText('Sonar:', '\255\128\128\255' .. sonarRadius) end + if jammingRadius > 0 then DrawText('Jam:' , '\255\255\77\77' .. jammingRadius) end + if sonarJammingRadius > 0 then DrawText('Sonar Jam:', '\255\255\77\77' .. sonarJammingRadius) end + if seismicRadius > 0 then DrawText('Seis:' , '\255\255\26\255' .. seismicRadius) end + + if uDef.stealth then DrawText("Other:", "Stealth") end + + cY = cY - fontSize + + local uExp = spGetUnitExperience(uID) + ------------------------------------------------------------------------------------ + -- Armor + ------------------------------------------------------------------------------------ + + DrawText("Armor:", "class " .. Game.armorTypes[uDef.armorType or 0] or '???') + + local maxHP = uDef.health + if ctrl then + maxHP = uMaxHp + end + if uExp ~= 0 then + DrawText("Exp:", format("+%d%% health", (uMaxHp/uDef.health-1)*100)) + end + DrawText("Open:", format("maxHP: %d", maxHP) ) + if uDef.armoredMultiple ~= 1 then DrawText("Closed:", format(" +%d%%, maxHP: %d", (1/uDef.armoredMultiple-1) *100,maxHP/uDef.armoredMultiple)) end + + cY = cY - fontSize + + ------------------------------------------------------------------------------------ + -- Weapons + ------------------------------------------------------------------------------------ + local wepCounts = {} -- wepCounts[wepDefID] = # + local wepsCompact = {} -- uWepsCompact[1..n] = wepDefID + + local uWeps = uDef.weapons + local weaponNums = {} + for i = 1, #uWeps do + local wDefID = uWeps[i].weaponDef + local wCount = wepCounts[wDefID] + if wCount then + wepCounts[wDefID] = wCount + 1 + else + wepCounts[wDefID] = 1 + wepsCompact[#wepsCompact + 1] = wDefID + weaponNums[#wepsCompact] = i + end + end + local selfDWeaponID = WeaponDefNames[uDef.selfDExplosion].id + local deathWeaponID = WeaponDefNames[uDef.deathExplosion].id + local selfDWeaponIndex + local deathWeaponIndex + + if shift then + wepCounts = {} + wepsCompact = {} + wepCounts[selfDWeaponID] = 1 + wepCounts[deathWeaponID] = 1 + deathWeaponIndex = #wepsCompact+1 + wepsCompact[deathWeaponIndex] = deathWeaponID + selfDWeaponIndex = #wepsCompact+1 + wepsCompact[selfDWeaponIndex] = selfDWeaponID + end + + for i = 1, #wepsCompact do + + local wDefId = wepsCompact[i] + local uWep = wDefs[wDefId] + + if uWep.range > 16 then + local oBurst = uWep.salvoSize * uWep.projectiles + local oRld = max(1/30,uWep.stockpile and uWep.stockpileTime or uWep.reload) + if uID and useExp and not uWep.stockpile and uWep.stockpileTime then + oRld = spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTime") or oRld + end + local wepCount = wepCounts[wDefId] + + local typeName = uWep.type + if i == deathWeaponIndex then + typeName = "Death explosion" + oRld = 1 + elseif i == selfDWeaponIndex then + typeName = "Self Destruct" + oRld = uDef.selfDCountdown + end + if wepCount > 1 then + DrawText("Weap:", format(yellow .. "%dx" .. white .. " %s", wepCount, typeName)) + else + DrawText("Weap:", typeName) + end + local reload = spGetUnitWeaponState(uID,weaponNums[i] or -1,"reloadTime") or uWep.reload + local accuracy = spGetUnitWeaponState(uID,weaponNums[i] or -1,"accuracy") or uWep.accuracy + local moveError = spGetUnitWeaponState(uID,weaponNums[i] or -1,"targetMoveError") or uWep.targetMoveError + local reloadBonus = reload ~= 0 and (uWep.reload/reload-1) or 0 + local accuracyBonus = accuracy ~= 0 and (uWep.accuracy/accuracy-1) or 0 + local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError/moveError-1) or 0 + local range = spGetUnitWeaponState(uID,weaponNums[i] or -1,"range") or uWep.range + local rangeBonus = range ~= 0 and (range/uWep.range-1) or 0 + if uExp ~= 0 then + DrawText("Exp:", format("+%d%% accuracy, +%d%% aim, +%d%% firerate, +%d%% range", accuracyBonus*100, moveErrorBonus*100, reloadBonus*100, rangeBonus*100 )) + end + local infoText = format("%d range, %d aoe, %d%% edge", useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) + if uWep.damages.paralyzeDamageTime > 0 then + infoText = format("%s, %ds paralyze", infoText, uWep.damages.paralyzeDamageTime) + end + if uWep.damages.impulseBoost > 0 then + infoText = format("%s, %d impulse", infoText, uWep.damages.impulseBoost*100) + end + if uWep.damages.craterBoost > 0 then + infoText = format("%s, %d crater", infoText, uWep.damages.craterBoost*100) + end + DrawText("Info:", infoText) + + local defaultDamage = uWep.damages[0] + for cat=0, #uWep.damages do + local oDmg = uWep.damages[cat] + local catName = Game.armorTypes[cat] + if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then + local dmgString + if oBurst > 1 then + dmgString = format(yellow .. "%d (x%d)" .. white .. " / " .. yellow .. "%.2f\s" .. white .. " = " .. yellow .. "%.2f \d\p\s", oDmg, oBurst, oRld, oBurst * oDmg / oRld) + else + dmgString = format(yellow .. "%d" .. white .. " / " .. yellow .. "%.2f\s" .. white .. " = " .. yellow .. "%.2f \d\p\s", oDmg, oRld, oDmg / oRld) + end + + if wepCount > 1 then + dmgString = dmgString .. white .. " (Each)" + end + + dmgString = dmgString .. white .. " (" .. catName .. ")" + + DrawText("Dmg:", dmgString) + end + end + + if uWep.metalCost > 0 or uWep.energyCost > 0 then + + -- Stockpiling weapons are weird + -- They take the correct amount of resources overall + -- They take the correct amount of time + -- They drain ((simSpeed+2)/simSpeed) times more resources than they should (And the listed drain is real, having lower income than listed drain WILL stall you) + local drainAdjust = uWep.stockpile and (simSpeed+2)/simSpeed or 1 + + DrawText('Cost:', format(metalColor .. '%d' .. white .. ', ' .. + energyColor .. '%d' .. white .. ' = ' .. + metalColor .. '-%d' .. white .. ', ' .. + energyColor .. '-%d' .. white .. ' per second', + uWep.metalCost, + uWep.energyCost, + drainAdjust * uWep.metalCost / oRld, + drainAdjust * uWep.energyCost / oRld)) + end + + + cY = cY - fontSize + end + end + + + + else + + + + local uDef = uDefs[uDefID] + local uMaxHp = uDef.health + local uTeam = Spring.GetMyTeamID() + + maxWidth = 0 + + cX = mx + xOffset + cY = my + yOffset + cYstart = cY + + local text = yellow .. uDef.humanName .. white .. " " .. uDef.name .. " ("..GetTeamColorCode(uTeam) .. GetTeamName(uTeam) .. white .. ")" + + cY = cY - 2 * fontSize + textBuffer = {} + textBufferCount = 0 + + ------------------------------------------------------------------------------------ + -- Units under construction + ------------------------------------------------------------------------------------ + if buildProg and buildProg < 1 then + + local myTeamID = spGetMyTeamID() + local mCur, mStor, mPull, mInc, mExp, mShare, mSent, mRec = spGetTeamResources(myTeamID, 'metal') + local eCur, eStor, ePull, eInc, eExp, eShare, eSent, eRec = spGetTeamResources(myTeamID, 'energy') + + local mTotal = uDef.metalCost + local eTotal = uDef.energyCost + local buildRem = 1 - buildProg + local mRem = mTotal * buildRem + local eRem = eTotal * buildRem + local mEta = (mRem - mCur) / (mInc + mRec) + local eEta = (eRem - eCur) / (eInc + eRec) + + DrawText("Prog:", format("%d%%", 100 * buildProg)) + DrawText("Metal:", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", mTotal * buildProg, mTotal, mRem, mEta)) + DrawText("Energy:", format("%d / %d (" .. yellow .. "%d" .. white .. ", %ds)", eTotal * buildProg, eTotal, eRem, eEta)) + --DrawText("MaxBP:", format(white .. '%d', buildRem * uDef.buildTime / math.max(mEta, eEta))) + cY = cY - fontSize + end + + ------------------------------------------------------------------------------------ + -- Generic information, cost, move, class + ------------------------------------------------------------------------------------ + + --DrawText('Height:', uDefs[spGetUnitDefID(uID)].height) + + DrawText("Cost:", format(metalColor .. '%d' .. white .. ' / ' .. + energyColor .. '%d' .. white .. ' / ' .. + buildColor .. '%d', uDef.metalCost, uDef.energyCost, uDef.buildTime) + ) + + if not (uDef.isBuilding or uDef.isFactory) then + DrawText("Move:", format("%.1f / %.1f / %.0f (Speed / Accel / Turn)", uDef.speed, 900 * uDef.maxAcc, simSpeed * uDef.turnRate * (180 / 32767))) + end + + + + if uDef.buildSpeed > 0 then DrawText('Build:', yellow .. uDef.buildSpeed) end + + cY = cY - fontSize + + ------------------------------------------------------------------------------------ + -- Sensors and Jamming + ------------------------------------------------------------------------------------ + local losRadius = uDef.losRadius + local airLosRadius = uDef.airLosRadius + local radarRadius = uDef.radarRadius + local sonarRadius = uDef.sonarRadius + local jammingRadius = uDef.jammerRadius + local sonarJammingRadius = uDef.sonarJamRadius + local seismicRadius = uDef.seismicRadius + + DrawText('Los:', losRadius .. (airLosRadius > losRadius and format(' (AirLos: %d)', airLosRadius) or '')) + + if radarRadius > 0 then DrawText('Radar:', '\255\77\255\77' .. radarRadius) end + if sonarRadius > 0 then DrawText('Sonar:', '\255\128\128\255' .. sonarRadius) end + if jammingRadius > 0 then DrawText('Jam:' , '\255\255\77\77' .. jammingRadius) end + if sonarJammingRadius > 0 then DrawText('Sonar Jam:', '\255\255\77\77' .. sonarJammingRadius) end + if seismicRadius > 0 then DrawText('Seis:' , '\255\255\26\255' .. seismicRadius) end + + if uDef.stealth then DrawText("Other:", "Stealth") end + + cY = cY - fontSize + + ------------------------------------------------------------------------------------ + -- Armor + ------------------------------------------------------------------------------------ + + DrawText("Armor:", "class " .. Game.armorTypes[uDef.armorType or 0] or '???') + + local maxHP = uDef.health + if ctrl then + maxHP = uMaxHp + end + DrawText("Open:", format("maxHP: %d", maxHP) ) + if uDef.armoredMultiple ~= 1 then DrawText("Closed:", format(" +%d%%, maxHP: %d", (1/uDef.armoredMultiple-1) *100,maxHP/uDef.armoredMultiple)) end + + cY = cY - fontSize + + ------------------------------------------------------------------------------------ + -- Weapons + ------------------------------------------------------------------------------------ + local wepCounts = {} -- wepCounts[wepDefID] = # + local wepsCompact = {} -- uWepsCompact[1..n] = wepDefID + + local uWeps = uDef.weapons + local weaponNums = {} + for i = 1, #uWeps do + local wDefID = uWeps[i].weaponDef + local wCount = wepCounts[wDefID] + if wCount then + wepCounts[wDefID] = wCount + 1 + else + wepCounts[wDefID] = 1 + wepsCompact[#wepsCompact + 1] = wDefID + weaponNums[#wepsCompact] = i + end + end + local selfDWeaponID = WeaponDefNames[uDef.selfDExplosion].id + local deathWeaponID = WeaponDefNames[uDef.deathExplosion].id + local selfDWeaponIndex + local deathWeaponIndex + + if shift then + wepCounts = {} + wepsCompact = {} + wepCounts[selfDWeaponID] = 1 + wepCounts[deathWeaponID] = 1 + deathWeaponIndex = #wepsCompact+1 + wepsCompact[deathWeaponIndex] = deathWeaponID + selfDWeaponIndex = #wepsCompact+1 + wepsCompact[selfDWeaponIndex] = selfDWeaponID + end + + for i = 1, #wepsCompact do + + local wDefId = wepsCompact[i] + local uWep = wDefs[wDefId] + + if uWep.range > 16 then + local oBurst = uWep.salvoSize * uWep.projectiles + local oRld = max(0.00000000001,uWep.stockpile == true and uWep.stockpileTime/30 or uWep.reload) + local wepCount = wepCounts[wDefId] + + local typeName = uWep.type + if i == deathWeaponIndex then + typeName = "Death explosion" + oRld = 1 + elseif i == selfDWeaponIndex then + typeName = "Self Destruct" + oRld = uDef.selfDCountdown + end + if wepCount > 1 then + DrawText("Weap:", format(yellow .. "%dx" .. white .. " %s", wepCount, typeName)) + else + DrawText("Weap:", typeName) + end + local reload = uWep.reload + local accuracy = uWep.accuracy + local moveError = uWep.targetMoveError + local range = uWep.range + local reloadBonus = reload ~= 0 and (uWep.reload/reload-1) or 0 + local accuracyBonus = accuracy ~= 0 and (uWep.accuracy/accuracy-1) or 0 + local moveErrorBonus = moveError ~= 0 and (uWep.targetMoveError/moveError-1) or 0 + local rangeBonus = range ~= 0 and (range/uWep.range-1) or 0 + local infoText = format("%d range, %d aoe, %d%% edge", useExp and range or uWep.range, uWep.damageAreaOfEffect, 100 * uWep.edgeEffectiveness) + if uWep.damages.paralyzeDamageTime > 0 then + infoText = format("%s, %ds paralyze", infoText, uWep.damages.paralyzeDamageTime) + end + if uWep.damages.impulseBoost > 0 then + infoText = format("%s, %d impulse", infoText, uWep.damages.impulseBoost*100) + end + if uWep.damages.craterBoost > 0 then + infoText = format("%s, %d crater", infoText, uWep.damages.craterBoost*100) + end + DrawText("Info:", infoText) + + local defaultDamage = uWep.damages[0] + for cat=0, #uWep.damages do + local oDmg = uWep.damages[cat] + local catName = Game.armorTypes[cat] + if catName and oDmg and (oDmg ~= defaultDamage or cat == 0) then + local dmgString + if oBurst > 1 then + dmgString = format(yellow .. "%d (x%d)" .. white .. " / " .. yellow .. "%.2f\s" .. white .. " = " .. yellow .. "%.2f \d\p\s", oDmg, oBurst, oRld, oBurst * oDmg / oRld) + else + dmgString = format(yellow .. "%d" .. white .. " / " .. yellow .. "%.2f\s" .. white .. " = " .. yellow .. "%.2f \d\p\s", oDmg, oRld, oDmg / oRld) + end + + if wepCount > 1 then + dmgString = dmgString .. white .. " (Each)" + end + + dmgString = dmgString .. white .. " (" .. catName .. ")" + + DrawText("Dmg:", dmgString) + end + end + + if uWep.metalCost > 0 or uWep.energyCost > 0 then + + -- Stockpiling weapons are weird + -- They take the correct amount of resources overall + -- They take the correct amount of time + -- They drain ((simSpeed+2)/simSpeed) times more resources than they should (And the listed drain is real, having lower income than listed drain WILL stall you) + local drainAdjust = uWep.stockpile and (simSpeed+2)/simSpeed or 1 + + DrawText('Cost:', format(metalColor .. '%d' .. white .. ', ' .. + energyColor .. '%d' .. white .. ' = ' .. + metalColor .. '-%d' .. white .. ', ' .. + energyColor .. '-%d' .. white .. ' per second', + uWep.metalCost, + uWep.energyCost, + drainAdjust * uWep.metalCost / oRld, + drainAdjust * uWep.energyCost / oRld)) + end + + + cY = cY - fontSize + end + end + end + + -- background + if WG.hoverID ~= nil then + glColor(0.11,0.11,0.11,0.9) + else + glColor(0,0,0,0.66) + end + + -- correct position when it goes below screen + if cY < 0 then + cYstart = cYstart - cY + local num = #textBuffer + for i=1, num do + textBuffer[i][4] = textBuffer[i][4] - (cY/2) + textBuffer[i][4] = textBuffer[i][4] - (cY/2) + end + cY = 0 + end + -- correct position when it goes off screen + if cX + maxWidth+bgpadding+bgpadding > vsx then + local cXnew = vsx-maxWidth-bgpadding-bgpadding + local num = #textBuffer + for i=1, num do + textBuffer[i][3] = textBuffer[i][3] - ((cX-cXnew)/2) + textBuffer[i][3] = textBuffer[i][3] - ((cX-cXnew)/2) + end + cX = cXnew + end + + -- title + local text = "\255\190\255\190" .. uDef.humanName + if uID then + text = text .. " " .. grey .. uDef.name .. " #" .. uID .. " "..GetTeamColorCode(uTeam) .. GetTeamName(uTeam) + end + local iconHalfSize = titleFontSize*0.75 + if not uID then + iconHalfSize = -bgpadding/2.5 + end + cornersize = 0 + if not uID then + glColor(0.1,0.1,0.1,(WG['guishader'] and 0.8 or 0.88)) + else + glColor(0,0,0,(WG['guishader'] and 0.7 or 0.75)) + end + RectRound(cX-bgpadding+cornersize, cYstart-bgpadding+cornersize, cX+(font:GetTextWidth(text)*titleFontSize)+iconHalfSize+iconHalfSize+bgpadding+(bgpadding/1.5)-cornersize, cYstart+(titleFontSize/2)+bgpadding-cornersize, bgcornerSize) + + if WG['guishader'] then + guishaderEnabled = true + WG['guishader'].InsertScreenDlist( gl.CreateList( function() + RectRound(cX-bgpadding+cornersize, cYstart-bgpadding+cornersize, cX+(font:GetTextWidth(text)*titleFontSize)+iconHalfSize+iconHalfSize+bgpadding+(bgpadding/1.5)-cornersize, cYstart+(titleFontSize/2)+bgpadding-cornersize, bgcornerSize) + end), 'unit_stats_title') + end + + cornersize = ceil(bgpadding*0.25) + glColor(1,1,1,0.023) + RectRound(cX-bgpadding+cornersize, cYstart-bgpadding+cornersize, cX+(font:GetTextWidth(text)*titleFontSize)+iconHalfSize+iconHalfSize+bgpadding+(bgpadding/1.5)-cornersize, cYstart+(titleFontSize/2)+bgpadding-cornersize, bgcornerSize*0.88) + + + -- icon + if uID then + glColor(1,1,1,1) + glTexture('#' .. uDefID) + glTexRect(cX, cYstart+cornersize-iconHalfSize, cX+iconHalfSize+iconHalfSize, cYstart+cornersize+iconHalfSize) + glTexture(false) + end + + -- title text + glColor(1,1,1,1) + font:Begin() + font:Print(text, cX+iconHalfSize+iconHalfSize+(bgpadding/1.5), cYstart, titleFontSize, "o") + font:End() + + -- stats + cornersize = 0 + if not uID then + glColor(0.1,0.1,0.1,(WG['guishader'] and 0.8 or 0.88)) + else + glColor(0,0,0,(WG['guishader'] and 0.7 or 0.75)) + end + RectRound(floor(cX-bgpadding)+cornersize, ceil(cY+(fontSize/3)+bgpadding)+cornersize, ceil(cX+maxWidth+bgpadding)-cornersize, floor(cYstart-bgpadding)-cornersize, bgcornerSize) + + if WG['guishader'] then + guishaderEnabled = true + WG['guishader'].InsertScreenDlist( gl.CreateList( function() + RectRound(floor(cX-bgpadding)+cornersize, ceil(cY+(fontSize/3)+bgpadding)+cornersize, ceil(cX+maxWidth+bgpadding)-cornersize, floor(cYstart-bgpadding)-cornersize, bgcornerSize) + end), 'unit_stats_data') + end + + cornersize = ceil(bgpadding*0.23) + glColor(1,1,1,0.025) + RectRound(floor(cX-bgpadding)+cornersize, ceil(cY+(fontSize/3)+bgpadding)+cornersize, ceil(cX+maxWidth+bgpadding)-cornersize, floor(cYstart-bgpadding)-cornersize, bgcornerSize*0.88) + + DrawTextBuffer() + +end +------------------------------------------------------------------------------------ diff --git a/LuaUI/Widgets_Evo/gui_vote_interface.lua b/LuaUI/Widgets_Evo/gui_vote_interface.lua new file mode 100644 index 000000000..cfc6dfb45 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_vote_interface.lua @@ -0,0 +1,386 @@ +function widget:GetInfo() + return { + name = "Vote interface", + desc = "", + author = "Floris", + date = "July 2018", + license = "", + layer = -2000, + enabled = true, + } +end + +local vsx, vsy = gl.GetViewSizes() +local customScale = 1.5 +local widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + +local bgcorner = "LuaUI/Images/bgcorner.png" + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +-- being set at gamestart again: +local myPlayerID = Spring.GetMyPlayerID() +local myName,_,mySpec,myTeamID,myAllyTeamID = Spring.GetPlayerInfo(myPlayerID,false) +local startedAsPlayer = not mycSpec + +local function DrawRectRound(px,py,sx,sy,cs) + + local csx = cs + local csy = cs + if sx-px < (cs*2) then + csx = (sx-px)/2 + if csx < 0 then csx = 0 end + end + if sy-py < (cs*2) then + csy = (sy-py)/2 + if csy < 0 then csy = 0 end + end + cs = math.min(csx, csy) + + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + local o = offset + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +function IsOnRect(x, y, BLcornerX, BLcornerY,TRcornerX,TRcornerY) + return x >= BLcornerX and x <= TRcornerX and y >= BLcornerY and y <= TRcornerY +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) * customScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + gl.DeleteFont(font2) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:PlayerChanged(playerID) + mySpec = Spring.GetSpectatingState() +end + +--local sec = 0 +--function widget:Update(dt) +-- myName,_,mySpec,myTeamID,myAllyTeamID = Spring.GetPlayerInfo(1,false) +-- sec = sec + dt +-- if sec > 2 and not voteDlist then +-- StartVote('testvote yeah!', 'somebody') +-- end +--end + +function widget:Initialize() + if Spring.IsReplay() then + widgetHandler:RemoveWidget(self) + end +end + +function widget:GameFrame(n) + if n > 0 and not gameStarted then + gameStarted = true + myPlayerID = Spring.GetMyPlayerID() + myName,_,mySpec,myTeamID,myAllyTeamID = Spring.GetPlayerInfo(myPlayerID,false) + startedAsPlayer = not mySpec + end +end + +function isTeamPlayer(playerName) + local players = Spring.GetPlayerList() + for _,pID in ipairs(players) do + local name,_,spec,teamID,allyTeamID = Spring.GetPlayerInfo(pID,false) + if name == playerName then + if allyTeamID == myAllyTeamID then + return true + end + end + end + return false +end + +function widget:AddConsoleLine(lines, priority) + if startedAsPlayer and (not WG['topbar'] or (WG['topbar'] and WG['topbar'].showingRejoining and not WG['topbar'].showingRejoining())) then + lines = lines:match('^\[f=[0-9]+\] (.*)$') or lines + for line in lines:gmatch("[^\n]+") do + if (string.sub(line,1,1) == ">" and string.sub(line,3,3) ~= "<") then -- system message + if string.find(line," called a vote ") then -- vote called + local title = string.sub(line,string.find(line,' "')+2, string.find(line,'" ')-1)..'?' + title = title:sub(1,1):upper()..title:sub(2) + if not string.find(line,"\"resign ") or isTeamPlayer(string.sub(line,string.find(line,'"resign ')+8, string.find(line,' TEAM')-1)) then + StartVote(title, string.find(line, string.gsub(myName, "%p", "%%%1").." called a vote ")) + end + elseif voteDlist and (string.find(line," passed.") or string.find(line," failed") or string.find(line,"Vote cancelled") or string.find(line," cancelling \"")) then + EndVote() + end + end + end + end +end + +function EndVote() + if voteDlist then + gl.DeleteList(voteDlist) + voteDlist = nil + voteName = nil + voteOwner = nil + if WG['guishader'] then + WG['guishader'].DeleteDlist('voteinterface') + end + end +end + +function StartVote(name, owner) + if voteDlist then + gl.DeleteList(voteDlist) + end + if owner then + voteOwner = owner + end + voteDlist = gl.CreateList(function() + if name then + voteName = name + end + + local x,y,b = Spring.GetMouseState() + + local width = vsx/6.2 + local height = vsy/13 + + local fontSize = height/5 -- title only + local minWidth = font:GetTextWidth(' '..voteName..' ')*fontSize + if width < minWidth then + width = minWidth + end + + local padding = width/70 + local buttonPadding = width/100 + local buttonMargin = width/32 + local buttonHeight = height*0.55 + + local xpos = width/2 + local ypos = vsy-(height/2) + + if WG['topbar'] ~= nil then + local topbarArea = WG['topbar'].GetPosition() + --xpos = vsx-(width/2) + xpos = topbarArea[1] + (width/2) + ((vsx-topbarArea[1])/1.95) + ypos = topbarArea[6]-(5*topbarArea[5])-(height/2) + end + + hovered = nil + + windowArea = {xpos-(width/2), ypos-(height/2), xpos+(width/2), ypos+(height/2) } + closeButtonArea = {(xpos+(width/2))-(height/1.9), ypos+(height/5.5), xpos+(width/2), ypos+(height/2) } + yesButtonArea = {xpos-(width/2)+buttonMargin, ypos-(height/2)+buttonMargin, xpos-(buttonMargin/2), ypos-(height/2)+buttonHeight-buttonMargin } + noButtonArea = {xpos+(buttonMargin/2), ypos-(height/2)+buttonMargin, xpos+(width/2)-buttonMargin, ypos-(height/2)+buttonHeight-buttonMargin} + + -- window + gl.Color(0,0,0,0.82) + RectRound(windowArea[1], windowArea[2], windowArea[3], windowArea[4], 5.5*widgetScale) + gl.Color(1,1,1,0.05) + RectRound(windowArea[1]+padding, windowArea[2]+padding, windowArea[3]-padding, windowArea[4]-padding, 5*widgetScale) + + -- close + --gl.Color(0.1,0.1,0.1,0.55+(0.36)) + --RectRound(closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4], 3.5*widgetScale) + if IsOnRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) then + hovered = 'esc' + gl.Color(1,1,1,0.55) + else + gl.Color(1,1,1,0.027) + end + RectRound(closeButtonArea[1]+padding, closeButtonArea[2]+padding, closeButtonArea[3]-padding, closeButtonArea[4]-padding, 3*widgetScale) + + fontSize = fontSize*0.85 + gl.Color(0,0,0,1) + + -- vote name + font:Begin() + font:Print("\255\190\190\190"..voteName, windowArea[1]+((windowArea[3]-windowArea[1])/2), windowArea[4]-padding-padding-padding-fontSize, fontSize, "con") + font:End() + + font2:Begin() + -- ESC + font2:Print("\255\0\0\0ESC", closeButtonArea[1]+((closeButtonArea[3]-closeButtonArea[1])/2), closeButtonArea[2]+((closeButtonArea[4]-closeButtonArea[2])/2)-(fontSize/3), fontSize, "cn") + + -- NO + if IsOnRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) then + hovered = 'n' + gl.Color(0.7,0.1,0.1,0.8) + else + gl.Color(0.5,0,0,0.7) + end + RectRound(noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4], 5*widgetScale) + gl.Color(0,0,0,0.075) + RectRound(noButtonArea[1]+buttonPadding, noButtonArea[2]+buttonPadding, noButtonArea[3]-buttonPadding, noButtonArea[4]-buttonPadding, 4*widgetScale) + + fontSize = fontSize*0.85 + local noText = 'NO' + if voteOwner then + noText = 'End Vote' + end + font2:SetOutlineColor(0,0,0,0.4) + font2:Print(noText, noButtonArea[1]+((noButtonArea[3]-noButtonArea[1])/2), noButtonArea[2]+((noButtonArea[4]-noButtonArea[2])/2)-(fontSize/3), fontSize, "con") + + -- YES + if not voteOwner then + if IsOnRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4]) then + hovered = 'y' + gl.Color(0.05,0.6,0.05,0.8) + else + gl.Color(0,0.5,0,0.35) + end + RectRound(yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4], 5*widgetScale) + gl.Color(0,0,0,0.075) + RectRound(yesButtonArea[1]+buttonPadding, yesButtonArea[2]+buttonPadding, yesButtonArea[3]-buttonPadding, yesButtonArea[4]-buttonPadding, 4*widgetScale) + + font2:Print("YES", yesButtonArea[1]+((yesButtonArea[3]-yesButtonArea[1])/2), yesButtonArea[2]+((yesButtonArea[4]-yesButtonArea[2])/2)-(fontSize/3), fontSize, "con") + end + font2:End() + end) + -- background blur + if WG['guishader'] then + dlistGuishader = gl.CreateList( function() + RectRound(windowArea[1],windowArea[2],windowArea[3],windowArea[4], 5.5*widgetScale) + end) + WG['guishader'].InsertDlist(dlistGuishader, 'voteinterface') + end +end + +function widget:KeyPress(key) + if key == 27 and voteDlist then -- ESC + if not voteOwner then + Spring.SendCommands("say !vote b") + end + EndVote() + end +end + +function widget:MousePress(x, y, button) + if voteDlist and button == 1 then + if IsOnRect(x, y, windowArea[1], windowArea[2], windowArea[3], windowArea[4]) then + if not voteOwner and IsOnRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4]) then + Spring.SendCommands("say !vote y") + EndVote() + elseif IsOnRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) then + if voteOwner then + Spring.SendCommands("say !endvote") + else + Spring.SendCommands("say !vote n") + end + EndVote() + elseif IsOnRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) then + Spring.SendCommands("say !vote b") + EndVote() + end + return true + end + end +end + +function widget:Shutdown() + gl.DeleteFont(font) + EndVote() +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if voteDlist then + local x,y,b = Spring.GetMouseState() + if (not WG['topbar'] or not WG['topbar'].showingQuit()) then + if IsOnRect(x, y, windowArea[1], windowArea[2], windowArea[3], windowArea[4]) then + if (not voteOwner and IsOnRect(x, y, yesButtonArea[1], yesButtonArea[2], yesButtonArea[3], yesButtonArea[4])) or + IsOnRect(x, y, noButtonArea[1], noButtonArea[2], noButtonArea[3], noButtonArea[4]) or + IsOnRect(x, y, closeButtonArea[1], closeButtonArea[2], closeButtonArea[3], closeButtonArea[4]) + then + StartVote() + elseif hovered then + StartVote() + end + elseif hovered then + StartVote() + end + end + gl.CallList(voteDlist) + end +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/gui_widget_selector.lua b/LuaUI/Widgets_Evo/gui_widget_selector.lua new file mode 100644 index 000000000..5be0e4f46 --- /dev/null +++ b/LuaUI/Widgets_Evo/gui_widget_selector.lua @@ -0,0 +1,853 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: selector.lua +-- brief: the widget selector, loads and unloads widgets +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- changes: +-- jK (April@2009) - updated to new font system +-- Bluestone (Jan 2015) - added to BA as a widget, added various stuff +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Widget Selector", + desc = "Widget selection widget", + author = "trepan, jK, Bluestone", + date = "Jan 8, 2007", + license = "GNU GPL, v2 or later", + layer = -math.huge, + handler = true, + enabled = true + } +end + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + +-- relies on a gadget to implement "luarules reloadluaui" +-- relies on custom stuff in widgetHandler to implement blankOutConfig and allowUserWidgets + +include("keysym.h.lua") +include("fonts.lua") + +local WhiteStr = "\255\255\255\255" +local RedStr = "\255\255\001\001" +local GreenStr = "\255\001\255\001" +local BlueStr = "\255\001\001\255" +local CyanStr = "\255\001\255\255" +local YellowStr = "\255\255\255\001" +local MagentaStr = "\255\255\001\255" + +local cutomScale = 1 +local sizeMultiplier = 1 + +local floor = math.floor + +local widgetsList = {} +local fullWidgetsList = {} + +local vsx, vsy = widgetHandler:GetViewSizes() + +local minMaxEntries = 15 +local curMaxEntries = 25 + +local startEntry = 1 +local pageStep = math.floor(curMaxEntries / 2) - 1 + +local fontSize = 13.5 +local fontSpace = 8.5 +local yStep = fontSize + fontSpace + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local bgPadding = 5.5 +local bgcorner = "LuaUI/Images/bgcorner.png" + +local maxWidth = 0.01 +local borderx = yStep * 0.75 +local bordery = yStep * 0.75 + +local midx = vsx * 0.5 +local minx = vsx * 0.4 +local maxx = vsx * 0.6 +local midy = vsy * 0.5 +local miny = vsy * 0.4 +local maxy = vsy * 0.6 + +local sbposx = 0.0 +local sbposy = 0.0 +local sbsizex = 0.0 +local sbsizey = 0.0 +local sby1 = 0.0 +local sby2 = 0.0 +local sbsize = 0.0 +local sbheight = 0.0 +local activescrollbar = false +local scrollbargrabpos = 0.0 + +local show = false +local pagestepped = false + + +local buttons = { --see MouseRelease for which functions are called by which buttons + [1] = "Reload LuaUI", + [2] = "Unload ALL Widgets", + [3] = "Allow/Disallow User Widgets", + [4] = "Reset LuaUI", + [5] = "Factory Reset LuaUI", +} + +local allowuserwidgets = true +if Spring.GetModOptions and (tonumber(Spring.GetModOptions().allowuserwidgets) or 1) == 0 then + allowuserwidgets = false + buttons[3] = '' +end + +local titleFontSize = 20 +local buttonFontSize = 15 +local buttonHeight = 24 +local buttonTop = 28 -- offset between top of buttons and bottom of widget + +------------------------------------------------------------------------------- + +function widget:Initialize() + widgetHandler.knownChanged = true + Spring.SendCommands('unbindkeyset f11') + + if allowuserwidgets then + if widgetHandler.allowUserWidgets then + buttons[3] = "Disallow User Widgets" + else + buttons[3] = "Allow User Widgets" + end + end + if Spring.GetGameFrame() <= 0 then + Spring.SendLuaRulesMsg('xmas'..((os.date("%m") == "12" and os.date("%d") >= "17") and '1' or '0')) + end +end + + +------------------------------------------------------------------------------- + + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.07 -- texture offset, because else gaps could show + local o = offset + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRound(px,py,sx,sy,cs) + local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + + +local function UpdateGeometry() + midx = vsx * 0.5 + midy = vsy * 0.5 + + local halfWidth = ((maxWidth+2) * fontSize) * sizeMultiplier * 0.5 + minx = floor(midx - halfWidth - (borderx*sizeMultiplier)) + maxx = floor(midx + halfWidth + (borderx*sizeMultiplier)) + + local ySize = (yStep * sizeMultiplier) * (#widgetsList) + miny = floor(midy - (0.5 * ySize)) - ((fontSize+bgPadding+bgPadding)*sizeMultiplier) + maxy = floor(midy + (0.5 * ySize)) +end + + +local function UpdateListScroll() + local wCount = #fullWidgetsList + local lastStart = lastStart or wCount - curMaxEntries + 1 + if (lastStart < 1) then lastStart = 1 end + if (lastStart > wCount - curMaxEntries + 1) then lastStart = 1 end + if (startEntry > lastStart) then startEntry = lastStart end + if (startEntry < 1) then startEntry = 1 end + + widgetsList = {} + local se = startEntry + local ee = se + curMaxEntries - 1 + local n = 1 + for i = se, ee do + widgetsList[n],n = fullWidgetsList[i],n+1 + end +end + + +local function ScrollUp(step) + startEntry = startEntry - step + UpdateListScroll() +end + + +local function ScrollDown(step) + startEntry = startEntry + step + UpdateListScroll() +end + + +function widget:MouseWheel(up, value) + if not show then return false end + + local a,c,m,s = Spring.GetModKeyState() + if (a or m) then + return false -- alt and meta allow normal control + end + local step = (s and 4) or (c and 1) or 2 + if (up) then + ScrollUp(step) + else + ScrollDown(step) + end + return true +end + + +local function SortWidgetListFunc(nd1, nd2) --does nd1 come before nd2? + -- widget profiler on top + if nd1[1]=="Widget Profiler" then + return true + elseif nd2[1]=="Widget Profiler" then + return false + end + + -- mod widgets first, then user widgets + if (nd1[2].fromZip ~= nd2[2].fromZip) then + return nd1[2].fromZip + end + + -- sort by name + return (nd1[1] < nd2[1]) +end + + +local function UpdateList() + if (not widgetHandler.knownChanged) then + return + end + widgetHandler.knownChanged = false + + local myName = widget:GetInfo().name + maxWidth = 0 + widgetsList = {} + for name,data in pairs(widgetHandler.knownWidgets) do + if (name ~= myName) then + fullWidgetsList[#fullWidgetsList+1] = { name, data } + -- look for the maxWidth + local width = fontSize * font:GetTextWidth(name) + if (width > maxWidth) then + maxWidth = width + end + end + end + + maxWidth = (maxWidth / fontSize) + + local myCount = #fullWidgetsList + if (widgetHandler.knownCount ~= (myCount + 1)) then + error('knownCount mismatch') + end + + table.sort(fullWidgetsList, SortWidgetListFunc) + + UpdateListScroll() + UpdateGeometry() +end + + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + widgetScale = (0.5 + (vsx*vsy / 5700000)) + local fontfileScale = widgetScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + + if customScale == nil then + customScale = 1 + end + sizeMultiplier = 0.6 + (vsx*vsy / 6000000) * customScale + + UpdateGeometry() +end + + +------------------------------------------------------------------------------- + +function widget:KeyPress(key, mods, isRepeat) + if (show and (key == KEYSYMS.ESCAPE) or + ((key == KEYSYMS.F11) and not isRepeat and + not (mods.alt or mods.ctrl or mods.meta or mods.shift))) then + show = not show + return true + end + if (show and key == KEYSYMS.PAGEUP) then + ScrollUp(pageStep) + return true + end + if (show and key == KEYSYMS.PAGEDOWN) then + ScrollDown(pageStep) + return true + end + return false +end +local activeGuishader = false +local scrollbarOffset = -15 +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not show then + if activeGuishader and (WG['guishader']) then + activeGuishader = false + WG['guishader'].DeleteDlist('widgetselector') + end + return + end + UpdateList() + if (WG['guishader'] == nil) then + activeGuishader = false + end + if (WG['guishader']) and not activeGuishader then + activeGuishader = true + dlistGuishader = gl.CreateList( function() + RectRound(minx-(bgPadding*sizeMultiplier), miny-(bgPadding*sizeMultiplier), maxx+(bgPadding*sizeMultiplier), maxy+(bgPadding*sizeMultiplier), 8*sizeMultiplier) + end) + WG['guishader'].InsertDlist(dlistGuishader, 'widgetselector') + end + borderx = (yStep*sizeMultiplier) * 0.75 + bordery = (yStep*sizeMultiplier) * 0.75 + + -- draw the header + font2:Begin() + font2:Print("Widget Selector", midx, maxy + ((11 + bgPadding)*sizeMultiplier), titleFontSize*sizeMultiplier, "oc") + font2:End() + + font:Begin() + local mx,my,lmb,mmb,rmb = Spring.GetMouseState() + local tcol = WhiteStr + + -- draw the -/+ buttons + if maxx-10 < mx and mx < maxx and maxy < my and my < maxy + ((buttonFontSize + 7)*sizeMultiplier) then + tcol = '\255\031\031\031' + end + font:Print(tcol.."+", maxx, maxy + ((7 + bgPadding)*sizeMultiplier), buttonFontSize*sizeMultiplier, "or") + tcol = WhiteStr + if minx < mx and mx < minx+10 and maxy < my and my < maxy + ((buttonFontSize + 7)*sizeMultiplier) then + tcol = '\255\031\031\031' + end + font:Print(tcol.."-", minx, maxy + ((7 + bgPadding)*sizeMultiplier), buttonFontSize*sizeMultiplier, "ol") + tcol = WhiteStr + + -- draw the box + if WG['guishader'] then + gl.Color(0,0,0,0.8) + else + gl.Color(0,0,0,0.85) + end + RectRound(minx-(bgPadding*sizeMultiplier), miny-(bgPadding*sizeMultiplier), maxx+(bgPadding*sizeMultiplier), maxy+(bgPadding*sizeMultiplier), 8*sizeMultiplier) + + gl.Color(0.33,0.33,0.33,0.2) + RectRound(minx, miny, maxx, maxy, 8*sizeMultiplier) + + -- draw the text buttons (at the bottom) & their outlines + for i,name in ipairs(buttons) do + tcol = WhiteStr + if minx < mx and mx < maxx and miny - (buttonTop*sizeMultiplier) - i*(buttonHeight*sizeMultiplier) < my and my < miny - (buttonTop*sizeMultiplier) - (i-1)*(buttonHeight*sizeMultiplier) then + tcol = '\255\031\031\031' + end + font:Print(tcol .. buttons[i], (minx+maxx)/2, miny - (buttonTop*sizeMultiplier) - (i*(buttonHeight*sizeMultiplier)), buttonFontSize*sizeMultiplier, "oc") + end + + + -- draw the widgets + local nd = not widgetHandler.tweakMode and self:AboveLabel(mx, my) + local pointedY = nil + local pointedEnabled = false + local pointedName = (nd and nd[1]) or nil + local posy = maxy - ((yStep+bgPadding)*sizeMultiplier) + sby1 = posy + ((fontSize + fontSpace)*sizeMultiplier) * 0.5 + for _,namedata in ipairs(widgetsList) do + local name = namedata[1] + local data = namedata[2] + local color = '' + local pointed = (pointedName == name) + local order = widgetHandler.orderList[name] + local enabled = order and (order > 0) + local active = data.active + if (pointed and not activescrollbar) then + pointedY = posy + pointedEnabled = data.active + if not pagestepped and (lmb or mmb or rmb) then + color = WhiteStr + else + color = (active and '\255\128\255\128') or + (enabled and '\255\255\255\128') or '\255\255\128\128' + end + else + color = (active and '\255\064\224\064') or + (enabled and '\255\200\200\064') or '\255\224\064\064' + end + + local tmpName + if (data.fromZip) then + -- FIXME: extra chars not counted in text length + tmpName = WhiteStr .. '*' .. color .. name .. WhiteStr .. '*' + else + tmpName = color .. name + end + + font:Print(color..tmpName, midx, posy + (fontSize*sizeMultiplier) * 0.5, fontSize*sizeMultiplier, "vc") + posy = posy - (yStep*sizeMultiplier) + end + + + -- scrollbar + if #widgetsList < #fullWidgetsList then + sby2 = posy + (yStep * sizeMultiplier) - (fontSpace*sizeMultiplier) * 0.5 + sbheight = sby1 - sby2 + sbsize = sbheight * #widgetsList / #fullWidgetsList + if activescrollbar then + startEntry = math.max(0, math.min( + math.floor(#fullWidgetsList * + ((sby1 - sbsize) - + (my - math.min(scrollbargrabpos, sbsize))) + / sbheight + 0.5), + #fullWidgetsList - curMaxEntries)) + 1 + end + local sizex = maxx - minx + sbposx = minx + sizex + 1.0 + scrollbarOffset + sbposy = sby1 - sbsize - sbheight * (startEntry - 1) / #fullWidgetsList + sbsizex = (yStep * sizeMultiplier) + sbsizey = sbsize + + local trianglePadding = 4*sizeMultiplier + local scrollerPadding = 8*sizeMultiplier + + -- background + --gl.Color(0.0, 0.0, 0.0, 0.2) + --RectRound(sbposx, miny, sbposx + sbsizex, maxy, 6*sizeMultiplier) + if (sbposx < mx and mx < sbposx + sbsizex and miny < my and my < maxy) or activescrollbar then + gl.Color(1,1,1,0.04) + RectRound(sbposx, miny, sbposx + sbsizex, maxy, 6*sizeMultiplier) + end + + --[[gl.Color(1.0, 1.0, 1.0, 0.15) + gl.Shape(GL.TRIANGLES, { + { v = { sbposx + sbsizex / 2, miny + trianglePadding } }, + { v = { sbposx + trianglePadding, sby2 - 1 - trianglePadding} }, + { v = { sbposx + sbsizex - trianglePadding, sby2 - 1 - trianglePadding} } + }) + gl.Shape(GL.TRIANGLES, { + { v = { sbposx + sbsizex / 2, maxy - trianglePadding } }, + { v = { sbposx - trianglePadding + sbsizex, sby2 + sbheight + 1 + trianglePadding} }, + { v = { sbposx + trianglePadding, sby2 + sbheight + 1 + trianglePadding} } + })]]-- + + -- scroller + if (sbposx < mx and mx < sbposx + sbsizex and sby2 < my and my < sby2 + sbheight) then + gl.Color(1.0, 1.0, 1.0, 0.4) + gl.Blending(GL.SRC_ALPHA, GL.ONE) + RectRound(sbposx+scrollerPadding, sbposy, sbposx + sbsizex - scrollerPadding, sbposy + sbsizey, 1.75*sizeMultiplier) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + end + gl.Color(0.33, 0.33, 0.33, 0.8) + RectRound(sbposx+scrollerPadding, sbposy, sbposx + sbsizex - scrollerPadding, sbposy + sbsizey, 1.75*sizeMultiplier) + else + sbposx = 0.0 + sbposy = 0.0 + sbsizex = 0.0 + sbsizey = 0.0 + end + + + -- highlight label + if (sbposx < mx and mx < sbposx + sbsizex and miny < my and my < maxy) or activescrollbar then + + else + if (pointedY) then + gl.Color(1.0, 1.0, 1.0, 0.09) + local xn = minx + 0.5 + local xp = maxx - 0.5 + local yn = pointedY - ((fontSpace * 0.5 + 1)*sizeMultiplier) + local yp = pointedY + ((fontSize + fontSpace * 0.5 + 1)*sizeMultiplier) + if scrollbarOffset < 0 then + xp = xp + scrollbarOffset + --xn = xn - scrollbarOffset + end + yn = yn + 0.5 + yp = yp - 0.5 + gl.Blending(GL.SRC_ALPHA, GL.ONE) + RectRound(xn, yn, xp, yp, 5*sizeMultiplier) + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) +end + end + + font:End() +end + + +function widget:MousePress(x, y, button) + if (Spring.IsGUIHidden()) or not show then + return false + end + + UpdateList() + + if button == 1 then + -- above a button + if minx < x and x < maxx and miny - (buttonTop*sizeMultiplier) - #buttons*(buttonHeight*sizeMultiplier) < y and y < miny - (buttonTop*sizeMultiplier) then + return true + end + + -- above the -/+ + if maxx-10 < x and x < maxx and maxy + bgPadding < y and y < maxy + ((buttonFontSize + 7 + bgPadding)*sizeMultiplier) then + return true + end + if minx < x and x < minx+10 and maxy + bgPadding < y and y < maxy + ((buttonFontSize + 7 + bgPadding)*sizeMultiplier) then + return true + end + + -- above the scrollbar + if ((x >= minx + scrollbarOffset) and (x <= maxx + scrollbarOffset + (yStep * sizeMultiplier))) then + if ((y >= (maxy - bordery)) and (y <= maxy)) then + if x > maxx+scrollbarOffset then + ScrollUp(1) + else + ScrollUp(pageStep) + end + return true + elseif ((y >= miny) and (y <= miny + bordery)) then + if x > maxx+scrollbarOffset then + ScrollDown(1) + else + ScrollDown(pageStep) + end + return true + end + end + + -- above the list + if sbposx < x and x < sbposx + sbsizex and sbposy < y and y < sbposy + sbsizey then + activescrollbar = true + scrollbargrabpos = y - sbposy + return true + elseif sbposx < x and x < sbposx + sbsizex and sby2 < y and y < sby2 + sbheight then + if y > sbposy + sbsizey then + startEntry = math.max(1, math.min(startEntry - curMaxEntries, #fullWidgetsList - curMaxEntries + 1)) + elseif y < sbposy then + startEntry = math.max(1, math.min(startEntry + curMaxEntries, #fullWidgetsList - curMaxEntries + 1)) + end + UpdateListScroll() + pagestepped = true + return true + end + end + + local namedata = self:AboveLabel(x, y) + if (not namedata) then + show = false + return false + end + + + return true + +end + + +function widget:MouseMove(x, y, dx, dy, button) + if show and activescrollbar then + startEntry = math.max(0, math.min(math.floor((#fullWidgetsList * ((sby1 - sbsize) - (y - math.min(scrollbargrabpos, sbsize))) / sbheight) + 0.5), + #fullWidgetsList - curMaxEntries)) + 1 + UpdateListScroll() + return true + end + return false +end + + +function widget:MouseRelease(x, y, mb) + if (Spring.IsGUIHidden()) or not show then + return -1 + end + + UpdateList() + if pagestepped then + pagestepped = false + return true + end + + if mb == 1 and activescrollbar then + activescrollbar = false + scrollbargrabpos = 0.0 + return -1 + end + + if mb == 1 then + if maxx-10 < x and x < maxx and maxy + bgPadding < y and y < maxy + buttonFontSize + 7 + bgPadding then + -- + button + curMaxEntries = curMaxEntries + 1 + UpdateListScroll() + UpdateGeometry() + Spring.WarpMouse(x, y+0.5*(fontSize+fontSpace)) + return -1 + end + if minx < x and x < minx+10 and maxy + bgPadding < y and y < maxy + buttonFontSize + 7 + bgPadding then + -- - button + if curMaxEntries > minMaxEntries then + curMaxEntries = curMaxEntries - 1 + UpdateListScroll() + UpdateGeometry() + Spring.WarpMouse(x, y-0.5*(fontSize+fontSpace)) + end + return -1 + end + end + + if mb == 1 then + local buttonID = nil + for i,_ in ipairs(buttons) do + if minx < x and x < maxx and miny - (buttonTop*sizeMultiplier) - i*(buttonHeight*sizeMultiplier) < y and y < miny - (buttonTop*sizeMultiplier) - (i-1)*(buttonHeight*sizeMultiplier) then + buttonID = i + break + end + end + if buttonID == 1 then + Spring.SendCommands("luarules reloadluaui") + return -1 + end + if buttonID == 2 then + -- disable all widgets, but don't reload + for _,namedata in ipairs(fullWidgetsList) do + widgetHandler:DisableWidget(namedata[1]) + end + widgetHandler:SaveConfigData() + return -1 + end + if buttonID == 3 and allowuserwidgets then + -- tell the widget handler that we allow/disallow user widgets and reload + if widgetHandler.allowUserWidgets then + widgetHandler.__allowUserWidgets = false + Spring.Echo("Disallowed user widgets, reloading...") + else + widgetHandler.__allowUserWidgets = true + Spring.Echo("Allowed user widgets, reloading...") + end + Spring.SendCommands("luarules reloadluaui") + return -1 + end + if buttonID == 4 then + Spring.SendCommands("luaui reset") + return -1 + end + if buttonID == 5 then + Spring.SendCommands("luaui factoryreset") + return -1 + end + end + + local namedata = self:AboveLabel(x, y) + if (not namedata) then + return false + end + + local name = namedata[1] + local data = namedata[2] + + if (mb == 1) then + widgetHandler:ToggleWidget(name) + elseif ((button == 2) or (button == 3)) then + local w = widgetHandler:FindWidget(name) + if (not w) then return -1 end + if (button == 2) then + widgetHandler:LowerWidget(w) + else + widgetHandler:RaiseWidget(w) + end + widgetHandler:SaveConfigData() + end + return -1 +end + + +function widget:AboveLabel(x, y) + if ((x < minx) or (y < (miny + bordery)) or + (x > maxx) or (y > (maxy - bordery))) then + return nil + end + local count = #widgetsList + if (count < 1) then return nil end + + local i = floor(1 + ((maxy - bordery) - y) / (yStep * sizeMultiplier)) + if (i < 1) then i = 1 + elseif (i > count) then i = count end + + return widgetsList[i] +end + + +function widget:IsAbove(x, y) + if not show then return false end + UpdateList() + if ((x < minx) or (x > maxx + (yStep * sizeMultiplier)) or + (y < miny - #buttons*buttonHeight) or (y > maxy+bgPadding)) then + return false + end + return true +end + + +function widget:GetTooltip(x, y) + if not show then return nil end + + UpdateList() + local namedata = self:AboveLabel(x, y) + if (not namedata) then + return '\255\200\255\200'..'Widget Selector\n' .. + '\255\255\255\200'..'LMB: toggle widget\n' .. + '\255\255\200\200'..'MMB: lower widget\n' .. + '\255\200\200\255'..'RMB: raise widget' + end + + local n = namedata[1] + local d = namedata[2] + + local order = widgetHandler.orderList[n] + local enabled = order and (order > 0) + + local tt = (d.active and GreenStr) or (enabled and YellowStr) or RedStr + tt = tt..n..'\n' + tt = d.desc and tt..WhiteStr..d.desc..'\n' or tt + tt = d.author and tt..BlueStr..'Author: '..CyanStr..d.author..'\n' or tt + tt = tt..MagentaStr..d.basename + if (d.fromZip) then + tt = tt..RedStr..' (mod widget)' + end + return tt +end + +function widget:GetConfigData() + local data = {startEntry=startEntry, curMaxEntries=curMaxEntries, show=show} + return data +end + +function widget:SetConfigData(data) + startEntry = data.startEntry or startEntry + curMaxEntries = data.curMaxEntries or curMaxEntries + show = data.show or show +end + +function widget:TextCommand(s) + -- process request to tell the widgetHandler to blank out the widget config when it shuts down + local token = {} + local n = 0 + for w in string.gmatch(s, "%S+") do + n = n + 1 + token[n] = w + end + if n==1 and token[1]=="reset" then + -- tell the widget handler to reload with a blank config + widgetHandler.blankOutConfig = true + Spring.SendCommands("luarules reloadluaui") + end + if n==1 and token[1]=="factoryreset" then + -- tell the widget handler to disallow user widgets and reload with a blank config + widgetHandler.__blankOutConfig = true + widgetHandler.__allowUserWidgets = false + Spring.SendCommands("luarules reloadluaui") + end +end + + + +function widget:Shutdown() + Spring.SendCommands('bind f11 luaui selector') -- if this one is removed or crashes, then have the backup one take over. + + if WG['guishader'] then + WG['guishader'].DeleteDlist('widgetselector') + end + gl.DeleteFont(font) + gl.DeleteFont(font2) +end + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/keep_morphed_selected.lua b/LuaUI/Widgets_Evo/keep_morphed_selected.lua index dd32c9204..d0a6ddda6 100644 --- a/LuaUI/Widgets_Evo/keep_morphed_selected.lua +++ b/LuaUI/Widgets_Evo/keep_morphed_selected.lua @@ -2,24 +2,32 @@ function widget:GetInfo() return { name = "Keep Morpheds Selected", - desc = "Maintain unit selection through morphing", - author = "zwzsg", - version = "1.0", - date = "August, 5th, 2009", + desc = "Maintain unit selection and factory queue (for EvoRTS) through morphing", + author = "zwzsg, modified by CommonPlayer", + version = "1.1", + date = "August, 5th, 2009", --modified by CommonPlayer, May 2018 license = "Public Domain", layer = 0, enabled = true, } end +local spGetFullBuildQueue = Spring.GetFullBuildQueue + local Createds={} local Destroyeds={} +local DestroyedsHasQueue={} + function widget:UnitDestroyed(unitID,unitDefID,teamID) + local x,_,z=Spring.GetUnitPosition(unitID) + if Spring.IsUnitSelected(unitID) then - local x,_,z=Spring.GetUnitPosition(unitID) table.insert(Destroyeds,{u=unitID,x=x,z=z,t=teamID}) end + + local queue = spGetFullBuildQueue(unitID) + if queue[1] and UnitDefs[unitDefID].isFactory then table.insert(DestroyedsHasQueue, {u=unitID,x=x,z=z,t=teamID,queue=queue}) end end function widget:UnitCreated(unitID,unitDefID,teamID) @@ -29,6 +37,32 @@ end function widget:GameFrame(frameNum) local ToReSelect={} + + for _,c in ipairs(Createds) do + --Spring.Echo("#DesQuee" .. #DestroyedsHasQueue) + for _,d in ipairs(DestroyedsHasQueue) do + if c.x==d.x and c.z==d.z and c.t==d.t then + for i = 1, #d.queue do + for k, v in pairs(d.queue[i]) do + local oldName = UnitDefs[k].name + local newName = oldName .. "_up1" + if oldName:find("_up1") then newName = oldName:gsub("_up1", "_up2") + elseif oldName:find("_up2") then newName = oldName:gsub("_up2", "_up3") end + local uDefName = UnitDefNames[newName] + if uDefName then + for _ = 1, v do Spring.GiveOrderToUnit(c.u, -uDefName.id, {}, 0) end + --Spring.Echo(UnitDefs[k].name .. "___" .. v) + --Spring.Echo(uDefName.id) + else + for _ = 1, v do Spring.GiveOrderToUnit(c.u, -UnitDefs[k].id, {}, 0) end + end + end + end + end + end + end + + for _,c in ipairs(Createds) do for _,d in ipairs(Destroyeds) do if c.x==d.x and c.z==d.z and c.t==d.t then @@ -41,5 +75,6 @@ function widget:GameFrame(frameNum) end Createds={} Destroyeds={} + + DestroyedsHasQueue={} end - diff --git a/LuaUI/Widgets_Evo/map_startbox.lua b/LuaUI/Widgets_Evo/map_startbox.lua new file mode 100644 index 000000000..511b31b1e --- /dev/null +++ b/LuaUI/Widgets_Evo/map_startbox.lua @@ -0,0 +1,616 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: minimap_startbox.lua +-- brief: shows the startboxes in the minimap +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Start Boxes", + desc = "Displays Start Boxes and Start Points", + author = "trepan, jK", + date = "2007-2009", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if (Game.startPosType ~= 2) then + return false +end + +if (Spring.GetGameFrame() > 1) then + widgetHandler:RemoveWidget(self) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- config options +-- + +-- enable simple version by default though +local drawGroundQuads = true + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 50 +local fontfileOutlineSize = 10 +local fontfileOutlineStrength = 1.7 +local fontfileOutlineStrength2 = 10 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local shadowFont = gl.LoadFont(fontfile, fontfileSize*fontfileScale, 35*fontfileScale, 1.5) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength2) + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local useThickLeterring = true +local heightOffset = 50 +local fontSize = 18 +local fontShadow = true -- only shows if font has a white outline +local shadowOpacity = 0.35 + +local infotext = "Pick a startspot within the green area, and click the Ready button. (F4 shows metal spots)" +local infotextFontsize = 13 + +local comnameList = {} +local drawShadow = fontShadow +local usedFontSize = fontSize + +local widgetScale = (1 + (vsx*vsy / 5500000)) + +local gl = gl -- use a local copy for faster access + +local msx = Game.mapSizeX +local msz = Game.mapSizeZ + +local xformList = 0 +local coneList = 0 +local startboxDListStencil = 0 +local startboxDListColor = 0 + +local isSpec = Spring.GetSpectatingState() or Spring.IsReplay() + +local gaiaTeamID +local gaiaAllyTeamID + +local startTimer = Spring.GetTimer() + +local texName = LUAUI_DIRNAME .. 'Images/highlight_strip.png' +local texScale = 512 + + +local GetUnitTeam = Spring.GetUnitTeam +local GetTeamInfo = Spring.GetTeamInfo +local GetPlayerInfo = Spring.GetPlayerInfo +local GetPlayerList = Spring.GetPlayerList +local GetTeamColor = Spring.GetTeamColor +local GetVisibleUnits = Spring.GetVisibleUnits +local GetUnitDefID = Spring.GetUnitDefID +local GetAllUnits = Spring.GetAllUnits +local IsUnitInView = Spring.IsUnitInView +local GetCameraPosition = Spring.GetCameraPosition +local GetUnitPosition = Spring.GetUnitPosition +local GetFPS = Spring.GetFPS + +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glDepthTest = gl.DepthTest +local glAlphaTest = gl.AlphaTest +local glColor = gl.Color +local glText = gl.Text +local glTranslate = gl.Translate +local glBillboard = gl.Billboard +local glDrawFuncAtUnit = gl.DrawFuncAtUnit +local glDrawListAtUnit = gl.DrawListAtUnit +local GL_GREATER = GL.GREATER +local GL_SRC_ALPHA = GL.SRC_ALPHA +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local glBlending = gl.Blending +local glScale = gl.Scale + +local glCreateList = gl.CreateList +local glBeginEnd = gl.BeginEnd +local glDeleteList = gl.DeleteList +local glCallList = gl.CallList + +-------------------------------------------------------------------------------- + +GL.KEEP = 0x1E00 +GL.INCR_WRAP = 0x8507 +GL.DECR_WRAP = 0x8508 +GL.INCR = 0x1E02 +GL.DECR = 0x1E03 +GL.INVERT = 0x150A + +local stencilBit1 = 0x01 +local stencilBit2 = 0x10 + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DrawMyBox(minX,minY,minZ, maxX,maxY,maxZ) + gl.BeginEnd(GL.QUADS, function() + --// top + gl.Vertex(minX, maxY, minZ); + gl.Vertex(maxX, maxY, minZ); + gl.Vertex(maxX, maxY, maxZ); + gl.Vertex(minX, maxY, maxZ); + --// bottom + gl.Vertex(minX, minY, minZ); + gl.Vertex(minX, minY, maxZ); + gl.Vertex(maxX, minY, maxZ); + gl.Vertex(maxX, minY, minZ); + end); + gl.BeginEnd(GL.QUAD_STRIP, function() + --// sides + gl.Vertex(minX, minY, minZ); + gl.Vertex(minX, maxY, minZ); + gl.Vertex(minX, minY, maxZ); + gl.Vertex(minX, maxY, maxZ); + gl.Vertex(maxX, minY, maxZ); + gl.Vertex(maxX, maxY, maxZ); + gl.Vertex(maxX, minY, minZ); + gl.Vertex(maxX, maxY, minZ); + gl.Vertex(minX, minY, minZ); + gl.Vertex(minX, maxY, minZ); + end); +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +local function createComnameList(x, y, name, teamID, color) + comnameList[teamID] = {} + comnameList[teamID]['x'] = math.floor(x) + comnameList[teamID]['y'] = math.floor(y) + comnameList[teamID]['list'] = gl.CreateList( function() + local outlineColor = {0,0,0,1} + if (color[1] + color[2]*1.2 + color[3]*0.4) < 0.8 then + outlineColor = {1,1,1,1} + end + if useThickLeterring then + if outlineColor[1] == 1 and fontShadow then + glTranslate(0, -(usedFontSize/44), 0) + shadowFont:Begin() + shadowFont:SetTextColor({0,0,0,shadowOpacity}) + shadowFont:SetOutlineColor({0,0,0,shadowOpacity}) + shadowFont:Print(name, x, y, usedFontSize, "con") + shadowFont:End() + glTranslate(0, (usedFontSize/44), 0) + end + font2:Begin() + font2:SetTextColor(outlineColor) + font2:SetOutlineColor(outlineColor) + + font2:Print(name, x-(usedFontSize/38), y-(usedFontSize/33), usedFontSize, "con") + font2:Print(name, x+(usedFontSize/38), y-(usedFontSize/33), usedFontSize, "con") + font2:End() + end + font2:Begin() + font2:SetTextColor(color) + font2:SetOutlineColor(outlineColor) + font2:Print(name, x, y, usedFontSize, "con") + font2:End() + end) +end + +local function DrawName(x, y, name, teamID, color) + -- not optimal, everytime you move camera the x and y are different so it has to recreate the drawlist + if comnameList[teamID] == nil or comnameList[teamID]['x'] ~= math.floor(x) or comnameList[teamID]['y'] ~= math.floor(y) then -- using floor because the x and y values had a a tiny change each frame + if comnameList[teamID] ~= nil then + gl.DeleteList(comnameList[teamID]['list']) + end + createComnameList(x, y, name, teamID, color) + end + glCallList(comnameList[teamID]['list']) +end + + +function createInfotextList() + if infotextList then + gl.DeleteList(infotextList) + end + infotextList = gl.CreateList(function() + font:Begin() + font:SetTextColor(0.75,0.75,0.75,1) + font:Print(infotext, 0,0, infotextFontsize*widgetScale, "cno") + font:End() + end) +end + +function widget:Initialize() + -- only show at the beginning + if (Spring.GetGameFrame() > 1) then + widgetHandler:RemoveWidget(self) + return + end + + createInfotextList() + + -- get the gaia teamID and allyTeamID + gaiaTeamID = Spring.GetGaiaTeamID() + if (gaiaTeamID) then + gaiaAllyTeamID = select(6,Spring.GetTeamInfo(gaiaTeamID,false)) + end + + -- flip and scale (using x & y for gl.Rect()) + xformList = gl.CreateList(function() + gl.LoadIdentity() + gl.Translate(0, 1, 0) + gl.Scale(1 / msx, -1 / msz, 1) + end) + + -- cone list for world start positions + coneList = gl.CreateList(function() + local h = 100 + local r = 25 + local divs = 32 + gl.BeginEnd(GL.TRIANGLE_FAN, function() + gl.Vertex( 0, h, 0) + for i = 0, divs do + local a = i * ((math.pi * 2) / divs) + local cosval = math.cos(a) + local sinval = math.sin(a) + gl.Vertex(r * sinval, 0, r * cosval) + end + end) + end) + + if (drawGroundQuads) then + startboxDListStencil = gl.CreateList(function() + local minY,maxY = Spring.GetGroundExtremes() + minY = minY - 200; maxY = maxY + 500; + for _,at in ipairs(Spring.GetAllyTeamList()) do + if (true or at ~= gaiaAllyTeamID) then + local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) + if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then + + if (at == Spring.GetMyAllyTeamID()) then + gl.StencilMask(stencilBit2); + gl.StencilFunc(GL.ALWAYS, 0, stencilBit2); + else + gl.StencilMask(stencilBit1); + gl.StencilFunc(GL.ALWAYS, 0, stencilBit1); + end + DrawMyBox(xn-1,minY,zn-1, xp+1,maxY,zp+1) + + end + end + end + end) + + startboxDListColor = gl.CreateList(function() + local minY,maxY = Spring.GetGroundExtremes() + minY = minY - 200; maxY = maxY + 500; + for _,at in ipairs(Spring.GetAllyTeamList()) do + if (true or at ~= gaiaAllyTeamID) then + local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) + if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then + + if (at == Spring.GetMyAllyTeamID()) then + gl.Color( 0, 1, 0, 0.22 ) -- green + gl.StencilMask(stencilBit2); + gl.StencilFunc(GL.NOTEQUAL, 0, stencilBit2); + else + gl.Color( 1, 0, 0, 0.22 ) -- red + gl.StencilMask(stencilBit1); + gl.StencilFunc(GL.NOTEQUAL, 0, stencilBit1); + end + DrawMyBox(xn-1,minY,zn-1, xp+1,maxY,zp+1) + + end + end + end + end) + end +end + + +function removeLists() + gl.DeleteList(infotextList) + gl.DeleteList(xformList) + gl.DeleteList(coneList) + gl.DeleteList(startboxDListStencil) + gl.DeleteList(startboxDListColor) + removeTeamLists() +end + +function widget:Shutdown() + removeLists() + gl.DeleteFont(font) + gl.DeleteFont(shadowFont) +end + + +function removeTeamLists() + for _, teamID in ipairs(Spring.GetTeamList()) do + if comnameList[teamID] ~= nil then + gl.DeleteList(comnameList[teamID].list) + end + end + comnameList = {} +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local teamColors = {} + +local function GetTeamColor(teamID) + local color = teamColors[teamID] + if (color) then + return color + end + local r,g,b = Spring.GetTeamColor(teamID) + + color = { r, g, b } + teamColors[teamID] = color + return color +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local teamColorStrs = {} + + +local function GetTeamColorStr(teamID) + local colorSet = teamColorStrs[teamID] + if (colorSet) then + return colorSet[1], colorSet[2] + end + + local outlineChar = '' + local r,g,b = Spring.GetTeamColor(teamID) + if (r and g and b) then + local function ColorChar(x) + local c = math.floor(x * 255) + c = ((c <= 1) and 1) or ((c >= 255) and 255) or c + return string.char(c) + end + local colorStr + colorStr = '\255' + colorStr = colorStr .. ColorChar(r) + colorStr = colorStr .. ColorChar(g) + colorStr = colorStr .. ColorChar(b) + local i = (r * 0.299) + (g * 0.587) + (b * 0.114) + outlineChar = ((i > 0.25) and 'o') or 'O' + teamColorStrs[teamID] = { colorStr, outlineChar } + return colorStr, "s",outlineChar + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DrawStartboxes3dWithStencil() + gl.DepthMask(false); + if (gl.DepthClamp) then gl.DepthClamp(true); end + + gl.DepthTest(true); + gl.StencilTest(true); + gl.ColorMask(false, false, false, false); + gl.Culling(false); + + gl.StencilOp(GL.KEEP, GL.INVERT, GL.KEEP); + + gl.CallList(startboxDListStencil); --// draw + + gl.Culling(GL.BACK); + gl.DepthTest(false); + + gl.ColorMask(true, true, true, true); + + gl.CallList(startboxDListColor); --// draw + + if (gl.DepthClamp) then gl.DepthClamp(false); end + gl.StencilTest(false); + gl.DepthTest(true); + gl.Culling(false); +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:DrawWorld() + --gl.Fog(false) + + local time = Spring.DiffTimers(Spring.GetTimer(), startTimer) + + -- show the ally startboxes + DrawStartboxes3dWithStencil() + + -- show the team start positions + for _, teamID in ipairs(Spring.GetTeamList()) do + local _,_,spec = Spring.GetPlayerInfo(select(2,Spring.GetTeamInfo(teamID,false)),false) + if ((not spec) and (teamID ~= gaiaTeamID)) then + local x, y, z = Spring.GetTeamStartPosition(teamID) + local isNewbie = (Spring.GetTeamRulesParam(teamID, 'isNewbie') == 1) -- =1 means the startpoint will be replaced and chosen by initial_spawn + if (x ~= nil and x > 0 and z > 0 and y > -500) and not isNewbie then + local color = GetTeamColor(teamID) + local alpha = 0.5 + math.abs(((time * 3) % 1) - 0.5) + gl.PushMatrix() + gl.Translate(x, y, z) + gl.Color(color[1], color[2], color[3], alpha) + gl.CallList(coneList) + gl.PopMatrix() + end + end + end + + --gl.Fog(true) +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:DrawScreenEffects() + -- show the names over the team start positions + --gl.Fog(false) + for _, teamID in ipairs(Spring.GetTeamList()) do + local name,_,spec = Spring.GetPlayerInfo(select(2,Spring.GetTeamInfo(teamID,false)),false) + local isNewbie = (Spring.GetTeamRulesParam(teamID, 'isNewbie') == 1) -- =1 means the startpoint will be replaced and chosen by initial_spawn + if (name ~= nil) and ((not spec) and (teamID ~= gaiaTeamID)) and not isNewbie then + local colorStr, outlineStr = GetTeamColorStr(teamID) + local x, y, z = Spring.GetTeamStartPosition(teamID) + if (x ~= nil and x > 0 and z > 0 and y > -500) then + local sx, sy, sz = Spring.WorldToScreenCoords(x, y + 120, z) + if (sz < 1) then + + DrawName(sx, sy, name, teamID, GetTeamColor(teamID)) + + end + end + end + end + --gl.Fog(true) +end + + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + if not isSpec then + gl.PushMatrix() + gl.Translate(vsx/2, vsy/6.2, 0) + gl.Scale(1*widgetScale, 1*widgetScale, 1) + gl.CallList(infotextList) + gl.PopMatrix() + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:DrawInMiniMap(sx, sz) + -- only show at the beginning + if (Spring.GetGameFrame() > 1) then + widgetHandler:RemoveWidget(self) + end + + gl.PushMatrix() + gl.CallList(xformList) + + gl.LineWidth(1.49) + + local gaiaAllyTeamID + local gaiaTeamID = Spring.GetGaiaTeamID() + if (gaiaTeamID) then + gaiaAllyTeamID = select(6,Spring.GetTeamInfo(gaiaTeamID,false)) + end + + -- show all start boxes + for _,at in ipairs(Spring.GetAllyTeamList()) do + if (at ~= gaiaAllyTeamID) then + local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) + if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then + local color + if (at == Spring.GetMyAllyTeamID()) then + color = { 0, 1, 0, 0.1 } -- green + else + color = { 1, 0, 0, 0.1 } -- red + end + gl.Color(color) + gl.Rect(xn, zn, xp, zp) + color[4] = 0.5 -- pump up the volume + gl.Color(color) + gl.PolygonMode(GL.FRONT_AND_BACK, GL.LINE) + gl.Rect(xn, zn, xp, zp) + gl.PolygonMode(GL.FRONT_AND_BACK, GL.FILL) + end + end + end + + gl.PushAttrib(GL_HINT_BIT) + --gl.Smoothing(true) --enable point smoothing + + -- show the team start positions + for _, teamID in ipairs(Spring.GetTeamList()) do + local _,_,spec = Spring.GetPlayerInfo(select(2,Spring.GetTeamInfo(teamID,false)),false) + if ((not spec) and (teamID ~= gaiaTeamID)) then + local x, y, z = Spring.GetTeamStartPosition(teamID) + local isNewbie = (Spring.GetTeamRulesParam(teamID, 'isNewbie') == 1) -- =1 means the startpoint will be replaced and chosen by initial_spawn + if (x ~= nil and x > 0 and z > 0 and y > -500) and not isNewbie then + local color = GetTeamColor(teamID) + local r, g, b = color[1], color[2], color[3] + local time = Spring.DiffTimers(Spring.GetTimer(), startTimer) + local i = 2 * math.abs(((time * 3) % 1) - 0.5) + gl.PointSize(11) + gl.Color(i, i, i) + gl.BeginEnd(GL.POINTS, gl.Vertex, x, z) + gl.PointSize(7.5) + gl.Color(r, g, b) + gl.BeginEnd(GL.POINTS, gl.Vertex, x, z) + end + end + end + + gl.LineWidth(1.0) + gl.PointSize(1.0) + gl.PopAttrib() --reset point smoothing + gl.PopMatrix() +end + + +function widget:ViewResize(x, y) + vsx,vsy = x,y + widgetScale = (0.75 + (vsx*vsy / 7500000)) + removeTeamLists() + usedFontSize = fontSize * widgetScale + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + gl.DeleteFont(shadowFont) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength2) + shadowFont = gl.LoadFont(fontfile, fontfileSize*fontfileScale, 35*fontfileScale, 1.6) + createInfotextList() + end +end + + +-- reset needed when waterlevel has changed by gadget (modoption) +local resetsec = 0 +local resetted = false +local doWaterLevelCheck = false +if (Spring.GetModOptions() ~= nil and Spring.GetModOptions().map_waterlevel ~= 0) then + doWaterLevelCheck = true +end + +local groundHeightPoint = Spring.GetGroundHeight(0,0) +function widget:Update(dt) + if (doWaterLevelCheck and not resetted) or (Spring.IsCheatingEnabled() and Spring.GetGroundHeight(0,0) ~= groundHeightPoint)then + resetsec = resetsec + dt + if resetsec > 1 then + groundHeightPoint = Spring.GetGroundHeight(0,0) + resetted = true + removeLists() + widget:Initialize() + end + end +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/minimap_events.lua b/LuaUI/Widgets_Evo/minimap_events.lua deleted file mode 100644 index 5884bab04..000000000 --- a/LuaUI/Widgets_Evo/minimap_events.lua +++ /dev/null @@ -1,484 +0,0 @@ --- $Id: minimap_events.lua 3171 2008-11-06 09:06:29Z det $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: minimap_events.lua --- brief: display ally events and battle damages in the minimap --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "MinimapEvents", - desc = "Display ally events and battle damages in the minimap", - author = "trepan", - date = "Jul 16, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- Automatically generated local definitions - -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_ONE = GL.ONE -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_POINTS = GL.POINTS -local GL_QUADS = GL.QUADS -local GL_SRC_ALPHA = GL.SRC_ALPHA -local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN -local glBeginEnd = gl.BeginEnd -local glBlending = gl.Blending -local glCallList = gl.CallList -local glColor = gl.Color -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glLineWidth = gl.LineWidth -local glLoadIdentity = gl.LoadIdentity -local glPopMatrix = gl.PopMatrix -local glPushMatrix = gl.PushMatrix -local glRotate = gl.Rotate -local glScale = gl.Scale -local glSmoothing = gl.Smoothing -local glTexCoord = gl.TexCoord -local glTranslate = gl.Translate -local glVertex = gl.Vertex -local glTexture = gl.Texture -local spGetFrameTimeOffset = Spring.GetFrameTimeOffset -local spGetGameSeconds = Spring.GetGameSeconds -local spGetUnitPosition = Spring.GetUnitPosition -local spGetUnitViewPosition = Spring.GetUnitViewPosition -local spIsUnitAllied = Spring.IsUnitAllied - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- TODO: --- - texture atlas for different event types (animated?) --- - better clamping and default scales --- - remove unneeded lists (circle, point, rect) --- - varied alpha? --- - option for local team only (no allied events) --- - speed-ups ... - --- --- event = { --- u = unitID --- v = pixels value --- x = x position --- z = z position --- c = color --- } --- --- damage = { --- u = unitID --- v = damage value (pixels) --- p = paralyze value (pixels) --- } --- - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local lineWidth = 2 -- set to 0 to remove outlines - -local eventScale = 0.02 - -local doDamages = true - -local fracScale = 50 -local healthScale = 0 -- 0.001 - -local paraFracScale = fracScale * 0.25 -local paraHealthScale = healthScale * 0 - -local alpha = 0.3 -local deathColor = { 1.0, 0.2, 0.2, alpha } -local takenColor = { 1.0, 0.0, 1.0, alpha } -local createColor = { 0.0, 1.0, 0.0, alpha } -local stockpileColor = { 1.0, 1.0, 1.0, alpha } -local damageColor = { 1.0, 1.0, 0.0, alpha } -local paralyzeColor = { 0.0, 0.0, 1.0, alpha } - -local limit = 0.1 - -local minAlpha = 0.4 -local minPixels = 5.0 - - --------------------------------------------------------------------------------- - -local gl = gl - -local gameSecs = 0 -local gamestart = false - -local xMapSize = Game.mapX * 512 -local yMapSize = Game.mapY * 512 -local pxScale = 1 -- (xMapSize / minimap xPixels) -local pyScale = 1 -- (yMapSize / minimap yPixels) - -local rectList = 0 - -local pointList = 0 - -local circleDivs = 16 -local circleList = 0 - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local eventMap = {} - -local damageMap = {} - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function GetGameSecs() - return spGetGameSeconds() + spGetFrameTimeOffset() -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GameStart() - gamestart = true -end - -local function CreateLists() -circleList = glCreateList(function() - glBeginEnd(GL_TRIANGLE_FAN, function() - for i = 0, circleDivs - 1 do - local r = 2.0 * math.pi * (i / circleDivs) - local cosv = math.cos(r) - local sinv = math.sin(r) - --glTexCoord(cosv, sinv) - glVertex(cosv, 0, sinv) - end - end) - if (lineWidth > 0) then - glBeginEnd(GL_LINE_LOOP, function() - for i = 0, circleDivs - 1 do - local r = 2.0 * math.pi * (i / circleDivs) - local cosv = math.cos(r) - local sinv = math.sin(r) - --glTexCoord(cosv, sinv) - glVertex(cosv, 0, sinv) - end - end) - end - end) - pointList = glCreateList(function() - glBeginEnd(GL_POINTS, function() - glVertex(0, 0, 0) - end) - end) - rectList = glCreateList(function() - glBeginEnd(GL_QUADS, function() - --glTexCoord(0, 0); - glVertex(-1, 0, -1) - --glTexCoord(1, 0); - glVertex( 1, 0, -1) - --glTexCoord(1, 1); - glVertex( 1, 0, 1) - --glTexCoord(0, 1); - glVertex(-1, 0, 1) - end) - end) -end - -function widget:Initialize() - - gameSecs = GetGameSecs() - gamestart = gameSecs > 0 - - -end - - -function widget:Shutdown() - glDeleteList(rectList) - glDeleteList(pointList) - glDeleteList(circleList) -end - - --------------------------------------------------------------------------------- - -function widget:Update(dt) - - local gs = GetGameSecs() - if (gs == gameSecs) then - return - end --- dt = gs - gameSecs - gameSecs = gs - - local scale = (1 - (4 * dt)) - - for unitID, d in pairs(eventMap) do - local v = d.v - v = v * scale - if (v < limit) then - eventMap[unitID] = nil - else - d.v = v - end - end - - for unitID, d in pairs(damageMap) do - local v = d.v * scale - local p = d.p * scale - - if (v > limit) then - d.v = v - else - if (p > limit) then - d.v = 0 - else - damageMap[unitID] = nil - end - end - - if (p > 1) then - d.p = p - else - if (v > 1) then - d.p = 0 - else - damageMap[unitID] = nil - end - end - end -end - - --------------------------------------------------------------------------------- - -local function AddEvent(unitID, unitDefID, color, cost) - if (not spIsUnitAllied(unitID)) then - return - end - local ud = UnitDefs[unitDefID] - if ((ud == nil) or ud.isFeature) then - return - end - local px, py, pz = spGetUnitPosition(unitID) - if (px and pz) then - eventMap[unitID] = { - x = px, - z = pz, - v = cost or (ud.cost * eventScale), - u = unitID, - c = color, --- t = GetGameSeconds() - } - end -end - - -function widget:UnitFinished(unitID, unitDefID, unitTeam) - if not gamestart then return end - AddEvent(unitID, unitDefID, createColor) -end - - -function widget:UnitDestroyed(unitID, unitDefID, unitTeam) - damageMap[unitID] = nil - AddEvent(unitID, unitDefID, deathColor) -end - - -function widget:UnitTaken(unitID, unitDefID) - damageMap[unitID] = nil - AddEvent(unitID, unitDefID, takenColor) -end - - -function widget:StockpileChanged(unitID, unitDefID, unitTeam, - weaponNum, oldCount, newCount) - if (newCount > oldCount) then - AddEvent(unitID, unitDefID, stockpileColor, 100) - end -end - - --------------------------------------------------------------------------------- - -function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - if (not doDamages) then - return - end - if (not spIsUnitAllied(unitID)) then - return - end - if (damage <= 0) then - return - end - - local ud = UnitDefs[unitDefID] - if (ud == nil) then - return - end - - -- clamp the damage - damage = math.min(ud.health, damage) - - -- scale the damage value - if (paralyzer) then - damage = (paraHealthScale * damage) + - (paraFracScale * (damage / ud.health)) - else - damage = (healthScale * damage) + - (fracScale * (damage / ud.health)) - end - - - local d = damageMap[unitID] - if (d ~= nil) then - if (paralyzer) then - d.p = d.p + damage - else - d.v = d.v + damage - end - else - d = {} - d.u = unitID --- d.t = GetGameSeconds() - if (paralyzer) then - d.v = 0 - d.p = math.max(1, damage) - else - d.v = math.max(1, damage) - d.p = 0 - end - damageMap[unitID] = d - end - if d.v > 0 and d.v < minPixels then d.v = minPixels end - if d.p >0 and d.p < minPixels then d.p = minPixels end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function DrawEvent(event) - local pixels = event.v - - local color = event.c - color[4] = alpha - - local scale = minPixels + pixels - - glPushMatrix() - glTranslate(event.x, 0, event.z) - glScale(scale * pxScale, 1, scale * pyScale) - glColor(color) - glCallList(circleList) - glPopMatrix() -end - - -local function DrawDamage(damage) - - local px, py, pz = spGetUnitViewPosition(damage.u) - if (px == nil) then - return - end - - - local pixels = damage.v - - if (pixels > 0) then - - local scale = minPixels + pixels - - glPushMatrix() - glTranslate(px, 0, pz) - glScale(scale * pxScale, 1, scale * pyScale) - glColor(damageColor) - glCallList(circleList) - glPopMatrix() - end - - pixels = damage.p - if (pixels > 0) then - - local scale = minPixels + pixels - - glPushMatrix() - glTranslate(px, 0, pz) - glScale(scale * pxScale, 1, scale * pyScale) - glColor(paralyzeColor) - glCallList(circleList) - glPopMatrix() - end - -end - - --------------------------------------------------------------------------------- - -function widget:DrawInMiniMap(xSize, ySize) - if ((next(eventMap) == nil) and - (next(damageMap) == nil)) then - return - end - - if circleList == 0 then - CreateLists() - end - - glSmoothing(false, false, false) - glBlending(GL_SRC_ALPHA, GL_ONE) - glLineWidth(lineWidth) - glTexture(false) - gl.Lighting(false) - - -- setup the pixel scales - pxScale = xMapSize / xSize - pyScale = yMapSize / ySize - - glPushMatrix() - - glLoadIdentity() - glTranslate(0, 1, 0) - glScale(1 / xMapSize, -1 / yMapSize,1) - glRotate(270, 1, 0, 0) - - -- draw damages before events - for _,damage in pairs(damageMap) do - DrawDamage(damage) - end - - for _,event in pairs(eventMap) do - DrawEvent(event) - end - - glPopMatrix() - - glLineWidth(1) - glColor(1,1,1,1) - gl.Lighting(true) - glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glSmoothing(true, true, false) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/minimap_relative.lua b/LuaUI/Widgets_Evo/minimap_relative.lua new file mode 100644 index 000000000..cd1052173 --- /dev/null +++ b/LuaUI/Widgets_Evo/minimap_relative.lua @@ -0,0 +1,82 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: minimap_relative.lua +-- brief: keeps the minimap at a relative size (maxspect) +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "RelativeMinimap", + desc = "Keeps the minimap at a relative size (maxspect)", + author = "trepan", + date = "Feb 5, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Adjust these setting to your liking +-- + +-- offsets, in pixels +local xoff = 2 +local yoff = 2 + +-- maximum fraction of screen size, +-- set one value to 1 to calibrate the other +local xmax = 0.262 +local ymax = 0.310 + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Make sure these are floored +-- + +xoff = math.floor(xoff) +yoff = math.floor(yoff) + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:Initialize() + widget:ViewResize(widgetHandler:GetViewSizes()) +end + + +function widget:ViewResize(viewSizeX, viewSizeY) + -- the extra 2 pixels are for the minimap border + local xp = math.floor(viewSizeX * xmax) - xoff - 2 + local yp = math.floor(viewSizeY * ymax) - yoff - 2 + local limitAspect = (xp / yp) + local mapAspect = (Game.mapSizeX / Game.mapSizeZ) + + local sx, sy + if (mapAspect > limitAspect) then + sx = xp + sy = xp / mapAspect + else + sx = yp * mapAspect + sy = yp + end + sx = math.floor(sx) + sy = math.floor(sy) + gl.ConfigMiniMap(xoff, viewSizeY - sy - yoff, sx, sy) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/minimap_startbox.lua b/LuaUI/Widgets_Evo/minimap_startbox.lua deleted file mode 100644 index 9697c721e..000000000 --- a/LuaUI/Widgets_Evo/minimap_startbox.lua +++ /dev/null @@ -1,420 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: minimap_startbox.lua --- brief: shows the startboxes in the minimap --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "MiniMap Start Boxes", - desc = "MiniMap Start Boxes", - author = "trepan, jK", - date = "2007-2009", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (Game.startPosType ~= 2) then - return false -end - -if (Spring.GetGameFrame() > 1) then - widgetHandler:RemoveWidget() -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- config options --- - --- enable simple version by default though -local drawGroundQuads = true - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local gl = gl -- use a local copy for faster access - -local msx = Game.mapSizeX -local msz = Game.mapSizeZ - -local xformList = 0 -local coneList = 0 -local startboxDListStencil = 0 -local startboxDListColor = 0 - -local gaiaTeamID -local gaiaAllyTeamID - -local startTimer = Spring.GetTimer() - -local texName = LUAUI_DIRNAME .. 'Images/highlight_strip.png' -local texScale = 512 - --------------------------------------------------------------------------------- - -GL.KEEP = 0x1E00 -GL.INCR_WRAP = 0x8507 -GL.DECR_WRAP = 0x8508 -GL.INCR = 0x1E02 -GL.DECR = 0x1E03 -GL.INVERT = 0x150A - -local stencilBit1 = 0x01 -local stencilBit2 = 0x10 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function DrawMyBox(minX,minY,minZ, maxX,maxY,maxZ) - gl.BeginEnd(GL.QUADS, function() - --// top - gl.Vertex(minX, maxY, minZ); - gl.Vertex(maxX, maxY, minZ); - gl.Vertex(maxX, maxY, maxZ); - gl.Vertex(minX, maxY, maxZ); - --// bottom - gl.Vertex(minX, minY, minZ); - gl.Vertex(minX, minY, maxZ); - gl.Vertex(maxX, minY, maxZ); - gl.Vertex(maxX, minY, minZ); - end); - gl.BeginEnd(GL.QUAD_STRIP, function() - --// sides - gl.Vertex(minX, minY, minZ); - gl.Vertex(minX, maxY, minZ); - gl.Vertex(minX, minY, maxZ); - gl.Vertex(minX, maxY, maxZ); - gl.Vertex(maxX, minY, maxZ); - gl.Vertex(maxX, maxY, maxZ); - gl.Vertex(maxX, minY, minZ); - gl.Vertex(maxX, maxY, minZ); - gl.Vertex(minX, minY, minZ); - gl.Vertex(minX, maxY, minZ); - end); -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - -- only show at the beginning - if (Spring.GetGameFrame() > 1) then - widgetHandler:RemoveWidget() - return - end - - -- get the gaia teamID and allyTeamID - gaiaTeamID = Spring.GetGaiaTeamID() - if (gaiaTeamID) then - local _,_,_,_,_,atid = Spring.GetTeamInfo(gaiaTeamID) - gaiaAllyTeamID = atid - end - - -- flip and scale (using x & y for gl.Rect()) - xformList = gl.CreateList(function() - gl.LoadIdentity() - gl.Translate(0, 1, 0) - gl.Scale(1 / msx, -1 / msz, 1) - end) - - -- cone list for world start positions - coneList = gl.CreateList(function() - local h = 100 - local r = 25 - local divs = 32 - gl.BeginEnd(GL.TRIANGLE_FAN, function() - gl.Vertex( 0, h, 0) - for i = 0, divs do - local a = i * ((math.pi * 2) / divs) - local cosval = math.cos(a) - local sinval = math.sin(a) - gl.Vertex(r * sinval, 0, r * cosval) - end - end) - end) - - if (drawGroundQuads) then - startboxDListStencil = gl.CreateList(function() - local minY,maxY = Spring.GetGroundExtremes() - minY = minY - 200; maxY = maxY + 100; - for _,at in ipairs(Spring.GetAllyTeamList()) do - if (true or at ~= gaiaAllyTeamID) then - local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) - if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then - - if (at == Spring.GetMyAllyTeamID()) then - gl.StencilMask(stencilBit2); - gl.StencilFunc(GL.ALWAYS, 0, stencilBit2); - else - gl.StencilMask(stencilBit1); - gl.StencilFunc(GL.ALWAYS, 0, stencilBit1); - end - DrawMyBox(xn,minY,zn, xp,maxY,zp) - - end - end - end - end) - - startboxDListColor = gl.CreateList(function() - local minY,maxY = Spring.GetGroundExtremes() - minY = minY - 200; maxY = maxY + 100; - for _,at in ipairs(Spring.GetAllyTeamList()) do - if (true or at ~= gaiaAllyTeamID) then - local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) - if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then - - if (at == Spring.GetMyAllyTeamID()) then - gl.Color( 0, 1, 0, 0.3 ) -- green - gl.StencilMask(stencilBit2); - gl.StencilFunc(GL.NOTEQUAL, 0, stencilBit2); - else - gl.Color( 1, 0, 0, 0.3 ) -- red - gl.StencilMask(stencilBit1); - gl.StencilFunc(GL.NOTEQUAL, 0, stencilBit1); - end - DrawMyBox(xn,minY,zn, xp,maxY,zp) - - end - end - end - end) - end -end - - -function widget:Shutdown() - gl.DeleteList(xformList) - gl.DeleteList(coneList) - gl.DeleteList(startboxDListStencil) - gl.DeleteList(startboxDListColor) -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local teamColors = {} - -local function GetTeamColor(teamID) - local color = teamColors[teamID] - if (color) then - return color - end - local r,g,b = Spring.GetTeamColor(teamID) - - color = { r, g, b } - teamColors[teamID] = color - return color -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local teamColorStrs = {} - - -local function GetTeamColorStr(teamID) - local colorSet = teamColorStrs[teamID] - if (colorSet) then - return colorSet[1], colorSet[2] - end - - local outlineChar = '' - local r,g,b = Spring.GetTeamColor(teamID) - if (r and g and b) then - local function ColorChar(x) - local c = math.floor(x * 255) - c = ((c <= 1) and 1) or ((c >= 255) and 255) or c - return string.char(c) - end - local colorStr - colorStr = '\255' - colorStr = colorStr .. ColorChar(r) - colorStr = colorStr .. ColorChar(g) - colorStr = colorStr .. ColorChar(b) - local i = (r * 0.299) + (g * 0.587) + (b * 0.114) - outlineChar = ((i > 0.25) and 'o') or 'O' - teamColorStrs[teamID] = { colorStr, outlineChar } - return colorStr, "s",outlineChar - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function DrawStartboxes3dWithStencil() - gl.DepthMask(false); - if (gl.DepthClamp) then gl.DepthClamp(true); end - - gl.DepthTest(true); - gl.StencilTest(true); - gl.ColorMask(false, false, false, false); - gl.Culling(false); - - gl.StencilOp(GL.KEEP, GL.INVERT, GL.KEEP); - - gl.CallList(startboxDListStencil); --// draw - - gl.Culling(GL.BACK); - gl.DepthTest(false); - - gl.ColorMask(true, true, true, true); - - gl.CallList(startboxDListColor); --// draw - - if (gl.DepthClamp) then gl.DepthClamp(false); end - gl.StencilTest(false); - gl.DepthTest(true); - gl.Culling(false); -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:DrawWorld() - gl.Fog(false) - - local time = Spring.DiffTimers(Spring.GetTimer(), startTimer) - - -- show the ally startboxes - DrawStartboxes3dWithStencil() - - -- show the team start positions - for _, teamID in ipairs(Spring.GetTeamList()) do - local _,leader = Spring.GetTeamInfo(teamID) - local _,_,spec = Spring.GetPlayerInfo(leader) - if ((not spec) and (teamID ~= gaiaTeamID)) then - local x, y, z = Spring.GetTeamStartPosition(teamID) - if (x ~= nil and x > 0 and z > 0 and y > -500) then - local color = GetTeamColor(teamID) - local alpha = 0.5 + math.abs(((time * 3) % 1) - 0.5) - gl.PushMatrix() - gl.Translate(x, y, z) - gl.Color(color[1], color[2], color[3], alpha) - gl.CallList(coneList) - gl.PopMatrix() - end - end - end - - gl.Fog(true) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:DrawScreenEffects() - -- show the names over the team start positions - gl.Fog(false) - gl.BeginText() - for _, teamID in ipairs(Spring.GetTeamList()) do - local _,leader = Spring.GetTeamInfo(teamID) - local name,_,spec = Spring.GetPlayerInfo(leader) - if ((not spec) and (teamID ~= gaiaTeamID)) then - local colorStr, outlineStr = GetTeamColorStr(teamID) - local x, y, z = Spring.GetTeamStartPosition(teamID) - if (x ~= nil and x > 0 and z > 0 and y > -500) then - local sx, sy, sz = Spring.WorldToScreenCoords(x, y + 120, z) - if (sz < 1) then - gl.Text(colorStr .. name, sx, sy, 18, 'cs') - end - end - end - end - gl.EndText() - gl.Fog(true) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:DrawInMiniMap(sx, sz) - -- only show at the beginning - if (Spring.GetGameFrame() > 1) then - widgetHandler:RemoveWidget() - end - - gl.PushMatrix() - gl.CallList(xformList) - - gl.LineWidth(1.49) - - local gaiaAllyTeamID - local gaiaTeamID = Spring.GetGaiaTeamID() - if (gaiaTeamID) then - local _,_,_,_,_,atid = Spring.GetTeamInfo(gaiaTeamID) - gaiaAllyTeamID = atid - end - - -- show all start boxes - for _,at in ipairs(Spring.GetAllyTeamList()) do - if (at ~= gaiaAllyTeamID) then - local xn, zn, xp, zp = Spring.GetAllyTeamStartBox(at) - if (xn and ((xn ~= 0) or (zn ~= 0) or (xp ~= msx) or (zp ~= msz))) then - local color - if (at == Spring.GetMyAllyTeamID()) then - color = { 0, 1, 0, 0.1 } -- green - else - color = { 1, 0, 0, 0.1 } -- red - end - gl.Color(color) - gl.Rect(xn, zn, xp, zp) - color[4] = 0.5 -- pump up the volume - gl.Color(color) - gl.PolygonMode(GL.FRONT_AND_BACK, GL.LINE) - gl.Rect(xn, zn, xp, zp) - gl.PolygonMode(GL.FRONT_AND_BACK, GL.FILL) - end - end - end - - gl.PushAttrib(GL_HINT_BIT) - gl.Smoothing(true) --enable point smoothing - - -- show the team start positions - for _, teamID in ipairs(Spring.GetTeamList()) do - local _,leader = Spring.GetTeamInfo(teamID) - local _,_,spec = Spring.GetPlayerInfo(leader) - if ((not spec) and (teamID ~= gaiaTeamID)) then - local x, y, z = Spring.GetTeamStartPosition(teamID) - if (x ~= nil and x > 0 and z > 0 and y > -500) then - local color = GetTeamColor(teamID) - local r, g, b = color[1], color[2], color[3] - local time = Spring.DiffTimers(Spring.GetTimer(), startTimer) - local i = 2 * math.abs(((time * 3) % 1) - 0.5) - gl.PointSize(11) - gl.Color(i, i, i) - gl.BeginEnd(GL.POINTS, gl.Vertex, x, z) - gl.PointSize(7.5) - gl.Color(r, g, b) - gl.BeginEnd(GL.POINTS, gl.Vertex, x, z) - end - end - end - - gl.LineWidth(1.0) - gl.PointSize(1.0) - gl.PopAttrib() --reset point smoothing - gl.PopMatrix() -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/red_ui_framework.lua b/LuaUI/Widgets_Evo/red_ui_framework.lua new file mode 100644 index 000000000..2ab79df29 --- /dev/null +++ b/LuaUI/Widgets_Evo/red_ui_framework.lua @@ -0,0 +1,838 @@ +function widget:GetInfo() + return { + version = "9", + name = "Red_UI_Framework", + desc = "Red UI Framework", + author = "Regret (enhanced by Floris)", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = -9999998, --lowest go first + enabled = true, --loaded by default + handler = true, --access to handler + } +end + +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 32 +local fontfileOutlineSize = 9 +local fontfileOutlineStrength = 1.45 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) +local fontfile2 = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font2", "JosefinSans-Bold.ttf") +local font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + +local useRoundedRectangles = true +local roundedSizeMultiplier = 1 +local usedRoundedSize = roundedSize + +local TN = "Red" +local DrawingTN = "Red_Drawing" --WG name for drawing function list +local version = 9 + +local clock = os.clock +local sgsub = string.gsub +local function getLineCount(text) + _,linecount = sgsub(text,"\n","\n") + return linecount+1 +end + +local Main = {} --boss table with a manabar +local WidgetList = {} --list of widgets using the framework + +local LastProcessedWidget = "" --for debugging +local inTweak = false + +local vsx,vsy = widgetHandler:GetViewSizes() +if (vsx == 1) then --hax for windowed mode + vsx,vsy = Spring.GetWindowGeometry() +end + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx,vsy = Spring.GetViewGeometry() + + + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + font2 = gl.LoadFont(fontfile2, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + WG[TN].font = font + WG[TN].font2 = font2 + end + + Main.vsx,Main.vsy = vsx,vsy + Main.Screen.vsx,Main.Screen.vsy = vsx,vsy + usedRoundedSize = 4 + math.floor((((vsx*vsy) / 900000))) * roundedSizeMultiplier +end + + +--helper functions +local type = type + +local function getTextWidth(o) + if o.font2 then + return font2:GetTextWidth(o.caption)*o.fontsize + else + return font:GetTextWidth(o.caption)*o.fontsize + end +end + +local function getTextHeight(o) + return getLineCount(o.caption)*o.fontsize +end + +local function isInRect(x,y,px,py,sx,sy) + if (not py) then + py = px.py + sx = px.sx + sy = px.sy + px = px.px + end + if ((x >= px) and (x <= px+sx) + and (y >= py) and (y <= py+sy)) then + return true + end + return false +end + +local function copytable(t,copyeverything) + local r = {} + for i,v in pairs(t) do + if (copyeverything and (type(v)=="table")) then + r[i] = copytable(v) --can (probably) cause loops + else + r[i] = v + end + end + return r +end +------------------------- + + +--Objects +local F = { + [1] = function(o) --rectangle + if (o.draw == false) then + return + end + + local color = o.color + local border = o.border --color + local texturecolor = o.texturecolor + local captioncolor = o.captioncolor + local iconscale = 1 + if o.iconscale ~= nil then + iconscale = o.iconscale + end + + local texture = o.texture + local px,py,sx,sy = o.px,o.py,o.sx,o.sy + + local alphamult = o.alphamult + if (alphamult~=nil) then + if (color) then + color = copytable(color) + color[4] = o.color[4]*alphamult + end + if (border) then + border = copytable(border) + border[4] = o.border[4]*alphamult + end + if (captioncolor) then + captioncolor = copytable(captioncolor) + captioncolor[4] = o.captioncolor[4]*alphamult + end + if (texturecolor) then + texturecolor = copytable(texturecolor) + texturecolor[4] = o.texturecolor[4]*alphamult + else + texturecolor = {1,1,1,alphamult} + end + end + + if (color) then + Rect(px,py,sx,sy,color,iconscale) + end + + if (texture) then + TexRect(px,py,sx,sy,texture,texturecolor,iconscale) + end + + if (o.caption) then + local px2,py2 = px,py + local text = o.caption + local width + if o.font2 then + width = font2:GetTextWidth(text) + else + width = font:GetTextWidth(text) + end + local linecount = getLineCount(text) + local fontsize = sx/width + local height = linecount*fontsize + if (height > sy) then + fontsize = sy/linecount + px2 = px2 + (sx - width*fontsize) /2 --center + else + py2 = py2 + (sy - height) /2 --center + end + Text(px2+((sx*(1-iconscale))/2),py2+((sy*(1-iconscale))/2),fontsize*iconscale,text,o.options,captioncolor,o.font2) + o.autofontsize = fontsize + end + + if (border) then --todo: border styles + Border(px,py,sx,sy,o.borderwidth,border) + end + end, + + [2] = function(o) --text + if (o.draw == false) then + return + end + + local color = o.color + local captioncolor = o.captioncolor + + local alphamult = o.alphamult + if (alphamult~=nil) then + if (color) then + color = copytable(color) + color[4] = o.color[4]*alphamult + elseif (captioncolor) then + captioncolor = copytable(captioncolor) + captioncolor[4] = o.captioncolor[4]*alphamult + end + end + + local px,py = o.px,o.py + local fontsize = o.fontsize + + Text(px,py,fontsize,o.caption,o.options,color or captioncolor,o.font2) + end, + + [3] = function(o) --area + --plain dummy + end, + + [4] = function(o) --rectangle rounded + if (o.draw == false) then + return + end + + local color = o.color + local border = o.border --color + local texturecolor = o.texturecolor + local captioncolor = o.captioncolor + local iconscale = 1 + if o.iconscale ~= nil then + iconscale = o.iconscale + end + + local texture = o.texture + local px,py,sx,sy = o.px,o.py,o.sx,o.sy + + local alphamult = o.alphamult + if (alphamult~=nil) then + if (color) then + color = copytable(color) + color[4] = o.color[4]*alphamult + end + if (border) then + border = copytable(border) + border[4] = o.border[4]*alphamult + end + if (captioncolor) then + captioncolor = copytable(captioncolor) + captioncolor[4] = o.captioncolor[4]*alphamult + end + if (texturecolor) then + texturecolor = copytable(texturecolor) + texturecolor[4] = o.texturecolor[4]*alphamult + else + texturecolor = {1,1,1,alphamult} + end + end + if (color) then + local roundedSize = usedRoundedSize + if o.roundedsize ~= nil then + roundedSize = o.roundedsize + end + RectRound(px,py,sx,sy,color,roundedSize,iconscale,false,(o.guishader ~= nil and o.guishader)) + if o.glone ~= nil and o.glone > 0 then + RectRound(px,py,sx,sy,{color[1],color[2],color[3],o.glone},roundedSize,iconscale,true,(o.guishader ~= nil and o.guishader)) + end + end + + if (texture) then + TexRect(px,py,sx,sy,texture,texturecolor,iconscale) + end + + if (o.caption) then + local px2,py2 = px,py + local text = o.caption + local width + if o.font2 then + width = font2:GetTextWidth(text) + else + width = font:GetTextWidth(text) + end + local linecount = getLineCount(text) + local fontsize = sx/width + local height = linecount*fontsize + if (height > sy) then + fontsize = sy/linecount + px2 = px2 + (sx - width*fontsize) /2 --center + else + py2 = py2 + (sy - height) /2 --center + end + Text(px2+((sx*(1-iconscale))/2),py2+((sy*(1-iconscale))/2),fontsize*iconscale,text,o.options,captioncolor,o.font2) + o.autofontsize = fontsize + end + + if (border) then --todo: border styles + --Border(px,py,sx,sy,o.borderwidth,border) + end + end, +} +if useRoundedRectangles == false then + F[4] = F[1] +end + +local otypes = { + ["rectangle"] = 1, + ["text"] = 2, + ["area"] = 3, + ["rectanglerounded"] = 4, +} +------------------------- + +local function processEffects(o,CurClock) + local e = o.effects + + if (o.active ~= false) then + if (e.fadein_at_activation) then + if (o.justactivated) then + if (o.alphamult == nil) then + o.alphamult = 0 + end + o.fadein_at_activation_start = CurClock --effect start + end + if (o.alphamult~=nil) then + local start = o.fadein_at_activation_start + o.alphamult = (CurClock-start)/e.fadein_at_activation + if (o.alphamult > 1) then + o.alphamult = nil + o.fadein_at_activation_start = nil + else + --useless here [x] maby + o.tempactive = true --force object to be active + end + end + end + else + o.fadein_at_activation_start = nil + end + + if (o.active == false) then + if (e.fadeout_at_deactivation) then + if (o.justdeactivated) then + if (o.alphamult == nil) then + o.alphamult = 0 + end + o.fadeout_at_deactivation_start = CurClock --effect start + end + if (o.alphamult~=nil) then + local start = o.fadeout_at_deactivation_start + if (start~=nil) then + o.alphamult = 1-(CurClock-start)/e.fadeout_at_deactivation + if (o.alphamult <= 0) then + o.alphamult = nil + o.fadeout_at_deactivation_start = nil + else + o.tempactive = true --force object to be active + end + end + end + end + else + o.fadeout_at_deactivation_start = nil + end +end + +--Mouse handling +local Mouse = {{},{},{}} +local sGetMouseState = Spring.GetMouseState + +local dropClick = false +local dropWheel = false + +local useDefaultMouseCursor = false +function widget:IsAbove(x,y) + if (useDefaultMouseCursor) then + return true + end + return false +end + +local WheelState = nil +function widget:MouseWheel(up,value) --up = true/false , value = -1/1 + if Spring.IsGUIHidden() then return end + WheelState = up + return dropWheel +end + +function widget:MousePress(mx,my,mb) + if Spring.IsGUIHidden() then return end + if (type(dropClick)=="table") then + for i=1,#dropClick do + if (dropClick[i] == mb) then + dropClick = true + break + end + end + if (dropClick ~= true) then + dropClick = false + end + end + + return dropClick +end + +local LastMouseState = {sGetMouseState()} +local function handleMouse() + if Spring.IsGUIHidden() then return end + --reset status + dropClick = false + dropWheel = false + useDefaultMouseCursor = false + ---- + + local CurMouseState = {sGetMouseState()} --{mx,my,m1,m2,m3} + CurMouseState[2] = vsy-CurMouseState[2] --make 0,0 top left + + Mouse.hoverunused = true --used in mouseover + Mouse.x = CurMouseState[1] + Mouse.y = CurMouseState[2] + + if (WheelState ~= nil) then + Mouse.wheel = WheelState + else + Mouse.wheel = nil + end + WheelState = nil + + for i=3,5 do + local n=i-2 + Mouse[n][1] = nil + Mouse[n][2] = nil + Mouse[n][3] = nil + + if (CurMouseState[i] and LastMouseState[i]) then + Mouse[n][1] = true --isheld + elseif (CurMouseState[i] and (not LastMouseState[i])) then + Mouse[n][2] = true --waspressed + Mouse[n][4] = {Mouse.x,Mouse.y} --last press + elseif ((not CurMouseState[i]) and LastMouseState[i]) then + Mouse[n][3] = true --wasreleased + Mouse[n][5] = {Mouse.x,Mouse.y} --last release + end + end + LastMouseState = CurMouseState +end + +local function mouseEvent(t,e,o) + if (t) then + for i=1,#t do + local m = Mouse[t[i][1]] + if (m[e]) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then + o.checkedformouse = true + else + return true + end + end + + if ((e==1) and (not isInRect(m[4][1],m[4][2],o))) then --last click was not in same area + --nuthin' + else + m[e] = nil --so only topmost area will get the event + t[i][2](Mouse.x,Mouse.y,o) + end + end + end + end +end + +local function processMouseEvents(o) + o.checkedformouse = nil + + if (o[2] == 2) then --text + o.sx = o.getwidth() + o.sy = o.getheight() + end + + if (o.movable) then + for i=1,#o.movable do + if inTweak or (o.onlyTweakUi ~= nil and o.onlyTweakUi == false) then + if (not o.wasclicked) then + if (Mouse[o.movable[i]][2]) then + if (isInRect(Mouse.x,Mouse.y,o)) then + o.checkedformouse = true + + o.wasclicked = {o.px - Mouse.x,o.py - Mouse.y} + Mouse[o.movable[i]][2] = nil --so only topmost area will get the event + end + end + else + local newpx = Mouse.x + o.wasclicked[1] + local newpy = Mouse.y + o.wasclicked[2] + + if (o.obeyscreenedge) then + if (newpx<0) then newpx = -0.1 end + if (newpy<0) then newpy = -0.1 end + if (newpx>(vsx-o.sx)) then newpx = vsx-o.sx end + if (newpy>(vsy-o.sy)) then newpy = vsy-o.sy end + elseif (o.movablearea) then + if (newpx((o.movablearea.px+o.movablearea.sx)-o.sx)) then newpx = (o.movablearea.px+o.movablearea.sx)-o.sx end + if (newpy>((o.movablearea.py+o.movablearea.sy)-o.sy)) then newpy = (o.movablearea.py+o.movablearea.sy)-o.sy end + elseif (o.minpx) then + if (newpx(o.maxpx-o.sx)) then newpx = o.maxpx-o.sx end + if (newpy>(o.maxpy-o.sy)) then newpy = o.maxpy-o.sy end + end + + local changex = newpx-o.px + local changey = newpy-o.py + if (o.movableslaves) then + for j=1,#o.movableslaves do + local s = o.movableslaves[j] + local snewpx = s.px - (o.px - newpx) + local snewpy = s.py - (o.py - newpy) + + if (s.obeyscreenedge) then + if (snewpx<0) then snewpx = 0 end + if (snewpy<0) then snewpy = 0 end + if (snewpx>(vsx-s.sx)) then snewpx = vsx-s.sx end + if (snewpy>(vsy-s.sy)) then snewpy = vsy-s.sy end + elseif (s.movablearea and (s.movablearea~=o)) then --disregard self to prevent a bug + if (snewpx((s.movablearea.px+s.movablearea.sx)-s.sx)) then snewpx = (s.movablearea.px+s.movablearea.sx)-s.sx end + if (snewpy>((s.movablearea.py+s.movablearea.sy)-s.sy)) then snewpy = (s.movablearea.py+s.movablearea.sy)-s.sy end + elseif (s.minpx) then + if (snewpx(s.maxpx-s.sx)) then snewpx = s.maxpx-s.sx end + if (snewpy>(s.maxpy-s.sy)) then snewpy = s.maxpy-s.sy end + end + + local schangex = snewpx-s.px + local schangey = snewpy-s.py + + if (math.abs(changex)>math.abs(schangex)) then changex = schangex end + if (math.abs(changey)>math.abs(schangey)) then changey = schangey end + end + for j=1,#o.movableslaves do --move slaves + local s = o.movableslaves[j] + s.px = s.px+changex + s.py = s.py+changey + end + end + o.px = o.px+changex --move self + o.py = o.py+changey + if (Mouse[o.movable[i]][3]) then + o.wasclicked = nil + Mouse[o.movable[i]][3] = nil --so only topmost area will get the event + end + end + end + end + end + + if (o.mousenotover) then + if (isInRect(Mouse.x,Mouse.y,o)) then + o.checkedformouse = true + else + o.mousenotover(Mouse.x,Mouse.y,o) + return + end + end + + if (o.overridecursor) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then o.checkedformouse = true else return end + end + useDefaultMouseCursor = true + end + if (o.overrideclick) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then o.checkedformouse = true else return end + end + dropClick = o.overrideclick + end + if (o.overridewheel) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then o.checkedformouse = true else return end + end + dropWheel = true + end + + if (o.mouseover and Mouse.hoverunused) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then + o.checkedformouse = true + else + return + end + end + Mouse.hoverunused = false + o.mouseover(Mouse.x,Mouse.y,o) + end + + if mouseEvent(o.mouseclick,2,o) + or mouseEvent(o.mouseheld,1,o) + or mouseEvent(o.mouserelease,3,o) then return end + + if (o.mousewheel) then + if (not o.checkedformouse) then + if (isInRect(Mouse.x,Mouse.y,o)) then + o.checkedformouse = true + else + return + end + end + if (Mouse.wheel ~= nil) then + o.mousewheel(Mouse.wheel,Mouse.x,Mouse.y,o) + end + end +end +------------------------- + +local ssub = string.sub +function widget:Initialize() + + WG[TN] = {{} } + Main = WG[TN] + Main.Version = version + Main.font = font + Main.font2 = font2 + Main.vsx,Main.vsy = vsx,vsy + Main.Screen = {vsx=vsx,vsy=vsy} + Main.Copytable = copytable + Main.Mouse = Mouse + + Main.GetWidgetObjects = function(w) + for i=1,#WidgetList do + if (WidgetList[i]:GetInfo().name == w:GetInfo().name) then + return copytable(Main[1][i]) + end + end + end + + Main.SetTooltip = function(text) + WG[TN].tooltip = text + end + Main.GetSetTooltip = function() + return WG[TN].tooltip + end + + Main.New = function(w) --function to create a function dawg + for i=1,#WidgetList do --prevents duplicate widget tables + if (WidgetList[i]:GetInfo().name == w:GetInfo().name) then + --Spring.Echo(widget:GetInfo().name..">> don't reload the widget \""..w:GetInfo().name.."\" so fast :<") + table.remove(WidgetList,i) + table.remove(Main[1],i) + break + end + end + + local n = #Main[1]+1 + WidgetList[n] = w --remember widget + Main[1][n] = {} + local t = Main[1][n] + return function(o) + local duplicate = false + for i=1,#t do + if (t[i] == o) then + duplicate = true --object already exists, create a copy + break + end + end + + local r = {} + + local m = #t+1 + if (duplicate) then + --local new = copytable(o,true) + local new = copytable(o) + t[m] = new + r = new + else + o[2] = otypes[o[1]] --translate object type + t[m] = o + r = o + end + + r.delete = function() + r.scheduledfordeletion = true + end + + if (r.caption) then + r.getwidth = function() + return getTextWidth(r) + end + + r.getheight = function() + return getTextHeight(r) + end + end + + return r + end + end +end + +function widget:Shutdown() + gl.DeleteFont(font) + gl.DeleteFont(font2) + WG[TN] = nil + if (LastProcessedWidget ~= "") then + Spring.Echo(widget:GetInfo().name..">> last processed widget was \""..LastProcessedWidget.."\"") --for debugging + end +end + +function widget:TweakDrawScreen() + inTweak = true +end +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + inTweak = false +end + +local hookedtodrawing = false +local fc = 0 --framecount +function widget:Update() + + Main.tooltip = nil + handleMouse() + --flush deactivated widgets + fc=fc+1 + if (fc > 200) then + fc = 0 + local temp = {} + for i=1,#WidgetList do + local name = WidgetList[i]:GetInfo().name + local order = widgetHandler.orderList[name] + local enabled = order and (order > 0) + + if (enabled) then + temp[#temp+1] = WidgetList[i] + else + table.remove(Main[1],i) + end + end + WidgetList = temp + end + + if (not hookedtodrawing) then --so drawing widget can be loaded after this widget + if (WG[DrawingTN]) then + local X = WG[DrawingTN] + if (X.version ~= version) then + Spring.Echo(widget:GetInfo().name..">> Invalid drawing widget version.") + widgetHandler:ToggleWidget(widget:GetInfo().name) + return + end + Color = X.Color + Rect = X.Rect + RectRound = X.RectRound + TexRect = X.TexRect + Border = X.Border + Text = X.Text + hookedtodrawing = true + end + else --process widgets + local wl = Main[1] + for j=#wl,1,-1 do --iterate backwards + if (j==0) then break end + local CurClock = clock() + + --for debugging + WG[DrawingTN].LastWidget = "" + local w = WidgetList[j] + if (w) then + local winfo = WidgetList[j]:GetInfo() + if (winfo) then + LastProcessedWidget = winfo.name + WG[DrawingTN].LastWidget = LastProcessedWidget + end + end + -- + + local dellst = {} + local objlst = wl[j] + + for i=1,#objlst do + local o = objlst[i] + o.tempactive = nil + if (o.scheduledfordeletion) then + dellst[#dellst+1] = i + else + if (o.active ~= false) then + o.notfirstprocessing = true + if (o.lastactivestate == false) then + o.justactivated = true + else + o.justactivated = nil + end + else + if ((o.lastactivestate ~= false) and o.notfirstprocessing) then + o.justdeactivated = true + else + o.justdeactivated = nil + end + end + o.lastactivestate = o.active + + if (o.effects) then + processEffects(o,CurClock) + end + if ((o.active ~= false) or o.tempactive) then + F[o[2]](o) --object draw function + end + end + + --process mouseevents backwards, so topmost drawn objects get to mouseevents first + if not WG['topbar'] or not WG['topbar'].showingQuit() then + local ro = objlst[#objlst-i+1] + if (not ro.scheduledfordeletion) then + if (ro.active ~= false) then + if (ro.onupdate) then + ro.onupdate(ro) + end + processMouseEvents(ro) + end + end + end + end + + for i=1,#dellst do + table.remove(objlst,dellst[i]) + end + end + end +end + +function widget:WorldTooltip(ttType,data1,data2,data3) + return Main.tooltip +end diff --git a/LuaUI/Widgets_Evo/red_ui_framework_drawing.lua b/LuaUI/Widgets_Evo/red_ui_framework_drawing.lua new file mode 100644 index 000000000..9c9ad8245 --- /dev/null +++ b/LuaUI/Widgets_Evo/red_ui_framework_drawing.lua @@ -0,0 +1,463 @@ +function widget:GetInfo() + return { + version = "9", + name = "Red_Drawing", + desc = "Drawing widget for Red UI Framework", + author = "Regret", + date = "29 may 2015", + license = "GNU GPL, v2 or later", + layer = -1, + enabled = true, + } +end + +local bgcornerSize = 8 +local bgcorner = "LuaUI/Images/bgcorner.png" + +local TN = "Red_Drawing" --WG name for function list +local version = 9 + + +local vsx,vsy = widgetHandler:GetViewSizes() +if (vsx == 1) then --hax for windowed mode + vsx,vsy = Spring.GetWindowGeometry() +end + +local sIsGUIHidden = Spring.IsGUIHidden + +local F = {} --function table +local Todo = {} --function queue +local dList = {} +local StartList + +local glText = gl.Text +local glTexture = gl.Texture +local glColor = gl.Color +local glRect = gl.Rect +local glTexRect = gl.TexRect +local glMatrixMode = gl.MatrixMode +local glLoadIdentity = gl.LoadIdentity +local glOrtho = gl.Ortho +local glTranslate = gl.Translate +local glResetState = gl.ResetState +local glResetMatrices = gl.ResetMatrices +local glDepthTest = gl.DepthTest +local glVertex = gl.Vertex +local glBeginEnd = gl.BeginEnd +local glCallList = gl.CallList +local glDeleteList = gl.DeleteList +local glCreateList = gl.CreateList +local glPushMatrix = gl.PushMatrix +local glPopMatrix = gl.PopMatrix +local glScale = gl.Scale + +local GL_ONE = GL.ONE +local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA +local GL_SRC_ALPHA = GL.SRC_ALPHA +local glBlending = gl.Blending + +local GL_LINE_LOOP = GL.LINE_LOOP +local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT +local GL_PROJECTION = GL.PROJECTION +local GL_MODELVIEW = GL.MODELVIEW + +local blurRect = {} +local newBlurRect = {} + + +local function Color(c) + glColor(c[1],c[2],c[3],c[4]) +end + +local function Text(px,py,fontsize,text,options,c,usefont2) + glPushMatrix() + local f = usefont2 and font2 or font + f:Begin() + if (c) then + f:SetTextColor(c[1],c[2],c[3],c[4]) + f:SetOutlineColor(0,0,0,1) + --glColor(c[1],c[2],c[3],c[4]) + else + f:SetTextColor(1,1,1,1) + f:SetOutlineColor(0,0,0,1) + --glColor(1,1,1,1) + end + glTranslate(px,py+fontsize,0) + if (options) then + options = options.."d" --fuck you jK + else + options = "d" + end + glScale(1,-1,1) --flip + + --glText(text,0,0,fontsize,options) + f:Print(text,0,0,fontsize,options) + f:End() + glPopMatrix() +end + +local function Border(px,py,sx,sy,width,c) + if (width == nil) then + width = 1 + elseif (width == 0) then + return + end + px,py,sx,sy = px,py,sx,sy + + glPushMatrix() + if (c) then + glColor(c[1],c[2],c[3],c[4]) + else + glColor(1,1,1,1) + end + glTranslate(px,py,0) + glRect(0,0,sx,width) --top + glRect(0,width,width,sy) --left + glRect(width,sy-width,sx-width,sy) --bottom + glRect(sx-width,width,sx,sy) --right + glPopMatrix() +end + +local function Rect(px,py,sx,sy,c,scale) + if (c) then + glColor(c[1],c[2],c[3],c[4]) + else + glColor(1,1,1,1) + end + if scale ~= nil and scale ~= 1 then + px = px + ((sx * (1-scale))/2) + py = py + ((sy * (1-scale))/2) + sx = sx * scale + sy = sy * scale + end + px,py,sx,sy = px,py,sx,sy + glRect(px,py,px+sx,py+sy) +end + +local function DrawRectRound(px,py,sx,sy,cs) + gl.TexCoord(0.8,0.8) + gl.Vertex(px+cs, py, 0) + gl.Vertex(sx-cs, py, 0) + gl.Vertex(sx-cs, sy, 0) + gl.Vertex(px+cs, sy, 0) + + gl.Vertex(px, py+cs, 0) + gl.Vertex(px+cs, py+cs, 0) + gl.Vertex(px+cs, sy-cs, 0) + gl.Vertex(px, sy-cs, 0) + + gl.Vertex(sx, py+cs, 0) + gl.Vertex(sx-cs, py+cs, 0) + gl.Vertex(sx-cs, sy-cs, 0) + gl.Vertex(sx, sy-cs, 0) + + local offset = 0.05 -- texture offset, because else gaps could show + + -- top left + if py <= 0 or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, py+cs, 0) + -- top right + if py <= 0 or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, py, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, py, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, py+cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, py+cs, 0) + -- bottom left + if sy >= vsy or px <= 0 then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(px+cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(px+cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(px, sy-cs, 0) + -- bottom right + if sy >= vsy or sx >= vsx then o = 0.5 else o = offset end + gl.TexCoord(o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,1-offset) + gl.Vertex(sx-cs, sy, 0) + gl.TexCoord(1-offset,1-offset) + gl.Vertex(sx-cs, sy-cs, 0) + gl.TexCoord(1-offset,o) + gl.Vertex(sx, sy-cs, 0) +end + +function RectRoundOrg(px,py,sx,sy,cs) + --local px,py,sx,sy,cs = math.floor(px),math.floor(py),math.ceil(sx),math.ceil(sy),math.floor(cs) + + gl.Texture(bgcorner) + gl.BeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) +end + +local function RectRound(px,py,sx,sy,c,cs,scale,glone,guishader) + + if (c) then + glColor(c[1],c[2],c[3],c[4]) + else + glColor(1,1,1,1) + end + + if cs == nil then + cs = 4 + end + + if glone then + glBlending(GL_SRC_ALPHA, GL_ONE) + end + -- add blur shader + if c and guishader then + newBlurRect[px..' '..py..' '..sx..' '..sy] = {px=px,py=py,sx=sx,sy=sy,cs=cs} + end + + if scale ~= nil and scale ~= 1 then + px = px + ((sx * (1-scale))/2) + py = py + ((sy * (1-scale))/2) + sx = sx * scale + sy = sy * scale + end + + sx = px+sx + sy = py+sy + + gl.Texture(bgcorner) + glBeginEnd(GL.QUADS, DrawRectRound, px,py,sx,sy,cs) + gl.Texture(false) + + if glone then + glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + end +end + +local function TexRect(px,py,sx,sy,texture,c,scale) + glPushMatrix() + if (c) then + glColor(c[1],c[2],c[3],c[4]) + else + glColor(1,1,1,1) + end + if scale ~= nil and scale ~= 1 then + px = px + ((sx * (1-scale))/2) + py = py + ((sy * (1-scale))/2) + sx = sx * scale + sy = sy * scale + end + px,py,sx,sy = px,py,sx,sy + glTranslate(px,py+sy,0) + glScale(1,-1,1) --flip + glTexture(texture) + DrawRect(0,0,sx,sy) + glTexture(false) + glPopMatrix() +end + +local function RectQuad(px,py,sx,sy) + local o = 0.008 -- texture offset, because else grey line might show at the edges + gl.TexCoord(o,1-o) + gl.Vertex(px, py, 0) + gl.TexCoord(1-o,1-o) + gl.Vertex(sx, py, 0) + gl.TexCoord(1-o,o) + gl.Vertex(sx, sy, 0) + gl.TexCoord(o,o) + gl.Vertex(px, sy, 0) +end + +function DrawRect(px,py,sx,sy) + gl.BeginEnd(GL.QUADS, RectQuad, px,py,sx,sy) +end + +local function CreateStartList() + if (StartList) then glDeleteList(StartList) end + StartList = glCreateList(function() + glMatrixMode(GL_PROJECTION) + glLoadIdentity() + glOrtho(0,vsx,vsy,0,0,1) --top left is 0,0 + glDepthTest(false) + glMatrixMode(GL_MODELVIEW) + glLoadIdentity() + glTranslate(0.375,0.375,0) -- for exact pixelization + end) +end + +function widget:ViewResize(viewSizeX, viewSizeY) + vsx,vsy = widgetHandler:GetViewSizes() + font = WG['Red'].font + font2 = WG['Red'].font2 + CreateStartList() +end + +function widget:Initialize() + font = WG['Red'].font + font2 = WG['Red'].font2 + vsx,vsy = widgetHandler:GetViewSizes() + CreateStartList() + + local T = {} + WG[TN] = T + T.version = version + T.Color = function(a,b,c,d) --using (...) seems slower + Todo[#Todo+1] = {1,a,b,c,d} + end + T.Rect = function(a,b,c,d,e,f) + Todo[#Todo+1] = {2,a,b,c,d,e,f} + end + T.TexRect = function(a,b,c,d,e,f,g) + Todo[#Todo+1] = {3,a,b,c,d,e,f,g} + end + T.Border = function(a,b,c,d,e,f) + Todo[#Todo+1] = {4,a,b,c,d,e,f} + end + T.Text = function(a,b,c,d,e,f,g) + Todo[#Todo+1] = {5,a,b,c,d,e,f,g} + end + T.RectRound = function(a,b,c,d,e,f,g,h,i) + Todo[#Todo+1] = {6,a,b,c,d,e,f,g,h,i} + end + + F[1] = Color + F[2] = Rect + F[3] = TexRect + F[4] = Border + F[5] = Text + F[6] = RectRound +end + +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawScreen() + if chobbyInterface then return end + + newBlurRect = {} + + glResetState() + glResetMatrices() + + glCallList(StartList) + + local id = '' + local t + for i=1,#Todo do + t = Todo[i] + id = '' + if t[1] == 5 then -- text + id = t[1]..'_'..t[2]..'_'..t[3]..'_'..t[4]..'_'..t[5] + if type(t[7]) == 'table' then + id = id .. t[7][1]..'_'..t[7][2]..'_'..t[7][3]..'_'..t[7][4] + end + end + + if id ~= '' then + if dList[id] == nil then + dList[id] = glCreateList(function() + F[t[1]](t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10]) + end) + end + glCallList(dList[id]) + else + F[t[1]](t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10]) + end + + Todo[i] = nil + end + + + glResetState() + glResetMatrices() + + if WG['guishader'] then + + -- remove changed blur areas + for id, rect in pairs(blurRect) do + if newBlurRect[id] == nil and rect.id ~= nil then + WG['guishader'].DeleteDlist('red_ui_'..rect.id) + blurRect[id] = nil + else + newBlurRect[id] = rect + end + end + -- add new blur areas + local count = 0 + for id, rect in pairs(newBlurRect) do + if blurRect[id] == nil then + local x = rect.px + local y = vsy-rect.py + local x2 = (rect.px+rect.sx) + local y2 = vsy-(rect.py+rect.sy) + + local rectid = rect.px..' '..rect.py..' '..rect.sx..' '..rect.sy + + WG['guishader'].InsertDlist(glCreateList( function() RectRoundOrg(x,y2,x2,y,rect.cs) end), 'red_ui_'..rectid) + newBlurRect[rectid].id = rectid + end + count = count + 1 + end + --Spring.Echo(count) + blurRect = newBlurRect + else + blurRect = {} + end +end + +local sec = 0 +local flushDistsTime = 20 +function widget:Update(dt) + if chobbyInterface then return end + if (sIsGUIHidden()) then + for i=1,#Todo do + Todo[i] = nil + end + end + + sec=sec+dt + if (sec>flushDistsTime) then + sec = 0 + removeDLists() + end +end + +function removeDLists() + for t, l in pairs(dList) do + glDeleteList(dList[l]) + end + dList = {} +end + +function widget:Shutdown() + glDeleteList(StartList) + removeDLists() + + if WG['guishader'] then + + -- remove blur areas + for id, rect in pairs(blurRect) do + if rect.id ~= nil then + WG['guishader'].DeleteDlist('red_ui_'..rect.id) + blurRect[id] = nil + end + end + end + + if (WG[TN].LastWidget) then + Spring.Echo(widget:GetInfo().name..">> last processed widget was \""..WG[TN].LastWidget.."\"") --for debugging + end + + WG[TN]=nil +end diff --git a/LuaUI/Widgets_Evo/reset_hotkeys.lua b/LuaUI/Widgets_Evo/reset_hotkeys.lua deleted file mode 100644 index 68cfcd7a2..000000000 --- a/LuaUI/Widgets_Evo/reset_hotkeys.lua +++ /dev/null @@ -1,39 +0,0 @@ -function widget:GetInfo() - return { - name = "Reset Hotkeys", - desc = "Sets default hotkeys for common order elements", - author = "", - date = "", - license = "GNU LGPL, v2.1 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - -function widget:Initialize() - - -- replace fps mode bind with capture - Spring.SendCommands({ - "unbindkeyset c", - }) - Spring.SendCommands("bind ctrl+c capture") - - - -- set repeat to be bound to q - Spring.SendCommands({ - "unbindkeyset q", - }) - Spring.SendCommands("bind q repeat") - - - -- set Priority to be bound to i - Spring.SendCommands({ - "unbindkeyset i", - }) - Spring.SendCommands("bind i priority") - - if Game.version == "85.0" then - Spring.SendCommands({"unbindaction specteam"}) - end - -end diff --git a/LuaUI/Widgets_Evo/simple_console.lua.disabled b/LuaUI/Widgets_Evo/simple_console.lua.disabled deleted file mode 100644 index 43e871e7a..000000000 --- a/LuaUI/Widgets_Evo/simple_console.lua.disabled +++ /dev/null @@ -1,59 +0,0 @@ -function widget:GetInfo() - return { - name = "Simple Console", --version 1 - desc = "Draws a simple console + filters out frame numbers", - author = "abma", - date = "November, 2011", --last change November, 2011 - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true, --enabled by default - } -end - -local linesbuffer={} -local maxlines=10 -local fontsize=14 -local lineheight=fontsize+2 - -function widget:Initialize() - Spring.SendCommands("console 0") -end - -function widget:Shutdown() - Spring.SendCommands("console 1") -end - -function widget:DrawScreen() - local vsx, vsy = gl.GetViewSizes() - local posx, posy = vsx * 0.27, vsy * 0.96 - count=math.max(#linesbuffer-maxlines, 0) - i=0 - for n, v in pairs(linesbuffer) do - if n>count then - gl.Text(v["line"], posx, posy-i*lineheight, fontsize, "on") - i=i+1 - end - end -end - -function widget:AddConsoleLine(lines,priority) - lines = lines:match('^\[f=[0-9]+\] (<.*>.*)$') - if lines==nil then - return - end - len=#linesbuffer - for line in lines:gmatch("[^\n]+") do - table.insert(linesbuffer, {frame=Spring.GetGameFrame(), line=line}) - end -end - -function widget:GameFrame(curframe) - if #linesbuffer>0 then - for n,v in pairs(linesbuffer) do - if curframe > v["frame"]+400 then - table.remove(linesbuffer, n) - end - end - end -end - diff --git a/LuaUI/Widgets_Evo/snd_ambientSoundPlayer.lua b/LuaUI/Widgets_Evo/snd_ambientSoundPlayer.lua new file mode 100644 index 000000000..7bf7a2ad1 --- /dev/null +++ b/LuaUI/Widgets_Evo/snd_ambientSoundPlayer.lua @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: snd_ambientSoundPlayer.lua +-- brief: Plays a looping background sound +-- author: Forboding Angel +-- +-- Copyright (C) 2019. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +math.randomseed( os.time() - os.clock() * 1000 ) +math.random() math.random() math.random() + +function widget:GetInfo() + return { + name = "Ambient Background Sound Player", + desc = "Plays a looping background sound", + author = "Forboding Angel", + date = "May 2019", + license = "GNU GPL, v2 or later", + layer = 9999999999, + enabled = true -- loaded by default? + } +end + +function widget:Initialize() + +end + +function widget:GameFrame(n) + + if n == 1 then + myTeamID = Spring.GetMyTeamID() + myFaction = Spring.GetTeamRulesParam(myTeamID, "faction", playerFaction) + if myFaction == nil then + Spring.Echo("[Ambient Background Sound Player] If you're seeing this message that means that the code which sets the player's faction is absolutely fucked somewhere. On the next line I will echo the myFaction variable (It will be nil). If it says anything other than the factions listed in game_spawn.lua (it will), at least it will provide a clue. Additionally I will manually set the player faction to Federation of Kala so that it doesn't crash and burn. Happy bug hunting!") + Spring.Echo(myFaction) + myFaction = "Federation of Kala" + else + Spring.Echo("[Ambient Background Sound Player] Player faction is " .. myFaction) + end + end + + if myFaction == "Federation of Kala" then + if n == 1 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/ambient-stereo-short.wav", 0.33, 'ui') + elseif (n % 50) == 4 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/ambient-stereo-short.wav", 0.33, 'ui') + end + elseif myFaction == "Loz Alliance" then + if n == 1 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/ambient-stereo-short.wav", 0.33, 'ui') + elseif (n % 50) == 4 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/ambient-stereo-short.wav", 0.33, 'ui') + end + elseif myFaction == "zaal" then + if n == 1 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/zaalambient.wav", 0.33, 'ui') + elseif (n % 50) == 4 then + Spring.PlaySoundFile("LuaUI/Sounds/ambient/zaalambient.wav", 0.33, 'ui') + end + end + +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/snd_game_sounds.lua b/LuaUI/Widgets_Evo/snd_game_sounds.lua index 96924d9e2..ff51ede89 100644 --- a/LuaUI/Widgets_Evo/snd_game_sounds.lua +++ b/LuaUI/Widgets_Evo/snd_game_sounds.lua @@ -49,19 +49,19 @@ alarmTimes["position"] = {} local spamBlock = false ---------------------------------------------------------------------------- -local cloak1 = "sounds/cloak.wav" -local decloak1 = "sounds/cloak.wav" -local cloak2 = "sounds/cloak.wav" -local decloak2 = "sounds/cloak.wav" +local cloak1 = "sounds/miscfx/cloak.wav" +local decloak1 = "sounds/miscfx/cloak.wav" +local cloak2 = "sounds/miscfx/cloak.wav" +local decloak2 = "sounds/miscfx/cloak.wav" -local CD1 = "sounds/count1.wav" -local CD2 = "sounds/count2.wav" -local CD3 = "sounds/count3.wav" -local CD4 = "sounds/count4.wav" -local CD5 = "sounds/count5.wav" -local CD6 = "sounds/count6.wav" -local cancel = "sounds/cancel2.wav" -local movefailed = "sounds/cantdo4.wav" +local CD1 = "sounds/selfdcountdown/count1.wav" +local CD2 = "sounds/selfdcountdown/count2.wav" +local CD3 = "sounds/selfdcountdown/count3.wav" +local CD4 = "sounds/selfdcountdown/count4.wav" +local CD5 = "sounds/selfdcountdown/count5.wav" +local CD6 = "sounds/selfdcountdown/count6.wav" +local cancel = "sounds/ui/cancel2.wav" +local movefailed = "sounds/ui/cantdo4.wav" local ADUnits = {} local CMD_SELFD = CMD.SELFD @@ -244,9 +244,9 @@ function widget:UnitDamaged (unitID, unitDefID, unitTeam, damage, paralyzer, wea local snd if isCommander then - snd = 'sounds/warning2.wav' + snd = 'sounds/miscfx/warning2.wav' else - snd = 'sounds/warning1.wav' + snd = 'sounds/miscfx/warning1.wav' end -- ALL units have volume = 1.0 in unitdef. Some units, such as critters and DT:s have no volume, making the widget fail on nil index. -- this was the previous lookup code for volume: udef.sounds.underattack[1].volume diff --git a/LuaUI/Widgets_Evo/snd_music.lua b/LuaUI/Widgets_Evo/snd_music.lua deleted file mode 100644 index cb2ac965e..000000000 --- a/LuaUI/Widgets_Evo/snd_music.lua +++ /dev/null @@ -1,287 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: gui_music.lua --- brief: yay music --- author: cake --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Music Player", - desc = "Plays music based on situation", - author = "cake, trepan, Smoth, Licho, xponen", - date = "Mar 01, 2008, Aug 20 2009, Nov 23 2011", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local unitExceptions = include("Configs/snd_music_exception.lua") - -local windows = {} - -local WAR_THRESHOLD = 5000 -local PEACE_THRESHOLD = 1000 - -local musicType = 'peace' -local dethklok = {} -- keeps track of the number of doods killed in each time frame -local timeframetimer = 0 -local previousTrack = '' -local previousTrackType = '' -local newTrackWait = 1000 -local numVisibleEnemy = 0 -local fadeVol -local curTrack = "no name" -local songText = "no name" - -local warTracks = VFS.DirList('music/war/', '*.ogg') -local peaceTracks = VFS.DirList('music/peace/', '*.ogg') -local victoryTracks = VFS.DirList('music/victory/', '*.ogg') -local defeatTracks = VFS.DirList('music/defeat/', '*.ogg') - -local firstTime = false -local wasPaused = false -local firstFade = true -local initSeed = 0 -local seedInitialized = false -local gameOver = false - -local myTeam = Spring.GetMyTeamID() -local isSpec = Spring.GetSpectatingState() or Spring.IsReplay() -local defeat = false - -options_path = 'Settings/Interface/Pause Screen' - -options = { - pausemusic = {name='Pause Music', type='bool', value=false}, -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:Initialize() - -- Spring.Echo(math.random(), math.random()) - -- Spring.Echo(os.clock()) - - -- for TrackName,TrackDef in pairs(peaceTracks) do - -- Spring.Echo("Track: " .. TrackDef) - -- end - --math.randomseed(os.clock()* 101.01)--lurker wants you to burn in hell rgn - -- for i=1,20 do Spring.Echo(math.random()) end - - for i = 1, 30, 1 do - dethklok[i]=0 - end -end - - -function widget:Shutdown() - Spring.StopSoundStream() - - for i=1,#windows do - (windows[i]):Dispose() - end -end - -local function PlayNewTrack() - Spring.StopSoundStream() - local newTrack = previousTrack - repeat - if musicType == 'peace' then - newTrack = peaceTracks[math.random(1, #peaceTracks)] - elseif musicType == 'war' then - newTrack = warTracks[math.random(1, #warTracks)] - end - until newTrack ~= previousTrack - -- for key, val in pairs(oggInfo) do - -- Spring.Echo(key, val) - -- end - firstFade = false - previousTrack = newTrack - - -- if (oggInfo.comments.TITLE and oggInfo.comments.TITLE) then - -- Spring.Echo("Song changed to: " .. oggInfo.comments.TITLE .. " By: " .. oggInfo.comments.ARTIST) - -- else - -- Spring.Echo("Song changed but unable to get the artist and title info") - -- end - curTrack = newTrack - Spring.PlaySoundStream(newTrack,WG.music_volume or 0.5) - playing = true - - WG.music_start_volume = WG.music_volume -end - -function widget:Update(dt) - if gameOver then - return - end - if (Spring.GetGameSeconds()>0) then - if not seedInitialized then - math.randomseed(os.clock()* 100) - seedInitialized=true - end - timeframetimer = timeframetimer + dt - if (timeframetimer > 1) then -- every second - timeframetimer = 0 - newTrackWait = newTrackWait + 1 - local PlayerTeam = Spring.GetMyTeamID() - numVisibleEnemy = 0 - local doods = Spring.GetVisibleUnits() - for _, u in ipairs(doods) do - if (Spring.IsUnitAllied(u) ~= true) then - numVisibleEnemy = numVisibleEnemy + 1 - end - end - - totalKilled = 0 - for i = 1, 10, 1 do --calculate the first half of the table (1-15) - totalKilled = totalKilled + (dethklok[i] * 2) - end - - for i = 11, 20, 1 do -- calculate the second half of the table (16-45) - totalKilled = totalKilled + dethklok[i] - end - - for i = 20, 1, -1 do -- shift value(s) to the end of table - dethklok[i+1] = dethklok[i] - end - dethklok[1] = 0 -- empty the first row - - --Spring.Echo (totalKilled) - - if (totalKilled > WAR_THRESHOLD) then - musicType = 'war' - end - - if (totalKilled <= PEACE_THRESHOLD) then - musicType = 'peace' - end - - if (not firstTime) then - PlayNewTrack() - firstTime = true -- pop this cherry - end - - local playedTime, totalTime = Spring.GetSoundStreamTime() - playedTime = math.floor(playedTime) - totalTime = math.floor(totalTime) - --Spring.Echo(playedTime, totalTime) - - --Spring.Echo(playedTime, totalTime, newTrackWait) - - --if((totalTime - playedTime) <= 6 and (totalTime >= 1) ) then - --Spring.Echo("time left:", (totalTime - playedTime)) - --Spring.Echo("volume:", (totalTime - playedTime)/6) - --if ((totalTime - playedTime)/6 >= 0) then - -- Spring.SetSoundStreamVolume((totalTime - playedTime)/6) - --else - -- Spring.SetSoundStreamVolume(0.1) - --end - --elseif(playedTime <= 5 )then--and not firstFade - --Spring.Echo("time playing:", playedTime) - --Spring.Echo("volume:", playedTime/5) - --Spring.SetSoundStreamVolume( playedTime/5) - --end - - if ( (musicType ~= previousTrackType and musicType == 'war') or (playedTime >= totalTime)) then -- both zero means track stopped in 8 - previousTrackType = musicType - PlayNewTrack() - - --Spring.Echo("Track: " .. newTrack) - newTrackWait = 0 - end - end - local _, _, paused = Spring.GetGameSpeed() - if (paused ~= wasPaused) and options.pausemusic.value then - Spring.PauseSoundStream() - wasPaused = paused - end - end -end - -function widget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - if unitExceptions[unitDefID] then - return - end - - if (damage < 1.5) then return end - local PlayerTeam = Spring.GetMyTeamID() - - if (UnitDefs[unitDefID] == nil) then return end - - if paralyzer then - return - else - if (teamID == PlayerTeam) then - damage = damage * 1.5 - end - local multifactor = 1 - if (numVisibleEnemy > 3) then - multifactor = math.log(numVisibleEnemy) - end - dethklok[1] = dethklok[1] + (damage * multifactor); - end -end - -function widget:UnitDestroyed(unitID, unitDefID, teamID) - if unitExceptions[unitDefID] then - return - end - local unitWorth = 50 - if (UnitDefs[unitDefID].metalCost > 500) then - unitWorth = 200 - end - if (UnitDefs[unitDefID].metalCost > 1000) then - unitWorth = 300 - end - if (UnitDefs[unitDefID].metalCost > 3000) then - unitWorth = 500 - end - if (UnitDefs[unitDefID].metalCost > 8000) then - unitWorth = 700 - end - if (teamID == PlayerTeam) then - unitWorth = unitWorth * 1.5 - end - local multifactor = 1 - if (numVisibleEnemy > 3) then - multifactor = math.log(numVisibleEnemy) - end - dethklok[1] = dethklok[1] + (unitWorth*multifactor); -end - -function widget:TeamDied(team) - if team == myTeam and not isSpec then - defeat = true - end -end - -function widget:GameOver() - --gameOver = true - local track - -- FIXME: get a better way to detect who won - if not defeat then - if #victoryTracks <= 0 then return end - track = victoryTracks[math.random(1, #victoryTracks)] - else - if #defeatTracks <= 0 then return end - track = defeatTracks[math.random(1, #defeatTracks)] - end - Spring.StopSoundStream() - Spring.PlaySoundStream(track,WG.music_volume or 0.5) - WG.music_start_volume = WG.music_volume -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/spring_direct_launch.lua.disabled b/LuaUI/Widgets_Evo/spring_direct_launch.lua.disabled deleted file mode 100644 index 0ef7bcdf7..000000000 --- a/LuaUI/Widgets_Evo/spring_direct_launch.lua.disabled +++ /dev/null @@ -1,1194 +0,0 @@ - --- Should you want to make your own GUI: - --- To save a game: --- Spring.SendCommands("luarules dump YourSaveName") - --- To save a game with a pretty name: --- local savegamefilename=os.date("%y-%m-%d %H-%M-%S ")..Game.modName.." "..Game.mapName --- savegamefilename,_=string.gsub(savegamefilename,"[^%w-._]","_") -- replace special characters with an underscore --- savegamefilename,_=string.gsub(savegamefilename,"%.smf","") --- Spring.SendCommands("luarules dump "..savegamefilename) - --- To restart a game: --- Spring.SendCommands("luarules dump restart") - --- To get the list of all savegames: --- Copy'n'paste the function GetSavegames() --- Then call it. See the end of that function to see what it returns. - --- To load a game: --- Copy'n'paste the function DoTheRestart(..) --- Then call it, passing it the Filename of the save --- Or, use Spring.Restart directly (only if the script is small) - --- Ex: --- -- Listing all savegames --- local AllSaves=GetSavegames() --- for k=1,#AllSaves --- Spring.Echo(AllSaves[k].DisplayName) --- end --- --- --Showing degtails of a savegame: --- local N=1 --- Spring.Echo(AllSaves[N].Description) --- --- -- Loading a savegame: --- DoTheRestart(AllSaves[N].FileName) --- -- Or, more directly: --- Spring.Restart(AllSaves[N].FileName) - -function widget:GetInfo() - return { - name = "Spring Direct Launch 2", - desc = "Show some SP menu when Spring.exe is run directly", - author = "zwzsg", - version = "2.7", - date = "8th december, 2009", - license = "Public Domain", - layer = -100, - enabled = true, - handler = true, -- To see the real widgetHandler - } -end - - -VFS.Include("LuaRules/Gadgets/libs/FillModSpecific.lua",nil) -VFS.Include("LuaRules/Gadgets/libs/ColorConversion.lua",nil) -VFS.Include("LuaRules/Gadgets/libs/GenerateGame.lua",nil) -VFS.Include("LuaRules/Gadgets/libs/WriteScript.lua",nil) - -local IsActive = false -local HideView = false -local vsx,vsy = 0,0 -local MainMenuFontSize = 24 -- Setting this value to a higher number will decrease the font size whereas lower numbers will decrease the font size -local MissionMenuFontSize = 40 -local MapMenuFontSize = 40 -local SingleMenuFontSize = 40 -local SaveMenuFontSize = 40 -local CreditsMenuFontSize = 40 -local StoryMenuFontSize = 40 -local FramesList = {} -local FunctionsList = {} -local ActiveFrameIndex = nil -local MouseOveredFrameIndex = nil -local KeyboardFrameIndex = nil -local RemovedWidgetList = {} -local InitializeTimer = nil -local SDLG=nil -local ViewPoint=nil -local ScrollUp=nil -local ScrollDown=nil - -local function SafeTry(func,...) - local Get=function(func) return loadstring("return "..func)() end - local f=Get(func) - if type(f)~="function" then - Spring.Echo(func.." not supported!") - else - local status, msg = pcall(f,...) - if not status then - Spring.Echo(func.." failed: "..msg) - end - end -end - -local function UnQuoteString(str) - if type(str)~="string" then - return str - end - local len=string.len(str) - local last=string.sub(str,len,len) - local first=string.sub(str,1,1) - if last=="'" or last=='"' then - str=string.sub(str,1,len-1) - len=len-1 - end - if first=="'" or first=='"' then - str=string.sub(str,2,len) - len=len-1 - end - return loadstring("return"..str)() -end - -local function Capitalize(str) - return string.gsub (str, "(%w)(%w*)", function(a,b) return string.upper(a) .. b end) -end - -local function JoinArrays(a1,a2) - local a3={} - local n=#a1 - for k=1,n do - a3[k]=a1[k] - end - for k=1,#a2 do - a3[n+k]=a2[k] - end - return a3 -end - -local function AddFrame(Text,Pos,FontSize,Color,FramePosition,TextPosition,Function,Param1,Param2,Param3) - table.insert(FramesList,{Text=Text,Pos=Pos,FontSize=FontSize,Color=Color,FramePosition=FramePosition,TextPosition=TextPosition,Function=Function,Param1=Param1,Param2=Param2,Param3=Param3}) -end - -local function RemoveAllFrames() - FramesList = {} - ActiveFrameIndex = nil - MouseOveredFrameIndex = nil - KeyboardFrameIndex = nil - ScrollUp=nil - ScrollDown=nil -end - -local function isAboveFrame(x,y,Frame) - if type(x)~="number" or type(y)~="number" then - x,y = Spring.GetMouseState() - end - if x>=Frame.Pos.xPosMin and x<=Frame.Pos.xPosMax and y>=Frame.Pos.yPosMin and y<=Frame.Pos.yPosMax then - return true - else - return false - end -end - -function widget:IsAbove(x,y) - if IsActive then - return true - else - return false - end -end - -function widget:GetTooltip(x,y) - return "" -end - -local function Quit() - Spring.SendCommands("quit") - Spring.SendCommands("quitforce") -end - -local function CountMissingMaps() - local missing = 0 - for m,_ in ipairs(ModSpecific.MapsList) do - if not VFS.FileExists("maps/"..ModSpecific.MapsList[m].ExternalFileName) then - missing = missing+1 - end - end - return missing -end - -local function WidgetsExplorer() - Spring.Echo("_______") - Spring.Echo("widgetHandler=",widgetHandler) - Spring.Echo("_______") - Spring.Echo("Other Types:") - for index,value in pairs(widgetHandler) do - if type(value)~="function" and type(value)~="table" then - Spring.Echo(index,value) - end - end - Spring.Echo("_______") - Spring.Echo("Tables:") - for index,value in pairs(widgetHandler) do - if type(value)=="table" then - Spring.Echo(index,value) - end - end - Spring.Echo("_______") - Spring.Echo("Functions:") - for index,value in pairs(widgetHandler) do - if type(value)=="function" then - Spring.Echo(index,value) - end - end - Spring.Echo("_______") - Spring.Echo("widgetHandler.widgets=",widgetHandler.widgets) - for index,value in pairs(widgetHandler.widgets) do - Spring.Echo("Widget n°",index,value) - for i,v in pairs(value) do - Spring.Echo(i,v) - end - end - Spring.Echo("_______") -end - - -local function GetSavegames() - local Savegames={} - local FileList=VFS.DirList("Savegames/"..Game.modShortName) - for Index,FileName in ipairs(FileList) do - local ext=string.lower(string.sub(FileName,-4)) - if ext==".txt" or ext==".sav" then - - local RawFileContent=string.sub(VFS.LoadFile(FileName),1,8000) - local DisplayName,_=string.gsub(FileName,"[_]"," ") - local EndIndex=(string.find(DisplayName,".",string.len(DisplayName)-4,true) or 1+string.len(DisplayName))-1 - local BeginIndex=1 - repeat - local NewBeginIndex=string.find(DisplayName,"/",BeginIndex,true) or string.find(DisplayName,"\\",BeginIndex,true) - BeginIndex=NewBeginIndex and NewBeginIndex+1 or BeginIndex - until not NewBeginIndex - DisplayName=string.sub(DisplayName,BeginIndex,EndIndex) - - local descr="" - local ModName=string.match(RawFileContent,"GameType=([^;]*);") - local MapName=string.match(RawFileContent,"Mapname=([^;]*).smf;") or string.match(RawFileContent,"Mapname=([^;]*);") - local DateTime=string.match(RawFileContent,"DateTime=([^;]*);") - local NumPlayers=tonumber(string.match(RawFileContent,"NumPlayers=([^;]*);")) - local NumTeams=tonumber(string.match(RawFileContent,"NumTeams=([^;]*);")) - local MyPlayerNum=tonumber(string.match(RawFileContent,"MyPlayerNum=([^;]*);")) - local cw=tonumber(string.match(RawFileContent,"colorwars=([^;]*);")) - local sos=tonumber(string.match(RawFileContent,"sos=([^;]*);")) - cw=cw~=0 and cw - sos=sos~=0 and sos - DateTime=tonumber(DateTime) or DateTime - MapName,_=string.gsub(MapName or "?","_"," ") - - - descr=descr.."Mod: "..(ModName or "?").." Map: "..(MapName or "?").."\n" - - if sos then - descr=descr.." SOS: "..sos - end - if cw then - local cw_min=math.floor(cw) - local cw_sec=math.floor(60*(cw-cw_min)) - descr=descr.." ColorWars: "..cw_min..(cw_sec~=0 and (":"..cw_sec) or "") - end - - if NumPlayers then - descr=descr.."\n" - if NumPlayers>2 then - descr=descr.."Multiplayer: "..NumPlayers.." human players" - descr=descr..", "..NumTeams.." teams" - else - descr=descr.."Single Player" - local spectator=tonumber(string.match(RawFileContent,"pectator=([^;]*);")) - if spectator then - if spectator==1 then - descr=descr.." - Spectating "..NumTeams.." AIs" - elseif spectator==0 then - descr=descr.." with "..(NumTeams-1).." AI"..((NumTeams-1)>1 and "s" or "") - end - end - end - end - - if DateTime then - descr=descr.."\n"..(type(DateTime)=="number" and os.date("%A %d %B %Y at %X",DateTime) or DateTime) - end - - table.insert(Savegames,{Index=Index,FileName=FileName,DisplayName=DisplayName,Description=descr, - ModName=ModName,MapName=MapName,NumPlayers=NumPlayers,NumTeams=NumTeams,DateTime=DateTime}) - - end - end - return Savegames -end - -local function ListAvailableLuaStuff() - Spring.Echo("io stuff:") - for index,value in pairs(io) do - Spring.Echo(index,value) - end - Spring.Echo("os stuff:") - for index,value in pairs(os) do - Spring.Echo(index,value) - end - Spring.Echo("package stuff:") - for index,value in pairs(package) do - Spring.Echo(index,value) - end -end - -local function PrintReadMe(ReadmeLines,StartAt) - RemoveAllFrames() - local FontSize = 16 - local LinesPerScreen = math.floor(vsy*0.6/FontSize) - local ReadmeLines=ReadmeLines - AddFrame(ModSpecific.ReadmeFileName,{x=vsx*0.5,y=vsy},vsy/StoryMenuFontSize,{1,1,0.5,0.5},"ct","c",nil) - if not VFS.FileExists(ModSpecific.ReadmeFileName) then - AddFrame("File "..ModSpecific.ReadmeFileName.." not found!",{x=vsx*0.5,y=vsy*0.5},vsy/StoryMenuFontSize,{1,0.5,0.5,0.5},"cc","c",nil) - else - if not ReadmeLines then - --Spring.Echo("Parsing "..ModSpecific.ReadmeFileName) - local readmedata=VFS.LoadFile(ModSpecific.ReadmeFileName) - readmedata=readmedata:gsub("\r\n?", "\n"):gsub("\n\n+", function(c) return ("\n "):rep(#c - 1) .. "\n" end) - ReadmeLines = {} - for line in string.gmatch(readmedata,"[^\r\n]+") do - local b=1 - local e=nil - local len=string.len(line) - while b<=len do - for k=b,len do - if gl.GetTextWidth("X"..string.sub(line,b,k).."X")*FontSize>=vsx*0.6 then - break - end - if string.sub(line,k,k)==" " or string.sub(line,k,k)=="\t" or k==len then - e=k - end - end - e=e or len - table.insert(ReadmeLines,string.sub(line,b,e)) - b=e+1 - e=nil - end - end - end - local StartAt=math.max(1,math.min(#ReadmeLines-(LinesPerScreen-3),StartAt or 1)) - local txt="" - for k=StartAt,math.min(#ReadmeLines,StartAt+LinesPerScreen-1) do - txt=txt..ReadmeLines[k].."\n" - end - AddFrame(txt,{x=0.2*vsx,y=vsy*0.8},FontSize,{0,0.1,0.2,0.8},"lt","l",nil) - if StartAt>1 then - AddFrame("Up",{x=vsx*0.0,y=vsy},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"lt","c",FunctionsList.PrintReadMe,ReadmeLines,StartAt-LinesPerScreen+1) - AddFrame("Up",{x=vsx*1.0,y=vsy},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"rt","c",FunctionsList.PrintReadMe,ReadmeLines,StartAt-LinesPerScreen+1) - ScrollUp={FunctionsList.PrintReadMe,ReadmeLines,StartAt-1} - end - if StartAt+LinesPerScreen-1<#ReadmeLines then - AddFrame("Down",{x=vsx*0.3,y=0},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"cb","c",FunctionsList.PrintReadMe,ReadmeLines,StartAt+LinesPerScreen-1) - AddFrame("Down",{x=vsx*0.7,y=0},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"cb","c",FunctionsList.PrintReadMe,ReadmeLines,StartAt+LinesPerScreen-1) - ScrollDown={FunctionsList.PrintReadMe,ReadmeLines,StartAt+1} - end - end - AddFrame("Back",{x=vsx*0.5,y=0},vsy/StoryMenuFontSize,{},"cb","c",FunctionsList.MainMenu) -end - -local function PrintCredits(CreditsLines,StartAt) - RemoveAllFrames() - local FontSize = 16 - local LinesPerScreen = math.floor(vsy*0.6/FontSize) - local CreditsLines=CreditsLines - AddFrame(ModSpecific.CreditsFileName,{x=vsx*0.5,y=vsy},vsy/StoryMenuFontSize,{1,1,0.5,0.5},"ct","c",nil) - if not VFS.FileExists(ModSpecific.CreditsFileName) then - AddFrame("File "..ModSpecific.CreditsFileName.." not found!",{x=vsx*0.5,y=vsy*0.5},vsy/StoryMenuFontSize,{1,0.5,0.5,0.5},"cc","c",nil) - else - if not CreditsLines then - --Spring.Echo("Parsing "..ModSpecific.CreditsFileName) - local creditsdata=VFS.LoadFile(ModSpecific.CreditsFileName) - creditsdata=creditsdata:gsub("\r\n?", "\n"):gsub("\n\n+", function(c) return ("\n "):rep(#c - 1) .. "\n" end) - CreditsLines = {} - for line in string.gmatch(creditsdata,"[^\r\n]+") do - local b=1 - local e=nil - local len=string.len(line) - while b<=len do - for k=b,len do - if gl.GetTextWidth("X"..string.sub(line,b,k).."X")*FontSize>=vsx*0.6 then - break - end - if string.sub(line,k,k)==" " or string.sub(line,k,k)=="\t" or k==len then - e=k - end - end - e=e or len - table.insert(CreditsLines,string.sub(line,b,e)) - b=e+1 - e=nil - end - end - end - local StartAt=math.max(1,math.min(#CreditsLines-(LinesPerScreen-3),StartAt or 1)) - local txt="" - for k=StartAt,math.min(#CreditsLines,StartAt+LinesPerScreen-1) do - txt=txt..CreditsLines[k].."\n" - end - AddFrame(txt,{x=0.2*vsx,y=vsy*0.8},FontSize,{0,0.1,0.2,0.8},"lt","l",nil) - if StartAt>1 then - AddFrame("Up",{x=vsx*0.0,y=vsy},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"lt","c",FunctionsList.PrintCredits,CreditsLines,StartAt-LinesPerScreen+1) - AddFrame("Up",{x=vsx*1.0,y=vsy},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"rt","c",FunctionsList.PrintCredits,CreditsLines,StartAt-LinesPerScreen+1) - ScrollUp={FunctionsList.PrintCredits,CreditsLines,StartAt-1} - end - if StartAt+LinesPerScreen-1<#CreditsLines then - AddFrame("Down",{x=vsx*0.3,y=0},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"cb","c",FunctionsList.PrintCredits,CreditsLines,StartAt+LinesPerScreen-1) - AddFrame("Down",{x=vsx*0.7,y=0},vsy/StoryMenuFontSize,{0.9,0.6,0,0.5},"cb","c",FunctionsList.PrintCredits,CreditsLines,StartAt+LinesPerScreen-1) - ScrollDown={FunctionsList.PrintCredits,CreditsLines,StartAt+1} - end - end - AddFrame("Back",{x=vsx*0.5,y=0},vsy/StoryMenuFontSize,{},"cb","c",FunctionsList.MainMenu) -end - -local function Credits() - RemoveAllFrames() --- AddFrame({texture=":nc:bitmaps/button.bmp",text="This is a button"},{x=vsx*0.1,y=vsy*0.9},vsy/24,{},"lt","c",FunctionsList.Credits) --- AddFrame({texture=":nc:bitmaps/plasmaball.bmp",text="",width=vsx*0.2,height=vsy*0.4},{x=vsx*0.1,y=vsy*0.8},vsy/24,{0.1,0.67,0.35,0.5},"lt","c",FunctionsList.Credits) - AddFrame("Credits:",{x=vsx*0.5,y=vsy*0.9},vsy/CreditsMenuFontSize,{},"cb","c",nil) - AddFrame(" Evolution RTS by: ",{x=vsx*0.5,y=vsy*0.75},vsy/CreditsMenuFontSize,{},"cb","c",nil) - AddFrame("Forboding Angel\nKaiserJ",{x=vsx*0.5,y=vsy*0.75},vsy/CreditsMenuFontSize,{},"ct","l",nil) - AddFrame("Licensed under:\n Creative Commons\n Attribution\n Noncommercial\n No Derivative Works",{x=vsx*0.5,y=vsy*0.65},vsy/CreditsMenuFontSize,{},"ct","l",nil) - AddFrame("Spring Engine by: ",{x=vsx*0.5,y=vsy*0.3},vsy/CreditsMenuFontSize,{},"cb","l",nil) - AddFrame("Swedish Yankspankers\nLicensed under: GPL",{x=vsx*0.5,y=vsy*0.3},vsy/CreditsMenuFontSize,{},"ct","c",nil) - AddFrame("Back",{x=vsx*0.5,y=vsy*0.1},vsy/CreditsMenuFontSize,{},"cc","l",FunctionsList.MainMenu) -end - -local function DoTheRestart(startscriptfilename) - local n_fullscript=ModSpecific.ReloadScriptFileName - local n_infologcopy="infolog.bak.txt" - local complete=VFS.LoadFile(startscriptfilename) - Spring.Echo(widget:GetInfo().name..": Wanting to reload \""..startscriptfilename.."\"") - --Spring.Echo(widget:GetInfo().name..": that file contains:") - --Spring.Echo("\n\n<>\n\n") - --Spring.Echo(complete) - --Spring.Echo("\n\n<>\n\n") - complete,_=string.gsub(complete,"HostPort=[^;]*;","HostPort="..(0)..";",1) - complete,_=string.gsub(complete,"GameType=[^;]*;","GameType="..ModSpecific.ModFileName..";",1) - complete,_=string.gsub(complete,"Mapname=[^;]*;","Mapname="..CutOrAddMapSuffix(string.match(complete,"Mapname=([^;]*);"))..";",1) - local file=io.open(n_fullscript,"wb") - file:write(complete) - file:flush() - file:close() - local trimmed=complete - trimmed,_=string.gsub(trimmed,"//[^\r\n]-[\r\n]+","\n")-- Remove // comments - trimmed,_=string.gsub(trimmed,"/%*.-%*/","")-- Remove /* comments */ - trimmed,_=string.gsub(trimmed,"%s-u%d+%s-%=[^;]*;","")-- Remove u123=...; - trimmed,_=string.gsub(trimmed,"%s-f%d+%s-%=[^;]*;","")-- Remove f123=...; - trimmed,_=string.gsub(trimmed,"%s-RemoveUnits+%s-%=[^;]*;","")-- Remove RemoveUnits=...; - trimmed,_=string.gsub(trimmed,"%s-RemoveFeatures+%s-%=[^;]*;","")-- Remove RemoveFeatures=...; - trimmed,_=string.gsub(trimmed,"%s-HeightMapV%d+%s-%=[^;]*;","")-- Remove HeightMapV2=...; - if string.match(string.lower(startscriptfilename),"mission") then - -- Insert name of mission script - trimmed,_=string.gsub(trimmed,"([^%{]-%{[^%{]-{)(.*)","%1\n\t\tMissionScript="..startscriptfilename..";\n%2") - end - -- Insert name of full script - trimmed,_=string.gsub(trimmed,"([^%{]-%{[^%{]-{)(.*)","%1\n\tFullScript="..n_fullscript..";\n%2") - Spring.Echo("\n\n<>\n\n") - Spring.Echo(trimmed) - Spring.Echo("\n\n<>\n\n") - Spring.Echo("Making infolog.txt copy into "..n_infologcopy) - local file=io.open(n_infologcopy,"wb") - file:write(VFS.LoadFile("infolog.txt")) - file:flush() - file:close() - Spring.Echo(widget:GetInfo().name..": Ok, calling Spring.Restart(\"-s\",\"[GAME]{..}\") now!") - Spring.Restart("-s",trimmed) - Spring.Echo(widget:GetInfo().name..": Just called Spring.Restart(\"-s\",\"[GAME]{..}\")") - Spring.Echo(widget:GetInfo().name..": Wait, we shouldn't be here, should have restarted or crashed or quitted by now.") -end - -local function RunGame() - Spring.Echo(widget:GetInfo().name..": I am about to write \""..ModSpecific.ScriptFileName.."\"") - WriteScript(SDLG) - Spring.Echo(widget:GetInfo().name..": I have now written \""..ModSpecific.ScriptFileName.."\"") - if Spring.Restart then - DoTheRestart(ModSpecific.ScriptFileName) - else - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nIntegrated Launcher",{x=vsx*0.5,y=vsy*0.8},vsy/24,{},"cc","c",nil) - AddFrame("Error!\n\"package\" library disabled\nSpring.Restart not implemented\nin this build of Spring!", - {x=vsx*0.5,y=vsy*0.6},vsy/24,{},"cc","c",nil) - AddFrame("Quit, then drag'n'drop\n"..ModSpecific.ScriptFileName.."\nover "..ModSpecific.ExecutableFileName.." manually.", - {x=vsx*0.5,y=vsy*0.4},vsy/24,{},"cc","c",nil) - AddFrame("Quit",{x=vsx*0.4,y=vsy*0.2},vsy/24,{},"cc","c",FunctionsList.Quit) - AddFrame("Back",{x=vsx*0.6,y=vsy*0.2},vsy/24,{},"cc","c",FunctionsList.MainMenu) - end -end - -local function RunScript(ScriptFileName) - if Spring.Restart then - DoTheRestart(ScriptFileName) - else - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nIntegrated Launcher",{x=vsx*0.5,y=vsy*0.8},vsy/24,{},"cc","c",nil) - AddFrame("Sorry! \"Spring.Restart\" Not available!", - {x=vsx*0.5,y=vsy*0.6},vsy/24,{},"cc","c",nil) - AddFrame("You have to manually pass the file\n"..ScriptFileName.."\n as an argument to "..ModSpecific.ExecutableFileName, - {x=vsx*0.5,y=vsy*0.4},vsy/24,{},"cc","c",nil) - AddFrame("Quit",{x=vsx*0.4,y=vsy*0.2},vsy/24,{},"cc","c",FunctionsList.Quit) - AddFrame("Back",{x=vsx*0.6,y=vsy*0.2},vsy/24,{},"cc","c",FunctionsList.MainMenu) - end -end - -local function RestartSameGame() - local ms=Spring.GetModOptions()["missionscript"] - if ms then - if VFS.FileExists(ms) then - DoTheRestart(ms) - else - Spring.Echo("Mission script does not exist anymore: \""..ms.."\"") - end - else - Spring.SendCommands("luarules dump restart") - end - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nIntegrated Launcher",{x=vsx*0.5,y=vsy*0.8},vsy/24,{},"cc","c",nil) - AddFrame("Sorry! Restart failed!", - {x=vsx*0.5,y=vsy*0.6},vsy/SaveMenuFontSize,{},"cc","c",nil) - AddFrame("Try to quit and drag and drop \n"..ModSpecific.ScriptFileName.."\n over "..ModSpecific.ExecutableFileName, - {x=vsx*0.5,y=vsy*0.4},vsy/SaveMenuFontSize,{},"cc","c",nil) - AddFrame("Quit",{x=vsx*0.4,y=vsy*0.2},vsy/SaveMenuFontSize,{},"cc","c",FunctionsList.Quit) - AddFrame("Back",{x=vsx*0.6,y=vsy*0.2},vsy/SaveMenuFontSize,{},"cc","c",FunctionsList.MainMenu) -end - -local function PseudoSave() - local key_alt, key_ctrl, key_meta, key_shift=Spring.GetModKeyState() - local savegamefilename=os.date("%y-%m-%d %H-%M-%S ")..Game.modName.." "..Game.mapName - savegamefilename,_=string.gsub(savegamefilename,"[^%w-._]","_") -- replace special characters with an underscore - savegamefilename,_=string.gsub(savegamefilename,"%.smf","")..".sav" - Spring.SendCommands("luarules dump "..savegamefilename..((key_shift or key_ctrl or key_ctrl or key_meta) and " light" or "")) - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nIntegrated Launcher",{x=vsx*0.5,y=vsy*0.9},vsy/32,{},"cc","c",nil) - AddFrame("Game saved!\n \n" - .."You can use the \'Load\' menu any time to reload!", - {x=vsx*0.5,y=vsy*0.7},vsy/SaveMenuFontSize,{},"cc","c",nil) - AddFrame("This is a custom pseudo-savegame system,\n" - .."based on complex Lua and heavy startscripts,\n" - .."independant from Spring hard coded savegame system.", - {x=vsx*0.5,y=vsy*0.5},vsy/SaveMenuFontSize,{},"cc","l",nil) - AddFrame(" Warning: Under construction units not saved properly! \n" - .." Warning: Some orders and states improperly saved! \n" - .." Warning: May crash during reload! ", - {x=vsx*0.5,y=vsy*0.38},vsy/SaveMenuFontSize,{},"cc","l",nil) - AddFrame("Quit",{x=vsx*0.3,y=vsy*0.2},vsy/SaveMenuFontSize,{},"cc","c",FunctionsList.Quit) - AddFrame("Resume",{x=vsx*0.5,y=vsy*0.2},vsy/SaveMenuFontSize,{},"cc","c",FunctionsList.SwitchOff) - AddFrame("Back",{x=vsx*0.7,y=vsy*0.2},vsy/SaveMenuFontSize,{},"cc","c",FunctionsList.MainMenu) - -- Bah, skip showing that, let's go directly back to game - FunctionsList.SwitchOff() -end - -local function ChangeGrouping(grouping) - SDLG=GenerateSkirmish(SDLG.map,grouping,SDLG.difficulty,SDLG.AlliesFaction,SDLG.EnemiesFaction) - FunctionsList.SinglePlayer() -end - -local function ChangeDifficulty(difficulty) - SDLG=GenerateSkirmish(SDLG.map,SDLG.grouping,difficulty,SDLG.AlliesFaction,SDLG.EnemiesFaction) - FunctionsList.SinglePlayer() -end - -local function ChangeYourFaction() - local AFI=nil - for fi,f in ipairs(ModSpecific.FactionsList) do - if f==SDLG.AlliesFaction then - AFI=fi - break - end - end - AFI=1+(AFI%#ModSpecific.FactionsList) - SDLG.AlliesFaction=ModSpecific.FactionsList[AFI] - SDLG=GenerateSkirmish(SDLG.map,SDLG.grouping,SDLG.difficulty,SDLG.AlliesFaction,SDLG.EnemiesFaction) - FunctionsList.SinglePlayer() -end - -local function ChangeTheirFaction() - local EFI=nil - for fi,f in ipairs(ModSpecific.FactionsList) do - if f==SDLG.EnemiesFaction then - EFI=fi - break - end - end - EFI=1+(EFI%#ModSpecific.FactionsList) - SDLG.EnemiesFaction=ModSpecific.FactionsList[EFI] - SDLG=GenerateSkirmish(SDLG.map,SDLG.grouping,SDLG.difficulty,SDLG.AlliesFaction,SDLG.EnemiesFaction) - FunctionsList.SinglePlayer() -end - -local function RunRandomGame(difficulty) - if difficulty==4 then - SDLG=GenerateSkirmish(nil,3,3) - else - SDLG=GenerateSkirmish(nil,nil,difficulty) - end - RunGame() -end - -local function RandomSinglePlayer() - SDLG=GenerateSkirmish(SDLG.map) - FunctionsList.SinglePlayer() -end - -local function ChangeMap(m,ReturnTo) - SDLG=GenerateSkirmish(ModSpecific.MapsList[m],SDLG.grouping,SDLG.difficulty,SDLG.AlliesFaction,SDLG.EnemiesFaction) - FunctionsList.GoToPage(ReturnTo) -end - -local function ListMap(ReturnTo) - RemoveAllFrames() - AddFrame("Choose a map:",{x=vsx*0.5,y=vsy*0.9},vsy/MapMenuFontSize,{},"cc","c",nil) - for m,_ in ipairs(ModSpecific.MapsList) do - local missing=true - if VFS.FileExists("maps/"..ModSpecific.MapsList[m].ExternalFileName) then - missing = false - end - AddFrame(ModSpecific.MapsList[m].ClearName..(missing and " - Missing!" or ""),{x=vsx*0.5,y=vsy*(0.85-0.07*m)},vsy/MapMenuFontSize,{},"cc","c",missing and ListMap or ChangeMap,missing and ReturnTo or m,ReturnTo) - end - AddFrame("Back",{x=vsx*0.5,y=vsy*0.05},vsy/MapMenuFontSize,{},"cc","c",ReturnTo) -end - -local function SinglePlayer() - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nSingle Player",{x=vsx*0.5,y=vsy*0.9},vsy/24,{0,0,1,0.5},"cc","c",FunctionsList.SimplerSinglePlayer) - - AddFrame("Map: "..SDLG.map.ClearName,{x=vsx*0.5,y=vsy*0.75},vsy/SingleMenuFontSize,{},"cc","c",ListMap,FunctionsList.SinglePlayer) - - local nbr_map_missing = CountMissingMaps() - if nbr_map_missing>0 then - AddFrame("Warning! "..nbr_map_missing.." map"..(nbr_map_missing==1 and "" or "s").." missing!", - {x=vsx*0.53,y=vsy*0.65},vsy/SingleMenuFontSize,{0.1,0,0,0.5},"cc","c",ListMap,FunctionsList.SinglePlayer) - end - - AddFrame("You:\n\255\128\255\128"..SDLG.AlliesFaction.ClearName, - {x=vsx*0.5,y=vsy*(0.5+(nbr_map_missing==0 and 0.1 or 0))},vsy/SingleMenuFontSize,{},"cc","l",ChangeYourFaction) - AddFrame("Enemy:\n\255\255\128\128"..SDLG.EnemiesFaction.ClearName, - {x=vsx*0.5,y=vsy*(0.35+(nbr_map_missing==0 and 0.1 or 0))},vsy/SingleMenuFontSize,{},"cc","l",ChangeTheirFaction) - - AddFrame("Spectate",{x=vsx*0.15,y=vsy*0.60},vsy/SingleMenuFontSize,{0.33,0.88,1,0.5},"lc","c",ChangeGrouping,0) - AddFrame("Duel",{x=vsx*0.15,y=vsy*0.50},vsy/SingleMenuFontSize,{0.33,0.88,0,0.5},"lc","c",ChangeGrouping,1) - AddFrame("Team Game",{x=vsx*0.15,y=vsy*0.40},vsy/SingleMenuFontSize,{0.88,0.79,0,0.5},"lc","c",ChangeGrouping,2) - AddFrame("Outgunned",{x=vsx*0.15,y=vsy*0.30},vsy/SingleMenuFontSize,{0.88,0.40,0,0.5},"lc","c",ChangeGrouping,3) - --AddFrame("Heroic",{x=vsx*0.15,y=vsy*0.20},vsy/24,{0.88,0,0.88,0.5},"lc","c",ChangeGrouping,4) - - AddFrame("Easy",{x=vsx*0.85,y=vsy*0.60},vsy/SingleMenuFontSize,{0.33,0.88,1,0.5},"rc","c",ChangeDifficulty,1) - AddFrame("Medium",{x=vsx*0.85,y=vsy*0.50},vsy/SingleMenuFontSize,{0.33,0.88,0,0.5},"rc","c",ChangeDifficulty,2) - AddFrame("Hard",{x=vsx*0.85,y=vsy*0.40},vsy/SingleMenuFontSize,{0.88,0.79,0,0.5},"rc","c",ChangeDifficulty,3) - AddFrame("Extreme",{x=vsx*0.85,y=vsy*0.30},vsy/SingleMenuFontSize,{0.88,0.40,0,0.5},"rc","c",ChangeDifficulty,4) - - AddFrame("Start!",{x=vsx*0.4,y=vsy*0.2},vsy/SingleMenuFontSize,{0,1,0,0.5},"cc","c",RunGame) - AddFrame("Back",{x=vsx*0.6,y=vsy*0.2},vsy/SingleMenuFontSize,{},"cc","c",FunctionsList.MainMenu) - - AddFrame(SDLG.description,{x=vsx*0.5,y=vsy*0.05},vsy/SingleMenuFontSize,{0.2,0.5,0.9,0.5},"cc","c") - -end - -local function SimplerSinglePlayer() - RemoveAllFrames() --- AddFrame(ModSpecific.ModDisplayName.."\nSingle Player",{x=vsx*0.5,y=vsy*0.8},vsy/24,{0,0,1,0.5},"cc","c",FunctionsList.SinglePlayer) - AddFrame("Easy",{x=vsx*0.5,y=vsy*0.6},vsy/SingleMenuFontSize,{0.33,0.88,0,0.5},"cc","c",RunRandomGame,1) - AddFrame("Medium",{x=vsx*0.5,y=vsy*0.5},vsy/SingleMenuFontSize,{0.88,0.79,0,0.5},"cc","c",RunRandomGame,2) - AddFrame("Hard",{x=vsx*0.5,y=vsy*0.4},vsy/SingleMenuFontSize,{0.88,0.40,0,0.5},"cc","c",RunRandomGame,3) - AddFrame("Very Hard",{x=vsx*0.5,y=vsy*0.3},vsy/SingleMenuFontSize,{0.88,0.02,0,0.5},"cc","c",RunRandomGame,4) - AddFrame("Back",{x=vsx*0.5,y=vsy*0.2},vsy/SingleMenuFontSize,{0,0,1,0.5},"cc","c",FunctionsList.MainMenu) - local nbr_map_missing = CountMissingMaps() - if nbr_map_missing>0 then - AddFrame("Warning! "..nbr_map_missing.." map"..(nbr_map_missing==1 and "" or "s").." missing!", - {x=vsx*0.5,y=vsy*0.1},vsy/SingleMenuFontSize,{0.90,0,0,0.5},"cc","c",ListMap,FunctionsList.SimplerSinglePlayer) - end -end - -local function PseudoLoad(StartAt) - - local function GetSaveDescriptionFromActiveFrame() - local FrameIndex=ActiveFrameIndex or MouseOveredFrameIndex or KeyboardFrameIndex - if FrameIndex and FramesList[FrameIndex] and FramesList[FrameIndex].Param2 then - local ActiveSave=FramesList[FrameIndex].Param2 - if ActiveSave.Description then - return ActiveSave.Description - else - return "Description Unavailable" - end - else - return "No save selected" - end - end - - local StartAt=math.max(1,StartAt or 1) - local SavePerPage=10 - Savegames=GetSavegames() - RemoveAllFrames() - AddFrame(GetSaveDescriptionFromActiveFrame,{x=vsx,y=vsy},vsy/SaveMenuFontSize,{},"rt","l") - - for SaveIndex=StartAt,StartAt+SavePerPage-1 do - local Savegame=Savegames[SaveIndex] - if Savegame then - AddFrame(Savegame.DisplayName,{x=0,y=vsy-(vsy/16)*(4+SaveIndex-StartAt)},vsy/SaveMenuFontSize,{},"lt","l",RunScript,Savegame.FileName,Savegame) - end - end - - if StartAt>1 then - AddFrame("<-",{x=vsx*0.4,y=0},vsy/SaveMenuFontSize,{},"cb","c",FunctionsList.PseudoLoad,math.max(1,StartAt-SavePerPage)) - end - AddFrame("Back",{x=vsx*0.5,y=0},vsy/SaveMenuFontSize,{},"cb","c",FunctionsList.MainMenu) - if StartAt+SavePerPage-1<#Savegames then - AddFrame("->",{x=vsx*0.6,y=0},vsy/SaveMenuFontSize,{},"cb","c",FunctionsList.PseudoLoad,StartAt+SavePerPage) - end -end - -local function MissionsMenu() - RemoveAllFrames() - local MissionsList=JoinArrays(VFS.DirList("Missions/"..Game.modShortName),VFS.DirList("Missions")) - local ItemSize=math.min(vsy/(2*(#MissionsList+2)),vsy/MissionMenuFontSize) - for MissionIndex,MissionFileName in ipairs(MissionsList) do - local EndIndex=(string.find(MissionFileName,".",string.len(MissionFileName)-4,true) or 1+string.len(MissionFileName))-1 - local BeginIndex=1 - repeat - local NewBeginIndex=string.find(MissionFileName,"/",BeginIndex,true) or string.find(MissionFileName,"\\",BeginIndex,true) - BeginIndex=NewBeginIndex and NewBeginIndex+1 or BeginIndex - until not NewBeginIndex - AddFrame(Capitalize(string.sub(MissionFileName,BeginIndex,EndIndex)),{x=vsx*0.5,y=vsy-2*MissionIndex*ItemSize},ItemSize,{},"ct","c",RunScript,MissionFileName) - end - AddFrame("Back",{x=vsx*0.5,y=0},vsy/MissionMenuFontSize,{},"cb","c",FunctionsList.MainMenu) -end - -local function MainMenu() - RemoveAllFrames() - local JustMenuNoGame = (Spring.GetModOptions()[string.lower(ModSpecific.AnyModOptionWillDo)] == nil) - if JustMenuNoGame then --- AddFrame(ModSpecific.ModDisplayName,{x=vsx*0.5,y=vsy*0.9},vsy/12,{},"cc","c") - else - AddFrame("Restart",{x=vsx*0.5,y=vsy*0.9},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.RestartSameGame) - end - AddFrame("Skirmish",{x=vsx*0.5,y=vsy*0.8},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.RandomSinglePlayer) - AddFrame("Missions",{x=vsx*0.5,y=vsy*0.6},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.MissionsMenu) - if package then - AddFrame("MultiPlayer",{x=vsx*0.5,y=vsy*0.53},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.MultiPlayer) - AddFrame("Options",{x=vsx*0.5,y=vsy*0.47},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.Settings) - end - AddFrame("Load",{x=vsx*0.5,y=vsy*0.45},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.PseudoLoad) - local LoadButtonIndex=#FramesList - if ModSpecific.ReadmeFileName then - AddFrame(Capitalize(string.match(ModSpecific.ReadmeFileName,"(.+)%.[.^%.]-") or ModSpecific.ReadmeFileName),{x=vsx*0.5,y=vsy*0.4},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.PrintReadMe) - end - AddFrame("Credits",{x=vsx*0.5,y=vsy*0.3},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.PrintCredits) - AddFrame("Quit",{x=vsx*0.5,y=vsy*0.2},vsy/MainMenuFontSize,{},"cc","c",FunctionsList.Quit) - if #FramesList>0 then - local factor=4/#FramesList - for Index,Frame in ipairs(FramesList) do - Frame.FontSize=Frame.FontSize*factor - Frame.Pos.y=vsy*(1-(Index)/(1+#FramesList)) - end - end - local _,_,isDead = Spring.GetTeamInfo(Spring.GetMyTeamID()) - if not isDead and not Spring.GetSpectatingState() and not JustMenuNoGame then - FramesList[LoadButtonIndex].Pos.x=vsx*0.6 - AddFrame("Save",{x=vsx*0.4,y=FramesList[LoadButtonIndex].Pos.y},FramesList[LoadButtonIndex].FontSize,{},"cc","c",FunctionsList.PseudoSave) - for f=#FramesList,LoadButtonIndex,-1 do - FramesList[f+1]=FramesList[f] - end - FramesList[LoadButtonIndex]=FramesList[#FramesList] - FramesList[#FramesList]=nil - end -end - - -local function GoToPage(PageToGoTo) - PageToGoTo() -end - -local function DrawFrame(Frame) - - local Text = Frame.Text - local Texture = nil - local TextureWidth = nil - local TextureHeight = nil - local x = Frame.Pos.x - local y = Frame.Pos.y - local FontSize = Frame.FontSize - local bg_red = Frame.Color[1] or (Frame.Function and 0.7 or 0.2) - local bg_green = Frame.Color[2] or (Frame.Function and 0.7 or 0.2) - local bg_blue = Frame.Color[3] or (Frame.Function and 0.7 or 0.2) - local bg_alpha = Frame.Color[4] or 0.5 - local FramePosition = Frame.FramePosition - local TextPosition = Frame.TextPosition - - if type(Text)=="function" then - Text=Text() - end - if type(Text)=="table" then - Texture,Text,TextureWidth,TextureHeight=Text.texture,Text.text,Text.width,Text.height - bg_red = Frame.Color[1] or 1 - bg_green = Frame.Color[2] or 1 - bg_blue = Frame.Color[3] or 1 - bg_alpha = Frame.Color[4] or 0.5 - end - if type(Text)~="string" then - Text=tostring(Text) - end - if type(x)~="number" then - x=vsx/2 - end - if type(y)~="number" then - y=vsy/2 - end - if type(FontSize)~="number" then - FontSize=20 - end - if type(bg_red)~="number" or type(bg_green)~="number" or type(bg_blue)~="number" then - bg_red = 1 - bg_green = 1 - bg_blue = 1 - end - if type(bg_alpha)~="number" then - bg_alpha = 0.2 - end - - local txtLinesList = {} - local maxTxtWidth = 0 - for line in string.gmatch(Text,"[^\r\n]+") do - table.insert(txtLinesList,line) - if gl.GetTextWidth(line)>maxTxtWidth then - maxTxtWidth=gl.GetTextWidth(line) - end - end - - local TextWidthFixHack = 1 - if tonumber(string.sub(Game.version,1,4))<=0.785 and string.sub(Game.version,1,5)~="0.78+" then - TextWidthFixHack = (vsx/vsy)*(4/3) - end - local xFramedTextSize=FontSize*(1+maxTxtWidth*TextWidthFixHack) - local yFramedTextSize=FontSize*(1+#txtLinesList) - if Texture then - gl.Texture(Texture) - local TextureInfo=gl.TextureInfo(Texture) - xFramedTextSize,yFramedTextSize=TextureWidth or xFramedTextSize or TextureInfo.xsize,TextureHeight or yFramedTextSize or TextureInfo.ysize - end - local xPosMin = x-xFramedTextSize/2 - local xPosMax = x+xFramedTextSize/2 - local yPosMin = y-yFramedTextSize/2 - local yPosMax = y+yFramedTextSize/2 - - if type(FramePosition)=="string" and string.len(FramePosition)==2 then - if string.sub(FramePosition,1,1)=='c' then - xPosMin = x - xFramedTextSize/2 - xPosMax = x + xFramedTextSize/2 - elseif string.sub(FramePosition,1,1)=='r' then - xPosMin = x - xFramedTextSize - xPosMax = x - elseif string.sub(FramePosition,1,1)=='l' then - xPosMin = x - xPosMax = x + xFramedTextSize - else - Spring.Echo("Wrong FramePosition[1] in "..widget:GetInfo().name.."'s DrawFramedText",string.sub(FramePosition,1,1)) - end - if string.sub(FramePosition,2,2)=='c' then - yPosMin = y - yFramedTextSize/2 - yPosMax = y + yFramedTextSize/2 - elseif string.sub(FramePosition,2,2)=='t' or string.sub(FramePosition,2,2)=='u' then - yPosMin = y - yFramedTextSize - yPosMax = y - elseif string.sub(FramePosition,2,2)=='b' or string.sub(FramePosition,2,2)=='d' then - yPosMin = y - yPosMax = y + yFramedTextSize - else - Spring.Echo("Wrong FramePosition[2] in "..widget:GetInfo().name.."'s DrawFramedText") - end - else - Spring.Echo("Wrong FramePosition in "..widget:GetInfo().name.."'s DrawFramedText",string.sub(FramePosition,2,2)) - end - - Frame.Pos={x=Frame.Pos.x, y=Frame.Pos.y, xPosMin=xPosMin, xPosMax=xPosMax, yPosMin=yPosMin, yPosMax=yPosMax, xFramedTextSize=xFramedTextSize, yFramedTextSize=yFramedTextSize} - - if Frame.Function and isAboveFrame(nil,nil,Frame) then - MouseOveredFrameIndex = Frame.Index - ActiveFrameIndex = Frame.Index - end - - if ActiveFrameIndex ~= MouseOveredFrameIndex and not KeyboardFrameIndex then - ActiveFrameIndex = nil - end - - - if Texture then - gl.Color(bg_red,bg_green,bg_blue,bg_alpha) - gl.TexRect(xPosMin,yPosMin,xPosMax,yPosMax) - gl.Texture(false) - else - gl.Color(bg_red,bg_green,bg_blue,bg_alpha) - gl.Rect(xPosMin,yPosMin,xPosMax,yPosMax) - end - gl.Color(1,1,1,bg_alpha) - for n,_ in ipairs(txtLinesList) do - if TextPosition=="c" then - gl.Text(txtLinesList[n], (xPosMin+xPosMax)/2, yPosMax+(-0.5-n)*FontSize, FontSize, "cod") - elseif TextPosition=="r" then - gl.Text(txtLinesList[n], xPosMax-FontSize/2, yPosMax+(-0.5-n)*FontSize, FontSize, "rod") - else - gl.Text(txtLinesList[n], xPosMin+FontSize/2, yPosMax+(-0.5-n)*FontSize, FontSize, "od") - end - end - if Frame.Index==ActiveFrameIndex then - gl.Color(0,0,0,bg_alpha) - gl.LineWidth(FontSize/4) - gl.Shape(GL.LINES,{ - {v={xPosMin+FontSize/4,yPosMax-FontSize/8}}, - {v={xPosMax-FontSize/4,yPosMax-FontSize/8}}, - {v={xPosMax-FontSize/8,yPosMax}}, - {v={xPosMax-FontSize/8,yPosMin}}, - {v={xPosMax-FontSize/4,yPosMin+FontSize/8}}, - {v={xPosMin+FontSize/4,yPosMin+FontSize/8}}, - {v={xPosMin+FontSize/8,yPosMin}}, - {v={xPosMin+FontSize/8,yPosMax}},}) - else - gl.Color(0,0,0,bg_alpha) - gl.LineWidth(1) - gl.Shape(GL.LINES,{ - {v={xPosMin+1,yPosMax-0.5}}, - {v={xPosMax-1,yPosMax-0.5}}, - {v={xPosMax-0.5,yPosMax}}, - {v={xPosMax-0.5,yPosMin}}, - {v={xPosMax-1,yPosMin+0.5}}, - {v={xPosMin+1,yPosMin+0.5}}, - {v={xPosMin+0.5,yPosMin}}, - {v={xPosMin+0.5,yPosMax}},}) - end - gl.Color(1,1,1,1) -end - -local function EitherDrawScreen(self) - - -- Nothing until screen size is known - if vsx==nil or vsy==nil or vsx==0 or vsy==0 or not IsActive then - return - end - - -- Remove (make yellow) all other widgets after 0.7s - if false and InitializeTimer and Spring.DiffTimers(Spring.GetTimer(),InitializeTimer)>0.7 then - InitializeTimer = false - RemovedWidgetList = {} - local RemovedWidgetListName = {} - for name,kw in pairs(widgetHandler.knownWidgets) do - if kw.active and name ~= self:GetInfo().name then - table.insert(RemovedWidgetListName,name) - end - end - for _,w in pairs(widgetHandler.widgets) do - for _,name in pairs(RemovedWidgetListName) do - if w.GetInfo().name == name then - table.insert(RemovedWidgetList,w) - end - end - end - for _,w in pairs(RemovedWidgetList) do - Spring.Echo("Removing",w.GetInfo().name) - widgetHandler:RemoveWidget(w) - end - Spring.Echo("The line above may complain about 'w' being nil, that is normal, and a result of my closing all widgets.") - Spring.SendCommands("hideinterface 1") -- In case action finder had unhidden it - end - - -- If no menu shown, then show the first menu - if #FramesList==0 then - FunctionsList.MainMenu() - end - - if HideView then - -- Draw background texture - local BackgroundTexture = "bitmaps/spbackground.png" - gl.Blending(false) - gl.Color(1,1,1,1) - gl.Texture(BackgroundTexture) - gl.TexRect(0,0,vsx,vsy) - gl.Texture(false) - end - - if ViewPoint then - Spring.SetCameraState(ViewPoint,0) - end - - -- Draw the elements - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.Color(1,1,1,1) - gl.Text("Spring\n"..Game.version,4,4,12,"ob") - gl.Text(Game.modShortName.."\n"..Game.modVersion,vsx-4,4,12,"rob") - MouseOveredFrameIndex=nil - for Index,Frame in ipairs(FramesList) do - Frame.Index=Index - DrawFrame(Frame) - end -end - - -function widget:DrawScreenEffects(dse_vsx, dse_vsy) - vsx, vsy = dse_vsx, dse_vsy - if Spring.IsGUIHidden() then - EitherDrawScreen(self) - end -end - - -function widget:DrawScreen() - if not Spring.IsGUIHidden() then - EitherDrawScreen(self) - end -end - - -function widget:MousePress(x,y,button) - if IsActive then - for _,Frame in ipairs(FramesList) do - if isAboveFrame(x,y,Frame) then - if Frame.Function then - Frame.Function(Frame.Param1,Frame.Param2,Frame.Param3) - return true - end - end - end - end -end - -function widget:MouseWheel(up,value) - if up then - if ScrollUp then - ScrollUp[1](ScrollUp[2],ScrollUp[3],ScrollUp[4],ScrollUp[5]) - return true - end - else - if ScrollDown then - ScrollDown[1](ScrollDown[2],ScrollDown[3],ScrollDown[4],ScrollDown[5]) - return true - end - end - return false -end - -function widget:KeyPress(key) - local up_arrow,down_arrow,right_arrow,left_arrow,enter,space,esc,del,tab = 273,274,275,276,13,32,27,127,9 - if key==esc then - local _,cmd=Spring.GetActiveCommand() - local alt,ctrl,meta,shift=Spring.GetModKeyState() - if not alt and not ctrl and not meta and shift and not cmd then - if IsActive and not HideView then - if ViewPoint then - Spring.SendCommands({'NoSound 0'}) -- Re-enable sounds when pressing esc after direct running Spring.exe - ViewPoint=nil - end - FunctionsList.SwitchOff() - return true - elseif IsActive and HideView then - HideView=false - Spring.SendCommands("endgraph 0") - Spring.SendCommands("hideinterface 1") - Spring.SendCommands({'NoSound 0'}) -- Re-enable sounds when pressing esc after direct running Spring.exe - return true - else - FunctionsList.SwitchOn() - return true - end - end - end - if IsActive then - if key==up_arrow or key==left_arrow then - if not ActiveFrameIndex then - for Index,Frame in ipairs(FramesList) do - if Frame.Function then - ActiveFrameIndex = Index - end - end - else - local NewFrameIndex = ActiveFrameIndex - for Index,Frame in ipairs(FramesList) do - if Frame.Function and IndexActiveFrameIndex then - ActiveFrameIndex = Index - break - end - end - end - KeyboardFrameIndex = ActiveFrameIndex - elseif key==enter or key==space then - if ActiveFrameIndex and FramesList[ActiveFrameIndex] and FramesList[ActiveFrameIndex].Function then - FramesList[ActiveFrameIndex].Function(FramesList[ActiveFrameIndex].Param1,FramesList[ActiveFrameIndex].Param2,FramesList[ActiveFrameIndex].Param3) - return true - end - elseif key==del then - local FrameIndex=ActiveFrameIndex or MouseOveredFrameIndex or KeyboardFrameIndex - if FrameIndex and FramesList[FrameIndex] and FramesList[FrameIndex].Param2 then - local ActiveSave=FramesList[FrameIndex].Param2 - if ActiveSave.FileName then - Spring.Echo("Deleting "..ActiveSave.FileName) - os.remove(ActiveSave.FileName) - FunctionsList.PseudoLoad(20*math.floor(ActiveSave.Index/20)) - return true - end - end - end - if key==up_arrow or key==left_arrow or key==down_arrow or key==right_arrow or key==enter or key==space or key==tab then - return true - end - end -end - -local function FindMap() - --Spring.Echo("Game.mapName:"..Game.mapName) - --Spring.Echo("Game.mapHumanName:"..Game.mapHumanName) - for _,map in ipairs(ModSpecific.MapsList) do - if map.InternalFileName == Game.mapName then - return map - end - end - return nil -end - -function widget:GameOver() - FunctionsList.SwitchOn() -end - - -local function SwitchOn() - if not IsActive then - IsActive = true - FramesList={} - Spring.SendCommands("endgraph 0") - Spring.SendCommands("hideinterface 1") - end -end - - -local function SwitchOff() - if IsActive then - IsActive = false - RemoveAllFrames() - Spring.SendCommands("endgraph 1") - Spring.SendCommands("hideinterface 0") - end -end - -local function BetterizeRandom() - local x,y=Spring.GetMouseState() - local BetterRand=math.floor(99*(os.clock()%99999)+(99*(os.time())%99999))+Spring.GetDrawFrame()+math.random(0,999) - for k=-5,BetterRand%100 do - math.random(0,999) - end -end - -function widget:Initialize() - SafeTry("Spring.SetWMIcon","bitmaps/icons/SpringAppIcon"..Game.modShortName..".png") - SafeTry("Spring.SetWMCaption",Game.modName.." - Spring "..Game.version,Game.modShortName.." "..Game.modVersion) - BetterizeRandom() - IsActive = false - FunctionsList={Credits=Credits,MainMenu=MainMenu,Quit=Quit, - SimplerSinglePlayer=SimplerSinglePlayer,PrintReadMe=PrintReadMe,PrintCredits=PrintCredits, - SinglePlayer=SinglePlayer,RandomSinglePlayer=RandomSinglePlayer,GoToPage=GoToPage, - MissionsMenu=MissionsMenu,SwitchOn=SwitchOn,SwitchOff=SwitchOff, - RestartSameGame=RestartSameGame,PseudoSave=PseudoSave,PseudoLoad=PseudoLoad} - FramesList={} - FillModSpecific() - SDLG=GenerateSkirmish() - --SDLG=GenerateSkirmish(FindMap()) - if Spring.GetModOptions()[string.lower(ModSpecific.AnyModOptionWillDo)]==nil then - Spring.SendCommands({'NoSound 1'}) -- Disable sound when menu pops up straight after running Spring.exe - ViewPoint=Spring.GetModOptions()["viewpoint"] or Spring.GetModOptions()["viewpoint0"] or Spring.GetModOptions()["viewpoint1"] - ViewPoint=UnQuoteString(ViewPoint) - InitializeTimer = Spring.GetTimer() - HideView = (ViewPoint==nil) - FunctionsList.SwitchOn() - elseif #Spring.GetPlayerList()>1 then - widgetHandler:RemoveWidget(self) -- Disable the menu in multiplayer games - end -end - - -function widget:Shutdown() - FunctionsList.SwitchOff() -end - diff --git a/LuaUI/Widgets_Evo/unit_air_allways_fly.lua b/LuaUI/Widgets_Evo/unit_air_allways_fly.lua new file mode 100644 index 000000000..3a03b6ec6 --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_air_allways_fly.lua @@ -0,0 +1,118 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function widget:GetInfo() + return { + name = "Aircraft plants on Fly", + desc = "Setting aircraft plants on Fly mode", + author = "[teh]decay", + date = "29 sept 2013", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = false -- loaded by default? + } +end + +-- project page on github: https://github.com/jamerlan/unit_air_allways_fly + +--Changelog +-- + +------------------------------- + +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetMyTeamId = Spring.GetMyTeamID +local spGetTeamUnits = Spring.GetTeamUnits +local spGetUnitDefID = Spring.GetUnitDefID +-------------------------------------------------------------------------------- + + +function widget:Update() + +end + +function widget:UnitCreated(unitID, unitDefID, teamID, builderID) + if(teamID == spGetMyTeamId()) then + switchAirpadToFlyMode(unitID, unitDefID) + end +end + +function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + if(newTeam == spGetMyTeamId()) then + switchAirpadToFlyMode(unitID, unitDefID) + end +end + + +function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + if(unitTeam == spGetMyTeamId()) then + switchAirpadToFlyMode(unitID, unitDefID) + end +end + + +function switchAirpadToFlyMode(unitID, unitDefID) + -- if (unitDefID == UnitDefNames["eairengineer"].id or + -- unitDefID == UnitDefNames["ebomber"].id or + -- unitDefID == UnitDefNames["edrone"].id or + -- unitDefID == UnitDefNames["edrone_up1"].id or + -- unitDefID == UnitDefNames["edrone_up2"].id or + -- unitDefID == UnitDefNames["edrone_up3"].id or + -- unitDefID == UnitDefNames["efighter"].id or + -- unitDefID == UnitDefNames["egunship2"].id or + -- unitDefID == UnitDefNames["escout"].id or + -- unitDefID == UnitDefNames["eraider"].id or + -- unitDefID == UnitDefNames["eraider_up1"].id or + -- unitDefID == UnitDefNames["eraider_up2"].id or + -- unitDefID == UnitDefNames["eraider_up3"].id or + -- unitDefID == UnitDefNames["etransport"].id or + -- unitDefID == UnitDefNames["ebomber_up1"].id or + -- unitDefID == UnitDefNames["efighter_up1"].id or + -- unitDefID == UnitDefNames["egunship2_up1"].id or + -- unitDefID == UnitDefNames["escout_up1"].id or + -- unitDefID == UnitDefNames["etransport_up1"].id or + -- unitDefID == UnitDefNames["ebomber_up2"].id or + -- unitDefID == UnitDefNames["efighter_up2"].id or + -- unitDefID == UnitDefNames["egunship2_up2"].id or + -- unitDefID == UnitDefNames["escout_up2"].id or + -- unitDefID == UnitDefNames["etransport_up2"].id or + -- unitDefID == UnitDefNames["ebomber_up3"].id or + -- unitDefID == UnitDefNames["efighter_up3"].id or + -- unitDefID == UnitDefNames["egunship2_up3"].id or + -- unitDefID == UnitDefNames["escout_up3"].id or + -- unitDefID == UnitDefNames["etransport_up3"].id or + -- unitDefID == UnitDefNames["ekrow"].id or + -- unitDefID == UnitDefNames["ekrow_up1"].id or + -- unitDefID == UnitDefNames["ekrow_up2"].id or + -- unitDefID == UnitDefNames["ekrow_up3"].id) then + -- spGiveOrderToUnit(unitID, CMD.IDLEMODE, { 0 }, {}) + -- end +end + +function widget:PlayerChanged(playerID) + local _, _, spec = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if spec then + widgetHandler:RemoveWidget() + return false + end +end + + +function widget:Initialize() + local _, _, spec, teamId = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if spec then + widgetHandler:RemoveWidget() + return false + end + + for _, unitID in ipairs(spGetTeamUnits(teamId)) do -- init existing labs + switchAirpadToFlyMode(unitID, spGetUnitDefID(unitID)) + end + + return true +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + diff --git a/LuaUI/Widgets_Evo/unit_armor_icons.lua b/LuaUI/Widgets_Evo/unit_armor_icons.lua new file mode 100644 index 000000000..bcb3195fc --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_armor_icons.lua @@ -0,0 +1,150 @@ + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Armor Icons", + desc = "Adds an armor icon for armored units (needs Unit Icons)", + author = "trepan (idea quantum,jK), CarRepairer tweak, CommonPlayer", + date = "Feb, 2008", + license = "GNU GPL, v2 or later", + layer = 5, + enabled = true -- loaded by default? + } +end + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +-- speed-ups +local GetUnitDefID = Spring.GetUnitDefID +local GetAllUnits = Spring.GetAllUnits + +---------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------- + +local PWUnits = {} + +local myAllyTeamID = 666 + + +local armoredTex = 'luaui/images/armortype/armored.dds' +local dmgTexBase = 'luaui/images/damagetype/' +local dmgTextures = { + ecommanderbattle = dmgTexBase .. 'light.dds', + -- Start h-bots + ehbotpeewee = dmgTexBase .. 'light.dds', + ehbotthud = dmgTexBase .. 'light.dds', + ehbotsniper = dmgTexBase .. 'armor.dds', + ehbotrocko = dmgTexBase .. 'armor.dds', + -- Start Hovers + eartytank = dmgTexBase .. 'building.dds', + elighttank3 = dmgTexBase .. 'light.dds', + eheavytank3 = dmgTexBase .. 'armor.dds', + emissiletank = dmgTexBase .. 'armor.dds', + eriottank2 = dmgTexBase .. 'light.dds', + eriottank2shotgun = dmgTexBase .. 'light.dds', + elacerator = dmgTexBase .. 'building.dds', + -- Start All Terrains + eallterrheavy = dmgTexBase .. 'armor.dds', + eallterrlight = dmgTexBase .. 'light.dds', + eallterrmed = dmgTexBase .. 'armor.dds', + eallterrriot = dmgTexBase .. 'light.dds', + eallterrriotshotgun = dmgTexBase .. 'light.dds', + eallterrassault = dmgTexBase .. 'building.dds', + eallterranarchid = dmgTexBase .. 'building.dds', + eallterranarchidflame = dmgTexBase .. 'building.dds', + -- Start Amphibs + eamphibbuggy = dmgTexBase .. 'light.dds', + eamphibriot = dmgTexBase .. 'light.dds', + eamphibneedle = dmgTexBase .. 'light.dds', + eamphibriotshotgun = dmgTexBase .. 'light.dds', + eamphibmedtank = dmgTexBase .. 'armor.dds', + eamphibrock = dmgTexBase .. 'armor.dds', + eamphibarty = dmgTexBase .. 'building.dds', + eamphibleveler = dmgTexBase .. 'armor.dds', + -- Start Aircraft + edrone = dmgTexBase .. 'light.dds', + efighter = dmgTexBase .. 'light.dds', + egunship2 = dmgTexBase .. 'armor.dds', + ebomber = dmgTexBase .. 'building.dds', + -- Start Buildings + elightturret2 = dmgTexBase .. 'light.dds', + eheavyturret2 = dmgTexBase .. 'armor.dds', +} + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +function PWCreate(unitID) + PWUnits[unitID] = true + SetArmorIcon(unitID) +end + +function widget:Initialize() + + widgetHandler:RegisterGlobal("PWCreate", PWCreate) + + WG.icons.SetOrder( 'dmgtype', 1 ) + WG.icons.SetOrder( 'armor', 2 ) + + for _,unitID in pairs( GetAllUnits() ) do + SetArmorIcon(unitID) + end +end + +function widget:Shutdown() +end + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +function SetArmorIcon(unitID) + local ud = UnitDefs[GetUnitDefID(unitID)] + if (ud == nil) then + return + end + + if ud.customParams.armortype then + armortype = ud.customParams.armortype + if armortype == "armored" then + if not PWUnits[unitID] then + WG.icons.SetUnitIcon( unitID, {name='armor', texture=armoredTex } ) + end + end + end + if ud.weapons and #ud.weapons ~= 0 then + local wd = WeaponDefs[ud.weapons[1].weaponDef] + if wd.customParams ~= nil and wd.customParams.damagetype ~= nil and + dmgTextures[wd.customParams.damagetype] ~= nil then + WG.icons.SetUnitIcon( unitID, {name='dmgtype', texture=dmgTextures[wd.customParams.damagetype] } ) + end + end +end + + + +------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------- + +function widget:UnitCreated(unitID, unitDefID, unitTeam) + SetArmorIcon(unitID) +end + + +function widget:UnitDestroyed(unitID, unitDefID, unitTeam) + WG.icons.SetUnitIcon( unitID, {name='armor', texture=nil} ) + PWUnits[unitID] = nil +end + +--needed if icon widget gets disabled/enabled after this one. find a better way? +function widget:GameFrame(f) + if f%(32*5) == 0 then --5 seconds + for _,unitID in pairs( GetAllUnits() ) do + SetArmorIcon(unitID) + end + end +end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/unit_auto_group.lua b/LuaUI/Widgets_Evo/unit_auto_group.lua index 0dccf9ea1..3c70f1e57 100644 --- a/LuaUI/Widgets_Evo/unit_auto_group.lua +++ b/LuaUI/Widgets_Evo/unit_auto_group.lua @@ -32,11 +32,17 @@ include("keysym.h.lua") -- Added commands: help, loadgroups, cleargroups, verboseMode, addall. -- Licho, v1.0 : Creation. ---REMINDER : --- none -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +local fontfile = LUAUI_DIRNAME .. "fonts/" .. Spring.GetConfigString("ui_font", "JosefinSans-SemiBold.ttf") +local vsx,vsy = Spring.GetViewGeometry() +local fontfileScale = (0.5 + (vsx*vsy / 5700000)) +local fontfileSize = 25 +local fontfileOutlineSize = 6 +local fontfileOutlineStrength = 1.4 +local font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + local debug = false --of true generates debug messages local unit2group = {} -- list of unit types to group @@ -49,16 +55,7 @@ for _, v in ipairs( groupableBuildingTypes ) do end end - -local helpText = - 'Alt+0-9 sets autogroup# for selected unit type(s).\nNewly built units get added to group# equal to their autogroup#.'.. - '\nAlt+BACKQUOTE (~) deletes autogrouping for selected unit type(s).' - --'Ctrl+~ removes nearest selected unit from its group and selects it. ' - --'Extra function: Ctrl+q picks single nearest unit from current selection.', - -options_order = { 'help', 'cleargroups', 'loadgroups', 'addall', 'verbose', 'immediate', 'groupnumbers', } -options_path = 'Settings/Interface/AutoGroup' -options = { +local options = { loadgroups = { name = 'Preserve Auto Groups', desc = 'Preserve auto groupings for next game. Unchecking this clears the groups!', @@ -94,12 +91,6 @@ options = { value = true, }, - help = { - name = 'Help', - type = 'text', - value = helpText, - }, - cleargroups = { name = 'Clear Auto Groups', type = 'button', @@ -111,11 +102,8 @@ options = { } local finiGroup = {} -local myTeam -local selUnitDefs = {} -local loadGroups = true +local myTeam = Spring.GetMyTeamID() local createdFrame = {} -local textColor = {0.7, 1.0, 0.7, 1.0} -- r g b alpha local textSize = 13.0 -- gr = groupe selected/wanted @@ -124,7 +112,6 @@ local textSize = 13.0 local SetUnitGroup = Spring.SetUnitGroup local GetSelectedUnits = Spring.GetSelectedUnits local GetUnitDefID = Spring.GetUnitDefID -local GetAllUnits = Spring.GetAllUnits local GetUnitHealth = Spring.GetUnitHealth local GetMouseState = Spring.GetMouseState local SelectUnitArray = Spring.SelectUnitArray @@ -137,47 +124,94 @@ local GetGameFrame = Spring.GetGameFrame local IsGuiHidden = Spring.IsGUIHidden local Echo = Spring.Echo - function printDebug( value ) - if ( debug ) then Echo( value ) - end - end +function printDebug( value ) + if ( debug ) then Echo( value ) end +end + +function widget:ViewResize(n_vsx,n_vsy) + vsx,vsy = Spring.GetViewGeometry() + local newFontfileScale = (0.5 + (vsx*vsy / 5700000)) + if (fontfileScale ~= newFontfileScale) then + fontfileScale = newFontfileScale + gl.DeleteFont(font) + font = gl.LoadFont(fontfile, fontfileSize*fontfileScale, fontfileOutlineSize*fontfileScale, fontfileOutlineStrength) + end +end + +function widget:GameStart() + gameStarted = true + widget:PlayerChanged() +end + +function widget:PlayerChanged(playerID) + if Spring.GetSpectatingState() and (Spring.GetGameFrame() > 0 or gameStarted) then + widgetHandler:RemoveWidget(self) + return + end + myTeam = Spring.GetMyTeamID() +end + +function widget:Initialize() + myTeam = Spring.GetMyTeamID() + + WG['autogroup'] = {} + WG['autogroup'].getImmediate = function() + return options.immediate.value + end + WG['autogroup'].setImmediate = function(value) + options.immediate.value = value + end + + dlists = {} + for i=0, 9 do + dlists[i] = gl.CreateList(function() + font:Begin() + font:Print("\255\200\255\200" .. i, 20.0, -10.0, textSize, "cns") + font:End() + end) + end + + if Spring.IsReplay() or Spring.GetGameFrame() > 0 then + widget:PlayerChanged() + end +end -function widget:Initialize() - local _, _, spec, team = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) - if spec then - widgetHandler:RemoveWidget() - return false +function widget:Shutdown() + WG['autogroup'] = nil + if dlists then + for i,_ in ipairs(dlists) do + gl.DeleteList(dlists[i]) + end + dlists = {} end - myTeam = team + gl.DeleteFont(font) end function widget:DrawWorld() -if not IsGuiHidden() then - local existingGroups = GetGroupList() - if options.groupnumbers.value then - for inGroup, _ in pairs(existingGroups) do - units = GetGroupUnits(inGroup) - for _, unit in ipairs(units) do - if Spring.IsUnitInView(unit) then - local ux, uy, uz = Spring.GetUnitViewPosition(unit) - gl.PushMatrix() - gl.Translate(ux, uy, uz) - gl.Billboard() - gl.Color(textColor)--unused anyway when gl.Text have option 's' (and b & w) - gl.Text("" .. inGroup, 30.0, -10.0, textSize, "cns") - gl.PopMatrix() + if not IsGuiHidden() then + local existingGroups = GetGroupList() + if options.groupnumbers.value then + for inGroup, _ in pairs(existingGroups) do + local units = GetGroupUnits(inGroup) + for _, unit in ipairs(units) do + if Spring.IsUnitInView(unit) then + local ux, uy, uz = Spring.GetUnitViewPosition(unit) + gl.PushMatrix() + gl.Translate(ux, uy, uz) + gl.Billboard() + gl.CallList(dlists[inGroup]) + gl.PopMatrix() + end end end end - else end -end + end end function widget:UnitFinished(unitID, unitDefID, unitTeam) if (unitTeam == myTeam and unitID ~= nil) then if (createdFrame[unitID] == GetGameFrame()) then local gr = unit2group[unitDefID] ---printDebug(": Unit finished " .. unitID) -- if gr ~= nil then SetUnitGroup(unitID, gr) end else finiGroup[unitID] = 1 @@ -197,7 +231,6 @@ function widget:UnitFromFactory(unitID, unitDefID, unitTeam) createdFrame[unitID] = GetGameFrame() local gr = unit2group[unitDefID] if gr ~= nil then SetUnitGroup(unitID, gr) end ---printDebug(": Unit from factory " .. unitID) end end end @@ -205,13 +238,11 @@ end function widget:UnitDestroyed(unitID, unitDefID, teamID) finiGroup[unitID] = nil createdFrame[unitID] = nil ---printDebug(" : Unit destroyed ".. unitID) end function widget:UnitGiven(unitID, unitDefID, newTeamID, teamID) if (newTeamID == myTeam) then local gr = unit2group[unitDefID] ---printDebug(" : Unit given ".. unit2group[unitDefID]) if gr ~= nil then SetUnitGroup(unitID, gr) end end createdFrame[unitID] = nil @@ -221,7 +252,6 @@ end function widget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) if (teamID == myTeam) then local gr = unit2group[unitDefID] ---printDebug(" : Unit taken ".. unit2group[unitDefID]) if gr ~= nil then SetUnitGroup(unitID, gr) end end createdFrame[unitID] = nil @@ -231,10 +261,8 @@ end function widget:UnitIdle(unitID, unitDefID, unitTeam) if (unitTeam == myTeam and finiGroup[unitID]~=nil) then local gr = unit2group[unitDefID] - if gr ~= nil then SetUnitGroup(unitID, gr) ---printDebug(" : Unit idle " .. gr) - end - finiGroup[unitID] = nil + if gr ~= nil then SetUnitGroup(unitID, gr) end + finiGroup[unitID] = nil end end @@ -255,18 +283,28 @@ function widget:KeyPress(key, modifier, isRepeat) if (gr ~= nil) then if (gr == -1) then gr = nil end selUnitDefIDs = {} + local unit2groupDeleted = {} local exec = false --set to true when there is at least one unit to process - for _, unitID in ipairs(GetSelectedUnits()) do + local units = GetSelectedUnits() + for _, unitID in ipairs(units) do local udid = GetUnitDefID(unitID) if ( not UDefTab[udid]["isFactory"] and (groupableBuildings[udid] or not UDefTab[udid]["isBuilding"] )) then - selUnitDefIDs[udid] = true - unit2group[udid] = gr - --local x, y, z = Spring.GetUnitPosition(unitID) - --Spring.MarkerAddPoint( x, y, z ) - exec = true - --Echo(' : Add unit ' .. unitID .. 'to group ' .. gr) - if (gr==nil) then SetUnitGroup(unitID, -1) else - SetUnitGroup(unitID, gr) end + --if unit2group[udid] ~= nil then + -- unit2group[udid] = nil + -- unit2groupDeleted[udid] = true + -- SelectUnitArray({}) + -- for _, uID in ipairs(Spring.GetTeamUnits(myTeam)) do -- ungroup all units of this unitdef + -- if GetUnitDefID(uID) == udid then + -- SetUnitGroup(uID, -1) + -- end + -- end + --elseif unit2groupDeleted[udid] == nil then + selUnitDefIDs[udid] = true + unit2group[udid] = gr + exec = true + if (gr==nil) then SetUnitGroup(unitID, -1) else + SetUnitGroup(unitID, gr) end + --end end end if ( exec == false ) then @@ -308,12 +346,13 @@ function widget:KeyPress(key, modifier, isRepeat) local mindist = math.huge local muid = nil if (pos == nil) then return end - for _, uid in ipairs(GetSelectedUnits()) do - local x,_,z = GetUnitPosition(uid) + local units = GetSelectedUnits() + for _, unitID in ipairs(units) do + local x,_,z = GetUnitPosition(unitID) dist = (pos[1]-x)*(pos[1]-x) + (pos[3]-z)*(pos[3]-z) if (dist < mindist) then mindist = dist - muid = uid + muid = unitID end end if (muid ~= nil) then @@ -323,8 +362,9 @@ function widget:KeyPress(key, modifier, isRepeat) end --[[ if (key == KEYSYMS.Q) then - for _, uid in ipairs(GetSelectedUnits()) do - SetUnitGroup(uid,-1) + local units = GetSelectedUnits() + for _, unitID in ipairs(units) do + SetUnitGroup(unitID,-1) end end --]] @@ -332,21 +372,55 @@ function widget:KeyPress(key, modifier, isRepeat) return false end + +function tableMerge(t1, t2) + for k,v in pairs(t2) do + if type(v) == "table" then + if type(t1[k] or false) == "table" then + tableMerge(t1[k] or {}, t2[k] or {}) + else + t1[k] = v + end + else + t1[k] = v + end + end + return t1 +end + +function deepcopy(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[deepcopy(orig_key)] = deepcopy(orig_value) + end + setmetatable(copy, deepcopy(getmetatable(orig))) + else -- number, string, boolean, etc + copy = orig + end + return copy +end + + function widget:GetConfigData() local groups = {} for id, gr in pairs(unit2group) do table.insert(groups, {UnitDefs[id].name, gr}) - end - local ret = - { - version = versionNum, - groups = groups, - } + end + local ret = + { + version = versionNum, + groups = groups, + options = options, + } return ret end function widget:SetConfigData(data) - if (data and type(data) == 'table' and data.version and (data.version+0) > 2.1) then + if (data and type(data) == 'table' and data.version and (data.version+0) > 2.1 and data.options) then + options = tableMerge(deepcopy(options), deepcopy(data.options)) local groupData = data.groups if groupData and type(groupData) == 'table' then for _, nam in ipairs(groupData) do diff --git a/LuaUI/Widgets_Evo/unit_automaticFightCommand.lua b/LuaUI/Widgets_Evo/unit_automaticFightCommand.lua new file mode 100644 index 000000000..fd720d1f1 --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_automaticFightCommand.lua @@ -0,0 +1,104 @@ +function widget:GetInfo() + return { + name = "Automatic Fight Command", + desc = "Gives select units a fight command after they have been built (because Spring doesn't call unitIdle properly)", + author = "Forby", + date = "Jan 8, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local CMD_FIGHT = CMD.FIGHT +local spGetMyTeamID = Spring.GetMyTeamID +local spGetTeamUnits = Spring.GetTeamUnits +local spGetUnitDefID = Spring.GetUnitDefID +local spGetUnitPosition = Spring.GetUnitPosition +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetSpectatingState = Spring.GetSpectatingState + +local hmsx = Game.mapSizeX/2 +local hmsz = Game.mapSizeZ/2 + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local targetUnits = { + eorb = true, + eorb_up1 = true, + eorb_up2 = true, + eorb_up3 = true, + ehbotengineer = true, + ehbotengineer_turret = true, + zarm = true, + ztenticle = true, + fedengineer = true, + lozengineer = true, + fedorb = true, + lozorb = true, + fedcommander = true + fedcommander_up1 = true, + fedcommander_up2 = true, + fedcommander_up3 = true, + fedcommander_up4 = true, + lozcommander = true, + lozcommander_up1 = true, + lozcommander_up2 = true, + lozcommander_up3 = true, + lozcommander_up4 = true +} + +local function IsTargetUnit(ud) + return ud and targetUnits[ud.name] +end + + +local function SetupUnit(unitID) + local x, y, z = spGetUnitPosition(unitID) + if x and y and z then + if (x > hmsx) then -- avoid to issue commands outside map + x = x - 1 + else + x = x + 1 + end + if (z > hmsz) then + z = z - 1 + else + z = z + 1 + end + -- meta enables reclaim enemy units, alt autoresurrect ( if available ) + spGiveOrderToUnit(unitID, CMD_FIGHT, { x, y, z }, {"meta"}) + end +end + +function widget:PlayerChanged() + if spGetSpectatingState() then + widgetHandler:RemoveWidget() + end +end + +function widget:Initialize() + if spGetSpectatingState() then + widgetHandler:RemoveWidget() + end +end + + +function widget:UnitCreated(unitID, unitDefID, unitTeam) + if unitTeam ~= spGetMyTeamID() then + return + end + if IsTargetUnit(UnitDefs[unitDefID]) then + SetupUnit(unitID) + end +end + + +function widget:UnitGiven(unitID, unitDefID, unitTeam) + widget:UnitCreated(unitID, unitDefID, unitTeam) +end \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/unit_comm_nametags.lua b/LuaUI/Widgets_Evo/unit_comm_nametags.lua deleted file mode 100644 index 6cb9e7b77..000000000 --- a/LuaUI/Widgets_Evo/unit_comm_nametags.lua +++ /dev/null @@ -1,233 +0,0 @@ -local versionNumber = "1.71" - -function widget:GetInfo() - return { - name = "Commander Name Tags ", - desc = versionNumber .." Displays a name tag above each commander.", - author = "Evil4Zerggin and CarRepairer", - date = "18 April 2008", - license = "GNU GPL, v2 or later", - layer = -10, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --- config --------------------------------------------------------------------------------- - -local showStickyTags = false --comms literally wear name tags -local heightOffset = 22 -local xOffset = 0 -local yOffset = 0 -local fontSize = 6 - --------------------------------------------------------------------------------- --- speed-ups --------------------------------------------------------------------------------- - -local GetUnitTeam = Spring.GetUnitTeam -local GetTeamInfo = Spring.GetTeamInfo -local GetPlayerInfo = Spring.GetPlayerInfo -local GetTeamColor = Spring.GetTeamColor -local GetUnitViewPosition = Spring.GetUnitViewPosition -local GetVisibleUnits = Spring.GetVisibleUnits -local GetUnitDefID = Spring.GetUnitDefID -local GetAllUnits = Spring.GetAllUnits -local GetUnitHeading = Spring.GetUnitHeading - -local iconsize = 10 -local iconhsize = iconsize * 0.5 - - -local glColor = gl.Color ---local glText = gl.Text -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glTranslate = gl.Translate -local glBillboard = gl.Billboard -local glDrawFuncAtUnit = gl.DrawFuncAtUnit - -local glDepthTest = gl.DepthTest -local glAlphaTest = gl.AlphaTest -local glTexture = gl.Texture -local glTexRect = gl.TexRect -local glRotate = gl.Rotate -local GL_GREATER = GL.GREATER -local glUnitMultMatrix = gl.UnitMultMatrix -local glUnitPieceMultMatrix = gl.UnitPieceMultMatrix -local glScale = gl.Scale - - -local overheadFont = "LuaUI/Fonts/FreeSansBold_14" -local stickyFont = "LuaUI/Fonts/FreeSansBold_14" -local fhDraw = fontHandler.Draw --------------------------------------------------------------------------------- --- local variables --------------------------------------------------------------------------------- - ---key: unitID ---value: attributes = {name, color, height, currentAttributes, torsoPieceID} ---currentAttributes = {name, color, height} -local comms = {} - --------------------------------------------------------------------------------- --- helper functions --------------------------------------------------------------------------------- - ---gets the name, color, and height of the commander -local function GetCommAttributes(unitID, unitDefID) - local team = GetUnitTeam(unitID) - if team == nil then - return nil - end - local _, player = GetTeamInfo(team) - local name = GetPlayerInfo(player) or 'Robert Paulson' - local r, g, b, a = GetTeamColor(team) - local height = UnitDefs[unitDefID].height + heightOffset - local pm = spGetUnitPieceMap(unitID) - local pmt = pm["torso"] - if (pmt == nil) then - pmt = pm["chest"] - end - return {name, {r, g, b, a}, height, pmt } -end - -local function DrawCommName(unitID, attributes) - glTranslate(0, attributes[3], 0 ) - glBillboard() - - glColor(attributes[2]) - --glText(attributes[1], xOffset, yOffset, fontSize, "cn") - fontHandler.UseFont(overheadFont) - fontHandler.DrawCentered(attributes[1], xOffset,yOffset) - glColor(1,1,1,1) -end - -local function DrawNameTag(rotation) - glRotate(rotation,0,1,0) - glTranslate(8, 35, 7) - - glColor(1,1,1,1) - glTexRect(-iconhsize, 0, iconhsize, iconsize) -end - -local function DrawCommName2(unitID, attributes, rotation) - glRotate(rotation,0,1,0) - glTranslate(8, 40, 7) - - glColor(attributes[2]) - --glText(attributes[1], xOffset, yOffset, 1, "cn") - - glColor(1,1,1,1) -end - --------------------------------------------------------------------------------- --- callins --------------------------------------------------------------------------------- - -function widget:Initialize() - local allUnits = GetAllUnits() - for _, unitID in pairs(allUnits) do - local unitDefID = GetUnitDefID(unitID) - if (unitDefID and UnitDefs[unitDefID].customParams.iscommander) then - comms[unitID] = GetCommAttributes(unitID, unitDefID) - end - end -end - - -function spGetUnitPieceMap(unitID,piecename) - local pieceMap = {} - local pl = Spring.GetUnitPieceList(unitID) - if pl == nil then - return pieceMap - end - for piecenum,piecename in pairs(pl) do - pieceMap[piecename] = piecenum - end - return pieceMap -end - - -function widget:DrawWorld() -if not Spring.IsGUIHidden() then - glDepthTest(true) - glAlphaTest(GL_GREATER, 0) - - if (showStickyTags) then - glTexture('LuaUI/Images/hellomynameis.png') - for unitID, attributes in pairs(comms) do - if (attributes[4]) then - glPushMatrix() - glUnitMultMatrix(unitID) - glUnitPieceMultMatrix(unitID, attributes[4]) - glRotate(0,0,1,0) - glTranslate(8, 0, 7) - glColor(1,1,1,1) - glTexRect(-iconhsize, 0, iconhsize, iconsize) - glPopMatrix() - end - end - for unitID, attributes in pairs(comms) do - if (attributes[4]) then - glPushMatrix() - glUnitMultMatrix(unitID) - glUnitPieceMultMatrix(unitID, attributes[4]) - glRotate(0,0,1,0) - glTranslate(8, 0, 7) - glColor(attributes[2]) - - glPushMatrix() - glScale(0.03, 0.03, 0.03) - glTranslate (0,120,5) - fontHandler.UseFont(stickyFont) - fontHandler.DrawCentered(attributes[1], 0,0) - glPopMatrix() - - glPopMatrix() - end - end - - end - - for unitID, attributes in pairs(comms) do - local heading = GetUnitHeading(unitID) - if (not heading) then - return - end - local rot = (heading / 32768) * 180 - glDrawFuncAtUnit(unitID, false, DrawCommName, unitID, attributes) - if (showStickyTags) then - glDrawFuncAtUnit(unitID, false, DrawCommName2, unitID, attributes, rot) - end - end - - glAlphaTest(false) - glColor(1,1,1,1) - glTexture(false) - glDepthTest(false) -end -end - -function widget:UnitCreated( unitID, unitDefID, unitTeam) - if (unitDefID and UnitDefs[unitDefID] and UnitDefs[unitDefID].customParams.iscommander) then - comms[unitID] = GetCommAttributes(unitID, unitDefID) - end -end - -function widget:UnitDestroyed(unitID, unitDefID, unitTeam) - comms[unitID] = nil -end - -function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - widget:UnitCreated( unitID, unitDefID, unitTeam) -end - -function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - widget:UnitCreated( unitID, unitDefID, unitTeam) -end - -function widget:UnitEnteredLos(unitID, unitDefID, unitTeam) - widget:UnitCreated( unitID, unitDefID, unitTeam) -end diff --git a/LuaUI/Widgets_Evo/unit_customformations2.lua b/LuaUI/Widgets_Evo/unit_customformations2.lua deleted file mode 100644 index d25e765a5..000000000 --- a/LuaUI/Widgets_Evo/unit_customformations2.lua +++ /dev/null @@ -1,1158 +0,0 @@ - -function widget:GetInfo() - return { - name = "CustomFormations2", - desc = "Allows you to draw your own formation line.", - author = "Niobium", -- Based on 'Custom Formations' by jK and gunblob - version = "v3.3", - date = "Mar, 2010", - license = "GNU GPL, v2 or later", - layer = 10000, - enabled = true, - handler = true, - } -end - --------------------------------------------------------------------------------- --- User Configurable Constants --------------------------------------------------------------------------------- --- Minimum spacing between commands (Squared) when drawing a path for a single unit, must be >16*16 (Or orders overlap and cancel) -local minPathSpacingSq = 50 * 50 - --- Minimum line length to cause formation move instead of single-click-style order -local minFormationLength = 20 - --- How long should algorithms take. (~0.1 gives visible stutter, default: 0.05) -local maxHngTime = 0.05 -- Desired maximum time for hungarian algorithm -local maxNoXTime = 0.05 -- Strict maximum time for backup algorithm - -local defaultHungarianUnits = 20 -- Need a baseline to start from when no config data saved -local minHungarianUnits = 10 -- If we kept reducing maxUnits it can get to a point where it can never increase, so we enforce minimums on the algorithms. -local unitIncreaseThresh = 0.85 -- We only increase maxUnits if the units are great enough for time to be meaningful - --- Alpha loss per second after releasing mouse -local lineFadeRate = 2.0 - --- What commands are eligible for custom formations -local formationCmds = { - [CMD.MOVE] = true, - [CMD.FIGHT] = true, - [CMD.ATTACK] = true, - [CMD.PATROL] = true, - [CMD.UNLOAD_UNIT] = true, - [38521] = true -- Jump -} - --- What commands require alt to be held (Must also appear in formationCmds) -local requiresAlt = { - [CMD.ATTACK] = true, - [CMD.UNLOAD_UNIT] = true -} - --- Context-based default commands that can be overridden (i.e. guard when mouseover unit) --- If the mouse remains on the same target for both Press/Release then the formation is ignored and original command is issued. --- Normal logic will follow after override, i.e. must be a formationCmd to get formation, alt must be held if requiresAlt, etc. -local overrideCmds = { - [CMD.GUARD] = CMD.MOVE, -} - --- What commands are issued at a position or unit/feature ID (Only used by GetUnitPosition) -local positionCmds = { - [CMD.MOVE]=true, [CMD.ATTACK]=true, [CMD.RECLAIM]=true, [CMD.RESTORE]=true, [CMD.RESURRECT]=true, - [CMD.PATROL]=true, [CMD.CAPTURE]=true, [CMD.FIGHT]=true, [CMD.MANUALFIRE]=true, [38521]=true, -- jump - [CMD.UNLOAD_UNIT]=true, [CMD.UNLOAD_UNITS]=true,[CMD.LOAD_UNITS]=true, [CMD.GUARD]=true, [CMD.AREA_ATTACK] = true, -} - --------------------------------------------------------------------------------- --- Globals --------------------------------------------------------------------------------- -local maxHungarianUnits = defaultHungarianUnits -- Also set when loading config - -local fNodes = {} -- Formation nodes, filled as we draw -local fDists = {} -- fDists[i] = distance from node 1 to node i -local totaldxy = 0 -- Measure of distance mouse has moved, used to unjag lines drawn in minimap - -local dimmCmd = nil -- The dimming command (Used for color) -local dimmNodes = {} -- The current nodes of dimming line -local dimmAlpha = 0 -- The current alpha of dimming line - -local pathCandidate = false -- True if we should start a path on mouse move -local draggingPath = false -- True if we are dragging a path for unit(s) to follow -local lastPathPos = nil -- The last point added to the path, used for min-distance check - -local overriddenCmd = nil -- The command we ignored in favor of move -local overriddenTarget = nil -- The target (for params) we ignored - -local usingCmd = nil -- The command to execute across the line -local usingRMB = false -- If the command is the default it uses right click, otherwise it is active and uses left click -local inMinimap = false -- Is the line being drawn in the minimap -local endShift = false -- True to reset command when shift is released - -local MiniMapFullProxy = (Spring.GetConfigInt("MiniMapFullProxy", 0) == 1) - --------------------------------------------------------------------------------- --- Speedups --------------------------------------------------------------------------------- -local GL_LINE_STRIP = GL.LINE_STRIP -local glVertex = gl.Vertex -local glLineStipple = gl.LineStipple -local glLineWidth = gl.LineWidth -local glColor = gl.Color -local glBeginEnd = gl.BeginEnd -local glPushMatrix = gl.PushMatrix -local glPopMatrix = gl.PopMatrix -local glScale = gl.Scale -local glTranslate = gl.Translate -local glLoadIdentity = gl.LoadIdentity - -local spGetActiveCommand = Spring.GetActiveCommand -local spSetActiveCommand = Spring.SetActiveCommand -local spGetDefaultCommand = Spring.GetDefaultCommand -local spFindUnitCmdDesc = Spring.FindUnitCmdDesc -local spGetModKeyState = Spring.GetModKeyState -local spGetInvertQueueKey = Spring.GetInvertQueueKey -local spIsAboveMiniMap = Spring.IsAboveMiniMap -local spGetSelectedUnitCount = Spring.GetSelectedUnitsCount -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetUnitDefID = Spring.GetUnitDefID -local spGiveOrder = Spring.GiveOrder -local spGetUnitIsTransporting = Spring.GetUnitIsTransporting -local spGetCommandQueue = Spring.GetCommandQueue -local spGetUnitPosition = Spring.GetUnitPosition -local spTraceScreenRay = Spring.TraceScreenRay -local spGetGroundHeight = Spring.GetGroundHeight -local spGetFeaturePosition = Spring.GetFeaturePosition -local spGiveOrderToUnit = Spring.GiveOrderToUnit - -local mapSizeX, mapSizeZ = Game.mapSizeX, Game.mapSizeZ -local maxUnits = Game.maxUnits - -local osclock = os.clock -local tsort = table.sort -local floor = math.floor -local ceil = math.ceil -local sqrt = math.sqrt -local huge = math.huge - -local CMD_INSERT = CMD.INSERT -local CMD_MOVE = CMD.MOVE -local CMD_ATTACK = CMD.ATTACK -local CMD_UNLOADUNIT = CMD.UNLOAD_UNIT -local CMD_UNLOADUNITS = CMD.UNLOAD_UNITS -local CMD_SET_WANTED_MAX_SPEED = CMD.SET_WANTED_MAX_SPEED -local CMD_OPT_ALT = CMD.OPT_ALT -local CMD_OPT_CTRL = CMD.OPT_CTRL -local CMD_OPT_META = CMD.OPT_META -local CMD_OPT_SHIFT = CMD.OPT_SHIFT -local CMD_OPT_RIGHT = CMD.OPT_RIGHT - -local keyShift = 304 - --------------------------------------------------------------------------------- --- Helper Functions --------------------------------------------------------------------------------- -local function GetModKeys() - - local alt, ctrl, meta, shift = spGetModKeyState() - - if spGetInvertQueueKey() then -- Shift inversion - shift = not shift - end - - return alt, ctrl, meta, shift -end -local function GetUnitFinalPosition(uID) - - local ux, uy, uz = spGetUnitPosition(uID) - - local cmds = spGetCommandQueue(uID) - for i = #cmds, 1, -1 do - - local cmd = cmds[i] - if (cmd.id < 0) or positionCmds[cmd.id] then - - local params = cmd.params - if #params >= 3 then - return params[1], params[2], params[3] - else - if #params == 1 then - - local pID = params[1] - local px, py, pz - - if pID > maxUnits then - px, py, pz = spGetFeaturePosition(pID - maxUnits) - else - px, py, pz = spGetUnitPosition(pID) - end - - if px then - return px, py, pz - end - end - end - end - end - - return ux, uy, uz -end -local function SetColor(cmdID, alpha) - if cmdID == CMD_MOVE then glColor(0.5, 1.0, 0.5, alpha) -- Green - elseif cmdID == CMD_ATTACK then glColor(1.0, 0.2, 0.2, alpha) -- Red - elseif cmdID == CMD_UNLOADUNIT then glColor(1.0, 1.0, 0.0, alpha) -- Yellow - else glColor(0.5, 0.5, 1.0, alpha) -- Blue - end -end -local function CanUnitExecute(uID, cmdID) - - if cmdID == CMD_UNLOADUNIT then - local transporting = spGetUnitIsTransporting(uID) - return (transporting and #transporting > 0) - end - - return (spFindUnitCmdDesc(uID, cmdID) ~= nil) -end -local function GetExecutingUnits(cmdID) - local units = {} - local selUnits = spGetSelectedUnits() - for i = 1, #selUnits do - local uID = selUnits[i] - if CanUnitExecute(uID, cmdID) then - units[#units + 1] = uID - end - end - return units -end -local function AddFNode(pos) - - local px, pz = pos[1], pos[3] - if px < 0 or pz < 0 or px > mapSizeX or pz > mapSizeZ then - return false - end - - local n = #fNodes - if n == 0 then - fNodes[1] = pos - fDists[1] = 0 - else - local prevNode = fNodes[n] - local dx, dz = px - prevNode[1], pz - prevNode[3] - local distSq = dx*dx + dz*dz - if distSq == 0.0 then -- Don't add if duplicate - return false - end - - fNodes[n + 1] = pos - fDists[n + 1] = fDists[n] + sqrt(distSq) - end - - totaldxy = 0 - return true -end -local function GetInterpNodes(number) - - local spacing = fDists[#fNodes] / (number - 1) - - local interpNodes = {} - - local sPos = fNodes[1] - local sX = sPos[1] - local sZ = sPos[3] - local sDist = 0 - - local eIdx = 2 - local ePos = fNodes[2] - local eX = ePos[1] - local eZ = ePos[3] - local eDist = fDists[2] - - interpNodes[1] = {sX, spGetGroundHeight(sX, sZ), sZ} - - for n = 1, number - 2 do - - local reqDist = n * spacing - while (reqDist > eDist) do - - sX = eX - sZ = eZ - sDist = eDist - - eIdx = eIdx + 1 - ePos = fNodes[eIdx] - eX = ePos[1] - eZ = ePos[3] - eDist = fDists[eIdx] - end - - local nFrac = (reqDist - sDist) / (eDist - sDist) - local nX = sX * (1 - nFrac) + eX * nFrac - local nZ = sZ * (1 - nFrac) + eZ * nFrac - interpNodes[n + 1] = {nX, spGetGroundHeight(nX, nZ), nZ} - end - - ePos = fNodes[#fNodes] - eX = ePos[1] - eZ = ePos[3] - interpNodes[number] = {eX, spGetGroundHeight(eX, eZ), eZ} - - return interpNodes -end -local function GetCmdOpts(alt, ctrl, meta, shift, right) - - local opts = { alt=alt, ctrl=ctrl, meta=meta, shift=shift, right=right } - local coded = 0 - - if alt then coded = coded + CMD_OPT_ALT end - if ctrl then coded = coded + CMD_OPT_CTRL end - if meta then coded = coded + CMD_OPT_META end - if shift then coded = coded + CMD_OPT_SHIFT end - if right then coded = coded + CMD_OPT_RIGHT end - - opts.coded = coded - return opts -end -local function GiveNotifyingOrder(cmdID, cmdParams, cmdOpts) - - if widgetHandler:CommandNotify(cmdID, cmdParams, cmdOpts) then - return - end - - spGiveOrder(cmdID, cmdParams, cmdOpts.coded) -end -local function GiveNotifyingOrderToUnit(uArr, oArr, uID, cmdID, cmdParams, cmdOpts) - - for _, w in ipairs(widgetHandler.widgets) do - if w.UnitCommandNotify and w:UnitCommandNotify(uID, cmdID, cmdParams, cmdOpts) then - return - end - end - - uArr[#uArr + 1] = uID - oArr[#oArr + 1] = {cmdID, cmdParams, cmdOpts.coded} - return -end - --------------------------------------------------------------------------------- --- Mouse/keyboard Callins --------------------------------------------------------------------------------- -function widget:MousePress(mx, my, mButton) - - -- Where did we click - inMinimap = spIsAboveMiniMap(mx, my) - if inMinimap and not MiniMapFullProxy then return false end - - -- Get command that would've been issued - local _, activeCmdID = spGetActiveCommand() - if activeCmdID then - if mButton ~= 1 then return false end - - usingCmd = activeCmdID - usingRMB = false - else - if mButton ~= 3 then return false end - - local _, defaultCmdID = spGetDefaultCommand() - if not defaultCmdID then return false end - - local overrideCmdID = overrideCmds[defaultCmdID] - if overrideCmdID then - - local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) - if targType == 'unit' then - overriddenCmd = defaultCmdID - overriddenTarget = targID - elseif targType == 'feature' then - overriddenCmd = defaultCmdID - overriddenTarget = targID + maxUnits - else - -- We can't reversibly override a command if we can't get the original target, so we give up overriding it. - return false - end - - usingCmd = overrideCmdID - else - overriddenCmd = nil - overriddenTarget = nil - - usingCmd = defaultCmdID - end - - usingRMB = true - end - - -- Without this, the unloads issued will use the area of the last area unload - if usingCmd == CMD_UNLOADUNITS then - usingCmd = CMD_UNLOADUNIT - end - - -- Is this command eligible for a custom formation ? - local alt, ctrl, meta, shift = GetModKeys() - if not (formationCmds[usingCmd] and (alt or not requiresAlt[usingCmd])) then - return false - end - - -- Get clicked position - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if not pos then return false end - - -- Setup formation node array - if not AddFNode(pos) then return false end - - -- Is this line a path candidate (We don't do a path off an overriden command) - pathCandidate = (not overriddenCmd) and (spGetSelectedUnitCount()==1 or (alt and not requiresAlt[usingCmd])) - - -- We handled the mouse press - return true -end -function widget:MouseMove(mx, my, dx, dy, mButton) - - -- It is possible for MouseMove to fire after MouseRelease - if #fNodes == 0 then - return false - end - - -- Minimap-specific checks - if inMinimap then - totaldxy = totaldxy + dx*dx + dy*dy - if (totaldxy < 5) or not spIsAboveMiniMap(mx, my) then - return false - end - end - - -- Get clicked position - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if not pos then return false end - - -- Add the new formation node - if not AddFNode(pos) then return false end - - -- Have we started drawing a line? - if #fNodes == 2 then - - -- We have enough nodes to start drawing now - widgetHandler:UpdateWidgetCallIn("DrawInMiniMap", self) - widgetHandler:UpdateWidgetCallIn("DrawWorld", self) - - -- If the line is a path, start the units moving to this node - if pathCandidate then - - local alt, ctrl, meta, shift = GetModKeys() - local cmdOpts = GetCmdOpts(false, ctrl, meta, shift, usingRMB) -- using alt uses springs box formation, so we set it off always - GiveNotifyingOrder(usingCmd, pos, cmdOpts) - lastPathPos = pos - - draggingPath = true - end - else - -- Are we dragging a path? - if draggingPath then - - local dx, dz = pos[1] - lastPathPos[1], pos[3] - lastPathPos[3] - if (dx*dx + dz*dz) > minPathSpacingSq then - - local alt, ctrl, meta, shift = GetModKeys() - local cmdOpts = GetCmdOpts(false, ctrl, meta, true, usingRMB) -- using alt uses springs box formation, so we set it off always - GiveNotifyingOrder(usingCmd, pos, cmdOpts) - lastPathPos = pos - end - end - end - - return false -end -function widget:MouseRelease(mx, my, mButton) - - -- It is possible for MouseRelease to fire after MouseRelease - if #fNodes == 0 then - return false - end - - -- Modkeys / command reset - local alt, ctrl, meta, shift = GetModKeys() - if not usingRMB then - if shift then - endShift = true -- Reset on release of shift - else - spSetActiveCommand(0) -- Reset immediately - end - end - - -- Are we going to use the drawn formation? - local usingFormation = true - - -- Override checking - if overriddenCmd then - - local targetID - local targType, targID = spTraceScreenRay(mx, my, false, inMinimap) - if targType == 'unit' then - targetID = targID - elseif targType == 'feature' then - targetID = targID + maxUnits - end - - if targetID and targetID == overriddenTarget then - - -- Signal that we are no longer using the drawn formation - usingFormation = false - - -- Process the original command instead - local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) - GiveNotifyingOrder(overriddenCmd, {overriddenTarget}, cmdOpts) - end - end - - -- Using path? If so then we do nothing - if draggingPath then - - draggingPath = false - - -- Using formation? If so then it's time to calculate and issue orders. - elseif usingFormation then - - -- Add final position (Sometimes we don't get the last MouseMove before this MouseRelease) - if (not inMinimap) or spIsAboveMiniMap(mx, my) then - local _, pos = spTraceScreenRay(mx, my, true, inMinimap) - if pos then - AddFNode(pos) - end - end - - -- Get command options - local cmdOpts = GetCmdOpts(alt, ctrl, meta, shift, usingRMB) - - -- Single click ? (no line drawn) - --if (#fNodes == 1) then - if fDists[#fNodes] < minFormationLength then - -- We should check if any units are able to execute it, - -- but the order is small enough network-wise that the tiny bug potential isn't worth it. - GiveNotifyingOrder(usingCmd, fNodes[1], cmdOpts) - else - -- Order is a formation - -- Are any units able to execute it? - local mUnits = GetExecutingUnits(usingCmd) - if #mUnits > 0 then - - local interpNodes = GetInterpNodes(#mUnits) - - local orders - if (#mUnits <= maxHungarianUnits) then - orders = GetOrdersHungarian(interpNodes, mUnits, #mUnits, shift and not meta) - else - orders = GetOrdersNoX(interpNodes, mUnits, #mUnits, shift and not meta) - end - - local unitArr = {} - local orderArr = {} - if meta then - local altOpts = GetCmdOpts(true, false, false, false, false) - for i = 1, #orders do - local orderPair = orders[i] - local orderPos = orderPair[2] - GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], CMD_INSERT, {0, usingCmd, cmdOpts.coded, orderPos[1], orderPos[2], orderPos[3]}, altOpts) - if (i == #orders and #unitArr > 0) or #unitArr >= 100 then - Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) - unitArr = {} - orderArr = {} - end - end - else - for i = 1, #orders do - local orderPair = orders[i] - GiveNotifyingOrderToUnit(unitArr, orderArr, orderPair[1], usingCmd, orderPair[2], cmdOpts) - if (i == #orders and #unitArr > 0) or #unitArr >= 100 then - Spring.GiveOrderArrayToUnitArray(unitArr, orderArr, true) - unitArr = {} - orderArr = {} - end - end - end - - end - end - - -- Move Speed (Applicable to every order) - local wantedSpeed = 99999 -- High enough to exceed all units speed, but not high enough to cause errors (i.e. vs math.huge) - - if ctrl then - local selUnits = spGetSelectedUnits() - for i = 1, #selUnits do - local uSpeed = UnitDefs[spGetUnitDefID(selUnits[i])].speed - if uSpeed > 0 and uSpeed < wantedSpeed then - wantedSpeed = uSpeed - end - end - end - - -- Directly giving speed order appears to work perfectly, including with shifted orders ... - -- ... But other widgets CMD.INSERT the speed order into the front (Posn 1) of the queue instead (which doesn't work with shifted orders) - local speedOpts = GetCmdOpts(alt, ctrl, meta, shift, true) - GiveNotifyingOrder(CMD_SET_WANTED_MAX_SPEED, {wantedSpeed / 30}, speedOpts) - end - - if #fNodes > 1 then - dimmCmd = usingCmd - dimmNodes = fNodes - dimmAlpha = 1.0 - widgetHandler:UpdateWidgetCallIn("Update", self) - end - - fNodes = {} - fDists = {} - - return true -end -function widget:KeyRelease(key) - if (key == keyShift) and endShift then - spSetActiveCommand(0) - endShift = false - end -end - --------------------------------------------------------------------------------- --- Drawing --------------------------------------------------------------------------------- -local function tVerts(verts) - for i = 1, #verts do - local v = verts[i] - glVertex(v[1], v[2], v[3]) - end -end -local function tVertsMinimap(verts) - for i = 1, #verts do - local v = verts[i] - glVertex(v[1], v[3], 1) - end -end -local function DrawFormationLines(vertFunction, lineStipple) - - glLineStipple(lineStipple, 4095) - glLineWidth(2.0) - - if #fNodes > 1 then - SetColor(usingCmd, 1.0) - glBeginEnd(GL_LINE_STRIP, vertFunction, fNodes) - end - - if #dimmNodes > 1 then - SetColor(dimmCmd, dimmAlpha) - glBeginEnd(GL_LINE_STRIP, vertFunction, dimmNodes) - end - - glLineWidth(1.0) - glLineStipple(false) -end - -function widget:DrawWorld() - - DrawFormationLines(tVerts, 2) -end -function widget:DrawInMiniMap() - - glPushMatrix() - glLoadIdentity() - glTranslate(0, 1, 0) - glScale(1 / mapSizeX, -1 / mapSizeZ, 1) - - DrawFormationLines(tVertsMinimap, 1) - glPopMatrix() -end -function widget:Update(deltaTime) - - dimmAlpha = dimmAlpha - lineFadeRate * deltaTime - - if dimmAlpha <= 0 then - - dimmNodes = {} - widgetHandler:RemoveWidgetCallIn("Update", self) - - if #fNodes == 0 then - widgetHandler:RemoveWidgetCallIn("DrawWorld", self) - widgetHandler:RemoveWidgetCallIn("DrawInMiniMap", self) - end - end -end - ---------------------------------------------------------------------------------------------------------- --- Config ---------------------------------------------------------------------------------------------------------- -function widget:GetConfigData() -- Saving - return { - ['maxHungarianUnits'] = maxHungarianUnits, - } -end -function widget:SetConfigData(data) -- Loading - maxHungarianUnits = data['maxHungarianUnits'] or defaultHungarianUnits -end - ---------------------------------------------------------------------------------------------------------- --- Matching Algorithms ---------------------------------------------------------------------------------------------------------- -function GetOrdersNoX(nodes, units, unitCount, shifted) - - -- Remember when we start - -- This is for capping total time - -- Note: We at least complete initial assignment - local startTime = osclock() - - --------------------------------------------------------------------------------------------------------- - -- Find initial assignments - --------------------------------------------------------------------------------------------------------- - local unitSet = {} - local fdist = -1 - local fm - - for u = 1, unitCount do - - -- Get unit position - local ux, uz - if shifted then - ux, _, uz = GetUnitFinalPosition(units[u]) - else - ux, _, uz = spGetUnitPosition(units[u]) - end - unitSet[u] = {ux, units[u], uz, -1} -- Such that x/z are in same place as in nodes (So we can use same sort function) - - -- Work on finding furthest points (As we have ux/uz already) - for i = u - 1, 1, -1 do - - local up = unitSet[i] - local vx, vz = up[1], up[3] - local dx, dz = vx - ux, vz - uz - local dist = dx*dx + dz*dz - - if (dist > fdist) then - fdist = dist - fm = (vz - uz) / (vx - ux) - end - end - end - - -- Maybe nodes are further apart than the units - for i = 1, unitCount - 1 do - - local np = nodes[i] - local nx, nz = np[1], np[3] - - for j = i + 1, unitCount do - - local mp = nodes[j] - local mx, mz = mp[1], mp[3] - local dx, dz = mx - nx, mz - nz - local dist = dx*dx + dz*dz - - if (dist > fdist) then - fdist = dist - fm = (mz - nz) / (mx - nx) - end - end - end - - local function sortFunc(a, b) - -- y = mx + c - -- c = y - mx - -- c = y + x / m (For perp line) - return (a[3] + a[1] / fm) < (b[3] + b[1] / fm) - end - - tsort(unitSet, sortFunc) - tsort(nodes, sortFunc) - - for u = 1, unitCount do - unitSet[u][4] = nodes[u] - end - - --------------------------------------------------------------------------------------------------------- - -- Main part of algorithm - --------------------------------------------------------------------------------------------------------- - - -- M/C for each finished matching - local Ms = {} - local Cs = {} - - -- Stacks to hold finished and still-to-check units - local stFin = {} - local stFinCnt = 0 - local stChk = {} - local stChkCnt = 0 - - -- Add all units to check stack - for u = 1, unitCount do - stChk[u] = u - end - stChkCnt = unitCount - - -- Begin algorithm - while ((stChkCnt > 0) and (osclock() - startTime < maxNoXTime)) do - - -- Get unit, extract position and matching node position - local u = stChk[stChkCnt] - local ud = unitSet[u] - local ux, uz = ud[1], ud[3] - local mn = ud[4] - local nx, nz = mn[1], mn[3] - - -- Calculate M/C - local Mu = (nz - uz) / (nx - ux) - local Cu = uz - Mu * ux - - -- Check for clashes against finished matches - local clashes = false - - for i = 1, stFinCnt do - - -- Get opposing unit and matching node position - local f = stFin[i] - local fd = unitSet[f] - local tn = fd[4] - - -- Get collision point - local ix = (Cs[f] - Cu) / (Mu - Ms[f]) - local iz = Mu * ix + Cu - - -- Check bounds - if ((ux - ix) * (ix - nx) >= 0) and - ((uz - iz) * (iz - nz) >= 0) and - ((fd[1] - ix) * (ix - tn[1]) >= 0) and - ((fd[3] - iz) * (iz - tn[3]) >= 0) then - - -- Lines cross - - -- Swap matches, note this retains solution integrity - ud[4] = tn - fd[4] = mn - - -- Remove clashee from finished - stFin[i] = stFin[stFinCnt] - stFinCnt = stFinCnt - 1 - - -- Add clashee to top of check stack - stChkCnt = stChkCnt + 1 - stChk[stChkCnt] = f - - -- No need to check further - clashes = true - break - end - end - - if not clashes then - - -- Add checked unit to finished - stFinCnt = stFinCnt + 1 - stFin[stFinCnt] = u - - -- Remove from to-check stack (Easily done, we know it was one on top) - stChkCnt = stChkCnt - 1 - - -- We can set the M/C now - Ms[u] = Mu - Cs[u] = Cu - end - end - - --------------------------------------------------------------------------------------------------------- - -- Return orders - --------------------------------------------------------------------------------------------------------- - local orders = {} - for i = 1, unitCount do - local unit = unitSet[i] - orders[i] = {unit[2], unit[4]} - end - return orders -end -function GetOrdersHungarian(nodes, units, unitCount, shifted) - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - -- (the following code is written by gunblob) - -- this code finds the optimal solution (slow, but effective!) - -- it uses the hungarian algorithm from http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html - -- if this violates gpl license please let gunblob and me know - ------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------- - local t = osclock() - - -------------------------------------------------------------------------------------------- - -------------------------------------------------------------------------------------------- - -- cache node<->unit distances - - local distances = {} - --for i = 1, unitCount do distances[i] = {} end - - for i = 1, unitCount do - - local uID = units[i] - local ux, uz - - if shifted then - ux, _, uz = GetUnitFinalPosition(uID) - else - ux, _, uz = spGetUnitPosition(uID) - end - - distances[i] = {} - local dists = distances[i] - for j = 1, unitCount do - - local nodePos = nodes[j] - local dx, dz = nodePos[1] - ux, nodePos[3] - uz - dists[j] = floor(sqrt(dx*dx + dz*dz) + 0.5) - -- Integer distances = greatly improved algorithm speed - end - end - - -------------------------------------------------------------------------------------------- - -------------------------------------------------------------------------------------------- - -- find optimal solution and send orders - local result = findHungarian(distances, unitCount) - - -------------------------------------------------------------------------------------------- - -------------------------------------------------------------------------------------------- - -- determine needed time and optimize the maxUnits limit - - local delay = osclock() - t - - if (delay > maxHngTime) and (maxHungarianUnits > minHungarianUnits) then - - -- Delay is greater than desired, we have to reduce units - maxHungarianUnits = maxHungarianUnits - 1 - else - -- Delay is less than desired, so thats OK - -- To make judgements we need number of units to be close to max - -- Because we are making predictions of time and we want them to be accurate - if (#units > maxHungarianUnits*unitIncreaseThresh) then - - -- This implementation of Hungarian algorithm is O(n3) - -- Because we have less than maxUnits, but are altering maxUnits... - -- We alter the time, to 'predict' time we would be getting at maxUnits - -- We then recheck that against maxHngTime - - local nMult = maxHungarianUnits / #units - - if ((delay*nMult*nMult*nMult) < maxHngTime) then - maxHungarianUnits = maxHungarianUnits + 1 - else - if (maxHungarianUnits > minHungarianUnits) then - maxHungarianUnits = maxHungarianUnits - 1 - end - end - end - end - - -- Return orders - local orders = {} - for i = 1, unitCount do - local rPair = result[i] - orders[i] = {units[rPair[1]], nodes[rPair[2]]} - end - - return orders -end - -function findHungarian(array, n) - - -- Vars - local colcover = {} - local rowcover = {} - local starscol = {} - local primescol = {} - - -- Initialization - for i = 1, n do - rowcover[i] = false - colcover[i] = false - starscol[i] = false - primescol[i] = false - end - - -- Subtract minimum from rows - for i = 1, n do - - local aRow = array[i] - local minVal = aRow[1] - for j = 2, n do - if aRow[j] < minVal then - minVal = aRow[j] - end - end - - for j = 1, n do - aRow[j] = aRow[j] - minVal - end - end - - -- Subtract minimum from columns - for j = 1, n do - - local minVal = array[1][j] - for i = 2, n do - if array[i][j] < minVal then - minVal = array[i][j] - end - end - - for i = 1, n do - array[i][j] = array[i][j] - minVal - end - end - - -- Star zeroes - for i = 1, n do - local aRow = array[i] - for j = 1, n do - if (aRow[j] == 0) and not colcover[j] then - colcover[j] = true - starscol[i] = j - break - end - end - end - - -- Start solving system - while true do - - -- Are we done ? - local done = true - for i = 1, n do - if not colcover[i] then - done = false - break - end - end - - if done then - local pairings = {} - for i = 1, n do - pairings[i] = {i, starscol[i]} - end - return pairings - end - - -- Not done - local r, c = stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) - stepFiveStar(colcover, rowcover, r, c, n, starscol, primescol) - end -end -function doPrime(array, colcover, rowcover, n, starscol, r, c, rmax, primescol) - - primescol[r] = c - - local starCol = starscol[r] - if starCol then - - rowcover[r] = true - colcover[starCol] = false - - for i = 1, rmax do - if not rowcover[i] and (array[i][starCol] == 0) then - local rr, cc = doPrime(array, colcover, rowcover, n, starscol, i, starCol, rmax, primescol) - if rr then - return rr, cc - end - end - end - - return - else - return r, c - end -end -function stepPrimeZeroes(array, colcover, rowcover, n, starscol, primescol) - - -- Infinite loop - while true do - - -- Find uncovered zeros and prime them - for i = 1, n do - if not rowcover[i] then - local aRow = array[i] - for j = 1, n do - if (aRow[j] == 0) and not colcover[j] then - local i, j = doPrime(array, colcover, rowcover, n, starscol, i, j, i-1, primescol) - if i then - return i, j - end - break -- this row is covered - end - end - end - end - - -- Find minimum uncovered - local minVal = huge - for i = 1, n do - if not rowcover[i] then - local aRow = array[i] - for j = 1, n do - if (aRow[j] < minVal) and not colcover[j] then - minVal = aRow[j] - end - end - end - end - - -- There is the potential for minVal to be 0, very very rarely though. (Checking for it costs more than the +/- 0's) - - -- Covered rows = + - -- Uncovered cols = - - for i = 1, n do - local aRow = array[i] - if rowcover[i] then - for j = 1, n do - if colcover[j] then - aRow[j] = aRow[j] + minVal - end - end - else - for j = 1, n do - if not colcover[j] then - aRow[j] = aRow[j] - minVal - end - end - end - end - end -end -function stepFiveStar(colcover, rowcover, row, col, n, starscol, primescol) - - -- Star the initial prime - primescol[row] = false - starscol[row] = col - local ignoreRow = row -- Ignore the star on this row when looking for next - - repeat - local noFind = true - - for i = 1, n do - - if (starscol[i] == col) and (i ~= ignoreRow) then - - noFind = false - - -- Unstar the star - -- Turn the prime on the same row into a star (And ignore this row (aka star) when searching for next star) - - local pcol = primescol[i] - primescol[i] = false - starscol[i] = pcol - ignoreRow = i - col = pcol - - break - end - end - until noFind - - for i = 1, n do - rowcover[i] = false - colcover[i] = false - primescol[i] = false - end - - for i = 1, n do - local scol = starscol[i] - if scol then - colcover[scol] = true - end - end -end diff --git a/LuaUI/Widgets_Evo/unit_customrings.lua b/LuaUI/Widgets_Evo/unit_customrings.lua index bbc1ba387..8b8c5f50d 100644 --- a/LuaUI/Widgets_Evo/unit_customrings.lua +++ b/LuaUI/Widgets_Evo/unit_customrings.lua @@ -26,28 +26,86 @@ end local ringsDefs = { [UnitDefNames.ecommander.id] = { - { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, - { color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + -- { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, + --{ color = {0,1,0,0.6}, lineWidth = 5, radius = 300, divs = 64 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommandercloak.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommandershield.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommanderbuild.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1500 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommanderbattle.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 500 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommanderfactory.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 250 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ecommanderhealer.id] = { + -- { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, + { color = {0,1,0,0.6}, lineWidth = 5, radius = 1000, divs = 128 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, }, [UnitDefNames.eorb.id] = { - { color = {1,0.5,0,0.8}, lineWidth = 2, radius = 800 }, + --{ color = {1,0.5,0,0.8}, lineWidth = 2, radius = 800 }, + --{ color = {0.5,0,1,0.2}, lineWidth = 5, radius = 500 }, + { color = {0,1,0,0.6}, lineWidth = 10, radius = 1000 }, + }, + [UnitDefNames.eorb_up1.id] = { + --{ color = {1,0.5,0,0.8}, lineWidth = 2, radius = 800 }, + --{ color = {0.5,0,1,0.2}, lineWidth = 5, radius = 500 }, + { color = {0,1,0,0.6}, lineWidth = 10, radius = 1000 }, + }, + [UnitDefNames.eorb_up2.id] = { + --{ color = {1,0.5,0,0.8}, lineWidth = 2, radius = 800 }, + --{ color = {0.5,0,1,0.2}, lineWidth = 5, radius = 500 }, + { color = {0,1,0,0.6}, lineWidth = 10, radius = 1050 }, + }, + [UnitDefNames.eorb_up3.id] = { + --{ color = {1,0.5,0,0.8}, lineWidth = 2, radius = 800 }, + --{ color = {0.5,0,1,0.2}, lineWidth = 5, radius = 500 }, + { color = {0,1,0,0.6}, lineWidth = 10, radius = 1000 }, + }, + [UnitDefNames.ebox.id] = { { color = {0.5,0,1,0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ehbotengineer.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 800 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + }, + [UnitDefNames.ehbotengineer_turret.id] = { + --{ color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 1000 }, + --{ color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + { color = {0,1,0,0.6}, lineWidth = 10, radius = 995 }, + }, + [UnitDefNames.zarm.id] = { { color = {0,1,0,0.6}, lineWidth = 10, radius = 1000 }, }, - [UnitDefNames.eengineer5.id] = { - { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 800 }, - { color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + + -- Shield Units + [UnitDefNames.ekmar.id] = { + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 750 }, }, - [UnitDefNames.eamphibengineer.id] = { - { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 800 }, - { color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + [UnitDefNames.eallterrshield.id] = { + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 300 }, }, - [UnitDefNames.eallterrengineer.id] = { - { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 800 }, - { color = {0.5, 0, 1, 0.2}, lineWidth = 5, radius = 500 }, + [UnitDefNames.eallterrshield_up1.id] = { + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 300 }, }, - [UnitDefNames.eairengineer.id] = { - { color = {1, 0.5, 0, 0.8}, lineWidth = 2, radius = 800 }, + [UnitDefNames.eallterrshield_up2.id] = { + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 300 }, + }, + [UnitDefNames.eallterrshield_up3.id] = { + { color = {0, 0, 1, 0.5}, lineWidth = 5, radius = 300 }, }, } @@ -73,7 +131,15 @@ function widget:UnitCreated(uId, uDefId) end end -function widget:DrawWorld() +function widget:RecvLuaMsg(msg, playerID) + if msg:sub(1,18) == 'LobbyOverlayActive' then + chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1') + end +end + +function widget:DrawWorldPreUnit() + if chobbyInterface then return end + if Spring.IsGUIHidden() then return end for uId, rings in pairs(ringedUnits) do if (Spring.IsUnitAllied(uId)and Spring.IsUnitSelected(uId)) then local ux, uy, uz = Spring.GetUnitPosition(uId) diff --git a/LuaUI/Widgets_Evo/unit_ghostRadar.lua b/LuaUI/Widgets_Evo/unit_ghostRadar.lua index 21835ac1c..ea656ac93 100644 --- a/LuaUI/Widgets_Evo/unit_ghostRadar.lua +++ b/LuaUI/Widgets_Evo/unit_ghostRadar.lua @@ -1,11 +1,10 @@ -include("colors.h.lua") include("keysym.h.lua") -local versionNumber = "1.11" +local versionNumber = "1.21" function widget:GetInfo() return { - name = "Ghost Radar v" .. string.format("%s", versionNumber ), - desc = "allows ghosted radar dots", + name = "Ghost Radar", + desc = "Allows ghosted radar blips [v" .. string.format("%s", versionNumber ) .. "]", author = "very_bad_soldier", date = "July 21, 2008", license = "GNU GPL v2", @@ -14,25 +13,29 @@ function widget:GetInfo() } end +local lineWidth = 1.0 -- calcs dynamic now + local printDebug -local DrawGhosts -local udefTab = UnitDefs +local udefTab = UnitDefs local spGetUnitDefID = Spring.GetUnitDefID local spEcho = Spring.Echo local spGetUnitPosition = Spring.GetUnitPosition local spGetGameSeconds = Spring.GetGameSeconds local floor = math.floor +local pairs = pairs local spGetMyPlayerID = Spring.GetMyPlayerID local spGetPlayerInfo = Spring.GetPlayerInfo +local spIsUnitInView = Spring.IsUnitInView local glColor = gl.Color local glDepthTest = gl.DepthTest ---local glBlending = gl.Blending -local glUnitShape = gl.UnitShape +local glUnitShape = gl.UnitShape local glPopMatrix = gl.PopMatrix local glPushMatrix = gl.PushMatrix local glTranslate = gl.Translate +local glLoadIdentity = gl.LoadIdentity + ---------------------------------------------------------------- local debug = false @@ -47,22 +50,33 @@ function widget:UnitEnteredRadar(unitID, allyTeam) end function widget:UnitEnteredLos(unitID, allyTeam ) - if ( dots[unitID] == nil ) then - --we dont have information about this unit yet - local udefID = spGetUnitDefID(unitID) - local udef = udefTab[udefID] + --update unitID info, ID could have been reused already! + local udefID = spGetUnitDefID(unitID) + local udef = udefTab[udefID] - --skip buildings, they get ghosted anyway - if ( udef.isBuilding == false and udef.isFactory == false ) then - dots[unitID] = {} - dots[unitID]["unitDefId"] = udefID - dots[unitID]["teamId"] = allyTeam - dots[unitID]["radar"] = true - end + --skip buildings, they get ghosted anyway + if ( udef.isBuilding == false and udef.isFactory == false ) then + dots[unitID] = {} + dots[unitID]["unitDefId"] = udefID + dots[unitID]["teamId"] = allyTeam + dots[unitID]["radar"] = true + dots[unitID]["los"] = true + else + dots[unitID] = nil end - +end + + +function widget:UnitCreated(unitID, allyTeam) + --kill the dot info if this unitID gets reused on own team if ( dots[unitID] ~= nil ) then - dots[unitID]["los"] = true + dots[unitID] = nil + end +end + +function widget:UnitDestroyed(unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID) + if ( dots[unitID] ~= nil ) then + dots[unitID] = nil end end @@ -80,33 +94,23 @@ end function widget:DrawWorld() - DrawGhosts() -end - - -function DrawGhosts() - glColor(1.0, 1.0, 1.0, 0.35 ) - glDepthTest(true) + glColor(1.0, 1.0, 1.0, 0.35 ) + glDepthTest(true) for unitID, dot in pairs( dots ) do - if ( dot["radar"] == true ) and ( dot["los"] == false ) and ( dot["unitDefId"] ~= nil ) then - - local x, y, z = spGetUnitPosition(unitID) - -- printDebug("DRAW udef: " .. dot["unitDefId"] .. " x: " .. x .. " y: " .. y .. " z:" .. z ) - if ( x ~= nil ) then --i hope checking x instead of xyz is ok - glPushMatrix() - glTranslate( x, y + 5 , z) - - glUnitShape( dot["unitDefId"], dot["teamId"] ) - - glPopMatrix() - end + if ( dot["radar"] == true ) and ( dot["los"] == false ) and ( dot["unitDefId"] ~= nil ) then + local x, y, z = spGetUnitPosition(unitID) + if x and ( spIsUnitInView(unitID) ) then + glPushMatrix() + glLoadIdentity() + glTranslate( x, y + 5 , z) + glUnitShape( dot["unitDefId"], dot["teamId"], false, false, false) + glPopMatrix() end + end end glDepthTest(false) - -- glBlending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA); - -- glBlending(false) glColor(1, 1, 1, 1) end @@ -117,13 +121,8 @@ function widget:Update() -- update timers once every seconds if (time % updateInt == 0 and time ~= lastTime) then lastTime = time - --do update stuff: - local playerID = spGetMyPlayerID() - local _, _, spec, _, _, _, _, _ = spGetPlayerInfo(playerID) - - if ( spec == true ) then - spEcho(" Spectator mode. Widget removed.") - widgetHandler:RemoveWidget() + if select(3,spGetPlayerInfo(spGetMyPlayerID(),false)) then + widgetHandler:RemoveWidget(self) return false end end @@ -143,4 +142,4 @@ function printDebug( value ) spEcho( value ) end end -end \ No newline at end of file +end diff --git a/LuaUI/Widgets_Evo/unit_healthbars.lua b/LuaUI/Widgets_Evo/unit_healthbars.lua deleted file mode 100644 index f894c39cc..000000000 --- a/LuaUI/Widgets_Evo/unit_healthbars.lua +++ /dev/null @@ -1,1230 +0,0 @@ --- $Id: unit_healthbars.lua 4481 2009-04-25 18:38:05Z carrepairer $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- author: jK --- --- Copyright (C) 2007,2008,2009. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "HealthBars", - desc = "Gives various informations about units in form of bars.", - author = "jK", - date = "2009", --2013 May 12 - license = "GNU GPL, v2 or later", - layer = -10, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ---//for backward compatibility with old weapon indexes -local reverseCompat = (Game.version:find('91.')) and 1 or 0 - -local barHeight = 3 -local barWidth = 14 --// (barWidth)x2 total width!!! -local barAlpha = 0.9 - -local featureBarHeight = 3 -local featureBarWidth = 10 -local featureBarAlpha = 0.6 - -local drawBarTitles = true -local drawBarPercentages = true -local titlesAlpha = 0.3*barAlpha - -local drawFullHealthBars = false - -local drawFeatureHealth = false -local featureTitlesAlpha = featureBarAlpha * titlesAlpha/barAlpha -local featureHpThreshold = 0.85 - -local infoDistance = 700000 - -local drawStunnedOverlay = true -local drawUnitsOnFire = Spring.GetGameRulesParam("unitsOnFire") -local drawJumpJet = Spring.GetGameRulesParam("jumpJets") - ---// this table is used to shows the hp of perimeter defence, and filter it for default wreckages -local walls = {dragonsteeth=true,dragonsteeth_core=true,fortification=true,fortification_core=true,spike=true,floatingteeth=true,floatingteeth_core=true,spike=true} - -local stockpileH = 24 -local stockpileW = 12 - -local captureReloadTime = 240 -local DISARM_DECAY_FRAMES = 1200 - --------------------------------------------------------------------------------- --- OPTIONS --------------------------------------------------------------------------------- -local function OptionsChanged() - drawFeatureHealth = options.drawFeatureHealth.value - drawBarPercentages = options.drawBarPercentages.value - debugMode = options.debugMode.value -end - -options_path = 'Settings/Interface/Healthbars' -options_order = { 'showhealthbars', 'drawFeatureHealth', 'drawBarPercentages', 'debugMode', 'minReloadTime'} -options = { - - showhealthbars = { - name = 'Show Healthbars', - type = 'bool', - value = true, - --OnChange = function() Spring.SendCommands{'showhealthbars'} end, - }, - drawFeatureHealth = { - name = 'Draw health of features (corpses)', - type = 'bool', - value = false, - desc = 'Shows healthbars on corpses', - OnChange = OptionsChanged, - }, - - drawBarPercentages = { - name = 'Draw percentages', - type = 'bool', - value = true, - desc = 'Shows percentages next to bars', - OnChange = OptionsChanged, - }, - - minReloadTime = { - name = 'Min reload time', - type = 'number', - value = 3, - min = 1, - max = 10, - step = 1, - desc = 'Min reload time (sec)', - OnChange = OptionsChanged, - }, - - debugMode = { - name = 'Debug Mode', - type = 'bool', - value = false, - advanced = true, - desc = 'Pings units with debug information', - OnChange = OptionsChanged, - }, - - -} - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function lowerkeys(t) - local tn = {} - for i,v in pairs(t) do - local typ = type(i) - if type(v)=="table" then - v = lowerkeys(v) - end - if typ=="string" then - tn[i:lower()] = v - else - tn[i] = v - end - end - return tn -end - -local paralyzeOnMaxHealth = ((lowerkeys(VFS.Include"gamedata/modrules.lua") or {}).paralyze or {}).paralyzeonmaxhealth - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// colors -local bkBottom = { 0.40,0.40,0.40,barAlpha } -local bkTop = { 0.10,0.10,0.10,barAlpha } -local hpcolormap = { {0.8, 0.0, 0.0, barAlpha}, {0.8, 0.6, 0.0, barAlpha}, {0.0,0.70,0.0,barAlpha} } -local bfcolormap = {} - -local fbkBottom = { 0.40,0.40,0.40,featureBarAlpha } -local fbkTop = { 0.06,0.06,0.06,featureBarAlpha } -local fhpcolormap = { {0.8, 0.0, 0.0, featureBarAlpha}, {0.8, 0.6, 0.0, featureBarAlpha}, {0.0,0.70,0.0,featureBarAlpha} } - -local barColors = { - emp = { 0.50,0.50,1.00,barAlpha }, - emp_p = { 0.40,0.40,0.80,barAlpha }, - emp_b = { 0.60,0.60,0.90,barAlpha }, - disarm = { 0.50,0.50,0.50,barAlpha }, - disarm_p= { 0.40,0.40,0.40,barAlpha }, - disarm_b= { 0.60,0.60,0.60,barAlpha }, - capture = { 1.00,0.50,0.00,barAlpha }, - capture_reload = { 0.00,0.60,0.60,barAlpha }, - build = { 0.75,0.75,0.75,barAlpha }, - stock = { 0.50,0.50,0.50,barAlpha }, - reload = { 0.00,0.60,0.60,barAlpha }, - reload2 = { 0.80,0.60,0.00,barAlpha }, - jump = { 0.00,0.90,0.00,barAlpha }, - sheath = { 0.00,0.20,1.00,barAlpha }, - fuel = { 0.70,0.30,0.00,barAlpha }, - slow = { 0.50,0.10,0.70,barAlpha }, - goo = { 0.40,0.40,0.40,barAlpha }, - shield = { 0.30,0.0,0.90,barAlpha }, - tank = { 0.10,0.20,0.90,barAlpha }, - tele = { 0.00,0.60,0.60,barAlpha }, - - resurrect = { 1.00,0.50,0.00,featureBarAlpha }, - reclaim = { 0.75,0.75,0.75,featureBarAlpha }, -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local blink = false; -local gameFrame = 0; - -local empDecline = 32/30/40; - -local cx, cy, cz = 0,0,0; --// camera pos - -local paraUnits = {}; -local disarmUnits = {}; -local onFireUnits = {}; -local UnitMorphs = {}; - -local barShader; -local barDList; -local barFeatureDList; - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// speedup (there are a lot more localizations, but they are in limited scope cos we are running out of upvalues) -local glColor = gl.Color -local glMyText = gl.FogCoord -local floor = math.floor - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -do - local deactivated = false - function showhealthbars(cmd, line, words) - if ((words[1])and(words[1]~="0"))or(deactivated) then - widgetHandler:UpdateCallIn('DrawWorld') - deactivated = false - else - widgetHandler:RemoveCallIn('DrawWorld') - deactivated = true - end - end - options.showhealthbars.OnChange = function(self) showhealthbars(_,_,{self.value and '1' or '0'}) end -end --//end do - -function widget:Initialize() - - --// catch f9 - Spring.SendCommands({"showhealthbars 0"}) - Spring.SendCommands({"showrezbars 0"}) - widgetHandler:AddAction("showhealthbars", showhealthbars) - Spring.SendCommands({"unbind f9 showhealthbars"}) - Spring.SendCommands({"bind f9 luaui showhealthbars"}) - - --// find real primary weapon and its reloadtime - for _,ud in pairs(UnitDefs) do - ud.reloadTime = 0; - ud.primaryWeapon = 1; - ud.shieldPower = 0; - - for i=1,#ud.weapons do - local WeaponDefID = ud.weapons[i].weaponDef; - local WeaponDef = WeaponDefs[ WeaponDefID ]; - if (WeaponDef.reload>ud.reloadTime) then - ud.reloadTime = WeaponDef.reload; - ud.primaryWeapon = i; - end - end - local shieldDefID = ud.shieldWeaponDef - ud.shieldPower = ((shieldDefID)and(WeaponDefs[shieldDefID].shieldPower))or(-1) - end - - --// link morph callins - widgetHandler:RegisterGlobal('MorphUpdate', MorphUpdate) - widgetHandler:RegisterGlobal('MorphFinished', MorphFinished) - widgetHandler:RegisterGlobal('MorphStart', MorphStart) - widgetHandler:RegisterGlobal('MorphStop', MorphStop) - - --// deactivate cheesy progress text - widgetHandler:RegisterGlobal('MorphDrawProgress', function() return true end) - - --// wow, using a buffered list can give 1-2 frames in extreme(!) situations :p - for hp=0,100 do - bfcolormap[hp] = {GetColor(hpcolormap,hp*0.01)} - end - - --// create bar shader - if (gl.CreateShader) then - barShader = gl.CreateShader({ - vertex = [[ - #define barColor gl_MultiTexCoord1 - #define progress gl_MultiTexCoord2.x - #define offset gl_MultiTexCoord2.y - - void main() - { - // switch between font rendering and bar rendering - if (gl_FogCoord>0.5f) { - gl_TexCoord[0]= gl_TextureMatrix[0]*gl_MultiTexCoord0; - gl_FrontColor = gl_Color; - gl_Position = ftransform(); - return; - } - - if (gl_Vertex.w>0) { - gl_FrontColor = gl_Color; - if (gl_Vertex.z>0.0) { - gl_Vertex.x -= (1.0-progress)*gl_Vertex.z; - gl_Vertex.z = 0.0; - } - }else{ - if (gl_Vertex.y>0.0) { - gl_FrontColor = vec4(barColor.rgb*1.5,barColor.a); - }else{ - gl_FrontColor = barColor; - } - if (gl_Vertex.z>1.0) { - gl_Vertex.x += progress*gl_Vertex.z; - gl_Vertex.z = 0.0; - } - gl_Vertex.w = 1.0; - } - - gl_Vertex.y += offset; - gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; - } - ]], - }); - - if (barShader) then - barDList = gl.CreateList(function() - gl.BeginEnd(GL.QUADS,function() - gl.Vertex(-barWidth,0, 0,0); - gl.Vertex(-barWidth,0, barWidth*2,0); - gl.Vertex(-barWidth,barHeight,barWidth*2,0); - gl.Vertex(-barWidth,barHeight,0,0); - - gl.Color(bkBottom); - gl.Vertex(barWidth,0, 0, 1); - gl.Vertex(barWidth,0, barWidth*2,1); - gl.Color(bkTop); - gl.Vertex(barWidth,barHeight,barWidth*2,1); - gl.Vertex(barWidth,barHeight,0, 1); - end) - end) - - barFeatureDList = gl.CreateList(function() - gl.BeginEnd(GL.QUADS,function() - gl.Vertex(-featureBarWidth,0, 0,0); - gl.Vertex(-featureBarWidth,0, featureBarWidth*2,0); - gl.Vertex(-featureBarWidth,featureBarHeight,featureBarWidth*2,0); - gl.Vertex(-featureBarWidth,featureBarHeight,0,0); - - gl.Color(fbkBottom); - gl.Vertex(featureBarWidth,0, 0, 1); - gl.Vertex(featureBarWidth,0, featureBarWidth*2,1); - gl.Color(fbkTop); - gl.Vertex(featureBarWidth,featureBarHeight,featureBarWidth*2,1); - gl.Vertex(featureBarWidth,featureBarHeight,0, 1); - end) - end) - end - end - -end - -function widget:Shutdown() - --// catch f9 - widgetHandler:RemoveAction("showhealthbars", showhealthbars) - Spring.SendCommands({"unbind f9 luaui"}) - Spring.SendCommands({"bind f9 showhealthbars"}) - Spring.SendCommands({"showhealthbars 1"}) - Spring.SendCommands({"showrezbars 1"}) - - widgetHandler:DeregisterGlobal('MorphUpdate', MorphUpdate) - widgetHandler:DeregisterGlobal('MorphFinished', MorphFinished) - widgetHandler:DeregisterGlobal('MorphStart', MorphStart) - widgetHandler:DeregisterGlobal('MorphStop', MorphStop) - - widgetHandler:DeregisterGlobal('MorphDrawProgress') - - if (barShader) then - gl.DeleteShader(barShader) - end - if (barDList) then - gl.DeleteList(barDList) - gl.DeleteList(barFeatureDList) - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function GetColor(colormap,slider) - local coln = #colormap - if (slider>=1) then - local col = colormap[coln] - return col[1],col[2],col[3],col[4] - end - if (slider<0) then slider=0 elseif(slider>1) then slider=1 end - local posn = 1+(coln-1) * slider - local iposn = floor(posn) - local aa = posn - iposn - local ia = 1-aa - - local col1,col2 = colormap[iposn],colormap[iposn+1] - - return col1[1]*ia + col2[1]*aa, col1[2]*ia + col2[2]*aa, - col1[3]*ia + col2[3]*aa, col1[4]*ia + col2[4]*aa -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local DrawUnitBar -local DrawFeatureBar -local DrawStockpile - -do - --//speedup - local GL_QUADS = GL.QUADS - local glVertex = gl.Vertex - local glBeginEnd = gl.BeginEnd - local glMultiTexCoord = gl.MultiTexCoord - local glTexRect = gl.TexRect - local glTexture = gl.Texture - local glCallList = gl.CallList - local glText = gl.Text - - local function DrawGradient(left,top,right,bottom,topclr,bottomclr) - glColor(bottomclr) - glVertex(left,bottom) - glVertex(right,bottom) - glColor(topclr) - glVertex(right,top) - glVertex(left,top) - end - - local brightClr = {} - function DrawUnitBar(offsetY,percent,color) - if (barShader) then - glMultiTexCoord(1,color) - glMultiTexCoord(2,percent,offsetY) - glCallList(barDList) - return; - end - - brightClr[1] = color[1]*1.5; brightClr[2] = color[2]*1.5; brightClr[3] = color[3]*1.5; brightClr[4] = color[4] - local progress_pos= -barWidth+barWidth*2*percent-1 - local bar_Height = barHeight+offsetY - if percent<1 then glBeginEnd(GL_QUADS,DrawGradient,progress_pos, bar_Height, barWidth, offsetY, bkTop,bkBottom) end - glBeginEnd(GL_QUADS,DrawGradient,-barWidth, bar_Height, progress_pos, offsetY,brightClr,color) - end - - function DrawFeatureBar(offsetY,percent,color) - if (barShader) then - glMultiTexCoord(1,color) - glMultiTexCoord(2,percent,offsetY) - glCallList(barFeatureDList) - return; - end - - brightClr[1] = color[1]*1.5; brightClr[2] = color[2]*1.5; brightClr[3] = color[3]*1.5; brightClr[4] = color[4] - local progress_pos = -featureBarWidth+featureBarWidth*2*percent - glBeginEnd(GL_QUADS,DrawGradient,progress_pos, featureBarHeight+offsetY, featureBarWidth, offsetY, fbkTop,fbkBottom) - glBeginEnd(GL_QUADS,DrawGradient,-featureBarWidth, featureBarHeight+offsetY, progress_pos, offsetY, brightClr,color) - end - - function DrawStockpile(numStockpiled,numStockpileQued, freeStockpile) - --// DRAW STOCKPILED MISSLES - glColor(1,1,1,1) - glTexture("LuaUI/Images/nuke.png") - local xoffset = barWidth+16 - for i=1,((numStockpiled>3) and 3) or numStockpiled do - glTexRect(xoffset,-(11*barHeight-2)-stockpileH,xoffset-stockpileW,-(11*barHeight-2)) - xoffset = xoffset-8 - end - glTexture(false) - if freeStockpile then - glText(numStockpiled,barWidth+1.7,-(11*barHeight-2)-16,7.5,"cno") - else - glText(numStockpiled..'/'..numStockpileQued,barWidth+1.7,-(11*barHeight-2)-16,7.5,"cno") - end - end - -end --//end do - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local AddBar -local DrawBars -local barsN = 0 - -do - --//speedup - local glColor = gl.Color - local glText = gl.Text - - local maxBars = 20 - local bars = {} - local barHeightL = barHeight + 2 - local barStart = -(barWidth + 1) - local fBarHeightL = featureBarHeight + 2 - local fBarStart = -(featureBarWidth + 1) - - for i=1,maxBars do bars[i] = {} end - - function AddBar(title,progress,color_index,text,color) - barsN = barsN + 1 - local barInfo = bars[barsN] - barInfo.title = title - barInfo.progress = progress - barInfo.color = color or barColors[color_index] - barInfo.text = text - end - - function DrawBars(fullText) - local yoffset = 0 - for i=1,barsN do - local barInfo = bars[i] - DrawUnitBar(yoffset,barInfo.progress,barInfo.color) - if (fullText) then - if (barShader) then glMyText(1) end - if (drawBarPercentages) then - glColor(1,1,1,barAlpha) - glText(barInfo.text,barStart,yoffset,4,"r") - end - if (drawBarTitles) then - glColor(1,1,1,titlesAlpha) - glText(barInfo.title,0,yoffset,2.5,"cd") - end - if (barShader) then glMyText(0) end - end - yoffset = yoffset - barHeightL - end - - barsN = 0 --//reset! - end - - function DrawBarsFeature(fullText) - local yoffset = 0 - for i=1,barsN do - local barInfo = bars[i] - DrawFeatureBar(yoffset,barInfo.progress,barInfo.color) - if (fullText) then - if (barShader) then glMyText(1) end - if (drawBarPercentages) then - glColor(1,1,1,featureBarAlpha) - glText(barInfo.text,fBarStart,yoffset,4,"r") - end - if (drawBarTitles) then - glColor(1,1,1,featureTitlesAlpha) - glText(barInfo.title,0,yoffset,2.5,"cd") - end - if (barShader) then glMyText(0) end - end - yoffset = yoffset - fBarHeightL - end - - barsN = 0 --//reset! - end - -end --//end do - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local DrawUnitInfos -local JustGetOverlayInfos - -do - --//speedup - local glTranslate = gl.Translate - local glPushMatrix = gl.PushMatrix - local glPopMatrix = gl.PopMatrix - local glBillboard = gl.Billboard - local GetUnitIsStunned = Spring.GetUnitIsStunned - local GetUnitHealth = Spring.GetUnitHealth - local GetUnitWeaponState = Spring.GetUnitWeaponState - local GetUnitShieldState = Spring.GetUnitShieldState - local GetUnitViewPosition = Spring.GetUnitViewPosition - local GetUnitStockpile = Spring.GetUnitStockpile - local GetUnitRulesParam = Spring.GetUnitRulesParam - - local fullText - local ux, uy, uz - local dx, dy, dz, dist - local health,maxHealth,paralyzeDamage,capture,build - local hp, hp100, emp, morph - local reload,reloaded,reloadFrame - local numStockpiled,numStockpileQued - - local customInfo = {} - local ci - - function JustGetOverlayInfos(unitID,unitDefID, ud) - - ux, uy, uz = GetUnitViewPosition(unitID) - if not ux then return end - dx, dy, dz = ux-cx, uy-cy, uz-cz - dist = dx*dx + dy*dy + dz*dz - - if (dist > 9000000) then - return - end - --// GET UNIT INFORMATION - health,maxHealth,paralyzeDamage = GetUnitHealth(unitID) - - local empHP = ((not paralyzeOnMaxHealth) and health) or maxHealth - emp = (paralyzeDamage or 0)/empHP - hp = (health or 0)/maxHealth - morph = UnitMorphs[unitID] - - if (drawUnitsOnFire)and(GetUnitRulesParam(unitID,"on_fire")==1) then - onFireUnits[#onFireUnits+1]=unitID - end - - --// PARALYZE - local stunned, _, inbuild = GetUnitIsStunned(unitID) - if (emp>0)and(hp>0)and((not morph) or morph.combatMorph) and (emp<1e8) and (paralyzeDamage >= empHP) then - if (stunned) then - paraUnits[#paraUnits+1]=unitID - end - end - - --// DISARM - if not stunned then - local disarmed = GetUnitRulesParam(unitID,"disarmed") - if disarmed and disarmed == 1 then - disarmUnits[#disarmUnits+1]=unitID - end - end - end - - function DrawUnitInfos(unitID,unitDefID, ud) - if (not customInfo[unitDefID]) then - customInfo[unitDefID] = { - height = ud.height+14, - canJump = (ud.customParams.canjump=="1")or(GetUnitRulesParam(unitID,"jumpReload")), - maxShield = ud.shieldPower, - canStockpile = ud.canStockpile, - gadgetStock = ud.customParams.stockpiletime, - reloadTime = ud.reloadTime, - primaryWeapon = ud.primaryWeapon, - maxWaterTank = ud.customParams.maxwatertank, - freeStockpile = (ud.customParams.freestockpile and true) or nil, - } - end - ci = customInfo[unitDefID] - - fullText = true - ux, uy, uz = GetUnitViewPosition(unitID) - if not ux then return end - dx, dy, dz = ux-cx, uy-cy, uz-cz - dist = dx*dx + dy*dy + dz*dz - if (dist > infoDistance) then - if (dist > 9000000) then - if debugMode then - local x,y,z = Spring.GetUnitPosition(unitID) - Spring.MarkerAddPoint(x,y,z,"High Distance") - end - return - end - fullText = false - end - - --// GET UNIT INFORMATION - health,maxHealth,paralyzeDamage,capture,build = GetUnitHealth(unitID) - --if (not health) then health=-1 elseif(health<1) then health=1 end - if (not maxHealth)or(maxHealth<1) then maxHealth=1 end - if (not build) then build=1 end - - local empHP = (not paralyzeOnMaxHealth) and health or maxHealth - emp = (paralyzeDamage or 0)/empHP - hp = (health or 0)/maxHealth - - if hp < 0 then - hp = 0 - end - - morph = UnitMorphs[unitID] - - if (drawUnitsOnFire)and(GetUnitRulesParam(unitID,"on_fire")==1) then - onFireUnits[#onFireUnits+1]=unitID - end - - --// BARS //----------------------------------------------------------------------------- - --// Shield - if (ci.maxShield>0) then - local shieldOn,shieldPower = GetUnitShieldState(unitID) - if (shieldOn)and(build==1)and(shieldPowerhp+0.01 or hp>build+0.01))or(drawFullHealthBars)) then - hp100 = hp*100; hp100 = hp100 - hp100%1; --//same as floor(hp*100), but 10% faster - if (hp100<0) then hp100=0 elseif (hp100>100) then hp100=100 end - if (drawFullHealthBars)or(hp100<100) then - AddBar("health",hp,nil,(fullText and hp100..'%') or '',bfcolormap[hp100]) - end - end - - --// BUILD - if (build<1) then - AddBar("building",build,"build",(fullText and floor(build*100)..'%') or '') - end - - --// MORPHING - if (morph) then - local build = morph.progress - AddBar("morph",build,"build",(fullText and floor(build*100)..'%') or '') - end - - --// STOCKPILE - if (ci.canStockpile) then - local stockpileBuild - numStockpiled,numStockpileQued,stockpileBuild = GetUnitStockpile(unitID) - if ci.gadgetStock then - stockpileBuild = GetUnitRulesParam(unitID,"gadgetStockpile") - end - if (numStockpiled) then - stockpileBuild = stockpileBuild or 0 - if (stockpileBuild>0) then - AddBar("stockpile",stockpileBuild,"stock",(fullText and floor(stockpileBuild*100)..'%') or '') - end - end - else - numStockpiled = false - end - - --// PARALYZE - local paraTime = false - local stunned = GetUnitIsStunned(unitID) - if (emp>0)and(hp>0)and((not morph) or morph.combatMorph)and(emp<1e8) then - local infotext = "" - stunned = stunned and paralyzeDamage >= empHP - if (stunned) then - paraTime = (paralyzeDamage-empHP)/(maxHealth*empDecline) - paraUnits[#paraUnits+1]=unitID - if (fullText) then - infotext = floor(paraTime) .. 's' - end - emp = 1 - else - if (emp>1) then emp=1 end - if (fullText) then - infotext = floor(emp*100)..'%' - end - end - local empcolor_index = (stunned and ((blink and "emp_b") or "emp_p")) or ("emp") - AddBar("paralyze",emp,empcolor_index,infotext) - end - - --// DISARM - local disarmFrame = GetUnitRulesParam(unitID,"disarmframe") - if disarmFrame and disarmFrame ~= -1 and disarmFrame > gameFrame then - local disarmProp = (disarmFrame - gameFrame)/1200 - if disarmProp < 1 then - if (not paraTime) and disarmProp > emp + 0.014 then -- 16 gameframes of emp time - AddBar("disarm",disarmProp,"disarm",(fullText and floor(disarmProp*100)..'%') or '') - end - else - local disarmTime = (disarmFrame - gameFrame - 1200)/30 - if (not paraTime) or disarmTime > paraTime + 0.5 then - AddBar("disarm",1,((blink and "disarm_b") or "disarm_p") or ("disarm"),floor(disarmTime) .. 's') - if not stunned then - disarmUnits[#disarmUnits+1]=unitID - end - end - end - end - - --// CAPTURE (set by capture gadget) - if ((capture or -1)>0) then - AddBar("capture",capture,"capture",(fullText and floor(capture*100)..'%') or '') - end - - --// CAPTURE RECHARGE - local captureReloadState = GetUnitRulesParam(unitID,"captureRechargeFrame") - if (captureReloadState and captureReloadState > 0) then - local capture = 1-(captureReloadState-gameFrame)/captureReloadTime - AddBar("capture reload",capture,"reload",(fullText and floor(capture*100)..'%') or '') - end - - --// WATER TANK - local waterTank = GetUnitRulesParam(unitID,"watertank") - if (ci.maxWaterTank and waterTank) then - local prog = waterTank/ci.maxWaterTank - if prog < 1 then - AddBar("water tank",prog,"tank",(fullText and floor(prog*100)..'%') or '') - end - end - - --// Teleport progress - local TeleportEnd = GetUnitRulesParam(unitID,"teleportend") - local TeleportCost = GetUnitRulesParam(unitID,"teleportcost") - if TeleportEnd and TeleportCost and TeleportEnd ~= 0 then - local prog - if TeleportEnd > TeleportCost then - -- End frame given - prog = 1 - (TeleportEnd - gameFrame)/TeleportCost - else - -- Same parameters used to display a static progress - prog = 1 - TeleportEnd/TeleportCost - end - if prog < 1 then - AddBar("teleport",prog,"tele",(fullText and floor(prog*100)..'%') or '') - end - end - - --// SPECIAL WEAPON - - local specialReloadState = GetUnitRulesParam(unitID,"specialReloadFrame") - if (specialReloadState and specialReloadState > gameFrame) then - local special = 1-(specialReloadState-gameFrame)/(ud.customParams.specialreloadtime or 1*30) - AddBar("ability",special,"reload2",(fullText and floor(special*100)..'%') or '') - end - - - --// RELOAD - if (ci.reloadTime>=options.minReloadTime.value) then - _,reloaded,reloadFrame = GetUnitWeaponState(unitID,ci.primaryWeapon - reverseCompat) - if (reloaded==false) then - local slowState = 1-(GetUnitRulesParam(unitID,"slowState") or 0) - local reloadTime = Spring.GetUnitWeaponState(unitID, ci.primaryWeapon - reverseCompat , 'reloadTime') - ci.reloadTime = reloadTime - -- When weapon is disabled the reload time is constantly set to be almost complete. - -- It results in a bunch of units walking around with 99% reload bars. - if reloadFrame > gameFrame + 4 then -- UPDATE_PERIOD in unit_attributes.lua. - reload = 1 - ((reloadFrame-gameFrame)/30) / ci.reloadTime; - if (reload >= 0) then - AddBar("reload",reload,"reload",(fullText and floor(reload*100)..'%') or '') - end - end - end - end - - --// SHEATH - local sheathState = GetUnitRulesParam(unitID,"sheathState") - if sheathState and (sheathState < 1) then - AddBar("sheath",sheathState,"sheath",(fullText and floor(sheathState*100)..'%') or '') - end - - --// SLOW - local slowState = GetUnitRulesParam(unitID,"slowState") - if (slowState and (slowState>0)) then - AddBar("slow",slowState,"slow",(fullText and floor(slowState*100)..'%') or '') - end - - --// GOO - local gooState = GetUnitRulesParam(unitID,"gooState") - if (gooState and (gooState>0)) then - AddBar("goo",gooState,"goo",(fullText and floor(gooState*100)..'%') or '') - end - - --// JUMPJET - if (drawJumpJet)and(ci.canJump) then - local jumpReload = GetUnitRulesParam(unitID,"jumpReload") - if (jumpReload and (jumpReload>0) and (jumpReload<1)) then - AddBar("jump",jumpReload,"jump",(fullText and floor(jumpReload*100)..'%') or '') - end - end - - if debugMode then - local x,y,z = Spring.GetUnitPosition(unitID) - Spring.MarkerAddPoint(x,y,z,"N" .. barsN) - end - - if (barsN>0)or(numStockpiled) then - glPushMatrix() - glTranslate(ux, uy+ci.height, uz ) - glBillboard() - - --// STOCKPILE ICON - if (numStockpiled) then - if (barShader) then - glMyText(1) - DrawStockpile(numStockpiled,numStockpileQued, ci.freeStockpile) - glMyText(0) - else - DrawStockpile(numStockpiled,numStockpileQued, ci.freeStockpile) - end - end - - --// DRAW BARS - DrawBars(fullText) - - glPopMatrix() - end - end - -end --// end do - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local DrawFeatureInfos - -do - --//speedup - local glTranslate = gl.Translate - local glPushMatrix = gl.PushMatrix - local glPopMatrix = gl.PopMatrix - local glBillboard = gl.Billboard - local GetFeatureHealth = Spring.GetFeatureHealth - local GetFeatureResources = Spring.GetFeatureResources - - local featureDefID - local health,maxHealth,resurrect,reclaimLeft - local hp - - local customInfo = {} - local ci - - function DrawFeatureInfos(featureID,featureDefID,fullText,fx,fy,fz) - if (not customInfo[featureDefID]) then - local featureDef = FeatureDefs[featureDefID or -1] or {height=0,name=''} - customInfo[featureDefID] = { - height = featureDef.height+14, - wall = walls[featureDef.name], - } - end - ci = customInfo[featureDefID] - - health,maxHealth,resurrect = GetFeatureHealth(featureID) - _,_,_,_,reclaimLeft = GetFeatureResources(featureID) - if (not resurrect) then resurrect=0 end - if (not reclaimLeft) then reclaimLeft=1 end - - hp = (health or 0)/(maxHealth or 1) - - --// filter all walls and none resurrecting features - if (resurrect == 0) and - (reclaimLeft == 1) and - (hp > featureHpThreshold) - then return end - - --// BARS //----------------------------------------------------------------------------- - --// HEALTH - if (hp0) then - AddBar("resurrect",resurrect,"resurrect",(fullText and floor(resurrect*100)..'%') or '') - end - - --// RECLAIMING - if (reclaimLeft>0 and reclaimLeft<1) then - AddBar("reclaim",reclaimLeft,"reclaim",(fullText and floor(reclaimLeft*100)..'%') or '') - end - - - if (barsN>0) then - glPushMatrix() - glTranslate(fx,fy+ci.height,fz) - glBillboard() - - --// DRAW BARS - DrawBarsFeature(fullText) - - glPopMatrix() - end - end - -end --// end do - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local DrawOverlays - -do - local GL_TEXTURE_GEN_MODE = GL.TEXTURE_GEN_MODE - local GL_EYE_PLANE = GL.EYE_PLANE - local GL_EYE_LINEAR = GL.EYE_LINEAR - local GL_T = GL.T - local GL_S = GL.S - local GL_ONE = GL.ONE - local GL_SRC_ALPHA = GL.SRC_ALPHA - local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA - local glUnit = gl.Unit - local glTexGen = gl.TexGen - local glTexCoord = gl.TexCoord - local glPolygonOffset = gl.PolygonOffset - local glBlending = gl.Blending - local glDepthTest = gl.DepthTest - local glTexture = gl.Texture - local GetCameraVectors = Spring.GetCameraVectors - local abs = math.abs - - function DrawOverlays() - --// draw an overlay for stunned or disarmed units - if (drawStunnedOverlay) and ((#paraUnits>0) or (#disarmUnits>0)) then - glDepthTest(true) - glPolygonOffset(-2, -2) - glBlending(GL_SRC_ALPHA, GL_ONE) - - local alpha = ((5.5 * widgetHandler:GetHourTimer()) % 2) - 0.7 - if (#paraUnits>0) then - glColor(0,0.7,1,alpha/4) - for i=1,#paraUnits do - glUnit(paraUnits[i],true) - end - end - if (#disarmUnits>0) then - glColor(0.8,0.8,0.5,alpha/6) - for i=1,#disarmUnits do - glUnit(disarmUnits[i],true) - end - end - local shift = widgetHandler:GetHourTimer() / 20 - - glTexCoord(0,0) - glTexGen(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR) - local cvs = GetCameraVectors() - local v = cvs.right - glTexGen(GL_T, GL_EYE_PLANE, v[1]*0.008,v[2]*0.008,v[3]*0.008, shift) - glTexGen(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR) - v = cvs.forward - glTexGen(GL_S, GL_EYE_PLANE, v[1]*0.008,v[2]*0.008,v[3]*0.008, shift) - - if (#paraUnits>0) then - glTexture("LuaUI/Images/paralyzed.png") - glColor(0,1,1,alpha*1.1) - for i=1,#paraUnits do - glUnit(paraUnits[i],true) - end - end - if (#disarmUnits>0) then - glTexture("LuaUI/Images/disarmed.png") - glColor(0.6,0.6,0.2,alpha*0.9) - for i=1,#disarmUnits do - glUnit(disarmUnits[i],true) - end - end - - glTexture(false) - glTexGen(GL_T, false) - glTexGen(GL_S, false) - glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glPolygonOffset(false) - glDepthTest(false) - - paraUnits = {} - disarmUnits = {} - end - - --// overlay for units on fire - if (drawUnitsOnFire)and(onFireUnits) then - glDepthTest(true) - glPolygonOffset(-2, -2) - glBlending(GL_SRC_ALPHA, GL_ONE) - - local alpha = abs((widgetHandler:GetHourTimer() % 2)-1) - glColor(1,0.3,0,alpha/4) - for i=1,#onFireUnits do - glUnit(onFireUnits[i],true) - end - - glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - glPolygonOffset(false) - glDepthTest(false) - - onFireUnits = {} - end - end - -end --//end do - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local visibleFeatures = {} -local visibleUnits = {} - -do - local ALL_UNITS = Spring.ALL_UNITS - local GetCameraPosition = Spring.GetCameraPosition - local GetUnitDefID = Spring.GetUnitDefID - local glDepthMask = gl.DepthMask - local glMultiTexCoord = gl.MultiTexCoord - - function widget:DrawWorld() - if not Spring.IsGUIHidden() then - if (#visibleUnits+#visibleFeatures==0) then - return - end - if WG.Cutscene and WG.Cutscene.IsInCutscene() then - return - end - --gl.Fog(false) - --gl.DepthTest(true) - glDepthMask(true) - - cx, cy, cz = GetCameraPosition() - - if (barShader) then gl.UseShader(barShader); glMyText(0); end - - --// draw bars of units - local unitID,unitDefID,unitDef - for i=1,#visibleUnits do - unitID = visibleUnits[i] - unitDefID = GetUnitDefID(unitID) - if (unitDefID) then - unitDef = UnitDefs[unitDefID] - if (unitDef) then - DrawUnitInfos(unitID, unitDefID, unitDef) - elseif debugMode then - local x,y,z = Spring.GetUnitPosition(unitID) - if not (x and y and z) then - Spring.Log("HealthBars", "error", "missing position and unitDef of unit " .. unitID) - else - Spring.MarkerAddPoint(x,y,z,"Missing unitDef") - end - end - elseif debugMode then - local x,y,z = Spring.GetUnitPosition(unitID) - if not (x and y and z) then - Spring.Log("HealthBars", "error", "missing position and unitDefID of unit " .. unitID) - else - Spring.MarkerAddPoint(x,y,z,"Missing unitDef") - end - end - end - - --// draw bars for features - local wx, wy, wz, dx, dy, dz, dist, featureID, valid - local featureInfo - for i=1,#visibleFeatures do - featureInfo = visibleFeatures[i] - featureID = featureInfo[4] - valid = Spring.ValidFeatureID(featureID) - if (valid) then - wx, wy, wz = featureInfo[1],featureInfo[2],featureInfo[3] - dx, dy, dz = wx-cx, wy-cy, wz-cz - dist = dx*dx + dy*dy + dz*dz - if (dist < 6000000) then - if (dist < infoDistance) then - DrawFeatureInfos(featureInfo[4], featureInfo[5], true, wx,wy,wz) - else - DrawFeatureInfos(featureInfo[4], featureInfo[5], false, wx,wy,wz) - end - end - end - end - else - local unitID,unitDefID,unitDef - for i=1,#visibleUnits do - unitID = visibleUnits[i] - unitDefID = GetUnitDefID(unitID) - if (unitDefID) then - unitDef = UnitDefs[unitDefID] - if (unitDef) then - JustGetOverlayInfos(unitID, unitDefID, unitDef) - end - end - end - end - - if (barShader) then gl.UseShader(0) end - glDepthMask(false) - - DrawOverlays() - glMultiTexCoord(1,1,1,1) - glColor(1,1,1,1) - - --gl.DepthTest(false) - end -end --//end do - -do - local GetGameFrame = Spring.GetGameFrame - local GetVisibleUnits = Spring.GetVisibleUnits - local GetVisibleFeatures = Spring.GetVisibleFeatures - local GetFeatureDefID = Spring.GetFeatureDefID - local GetFeaturePosition = Spring.GetFeaturePosition - local GetFeatureResources = Spring.GetFeatureResources - local select = select - - local sec = 0 - local sec2 = 0 - - function widget:Update(dt) - sec=sec+dt - blink = (sec%1)<0.5 - - gameFrame = GetGameFrame() - visibleUnits = GetVisibleUnits(-1,nil,false) --this don't need any delayed update or caching or optimization since its already done in "LUAUI/cache.lua" - - sec2=sec2+dt - if (sec2>1/3) then - sec2 = 0 - visibleFeatures = GetVisibleFeatures(-1,nil,false,false) - local cnt = #visibleFeatures - local featureID,featureDefID,featureDef - for i=cnt,1,-1 do - featureID = visibleFeatures[i] - featureDefID = GetFeatureDefID(featureID) or -1 - featureDef = FeatureDefs[featureDefID] - --// filter trees and none destructable features - if (featureDef)and(featureDef.destructable)and( - (featureDef.drawTypeString=="model")or(select(5,GetFeatureResources(featureID))<1) - ) then - local fx,fy,fz = GetFeaturePosition(featureID) - visibleFeatures[i] = {fx,fy,fz, featureID, featureDefID} - else - visibleFeatures[i] = visibleFeatures[cnt] - visibleFeatures[cnt] = nil - cnt = cnt-1 - end - end - end - - end - -end --//end do - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// not 100% finished! - -function MorphUpdate(morphTable) - UnitMorphs = morphTable -end - -function MorphStart(unitID,morphDef) - --return false -end - -function MorphStop(unitID) - UnitMorphs[unitID] = nil -end - -function MorphFinished(unitID) - UnitMorphs[unitID] = nil -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/unit_icons.lua b/LuaUI/Widgets_Evo/unit_icons.lua index db54657b5..3236eb74f 100644 --- a/LuaUI/Widgets_Evo/unit_icons.lua +++ b/LuaUI/Widgets_Evo/unit_icons.lua @@ -43,7 +43,7 @@ options = { iconsize = { name = 'Hovering Icon Size', type = 'number', - value = 30, min=10, max = 40, + value = 15, min=10, max = 40, } } @@ -54,8 +54,8 @@ local unitHeights = {} local iconOrders = {} local iconOrders_order = {} -local iconoffset = 14 - +local iconoffset = 14 -- vertical offset +local iconoffsethorizontal = 28 -- horizontal offset local iconUnitTexture = {} local textureUnitsXshift = {} @@ -206,7 +206,7 @@ end ------------------------------------------------------------------------------------- local function DrawUnitFunc(xshift, yshift) - glTranslate(xshift,yshift,0) + glTranslate(xshift + iconoffsethorizontal,yshift,0) glBillboard() glTexRect(-options.iconsize.value*0.5, -9, options.iconsize.value*0.5, options.iconsize.value-9) end @@ -294,4 +294,4 @@ function widget:Shutdown() end ------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/unit_rank_icons.lua b/LuaUI/Widgets_Evo/unit_rank_icons.lua deleted file mode 100644 index 6fcf4ce07..000000000 --- a/LuaUI/Widgets_Evo/unit_rank_icons.lua +++ /dev/null @@ -1,160 +0,0 @@ -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Rank Icons 2", - desc = "Adds a rank icon depending on experience next to units (needs Unit Icons)", - author = "trepan (idea quantum,jK), CarRepairer tweak", - date = "Feb, 2008", - license = "GNU GPL, v2 or later", - layer = 5, - enabled = true -- loaded by default? - } -end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - --- speed-ups -local GetUnitDefID = Spring.GetUnitDefID -local GetUnitExperience = Spring.GetUnitExperience -local GetAllUnits = Spring.GetAllUnits -local IsUnitAllied = Spring.IsUnitAllied -local GetSpectatingState = Spring.GetSpectatingState - -local min = math.min -local floor = math.floor - ----------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------- - -local PWranks = { [0] = {}, [1] = {}, [2] = {}, [3] = {}, [4] = {} } - -local PWUnits = {} - -local myAllyTeamID = 666 - - -local rankTexBase = 'LuaUI/Images/Ranks/' -local rankTextures = { - [0] = nil, - [1] = rankTexBase .. 'rank1.png', - [2] = rankTexBase .. 'rank2.png', - [3] = rankTexBase .. 'rank3.png', - [4] = rankTexBase .. 'star.png', -} -local PWrankTextures = { - [0] = rankTexBase .. 'PWrank0.png', - [1] = rankTexBase .. 'PWrank1.png', - [2] = rankTexBase .. 'PWrank2.png', - [3] = rankTexBase .. 'PWrank3.png', - [4] = rankTexBase .. 'PWstar.png', -} - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function PWCreate(unitID) - PWUnits[unitID] = true - SetUnitRank(unitID) -end - -function widget:Initialize() - - widgetHandler:RegisterGlobal("PWCreate", PWCreate) - - WG.icons.SetOrder( 'rank', 1 ) - - for udid, ud in pairs(UnitDefs) do - -- 0.15+2/(1.2+math.exp(Unit.power/1000)) - ud.power_xp_coeffient = ((ud.power / 1000) ^ -0.2) / 6 -- dark magic - end - - for _,unitID in pairs( GetAllUnits() ) do - SetUnitRank(unitID) - end -end - -function widget:Shutdown() -end - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function SetUnitRank(unitID) - local ud = UnitDefs[GetUnitDefID(unitID)] - if (ud == nil) then - return - end - - local xp = GetUnitExperience(unitID) - if (not xp) then - return - end - xp = min(floor(xp / ud.power_xp_coeffient),4) - - if not PWUnits[unitID] then - if (xp>0) then - WG.icons.SetUnitIcon( unitID, {name='rank', texture=rankTextures[xp] } ) - end - else - PWranks[xp][unitID] = true - end -end - - - -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- - -function widget:UnitExperience(unitID,unitDefID,unitTeam, xp, oldXP) - local ud = UnitDefs[unitDefID] - if (ud == nil) then - return - end - if xp < 0 then xp = 0 end - if oldXP < 0 then oldXP = 0 end - - local rank = min(floor(xp / ud.power_xp_coeffient),4) - local oldRank = min(floor(oldXP / ud.power_xp_coeffient),4) - - if (rank~=oldRank) then - if not PWUnits[unitID] then - WG.icons.SetUnitIcon( unitID, {name='rank', texture=rankTextures[rank]} ) - else - for i=0,rank-1 do PWranks[i][unitID] = nil end - PWranks[rank][unitID] = true - end - end -end - -function widget:UnitCreated(unitID, unitDefID, unitTeam) - if (IsUnitAllied(unitID)or(GetSpectatingState())) then - SetUnitRank(unitID) - end -end - - -function widget:UnitDestroyed(unitID, unitDefID, unitTeam) - WG.icons.SetUnitIcon( unitID, {name='rank', texture=nil} ) - PWUnits[unitID] = nil -end - - -function widget:UnitGiven(unitID, unitDefID, oldTeam, newTeam) - if (not IsUnitAllied(unitID))and(not GetSpectatingState()) then - WG.icons.SetUnitIcon( unitID, {name='rank', texture=nil} ) - end -end - ---needed if icon widget gets disabled/enabled after this one. find a better way? -function widget:GameFrame(f) - if f%(32*5) == 0 then --5 seconds - for _,unitID in pairs( GetAllUnits() ) do - SetUnitRank(unitID) - end - end -end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/unit_selection_circles_0.5.8.lua b/LuaUI/Widgets_Evo/unit_selection_circles_0.5.8.lua deleted file mode 100644 index e2db504b8..000000000 --- a/LuaUI/Widgets_Evo/unit_selection_circles_0.5.8.lua +++ /dev/null @@ -1,563 +0,0 @@ -function widget:GetInfo() - return { - name = "Unit Selection Circles 0.5.8", - desc = "Draws blended shapes around units and buildings ", - author = "Lelousius and aegis (edited by Forboding Angel)", - date = "Jan 19, 2011", - license = "GNU GPL, v2 or later", - layer = 2, - enabled = false -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function SetupCommandColors(state) - local alpha = state and 1 or 0 - local f = io.open('cmdcolors.tmp', 'w+') - if (f) then - f:write('unitBox 0 1 0 ' .. alpha) - f:close() - Spring.SendCommands({'cmdcolors cmdcolors.tmp'}) - end - os.remove('cmdcolors.tmp') -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local math_acos = math.acos -local math_pi = math.pi -local math_cos = math.cos -local math_sin = math.sin -local math_abs = math.abs -local rad_con = 180 / math_pi - -local GL_ONE_MINUS_SRC_ALPHA = GL.ONE_MINUS_SRC_ALPHA -local GL_ONE_MINUS_DST_ALPHA = GL.ONE_MINUS_DST_ALPHA -local GL_SRC_ALPHA = GL.SRC_ALPHA -local GL_DST_ALPHA = GL.DST_ALPHA -local GL_DST_COLOR = GL.DST_COLOR -local GL_SRC_COLOR = GL.SRC_COLOR -local GL_ZERO = GL.ZERO -local GL_ONE = GL.ONE - -local GL_QUADS = GL.QUADS -local GL_QUAD_STRIP = GL.QUAD_STRIP -local GL_TRIANGLE_FAN = GL.TRIANGLE_FAN -local GL_TRIANGLE_STRIP = GL.TRIANGLE_STRIP -local GL_LINE_LOOP = GL.LINE_LOOP -local GL_TRIANGLES = GL.TRIANGLES -local GL_POLYGON = GL.POLYGON - -local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT -local glPushAttrib = gl.PushAttrib -local glPopAttrib = gl.PopAttrib - -local gl_DepthTest = gl.DepthTest -local gl_BlendFunc = gl.BlendFunc -local gl_ColorMask = gl.ColorMask -local gl_DrawList = gl.CallList - -local spGetUnitHeading = Spring.GetUnitHeading -local spGetUnitDirection = Spring.GetUnitDirection -local spGetHeadingFromVector = Spring.GetHeadingFromVector -local spIsUnitIcon = Spring.IsUnitIcon - -local UnitDs = UnitDefs - --- Automatically generated local definitions - -local glBeginEnd = gl.BeginEnd -local glColor = gl.Color -local glCreateList = gl.CreateList -local glDeleteList = gl.DeleteList -local glDepthTest = gl.DepthTest -local glDrawListAtUnit = gl.DrawListAtUnit -local glLineWidth = gl.LineWidth -local glPolygonOffset = gl.PolygonOffset -local glVertex = gl.Vertex -local spDiffTimers = Spring.DiffTimers -local spGetVisibleUnits = Spring.GetVisibleUnits -local spGetGroundNormal = Spring.GetGroundNormal -local spGetSelectedUnits = Spring.GetSelectedUnits -local spGetTeamColor = Spring.GetTeamColor -local spGetTimer = Spring.GetTimer -local spGetUnitBasePosition = Spring.GetUnitBasePosition -local spGetUnitDefDimensions = Spring.GetUnitDefDimensions -local spGetUnitDefID = Spring.GetUnitDefID -local spGetUnitRadius = Spring.GetUnitRadius -local spGetUnitTeam = Spring.GetUnitTeam -local spGetUnitViewPosition = Spring.GetUnitViewPosition -local spIsUnitSelected = Spring.IsUnitSelected -local spIsUnitVisible = Spring.IsUnitVisible -local spSendCommands = Spring.SendCommands - -local spGetCameraPosition = Spring.GetCameraPosition -local spGetGameFrame = Spring.GetGameFrame -local spTraceScreenRay = Spring.TraceScreenRay -local spGetMouseState = Spring.GetMouseState - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local clearquad -local shapes = {} - -local myTeamID = Spring.GetLocalTeamID() - -local circleDivs = 32 -- how precise circle? octagon by default -local innersize = 0.9 -- circle scale compared to unit radius -local selectinner = 1.5 -local outersize = 1.9 -- outer fade size compared to circle scale (1 = no outer fade) -local scalefaktor = 2.8 -local rectangleFactor = 3.5 -local CAlpha = 0.5 - -local colorout = { 1, 1, 1, 0 } -- outer color -local colorin = { 1, 1, 1, 1 } -- inner color - -local teamColors = {} -local unitConf = {} ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- - -local lastCamX, lastCamY, lastCamZ -local lastGameFrame = 0 - -local lastVisibleUnits, lastVisibleSelected -local forceUpdate = false - -local function HasVisibilityChanged() - local camX, camY, camZ = spGetCameraPosition() - local gameFrame = spGetGameFrame() - if (camX ~= lastCamX) or (camY ~= lastCamY) or (camZ ~= lastCamZ) or - ((gameFrame - lastGameFrame) >= 15) or (#lastVisibleSelected > 0) or - (#spGetSelectedUnits() > 0) then - - lastGameFrame = gameFrame - lastCamX, lastCamY, lastCamZ = camX, camY, camZ - return true - end - return false -end - -local function GetVisibleUnits() - if (HasVisibilityChanged()) then - - local units = spGetVisibleUnits(-1, 30, true) - local visibleUnits = {} - local visibleSelected = {} - - for i=1, #units do - local unitID = units[i] - if (spIsUnitSelected(unitID)) then - visibleSelected[#visibleSelected+1] = unitID - else - visibleUnits[#visibleUnits+1] = unitID - end - end - - lastVisibleUnits = visibleUnits - lastVisibleSelected = visibleSelected - return visibleUnits, visibleSelected - else - return lastVisibleUnits, lastVisibleSelected - end -end - -local function GetTeamColorSet(teamID) - local colors = teamColors[teamID] - if (colors) then - return colors - end - local r,g,b = spGetTeamColor(teamID) - - colors = { r, g, b, 0 } - -- Alpha = 0 as it is drawn with DST_ALPHA and should Clear it afterwards - - teamColors[teamID] = colors - return colors -end - --- Not to be used anymore due to improvements - ---local function GetCircle(teamID) --- if (circle[teamID]) then --- return circle[teamID] --- else --- local colors = GetTeamColorSet(teamID) --- circle[teamID] = glCreateList(function() --- glBeginEnd(GL.QUAD_STRIP, function() --- local radstep = (2.0 * math_pi) / circleDivs --- for i = 0, circleDivs do --- local a1 = (i * radstep) --- glColor(colors[1]) --- glVertex(math_sin(a1)*innersize, 0, math_cos(a1)*innersize) --- glColor(colors[2]) --- glVertex(math_sin(a1)*selectinner, 0, math_cos(a1)*selectinner) --- end --- end) --- end) --- end --- return circle[teamID] ---end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- Creating polygons: -local function CreateDisplayLists(callback) - local displayLists = {} - - local zeroColor = {0, 0, 0, 0} - local CAlphaColor = {0, 0, 0, CAlpha} - - displayLists.select = callback.fading(colorin, colorout, outersize, selectinner) - displayLists.invertedSelect = callback.fading(colorout, colorin, outersize, selectinner) - displayLists.inner = callback.solid(zeroColor, innersize) - displayLists.large = callback.solid(nil, selectinner) - displayLists.kill = callback.solid(nil, outersize) - displayLists.shape = callback.fading(zeroColor, CAlphaColor, innersize, selectinner) - - return displayLists -end - -local function CreateCircleLists() - local callback = {} - - function callback.fading(colorin, colorout, innersize, outersize) - return glCreateList(function() - glBeginEnd(GL.QUAD_STRIP, function() - local radstep = (2.0 * math_pi) / circleDivs - for i = 0, circleDivs do - local a1 = (i * radstep) - if (colorin) then - glColor(colorin) - end - glVertex(math_sin(a1)*innersize, 0, math_cos(a1)*innersize) - if (colorout) then - glColor(colorout) - end - glVertex(math_sin(a1)*outersize, 0, math_cos(a1)*outersize) - end - end) - end) - end - - function callback.solid(color, size) - return glCreateList(function() - glBeginEnd(GL.TRIANGLE_FAN, function() - local radstep = (2.0 * math_pi) / circleDivs - if (color) then - glColor(color) - end - glVertex(0, 0, 0) - for i = 0, circleDivs do - local a1 = (i * radstep) - glVertex(math_sin(a1)*size, 0, math_cos(a1)*size) - end - end) - end) - end - - shapes.circle = CreateDisplayLists(callback) -end - -local function CreatePolygonCallback(points, immediate) - immediate = immediate or GL_POLYGON - local callback = {} - - function callback.fading(colorin, colorout, innersize, outersize) - local diff = outersize - innersize - local steps = {} - - for i=1, #points do - local p = points[i] - local x, z = p[1]*outersize, p[2]*outersize - local xs, zs = (math_abs(x)/x and x or 1), (math_abs(z)/z and z or 1) - steps[i] = {x, z, xs, zs} - end - - return glCreateList(function() - glBeginEnd(GL_TRIANGLE_STRIP, function() - for i=1, #steps do - local step = steps[i] or steps[i-#steps] - local nexts = steps[i+1] or steps[i-#steps+1] - - glColor(colorout) - glVertex(step[1], 0, step[2]) - - glColor(colorin) - glVertex(step[1] - diff*step[3], 0, step[2] - diff*step[4]) - - glColor(colorout) - glVertex(step[1] + (nexts[1]-step[1]), 0, step[2] + (nexts[2]-step[2])) - - glColor(colorin) - glVertex(nexts[1] - diff*nexts[3], 0, nexts[2] - diff*nexts[4]) - end - end) - end) - end - - function callback.solid(color, size) - return glCreateList(function() - glBeginEnd(immediate, function() - if (color) then - glColor(color) - end - for i=1, #points do - local p = points[i] - glVertex(size*p[1], 0, size*p[2]) - end - end) - end) - end - - return callback -end - -local function CreateSquareLists() - local points = { - {-1, 1}, - {1, 1}, - {1, -1}, - {-1, -1} - } - - local callback = CreatePolygonCallback(points, GL_QUADS) - shapes.square = CreateDisplayLists(callback) -end - -local function CreateTriangleLists() - local points = { - {0, -1}, - {1, 1}, - {-1, 1} - } - - local callback = CreatePolygonCallback(points, GL_TRIANGLES) - shapes.triangle = CreateDisplayLists(callback) -end - -local function DestroyShape(shape) - glDeleteList(shape.select) - glDeleteList(shape.invertedSelect) - glDeleteList(shape.inner) - glDeleteList(shape.large) - glDeleteList(shape.kill) - glDeleteList(shape.shape) -end - -function widget:Initialize() - CreateCircleLists() - CreateSquareLists() - CreateTriangleLists() - - for udid, unitDef in pairs(UnitDs) do - local xsize, zsize = unitDef.xsize, unitDef.zsize - local scale = scalefaktor*( xsize^2 + zsize^2 )^0.5 - local shape, xscale, zscale - shape = shapes.circle - xscale, zscale = scale, scale - - unitConf[udid] = {shape=shape, xscale=xscale, zscale=zscale} - end - - clearquad = glCreateList(function() - local size = 1000 - glBeginEnd(GL.QUADS, function() - glVertex( -size,0, -size) - glVertex( Game.mapSizeX+size,0, -size) - glVertex( Game.mapSizeX+size,0, Game.mapSizeZ+size) - glVertex( -size,0, Game.mapSizeZ+size) - end) - end) - SetupCommandColors(false) -end - -function widget:Shutdown() - SetupCommandColors(true) - - glDeleteList(clearquad) - - for _, shape in pairs(shapes) do - DestroyShape(shape) - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- -local visibleUnits, visibleSelected = {}, {} -local degrot = {} -function widget:Update() - local mx, my = spGetMouseState() - local ct, id = spTraceScreenRay(mx, my) - if (ct == "unit") then - hoveredUnit = id - else - hoveredUnit = nil - end - - visibleUnits, visibleSelected = GetVisibleUnits() - heading = {} - for i=1, #visibleUnits do - local unitID = visibleUnits[i] - dirx, _, dirz = spGetUnitDirection(unitID) - if (dirz ~= nil) then - degrot[unitID] = 180 - math_acos(dirz) * rad_con - end - end - for i=1, #visibleSelected do - local unitID = visibleSelected[i] - dirx, _, dirz = spGetUnitDirection(unitID) - if (dirz ~= nil) then - degrot[unitID] = 180 - math_acos(dirz) * rad_con - end - end -end - ---Funktion-vars for later use - local teamID = 0 - local unitID = 0 - local udid = 0 - local dirx = 0 - local diry = 0 - local dirz = 0 - local unit --- Drawing: - -function widget:DrawWorldPreUnit() -if not Spring.IsGUIHidden() then - if (#visibleUnits + #visibleSelected == 0) then return end - - glPushAttrib(GL_COLOR_BUFFER_BIT) - - glDepthTest(false) - - -- To fix Water - gl_ColorMask(false,false,false,true) - gl_BlendFunc(GL_ONE, GL_ONE) - glColor(1,1,1,1) - -- Does not need to be drawn per Unit .. it covers the whole map - gl_DrawList(clearquad) - - -- Draw selection circles --- gl_ColorMask(false,false,false,true) - gl_BlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA) - for i=1, #visibleSelected do - unitID = visibleSelected[i] - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - glDrawListAtUnit(unitID, unit.shape.select, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - -- Here The inner of the selected circles are removed - gl_BlendFunc(GL_ONE, GL_ZERO) - glColor(0,0,0,1) - - for i=1, #visibleSelected do - unitID = visibleSelected[i] - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - glDrawListAtUnit(unitID, unit.shape.large, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - -- Really draw the Circles now (This could be optimised if we could say Draw as much as DST_ALPHA * SRC_ALPHA is) - -- (without protecting form drawing them twice) - gl_ColorMask(true,true,true,true) - gl_BlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA) - glColor(1,1,1,1) --- for i=1, #visibleSelected do --- unitID = visibleSelected[i] --- udid = spGetUnitDefID(unitID) --- unit = unitConf[udid] --- gl_BlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA) --- glDrawListAtUnit(unitID, unit.shape.kill, false, unit.xscale, 1.0, unit.zscale, 0, 0, 0, 0) --- end - - -- Does not need to be drawn per Unit anymore - gl_DrawList(clearquad) - - - -- Draw Circles to AlphaBuffer - gl_ColorMask(false, false, false, true) - gl_BlendFunc(GL_DST_ALPHA, GL_ZERO) --- local circle1 = GetCircle(1) - for i=1, #visibleUnits do - unitID = visibleUnits[i] - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - glDrawListAtUnit(unitID, unit.shape.shape, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - glDrawListAtUnit(unitID, unit.shape.inner, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - for i=1, #visibleSelected do - unitID = visibleSelected[i] - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - glDrawListAtUnit(unitID, unit.shape.shape, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - glDrawListAtUnit(unitID, unit.shape.inner, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - -- Really Draw those Circles (w.o. protecting form drawing them twice) - gl_ColorMask(true,true,true,true) - gl_BlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA) - for i=1, #visibleUnits do - unitID = visibleUnits[i] - teamID = spGetUnitTeam(unitID) - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - if (teamID and unit) then - glColor(GetTeamColorSet(teamID)) - - glDrawListAtUnit(unitID, unit.shape.large, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - for i=1, #visibleSelected do - unitID = visibleSelected[i] - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - glColor(1,1,1,0) - glDrawListAtUnit(unitID, unit.shape.large, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - - -- highlight unit under mouse cursor - if (hoveredUnit) then - local unitID = hoveredUnit - udid = spGetUnitDefID(unitID) - unit = unitConf[udid] - - if (unit) then - gl_ColorMask(true,true,true,true) - gl_BlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA) - - glColor(0.5,0.5,0.5,0) - glDrawListAtUnit(unitID, unit.shape.large, false, unit.xscale, 1.0, unit.zscale, degrot[unitID], 0, degrot[unitID], 0) - end - end - glPopAttrib() -end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/LuaUI/Widgets_Evo/unit_selectionblurryhalo.lua b/LuaUI/Widgets_Evo/unit_selectionblurryhalo.lua deleted file mode 100644 index 3a67574b9..000000000 --- a/LuaUI/Widgets_Evo/unit_selectionblurryhalo.lua +++ /dev/null @@ -1,628 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Selection BlurryHalo", - desc = "Shows a halo for selected, hovered ally-selected units. (Doesn't work on ati cards!)", - author = "CarRepairer, from jK's gfx_halo", - date = "Jan, 2008", - version = "0.004", - license = "GNU GPL, v2 or later", - layer = -11, - enabled = true -- loaded by default? - } -end - ---this widget requires the gui_selectionsend.lua widget - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local showAlly = false -local visibleAllySelUnits = {} -local visibleSelected = {} - -local function UpdateHaloColors(self) end - -options_path = 'Settings/Interface/Selection/Blurry Halo Selections' - -options_order = { - 'showally', - 'useteamcolors', - - - 'lblPresetColors', - 'selectColor', - 'allySelectColor', - 'myHoverColor', - 'allyHoverColor', - 'enemyHoverColor', - 'featureHoverColor', - - -} - -options = { - showally = { - name = 'Show Ally Selections', - type = 'bool', - desc = 'Highlight the units your allies currently have selected.', - value = true, - OnChange = function(self) - visibleAllySelUnits = {} - showAlly = self.value - end, - }, - useteamcolors = { - name = 'Use Team Colors', - type = 'bool', - desc = 'Highlight your allies\' selections with their team colors instead of the preset colors.', - value = false, - }, - - ----- - - lblPresetColors = {type='label', name = 'Preset Colors' }, - selectColor = { - name = 'Selected Units Color', - type = 'colors', - value = { 0, 1, 0, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - allySelectColor = { - name = 'Ally Selected Units Color', - type = 'colors', - value = { 1, 1, 0, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - myHoverColor = { - name = 'My Unit Hover Color', - type = 'colors', - value = { 1, 1, 1, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - allyHoverColor = { - name = 'Ally Unit Hover Color', - type = 'colors', - value = { 0.5, 0.5, 1, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - enemyHoverColor = { - name = 'Enemy Unit Hover Color', - type = 'colors', - value = { 1, 0, 0, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - - featureHoverColor = { - name = 'Feature Hover Color', - type = 'colors', - value = { 1, 0, 1, 1 }, - OnChange = function(self) UpdateHaloColors(); end - }, - - - -} - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// user var - -local gAlpha = 0.8 - ---// app var - -local offscreentex -local outlinemasktex -local depthtex -local blurtex -local fbo - -local blurShader_h -local blurShader_v -local maskGenShader -local maskApplyShader -local uniformScreenX, uniformScreenY - -local vsx, vsy = 0,0 -local resChanged = false - - ---more -local featureHoverColor = { 1, 0, 1, 1} -local myHoverColor = { 1, 1, 1, 1 } -local allyHoverColor = { 0.5, 0.5, 1, 1 } -local enemyHoverColor = { 1, 0, 0, 1 } -local selectColor = { 0, 1, 0, 1 } -local allySelectColor = { 1, 1, 0, 1 } - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// gl const - -local GL_DEPTH_BITS = 0x0D56 - -local GL_DEPTH_COMPONENT = 0x1902 -local GL_DEPTH_COMPONENT16 = 0x81A5 -local GL_DEPTH_COMPONENT24 = 0x81A6 -local GL_DEPTH_COMPONENT32 = 0x81A7 - -local GL_COLOR_ATTACHMENT0_EXT = 0x8CE0 -local GL_COLOR_ATTACHMENT1_EXT = 0x8CE1 -local GL_COLOR_ATTACHMENT2_EXT = 0x8CE2 -local GL_COLOR_ATTACHMENT3_EXT = 0x8CE3 - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - ---// speed ups - -local ALL_UNITS = Spring.ALL_UNITS - -local spGetMyTeamID = Spring.GetMyTeamID -local spGetUnitTeam = Spring.GetUnitTeam -local spValidUnitID = Spring.ValidUnitID -local ValidFeatureID = Spring.ValidFeatureID -local spIsUnitAllied = Spring.IsUnitAllied -local spIsUnitSelected = Spring.IsUnitSelected -local spGetMouseState = Spring.GetMouseState -local spTraceScreenRay = Spring.TraceScreenRay -local spGetPlayerControlledUnit = Spring.GetPlayerControlledUnit -local spGetVisibleUnits = Spring.GetVisibleUnits -local spIsUnitIcon = Spring.IsUnitIcon - ---local myPlayerID = Spring.GetMyPlayerID() - -local GL_FRONT = GL.FRONT -local GL_BACK = GL.BACK -local GL_MODELVIEW = GL.MODELVIEW -local GL_PROJECTION = GL.PROJECTION -local GL_COLOR_BUFFER_BIT = GL.COLOR_BUFFER_BIT -local GL_DEPTH_BUFFER_BIT = GL.DEPTH_BUFFER_BIT - -local glUnit = gl.Unit -local glFeature = gl.Feature -local glCopyToTexture = gl.CopyToTexture -local glRenderToTexture = gl.RenderToTexture -local glCallList = gl.CallList -local glActiveFBO = gl.ActiveFBO - -local glUseShader = gl.UseShader -local glUniform = gl.Uniform -local glUniformInt = gl.UniformInt - -local glClear = gl.Clear -local glTexRect = gl.TexRect -local glColor = gl.Color -local glTexture = gl.Texture -local glCulling = gl.Culling -local glDepthTest = gl.DepthTest - -local glResetMatrices = gl.ResetMatrices -local glMatrixMode = gl.MatrixMode -local glPushMatrix = gl.PushMatrix -local glLoadIdentity = gl.LoadIdentity -local glPopMatrix = gl.PopMatrix -local glBlending = gl.Blending - -local echo = Spring.Echo - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ---functions - -UpdateHaloColors = function(self) - selectColor = options.selectColor.value - allySelectColor = options.allySelectColor.value - myHoverColor = options.myHoverColor.value - - allyHoverColor = options.allyHoverColor.value - enemyHoverColor = options.enemyHoverColor.value - featureHoverColor = options.featureHoverColor.value -end - -local function GetVisibleUnits() - local units = spGetVisibleUnits(-1, 30, false) - - local visibleAllySelUnits = {} - local visibleSelected = {} - - for i=1, #units do - local unitID = units[i] - if (spIsUnitSelected(unitID)) then - visibleSelected[#visibleSelected+1] = unitID - elseif showAlly and WG.allySelUnits[unitID] then - visibleAllySelUnits[#visibleAllySelUnits+1] = unitID - end - end - - return visibleAllySelUnits, visibleSelected - -end - - -local function DrawHaloFunc() - visibleAllySelUnits, visibleSelected = GetVisibleUnits() - - glColor(selectColor) - for i=1,#visibleSelected do - local unitID = visibleSelected[i] - glUnit(unitID,true) - end - - if not options.useteamcolors.value then glColor(allySelectColor) end - for i=1,#visibleAllySelUnits do - local unitID = visibleAllySelUnits[i] - if options.useteamcolors.value then - local teamID = spGetUnitTeam(unitID) - if teamID then - local r, g, b = Spring.GetTeamColor(teamID); - glColor(r, g, b, allySelectColor[4]) - else - glColor(allySelectColor) - end - end - glUnit(unitID,true) - end - - local mx, my = spGetMouseState() - local pointedType, data = spTraceScreenRay(mx, my) - if pointedType == 'unit' and spValidUnitID(data) and not spIsUnitIcon(data) then - local teamID = spGetUnitTeam(data) - if teamID == spGetMyTeamID() then - glColor(myHoverColor) - elseif (teamID and Spring.AreTeamsAllied(teamID, Spring.GetMyTeamID()) ) then - glColor(allyHoverColor) - else - glColor(enemyHoverColor) - end - - glUnit(data, true) - elseif (pointedType == 'feature') and ValidFeatureID(data) then - glColor(featureHoverColor) - glFeature(data, true) - end - -end - -local DrawVisibleUnits - -DrawVisibleUnits = DrawHaloFunc - -local MyDrawVisibleUnits = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - -- glClear(GL_DEPTH_BUFFER_BIT) - --glCulling(GL_FRONT) - DrawVisibleUnits() - --glCulling(GL_BACK) - --glCulling(false) - glColor(1,1,1,1) -end -local maskGen = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glUseShader(maskGenShader) - glTexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) - --glTexRect(-1-1/vsx,1+1/vsy,1+1/vsx,-1-1/vsy) -end -local blur_h = function() - glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glUseShader(blurShader_h) - glTexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) - --glTexRect(-1-1/vsx,1+1/vsy,1+1/vsx,-1-1/vsy) -end -local blur_v = function() - --glClear(GL_COLOR_BUFFER_BIT,0,0,0,0) - glUseShader(blurShader_v) - glTexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) - --glTexRect(-1-1/vsx,1+1/vsy,1+1/vsx,-1-1/vsy) -end - -function widget:DrawWorldPreUnit() - if Spring.IsGUIHidden() then - return - end - -- glCopyToTexture(depthtex, 0, 0, 0, 0, vsx, vsy) - - glBlending(true) - - if (resChanged) then - resChanged = false - if (vsx==1) or (vsy==1) then return end - glUseShader(blurShader_h) - glUniformInt(uniformScreenX, math.ceil(vsx*0.8) ) --can use these numbers to adjust thickness - glUseShader(blurShader_v) - glUniformInt(uniformScreenY, math.ceil(vsy*0.8) ) --can use these numbers to adjust thickness - end - - glDepthTest(GL.GEQUAL) - glActiveFBO(fbo,MyDrawVisibleUnits) - glDepthTest(false) - - glTexture(offscreentex) - glRenderToTexture(outlinemasktex, maskGen) - glRenderToTexture(blurtex, blur_h) - glTexture(blurtex) - glRenderToTexture(offscreentex, blur_v) - - glBlending(false) -end - -function widget:DrawScreenEffects() - if Spring.IsGUIHidden() then - return - end - glBlending(true) - - glColor(1,1,1,gAlpha) - - glCallList(enter2d) - glTexture(0, offscreentex) - glTexture(1, outlinemasktex) - glUseShader(maskApplyShader) - glTexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) --this line breaks mearth labels - glCallList(leave2d) - glBlending(false) -end - - -local function ShowSelectionSquares(state) - local alpha = state and 1 or 0 - local f = io.open('cmdcolors.tmp', 'w+') - if (f) then - f:write('unitBox 0 1 0 ' .. alpha) - f:close() - Spring.SendCommands({'cmdcolors cmdcolors.tmp'}) - end - os.remove('cmdcolors.tmp') -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- ---call ins - -function widget:Initialize() - showAlly = options.showally.value - - if (not gl.CreateShader)or(not gl.CreateFBO) then - Spring.Echo("Halo widget: your card is unsupported!") - widgetHandler:RemoveWidget() - return - end - - vsx, vsy = widgetHandler:GetViewSizes() - - maskGenShader = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - - void main(void) { - vec4 color = texture2D(tex0, gl_TexCoord[0].st); - gl_FragColor = vec4(1.0 - ((color.r + color.g + color.b) * 255.0)); - } - ]], - uniformInt = { - tex0 = 0, - }, - }) - - if (maskGenShader == nil) then - Spring.Log(widget:GetInfo().name, LOG.ERROR, "Halo selection widget: mask generation shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - - blurShader_h = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - uniform int screenX; - - const vec2 kernel = vec2(0.6,0.7); - - void main(void) { - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int i; - int n = 1; - float pixelsize = 1.0/float(screenX); - for(i = 1; i < 3; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); - --n; - } - - gl_FragColor += texture2D(tex0, texCoord ); - - n = 0; - for(i = -2; i < 0; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + i*pixelsize,texCoord.t) ); - ++n; - } - } - ]], - uniformInt = { - tex0 = 0, - screenX = math.ceil(vsx*0.5), - }, - }) - - - if (blurShader_h == nil) then - Spring.Log(widget:GetInfo().name, LOG.ERROR, "Halo selection widget: hblur shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - - blurShader_v = gl.CreateShader({ - fragment = [[ uniform sampler2D tex0; - uniform int screenY; - - const vec2 kernel = vec2(0.6,0.7); - - void main(void) { - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int i; - int n = 1; - float pixelsize = 1.0/float(screenY); - for(i = 0; i < 2; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); - --n; - } - - gl_FragColor += texture2D(tex0, texCoord ); - - n = 0; - for(i = -2; i < 0; ++i){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + i*pixelsize) ); - ++n; - } - } - ]], - uniformInt = { - tex0 = 0, - screenY = math.ceil(vsy*0.5), - }, - }) - - if (blurShader_v == nil) then - Spring.Log(widget:GetInfo().name, LOG.ERROR, "Halo selection widget: vblur shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - - maskApplyShader = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - uniform sampler2D tex1; - - void main(void) { - gl_FragColor = texture2D(tex0, gl_TexCoord[0].st) * texture2D(tex1, gl_TexCoord[0].st); - } - ]], - uniformInt = { - tex0 = 0, - tex1 = 1, - }, - }) - - if (maskApplyShader == nil) then - Spring.Log(widget:GetInfo().name, LOG.ERROR, "Halo selection widget: mask application shader error: "..gl.GetShaderLog()) - widgetHandler:RemoveWidget() - return false - end - - uniformScreenX = gl.GetUniformLocation(blurShader_h, 'screenX') - uniformScreenY = gl.GetUniformLocation(blurShader_v, 'screenY') - - fbo = gl.CreateFBO() - - self:ViewResize(vsx,vsy) - - enter2d = gl.CreateList(function() - glUseShader(0) - glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity() - glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity() - end) - leave2d = gl.CreateList(function() - glMatrixMode(GL_PROJECTION); glPopMatrix() - glMatrixMode(GL_MODELVIEW); glPopMatrix() - glTexture(0, false) - glTexture(1, false) - glUseShader(0) - end) - - - ShowSelectionSquares(false) -end --init - -function widget:ViewResize(viewSizeX, viewSizeY) - vsx = viewSizeX - vsy = viewSizeY - - fbo.color0 = nil - - gl.DeleteTexture(depthtex or 0) - gl.DeleteTextureFBO(offscreentex or 0) - gl.DeleteTextureFBO(blurtex or 0) - gl.DeleteTextureFBO(outlinemasktex or 0) - - depthtex = gl.CreateTexture(vsx,vsy, { - border = false, - format = GL_DEPTH_COMPONENT24, - min_filter = GL.NEAREST, - mag_filter = GL.NEAREST, - }) - - offscreentex = gl.CreateTexture(vsx,vsy, { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - outlinemasktex = gl.CreateTexture(vsx,vsy, { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - blurtex = gl.CreateTexture(math.floor(vsx*0.5),math.floor(vsy*0.5), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - fbo.depth = depthtex - fbo.color0 = offscreentex - fbo.drawbuffers = GL_COLOR_ATTACHMENT0_EXT - - resChanged = true -end - - -function widget:Shutdown() - gl.DeleteTexture(depthtex) - if (gl.DeleteTextureFBO) then - gl.DeleteTextureFBO(offscreentex) - gl.DeleteTextureFBO(blurtex) - gl.DeleteTextureFBO(outlinemasktex) - end - - if (gl.DeleteFBO) then - gl.DeleteFBO(fbo or 0) - end - - if (gl.DeleteShader) then - gl.DeleteShader(maskGenShader or 0) - gl.DeleteShader(blurShader_h or 0) - gl.DeleteShader(blurShader_v or 0) - gl.DeleteShader(maskApplyShader or 0) - end - - gl.DeleteList(enter2d) - gl.DeleteList(leave2d) - - ShowSelectionSquares(true) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - diff --git a/LuaUI/Widgets_Evo/unit_setUnitHoldFire.lua b/LuaUI/Widgets_Evo/unit_setUnitHoldFire.lua new file mode 100644 index 000000000..73101ef22 --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_setUnitHoldFire.lua @@ -0,0 +1,81 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +function widget:GetInfo() + return { + name = "Set Unit to Hold Fire", + desc = "Sets certain units to Hold Fire automagically", + author = "[teh]decay", + date = "29 sept 2013", + license = "GNU GPL, v2 or later", + version = 1, + layer = 5, + enabled = true -- loaded by default? + } +end + +------------------------------- + +local spGiveOrderToUnit = Spring.GiveOrderToUnit +local spGetMyTeamId = Spring.GetMyTeamID +local spGetTeamUnits = Spring.GetTeamUnits +local spGetUnitDefID = Spring.GetUnitDefID +-------------------------------------------------------------------------------- + + +function widget:Update() + +end + +function widget:UnitCreated(unitID, unitDefID, teamID, builderID) + if(teamID == spGetMyTeamId()) then + switchUnitToHoldFire(unitID, unitDefID) + end +end + +function widget:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + if(newTeam == spGetMyTeamId()) then + switchUnitToHoldFire(unitID, unitDefID) + end +end + + +function widget:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + if(unitTeam == spGetMyTeamId()) then + switchUnitToHoldFire(unitID, unitDefID) + end +end + + +function switchUnitToHoldFire(unitID, unitDefID) + if (unitDefID == UnitDefNames["ecommandermeteor"].id) then + spGiveOrderToUnit(unitID, CMD.FIRE_STATE, { 0 }, {}) + end +end + +function widget:PlayerChanged(playerID) + local _, _, spec = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if spec then + widgetHandler:RemoveWidget() + return false + end +end + + +function widget:Initialize() + local _, _, spec, teamId = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) + if spec then + widgetHandler:RemoveWidget() + return false + end + + for _, unitID in ipairs(spGetTeamUnits(teamId)) do -- init existing labs + switchUnitToHoldFire(unitID, spGetUnitDefID(unitID)) + end + + return true +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + diff --git a/LuaUI/Widgets_Evo/unit_showbuilderqueue.lua b/LuaUI/Widgets_Evo/unit_showbuilderqueue.lua new file mode 100644 index 000000000..676da6926 --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_showbuilderqueue.lua @@ -0,0 +1,216 @@ +function widget:GetInfo() + return { + name = "Show Builder Queue", -- old name: Show Build + desc = "Shows buildings about to be built", + author = "WarXperiment", + date = "February 15, 2010", + license = "GNU GPL, v2 or later", + version = "5", + layer = 55, + enabled = false, -- loaded by default? + } +end + +local showForCreatedUnits = false -- keep drawing unitshape for building when it has a nanoframe but isnt finished + +--Changelog +-- before v2 developed outside of BA by WarXperiment +-- v2 [teh]decay - fixed crash: Error in DrawWorld(): [string "LuaUI/Widgets/unit_showbuild.lua"]:82: bad argument #1 to 'GetTeamColor' (number expected, got no value) +-- v3 [teh]decay - updated for spring 98 engine -- project page on github: https://github.com/jamerlan/unit_showbuild +-- v4 Floris - lots of performance increases +-- v5 Floris - cleanup, polishing and fixes + +local command = {} +local commandOrdered = {} +local commandCreatedUnits = {} +local commandCreatedUnitsIDs = {} +local builders = {} +local myPlayerID = Spring.GetMyPlayerID() +local maxDisplayed = 150 + +local builderUnitDefs = {} +for udefID,def in ipairs(UnitDefs) do + if def.isBuilder and not def.isFactory and def.buildOptions[1] then + local buildOptions = {} + for _,unit in ipairs(def.buildOptions) do + buildOptions[unit] = true + end + builderUnitDefs[udefID] = buildOptions + end +end + +function updateBuilders() + for unitID, _ in pairs(builders) do + checkBuilder(unitID) + end +end + +function addBuilders() + command = {} + local allUnits = Spring.GetAllUnits() + for _, unitID in ipairs(allUnits) do + local uDefID = Spring.GetUnitDefID(unitID) + if builderUnitDefs[uDefID] then + builders[unitID] = true + checkBuilder(unitID) + end + end +end + +function widget:Initialize() + if Spring.GetGameFrame() > 0 then + addBuilders() + end +end + +function widget:PlayerChanged(playerID) + if playerID == myPlayerID and Spring.GetGameFrame() > 0 and Spring.GetSpectatingState() then + addBuilders() + updateBuilders() + end +end + +function clearBuilderCommands(unitID) + if commandOrdered[unitID] then + for id, _ in pairs(commandOrdered[unitID]) do + if command[id] and command[id][unitID] then + command[id][unitID] = nil + command[id].builders = command[id].builders - 1 + if command[id].builders == 0 then + command[id] = nil + end + end + end + commandOrdered[unitID] = nil + end +end + +local gameFrame = Spring.GetGameFrame() +function widget:GameFrame(gf) + gameFrame = gf +end + +local newUnitCommands = {} +function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, _, _) + if builderUnitDefs[unitDefID] then + newUnitCommands[unitID] = os.clock() + 0.05 + end +end + +local sec = 0 +local lastUpdate = 0 +function widget:Update(dt) + sec = sec + dt + if sec > lastUpdate + 0.1 then + lastUpdate = sec + + -- process newly given commands (not done in widgetUnitCommand() because with huge build queue it eats memory and can crash lua) + local clock = os.clock() + for unitID, cmdClock in pairs(newUnitCommands) do + if clock > cmdClock then + checkBuilder(unitID) + newUnitCommands[unitID] = nil + end + end + end +end + +function checkBuilder(unitID) + clearBuilderCommands(unitID) + local queue = Spring.GetCommandQueue(unitID, 200) + if(queue and #queue > 0) then + for _, cmd in ipairs(queue) do + if ( cmd.id < 0 ) then + local myCmd = { + id = math.abs(cmd.id), + teamid = Spring.GetUnitTeam(unitID), + params = cmd.params + } + local y = cmd.params[2] + if UnitDefs[math.abs(cmd.id)].minWaterDepth < 0 then -- AI bots queue very high y pos so this corrects that + y = Spring.GetGroundHeight(cmd.params[1],cmd.params[3]) + else + y = - UnitDefs[math.abs(cmd.id)].waterline + end + myCmd.params[2] = y + local id = Spring.GetUnitTeam(unitID)..'_'..math.abs(cmd.id)..'_'..cmd.params[1]..'_'..myCmd.params[2]..'_'..cmd.params[3] + if showForCreatedUnits or commandCreatedUnits[id] == nil then + if command[id] == nil then + command[id] = {id = myCmd, builders = 0} + end + command[id][unitID] = true + command[id].builders = command[id].builders + 1 + if commandOrdered[unitID] == nil then + commandOrdered[unitID] = {} + end + commandOrdered[unitID][id] = true + end + end + end + end +end + +function widget:UnitFinished(unitID, unitDefID, unitTeam) + if commandCreatedUnitsIDs[unitID] then + commandCreatedUnits[commandCreatedUnitsIDs[unitID]] = nil + commandCreatedUnitsIDs[unitID] = nil + end +end + +function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID) + local x,y,z = Spring.GetUnitPosition(unitID) + if UnitDefs[unitDefID].minWaterDepth < 0 then + y = Spring.GetGroundHeight(x,z) + else + y = - UnitDefs[unitDefID].waterline + end + if command[unitTeam..'_'..unitDefID..'_'..x..'_'..y..'_'..z] then + command[unitTeam..'_'..unitDefID..'_'..x..'_'..y..'_'..z] = nil + commandCreatedUnitsIDs[unitID] = unitTeam..'_'..unitDefID..'_'..x..'_'..y..'_'..z + commandCreatedUnits[unitTeam..'_'..unitDefID..'_'..x..'_'..y..'_'..z] = true + end + if builderUnitDefs[unitDefID] then + builders[unitID] = true + end +end + +function widget:UnitDestroyed(unitID, unitDefID, unitTeam, builderID) + if builders[unitID] then + builders[unitID] = nil + newUnitCommands[unitID] = nil + clearBuilderCommands(unitID) + end + if commandCreatedUnitsIDs[unitID] then + commandCreatedUnits[commandCreatedUnitsIDs[unitID]] = nil + end +end + + +function widget:DrawWorld() + if Spring.IsGUIHidden() then return end + + gl.DepthTest(true) + local commandVisible = 0 + for _, units in pairs(command) do + local myCmd = units.id + local params = myCmd.params + + local x, y, z = params[1], params[2], params[3] + local degrees = params[4] ~= nil and params[4] * 90 or 0 -- mex command doesnt supply param 4 + if Spring.IsAABBInView(x-1,y-1,z-1,x+1,y+1,z+1) then + gl.PushMatrix() + gl.LoadIdentity() + gl.Translate( x, y, z ) + gl.Rotate( degrees, 0, 1.0, 0 ) + gl.UnitShape(myCmd.id, myCmd.teamid, false, false, false) + gl.PopMatrix() + commandVisible = commandVisible + 1 + if commandVisible > maxDisplayed then + break + end + end + end + gl.DepthTest(false) + gl.Color(1, 1, 1, 1) +end + diff --git a/LuaUI/Widgets_Evo/unit_smart_select.lua b/LuaUI/Widgets_Evo/unit_smart_select.lua index 9da4d6fab..420832f16 100644 --- a/LuaUI/Widgets_Evo/unit_smart_select.lua +++ b/LuaUI/Widgets_Evo/unit_smart_select.lua @@ -2,7 +2,7 @@ -------------------------------------------------------------------------------- -- -- file: unit_smart_select.lua --- version: 1.3 +-- version: 1.36 -- brief: Selects units as you drag over them and provides selection modifier hotkeys -- original author: Ryan Hileman (aegis) -- @@ -15,11 +15,11 @@ function widget:GetInfo() return { name = "SmartSelect", - desc = "Selects units as you drag over them and provides selection modifier hotkeys", + desc = "Selects units as you drag over them. (SHIFT: select all, Z: same type, SPACE: new idle units, CTRL: invert selection) /selectionmode toggles filtering buildings in selection", author = "aegis", date = "Jan 2, 2011", license = "Public Domain", - layer = 0, + layer = -99999999999, enabled = true } end @@ -30,15 +30,20 @@ end -- whether to select buildings when mobile units are inside selection rectangle local selectBuildingsWithMobile = false +local includeNanosAsMobile = true + +local includeBuilders = true -- only select new units identical to those already selected local sameSelectKey = 'z' +-- only select new idle units +local idleSelectKey = 'space' + ----------------------------------------------------------------- -- manually generated locals because I don't have trepan's script ----------------------------------------------------------------- local GetTimer = Spring.GetTimer -local DiffTimers = Spring.DiffTimers local GetMouseState = Spring.GetMouseState local GetModKeyState = Spring.GetModKeyState local GetKeyState = Spring.GetKeyState @@ -55,14 +60,15 @@ local GetSelectedUnits = Spring.GetSelectedUnits local GetUnitsInRectangle = Spring.GetUnitsInRectangle local SelectUnitArray = Spring.SelectUnitArray local GetActiveCommand = Spring.GetActiveCommand +local GetUnitTeam = Spring.GetUnitTeam local GetGroundHeight = Spring.GetGroundHeight local GetMiniMapGeometry = Spring.GetMiniMapGeometry -local GetMiniMapDualScreen = Spring.GetMiniMapDualScreen local IsAboveMiniMap = Spring.IsAboveMiniMap local GetUnitDefID = Spring.GetUnitDefID local GetUnitPosition = Spring.GetUnitPosition +local GetCommandQueue = Spring.GetCommandQueue local UnitDefs = UnitDefs local min = math.min @@ -74,11 +80,15 @@ local glLineWidth = gl.LineWidth local glDepthTest = gl.DepthTest local glBeginEnd = gl.BeginEnd local GL_LINE_STRIP = GL.LINE_STRIP + +local GaiaTeamID = Spring.GetGaiaTeamID() + ----------------------------------------------------------------- -- end function locals ------------------------------------------ ----------------------------------------------------------------- sameSelectKey = Spring.GetKeyCode(sameSelectKey) +idleSelectKey = Spring.GetKeyCode(idleSelectKey) local minimapOnLeft = (Spring.GetMiniMapDualScreen() == "left") local combatFilter, builderFilter, buildingFilter, mobileFilter @@ -92,9 +102,8 @@ local minimapRect local lastCoords local lastMeta +local filtered -local lastUpdate = GetTimer() -local spectating = false local myPlayerID local function sort(v1, v2) @@ -105,14 +114,6 @@ local function sort(v1, v2) end end -local function GetUnitsInArbitraryRectangle(x1, z1, x2, z2, team) - x1, x2 = sort(x1, x2) - z1, z2 = sort(z1, z2) - - local units = GetUnitsInRectangle(x1, z1, x2, z2, team) - return units -end - local mapWidth, mapHeight = Game.mapSizeX, Game.mapSizeZ local function MinimapToWorldCoords(x, y) @@ -161,17 +162,38 @@ local function GetUnitsInScreenRectangle(x1, y1, x2, y2, team) return result end + +local selectedUnits = Spring.GetSelectedUnits() +function widget:SelectionChanged(sel) + local equalSelection = true + for k,v in pairs(sel) do + if selectedUnits[k] ~= v then + equalSelection = false + break + end + end + selectedUnits = sel + if (referenceCoords ~= nil and GetActiveCommand() == 0) then + if not select(3,GetMouseState()) and referenceSelection ~= nil and lastSelection ~= nil and equalSelection then + WG['smartselect'].updateSelection = false -- widgethandler uses this to ignore the engine mouserelease selection + end + end +end + function widget:MousePress(x, y, button) if (button == 1) then - referenceSelection = GetSelectedUnits() + referenceSelection = selectedUnits referenceSelectionTypes = {} for i=1, #referenceSelection do udid = GetUnitDefID(referenceSelection[i]) - referenceSelectionTypes[udid] = 1 + if udid then + referenceSelectionTypes[udid] = 1 + end end referenceScreenCoords = {x, y} lastMeta = nil lastSelection = nil + filtered = false if (IsAboveMiniMap(x, y)) then referenceCoords = {0, 0, 0} @@ -185,20 +207,50 @@ function widget:MousePress(x, y, button) end end -function widget:Update() - --[[ - local newUpdate = GetTimer() - if (DiffTimers(newUpdate, lastUpdate) < 0.1) then - return +function widget:TextCommand(command) + if (string.find(command, "selectionmode") == 1 and string.len(command) == 13) then + selectBuildingsWithMobile = not selectBuildingsWithMobile + if selectBuildingsWithMobile then + Spring.Echo("SmartSelect: Selects whatever comes under selection rectangle.") + else + Spring.Echo("SmartSelect: Ignores buildings if it can select mobile units.") + end end - lastUpdate = newUpdate - --]] + if (string.find(command, "selectionnanos") == 1 and string.len(command) == 14) then + includeNanosAsMobile = not includeNanosAsMobile + init() + if includeNanosAsMobile then + Spring.Echo("SmartSelect: Treats nanos like mobile units and wont exclude them") + else + Spring.Echo("SmartSelect: Stops treating nanos as if they are mobile units") + end + end +end + +function widget:GetConfigData(data) + savedTable = {} + savedTable.selectBuildingsWithMobile = selectBuildingsWithMobile + savedTable.includeNanosAsMobile = includeNanosAsMobile + savedTable.includeBuilders = includeBuilders + return savedTable +end + +function widget:SetConfigData(data) + if data.selectBuildingsWithMobile ~= nil then selectBuildingsWithMobile = data.selectBuildingsWithMobile end + if data.includeNanosAsMobile ~= nil then includeNanosAsMobile = data.includeNanosAsMobile end + if data.includeBuilders ~= nil then includeBuilders = data.includeBuilders end +end + +function widget:Update() + WG['smartselect'].updateSelection = true if (referenceCoords ~= nil and GetActiveCommand() == 0) then - x, y, pressed = GetMouseState() + local x, y, pressed = GetMouseState() + local px, py, sx, sy = GetMiniMapGeometry() - - if (pressed) and (referenceSelection ~= nil) then + + if (pressed or lastSelection) and (referenceSelection ~= nil) then + local alt, ctrl, meta, shift = GetModKeyState() if (#referenceSelection == 0) then -- no point in inverting an empty selection @@ -206,7 +258,8 @@ function widget:Update() end local sameSelect = GetKeyState(sameSelectKey) - + local idleSelect = GetKeyState(idleSelectKey) + local sameLast = (referenceScreenCoords ~= nil) and (x == referenceScreenCoords[1] and y == referenceScreenCoords[2]) if (sameLast and lastCoords == referenceCoords) then return @@ -221,20 +274,48 @@ function widget:Update() local mouseSelection, originalMouseSelection local r = referenceScreenCoords - local playing = GetPlayerInfo(myPlayerID).spectating == false + local playing = GetPlayerInfo(myPlayerID,false).spectating == false local team = (playing and GetMyTeamID()) if (r ~= nil and IsAboveMiniMap(r[1], r[2])) then local mx, my = max(px, min(px+sx, x)), max(py, min(py+sy, y)) - mouseSelection = GetUnitsInMinimapRectangle(r[1], r[2], x, y, team) + mouseSelection = GetUnitsInMinimapRectangle(r[1], r[2], x, y, nil) else local d = referenceCoords local x1, y1 = WorldToScreenCoords(d[1], d[2], d[3]) - mouseSelection = GetUnitsInScreenRectangle(x, y, x1, y1, team) + mouseSelection = GetUnitsInScreenRectangle(x, y, x1, y1, nil) + end + originalMouseSelection = mouseSelection + + + -- filter gaia units + local filteredselection = {} + local filteredselectionCount = 0 + if not Spring.IsGodModeEnabled() then + for i=1, #mouseSelection do + if GetUnitTeam(mouseSelection[i]) ~= GaiaTeamID then + filteredselectionCount = filteredselectionCount + 1 + filteredselection[filteredselectionCount] = mouseSelection[i] + end + end + mouseSelection = filteredselection end - + filteredselection = nil + local newSelection = {} local uid, udid, udef, tmp + if (idleSelect) then + tmp = {} + for i=1, #mouseSelection do + uid = mouseSelection[i] + udid = GetUnitDefID(uid) + if (mobileFilter[udid] or builderFilter[udid]) and (GetCommandQueue(uid, 0) == 0) then + tmp[#tmp+1] = uid + end + end + mouseSelection = tmp + end + if (sameSelect) and (#referenceSelection > 0) then -- only select new units identical to those already selected tmp = {} @@ -248,6 +329,7 @@ function widget:Update() mouseSelection = tmp end + if (alt) then -- only select mobile combat units @@ -286,13 +368,21 @@ function widget:Update() if (mobiles) then tmp = {} + local tmp2 = {} for i=1, #mouseSelection do uid = mouseSelection[i] udid = GetUnitDefID(uid) if (buildingFilter[udid] == false) then - tmp[#tmp+1] = uid + if (includeBuilders or not builderFilter[udid]) then + tmp[#tmp+1] = uid + else + tmp2[#tmp2+1] = uid + end end end + if #tmp == 0 then + tmp = tmp2 + end mouseSelection = tmp end end @@ -301,6 +391,7 @@ function widget:Update() newSelection = referenceSelection end + if (ctrl) then -- deselect units inside the selection rectangle, if we already had units selected local negative = {} @@ -320,53 +411,56 @@ function widget:Update() newSelection = tmp SelectUnitArray(newSelection) elseif (shift) then - --Spring.Echo('shift') -- append units inside selection rectangle to current selection SelectUnitArray(newSelection) SelectUnitArray(mouseSelection, true) elseif (#mouseSelection > 0) then -- select units inside selection rectangle SelectUnitArray(mouseSelection) - elseif (alt == false) then + elseif (#originalMouseSelection > 0) and (#mouseSelection == 0) then + SelectUnitArray({}) + else -- keep current selection while dragging until more things are selected SelectUnitArray(referenceSelection) lastSelection = nil return end - lastSelection = GetSelectedUnits() - elseif (lastSelection ~= nil) then - SelectUnitArray(lastSelection) - lastSelection = nil - referenceSelection = nil - referenceSelectionTypes = nil - referenceCoords = nil - minimapRect = nil + if pressed then + lastSelection = true --selectedUnits + else + lastSelection = nil + referenceSelection = nil + referenceSelectionTypes = nil + referenceCoords = nil + minimapRect = nil + end else referenceSelection = nil referenceSelectionTypes = nil referenceCoords = nil minimapRect = nil end + end end -function widget:Initialize() +function init() myPlayerID = GetMyPlayerID() combatFilter = {} builderFilter = {} buildingFilter = {} mobileFilter = {} - + for udid, udef in pairs(UnitDefs) do - local mobile = (udef.canMove and udef.speed > 0.000001) + local mobile = (udef.canMove and udef.speed > 0.000001) or (includeNanosAsMobile and (UnitDefs[udid].name == "armnanotc" or UnitDefs[udid].name == "cornanotc")) local builder = (udef.canReclaim and udef.reclaimSpeed > 0) or - (udef.isBuilder and udef.buildSpeed > 0) or + --(udef.builder and udef.buildSpeed > 0) or -- udef.builder = deprecated it seems (udef.canResurrect and udef.resurrectSpeed > 0) or (udef.canRepair and udef.repairSpeed > 0) local building = (mobile == false) local combat = (builder == false) and (mobile == true) and (#udef.weapons > 0) - + combatFilter[udid] = combat builderFilter[udid] = builder buildingFilter[udid] = building @@ -374,6 +468,29 @@ function widget:Initialize() end end +function widget:Shutdown() + WG['smartselect'] = nil +end + +function widget:Initialize() + + WG['smartselect'] = {} + WG['smartselect'].getIncludeBuildings = function() + return selectBuildingsWithMobile + end + WG['smartselect'].setIncludeBuildings = function(value) + selectBuildingsWithMobile = value + end + WG['smartselect'].getIncludeBuilders = function() + return includeBuilders + end + WG['smartselect'].setIncludeBuilders = function(value) + includeBuilders = value + end + WG['smartselect'].updateSelection = false + init() +end + local function DrawRectangle(r) local x1, y1, x2, y2 = r[1], r[2], r[3], r[4] glVertex(r[1], 0, r[2]) @@ -383,12 +500,13 @@ local function DrawRectangle(r) glVertex(r[1], 0, r[2]) end -function widget:DrawWorld() - if (minimapRect ~= nil) then - glColor(1, 1, 1, 1) - glLineWidth(1.0) - glDepthTest(false) - glBeginEnd(GL_LINE_STRIP, DrawRectangle, minimapRect) - end -end + +--function widget:DrawWorld() +-- if (minimapRect ~= nil) then +-- glColor(1, 1, 1, 1) +-- glLineWidth(1.0) +-- glDepthTest(false) +-- glBeginEnd(GL_LINE_STRIP, DrawRectangle, minimapRect) -- drawing coordinates display incorrect +-- end +--end diff --git a/LuaUI/Widgets_Evo/unit_stockpile.lua b/LuaUI/Widgets_Evo/unit_stockpile.lua deleted file mode 100644 index c7f65f119..000000000 --- a/LuaUI/Widgets_Evo/unit_stockpile.lua +++ /dev/null @@ -1,42 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: unit_stockpile.lua --- brief: adds 100 builds to all new units that can stockpile --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widget:GetInfo() - return { - name = "Stockpiler", - desc = "Automatically adds 100 stockpile builds to new units", - author = "trepan", - date = "Jan 8, 2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true -- loaded by default? - } -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - - -function widget:UnitCreated(unitID, unitDefID, unitTeam) - local ud = UnitDefs[unitDefID] - if ((ud ~= nil) and (unitTeam == Spring.GetMyTeamID())) then - if (ud.canStockpile) then - -- give stockpilers 100 units to build - Spring.GiveOrderToUnit(unitID, CMD.STOCKPILE, {}, { "shift" }) - end - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/unit_stockpile_EvoRTS.lua b/LuaUI/Widgets_Evo/unit_stockpile_EvoRTS.lua new file mode 100644 index 000000000..5a4ee98ae --- /dev/null +++ b/LuaUI/Widgets_Evo/unit_stockpile_EvoRTS.lua @@ -0,0 +1,45 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: unit_stockpile.lua +-- brief: adds 100 builds to all new units that can stockpile +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widget:GetInfo() + return { + name = "Stockpiler (Evolution RTS)", + desc = "Automatically adds stockpile builds to new units", + author = "trepan", + date = "Jan 8, 2007", + license = "GNU GPL, v2 or later", + layer = 0, + enabled = true -- loaded by default? + } +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + + +function widget:UnitCreated(unitID, unitDefID, unitTeam) + local ud = UnitDefs[unitDefID] + if ((ud ~= nil) and (unitTeam == Spring.GetMyTeamID())) then + if (ud.name == "esilo" or ud.name == "eshieldgen") then + -- give stockpilers 5 units to build + Spring.GiveOrderToUnit(unitID, CMD.STOCKPILE, {}, { "shift" }) + elseif (ud.name == "ecruisesilo") then + -- give stockpilers 5 units to build + Spring.GiveOrderToUnit(unitID, CMD.STOCKPILE, {}, { "ctrl" }) + end + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/LuaUI/Widgets_Evo/unit_transport_ai.lua b/LuaUI/Widgets_Evo/unit_transport_ai.lua deleted file mode 100644 index 75d388d78..000000000 --- a/LuaUI/Widgets_Evo/unit_transport_ai.lua +++ /dev/null @@ -1,641 +0,0 @@ --- $Id: unit_transport_ai.lua 4460 2009-04-20 20:36:16Z licho $ -include("keysym.h.lua") - -function widget:GetInfo() - return { - name = "Transport AI", - desc = "Automatically transports units going to factory waypoint.\n" .. - "Adds embark=call for transport and disembark=unload from transport command", - author = "Licho", - date = "1.11.2007", - license = "GNU GPL, v2 or later", - layer = 0, - enabled = true - } -end - - -local CONST_IGNORE_BUILDERS = false -- should automated factory transport ignore builders? -local CONST_HEIGHT_MULTIPLIER = 3 -- how many times to multiply height difference when evaluating distance -local CONST_TRANSPORT_PICKUPTIME = 9 -- how long (in seconds) does transport land and takeoff with unit -local CONST_PRIORITY_BENEFIT = 10000 -- how much more important are priority transfers -local CONST_BENEFIT_LIMIT = 5 -- what is the lowest benefit treshold to use transport (in sec difference with transport against without it) -local CONST_TRANSPORT_STOPDISTANCE = 150 -- how close by has transport be to stop the unit -local CONST_UNLOAD_RADIUS = 200 -- how big is the radious for unload command for factory transports - -local idleTransports = {} -- list of idle transports key = id, value = {defid} -local waitingUnits = {} -- list of units waiting for traqnsport - key = unitID, {unit state, unitDef, factory} -local priorityUnits = {} -- lists of priority units waiting for key= unitId, value = state -local toPick = {} -- list of units waiting to be picked - key = transportID, value = {id, stoppedState} -local toPickRev = {} -- list of units waiting to be picked - key = unitID, value=transportID -local storedQueue = {} -- unit keyed stored queues -local hackIdle ={} -- temp field to overcome unitIdle problem - - -local ST_ROUTE = 1 -- unit is enroute from factory -local ST_PRIORITY = 2 -- unit is in need of priority transport -local ST_STOPPED = 3 -- unit is enroute from factory but stopped - - -local timer = 0 -local myTeamID - - -local GetUnitPosition = Spring.GetUnitPosition -local GetUnitDefID = Spring.GetUnitDefID -local Echo = Spring.Echo -local GetPlayerInfo = Spring.GetPlayerInfo -local GetCommandQueue = Spring.GetCommandQueue -local GetUnitSeparation = Spring.GetUnitSeparation -local GiveOrderToUnit = Spring.GiveOrderToUnit -local GetUnitDefDimensions = Spring.GetUnitDefDimensions -local GetTeamUnits = Spring.GetTeamUnits -local GetSelectedUnits = Spring.GetSelectedUnits -local GetUnitIsTransporting = Spring.GetUnitIsTransporting -local GetGroundHeight = Spring.GetGroundHeight - -local function IgBuilderChanged() - CONST_IGNORE_BUILDERS = options.ignoreBuilders.value -end - -options_path = 'Game/Settings' -options = { - ignoreBuilders = { - name = "Transport AI: Ignore Builders", - type = "bool", - value = false, - desc = "Do not pick up builders.", - OnChange = IgBuilderChanged, - }, -} - -function IsTransport(unitDefID) - ud = UnitDefs[unitDefID] - return (ud ~= nil and (ud.transportCapacity >= 1) and ud.canFly) -end - -function IsTransportable(unitDefID) - ud = UnitDefs[unitDefID] - if (ud == nil) then return false end - udc = ud.springCategories - return (udc~= nil and ud.speed > 0 and not ud.canFly) -end - - -function IsEmbarkCommand(unitID) - local queue = GetCommandQueue(unitID); - if (queue ~= nil and #queue>=1 and IsEmbark(queue[1])) then - return true - end - return false -end - -function IsEmbark(cmd) - if (cmd.id == CMD.WAIT and cmd.options.alt and not cmd.options.ctrl) then - return true - end - return false -end - -function IsDisembark(cmd) - if (cmd.id == CMD.WAIT and cmd.options.alt and cmd.options.ctrl) then - return true - end - return false -end - -function IsWaitCommand(unitID) - local queue = GetCommandQueue(unitID); - if (queue ~= nil and queue[1].id == CMD.WAIT and not queue[1].options.alt) then - return true - end - return false -end - -function IsIdle(unitID) - local queue = GetCommandQueue(unitID) - if (queue == nil or #queue==0) then - return true - else - return false - end -end - -function GetToPickTransport(unitID) - local x = toPickRev[unitID] - if x~= nil then - return x - else - return 0 - end -end - -function GetToPickUnit(transportID) - local x = toPick[transportID] - if (x~=nil) then - if x[1] ~= nil then - return x[1] - else - return 0 - end - end - return 0 -end - -function DeleteToPickTran(transportID) - local tr = toPick[transportID] - if (tr ~= nil) then - local uid = tr[1] - if (uid ~= nil) then - toPickRev[uid]=nil - end - end - toPick[transportID] = nil -end - -function DeleteToPickUnit(unitID) - local tr = toPickRev[unitID] - if (tr~=nil) then - toPick[tr] = nil - end - toPickRev[unitID] = nil -end - -function AddToPick(transportID, unitID, stopped, fact) - toPick[transportID] = {unitID, stopped, fact} - toPickRev[unitID] = transportID -end - - - -function widget:Initialize() - local _, _, spec, teamID = GetPlayerInfo(Spring.GetMyPlayerID()) - if spec then - widgetHandler:RemoveWidget() - return false - end - myTeamID = teamID - widgetHandler:RegisterGlobal('taiEmbark', taiEmbark) - - - for _, unitID in ipairs(GetTeamUnits(teamID)) do -- init existing transports - if AddTransport(unitID, GetUnitDefID(unitID)) then - AssignTransports(unitID, 0) - end - end -end - -function widget:Shutdown() - widgetHandler:DeregisterGlobal('taiEmbark') -end - - -function widget:UnitTaken(unitID, unitDefID, oldTeamID, teamID) - if teamID == myTeamID then - if AddTransport(unitID, unitDefID) then - AssignTransports(unitID, 0) - end - end -end - ---[[function widget:UnitCreated(unitID, unitDefID, teamID) - if teamID == myTeamID then - if AddTransport(unitID, unitDefID) then - AssignTransports(unitID, 0) - end - end -end]]-- - -function widget:UnitDestroyed(unitID, unitDefID, teamID) - if teamID == myTeamID then --- Echo("unit destroyed " ..unitID) - idleTransports[unitID] = nil - priorityUnits[unitID] = nil - local tuid = GetToPickUnit(unitID) - if (tuid ~= 0) then -- transport which was about to pick something was destroyed - local state = toPick[unitID][2] - local fact = toPick[unitID][3] - if (state == ST_PRIORITY) then - waitingUnits[tuid] = {ST_PRIORITY, GetUnitDefID(tuid)} - else - waitingUnits[tuid] = {ST_ROUTE, GetUnitDefID(tuid), fact} - if (state == ST_STOPPED) then - GiveOrderToUnit(tuid, CMD.WAIT, {}, {}) - end - end - DeleteToPickTran(unitID) - AssignTransports(0, tuid) - else -- unit which was about to be picked was destroyed - pom = GetToPickTransport(unitID) - if (pom~=0) then - DeleteToPickUnit(unitID) - GiveOrderToUnit(pom, CMD.STOP, {}, {}) - end -- delete form toPick list - end - end -end - -function widget:UnitGiven(unitID, unitDefID, newTeamID, teamID) - widget:UnitDestroyed(unitID, unitDefID, teamID) -end - - -function AddTransport(unitID, unitDefID) - if (IsTransport(unitDefID)) then -- and IsIdle(unitID) - idleTransports[unitID] = unitDefID - --Echo ("transport added " .. unitID) - return true - end - return false -end - - -function widget:UnitIdle(unitID, unitDefID, teamID) - if teamID ~= myTeamID then return end - if WG.FerryUnits and WG.FerryUnits[unitID] then return end - if (hackIdle[unitID] ~= nil) then - hackIdle[unitID] = nil - return - end - if (AddTransport(unitID, unitDefID)) then - AssignTransports(unitID, 0) - else - if (IsTransportable(unitDefID)) then - priorityUnits[unitID] = nil - - local marked = GetToPickTransport(unitID) - if (waitingUnits[unitID] ~= nil) then -- unit was waiting for transport and now its suddenly idle (stopped) - delete it --- Echo("waiting unit idle "..unitID) - waitingUnits[unitID] = nil - end - - if (marked ~= 0) then --- Echo("to pick unit idle "..unitID) - DeleteToPickTran(marked) - GiveOrderToUnit(marked, CMD.STOP, {}, {}) -- and stop it (when it becomes idle it will be assigned) - end - end - end -end - - - - -function widget:UnitFromFactory(unitID, unitDefID, unitTeam, factID, factDefID, userOrders) - if unitTeam == myTeamID then - local ud = UnitDefs[unitDefID] - if (CONST_IGNORE_BUILDERS and ud.isBuilder and ud.canAssist) then return end - if (IsTransportable(unitDefID) and not userOrders) then --- Echo ("new unit from factory "..unitID) - - for _,v in ipairs(GetCommandQueue(unitID)) do - if (IsEmbark(v)) then - priorityUnits[unitID] = unitDefID - return - end - end - - waitingUnits[unitID] = {ST_ROUTE, unitDefID, factID} - AssignTransports(0, unitID) - end - end -end - - -function widget:CommandNotify(id, params, options) - local sel = nil - if (not options.shift) then - sel = GetSelectedUnits() - for _, uid in ipairs(sel) do - widget:UnitDestroyed(uid, GetUnitDefID(uid), myTeamID) - end - end - - if (id == CMD.WAIT and options.alt) then - if (sel == nil) then sel = GetSelectedUnits() end - for _, uid in ipairs(sel) do - priorityUnits[uid] = GetUnitDefID(uid) - end - end - - return false -end - - -function widget:Update(deltaTime) - timer = timer + deltaTime - if (timer < 1) then return end - StopCloseUnits() - - local todel = {} - for i, d in pairs(priorityUnits) do --- Echo ("checking prio " ..i) - if (IsEmbarkCommand(i)) then --- Echo ("prio called " ..i) - waitingUnits[i] = {ST_PRIORITY, d} - AssignTransports(0, i) - table.insert(todel, i) - end - end - for _, x in ipairs(todel) do - priorityUnits[x] = nil - end - - timer = 0 -end - - -function StopCloseUnits() -- stops dune units which are close to transport - for transportID, val in pairs(toPick) do - local unitID = val[1] - local state = val[2] - if (state == ST_ROUTE) then - local dist = GetUnitSeparation(transportID, unitID, true) - if (dist ~= nil and dist < CONST_TRANSPORT_STOPDISTANCE) then - local canStop = true - if (val[3] ~= nil) then - local fd = GetUnitDefID(val[3]) - local ud = GetUnitDefID(unitID) - if (fd ~= nil and ud ~= nil) then - local fd = GetUnitDefDimensions(fd) - local ud = GetUnitDefDimensions(ud) - if (fd ~= nil and ud ~= nil) then - if (GetUnitSeparation(unitID, val[3], true) < fd.radius + ud.radius) then --- Echo ("Cant stop - too close to factory") - canStop = false - end - end - end - end - if canStop then - if not IsWaitCommand(unitID) then GiveOrderToUnit(unitID, CMD.WAIT, {},{}) end - toPick[transportID][2] = ST_STOPPED - end - end - end - end -end - - -function widget:UnitLoaded(unitID, unitDefID, teamID, transportID) - if (teamID ~= myTeamID or toPick[transportID]==nil) then return end - - local queue = GetCommandQueue(unitID); - if (queue == nil) then return end - --- Echo("unit loaded " .. transportID .. " " ..unitID) - local torev = {} - local vl = nil - - local ender = false - - storedQueue[unitID] = {} - DeleteToPickTran(transportID) - hackIdle[transportID] = true - local cnt = 0 - for k, v in ipairs(queue) do - if (not v.options.internal) then - if ((v.id == CMD.MOVE or (v.id==CMD.WAIT) or v.id == CMD.SET_WANTED_MAX_SPEED) and not ender) then - cnt = cnt +1 - if (v.id == CMD.MOVE) then - GiveOrderToUnit(transportID, CMD.MOVE, v.params, {"shift"}) - table.insert(torev, {v.params[1], v.params[2], v.params[3]+20}) - vl = v.params - end - if (IsDisembark(v)) then - ender = true - end - else - if (not ender) then - ender = true - end - if (v.ID ~= CMD.WAIT) then - local opts = {} - table.insert(opts, "shift") -- appending - if (v.options.alt) then table.insert(opts, "alt") end - if (v.options.ctrl) then table.insert(opts, "ctrl") end - if (v.options.right) then table.insert(opts, "right") end - table.insert(storedQueue[unitID], {v.id, v.params, opts}) - end - end - end - end - - GiveOrderToUnit(unitID, CMD.STOP, {}, {}) - - if (vl ~= nil) then - GiveOrderToUnit(transportID, CMD.UNLOAD_UNITS, {vl[1], vl[2], vl[3], CONST_UNLOAD_RADIUS}, {"shift"}) - - local i = #torev - while (i > 0) do - GiveOrderToUnit(transportID, CMD.MOVE, torev[i], {"shift"}) - i = i -1 - end - - local x,y,z = GetUnitPosition(transportID) - GiveOrderToUnit(transportID, CMD.MOVE, {x,y,z}, {"shift"}) - end - -end - - -function widget:UnitUnloaded(unitID, unitDefID, teamID, transportID) - if (teamID ~= myTeamID or storedQueue[unitID] == nil) then return end - GiveOrderToUnit(unitID, CMD.STOP, {}, {}) - for _, x in ipairs(storedQueue[unitID]) do - GiveOrderToUnit(unitID, x[1], x[2], x[3]) - end - storedQueue[unitID] = nil - local queue = GetCommandQueue(unitID) - if (queue and queue[1] and queue[1].id == CMD.WAIT) then GiveOrderToUnit(unitID, CMD.WAIT, {}, {}) end -- workaround: clears wait order if STOP fails to do so -end - - -function CanTransport(transportID, unitID) - local udef = GetUnitDefID(unitID) - local tdef = GetUnitDefID(transportID) - - if (not udef or not tdef) then return false end - if (UnitDefs[udef].xsize > UnitDefs[tdef].transportSize * 2) then -- unit size check --- Echo ("size failed") - return false - end - - local trans = GetUnitIsTransporting(transportID) -- capacity check - if (UnitDefs[tdef].transportCapacity <= #trans) then --- Echo ("count failed") - return false - end - - - local mass = 0 -- mass check - for _,a in ipairs(trans) do - mass = mass + UnitDefs[GetUnitDefID(a)].mass - end - if (mass > UnitDefs[tdef].transportMass) then --- Echo ("mass failed") - return false - end - return true -end - - -function AssignTransports(transportID, unitID) - local best = {} --- Echo ("assigning " .. transportID .. " " ..unitID) - if (transportID~=0) then - local transpeed = UnitDefs[GetUnitDefID(transportID)].speed - for id, val in pairs(waitingUnits) do - if CanTransport(transportID, id) then - local unitspeed = UnitDefs[val[2]].speed - - local ud = GetPathLength(id) - local td = GetUnitSeparation(id, transportID, true) - - local ttime = (td + ud) / transpeed + CONST_TRANSPORT_PICKUPTIME - local utime = (ud) / unitspeed - local benefit = utime-ttime - if (val[1]==ST_PRIORITY) then - benefit = benefit + CONST_PRIORITY_BENEFIT - end - -- Echo (" "..transportID .. " " .. id .. " " .. benefit) - - if (benefit > CONST_BENEFIT_LIMIT) then table.insert(best, {benefit, transportID, id}) end - end - end - elseif (unitID ~=0) then - local unitspeed = UnitDefs[GetUnitDefID(unitID)].speed - local state = waitingUnits[unitID][1] - local ud = GetPathLength(unitID) - for id, def in pairs(idleTransports) do - if CanTransport(id, unitID) then - local transpeed = UnitDefs[def].speed - local td = GetUnitSeparation(unitID, id, true) - - local ttime = (td + ud) / transpeed + CONST_TRANSPORT_PICKUPTIME - local utime = (ud) / unitspeed - local benefit = utime-ttime - if (state==ST_PRIORITY) then - benefit = benefit + CONST_PRIORITY_BENEFIT - end - --- Echo (" "..id.. " " .. unitID .. " " .. benefit) - - if (benefit > CONST_BENEFIT_LIMIT) then table.insert(best, {benefit, id, unitID}) end - end - end - end - - table.sort(best, function(a,b) return a[1]>b[1] end) - local i = 1 - local it = #best - local used = {} - while i <= it do - local tid = best[i][2] - local uid = best[i][3] - i = i +1 - if (used[tid]==nil and used[uid]==nil) then - used[tid] = 1 - used[uid] = 1 --- Echo ("ordering " .. tid .. " " .. uid ) - - if (waitingUnits[uid][1] == ST_PRIORITY) then - AddToPick(tid, uid, ST_PRIORITY) - else - AddToPick(tid, uid, ST_ROUTE, waitingUnits[uid][3]) - end - waitingUnits[uid] = nil - idleTransports[tid] = nil - GiveOrderToUnit(tid, CMD.LOAD_UNITS, {uid}, {}) - end - end -end - - - -function Dist(x,y,z, x2, y2, z2) - local xd = x2-x - local yd = y2-y - local zd = z2-z - return math.sqrt(xd*xd + yd*yd + zd*zd) -end - - -function GetPathLength(unitID) - local mini = math.huge - local maxi = -math.huge - local px,py,pz= GetUnitPosition(unitID) - - local h = GetGroundHeight(px,pz) - if (h < mini) then mini = h end - if (h > maxi) then maxi = h end - - local d = 0 - local queue = GetCommandQueue(unitID); - if (queue == nil) then return 0 end - for k, v in ipairs(queue) do - if (v.id == CMD.MOVE or v.id==CMD.WAIT) then - if (v.id == CMD.MOVE) then - d = d + Dist(px,py, pz, v.params[1], v.params[2], v.params[3]) - px = v.params[1] - py = v.params[2] - pz = v.params[3] - local h = GetGroundHeight(px,pz) - if (h < mini) then mini = h end - if (h > maxi) then maxi = h end - end - else - break - end - end - - d = d + (maxi - mini) * CONST_HEIGHT_MULTIPLIER - return d -end - - ---[[ -function widget:KeyPress(key, modifier, isRepeat) - if (key == KEYSYMS.Q and not modifier.ctrl) then - if (not modifier.alt) then - local opts = {"alt"} - if (modifier.shift) then table.insert(opts, "shift") end - - for _, id in ipairs(GetSelectedUnits()) do -- embark - local def = GetUnitDefID(id) - if (IsTransportable(def) or UnitDefs[def].isFactory) then - GiveOrderToUnit(id, CMD.WAIT, {}, opts) - if (not UnitDefs[def].isFactory) then priorityUnits[id] = def end - end - end - else - local opts = {"alt", "ctrl"} - if (modifier.shift) then table.insert(opts, "shift") end - for _, id in ipairs(GetSelectedUnits()) do --disembark - local def = GetUnitDefID(id) - if (IsTransportable(def) or UnitDefs[def].isFactory) then GiveOrderToUnit(id, CMD.WAIT, {}, opts) end - end - - end - end -end ]]-- - - - -function taiEmbark(unitID, teamID, embark, shift) -- called by gadget - if (teamID ~= myTeamID) then return end - - if (not shift) then - widget:UnitDestroyed(unitID, GetUnitDefID(unitID), myTeamID) - end - - - if (embark) then - local def = GetUnitDefID(unitID) - local ud = UnitDefs[def] - if (ud ~= nil and not ud.isFactory) then - priorityUnits[unitID] = def - end - end -end - diff --git a/LuaUI/Widgets_Evo/unit_waypoint_dragger.lua b/LuaUI/Widgets_Evo/unit_waypoint_dragger.lua deleted file mode 100644 index 10c43fd1e..000000000 --- a/LuaUI/Widgets_Evo/unit_waypoint_dragger.lua +++ /dev/null @@ -1,412 +0,0 @@ -local sprGetActiveCommand = Spring.GetActiveCommand -local sprGetDefaultCommand = Spring.GetDefaultCommand -local sprGetGameSeconds = Spring.GetGameSeconds -local sprGetSelectedUnits = Spring.GetSelectedUnits -local sprGetCommandQueue = Spring.GetCommandQueue -local sprGetUnitCommands = Spring.GetUnitCommands -local sprGetMouseState = Spring.GetMouseState -local sprGetModKeyState = Spring.GetModKeyState -local sprGiveOrderToUnit = Spring.GiveOrderToUnit -local sprSelectUnitArray = Spring.SelectUnitArray -local sprIsAboveMiniMap = Spring.IsAboveMiniMap -local sprMinimapMouseToWorld = Spring.MinimapMouseToWorld -local sprTestBuildOrder = Spring.TestBuildOrder -local sprGetBuildFacing = Spring.GetBuildFacing -local sprGetMyTeamID = Spring.GetMyTeamID - -local sprWorldToScreenCoords = Spring.WorldToScreenCoords -local sprTraceScreenRay = Spring.TraceScreenRay - -local floor = math.floor - -local glVertex = gl.Vertex -local glBeginEnd = gl.BeginEnd -local glColor = gl.Color -local glLineStipple = gl.LineStipple -local glDrawGroundCircle = gl.DrawGroundCircle - -local glPushMatrix = gl.PushMatrix -local glRotate = gl.Rotate -local glTranslate = gl.Translate -local glUnitShape = gl.UnitShape -local glPopMatrix = gl.PopMatrix - -local cmdColorsTbl = { - [CMD.MOVE] = {0.5, 1.0, 0.5, 0.55}, - [CMD.PATROL] = {0.3, 0.3, 1.0, 0.55}, - [CMD.RECLAIM] = {1.0, 0.2, 1.0, 0.55}, - [CMD.REPAIR] = {0.3, 1.0, 1.0, 0.55}, - [CMD.ATTACK] = {1.0, 0.2, 0.2, 0.55}, - [CMD.AREA_ATTACK] = {1.0, 0.2, 0.2, 0.55}, - [CMD.FIGHT] = {0.5, 0.5, 1.0, 0.55}, - [CMD.LOAD_UNITS] = {0.3, 1.0, 1.0, 0.55}, - [CMD.UNLOAD_UNITS] = {1.0, 1.0, 0.0, 0.55}, - [CMD.RESURRECT] = {0.2, 0.6, 1.0, 0.55}, - [CMD.RESTORE] = {0.0, 1.0, 0.0, 0.55}, -} - -local wayPtSelDist = 13 -local selWayPtsTbl = {} - -function widget:GetInfo() - return { - name = "BA Waypoint Dragger", - desc = "Enables Waypoint Dragging", - author = "Kloot", - date = "Aug. 8, 2007 [updated Aug. 14, 2009]", - license = "GNU GPL v2", - layer = 5, - enabled = true - } -end - -function widget:Initialize() -end - -function widget:Shutdown() -end - - - -local function GetCommandColor(cmdID) - if (cmdColorsTbl[cmdID] ~= nil) then - return cmdColorsTbl[cmdID][1], cmdColorsTbl[cmdID][2], cmdColorsTbl[cmdID][3], cmdColorsTbl[cmdID][4] - end - - return 1.0, 1.0, 1.0, 1.0 -end - -local function GetMouseWorldCoors(mx, my) - local cwc = nil - - if (sprIsAboveMiniMap(mx, my)) then - cwc = sprMinimapMouseToWorld(mx, my) - else - _, cwc = sprTraceScreenRay(mx, my, true) - end - - return cwc -end - -local function GetSqDist2D(x, y, p, q) - local dx = x - p - local dy = y - q - return (dx * dx + dy * dy) -end - -local function GetCommandWorldPosition(cmd) - local cmdID = cmd.id - local cmdPars = cmd.params - - if (cmdID == CMD.MOVE) then - return cmdPars[1], cmdPars[2], cmdPars[3], 0 - end - if (cmdID == CMD.PATROL) then - return cmdPars[1], cmdPars[2], cmdPars[3], 0 - end - - - if (cmdID == CMD.RECLAIM) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - if (cmdID == CMD.REPAIR) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - if (cmdID == CMD.RESURRECT) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - - if (cmdID == CMD.LOAD_UNITS) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - if (cmdID == CMD.UNLOAD_UNITS) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - - if (cmdID == CMD.AREA_ATTACK) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - - if (cmdID == CMD.RESTORE) then - if (#cmdPars >= 4) then - return cmdPars[1], cmdPars[2], cmdPars[3], cmdPars[4] - end - end - - if (cmdID == CMD.ATTACK) then - if (#cmdPars >= 3) then - return cmdPars[1], cmdPars[2], cmdPars[3], 0 - end - end - if (cmdID == CMD.FIGHT) then - return cmdPars[1], cmdPars[2], cmdPars[3], 0 - end - - return nil, nil, nil, nil -end - --- measure distance from waypoint to cursor in screen-space coordinates --- (so that at greater zoom-levels, waypoints are less easily dragged) -local function GetCommandCursorScreenSqDist(cmd, mx, my) - local x, y, z, _ = GetCommandWorldPosition(cmd) - - if (x ~= nil and y ~= nil and z ~= nil) then - local p, q = sprWorldToScreenCoords(x, y, z) - local d = GetSqDist2D(mx, my, p, q) - - return d - end - - return -1 -end - -local function IsCommandNearCursor(cmd, mx, my) - local d = GetCommandCursorScreenSqDist(cmd, mx, my) - - return (d >= 0 and d < (wayPtSelDist * wayPtSelDist)) -end - - - -local function GetWayPointsNearCursor(wpTbl, mx, my) - local selUnitsTbl = sprGetSelectedUnits() - local numSelWayPts = 0 - - if (selUnitsTbl == nil or #selUnitsTbl == 0) then - return numSelWayPts - end - - for i = 1, #selUnitsTbl do - local unitID = selUnitsTbl[i] - local commands = sprGetCommandQueue(unitID) - - for cmdNum = 1, #commands do - local curCmd = commands[cmdNum ] - local nxtCmd = commands[cmdNum + 1] - local x, y, z, fr = GetCommandWorldPosition(curCmd) - - if (IsCommandNearCursor(curCmd, mx, my)) then - -- save the tag of the next command - local wpLink = (nxtCmd and nxtCmd.tag) or nil - local wpData = {x, y, z, fr, wpLink, curCmd, unitID} - local wpKey = tostring(unitID) .. "-" .. tostring(curCmd.tag) - - wpTbl[wpKey] = wpData - numSelWayPts = numSelWayPts + 1 - end - end - end - - return numSelWayPts -end - -local function MoveWayPoints(wpTbl, mx, my, finalize) - local cursorWorldCoors = GetMouseWorldCoors(mx, my) - - if (cursorWorldCoors ~= nil) then - local wpTblTmp = {} - local cx, cy, cz = cursorWorldCoors[1], cursorWorldCoors[2], cursorWorldCoors[3] - local alt, ctrl, _, _ = sprGetModKeyState() - - if (ctrl) then - -- merge waypoints that are currently near - -- the cursor with those that were near it - -- at the time of the MousePress event - GetWayPointsNearCursor(wpTblTmp, mx, my) - - for wpKey, wpData in pairs(wpTblTmp) do - wpTbl[wpKey] = wpData - end - end - - for wpKey, wpData in pairs(wpTbl) do - -- facing for build orders, - -- radius for area orders - local cmdFacRad = wpData[4] - local cmdLink = wpData[5] - local cmdID = wpData[6].id - local cmdPars = wpData[6].params - local cmdTag = wpData[6].tag - local cmdUnitID = wpData[7] - - if (finalize) then - if (cmdLink == nil) then - cmdLink = cmdTag - end - - if (cmdFacRad > 0) then - -- sprGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdNum, cmdID, 0, cx, cy, cz, cmdFacRad}, {"alt"}) - sprGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdLink, cmdID, 0, cx, cy, cz, cmdFacRad}, {""}) - else - -- sprGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdNum, cmdID, 0, cx, cy, cz}, {"alt"}) - sprGiveOrderToUnit(cmdUnitID, CMD.INSERT, {cmdLink, cmdID, 0, cx, cy, cz}, {""}) - end - - if (not alt) then - sprGiveOrderToUnit(cmdUnitID, CMD.REMOVE, {cmdTag}, {""}) - end - else - wpData[1] = cx - wpData[2] = cy - wpData[3] = cz - end - end - end - - if (finalize) then - for wpKey, _ in pairs(wpTbl) do - selWayPtsTbl[wpKey] = nil - end - end -end - -local function UpdateWayPoints(wpTbl) - local _, _, _, shift = sprGetModKeyState() - local badWayPtsTbl = {} - - for wpKey, wpData in pairs(wpTbl) do - local cmdTag = wpData[6].tag - local cmdUnitID = wpData[7] - local cmdValid = false - - local unitCmds = sprGetCommandQueue(cmdUnitID) - - -- check if the command has not been completed - -- since the MousePress() event occurred (tags - -- don't wrap around within a unit's cmd queue - -- until 1 << 24 of them have been assigned, so - -- this should be safe) - for unitCmdNum = 1, #unitCmds do - if (unitCmds[unitCmdNum].tag == cmdTag) then - cmdValid = true; break - end - end - - -- if shift was released while dragging, - -- make sure to erase all waypoints here - if ((not cmdValid) or (not shift)) then - badWayPtsTbl[wpKey] = true - end - end - - for wpKey, _ in pairs(badWayPtsTbl) do - wpTbl[wpKey] = nil - end -end - - - -function widget:MousePress(mx, my, mb) - -- decide whether to steal this press from the engine - -- so that we get the subsequent MouseMove() call-ins - -- - -- we do this when the following conditions are true: - -- 1. we have at least one unit selected - -- 2. we have the shift key pressed - -- 3. we pressed the LEFT mouse button (otherwise shift-move orders would break) - -- 4. our default command is Move (ie. we haven't clicked on a build-icon, etc.) [?] - -- 5. our mouse cursor is within "grabbing" radius of (at least) - -- one waypoint of at least one of the units we have selected - -- - local _, actCmdID, _, _ = sprGetActiveCommand() - local _, defCmdID, _, _ = sprGetDefaultCommand() - local alt, ctrl, meta, shift = sprGetModKeyState() - local numWayPts = 0 - - if (not shift) then return false end - if (mb ~= 1) then return false end --- if (actCmdID ~= CMD.MOVE and defCmdID ~= CMD.MOVE) then return false end - - numWayPts = GetWayPointsNearCursor(selWayPtsTbl, mx, my) - - if (numWayPts == 0) then - return false - end - - return true -end - -function widget:MouseMove(mx, my, mdx, mdy, mb) - MoveWayPoints(selWayPtsTbl, mx, my, false) - return false -end - -function widget:MouseRelease(mx, my, mb) - MoveWayPoints(selWayPtsTbl, mx, my, true) - return false -end - - - -function widget:Update(_) - -- remove waypoints that units have - -- "passed" in some sense since the - -- MousePress event was received - UpdateWayPoints(selWayPtsTbl) -end - -function widget:DrawWorld() - local mx, my, _, _, _ = sprGetMouseState() - local _, _, _, shift = sprGetModKeyState() - local wpTblTmp = {} - - if (not shift) then - return - end - - -- we want to draw selection circles even when no - -- MousePress event has occurred (more intuitive) - -- note: only call this if selWayPtsTbl is empty? - GetWayPointsNearCursor(wpTblTmp, mx, my) - - for _, wpData in pairs(wpTblTmp) do - local cmd = wpData[6] - local x, y, z, _ = GetCommandWorldPosition(cmd) - local p, q = sprWorldToScreenCoords(x, y, z) - local r, g, b, a = GetCommandColor(cmd.id) - - glColor(r, g, b, a) - glDrawGroundCircle(x, y, z, wayPtSelDist, 16) - end - - for _, wpData in pairs(selWayPtsTbl) do - local cmd = wpData[6] - local nx, ny, nz = wpData[1], wpData[2], wpData[3] - local ox, oy, oz, _ = GetCommandWorldPosition(cmd) - local p, q = sprWorldToScreenCoords(ox, oy, oz) - local d = GetSqDist2D(mx, my, p, q) - local r, g, b, a = GetCommandColor(cmd.id) - - glColor(r, g, b, a) - - if (d > (wayPtSelDist * wayPtSelDist)) then - glDrawGroundCircle(ox, oy, oz, wayPtSelDist, 16) - end - - local pattern = (65536 - 775) - local offset = floor((sprGetGameSeconds() * 16) % 16) - - glLineStipple(2, pattern, -offset) - glBeginEnd(GL.LINES, - function() - glVertex(ox, oy, oz) - glVertex(nx, ny, nz) - end - ) - glLineStipple(false) - end - - glColor(1.0, 1.0, 1.0, 1.0) -end diff --git a/LuaUI/Widgets_Evo/wg_mexspot_fetcher.lua b/LuaUI/Widgets_Evo/wg_mexspot_fetcher.lua deleted file mode 100644 index f4c3329aa..000000000 --- a/LuaUI/Widgets_Evo/wg_mexspot_fetcher.lua +++ /dev/null @@ -1,26 +0,0 @@ - -function widget:GetInfo() - return { - name = "Mexspot Fetcher", - desc = "Fetches metal spot data from synced.", - author = "Google Frog", -- - date = "22 April 2012", - license = "GNU GPL, v2 or later", - layer = -30000, - enabled = true -- loaded by default? - } -end - -function widget:Initialize() - widgetHandler:RegisterGlobal("SendMetalSpots", SendMetalSpots) - Spring.SendLuaRulesMsg("RequestMetalSpots") - Spring.Echo("Mexspot Fetcher fetching") - --Spring.MarkerAddPoint(0,0,0,"") -end - -function SendMetalSpots(playerID, metalSpots, metalSpotsByPos) - WG.metalSpots = metalSpots - WG.metalSpotsByPos = metalSpotsByPos - Spring.Echo("Mexspot Fetcher received") - widgetHandler:RemoveWidget(self) -end \ No newline at end of file diff --git a/LuaUI/camain.lua b/LuaUI/camain.lua deleted file mode 100644 index 59134360a..000000000 --- a/LuaUI/camain.lua +++ /dev/null @@ -1,174 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: main.lua --- brief: the entry point from gui.lua, relays call-ins to the widget manager --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- --- 0.75b2 compatibilty --- -if (Spring.GetTeamColor == nil) then - local getTeamInfo = Spring.GetTeamInfo - Spring.GetTeamColor = function(teamID) - local _,_,_,_,_,_,r,g,b,a = getTeamInfo(teamID) - return r, g, b, a - end - Spring.GetTeamInfo = function(teamID) - local id, leader, active, isDead, isAi, side, - r, g, b, a, allyTeam = getTeamInfo(teamID) - return id, leader, active, isDead, isAi, side, allyTeam - end -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -Spring.SendCommands({"ctrlpanel " .. LUAUI_DIRNAME .. "ctrlpanel.txt"}) - -VFS.Include(LUAUI_DIRNAME .. 'utils.lua', utilFile) - -include("setupdefs.lua") -include("savetable.lua") - -include("debug.lua") -include("modfonts.lua") -include("layout.lua") -- contains a simple LayoutButtons() -include("cawidgets.lua") -- the widget handler - --------------------------------------------------------------------------------- --- --- print the header --- - -if (RestartCount == nil) then - RestartCount = 0 -else - RestartCount = RestartCount + 1 -end - -do - local restartStr = "" - if (RestartCount > 0) then - restartStr = " (" .. RestartCount .. " Restarts)" - end - Spring.SendCommands({"echo " .. LUAUI_VERSION .. restartStr}) -end - - --------------------------------------------------------------------------------- - -local gl = Spring.Draw -- easier to use - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --- --- A few helper functions --- - -function Say(msg) - Spring.SendCommands({'say ' .. msg}) -end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --- --- Update() -- called every frame --- - -activePage = 0 - -forceLayout = true - - -function Update() - local currentPage = Spring.GetActivePage() - if (forceLayout or (currentPage ~= activePage)) then - Spring.ForceLayoutUpdate() -- for the page number indicator - forceLayout = false - end - activePage = currentPage - - fontHandler.Update() - - widgetHandler:Update() - - return -end - - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- --- --- WidgetHandler fixed calls --- - -function Shutdown() - return widgetHandler:Shutdown() -end - -function ConfigureLayout(command) - return widgetHandler:ConfigureLayout(command) -end - -function CommandNotify(id, params, options) - return widgetHandler:CommandNotify(id, params, options) -end - -function DrawScreen(vsx, vsy) - return widgetHandler:DrawScreen() -end - -function KeyPress(key, mods, isRepeat) - return widgetHandler:KeyPress(key, mods, isRepeat) -end - -function KeyRelease(key, mods) - return widgetHandler:KeyRelease(key, mods) -end - -function MouseMove(x, y, dx, dy, button) - return widgetHandler:MouseMove(x, y, dx, dy, button) -end - -function MousePress(x, y, button) - return widgetHandler:MousePress(x, y, button) -end - -function MouseRelease(x, y, button) - return widgetHandler:MouseRelease(x, y, button) -end - -function IsAbove(x, y) - return widgetHandler:IsAbove(x, y) -end - -function GetTooltip(x, y) - return widgetHandler:GetTooltip(x, y) -end - -function AddConsoleLine(msg, priority) - return widgetHandler:AddConsoleLine(msg, priority) -end - -function GroupChanged(groupID) - return widgetHandler:GroupChanged(groupID) -end - - --- --- The unit (and some of the Draw) call-ins are handled --- differently (see LuaUI/widgets.lua / UpdateCallIns()) --- - - --------------------------------------------------------------------------------- - diff --git a/LuaUI/cawidgets.lua b/LuaUI/cawidgets.lua deleted file mode 100644 index 0a7dc01bb..000000000 --- a/LuaUI/cawidgets.lua +++ /dev/null @@ -1,2112 +0,0 @@ --- $Id: cawidgets.lua 4261 2009-03-31 16:34:36Z licho $ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: widgets.lua --- brief: the widget manager, a call-in router --- author: Dave Rodgers --- --- modified by jK and quantum --- --- Copyright (C) 2007,2008,2009. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - --- stable release? -local isStable = false -local resetWidgetDetailLevel = false -- has widget detail level changed - -local ORDER_VERSION = 8 --- change this to reset enabled/disabled widgets -local DATA_VERSION = 9 -- change this to reset widget settings - -function includeZIPFirst(filename, envTable) - if (string.find(filename, '.h.lua', 1, true)) then - filename = 'Headers/' .. filename - end - return VFS.Include(LUAUI_DIRNAME .. filename, envTable, VFS.ZIP_FIRST) -end - - -include("keysym.h.lua") -include("utils.lua") -includeZIPFirst("system.lua") -includeZIPFirst("cache.lua") --contain cached override for Spring.GetVisibleUnit (performance optimization). All overrides that are placed here have global reach -include("callins.lua") -include("savetable.lua") -include("utility_two.lua") --contain file backup function -local myName, transmitMagic, voiceMagic, transmitLobbyMagic, MessageProcessor = include("chat_preprocess.lua") -- contain stuff that preprocess chat message for Chili Chat widgets - -local modShortUpper = Game.modShortName:upper() -local ORDER_FILENAME = LUAUI_DIRNAME .. 'Config/' .. modShortUpper .. '_order.lua' -local CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/' .. modShortUpper .. '_data.lua' -local WIDGET_DIRNAME = LUAUI_DIRNAME .. 'Widgets_Evo/' - -local HANDLER_BASENAME = "cawidgets.lua" -local SELECTOR_BASENAME = 'selector.lua' - -do - local isMission = Game.modDesc:find("Mission Mutator") - if isMission then -- all missions will be forced to use a specific name - if not VFS.FileExists(ORDER_FILENAME) or not VFS.FileExists(CONFIG_FILENAME) then - ORDER_FILENAME = LUAUI_DIRNAME .. 'Config/ZK_order.lua' --use "ZK" name when running any mission mod (provided that there's no existing config file) - CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/ZK_data.lua' - end - end -end - -local SAFEWRAP = 1 --- 0: disabled --- 1: enabled, but can be overriden by widget.GetInfo().unsafe --- 2: always enabled - -local SAFEDRAW = false -- requires SAFEWRAP to work -local glPopAttrib = gl.PopAttrib -local glPushAttrib = gl.PushAttrib -local pairs = pairs -local ipairs = ipairs - -do -- create backup for ZK_data.lua and ZK_order.lua to workaround against case of file corruption when OS crash - local fileToCheck = {ORDER_FILENAME,CONFIG_FILENAME} - local extraText = {'-- Widget Order List (0 disables a widget)', '-- Widget Custom Data'} --this is a header text that is appended to start of file - for i=1, #fileToCheck do - CheckLUAFileAndBackup(fileToCheck[i], extraText[i]) - end -end - --- read local widgets config -local localWidgetsFirst = false -local localWidgets = false - -if VFS.FileExists(CONFIG_FILENAME) then --check config file whether user want to use localWidgetsFirst - local cadata = VFS.Include(CONFIG_FILENAME) - if cadata["Local Widgets Config"] then - localWidgetsFirst = cadata["Local Widgets Config"].localWidgetsFirst - localWidgets = cadata["Local Widgets Config"].localWidgets - end -end - -local VFSMODE -VFSMODE = localWidgetsFirst and VFS.RAW_FIRST -VFSMODE = VFSMODE or localWidgets and VFS.ZIP_FIRST -VFSMODE = VFSMODE or VFS.ZIP - -local detailLevel = Spring.GetConfigInt("widgetDetailLevel", 3) - --------------------------------------------------------------------------------- - --- install bindings for TweakMode and the Widget Selector - -Spring.SendCommands({ - "unbindkeyset Any+f11", - "unbindkeyset Ctrl+f11", - "bind f11 luaui selector", - "bind C+f11 luaui tweakgui", - "echo LuaUI: bound F11 to the widget selector", - "echo LuaUI: bound CTRL+F11 to tweak mode" -}) - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- the widgetHandler object --- - -widgetHandler = { - - widgets = {}, - - configData = {}, - orderList = {}, - - knownWidgets = {}, - knownCount = 0, - knownChanged = true, - - commands = {}, - customCommands = {}, - inCommandsChanged = false, - - autoModWidgets = false, - - actionHandler = include("actions.lua"), - - WG = {}, -- shared table for widgets - - globals = {}, -- global vars/funcs - - mouseOwner = nil, - ownedButton = 0, - - tweakMode = false, -} - - --- these call-ins are set to 'nil' if not used --- they are setup in UpdateCallIns() -local flexCallIns = { - 'GameOver', - 'GamePaused', - 'GameFrame', - 'GameSetup', - 'TeamDied', - 'TeamChanged', - 'PlayerAdded', - 'PlayerChanged', - "PlayerRemoved", - 'ShockFront', - 'WorldTooltip', - 'MapDrawCmd', - 'DefaultCommand', - 'UnitCreated', - 'UnitFinished', - 'UnitFromFactory', - 'UnitDestroyed', - 'UnitExperience', - 'UnitTaken', - 'UnitGiven', - 'UnitIdle', - 'UnitCommand', - 'UnitCmdDone', - 'UnitDamaged', - 'UnitEnteredRadar', - 'UnitEnteredLos', - 'UnitLeftRadar', - 'UnitLeftLos', - 'UnitEnteredWater', - 'UnitEnteredAir', - 'UnitLeftWater', - 'UnitLeftAir', - 'UnitSeismicPing', - 'UnitLoaded', - 'UnitUnloaded', - 'UnitCloaked', - 'UnitDecloaked', - 'UnitMoveFailed', - 'RecvLuaMsg', - 'StockpileChanged', - 'DrawGenesis', - 'DrawWorld', - 'DrawWorldPreUnit', - 'DrawWorldShadow', - 'DrawWorldReflection', - 'DrawWorldRefraction', - 'DrawScreenEffects', - 'DrawInMiniMap', - 'RecvSkirmishAIMessage', - 'SelectionChanged', - 'AddTransmitLine', - 'AddConsoleMessage', - 'VoiceCommand', -} -local flexCallInMap = {} -for _,ci in ipairs(flexCallIns) do - flexCallInMap[ci] = true -end - -local callInLists = { - 'GamePreload', - 'GameStart', - 'Shutdown', - 'Update', - 'TextCommand', - 'CommandNotify', - 'AddConsoleLine', - 'ViewResize', - 'DrawScreen', - 'KeyPress', - 'KeyRelease', - 'MousePress', - 'MouseWheel', - 'JoyAxis', - 'JoyHat', - 'JoyButtonDown', - 'JoyButtonUp', - 'IsAbove', - 'GetTooltip', - 'GroupChanged', - 'CommandsChanged', - 'TweakMousePress', - 'TweakMouseWheel', - 'TweakIsAbove', - 'TweakGetTooltip', - 'GameProgress', - 'UnsyncedHeightMapUpdate', --- these use mouseOwner instead of lists --- 'MouseMove', --- 'MouseRelease', --- 'TweakKeyPress', --- 'TweakKeyRelease', --- 'TweakMouseMove', --- 'TweakMouseRelease', - --- uses the DrawScreenList --- 'TweakDrawScreen', -} - --- append the flex call-ins -for _,uci in ipairs(flexCallIns) do - table.insert(callInLists, uci) -end - - --- initialize the call-in lists -do - for _,listname in ipairs(callInLists) do - widgetHandler[listname..'List'] = {} - end -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Reverse integer iterator for drawing --- - -local function rev_iter(t, key) - if (key <= 1) then - return nil - else - local nkey = key - 1 - return nkey, t[nkey] - end -end - -local function ripairs(t) - return rev_iter, t, (1 + #t) -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- helper functions ----include chat preprocess here - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -function widgetHandler:LoadOrderList() - local chunk, err = loadfile(ORDER_FILENAME) - if (chunk == nil) then - self.orderList = {} -- safety - return {} - else - local tmp = {} - setfenv(chunk, tmp) - self.orderList = chunk() - if (not self.orderList) then - self.orderList = {} -- safety - end - if (self.orderList.version or 0) < ORDER_VERSION then - self.orderList = {} - self.orderList.version = ORDER_VERSION - end - local detailLevel = Spring.GetConfigInt("widgetDetailLevel", 2) - if (self.orderList.lastWidgetDetailLevel ~= detailLevel) then - resetWidgetDetailLevel = true - self.orderList.lastWidgetDetailLevel = detailLevel - end - end -end - - -function widgetHandler:SaveOrderList() - -- update the current order - for i,w in ipairs(self.widgets) do - self.orderList[w.whInfo.name] = i - end - table.save(self.orderList, ORDER_FILENAME, - '-- Widget Order List (0 disables a widget)') -end - - --------------------------------------------------------------------------------- - -function widgetHandler:LoadConfigData() - local chunk, err = loadfile(CONFIG_FILENAME) - if (chunk == nil) then - return {} - else - local tmp = {} - setfenv(chunk, tmp) - self.configData = chunk() - if (not self.configData) then - self.configData = {} -- safety - end - if (self.configData.version or 0) < DATA_VERSION then - self.configData = {} - self.configData.version = DATA_VERSION - end - - end -end - - -function widgetHandler:SaveConfigData() - resetWidgetDetailLevel = false - self:LoadConfigData() - for _,w in ipairs(self.widgets) do - if (w.GetConfigData) then - local ok, err = pcall(function() - self.configData[w.whInfo.name] = w:GetConfigData() - end) - if not ok then Spring.Log(HANDLER_BASENAME, LOG.ERROR, "Failed to GetConfigData from: " .. w.whInfo.name.." ("..err..")") end - end - end - table.save(self.configData, CONFIG_FILENAME, '-- Widget Custom Data') -end - - -function widgetHandler:SendConfigData() - self:LoadConfigData() - for _,w in ipairs(self.widgets) do - local data = self.configData[w.whInfo.name] - if (w.SetConfigData and data) then - w:SetConfigData(data) - end - end -end - - --------------------------------------------------------------------------------- - -function widgetHandler:Initialize() - if Game.modVersion:find("stable",1,true) then - isStable = true - end - - self:LoadOrderList() - self:LoadConfigData() - - local autoModWidgets = Spring.GetConfigInt('LuaAutoModWidgets', 1) - self.autoModWidgets = (autoModWidgets ~= 0) - - -- create the "LuaUI/Config" directory - Spring.CreateDir(LUAUI_DIRNAME .. 'Config') - - local unsortedWidgets = {} - - -- stuff the widgets into unsortedWidgets - local widgetFiles = VFS.DirList(WIDGET_DIRNAME, "*.lua", VFSMODE) - for k,wf in ipairs(widgetFiles) do - local widget = self:LoadWidget(wf) - if (widget) then - table.insert(unsortedWidgets, widget) - end - end - - -- sort the widgets - table.sort(unsortedWidgets, function(w1, w2) - local l1 = w1.whInfo.layer - local l2 = w2.whInfo.layer - if (l1 ~= l2) then - return (l1 < l2) - end - local n1 = w1.whInfo.name - local n2 = w2.whInfo.name - local o1 = self.orderList[n1] - local o2 = self.orderList[n2] - if (o1 ~= o2) then - return (o1 < o2) - else - return (n1 < n2) - end - end) - - -- first add the api widgets - for _,w in ipairs(unsortedWidgets) do - if (w.whInfo.api) then - widgetHandler:InsertWidget(w) - - local name = w.whInfo.name - local basename = w.whInfo.basename - Spring.Echo(string.format("Loaded API widget: %-18s <%s>", name, basename)) - end - end - - -- add the widgets - for _,w in ipairs(unsortedWidgets) do - if (not w.whInfo.api) then - widgetHandler:InsertWidget(w) - - local name = w.whInfo.name - local basename = w.whInfo.basename - Spring.Echo(string.format("Loaded widget: %-18s <%s>", name, basename)) - end - end - - -- save the active widgets, and their ordering - self:SaveOrderList() - self:SaveConfigData() -end - - -function widgetHandler:LoadWidget(filename, _VFSMODE) - _VFSMODE = _VFSMODE or VFSMODE - local basename = Basename(filename) - local text = VFS.LoadFile(filename, _VFSMODE) - - if (text == nil) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Failed to load: ' .. basename .. ' (missing file: ' .. filename ..')') - return nil - end - local chunk, err = loadstring(text, filename) - if (chunk == nil) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') - return nil - end - - local widget = widgetHandler:NewWidget() - setfenv(chunk, widget) - local success, err = pcall(chunk) - if (not success) then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') - return nil - end - if (err == false) then - return nil -- widget asked for a silent death - end - - -- raw access to widgetHandler - if (widget.GetInfo and widget:GetInfo().handler) then - widget.widgetHandler = self - end - - self:FinalizeWidget(widget, filename, basename) - local name = widget.whInfo.name - if (basename == SELECTOR_BASENAME) then - self.orderList[name] = 1 -- always enabled - end - - err = self:ValidateWidget(widget) - if (err) then - Spring.Echo('Failed to load: ' .. basename .. ' (' .. err .. ')') - return nil - end - - local knownInfo = self.knownWidgets[name] - if (knownInfo) then - if (knownInfo.active) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Failed to load: ' .. basename .. ' (duplicate name)') - return nil - end - else - -- create a knownInfo table - knownInfo = {} - knownInfo.desc = widget.whInfo.desc - knownInfo.author = widget.whInfo.author - knownInfo.basename = widget.whInfo.basename - knownInfo.filename = widget.whInfo.filename - knownInfo.alwaysStart = widget.whInfo.alwaysStart - knownInfo.fromZip = true - if (_VFSMODE ~= VFS.ZIP) then - if (_VFSMODE == VFS.RAW_FIRST) then - knownInfo.fromZip = not VFS.FileExists(filename,VFS.RAW_ONLY) - else - knownInfo.fromZip = VFS.FileExists(filename,VFS.ZIP_ONLY) - end - end - self.knownWidgets[name] = knownInfo - self.knownCount = self.knownCount + 1 - self.knownChanged = true - end - knownInfo.active = true - - if (widget.GetInfo == nil) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Failed to load: ' .. basename .. ' (no GetInfo() call)') - return nil - end - - local info = widget:GetInfo() - local order = self.orderList[name] - - local enabled = ((order ~= nil) and (order > 0)) or - ((order == nil) and -- unknown widget - (info.enabled and ((not knownInfo.fromZip) or self.autoModWidgets))) or info.alwaysStart - - -- experimental widget, disabled by default in stable - if info.experimental and isStable then - enabled = false - end - - if resetWidgetDetailLevel and info.detailsDefault ~= nil then - if type(info.detailsDefault) == "table" then - enabled = info.detailsDefault[detailLevel] and true - elseif type(info.detailsDefault) == "number" then - enabled = detailLevel >= info.detailsDefault - elseif tonumber(info.detailsDefault) then - enabled = detailLevel >= tonumber(info.detailsDefault) - end - end - - if (enabled) then - -- this will be an active widget - if (order == nil) then - self.orderList[name] = 12345 -- back of the pack - else - self.orderList[name] = order - end - else - self.orderList[name] = 0 - self.knownWidgets[name].active = false - return nil - end - - -- load the config data - local config = self.configData[name] - if (widget.SetConfigData and config) then - widget:SetConfigData(config) - end - - return widget -end - - -function widgetHandler:NewWidget() - local widget = {} - if (true) then - -- copy the system calls into the widget table - for k,v in pairs(System) do - widget[k] = v - end - else - -- use metatable redirection - setmetatable(widget, { - __index = System, - __metatable = true, - }) - end - widget.WG = self.WG -- the shared table - widget.widget = widget -- easy self referencing - - -- wrapped calls (closures) - widget.widgetHandler = {} - local wh = widget.widgetHandler - local self = self - widget.include = function (f) return include(f, widget) end - wh.ForceLayout = function (_) self:ForceLayout() end - wh.RaiseWidget = function (_) self:RaiseWidget(widget) end - wh.LowerWidget = function (_) self:LowerWidget(widget) end - wh.RemoveWidget = function (_) self:RemoveWidget(widget) end - wh.GetCommands = function (_) return self.commands end - wh.InTweakMode = function (_) return self.tweakMode end - wh.GetViewSizes = function (_) return self:GetViewSizes() end - wh.GetHourTimer = function (_) return self:GetHourTimer() end - wh.IsMouseOwner = function (_) return (self.mouseOwner == widget) end - wh.DisownMouse = function (_) - if (self.mouseOwner == widget) then - self.mouseOwner = nil - end - end - - wh.isStable = function (_) return self:isStable() end - - wh.UpdateCallIn = function (_, name) - self:UpdateWidgetCallIn(name, widget) - end - wh.RemoveCallIn = function (_, name) - self:RemoveWidgetCallIn(name, widget) - end - - wh.AddAction = function (_, cmd, func, data, types) - return self.actionHandler:AddAction(widget, cmd, func, data, types) - end - wh.RemoveAction = function (_, cmd, types) - return self.actionHandler:RemoveAction(widget, cmd, types) - end - - wh.AddLayoutCommand = function (_, cmd) - if (self.inCommandsChanged) then - table.insert(self.customCommands, cmd) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "AddLayoutCommand() can only be used in CommandsChanged()") - end - end - - wh.RegisterGlobal = function(_, name, value) - return self:RegisterGlobal(widget, name, value) - end - wh.DeregisterGlobal = function(_, name) - return self:DeregisterGlobal(widget, name) - end - wh.SetGlobal = function(_, name, value) - return self:SetGlobal(widget, name, value) - end - - wh.ConfigLayoutHandler = function(_, d) self:ConfigLayoutHandler(d) end - - ---- - widget.ProcessConsoleBuffer = function(_,_, num) -- FIXME: probably not the least hacky way to make ProcessConsoleBuffer accessible to widgets - return MessageProcessor:ProcessConsoleBuffer(num) - end - ---- - - return widget -end - - -function widgetHandler:FinalizeWidget(widget, filename, basename) - local wi - - if (widget.GetInfo == nil) then - wi = {} - wi.filename = filename - wi.basename = basename - wi.name = basename - wi.layer = 0 - else - local info = widget:GetInfo() - wi = info - wi.filename = filename - wi.basename = basename - wi.name = wi.name or basename - wi.layer = wi.layer or 0 - wi.desc = wi.desc or "" - wi.author = wi.author or "" - wi.license = wi.license or "" - wi.enabled = wi.enabled or false - wi.api = wi.api or false - - -- exprimental widget - -- change name for separate settings and disable by default - if info.experimental and isStable then - wi.name = wi.name .. " (experimental)" - wi.enabled = false - end - - end - - widget.whInfo = {} -- a proxy table - local mt = { - __index = wi, - __newindex = function() error("whInfo tables are read-only") end, - __metatable = "protected" - } - setmetatable(widget.whInfo, mt) -end - - -function widgetHandler:ValidateWidget(widget) - if (widget.GetTooltip and not widget.IsAbove) then - return "Widget has GetTooltip() but not IsAbove()" - end - if (widget.TweakGetTooltip and not widget.TweakIsAbove) then - return "Widget has TweakGetTooltip() but not TweakIsAbove()" - end - return nil -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -local function HandleError(widget, funcName, status, ...) - if (status) then - return ... - end - - if (funcName ~= 'Shutdown') then - widgetHandler:RemoveWidget(widget) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Error in Shutdown()') - end - local name = widget.whInfo.name - local error_message = select(1,...) - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Error in ' .. funcName ..'(): ' .. tostring(error_message)) - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Removed widget: ' .. name) - return nil -end - -local function SafeWrapFuncNoGL(func, funcName) - return function(w, ...) - return HandleError(w, funcName, pcall(func, w, ...)) - end -end - -local function SafeWrapFuncGL(func, funcName) - local wh = widgetHandler - - return function(w, ...) - - glPushAttrib(GL.ALL_ATTRIB_BITS) - local r = { pcall(func, w, ...) } - glPopAttrib() - - if (r[1]) then - table.remove(r, 1) - return unpack(r) - else - if (funcName ~= 'Shutdown') then - widgetHandler:RemoveWidget(w) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Error in Shutdown()') - end - local name = w.whInfo.name - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Error in ' .. funcName ..'(): ' .. tostring(r[2])) - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'Removed widget: ' .. name) - return nil - end - end -end - - -local function SafeWrapFunc(func, funcName) - if (not SAFEDRAW) then - return SafeWrapFuncNoGL(func, funcName) - else - if (string.sub(funcName, 1, 4) ~= 'Draw') then - return SafeWrapFuncNoGL(func, funcName) - else - return SafeWrapFuncGL(func, funcName) - end - end -end - - -local function SafeWrapWidget(widget) - if (SAFEWRAP <= 0) then - return - elseif (SAFEWRAP == 1) then - if (widget.GetInfo and widget.GetInfo().unsafe) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'LuaUI: loaded unsafe widget: ' .. widget.whInfo.name) - return - end - end - - for _,ciName in ipairs(callInLists) do - if (widget[ciName]) then - widget[ciName] = SafeWrapFunc(widget[ciName], ciName) - end - if (widget.Initialize) then - widget.Initialize = SafeWrapFunc(widget.Initialize, 'Initialize') - end - end -end - - --------------------------------------------------------------------------------- - -local function ArrayInsert(t, f, w) - if (f) then - local layer = w.whInfo.layer - local index = 1 - for i,v in ipairs(t) do - if (v == w) then - return -- already in the table - end - if (layer >= v.whInfo.layer) then - index = i + 1 - end - end - table.insert(t, index, w) - end -end - - -local function ArrayRemove(t, w) - for k,v in ipairs(t) do - if (v == w) then - table.remove(t, k) - -- break - end - end -end - - -function widgetHandler:InsertWidget(widget) - if (widget == nil) then - return - end - - SafeWrapWidget(widget) - - ArrayInsert(self.widgets, true, widget) - for _,listname in ipairs(callInLists) do - local func = widget[listname] - if (type(func) == 'function') then - ArrayInsert(self[listname..'List'], func, widget) - end - end - self:UpdateCallIns() - - if (widget.Initialize) then - widget:Initialize() - end -end - - -function widgetHandler:RemoveWidget(widget) - if (widget == nil) then - return - end - - local name = widget.whInfo.name - if (widget.GetConfigData) then - local ok, err = pcall(function() - self.configData[name] = widget:GetConfigData() - end) - if not ok then Spring.Log(HANDLER_BASENAME, LOG.ERROR, "Failed to GetConfigData: " .. name.." ("..err..")") end - end - self.knownWidgets[name].active = false - if (widget.Shutdown) then - widget:Shutdown() - end - ArrayRemove(self.widgets, widget) - self:RemoveWidgetGlobals(widget) - self.actionHandler:RemoveWidgetActions(widget) - for _,listname in ipairs(callInLists) do - ArrayRemove(self[listname..'List'], widget) - end - self:UpdateCallIns() -end - - --------------------------------------------------------------------------------- - -function widgetHandler:UpdateCallIn(name) - local listName = name .. 'List' - if ((name == 'Update') or - (name == 'DrawScreen')) then - return - end - - if ((#self[listName] > 0) or - (not flexCallInMap[name]) or - ((name == 'GotChatMsg') and actionHandler.HaveChatAction()) or - ((name == 'RecvFromSynced') and actionHandler.HaveSyncAction())) then - -- always assign these call-ins - local selffunc = self[name] - _G[name] = function(...) - return selffunc(self, ...) - end - else - _G[name] = nil - end - Script.UpdateCallIn(name) -end - - -function widgetHandler:UpdateWidgetCallIn(name, w) - local listName = name .. 'List' - local ciList = self[listName] - if (ciList) then - local func = w[name] - if (type(func) == 'function') then - ArrayInsert(ciList, func, w) - else - ArrayRemove(ciList, w) - end - self:UpdateCallIn(name) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'UpdateWidgetCallIn: bad name: ' .. name) - end -end - - -function widgetHandler:RemoveWidgetCallIn(name, w) - local listName = name .. 'List' - local ciList = self[listName] - if (ciList) then - ArrayRemove(ciList, w) - self:UpdateCallIn(name) - else - Spring.Log(HANDLER_BASENAME, LOG.ERROR, 'RemoveWidgetCallIn: bad name: ' .. name) - end -end - - -function widgetHandler:UpdateCallIns() - for _,name in ipairs(callInLists) do - self:UpdateCallIn(name) - end -end - - --------------------------------------------------------------------------------- - -function widgetHandler:EnableWidget(name) - local ki = self.knownWidgets[name] - if (not ki) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "EnableWidget(), could not find widget: " .. tostring(name)) - return false - end - if (not ki.active) then - Spring.Echo('Loading: '..ki.filename) - local order = widgetHandler.orderList[name] - if (not order or (order <= 0)) then - self.orderList[name] = 1 - end - local w = self:LoadWidget(ki.filename) - if (not w) then return false end - self:InsertWidget(w) - self:SaveOrderList() - end - return true -end - - -function widgetHandler:DisableWidget(name) - local ki = self.knownWidgets[name] - if (not ki) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "DisableWidget(), could not find widget: " .. tostring(name)) - return false - end - if (ki.active) then - local w = self:FindWidget(name) - if (not w) then return false end - Spring.Echo('Removed: '..ki.filename) - self:RemoveWidget(w) -- deactivate - self.orderList[name] = 0 -- disable - self:SaveOrderList() - end - return true -end - - -function widgetHandler:ToggleWidget(name) - local ki = self.knownWidgets[name] - if (not ki) then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "ToggleWidget(), could not find widget: " .. tostring(name)) - return - end - if (ki.active) then - return self:DisableWidget(name) - elseif (self.orderList[name] <= 0) then - return self:EnableWidget(name) - else - -- the widget is not active, but enabled; disable it - self.orderList[name] = 0 - self:SaveOrderList() - end - return true -end - - --------------------------------------------------------------------------------- - -local function FindWidgetIndex(t, w) - for k,v in ipairs(t) do - if (v == w) then - return k - end - end - return nil -end - - -local function FindLowestIndex(t, i, layer) - for x = (i - 1), 1, -1 do - if (t[x].whInfo.layer < layer) then - return x + 1 - end - end - return 1 -end - - -function widgetHandler:RaiseWidget(widget) - if (widget == nil) then - return - end - local function Raise(t, f, w) - if (f == nil) then return end - local i = FindWidgetIndex(t, w) - if (i == nil) then return end - local n = FindLowestIndex(t, i, w.whInfo.layer) - if (n and (n < i)) then - table.remove(t, i) - table.insert(t, n, w) - end - end - Raise(self.widgets, true, widget) - for _,listname in ipairs(callInLists) do - Raise(self[listname..'List'], widget[listname], widget) - end -end - - -local function FindHighestIndex(t, i, layer) - local ts = #t - for x = (i + 1),ts do - if (t[x].whInfo.layer > layer) then - return (x - 1) - end - end - return (ts + 1) -end - - -function widgetHandler:LowerWidget(widget) - if (widget == nil) then - return - end - local function Lower(t, f, w) - if (f == nil) then return end - local i = FindWidgetIndex(t, w) - if (i == nil) then return end - local n = FindHighestIndex(t, i, w.whInfo.layer) - if (n and (n > i)) then - table.insert(t, n, w) - table.remove(t, i) - end - end - Lower(self.widgets, true, widget) - for _,listname in ipairs(callInLists) do - Lower(self[listname..'List'], widget[listname], widget) - end -end - - -function widgetHandler:FindWidget(name) - if (type(name) ~= 'string') then - return nil - end - for k,v in ipairs(self.widgets) do - if (name == v.whInfo.name) then - return v,k - end - end - return nil -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Global var/func management --- - -function widgetHandler:RegisterGlobal(owner, name, value) - if ((name == nil) or - (_G[name]) or - (self.globals[name]) or - (CallInsMap[name])) then - return false - end - _G[name] = value - self.globals[name] = owner - return true -end - - -function widgetHandler:DeregisterGlobal(owner, name) - if ((name == nil) or (self.globals[name] and (self.globals[name] ~= owner))) then - return false - end - _G[name] = nil - self.globals[name] = nil - return true -end - - -function widgetHandler:SetGlobal(owner, name, value) - if ((name == nil) or (self.globals[name] ~= owner)) then - return false - end - _G[name] = value - return true -end - - -function widgetHandler:RemoveWidgetGlobals(owner) - local count = 0 - for name, o in pairs(self.globals) do - if (o == owner) then - _G[name] = nil - self.globals[name] = nil - count = count + 1 - end - end - return count -end - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- Helper facilities --- - -local hourTimer = 0 - - -function widgetHandler:GetHourTimer() - return hourTimer -end - -function widgetHandler:GetViewSizes() - --FIXME remove - return gl.GetViewSizes() -end - -function widgetHandler:ForceLayout() - forceLayout = true -- in main.lua -end - - -function widgetHandler:ConfigLayoutHandler(data) - ConfigLayoutHandler(data) -end - -function widgetHandler:isStable() - return isStable -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- The call-in distribution routines --- - -function widgetHandler:Shutdown() - self:SaveOrderList() - self:SaveConfigData() - for _,w in ipairs(self.ShutdownList) do - w:Shutdown() - end - return -end - -function widgetHandler:Update() - local deltaTime = Spring.GetLastUpdateSeconds() - -- update the hour timer - hourTimer = (hourTimer + deltaTime)%3600 - for _,w in ipairs(self.UpdateList) do - w:Update(deltaTime) - end - return -end - - -function widgetHandler:ConfigureLayout(command) - if (command == 'tweakgui') then - self.tweakMode = true - Spring.Echo("LuaUI TweakMode: ON") - return true - elseif (command == 'reconf') then - self:SendConfigData() - return true - elseif (command == 'selector') then - for _,w in ipairs(self.widgets) do - if (w.whInfo.basename == SELECTOR_BASENAME) then - return true -- there can only be one - end - end - local sw = self:LoadWidget(LUAUI_DIRNAME .. SELECTOR_BASENAME, VFS.RAW_FIRST) - self:InsertWidget(sw) - self:RaiseWidget(sw) - return true - elseif (string.find(command, 'togglewidget') == 1) then - self:ToggleWidget(string.sub(command, 14)) - return true - elseif (string.find(command, 'enablewidget') == 1) then - self:EnableWidget(string.sub(command, 14)) - return true - elseif (string.find(command, 'disablewidget') == 1) then - self:DisableWidget(string.sub(command, 15)) - return true - end - - if (self.actionHandler:TextAction(command)) then - return true - end - - for _,w in ipairs(self.TextCommandList) do - if (w:TextCommand(command)) then - return true - end - end - return false -end - - -function widgetHandler:CommandNotify(id, params, options) - for _,w in ipairs(self.CommandNotifyList) do - if (w:CommandNotify(id, params, options)) then - return true - end - end - return false -end - ---NOTE: StringStarts() and MessageProcessor is included in "chat_preprocess.lua" -function widgetHandler:AddConsoleLine(msg, priority) - if StringStarts(msg, transmitLobbyMagic) then -- sending to the lobby - return -- ignore - elseif StringStarts(msg, transmitMagic) then -- receiving from the lobby - if StringStarts(msg, voiceMagic) then - local tableString = string.sub(msg, string.len(voiceMagic) + 1) -- strip the magic string - local voiceCommandParams = Deserialize("return "..tableString) -- deserialize voice command parameters in table form - for _,w in ipairs(self.VoiceCommandList) do - w:VoiceCommand(voiceCommandParams.commandName, voiceCommandParams) - end - return - else - for _,w in ipairs(self.AddTransmitLineList) do - w:AddTransmitLine(msg, priority) - end - return - end - else - --censor message for muted player. This is mandatory, everyone is forced to close ears to muted players (ie: if it is optional, then everyone will opt to hear muted player for spec-cheat info. Thus it will defeat the purpose of mute) - local newMsg = { text = msg, priority = priority } - MessageProcessor:ProcessConsoleLine(newMsg) - if newMsg.msgtype ~= 'other' and newMsg.msgtype ~= 'autohost' then - local playerID_msg = newMsg.player and newMsg.player.id --retrieve playerID from message. - local customkeys = select(10, Spring.GetPlayerInfo(playerID_msg)) - if customkeys and customkeys.muted then - local myPlayerID = Spring.GetLocalPlayerID() - if myPlayerID == playerID_msg then --if I am the muted, then: - newMsg.argument="" --remind myself that I am muted. - msg = "" - else --if I am NOT the muted, then: delete this message - return - end - --TODO: improve chili_chat2 spam-filter/dedupe-detection too. - end - end - - --send message to widget:AddConsoleLine - for _,w in ipairs(self.AddConsoleLineList) do - w:AddConsoleLine(msg, priority) - end - - --send message to widget:AddConsoleMessage - if newMsg.msgtype == 'point' or newMsg.msgtype == 'label' then - return -- ignore all console messages about points... those come in through the MapDrawCmd callin - end - for _,w in ipairs(self.AddConsoleMessageList) do - w:AddConsoleMessage(newMsg) - end - end -end - - -function widgetHandler:GroupChanged(groupID) - for _,w in ipairs(self.GroupChangedList) do - w:GroupChanged(groupID) - end - return -end - - -function widgetHandler:CommandsChanged() - widgetHandler:UpdateSelection() -- for selectionchanged - self.inCommandsChanged = true - self.customCommands = {} - for _,w in ipairs(self.CommandsChangedList) do - w:CommandsChanged() - end - self.inCommandsChanged = false - return -end - - --------------------------------------------------------------------------------- --- --- Drawing call-ins --- - - -function widgetHandler:ViewResize(viewGeometry) - local vsx = viewGeometry.viewSizeX - local vsy = viewGeometry.viewSizeY - - for _,w in ipairs(self.ViewResizeList) do - w:ViewResize(vsx, vsy, viewGeometry) - end - return -end - -function widgetHandler:DrawScreen() - if (self.tweakMode) then - gl.Color(0, 0, 0, 0.5) - local sx, sy, px, py = Spring.GetViewGeometry() - gl.Shape(GL.QUADS, { - {v = { px, py }}, {v = { px+sx, py }}, {v = { px+sx, py+sy }}, {v = { px, py+sy }} - }) - gl.Color(1, 1, 1) - end - for _,w in ripairs(self.DrawScreenList) do - w:DrawScreen() - if (self.tweakMode and w.TweakDrawScreen) then - w:TweakDrawScreen() - end - end - return -end - - -function widgetHandler:DrawGenesis() - for _,w in ripairs(self.DrawGenesisList) do - w:DrawGenesis() - end - return -end - - -function widgetHandler:DrawWorld() - for _,w in ripairs(self.DrawWorldList) do - w:DrawWorld() - end - return -end - - -function widgetHandler:DrawWorldPreUnit() - for _,w in ripairs(self.DrawWorldPreUnitList) do - w:DrawWorldPreUnit() - end - return -end - - -function widgetHandler:DrawWorldShadow() - for _,w in ripairs(self.DrawWorldShadowList) do - w:DrawWorldShadow() - end - return -end - - -function widgetHandler:DrawWorldReflection() - for _,w in ripairs(self.DrawWorldReflectionList) do - w:DrawWorldReflection() - end - return -end - - -function widgetHandler:DrawWorldRefraction() - for _,w in ripairs(self.DrawWorldRefractionList) do - w:DrawWorldRefraction() - end - return -end - - -function widgetHandler:DrawScreenEffects(vsx, vsy) - for _,w in ripairs(self.DrawScreenEffectsList) do - w:DrawScreenEffects(vsx, vsy) - end - return -end - - -function widgetHandler:DrawInMiniMap(xSize, ySize) - for _,w in ripairs(self.DrawInMiniMapList) do - w:DrawInMiniMap(xSize, ySize) - end - return -end - - --------------------------------------------------------------------------------- --- --- Keyboard call-ins --- - -function widgetHandler:KeyPress(key, mods, isRepeat, label, unicode) - if (self.tweakMode) then - local mo = self.mouseOwner - if (mo and mo.TweakKeyPress) then - mo:TweakKeyPress(key, mods, isRepeat, label, unicode) - end - return true - end - - if (self.actionHandler:KeyAction(true, key, mods, isRepeat)) then - return true - end - - for _,w in ipairs(self.KeyPressList) do - if (w:KeyPress(key, mods, isRepeat, label, unicode)) then - return true - end - end - return false -end - - -function widgetHandler:KeyRelease(key, mods, label, unicode) - if (self.tweakMode) then - local mo = self.mouseOwner - if (mo and mo.TweakKeyRelease) then - mo:TweakKeyRelease(key, mods, label, unicode) - elseif (key == KEYSYMS.ESCAPE) then - Spring.Echo("LuaUI TweakMode: OFF") - self.tweakMode = false - end - return true - end - - if (self.actionHandler:KeyAction(false, key, mods, false)) then - return true - end - - for _,w in ipairs(self.KeyReleaseList) do - if (w:KeyRelease(key, mods, label, unicode)) then - return true - end - end - return false -end - - --------------------------------------------------------------------------------- --- --- Mouse call-ins --- - -do - local lastDrawFrame = 0 - local lastx,lasty = 0,0 - local lastWidget - - local spGetDrawFrame = Spring.GetDrawFrame - - -- local helper (not a real call-in) - function widgetHandler:WidgetAt(x, y) - local drawframe = spGetDrawFrame() - if (lastDrawFrame == drawframe)and(lastx == x)and(lasty == y) then - return lastWidget - end - - lastDrawFrame = drawframe - lastx = x - lasty = y - - if (not self.tweakMode) then - for _,w in ipairs(self.IsAboveList) do - if (w:IsAbove(x, y)) then - lastWidget = w - return w - end - end - else - for _,w in ipairs(self.TweakIsAboveList) do - if (w:TweakIsAbove(x, y)) then - lastWidget = w - return w - end - end - end - lastWidget = nil - return nil - end -end - - -function widgetHandler:MousePress(x, y, button) - local mo = self.mouseOwner - if (not self.tweakMode) then - if (mo) then - mo:MousePress(x, y, button) - return true -- already have an active press - end - for _,w in ipairs(self.MousePressList) do - if (w:MousePress(x, y, button)) then - self.mouseOwner = w - return true - end - end - return false - else - if (mo) then - mo:TweakMousePress(x, y, button) - return true -- already have an active press - end - for _,w in ipairs(self.TweakMousePressList) do - if (w:TweakMousePress(x, y, button)) then - self.mouseOwner = w - return true - end - end - return true -- always grab the mouse - end -end - - -function widgetHandler:MouseMove(x, y, dx, dy, button) - local mo = self.mouseOwner - if (not self.tweakMode) then - if (mo and mo.MouseMove) then - return mo:MouseMove(x, y, dx, dy, button) - end - else - if (mo and mo.TweakMouseMove) then - mo:TweakMouseMove(x, y, dx, dy, button) - end - return true - end -end - - -function widgetHandler:MouseRelease(x, y, button) - local mo = self.mouseOwner - local mx, my, lmb, mmb, rmb = Spring.GetMouseState() - if (not (lmb or mmb or rmb)) then - self.mouseOwner = nil - end - - if (not self.tweakMode) then - if (mo and mo.MouseRelease) then - return mo:MouseRelease(x, y, button) - end - return -1 - else - if (mo and mo.TweakMouseRelease) then - mo:TweakMouseRelease(x, y, button) - end - return -1 - end -end - - -function widgetHandler:MouseWheel(up, value) - if (not self.tweakMode) then - for _,w in ipairs(self.MouseWheelList) do - if (w:MouseWheel(up, value)) then - return true - end - end - return false - else - for _,w in ipairs(self.TweakMouseWheelList) do - if (w:TweakMouseWheel(up, value)) then - return true - end - end - return false -- FIXME: always grab in tweakmode? - end -end - -function widgetHandler:JoyAxis(axis, value) - for _,w in ipairs(self.JoyAxisList) do - if (w:JoyAxis(axis, value)) then - return true - end - end - return false -end - -function widgetHandler:JoyHat(hat, value) - for _,w in ipairs(self.JoyHatList) do - if (w:JoyHat(hat, value)) then - return true - end - end - return false -end - -function widgetHandler:JoyButtonDown(button, state) - for _,w in ipairs(self.JoyButtonDownList) do - if (w:JoyButtonDown(button, state)) then - return true - end - end - return false -end - -function widgetHandler:JoyButtonUp(button, state) - for _,w in ipairs(self.JoyButtonUpList) do - if (w:JoyButtonUp(button, state)) then - return true - end - end - return false -end - -function widgetHandler:IsAbove(x, y) - if (self.tweakMode) then - return true - end - return (widgetHandler:WidgetAt(x, y) ~= nil) -end - - -function widgetHandler:GetTooltip(x, y) - if (not self.tweakMode) then - for _,w in ipairs(self.GetTooltipList) do - if (w:IsAbove(x, y)) then - local tip = w:GetTooltip(x, y) - if ((type(tip) == 'string') and (#tip > 0)) then - return tip - end - end - end - return "" - else - for _,w in ipairs(self.TweakGetTooltipList) do - if (w:TweakIsAbove(x, y)) then - local tip = w:TweakGetTooltip(x, y) or '' - if ((type(tip) == 'string') and (#tip > 0)) then - return tip - end - end - end - return "Tweak Mode -- hit ESCAPE to cancel" - end -end - - --------------------------------------------------------------------------------- --- --- Game call-ins --- - -function widgetHandler:GamePreload() - for _,w in ipairs(self.GamePreloadList) do - w:GamePreload() - end - return -end - -function widgetHandler:GameStart() - for _,w in ipairs(self.GameStartList) do - w:GameStart() - end - - local plist = "" - gaiaTeam = Spring.GetGaiaTeamID() - for _, teamID in ipairs(Spring.GetTeamList()) do - local teamLuaAI = Spring.GetTeamLuaAI(teamID) - if ((teamLuaAI == nil or teamLuaAI == "") and teamID ~= gaiaTeam) then - local _,_,_,ai,side,ally = Spring.GetTeamInfo(teamID) - if (not ai) then - for _, pid in ipairs(Spring.GetPlayerList(teamID)) do - local name, active, spec = Spring.GetPlayerInfo(pid) - if active and not spec then plist = plist .. "," .. name end - end - end - end - end - Spring.SendCommands("wbynum 255 SPRINGIE:stats,plist".. plist) - return -end - -function widgetHandler:GameOver() - for _,w in ipairs(self.GameOverList) do - w:GameOver() - end - return -end - - -function widgetHandler:GamePaused(playerID, paused) - for _,w in ipairs(self.GamePausedList) do - w:GamePaused(playerID, paused) - end - return -end - - -function widgetHandler:TeamDied(teamID) - for _,w in ipairs(self.TeamDiedList) do - w:TeamDied(teamID) - end - return -end - - -function widgetHandler:TeamChanged(teamID) - for _,w in ipairs(self.TeamChangedList) do - w:TeamChanged(teamID) - end - return -end - - -function widgetHandler:PlayerAdded(playerID, reason) - --ListMutedPlayers() - for _,w in ipairs(self.PlayerAddedList) do - w:PlayerAdded(playerID, reason) - end - return -end - - -function widgetHandler:PlayerChanged(playerID) - for _,w in ipairs(self.PlayerChangedList) do - w:PlayerChanged(playerID) - end - return -end - - -function widgetHandler:PlayerRemoved(playerID, reason) - for _,w in ipairs(self.PlayerRemovedList) do - w:PlayerRemoved(playerID, reason) - end - return -end - - -function widgetHandler:GameFrame(frameNum) - for _,w in ipairs(self.GameFrameList) do - w:GameFrame(frameNum) - end - return -end - - -function widgetHandler:ShockFront(power, dx, dy, dz) - for _,w in ipairs(self.ShockFrontList) do - w:ShockFront(power, dx, dy, dz) - end - return -end - -function widgetHandler:RecvSkirmishAIMessage(aiTeam, dataStr) - for _,w in ipairs(self.RecvSkirmishAIMessageList) do - local dataRet = w:RecvSkirmishAIMessage(aiTeam, dataStr) - if (dataRet) then - return dataRet - end - end -end - -function widgetHandler:WorldTooltip(ttType, ...) - for _,w in ipairs(self.WorldTooltipList) do - local tt = w:WorldTooltip(ttType, ...) - if ((type(tt) == 'string') and (#tt > 0)) then - return tt - end - end - return -end - - -function widgetHandler:MapDrawCmd(playerID, cmdType, px, py, pz, ...) - local customkeys = select(10, Spring.GetPlayerInfo(playerID)) - if customkeys and customkeys.muted then - return true - end - - local retval = false - for _,w in ipairs(self.MapDrawCmdList) do - local takeEvent = w:MapDrawCmd(playerID, cmdType, px, py, pz, ...) - if (takeEvent) then - retval = true - end - end - return retval -end - - -function widgetHandler:GameSetup(state, ready, playerStates) - for _,w in ipairs(self.GameSetupList) do - local success, newReady = w:GameSetup(state, ready, playerStates) - if (success) then - return true, newReady - end - end - return false -end - - -function widgetHandler:DefaultCommand(...) - for _,w in ripairs(self.DefaultCommandList) do - local result = w:DefaultCommand(...) - if (type(result) == 'number') then - return result - end - end - return nil -- not a number, use the default engine command -end - - --------------------------------------------------------------------------------- --- --- Unit call-ins --- - -function widgetHandler:UnitCreated(unitID, unitDefID, unitTeam, builderID) - for _,w in ipairs(self.UnitCreatedList) do - w:UnitCreated(unitID, unitDefID, unitTeam, builderID) - end - return -end - - -function widgetHandler:UnitFinished(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitFinishedList) do - w:UnitFinished(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, - factID, factDefID, userOrders) - for _,w in ipairs(self.UnitFromFactoryList) do - w:UnitFromFactory(unitID, unitDefID, unitTeam, - factID, factDefID, userOrders) - end - return -end - - -function widgetHandler:UnitDestroyed(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitDestroyedList) do - w:UnitDestroyed(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitExperience(unitID, unitDefID, unitTeam, - experience, oldExperience) - for _,w in ipairs(self.UnitExperienceList) do - w:UnitExperience(unitID, unitDefID, unitTeam, - experience, oldExperience) - end - return -end - - -function widgetHandler:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - for _,w in ipairs(self.UnitTakenList) do - w:UnitTaken(unitID, unitDefID, unitTeam, newTeam) - end - return -end - - -function widgetHandler:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - for _,w in ipairs(self.UnitGivenList) do - w:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) - end - return -end - - -function widgetHandler:UnitIdle(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitIdleList) do - w:UnitIdle(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitCommand(unitID, unitDefID, unitTeam, - cmdId, cmdOpts, cmdParams) - for _,w in ipairs(self.UnitCommandList) do - w:UnitCommand(unitID, unitDefID, unitTeam, - cmdId, cmdOpts, cmdParams) - end - return -end - - -function widgetHandler:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdTag) - for _,w in ipairs(self.UnitCmdDoneList) do - w:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdTag) - end - return -end - - -function widgetHandler:UnitDamaged(unitID, unitDefID, unitTeam, - damage, paralyzer) - for _,w in ipairs(self.UnitDamagedList) do - w:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) - end - return -end - - -function widgetHandler:UnitEnteredRadar(unitID, unitTeam) - for _,w in ipairs(self.UnitEnteredRadarList) do - w:UnitEnteredRadar(unitID, unitTeam) - end - return -end - - -function widgetHandler:UnitEnteredLos(unitID, unitTeam) - for _,w in ipairs(self.UnitEnteredLosList) do - w:UnitEnteredLos(unitID, unitTeam) - end - return -end - - -function widgetHandler:UnitLeftRadar(unitID, unitTeam) - for _,w in ipairs(self.UnitLeftRadarList) do - w:UnitLeftRadar(unitID, unitTeam) - end - return -end - - -function widgetHandler:UnitLeftLos(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitLeftLosList) do - w:UnitLeftLos(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitEnteredWater(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitEnteredWaterList) do - w:UnitEnteredWater(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitEnteredAir(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitEnteredAirList) do - w:UnitEnteredAir(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitLeftWater(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitLeftWaterList) do - w:UnitLeftWater(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitLeftAir(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitLeftAirList) do - w:UnitLeftAir(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitSeismicPing(x, y, z, strength) - for _,w in ipairs(self.UnitSeismicPingList) do - w:UnitSeismicPing(x, y, z, strength) - end - return -end - - -function widgetHandler:UnitLoaded(unitID, unitDefID, unitTeam, - transportID, transportTeam) - for _,w in ipairs(self.UnitLoadedList) do - w:UnitLoaded(unitID, unitDefID, unitTeam, - transportID, transportTeam) - end - return -end - - -function widgetHandler:UnitUnloaded(unitID, unitDefID, unitTeam, - transportID, transportTeam) - for _,w in ipairs(self.UnitUnloadedList) do - w:UnitUnloaded(unitID, unitDefID, unitTeam, - transportID, transportTeam) - end - return -end - - -function widgetHandler:UnitCloaked(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitCloakedList) do - w:UnitCloaked(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitDecloaked(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitDecloakedList) do - w:UnitDecloaked(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:UnitMoveFailed(unitID, unitDefID, unitTeam) - for _,w in ipairs(self.UnitMoveFailedList) do - w:UnitMoveFailed(unitID, unitDefID, unitTeam) - end - return -end - - -function widgetHandler:RecvLuaMsg(msg, playerID) - local retval = false - for _,w in ipairs(self.RecvLuaMsgList) do - if (w:RecvLuaMsg(msg, playerID)) then - retval = true - end - end - return retval -- FIXME -- another actionHandler type? -end - - -function widgetHandler:StockpileChanged(unitID, unitDefID, unitTeam, - weaponNum, oldCount, newCount) - for _,w in ipairs(self.StockpileChangedList) do - w:StockpileChanged(unitID, unitDefID, unitTeam, - weaponNum, oldCount, newCount) - end - return -end - - --- local helper (not a real call-in) -local oldSelection = {} -function widgetHandler:UpdateSelection() - local changed - local newSelection = Spring.GetSelectedUnits() - if (#newSelection == #oldSelection) then - for i=1, #newSelection do - if (newSelection[i] ~= oldSelection[i]) then -- it seems the order stays - changed = true - break - end - end - else - changed = true - end - if (changed) then - widgetHandler:SelectionChanged(newSelection) - end - oldSelection = newSelection -end - - -function widgetHandler:SelectionChanged(selectedUnits) - for _,w in ipairs(self.SelectionChangedList) do - local unitArray = w:SelectionChanged(selectedUnits) - if (unitArray) then - Spring.SelectUnitArray(unitArray) - break - end - end - return -end - - -function widgetHandler:GameProgress(frame) - for _,w in ipairs(self.GameProgressList) do - w:GameProgress(frame) - end - return -end - -function widgetHandler:UnsyncedHeightMapUpdate(x1,z1,x2,z2) - for _,w in ipairs(self.UnsyncedHeightMapUpdateList) do - w:UnsyncedHeightMapUpdate(x1,z1,x2,z2) - end - return -end - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -widgetHandler:Initialize() - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- diff --git a/LuaUI/chat_preprocess.lua b/LuaUI/chat_preprocess.lua deleted file mode 100644 index fcbd92bd9..000000000 --- a/LuaUI/chat_preprocess.lua +++ /dev/null @@ -1,138 +0,0 @@ ---Chat preprocessor. Provide preprocessed chat message for Chili Chat widget - -local myName = Spring.GetPlayerInfo(Spring.GetMyPlayerID()) -local transmitMagic = "> ["..myName.."]!transmit" -- Lobby is sending to LuaUI -local voiceMagic = "> ["..myName.."]!transmit voice" -- Lobby is sending a voice command to LuaUI -local transmitLobbyMagic = "!transmitlobby" -- LuaUI is sending to lobby - -function StringStarts(s, start) - return string.sub(s, 1, string.len(start)) == start -end - -local function Deserialize(text) - local f, err = loadstring(text) - if not f then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "Error while deserializing table (compiling): "..tostring(err)) - return - end - setfenv(f, {}) -- sandbox - local success, arg = pcall(f) - if not success then - Spring.Log(HANDLER_BASENAME, LOG.ERROR, "Error while deserializing table (calling): "..tostring(arg)) - return - end - return arg -end - - -local MessageProcessor = {} - -local PLAYERNAME_PATTERN = '([%w%[%]_]+)' -- to make message patterns easier to read/update - --- message definitions ---[[ -pattern syntax: - see http://www.lua.org/manual/5.1/manual.html#5.4.1 - pattern must contain at least 1 capture group; its content will end up in msg.argument after parseMessage() - PLAYERNAME will match anything that looks like a playername (see code for definition of PLAYERNAME_PATTERN); it is a capture group - if message does not contain a PLAYERNAME, add 'noplayername = true' to definition - it should be possible to add definitions to help debug widgets or whatever... (no guarantee) ---]] -MessageProcessor.MESSAGE_DEFINITIONS = { - { msgtype = 'player_to_allies', pattern = '^ Allies: (.*)' }, - { msgtype = 'player_to_player_received', pattern = '^ Private: (.*)' }, -- TODO test! - { msgtype = 'player_to_player_sent', pattern = '^You whispered PLAYERNAME: (.*)' }, -- TODO test! - { msgtype = 'player_to_specs', pattern = '^ Spectators: (.*)' }, - { msgtype = 'player_to_everyone', pattern = '^ (.*)' }, - - { msgtype = 'spec_to_specs', pattern = '^%[PLAYERNAME%] Spectators: (.*)' }, - { msgtype = 'spec_to_allies', pattern = '^%[PLAYERNAME%] Allies: (.*)' }, -- TODO is there a reason to differentiate spec_to_specs and spec_to_allies?? - { msgtype = 'spec_to_everyone', pattern = '^%[PLAYERNAME%] (.*)' }, - - -- shameful copy-paste -- TODO rewrite pattern matcher to remove this duplication - { msgtype = 'replay_spec_to_specs', pattern = '^%[PLAYERNAME %(replay%)%] Spectators: (.*)' }, - { msgtype = 'replay_spec_to_allies', pattern = '^%[PLAYERNAME %(replay%)%] Allies: (.*)' }, -- TODO is there a reason to differentiate spec_to_specs and spec_to_allies?? - { msgtype = 'replay_spec_to_everyone', pattern = '^%[PLAYERNAME %(replay%)%] (.*)'}, - - { msgtype = 'label', pattern = '^PLAYERNAME added point: (.+)', discard = true }, -- NOTE : these messages are discarded -- points and labels are provided through MapDrawCmd() callin - { msgtype = 'point', pattern = '^PLAYERNAME added point: ', discard = true }, - { msgtype = 'autohost', pattern = '^> (.+)', noplayername = true }, - { msgtype = 'other' } -- no pattern... will match anything else -} - -local function escapePatternReplacementChars(s) - return string.gsub(s, "%%", "%%%%") -end - -function MessageProcessor:Initialize() - local escapedPlayernamePattern = escapePatternReplacementChars(PLAYERNAME_PATTERN) - for _,def in ipairs(self.MESSAGE_DEFINITIONS) do - if def.pattern then - def.pattern = def.pattern:gsub('PLAYERNAME', escapedPlayernamePattern) -- patch definition pattern so it is an actual lua pattern string - end - end -end - -local players = {} - -local function SetupPlayers() - local playerroster = Spring.GetPlayerList() - - for i, id in ipairs(playerroster) do - local name, _, spec, teamId, allyTeamId, _,_,_,_,customkeys = Spring.GetPlayerInfo(id) - players[name] = { id = id, spec = spec, allyTeamId = allyTeamId, muted = (customkeys and customkeys.muted == 1) } - end -end - -local function getSource(spec, allyTeamId) - return (spec and 'spec') - or ((Spring.GetMyTeamID() == allyTeamId) and 'ally') - or 'enemy' -end - --- update msg members msgtype, argument, source and playername (when relevant) -function MessageProcessor:ParseMessage(msg) - for _, candidate in ipairs(self.MESSAGE_DEFINITIONS) do - if candidate.pattern == nil then -- for fallback/other messages - msg.msgtype = candidate.msgtype - msg.argument = msg.text - msg.source = 'other' - return - end - local capture1, capture2 = msg.text:match(candidate.pattern) - if capture1 then - msg.msgtype = candidate.msgtype - if candidate.noplayername then - msg.argument = capture1 - msg.source = 'other' - return - else - local playername = capture1 - if players[playername] then - local player = players[playername] - msg.player = player - msg.source = getSource(player.spec, player.allyTeamId) - msg.playername = playername - msg.argument = capture2 - return - end - end - end - end -end - -function MessageProcessor:ProcessConsoleLine(msg) - self:ParseMessage(msg) -end - -function MessageProcessor:ProcessConsoleBuffer(count) - local bufferMessages = Spring.GetConsoleBuffer(count) - for i = 1,#bufferMessages do - self:ProcessConsoleLine(bufferMessages[i]) - end - return bufferMessages -end - -SetupPlayers() -MessageProcessor:Initialize() -return myName, transmitMagic, voiceMagic, transmitLobbyMagic, MessageProcessor \ No newline at end of file diff --git a/LuaUI/main_evo.lua b/LuaUI/main_evo.lua new file mode 100644 index 000000000..3612b56ab --- /dev/null +++ b/LuaUI/main_evo.lua @@ -0,0 +1,156 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: main.lua +-- brief: the entry point from gui.lua, relays call-ins to the widget manager +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +Spring.SendCommands({"ctrlpanel " .. LUAUI_DIRNAME .. "ctrlpanel.txt"}) + +VFS.Include(LUAUI_DIRNAME .. 'utils.lua', utilFile) + +WG = {} +Spring.Utilities = {} +VFS.Include("LuaRules/Utilities/glvolumes.lua") + +include("setupdefs.lua") +include("savetable.lua") + +include("debug.lua") +include("fonts.lua") +include("layout.lua") -- contains a simple LayoutButtons() +include("widgets_evo.lua") -- the widget handler + + +-------------------------------------------------------------------------------- +-- +-- print the header +-- + +if (RestartCount == nil) then + RestartCount = 0 +else + RestartCount = RestartCount + 1 +end + +do + local restartStr = "" + if (RestartCount > 0) then + restartStr = " (" .. RestartCount .. " Restarts)" + end + Spring.SendCommands({"echo " .. LUAUI_VERSION .. restartStr}) +end + + +-------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- +-- A few helper functions +-- + +function Say(msg) + Spring.SendCommands({'say ' .. msg}) +end + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- +-- Update() -- called every frame +-- + +activePage = 0 + +forceLayout = true + + +function Update() + local currentPage = Spring.GetActivePage() + if (forceLayout or (currentPage ~= activePage)) then + Spring.ForceLayoutUpdate() -- for the page number indicator + forceLayout = false + end + activePage = currentPage + + fontHandler.Update() + + widgetHandler:Update() + + return +end + + +------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +-- +-- WidgetHandler fixed calls +-- + +function Shutdown() + return widgetHandler:Shutdown() +end + +function ConfigureLayout(command) + return widgetHandler:ConfigureLayout(command) +end + +function CommandNotify(id, params, options) + return widgetHandler:CommandNotify(id, params, options) +end + +function DrawScreen(vsx, vsy) + widgetHandler:SetViewSize(vsx, vsy) + return widgetHandler:DrawScreen() +end + +function KeyPress(key, mods, isRepeat, label, unicode) + return widgetHandler:KeyPress(key, mods, isRepeat, label, unicode) +end + +function KeyRelease(key, mods, label, unicode) + return widgetHandler:KeyRelease(key, mods, label, unicode) +end + +function MouseMove(x, y, dx, dy, button) + return widgetHandler:MouseMove(x, y, dx, dy, button) +end + +function MousePress(x, y, button) + return widgetHandler:MousePress(x, y, button) +end + +function MouseRelease(x, y, button) + return widgetHandler:MouseRelease(x, y, button) +end + +function IsAbove(x, y) + return widgetHandler:IsAbove(x, y) +end + +function GetTooltip(x, y) + return widgetHandler:GetTooltip(x, y) +end + +function AddConsoleLine(msg, priority) + return widgetHandler:AddConsoleLine(msg, priority) +end + +function GroupChanged(groupID) + return widgetHandler:GroupChanged(groupID) +end + + +-- +-- The unit (and some of the Draw) call-ins are handled +-- differently (see LuaUI/widgets.lua / UpdateCallIns()) +-- + + +-------------------------------------------------------------------------------- + diff --git a/LuaUI/modfonts.lua b/LuaUI/modfonts.lua index 708572c14..e345e7685 100644 --- a/LuaUI/modfonts.lua +++ b/LuaUI/modfonts.lua @@ -194,15 +194,13 @@ end -------------------------------------------------------------------------------- local function StripColorCodes(text) - if text ~= nil then - local stripped = "" - for txt, color in text:gmatch("([^\255]*)(\255?.?.?.?)") do - if (txt:len() > 0) then - stripped = stripped .. txt - end - end - return stripped - end + local stripped = "" + for txt, color in text:gmatch("([^\255]*)(\255?.?.?.?)") do + if (txt:len() > 0) then + stripped = stripped .. txt + end + end + return stripped end diff --git a/LuaUI/system.lua b/LuaUI/system.lua deleted file mode 100644 index 025dab81e..000000000 --- a/LuaUI/system.lua +++ /dev/null @@ -1,100 +0,0 @@ --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- --- --- file: system.lua --- brief: defines the global entries placed into a widget's table --- author: Dave Rodgers --- --- Copyright (C) 2007. --- Licensed under the terms of the GNU GPL, v2 or later. --- --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -if (System == nil) then - - System = { - -- - -- Custom LuaUI variables - -- - Commands = Commands, - fontHandler = fontHandler, - LUAUI_DIRNAME = LUAUI_DIRNAME, - - -- - -- Custom Spring tables - -- - VFS = VFS, - Script = Script, - Spring = Spring, - Game = Game, - gl = gl, - GL = GL, - CMD = CMD, - CMDTYPE = CMDTYPE, - - UnitDefs = UnitDefs, - UnitDefNames = UnitDefNames, - FeatureDefs = FeatureDefs, - FeatureDefNames = FeatureDefNames, - WeaponDefs = WeaponDefs, - WeaponDefNames = WeaponDefNames, - - -- - -- Standard libraries - -- - io = io, - os = os, - math = math, - debug = debug, - table = table, - string = string, - package = package, - coroutine = coroutine, - - -- - -- Standard functions and variables - -- - assert = assert, - error = error, - - print = print, - - next = next, - pairs = pairs, - ipairs = ipairs, - - tonumber = tonumber, - tostring = tostring, - type = type, - - collectgarbage = collectgarbage, - gcinfo = gcinfo, - - unpack = unpack, - select = select, - newproxy = newproxy, - - dofile = dofile, - loadfile = loadfile, - loadlib = loadlib, - loadstring = loadstring, - require = require, - - getmetatable = getmetatable, - setmetatable = setmetatable, - - rawequal = rawequal, - rawget = rawget, - rawset = rawset, - - getfenv = getfenv, - setfenv = setfenv, - - pcall = pcall, - xpcall = xpcall, - - _VERSION = _VERSION - } - -end diff --git a/LuaUI/utility_two.lua b/LuaUI/utility_two.lua deleted file mode 100644 index 17b69b4d8..000000000 --- a/LuaUI/utility_two.lua +++ /dev/null @@ -1,30 +0,0 @@ --- Utility function for ZK - --- Will try to read LUA content from target file and create BACKUP if have a successful read (in user's Spring folder) OR DELETE them if have a failure read --- This prevent corrupted file from being used. -function CheckLUAFileAndBackup(filePath, headerString) - local chunk, err = loadfile(filePath) - if (chunk) then --if original content is LUA OK: - local tmp = {} - setfenv(chunk, tmp) - local tab = chunk() - if tab and type(tab) == "table" then - table.save(chunk(),filePath..".bak",headerString) --write to backup - end - else --if original content is not LUA OK: - Spring.Log("CheckLUAFileAndBackup","warning", tostring(err) .. " (Now will find backup file)") - chunk, err = loadfile(filePath..".bak") - if (chunk) then --if backup content is LUA OK: - local tmp = {} - setfenv(chunk, tmp) - local tab = chunk() - if tab and type(tab) == "table" then - table.save(chunk(),filePath,headerString) --overwrite original - end - else --if backup content is also not LUA OK: - Spring.Log("CheckLUAFileAndBackup","warning", tostring(err) .. " (Backup file not available)") - Spring.Echo(os.remove (filePath)) --delete original - Spring.Echo(os.remove (filePath..".bak")) --delete backup - end - end -end \ No newline at end of file diff --git a/LuaUI/widgets_evo.lua b/LuaUI/widgets_evo.lua new file mode 100644 index 000000000..80af22e60 --- /dev/null +++ b/LuaUI/widgets_evo.lua @@ -0,0 +1,2091 @@ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- file: widgets.lua +-- brief: the widget manager, a call-in router +-- author: Dave Rodgers +-- +-- Copyright (C) 2007. +-- Licensed under the terms of the GNU GPL, v2 or later. +-- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function pwl() -- ??? (print widget list) + for k,v in ipairs(widgetHandler.widgets) do + print(k, v.whInfo.layer, v.whInfo.name) + end +end + + +include("keysym.h.lua") +include("utils.lua") +include("system.lua") +include("cache.lua") --contain cached override for Spring.GetVisibleUnit (performance optimization). All overrides that are placed here have global reach +include("callins.lua") +include("savetable.lua") + + +local gl = gl + +local modShortUpper = Game.modShortName:upper() +local ORDER_FILENAME = LUAUI_DIRNAME .. 'Config/' .. modShortUpper .. '_order.lua' +local CONFIG_FILENAME = LUAUI_DIRNAME .. 'Config/' .. modShortUpper .. '_data.lua' +local WIDGET_DIRNAME = LUAUI_DIRNAME .. 'Widgets_Evo/' + +local SELECTOR_BASENAME = 'selector.lua' + +local SAFEWRAP = 1 +-- 0: disabled +-- 1: enabled, but can be overriden by widget.GetInfo().unsafe +-- 2: always enabled + +local SAFEDRAW = false -- requires SAFEWRAP to work +local glPopAttrib = gl.PopAttrib +local glPushAttrib = gl.PushAttrib +local section = 'widgets_evo.lua' + + +-------------------------------------------------------------------------------- + +-- install bindings for TweakMode and the Widget Selector + +Spring.SendCommands({ + "unbindkeyset Any+f11", + "unbindkeyset Ctrl+f11", + "bind f11 luaui selector", + "bind C+f11 luaui tweakgui", + "echo LuaUI: bound F11 to the widget selector", + "echo LuaUI: bound CTRL+F11 to tweak mode" +}) + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- the widgetHandler object +-- + +widgetHandler = { + + widgets = {}, + + configData = {}, + orderList = {}, + + knownWidgets = {}, + knownCount = 0, + knownChanged = true, + + commands = {}, + customCommands = {}, + inCommandsChanged = false, + + autoUserWidgets = true, + + actionHandler = include("actions.lua"), + + WG = {}, -- shared table for widgets + + globals = {}, -- global vars/funcs + + mouseOwner = nil, + ownedButton = 0, + + tweakMode = false, + tweakKeys = {}, + + xViewSize = 1, + yViewSize = 1, + xViewSizeOld = 1, + yViewSizeOld = 1, +} + + +-- these call-ins are set to 'nil' if not used +-- they are setup in UpdateCallIns() +local flexCallIns = { + 'GamePreload', + 'GameStart', + 'GameOver', + 'GamePaused', + 'GameFrame', + 'GameSetup', + 'TeamDied', + 'TeamChanged', + 'PlayerChanged', + 'PlayerAdded', + 'PlayerRemoved', + 'ShockFront', + 'WorldTooltip', + 'MapDrawCmd', + 'DefaultCommand', + 'UnitCreated', + 'UnitFinished', + 'UnitFromFactory', + 'UnitReverseBuilt', + 'UnitDestroyed', + 'RenderUnitDestroyed', + 'UnitTaken', + 'UnitGiven', + 'UnitIdle', + 'UnitCommand', + 'UnitCmdDone', + 'UnitDamaged', + 'UnitStunned', + 'UnitEnteredRadar', + 'UnitEnteredLos', + 'UnitLeftRadar', + 'UnitLeftLos', + 'UnitEnteredWater', + 'UnitEnteredAir', + 'UnitLeftWater', + 'UnitLeftAir', + 'UnitSeismicPing', + 'UnitLoaded', + 'UnitUnloaded', + 'UnitCloaked', + 'UnitDecloaked', + 'UnitMoveFailed', + 'RecvLuaMsg', + 'SelectionChanged', + 'StockpileChanged', + 'DrawGenesis', + 'DrawWorld', + 'DrawWorldPreUnit', + 'DrawWorldShadow', + 'DrawWorldReflection', + 'DrawWorldRefraction', + 'DrawUnitsPostDeferred', + 'DrawFeaturesPostDeferred', + 'DrawScreenEffects', + 'DrawInMiniMap', + 'SunChanged', + 'RecvSkirmishAIMessage', +} +local flexCallInMap = {} +for _,ci in ipairs(flexCallIns) do + flexCallInMap[ci] = true +end + +local callInLists = { + 'GamePreload', + 'GameStart', + 'Shutdown', + 'Update', + 'TextCommand', + 'CommandNotify', + 'AddConsoleLine', + 'ViewResize', + 'DrawScreen', + 'KeyPress', + 'KeyRelease', + 'MousePress', + 'MouseWheel', + 'JoyAxis', + 'JoyHat', + 'JoyButtonDown', + 'JoyButtonUp', + 'IsAbove', + 'GetTooltip', + 'GroupChanged', + 'CommandsChanged', + 'TweakMousePress', + 'TweakMouseWheel', + 'TweakIsAbove', + 'TweakGetTooltip', + 'RecvFromSynced', + 'TextInput', + 'DownloadQueued', + 'DownloadStarted', + 'DownloadFinished', + 'DownloadFailed', + 'DownloadProgress', +-- these use mouseOwner instead of lists +-- 'MouseMove', +-- 'MouseRelease', +-- 'TweakKeyPress', +-- 'TweakKeyRelease', +-- 'TweakMouseMove', +-- 'TweakMouseRelease', + +-- uses the DrawScreenList +-- 'TweakDrawScreen', +} + +-- append the flex call-ins +for _,uci in ipairs(flexCallIns) do + table.insert(callInLists, uci) +end + + +-- initialize the call-in lists +do + for _,listname in ipairs(callInLists) do + widgetHandler[listname..'List'] = {} + end +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Reverse integer iterator for drawing +-- + +local function rev_iter(t, key) + if (key <= 1) then + return nil + else + local nkey = key - 1 + return nkey, t[nkey] + end +end + +local function ripairs(t) + return rev_iter, t, (1 + #t) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +function widgetHandler:LoadConfigData() + local chunk, err = loadfile(CONFIG_FILENAME) + if (chunk == nil) or (chunk() == nil) or (err) then + if err then + Spring.Log(section, LOG.ERROR, err) + end + return + end + local tmp = {math = {huge = math.huge}} + setfenv(chunk, tmp) + self.orderList = chunk().order + self.configData = chunk().data + if (not self.orderList) then + self.orderList = {} -- safety + end + if (not self.configData) then + self.configData = {} -- safety + end +end + + +function widgetHandler:SaveConfigData() +-- self:LoadConfigData() + local filetable = {} + for i,w in ipairs(self.widgets) do + if (w.GetConfigData) then + self.configData[w.whInfo.name] = select(2, pcall(w.GetConfigData)) + end + self.orderList[w.whInfo.name] = i + end + filetable.order = self.orderList + filetable.data = self.configData + table.save( filetable, CONFIG_FILENAME, '-- Widget Custom data and order, order = 0 disabled widget') +end + + +function widgetHandler:SendConfigData() + self:LoadConfigData() + for i,w in ipairs(self.widgets) do + local data = self.configData[w.whInfo.name] + if (w.SetConfigData and data) then + w:SetConfigData(data) + end + end +end + + +-------------------------------------------------------------------------------- + + +local function GetWidgetInfo(name, mode) + + do return end -- FIXME + + local lines = VFS.LoadFile(name, mode) + + local infoLines = {} + + for line in lines:gmatch('([^\n]*)\n') do + if (not line:find('^%s*%-%-')) then + if (line:find('[^\r]')) then + break -- not commented, not a blank line + end + end + local s, e, source = line:find('^%s*%-%-%>%>(.*)') + if (source) then + table.insert(infoLines, source) + end + end + + local info = {} + local chunk, err = loadstring(table.concat(infoLines, '\n')) + if (not chunk) then + Spring.Log(section, LOG.INFO, 'not loading ' .. name .. ': ' .. err) + else + setfenv(chunk, info) + local success, err = pcall(chunk) + if (not success) then + Spring.Log(section, LOG.INFO, 'not loading ' .. name .. ': ' .. err) + end + end + + for k,v in pairs(info) do + Spring.Log(section, LOG.INFO, name, k, 'type: ' .. type(v), '<'..tostring(v)..'>') + end +end + + +function widgetHandler:Initialize() + self:LoadConfigData() + + local autoUserWidgets = Spring.GetConfigInt('LuaAutoEnableUserWidgets', 1) + self.autoUserWidgets = (autoUserWidgets ~= 0) + + -- create the "LuaUI/Config" directory + Spring.CreateDir(LUAUI_DIRNAME .. 'Config') + + local unsortedWidgets = {} + + -- stuff the raw widgets into unsortedWidgets + local widgetFiles = VFS.DirList(WIDGET_DIRNAME, "*.lua", VFS.RAW_ONLY) + for k,wf in ipairs(widgetFiles) do + GetWidgetInfo(wf, VFS.RAW_ONLY) + local widget = self:LoadWidget(wf, false) + if (widget) then + table.insert(unsortedWidgets, widget) + end + end + + -- stuff the zip widgets into unsortedWidgets + local widgetFiles = VFS.DirList(WIDGET_DIRNAME, "*.lua", VFS.ZIP_ONLY) + for k,wf in ipairs(widgetFiles) do + GetWidgetInfo(wf, VFS.ZIP_ONLY) + local widget = self:LoadWidget(wf, true) + if (widget) then + table.insert(unsortedWidgets, widget) + end + end + + -- sort the widgets + table.sort(unsortedWidgets, function(w1, w2) + local l1 = w1.whInfo.layer + local l2 = w2.whInfo.layer + if (l1 ~= l2) then + return (l1 < l2) + end + local n1 = w1.whInfo.name + local n2 = w2.whInfo.name + local o1 = self.orderList[n1] + local o2 = self.orderList[n2] + if (o1 ~= o2) then + return (o1 < o2) + else + return (n1 < n2) + end + end) + + -- add the widgets + for _,w in ipairs(unsortedWidgets) do + local name = w.whInfo.name + local basename = w.whInfo.basename + local source = self.knownWidgets[name].fromZip and "mod: " or "user:" + Spring.Log(section, LOG.INFO, string.format("Loading widget from %s %-18s <%s> ...", source, name, basename)) + + widgetHandler:InsertWidget(w) + end + + -- save the active widgets, and their ordering + self:SaveConfigData() +end + + +function widgetHandler:LoadWidget(filename, fromZip) + local basename = Basename(filename) + local text = VFS.LoadFile(filename) + if (text == nil) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (missing file: ' .. filename ..')') + return nil + end + local chunk, err = loadstring(text, filename) + if (chunk == nil) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + return nil + end + + local widget = widgetHandler:NewWidget() + setfenv(chunk, widget) + local success, err = pcall(chunk) + if (not success) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + return nil + end + if (err == false) then + return nil -- widget asked for a silent death + end + + -- raw access to widgetHandler + if (widget.GetInfo and widget:GetInfo().handler) then + widget.widgetHandler = self + end + + self:FinalizeWidget(widget, filename, basename) + local name = widget.whInfo.name + if (basename == SELECTOR_BASENAME) then + self.orderList[name] = 1 -- always enabled + end + + err = self:ValidateWidget(widget) + if (err) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (' .. err .. ')') + return nil + end + + local knownInfo = self.knownWidgets[name] + if (knownInfo) then + if (knownInfo.active) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (duplicate name)') + return nil + end + else + -- create a knownInfo table + knownInfo = {} + knownInfo.desc = widget.whInfo.desc + knownInfo.author = widget.whInfo.author + knownInfo.basename = widget.whInfo.basename + knownInfo.filename = widget.whInfo.filename + knownInfo.enabled = widget.whInfo.enabled + knownInfo.fromZip = fromZip + self.knownWidgets[name] = knownInfo + self.knownCount = self.knownCount + 1 + self.knownChanged = true + end + knownInfo.active = true + + if (widget.GetInfo == nil) then + Spring.Log(section, LOG.ERROR, 'Failed to load: ' .. basename .. ' (no GetInfo() call)') + return nil + end + + local info = widget:GetInfo() + local order = self.orderList[name] + if (((order ~= nil) and (order > 0)) or + ((order == nil) and -- unknown widget + (info.enabled and (knownInfo.fromZip or self.autoUserWidgets)))) then + -- this will be an active widget + if (order == nil) then + self.orderList[name] = 12345 -- back of the pack + else + self.orderList[name] = order + end + else + self.orderList[name] = 0 + self.knownWidgets[name].active = false + return nil + end + + -- load the config data + local config = self.configData[name] + if (widget.SetConfigData and config) then + widget:SetConfigData(config) + end + + return widget +end + + +function widgetHandler:NewWidget() + local widget = {} + if (true) then + -- copy the system calls into the widget table + for k,v in pairs(System) do + widget[k] = v + end + widget["SendToUnsynced"] = Spring.SendToUnsynced + else + -- use metatable redirection + setmetatable(widget, { + __index = System, + __metatable = true, + }) + end + widget.WG = self.WG -- the shared table + widget.widget = widget -- easy self referencing + + -- wrapped calls (closures) + widget.widgetHandler = {} + local wh = widget.widgetHandler + local self = self + widget.include = function (f) return include(f, widget) end + wh.ForceLayout = function (_) self:ForceLayout() end + wh.RaiseWidget = function (_) self:RaiseWidget(widget) end + wh.LowerWidget = function (_) self:LowerWidget(widget) end + wh.RemoveWidget = function (_) self:RemoveWidget(widget) end + wh.GetCommands = function (_) return self.commands end + wh.InTweakMode = function (_) return self.tweakMode end + wh.GetViewSizes = function (_) return self:GetViewSizes() end + wh.GetHourTimer = function (_) return self:GetHourTimer() end + wh.IsMouseOwner = function (_) return (self.mouseOwner == widget) end + wh.DisownMouse = function (_) + if (self.mouseOwner == widget) then + self.mouseOwner = nil + end + end + + wh.UpdateCallIn = function (_, name) + self:UpdateWidgetCallIn(name, widget) + end + wh.RemoveCallIn = function (_, name) + self:RemoveWidgetCallIn(name, widget) + end + + wh.AddAction = function (_, cmd, func, data, types) + return self.actionHandler:AddAction(widget, cmd, func, data, types) + end + wh.RemoveAction = function (_, cmd, types) + return self.actionHandler:RemoveAction(widget, cmd, types) + end + + wh.AddSyncAction = function(_, cmd, func, help) + return self.actionHandler:AddSyncAction(widget, cmd, func, help) + end + wh.RemoveSyncAction = function(_, cmd) + return self.actionHandler:RemoveSyncAction(widget, cmd) + end + + wh.AddLayoutCommand = function (_, cmd) + if (self.inCommandsChanged) then + table.insert(self.customCommands, cmd) + else + Spring.Log(section, LOG.ERROR, "AddLayoutCommand() can only be used in CommandsChanged()") + end + end + + wh.RegisterGlobal = function(_, name, value) + return self:RegisterGlobal(widget, name, value) + end + wh.DeregisterGlobal = function(_, name) + return self:DeregisterGlobal(widget, name) + end + wh.SetGlobal = function(_, name, value) + return self:SetGlobal(widget, name, value) + end + + wh.ConfigLayoutHandler = function(_, d) self:ConfigLayoutHandler(d) end + + return widget +end + + +function widgetHandler:AddWidgetSyncAction(widget, cmd, func, help) + return self.actionHandler:AddSyncAction(widget, cmd, func, help) +end + +function widgetHandler:RemoveWidgetSyncAction(widget, cmd) + return self.actionHandler:RemoveSyncAction(widget, cmd) +end + + +function widgetHandler:FinalizeWidget(widget, filename, basename) + local wi = {} + + wi.filename = filename + wi.basename = basename + if (widget.GetInfo == nil) then + wi.name = basename + wi.layer = 0 + else + local info = widget:GetInfo() + wi.name = info.name or basename + wi.layer = info.layer or 0 + wi.desc = info.desc or "" + wi.author = info.author or "" + wi.license = info.license or "" + wi.enabled = info.enabled or false + end + + widget.whInfo = {} -- a proxy table + local mt = { + __index = wi, + __newindex = function() error("whInfo tables are read-only") end, + __metatable = "protected" + } + setmetatable(widget.whInfo, mt) +end + + +function widgetHandler:ValidateWidget(widget) + if (widget.GetTooltip and not widget.IsAbove) then + return "Widget has GetTooltip() but not IsAbove()" + end + if (widget.TweakGetTooltip and not widget.TweakIsAbove) then + return "Widget has TweakGetTooltip() but not TweakIsAbove()" + end + return nil +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function SafeWrapFuncNoGL(func, funcName) + local wh = widgetHandler + + return function(w, ...) + + local r = { pcall(func, w, ...) } + + if (r[1]) then + table.remove(r, 1) + return unpack(r) + else + if (funcName ~= 'Shutdown') then + widgetHandler:RemoveWidget(w) + else + Spring.Log(section, LOG.ERROR, 'Error in Shutdown()') + end + local name = w.whInfo.name + Spring.Log(section, LOG.ERROR, r[1]) + Spring.Log(section, LOG.ERROR, 'Error in ' .. funcName ..'(): ' .. tostring(r[2])) + Spring.Log(section, LOG.ERROR, 'Removed widget: ' .. name) + return nil + end + end +end + + +local function SafeWrapFuncGL(func, funcName) + local wh = widgetHandler + + return function(w, ...) + + glPushAttrib(GL.ALL_ATTRIB_BITS) + local r = { pcall(func, w, ...) } + glPopAttrib() + + if (r[1]) then + table.remove(r, 1) + return unpack(r) + else + if (funcName ~= 'Shutdown') then + widgetHandler:RemoveWidget(w) + else + Spring.Log(section, LOG.ERROR, 'Error in Shutdown()') + end + local name = w.whInfo.name + Spring.Log(section, LOG.ERROR, 'Error in ' .. funcName ..'(): ' .. tostring(r[2])) + Spring.Log(section, LOG.ERROR, 'Removed widget: ' .. name) + return nil + end + end +end + + +local function SafeWrapFunc(func, funcName) + if (not SAFEDRAW) then + return SafeWrapFuncNoGL(func, funcName) + else + if (string.sub(funcName, 1, 4) ~= 'Draw') then + return SafeWrapFuncNoGL(func, funcName) + else + return SafeWrapFuncGL(func, funcName) + end + end +end + + +local function SafeWrapWidget(widget) + if (SAFEWRAP <= 0) then + return + elseif (SAFEWRAP == 1) then + if (widget.GetInfo and widget.GetInfo().unsafe) then + Spring.LOG(section, LOG.INFO, 'LuaUI: loaded unsafe widget: ' .. widget.whInfo.name) + return + end + end + + for _,ciName in ipairs(callInLists) do + if (widget[ciName]) then + widget[ciName] = SafeWrapFunc(widget[ciName], ciName) + end + if (widget.Initialize) then + widget.Initialize = SafeWrapFunc(widget.Initialize, 'Initialize') + end + end +end + + +-------------------------------------------------------------------------------- + +local function ArrayInsert(t, f, w) + if (f) then + local layer = w.whInfo.layer + local index = 1 + for i,v in ipairs(t) do + if (v == w) then + return -- already in the table + end + if (layer >= v.whInfo.layer) then + index = i + 1 + end + end + table.insert(t, index, w) + end +end + + +local function ArrayRemove(t, w) + for k,v in ipairs(t) do + if (v == w) then + table.remove(t, k) + -- break + end + end +end + + +function widgetHandler:InsertWidget(widget) + if (widget == nil) then + return + end + + SafeWrapWidget(widget) + + ArrayInsert(self.widgets, true, widget) + for _,listname in ipairs(callInLists) do + local func = widget[listname] + if (type(func) == 'function') then + ArrayInsert(self[listname..'List'], func, widget) + end + end + self:UpdateCallIns() + + if (widget.Initialize) then + widget:Initialize() + end +end + + +function widgetHandler:RemoveWidget(widget) + if (widget == nil) then + return + end + + local name = widget.whInfo.name + if (widget.GetConfigData) then + self.configData[name] = widget:GetConfigData() + end + self.knownWidgets[name].active = false + if (widget.Shutdown) then + widget:Shutdown() + end + ArrayRemove(self.widgets, widget) + self:RemoveWidgetGlobals(widget) + self.actionHandler:RemoveWidgetActions(widget) + for _,listname in ipairs(callInLists) do + ArrayRemove(self[listname..'List'], widget) + end + self:UpdateCallIns() + + if (widget.whInfo.basename == SELECTOR_BASENAME) then + Spring.SendCommands({"luaui update"}) + end +end + + +-------------------------------------------------------------------------------- + +function widgetHandler:UpdateCallIn(name) + local listName = name .. 'List' + if ((name == 'Update') or + (name == 'DrawScreen')) then + return + end + + if ((#self[listName] > 0) or + (not flexCallInMap[name]) or + ((name == 'GotChatMsg') and actionHandler.HaveChatAction()) or + ((name == 'RecvFromSynced'))) then + -- always assign these call-ins + local selffunc = self[name] + _G[name] = function(...) + return selffunc(self, ...) + end + else + _G[name] = nil + end + Script.UpdateCallIn(name) +end + + +function widgetHandler:UpdateWidgetCallIn(name, w) + local listName = name .. 'List' + local ciList = self[listName] + if (ciList) then + local func = w[name] + if (type(func) == 'function') then + ArrayInsert(ciList, func, w) + else + ArrayRemove(ciList, w) + end + self:UpdateCallIn(name) + else + Spring.Log(section, LOG.ERROR, 'UpdateWidgetCallIn: bad name: ' .. name) + end +end + + +function widgetHandler:RemoveWidgetCallIn(name, w) + local listName = name .. 'List' + local ciList = self[listName] + if (ciList) then + ArrayRemove(ciList, w) + self:UpdateCallIn(name) + else + Spring.Log(section, LOG.ERROR, 'RemoveWidgetCallIn: bad name: ' .. name) + end +end + + +function widgetHandler:UpdateCallIns() + for _,name in ipairs(callInLists) do + self:UpdateCallIn(name) + end +end + + +function widgetHandler:SelectorActive() + for _,w in ipairs(self.widgets) do + if (w.whInfo.basename == SELECTOR_BASENAME) then + return true + end + end + return false +end +-------------------------------------------------------------------------------- + +function widgetHandler:EnableWidget(name) + local ki = self.knownWidgets[name] + if (not ki) then + Spring.Log(section, LOG.ERROR, "EnableWidget(), could not find widget: " .. tostring(name)) + return false + end + if (not ki.active) then + Spring.Log(section, LOG.INFO, 'Loading: '..ki.filename) + local order = widgetHandler.orderList[name] + if (not order or (order <= 0)) then + self.orderList[name] = 1 + end + local w = self:LoadWidget(ki.filename) + if (not w) then return false end + self:InsertWidget(w) + self:SaveConfigData() + end + + if (not self:SelectorActive()) then + Spring.SendCommands({"luaui update"}) + end + + return true +end + + +function widgetHandler:DisableWidget(name) + local ki = self.knownWidgets[name] + if (not ki) then + Spring.Log(section, LOG.ERROR, "DisableWidget(), could not find widget: " .. tostring(name)) + return false + end + if (ki.active) then + local w = self:FindWidget(name) + if (not w) then return false end + Spring.Log(section, LOG.INFO, 'Removed: '..ki.filename) + self:RemoveWidget(w) -- deactivate + self.orderList[name] = 0 -- disable + self:SaveConfigData() + end + + if (not self:SelectorActive()) then + Spring.SendCommands({"luaui update"}) + end + + return true +end + + +function widgetHandler:ToggleWidget(name) + local ki = self.knownWidgets[name] + if (not ki) then + Spring.Log(section, LOG.ERROR, "ToggleWidget(), could not find widget: " .. tostring(name)) + return + end + if (ki.active) then + return self:DisableWidget(name) + elseif (self.orderList[name] <= 0) then + return self:EnableWidget(name) + else + -- the widget is not active, but enabled; disable it + self.orderList[name] = 0 + self:SaveConfigData() + end + return true +end + + +-------------------------------------------------------------------------------- + +local function FindWidgetIndex(t, w) + for k,v in ipairs(t) do + if (v == w) then + return k + end + end + return nil +end + + +local function FindLowestIndex(t, i, layer) + for x = (i - 1), 1, -1 do + if (t[x].whInfo.layer < layer) then + return x + 1 + end + end + return 1 +end + + +function widgetHandler:RaiseWidget(widget) + if (widget == nil) then + return + end + local function Raise(t, f, w) + if (f == nil) then return end + local i = FindWidgetIndex(t, w) + if (i == nil) then return end + local n = FindLowestIndex(t, i, w.whInfo.layer) + if (n and (n < i)) then + table.remove(t, i) + table.insert(t, n, w) + end + end + Raise(self.widgets, true, widget) + for _,listname in ipairs(callInLists) do + Raise(self[listname..'List'], widget[listname], widget) + end +end + + +local function FindHighestIndex(t, i, layer) + local ts = #t + for x = (i + 1),ts do + if (t[x].whInfo.layer > layer) then + return (x - 1) + end + end + return (ts + 1) +end + + +function widgetHandler:LowerWidget(widget) + if (widget == nil) then + return + end + local function Lower(t, f, w) + if (f == nil) then return end + local i = FindWidgetIndex(t, w) + if (i == nil) then return end + local n = FindHighestIndex(t, i, w.whInfo.layer) + if (n and (n > i)) then + table.insert(t, n, w) + table.remove(t, i) + end + end + Lower(self.widgets, true, widget) + for _,listname in ipairs(callInLists) do + Lower(self[listname..'List'], widget[listname], widget) + end +end + + +function widgetHandler:FindWidget(name) + if (type(name) ~= 'string') then + return nil + end + for k,v in ipairs(self.widgets) do + if (name == v.whInfo.name) then + return v,k + end + end + return nil +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Global var/func management +-- + +function widgetHandler:RegisterGlobal(owner, name, value) + if ((name == nil) or + (_G[name]) or + (self.globals[name]) or + (CallInsMap[name])) then + return false + end + _G[name] = value + self.globals[name] = owner + return true +end + + +function widgetHandler:DeregisterGlobal(owner, name) + if (name == nil) then + return false + end + _G[name] = nil + self.globals[name] = nil + return true +end + + +function widgetHandler:SetGlobal(owner, name, value) + if ((name == nil) or (self.globals[name] ~= owner)) then + return false + end + _G[name] = value + return true +end + + +function widgetHandler:RemoveWidgetGlobals(owner) + local count = 0 + for name, o in pairs(self.globals) do + if (o == owner) then + _G[name] = nil + self.globals[name] = nil + count = count + 1 + end + end + return count +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- Helper facilities +-- + +local hourTimer = 0 + + +function widgetHandler:GetHourTimer() + return hourTimer +end + + +function widgetHandler:GetViewSizes() + return self.xViewSize, self.yViewSize +end + + +function widgetHandler:ForceLayout() + forceLayout = true -- in main.lua +end + + +function widgetHandler:ConfigLayoutHandler(data) + ConfigLayoutHandler(data) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- +-- The call-in distribution routines +-- + +function widgetHandler:Shutdown() + self:SaveConfigData() + for _,w in ipairs(self.ShutdownList) do + w:Shutdown() + end + return +end + +function widgetHandler:Update() + local deltaTime = Spring.GetLastUpdateSeconds() + -- update the hour timer + hourTimer = (hourTimer + deltaTime) % 3600.0 + for _,w in ipairs(self.UpdateList) do + w:Update(deltaTime) + end + return +end + + +function widgetHandler:ConfigureLayout(command) + if (command == 'tweakgui') then + self.tweakKeys = {} + self.tweakMode = true + Spring.Log(section, LOG.INFO, "LuaUI TweakMode: ON") + return true + elseif (command == 'reconf') then + self:SendConfigData() + return true + elseif (command == 'selector') then + if (self:SelectorActive()) then + return true -- there can only be one + end + local sw = self:LoadWidget(LUAUI_DIRNAME .. SELECTOR_BASENAME) + self:InsertWidget(sw) + self:RaiseWidget(sw) + return true + elseif (string.find(command, 'togglewidget') == 1) then + self:ToggleWidget(string.sub(command, 14)) + return true + elseif (string.find(command, 'enablewidget') == 1) then + self:EnableWidget(string.sub(command, 14)) + return true + elseif (string.find(command, 'disablewidget') == 1) then + self:DisableWidget(string.sub(command, 15)) + return true + end + + if (self.actionHandler:TextAction(command)) then + return true + end + + for _,w in ipairs(self.TextCommandList) do + if (w:TextCommand(command)) then + return true + end + end + return false +end + + +function widgetHandler:CommandNotify(id, params, options) + for _,w in ipairs(self.CommandNotifyList) do + if (w:CommandNotify(id, params, options)) then + return true + end + end + return false +end + + +function widgetHandler:AddConsoleLine(msg, priority) + for _,w in ipairs(self.AddConsoleLineList) do + w:AddConsoleLine(msg, priority) + end + return +end + + +function widgetHandler:GroupChanged(groupID) + for _,w in ipairs(self.GroupChangedList) do + w:GroupChanged(groupID) + end + return +end + + +function widgetHandler:CommandsChanged() + if widgetHandler:UpdateSelection() then -- for selectionchanged + return -- selection updated, don't call commands changed. + end + self.inCommandsChanged = true + self.customCommands = {} + for _,w in ipairs(self.CommandsChangedList) do + w:CommandsChanged() + end + self.inCommandsChanged = false + return +end + + +-------------------------------------------------------------------------------- +-- +-- Drawing call-ins +-- + + +-- generates ViewResize() calls for the widgets +function widgetHandler:SetViewSize(vsx, vsy) + self.xViewSize = vsx + self.yViewSize = vsy + if ((self.xViewSizeOld ~= vsx) or + (self.yViewSizeOld ~= vsy)) then + widgetHandler:ViewResize(vsx, vsy) + self.xViewSizeOld = vsx + self.yViewSizeOld = vsy + end +end + + +function widgetHandler:ViewResize(vsx, vsy) + if (type(vsx) == 'table') then + vsy = vsx.viewSizeY + vsx = vsx.viewSizeX + print('real ViewResize') -- FIXME + end + + for _,w in ipairs(self.ViewResizeList) do + w:ViewResize(vsx, vsy) + end + return +end + + +function widgetHandler:DrawScreen() + if (self.tweakMode) then + gl.Color(0, 0, 0, 0.5) + local sx, sy = self.xViewSize, self.yViewSize + gl.Shape(GL.QUADS, { + {v = { 0, 0 }}, {v = { sx, 0 }}, {v = { sx, sy }}, {v = { 0, sy }} + }) + gl.Color(1, 1, 1) + end + for _,w in ripairs(self.DrawScreenList) do + w:DrawScreen() + if (self.tweakMode and w.TweakDrawScreen) then + w:TweakDrawScreen() + end + end + return +end + + +function widgetHandler:DrawGenesis() + for _,w in ripairs(self.DrawGenesisList) do + w:DrawGenesis() + end + return +end + + +function widgetHandler:DrawWorld() + for _,w in ripairs(self.DrawWorldList) do + w:DrawWorld() + end + return +end + + +function widgetHandler:DrawWorldPreUnit() + for _,w in ripairs(self.DrawWorldPreUnitList) do + w:DrawWorldPreUnit() + end + return +end + + +function widgetHandler:DrawWorldShadow() + for _,w in ripairs(self.DrawWorldShadowList) do + w:DrawWorldShadow() + end + return +end + + +function widgetHandler:DrawWorldReflection() + for _,w in ripairs(self.DrawWorldReflectionList) do + w:DrawWorldReflection() + end + return +end + + +function widgetHandler:DrawWorldRefraction() + for _,w in ripairs(self.DrawWorldRefractionList) do + w:DrawWorldRefraction() + end + return +end + + +function widgetHandler:DrawUnitsPostDeferred() + for _,w in ripairs(self.DrawUnitsPostDeferredList) do + w:DrawUnitsPostDeferred() + end + return +end + + +function widgetHandler:DrawFeaturesPostDeferred() + for _,w in ripairs(self.DrawFeaturesPostDeferredList) do + w:DrawFeaturesPostDeferred() + end + return +end + + +function widgetHandler:DrawScreenEffects(vsx, vsy) + for _,w in ripairs(self.DrawScreenEffectsList) do + w:DrawScreenEffects(vsx, vsy) + end + return +end + + +function widgetHandler:DrawInMiniMap(xSize, ySize) + for _,w in ripairs(self.DrawInMiniMapList) do + w:DrawInMiniMap(xSize, ySize) + end + return +end + +function widgetHandler:SunChanged() + for _,w in ripairs(self.SunChangedList) do + w:SunChanged() + end + return +end + + +-------------------------------------------------------------------------------- +-- +-- Keyboard call-ins +-- + +function widgetHandler:KeyPress(key, mods, isRepeat, label, unicode) + if (self.tweakMode) then + self.tweakKeys[key] = true + local mo = self.mouseOwner + if (mo and mo.TweakKeyPress) then + mo:TweakKeyPress(key, mods, isRepeat, label, unicode) + end + return true + end + + if (self.actionHandler:KeyAction(true, key, mods, isRepeat)) then + return true + end + + for _,w in ipairs(self.KeyPressList) do + if (w:KeyPress(key, mods, isRepeat, label, unicode)) then + return true + end + end + return false +end + + +function widgetHandler:KeyRelease(key, mods, label, unicode) + if (self.tweakMode and self.tweakKeys[key] ~= nil) then + local mo = self.mouseOwner + if (mo and mo.TweakKeyRelease) then + mo:TweakKeyRelease(key, mods, label, unicode) + elseif (key == KEYSYMS.ESCAPE) then + Spring.Log(section, LOG.INFO, "LuaUI TweakMode: OFF") + self.tweakMode = false + end + return true + end + + if (self.actionHandler:KeyAction(false, key, mods, false)) then + return true + end + + for _,w in ipairs(self.KeyReleaseList) do + if (w:KeyRelease(key, mods, label, unicode)) then + return true + end + end + return false +end + +function widgetHandler:TextInput(utf8, ...) + if (self.tweakMode) then + return true + end + + for _,w in ipairs(self.TextInputList) do + if (w:TextInput(utf8, ...)) then + return true + end + end + return false +end + +-------------------------------------------------------------------------------- +-- +-- Mouse call-ins +-- + +-- local helper (not a real call-in) +function widgetHandler:WidgetAt(x, y) + if (not self.tweakMode) then + for _,w in ipairs(self.IsAboveList) do + if (w:IsAbove(x, y)) then + return w + end + end + else + for _,w in ipairs(self.TweakIsAboveList) do + if (w:TweakIsAbove(x, y)) then + return w + end + end + end + return nil +end + + +function widgetHandler:MousePress(x, y, button) + local mo = self.mouseOwner + if (not self.tweakMode) then + if (mo) then + mo:MousePress(x, y, button) + return true -- already have an active press + end + for _,w in ipairs(self.MousePressList) do + if (w:MousePress(x, y, button)) then + if (not mo) then + self.mouseOwner = w + end + return true + end + end + return false + else + if (mo) then + mo:TweakMousePress(x, y, button) + return true -- already have an active press + end + for _,w in ipairs(self.TweakMousePressList) do + if (w:TweakMousePress(x, y, button)) then + self.mouseOwner = w + return true + end + end + return true -- always grab the mouse + end +end + + +function widgetHandler:MouseMove(x, y, dx, dy, button) + local mo = self.mouseOwner + if (not self.tweakMode) then + if (mo and mo.MouseMove) then + return mo:MouseMove(x, y, dx, dy, button) + end + else + if (mo and mo.TweakMouseMove) then + mo:TweakMouseMove(x, y, dx, dy, button) + end + return true + end +end + + +function widgetHandler:MouseRelease(x, y, button) + local mo = self.mouseOwner + local mx, my, lmb, mmb, rmb = Spring.GetMouseState() + if (not (lmb or mmb or rmb)) then + self.mouseOwner = nil + end + + if (not self.tweakMode) then + if (mo and mo.MouseRelease) then + return mo:MouseRelease(x, y, button) + end + return -1 + else + if (mo and mo.TweakMouseRelease) then + mo:TweakMouseRelease(x, y, button) + end + return -1 + end +end + + +function widgetHandler:MouseWheel(up, value) + if (not self.tweakMode) then + for _,w in ipairs(self.MouseWheelList) do + if (w:MouseWheel(up, value)) then + return true + end + end + return false + else + for _,w in ipairs(self.TweakMouseWheelList) do + if (w:TweakMouseWheel(up, value)) then + return true + end + end + return false -- FIXME: always grab in tweakmode? + end +end + +function widgetHandler:JoyAxis(axis, value) + for _,w in ipairs(self.JoyAxisList) do + if (w:JoyAxis(axis, value)) then + return true + end + end + return false +end + +function widgetHandler:JoyHat(hat, value) + for _,w in ipairs(self.JoyHatList) do + if (w:JoyHat(hat, value)) then + return true + end + end + return false +end + +function widgetHandler:JoyButtonDown(button, state) + for _,w in ipairs(self.JoyButtonDownList) do + if (w:JoyButtonDown(button, state)) then + return true + end + end + return false +end + +function widgetHandler:JoyButtonUp(button, state) + for _,w in ipairs(self.JoyButtonUpList) do + if (w:JoyButtonUp(button, state)) then + return true + end + end + return false +end + +function widgetHandler:IsAbove(x, y) + if (self.tweakMode) then + return true + end + return (widgetHandler:WidgetAt(x, y) ~= nil) +end + + +function widgetHandler:GetTooltip(x, y) + if (not self.tweakMode) then + for _,w in ipairs(self.GetTooltipList) do + if (w:IsAbove(x, y)) then + local tip = w:GetTooltip(x, y) + if ((type(tip) == 'string') and (#tip > 0)) then + return tip + end + end + end + return "" + else + for _,w in ipairs(self.TweakGetTooltipList) do + if (w:TweakIsAbove(x, y)) then + local tip = w:TweakGetTooltip(x, y) or '' + if ((type(tip) == 'string') and (#tip > 0)) then + return tip + end + end + end + return "Tweak Mode -- hit ESCAPE to cancel" + end +end + + +-------------------------------------------------------------------------------- +-- +-- Game call-ins +-- + +function widgetHandler:GamePreload() + for _,w in ipairs(self.GamePreloadList) do + w:GamePreload() + end + return +end + +function widgetHandler:GameStart() + for _,w in ipairs(self.GameStartList) do + w:GameStart() + end + return +end + +function widgetHandler:GameOver() + for _,w in ipairs(self.GameOverList) do + w:GameOver() + end + return +end + + +function widgetHandler:GamePaused(playerID, paused) + for _,w in ipairs(self.GamePausedList) do + w:GamePaused(playerID, paused) + end + return +end + + +function widgetHandler:TeamDied(teamID) + for _,w in ipairs(self.TeamDiedList) do + w:TeamDied(teamID) + end + return +end + + +function widgetHandler:TeamChanged(teamID) + for _,w in ipairs(self.TeamChangedList) do + w:TeamChanged(teamID) + end + return +end + + +function widgetHandler:PlayerChanged(playerID) + for _,w in ipairs(self.PlayerChangedList) do + w:PlayerChanged(playerID) + end + return +end + + +function widgetHandler:PlayerAdded(playerID) + for _,w in ipairs(self.PlayerAddedList) do + w:PlayerAdded(playerID) + end + return +end + + +function widgetHandler:PlayerRemoved(playerID, reason) + for _,w in ipairs(self.PlayerRemovedList) do + w:PlayerRemoved(playerID, reason) + end + return +end + + +function widgetHandler:GameFrame(frameNum) + for _,w in ipairs(self.GameFrameList) do + w:GameFrame(frameNum) + end + return +end + +-- local helper (not a real call-in) +local oldSelection = {} +function widgetHandler:UpdateSelection() + local changed + local newSelection = Spring.GetSelectedUnits() + if (#newSelection == #oldSelection) then + for i = 1, #oldSelection do + if (newSelection[i] ~= oldSelection[i]) then -- it seems the order stays + changed = true + break + end + end + else + changed = true + end + if (changed) then + local subselection = true + if #newSelection > #oldSelection then + subselection = false + else + local newSeen = 0 + local oldSelectionMap = {} + for i = 1, #oldSelection do + oldSelectionMap[oldSelection[i]] = true + end + for i = 1, #newSelection do + if not oldSelectionMap[newSelection[i]] then + subselection = false + break + end + end + end + if widgetHandler:SelectionChanged(newSelection, subselection) then + -- selection changed, don't set old selection to new selection as it is soon to change. + return true + end + end + oldSelection = newSelection + return false +end + +function widgetHandler:SelectionChanged(selectedUnits, subselection) + for _,w in ipairs(self.SelectionChangedList) do + if widgetHandler.WG['smartselect'] and not widgetHandler.WG['smartselect'].updateSelection then return end + local unitArray = w:SelectionChanged(selectedUnits, subselection) + if (unitArray) then + Spring.SelectUnitArray(unitArray) + return true + end + end + return false +end + +function widgetHandler:ShockFront(power, dx, dy, dz) + for _,w in ipairs(self.ShockFrontList) do + w:ShockFront(power, dx, dy, dz) + end + return +end + +function widgetHandler:RecvSkirmishAIMessage(aiTeam, dataStr) + for _,w in ipairs(self.RecvSkirmishAIMessageList) do + local dataRet = w:RecvSkirmishAIMessage(aiTeam, dataStr) + if (dataRet) then + return dataRet + end + end +end + +function widgetHandler:WorldTooltip(ttType, ...) + for _,w in ipairs(self.WorldTooltipList) do + local tt = w:WorldTooltip(ttType, ...) + if ((type(tt) == 'string') and (#tt > 0)) then + return tt + end + end + return +end + + +function widgetHandler:MapDrawCmd(playerID, cmdType, px, py, pz, ...) + local retval = false + for _,w in ipairs(self.MapDrawCmdList) do + local takeEvent = w:MapDrawCmd(playerID, cmdType, px, py, pz, ...) + if (takeEvent) then + retval = true + end + end + return retval +end + + +function widgetHandler:GameSetup(state, ready, playerStates) + for _,w in ipairs(self.GameSetupList) do + local success, newReady = w:GameSetup(state, ready, playerStates) + if (success) then + return true, newReady + end + end + return false +end + + +function widgetHandler:DefaultCommand(...) + for _,w in ripairs(self.DefaultCommandList) do + local result = w:DefaultCommand(...) + if (type(result) == 'number') then + return result + end + end + return nil -- not a number, use the default engine command +end + + +-------------------------------------------------------------------------------- +-- +-- Unit call-ins +-- + +function widgetHandler:UnitCreated(unitID, unitDefID, unitTeam, builderID) + for _,w in ipairs(self.UnitCreatedList) do + w:UnitCreated(unitID, unitDefID, unitTeam, builderID) + end + return +end + + +function widgetHandler:UnitFinished(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitFinishedList) do + w:UnitFinished(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitFromFactory(unitID, unitDefID, unitTeam, + factID, factDefID, userOrders) + for _,w in ipairs(self.UnitFromFactoryList) do + w:UnitFromFactory(unitID, unitDefID, unitTeam, + factID, factDefID, userOrders) + end + return +end + + +function widgetHandler:UnitReverseBuilt(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitReverseBuiltList) do + w:UnitReverseBuilt(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitDestroyed(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitDestroyedList) do + w:UnitDestroyed(unitID, unitDefID, unitTeam) + end + return +end + +function widgetHandler:RenderUnitDestroyed(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.RenderUnitDestroyedList) do + w:RenderUnitDestroyed(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + for _,w in ipairs(self.UnitTakenList) do + w:UnitTaken(unitID, unitDefID, unitTeam, newTeam) + end + return +end + + +function widgetHandler:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + for _,w in ipairs(self.UnitGivenList) do + w:UnitGiven(unitID, unitDefID, unitTeam, oldTeam) + end + return +end + + +function widgetHandler:UnitIdle(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitIdleList) do + w:UnitIdle(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitCommand(unitID, unitDefID, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag) + for _,w in ipairs(self.UnitCommandList) do + w:UnitCommand(unitID, unitDefID, unitTeam, cmdId, cmdParams, cmdOpts, cmdTag) + end + return +end + + +function widgetHandler:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) + for _,w in ipairs(self.UnitCmdDoneList) do + w:UnitCmdDone(unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag) + end + return +end + + +function widgetHandler:UnitDamaged(unitID, unitDefID, unitTeam, + damage, paralyzer) + for _,w in ipairs(self.UnitDamagedList) do + w:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer) + end + return +end + +function widgetHandler:UnitStunned(unitID, unitDefID, unitTeam, stunned) + for _,w in ipairs(self.UnitStunnedList) do + w:UnitStunned(unitID, unitDefID, unitTeam, stunned) + end + return +end + + +function widgetHandler:UnitEnteredRadar(unitID, unitTeam) + for _,w in ipairs(self.UnitEnteredRadarList) do + w:UnitEnteredRadar(unitID, unitTeam) + end + return +end + + +function widgetHandler:UnitEnteredLos(unitID, unitTeam) + for _,w in ipairs(self.UnitEnteredLosList) do + w:UnitEnteredLos(unitID, unitTeam) + end + return +end + + +function widgetHandler:UnitLeftRadar(unitID, unitTeam) + for _,w in ipairs(self.UnitLeftRadarList) do + w:UnitLeftRadar(unitID, unitTeam) + end + return +end + + +function widgetHandler:UnitLeftLos(unitID, unitTeam) + for _,w in ipairs(self.UnitLeftLosList) do + w:UnitLeftLos(unitID, unitTeam) + end + return +end + + +function widgetHandler:UnitEnteredWater(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitEnteredWaterList) do + w:UnitEnteredWater(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitEnteredAir(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitEnteredAirList) do + w:UnitEnteredAir(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitLeftWater(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitLeftWaterList) do + w:UnitLeftWater(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitLeftAir(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitLeftAirList) do + w:UnitLeftAir(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitSeismicPing(x, y, z, strength) + for _,w in ipairs(self.UnitSeismicPingList) do + w:UnitSeismicPing(x, y, z, strength) + end + return +end + + +function widgetHandler:UnitLoaded(unitID, unitDefID, unitTeam, + transportID, transportTeam) + for _,w in ipairs(self.UnitLoadedList) do + w:UnitLoaded(unitID, unitDefID, unitTeam, + transportID, transportTeam) + end + return +end + + +function widgetHandler:UnitUnloaded(unitID, unitDefID, unitTeam, + transportID, transportTeam) + for _,w in ipairs(self.UnitUnloadedList) do + w:UnitUnloaded(unitID, unitDefID, unitTeam, + transportID, transportTeam) + end + return +end + + +function widgetHandler:UnitCloaked(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitCloakedList) do + w:UnitCloaked(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitDecloaked(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitDecloakedList) do + w:UnitDecloaked(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:UnitMoveFailed(unitID, unitDefID, unitTeam) + for _,w in ipairs(self.UnitMoveFailedList) do + w:UnitMoveFailed(unitID, unitDefID, unitTeam) + end + return +end + + +function widgetHandler:RecvLuaMsg(msg, playerID) + local retval = false + for _,w in ipairs(self.RecvLuaMsgList) do + if (w:RecvLuaMsg(msg, playerID)) then + retval = true + end + end + return retval -- FIXME -- another actionHandler type? +end + + +function widgetHandler:RecvFromSynced(...) + local retval = false + if (self.actionHandler:RecvFromSynced(...)) then + retval = true + end + for _,w in ipairs(self.RecvFromSyncedList) do + if (w:RecvFromSynced(...)) then + retval = true + end + end + return retval +end + + +function widgetHandler:StockpileChanged(unitID, unitDefID, unitTeam, + weaponNum, oldCount, newCount) + for _,w in ipairs(self.StockpileChangedList) do + w:StockpileChanged(unitID, unitDefID, unitTeam, + weaponNum, oldCount, newCount) + end + return +end + +-------------------------------------------------------------------------------- +-- +-- Download call-ins +-- + +function widgetHandler:DownloadStarted(id) + for _,w in ipairs(self.DownloadStartedList) do + w:DownloadStarted(id) + end +end + +function widgetHandler:DownloadQueued(id) + for _,w in ipairs(self.DownloadQueuedList) do + w:DownloadQueued(id) + end +end + +function widgetHandler:DownloadFinished(id) + for _,w in ipairs(self.DownloadFinishedList) do + w:DownloadFinished(id) + end +end + +function widgetHandler:DownloadFailed(id, errorid) + for _,w in ipairs(self.DownloadFailedList) do + w:DownloadFailed(id, errorid) + end +end + +function widgetHandler:DownloadProgress(id, downloaded, total) + for _,w in ipairs(self.DownloadProgressList) do + w:DownloadProgress(id, downloaded, total) + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +widgetHandler:Initialize() + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/ModOptions.lua b/ModOptions.lua index 82d0ca254..10402d73d 100644 --- a/ModOptions.lua +++ b/ModOptions.lua @@ -1,48 +1,567 @@ local options= { - { - key = 'StartingResources', - name = 'Starting Resources', - desc = 'Sets storage and amount of resources that players will start with', - type = 'section', - }, - { - key = 'StartMetal', - name = 'Starting metal', - desc = 'Determines amount of metal and metal storage that each player will start with', - type = 'number', - section= 'StartingResources', - def = 100, - min = 0, - max = 1000, - step = 1, -- quantization is aligned to the def value - -- (step <= 0) means that there is no quantization - }, - { - key = 'StartEnergy', - name = 'Starting energy', - desc = 'Determines amount of energy and energy storage that each player will start with', - type = 'number', - section= 'StartingResources', - def = 250, - min = 0, - max = 1000, - step = 1, -- quantization is aligned to the def value - -- (step <= 0) means that there is no quantization - }, - { - key="gameplayspeed", - name="Gameplay Speed", - desc="Modifies buildtimes based upon cost", - type="list", - def="faster", - section="other", - items={ - {key="normal", name="Normal", desc="Unit buildtimes are equal to their metal cost"}, - {key="fast", name="Fast", desc="Unit buildtimes are equal to their metal cost divided by 2"}, - {key="faster", name="Faster", desc="Unit buildtimes are equal to their metal cost divided by 4"}, - {key="fastest", name="Fastest", desc="All units have a buildtime of 5 seconds"}, + { + key = 'startingresources', + name = 'Starting Resources', + desc = 'Sets the storage and amount of resources with which each player will start', + type = 'section', + }, + { + key = 'startmetal', + name = 'Starting Metal', + desc = 'Determines the amount of metal and metal storage with which each player will start', + type = 'number', + section= 'startingresources', + def = 100, + min = 0, + max = 1000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'startenergy', + name = 'Starting Energy', + desc = 'Determines the amount of energy and energy storage with which each player will start', + type = 'number', + section= 'startingresources', + def = 100, + min = 0, + max = 1000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + +-- Shard AI Options + { + key = 'aioptions', + name = 'DAI (AI Opponent) Options', + desc = 'Allows you to adjust ShardLua settings', + type = 'section', + }, + { + key = 'aidebug', + name = 'AI is spamming chat with debug values', + desc = 'AI is spamming chat with debug values', + type="list", + def="disabled", + section= "aioptions", + items={ + {key="disabled", name="Disabled", desc="Clean Chat"}, + {key="enabled", name="Enabled", desc="Cries in Spam"}, + } + }, + { + key = 'ai_enableincomemultiplier', + name = 'Enable DAI resource cheats', + desc = 'Enable DAI resource cheats', + type="list", + def="disabled", + section= "aioptions", + items={ + {key="disabled", name="Disabled", desc="Clean, non cheating AI"}, + {key="enabled", name="Enabled", desc="Laughs in hardcore"}, + } + }, + { + key = 'ai_incomemultiplier', + name = 'AI Income Percentage', + desc = 'Percentage of AI resource income compared to the default (100 = 100%, I.E. Normal. 200 = 200%, which would mean that the AI income would be double the player income)', + type = 'number', + section= 'aioptions', + def = 100, + min = 1, + max = 1000, + step = 1, + }, + +-- Resourcing + { + key = 'resourcing', + name = 'Resourcing Options', + desc = 'Allows you to adjust how metal income is handled and how it is distributed', + type = 'section', + }, + { + key = 'mexlayout', + name = 'Default Metal Spot Layout', + desc = 'If enabled, the default layout for metal spots will be used, if disabled, the metal spots defined by the map will be used.', + type="list", + def="enabled", + section= "resourcing", + items={ + {key="disabled", name="Disabled", desc="Use the Metal Map Layout defined in the map"}, + {key="enabled", name="Enabled", desc="Default Metal Map Layout"}, + } + }, + { + key = 'mexrandomlayout', + name = 'Metal Spot Layout to use', + desc = 'This allows you to choose between the different metal spot layouts that are available.', + type="list", + def="standard", + section= "resourcing", + items={ + {key="standard", name="Standard", desc="Random placing that is mirrored. Has various methods for different map shapes and is more careful with metal spot placement."}, + {key="ffa", name="Free For All", desc=""}, + {key="legacy1", name="Legacy 1", desc="Most uniform layout. Max metal ~49.1, Max metal spots 56."}, + {key="legacy2", name="Legacy 2", desc="Less uniform, more clustered layout. Max metal ~50, Max metal spots 56."}, + {key="legacy3", name="Legacy 3", desc="The Pitchfork! Dense metal layout with lower output per metal spot. Max metal ~51.1, Max metal spots 94."}, + {key="legacy4", name="Legacy 4", desc=""}, } }, + { + key = 'maximummexelevationdifference', + name = 'Standard Metal Spot Layout: Maximum elevation difference for Metal Spot locations', + desc = 'This is used as an attempt to avoid placement on cliffs (only works on Standard Metal Spot Layout)', + type = 'number', + section= 'resourcing', + def = 50, + min = 0, + max = 200, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'allowmexesinwater', + name = 'Standard Metal Spot Layout: Allow metal spots to be placed in water?', + desc = 'Should metal spots be placed in water? Sometimes turning this off can be beneficial if the water on a map does damage. (only works on Standard Metal Spot Layout)', + type="list", + def="disabled", + section= "resourcing", + items={ + {key="disabled", name="Disabled", desc="Disallow metal spots being placed in water."}, + {key="enabled", name="Enabled", desc="Allow metal spots to be placed in water."}, + } + }, + { + key = 'dynamicmexoutput', + name = 'Should metal spot output values be dynamic?', + desc = 'Uses a sine to determine metal spot values based upon distance from the edge of the map and distance to the center.', + type="list", + def="disabled", + section= "resourcing", + items={ + {key="disabled", name="Disabled", desc="All metal spot output values will be set to 1.0"}, + {key="enabled", name="Enabled", desc="All metal spot output values will be automatically calculated"}, + } + }, + { + key = 'mexspotspersidemultiplier', + name = 'Metal spot per side percentage modifier', + desc = 'This is a percentage modifier for the amount of metal spots on a map. A setting of 100 is literally 100%, so increasing to 200% will double the amount of metal spots that are placed on the map. Remember that the amount of metal spots is already scaled according to how many players are in the game.', + type = 'number', + section= 'resourcing', + def = 100, + min = 1, + max = 200, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'metalextractorcommunism', + name = 'Metal Extractor Communism', + desc = 'If enabled, then all metal income from Metal Extractors is split between allies. This means that it does not matter which ally owns the metal extractor, the entire team will benefit.', + type="list", + def="disabled", + section= "resourcing", + items={ + {key="disabled", name="Disabled", desc="Metal Extractor income will NOT be split between allies."}, + {key="enabled", name="Enabled", desc="Metal Extractor income will be split between allies."}, + } + }, + { + key = 'mincome', + name = 'Automatic Metal Income', + desc = 'Determines the amount of metal income you start with per second. It increases every (2.5 minutes, is the default) by this amount until it hits income.', + type="list", + def="enabled", + section= "resourcing", + items={ + {key="disabled", name="Disabled", desc="Turn off the automatic metal income"}, + {key="enabled", name="Enabled", desc="Metal income is automatic and graduates as the game goes along."}, + } + }, + { + key = 'basicincome', + name = 'Basic Metal Income Amount', + desc = 'Determines the amount of metal income you start with per second.', + type = 'number', + section= 'resourcing', + def = 1, + min = 0, + max = 5, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'basicincomeinterval', + name = 'Basic Metal Income Increase Interval', + desc = 'Determines how often your basic metal income is increased.', + type = 'number', + section= 'resourcing', + def = 2.5, + min = 0.5, + max = 5, + step = 0.5, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'basicincomeincrease', + name = 'Basic Metal Income Increase', + desc = 'Your basic metal income increases every (1 minutes, is the default) by this amount until it hits income.', + type = 'number', + section= 'resourcing', + def = 1, + min = 0, + max = 5, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'maxbasicincome', + name = 'Maximum Basic Metal Income', + desc = 'Determines the maximum amount that your basic metal income level can reach.', + type = 'number', + section= 'resourcing', + def = 10, + min = 0, + max = 30, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + + { + key = 'supplyoptions', + name = 'Supply Options', + desc = 'Allows you to set options that effect Supply', + type = 'section', + }, + { + key = 'supplycap', + name = 'Maximum Army Supply', + desc = 'Determines the maximum army supply that is allowed.', + type = 'number', + section= 'supplyoptions', + def = 1000000, + min = 50, + max = 1000000, + step = 50, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'intrinsicsupply', + name = 'Intrinsic Army Supply', + desc = 'How much supply is available from the beginning of the game without needing supply depots?', + type = 'number', + section= 'supplyoptions', + def = 10, + min = 10, + max = 400, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + + { + key = 'mexcost', + name = 'Metal Extractor Costs', + desc = 'Allows you to set the cost of Metal Extractors', + type = 'section', + }, + { + key = 'metalextractorcostateran', + name = 'Ateran Metal Extractor Cost', + desc = 'How much metal does an Ateran Metal Extractor cost?', + type = 'number', + section= 'mexcost', + def = 50, + min = 1, + max = 500, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'metalextractorcostzaal', + name = 'Zaal Metal Extractor Cost', + desc = 'How much metal does an Zaal Metal Extractor cost?', + type = 'number', + section= 'mexcost', + def = 65, + min = 1, + max = 500, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + +-- Gameplay Options + { + key = 'gameplayoptions', + name = 'Gameplay Options', + desc = 'Various gameplay options that will change how the game is played.', + type = 'section', + }, + { + key = 'unithealthmodifier', + name = 'Unit Health Modifier', + desc = 'This acts as a percentage of base unit health. Setting to 200 would double unit hitpoints.', + type = 'number', + section= 'gameplayoptions', + def = 500, + min = 1, + max = 2000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'scavengers', + name = 'Scavenger amount', + desc = 'This multiplier will be applied on the amount of civilians a map will end up with', + type = 'number', + section= 'gameplayoptions', + def = 0, + min = 0, + max = 5, + step = 0.1, + }, + { + key = 'scavengerstech', + name = 'Scavengers Tech Speed', + desc = 'Determines how fast scav tech ramps up. Adaptive will adjust to players skill', + type = 'list', + section = 'gameplayoptions', + def = "adaptive", + items={ + {key="adaptive", name="Adaptive", desc="Adapts to players skill"}, + {key="easy", name="Easy", desc="Slow ramp up for newbies and noobs"}, + {key="medium", name="Medium", desc="Normal ramp up for slightly experienced players"}, + {key="hard", name="Hard", desc="Hard ramp up for experienced players"}, + {key="brutal", name="Brutal", desc="You'll die"}, + } + }, + { + key = 'lootboxes', + name = 'Lootboxes', + desc = '1 to enable, 0 to disable', + type = 'number', + section= 'gameplayoptions', + def = 1, + min = 0, + max = 1, + step = 1, + }, + { + key="deathmode", + name="Game End Mode", + desc="What it takes to eliminate a team", + type="list", + def="com", + section="gameplayoptions", + items={ + {key="neverend", name="None", desc="Teams are never eliminated"}, + {key="com", name="Kill all enemy Overseers", desc="When a team has no Overseers left, it loses"}, + {key="killall", name="Kill everything", desc="Every last unit must be eliminated, no exceptions!"}, + } + }, + { + key = "shareddynamicalliancevictory", + name = "Dynamic Alliance Victory?", + desc = "Should dynamic alliance teams share in a victory, or should they be forced to turn on one another?", + type = "bool", + def = true, + section= "gameplayoptions", + }, + { + key = 'unitheat', + name = 'Unit Heat Amount', + desc = 'How much heat does each unit generate when it moves through an area?', + type = 'number', + section= 'gameplayoptions', + def = 42, + min = 0, + max = 100, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + +-- Control Victory Options + { + key = 'controlvictoryoptions', + name = 'Control Victory Options', + desc = 'Allows you to control at a granular level the individual options for Control Point Victory', + type = 'section', + }, + { + key="scoremode", + name="Scoring Mode (Control Victory Points)", + desc="Defines how the game is played", + type="list", + def="disabled", + section="controlvictoryoptions", + items={ + {key="disabled", name="Disabled", desc="Disable Control Points as a victory condition."}, + {key="countdown", name="Countdown", desc="A Control Point decreases all opponents' scores, zero means defeat."}, + {key="tugofwar", name="Tug of War", desc="A Control Point steals enemy score, zero means defeat."}, + {key="domination", name="Domination", desc="Holding all Control Points will grant 1000 score, first to reach the score limit wins."}, + } + }, + { + key = 'limitscore', + name = 'Total Score', + desc = 'Total score amount available.', + type = 'number', + section= 'controlvictoryoptions', + def = 3500, + min = 500, + max = 5000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = "numberofcontrolpoints", + name = "Set number of Control Points on the map", + desc = "Sets the number of control points on the map and scales the total score amount to match. Has no effect if Preset map configs are enabled.", + section= "controlvictoryoptions", + type="list", + def="7", + section= "controlvictoryoptions", + items={ + {key="7", name="7", desc=""}, + {key="13", name="13", desc=""}, + {key="19", name="19", desc=""}, + {key="25", name="25", desc=""}, + } + }, + { + key = "usemapconfig", + name = "Use preset map-specific Control Point locations?", + desc = "Should the control point config for this map be used instead of autogenerated control points?", + type="list", + def="disabled", + section= "controlvictoryoptions", + items={ + {key="disabled", name="Disabled", desc="This will tell the game to use autogenerated control points."}, + {key="enabled", name="Enabled", desc="This will tell the game to use preset map control points (Set via map config)."}, + } + }, + { + key = 'captureradius', + name = 'Capture Radius', + desc = 'Radius around a point in which to capture it.', + type = 'number', + section= 'controlvictoryoptions', + def = 500, + min = 100, + max = 1000, + step = 25, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'capturetime', + name = 'Capture Time', + desc = 'Time to capture a point.', + type = 'number', + section= 'controlvictoryoptions', + def = 30, + min = 1, + max = 60, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'capturebonus', + name = 'Capture Bonus', + desc = 'Percentage of how much faster capture takes place by adding more units.', + type = 'number', + section= 'controlvictoryoptions', + def = 5, + min = 1, + max = 100, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'decapspeed', + name = 'De-Cap Speed', + desc = 'Speed multiplier for neutralizing an enemy point.', + type = 'number', + section= 'controlvictoryoptions', + def = 2, + min = 1, + max = 3, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'starttime', + name = 'Start Time', + desc = 'Number of seconds until control points can be captured.', + type = 'number', + section= 'controlvictoryoptions', + def = 180, + min = 0, + max = 300, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'metalperpoint', + name = 'Metal given to each player per captured point', + desc = 'Each player on an allyteam that has captured a point will receive this amount of resources per point captured per second', + type = 'number', + section= 'controlvictoryoptions', + def = 0, + min = 0, + max = 20, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'energyperpoint', + name = 'Energy given to each player per captured point', + desc = 'Each player on an allyteam that has captured a point will receive this amount of resources per point captured per second', + type = 'number', + section= 'controlvictoryoptions', + def = 0, + min = 0, + max = 20, + step = 0.1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'dominationscoretime', + name = 'Domination Score Time', + desc = 'Time needed holding all points to score in multi domination.', + type = 'number', + section= 'controlvictoryoptions', + def = 30, + min = 1, + max = 60, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'tugofwarmodifier', + name = 'Tug of War Modifier', + desc = 'The amount of score transfered between opponents when points are captured is multiplied by this amount.', + type = 'number', + section= 'controlvictoryoptions', + def = 2, + min = 0, + max = 6, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, + { + key = 'dominationscore', + name = 'Score awarded for Domination', + desc = 'The amount of score awarded when you have scored a domination.', + type = 'number', + section= 'controlvictoryoptions', + def = 1000, + min = 500, + max = 1000, + step = 1, -- quantization is aligned to the def value + -- (step <= 0) means that there is no quantization + }, +-- End Control Victory Options } return options \ No newline at end of file diff --git a/ModelMaterials/1_normalmapping.lua b/ModelMaterials/1_normalmapping.lua new file mode 100644 index 000000000..a8d6b1aa2 --- /dev/null +++ b/ModelMaterials/1_normalmapping.lua @@ -0,0 +1,169 @@ +-- $Id$ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function SunChanged(curShaderObj) + curShaderObj:SetUniformAlways("shadowDensity", gl.GetSun("shadowDensity" ,"unit")) + + curShaderObj:SetUniformAlways("sunAmbient", gl.GetSun("ambient" ,"unit")) + curShaderObj:SetUniformAlways("sunDiffuse", gl.GetSun("diffuse" ,"unit")) + curShaderObj:SetUniformAlways("sunSpecular", gl.GetSun("specular" ,"unit")) + --gl.Uniform(gl.GetUniformLocation(curShader, "sunSpecularExp"), gl.GetSun("specularExponent" ,"unit")) +end + + + +local default_lua = VFS.Include("ModelMaterials/Shaders/default.lua") + +local matTemplate = { + shaderDefinitions = { + "#define use_normalmapping", + "#define deferred_mode 0", + "#define SPECULARMULT 6.0", + "#define SPECULARSUNEXP 12.0", + }, + deferredDefinitions = { + "#define use_normalmapping", + "#define deferred_mode 1", + "#define SPECULARMULT 6.0", + "#define SPECULARSUNEXP 12.0", + "#define MAT_IDX 1", + }, + + shader = default_lua, + deferred = default_lua, + usecamera = false, + culling = GL.BACK, + predl = nil, + postdl = nil, + texunits = { + [0] = '%%UNITDEFID:0', + [1] = '%%UNITDEFID:1', + [2] = '$shadow', + [4] = '$reflection', + [5] = '%NORMALTEX', + }, + -- uniforms = { + -- } + --DrawUnit = DrawUnit, + SunChanged = SunChanged, +} + + +local materials = { + normalMappedS3o = Spring.Utilities.CopyTable(matTemplate, true), + normalMappedS3oFlipped = Spring.Utilities.CopyTable(matTemplate, true), +} + +table.insert(materials.normalMappedS3oFlipped.shaderDefinitions, "#define flip_normalmap") +table.insert(materials.normalMappedS3oFlipped.deferredDefinitions, "#define flip_normalmap") + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Automated normalmap detection + +local unitMaterials = {} + + +local function basename(fullpath) + local _,_,base = fullpath:find("([^\\/:]*)$") + local _,_,path = fullpath:find("(.*[\\/:])[^\\/:]*$") + if not path then path = "" end + if base then base = base:gsub("%....", "") end + return base, path +end + + +local function FindTextureFile(filepath) + local normaltex + + --// extract basename of a given filepath (e.g. the path of tex1 or tex2) + local basefilename, basepath = basename(filepath) + if (tonumber(basefilename:sub(-1,-1))) then + --// remove trailing numbers (e.g. corcom1.png -> corcom1 -> corcom) + basefilename = basefilename:sub(1,-2) + end + if (basefilename:sub(-1,-1) == "_") then + --// remove trailing underscores (e.g. corcom_1.png -> corcom_1 -> corcom) + basefilename = basefilename:sub(1,-2) + end + + --// check if there is a corresponding _normals.dds file + for _,dir in ipairs{basepath, "", "unittextures"} do + local foundFiles = VFS.DirList(dir, basefilename .. "_normals.*") + if (foundFiles and foundFiles[1]) then + normaltex = foundFiles[1] + break + end + end + + return normaltex +end + + +local function FindNormalmapFromModel(modelpath, fileext) + if not modelpath then + return + end + + local normaltex + + if (fileext == "s3o") then + --// in case of S3O check the model's tex1 & tex2 and use it to find the normalmap + --// udef.model.textures is empty at gamestart, so read the texture filenames from the s3o directly + local rawstr = VFS.LoadFile(modelpath) + local header = rawstr:sub(1,60) + local texPtrs = VFS.UnpackU32(header, 45, 2) + + local tex1,tex2 + if (texPtrs[2] > 0) + then tex2 = rawstr:sub(texPtrs[2]+1, rawstr:len()-1) + else texPtrs[2] = rawstr:len() end + if (texPtrs[1] > 0) + then tex1 = rawstr:sub(texPtrs[1]+1, texPtrs[2]-1) end + + --// output units without tex2 + if not tex2 then + Spring.Log(gadget:GetInfo().name, LOG.WARNING, udef.name .. " missing a tex2") + end + + normaltex = FindTextureFile(tex1) or FindTextureFile(tex2) + end + + --// all others & fallback use just modelfilename itself to find the normalmap + return normaltex or FindTextureFile(modelpath) +end + + + + + +for i=1,#UnitDefs do + local udef = UnitDefs[i] + + if (udef.customParams.normaltex and VFS.FileExists(udef.customParams.normaltex)) then + if udef.customParams.normaltex:lower():find(".dds") then + unitMaterials[udef.name] = {"normalMappedS3o", NORMALTEX = udef.customParams.normaltex} + else + unitMaterials[udef.name] = {"normalMappedS3oFlipped", NORMALTEX = udef.customParams.normaltex} + end + + elseif (udef.model.type ~= "3do") then + local normaltex = FindNormalmapFromModel(udef.model.path, udef.model.type) + if normaltex then + if normaltex:lower():find(".dds") then + unitMaterials[udef.name] = {"normalMappedS3o", NORMALTEX = normaltex} + else + unitMaterials[udef.name] = {"normalMappedS3oFlipped", NORMALTEX = normaltex} + end + end + end +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +return materials, unitMaterials + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/ModelMaterials/4_features_trees.lua b/ModelMaterials/4_features_trees.lua new file mode 100644 index 000000000..907cfeed1 --- /dev/null +++ b/ModelMaterials/4_features_trees.lua @@ -0,0 +1,173 @@ +-- $Id$ +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +local function DrawFeature(featureID, featureDefID, material, drawMode, luaShaderObj) -- UNUSED! + local wx, wy, wz = Spring.GetWind() + luaShaderObj:SetUniformAlways("wind", wx, wy, wz) + + return false +end + +local function SunChanged(curShaderObj) + curShaderObj:SetUniformAlways("shadowDensity", gl.GetSun("shadowDensity" ,"unit")) + + curShaderObj:SetUniformAlways("sunAmbient", gl.GetSun("ambient" ,"unit")) + curShaderObj:SetUniformAlways("sunDiffuse", gl.GetSun("diffuse" ,"unit")) + curShaderObj:SetUniformAlways("sunSpecular", gl.GetSun("specular" ,"unit")) + --gl.Uniform(gl.GetUniformLocation(curShader, "sunSpecularExp"), gl.GetSun("specularExponent" ,"unit")) +end + + +local default_lua = VFS.Include("ModelMaterials/Shaders/default.lua") + +local materials = { + feature_tree = { + shader = default_lua, + deferred = default_lua, + shaderDefinitions = { + "#define use_normalmapping", + "#define deferred_mode 0", + }, + deferredDefinitions = { + --"#define use_normalmapping", --very expensive for trees (too much overdraw) + "#define deferred_mode 1", + }, + shaderPlugins = { + VERTEX_GLOBAL_NAMESPACE = [[ + vec2 getWind(int period) { + vec2 wind; + wind.x = sin(period * 5.0); + wind.y = cos(period * 5.0); + return wind * 12.0f; + } + ]], + VERTEX_PRE_TRANSFORM = [[ + // adapted from 0ad's model_common.vs + + vec2 curWind = getWind(simFrame / 750); + vec2 nextWind = getWind(simFrame / 750 + 1); + float tweenFactor = smoothstep(0.0f, 1.0f, max(simFrame % 750 - 600, 0) / 150.0f); + vec2 wind = mix(curWind, nextWind, tweenFactor); + + + + + // fractional part of model position, clamped to >.4 + vec4 modelPos = gl_ModelViewMatrix[3]; + modelPos = fract(modelPos); + modelPos = clamp(modelPos, 0.4, 1.0); + + // crude measure of wind intensity + float abswind = abs(wind.x) + abs(wind.y); + + vec4 cosVec; + float simTime = 0.02 * simFrame; + // these determine the speed of the wind's "cosine" waves. + cosVec.w = 0.0; + cosVec.x = simTime * modelPos[0] + vertex.x; + cosVec.y = simTime * modelPos[2] / 3.0 + modelPos.x; + cosVec.z = simTime * 1.0 + vertex.z; + + // calculate "cosines" in parallel, using a smoothed triangle wave + vec4 tri = abs(fract(cosVec + 0.5) * 2.0 - 1.0); + cosVec = tri * tri *(3.0 - 2.0 * tri); + + float limit = clamp((vertex.x * vertex.z * vertex.y) / 3000.0, 0.0, 0.2); + + float diff = cosVec.x * limit; + float diff2 = cosVec.y * clamp(vertex.y / 30.0, 0.05, 0.2); + + vertex.xyz += cosVec.z * limit * clamp(abswind, 1.2, 1.7); + + vertex.xz += diff + diff2 * wind; + ]], + FRAGMENT_POST_SHADING = [[ + //gl_FragColor.r=1.0; + ]] + }, + force = true, --// always use the shader even when normalmapping is disabled + feature = true, --// This is used to define that this is a feature shader + usecamera = false, + culling = GL.BACK, + texunits = { + [0] = '%%FEATUREDEFID:0', + [1] = '%%FEATUREDEFID:1', + [2] = '$shadow', + [4] = '$reflection', + [5] = '%NORMALTEX', + }, + --DrawFeature = DrawFeature, + SunChanged = SunChanged, + }, +} + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- affected unitdefs + +local featureMaterials = {} +local featureNameStubs = { + "ad0_", + "btree", + "art", + "bush", + "tree", + "vegetation", + "vegitation", + "baobab", + "aleppo", + "pine", + "senegal", + "palm", + "shrub", + "bloodthorn", + "birch", + "maple", + "oak", + "fern", + "grass", + "weed", + "plant", + "palmetto" + } -- This list should cover all vegetative features in spring features +local tex1_to_normaltex = {} +-- All feature defs that contain the string "aleppo" will be affected by it +local echoline = '' +for id, featureDef in pairs(FeatureDefs) do + Spring.PreloadFeatureDefModel(id) + for _,stub in ipairs (featureNameStubs) do + if featureDef.model.textures and featureDef.model.textures.tex1 and featureDef.name and featureDef.name:find(stub) and featureDef.name:find(stub) == 1 then --also starts with + --if featureDef.customParam.normaltex then + echoline = echoline..(echoline ~= '' and ', ' or '')..featureDef.name + if featureDef.name:find('btree') == 1 then --beherith's old trees suffer if they get shitty normals + featureMaterials[featureDef.name] = {"feature_tree", NORMALTEX = "unittextures/blank_normal.tga"} + else + featureMaterials[featureDef.name] = {"feature_tree", NORMALTEX = "unittextures/default_tree_normal.tga"} + end + + --TODO: dont forget the feature normals! + --TODO: actually generate normals for all these old-ass features, and include them in BAR + --TODO: add a blank normal map to avoid major fuckups. + --Todo, grab the texture1 names for features in tex1_to_normaltex assignments, + --and hope that I dont have to actually load the models to do so + + end + end +end +if echoline ~= '' then + --Spring.Echo('Adding normal texture to trees: '..echoline) +end + + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- + +if Spring.GetConfigInt("TreeWind",1) == 0 then + return {}, {} +else + return materials, featureMaterials +end + +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/ModelMaterials/Shaders/default.lua b/ModelMaterials/Shaders/default.lua new file mode 100644 index 000000000..8e11e5230 --- /dev/null +++ b/ModelMaterials/Shaders/default.lua @@ -0,0 +1,390 @@ +return { +vertex = [[ + //shader version is added via gadget + %%GLOBAL_NAMESPACE%% + + //#define use_normalmapping + //#define flip_normalmap + //#define use_shadows + %%VERTEX_GLOBAL_NAMESPACE%% + #line 10010 + + uniform mat4 camera; //ViewMatrix (gl_ModelViewMatrix is ModelMatrix!) + uniform vec3 cameraPos; + + uniform vec3 sunDiffuse; + uniform vec3 sunAmbient; + uniform vec3 etcLoc; + uniform int simFrame; + + #ifdef flashlights + out float selfIllumMod; + #endif + //uniform float frameLoc; + + //The api_custom_unit_shaders supplies this definition: + #ifdef use_shadows + uniform mat4 shadowMatrix; + uniform vec4 shadowParams; + #endif + + #ifdef use_vertex_ao + out float aoTerm; + #endif + + out vec3 viewDir; + + #ifdef use_normalmapping + out mat3 tbnMatrix; + #else + out vec3 normalv; + #endif + + out vec2 tex_coord0; + out vec4 tex_coord1; + out vec4 worldPos; + + void main(void) + { + vec4 vertex = gl_Vertex; + vec3 normal = gl_Normal; + + %%VERTEX_PRE_TRANSFORM%% + + #ifdef use_normalmapping + vec3 tangent = gl_MultiTexCoord5.xyz; + vec3 bitangent = gl_MultiTexCoord6.xyz; + tbnMatrix = gl_NormalMatrix * mat3(tangent, bitangent, normal); + #else + normalv = gl_NormalMatrix * normal; + #endif + + worldPos = gl_ModelViewMatrix * vertex; + gl_Position = gl_ProjectionMatrix * (camera * worldPos); + viewDir = cameraPos - worldPos.xyz; + + #ifdef use_shadows + tex_coord1 = shadowMatrix * worldPos; + #if 1 + tex_coord1.xy = tex_coord1.xy + 0.5; + #else + tex_coord1.xy *= (inversesqrt(abs(tex_coord1.xy) + shadowParams.zz) + shadowParams.ww); + tex_coord1.xy += shadowParams.xy; + #endif + #endif + + #ifdef use_treadoffset + tex_coord0.st = gl_MultiTexCoord0.st; + const vec4 treadBoundaries = vec4(0.6279296875, 0.74951171875, 0.5702890625, 0.6220703125); + if (all(bvec4( + tex_coord0.s >= treadBoundaries.x, tex_coord0.s <= treadBoundaries.y, + tex_coord0.t >= treadBoundaries.z, tex_coord0.t <= treadBoundaries.w))) { + tex_coord0.s = gl_MultiTexCoord0.s + etcLoc.z; + } + #endif + + #ifdef use_vertex_ao + aoTerm = max(0.4, fract(gl_MultiTexCoord0.s * 16384.0) * 1.3); // great + #endif + + #ifndef use_treadoffset + tex_coord0.st = gl_MultiTexCoord0.st; + #endif + + #ifdef flashlights + // gl_ModelViewMatrix[3][0] + gl_ModelViewMatrix[3][2] are Tx, Tz elements of translation of matrix + selfIllumMod = max(-0.2, sin(simFrame * 0.063 + (gl_ModelViewMatrix[3][0] + gl_ModelViewMatrix[3][2]) * 0.1)) + 0.2; + #endif + + //float fogCoord = length(gl_Position.xyz); // maybe fog should be readded? + //fogFactor = (gl_Fog.end - fogCoord) * gl_Fog.scale; //gl_Fog.scale := 1.0 / (gl_Fog.end - gl_Fog.start) + //fogFactor = clamp(fogFactor, 0.0, 1.0); + + %%VERTEX_POST_TRANSFORM%% + } +]], + + +fragment = [[ + //shader version is added via gadget + %%GLOBAL_NAMESPACE%% + + #if (GL_FRAGMENT_PRECISION_HIGH == 1) + // ancient GL3 ATI drivers confuse GLSL for GLSL-ES and require this + precision highp float; + #else + precision mediump float; + #endif + + %%FRAGMENT_GLOBAL_NAMESPACE%% + #line 20120 + + #if (deferred_mode == 1) + #define GBUFFER_NORMTEX_IDX 0 + #define GBUFFER_DIFFTEX_IDX 1 + #define GBUFFER_SPECTEX_IDX 2 + #define GBUFFER_EMITTEX_IDX 3 + #define GBUFFER_MISCTEX_IDX 4 + + #define GBUFFER_COUNT 5 + #endif + + uniform sampler2D textureS3o1; + uniform sampler2D textureS3o2; + uniform samplerCube specularTex; + uniform samplerCube reflectTex; + + uniform vec3 sunPos; //light direction in fact + #define lightDir sunPos + + uniform vec3 sunDiffuse; + uniform vec3 sunAmbient; + uniform vec3 sunSpecular; + + uniform vec3 etcLoc; + + #ifndef SPECULARSUNEXP + #define SPECULARSUNEXP 16.0 + #endif + + #ifndef SPECULARMULT + #define SPECULARMULT 2.0 + #endif + + #ifndef MAT_IDX + #define MAT_IDX 0 + #endif + + #ifndef SHADOW_SAMPLES + #define SHADOW_SAMPLES 6 // number of shadowmap samples per fragment + #define SHADOW_RANDOMNESS 0.4 // 0.0 - blocky look, 1.0 - random points look + #define SHADOW_SAMPLING_DISTANCE 2.0 // how far shadow samples go (in shadowmap texels) as if it was applied to 8192x8192 sized shadow map + #endif + + #ifdef use_shadows + uniform sampler2DShadow shadowTex; + #endif + uniform float shadowDensity; + + #ifdef use_vertex_ao + in float aoTerm; + #endif + + uniform vec4 teamColor; + in vec3 viewDir; + //varying float fogFactor; + + #ifdef flashlights + in float selfIllumMod; + #endif + + #ifdef use_normalmapping + in mat3 tbnMatrix; + uniform sampler2D normalMap; + #define normalv tbnMatrix[2] + #else + in vec3 normalv; + #endif + + in vec2 tex_coord0; + in vec4 tex_coord1; + in vec4 worldPos; + + #if (deferred_mode == 1) + out vec4 fragData[GBUFFER_COUNT]; + #else + out vec4 fragData[1]; + #endif + + const float PI = acos(0.0) * 2.0; + + const mat3 RGB2YCBCR = mat3( + 0.2126, -0.114572, 0.5, + 0.7152, -0.385428, -0.454153, + 0.0722, 0.5, -0.0458471); + + const mat3 YCBCR2RGB = mat3( + 1.0, 1.0, 1.0, + 0.0, -0.187324, 1.8556, + 1.5748, -0.468124, -5.55112e-17); + + #define NORM2SNORM(value) (value * 2.0 - 1.0) + #define SNORM2NORM(value) (value * 0.5 + 0.5) + + // http://blog.marmakoide.org/?p=1 + const float goldenAngle = PI * (3.0 - sqrt(5.0)); + vec2 SpiralSNorm(int i, int N) { + float theta = float(i) * goldenAngle; + float r = sqrt(float(i)) / sqrt(float(N)); + return vec2 (r * cos(theta), r * sin(theta)); + } + + float hash12(vec2 p) { + const float HASHSCALE1 = 0.1031; + vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); + p3 += dot(p3, p3.yzx + 19.19); + return fract((p3.x + p3.y) * p3.z); + } + +#ifdef use_shadows + float GetShadowPCFRandom(float NdotL) { + float shadow = 0.0; + + const float cb = 0.00005; + float bias = cb * tan(acos(NdotL)); + bias = clamp(bias, 0.0, 5.0 * cb); + + #if defined(SHADOW_SAMPLES) && (SHADOW_SAMPLES > 1) + + + float rndRotAngle = NORM2SNORM(hash12(gl_FragCoord.xy)) * PI / 2.0 * SHADOW_RANDOMNESS; + + vec2 vSinCos = vec2(sin(rndRotAngle), cos(rndRotAngle)); + mat2 rotMat = mat2(vSinCos.y, -vSinCos.x, vSinCos.x, vSinCos.y); + + vec2 filterSize = vec2(SHADOW_SAMPLING_DISTANCE / 8192.0); + + for (int i = 0; i < SHADOW_SAMPLES; ++i) { + // SpiralSNorm return low discrepancy sampling vec2 + vec2 offset = (rotMat * SpiralSNorm( i, SHADOW_SAMPLES )) * filterSize; + + vec4 shTexCoord = tex_coord1 + vec4(offset, -bias, 0.0); + shadow += textureProj( shadowTex, shTexCoord ); + } + + shadow /= float(SHADOW_SAMPLES); + shadow *= 1.0 - smoothstep(shadow, 1.0, 0.2); + #else + vec4 shTexCoord = tex_coord1; + shTexCoord.z -= bias; + shadow = textureProj( shadowTex, shTexCoord ); + #endif + + return mix(1.0, shadow, shadowDensity); + } +#endif + + void main(void){ + %%FRAGMENT_PRE_SHADING%% + #line 20212 + + #ifdef use_normalmapping + vec2 tc = tex_coord0.st; + #ifdef flip_normalmap + tc.t = 1.0 - tc.t; + #endif + vec4 normaltex = texture(normalMap, tc); + vec3 nvTS = normalize(NORM2SNORM(normaltex.xyz)); + vec3 N = tbnMatrix * nvTS; + #else + vec3 N = normalize(normalv); + #endif + + vec3 L = normalize(lightDir); //just in case + + float NdotLu = dot(N, L); + float NdotL = max(NdotLu, 0.0); + vec3 light = NdotL * sunDiffuse + sunAmbient; + + vec4 diffuseIn = texture(textureS3o1, tex_coord0.st); + + #ifdef LUMAMULT + vec3 yCbCr = RGB2YCBCR * diffuseIn.rgb; + yCbCr.x *= LUMAMULT; + diffuseIn.rgb = YCBCR2RGB * yCbCr; + #endif + + vec4 outColor = diffuseIn; + vec4 extraColor = texture(textureS3o2, tex_coord0.st); + + vec3 V = normalize(viewDir); + vec3 Rv = -reflect(V, N); + + vec3 specularColor; + + // blinn-phong + vec3 H = normalize(L + V); + float HdotN = max(dot(H, N), 0.0); + specularColor = sunSpecular * pow(HdotN, SPECULARSUNEXP); + + specularColor *= extraColor.b * SPECULARMULT; //EvoRTS specific change, tex2.b is used as specular multiplier; tex2.g is used as a reflectivity + + vec3 reflection = texture(reflectTex, Rv).rgb; + + float nShadowMix = smoothstep(0.0, 0.35, NdotLu); + float nShadow = mix(1.0, nShadowMix, shadowDensity); + + #ifdef use_shadows + float gShadow = GetShadowPCFRandom(NdotL); + #else + float gShadow = 1.0; + #endif + + float shadow = min(nShadow, gShadow); + + light = mix(sunAmbient, light, shadow); + specularColor *= shadow; + + reflection = mix(light, reflection, extraColor.g); // reflection + + #ifdef flashlights + extraColor.r = extraColor.r * selfIllumMod; + #endif + + reflection += (extraColor.rrr); // self-illum + + outColor.rgb = mix(outColor.rgb, teamColor.rgb, outColor.a); + + //#if (deferred_mode == 0) + // diffuse + specularColor + envcube lighting + // (reflection contains the NdotL term!) + outColor.rgb = outColor.rgb * reflection + specularColor; + //#endif + + outColor.a = extraColor.a; + //outColor.rgb = outColor.rgb + outColor.rgb * (normaltex.a - 0.5) * etcLoc.g; // no more wreck color blending + + #ifdef use_vertex_ao + outColor.rgb = outColor.rgb * aoTerm; + #endif + + // debug hook + #if 0 + //outColor.rgb = vec3(normalv); + outColor.rgb = vec3(N); + #endif + + #if (deferred_mode == 0) + fragData[0] = outColor; + #else + fragData[GBUFFER_NORMTEX_IDX] = vec4(SNORM2NORM(N), 1.0); + fragData[GBUFFER_DIFFTEX_IDX] = outColor; + fragData[GBUFFER_SPECTEX_IDX] = vec4(specularColor, extraColor.a); + fragData[GBUFFER_EMITTEX_IDX] = vec4(extraColor.rrr, 1.0); + fragData[GBUFFER_MISCTEX_IDX] = vec4(float(MAT_IDX) / 255.0, 0.0, 0.0, 0.0); + #endif + + %%FRAGMENT_POST_SHADING%% + } +]], + + uniformInt = { + textureS3o1 = 0, + textureS3o2 = 1, + shadowTex = 2, + reflectTex = 4, + normalMap = 5, + }, + uniformFloat = { + -- sunPos = {gl.GetSun("pos")}, -- material has sunPosLoc + sunAmbient = {gl.GetSun("ambient" ,"unit")}, + sunDiffuse = {gl.GetSun("diffuse" ,"unit")}, + sunSpecular = {gl.GetSun("specular" ,"unit")}, + --sunSpecularExp = gl.GetSun("specularExponent"), -- this might return crazy values like 100.0, which are unapplicable for Phong/Blinn-Phong + shadowDensity = gl.GetSun("shadowDensity" ,"unit"), + -- shadowParams = {gl.GetShadowMapParams()}, -- material has shadowParamsLoc + }, + uniformMatrix = { + -- shadowMatrix = {gl.GetMatrixData("shadow")}, -- material has shadow{Matrix}Loc + }, +} diff --git a/Music/defeat/429789_06___Surface.ogg b/Music/defeat/429789_06___Surface.ogg deleted file mode 100644 index a54ceef45..000000000 Binary files a/Music/defeat/429789_06___Surface.ogg and /dev/null differ diff --git a/Music/peace/511381_Sweet-Cold-Revenge.ogg b/Music/peace/511381_Sweet-Cold-Revenge.ogg deleted file mode 100644 index 9bfc6e00d..000000000 Binary files a/Music/peace/511381_Sweet-Cold-Revenge.ogg and /dev/null differ diff --git a/Music/peace/527066_Beyond.ogg b/Music/peace/527066_Beyond.ogg deleted file mode 100644 index 353aea900..000000000 Binary files a/Music/peace/527066_Beyond.ogg and /dev/null differ diff --git a/Music/peace/553714_A-Pixel-is-Born.ogg b/Music/peace/553714_A-Pixel-is-Born.ogg deleted file mode 100644 index b5264deb0..000000000 Binary files a/Music/peace/553714_A-Pixel-is-Born.ogg and /dev/null differ diff --git a/Music/peace/553754_Lighthouse.ogg b/Music/peace/553754_Lighthouse.ogg deleted file mode 100644 index e31d79e7f..000000000 Binary files a/Music/peace/553754_Lighthouse.ogg and /dev/null differ diff --git a/Music/peace/553873_Restarting-The-Time.ogg b/Music/peace/553873_Restarting-The-Time.ogg deleted file mode 100644 index 96646471e..000000000 Binary files a/Music/peace/553873_Restarting-The-Time.ogg and /dev/null differ diff --git a/Music/peace/Angel Down.ogg b/Music/peace/Angel Down.ogg deleted file mode 100644 index 3f76654d4..000000000 Binary files a/Music/peace/Angel Down.ogg and /dev/null differ diff --git a/Music/peace/Byte Run.ogg b/Music/peace/Byte Run.ogg deleted file mode 100644 index 3eccc5167..000000000 Binary files a/Music/peace/Byte Run.ogg and /dev/null differ diff --git a/Music/peace/Droum.ogg b/Music/peace/Droum.ogg deleted file mode 100644 index 771e09c3a..000000000 Binary files a/Music/peace/Droum.ogg and /dev/null differ diff --git a/Music/peace/EE Environmental Runs.ogg b/Music/peace/EE Environmental Runs.ogg deleted file mode 100644 index 208577e31..000000000 Binary files a/Music/peace/EE Environmental Runs.ogg and /dev/null differ diff --git a/Music/peace/Eastern Vector.ogg b/Music/peace/Eastern Vector.ogg deleted file mode 100644 index 6a8f52198..000000000 Binary files a/Music/peace/Eastern Vector.ogg and /dev/null differ diff --git a/Music/peace/Environment Alpha.ogg b/Music/peace/Environment Alpha.ogg deleted file mode 100644 index 7ded7bcb0..000000000 Binary files a/Music/peace/Environment Alpha.ogg and /dev/null differ diff --git a/Music/peace/Evade.ogg b/Music/peace/Evade.ogg deleted file mode 100644 index 7da80901d..000000000 Binary files a/Music/peace/Evade.ogg and /dev/null differ diff --git a/Music/peace/Exbioract Menu.ogg b/Music/peace/Exbioract Menu.ogg deleted file mode 100644 index f767da2ba..000000000 Binary files a/Music/peace/Exbioract Menu.ogg and /dev/null differ diff --git a/Music/peace/GD Initialization.ogg b/Music/peace/GD Initialization.ogg deleted file mode 100644 index 1415ffefd..000000000 Binary files a/Music/peace/GD Initialization.ogg and /dev/null differ diff --git a/Music/peace/Intrusive Thoughts.ogg b/Music/peace/Intrusive Thoughts.ogg deleted file mode 100644 index f4c7f7012..000000000 Binary files a/Music/peace/Intrusive Thoughts.ogg and /dev/null differ diff --git a/Music/peace/Mysteries at Severnaya Industrial 9.ogg b/Music/peace/Mysteries at Severnaya Industrial 9.ogg deleted file mode 100644 index e762c1636..000000000 Binary files a/Music/peace/Mysteries at Severnaya Industrial 9.ogg and /dev/null differ diff --git a/Music/peace/Strange Robot.ogg b/Music/peace/Strange Robot.ogg deleted file mode 100644 index 93ecb6c9d..000000000 Binary files a/Music/peace/Strange Robot.ogg and /dev/null differ diff --git a/Music/peace/The URC Extraction.ogg b/Music/peace/The URC Extraction.ogg deleted file mode 100644 index 930a69ba3..000000000 Binary files a/Music/peace/The URC Extraction.ogg and /dev/null differ diff --git a/Music/peace/This World is Imploding.ogg b/Music/peace/This World is Imploding.ogg deleted file mode 100644 index 719b4d57d..000000000 Binary files a/Music/peace/This World is Imploding.ogg and /dev/null differ diff --git a/Music/victory/450042_01___Resting_Place.ogg b/Music/victory/450042_01___Resting_Place.ogg deleted file mode 100644 index cdd3bd1db..000000000 Binary files a/Music/victory/450042_01___Resting_Place.ogg and /dev/null differ diff --git a/Music/war/187452_Heavy.ogg b/Music/war/187452_Heavy.ogg deleted file mode 100644 index 813ed5b08..000000000 Binary files a/Music/war/187452_Heavy.ogg and /dev/null differ diff --git a/Music/war/192884_new.ogg b/Music/war/192884_new.ogg deleted file mode 100644 index 10528fb5f..000000000 Binary files a/Music/war/192884_new.ogg and /dev/null differ diff --git a/Music/war/256720_Better_than_Nothing.ogg b/Music/war/256720_Better_than_Nothing.ogg deleted file mode 100644 index 971a795c9..000000000 Binary files a/Music/war/256720_Better_than_Nothing.ogg and /dev/null differ diff --git a/Music/war/291507_Left_to_Rot.ogg b/Music/war/291507_Left_to_Rot.ogg deleted file mode 100644 index 954db86d9..000000000 Binary files a/Music/war/291507_Left_to_Rot.ogg and /dev/null differ diff --git a/Music/war/297894_Fists_of_Stone.ogg b/Music/war/297894_Fists_of_Stone.ogg deleted file mode 100644 index 789aba420..000000000 Binary files a/Music/war/297894_Fists_of_Stone.ogg and /dev/null differ diff --git a/Music/war/334346_Distant_Lands.ogg b/Music/war/334346_Distant_Lands.ogg deleted file mode 100644 index 0defd82ce..000000000 Binary files a/Music/war/334346_Distant_Lands.ogg and /dev/null differ diff --git a/Music/war/381879_dknew2.ogg b/Music/war/381879_dknew2.ogg deleted file mode 100644 index 475761c86..000000000 Binary files a/Music/war/381879_dknew2.ogg and /dev/null differ diff --git a/Music/war/383176_Sacrifice___deathkllr84.ogg b/Music/war/383176_Sacrifice___deathkllr84.ogg deleted file mode 100644 index cfa9b5d70..000000000 Binary files a/Music/war/383176_Sacrifice___deathkllr84.ogg and /dev/null differ diff --git a/Music/war/392305_deathkllr84___metalriffs.ogg b/Music/war/392305_deathkllr84___metalriffs.ogg deleted file mode 100644 index 51458eea4..000000000 Binary files a/Music/war/392305_deathkllr84___metalriffs.ogg and /dev/null differ diff --git a/Music/war/393018_deathkllr84___Anasasis_int.ogg b/Music/war/393018_deathkllr84___Anasasis_int.ogg deleted file mode 100644 index 54830103a..000000000 Binary files a/Music/war/393018_deathkllr84___Anasasis_int.ogg and /dev/null differ diff --git a/Music/war/393567_deathkllr84___breakdown.ogg b/Music/war/393567_deathkllr84___breakdown.ogg deleted file mode 100644 index 685b84a34..000000000 Binary files a/Music/war/393567_deathkllr84___breakdown.ogg and /dev/null differ diff --git a/Music/war/493567_Torture-Arena.ogg b/Music/war/493567_Torture-Arena.ogg deleted file mode 100644 index 3775e3e19..000000000 Binary files a/Music/war/493567_Torture-Arena.ogg and /dev/null differ diff --git a/Music/war/514888_Sweet-Cold-Revenge-.ogg b/Music/war/514888_Sweet-Cold-Revenge-.ogg deleted file mode 100644 index 43940e5a8..000000000 Binary files a/Music/war/514888_Sweet-Cold-Revenge-.ogg and /dev/null differ diff --git a/Music/war/518212_No-more-sun.ogg b/Music/war/518212_No-more-sun.ogg deleted file mode 100644 index aad7ad51b..000000000 Binary files a/Music/war/518212_No-more-sun.ogg and /dev/null differ diff --git a/Music/war/551136_Knightfall.ogg b/Music/war/551136_Knightfall.ogg deleted file mode 100644 index 4b99aa819..000000000 Binary files a/Music/war/551136_Knightfall.ogg and /dev/null differ diff --git a/Music/war/551169_Execution.ogg b/Music/war/551169_Execution.ogg deleted file mode 100644 index 008363ca5..000000000 Binary files a/Music/war/551169_Execution.ogg and /dev/null differ diff --git a/Music/war/551170_Active-Power.ogg b/Music/war/551170_Active-Power.ogg deleted file mode 100644 index 1b5db60c9..000000000 Binary files a/Music/war/551170_Active-Power.ogg and /dev/null differ diff --git a/Music/war/555389_Reboot.ogg b/Music/war/555389_Reboot.ogg deleted file mode 100644 index da4b6e946..000000000 Binary files a/Music/war/555389_Reboot.ogg and /dev/null differ diff --git a/Music/war/556245_Defiance-1.ogg b/Music/war/556245_Defiance-1.ogg deleted file mode 100644 index c16ddef4f..000000000 Binary files a/Music/war/556245_Defiance-1.ogg and /dev/null differ diff --git a/Music/war/556245_Defiance-2.ogg b/Music/war/556245_Defiance-2.ogg deleted file mode 100644 index 3640157db..000000000 Binary files a/Music/war/556245_Defiance-2.ogg and /dev/null differ diff --git a/Music/war/556245_Defiance-3.ogg b/Music/war/556245_Defiance-3.ogg deleted file mode 100644 index 6dd37ef1c..000000000 Binary files a/Music/war/556245_Defiance-3.ogg and /dev/null differ diff --git a/Music/war/556245_Defiance-4.ogg b/Music/war/556245_Defiance-4.ogg deleted file mode 100644 index 23e7aa3f1..000000000 Binary files a/Music/war/556245_Defiance-4.ogg and /dev/null differ diff --git a/Music/war/556245_Defiance-5.ogg b/Music/war/556245_Defiance-5.ogg deleted file mode 100644 index b6ad07c27..000000000 Binary files a/Music/war/556245_Defiance-5.ogg and /dev/null differ diff --git a/Music/war/559522_Aftershock.ogg b/Music/war/559522_Aftershock.ogg deleted file mode 100644 index a6f9ca00d..000000000 Binary files a/Music/war/559522_Aftershock.ogg and /dev/null differ diff --git a/Objects3D/ChickenDefenseModels/agamautoburst.s3o b/Objects3D/ChickenDefenseModels/agamautoburst.s3o new file mode 100644 index 000000000..f2732cfc5 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/agamautoburst.s3o differ diff --git a/Objects3D/ChickenDefenseModels/big_chicken_dodo.s3o b/Objects3D/ChickenDefenseModels/big_chicken_dodo.s3o new file mode 100644 index 000000000..51508c22e Binary files /dev/null and b/Objects3D/ChickenDefenseModels/big_chicken_dodo.s3o differ diff --git a/Objects3D/ChickenDefenseModels/brain_bug.s3o b/Objects3D/ChickenDefenseModels/brain_bug.s3o new file mode 100644 index 000000000..72f5f1c68 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/brain_bug.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken.s3o b/Objects3D/ChickenDefenseModels/chicken.s3o new file mode 100644 index 000000000..ec3c39d1c Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1b.s3o b/Objects3D/ChickenDefenseModels/chicken1b.s3o new file mode 100644 index 000000000..8dea48273 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1c.s3o b/Objects3D/ChickenDefenseModels/chicken1c.s3o new file mode 100644 index 000000000..4a9522072 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1c.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1d.s3o b/Objects3D/ChickenDefenseModels/chicken1d.s3o new file mode 100644 index 000000000..a3ddc82ed Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1d.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1x.s3o b/Objects3D/ChickenDefenseModels/chicken1x.s3o new file mode 100644 index 000000000..3c1b7eea4 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1x.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1y.s3o b/Objects3D/ChickenDefenseModels/chicken1y.s3o new file mode 100644 index 000000000..b573b1f81 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1y.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken1z.s3o b/Objects3D/ChickenDefenseModels/chicken1z.s3o new file mode 100644 index 000000000..de12d782c Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken1z.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken2.s3o b/Objects3D/ChickenDefenseModels/chicken2.s3o new file mode 100644 index 000000000..52cb7a696 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken2.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken2b.s3o b/Objects3D/ChickenDefenseModels/chicken2b.s3o new file mode 100644 index 000000000..c55ba71d4 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken2b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_colonizer.s3o b/Objects3D/ChickenDefenseModels/chicken_colonizer.s3o new file mode 100644 index 000000000..9f915f853 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_colonizer.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_crow.s3o b/Objects3D/ChickenDefenseModels/chicken_crow.s3o new file mode 100644 index 000000000..4917e18c2 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_crow.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_digger.s3o b/Objects3D/ChickenDefenseModels/chicken_digger.s3o new file mode 100644 index 000000000..929bb39f3 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_digger.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_digger_b.s3o b/Objects3D/ChickenDefenseModels/chicken_digger_b.s3o new file mode 100644 index 000000000..885434693 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_digger_b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_dodo.s3o b/Objects3D/ChickenDefenseModels/chicken_dodo.s3o new file mode 100644 index 000000000..afd405883 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_dodo.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_drone.s3o b/Objects3D/ChickenDefenseModels/chicken_drone.s3o new file mode 100644 index 000000000..cad816d21 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_drone.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_droneb.s3o b/Objects3D/ChickenDefenseModels/chicken_droneb.s3o new file mode 100644 index 000000000..e8b6dffbd Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_droneb.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_listener.s3o b/Objects3D/ChickenDefenseModels/chicken_listener.s3o new file mode 100644 index 000000000..ab80a57fc Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_listener.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_listener_b.s3o b/Objects3D/ChickenDefenseModels/chicken_listener_b.s3o new file mode 100644 index 000000000..1ce22abaa Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_listener_b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_pidgeon.s3o b/Objects3D/ChickenDefenseModels/chicken_pidgeon.s3o new file mode 100644 index 000000000..71fc8f022 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_pidgeon.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_pidgeonb.s3o b/Objects3D/ChickenDefenseModels/chicken_pidgeonb.s3o new file mode 100644 index 000000000..7662a4576 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_pidgeonb.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_pidgeonc.s3o b/Objects3D/ChickenDefenseModels/chicken_pidgeonc.s3o new file mode 100644 index 000000000..1bd1a72f4 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_pidgeonc.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_pidgeond.s3o b/Objects3D/ChickenDefenseModels/chicken_pidgeond.s3o new file mode 100644 index 000000000..1833dcb24 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_pidgeond.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chicken_spidermonkey.s3o b/Objects3D/ChickenDefenseModels/chicken_spidermonkey.s3o new file mode 100644 index 000000000..d6d9ab5b7 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chicken_spidermonkey.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickena.s3o b/Objects3D/ChickenDefenseModels/chickena.s3o new file mode 100644 index 000000000..913ba4844 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickena.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickena2.s3o b/Objects3D/ChickenDefenseModels/chickena2.s3o new file mode 100644 index 000000000..544bcad90 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickena2.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickena2b.s3o b/Objects3D/ChickenDefenseModels/chickena2b.s3o new file mode 100644 index 000000000..650d85f87 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickena2b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenab.s3o b/Objects3D/ChickenDefenseModels/chickenab.s3o new file mode 100644 index 000000000..b336ef30b Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenab.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenac.s3o b/Objects3D/ChickenDefenseModels/chickenac.s3o new file mode 100644 index 000000000..e2612fde2 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenac.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenc.s3o b/Objects3D/ChickenDefenseModels/chickenc.s3o new file mode 100644 index 000000000..ac2e4ecf3 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenc.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenc2.s3o b/Objects3D/ChickenDefenseModels/chickenc2.s3o new file mode 100644 index 000000000..36d440072 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenc2.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenc3.s3o b/Objects3D/ChickenDefenseModels/chickenc3.s3o new file mode 100644 index 000000000..3df866fae Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenc3.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenc3b.s3o b/Objects3D/ChickenDefenseModels/chickenc3b.s3o new file mode 100644 index 000000000..f81366cfd Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenc3b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenc3c.s3o b/Objects3D/ChickenDefenseModels/chickenc3c.s3o new file mode 100644 index 000000000..91e977a71 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenc3c.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenegg.s3o b/Objects3D/ChickenDefenseModels/chickenegg.s3o new file mode 100644 index 000000000..5721755dd Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenegg.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickeneggb.s3o b/Objects3D/ChickenDefenseModels/chickeneggb.s3o new file mode 100644 index 000000000..c69bc1399 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickeneggb.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickeneggc.s3o b/Objects3D/ChickenDefenseModels/chickeneggc.s3o new file mode 100644 index 000000000..911c2f225 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickeneggc.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickeneggd.s3o b/Objects3D/ChickenDefenseModels/chickeneggd.s3o new file mode 100644 index 000000000..0da75b49c Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickeneggd.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickeneggred.s3o b/Objects3D/ChickenDefenseModels/chickeneggred.s3o new file mode 100644 index 000000000..6ec84557a Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickeneggred.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickeneggyellow.s3o b/Objects3D/ChickenDefenseModels/chickeneggyellow.s3o new file mode 100644 index 000000000..0954420e7 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickeneggyellow.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenf.s3o b/Objects3D/ChickenDefenseModels/chickenf.s3o new file mode 100644 index 000000000..907524ba6 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenf.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenf1.s3o b/Objects3D/ChickenDefenseModels/chickenf1.s3o new file mode 100644 index 000000000..e54db305e Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenf1.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenf1b.s3o b/Objects3D/ChickenDefenseModels/chickenf1b.s3o new file mode 100644 index 000000000..1750a8721 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenf1b.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenq.s3o b/Objects3D/ChickenDefenseModels/chickenq.s3o new file mode 100644 index 000000000..235facbd3 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenq.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickenr.s3o b/Objects3D/ChickenDefenseModels/chickenr.s3o new file mode 100644 index 000000000..05725cf32 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickenr.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickens.s3o b/Objects3D/ChickenDefenseModels/chickens.s3o new file mode 100644 index 000000000..05a82fb14 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickens.s3o differ diff --git a/Objects3D/ChickenDefenseModels/chickens2.s3o b/Objects3D/ChickenDefenseModels/chickens2.s3o new file mode 100644 index 000000000..6a6a35a92 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/chickens2.s3o differ diff --git a/Objects3D/ChickenDefenseModels/e_chickenq.s3o b/Objects3D/ChickenDefenseModels/e_chickenq.s3o new file mode 100644 index 000000000..4ac232b5d Binary files /dev/null and b/Objects3D/ChickenDefenseModels/e_chickenq.s3o differ diff --git a/Objects3D/ChickenDefenseModels/epic_chickenq.s3o b/Objects3D/ChickenDefenseModels/epic_chickenq.s3o new file mode 100644 index 000000000..9f00b9302 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/epic_chickenq.s3o differ diff --git a/Objects3D/ChickenDefenseModels/greyrock2.s3o b/Objects3D/ChickenDefenseModels/greyrock2.s3o new file mode 100644 index 000000000..57f9d995b Binary files /dev/null and b/Objects3D/ChickenDefenseModels/greyrock2.s3o differ diff --git a/Objects3D/ChickenDefenseModels/h_chickenq.s3o b/Objects3D/ChickenDefenseModels/h_chickenq.s3o new file mode 100644 index 000000000..7b3aa5d51 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/h_chickenq.s3o differ diff --git a/Objects3D/ChickenDefenseModels/roost.s3o b/Objects3D/ChickenDefenseModels/roost.s3o new file mode 100644 index 000000000..5e59350b4 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/roost.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chicken_white.s3o b/Objects3D/ChickenDefenseModels/s_chicken_white.s3o new file mode 100644 index 000000000..59da3e495 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chicken_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickena_white.s3o b/Objects3D/ChickenDefenseModels/s_chickena_white.s3o new file mode 100644 index 000000000..6cdfd6571 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickena_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickenboss2_white.s3o b/Objects3D/ChickenDefenseModels/s_chickenboss2_white.s3o new file mode 100644 index 000000000..8c9e75ffd Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickenboss2_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickenboss_white.s3o b/Objects3D/ChickenDefenseModels/s_chickenboss_white.s3o new file mode 100644 index 000000000..6c9ecf38c Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickenboss_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickenq_spawner.s3o b/Objects3D/ChickenDefenseModels/s_chickenq_spawner.s3o new file mode 100644 index 000000000..b58930301 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickenq_spawner.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickens_white.s3o b/Objects3D/ChickenDefenseModels/s_chickens_white.s3o new file mode 100644 index 000000000..2c865c38c Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickens_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/s_chickenw_white.s3o b/Objects3D/ChickenDefenseModels/s_chickenw_white.s3o new file mode 100644 index 000000000..86d090f4a Binary files /dev/null and b/Objects3D/ChickenDefenseModels/s_chickenw_white.s3o differ diff --git a/Objects3D/ChickenDefenseModels/sgreyrock1.s3o b/Objects3D/ChickenDefenseModels/sgreyrock1.s3o new file mode 100644 index 000000000..bbd8a92b6 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/sgreyrock1.s3o differ diff --git a/Objects3D/ChickenDefenseModels/spike.s3o b/Objects3D/ChickenDefenseModels/spike.s3o new file mode 100644 index 000000000..ba74e8949 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/spike.s3o differ diff --git a/Objects3D/ChickenDefenseModels/spiker_gunship.s3o b/Objects3D/ChickenDefenseModels/spiker_gunship.s3o new file mode 100644 index 000000000..1430d767f Binary files /dev/null and b/Objects3D/ChickenDefenseModels/spiker_gunship.s3o differ diff --git a/Objects3D/ChickenDefenseModels/tube.s3o b/Objects3D/ChickenDefenseModels/tube.s3o new file mode 100644 index 000000000..49c6e0ccc Binary files /dev/null and b/Objects3D/ChickenDefenseModels/tube.s3o differ diff --git a/Objects3D/ChickenDefenseModels/ve_chickenq.s3o b/Objects3D/ChickenDefenseModels/ve_chickenq.s3o new file mode 100644 index 000000000..ce297d478 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/ve_chickenq.s3o differ diff --git a/Objects3D/ChickenDefenseModels/vh_chickenq.s3o b/Objects3D/ChickenDefenseModels/vh_chickenq.s3o new file mode 100644 index 000000000..efc363ac7 Binary files /dev/null and b/Objects3D/ChickenDefenseModels/vh_chickenq.s3o differ diff --git a/Objects3D/Lootboxes/lootbox.s3o b/Objects3D/Lootboxes/lootbox.s3o new file mode 100644 index 000000000..07605db70 Binary files /dev/null and b/Objects3D/Lootboxes/lootbox.s3o differ diff --git a/Objects3D/Lootboxes/lootbox3x3.s3o b/Objects3D/Lootboxes/lootbox3x3.s3o new file mode 100644 index 000000000..dab6f635d Binary files /dev/null and b/Objects3D/Lootboxes/lootbox3x3.s3o differ diff --git a/Objects3D/Lootboxes/lootbox4x4.s3o b/Objects3D/Lootboxes/lootbox4x4.s3o new file mode 100644 index 000000000..2944ea156 Binary files /dev/null and b/Objects3D/Lootboxes/lootbox4x4.s3o differ diff --git a/Objects3D/Lootboxes/lootbox5x5.s3o b/Objects3D/Lootboxes/lootbox5x5.s3o new file mode 100644 index 000000000..0a0413764 Binary files /dev/null and b/Objects3D/Lootboxes/lootbox5x5.s3o differ diff --git a/Objects3D/Lootboxes/lootbox6x6.s3o b/Objects3D/Lootboxes/lootbox6x6.s3o new file mode 100644 index 000000000..5f4be4091 Binary files /dev/null and b/Objects3D/Lootboxes/lootbox6x6.s3o differ diff --git a/Objects3D/airscout.s3o b/Objects3D/airscout.s3o deleted file mode 100644 index 5270222ca..000000000 Binary files a/Objects3D/airscout.s3o and /dev/null differ diff --git a/Objects3D/ammobox.s3o b/Objects3D/ammobox.s3o deleted file mode 100644 index 29e8cad3b..000000000 Binary files a/Objects3D/ammobox.s3o and /dev/null differ diff --git a/Objects3D/armflash.s3o b/Objects3D/armflash.s3o deleted file mode 100644 index 81794161b..000000000 Binary files a/Objects3D/armflash.s3o and /dev/null differ diff --git a/Objects3D/eaatank.s3o b/Objects3D/eaatank.s3o deleted file mode 100644 index dc675bd81..000000000 Binary files a/Objects3D/eaatank.s3o and /dev/null differ diff --git a/Objects3D/eaatank2.s3o b/Objects3D/eaatank2.s3o deleted file mode 100644 index 6b6a5fd20..000000000 Binary files a/Objects3D/eaatank2.s3o and /dev/null differ diff --git a/Objects3D/eaaturret.s3o b/Objects3D/eaaturret.s3o deleted file mode 100644 index 9e35d320b..000000000 Binary files a/Objects3D/eaaturret.s3o and /dev/null differ diff --git a/Objects3D/eaaturret2.s3o b/Objects3D/eaaturret2.s3o deleted file mode 100644 index 7f8404b4a..000000000 Binary files a/Objects3D/eaaturret2.s3o and /dev/null differ diff --git a/Objects3D/eaircon.s3o b/Objects3D/eaircon.s3o deleted file mode 100644 index f537be6c3..000000000 Binary files a/Objects3D/eaircon.s3o and /dev/null differ diff --git a/Objects3D/eairemp.s3o b/Objects3D/eairemp.s3o new file mode 100644 index 000000000..828646a06 Binary files /dev/null and b/Objects3D/eairemp.s3o differ diff --git a/Objects3D/eairengineer.s3o b/Objects3D/eairengineer.s3o deleted file mode 100644 index 5d62bf3c9..000000000 Binary files a/Objects3D/eairengineer.s3o and /dev/null differ diff --git a/Objects3D/eairengineer2.s3o b/Objects3D/eairengineer2.s3o deleted file mode 100644 index d49bd7e0b..000000000 Binary files a/Objects3D/eairengineer2.s3o and /dev/null differ diff --git a/Objects3D/eairplant - chopped.s3o b/Objects3D/eairplant - chopped.s3o deleted file mode 100644 index 91b41cd32..000000000 Binary files a/Objects3D/eairplant - chopped.s3o and /dev/null differ diff --git a/Objects3D/eairplant.s3o b/Objects3D/eairplant.s3o deleted file mode 100644 index c400ac1b3..000000000 Binary files a/Objects3D/eairplant.s3o and /dev/null differ diff --git a/Objects3D/eairplant2.s3o b/Objects3D/eairplant2.s3o deleted file mode 100644 index 5558c8a4e..000000000 Binary files a/Objects3D/eairplant2.s3o and /dev/null differ diff --git a/Objects3D/eairplant3.s3o b/Objects3D/eairplant3.s3o index 8a70f021a..15f93d5c5 100644 Binary files a/Objects3D/eairplant3.s3o and b/Objects3D/eairplant3.s3o differ diff --git a/Objects3D/eallterraa.s3o b/Objects3D/eallterraa.s3o deleted file mode 100644 index 5c813dac0..000000000 Binary files a/Objects3D/eallterraa.s3o and /dev/null differ diff --git a/Objects3D/eallterranarchid.s3o b/Objects3D/eallterranarchid.s3o new file mode 100644 index 000000000..6bca029ab Binary files /dev/null and b/Objects3D/eallterranarchid.s3o differ diff --git a/Objects3D/eallterrassault.s3o b/Objects3D/eallterrassault.s3o index f997c43bb..fc7e6e596 100644 Binary files a/Objects3D/eallterrassault.s3o and b/Objects3D/eallterrassault.s3o differ diff --git a/Objects3D/eallterrengineer.s3o b/Objects3D/eallterrengineer.s3o deleted file mode 100644 index ba54202de..000000000 Binary files a/Objects3D/eallterrengineer.s3o and /dev/null differ diff --git a/Objects3D/eallterrfac2.s3o b/Objects3D/eallterrfac2.s3o index cedfb6087..16127424a 100644 Binary files a/Objects3D/eallterrfac2.s3o and b/Objects3D/eallterrfac2.s3o differ diff --git a/Objects3D/eallterrheavy.s3o b/Objects3D/eallterrheavy.s3o deleted file mode 100644 index 791969f8e..000000000 Binary files a/Objects3D/eallterrheavy.s3o and /dev/null differ diff --git a/Objects3D/eallterrheavy2.s3o b/Objects3D/eallterrheavy2.s3o index 17154705e..d32f9d7a5 100644 Binary files a/Objects3D/eallterrheavy2.s3o and b/Objects3D/eallterrheavy2.s3o differ diff --git a/Objects3D/eallterrlight.s3o b/Objects3D/eallterrlight.s3o deleted file mode 100644 index 71ca30eb5..000000000 Binary files a/Objects3D/eallterrlight.s3o and /dev/null differ diff --git a/Objects3D/eallterrlight2.s3o b/Objects3D/eallterrlight2.s3o index 242b41ed8..c4894fcfa 100644 Binary files a/Objects3D/eallterrlight2.s3o and b/Objects3D/eallterrlight2.s3o differ diff --git a/Objects3D/eallterrmed.s3o b/Objects3D/eallterrmed.s3o deleted file mode 100644 index 10fdea19e..000000000 Binary files a/Objects3D/eallterrmed.s3o and /dev/null differ diff --git a/Objects3D/eallterrmed2.s3o b/Objects3D/eallterrmed2.s3o index 900d40237..0005e471c 100644 Binary files a/Objects3D/eallterrmed2.s3o and b/Objects3D/eallterrmed2.s3o differ diff --git a/Objects3D/eallterrriot.s3o b/Objects3D/eallterrriot.s3o deleted file mode 100644 index e6c1130ba..000000000 Binary files a/Objects3D/eallterrriot.s3o and /dev/null differ diff --git a/Objects3D/eallterrriot2.s3o b/Objects3D/eallterrriot2.s3o index 9280248e0..7a77bc9cc 100644 Binary files a/Objects3D/eallterrriot2.s3o and b/Objects3D/eallterrriot2.s3o differ diff --git a/Objects3D/eallterrshield.s3o b/Objects3D/eallterrshield.s3o index 53df34eed..995bd4a5b 100644 Binary files a/Objects3D/eallterrshield.s3o and b/Objects3D/eallterrshield.s3o differ diff --git a/Objects3D/eamphibaa.s3o b/Objects3D/eamphibaa.s3o index 37722f0cb..a01d73a44 100644 Binary files a/Objects3D/eamphibaa.s3o and b/Objects3D/eamphibaa.s3o differ diff --git a/Objects3D/eamphibaaturret.s3o b/Objects3D/eamphibaaturret.s3o new file mode 100644 index 000000000..e515453cb Binary files /dev/null and b/Objects3D/eamphibaaturret.s3o differ diff --git a/Objects3D/eamphibarty2.s3o b/Objects3D/eamphibarty2.s3o index e5694759b..502d531a3 100644 Binary files a/Objects3D/eamphibarty2.s3o and b/Objects3D/eamphibarty2.s3o differ diff --git a/Objects3D/eamphibbuggy2.s3o b/Objects3D/eamphibbuggy2.s3o index 203325ebf..65f5c95d8 100644 Binary files a/Objects3D/eamphibbuggy2.s3o and b/Objects3D/eamphibbuggy2.s3o differ diff --git a/Objects3D/eamphibdrone.s3o b/Objects3D/eamphibdrone.s3o deleted file mode 100644 index 616136ff7..000000000 Binary files a/Objects3D/eamphibdrone.s3o and /dev/null differ diff --git a/Objects3D/eamphibfac2.s3o b/Objects3D/eamphibfac2.s3o index e8960677d..c873a4b3f 100644 Binary files a/Objects3D/eamphibfac2.s3o and b/Objects3D/eamphibfac2.s3o differ diff --git a/Objects3D/eamphibleveler.s3o b/Objects3D/eamphibleveler.s3o new file mode 100644 index 000000000..fd94df023 Binary files /dev/null and b/Objects3D/eamphibleveler.s3o differ diff --git a/Objects3D/eamphibmedtank2.s3o b/Objects3D/eamphibmedtank2.s3o index f57e8ca0e..cebd097e4 100644 Binary files a/Objects3D/eamphibmedtank2.s3o and b/Objects3D/eamphibmedtank2.s3o differ diff --git a/Objects3D/eamphibriot.s3o b/Objects3D/eamphibriot.s3o deleted file mode 100644 index 134cb6ad5..000000000 Binary files a/Objects3D/eamphibriot.s3o and /dev/null differ diff --git a/Objects3D/eamphibriot2.s3o b/Objects3D/eamphibriot2.s3o index b6e1ded5c..025907c31 100644 Binary files a/Objects3D/eamphibriot2.s3o and b/Objects3D/eamphibriot2.s3o differ diff --git a/Objects3D/eamphibrock.s3o b/Objects3D/eamphibrock.s3o deleted file mode 100644 index 49ee140db..000000000 Binary files a/Objects3D/eamphibrock.s3o and /dev/null differ diff --git a/Objects3D/eamphibrock2.s3o b/Objects3D/eamphibrock2.s3o deleted file mode 100644 index 587a8e062..000000000 Binary files a/Objects3D/eamphibrock2.s3o and /dev/null differ diff --git a/Objects3D/eamphibrock3.s3o b/Objects3D/eamphibrock3.s3o deleted file mode 100644 index c0229fbd8..000000000 Binary files a/Objects3D/eamphibrock3.s3o and /dev/null differ diff --git a/Objects3D/eamphibrock4.s3o b/Objects3D/eamphibrock4.s3o index 5735c6a48..8ebd754a8 100644 Binary files a/Objects3D/eamphibrock4.s3o and b/Objects3D/eamphibrock4.s3o differ diff --git a/Objects3D/eantinuke.s3o b/Objects3D/eantinuke.s3o new file mode 100644 index 000000000..fc14e7862 Binary files /dev/null and b/Objects3D/eantinuke.s3o differ diff --git a/Objects3D/eartytank.s3o b/Objects3D/eartytank.s3o deleted file mode 100644 index 4a2323c81..000000000 Binary files a/Objects3D/eartytank.s3o and /dev/null differ diff --git a/Objects3D/eartytank2.s3o b/Objects3D/eartytank2.s3o index 2de7cec89..33d70bd6c 100644 Binary files a/Objects3D/eartytank2.s3o and b/Objects3D/eartytank2.s3o differ diff --git a/Objects3D/eartytankbase.s3o b/Objects3D/eartytankbase.s3o new file mode 100644 index 000000000..5268c33a4 Binary files /dev/null and b/Objects3D/eartytankbase.s3o differ diff --git a/Objects3D/eartyturret.s3o b/Objects3D/eartyturret.s3o new file mode 100644 index 000000000..b7d2b97cb Binary files /dev/null and b/Objects3D/eartyturret.s3o differ diff --git a/Objects3D/ebarricade.s3o b/Objects3D/ebarricade.s3o deleted file mode 100644 index 2b9034098..000000000 Binary files a/Objects3D/ebarricade.s3o and /dev/null differ diff --git a/Objects3D/ebarricade2.s3o b/Objects3D/ebarricade2.s3o deleted file mode 100644 index 615cbe7eb..000000000 Binary files a/Objects3D/ebarricade2.s3o and /dev/null differ diff --git a/Objects3D/ebarricade3.s3o b/Objects3D/ebarricade3.s3o index 0df4a0cdb..b0e421280 100644 Binary files a/Objects3D/ebarricade3.s3o and b/Objects3D/ebarricade3.s3o differ diff --git a/Objects3D/ebasefactory - Copy.s3o b/Objects3D/ebasefactory - Copy.s3o deleted file mode 100644 index ec5c62cc4..000000000 Binary files a/Objects3D/ebasefactory - Copy.s3o and /dev/null differ diff --git a/Objects3D/ebasefactory.s3o b/Objects3D/ebasefactory.s3o deleted file mode 100644 index 27255c47a..000000000 Binary files a/Objects3D/ebasefactory.s3o and /dev/null differ diff --git a/Objects3D/ebomb.s3o b/Objects3D/ebomb.s3o deleted file mode 100644 index 722431f62..000000000 Binary files a/Objects3D/ebomb.s3o and /dev/null differ diff --git a/Objects3D/ebomb2.s3o b/Objects3D/ebomb2.s3o deleted file mode 100644 index 20646cd54..000000000 Binary files a/Objects3D/ebomb2.s3o and /dev/null differ diff --git a/Objects3D/ebomber.s3o b/Objects3D/ebomber.s3o deleted file mode 100644 index 440549292..000000000 Binary files a/Objects3D/ebomber.s3o and /dev/null differ diff --git a/Objects3D/ebomber2-small.s3o b/Objects3D/ebomber2-small.s3o new file mode 100644 index 000000000..7eacb17a0 Binary files /dev/null and b/Objects3D/ebomber2-small.s3o differ diff --git a/Objects3D/ebomber2.s3o b/Objects3D/ebomber2.s3o index 5436fc452..a8daccc5e 100644 Binary files a/Objects3D/ebomber2.s3o and b/Objects3D/ebomber2.s3o differ diff --git a/Objects3D/ebox.s3o b/Objects3D/ebox.s3o new file mode 100644 index 000000000..4dc8eae9c Binary files /dev/null and b/Objects3D/ebox.s3o differ diff --git a/Objects3D/ebox_small.s3o b/Objects3D/ebox_small.s3o new file mode 100644 index 000000000..a246d8e6a Binary files /dev/null and b/Objects3D/ebox_small.s3o differ diff --git a/Objects3D/ecommander-meteor.s3o b/Objects3D/ecommander-meteor.s3o new file mode 100644 index 000000000..e2e9f5430 Binary files /dev/null and b/Objects3D/ecommander-meteor.s3o differ diff --git a/Objects3D/ecommander.s3o b/Objects3D/ecommander.s3o deleted file mode 100644 index 92aadb2df..000000000 Binary files a/Objects3D/ecommander.s3o and /dev/null differ diff --git a/Objects3D/ecommander2.s3o b/Objects3D/ecommander2.s3o deleted file mode 100644 index 1fb712e0c..000000000 Binary files a/Objects3D/ecommander2.s3o and /dev/null differ diff --git a/Objects3D/ecommander3.s3o b/Objects3D/ecommander3.s3o deleted file mode 100644 index ea3404baa..000000000 Binary files a/Objects3D/ecommander3.s3o and /dev/null differ diff --git a/Objects3D/ecommander4-battle-large.s3o b/Objects3D/ecommander4-battle-large.s3o new file mode 100644 index 000000000..0fba34008 Binary files /dev/null and b/Objects3D/ecommander4-battle-large.s3o differ diff --git a/Objects3D/ecommander4-battle.s3o b/Objects3D/ecommander4-battle.s3o new file mode 100644 index 000000000..cf5817de3 Binary files /dev/null and b/Objects3D/ecommander4-battle.s3o differ diff --git a/Objects3D/ecommander4.s3o b/Objects3D/ecommander4.s3o index b54f8298d..feaec1baf 100644 Binary files a/Objects3D/ecommander4.s3o and b/Objects3D/ecommander4.s3o differ diff --git a/Objects3D/ecruisemissile.s3o b/Objects3D/ecruisemissile.s3o new file mode 100644 index 000000000..c8e9da9b5 Binary files /dev/null and b/Objects3D/ecruisemissile.s3o differ diff --git a/Objects3D/edrone.s3o b/Objects3D/edrone.s3o deleted file mode 100644 index f6c0abc11..000000000 Binary files a/Objects3D/edrone.s3o and /dev/null differ diff --git a/Objects3D/edrone2.s3o b/Objects3D/edrone2.s3o index 8858698df..123054c2e 100644 Binary files a/Objects3D/edrone2.s3o and b/Objects3D/edrone2.s3o differ diff --git a/Objects3D/eengineer3.s3o b/Objects3D/eengineer3.s3o deleted file mode 100644 index c6c972c20..000000000 Binary files a/Objects3D/eengineer3.s3o and /dev/null differ diff --git a/Objects3D/eengineer4.s3o b/Objects3D/eengineer4.s3o deleted file mode 100644 index 4b75f1ec9..000000000 Binary files a/Objects3D/eengineer4.s3o and /dev/null differ diff --git a/Objects3D/eengineer5.s3o b/Objects3D/eengineer5.s3o deleted file mode 100644 index 65575aafb..000000000 Binary files a/Objects3D/eengineer5.s3o and /dev/null differ diff --git a/Objects3D/eengineer6.s3o b/Objects3D/eengineer6.s3o deleted file mode 100644 index ffdb86c3f..000000000 Binary files a/Objects3D/eengineer6.s3o and /dev/null differ diff --git a/Objects3D/eexnukearty.s3o b/Objects3D/eexnukearty.s3o deleted file mode 100644 index ffbb809ab..000000000 Binary files a/Objects3D/eexnukearty.s3o and /dev/null differ diff --git a/Objects3D/eexperimentalfac.s3o b/Objects3D/eexperimentalfac.s3o deleted file mode 100644 index b489eacc8..000000000 Binary files a/Objects3D/eexperimentalfac.s3o and /dev/null differ diff --git a/Objects3D/efatso2.s3o b/Objects3D/efatso2.s3o deleted file mode 100644 index 34ec6c41f..000000000 Binary files a/Objects3D/efatso2.s3o and /dev/null differ diff --git a/Objects3D/efighter.s3o b/Objects3D/efighter.s3o deleted file mode 100644 index 661b9e3cf..000000000 Binary files a/Objects3D/efighter.s3o and /dev/null differ diff --git a/Objects3D/efighter2-small.s3o b/Objects3D/efighter2-small.s3o new file mode 100644 index 000000000..c3acf2359 Binary files /dev/null and b/Objects3D/efighter2-small.s3o differ diff --git a/Objects3D/efighter2.s3o b/Objects3D/efighter2.s3o index 9d95cd726..0becfad6d 100644 Binary files a/Objects3D/efighter2.s3o and b/Objects3D/efighter2.s3o differ diff --git a/Objects3D/efighter3-small.s3o b/Objects3D/efighter3-small.s3o new file mode 100644 index 000000000..33a3834ed Binary files /dev/null and b/Objects3D/efighter3-small.s3o differ diff --git a/Objects3D/efighter3.s3o b/Objects3D/efighter3.s3o new file mode 100644 index 000000000..6892eaa5b Binary files /dev/null and b/Objects3D/efighter3.s3o differ diff --git a/Objects3D/eflakturret.s3o b/Objects3D/eflakturret.s3o new file mode 100644 index 000000000..9c886d0a0 Binary files /dev/null and b/Objects3D/eflakturret.s3o differ diff --git a/Objects3D/eflametank.s3o b/Objects3D/eflametank.s3o deleted file mode 100644 index caf248fbd..000000000 Binary files a/Objects3D/eflametank.s3o and /dev/null differ diff --git a/Objects3D/efusion.s3o b/Objects3D/efusion.s3o deleted file mode 100644 index 7e422b643..000000000 Binary files a/Objects3D/efusion.s3o and /dev/null differ diff --git a/Objects3D/efusion2-huge.s3o b/Objects3D/efusion2-huge.s3o new file mode 100644 index 000000000..ed5a1d08b Binary files /dev/null and b/Objects3D/efusion2-huge.s3o differ diff --git a/Objects3D/efusion2.s3o b/Objects3D/efusion2.s3o index df716c0d0..3c5bfb6cd 100644 Binary files a/Objects3D/efusion2.s3o and b/Objects3D/efusion2.s3o differ diff --git a/Objects3D/egeothermal.s3o b/Objects3D/egeothermal.s3o deleted file mode 100644 index 4abefc3e2..000000000 Binary files a/Objects3D/egeothermal.s3o and /dev/null differ diff --git a/Objects3D/egeothermal2.s3o b/Objects3D/egeothermal2.s3o index 4c49b3261..8d9d9c2ea 100644 Binary files a/Objects3D/egeothermal2.s3o and b/Objects3D/egeothermal2.s3o differ diff --git a/Objects3D/egunship2.s3o b/Objects3D/egunship2.s3o deleted file mode 100644 index f8d9b78e6..000000000 Binary files a/Objects3D/egunship2.s3o and /dev/null differ diff --git a/Objects3D/egunship3-small.s3o b/Objects3D/egunship3-small.s3o new file mode 100644 index 000000000..7e661eb5f Binary files /dev/null and b/Objects3D/egunship3-small.s3o differ diff --git a/Objects3D/egunship3.s3o b/Objects3D/egunship3.s3o index 0c3fcaf26..930391b75 100644 Binary files a/Objects3D/egunship3.s3o and b/Objects3D/egunship3.s3o differ diff --git a/Objects3D/ehbot_turretbase.s3o b/Objects3D/ehbot_turretbase.s3o new file mode 100644 index 000000000..c2078277c Binary files /dev/null and b/Objects3D/ehbot_turretbase.s3o differ diff --git a/Objects3D/ehbotbackpack.s3o b/Objects3D/ehbotbackpack.s3o new file mode 100644 index 000000000..e67d84a38 Binary files /dev/null and b/Objects3D/ehbotbackpack.s3o differ diff --git a/Objects3D/ehbotengineer2.s3o b/Objects3D/ehbotengineer2.s3o new file mode 100644 index 000000000..5b7919075 Binary files /dev/null and b/Objects3D/ehbotengineer2.s3o differ diff --git a/Objects3D/ehbotengineer_turret.s3o b/Objects3D/ehbotengineer_turret.s3o new file mode 100644 index 000000000..db3dd40e4 Binary files /dev/null and b/Objects3D/ehbotengineer_turret.s3o differ diff --git a/Objects3D/ehbotfac.s3o b/Objects3D/ehbotfac.s3o new file mode 100644 index 000000000..3ebad5882 Binary files /dev/null and b/Objects3D/ehbotfac.s3o differ diff --git a/Objects3D/ehbotkarganneth.s3o b/Objects3D/ehbotkarganneth.s3o new file mode 100644 index 000000000..6a058200c Binary files /dev/null and b/Objects3D/ehbotkarganneth.s3o differ diff --git a/Objects3D/ehbotkarganneth_turret.s3o b/Objects3D/ehbotkarganneth_turret.s3o new file mode 100644 index 000000000..157cbdc4a Binary files /dev/null and b/Objects3D/ehbotkarganneth_turret.s3o differ diff --git a/Objects3D/ehbotpeewee2.s3o b/Objects3D/ehbotpeewee2.s3o new file mode 100644 index 000000000..210788af0 Binary files /dev/null and b/Objects3D/ehbotpeewee2.s3o differ diff --git a/Objects3D/ehbotpeewee_turret.s3o b/Objects3D/ehbotpeewee_turret.s3o new file mode 100644 index 000000000..5b74c6f1f Binary files /dev/null and b/Objects3D/ehbotpeewee_turret.s3o differ diff --git a/Objects3D/ehbotrocko.s3o b/Objects3D/ehbotrocko.s3o new file mode 100644 index 000000000..ffc1a1484 Binary files /dev/null and b/Objects3D/ehbotrocko.s3o differ diff --git a/Objects3D/ehbotrocko_turret.s3o b/Objects3D/ehbotrocko_turret.s3o new file mode 100644 index 000000000..f9a834a00 Binary files /dev/null and b/Objects3D/ehbotrocko_turret.s3o differ diff --git a/Objects3D/ehbotsniper.s3o b/Objects3D/ehbotsniper.s3o new file mode 100644 index 000000000..523f0f1e6 Binary files /dev/null and b/Objects3D/ehbotsniper.s3o differ diff --git a/Objects3D/ehbotsniper_turret.s3o b/Objects3D/ehbotsniper_turret.s3o new file mode 100644 index 000000000..86f09fdec Binary files /dev/null and b/Objects3D/ehbotsniper_turret.s3o differ diff --git a/Objects3D/ehbotthud.s3o b/Objects3D/ehbotthud.s3o new file mode 100644 index 000000000..01d43ab52 Binary files /dev/null and b/Objects3D/ehbotthud.s3o differ diff --git a/Objects3D/ehbotthud_turret.s3o b/Objects3D/ehbotthud_turret.s3o new file mode 100644 index 000000000..52a1a6004 Binary files /dev/null and b/Objects3D/ehbotthud_turret.s3o differ diff --git a/Objects3D/eheavytank3.s3o b/Objects3D/eheavytank3.s3o deleted file mode 100644 index e59f243d0..000000000 Binary files a/Objects3D/eheavytank3.s3o and /dev/null differ diff --git a/Objects3D/eheavytank4.s3o b/Objects3D/eheavytank4.s3o index e100e1584..8f356fa49 100644 Binary files a/Objects3D/eheavytank4.s3o and b/Objects3D/eheavytank4.s3o differ diff --git a/Objects3D/eheavyturret.s3o b/Objects3D/eheavyturret.s3o deleted file mode 100644 index ebd3090d6..000000000 Binary files a/Objects3D/eheavyturret.s3o and /dev/null differ diff --git a/Objects3D/eheavyturret2.s3o b/Objects3D/eheavyturret2.s3o deleted file mode 100644 index e088dd562..000000000 Binary files a/Objects3D/eheavyturret2.s3o and /dev/null differ diff --git a/Objects3D/eheavyturret3.s3o b/Objects3D/eheavyturret3.s3o index 9f7044532..94a41848c 100644 Binary files a/Objects3D/eheavyturret3.s3o and b/Objects3D/eheavyturret3.s3o differ diff --git a/Objects3D/ehoverfactory.s3o b/Objects3D/ehoverfactory.s3o index be8529e27..e92fd263e 100644 Binary files a/Objects3D/ehoverfactory.s3o and b/Objects3D/ehoverfactory.s3o differ diff --git a/Objects3D/ejammer2.s3o b/Objects3D/ejammer2.s3o deleted file mode 100644 index 04c7212cd..000000000 Binary files a/Objects3D/ejammer2.s3o and /dev/null differ diff --git a/Objects3D/ejammer3.s3o b/Objects3D/ejammer3.s3o new file mode 100644 index 000000000..fe6388ca6 Binary files /dev/null and b/Objects3D/ejammer3.s3o differ diff --git a/Objects3D/ekrabgroth.s3o b/Objects3D/ekrabgroth.s3o deleted file mode 100644 index e8bd8b887..000000000 Binary files a/Objects3D/ekrabgroth.s3o and /dev/null differ diff --git a/Objects3D/ekrow.s3o b/Objects3D/ekrow.s3o new file mode 100644 index 000000000..657b7d027 Binary files /dev/null and b/Objects3D/ekrow.s3o differ diff --git a/Objects3D/elacerator.s3o b/Objects3D/elacerator.s3o new file mode 100644 index 000000000..7ca14e116 Binary files /dev/null and b/Objects3D/elacerator.s3o differ diff --git a/Objects3D/elaserbattery.s3o b/Objects3D/elaserbattery.s3o new file mode 100644 index 000000000..89c89f738 Binary files /dev/null and b/Objects3D/elaserbattery.s3o differ diff --git a/Objects3D/elighttank3.s3o b/Objects3D/elighttank3.s3o deleted file mode 100644 index 811f939f4..000000000 Binary files a/Objects3D/elighttank3.s3o and /dev/null differ diff --git a/Objects3D/elighttank4.s3o b/Objects3D/elighttank4.s3o index 613fe730b..9da20287a 100644 Binary files a/Objects3D/elighttank4.s3o and b/Objects3D/elighttank4.s3o differ diff --git a/Objects3D/elightturret.s3o b/Objects3D/elightturret.s3o deleted file mode 100644 index ae04ec6fa..000000000 Binary files a/Objects3D/elightturret.s3o and /dev/null differ diff --git a/Objects3D/elightturret2.s3o b/Objects3D/elightturret2.s3o deleted file mode 100644 index f16a2dadb..000000000 Binary files a/Objects3D/elightturret2.s3o and /dev/null differ diff --git a/Objects3D/elightturret3.s3o b/Objects3D/elightturret3.s3o index e57813851..b3d9c06d6 100644 Binary files a/Objects3D/elightturret3.s3o and b/Objects3D/elightturret3.s3o differ diff --git a/Objects3D/elrpc.s3o b/Objects3D/elrpc.s3o deleted file mode 100644 index 9772f781a..000000000 Binary files a/Objects3D/elrpc.s3o and /dev/null differ diff --git a/Objects3D/emaker.s3o b/Objects3D/emaker.s3o deleted file mode 100644 index 3eab347dd..000000000 Binary files a/Objects3D/emaker.s3o and /dev/null differ diff --git a/Objects3D/emaker2.s3o b/Objects3D/emaker2.s3o deleted file mode 100644 index bfb503e0c..000000000 Binary files a/Objects3D/emaker2.s3o and /dev/null differ diff --git a/Objects3D/emaker3.s3o b/Objects3D/emaker3.s3o index 14f22db95..bd0b605e9 100644 Binary files a/Objects3D/emaker3.s3o and b/Objects3D/emaker3.s3o differ diff --git a/Objects3D/emediumgen.s3o b/Objects3D/emediumgen.s3o new file mode 100644 index 000000000..cdacf6974 Binary files /dev/null and b/Objects3D/emediumgen.s3o differ diff --git a/Objects3D/emetalextractor.s3o b/Objects3D/emetalextractor.s3o deleted file mode 100644 index d7e1ed70e..000000000 Binary files a/Objects3D/emetalextractor.s3o and /dev/null differ diff --git a/Objects3D/emetalextractor2.s3o b/Objects3D/emetalextractor2.s3o index 75849aca5..a5401afa9 100644 Binary files a/Objects3D/emetalextractor2.s3o and b/Objects3D/emetalextractor2.s3o differ diff --git a/Objects3D/emetalextractor2_small.s3o b/Objects3D/emetalextractor2_small.s3o new file mode 100644 index 000000000..bfe71e115 Binary files /dev/null and b/Objects3D/emetalextractor2_small.s3o differ diff --git a/Objects3D/emetalextractor2_up1.s3o b/Objects3D/emetalextractor2_up1.s3o new file mode 100644 index 000000000..47e02f7e5 Binary files /dev/null and b/Objects3D/emetalextractor2_up1.s3o differ diff --git a/Objects3D/emetalextractor2_up2.s3o b/Objects3D/emetalextractor2_up2.s3o new file mode 100644 index 000000000..4492be82a Binary files /dev/null and b/Objects3D/emetalextractor2_up2.s3o differ diff --git a/Objects3D/emetalextractor2_up3.s3o b/Objects3D/emetalextractor2_up3.s3o new file mode 100644 index 000000000..9dd117b8d Binary files /dev/null and b/Objects3D/emetalextractor2_up3.s3o differ diff --git a/Objects3D/emetalextractor3.s3o b/Objects3D/emetalextractor3.s3o new file mode 100644 index 000000000..82ac128ff Binary files /dev/null and b/Objects3D/emetalextractor3.s3o differ diff --git a/Objects3D/emine.s3o b/Objects3D/emine.s3o index e3a0a020f..7326e42e1 100644 Binary files a/Objects3D/emine.s3o and b/Objects3D/emine.s3o differ diff --git a/Objects3D/emissiletank.s3o b/Objects3D/emissiletank.s3o deleted file mode 100644 index 6b5c37db2..000000000 Binary files a/Objects3D/emissiletank.s3o and /dev/null differ diff --git a/Objects3D/emissiletank2.s3o b/Objects3D/emissiletank2.s3o index 512d703cc..946d58d6d 100644 Binary files a/Objects3D/emissiletank2.s3o and b/Objects3D/emissiletank2.s3o differ diff --git a/Objects3D/eorb.s3o b/Objects3D/eorb.s3o deleted file mode 100644 index e180901a8..000000000 Binary files a/Objects3D/eorb.s3o and /dev/null differ diff --git a/Objects3D/eorb2.s3o b/Objects3D/eorb2.s3o deleted file mode 100644 index f7c00fb09..000000000 Binary files a/Objects3D/eorb2.s3o and /dev/null differ diff --git a/Objects3D/eorb3.s3o b/Objects3D/eorb3.s3o deleted file mode 100644 index 5d0c447d1..000000000 Binary files a/Objects3D/eorb3.s3o and /dev/null differ diff --git a/Objects3D/eorb4.s3o b/Objects3D/eorb4.s3o new file mode 100644 index 000000000..5223c0adc Binary files /dev/null and b/Objects3D/eorb4.s3o differ diff --git a/Objects3D/epowerplant.s3o b/Objects3D/epowerplant.s3o deleted file mode 100644 index ce9b09adf..000000000 Binary files a/Objects3D/epowerplant.s3o and /dev/null differ diff --git a/Objects3D/epowerplant3x3.s3o b/Objects3D/epowerplant3x3.s3o new file mode 100644 index 000000000..b875e526f Binary files /dev/null and b/Objects3D/epowerplant3x3.s3o differ diff --git a/Objects3D/epowerplant6x6.s3o b/Objects3D/epowerplant6x6.s3o new file mode 100644 index 000000000..82f0219b2 Binary files /dev/null and b/Objects3D/epowerplant6x6.s3o differ diff --git a/Objects3D/eradar2.s3o b/Objects3D/eradar2.s3o deleted file mode 100644 index a91ba9172..000000000 Binary files a/Objects3D/eradar2.s3o and /dev/null differ diff --git a/Objects3D/eradar3.s3o b/Objects3D/eradar3.s3o index df8c572f7..0954845ab 100644 Binary files a/Objects3D/eradar3.s3o and b/Objects3D/eradar3.s3o differ diff --git a/Objects3D/eradar3_large.s3o b/Objects3D/eradar3_large.s3o new file mode 100644 index 000000000..4ade9a77a Binary files /dev/null and b/Objects3D/eradar3_large.s3o differ diff --git a/Objects3D/eradar3_small.s3o b/Objects3D/eradar3_small.s3o new file mode 100644 index 000000000..141b60b38 Binary files /dev/null and b/Objects3D/eradar3_small.s3o differ diff --git a/Objects3D/eraider.s3o b/Objects3D/eraider.s3o new file mode 100644 index 000000000..4cb12301b Binary files /dev/null and b/Objects3D/eraider.s3o differ diff --git a/Objects3D/eriottank2.s3o b/Objects3D/eriottank2.s3o deleted file mode 100644 index 528e817fa..000000000 Binary files a/Objects3D/eriottank2.s3o and /dev/null differ diff --git a/Objects3D/eriottank3.s3o b/Objects3D/eriottank3.s3o index a2ab84041..cc4f36445 100644 Binary files a/Objects3D/eriottank3.s3o and b/Objects3D/eriottank3.s3o differ diff --git a/Objects3D/escout.s3o b/Objects3D/escout.s3o deleted file mode 100644 index 3afbe3ce3..000000000 Binary files a/Objects3D/escout.s3o and /dev/null differ diff --git a/Objects3D/escout2.s3o b/Objects3D/escout2.s3o index 78154a11e..806e2c26e 100644 Binary files a/Objects3D/escout2.s3o and b/Objects3D/escout2.s3o differ diff --git a/Objects3D/esilo.s3o b/Objects3D/esilo.s3o deleted file mode 100644 index afe4732c7..000000000 Binary files a/Objects3D/esilo.s3o and /dev/null differ diff --git a/Objects3D/esilo2.s3o b/Objects3D/esilo2.s3o new file mode 100644 index 000000000..90a3af1e0 Binary files /dev/null and b/Objects3D/esilo2.s3o differ diff --git a/Objects3D/estorage.s3o b/Objects3D/estorage.s3o deleted file mode 100644 index 13c7e7d70..000000000 Binary files a/Objects3D/estorage.s3o and /dev/null differ diff --git a/Objects3D/estorage2.s3o b/Objects3D/estorage2.s3o index f8992d01f..9b07473da 100644 Binary files a/Objects3D/estorage2.s3o and b/Objects3D/estorage2.s3o differ diff --git a/Objects3D/estorage2_small.s3o b/Objects3D/estorage2_small.s3o new file mode 100644 index 000000000..c883e1009 Binary files /dev/null and b/Objects3D/estorage2_small.s3o differ diff --git a/Objects3D/esubmarine.s3o b/Objects3D/esubmarine.s3o deleted file mode 100644 index 3bad0910c..000000000 Binary files a/Objects3D/esubmarine.s3o and /dev/null differ diff --git a/Objects3D/esubplane.s3o b/Objects3D/esubplane.s3o deleted file mode 100644 index 3bad0910c..000000000 Binary files a/Objects3D/esubplane.s3o and /dev/null differ diff --git a/Objects3D/etransport.s3o b/Objects3D/etransport.s3o deleted file mode 100644 index 64c07c8c5..000000000 Binary files a/Objects3D/etransport.s3o and /dev/null differ diff --git a/Objects3D/etransport2-small.s3o b/Objects3D/etransport2-small.s3o new file mode 100644 index 000000000..c976db991 Binary files /dev/null and b/Objects3D/etransport2-small.s3o differ diff --git a/Objects3D/euwmetalextractor.s3o b/Objects3D/euwmetalextractor.s3o deleted file mode 100644 index 8401b0ad8..000000000 Binary files a/Objects3D/euwmetalextractor.s3o and /dev/null differ diff --git a/Objects3D/euwturret.s3o b/Objects3D/euwturret.s3o index 7e7d2cff0..7cb632257 100644 Binary files a/Objects3D/euwturret.s3o and b/Objects3D/euwturret.s3o differ diff --git a/Objects3D/experimentalfac.s3o b/Objects3D/experimentalfac.s3o deleted file mode 100644 index 6d31ee689..000000000 Binary files a/Objects3D/experimentalfac.s3o and /dev/null differ diff --git a/Objects3D/extankdestroyer.s3o b/Objects3D/extankdestroyer.s3o deleted file mode 100644 index 76322ab86..000000000 Binary files a/Objects3D/extankdestroyer.s3o and /dev/null differ diff --git a/Objects3D/f2engineer.s3o b/Objects3D/f2engineer.s3o new file mode 100644 index 000000000..0fa147e53 Binary files /dev/null and b/Objects3D/f2engineer.s3o differ diff --git a/Objects3D/faction/armanni.s3o b/Objects3D/faction/armanni.s3o new file mode 100644 index 000000000..eebeddad8 Binary files /dev/null and b/Objects3D/faction/armanni.s3o differ diff --git a/Objects3D/faction/armarad.s3o b/Objects3D/faction/armarad.s3o new file mode 100644 index 000000000..e9d55c079 Binary files /dev/null and b/Objects3D/faction/armarad.s3o differ diff --git a/Objects3D/faction/armbrtha.s3o b/Objects3D/faction/armbrtha.s3o new file mode 100644 index 000000000..34b801530 Binary files /dev/null and b/Objects3D/faction/armbrtha.s3o differ diff --git a/Objects3D/faction/armcir.s3o b/Objects3D/faction/armcir.s3o new file mode 100644 index 000000000..aa09397ae Binary files /dev/null and b/Objects3D/faction/armcir.s3o differ diff --git a/Objects3D/faction/armhlt.s3o b/Objects3D/faction/armhlt.s3o new file mode 100644 index 000000000..524fd6617 Binary files /dev/null and b/Objects3D/faction/armhlt.s3o differ diff --git a/Objects3D/faction/cordoom.s3o b/Objects3D/faction/cordoom.s3o new file mode 100644 index 000000000..e07b2a16b Binary files /dev/null and b/Objects3D/faction/cordoom.s3o differ diff --git a/Objects3D/faction/corgate.s3o b/Objects3D/faction/corgate.s3o new file mode 100644 index 000000000..d7cddf62b Binary files /dev/null and b/Objects3D/faction/corgate.s3o differ diff --git a/Objects3D/faction/corpun.s3o b/Objects3D/faction/corpun.s3o new file mode 100644 index 000000000..b2f6a8947 Binary files /dev/null and b/Objects3D/faction/corpun.s3o differ diff --git a/Objects3D/faction/corscreamer.s3o b/Objects3D/faction/corscreamer.s3o new file mode 100644 index 000000000..f2391c52e Binary files /dev/null and b/Objects3D/faction/corscreamer.s3o differ diff --git a/Objects3D/faction/done/armamd.s3o b/Objects3D/faction/done/armamd.s3o new file mode 100644 index 000000000..7f2a7c1f7 Binary files /dev/null and b/Objects3D/faction/done/armamd.s3o differ diff --git a/Objects3D/faction/done/armflea.s3o b/Objects3D/faction/done/armflea.s3o new file mode 100644 index 000000000..51a130189 Binary files /dev/null and b/Objects3D/faction/done/armflea.s3o differ diff --git a/Objects3D/faction/done/armrl.s3o b/Objects3D/faction/done/armrl.s3o new file mode 100644 index 000000000..2bdc6f176 Binary files /dev/null and b/Objects3D/faction/done/armrl.s3o differ diff --git a/Objects3D/faction/done/armrock.s3o b/Objects3D/faction/done/armrock.s3o new file mode 100644 index 000000000..268c4d716 Binary files /dev/null and b/Objects3D/faction/done/armrock.s3o differ diff --git a/Objects3D/faction/done/armwar.s3o b/Objects3D/faction/done/armwar.s3o new file mode 100644 index 000000000..2c3ac3e93 Binary files /dev/null and b/Objects3D/faction/done/armwar.s3o differ diff --git a/Objects3D/faction/done/corck.s3o b/Objects3D/faction/done/corck.s3o new file mode 100644 index 000000000..ce19fcc66 Binary files /dev/null and b/Objects3D/faction/done/corck.s3o differ diff --git a/Objects3D/faction/done/corcrash.s3o b/Objects3D/faction/done/corcrash.s3o new file mode 100644 index 000000000..340d40128 Binary files /dev/null and b/Objects3D/faction/done/corcrash.s3o differ diff --git a/Objects3D/faction/done/corsilo.s3o b/Objects3D/faction/done/corsilo.s3o new file mode 100644 index 000000000..5d67b416d Binary files /dev/null and b/Objects3D/faction/done/corsilo.s3o differ diff --git a/Objects3D/faction/done/coruwadves.s3o b/Objects3D/faction/done/coruwadves.s3o new file mode 100644 index 000000000..65c7b0258 Binary files /dev/null and b/Objects3D/faction/done/coruwadves.s3o differ diff --git a/Objects3D/faction/xantinuke.s3o b/Objects3D/faction/xantinuke.s3o new file mode 100644 index 000000000..eacda98c1 Binary files /dev/null and b/Objects3D/faction/xantinuke.s3o differ diff --git a/Objects3D/faction/xcommander.s3o b/Objects3D/faction/xcommander.s3o new file mode 100644 index 000000000..8b9715949 Binary files /dev/null and b/Objects3D/faction/xcommander.s3o differ diff --git a/Objects3D/faction/xcrasher.s3o b/Objects3D/faction/xcrasher.s3o new file mode 100644 index 000000000..ce516f238 Binary files /dev/null and b/Objects3D/faction/xcrasher.s3o differ diff --git a/Objects3D/faction/xflea.s3o b/Objects3D/faction/xflea.s3o new file mode 100644 index 000000000..1c99f76ca Binary files /dev/null and b/Objects3D/faction/xflea.s3o differ diff --git a/Objects3D/faction/xhammer.s3o b/Objects3D/faction/xhammer.s3o new file mode 100644 index 000000000..d3183cc22 Binary files /dev/null and b/Objects3D/faction/xhammer.s3o differ diff --git a/Objects3D/faction/xkconstructor.s3o b/Objects3D/faction/xkconstructor.s3o new file mode 100644 index 000000000..89771b1f3 Binary files /dev/null and b/Objects3D/faction/xkconstructor.s3o differ diff --git a/Objects3D/faction/xklab.s3o b/Objects3D/faction/xklab.s3o new file mode 100644 index 000000000..ca2db7639 Binary files /dev/null and b/Objects3D/faction/xklab.s3o differ diff --git a/Objects3D/faction/xllt.s3o b/Objects3D/faction/xllt.s3o new file mode 100644 index 000000000..72d02fb19 Binary files /dev/null and b/Objects3D/faction/xllt.s3o differ diff --git a/Objects3D/faction/xmetalextractor.s3o b/Objects3D/faction/xmetalextractor.s3o new file mode 100644 index 000000000..0f864ce0e Binary files /dev/null and b/Objects3D/faction/xmetalextractor.s3o differ diff --git a/Objects3D/faction/xmetalextractormoho.s3o b/Objects3D/faction/xmetalextractormoho.s3o new file mode 100644 index 000000000..d807b1705 Binary files /dev/null and b/Objects3D/faction/xmetalextractormoho.s3o differ diff --git a/Objects3D/faction/xnukesilo.s3o b/Objects3D/faction/xnukesilo.s3o new file mode 100644 index 000000000..f138e51e8 Binary files /dev/null and b/Objects3D/faction/xnukesilo.s3o differ diff --git a/Objects3D/faction/xrocketturret.s3o b/Objects3D/faction/xrocketturret.s3o new file mode 100644 index 000000000..8e4c3dea5 Binary files /dev/null and b/Objects3D/faction/xrocketturret.s3o differ diff --git a/Objects3D/faction/xrocko.s3o b/Objects3D/faction/xrocko.s3o new file mode 100644 index 000000000..924a4e8c1 Binary files /dev/null and b/Objects3D/faction/xrocko.s3o differ diff --git a/Objects3D/faction/xskulk.s3o b/Objects3D/faction/xskulk.s3o new file mode 100644 index 000000000..f2ef70547 Binary files /dev/null and b/Objects3D/faction/xskulk.s3o differ diff --git a/Objects3D/faction/xsolar.s3o b/Objects3D/faction/xsolar.s3o new file mode 100644 index 000000000..51cfb810e Binary files /dev/null and b/Objects3D/faction/xsolar.s3o differ diff --git a/Objects3D/faction/xstorage.s3o b/Objects3D/faction/xstorage.s3o new file mode 100644 index 000000000..0e907cfd8 Binary files /dev/null and b/Objects3D/faction/xstorage.s3o differ diff --git a/Objects3D/faction/xsupply.s3o b/Objects3D/faction/xsupply.s3o new file mode 100644 index 000000000..cd8f0d9eb Binary files /dev/null and b/Objects3D/faction/xsupply.s3o differ diff --git a/Objects3D/faction/xwarrior.s3o b/Objects3D/faction/xwarrior.s3o new file mode 100644 index 000000000..bae261e94 Binary files /dev/null and b/Objects3D/faction/xwarrior.s3o differ diff --git a/Objects3D/features/anarchid/mexes/crystal.dae b/Objects3D/features/anarchid/mexes/crystal.dae new file mode 100644 index 000000000..f523401be --- /dev/null +++ b/Objects3D/features/anarchid/mexes/crystal.dae @@ -0,0 +1,152 @@ + + + + + Blender User + Blender 2.71.0 commit date:2014-06-16, commit time:09:48, hash:a19c1be + + 2014-09-02T23:26:37 + 2014-09-02T23:26:37 + + Z_UP + + + + + + + + + 0 0 0 1 + + + 0 0 0 1 + + + 0.64 0.64 0.64 1 + + + 0.5 0.5 0.5 1 + + + 50 + + + 1 + + + + + + 1 + + + + 1 + + + + + + + 0 0 0 1 + + + 0 0 0 1 + + + 0.64 0.64 0.64 1 + + + 0.5 0.5 0.5 1 + + + 50 + + + 1 + + + + + + 1 + + + + 1 + + + + + + + + + + + + + + + -28.57482 14.02363 38.74325 -32.04541 16.39551 38.52592 -29.20566 4.412431 31.73709 -31.49293 -1.412681 23.94009 -20.52177 1.730081 33.59592 -30.63853 18.03666 37.17802 -28.17702 1.189263 39.0455 -21.62672 -0.2547355 30.72275 -30.00703 3.604059 40.39531 -32.64043 3.454901 39.35707 -31.90339 0.6522143 39.30463 -28.80722 -3.073697 35.61886 -27.26857 -1.908115 34.71975 -30.94706 2.321352 27.1808 -32.87589 9.279316 33.78018 -18.52723 1.912068 38.9177 -18.03405 1.708955 36.64426 -17.17723 0.3930234 38.52372 -32.16743 -1.707076 31.45352 -32.62951 2.034456 31.88062 -24.51544 6.186581 34.79625 -31.16377 -1.343154 33.20217 -28.99618 16.65036 38.04507 -30.16818 -2.588767 31.6014 -31.14277 16.40404 35.94793 -32.74169 14.41273 35.43208 -31.36224 17.68185 36.61339 -29.85112 -0.9496039 24.13496 -29.15092 8.877198 33.96312 -23.64506 4.652561 36.41434 -20.06308 -0.8007915 32.04178 -33.35987 8.008378 33.62783 -33.80538 -0.007297813 33.29013 -18.77325 -1.078669 38.27152 -30.44636 7.915889 39.6401 -19.53642 -0.8841254 36.41211 -33.20174 -1.332766 34.70937 -27.99656 -2.362943 27.70424 -23.29575 -1.100021 29.42847 -33.69492 11.79599 36.63971 -32.4311 8.830438 37.747 -26.13847 3.658423 31.57875 -30.3603 0.357811 24.3194 -17.37231 -0.08451217 36.87754 -25.3859 4.813113 32.27844 -26.46439 4.98484 40.24294 -23.0838 -1.688193 37.38729 -23.49961 -1.046183 35.02803 -30.28615 16.68454 38.92707 -28.56939 11.50372 34.80116 -26.259 7.39291 39.43831 -26.7352 -3.126837 37.07976 -23.11768 -1.396738 31.79518 -32.65082 11.1049 34.65039 -30.59026 -0.6104695 39.11145 -24.15688 1.694533 38.87332 -32.19314 -1.214681 32.76022 -30.92857 -1.666675 30.57573 -25.88334 -1.389871 31.25843 -27.1621 9.205838 34.10079 -26.10444 9.287329 36.31341 -31.08683 5.077342 40.53807 -33.85233 1.568697 35.91408 -31.20442 -1.467992 35.84167 -29.9411 -2.750285 34.25375 -30.01633 -2.002706 28.86068 -25.82044 -0.8156555 28.96841 -25.6093 0.02606225 28.39239 -32.27638 16.71395 37.44598 -33.72312 12.7144 36.36064 -31.1951 8.877456 39.13063 -28.24245 4.556101 31.39675 -26.22833 -1.348024 27.81432 -28.97851 -2.005084 25.50792 -30.74905 -2.592112 25.40711 -31.83861 3.849301 30.92098 -28.18547 4.585507 31.84762 -19.33534 -0.3503698 34.15916 -20.90394 0.5439478 30.7466 -22.9724 1.194843 30.2464 -27.79426 -2.918297 37.05742 -27.12837 -1.636461 39.37013 -26.79269 -1.628706 38.24331 -30.31369 1.638466 39.62731 -18.4971 0.5607141 39.68686 -23.62999 3.646481 38.57072 -27.43653 8.480494 39.69198 -33.68334 6.342024 36.85689 -32.21303 5.956995 31.7766 -34.02242 6.012326 35.45606 -31.25613 -2.727515 26.06168 -22.25063 0.05916774 28.3387 -23.56001 0.6964864 27.75232 -20.89696 0.9895915 29.08472 -22.06762 1.357972 28.80162 -20.55443 3.228377 31.62931 -23.03326 4.799537 30.95791 -20.7492 2.623908 30.17726 -21.80331 2.955614 29.92235 -25.60888 4.365909 29.88647 -25.27758 2.091808 27.89159 -26.89044 4.946324 30.0548 -23.62671 2.823544 29.05233 -24.24328 7.213347 32.63555 -24.76173 6.39529 31.1359 -25.81967 9.011659 32.22132 -26.46314 6.24221 30.61076 -31.426 9.580449 31.1085 -29.46043 9.368263 31.20503 -28.95098 7.103649 30.08874 -31.07623 7.827347 30.05127 -29.27974 10.20617 32.93181 -29.00749 11.43581 33.32416 -30.91827 11.2491 33.25357 -28.34864 10.36003 32.99626 -28.27274 4.712793 28.54338 -29.24257 3.548229 26.00589 -28.63221 1.726564 24.3096 -28.91578 2.454691 24.41231 -26.26985 2.269933 26.68065 -26.96614 14.66747 36.56642 -26.78234 12.45103 35.16942 -26.17628 11.46143 34.86779 -25.72079 11.49652 35.82068 -29.39221 19.22308 36.19446 -28.38433 18.37232 36.72656 -29.70166 18.22116 35.43957 -28.1224 15.2139 34.73582 -27.82217 18.56112 34.50404 -30.11127 13.16574 33.47599 -31.89842 14.41178 33.74624 -31.21355 15.26473 33.9672 -31.85949 12.99491 33.41141 33.36443 14.02364 34.70407 32.56445 16.39551 38.08819 26.35234 4.412424 34.14332 18.28116 -1.412704 35.08177 29.6502 1.730097 25.89775 31.47333 18.03666 36.474 33.72953 1.189271 34.36297 26.63175 -0.2547274 26.50191 34.75109 3.604064 36.39455 33.28326 3.454901 38.81494 33.35599 0.6522141 38.07961 30.2457 -3.073695 34.40577 29.61917 -1.90811 32.73744 21.5675 2.321332 35.09072 27.74663 9.279304 38.10575 35.23228 1.912096 24.83005 33.07468 1.708981 23.96023 35.07181 0.393055 23.43293 25.57296 -1.70709 37.01473 25.91592 2.034442 37.54228 30.15924 6.18659 30.03674 27.46591 -1.343163 36.32061 32.60515 16.65036 35.00156 26.05615 -2.588775 35.06912 30.17578 16.40404 36.76339 29.39747 14.41272 38.2523 30.79466 17.68185 37.09202 18.75034 -0.9496251 33.49641 28.55566 8.877196 34.46509 31.90102 4.652575 29.45195 28.19578 -0.8007748 25.18333 27.51478 8.008368 38.55707 27.10676 -0.007312834 38.93918 34.55385 -1.078642 24.96348 33.93255 7.915893 36.70012 32.5923 -0.8841006 25.40187 28.60752 -1.332779 38.58374 22.58144 -2.362953 32.27089 25.07434 -1.10002 27.92854 30.4269 11.79599 39.39567 31.73162 8.830435 38.33687 26.71396 3.658424 31.09342 18.84619 0.3577882 34.02941 33.41632 -0.08448296 23.34737 27.53063 4.813117 30.46974 35.19883 4.984853 32.87702 32.95475 -1.688175 29.06295 30.55916 -1.046172 29.07458 33.25677 16.68454 36.42187 29.47983 11.50372 34.03336 34.44041 7.392925 32.53877 32.03535 -3.126826 32.61005 27.43716 -1.396733 28.15249 28.64234 11.10489 38.03079 33.38722 -0.6104663 36.75272 34.23834 1.694553 30.37145 26.85656 -1.214693 37.26062 24.91686 -1.666688 35.64549 26.44131 -1.389869 30.78787 29.02703 9.205839 32.52804 31.38643 9.287338 31.85902 34.70953 5.077344 37.48295 29.68513 1.568689 39.42833 30.06068 -1.467998 36.80618 28.70878 -2.750288 35.29298 23.38038 -2.002719 34.45686 24.19475 -0.8156594 30.33936 23.66263 0.02605819 30.03402 31.461 16.71395 38.13358 30.14706 12.71439 39.37636 33.30402 8.877461 37.35213 26.17946 4.556097 33.13649 22.98838 -1.348031 30.54661 20.25089 -2.005099 32.86804 19.85269 -2.592133 34.59616 25.10354 3.849289 36.60076 26.63348 4.585503 33.15642 30.40561 -0.3503506 24.82341 26.77725 0.5439584 25.79353 25.9351 1.194847 27.74788 31.83458 -2.918292 33.65014 34.22649 -1.636449 33.38416 33.17251 -1.628695 32.8631 33.94234 1.638469 36.56718 35.99549 0.560745 24.93018 34.02901 3.646498 29.80105 34.49169 8.480504 33.74224 30.64292 6.342013 39.42089 25.88368 5.956983 37.11422 29.20497 6.012316 39.51868 20.41229 -2.727536 35.20645 24.17661 0.05917125 26.71448 23.37763 0.6964837 27.9061 25.14039 0.9895978 25.50614 24.66377 1.357975 26.61223 27.70629 3.228389 25.59802 26.62613 4.799542 27.92797 26.24219 2.623917 25.54491 25.81303 2.955621 26.54088 25.13534 4.365907 30.2858 23.22501 2.091805 29.62255 25.08496 4.94632 31.57738 24.64773 2.823544 28.19127 28.07547 7.213352 29.40379 26.50983 6.395291 29.66169 27.40111 9.011661 30.88765 25.70505 6.242208 31.25005 25.358 9.580437 36.22573 25.7849 9.368254 34.30464 24.77061 7.103639 33.6141 24.37497 7.827333 35.70253 27.51741 10.20616 34.418 27.95007 11.43581 34.21588 27.55799 11.24909 36.08733 27.73809 10.36002 33.51114 23.36191 4.712784 32.68475 20.69714 3.548211 33.21237 19.1282 1.726547 32.32446 19.18158 2.454674 32.62131 21.86396 2.269923 30.39619 31.49036 14.66748 32.75107 30.14442 12.45103 32.33411 29.94942 11.46144 31.68583 30.96551 11.49653 31.39771 30.71424 19.22307 35.07955 31.40882 18.37232 34.17593 29.91795 18.22116 35.25714 29.49086 15.2139 33.58177 29.31307 18.56112 33.24672 27.91343 13.16573 35.32946 27.87815 14.41177 37.13658 28.21154 15.26472 36.49883 27.5547 12.9949 37.04169 45.35741 25.19635 -40.32151 50.96729 27.97363 -38.85567 45.33697 12.96831 -27.89171 47.67015 6.02981 -13.59799 31.41427 10.36591 -33.86866 48.19518 30.91555 -36.98805 45.54265 6.819795 -40.84796 32.70265 7.990019 -28.51902 48.77678 9.60467 -42.6226 52.94492 9.127609 -39.97884 51.86975 5.26847 -40.09708 46.04412 1.40398 -34.66982 43.18672 3.583958 -33.61711 47.29783 10.7158 -19.42196 51.66461 18.74501 -30.30101 29.32715 9.751791 -43.72682 27.97617 10.09478 -39.94544 27.0679 7.930592 -43.46247 50.59546 3.698006 -26.39182 51.24243 8.866234 -27.01971 38.10829 15.6919 -34.71068 49.30861 3.999162 -29.74563 45.73748 29.04232 -39.00274 47.33982 2.78689 -27.28022 48.84644 28.77109 -34.68011 51.51971 25.73196 -33.25483 49.29357 30.40115 -35.77471 44.9419 6.964452 -14.46627 45.50151 18.84624 -31.80796 37.12868 13.27989 -37.77722 30.43263 7.197944 -31.29942 52.51523 16.8672 -29.86966 53.66703 5.380644 -29.0642 29.7672 5.573807 -42.49978 49.0711 15.87415 -41.21563 30.59165 6.145266 -39.03662 53.07384 3.26284 -31.70288 42.77077 4.453474 -21.22884 35.23929 6.763112 -25.73418 53.559 21.51375 -35.01546 51.8872 17.24853 -37.30956 40.21469 12.51917 -28.59332 45.75793 8.694808 -14.63518 27.03338 7.598845 -40.5442 39.05146 14.15279 -30.05759 42.73107 12.3036 -43.50765 36.80514 4.076512 -39.58069 36.903 5.474431 -35.36751 48.102 28.63285 -40.11716 44.56781 22.52202 -33.47131 42.05079 15.98285 -42.20331 42.92739 1.382609 -37.86367 35.51988 5.811985 -29.88741 51.38338 21.1971 -31.89802 49.70417 3.759748 -40.17117 38.74664 8.361838 -41.84328 50.91802 4.088747 -28.65148 48.3129 4.203414 -25.26902 40.01852 5.414021 -28.07134 42.18745 19.66901 -32.68708 40.93729 19.4662 -36.85906 50.52735 11.47209 -42.53801 54.27126 7.007236 -33.60898 50.00923 3.187286 -34.30286 47.59788 1.971216 -31.94519 46.40123 4.304829 -22.58779 39.33617 6.791034 -24.13086 38.79548 8.173857 -23.20907 51.07858 28.64085 -36.91427 53.48433 22.88978 -34.53199 50.14451 17.22721 -40.10259 43.63647 13.44101 -27.61242 39.77748 6.223025 -21.99612 43.87147 5.296324 -17.11363 46.84484 4.136972 -16.3658 49.58207 11.84582 -25.6288 43.64614 13.38735 -28.41184 29.68939 7.482275 -35.20426 31.45082 9.26808 -28.79976 34.75279 9.918711 -27.27671 44.68093 1.481732 -37.48753 44.03695 2.89862 -41.71891 43.20814 3.241561 -39.875 49.22719 6.91207 -41.17508 29.54092 7.639962 -45.05551 37.67517 11.33108 -41.50703 44.01453 17.25268 -42.27575 53.9221 13.65315 -35.34238 50.28305 14.58945 -27.01113 54.17758 13.44717 -32.80432 47.85626 3.689916 -17.33563 33.16267 8.883629 -24.19302 35.17534 9.682056 -22.76391 31.01854 10.30134 -25.92802 32.88733 10.66958 -25.06604 30.91227 12.97134 -30.46666 34.80429 14.90119 -28.52449 30.9309 12.41187 -27.88348 32.61363 12.74344 -27.10731 38.88516 14.03574 -25.83901 37.99664 11.31528 -22.46811 41.03348 14.57928 -25.72539 35.46565 12.40768 -25.01472 37.07905 17.72692 -31.06565 37.64081 16.8102 -28.29421 39.50865 20.09574 -29.86037 40.37172 16.38626 -26.83782 48.58842 20.08959 -26.14147 45.33631 20.143 -26.93665 44.35728 17.26249 -25.1446 47.8594 17.8968 -24.40549 45.3921 20.96901 -29.9934 44.95498 22.68988 -30.77213 48.1458 22.0696 -30.03557 43.84057 21.3542 -30.40499 43.00194 14.33544 -22.66233 44.09399 13.08097 -17.94534 42.78193 10.99177 -15.18542 43.23639 11.95544 -15.27948 39.35886 11.66531 -20.05447 42.11201 26.94525 -37.07328 41.60828 24.13723 -34.69112 40.58316 22.90856 -34.35339 40.04477 22.82122 -36.15008 45.80551 33.08882 -35.69559 44.29725 31.93924 -36.93198 46.20519 31.77279 -34.27925 43.57944 27.93783 -33.53742 42.81917 32.84482 -33.26472 46.73224 24.9181 -30.69808 49.70999 26.29303 -30.60536 48.56494 27.5948 -31.21585 49.6516 24.35058 -30.02418 55.95975 21.80365 8.161037 57.40024 25.05487 11.80001 49.62767 10.03623 13.51842 43.00576 2.983526 20.76101 47.14637 5.865346 3.409586 55.03792 26.80754 10.8893 57.22009 6.338119 8.676398 44.83422 3.491722 6.345765 59.45063 9.511864 9.68987 59.77892 9.599989 13.09932 59.5732 6.141402 12.57923 54.25876 1.146996 11.60402 52.35028 2.330688 10.34632 45.86038 7.541045 18.07176 53.38466 16.40297 15.91391 51.77083 6.066635 -1.671224 49.07507 5.671641 -0.9335071 50.74923 4.065346 -2.772241 51.48203 3.015491 17.38108 51.85708 7.58581 17.31912 50.20939 11.74234 6.650774 52.78488 3.406307 15.31159 55.20209 24.9829 8.770076 50.63316 1.726234 15.23051 54.1352 24.85374 12.24744 54.62828 22.6266 14.41875 54.85581 26.44305 12.00688 42.28116 3.355084 18.85206 51.59214 15.4887 11.85073 51.61454 9.86157 4.959974 45.45204 2.705042 3.990039 53.59793 14.92562 16.62677 54.19601 5.32682 17.98266 51.47774 2.47338 -0.7938091 58.49019 14.71695 10.20401 49.87485 2.721208 1.030252 55.51355 3.720068 16.66937 45.23949 1.583238 15.02236 44.42515 2.618971 8.921152 56.68056 19.64186 15.00398 57.45068 15.9728 13.2953 47.85723 8.762344 10.37907 42.63914 4.994449 19.1842 49.12714 3.446979 -1.616961 48.09718 10.09066 9.08722 57.23657 10.74899 5.852677 52.92494 2.211602 4.370545 50.55528 2.93616 6.057898 56.8493 25.21175 9.666687 51.9419 18.61241 10.53929 56.04321 13.58727 5.866496 54.70856 0.8989359 8.582199 46.90111 2.337837 7.454998 54.03468 18.60694 15.03649 58.76466 4.460871 11.38528 54.80363 6.465615 4.413274 52.8576 3.663851 16.64803 49.86045 2.882496 16.53056 47.82682 2.649582 10.71729 50.62939 15.65546 9.612442 52.42738 15.71929 7.254408 60.05915 11.41609 10.64295 56.90304 7.334263 16.45491 55.65782 3.368693 13.9154 53.37765 1.613542 13.54311 47.54949 2.301173 16.52317 45.27744 3.239133 11.85874 44.46743 4.202804 11.87603 56.33541 25.42084 12.6139 56.31325 20.73801 15.10829 58.26295 15.94037 11.20444 48.72491 10.08176 12.6594 44.3054 2.599954 12.97669 43.37844 2.039412 17.25225 44.28536 1.537809 19.25836 50.23182 9.635635 16.84105 49.17634 10.1288 12.34793 47.29387 3.247369 2.006534 44.39522 4.367936 5.488056 44.92338 5.37347 7.926457 55.24165 1.273352 9.712965 57.25265 2.830557 7.616684 55.85718 2.75441 7.875052 58.96748 7.153329 10.61078 52.70317 4.469708 -2.00957 54.01648 8.738151 3.845588 56.85881 15.04379 6.896811 57.3972 13.09193 15.34318 51.16681 12.24873 16.59061 56.10412 12.67826 16.5054 45.27742 1.461378 19.45447 42.58048 3.845262 8.2984 42.60442 4.741652 9.970749 42.56356 4.835111 6.355401 42.86247 5.404203 7.735442 44.91399 7.590383 4.396045 45.39854 9.743669 7.289453 43.51197 6.82728 5.455268 43.78112 7.339715 6.69791 45.68521 9.481615 10.67969 43.56298 6.627038 11.61688 46.51107 10.33711 11.91233 43.84843 7.359952 9.144188 47.64475 12.85666 7.457503 46.38669 11.8729 8.908686 47.89491 15.18737 9.221519 46.76057 11.86759 11.03633 49.69504 16.48543 15.80027 48.74917 16.003 13.65624 47.47442 13.17472 13.9186 48.52474 14.29335 16.15735 50.43347 17.05963 12.44098 50.59721 18.52204 11.82701 51.57697 18.51948 13.93244 49.98273 17.1377 11.39309 45.6576 10.15729 14.24652 43.55952 8.767671 16.78237 41.56618 6.436419 17.21693 41.76555 7.349417 17.40191 42.78376 6.908533 13.33183 52.68543 22.29966 7.575446 51.28141 19.55616 8.337375 50.71616 18.28273 7.938218 51.49048 18.31022 6.922716 53.19568 28.04722 9.989924 53.29643 26.92747 8.689379 52.64169 26.8482 10.82339 51.29569 23.01798 9.775122 50.5828 26.99764 9.29125 51.20552 20.73803 12.77866 52.3562 22.45746 14.44038 52.14499 23.41142 13.51033 52.10193 20.73569 14.70498 2.448153 15.93274 48.69525 -0.9257616 19.18396 50.67864 -3.819969 4.165345 43.26312 -11.99543 -2.88733 37.83476 5.786539 -0.005551159 39.25557 -0.3894737 20.93664 48.20431 2.132866 0.4672117 50.01986 2.529481 -2.379165 37.42285 1.474773 3.640954 52.37981 -1.843532 3.729085 53.22892 -1.3613 0.2704966 52.94559 -1.215642 -4.723901 47.54438 -0.2666477 -3.540203 45.46507 -8.89887 1.670179 40.2415 -5.608679 10.53208 47.34405 11.51854 0.1957203 43.04298 10.37472 -0.1992661 40.49288 12.4492 -1.805568 41.86409 -7.351226 -2.855388 45.68986 -7.232272 1.714931 46.05092 3.055392 5.871441 42.78095 -5.105877 -2.464579 46.65869 1.729771 19.112 48.04037 -5.356925 -4.144647 44.52012 -1.870366 18.98284 47.52136 -3.939916 16.75571 48.34275 -1.521766 20.57216 48.19638 -10.22073 -2.515774 36.82499 -1.869789 9.617815 44.94754 4.942302 3.990665 43.90912 4.952226 -3.165847 37.67076 -6.280224 9.05473 47.66448 -7.527945 -0.5440662 48.4641 10.60646 -3.397531 42.88841 0.8189524 8.84604 51.50996 8.557446 -3.149699 41.58535 -6.02752 -2.15082 49.56381 -5.981372 -4.287633 39.15867 -0.07818031 -3.25191 37.41502 -4.202329 13.77097 50.46063 -2.395493 10.1019 50.95859 -0.9905025 2.891462 41.03062 -10.49383 -0.8764091 37.22983 11.05804 -2.423927 40.43913 0.3228911 4.219774 41.06888 4.925496 4.878078 49.60157 5.72637 -3.659305 45.11319 3.694418 -2.934736 43.03145 1.097354 19.34085 49.80593 -0.5201406 12.74151 45.0913 4.728183 7.716367 48.42457 1.839399 -4.971969 47.52375 1.751569 -3.533052 39.63584 -4.641667 12.73605 47.85128 -0.3060303 -1.410032 51.96294 5.973299 0.5947045 46.97608 -6.415202 -2.207035 46.93622 -6.760404 -2.988384 43.95671 -1.329383 -3.221304 41.0526 0.193657 9.784571 43.65177 2.800315 9.848392 45.06543 0.6267113 5.54518 53.12777 -5.601754 1.463369 50.90374 -3.284164 -2.502199 49.28251 -3.267242 -4.257346 46.97221 -7.108774 -3.569702 41.67213 -2.849591 -2.631746 38.70927 -2.991343 -1.668072 37.91157 -1.893832 19.54994 49.75177 -4.361931 14.86712 50.11376 -0.2045333 10.06946 51.43939 -3.110123 4.210873 42.23891 -4.103831 -3.270918 37.92087 -8.471119 -3.83145 37.66299 -10.31374 -4.333055 38.86785 -7.010031 3.764757 44.37144 -2.732882 4.257918 42.63702 7.195564 -2.623529 39.18537 3.309412 -1.502951 36.85709 0.9813504 -0.4974151 37.75424 0.8041485 -4.597548 48.22452 3.184962 -3.04035 49.88893 2.714904 -3.116497 48.54986 0.4904773 1.282421 52.04415 11.99634 -1.401209 43.91213 6.413081 2.867241 46.11094 3.835668 9.172883 49.38902 -4.427214 7.221032 51.22093 -6.618659 6.377848 45.25676 -5.774593 6.807373 50.12213 -10.35484 -4.409485 39.87828 0.2532473 -2.025614 35.4965 -1.395488 -1.129226 35.77753 2.170495 -1.03577 35.18073 0.8529013 -0.4666766 35.68848 4.468256 1.719491 37.20162 1.683904 3.872781 38.1257 3.205876 0.9563969 35.97931 2.019466 1.468831 36.43651 -1.621822 3.610735 38.93074 -2.874481 0.7561641 36.97801 -2.712669 4.466228 39.93646 -0.3873113 1.489072 36.87951 1.863564 6.985769 40.37103 0.2360457 6.002013 39.3513 0.1590706 9.316484 40.8897 -1.808704 5.99671 40.04818 -6.06425 10.61456 43.6809 -4.091336 10.13212 42.41632 -4.546769 7.303842 41.19712 -6.597195 8.422472 42.57949 -2.63133 11.18875 43.89352 -1.999473 12.65115 43.96081 -3.929023 12.64859 45.25294 -1.665299 11.26682 43.28688 -5.150403 4.286415 39.45241 -7.978947 2.896804 37.76961 -8.715124 0.5655604 35.86688 -8.867215 1.478556 36.09235 -4.68892 1.037662 36.47202 2.522829 16.42876 45.36983 1.55389 13.68526 44.09979 1.861294 12.41183 43.47984 2.983873 12.43932 44.08865 0.215664 22.17633 46.24561 1.516214 21.05657 46.145 -0.693135 20.97731 45.82649 0.1354767 17.14709 44.3352 0.5038757 21.12675 43.55632 -2.846162 14.86714 44.70834 -4.310982 16.58657 46.10106 -3.424517 17.54053 45.74924 -4.611565 14.8648 45.89055 -42.74474 12.09607 9.647969 -44.95919 13.81401 6.581296 -40.53467 5.202279 1.808526 -38.00675 1.306263 -8.095774 -35.07115 3.339368 10.89993 -42.09084 15.33569 6.473437 -46.5679 1.912366 9.873235 -34.3256 2.017868 7.034456 -48.5749 3.582537 9.756498 -50.13913 3.435852 6.494541 -50.29295 1.259553 6.973517 -45.64186 -1.129531 5.78194 -43.16743 -0.02626687 6.218241 -39.01882 3.94454 -4.278295 -44.01018 8.642622 0.9117873 -37.56992 3.014752 17.90357 -35.33195 3.125952 16.04166 -36.50049 1.925527 18.59928 -44.84035 0.224456 -1.16799 -44.45769 3.119049 -1.010753 -38.27472 6.528293 8.87544 -45.25518 0.377449 1.436663 -41.74805 14.23094 8.679613 -43.43469 -0.3835044 0.6368021 -42.03961 14.14777 4.767093 -43.6655 12.53982 2.839943 -42.38876 15.07686 5.287901 -36.54854 1.739955 -6.502181 -40.9353 8.503193 4.221797 -39.28441 5.184005 11.17637 -34.16519 1.526009 9.652774 -44.7102 7.625913 0.3107868 -47.29155 1.285542 -0.6594654 -38.17986 0.7010725 16.95463 -47.03126 7.058195 8.770116 -37.28725 1.015541 14.45999 -48.31459 0.1137982 1.224658 -38.23058 0.3329297 -1.418484 -35.02739 1.398669 4.307341 -46.31061 10.28432 3.158772 -46.98825 7.881687 5.235149 -37.88002 4.785698 4.211794 -36.75606 2.729034 -6.705202 -35.47752 1.714621 16.77499 -37.42131 5.665444 5.582274 -44.84355 4.882712 12.63506 -41.5182 0.08323204 12.41791 -39.76797 0.8249645 9.731123 -43.61726 14.09372 8.474379 -40.29222 10.52538 5.633546 -43.26364 6.889286 12.08171 -44.98937 -1.218886 8.986372 -36.89151 0.9170976 6.812255 -43.95918 10.00748 2.029457 -49.3421 0.349837 7.846968 -42.65958 2.546288 13.10644 -45.77988 0.4720526 0.1315118 -42.99763 0.4175974 -0.9992404 -38.9364 0.832785 3.944805 -39.15973 8.855063 6.046458 -39.9916 8.736922 9.15107 -49.21033 4.677092 9.036128 -48.99401 2.248409 1.972839 -47.486 -0.009079635 4.035209 -45.44666 -0.7861857 3.472719 -40.87989 0.3854652 -1.954323 -36.83332 1.538879 1.728557 -35.91506 2.279577 1.358131 -44.18701 14.17083 5.317938 -45.82649 11.0409 2.885693 -46.99326 7.835393 7.660849 -39.34702 5.404423 2.285144 -36.42036 1.219928 0.214685 -37.20933 0.8015773 -4.428884 -38.89804 0.2525908 -6.041011 -42.40681 4.703493 -1.244426 -39.65508 5.382022 2.784537 -35.10267 1.692942 12.39596 -33.45074 2.686936 7.693225 -34.70153 3.146373 5.470706 -45.85895 -1.107785 8.077961 -46.75674 -0.3063123 10.99083 -45.53227 -0.1603846 10.14839 -48.82562 2.091301 8.667653 -38.58531 1.862133 18.65398 -41.34063 4.154242 13.31098 -44.19573 7.660925 11.37737 -48.14924 5.938745 3.210408 -42.79619 6.261485 -0.6376377 -47.41077 5.810783 1.514558 -39.92992 0.04739725 -5.818913 -32.84272 2.491107 4.136935 -33.34511 2.989668 2.467797 -31.9504 3.220216 6.053215 -32.65829 3.48024 4.795354 -33.0349 4.737795 8.95587 -34.23258 5.923197 6.245915 -32.20911 4.405305 7.321688 -32.84653 4.639441 6.189058 -35.80495 5.557724 2.990382 -34.57475 3.988728 1.203803 -36.91625 5.931063 2.096825 -33.815 4.531398 3.778548 -35.9505 7.59027 6.97931 -35.44221 7.076345 5.017855 -36.47763 8.976128 5.29433 -36.58918 6.920878 3.054039 -40.43259 9.247667 -0.5252666 -38.81005 9.174095 1.221341 -38.13451 7.527132 0.4629356 -39.79199 7.991201 -1.34286 -39.80134 9.66114 3.125604 -39.50027 10.60786 3.786536 -41.21702 10.3654 2.099228 -38.97008 9.825872 3.979848 -36.99549 5.835532 -0.5858547 -36.15129 5.13507 -3.975737 -34.77554 3.907293 -5.214261 -34.89111 4.458131 -5.327328 -34.42275 4.207819 -0.836686 -39.32365 12.92771 8.850139 -38.69668 11.33188 7.538324 -38.20897 10.61255 7.716147 -38.56723 10.56167 9.053174 -39.80376 16.44897 6.579617 -39.59339 15.771 7.933518 -39.77232 15.71996 5.532459 -38.69997 13.49695 6.064189 -37.21491 16.191 6.193205 -40.08602 11.90356 3.063265 -41.53092 12.76642 1.866661 -40.83449 13.45516 2.692132 -41.65671 11.68173 1.519499 -4.062536 18.56809 -48.6076 -1.436233 21.81933 -51.50926 3.54331 6.800682 -45.29882 12.96806 -0.252013 -42.56406 -4.424921 2.629763 -38.60162 -1.207956 23.572 -48.98778 -4.157855 3.102573 -49.96595 -0.768825 0.2561451 -37.82692 -4.235685 6.276326 -52.41468 -1.323217 6.36446 -54.21736 -1.698637 2.905873 -53.80279 -0.2222492 -2.088546 -48.60526 -0.5059272 -0.9048618 -46.33729 9.293441 4.305505 -43.9345 4.029637 13.16743 -49.7279 -11.02729 2.831046 -40.50135 -9.173148 2.43605 -38.41006 -11.56278 0.8297526 -39.09809 6.187142 -0.2200403 -48.67063 5.965657 4.35028 -48.97957 -2.873144 8.506772 -42.78243 3.754813 0.1707732 -48.92358 -3.181169 21.74735 -48.19754 4.633971 -1.509305 -46.95799 0.4094021 21.6182 -48.77902 2.138572 19.39106 -50.18176 -0.1251224 23.20751 -49.31886 11.5766 0.1195383 -41.06974 1.178625 12.25316 -46.32286 -5.011101 6.626001 -43.29464 -3.154818 -0.5305382 -37.33889 4.574606 11.69008 -50.23451 5.526062 2.091295 -51.37073 -10.11074 -0.7622063 -40.62666 -3.349729 11.48141 -51.78076 -7.765789 -0.5143772 -39.99605 3.765415 0.4845426 -51.97138 6.83333 -1.652313 -42.0287 1.721823 -0.6165998 -38.59934 1.755557 16.40634 -52.2812 -0.117513 12.73726 -52.21601 1.511048 5.526786 -42.32227 11.71612 1.758906 -41.53772 -9.809118 0.211387 -38.15443 0.2463225 6.855101 -41.96598 -6.69755 7.513438 -48.73156 -6.1194 -1.023964 -44.20914 -3.557852 -0.2994071 -42.83039 -3.105743 21.97621 -50.07143 -0.1522417 15.37686 -46.05637 -6.157251 10.35172 -47.66744 -3.131285 -2.336616 -47.67187 -0.6883663 -0.8977321 -40.17127 2.955182 15.3714 -49.92269 -2.411718 1.225337 -52.54951 -6.91217 3.230051 -45.91289 4.921201 0.4283211 -49.58001 6.141715 -0.3530427 -46.84011 1.827835 -0.5859777 -42.44463 -0.4028387 12.41991 -44.46926 -3.31298 12.48373 -45.03862 -3.650137 8.180555 -53.38203 2.958393 4.098739 -53.12263 1.231755 0.1331607 -50.88247 1.906569 -1.621996 -48.67287 7.157405 -0.93437 -44.7643 3.979299 0.003572463 -40.66323 4.353138 0.9672419 -39.94442 -0.2352661 22.1853 -50.91434 2.011593 17.50249 -51.99794 -2.35198 12.70483 -52.01953 3.172272 6.846206 -44.10919 5.411924 -0.6356049 -40.28603 9.65644 -1.196134 -41.34611 11.05438 -1.697732 -43.04691 6.25588 6.400099 -47.3105 2.693231 6.893251 -44.37625 -5.748464 0.01178377 -38.11323 -1.343845 1.132354 -37.05379 0.609339 2.137895 -38.60614 -2.353008 -1.962194 -48.65019 -5.122635 -0.4049912 -49.52637 -4.273604 -0.4811417 -48.38916 -3.196052 3.917791 -52.38878 -11.74317 1.234121 -41.18783 -7.073077 5.502584 -44.95581 -5.594036 11.80824 -48.85467 1.742752 9.856402 -53.07399 5.617649 9.013193 -48.03822 3.35709 9.442736 -52.42845 10.7914 -1.77416 -44.02338 1.979354 0.6096869 -36.6695 3.468576 1.506081 -37.43077 0.2443013 1.599527 -35.79478 1.349729 2.168625 -36.67335 -2.552691 4.354799 -37.03594 -0.1721537 6.508093 -38.75047 -0.9825247 3.591697 -36.24714 0.01284605 4.104136 -37.03824 2.741496 6.246052 -40.50733 4.520832 3.391474 -39.01863 3.481622 7.101552 -41.79325 2.176967 4.12438 -38.18078 -1.015113 9.621091 -40.83927 0.8428856 8.637329 -40.35297 0.4562364 11.95181 -41.84397 2.585622 8.632033 -41.6295 5.559926 13.24989 -46.36866 4.05552 12.76745 -44.57191 4.854739 9.939167 -43.54475 6.397879 11.05781 -45.47706 2.220547 13.82408 -45.54483 1.597484 15.28649 -45.42007 3.052268 15.28394 -47.23014 1.480162 13.90215 -44.67704 5.952546 6.921736 -42.06044 9.154915 5.532123 -41.30062 10.42646 3.200869 -39.70517 10.50416 4.113866 -39.9658 6.403556 3.672973 -39.07846 -3.139231 19.0641 -45.41205 -1.8348 16.3206 -44.48994 -1.942721 15.04717 -43.80644 -3.195996 15.07465 -44.05165 -1.19959 24.81167 -46.93774 -2.410524 23.69191 -46.45278 -0.2070412 23.61265 -46.80962 -0.551715 19.78243 -45.13877 -0.6703047 23.76208 -44.28536 2.18185 17.50248 -46.3866 3.163089 19.22192 -48.15366 2.422424 20.17588 -47.55281 3.512875 17.50015 -48.04269 -40.58334 27.87981 -30.59645 -40.27744 32.27224 -35.87503 -29.77581 11.98201 -33.55733 -17.5403 2.453817 -38.66316 -32.48837 6.347077 -19.75897 -37.90119 34.6401 -33.41475 -41.83431 6.985838 -31.94527 -27.98435 3.140315 -22.04084 -43.99062 11.27358 -34.45643 -42.45257 11.39266 -38.82083 -42.49648 6.720094 -38.06651 -36.53971 -0.02737748 -33.8472 -34.91701 1.571788 -31.22004 -22.56849 8.61103 -36.99257 -33.01597 20.58351 -38.63055 -41.04616 6.618999 -16.16526 -37.32323 6.085361 -15.53504 -40.42098 3.915242 -14.23481 -29.84972 2.496994 -39.34556 -30.34453 8.671512 -39.48306 -34.39693 14.28694 -25.47349 -32.62383 3.02498 -37.55128 -39.3084 32.175 -30.91152 -30.03348 0.755191 -36.22741 -36.02219 32.00051 -34.56514 -35.39067 28.99166 -37.50624 -37.04205 34.14769 -34.68047 -17.73883 2.955782 -35.91176 -33.13195 19.34832 -32.63187 -37.08086 11.746 -24.20144 -30.08199 2.077499 -19.50599 -32.87161 18.58761 -39.6254 -32.83278 5.619616 -41.62719 -40.1877 1.764504 -17.07357 -42.52122 18.30567 -34.5398 -37.18563 2.099325 -18.39638 -35.19454 3.448878 -40.76783 -23.5431 0.5619951 -32.90285 -26.01747 1.961241 -24.96364 -37.57224 24.95928 -39.39128 -39.48827 20.00234 -37.73595 -29.3931 10.26097 -28.70317 -17.98844 5.170574 -36.52246 -37.77598 3.07983 -14.72725 -30.42229 12.05553 -27.25682 -43.46148 12.94492 -28.49473 -39.02193 1.41087 -24.22501 -35.15814 2.389755 -24.94394 -40.81643 32.48419 -32.94754 -34.30684 23.56845 -31.224 -41.9914 16.77946 -27.83252 -38.81055 -0.3625253 -30.40057 -29.88563 1.581424 -24.57623 -34.31177 23.56109 -37.92536 -42.18524 4.449686 -36.14347 -41.29956 7.15806 -25.3465 -31.95237 3.372928 -39.23019 -28.34684 2.317311 -37.38059 -29.16334 2.002609 -29.10031 -33.22609 19.5736 -29.34141 -36.77111 19.65982 -27.47536 -44.19385 13.8462 -35.97053 -37.01913 8.331668 -41.29578 -36.93858 2.974159 -37.47551 -34.35657 0.6029396 -35.72173 -25.51943 1.531938 -36.05638 -25.39002 2.799098 -29.04808 -24.38768 4.101021 -28.60828 -38.50954 32.76668 -36.26628 -37.06283 26.44018 -39.31006 -41.67343 19.95852 -35.63629 -29.15853 12.04351 -31.99102 -23.56276 1.93557 -29.86472 -19.99376 1.178297 -34.576 -19.96333 0.50064 -37.55019 -28.62518 11.44083 -37.97235 -29.88892 12.10707 -31.86629 -33.46757 2.810175 -18.12378 -27.93457 4.324079 -20.74006 -27.19404 5.682571 -24.02837 -38.82024 0.1433206 -32.08948 -42.47729 2.247103 -30.66536 -40.62039 2.144226 -30.18778 -42.87453 8.087203 -35.30987 -42.38109 4.461545 -16.28128 -40.65815 10.22826 -24.20293 -42.4044 18.74722 -29.55911 -38.2573 16.11029 -40.21479 -29.91335 14.97112 -38.19756 -36.01148 15.55143 -40.90295 -21.06729 0.3973845 -38.35507 -24.11163 3.61796 -23.15079 -23.18923 4.828991 -25.21352 -25.19663 4.955235 -20.76041 -24.77752 5.724092 -22.62147 -29.19167 8.677611 -19.69723 -28.13877 11.58672 -23.51824 -26.87098 7.646661 -20.19721 -26.4936 8.33897 -21.87298 -26.56066 11.23271 -27.83543 -23.42694 7.376166 -27.77602 -26.87108 12.38849 -29.81575 -25.1839 8.366324 -24.9087 -30.7954 15.79238 -25.00245 -28.42805 14.46333 -26.06462 -30.09803 18.9412 -27.30623 -27.67533 14.45617 -28.88438 -28.55978 20.69492 -36.39157 -28.62098 20.04314 -33.22621 -26.90971 16.22212 -32.82224 -26.9226 17.73341 -36.16309 -31.37633 21.47065 -32.69569 -31.92637 23.44637 -32.03657 -31.92868 23.44292 -35.17392 -31.4204 21.57612 -31.15521 -24.49696 12.14556 -32.19011 -20.48306 10.2682 -34.10327 -17.79331 7.118669 -33.50135 -17.93233 8.352133 -33.84146 -21.4962 7.756477 -29.43389 -36.9046 28.54993 -28.01554 -34.75064 24.84345 -28.15011 -34.28521 23.12304 -27.33936 -35.8119 23.16017 -26.53573 -36.15574 36.31491 -31.26432 -37.01932 34.80212 -29.72813 -35.00262 34.69503 -31.97031 -33.94994 29.52039 -29.91989 -33.3518 34.89692 -28.92127 -32.13014 26.44018 -33.5488 -32.59439 28.76314 -36.23972 -32.86489 30.05195 -34.97994 -32.13225 26.43703 -36.41924 + + + + + + + + + + 0.3749871 -0.9090111 -0.1818889 0.8785726 0.2492291 0.4074249 0.1824386 -0.9821986 0.04474598 -0.3980755 -0.9107682 0.1097142 0.1724734 -0.9698348 -0.1722598 -0.04397672 0.1435956 0.9886589 0.4997217 -0.8640668 -0.06055521 0.7112006 -0.281904 -0.6439906 0.2407149 0.3834183 -0.891654 -0.1408464 0.06353813 0.9879905 0.1531128 -0.5965402 -0.7878428 0.883376 0.4684263 -0.01495617 0.2268593 -0.9723845 -0.05480021 -0.7205399 -0.02575951 0.6929349 0.8364881 0.4660878 0.2881834 0.7485761 0.2619957 -0.6090911 0.9908638 -0.09883618 -0.09176254 -0.2775983 -0.8041461 0.5256313 0.4555199 -0.8734112 0.1722052 -0.4778385 -0.7716305 0.4198293 -0.817426 0.1443562 0.5576522 -0.1907675 -0.6004294 -0.7765902 -0.02286732 -0.9941982 0.1051048 0.5444676 0.2959483 0.7848373 -0.0923807 0.4090582 0.9078201 0.7864974 0.5606338 -0.2590591 -0.04045814 -0.998036 -0.04782629 0.3828287 0.4775815 -0.7907959 -0.5807286 0.7716497 0.2594437 -0.8895513 0.4305486 -0.1527297 -0.6179876 0.02997124 0.7856164 0.4159142 0.7853653 0.458494 -0.02408492 0.5067477 -0.8617579 0.1258585 -0.9831764 0.1323765 0.0699321 0.1659965 -0.9836435 -0.672294 0.5388354 -0.5076193 0.9067758 0.221458 -0.3587672 -0.482308 0.1617904 -0.8609314 0.6276616 0.06404161 0.7758477 0.9484025 -0.109016 0.2977383 -0.5088327 -0.8088256 0.2947716 -0.5243272 -0.8163741 0.2421034 0.2323638 -0.8417962 -0.487223 -0.07449084 0.9168173 -0.3922974 0.1927769 0.3982917 -0.8967725 0.2693042 0.8734605 0.4056378 0.03192752 0.3092443 -0.9504466 -0.06400305 -0.2156284 0.9743756 0.2987642 0.2176213 0.9291829 0.0405299 -0.3691115 0.928501 -0.8930871 -0.1043732 -0.437609 0.02199029 -0.9917871 -0.1259956 0.1818348 -0.9601072 0.2124389 -0.6395679 -0.7437295 -0.1944717 0.002884566 -0.9941315 0.1081399 0.1945934 -0.9799786 -0.04213631 -0.2630545 0.7369284 0.6226869 0.8416323 0.3380899 0.4211299 0.8831871 0.4679677 -0.03141391 -0.4969685 -0.1466933 0.8552797 0.0626266 -0.05068445 0.9967492 -0.8686209 -0.2365728 0.4353514 -0.8491203 -0.3533944 0.3925647 -0.311576 -0.8371086 0.4496328 -0.9501738 -0.2744379 0.1478297 -0.6318185 -0.6820503 -0.3682563 -0.7641984 -0.6444497 0.02618062 -0.2109524 -0.9753589 -0.0646063 0.4830337 -0.8039318 -0.3469468 0.2722424 -0.6778085 -0.6829787 0.08309 -0.5769126 -0.8125687 0.7567807 0.6449264 0.1065503 -0.3391435 0.9346464 -0.1068545 -0.8119933 0.4071931 -0.4181635 0.6580678 0.5989239 0.45633 -0.0147776 0.5985976 -0.8009135 0.1834118 -0.3700737 0.910717 0.4728756 -0.6200986 0.6259924 0.7560723 0.6269891 0.1877213 -0.06472247 -0.645851 0.7607151 -0.1045658 0.1798565 0.9781194 0.5069953 -0.0032323 0.8619428 0.422542 0.2546079 0.8698466 -0.9711703 -0.012636 0.2380521 -0.833743 0.0740143 -0.5471694 -0.9289453 0.2720681 -0.2510767 -0.9713346 -0.2348033 -0.0371015 -0.9367001 0.226395 0.2670918 -0.7759466 -0.6307452 0.008210003 0.6610444 -0.5841577 -0.4709353 0.8379274 0.1472142 -0.5255527 0.1090841 0.4935498 0.8628495 0.8632987 0.4142786 -0.2882509 -0.9722946 0.007238686 0.2336465 0.4069079 0.2346559 0.8828151 0.4668437 0.2414729 0.8507337 0.2798852 -0.6321651 -0.7225177 0.716772 -0.690167 -0.09953677 0.0667572 0.2872202 0.9555354 -0.08015835 -0.9915956 -0.1015514 -0.7379313 -0.6734906 -0.04321944 -0.004954993 -0.6825708 -0.7308025 -0.9494436 -0.2817952 0.1383771 0.7110095 -0.02467244 -0.7027494 0.6781488 -0.707987 0.1971513 -0.936357 -0.03582543 0.3492165 -0.9853524 0.02116477 0.1692122 -0.7545489 -0.01830738 -0.6559884 -0.3754772 -0.8059917 -0.4575961 0.08596616 -0.5711394 -0.8163391 -0.462767 -0.832288 0.305194 0.2014855 -0.7973233 -0.5689281 0.9044995 -0.4179803 -0.08469372 0.07674568 0.1745426 -0.9816543 -0.2243162 0.01293635 0.9744305 -0.1924699 -0.9519139 0.2383599 0.3387639 -0.8127851 -0.4739402 0.3128349 -0.9460508 -0.08439332 -0.5558164 0.7575793 0.3422597 0.08965134 0.4195297 -0.9033036 0.6356634 0.3925217 0.6647245 0.7822297 0.2124416 -0.5856495 0.8926531 0.3621085 0.2684177 0.07167071 -0.2403609 0.968034 -0.7431243 0.2640204 0.6148655 -0.03341102 -0.9839973 0.1750233 0.3824368 -0.8895089 -0.2500322 -0.6363128 -0.7084425 0.3053116 0.3253758 -0.8081839 -0.4908865 0.8778857 -0.4696249 -0.09364306 0.534024 -0.8330098 -0.1446138 0.8201808 0.5206287 0.2371692 0.5503267 0.638184 -0.5383882 0.07324683 0.5897791 0.8042361 -0.1334718 -0.2059481 0.9694177 0.08212524 -0.3333621 0.9392152 0.3712691 -0.8772926 -0.3041659 0.374913 0.7684748 0.5185428 -0.8914033 0.08089053 -0.4459338 -0.1891521 -0.2311119 0.954363 -0.1958593 0.3356739 0.9213914 -0.9992756 -0.03775441 0.00479418 -0.2896922 -0.9325525 -0.2154632 0.9233592 -0.3457936 -0.166837 -0.235747 0.4167209 -0.8779335 -0.8285441 0.191029 -0.5263295 -0.6685025 0.3342103 -0.6643854 -0.7428987 -0.0679444 0.6659467 -0.7314408 0.2184118 0.6459804 0.6502891 -0.3436716 -0.6775056 0.3083159 -0.9464168 0.09610724 -0.8131138 0.444778 -0.3755244 0.9663794 0.2489982 -0.06411349 0.6598651 -0.7389437 0.1361626 0.4637671 0.8856969 0.02147585 0.4452792 0.8208393 -0.3577001 0.4931094 -0.4235541 -0.7598981 0.02902847 0.5041132 -0.8631496 0.738475 0.5612705 -0.3736712 -0.1367438 -0.6109005 0.7798087 0.1707097 -0.6002965 0.7813464 0.2065175 -0.3378768 0.9182537 -0.2146373 -0.4491 0.8673178 0.5698449 0.2162918 0.7927767 -0.7757666 0.1733539 0.6067409 -0.9616375 0.07842433 -0.2628746 -0.6065829 0.3183183 -0.7285125 -0.8544433 0.1483479 -0.4979152 -0.8937597 0.08320832 -0.4407606 -0.9836581 -0.1047692 -0.1464245 0.3471525 0.4875612 -0.801105 0.4391167 0.07871937 -0.8949747 0.2342888 0.9387458 0.2527151 0.6272817 -0.7528724 -0.1992511 0.5664147 0.731113 -0.3803265 0.3640204 0.6287276 -0.6871615 0.1447595 -0.2712395 -0.9515639 0.3242291 0.7550638 0.5698722 0.2052105 0.6621374 -0.7207376 0.212288 0.6617116 -0.7190769 0.6317879 -0.2769635 -0.7239719 -0.8093876 -0.01236969 -0.5871446 0.7006582 0.4960649 -0.5128331 0.2261903 0.4498839 -0.863969 -0.6914099 0.4764686 -0.5430746 0.6447927 0.6557021 0.3928068 0.196607 0.5348132 -0.8217788 0.09277176 0.4569373 -0.8846477 0.09792387 0.9816238 0.1637846 -0.8789641 0.1051495 -0.4651513 0.005615651 0.3028432 -0.9530238 0.01632905 0.3006531 -0.9535937 -0.09661209 0.9951753 -0.01709765 -0.4894647 -0.5637342 -0.6653031 0.4631341 0.7453647 -0.4795188 0.3141037 0.8116288 -0.4925418 -0.08887171 0.1051127 -0.9904813 -0.6301435 0.7683869 -0.111807 -0.7058963 0.5081481 -0.493453 0.7363782 0.5646027 -0.372788 0.7164976 0.4135227 -0.5618098 -0.1036845 0.5241761 -0.8452745 0.8783798 -0.2441822 -0.4108821 -0.3630067 0.02732992 -0.9313857 -0.7766556 0.5141184 -0.3639898 0.8078135 0.4980091 -0.3153164 -0.6867067 0.640465 -0.3438582 0.01344037 0.2303125 -0.973024 0.01830732 0.2369308 -0.971354 -0.4358346 0.6235855 -0.6489911 0.5633609 0.7989808 0.2103667 0.9684727 -0.07032066 0.2389891 -0.4422444 -0.02241849 -0.8966143 -0.1159859 -0.9090102 -0.4003093 0.549867 0.2492318 -0.7972013 0.07489889 -0.982198 -0.1722708 0.04095155 -0.9107693 0.41088 -0.1406762 -0.9698348 -0.1990749 0.9670521 0.1435933 0.2102174 0.02465963 -0.8640653 -0.5027753 -0.5147119 -0.2819049 -0.8096922 -0.8382345 0.3834175 -0.3877553 0.9500431 0.06353944 0.3055828 -0.7506991 -0.596539 -0.2838875 0.1343533 0.4684288 -0.873226 -0.01572227 -0.9723843 -0.2328549 0.5613781 -0.02575963 0.8271584 0.4252323 0.4660899 -0.7758464 -0.4740062 0.2619932 -0.8406412 0.07679343 -0.09883421 -0.9921363 0.4712377 -0.8041458 0.3623321 0.2466203 -0.873411 -0.4199186 0.333158 -0.7716299 0.5418425 0.4116812 0.1443567 0.8998221 -0.7976459 -0.600431 0.05695426 0.09973937 -0.994198 0.04027891 0.8654749 0.2959495 -0.4041867 0.8792054 0.4090522 0.244283 -0.1225947 0.560635 -0.8189377 -0.05396723 -0.9980362 0.03180277 -0.7148358 0.4775824 -0.5108079 0.1577048 0.7716472 0.6161895 -0.3006782 0.4305462 0.8510127 0.6700375 0.02996885 0.7417221 0.5221136 0.7853661 -0.332562 -0.853461 0.5067456 -0.1217095 0.1517227 -0.9831759 -0.1017127 -0.9577288 0.1659964 -0.2349482 -0.6138101 0.5388333 0.5769714 -0.200571 0.2214601 -0.95432 -0.9299858 0.1617882 0.3300774 0.870652 0.06404489 -0.4877125 0.4535413 -0.1090127 -0.8845431 0.2046647 -0.8088274 0.5512809 0.1501335 -0.816375 0.5576665 -0.4410114 -0.8417972 -0.3112657 -0.3992443 0.9168163 0.007209122 -0.8513699 0.3982901 -0.3413714 0.44527 0.873462 -0.1969738 -0.9314242 0.3092377 -0.1918877 0.9495949 -0.2156255 0.2275418 0.9662789 0.2176216 -0.1376444 0.9220218 -0.3691101 0.1167643 -0.582068 -0.1043767 0.8064133 -0.1204745 -0.9917873 -0.04294121 0.2400836 -0.9601063 -0.1433724 -0.299627 -0.7437313 0.597568 0.107078 -0.9941313 0.0154066 -0.008685886 -0.9799779 -0.1989169 0.5693559 0.7369281 0.3643774 0.5571377 0.3380938 -0.7584788 0.1181018 0.4679702 -0.8758173 0.7591348 -0.1466924 0.634189 0.9930196 -0.05067616 0.1065078 0.2824978 -0.2365761 0.929638 0.2436177 -0.3533939 0.903196 0.390596 -0.8371088 0.3829928 -0.01466172 -0.2744385 0.9614928 -0.4696126 -0.6820523 0.5605968 -0.103177 -0.6444521 0.7576517 -0.09928315 -0.9753596 0.1970188 -0.2604392 -0.8039312 -0.5346644 -0.6272315 -0.6778076 -0.383611 -0.7868857 -0.576914 -0.2190462 0.2327506 0.6449289 -0.7279381 -0.1625655 0.9346451 0.3162453 -0.549218 0.4071901 0.7297641 0.5608516 0.5989267 -0.5716049 -0.7919179 0.5985969 -0.1206147 0.9286096 -0.3700697 -0.02706742 0.6968262 -0.6200972 -0.3604341 0.3126388 0.6269916 -0.7135396 0.7388785 -0.64585 0.1921881 0.9464373 0.179859 0.2681552 0.935149 -0.003228724 -0.3542398 0.9286855 0.2546083 -0.2696626 0.07073044 -0.01263731 0.9974154 -0.6800411 0.07401126 0.7294287 -0.4042649 0.2720655 0.8732413 -0.2005127 -0.2348062 0.9511365 0.1051627 0.2263932 0.9683424 -0.1228735 -0.6307471 0.7661984 -0.3526071 -0.5841541 -0.7310487 -0.3765874 0.1472147 -0.9146091 0.8688818 0.4935498 0.03811752 -0.138406 0.4142777 -0.8995653 0.06619888 0.00723505 0.9977802 0.9388275 0.2346598 -0.2520673 0.9173221 0.2414767 -0.3165581 -0.6649113 -0.6321656 -0.3978186 0.02287119 -0.6901654 -0.7232902 0.9530941 0.2872192 0.09548121 -0.1136227 -0.9915959 0.06186568 -0.1671484 -0.6734935 0.7200473 -0.7211533 -0.6825717 -0.1184645 -0.02385747 -0.2817959 0.9591777 -0.5726605 -0.02467566 -0.8194212 0.3087865 -0.707986 -0.6351431 0.1861629 -0.0358237 0.9818655 4.7011e-4 0.02116417 0.9997758 -0.7739331 -0.0183112 0.6330028 -0.514403 -0.8059926 0.2928577 -0.7901175 -0.5711388 -0.222519 0.2227098 -0.8322885 0.507638 -0.5267552 -0.7973247 -0.2946221 0.06918799 -0.4179792 -0.9058181 -0.9546171 0.1745415 -0.2413323 0.9225915 0.01294094 0.3855611 0.2024558 -0.9519143 0.2299365 -0.4099605 -0.8127858 -0.4138981 -0.03037941 -0.9460501 -0.3225931 0.2435328 0.7575777 0.6056137 -0.8752143 0.4195264 -0.2408266 0.7624778 0.3925227 -0.5143478 -0.4452206 0.2124392 -0.8698553 0.4152341 0.3621094 -0.8345403 0.9662435 -0.2403577 0.09274435 0.4806175 0.2640269 0.8362396 0.1668751 -0.983997 0.06247037 -0.1818947 -0.889508 -0.4191538 0.1935336 -0.708442 0.6787155 -0.4289236 -0.8081846 -0.4035621 0.05587267 -0.4696217 -0.881098 -0.05240285 -0.8330088 -0.5507723 0.3721979 0.5206293 -0.7683839 -0.4377785 0.6381852 -0.6333006 0.8050571 0.589784 0.06354457 0.9329826 -0.205945 0.2951781 0.9396033 -0.3333582 0.07757562 -0.2371346 -0.877293 -0.4172818 0.5743826 0.7684763 -0.2820085 -0.5899916 0.08088839 0.8033473 0.9087448 -0.2311066 0.3475235 0.8751167 0.3356711 0.3485623 -0.1639325 -0.03775686 0.9857487 -0.2612637 -0.9325544 0.2491659 -0.008594393 -0.3457943 -0.9382709 -0.9051272 0.4167212 0.08418995 -0.6586211 0.1910256 0.7278237 -0.7676855 0.3342078 0.5467759 0.5310014 -0.06794762 0.8446423 0.5132552 0.2184063 0.8299805 -0.5580267 -0.34367 -0.7553125 0.1467694 -0.9464154 -0.2876741 -0.507377 0.4447749 0.7380677 0.0999127 0.2489998 -0.9633362 0.2455805 -0.738943 -0.6274181 0.09944134 0.8856979 -0.4534873 -0.2774137 0.8208398 -0.4992631 -0.6657657 -0.4235527 -0.6142957 -0.8458681 0.5041115 -0.1742954 -0.243667 0.5612715 -0.7909493 0.7455405 -0.6109013 0.2663999 0.798949 -0.6002971 -0.03638505 0.9399372 -0.3378742 -0.04857134 0.8186485 -0.4490987 0.3579455 0.8775836 0.2162923 -0.4278607 0.4670988 0.17335 0.8670459 -0.42141 0.07842189 0.903473 -0.8204423 0.3183158 0.4749206 -0.6349877 0.1483459 0.7581453 -0.5852883 0.08320546 0.8065448 -0.3103479 -0.1047722 0.9448317 -0.731019 0.4875618 -0.4773831 -0.8080196 0.07871931 -0.583873 0.2886303 0.9387472 -0.1882712 -0.09051626 -0.7528707 -0.6519144 -0.2792702 0.7311136 -0.6224798 -0.6158661 0.6287261 -0.4747763 -0.9134798 -0.2712376 -0.30329 0.61642 0.7550653 -0.2233895 -0.6757631 0.6621361 -0.3239138 -0.6729318 0.6617103 -0.3306089 -0.606952 -0.2769604 -0.7449175 -0.7153325 -0.01237094 0.6986747 -0.3872156 0.4960648 -0.7771639 -0.8133987 0.4498822 -0.3687664 -0.6519823 0.4764665 0.5898295 0.496 0.6557042 -0.5692417 -0.7768058 0.5348128 -0.3324881 -0.856298 0.4569367 -0.2407538 0.1779603 0.9816245 -0.06887388 -0.6068333 0.1051471 0.7878435 -0.9384059 0.3028352 -0.1663886 -0.9371591 0.3006448 -0.1770461 -0.03316116 0.9951751 0.0923413 -0.7383726 -0.5637354 0.3701463 -0.3944724 0.745365 -0.5374223 -0.4324623 0.8116289 -0.3927274 -0.9912714 0.1051125 -0.07957637 -0.2165611 0.7683855 0.6022334 -0.6055163 0.5081487 0.6124825 -0.2431577 0.5646019 -0.7887325 -0.4328186 0.4135246 -0.8010402 -0.8506487 0.5241744 -0.04047095 -0.2567279 -0.2441813 -0.9351291 -0.979293 0.02732688 0.2005956 -0.4898548 0.514119 0.7040767 -0.1744483 0.4980102 -0.8494432 -0.4548324 0.6404624 0.6188178 -0.9567959 0.2303109 -0.1774786 -0.9543283 0.2369295 -0.181994 -0.7132408 0.6235868 0.3200424 0.3024333 0.798982 -0.5197709 0.3990209 -0.07031899 -0.9142415 -0.9583953 -0.02241986 0.2845626 -0.4421933 -0.8741402 0.2008584 -0.7853356 0.2688273 -0.5576557 -0.2731272 -0.9602141 0.05822563 0.2413365 -0.9680635 0.06789553 -0.2903554 -0.9306465 0.2226896 0.2471038 0.1732292 -0.953379 -0.5241023 -0.8466767 0.09195315 -0.7922733 -0.3337045 0.5108273 -0.3578212 0.4689798 0.8074787 0.3332796 0.08345103 -0.9391276 -0.3413447 -0.6208441 0.705717 -0.8274392 0.5348234 -0.1711971 -0.3182825 -0.9392969 0.1281318 0.8298354 0.001211524 -0.5580071 -0.7149775 0.5287027 -0.457472 -0.8389444 0.2879321 0.4618086 -0.9874683 -0.1555646 -0.02657258 0.2314425 -0.9113544 -0.340393 -0.4690555 -0.8791741 -0.08390414 0.4168828 -0.8804214 -0.2259796 0.8855774 0.1960121 -0.421108 -0.04633694 -0.6389172 0.7678788 -0.1022461 -0.9941281 0.0354287 -0.3537603 0.3344753 -0.8734872 0.299548 0.4530626 -0.839646 -0.7567705 0.6501215 0.06812107 -0.1098039 -0.9813241 0.157943 -0.4682589 0.5775123 0.6687399 0.6068534 0.7619022 -0.2263489 0.84527 0.5019198 0.1832901 0.7481951 0.06203407 -0.6605725 -0.1795744 0.8225526 -0.5395927 -0.05214315 0.6234949 0.7800868 -0.2180451 -0.9759305 -0.003970444 -0.2331992 0.2028081 0.9510452 0.6231006 0.6283543 0.465743 -0.9529358 0.2295062 0.1980917 0.3654726 0.2225692 0.9038212 -0.4926538 0.0525 -0.8686404 -0.9043996 -0.1698284 -0.391433 0.4111842 -0.9062672 -0.09801745 0.413299 -0.9094144 -0.04636049 -0.3694291 -0.8155894 0.4453493 0.135008 0.964878 0.2253513 -0.3058378 0.4895573 0.8165763 -0.04270118 0.8829202 -0.4675773 -0.1635347 0.386 0.9078879 0.2175439 -0.2661457 -0.939064 -0.09183412 0.2493903 -0.9640389 0.072546 -0.462816 -0.8834808 0.8183232 -0.08942443 0.5677591 -0.1696067 -0.9630751 0.2090936 -0.2514668 -0.9648044 -0.07692235 0.4548149 -0.8167011 0.355166 -0.1229208 -0.9919606 0.03007715 -0.2925008 -0.9483203 0.1230114 0.4086049 0.7315223 -0.545818 -0.7251485 0.3778267 -0.5756792 -0.8308271 0.534507 -0.1550123 0.6426668 -0.1560665 -0.7500818 0.1164174 -0.06423693 -0.9911209 0.9279272 -0.2500531 -0.2764501 0.8899407 -0.3979822 -0.2227458 0.2421048 -0.9352659 -0.2581917 0.9553993 -0.2945255 0.02160871 0.4280162 -0.7493678 0.5052227 0.6585279 -0.7342859 0.1648191 0.03184789 -0.9808067 0.192364 -0.5413771 -0.7834092 0.3052551 -0.423384 -0.6840153 0.5940278 -0.2861926 -0.60642 0.7418548 -0.6211953 0.7287999 -0.2880404 0.3858281 0.9224894 0.01224964 0.7584497 0.4935713 0.4256071 -0.4588512 0.6659591 -0.5881787 -0.03388613 0.7215934 0.6914873 -0.08003807 -0.4679129 -0.8801428 -0.4341423 -0.7189545 -0.5427936 -0.6078808 0.7068257 -0.3617711 0.09793096 -0.7696617 -0.6308965 0.3065905 0.2156239 -0.9270969 -0.3635368 -0.02572917 -0.9312245 -0.2213817 0.2892295 -0.931309 0.9948304 0.02671211 -0.09797352 0.7605548 0.1265371 0.636824 0.8847679 0.3487035 0.3091791 0.9485099 -0.2450811 0.2006593 0.9452478 0.2881513 -0.1532171 0.6706646 -0.7190908 0.1819825 -0.7025119 -0.606198 0.3728285 -0.9157554 0.1401732 0.3764884 0.1203001 0.53736 -0.8347288 -0.8744749 0.4727367 0.1086912 0.9941272 0.04991436 -0.09601968 -0.2071055 0.266582 -0.9412977 -0.273284 0.273108 -0.9223492 -0.4346649 -0.646667 0.626808 -0.7013283 -0.7081146 0.08192819 0.151082 0.3299067 -0.9318454 -0.08455836 -0.9752642 0.2042289 0.6074258 -0.7606827 0.2289014 -0.2075698 -0.6999382 0.683375 0.9522055 -0.3037872 0.03190428 -0.8204711 -0.0594806 0.5685853 -0.6469066 -0.7473108 -0.1517842 0.9788744 -0.001898527 -0.2044537 0.9971348 0.06666725 -0.03574401 0.6531535 0.0102241 0.7571564 0.1390035 -0.8362473 0.5304418 -0.2888623 -0.6013075 0.744975 0.3616042 -0.9259237 -0.1091236 -0.3552485 -0.7816219 0.5127042 -0.8776798 -0.4788501 0.01951181 -0.2385824 0.2132956 0.9474087 0.4079167 0.02659481 -0.9126317 0.06937813 -0.9957212 -0.06104052 -0.4477368 -0.7895449 0.4197027 -0.3858501 -0.9121595 0.1381468 0.5971192 0.7474626 -0.2911158 -0.19489 0.5194885 0.8319553 -0.4480749 0.4431481 -0.7764333 -0.8706886 0.2238245 0.4379544 -0.8032398 0.4053761 -0.4364356 0.07014155 -0.3040946 -0.9500563 0.8171061 0.3169251 -0.4815559 -0.0823273 -0.9963838 -0.02101075 -0.4548931 -0.8549209 0.2493644 0.5707319 -0.8138614 -0.1090634 -0.4397189 -0.7861147 0.4343626 -0.8504202 -0.5248605 0.0361517 -0.5584359 -0.8160292 0.1491491 -0.6940176 0.5913503 -0.4106633 -0.5525372 0.7514645 0.3605605 0.1528125 0.6238477 -0.7664609 0.290275 -0.2502311 -0.9236476 0.03734737 -0.4205191 -0.9065147 -0.4524465 -0.8432229 0.2902883 -0.1350325 0.802388 -0.581326 0.8312558 0.1362597 0.5389314 0.3412972 -0.2792861 -0.8975052 0.389563 0.3807868 -0.8385952 0.9913672 -0.001960575 0.1311006 0.08172458 -0.9433711 0.3215153 -0.9093398 -0.4084243 0.07931333 0.1473254 0.5232298 0.8393602 0.7645782 0.2643651 0.587819 0.5999351 0.4271512 0.676476 0.8475892 -0.04797196 -0.5284802 0.8158311 0.2705541 -0.5110969 -0.7402256 -0.3919662 0.5462863 -0.3634443 -0.9316155 7.79204e-4 0.7612121 0.5281623 0.3762987 -0.959507 0.2624146 -0.1023953 -0.6353806 -0.7663781 -0.09463691 -0.2832009 0.9407503 -0.1865101 -0.3582942 0.919501 0.1616889 -0.6166384 -0.4643386 0.6357254 -0.1077888 0.6199094 0.7772349 -0.7318143 0.6552206 0.1874403 0.181735 -0.7346627 -0.6536383 -0.1252471 -0.7198187 -0.6827694 -0.09731197 -0.4298537 -0.8976392 0.313198 -0.5504886 -0.7738664 -0.3968006 0.2406598 -0.8857946 0.8530431 0.2252499 -0.4707227 0.9211937 0.1344397 0.3651412 0.5305541 0.4106659 0.7415294 0.7915543 0.215108 0.5719881 0.8343166 0.1390567 0.5334596 0.9537828 -0.08435696 0.2884131 -0.4309714 0.5910398 0.6818618 -0.5968994 0.07485067 0.798817 -0.02729922 0.9392793 -0.3420659 -0.6372926 -0.7506819 0.1741685 -0.5093178 0.8403111 0.1856681 -0.393377 0.7492837 0.5327556 -0.3456994 -0.3148101 0.8839607 -0.08313828 0.7852102 -0.613623 -0.2292486 0.7861117 0.5739979 -0.2362254 0.7856549 0.5717901 -0.7366974 -0.3269538 0.5919275 0.721174 0.02005642 0.6924636 -0.7374705 0.5823271 0.3421 -0.3244938 0.5509742 0.7688506 0.6374553 0.5703824 0.5179911 -0.4430737 0.7236727 -0.5291347 -0.2678079 0.6511958 0.7100867 -0.1873782 0.5640154 0.8042238 0.07793867 0.9640607 -0.2539929 0.8177404 0.1647493 0.5515054 -0.1375268 0.3791497 0.9150584 -0.1492781 0.375932 0.9145442 0.2101677 0.9734504 -0.09068447 0.2590755 -0.6198327 0.7407343 -0.4217628 0.8589767 0.2903016 -0.2589719 0.9168658 0.3037937 -0.07934093 0.1338392 0.9878219 0.6125501 0.7875333 0.06762975 0.6545825 0.5976836 0.4629213 -0.7286085 0.6591095 0.1862912 -0.779462 0.4806549 0.4017583 0.03542673 0.6428042 0.7652109 -0.9089094 -0.3024548 0.2870621 0.2043192 0.04922151 0.977666 0.7267717 0.593273 0.3461648 -0.8061257 0.5771805 0.1304765 0.6460796 0.705224 0.2919594 -0.1620629 0.2873229 0.9440238 -0.1657252 0.2954674 0.9408689 0.3979482 0.7253586 0.5616869 -0.3620533 0.8604978 -0.3584141 -0.9305415 -0.1250471 -0.344174 0.2843225 -0.009227395 0.9586843 -0.2630975 -0.9468131 -0.1852694 -0.05108815 0.1761423 -0.9830381 0.03065967 -0.9932194 -0.1121391 0.3443092 -0.8634729 0.3685996 -0.1589178 -0.9872764 -0.005511045 0.8890565 0.1804836 -0.4207186 -0.2145524 -0.9101528 -0.3543855 -0.8721628 -0.371367 -0.3184626 -0.9303334 0.3278486 0.1643011 0.9379773 0.1102598 -0.3286967 -0.7257993 -0.6348603 0.2648919 -0.4454456 0.3794463 -0.8109246 -0.07864969 -0.9911416 -0.1070166 0.9427614 0.06790125 0.3264818 -0.1543801 0.3919169 -0.9069554 -0.8982844 0.1671771 -0.4063702 -0.520055 -0.1978515 -0.8309016 0.6523816 -0.7551051 0.06491857 0.01318746 -0.9072889 -0.420301 0.6458778 -0.7068427 0.2884707 0.8533059 0.2419804 0.4618599 -0.5608063 -0.6048815 0.5653448 0.1776242 -0.9831345 0.04354566 0.4316397 0.2678719 -0.8613547 0.819181 0.4465108 -0.3599594 -0.6259698 0.4723544 -0.6205185 0.04970896 -0.990402 0.128968 -0.9114819 0.4110864 -0.01445299 0.4348725 0.8328243 0.3424759 0.2322583 0.5096845 0.828419 0.9749825 0.1164794 0.1893186 0.162688 0.7561805 -0.6338167 -0.793765 0.4773057 0.3769835 0.1341767 -0.9857271 -0.1016802 -0.9192459 0.1251038 0.3732775 -0.1893697 0.5842702 0.7891562 -0.7436418 0.1199131 -0.657737 -0.5613028 0.1788123 0.8080627 0.4034239 0.02879828 -0.91456 -0.1535315 -0.1906971 -0.9695683 0.5512758 -0.7450466 0.3755005 0.511929 -0.7528236 0.4137457 -0.4756841 -0.876381 0.07537227 -0.3836945 0.905947 0.1789932 -0.9144286 0.3471382 0.2081233 0.1750566 0.8562937 -0.485918 -0.8832364 0.2724049 0.3816925 0.9120125 -0.1753603 -0.3707857 0.6764543 0.2187464 -0.7032492 0.8355519 -0.339751 -0.4317666 0.01999938 -0.0316618 0.9992985 -0.04841893 -0.9929033 0.1086212 0.1785421 -0.9655263 -0.1894245 0.1698145 -0.684085 0.7093594 0.1687358 -0.9854725 0.01929646 -0.05230057 -0.995127 -0.083588 0.6178401 0.7796303 -0.1022265 -0.02887159 0.2685887 -0.9628222 -0.4599783 0.3784527 -0.8032394 0.9956598 -0.06866985 0.06281775 0.862723 -0.02285927 -0.5051597 0.7957624 -0.136074 0.5901238 0.7575808 -0.2556138 0.6006105 0.602472 -0.7871502 0.1319928 0.5793594 -0.1755042 0.7959529 0.007076025 -0.6293549 0.7770858 0.4148931 -0.5657557 0.7125898 0.109784 -0.9518175 0.2863404 -0.4664038 -0.8583816 -0.2136549 -0.6800227 -0.7237549 0.117252 -0.7177641 -0.6093592 0.3368916 -0.2934568 0.5714317 -0.7663869 -0.01191812 0.9590764 0.2828969 -0.03714114 0.469944 0.8819144 0.06567293 0.5470896 -0.8344938 -0.7506147 0.5698153 0.3344964 0.7555257 -0.3552122 -0.5504591 0.3904612 -0.6416962 -0.6601259 -0.219563 0.5563992 -0.8013813 0.7541047 -0.6104379 -0.2422639 0.9042384 0.2220944 -0.3647289 0.5393293 -0.02346628 -0.841768 0.5652161 0.2414869 -0.7888059 0.6496787 0.089993 0.7548636 -0.1174449 0.1363009 0.9836812 0.1742097 0.3525621 0.9194298 0.4213415 -0.1402631 0.8959897 0.6422693 0.3253801 0.6939871 0.4031656 -0.5515865 0.7302122 -0.6731491 -0.6612843 -0.3310186 -0.8556175 0.04713809 -0.5154578 0.6822566 0.509432 -0.5244091 -0.6756362 0.3183148 -0.6649748 0.6447886 0.1097219 0.7564449 0.5852688 0.2236034 -0.7793985 0.5292476 0.2234674 -0.8185104 -0.7220388 -0.680433 0.1251837 -0.3597911 -0.7596183 -0.5417847 0.7991042 0.3114486 -0.5142297 0.01927202 -0.9819452 0.1881814 0.3434648 -0.5995417 0.7228981 -0.5975433 -0.7031255 0.3854305 0.5711577 -0.1832088 0.8001334 -0.9434669 -0.117465 -0.3099552 -0.07703387 -0.7635709 -0.6411126 0.734669 0.06729346 0.67508 0.5922572 0.1226754 0.7963556 -0.2430682 0.03308868 0.9694448 -0.1785489 -0.7806037 0.5989809 -0.7228441 -0.6040197 0.3356437 0.5415702 -0.7725152 0.3315448 -0.5378152 -0.8318971 0.1367556 -0.4512272 -0.5066546 -0.7346395 -0.9211741 0.1330047 0.3657157 0.9672105 0.06759566 -0.2448154 0.369378 -0.920069 0.1305102 -0.513877 -0.8574325 -0.02720302 -0.1456183 -0.9743149 -0.1717729 0.4984106 0.8192011 0.2837193 -0.8754298 0.3780749 0.3011346 0.2765485 0.3510008 -0.8946056 -0.8888814 0.1154038 -0.4433642 -0.18952 0.2823573 -0.9404023 0.8471738 -0.2133833 -0.4865843 0.8619273 0.3557079 0.3613216 0.243838 -0.9696017 0.02038627 -0.3285465 -0.9304395 -0.1622942 0.6105491 -0.6324331 0.4767163 -0.5232793 -0.8521243 -0.007939696 -0.4433873 -0.5557339 -0.7032549 -0.3071033 -0.8854374 -0.348838 -0.1964982 0.4460321 -0.8731803 -0.7740981 0.5630505 -0.2893896 0.6390652 0.6066601 -0.4728207 0.9381314 -0.1591365 -0.3075466 0.823725 -0.3078764 -0.4761188 -0.3726072 -0.9190295 -0.128641 0.2358323 0.7453979 -0.6235104 -0.001917898 0.1521718 0.9883522 0.9516484 -0.1792519 -0.2494677 0.8832501 0.3840509 -0.2690248 0.456575 0.0598694 0.8876683 0.007760524 -0.9066678 0.421774 -0.5381788 -0.4394571 -0.7191947 -0.7062637 0.4078156 0.5786864 -0.1099188 0.2528903 0.9612306 -0.3154131 0.3750733 0.8716849 0.931929 0.02720248 0.3616189 0.8877515 0.3102451 0.3400667 -0.8700083 -0.428008 -0.2447341 0.01709342 -0.9681462 -0.2498012 -0.001476645 0.5088791 0.8608367 -0.5102519 0.1514484 -0.8465852 -0.120794 -0.794643 -0.5949382 -0.2552396 0.8365696 -0.4847722 -0.5795856 0.7610573 -0.2913286 -0.8667071 -0.4949463 -0.06202423 -0.8186987 0.4694682 0.330654 -0.7064236 0.4737905 -0.5258215 0.8009037 -0.5680164 -0.1895008 0.6631823 -0.5873435 -0.4639148 0.7494484 -0.3251844 -0.5766994 0.9018174 -0.3965427 -0.1716948 0.4332057 0.1864355 -0.8818019 0.8761107 0.268418 0.4004769 0.1927864 0.1627341 0.9676523 -0.3991626 0.351074 0.8470043 -0.06981426 0.2139158 0.9743541 0.00357455 0.1548793 0.9879269 0.3199336 -0.01341193 0.9473451 -0.9053536 0.4241291 0.02119684 -0.9999203 0.005358338 0.01144021 0.0498563 0.9194778 -0.3899679 -0.4036253 -0.8166493 -0.4125176 -0.6475546 0.6592535 -0.3821751 -0.8220036 0.5667549 -0.05566906 -0.8919007 -0.3160076 0.3235003 0.3053115 0.7387248 -0.6008916 -0.7829294 0.6143109 0.0982021 -0.7846034 0.6132546 0.09119391 -0.9079942 -0.3614202 -0.2119479 -0.1575681 0.04665732 0.9864052 -0.8084308 0.4079154 -0.4243168 -0.9040933 0.3963087 0.159859 -0.2076963 0.5228989 0.8267038 0.01089358 0.6027127 -0.7978839 -0.8595381 0.4850927 0.160871 -0.8630049 0.4156138 0.287207 0.02886617 0.9723985 -0.231534 -0.02641713 0.1744406 0.9843133 -0.8732199 0.2685108 0.4066806 -0.8783828 0.2652709 0.3975865 -0.04562187 0.9987066 0.02244436 -0.3301233 -0.5355501 0.777306 -0.6904376 0.6801344 -0.2464005 -0.6399101 0.7601097 -0.1129094 -0.8493752 0.07977229 0.5217261 0.1269152 0.8218576 0.5553761 -0.1593672 0.5574946 0.8147404 -0.7049421 0.4773412 -0.5245969 -0.8530194 0.3226196 -0.4102126 -0.7445818 0.5029454 0.4389122 -0.7426924 -0.3422476 -0.5755646 -0.667694 0.03107571 0.7437869 -0.01275593 0.5746924 0.8182701 -0.6809809 0.4060875 -0.6093916 -0.04467713 0.6922894 0.7202356 -0.8891562 0.1949318 0.4140082 -0.8903501 0.2010953 0.4084573 -0.4278505 0.6407855 0.6374464 -0.125488 0.7469969 -0.652877 -0.2177241 -0.1561431 -0.9634394 -0.5974137 -0.009520113 0.8018766 0.1425694 -0.9468122 -0.2884796 0.9634634 0.1761403 -0.2017738 0.1155201 -0.9932196 0.01303386 -0.3112145 -0.8634732 0.396938 -0.01901441 -0.9872762 -0.1578736 0.552537 0.1804805 0.8137136 0.3171402 -0.9101527 -0.2665411 0.1804371 -0.3713656 -0.9107854 -0.3055292 0.3278479 -0.8939618 0.4691393 0.1102565 0.8762145 -0.3734437 -0.6348569 -0.6763849 0.7327042 0.3794471 -0.5649465 0.09363538 -0.9911417 -0.09418374 -0.1774953 0.06789922 0.9817764 0.8723904 0.391916 -0.2921249 0.263281 0.16718 -0.9501232 0.7409642 -0.1978515 -0.6417374 0.03625887 -0.7551061 0.6545992 0.4173187 -0.9072909 -0.05165535 -0.1856322 -0.706843 0.6825788 -0.3250238 0.2419765 0.9142247 -0.6449207 -0.6048805 -0.4671156 -0.0156911 -0.9831347 0.1822085 0.9175238 0.2678688 0.293933 0.4817472 0.4465098 0.7540216 0.5167855 0.4723538 -0.7140131 -0.1197826 -0.990402 0.06896418 -0.1260018 0.4110904 -0.9028446 -0.2714635 0.8328241 0.4824018 -0.7828031 0.5096851 0.3569879 -0.03700542 0.1164783 0.9925037 0.6513034 0.7561807 0.06320363 -0.4946553 0.4773079 -0.7262874 0.1211162 -0.9857275 0.1169286 -0.510308 0.1251059 -0.8508433 -0.8088988 0.5842705 -0.06565606 0.5354494 0.1199127 -0.8360113 -0.8848221 0.1788146 -0.4302499 0.9657512 0.02879577 0.2578673 0.9343864 -0.1906969 -0.3009266 -0.2861844 -0.7450472 0.6024973 -0.3300284 -0.7528231 0.5695074 -0.1476868 -0.8763794 -0.4584188 -0.2359108 0.9059481 -0.3515738 -0.3463783 0.3471426 -0.871501 0.5070722 0.8562928 0.09818619 -0.5130789 0.2724089 -0.8139678 0.5067291 -0.1753639 0.8440812 0.7989832 0.2187465 0.5601568 0.5552147 -0.3397507 0.7591483 -0.9843145 -0.03166127 0.1735584 -0.1147809 -0.9929031 -0.03112673 0.2146424 -0.9655273 0.1472609 -0.6747723 -0.6840862 0.2769628 0.006900131 -0.9854726 0.1696946 0.07454097 -0.995127 -0.06454509 0.1960995 0.7796284 0.5947474 0.9469079 0.2685871 -0.1767098 0.7228768 0.3784538 -0.5781192 0.09116929 -0.06867325 0.9934647 0.6319189 -0.02286267 0.7746974 -0.4606204 -0.1360772 0.8771043 -0.4768584 -0.2556142 0.840992 -0.03769618 -0.787152 0.615606 -0.6973022 -0.1755046 0.6949588 -0.7667378 -0.6293552 0.126591 -0.6402475 -0.5657551 0.5196194 -0.2660344 -0.9518173 0.1525431 0.1393253 -0.85838 -0.4937331 -0.2205165 -0.7237533 -0.6538758 -0.443347 -0.6093584 -0.6573627 0.7120921 0.5714308 -0.4079113 -0.2813599 0.9590764 0.03176605 -0.8771218 0.469946 0.09903568 0.8346596 0.5470885 -0.06354272 -0.4460309 0.569819 -0.6901904 0.6601793 -0.3552161 0.6618043 0.712354 -0.6416981 0.2842097 0.7580424 0.5563985 -0.3402829 0.3554379 -0.6104409 0.7078317 0.4995513 0.2220928 0.837331 0.9147443 -0.02346843 0.4033511 0.8663964 0.2414841 0.4370842 -0.6458824 0.08999246 0.7581143 -0.9900361 0.1363038 0.03535217 -0.8816632 0.3525621 0.3136399 -0.8204693 -0.1402605 0.5542175 -0.5868667 0.325378 0.7414288 -0.6594625 -0.5515875 0.5107449 0.2234708 -0.6612796 -0.7160797 0.3776345 0.04713845 -0.9247541 0.6231649 0.5094287 0.5934207 0.553068 0.3183144 -0.7699298 -0.6481976 0.1097229 0.7535256 0.860187 0.2236003 0.4583462 0.890212 0.2234644 0.3969714 -0.2348222 -0.6804309 -0.6941704 0.4799536 -0.7596186 -0.4388895 0.6310902 0.311446 0.7104412 -0.1829729 -0.9819452 0.04800391 -0.6614258 -0.5995403 0.4506301 -0.4728046 -0.7031235 -0.5311055 -0.7026881 -0.1832129 0.6875045 0.1610584 -0.1174717 -0.9799288 0.6216154 -0.7635734 -0.1747854 -0.5539676 0.06729227 0.8298142 -0.6957068 0.1226738 0.7077733 -0.9953035 0.03309202 -0.09097135 -0.6193274 -0.780601 -0.08423537 -0.4428949 -0.6040174 -0.6625761 -0.2442468 -0.7725154 0.5861428 -0.2178987 -0.8318967 -0.5103607 0.6564398 -0.5066531 -0.558918 -0.5031285 0.1330149 -0.8539137 0.3907594 0.06759399 0.9180077 -0.07210838 -0.9200688 0.3850634 -0.05221354 -0.8574305 -0.5119441 0.1473129 -0.9743151 -0.1703203 -0.2036263 0.8192003 0.536141 -0.43228 0.3780769 -0.8186525 0.9265106 0.3509974 0.1355691 0.3012798 0.1154085 -0.9465259 0.9000299 0.2823573 -0.3319948 0.61117 -0.2133833 0.7621934 -0.2243598 0.3557069 0.9072681 0.01738286 -0.9696022 0.2440682 0.1097949 -0.9304386 -0.3496127 -0.3770729 -0.6324319 0.676643 -0.07269233 -0.8521228 -0.518269 0.6266316 -0.5557393 -0.5463395 0.2974151 -0.8854376 -0.3571338 0.8325353 0.4460318 -0.3285431 0.1668056 0.563052 -0.8094123 0.5655429 0.6066581 0.5586834 0.4482648 -0.1591404 0.8796209 0.5972198 -0.3078793 0.740634 0.06976044 -0.9190288 -0.3879687 0.6523789 0.7453963 0.1370632 -0.9768713 0.1521734 0.1502196 0.3929591 -0.179255 0.9019151 0.401755 0.3840492 0.8313237 -0.806822 0.05987018 0.5877531 -0.4155554 -0.9066675 0.07257986 0.6277928 -0.4394603 -0.6424568 -0.680491 0.4078184 -0.6087825 -0.9666948 0.2528924 0.03932744 -0.9098404 0.3750772 -0.1775034 -0.2138803 0.02720165 0.9764811 -0.1993834 0.3102448 0.929513 0.107919 -0.4280133 -0.897306 0.2494545 -0.9681465 -0.02155905 -0.8508077 0.508878 0.1310315 0.7579683 0.1514479 -0.6344664 0.5692574 -0.7946433 -0.2109218 0.4397153 0.836569 -0.3268069 0.1986594 0.7610579 -0.6175155 -0.0721026 -0.4949417 -0.8659296 -0.4527182 0.4694691 -0.7580534 0.4108358 0.4737926 -0.7789317 0.3105034 -0.5680197 0.7621951 0.5604528 -0.5873469 0.5838803 0.6851721 -0.3251864 0.6517616 0.3084436 -0.3965441 0.8646475 0.9379686 0.1864325 0.2923316 -0.2608654 0.268418 0.9273085 -0.9264521 0.162735 0.3394168 -0.898343 0.3510787 -0.2640523 -0.9734895 0.2139189 0.08097469 -0.975606 0.1548812 0.1555793 -0.8868189 -0.01340997 0.4619225 -0.1602826 0.4241349 -0.8913019 -0.1651971 0.005355775 -0.9862461 0.3929964 0.9194772 -0.0107541 0.3454805 -0.8166478 -0.4623092 0.2779643 0.6592547 -0.6986553 -0.07150065 0.5667576 -0.8207762 -0.4569124 -0.3160083 -0.8314867 0.640723 0.7387233 0.209194 -0.2175224 0.6143134 -0.7584874 -0.2108596 0.6132578 -0.7612183 0.06967782 -0.3614183 -0.9297967 -0.9989033 0.04665893 -0.003877401 0.29484 0.4079189 -0.8641017 -0.2971005 0.3963133 -0.8687158 -0.8488186 0.5229005 -0.07798713 0.7900551 0.6027117 -0.1120332 -0.2912419 0.4850951 -0.8245368 -0.4166047 0.4156174 -0.8085189 0.2332208 0.9723978 -0.007111608 -0.9766511 0.1744424 0.1253896 -0.5362319 0.2685093 -0.8002238 -0.5280389 0.2652686 -0.8067265 -0.02919638 0.9987068 -0.04162138 -0.8188537 -0.5355476 -0.2065606 0.1372049 0.6801351 -0.7201328 0.01307463 0.7601141 -0.6496581 -0.6462329 0.07977527 -0.7589591 -0.5292232 0.8218594 0.210879 -0.8295585 0.5574978 -0.03207617 0.4098545 0.4773429 -0.7772793 0.2740433 0.3226217 -0.9059886 -0.5482769 0.502948 -0.6681585 0.4544035 -0.342248 -0.8224256 -0.8376847 0.03108012 -0.5452691 -0.810484 0.5746924 0.1133323 0.4973239 0.4060878 -0.7666561 -0.7185296 0.6922903 0.06670361 -0.5459204 0.1949338 -0.8148446 -0.5406185 0.2010985 -0.8168789 -0.6957008 0.6407856 -0.3246446 0.6257877 0.7469952 -0.2244722 0.9184522 -0.1561459 -0.3634061 -0.8842693 -0.009518444 -0.4668803 0.3238165 -0.945565 0.03240007 0.4142543 0.2084648 0.8859661 0.1576699 -0.985928 0.05555391 -0.1939151 -0.9673799 -0.1630128 0.232997 -0.9716902 -0.03911942 -0.6583886 0.4324138 0.6160705 0.3381199 -0.9318919 0.1313486 0.7796044 -0.6259575 -0.01985645 0.7956457 0.3525387 -0.4926097 -0.7388882 0.3548244 0.5728385 0.4985939 -0.8012911 -0.3306611 0.6703181 0.4636861 0.5793694 0.2140607 -0.9763766 0.02944397 -0.9441832 0.3275552 0.03500789 0.4079474 0.5302647 0.7432349 0.9982664 0.02795201 0.05179506 0.7590699 -0.4459266 0.4743019 -0.3900904 -0.9114735 0.1305589 0.23606 -0.9458281 0.2229009 -0.492126 -0.8696813 -0.03829383 -0.8530879 0.5144627 -0.08700239 0.3355232 -0.7912015 -0.5112969 0.03586953 -0.9993492 0.003804266 -0.1301938 0.4593385 0.8786681 -0.567573 0.6833007 0.4593049 0.7364269 0.5838055 0.3418281 0.09046846 -0.9934289 -0.07010453 0.818997 0.4821569 -0.3110767 -0.4495455 0.8895553 -0.08124172 -0.5073325 0.7168238 -0.4783067 -0.9098148 0.3867352 0.1505755 -0.0647726 0.8895507 0.4522213 0.4933007 0.6286101 -0.6012519 0.0972715 -0.9925186 0.07379078 0.7355832 0.01531934 -0.6772612 -0.2207048 0.7740241 -0.5934442 0.9451327 -0.03305059 0.3250105 0.1796456 0.2362529 -0.9549408 -0.02913451 0.07621192 0.9966658 0.54067 -0.3971748 0.7415714 -0.4164343 -0.8998779 -0.1296231 -0.391076 -0.9049671 -0.1676129 0.3785032 -0.9142112 -0.1447524 0.04918527 0.9804831 -0.1903513 0.753703 0.3934077 -0.5264621 -0.1227709 0.9349778 0.3327819 0.6714003 0.2862286 -0.6835897 -0.7255128 -0.1053338 0.6801 -0.3956632 0.4397987 0.806243 -0.5758457 -0.4167526 0.7033627 -0.4250619 0.03250497 -0.9045805 0.14991 -0.985624 -0.07792562 0.09117424 -0.9868015 0.1338286 -0.2278355 -0.8490721 -0.476621 0.04753154 -0.9987522 0.01531565 0.195306 -0.980479 0.02272707 -0.4541094 0.8697026 0.193396 0.3530972 0.3670588 0.8605756 0.6825831 0.4597088 0.5681093 -0.9500569 0.1296297 0.2838802 -0.634056 0.1332235 0.7617247 -0.968445 0.01368194 -0.2488512 -0.9381378 -0.1993667 -0.2831081 -0.354776 -0.932771 0.06381303 -0.8509183 -0.08940458 -0.5176341 -0.1337476 -0.8073492 -0.5747163 -0.5072624 -0.7268007 -0.4630827 0.01078361 -0.9885905 -0.1502417 0.4346996 -0.9005462 0.007274389 0.490707 -0.843213 -0.2195411 0.4825807 -0.7887205 -0.3808355 0.5962765 0.3208563 0.7358706 -0.2055766 0.9680812 -0.1433778 -0.3545097 0.682432 -0.6392256 0.1170195 0.7375953 0.6650261 0.4211636 0.745332 -0.5168185 -0.4328137 -0.4661697 0.7715944 0.03990876 -0.8205618 0.5701627 0.3576234 0.7294491 0.5831034 -0.4415026 -0.7864277 0.4319803 -0.6759065 0.4836863 0.5560557 -0.18417 0.02607858 0.9825483 -0.2717895 0.448764 0.8513175 -0.8563224 0.3294102 -0.3977447 -0.315768 0.2747877 -0.9081752 -0.5211837 0.5826415 -0.6236157 -0.7457401 -0.06071591 -0.6634647 -0.7575738 0.5801496 -0.2991796 -0.5099502 -0.7108981 -0.4843291 0.592761 -0.8048121 0.03019595 0.9747314 -0.1621983 0.1535912 -0.4308397 0.7273297 0.5341989 0.869531 0.3229093 0.3736916 -0.8474563 0.3538596 -0.3957288 -0.2912736 0.4287529 0.8551787 -0.2275044 0.4174713 0.8797496 0.5180545 -0.8217076 -0.2375207 0.4662925 -0.8589445 0.2116255 -0.5406541 0.5644653 0.6237565 0.09284591 -0.9896892 -0.1090635 -0.4248322 -0.7681779 -0.4789782 0.3923404 -0.8422673 -0.3696684 -0.844352 -0.1043301 -0.5255331 0.9205812 -0.3876422 -0.04757905 0.3420623 -0.8737234 0.3458333 -0.8992894 0.3094919 -0.3090202 -0.8191827 0.3642774 -0.4429917 -0.1709175 0.07595723 -0.9823532 0.08796733 -0.9013552 -0.4240528 0.4865949 -0.785591 -0.3821941 -0.3786689 -0.920358 -0.09772819 0.4009071 -0.8956005 -0.1928036 0.6080992 -0.7150114 0.3449262 0.739992 0.02794194 -0.6720351 -0.7973675 0.3063493 0.5199568 -0.1243113 -0.9922405 -0.002355873 0.4196968 -0.9022845 -0.09867829 0.2621476 -0.9637762 0.04913318 -0.4694153 0.8821701 -0.03775101 0.6596615 0.4612554 -0.5933719 0.005558133 0.5421499 0.8402634 0.994643 -0.05819833 0.0854302 0.5008056 0.3550124 0.7894048 -0.6050744 -0.2000171 0.7706348 -0.7896878 0.6134106 -0.01098978 -6.51633e-4 -0.9994819 0.03218102 0.3516195 -0.9361106 0.007810294 -0.5724449 -0.7941688 -0.2039677 0.420948 -0.90029 -0.110818 0.5846385 -0.74687 0.3168332 0.3838681 -0.9168846 0.1093981 0.4127506 0.5987187 0.6864204 0.7062644 0.7079439 -0.002464413 -0.4060112 0.7903274 0.4588437 -0.7773248 -0.06437665 0.625797 -0.5559952 -0.3695032 0.744538 0.3666657 -0.9301798 -0.01793789 -0.1150667 0.8809458 0.4590144 -0.4209447 0.3204203 -0.8486086 -0.8115131 -0.09126543 0.5771629 -0.644003 0.6367356 0.424061 -0.7632746 0.2633272 -0.5899751 0.03238594 -0.9664312 -0.2548763 0.6697062 -0.6684537 0.323517 0.3477546 0.5544945 -0.756044 -0.324525 0.4423502 -0.836068 -0.1301966 0.5694345 -0.8116607 -0.9617107 0.2740473 0.003244221 -0.8165183 0.5772443 0.009330391 0.7415471 -0.6676622 -0.06584197 0.1954761 -0.9725265 0.1264173 -0.3703821 0.7153255 -0.5925592 0.8079462 0.0615369 0.5860343 0.3524144 -0.8864239 0.3000946 0.1712573 0.9495963 0.2625601 0.4035899 0.9130762 0.05836993 0.6780665 -0.713712 -0.1756159 0.5432764 0.6120164 -0.5747059 0.7818526 0.5788808 0.2315243 -0.5328004 -0.7345518 0.4201875 -0.2771808 -0.7712364 0.5730318 -0.42681 -0.4214525 0.8001319 -0.7359117 -0.4757053 0.4818074 -0.1087293 0.342916 0.9330523 -0.8408126 0.5401162 -0.03617477 -0.5728365 0.365818 -0.7335091 -0.04212003 0.5297467 -0.8471095 -0.3609387 0.3961052 -0.8442889 -0.425601 0.3252903 -0.8444228 -0.679454 0.1290566 -0.7222788 0.7914988 0.5075168 -0.3405237 0.9135527 -0.2214821 -0.3411264 -0.07750195 0.9668062 0.2434734 0.4515265 -0.8833392 0.1258402 0.5567103 0.8228613 0.1138986 0.6577591 0.7199729 -0.2213417 0.6541782 -0.5781276 -0.4876673 -0.1655413 0.8745895 0.4557294 0.5264499 0.7848899 -0.3268002 0.5315814 0.7834228 -0.3219783 0.7786505 -0.6195699 -0.09917896 -0.2645019 0.1210294 -0.9567605 0.8794972 0.4638624 0.1063778 0.7435343 0.4738991 -0.4717801 -0.2161617 0.7248002 -0.6541704 0.1339656 0.7855199 0.604162 0.6517638 0.618193 -0.4393647 0.635573 0.5224447 -0.5684175 -0.1090384 0.9837371 0.1427305 -0.3995221 0.3481388 -0.8480457 0.6513934 0.2840288 -0.7035725 0.6616201 0.2762547 -0.6970956 -0.1291374 0.9915646 -0.01109433 0.1133889 -0.7393491 -0.6637061 0.5340383 0.8454169 -0.008574962 0.3938223 0.9146782 -0.0909267 0.6136285 -0.03318738 -0.7888971 -0.3444676 0.8986871 -0.2714839 -0.2484893 0.7532753 -0.6089575 0.7779301 0.5844724 0.2306877 0.9478034 0.3095675 0.07639741 0.4041207 0.6703533 -0.6223447 0.77933 -0.5983559 0.1860505 0.3524595 -0.0534569 -0.9342991 -0.3470668 0.7647706 -0.5428357 0.8213944 0.4726048 0.3193057 -0.2956464 0.8413129 -0.4525327 0.6821931 0.1499286 -0.7156352 0.6845647 0.1601223 -0.7111485 -0.003516554 0.8206483 -0.5714228 0.1521995 0.8930066 0.4235265 0.5914146 -0.3605509 0.721271 0.2662492 -0.1008593 -0.9586129 -0.04976648 -0.9468136 0.317911 -0.8590174 0.1761394 0.4806912 -0.1141312 -0.9932196 0.02210795 0.1782577 -0.8634712 -0.4718493 0.06536006 -0.9872771 0.1449557 -0.7706107 0.180482 -0.6112163 -0.2229088 -0.9101538 0.3491871 0.1002182 -0.3713704 0.9230602 0.558907 0.3278469 0.7616688 -0.7097229 0.1102601 -0.6957989 0.5586363 -0.6348626 0.5337368 -0.5302035 0.3794443 0.7582259 -0.06118124 -0.9911421 0.1178736 -0.1242548 0.06790345 -0.9899242 -0.7450912 0.3919144 0.5396686 0.03293222 0.1671758 0.985377 -0.5151189 -0.1978566 0.8339696 -0.2303761 -0.7551033 -0.6137963 -0.3827697 -0.9072907 0.1741001 -0.02700889 -0.7068408 -0.7068569 0.03671574 0.2419788 -0.9695866 0.7551057 -0.6048812 0.2528515 -0.03952211 -0.9831341 -0.1785647 -0.9634362 0.2678697 -0.006064713 -0.6852081 0.4465128 -0.5754269 -0.279586 0.4723504 0.8358928 0.09367382 -0.9904016 -0.1016355 0.3902571 0.4110838 0.8238383 0.1147633 0.8328252 -0.5415087 0.6402049 0.5096874 -0.5747664 -0.2615224 0.1164833 -0.9581429 -0.6403965 0.7561786 0.1344842 0.6892315 0.4773056 0.5451049 -0.1505447 -0.985727 -0.0753569 0.7414193 0.1251026 0.6592775 0.7915109 0.5842711 -0.1792699 -0.2609063 0.1199102 0.957888 0.9730009 0.1788145 0.1459265 -0.9986696 0.02879637 0.04277586 -0.8016194 -0.1907005 0.5666036 0.0928933 -0.7450441 -0.6605151 0.144594 -0.7528209 -0.6421474 0.2780286 -0.8763817 0.3932623 0.3302621 0.9059468 0.2649288 0.5911728 0.3471365 0.7280185 -0.5132278 0.8562927 0.05796521 0.7330353 0.2724044 0.6232615 -0.7359818 -0.1753608 -0.6538956 -0.9299427 0.2187465 -0.2955613 -0.7568465 -0.3397477 -0.5583502 0.8873535 -0.03165936 -0.4600017 0.1188356 -0.9929031 -0.004630744 -0.2488618 -0.9655266 -0.07632911 0.5610536 -0.6840837 -0.4660992 -0.0573368 -0.9854721 -0.1598668 -0.05182528 -0.9951273 0.08387994 -0.3649987 0.7796311 -0.5088726 -0.8507171 0.2685853 0.4518212 -0.5168874 0.378451 0.7678555 -0.3841215 -0.06866908 -0.9207254 -0.8346906 -0.02285856 -0.5502446 0.1772138 -0.1360726 -0.9747202 0.2035092 -0.2556111 -0.9451174 -0.1481436 -0.7871488 -0.5987071 0.45754 -0.1755012 -0.8716976 0.6937836 -0.6293532 -0.3501126 0.4555358 -0.5657516 -0.6873225 0.2082351 -0.9518164 -0.2251303 0.01471543 -0.8583818 0.5128003 0.4059829 -0.7237555 0.5579928 0.6196569 -0.6093645 0.494672 -0.5575011 0.5714299 0.602213 0.2589807 0.959077 -0.1144562 0.8073561 0.4699469 -0.3568279 -0.7774516 0.5470877 0.3102646 0.6320374 0.5698161 0.5252033 -0.8278942 -0.355212 -0.4340686 -0.7647502 -0.6416971 -0.05815494 -0.6215741 0.5563963 0.5514242 -0.5508661 -0.6104384 -0.5691323 -0.727113 0.2220966 -0.6495997 -0.9935086 -0.0234673 -0.1113098 -0.9574629 0.2414846 -0.1579554 0.3895829 0.08999651 -0.9165837 0.9341481 0.1363047 -0.3298307 0.7475054 0.3525642 -0.5629692 0.61716 -0.1402583 -0.7742358 0.3382652 0.325383 -0.8830076 0.4765254 -0.5515841 -0.684601 9.13444e-4 -0.6612894 0.7501302 -0.08376353 0.04713666 0.9953702 -0.7721201 0.5094322 -0.3798809 -0.2974818 0.3183113 0.9001013 0.3931646 0.1097269 -0.9128974 -0.9578968 0.2236019 -0.1801001 -0.9681912 0.2234655 -0.1125561 0.4316832 -0.6804333 0.5921656 -0.3267218 -0.7596232 0.5623394 -0.8146821 0.3114473 -0.4891765 0.1602423 -0.9819447 -0.1005333 0.4963783 -0.5995372 -0.6278246 0.6100055 -0.7031254 0.3653877 0.464913 -0.1832078 -0.8661932 0.1393895 -0.1174777 0.9832444 -0.5408894 -0.7635742 0.3526942 0.2804319 0.06729668 -0.9575119 0.4521798 0.1226769 -0.8834499 0.9769545 0.03309094 -0.2108668 0.6161713 -0.7806021 -0.1048486 0.6207833 -0.6040213 0.4997863 0.05776375 -0.7725129 -0.6323664 0.3605654 -0.8318966 0.4218302 -0.4592365 -0.5066566 0.7296582 0.7354876 0.1330089 0.6643543 -0.6474297 0.0675975 -0.7591215 -0.04635602 -0.9200687 -0.3890051 0.2029327 -0.8574338 0.4728906 -0.08963143 -0.9743159 0.2065789 0.03396403 0.8192025 -0.5724977 0.6573358 0.3780728 0.6518978 -0.9246483 0.3509983 0.1477354 -0.004405319 0.1154015 0.9933091 -0.759543 0.2823542 0.5859784 -0.8111519 -0.2133814 -0.5445192 -0.05725401 0.3557112 -0.9328406 -0.08958309 -0.9696012 -0.2277024 -2.09152e-4 -0.9304403 0.3664435 0.1574437 -0.6324291 -0.758449 0.2243676 -0.8521257 0.4728013 -0.4345543 -0.5557355 0.7087458 -0.1769937 -0.8854387 0.4297342 -0.696169 0.4460301 0.5624997 0.08290976 0.5630478 0.822255 -0.7067471 0.6066598 -0.3639677 -0.6908225 -0.1591371 -0.705294 -0.7913929 -0.307875 -0.5281196 0.04946309 -0.9190307 0.3910701 -0.6635105 0.7453963 0.06432765 0.8872315 0.1521747 -0.4355033 -0.6447157 -0.1792509 -0.743109 -0.6319967 0.3840516 -0.6731156 0.5941097 0.05987316 -0.8021526 0.3748279 -0.9066664 -0.1935454 -0.4069184 -0.4394672 0.8008034 0.8314161 0.4078161 0.3774033 0.9106853 0.2528929 -0.3266457 0.9212834 0.3750759 -0.1027373 -0.08795285 0.02720731 -0.995753 -0.0877391 0.3102476 -0.9465983 0.1653851 -0.4280108 0.8885126 -0.2315891 -0.9681468 0.09517413 0.7726767 0.5088799 -0.3794894 -0.533519 0.1514459 0.8321188 -0.4801191 -0.794645 0.3715171 -0.3218483 0.8365675 0.4433606 -0.004879772 0.7610552 0.6486688 0.3277879 -0.4949475 0.8047249 0.6587122 0.4694682 0.5879608 -0.1590691 0.4737898 0.8661527 -0.5242494 -0.5680175 -0.6344437 -0.7094259 -0.5873453 -0.3895386 -0.8487386 -0.3251836 -0.4170112 -0.5529227 -0.3965404 -0.7328249 -0.9824663 0.1864332 0.001575112 -0.02841258 0.2684213 -0.9628825 0.7825351 0.1627373 -0.600962 0.9361976 0.3510769 -0.01670992 0.9047135 0.2139192 -0.3684184 0.8844207 0.1548829 -0.4402401 0.7080758 -0.01340913 -0.7060091 0.4195144 0.4241341 0.8025695 0.4526004 0.005349874 0.8916974 -0.3717917 0.9194767 0.1278027 -0.1914022 -0.8166498 0.5444705 -0.05628561 0.6592521 0.7498124 0.3137075 0.5667543 0.7618249 0.6846802 -0.3160069 0.6567744 -0.6739616 0.738723 -0.007992208 0.434411 0.6143105 0.6587182 0.4288723 0.6132553 0.6633149 0.2115939 -0.3614228 0.9080757 0.9543419 0.04666012 -0.2950497 -0.02291184 0.4079132 0.9127333 0.5433169 0.3963081 0.740099 0.8332914 0.5229011 -0.1794429 -0.7203859 0.6027106 0.3431967 0.524509 0.4850926 0.6996968 0.6393474 0.4156125 0.6469166 -0.2204182 0.9723977 0.07654094 0.8944473 0.1744428 -0.4117448 0.7510154 0.2685104 0.603223 0.7451406 0.2652689 0.6118806 0.0403096 0.9987066 0.03098928 0.8431506 -0.5355486 -0.04779887 0.08445233 0.6801329 0.7282081 0.1818193 0.760109 0.6238398 0.8436425 0.07977217 0.5309461 0.4419314 0.8218604 -0.3595026 0.8011823 0.5574977 -0.2174934 -0.1586271 0.4773372 0.8642839 0.009460747 0.3226168 0.9464824 0.7230134 0.5029454 0.4736005 -0.1876343 -0.3422504 0.9206835 0.9624215 0.0310778 0.2697758 0.7394912 0.5746954 -0.3505396 -0.2452704 0.4060848 0.8803053 0.6656926 0.6922908 -0.2785443 0.7646353 0.1949324 0.6142755 0.7601875 0.2010926 0.6177998 0.7609519 0.6407849 0.1017194 -0.5300102 0.7469933 0.4013605 -0.7677262 -0.1561455 0.6214622 0.9834285 -0.009518921 0.1810463 0.1605744 -0.9468138 0.2788539 -0.3677573 0.1761385 0.913088 -0.07504332 -0.9932199 0.08878576 -0.1570014 -0.8634718 -0.4793402 0.1418087 -0.9872768 0.07193666 -0.9835528 0.1804824 0.007068157 0.04530876 -0.9101543 0.4117843 0.65686 -0.3713679 0.6562171 0.9129759 0.3278476 0.2428802 -0.9891582 0.1102586 -0.09700131 0.7698455 -0.6348611 0.06549179 0.06240862 0.3794435 0.9231076 0.02625262 -0.9911422 0.1301848 -0.7175098 0.06790238 -0.6932308 -0.2420285 0.3919138 0.8875955 0.6435185 0.1671745 0.7469516 0.1216544 -0.1978566 0.9726525 -0.5643308 -0.7551038 -0.3336901 -0.1890069 -0.9072909 0.3756324 -0.4642615 -0.7068411 -0.5337011 -0.5793609 0.2419793 -0.7783232 0.7467688 -0.6048799 -0.2765082 -0.1427518 -0.9831342 -0.1143193 -0.754314 0.2678685 0.5993804 -0.8945819 0.4465166 -0.0186029 0.3063382 0.4723506 0.8264634 0.009243905 -0.9904018 -0.1379092 0.8205799 0.4110874 0.397059 -0.2501453 0.8328253 -0.4937909 0.1383165 0.509688 -0.8491682 -0.8045125 0.1164829 -0.5824015 -0.4145378 0.7561794 0.5063115 0.8787044 0.4773067 -0.007540524 -0.1645224 -0.9857273 0.03569495 0.9909486 0.1251056 0.04867732 0.5041705 0.5842717 -0.6359549 0.3973829 0.1199082 0.909785 0.8494606 0.1788157 -0.4964289 -0.7511357 0.02879512 0.6595196 -0.2691727 -0.1907003 0.944023 -0.341804 -0.7450449 -0.572781 -0.2900087 -0.7528209 -0.5908939 0.4631716 -0.8763813 0.1320146 0.4233896 0.9059474 -7.06895e-4 0.9170101 0.3471389 0.1964357 -0.3634548 0.8562924 0.3669661 0.9618347 0.272405 0.02587735 -0.9833383 -0.1753634 -0.04789006 -0.9097442 0.2187466 0.3528674 -0.9396802 -0.339752 0.0396229 0.402804 -0.03165954 -0.9147385 0.0896697 -0.9929029 -0.07812196 -0.2417209 -0.9655268 0.09658634 0.1447976 -0.6840816 -0.7148888 -0.1449052 -0.9854723 -0.08858311 0.01222485 -0.9951274 0.09783726 -0.6034126 0.7796303 -0.1675406 -0.3793937 0.2685843 0.8853941 0.07881844 0.3784504 0.9222597 -0.8765514 -0.06866824 -0.4763845 -0.9952393 -0.02286005 0.09474283 -0.4731345 -0.1360708 -0.8704186 -0.434088 -0.2556111 -0.8638464 -0.4908108 -0.78715 -0.3734964 -0.1901636 -0.1755003 -0.9659386 0.3209224 -0.6293522 -0.7077602 -0.07611501 -0.5657505 -0.821056 0.02104979 -0.9518162 -0.3059455 0.3330062 -0.8583823 0.3902392 0.6661393 -0.7237543 0.1801066 0.7928869 -0.6093605 -0.003198027 -0.05668038 0.5714289 0.8186918 0.1299749 0.9590772 -0.2515502 0.40518 0.4699481 -0.7842053 -0.4110824 0.547087 0.7291826 0.8216713 0.5698174 0.01282083 -0.9170975 -0.3552153 0.1809819 -0.6321986 -0.6416981 0.4342215 -0.1384419 0.5563955 0.8193033 -0.7859856 -0.610438 -0.09793937 -0.9737369 0.2220937 -0.0501089 -0.8437304 -0.02346998 0.5362539 -0.8448995 0.2414842 0.4773156 -0.2712436 0.08999687 -0.958294 0.5208803 0.1363049 -0.8426771 0.2292999 0.3525652 -0.9072592 -0.004708528 -0.1402577 -0.9901039 -0.2901691 0.3253837 -0.8999597 -0.05805665 -0.5515819 -0.8320978 0.4710721 -0.6612879 0.5837718 0.5588697 0.04713457 0.8279148 -0.8396748 0.5094302 0.1882212 0.3326564 0.3183101 0.887704 -0.2661421 0.1097273 -0.9576681 -0.859124 0.2236001 0.4603357 -0.8247922 0.2234638 0.5194051 0.7075855 -0.6804338 0.1906113 0.09809267 -0.7596227 0.642924 -0.9413616 0.3114457 0.1297686 0.06179153 -0.9819447 -0.1787912 -0.006991267 -0.5995362 -0.8003171 0.7043004 -0.7031246 -0.09786087 -0.1809639 -0.1832057 -0.9662752 0.7251107 -0.1174755 0.6785382 -0.2001951 -0.7635736 0.6139033 -0.3819396 0.06729596 -0.9217339 -0.2017041 0.1226776 -0.9717333 0.6288195 0.03309279 -0.7768467 0.4142496 -0.7806003 -0.4680389 0.7969694 -0.6040198 7.66826e-5 -0.3515166 -0.7725128 -0.528829 0.5453791 -0.8318968 0.1025154 0.09978216 -0.5066576 0.8563537 0.989511 0.1330124 0.05635219 -0.9803377 0.06759661 -0.1853881 -0.2800288 -0.9200688 -0.2739658 0.4546027 -0.8574333 0.2411317 0.05971091 -0.974316 0.2171245 -0.3325186 0.8192024 -0.4672673 0.9208202 0.3780748 0.09565287 -0.6276583 0.3509969 0.6948713 0.6194072 0.1154015 0.7765417 -0.2242484 0.2823526 0.9327324 -0.9733125 -0.213382 0.08444333 -0.6295232 0.3557085 -0.6907764 -0.2125605 -0.9696013 -0.1212074 0.2296106 -0.9304406 0.2855861 -0.3529249 -0.6324304 -0.6895475 0.4712435 -0.8521254 0.2276223 0.1058934 -0.5557384 0.8245855 0.1315835 -0.885439 0.4457392 -0.1896032 0.4460292 0.8747049 0.5801669 0.5630483 0.5885431 -0.7787709 0.6066589 0.1596263 -0.9803881 -0.1591384 -0.1162507 -0.9476367 -0.307878 0.08482885 0.283748 -0.9190305 0.2736241 -0.4765359 0.745396 0.4661529 0.4180707 0.1521767 -0.8955775 -0.9681828 -0.1792521 -0.1746162 -0.9143857 0.3840516 -0.128075 -0.04017072 0.05987417 -0.9973973 0.1706299 -0.9066659 -0.3858008 0.1851478 -0.4394657 0.8789712 0.8843091 0.4078187 -0.2273353 0.5045992 0.2528942 -0.8254842 0.6532548 0.375079 -0.6577035 -0.6928865 0.02720749 -0.7205331 -0.6618983 0.3102493 -0.6823753 0.6859611 -0.4280116 0.5884416 -0.1207277 -0.9681472 0.2193534 0.3639557 0.5088809 -0.7801132 0.106156 0.1514443 0.9827489 -0.1410549 -0.7946456 0.5904589 0.02728468 0.8365672 0.5471844 0.4029344 0.7610557 0.508368 0.7599334 -0.4949477 0.421341 0.8818024 0.469469 0.04498195 0.4191925 0.4737901 0.774468 -0.8062032 -0.5680176 -0.1655062 -0.7968907 -0.5873453 0.1413877 -0.9226399 -0.3251856 0.2073404 -0.8902274 -0.3965424 -0.2241636 -0.7643456 0.1864323 0.6172672 -0.6258932 0.268422 -0.7322618 0.2327629 0.1627379 -0.958821 0.7188137 0.3510799 -0.6000416 0.4737544 0.213921 -0.8542802 0.4129104 0.1548833 -0.8975055 0.1088951 -0.0134074 -0.9939628 0.8300377 0.4241318 0.3621459 0.9116967 0.005349993 0.4108289 -0.2094867 0.9194764 0.3326838 0.1923016 -0.8166503 0.5441529 0.4263113 0.6592518 0.6193915 0.7220643 0.566755 0.3967519 0.9451801 -0.3160074 0.08230417 -0.5300216 0.7387223 0.416373 0.751442 0.6143106 0.2407433 0.7500091 0.6132549 0.2477999 0.7342251 -0.3614206 0.5747075 0.5584183 0.04666054 -0.8282462 0.5544657 0.407914 0.7253785 0.8873054 0.3963098 0.2358549 0.5366107 0.5229023 -0.6622855 -0.3459793 0.6027104 0.7190539 0.8473234 0.485092 0.2161682 0.9036837 0.4156156 0.1030511 -0.1237121 0.9723973 0.1978353 0.4385892 0.1744454 -0.8815942 0.963276 0.2685112 -0.001004159 0.964128 0.2652708 0.009420156 0.05082935 0.9987067 -0.001134514 0.6268368 -0.5355473 -0.5659193 0.5223973 0.6801328 0.5143154 0.5328031 0.7601118 0.3719557 0.9901126 0.07976943 -0.1153866 0.1188389 0.8218604 -0.557156 0.487738 0.5574977 -0.6717945 0.4183673 0.4773381 0.7727335 0.6008473 0.3226182 0.7313686 0.8601842 0.5029469 -0.08442443 0.4311343 -0.3422521 0.8348573 0.9188773 0.03107827 -0.3933177 0.3562539 0.5746992 -0.7367523 0.3609172 0.4060845 0.839544 0.3439114 0.6922916 -0.6343952 0.9808164 0.1949318 -9.36232e-4 0.9795606 0.2010964 0.004602015 0.6565533 0.6407893 -0.3979028 -0.1612066 0.7469956 0.6449885 -0.2083743 -0.1561481 0.9655041 0.8796054 -0.009518146 -0.475609 0.137503 -0.9493399 -0.2825717 0.3916395 -0.9199225 0.01899981 0.7112005 -0.2819041 -0.6439906 0.1531102 -0.5965393 -0.7878438 0.8364883 0.4660879 0.288183 0.990864 -0.09883767 -0.09175825 -0.1907676 -0.6004292 -0.7765904 0.7864959 0.5606354 -0.2590602 0.4159151 0.7853652 0.4584933 -0.2574436 -0.9058861 0.3362935 -0.4823063 0.1617907 -0.8609323 0.6276668 0.06404268 0.7758433 0.9484031 -0.1090139 0.2977375 0.03192746 0.3092417 -0.9504473 -0.06444609 -0.9675364 -0.2443767 0.2634766 -0.6765971 -0.6876019 0.9271538 0.315883 -0.2015035 -0.3391441 0.9346461 -0.1068543 0.6580676 0.5989241 0.4563298 0.1673868 -0.3813436 0.9091528 0.2798858 -0.6321646 -0.7225177 -0.004950821 -0.6825705 -0.7308029 0.08596384 -0.5711375 -0.8163408 0.9044995 -0.41798 -0.08469539 0.07324624 0.5897809 0.8042347 -0.8914025 0.08089274 -0.445935 0.9663795 0.2489984 -0.06411355 0.2342882 0.9387463 0.252714 0.6272814 -0.7528725 -0.1992509 0.1447585 -0.271238 -0.9515644 0.3242275 0.7550635 0.5698735 0.6317891 -0.2769607 -0.7239719 -0.8093873 -0.01236951 -0.5871449 -0.691409 0.4764693 -0.543075 0.6447927 0.6557022 0.3928065 0.0979247 0.981624 0.163784 -0.8789641 0.1051495 -0.4651511 -0.09661096 0.9951754 -0.01709932 -0.4894641 -0.5637339 -0.6653037 0.6251784 0.3424162 -0.701358 -0.08887237 0.1051136 -0.9904811 -0.6301438 0.7683867 -0.1118063 -0.7058957 0.5081495 -0.4934525 -0.1036783 0.5241742 -0.8452765 0.8783811 -0.2441808 -0.4108802 -0.3630065 0.02733039 -0.9313857 -0.7766548 0.5141197 -0.3639892 0.8078124 0.4980098 -0.3153179 -0.6867066 0.6404654 -0.3438579 -0.2553063 -0.9493405 -0.1832252 0.08483153 -0.9199216 -0.3828155 -0.514712 -0.2819055 -0.8096918 -0.7506984 -0.5965393 -0.2838886 0.425232 0.46609 -0.7758466 0.07679867 -0.098836 -0.9921357 -0.7976452 -0.6004317 0.05695384 -0.1225968 0.5606374 -0.8189358 0.5221142 0.7853664 -0.3325605 0.28802 -0.9058847 0.3105114 -0.9299861 0.1617883 0.3300761 0.8706528 0.06404465 -0.487711 0.4535417 -0.109014 -0.8845427 -0.9314231 0.3092412 -0.1918876 -0.251745 -0.9675373 0.02227383 -0.6332645 -0.6765971 -0.375756 -0.04212915 0.3158811 -0.947863 -0.1625658 0.9346457 0.3162434 0.5608518 0.5989267 -0.5716049 0.9243624 -0.3813413 -0.01153397 -0.6649113 -0.6321659 -0.397818 -0.7211528 -0.6825713 -0.1184695 -0.7901183 -0.571138 -0.2225182 0.06918591 -0.4179788 -0.9058184 0.8050584 0.5897823 0.06354427 -0.5899931 0.08089148 0.8033459 0.09991347 0.2489982 -0.9633365 0.2886298 0.9387475 -0.1882711 -0.09051537 -0.7528722 -0.6519129 -0.9134783 -0.2712407 -0.3032918 0.6164201 0.7550652 -0.2233895 -0.606952 -0.2769593 -0.7449181 -0.7153322 -0.01237112 0.6986752 -0.6519823 0.4764665 0.5898295 0.4960005 0.6557039 -0.5692416 0.1779608 0.9816245 -0.0688731 -0.6068305 0.105148 0.7878456 -0.03316062 0.995175 0.09234172 -0.7383731 -0.5637353 0.3701457 -0.5857765 0.3424236 -0.7345828 -0.9912714 0.105113 -0.07957595 -0.2165626 0.7683857 0.6022325 -0.6055176 0.5081461 0.6124835 -0.8506488 0.5241742 -0.04047143 -0.2567322 -0.2441841 -0.9351271 -0.9792929 0.02732646 0.2005957 -0.4898545 0.5141197 0.7040764 -0.1744495 0.4980107 -0.8494426 -0.4548318 0.6404629 0.6188177 -0.2760718 -0.9102993 0.3084471 -0.4345372 -0.8993453 0.04853385 -0.7922732 -0.3337038 0.5108277 -0.3413406 -0.620843 0.70572 -0.7149776 0.5287027 -0.4574719 -0.9874683 -0.1555645 -0.02657234 -0.04633682 -0.6389169 0.7678789 -0.7567685 0.6501237 0.06812232 -0.1795747 0.8225526 -0.5395926 0.1542745 -0.9770421 -0.1469285 0.3654748 0.2225689 0.9038203 -0.4926548 0.05250018 -0.8686398 -0.9043996 -0.1698284 -0.391433 -0.1635349 0.3859987 0.9078885 -0.1148567 -0.9437982 0.3099241 -0.4171438 -0.6833109 0.5992307 -0.9373416 0.3472532 0.02838796 0.3858278 0.9224896 0.01224964 -0.4588512 0.6659591 -0.5881787 -0.06557404 -0.4809737 -0.8742793 -0.434664 -0.6466675 0.6268079 -0.2075703 -0.6999381 0.683375 -0.2888604 -0.6013059 0.7449771 -0.87768 -0.4788497 0.01951366 0.152813 0.6238496 -0.7664593 0.8312566 0.1362572 0.5389308 -0.9595069 0.2624151 -0.1023952 -0.02729976 0.9392789 -0.3420673 -0.6372921 -0.7506824 0.1741682 -0.3456988 -0.3148104 0.8839609 -0.08313721 0.7852099 -0.6136234 -0.7366968 -0.3269528 0.5919288 0.721173 0.0200572 0.6924646 0.6374586 0.5703793 0.5179904 -0.4430738 0.7236704 -0.5291378 0.07793962 0.9640605 -0.2539934 0.8177391 0.1647485 0.5515077 0.2101687 0.9734501 -0.09068554 0.2590758 -0.6198328 0.7407341 -0.7242618 0.3966162 0.5640394 -0.07934105 0.133839 0.9878219 0.61255 0.7875334 0.06762981 0.6545837 0.5976832 0.4629201 0.03542709 0.6428043 0.7652109 -0.90891 -0.3024541 0.287061 0.204319 0.04922288 0.977666 0.7267719 0.5932725 0.3461651 -0.8061259 0.5771802 0.1304759 0.6460798 0.7052235 0.2919601 -0.2428864 -0.967211 0.07422357 -0.09098255 -0.9525059 -0.290611 -0.8721625 -0.3713687 -0.3184618 -0.7257995 -0.6348612 0.2648896 -0.1543812 0.391917 -0.9069551 -0.5200518 -0.1978526 -0.8309034 -0.5608063 -0.6048815 0.5653448 -0.6259699 0.4723545 -0.6205183 0.1626884 0.7561807 -0.6338165 0.4823547 -0.8646544 0.1403806 -0.5613027 0.1788123 0.8080627 0.4034258 0.02879816 -0.9145591 -0.1535319 -0.1906965 -0.9695684 -0.8832362 0.2724059 0.3816922 -0.1166984 -0.9643651 0.237448 -0.6802843 -0.7218526 0.1270512 -0.6198492 0.2171567 -0.7540756 -0.01191759 0.9590761 0.2828974 0.06567245 0.5470906 -0.8344933 0.7621795 -0.3649168 -0.5347132 -0.7220391 -0.6804329 0.1251832 -0.5975419 -0.7031254 0.3854328 -0.7228439 -0.6040206 0.3356425 -0.4512254 -0.5066549 -0.7346404 0.6390659 0.6066586 -0.4728214 -0.00191915 0.1521734 0.988352 -0.5102513 0.1514469 -0.8465857 0.04985558 0.9194782 -0.3899669 -0.4036288 -0.8166465 -0.4125193 -0.8919007 -0.3160066 0.3235009 0.3053119 0.7387248 -0.6008914 -0.9079939 -0.3614216 -0.2119473 -0.1575695 0.0466578 0.9864051 -0.2076964 0.5228989 0.8267037 0.01089298 0.6027131 -0.7978836 0.02886444 0.9723983 -0.2315348 -0.02641648 0.1744408 0.9843132 -0.04562222 0.9987066 0.02244436 -0.3301219 -0.5355504 0.7773065 -0.9308636 0.2560746 -0.2606121 -0.8493762 0.07977002 0.5217249 0.1269158 0.8218576 0.555376 -0.1593672 0.5574952 0.8147399 -0.7445824 0.502945 0.4389116 -0.7426921 -0.3422472 -0.5755652 -0.6676943 0.03107666 0.7437866 -0.01275593 0.5746926 0.81827 -0.6809827 0.4060893 -0.6093883 -0.0446791 0.6922864 0.7202384 -0.1107234 -0.9672101 -0.2285711 0.2731427 -0.9525068 -0.1346255 0.1804369 -0.3713659 -0.9107853 -0.37344 -0.6348582 -0.6763857 0.8723897 0.3919162 -0.2921262 0.7409636 -0.1978513 -0.6417381 -0.6449216 -0.6048794 -0.4671158 0.5167883 0.4723511 -0.7140128 0.6513034 0.7561807 0.06320339 -0.06447172 -0.8646562 0.49821 -0.8848223 0.1788147 -0.4302497 0.9657525 0.02879607 0.2578621 0.9343864 -0.190697 -0.3009265 -0.5130791 0.2724084 -0.8139678 -0.2525812 -0.9643644 -0.07876539 -0.230234 -0.7218521 -0.6526269 0.6496926 0.2171584 -0.7285203 -0.2813587 0.9590767 0.03176444 0.8346598 0.5470882 -0.0635426 0.6456484 -0.3649182 0.6708001 -0.2348204 -0.6804297 -0.694172 -0.4728043 -0.7031236 -0.5311058 -0.4428945 -0.6040177 -0.6625761 0.6564413 -0.5066534 -0.558916 0.565544 0.6066563 0.5586842 -0.976871 0.1521753 0.150218 0.7579682 0.1514481 -0.6344664 0.3929954 0.9194776 -0.01075464 0.3454805 -0.8166475 -0.4623095 -0.4569143 -0.3160052 -0.8314866 0.6407224 0.7387232 0.2091956 0.06967729 -0.3614196 -0.9297962 -0.9989033 0.04665929 -0.003878414 -0.848818 0.5229014 -0.07798838 0.7900539 0.602713 -0.1120349 0.2332206 0.9723979 -0.007110893 -0.9766507 0.174443 0.1253915 -0.02919644 0.9987068 -0.04162245 -0.8188539 -0.535548 -0.206559 0.1142438 0.2560775 -0.9598816 -0.6462316 0.07977235 -0.7589606 -0.5292234 0.8218594 0.2108787 -0.8295587 0.5574975 -0.03207617 -0.5482763 0.5029476 -0.6681594 0.4544038 -0.3422477 -0.8224255 -0.8376849 0.03107947 -0.5452688 -0.8104826 0.5746944 0.1133322 0.4973194 0.40609 -0.7666578 -0.7185292 0.6922906 0.06670385 0.2585581 -0.9611229 -0.0969038 0.2607871 -0.9574573 0.1235542 0.7796048 -0.625957 -0.01985687 0.4985944 -0.8012917 -0.3306593 0.4079468 0.5302648 0.7432352 0.7590712 -0.445926 0.4743005 0.3355243 -0.7912011 -0.5112966 0.736428 0.5838032 0.3418299 -0.06477272 0.8895508 0.4522212 -0.2276011 -0.9735293 0.02093464 0.1796448 0.2362531 -0.9549409 -0.02913546 0.0762121 0.9966659 0.54067 -0.3971748 0.7415714 0.6713997 0.286229 -0.6835902 0.1560975 -0.974318 -0.1622898 0.4891372 -0.8425656 -0.2254508 0.6051634 0.7551504 0.2520418 -0.2055775 0.9680809 -0.1433781 0.117021 0.7375953 0.6650257 -0.4427156 -0.4790197 0.7579861 0.518055 -0.8217074 -0.2375205 0.3923386 -0.8422673 -0.3696702 0.4865949 -0.7855904 -0.3821951 0.6080983 -0.7150117 0.3449274 -0.406011 0.7903279 0.4588431 -0.4209457 0.3204184 -0.8486087 0.807946 0.06153708 0.5860345 -0.07750195 0.9668061 0.2434734 0.4515268 -0.8833391 0.1258403 0.6541781 -0.5781276 -0.4876673 -0.1655416 0.8745895 0.4557294 0.7786498 -0.619571 -0.09917736 -0.2645009 0.1210298 -0.9567607 -0.2161614 0.7248004 -0.6541702 0.1339653 0.7855195 0.6041626 -0.1090378 0.9837371 0.1427306 -0.3995224 0.3481389 -0.8480455 -0.1291393 0.9915643 -0.01109385 0.1133881 -0.7393493 -0.6637061 0.9781873 0.1864226 -0.09163159 0.6136272 -0.03318375 -0.7888983 -0.3444681 0.8986871 -0.2714836 -0.2484887 0.7532754 -0.6089577 0.4041201 0.6703537 -0.6223448 0.7793307 -0.5983544 0.1860532 0.3524593 -0.05345755 -0.9342991 -0.3470667 0.7647706 -0.5428356 0.8213943 0.472605 0.3193054 -0.2956463 0.8413124 -0.4525338 0.1740145 -0.9672115 0.1849887 -0.2203782 -0.9525071 0.2101517 0.1002177 -0.371369 0.9230609 0.5586386 -0.6348617 0.5337356 -0.7450905 0.3919145 0.5396696 -0.5151181 -0.1978563 0.8339702 0.7551061 -0.6048809 0.2528515 -0.2795866 0.4723498 0.8358929 -0.6403965 0.756179 0.1344833 -0.08748358 -0.8646544 -0.4946913 0.9730011 0.1788146 0.1459255 -0.9986696 0.02879631 0.04277533 -0.8016191 -0.1906984 0.5666048 0.7330353 0.2724049 0.6232616 0.2645771 -0.9643645 -3.85508e-4 0.4148841 -0.7218537 0.5538938 -0.4020699 0.2171524 0.8894855 0.2589806 0.959077 -0.1144561 -0.7774515 0.5470878 0.3102646 -0.8167175 -0.3649156 -0.4470003 0.4316844 -0.6804344 0.5921636 0.6100058 -0.7031252 0.3653871 0.6207835 -0.6040212 0.4997863 -0.4592337 -0.5066561 0.7296602 -0.7067467 0.6066603 -0.3639674 0.8872317 0.1521756 -0.4355025 -0.5335202 0.1514436 0.8321183 -0.3717916 0.9194768 0.1278027 -0.1914022 -0.8166511 0.5444688 0.684679 -0.316009 0.6567748 -0.6739616 0.7387231 -0.007990658 0.2115934 -0.361421 0.9080766 0.9543424 0.04666066 -0.2950482 0.8332914 0.5229014 -0.1794425 -0.7203862 0.6027105 0.3431966 -0.2204182 0.9723977 0.0765416 0.8944477 0.1744425 -0.4117441 0.04030954 0.9987065 0.03098911 0.8431504 -0.5355489 -0.04780006 0.1780656 0.256077 0.9501144 0.8436417 0.07976973 0.5309476 0.4419309 0.8218603 -0.3595035 0.8011825 0.5574972 -0.2174935 0.7230135 0.5029456 0.4736004 -0.1876361 -0.3422494 0.9206834 0.9624216 0.03107744 0.2697756 0.7394909 0.5746957 -0.3505395 -0.2452736 0.4060834 0.8803051 0.6656927 0.6922907 -0.2785442 0.2515525 -0.967211 0.03499191 -0.03989899 -0.9525071 0.3018909 0.65686 -0.3713681 0.656217 0.7698462 -0.6348605 0.06549006 -0.2420288 0.3919137 0.8875954 0.1216545 -0.1978566 0.9726526 0.7467688 -0.6048798 -0.2765082 0.3063369 0.4723488 0.826465 -0.4145382 0.7561795 0.5063109 -0.3783374 -0.8646537 -0.330507 0.84946 0.1788158 -0.4964299 -0.751133 0.0287953 0.6595225 -0.2691726 -0.1907 0.9440231 0.9618342 0.2724067 0.02587759 0.2058624 -0.9643643 -0.1661993 0.6705029 -0.7218526 0.1713325 0.2445282 0.2171527 0.9450135 0.1299752 0.9590774 -0.2515492 -0.4110824 0.5470869 0.7291826 -0.9164994 -0.3649188 0.1638997 0.7075857 -0.680433 0.1906129 0.7043006 -0.7031247 -0.09785956 0.7969692 -0.6040199 7.68335e-5 0.09978145 -0.5066576 0.8563538 -0.7787696 0.606661 0.1596259 0.4180713 0.1521776 -0.8955771 0.1061556 0.1514434 0.9827492 -0.2094886 0.9194756 0.3326848 0.1923013 -0.8166506 0.5441525 0.9451805 -0.3160064 0.08230364 -0.5300227 0.7387223 0.4163717 0.7342251 -0.3614206 0.5747075 0.558419 0.04666078 -0.8282459 0.5366104 0.5229019 -0.6622861 -0.3459803 0.6027098 0.719054 -0.1237121 0.9723973 0.1978355 0.4385889 0.1744455 -0.8815943 0.0508297 0.9987067 -0.001134335 0.6268367 -0.5355474 -0.5659195 0.7344663 0.2560694 0.6284804 0.9901121 0.07977187 -0.1153882 0.118838 0.8218603 -0.5571563 0.4877377 0.5574987 -0.671794 0.8601846 0.5029464 -0.08442354 0.4311351 -0.3422527 0.8348568 0.9188773 0.03107899 -0.3933174 0.356255 0.574696 -0.7367543 0.360918 0.406085 0.8395435 0.3439117 0.6922914 -0.6343954 + + + + + + + + + + 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.2945209 0.7942254 0.2397847 0.7850985 0.2436928 0.7161976 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9149239 0.2896522 0.9350683 0.3402228 0.8852869 0.3379681 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.8280702 0.6559681 0.7861563 0.676423 0.7389528 0.6582456 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0.01455533 0.1286629 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.2945209 0.7942254 0.2397847 0.7850985 0.2436928 0.7161976 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05874407 0.9108197 0.05877703 0.813201 0.1115384 0.8442582 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9515935 0.759024 0.9736682 0.8268503 0.923352 0.8424654 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6833251 0 0.6879565 0.04913663 0.6314049 0.05666166 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.225188 0.7942254 0.2646147 0.8316428 0.2600923 0.8880816 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.854056 0.759024 0.9136443 0.8133101 0.8999323 0.8778077 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9149239 0.2896522 0.9350683 0.3402228 0.8852869 0.3379681 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.8280702 0.6559681 0.7861563 0.676423 0.7389528 0.6582456 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0.01455533 0.1286629 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4445233 0.9372683 0.3712257 0.9816631 0.3864287 0.9249993 0.7071035 0.3017868 0.6584097 0.5030993 0.6442623 0.4356029 0.5320112 0.6610466 0.6252335 0.7255471 0.4473347 0.7297828 0.8634828 0.5724628 0.852563 0.5250504 0.8634889 0.5215497 0.3864287 0.9249993 0.3366954 0.9392734 0.3690291 0.8301575 0.5409097 0.327716 0.4699992 0.3613697 0.508535 0.2402796 0.6252335 0.7255471 0.6207951 0.7738727 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2397847 0.7850985 0.9352307 0.5030993 0.8829054 0.4498766 0.9217579 0.4469904 0.5643269 0.5619001 0.4688332 0.3928911 0.5409097 0.327716 0.9403303 0.4515968 0.971183 0.4541858 0.9687955 0.4782974 0.7055709 0.1687021 0.7071035 0.3017868 0.6442623 0.4356029 0.4473347 0.7297828 0.5326485 0.7746021 0.4318631 0.82753 0.4603343 0.4925716 0.4688332 0.3928911 0.5643269 0.5619001 0.3015384 0.6705079 0.2436928 0.7161976 0.1656704 0.6761885 0.7729097 0.07328593 0.6879565 0.04913663 0.7588258 0.01246494 0.8485825 0.05001091 0.858704 0.09925681 0.82014 0.1111181 0.3302628 0.7238372 0.349651 0.6411093 0.3864775 0.7072693 0.6901841 0.6604264 0.5629815 0.6477982 0.6746092 0.6456211 0.4312682 0.6296764 0.4251476 0.6843706 0.3864775 0.7072693 0.1018064 0.4703353 0.03475892 0.5790455 0.0815162 0.484135 0.05877703 0.813201 0.1115384 0.8442582 0.111521 0.895769 0.5326485 0.7746021 0.511407 0.8431234 0.4318631 0.82753 0.6052546 0.54115 0.6005864 0.4603395 0.6312464 0.5215625 0.4688332 0.3928911 0.4699992 0.3613697 0.5409097 0.327716 0.6314049 0.5724629 0.6314327 0.5030993 0.6698976 0.5331548 0.465847 0.5823894 0.4982739 0.6371755 0.4312682 0.6296764 0.9736682 0.823008 0.9923636 0.8548582 0.9799624 0.8741174 0.03475892 0.5790455 0.004119396 0.5986681 4.65332e-4 0.5835576 0.0815162 0.484135 4.65332e-4 0.5835576 0.03335434 0.5015231 0.4603343 0.4925716 0.3784537 0.3792158 0.4421396 0.411386 0.2179645 0.8843737 0.2600923 0.8880816 0.2647069 0.9126251 0.8280702 0.8891744 0.7762902 0.8890668 0.8278625 0.7610007 0.5440917 0.6143988 0.5629815 0.6477982 0.4982739 0.6371755 1 0.3853698 0.9999504 0.4397937 0.971183 0.4186192 0.05945396 0 0.06170457 0.1256538 0.03556907 0.03967773 0.8485825 0.05001091 0.7588258 0.01246494 0.8156241 0.009393036 0.9350683 0.3402228 0.8829054 0.4498766 0.858704 0.3938493 0.9178071 0.5572614 0.9472836 0.6067261 0.947299 0.6936168 0.9176599 0.6042728 0.9178071 0.759024 0.8729462 0.6857206 0.5440917 0.6143988 0.512703 0.6127135 0.5076183 0.5755656 0.4312682 0.6296764 0.4638227 0.6601285 0.4251476 0.6843706 0.4473347 0.7297828 0.4318631 0.82753 0.3823177 0.7331182 0.0538454 0.7857549 0.01310884 0.7280395 0.1115384 0.7433003 0.0538454 0.7857549 0.001631319 0.8132011 0.01310884 0.7280395 0.7055709 0.1687021 0.6526677 0.1427591 0.6314049 0.05666166 0.9736682 0.8268503 0.923352 0.8424654 0.9138454 0.8132555 0.3781604 0.2292649 0.3302628 0.2329612 0.3384057 0.1871345 0.415529 0.1881387 0.3781604 0.2292649 0.3947749 0.1135763 0.3781604 0.2292649 0.4143361 0.2649131 0.3302628 0.2329612 0.1028066 0.346038 0.09667146 0.2737874 0.1727656 0.3367694 0.5726706 0.8451589 0.511407 0.8431234 0.5326485 0.7746021 0.5440917 0.6143988 0.6746092 0.6456211 0.5629815 0.6477982 0.5629815 0.6477982 0.6027385 0.6733846 0.5320112 0.6610466 0.511407 0.8431234 0.3864287 0.9249993 0.4318631 0.82753 0.4986227 0.9219498 0.3864287 0.9249993 0.511407 0.8431234 0.5643269 0.5619001 0.6052546 0.54115 0.6178627 0.5755656 0.7055709 0.1687021 0.6442623 0.4356029 0.631789 0.2551845 0.7464634 0.2143717 0.7071035 0.3017868 0.7055709 0.1687021 0.3302628 0.2329612 0.4141897 0.3116226 0.3572282 0.3021203 0.508535 0.2402796 0.4141897 0.3116226 0.4143361 0.2649131 0.2877599 0.3468021 0.2532485 0.255576 0.3302628 0.2891881 0.2532485 0.255576 0.2748188 0.1775573 0.3302628 0.2891881 0.465847 0.5823894 0.4312682 0.6296764 0.3524271 0.6124866 0.2532485 0.255576 0.2268384 0.1819047 0.2748188 0.1775573 0.2268384 0.1819047 0.2320041 0.1470512 0.2748188 0.1775573 0.947299 0.6915957 0.9807965 0.649501 0.9817211 0.7165493 0.6027385 0.6733846 0.6846091 0.7071572 0.6252335 0.7255471 0.6207951 0.7738727 0.6252335 0.7255471 0.6846091 0.7071572 0.6901841 0.6604264 0.7330856 0.6496022 0.7250938 0.6923875 0.6088518 0.7935531 0.5726706 0.8451589 0.5921916 0.7836278 0.6879565 0.04913663 0.6314049 0.05666166 0.6400691 0.008657574 0.7526732 0.6269338 0.7457163 0.6037476 0.7883881 0.6201798 0.0815162 0.484135 0.03475892 0.5790455 4.65332e-4 0.5835576 0.2179645 0.8843737 0.225188 0.7942254 0.2646147 0.8316428 0.01310884 0.7280395 0 0.7048346 0.1114476 0.5986681 0.415529 0.1881387 0.508535 0.2402796 0.4143361 0.2649131 0.6314049 0.006313979 0.6068789 0.02894526 0.5760803 0 0.7729097 0.07328593 0.7464634 0.2143717 0.7055709 0.1687021 0.5760803 0 0.6068789 0.02894526 0.4773114 0.05282545 0.5466821 0.1708915 0.506429 0.1381797 0.6068789 0.02894526 0.5466821 0.1708915 0.508535 0.2402796 0.506429 0.1381797 0.5488645 0.2875979 0.5409097 0.327716 0.508535 0.2402796 0.1727656 0.3367694 0.2532485 0.255576 0.1942579 0.365406 0.09667146 0.2737874 0.1129631 0.2175679 0.1631614 0.1980908 0.1129631 0.2175679 0.05945396 0 0.1631614 0.1980908 0.1631614 0.1980908 0.05945396 0 0.1220105 0.007707238 0.1018064 0.4703353 0.06066149 0.5897843 0.03475892 0.5790455 0.947299 0.6915957 0.9586271 0.6244697 0.9807965 0.649501 0.5726706 0.8451589 0.537976 0.9089362 0.5380318 0.8876333 0.9800919 0.3706222 0.9802727 0.2385389 0.987938 0.3222241 0.6264134 0.05788534 0.5466821 0.1708915 0.6068789 0.02894526 0.8485825 0.05001091 0.7729097 0.07328593 0.7588258 0.01246494 0.1018064 0.4703353 0.1727656 0.3367694 0.1942579 0.365406 0.5488645 0.2875979 0.6005864 0.4603395 0.5409097 0.327716 0.5409097 0.327716 0.6005864 0.4603395 0.6052546 0.54115 0.7889372 0.966069 0.7888768 0.8891744 0.8280342 0.9306059 0.4986227 0.9219498 0.4445233 0.9372683 0.3864287 0.9249993 0.4141897 0.3116226 0.508535 0.2402796 0.4699992 0.3613697 0.465847 0.5823894 0.512703 0.6127135 0.4982739 0.6371755 0.9473769 0.759024 0.947299 0.6915957 0.9817211 0.7165493 0.5726706 0.8451589 0.6088518 0.7935531 0.621499 0.8493218 0.2067765 0.7942254 0.2160103 0.8008353 0.2068021 0.9238957 0.3302628 0.6875545 0.2945209 0.7942254 0.3015384 0.6705079 0.3864775 0.7072693 0.3578419 0.7348905 0.3302628 0.7238372 0.1942579 0.365406 0.2532485 0.255576 0.2877599 0.3468021 0.0815162 0.484135 0.1727656 0.3367694 0.1018064 0.4703353 0.1631614 0.1980908 0.2141177 0.1161733 0.2268384 0.1819047 0.7330856 0.6496022 0.6901841 0.6604264 0.6746092 0.6456211 0.9473075 0.5193807 0.9861252 0.5446591 0.9861217 0.5896727 0.349651 0.6411093 0.4312682 0.6296764 0.3864775 0.7072693 0.5380318 0.8876333 0.4986227 0.9219498 0.511407 0.8431234 0.8155701 0.1905517 0.839717 0.2241519 0.798556 0.2383394 0.01310884 0.7280395 0.001631319 0.8132011 0 0.7048346 0.6052546 0.54115 0.5643269 0.5619001 0.5409097 0.327716 0.4251476 0.6843706 0.3823177 0.7331182 0.3864775 0.7072693 0.4251476 0.6843706 0.4638227 0.6601285 0.4473347 0.7297828 0.4638227 0.6601285 0.5320112 0.6610466 0.4473347 0.7297828 0.03475892 0.5790455 0.06066149 0.5897843 0.004119396 0.5986681 0.04926902 0.813201 0.0518192 0.9090555 0 0.9090462 0.6314049 0.006313979 0.6264134 0.05788534 0.6068789 0.02894526 0.7588258 0.01246494 0.6879565 0.04913663 0.6833251 0 0.3026489 0.8942928 0.3302628 0.8943386 0.3033998 0.9719785 0.4015532 0.1093797 0.506429 0.1381797 0.415529 0.1881387 0.1942579 0.365406 0.2877599 0.3468021 0.2810711 0.3958491 0.6901841 0.6604264 0.6027385 0.6733846 0.5629815 0.6477982 0.3864287 0.9249993 0.3712257 0.9816631 0.3366954 0.9392734 0.9712111 0.195822 0.9712116 0.09061938 0.9940676 0.1720778 0.4251476 0.6843706 0.4473347 0.7297828 0.3823177 0.7331182 0.3302628 0.6875545 0.3194696 0.6567412 0.3301954 0.598941 0.5726706 0.8451589 0.5380318 0.8876333 0.511407 0.8431234 0.6526677 0.1427591 0.7055709 0.1687021 0.631789 0.2551845 0.7729097 0.07328593 0.8155701 0.1905517 0.7464634 0.2143717 0.7561041 0.5724628 0.7561357 0.5168259 0.799849 0.5341348 0.3947749 0.1135763 0.3781604 0.2292649 0.3384057 0.1871345 0.415529 0.1881387 0.506429 0.1381797 0.508535 0.2402796 0.3823177 0.7331182 0.4318631 0.82753 0.3690291 0.8301575 0.8482692 0.5724628 0.8308894 0.5185565 0.852563 0.51855 0.1614423 0.8466095 0.2057902 0.8558299 0.2066536 0.8931387 0.3302628 0.2329612 0.4143361 0.2649131 0.4141897 0.3116226 0.4141897 0.3116226 0.4699992 0.3613697 0.4688332 0.3928911 0.1727656 0.3367694 0.2268384 0.1819047 0.2532485 0.255576 0.5320112 0.6610466 0.6027385 0.6733846 0.6252335 0.7255471 0.3302628 0.6875545 0.3015384 0.6705079 0.3194696 0.6567412 0.9922246 0.759024 0.9923636 0.8548582 0.9736682 0.823008 0.08409053 0.3730608 0.0815162 0.484135 0.03335434 0.5015231 0.1028066 0.346038 0.0815162 0.484135 0.08409053 0.3730608 0.4603343 0.4925716 0.4421396 0.411386 0.4688332 0.3928911 0.4421396 0.411386 0.4141897 0.3116226 0.4688332 0.3928911 0.3302628 0.6875545 0.3257824 0.7562578 0.2945209 0.7942254 0.6027385 0.6733846 0.6901841 0.6604264 0.6846091 0.7071572 0.05945396 0 0.1129631 0.2175679 0.06170457 0.1256538 0.8280702 0.881254 0.854056 0.759024 0.9136443 0.8133101 0.3712257 0.9816631 0.3305971 0.9847194 0.3366954 0.9392734 0.6879565 0.04913663 0.7055709 0.1687021 0.6314049 0.05666166 0.6879565 0.04913663 0.7729097 0.07328593 0.7055709 0.1687021 0.5380318 0.8876333 0.537976 0.9089362 0.4986227 0.9219498 0.9350683 0.3402228 0.9217579 0.4469904 0.8829054 0.4498766 0.7464634 0.2143717 0.7666487 0.3105279 0.7071035 0.3017868 0.3798652 0.0781821 0.4015532 0.1093797 0.3610486 0.09846651 0.4773114 0.05282545 0.4015532 0.1093797 0.3798652 0.0781821 0.4773114 0.05282545 0.506429 0.1381797 0.4015532 0.1093797 0.4773114 0.05282545 0.6068789 0.02894526 0.506429 0.1381797 0.5466821 0.1708915 0.5488645 0.2875979 0.508535 0.2402796 0.1685547 0.4274127 0.1942579 0.365406 0.2810711 0.3958491 0.0815162 0.484135 0.1028066 0.346038 0.1727656 0.3367694 0.9913349 0.9432765 0.9736682 0.9727531 0.9738537 0.8741174 0.1727656 0.3367694 0.1631614 0.1980908 0.2268384 0.1819047 0.1727656 0.3367694 0.09667146 0.2737874 0.1631614 0.1980908 0.2141177 0.1161733 0.1631614 0.1980908 0.1220105 0.007707238 0.7457163 0.6037476 0.7332697 0.5755656 0.7883881 0.6201798 0.7883881 0.6201798 0.7332697 0.5755656 0.7770158 0.5866931 0.799849 0.559322 0.799861 0.5210149 0.8308894 0.5507825 0.537976 0.9089362 0.5726706 0.8451589 0.6010219 0.8785287 0.858704 0.09925681 0.8418805 0.1708785 0.82014 0.1111181 0.8852869 0.3379681 0.858704 0.3938493 0.8750211 0.3121966 0.9350683 0.3402228 0.8852869 0.3379681 0.8750211 0.3121966 0.9392619 0.04739958 0.9712111 0.06998169 0.971194 0.1456199 0.7399734 0.7610007 0.7330856 0.7253506 0.7861563 0.676423 0.7861563 0.676423 0.7330856 0.7253506 0.7389528 0.6582456 0.7526732 0.6269338 0.8280702 0.6559681 0.7861563 0.676423 0.1612121 0.5986681 0.1614423 0.748671 0.1171672 0.7249614 0.839717 0.2241519 0.8105787 0.2956115 0.798556 0.2383394 0.1614423 0.8914955 0.1304914 0.9676789 0.116988 0.8915266 0.7762649 0.8976454 0.7331814 0.8688613 0.7330856 0.7874737 0.7666487 0.3105279 0.7464634 0.2143717 0.798556 0.2383394 0.9094594 0.2376047 0.9093615 0.2896522 0.858704 0.2112525 0.858704 0.2112525 0.9093615 0.2896522 0.8604477 0.2767071 0.8280702 0.881254 0.8999323 0.8778077 0.9138126 0.8968611 0.3302628 0.7942254 0.3302357 0.8942928 0.2647069 0.8631249 0.9800919 0.2887045 0.9479931 0.3276295 0.9479057 0.2783952 0.9800919 0.2887045 0.9479057 0.2783952 0.9782846 0.2645304 0.9352307 0.2654579 0.9479057 0.2783952 0.9479931 0.3276295 0.9403303 0.4515968 0.9352672 0.3706222 0.9688126 0.4162762 0.2196756 0.7834898 0.1656704 0.6761885 0.2436928 0.7161976 0.9249897 0.2363813 0.9095172 0.2896522 0.9094594 0.1988971 0.9999504 0.4397937 0.9961513 0.5030993 0.9801301 0.4913068 0.06170457 0.1256538 0.1135917 0.2381291 0.04345244 0.1913028 0.06170457 0.1256538 0.01455533 0.1286629 0 0.08078104 0.7399826 0.3558855 0.7323576 0.3847679 0.7143389 0.3521211 0.7323576 0.3847679 0.6933686 0.4388177 0.7143389 0.3521211 0.9736682 0.8268503 0.9515173 0.9773334 0.9138126 0.9072722 0.7071035 0.3017868 0.7666487 0.3105279 0.7399826 0.3558855 0.9392282 0.1215494 0.9064723 0.1646377 0.858704 0.09004449 0.7560843 0.5638503 0.7149434 0.5724628 0.7149555 0.5407623 0.1154862 0.8914955 0.1153147 0.748671 0.1613689 0.7942423 0.1614423 0.8466095 0.1637449 0.7942254 0.2067765 0.8333919 0.7149434 0.5148839 0.7120677 0.5519172 0.6698976 0.5148258 0.6698976 0.5148258 0.7120677 0.5519172 0.6922641 0.5724628 0.9064723 0.1646377 0.9013506 0.195822 0.8588156 0.1695974 0.8433437 0.5755656 0.8728559 0.590752 0.8280702 0.6215223 0.8728559 0.590752 0.8729462 0.6857206 0.8280702 0.6215223 0.858704 0.09004449 0.9064723 0.1646377 0.8588156 0.1695974 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2436928 0.7161976 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.8750211 0.3121966 0.9149239 0.2896522 0.8852869 0.3379681 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7526732 0.6269338 0.8280702 0.6559681 0.7389528 0.6582456 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0 0.08078104 0.03556907 0.03967773 0.01455533 0.1286629 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.3015384 0.6705079 0.2945209 0.7942254 0.2436928 0.7161976 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.111521 0.895769 0.05874407 0.9108197 0.1115384 0.8442582 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9138454 0.8132555 0.9515935 0.759024 0.923352 0.8424654 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6400691 0.008657574 0.6833251 0 0.6314049 0.05666166 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2179645 0.8843737 0.225188 0.7942254 0.2600923 0.8880816 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8280702 0.881254 0.854056 0.759024 0.8999323 0.8778077 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.8750211 0.3121966 0.9149239 0.2896522 0.8852869 0.3379681 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7526732 0.6269338 0.8280702 0.6559681 0.7389528 0.6582456 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0 0.08078104 0.03556907 0.03967773 0.01455533 0.1286629 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 0.4318631 0.82753 0.3864287 0.9249993 0.3690291 0.8301575 0.4473347 0.7297828 0.6252335 0.7255471 0.5326485 0.7746021 0.2436928 0.7161976 0.3015384 0.6705079 0.2397847 0.7850985 0.9352307 0.5030993 0.9403303 0.4515968 0.9687955 0.4782974 0.1614423 0.5986681 0.3015384 0.6705079 0.1656704 0.6761885 0.7729097 0.07328593 0.8485825 0.05001091 0.82014 0.1111181 0.05874407 0.9108197 0.05877703 0.813201 0.111521 0.895769 0.6698846 0.5656284 0.6314049 0.5724629 0.6698976 0.5331548 0.2253352 0.9235765 0.2179645 0.8843737 0.2647069 0.9126251 0.512703 0.6127135 0.5440917 0.6143988 0.4982739 0.6371755 0.8852869 0.3379681 0.9350683 0.3402228 0.858704 0.3938493 0.917843 0.759024 0.9178071 0.5572614 0.947299 0.6936168 0.8728559 0.590752 0.9176599 0.6042728 0.8729462 0.6857206 0.9515935 0.759024 0.9736682 0.8268503 0.9138454 0.8132555 0.5921916 0.7836278 0.5726706 0.8451589 0.5326485 0.7746021 0.6846091 0.7071572 0.6901841 0.6604264 0.7250938 0.6923875 0.6833251 0 0.6879565 0.04913663 0.6400691 0.008657574 0.8280702 0.6559681 0.7526732 0.6269338 0.7883881 0.6201798 0.2600923 0.8880816 0.2179645 0.8843737 0.2646147 0.8316428 0.3781604 0.2292649 0.415529 0.1881387 0.4143361 0.2649131 0.8280702 0.9764055 0.7889372 0.966069 0.8280342 0.9306059 0.6010219 0.8785287 0.5726706 0.8451589 0.621499 0.8493218 0.947299 0.6244698 0.9473075 0.5193807 0.9861217 0.5896727 0.7464634 0.2143717 0.8155701 0.1905517 0.798556 0.2383394 0.7998297 0.5682783 0.7561041 0.5724628 0.799849 0.5341348 0.1634581 0.9337109 0.1614423 0.8466095 0.2066536 0.8931387 0.8999323 0.8778077 0.8280702 0.881254 0.9136443 0.8133101 0.8308827 0.5724629 0.799849 0.559322 0.8308894 0.5507825 0.581386 0.9146242 0.537976 0.9089362 0.6010219 0.8785287 0.9149239 0.2896522 0.9350683 0.3402228 0.8750211 0.3121966 0.9392282 0.195822 0.9392619 0.04739958 0.971194 0.1456199 0.7389528 0.6582456 0.7526732 0.6269338 0.7861563 0.676423 0.117023 0.6310496 0.1612121 0.5986681 0.1171672 0.7249614 0.7761039 0.7610007 0.7762649 0.8976454 0.7330856 0.7874737 0.8105787 0.2956115 0.7666487 0.3105279 0.798556 0.2383394 0.8543749 0.9173622 0.8280702 0.881254 0.9138126 0.8968611 0.2647212 0.8103218 0.3302628 0.7942254 0.2647069 0.8631249 0.9354174 0.3706222 0.9352307 0.2654579 0.9479931 0.3276295 0.971183 0.4541858 0.9403303 0.4515968 0.9688126 0.4162762 0.2397847 0.7850985 0.2196756 0.7834898 0.2436928 0.7161976 0.971183 0.4186192 0.9999504 0.4397937 0.9801301 0.4913068 0.01455533 0.1286629 0.06170457 0.1256538 0.04345244 0.1913028 0.03556907 0.03967773 0.06170457 0.1256538 0 0.08078104 0.923352 0.8424654 0.9736682 0.8268503 0.9138126 0.9072722 0.7143389 0.3521211 0.7071035 0.3017868 0.7399826 0.3558855 0.8613898 0 0.9392282 0.1215494 0.858704 0.09004449 0.7561041 0.5121943 0.7560843 0.5638503 0.7149555 0.5407623 0.1614423 0.8554193 0.1154862 0.8914955 0.1613689 0.7942423 0.2057902 0.8558299 0.1614423 0.8466095 0.2067765 0.8333919 + + + + + + + + + + + + + + + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +

77 0 0 43 0 1 35 0 2 60 1 3 22 1 4 0 1 5 23 2 6 37 2 7 12 2 8 41 3 9 76 3 10 71 3 11 35 4 12 33 4 13 46 4 14 86 5 15 34 5 16 45 5 17 37 6 18 72 6 19 58 6 20 67 7 21 27 7 22 117 7 23 71 8 24 44 8 25 41 8 26 1 9 27 70 9 28 86 9 29 28 10 30 111 10 31 114 10 32 29 11 33 60 11 34 0 11 35 12 12 36 58 12 37 47 12 38 39 13 39 70 13 40 1 13 41 67 14 42 119 14 43 115 14 44 4 15 45 16 15 46 77 15 47 78 16 48 97 16 49 95 16 50 81 17 51 54 17 52 80 17 53 74 18 54 57 18 55 90 18 56 63 19 57 11 19 58 80 19 59 39 20 60 68 20 61 69 20 62 88 21 63 110 21 64 109 21 65 58 22 66 52 22 67 47 22 68 48 23 69 0 23 70 22 23 71 70 24 72 34 24 73 86 24 74 49 25 75 59 25 76 114 25 77 36 26 78 21 26 79 63 26 80 24 27 81 26 27 82 5 27 83 68 28 84 5 28 85 26 28 86 69 29 87 26 29 88 25 29 89 39 30 90 87 30 91 40 30 92 41 31 93 99 31 94 101 31 95 28 32 96 59 32 97 71 32 98 18 33 99 57 33 100 21 33 101 3 34 102 42 34 103 27 34 104 3 35 105 13 35 106 42 35 107 78 36 108 77 36 109 30 36 110 79 37 111 44 37 112 96 37 113 60 38 114 123 38 115 120 38 116 22 39 117 49 39 118 127 39 119 18 40 120 56 40 121 32 40 122 63 41 123 64 41 124 11 41 125 12 42 126 47 42 127 51 42 128 75 43 129 2 43 130 13 43 131 75 44 132 88 44 133 2 44 134 29 45 135 85 45 136 15 45 137 49 46 138 121 46 139 122 46 140 83 47 141 10 47 142 54 47 143 6 48 144 83 48 145 81 48 146 83 49 147 8 49 148 10 49 149 31 50 150 88 50 151 89 50 152 38 51 153 52 51 154 58 51 155 18 52 156 90 52 157 57 52 158 57 53 159 65 53 160 23 53 161 52 54 162 35 54 163 47 54 164 30 55 165 35 55 166 52 55 167 1 56 168 48 56 169 5 56 170 29 57 171 0 57 172 50 57 173 20 58 174 60 58 175 29 58 176 10 59 177 61 59 178 9 59 179 45 60 180 61 60 181 8 60 182 9 61 183 62 61 184 10 61 185 62 62 186 36 62 187 10 62 188 36 63 189 63 63 190 10 63 191 62 64 192 32 64 193 36 64 194 32 65 195 56 65 196 36 65 197 21 66 198 23 66 199 64 66 200 65 67 201 73 67 202 37 67 203 72 68 204 37 68 205 73 68 206 74 69 207 3 69 208 27 69 209 67 70 210 38 70 211 66 70 212 16 71 213 15 71 214 17 71 215 79 72 216 94 72 217 92 72 218 69 73 219 68 73 220 26 73 221 41 74 222 79 74 223 102 74 224 2 75 225 76 75 226 67 75 227 6 76 228 45 76 229 8 76 230 17 77 231 84 77 232 33 77 233 4 78 234 20 78 235 29 78 236 33 79 237 84 79 238 46 79 239 85 80 240 55 80 241 84 80 242 85 81 243 45 81 244 55 81 245 50 82 246 86 82 247 45 82 248 89 83 249 62 83 250 87 83 251 88 84 252 75 84 253 19 84 254 75 85 255 3 85 256 19 85 257 19 86 258 3 86 259 90 86 260 39 87 261 1 87 262 68 87 263 21 88 264 57 88 265 23 88 266 38 89 267 78 89 268 7 89 269 14 90 270 25 90 271 53 90 272 15 91 273 85 91 274 84 91 275 78 92 276 4 92 277 77 92 278 39 93 279 89 93 280 87 93 281 50 94 282 0 94 283 86 94 284 86 95 285 0 95 286 48 95 287 44 96 288 71 96 289 106 96 290 30 97 291 77 97 292 35 97 293 61 98 294 45 98 295 34 98 296 36 99 297 56 99 298 21 99 299 63 100 300 21 100 301 64 100 302 38 101 303 67 101 304 92 101 305 71 102 306 76 102 307 28 102 308 72 103 309 27 103 310 67 103 311 80 104 312 82 104 313 81 104 314 87 105 315 62 105 316 9 105 317 69 106 318 89 106 319 39 106 320 19 107 321 18 107 322 32 107 323 3 108 324 74 108 325 90 108 326 53 109 327 132 109 328 129 109 329 54 110 330 63 110 331 80 110 332 7 111 333 30 111 334 52 111 335 44 112 336 104 112 337 103 112 338 2 113 339 88 113 340 76 113 341 48 114 342 1 114 343 86 114 344 11 115 345 51 115 346 80 115 347 11 116 348 64 116 349 12 116 350 64 117 351 23 117 352 12 117 353 68 118 354 1 118 355 5 118 356 28 119 357 14 119 358 53 119 359 17 120 360 15 120 361 84 120 362 77 121 363 16 121 364 43 121 365 81 122 366 82 122 367 6 122 368 82 123 369 55 123 370 6 123 371 87 124 372 9 124 373 61 124 374 74 125 375 65 125 376 57 125 377 35 126 378 43 126 379 33 126 380 10 127 381 63 127 382 54 127 383 11 128 384 12 128 385 51 128 386 72 129 387 66 129 388 58 129 389 38 130 390 7 130 391 52 130 392 85 131 393 29 131 394 50 131 395 4 132 396 44 132 397 20 132 398 5 133 399 22 133 400 125 133 401 81 134 402 83 134 403 54 134 404 6 135 405 55 135 406 45 135 407 51 136 408 47 136 409 46 136 410 5 137 411 48 137 412 22 137 413 25 138 414 130 138 415 132 138 416 10 139 417 8 139 418 61 139 419 61 140 420 34 140 421 70 140 422 89 141 423 32 141 424 62 141 425 23 142 426 65 142 427 37 142 428 72 143 429 67 143 430 66 143 431 25 144 432 26 144 433 24 144 434 14 145 435 69 145 436 25 145 437 31 146 438 69 146 439 14 146 440 39 147 441 40 147 442 70 147 443 40 148 444 61 148 445 70 148 446 72 149 447 73 149 448 27 149 449 65 150 450 74 150 451 73 150 452 3 151 453 75 151 454 13 151 455 28 152 456 76 152 457 109 152 458 43 153 459 17 153 460 33 153 461 16 154 462 29 154 463 15 154 464 16 155 465 4 155 466 29 155 467 7 156 468 78 156 469 30 156 470 79 157 471 41 157 472 44 157 473 20 158 474 59 158 475 60 158 476 51 159 477 82 159 478 80 159 479 46 160 480 82 160 481 51 160 482 46 161 483 55 161 484 82 161 485 46 162 486 84 162 487 55 162 488 85 163 489 50 163 490 45 163 491 40 164 492 87 164 493 61 164 494 69 165 495 31 165 496 89 165 497 31 166 498 14 166 499 88 166 500 89 167 501 19 167 502 32 167 503 89 168 504 88 168 505 19 168 506 18 169 507 19 169 508 90 169 509 94 170 510 93 170 511 92 170 512 92 171 513 93 171 514 91 171 515 79 172 516 78 172 517 93 172 518 78 173 519 38 173 520 91 173 521 97 174 522 96 174 523 95 174 524 98 175 525 96 175 526 97 175 527 79 176 528 98 176 529 97 176 530 4 177 531 95 177 532 96 177 533 101 178 534 99 178 535 100 178 536 100 179 537 99 179 538 102 179 539 79 180 540 67 180 541 100 180 542 67 181 543 76 181 544 101 181 545 104 182 546 105 182 547 103 182 548 106 183 549 105 183 550 104 183 551 59 184 552 105 184 553 106 184 554 59 185 555 20 185 556 103 185 557 110 186 558 107 186 559 109 186 560 109 187 561 107 187 562 108 187 563 28 188 564 108 188 565 107 188 566 88 189 567 14 189 568 107 189 569 111 190 570 113 190 571 112 190 572 111 191 573 112 191 574 114 191 575 49 192 576 112 192 577 113 192 578 28 193 579 53 193 580 113 193 581 118 194 582 115 194 583 119 194 584 116 195 585 115 195 586 118 195 587 42 196 588 118 196 589 117 196 590 13 197 591 2 197 592 115 197 593 13 198 594 116 198 595 118 198 596 122 199 597 121 199 598 123 199 599 121 200 600 120 200 601 123 200 602 49 201 603 22 201 604 120 201 605 60 202 606 59 202 607 122 202 608 24 203 609 126 203 610 127 203 611 5 204 612 124 204 613 126 204 614 24 205 615 49 205 616 129 205 617 25 206 618 24 206 619 131 206 620 132 207 621 130 207 622 129 207 623 129 208 624 130 208 625 131 208 626 126 209 627 124 209 628 128 209 629 124 210 630 125 210 631 128 210 632 125 211 633 127 211 634 128 211 635 127 212 636 126 212 637 128 212 638 210 213 639 176 213 640 168 213 641 193 214 642 155 214 643 133 214 644 156 215 645 170 215 646 145 215 647 174 216 648 209 216 649 204 216 650 168 217 651 166 217 652 179 217 653 219 218 654 167 218 655 178 218 656 170 219 657 205 219 658 191 219 659 200 220 660 160 220 661 250 220 662 204 221 663 177 221 664 174 221 665 134 222 666 203 222 667 219 222 668 161 223 669 244 223 670 247 223 671 162 224 672 193 224 673 133 224 674 145 225 675 191 225 676 180 225 677 172 226 678 203 226 679 134 226 680 200 227 681 252 227 682 248 227 683 137 228 684 149 228 685 210 228 686 211 229 687 230 229 688 228 229 689 214 230 690 187 230 691 213 230 692 207 231 693 190 231 694 223 231 695 196 232 696 144 232 697 213 232 698 172 233 699 201 233 700 202 233 701 221 234 702 243 234 703 242 234 704 191 235 705 185 235 706 180 235 707 181 236 708 133 236 709 155 236 710 203 237 711 167 237 712 219 237 713 182 238 714 192 238 715 247 238 716 169 239 717 154 239 718 196 239 719 157 240 720 159 240 721 138 240 722 201 241 723 138 241 724 159 241 725 202 242 726 159 242 727 158 242 728 172 243 729 220 243 730 173 243 731 174 244 732 232 244 733 234 244 734 161 245 735 192 245 736 204 245 737 151 246 738 190 246 739 154 246 740 136 247 741 175 247 742 160 247 743 136 248 744 146 248 745 175 248 746 211 249 747 210 249 748 163 249 749 212 250 750 177 250 751 229 250 752 193 251 753 256 251 754 253 251 755 155 252 756 182 252 757 260 252 758 151 253 759 189 253 760 165 253 761 196 254 762 197 254 763 144 254 764 145 255 765 180 255 766 184 255 767 208 256 768 135 256 769 146 256 770 208 257 771 221 257 772 135 257 773 162 258 774 218 258 775 148 258 776 182 259 777 254 259 778 255 259 779 216 260 780 143 260 781 187 260 782 139 261 783 216 261 784 214 261 785 216 262 786 141 262 787 143 262 788 164 263 789 221 263 790 222 263 791 171 264 792 185 264 793 191 264 794 151 265 795 223 265 796 190 265 797 190 266 798 198 266 799 156 266 800 185 267 801 168 267 802 180 267 803 163 268 804 168 268 805 185 268 806 134 269 807 181 269 808 138 269 809 162 270 810 133 270 811 183 270 812 153 271 813 193 271 814 162 271 815 143 272 816 194 272 817 142 272 818 178 273 819 194 273 820 141 273 821 142 274 822 195 274 823 143 274 824 195 275 825 169 275 826 143 275 827 169 276 828 196 276 829 143 276 830 195 277 831 165 277 832 169 277 833 165 278 834 189 278 835 169 278 836 154 279 837 156 279 838 197 279 839 198 280 840 206 280 841 170 280 842 205 281 843 170 281 844 206 281 845 207 282 846 136 282 847 160 282 848 200 283 849 171 283 850 199 283 851 149 284 852 148 284 853 150 284 854 212 285 855 227 285 856 225 285 857 202 286 858 201 286 859 159 286 860 174 287 861 212 287 862 235 287 863 135 288 864 209 288 865 200 288 866 139 289 867 178 289 868 141 289 869 150 290 870 217 290 871 166 290 872 137 291 873 153 291 874 162 291 875 166 292 876 217 292 877 179 292 878 218 293 879 188 293 880 217 293 881 218 294 882 178 294 883 188 294 884 183 295 885 219 295 886 178 295 887 222 296 888 195 296 889 220 296 890 221 297 891 208 297 892 152 297 893 208 298 894 136 298 895 152 298 896 152 299 897 136 299 898 223 299 899 172 300 900 134 300 901 201 300 902 154 301 903 190 301 904 156 301 905 171 302 906 211 302 907 140 302 908 147 303 909 158 303 910 186 303 911 148 304 912 218 304 913 217 304 914 211 305 915 137 305 916 210 305 917 172 306 918 222 306 919 220 306 920 183 307 921 133 307 922 219 307 923 219 308 924 133 308 925 181 308 926 177 309 927 204 309 928 239 309 929 163 310 930 210 310 931 168 310 932 194 311 933 178 311 934 167 311 935 169 312 936 189 312 937 154 312 938 196 313 939 154 313 940 197 313 941 171 314 942 200 314 943 225 314 944 204 315 945 209 315 946 161 315 947 205 316 948 160 316 949 200 316 950 213 317 951 215 317 952 214 317 953 220 318 954 195 318 955 142 318 956 202 319 957 222 319 958 172 319 959 152 320 960 151 320 961 165 320 962 136 321 963 207 321 964 223 321 965 186 322 966 265 322 967 262 322 968 187 323 969 196 323 970 213 323 971 140 324 972 163 324 973 185 324 974 177 325 975 237 325 976 236 325 977 135 326 978 221 326 979 209 326 980 181 327 981 134 327 982 219 327 983 144 328 984 184 328 985 213 328 986 144 329 987 197 329 988 145 329 989 197 330 990 156 330 991 145 330 992 201 331 993 134 331 994 138 331 995 161 332 996 147 332 997 186 332 998 150 333 999 148 333 1000 217 333 1001 210 334 1002 149 334 1003 176 334 1004 214 335 1005 215 335 1006 139 335 1007 215 336 1008 188 336 1009 139 336 1010 220 337 1011 142 337 1012 194 337 1013 207 338 1014 198 338 1015 190 338 1016 168 339 1017 176 339 1018 166 339 1019 143 340 1020 196 340 1021 187 340 1022 144 341 1023 145 341 1024 184 341 1025 205 342 1026 199 342 1027 191 342 1028 171 343 1029 140 343 1030 185 343 1031 218 344 1032 162 344 1033 183 344 1034 137 345 1035 177 345 1036 153 345 1037 138 346 1038 155 346 1039 258 346 1040 214 347 1041 216 347 1042 187 347 1043 139 348 1044 188 348 1045 178 348 1046 184 349 1047 180 349 1048 179 349 1049 138 350 1050 181 350 1051 155 350 1052 158 351 1053 263 351 1054 265 351 1055 143 352 1056 141 352 1057 194 352 1058 194 353 1059 167 353 1060 203 353 1061 222 354 1062 165 354 1063 195 354 1064 156 355 1065 198 355 1066 170 355 1067 205 356 1068 200 356 1069 199 356 1070 158 357 1071 159 357 1072 157 357 1073 147 358 1074 202 358 1075 158 358 1076 164 359 1077 202 359 1078 147 359 1079 172 360 1080 173 360 1081 203 360 1082 173 361 1083 194 361 1084 203 361 1085 205 362 1086 206 362 1087 160 362 1088 198 363 1089 207 363 1090 206 363 1091 136 364 1092 208 364 1093 146 364 1094 161 365 1095 209 365 1096 242 365 1097 176 366 1098 150 366 1099 166 366 1100 149 367 1101 162 367 1102 148 367 1103 149 368 1104 137 368 1105 162 368 1106 140 369 1107 211 369 1108 163 369 1109 212 370 1110 174 370 1111 177 370 1112 153 371 1113 192 371 1114 193 371 1115 184 372 1116 215 372 1117 213 372 1118 179 373 1119 215 373 1120 184 373 1121 179 374 1122 188 374 1123 215 374 1124 179 375 1125 217 375 1126 188 375 1127 218 376 1128 183 376 1129 178 376 1130 173 377 1131 220 377 1132 194 377 1133 202 378 1134 164 378 1135 222 378 1136 164 379 1137 147 379 1138 221 379 1139 222 380 1140 152 380 1141 165 380 1142 222 381 1143 221 381 1144 152 381 1145 151 382 1146 152 382 1147 223 382 1148 227 383 1149 226 383 1150 225 383 1151 225 384 1152 226 384 1153 224 384 1154 212 385 1155 211 385 1156 226 385 1157 211 386 1158 171 386 1159 224 386 1160 230 387 1161 229 387 1162 228 387 1163 231 388 1164 229 388 1165 230 388 1166 212 389 1167 231 389 1168 230 389 1169 137 390 1170 228 390 1171 229 390 1172 234 391 1173 232 391 1174 233 391 1175 233 392 1176 232 392 1177 235 392 1178 212 393 1179 200 393 1180 233 393 1181 200 394 1182 209 394 1183 234 394 1184 237 395 1185 238 395 1186 236 395 1187 239 396 1188 238 396 1189 237 396 1190 192 397 1191 238 397 1192 239 397 1193 192 398 1194 153 398 1195 236 398 1196 243 399 1197 240 399 1198 242 399 1199 242 400 1200 240 400 1201 241 400 1202 161 401 1203 241 401 1204 240 401 1205 221 402 1206 147 402 1207 240 402 1208 244 403 1209 246 403 1210 245 403 1211 244 404 1212 245 404 1213 247 404 1214 182 405 1215 245 405 1216 246 405 1217 161 406 1218 186 406 1219 246 406 1220 251 407 1221 248 407 1222 252 407 1223 249 408 1224 248 408 1225 251 408 1226 175 409 1227 251 409 1228 250 409 1229 146 410 1230 135 410 1231 248 410 1232 146 411 1233 249 411 1234 251 411 1235 255 412 1236 254 412 1237 256 412 1238 254 413 1239 253 413 1240 256 413 1241 182 414 1242 155 414 1243 253 414 1244 193 415 1245 192 415 1246 255 415 1247 157 416 1248 259 416 1249 260 416 1250 138 417 1251 257 417 1252 259 417 1253 157 418 1254 182 418 1255 262 418 1256 158 419 1257 157 419 1258 264 419 1259 265 420 1260 263 420 1261 262 420 1262 262 421 1263 263 421 1264 264 421 1265 259 422 1266 257 422 1267 261 422 1268 257 423 1269 258 423 1270 261 423 1271 258 424 1272 260 424 1273 261 424 1274 260 425 1275 259 425 1276 261 425 1277 343 426 1278 309 426 1279 301 426 1280 326 427 1281 288 427 1282 266 427 1283 289 428 1284 303 428 1285 278 428 1286 307 429 1287 342 429 1288 337 429 1289 301 430 1290 299 430 1291 312 430 1292 352 431 1293 300 431 1294 311 431 1295 303 432 1296 338 432 1297 324 432 1298 293 433 1299 383 433 1300 385 433 1301 337 434 1302 310 434 1303 307 434 1304 267 435 1305 336 435 1306 352 435 1307 294 436 1308 377 436 1309 380 436 1310 295 437 1311 326 437 1312 266 437 1313 278 438 1314 324 438 1315 313 438 1316 305 439 1317 336 439 1318 267 439 1319 333 440 1320 385 440 1321 381 440 1322 270 441 1323 282 441 1324 343 441 1325 344 442 1326 363 442 1327 361 442 1328 347 443 1329 320 443 1330 346 443 1331 340 444 1332 323 444 1333 356 444 1334 329 445 1335 277 445 1336 346 445 1337 305 446 1338 334 446 1339 335 446 1340 354 447 1341 376 447 1342 375 447 1343 324 448 1344 318 448 1345 313 448 1346 314 449 1347 266 449 1348 288 449 1349 336 450 1350 300 450 1351 352 450 1352 315 451 1353 325 451 1354 380 451 1355 302 452 1356 287 452 1357 329 452 1358 290 453 1359 292 453 1360 271 453 1361 334 454 1362 271 454 1363 292 454 1364 335 455 1365 292 455 1366 291 455 1367 305 456 1368 353 456 1369 306 456 1370 307 457 1371 365 457 1372 367 457 1373 294 458 1374 325 458 1375 337 458 1376 284 459 1377 323 459 1378 287 459 1379 269 460 1380 308 460 1381 293 460 1382 269 461 1383 279 461 1384 308 461 1385 344 462 1386 343 462 1387 296 462 1388 345 463 1389 310 463 1390 362 463 1391 326 464 1392 389 464 1393 386 464 1394 288 465 1395 315 465 1396 393 465 1397 284 466 1398 322 466 1399 298 466 1400 329 467 1401 330 467 1402 277 467 1403 278 468 1404 313 468 1405 317 468 1406 341 469 1407 268 469 1408 279 469 1409 341 470 1410 354 470 1411 268 470 1412 295 471 1413 351 471 1414 281 471 1415 315 472 1416 387 472 1417 388 472 1418 349 473 1419 276 473 1420 320 473 1421 272 474 1422 349 474 1423 347 474 1424 349 475 1425 274 475 1426 276 475 1427 297 476 1428 354 476 1429 355 476 1430 304 477 1431 318 477 1432 324 477 1433 284 478 1434 356 478 1435 323 478 1436 323 479 1437 331 479 1438 289 479 1439 318 480 1440 301 480 1441 313 480 1442 296 481 1443 301 481 1444 318 481 1445 267 482 1446 314 482 1447 271 482 1448 295 483 1449 266 483 1450 316 483 1451 286 484 1452 326 484 1453 295 484 1454 276 485 1455 327 485 1456 275 485 1457 311 486 1458 327 486 1459 274 486 1460 275 487 1461 328 487 1462 276 487 1463 328 488 1464 302 488 1465 276 488 1466 302 489 1467 329 489 1468 276 489 1469 328 490 1470 298 490 1471 302 490 1472 298 491 1473 322 491 1474 302 491 1475 287 492 1476 289 492 1477 330 492 1478 331 493 1479 339 493 1480 303 493 1481 338 494 1482 303 494 1483 339 494 1484 340 495 1485 269 495 1486 293 495 1487 333 496 1488 304 496 1489 332 496 1490 282 497 1491 281 497 1492 283 497 1493 345 498 1494 360 498 1495 358 498 1496 335 499 1497 334 499 1498 292 499 1499 307 500 1500 345 500 1501 368 500 1502 268 501 1503 342 501 1504 333 501 1505 272 502 1506 311 502 1507 274 502 1508 283 503 1509 350 503 1510 299 503 1511 270 504 1512 286 504 1513 295 504 1514 299 505 1515 350 505 1516 312 505 1517 351 506 1518 321 506 1519 350 506 1520 351 507 1521 311 507 1522 321 507 1523 316 508 1524 352 508 1525 311 508 1526 355 509 1527 328 509 1528 353 509 1529 354 510 1530 341 510 1531 285 510 1532 341 511 1533 269 511 1534 285 511 1535 285 512 1536 269 512 1537 356 512 1538 305 513 1539 267 513 1540 334 513 1541 287 514 1542 323 514 1543 289 514 1544 304 515 1545 344 515 1546 273 515 1547 280 516 1548 291 516 1549 319 516 1550 281 517 1551 351 517 1552 350 517 1553 344 518 1554 270 518 1555 343 518 1556 305 519 1557 355 519 1558 353 519 1559 316 520 1560 266 520 1561 352 520 1562 352 521 1563 266 521 1564 314 521 1565 310 522 1566 337 522 1567 372 522 1568 296 523 1569 343 523 1570 301 523 1571 327 524 1572 311 524 1573 300 524 1574 302 525 1575 322 525 1576 287 525 1577 329 526 1578 287 526 1579 330 526 1580 304 527 1581 333 527 1582 358 527 1583 337 528 1584 342 528 1585 294 528 1586 338 529 1587 293 529 1588 333 529 1589 346 530 1590 348 530 1591 347 530 1592 353 531 1593 328 531 1594 275 531 1595 335 532 1596 355 532 1597 305 532 1598 285 533 1599 284 533 1600 298 533 1601 269 534 1602 340 534 1603 356 534 1604 319 535 1605 398 535 1606 395 535 1607 320 536 1608 329 536 1609 346 536 1610 273 537 1611 296 537 1612 318 537 1613 310 538 1614 370 538 1615 369 538 1616 268 539 1617 354 539 1618 342 539 1619 314 540 1620 267 540 1621 352 540 1622 277 541 1623 317 541 1624 346 541 1625 277 542 1626 330 542 1627 278 542 1628 330 543 1629 289 543 1630 278 543 1631 334 544 1632 267 544 1633 271 544 1634 294 545 1635 280 545 1636 319 545 1637 283 546 1638 281 546 1639 350 546 1640 343 547 1641 282 547 1642 309 547 1643 347 548 1644 348 548 1645 272 548 1646 348 549 1647 321 549 1648 272 549 1649 353 550 1650 275 550 1651 327 550 1652 340 551 1653 331 551 1654 323 551 1655 301 552 1656 309 552 1657 299 552 1658 276 553 1659 329 553 1660 320 553 1661 277 554 1662 278 554 1663 317 554 1664 338 555 1665 332 555 1666 324 555 1667 304 556 1668 273 556 1669 318 556 1670 351 557 1671 295 557 1672 316 557 1673 270 558 1674 310 558 1675 286 558 1676 271 559 1677 288 559 1678 391 559 1679 347 560 1680 349 560 1681 320 560 1682 272 561 1683 321 561 1684 311 561 1685 317 562 1686 313 562 1687 312 562 1688 271 563 1689 314 563 1690 288 563 1691 291 564 1692 396 564 1693 398 564 1694 276 565 1695 274 565 1696 327 565 1697 327 566 1698 300 566 1699 336 566 1700 355 567 1701 298 567 1702 328 567 1703 289 568 1704 331 568 1705 303 568 1706 338 569 1707 333 569 1708 332 569 1709 291 570 1710 292 570 1711 290 570 1712 280 571 1713 335 571 1714 291 571 1715 297 572 1716 335 572 1717 280 572 1718 305 573 1719 306 573 1720 336 573 1721 306 574 1722 327 574 1723 336 574 1724 338 575 1725 339 575 1726 293 575 1727 331 576 1728 340 576 1729 339 576 1730 269 577 1731 341 577 1732 279 577 1733 294 578 1734 342 578 1735 375 578 1736 309 579 1737 283 579 1738 299 579 1739 282 580 1740 295 580 1741 281 580 1742 282 581 1743 270 581 1744 295 581 1745 273 582 1746 344 582 1747 296 582 1748 345 583 1749 307 583 1750 310 583 1751 286 584 1752 325 584 1753 326 584 1754 317 585 1755 348 585 1756 346 585 1757 312 586 1758 348 586 1759 317 586 1760 312 587 1761 321 587 1762 348 587 1763 312 588 1764 350 588 1765 321 588 1766 351 589 1767 316 589 1768 311 589 1769 306 590 1770 353 590 1771 327 590 1772 335 591 1773 297 591 1774 355 591 1775 297 592 1776 280 592 1777 354 592 1778 355 593 1779 285 593 1780 298 593 1781 355 594 1782 354 594 1783 285 594 1784 284 595 1785 285 595 1786 356 595 1787 360 596 1788 359 596 1789 358 596 1790 358 597 1791 359 597 1792 357 597 1793 345 598 1794 344 598 1795 359 598 1796 344 599 1797 304 599 1798 357 599 1799 363 600 1800 362 600 1801 361 600 1802 364 601 1803 362 601 1804 363 601 1805 344 602 1806 345 602 1807 364 602 1808 270 603 1809 361 603 1810 362 603 1811 367 604 1812 365 604 1813 366 604 1814 366 605 1815 365 605 1816 368 605 1817 333 606 1818 366 606 1819 368 606 1820 333 607 1821 342 607 1822 367 607 1823 370 608 1824 371 608 1825 369 608 1826 372 609 1827 371 609 1828 370 609 1829 325 610 1830 371 610 1831 372 610 1832 325 611 1833 286 611 1834 369 611 1835 376 612 1836 373 612 1837 375 612 1838 375 613 1839 373 613 1840 374 613 1841 294 614 1842 374 614 1843 373 614 1844 354 615 1845 280 615 1846 373 615 1847 377 616 1848 379 616 1849 378 616 1850 377 617 1851 378 617 1852 380 617 1853 315 618 1854 378 618 1855 379 618 1856 294 619 1857 319 619 1858 379 619 1859 384 620 1860 381 620 1861 385 620 1862 382 621 1863 381 621 1864 384 621 1865 308 622 1866 384 622 1867 383 622 1868 279 623 1869 268 623 1870 381 623 1871 308 624 1872 279 624 1873 382 624 1874 388 625 1875 387 625 1876 389 625 1877 387 626 1878 386 626 1879 389 626 1880 315 627 1881 288 627 1882 386 627 1883 326 628 1884 325 628 1885 388 628 1886 290 629 1887 392 629 1888 393 629 1889 271 630 1890 390 630 1891 392 630 1892 290 631 1893 315 631 1894 395 631 1895 291 632 1896 290 632 1897 397 632 1898 398 633 1899 396 633 1900 395 633 1901 395 634 1902 396 634 1903 397 634 1904 392 635 1905 390 635 1906 394 635 1907 390 636 1908 391 636 1909 394 636 1910 391 637 1911 393 637 1912 394 637 1913 393 638 1914 392 638 1915 394 638 1916 476 639 1917 442 639 1918 434 639 1919 459 640 1920 421 640 1921 399 640 1922 422 641 1923 436 641 1924 411 641 1925 440 642 1926 475 642 1927 470 642 1928 434 643 1929 432 643 1930 445 643 1931 485 644 1932 433 644 1933 444 644 1934 436 645 1935 471 645 1936 457 645 1937 466 646 1938 426 646 1939 516 646 1940 470 647 1941 443 647 1942 440 647 1943 400 648 1944 469 648 1945 485 648 1946 427 649 1947 510 649 1948 513 649 1949 428 650 1950 459 650 1951 399 650 1952 411 651 1953 457 651 1954 446 651 1955 438 652 1956 469 652 1957 400 652 1958 466 653 1959 518 653 1960 514 653 1961 403 654 1962 415 654 1963 476 654 1964 477 655 1965 496 655 1966 494 655 1967 480 656 1968 453 656 1969 479 656 1970 473 657 1971 456 657 1972 489 657 1973 462 658 1974 410 658 1975 479 658 1976 438 659 1977 467 659 1978 468 659 1979 487 660 1980 509 660 1981 508 660 1982 457 661 1983 451 661 1984 446 661 1985 447 662 1986 399 662 1987 421 662 1988 469 663 1989 433 663 1990 485 663 1991 448 664 1992 458 664 1993 513 664 1994 435 665 1995 420 665 1996 462 665 1997 423 666 1998 425 666 1999 404 666 2000 467 667 2001 404 667 2002 425 667 2003 468 668 2004 425 668 2005 424 668 2006 438 669 2007 486 669 2008 439 669 2009 440 670 2010 498 670 2011 500 670 2012 427 671 2013 458 671 2014 470 671 2015 417 672 2016 456 672 2017 420 672 2018 402 673 2019 441 673 2020 426 673 2021 402 674 2022 412 674 2023 441 674 2024 477 675 2025 476 675 2026 429 675 2027 478 676 2028 443 676 2029 495 676 2030 459 677 2031 522 677 2032 519 677 2033 421 678 2034 448 678 2035 526 678 2036 417 679 2037 455 679 2038 431 679 2039 462 680 2040 463 680 2041 410 680 2042 411 681 2043 446 681 2044 450 681 2045 474 682 2046 401 682 2047 412 682 2048 474 683 2049 487 683 2050 401 683 2051 428 684 2052 484 684 2053 414 684 2054 448 685 2055 520 685 2056 521 685 2057 482 686 2058 409 686 2059 453 686 2060 405 687 2061 482 687 2062 480 687 2063 482 688 2064 407 688 2065 409 688 2066 430 689 2067 487 689 2068 488 689 2069 437 690 2070 451 690 2071 457 690 2072 417 691 2073 489 691 2074 456 691 2075 456 692 2076 464 692 2077 422 692 2078 451 693 2079 434 693 2080 446 693 2081 429 694 2082 434 694 2083 451 694 2084 400 695 2085 447 695 2086 404 695 2087 428 696 2088 399 696 2089 449 696 2090 419 697 2091 459 697 2092 428 697 2093 409 698 2094 460 698 2095 408 698 2096 444 699 2097 460 699 2098 407 699 2099 408 700 2100 461 700 2101 409 700 2102 461 701 2103 435 701 2104 409 701 2105 435 702 2106 462 702 2107 409 702 2108 461 703 2109 431 703 2110 435 703 2111 431 704 2112 455 704 2113 435 704 2114 420 705 2115 422 705 2116 463 705 2117 464 706 2118 472 706 2119 436 706 2120 471 707 2121 436 707 2122 472 707 2123 473 708 2124 402 708 2125 426 708 2126 466 709 2127 437 709 2128 465 709 2129 415 710 2130 414 710 2131 416 710 2132 478 711 2133 493 711 2134 491 711 2135 468 712 2136 467 712 2137 425 712 2138 440 713 2139 478 713 2140 501 713 2141 401 714 2142 475 714 2143 466 714 2144 405 715 2145 444 715 2146 407 715 2147 416 716 2148 483 716 2149 432 716 2150 403 717 2151 419 717 2152 428 717 2153 432 718 2154 483 718 2155 445 718 2156 484 719 2157 454 719 2158 483 719 2159 484 720 2160 444 720 2161 454 720 2162 449 721 2163 485 721 2164 444 721 2165 488 722 2166 461 722 2167 486 722 2168 487 723 2169 474 723 2170 418 723 2171 474 724 2172 402 724 2173 418 724 2174 418 725 2175 402 725 2176 489 725 2177 438 726 2178 400 726 2179 467 726 2180 420 727 2181 456 727 2182 422 727 2183 437 728 2184 477 728 2185 406 728 2186 413 729 2187 424 729 2188 452 729 2189 414 730 2190 484 730 2191 483 730 2192 477 731 2193 403 731 2194 476 731 2195 438 732 2196 488 732 2197 486 732 2198 449 733 2199 399 733 2200 485 733 2201 485 734 2202 399 734 2203 447 734 2204 443 735 2205 470 735 2206 505 735 2207 429 736 2208 476 736 2209 434 736 2210 460 737 2211 444 737 2212 433 737 2213 435 738 2214 455 738 2215 420 738 2216 462 739 2217 420 739 2218 463 739 2219 437 740 2220 466 740 2221 491 740 2222 470 741 2223 475 741 2224 427 741 2225 471 742 2226 426 742 2227 466 742 2228 479 743 2229 481 743 2230 480 743 2231 486 744 2232 461 744 2233 408 744 2234 468 745 2235 488 745 2236 438 745 2237 418 746 2238 417 746 2239 431 746 2240 402 747 2241 473 747 2242 489 747 2243 452 748 2244 531 748 2245 528 748 2246 453 749 2247 462 749 2248 479 749 2249 406 750 2250 429 750 2251 451 750 2252 443 751 2253 503 751 2254 502 751 2255 401 752 2256 487 752 2257 475 752 2258 447 753 2259 400 753 2260 485 753 2261 410 754 2262 450 754 2263 479 754 2264 410 755 2265 463 755 2266 411 755 2267 463 756 2268 422 756 2269 411 756 2270 467 757 2271 400 757 2272 404 757 2273 427 758 2274 413 758 2275 452 758 2276 416 759 2277 414 759 2278 483 759 2279 476 760 2280 415 760 2281 442 760 2282 480 761 2283 481 761 2284 405 761 2285 481 762 2286 454 762 2287 405 762 2288 486 763 2289 408 763 2290 460 763 2291 473 764 2292 464 764 2293 456 764 2294 434 765 2295 442 765 2296 432 765 2297 409 766 2298 462 766 2299 453 766 2300 410 767 2301 411 767 2302 450 767 2303 471 768 2304 465 768 2305 457 768 2306 437 769 2307 406 769 2308 451 769 2309 484 770 2310 428 770 2311 449 770 2312 403 771 2313 443 771 2314 419 771 2315 404 772 2316 421 772 2317 524 772 2318 480 773 2319 482 773 2320 453 773 2321 405 774 2322 454 774 2323 444 774 2324 450 775 2325 446 775 2326 445 775 2327 404 776 2328 447 776 2329 421 776 2330 424 777 2331 529 777 2332 531 777 2333 409 778 2334 407 778 2335 460 778 2336 460 779 2337 433 779 2338 469 779 2339 488 780 2340 431 780 2341 461 780 2342 422 781 2343 464 781 2344 436 781 2345 471 782 2346 466 782 2347 465 782 2348 424 783 2349 425 783 2350 423 783 2351 413 784 2352 468 784 2353 424 784 2354 430 785 2355 468 785 2356 413 785 2357 438 786 2358 439 786 2359 469 786 2360 439 787 2361 460 787 2362 469 787 2363 471 788 2364 472 788 2365 426 788 2366 464 789 2367 473 789 2368 472 789 2369 402 790 2370 474 790 2371 412 790 2372 427 791 2373 475 791 2374 508 791 2375 442 792 2376 416 792 2377 432 792 2378 415 793 2379 428 793 2380 414 793 2381 415 794 2382 403 794 2383 428 794 2384 406 795 2385 477 795 2386 429 795 2387 478 796 2388 440 796 2389 443 796 2390 419 797 2391 458 797 2392 459 797 2393 450 798 2394 481 798 2395 479 798 2396 445 799 2397 481 799 2398 450 799 2399 445 800 2400 454 800 2401 481 800 2402 445 801 2403 483 801 2404 454 801 2405 484 802 2406 449 802 2407 444 802 2408 439 803 2409 486 803 2410 460 803 2411 468 804 2412 430 804 2413 488 804 2414 430 805 2415 413 805 2416 487 805 2417 488 806 2418 418 806 2419 431 806 2420 488 807 2421 487 807 2422 418 807 2423 417 808 2424 418 808 2425 489 808 2426 493 809 2427 492 809 2428 491 809 2429 491 810 2430 492 810 2431 490 810 2432 478 811 2433 477 811 2434 492 811 2435 477 812 2436 437 812 2437 490 812 2438 496 813 2439 495 813 2440 494 813 2441 497 814 2442 495 814 2443 496 814 2444 478 815 2445 497 815 2446 496 815 2447 403 816 2448 494 816 2449 495 816 2450 500 817 2451 498 817 2452 499 817 2453 499 818 2454 498 818 2455 501 818 2456 478 819 2457 466 819 2458 499 819 2459 466 820 2460 475 820 2461 500 820 2462 503 821 2463 504 821 2464 502 821 2465 505 822 2466 504 822 2467 503 822 2468 458 823 2469 504 823 2470 505 823 2471 458 824 2472 419 824 2473 502 824 2474 509 825 2475 506 825 2476 508 825 2477 508 826 2478 506 826 2479 507 826 2480 427 827 2481 507 827 2482 506 827 2483 487 828 2484 413 828 2485 506 828 2486 510 829 2487 512 829 2488 511 829 2489 510 830 2490 511 830 2491 513 830 2492 448 831 2493 511 831 2494 512 831 2495 427 832 2496 452 832 2497 512 832 2498 517 833 2499 514 833 2500 518 833 2501 515 834 2502 514 834 2503 517 834 2504 441 835 2505 517 835 2506 516 835 2507 412 836 2508 401 836 2509 514 836 2510 412 837 2511 515 837 2512 517 837 2513 521 838 2514 520 838 2515 522 838 2516 520 839 2517 519 839 2518 522 839 2519 448 840 2520 421 840 2521 519 840 2522 459 841 2523 458 841 2524 521 841 2525 423 842 2526 525 842 2527 526 842 2528 404 843 2529 523 843 2530 525 843 2531 423 844 2532 448 844 2533 528 844 2534 424 845 2535 423 845 2536 530 845 2537 531 846 2538 529 846 2539 528 846 2540 528 847 2541 529 847 2542 530 847 2543 525 848 2544 523 848 2545 527 848 2546 523 849 2547 524 849 2548 527 849 2549 524 850 2550 526 850 2551 527 850 2552 526 851 2553 525 851 2554 527 851 2555 609 852 2556 575 852 2557 567 852 2558 592 853 2559 554 853 2560 532 853 2561 555 854 2562 569 854 2563 544 854 2564 573 855 2565 608 855 2566 603 855 2567 567 856 2568 565 856 2569 578 856 2570 618 857 2571 566 857 2572 577 857 2573 569 858 2574 604 858 2575 590 858 2576 599 859 2577 559 859 2578 649 859 2579 603 860 2580 576 860 2581 573 860 2582 533 861 2583 602 861 2584 618 861 2585 560 862 2586 643 862 2587 646 862 2588 561 863 2589 592 863 2590 532 863 2591 544 864 2592 590 864 2593 579 864 2594 571 865 2595 602 865 2596 533 865 2597 599 866 2598 651 866 2599 647 866 2600 536 867 2601 548 867 2602 609 867 2603 610 868 2604 629 868 2605 627 868 2606 613 869 2607 586 869 2608 612 869 2609 606 870 2610 589 870 2611 622 870 2612 595 871 2613 543 871 2614 612 871 2615 571 872 2616 600 872 2617 601 872 2618 620 873 2619 642 873 2620 641 873 2621 590 874 2622 584 874 2623 579 874 2624 580 875 2625 532 875 2626 554 875 2627 602 876 2628 566 876 2629 618 876 2630 581 877 2631 591 877 2632 646 877 2633 568 878 2634 553 878 2635 595 878 2636 556 879 2637 558 879 2638 537 879 2639 600 880 2640 537 880 2641 558 880 2642 601 881 2643 558 881 2644 557 881 2645 571 882 2646 619 882 2647 572 882 2648 573 883 2649 631 883 2650 633 883 2651 560 884 2652 591 884 2653 603 884 2654 550 885 2655 589 885 2656 553 885 2657 535 886 2658 574 886 2659 559 886 2660 535 887 2661 545 887 2662 574 887 2663 610 888 2664 609 888 2665 562 888 2666 611 889 2667 576 889 2668 628 889 2669 592 890 2670 655 890 2671 652 890 2672 554 891 2673 581 891 2674 659 891 2675 550 892 2676 588 892 2677 564 892 2678 595 893 2679 596 893 2680 543 893 2681 544 894 2682 579 894 2683 583 894 2684 607 895 2685 534 895 2686 545 895 2687 607 896 2688 620 896 2689 534 896 2690 561 897 2691 617 897 2692 547 897 2693 581 898 2694 653 898 2695 654 898 2696 615 899 2697 542 899 2698 586 899 2699 538 900 2700 615 900 2701 613 900 2702 615 901 2703 540 901 2704 542 901 2705 563 902 2706 620 902 2707 621 902 2708 570 903 2709 584 903 2710 590 903 2711 550 904 2712 622 904 2713 589 904 2714 589 905 2715 597 905 2716 555 905 2717 584 906 2718 567 906 2719 579 906 2720 562 907 2721 567 907 2722 584 907 2723 533 908 2724 580 908 2725 537 908 2726 561 909 2727 532 909 2728 582 909 2729 552 910 2730 592 910 2731 561 910 2732 542 911 2733 593 911 2734 541 911 2735 577 912 2736 593 912 2737 540 912 2738 541 913 2739 594 913 2740 542 913 2741 594 914 2742 568 914 2743 542 914 2744 568 915 2745 595 915 2746 542 915 2747 594 916 2748 564 916 2749 568 916 2750 564 917 2751 588 917 2752 568 917 2753 553 918 2754 555 918 2755 596 918 2756 597 919 2757 605 919 2758 569 919 2759 604 920 2760 569 920 2761 605 920 2762 606 921 2763 535 921 2764 559 921 2765 599 922 2766 570 922 2767 598 922 2768 548 923 2769 547 923 2770 549 923 2771 611 924 2772 626 924 2773 624 924 2774 601 925 2775 600 925 2776 558 925 2777 573 926 2778 611 926 2779 634 926 2780 534 927 2781 608 927 2782 599 927 2783 538 928 2784 577 928 2785 540 928 2786 549 929 2787 616 929 2788 565 929 2789 536 930 2790 552 930 2791 561 930 2792 565 931 2793 616 931 2794 578 931 2795 617 932 2796 587 932 2797 616 932 2798 617 933 2799 577 933 2800 587 933 2801 582 934 2802 618 934 2803 577 934 2804 621 935 2805 594 935 2806 619 935 2807 620 936 2808 607 936 2809 551 936 2810 607 937 2811 535 937 2812 551 937 2813 551 938 2814 535 938 2815 622 938 2816 571 939 2817 533 939 2818 600 939 2819 553 940 2820 589 940 2821 555 940 2822 570 941 2823 610 941 2824 539 941 2825 546 942 2826 557 942 2827 585 942 2828 547 943 2829 617 943 2830 616 943 2831 610 944 2832 536 944 2833 609 944 2834 571 945 2835 621 945 2836 619 945 2837 582 946 2838 532 946 2839 618 946 2840 618 947 2841 532 947 2842 580 947 2843 576 948 2844 603 948 2845 638 948 2846 562 949 2847 609 949 2848 567 949 2849 593 950 2850 577 950 2851 566 950 2852 568 951 2853 588 951 2854 553 951 2855 595 952 2856 553 952 2857 596 952 2858 570 953 2859 599 953 2860 624 953 2861 603 954 2862 608 954 2863 560 954 2864 604 955 2865 559 955 2866 599 955 2867 612 956 2868 614 956 2869 613 956 2870 619 957 2871 594 957 2872 541 957 2873 601 958 2874 621 958 2875 571 958 2876 551 959 2877 550 959 2878 564 959 2879 535 960 2880 606 960 2881 622 960 2882 585 961 2883 664 961 2884 661 961 2885 586 962 2886 595 962 2887 612 962 2888 539 963 2889 562 963 2890 584 963 2891 576 964 2892 636 964 2893 635 964 2894 534 965 2895 620 965 2896 608 965 2897 580 966 2898 533 966 2899 618 966 2900 543 967 2901 583 967 2902 612 967 2903 543 968 2904 596 968 2905 544 968 2906 596 969 2907 555 969 2908 544 969 2909 600 970 2910 533 970 2911 537 970 2912 560 971 2913 546 971 2914 585 971 2915 549 972 2916 547 972 2917 616 972 2918 609 973 2919 548 973 2920 575 973 2921 613 974 2922 614 974 2923 538 974 2924 614 975 2925 587 975 2926 538 975 2927 619 976 2928 541 976 2929 593 976 2930 606 977 2931 597 977 2932 589 977 2933 567 978 2934 575 978 2935 565 978 2936 542 979 2937 595 979 2938 586 979 2939 543 980 2940 544 980 2941 583 980 2942 604 981 2943 598 981 2944 590 981 2945 570 982 2946 539 982 2947 584 982 2948 617 983 2949 561 983 2950 582 983 2951 536 984 2952 576 984 2953 552 984 2954 537 985 2955 554 985 2956 657 985 2957 613 986 2958 615 986 2959 586 986 2960 538 987 2961 587 987 2962 577 987 2963 583 988 2964 579 988 2965 578 988 2966 537 989 2967 580 989 2968 554 989 2969 557 990 2970 662 990 2971 664 990 2972 542 991 2973 540 991 2974 593 991 2975 593 992 2976 566 992 2977 602 992 2978 621 993 2979 564 993 2980 594 993 2981 555 994 2982 597 994 2983 569 994 2984 604 995 2985 599 995 2986 598 995 2987 557 996 2988 558 996 2989 556 996 2990 546 997 2991 601 997 2992 557 997 2993 563 998 2994 601 998 2995 546 998 2996 571 999 2997 572 999 2998 602 999 2999 572 1000 3000 593 1000 3001 602 1000 3002 604 1001 3003 605 1001 3004 559 1001 3005 597 1002 3006 606 1002 3007 605 1002 3008 535 1003 3009 607 1003 3010 545 1003 3011 560 1004 3012 608 1004 3013 641 1004 3014 575 1005 3015 549 1005 3016 565 1005 3017 548 1006 3018 561 1006 3019 547 1006 3020 548 1007 3021 536 1007 3022 561 1007 3023 539 1008 3024 610 1008 3025 562 1008 3026 611 1009 3027 573 1009 3028 576 1009 3029 552 1010 3030 591 1010 3031 592 1010 3032 583 1011 3033 614 1011 3034 612 1011 3035 578 1012 3036 614 1012 3037 583 1012 3038 578 1013 3039 587 1013 3040 614 1013 3041 578 1014 3042 616 1014 3043 587 1014 3044 617 1015 3045 582 1015 3046 577 1015 3047 572 1016 3048 619 1016 3049 593 1016 3050 601 1017 3051 563 1017 3052 621 1017 3053 563 1018 3054 546 1018 3055 620 1018 3056 621 1019 3057 551 1019 3058 564 1019 3059 621 1020 3060 620 1020 3061 551 1020 3062 550 1021 3063 551 1021 3064 622 1021 3065 626 1022 3066 625 1022 3067 624 1022 3068 624 1023 3069 625 1023 3070 623 1023 3071 611 1024 3072 610 1024 3073 625 1024 3074 610 1025 3075 570 1025 3076 623 1025 3077 629 1026 3078 628 1026 3079 627 1026 3080 630 1027 3081 628 1027 3082 629 1027 3083 611 1028 3084 630 1028 3085 629 1028 3086 536 1029 3087 627 1029 3088 628 1029 3089 633 1030 3090 631 1030 3091 632 1030 3092 632 1031 3093 631 1031 3094 634 1031 3095 611 1032 3096 599 1032 3097 632 1032 3098 599 1033 3099 608 1033 3100 633 1033 3101 636 1034 3102 637 1034 3103 635 1034 3104 638 1035 3105 637 1035 3106 636 1035 3107 591 1036 3108 637 1036 3109 638 1036 3110 591 1037 3111 552 1037 3112 635 1037 3113 642 1038 3114 639 1038 3115 641 1038 3116 641 1039 3117 639 1039 3118 640 1039 3119 560 1040 3120 640 1040 3121 639 1040 3122 620 1041 3123 546 1041 3124 639 1041 3125 643 1042 3126 645 1042 3127 644 1042 3128 643 1043 3129 644 1043 3130 646 1043 3131 581 1044 3132 644 1044 3133 645 1044 3134 560 1045 3135 585 1045 3136 645 1045 3137 650 1046 3138 647 1046 3139 651 1046 3140 648 1047 3141 647 1047 3142 650 1047 3143 574 1048 3144 650 1048 3145 649 1048 3146 545 1049 3147 534 1049 3148 647 1049 3149 545 1050 3150 648 1050 3151 650 1050 3152 654 1051 3153 653 1051 3154 655 1051 3155 653 1052 3156 652 1052 3157 655 1052 3158 581 1053 3159 554 1053 3160 652 1053 3161 592 1054 3162 591 1054 3163 654 1054 3164 556 1055 3165 658 1055 3166 659 1055 3167 537 1056 3168 656 1056 3169 658 1056 3170 556 1057 3171 581 1057 3172 661 1057 3173 557 1058 3174 556 1058 3175 663 1058 3176 664 1059 3177 662 1059 3178 661 1059 3179 661 1060 3180 662 1060 3181 663 1060 3182 658 1061 3183 656 1061 3184 660 1061 3185 656 1062 3186 657 1062 3187 660 1062 3188 657 1063 3189 659 1063 3190 660 1063 3191 659 1064 3192 658 1064 3193 660 1064 3194 742 1065 3195 708 1065 3196 700 1065 3197 725 1066 3198 687 1066 3199 665 1066 3200 688 1067 3201 702 1067 3202 677 1067 3203 706 1068 3204 741 1068 3205 736 1068 3206 700 1069 3207 698 1069 3208 711 1069 3209 751 1070 3210 699 1070 3211 710 1070 3212 702 1071 3213 737 1071 3214 723 1071 3215 692 1072 3216 782 1072 3217 784 1072 3218 736 1073 3219 709 1073 3220 706 1073 3221 666 1074 3222 735 1074 3223 751 1074 3224 693 1075 3225 776 1075 3226 779 1075 3227 694 1076 3228 725 1076 3229 665 1076 3230 677 1077 3231 723 1077 3232 712 1077 3233 704 1078 3234 735 1078 3235 666 1078 3236 732 1079 3237 784 1079 3238 780 1079 3239 669 1080 3240 681 1080 3241 742 1080 3242 743 1081 3243 762 1081 3244 760 1081 3245 746 1082 3246 719 1082 3247 745 1082 3248 739 1083 3249 722 1083 3250 755 1083 3251 728 1084 3252 676 1084 3253 745 1084 3254 704 1085 3255 733 1085 3256 734 1085 3257 741 1086 3258 753 1086 3259 775 1086 3260 723 1087 3261 717 1087 3262 712 1087 3263 713 1088 3264 665 1088 3265 687 1088 3266 735 1089 3267 699 1089 3268 751 1089 3269 714 1090 3270 724 1090 3271 779 1090 3272 701 1091 3273 686 1091 3274 728 1091 3275 689 1092 3276 691 1092 3277 670 1092 3278 733 1093 3279 670 1093 3280 691 1093 3281 734 1094 3282 691 1094 3283 690 1094 3284 704 1095 3285 752 1095 3286 705 1095 3287 706 1096 3288 764 1096 3289 766 1096 3290 693 1097 3291 724 1097 3292 736 1097 3293 683 1098 3294 722 1098 3295 686 1098 3296 668 1099 3297 707 1099 3298 692 1099 3299 668 1100 3300 678 1100 3301 707 1100 3302 743 1101 3303 742 1101 3304 695 1101 3305 744 1102 3306 709 1102 3307 761 1102 3308 725 1103 3309 788 1103 3310 785 1103 3311 687 1104 3312 714 1104 3313 792 1104 3314 683 1105 3315 721 1105 3316 697 1105 3317 728 1106 3318 729 1106 3319 676 1106 3320 677 1107 3321 712 1107 3322 716 1107 3323 740 1108 3324 667 1108 3325 678 1108 3326 740 1109 3327 753 1109 3328 667 1109 3329 694 1110 3330 750 1110 3331 680 1110 3332 724 1111 3333 714 1111 3334 786 1111 3335 748 1112 3336 675 1112 3337 719 1112 3338 671 1113 3339 748 1113 3340 746 1113 3341 748 1114 3342 673 1114 3343 675 1114 3344 696 1115 3345 753 1115 3346 754 1115 3347 703 1116 3348 717 1116 3349 723 1116 3350 683 1117 3351 755 1117 3352 722 1117 3353 722 1118 3354 730 1118 3355 688 1118 3356 717 1119 3357 700 1119 3358 712 1119 3359 695 1120 3360 700 1120 3361 717 1120 3362 666 1121 3363 713 1121 3364 670 1121 3365 694 1122 3366 665 1122 3367 715 1122 3368 685 1123 3369 725 1123 3370 694 1123 3371 675 1124 3372 726 1124 3373 674 1124 3374 710 1125 3375 726 1125 3376 673 1125 3377 674 1126 3378 727 1126 3379 675 1126 3380 727 1127 3381 701 1127 3382 675 1127 3383 701 1128 3384 728 1128 3385 675 1128 3386 727 1129 3387 697 1129 3388 701 1129 3389 697 1130 3390 721 1130 3391 701 1130 3392 686 1131 3393 688 1131 3394 729 1131 3395 730 1132 3396 738 1132 3397 702 1132 3398 737 1133 3399 702 1133 3400 738 1133 3401 739 1134 3402 668 1134 3403 692 1134 3404 732 1135 3405 703 1135 3406 731 1135 3407 708 1136 3408 681 1136 3409 680 1136 3410 744 1137 3411 759 1137 3412 757 1137 3413 734 1138 3414 733 1138 3415 691 1138 3416 744 1139 3417 767 1139 3418 764 1139 3419 667 1140 3420 741 1140 3421 732 1140 3422 671 1141 3423 710 1141 3424 673 1141 3425 682 1142 3426 749 1142 3427 698 1142 3428 669 1143 3429 685 1143 3430 694 1143 3431 698 1144 3432 749 1144 3433 711 1144 3434 750 1145 3435 720 1145 3436 749 1145 3437 750 1146 3438 710 1146 3439 720 1146 3440 715 1147 3441 751 1147 3442 710 1147 3443 754 1148 3444 727 1148 3445 752 1148 3446 753 1149 3447 740 1149 3448 684 1149 3449 740 1150 3450 668 1150 3451 684 1150 3452 684 1151 3453 668 1151 3454 755 1151 3455 704 1152 3456 666 1152 3457 733 1152 3458 686 1153 3459 722 1153 3460 688 1153 3461 703 1154 3462 743 1154 3463 672 1154 3464 679 1155 3465 690 1155 3466 718 1155 3467 680 1156 3468 750 1156 3469 749 1156 3470 743 1157 3471 669 1157 3472 742 1157 3473 704 1158 3474 754 1158 3475 752 1158 3476 715 1159 3477 665 1159 3478 751 1159 3479 751 1160 3480 665 1160 3481 713 1160 3482 709 1161 3483 736 1161 3484 771 1161 3485 695 1162 3486 742 1162 3487 700 1162 3488 726 1163 3489 710 1163 3490 699 1163 3491 701 1164 3492 721 1164 3493 686 1164 3494 728 1165 3495 686 1165 3496 729 1165 3497 703 1166 3498 732 1166 3499 757 1166 3500 736 1167 3501 741 1167 3502 693 1167 3503 737 1168 3504 692 1168 3505 732 1168 3506 745 1169 3507 747 1169 3508 746 1169 3509 752 1170 3510 727 1170 3511 674 1170 3512 734 1171 3513 754 1171 3514 704 1171 3515 684 1172 3516 683 1172 3517 697 1172 3518 668 1173 3519 739 1173 3520 755 1173 3521 718 1174 3522 797 1174 3523 794 1174 3524 719 1175 3525 728 1175 3526 745 1175 3527 672 1176 3528 695 1176 3529 717 1176 3530 709 1177 3531 769 1177 3532 768 1177 3533 667 1178 3534 753 1178 3535 741 1178 3536 713 1179 3537 666 1179 3538 751 1179 3539 676 1180 3540 716 1180 3541 745 1180 3542 676 1181 3543 729 1181 3544 677 1181 3545 729 1182 3546 688 1182 3547 677 1182 3548 733 1183 3549 666 1183 3550 670 1183 3551 693 1184 3552 679 1184 3553 718 1184 3554 682 1185 3555 680 1185 3556 749 1185 3557 742 1186 3558 681 1186 3559 708 1186 3560 746 1187 3561 747 1187 3562 671 1187 3563 747 1188 3564 720 1188 3565 671 1188 3566 752 1189 3567 674 1189 3568 726 1189 3569 739 1190 3570 730 1190 3571 722 1190 3572 700 1191 3573 708 1191 3574 698 1191 3575 675 1192 3576 728 1192 3577 719 1192 3578 676 1193 3579 677 1193 3580 716 1193 3581 737 1194 3582 731 1194 3583 723 1194 3584 703 1195 3585 672 1195 3586 717 1195 3587 750 1196 3588 694 1196 3589 715 1196 3590 669 1197 3591 709 1197 3592 685 1197 3593 670 1198 3594 687 1198 3595 790 1198 3596 746 1199 3597 748 1199 3598 719 1199 3599 671 1200 3600 720 1200 3601 710 1200 3602 716 1201 3603 712 1201 3604 711 1201 3605 670 1202 3606 713 1202 3607 687 1202 3608 690 1203 3609 795 1203 3610 797 1203 3611 675 1204 3612 673 1204 3613 726 1204 3614 726 1205 3615 699 1205 3616 735 1205 3617 754 1206 3618 697 1206 3619 727 1206 3620 688 1207 3621 730 1207 3622 702 1207 3623 737 1208 3624 732 1208 3625 731 1208 3626 690 1209 3627 691 1209 3628 689 1209 3629 679 1210 3630 734 1210 3631 690 1210 3632 696 1211 3633 734 1211 3634 679 1211 3635 704 1212 3636 705 1212 3637 735 1212 3638 705 1213 3639 726 1213 3640 735 1213 3641 737 1214 3642 738 1214 3643 692 1214 3644 730 1215 3645 739 1215 3646 738 1215 3647 668 1216 3648 740 1216 3649 678 1216 3650 741 1217 3651 774 1217 3652 773 1217 3653 708 1218 3654 682 1218 3655 698 1218 3656 681 1219 3657 694 1219 3658 680 1219 3659 681 1220 3660 669 1220 3661 694 1220 3662 672 1221 3663 743 1221 3664 695 1221 3665 744 1222 3666 706 1222 3667 709 1222 3668 685 1223 3669 724 1223 3670 725 1223 3671 716 1224 3672 747 1224 3673 745 1224 3674 711 1225 3675 747 1225 3676 716 1225 3677 711 1226 3678 720 1226 3679 747 1226 3680 711 1227 3681 749 1227 3682 720 1227 3683 750 1228 3684 715 1228 3685 710 1228 3686 705 1229 3687 752 1229 3688 726 1229 3689 734 1230 3690 696 1230 3691 754 1230 3692 696 1231 3693 679 1231 3694 753 1231 3695 754 1232 3696 684 1232 3697 697 1232 3698 754 1233 3699 753 1233 3700 684 1233 3701 683 1234 3702 684 1234 3703 755 1234 3704 759 1235 3705 758 1235 3706 757 1235 3707 757 1236 3708 758 1236 3709 756 1236 3710 744 1237 3711 743 1237 3712 758 1237 3713 743 1238 3714 703 1238 3715 756 1238 3716 762 1239 3717 761 1239 3718 760 1239 3719 763 1240 3720 761 1240 3721 762 1240 3722 743 1241 3723 744 1241 3724 763 1241 3725 669 1242 3726 760 1242 3727 761 1242 3728 766 1243 3729 764 1243 3730 765 1243 3731 765 1244 3732 764 1244 3733 767 1244 3734 732 1245 3735 765 1245 3736 767 1245 3737 732 1246 3738 741 1246 3739 766 1246 3740 769 1247 3741 770 1247 3742 768 1247 3743 771 1248 3744 770 1248 3745 769 1248 3746 724 1249 3747 770 1249 3748 771 1249 3749 724 1250 3750 685 1250 3751 768 1250 3752 775 1251 3753 772 1251 3754 774 1251 3755 774 1252 3756 772 1252 3757 773 1252 3758 693 1253 3759 773 1253 3760 772 1253 3761 753 1254 3762 679 1254 3763 772 1254 3764 776 1255 3765 778 1255 3766 777 1255 3767 776 1256 3768 777 1256 3769 779 1256 3770 714 1257 3771 777 1257 3772 778 1257 3773 693 1258 3774 718 1258 3775 778 1258 3776 783 1259 3777 780 1259 3778 784 1259 3779 781 1260 3780 780 1260 3781 783 1260 3782 707 1261 3783 783 1261 3784 782 1261 3785 678 1262 3786 667 1262 3787 780 1262 3788 707 1263 3789 678 1263 3790 781 1263 3791 787 1264 3792 786 1264 3793 788 1264 3794 786 1265 3795 785 1265 3796 788 1265 3797 714 1266 3798 687 1266 3799 785 1266 3800 725 1267 3801 724 1267 3802 787 1267 3803 689 1268 3804 791 1268 3805 792 1268 3806 670 1269 3807 789 1269 3808 791 1269 3809 689 1270 3810 714 1270 3811 794 1270 3812 690 1271 3813 689 1271 3814 796 1271 3815 797 1272 3816 795 1272 3817 794 1272 3818 794 1273 3819 795 1273 3820 796 1273 3821 791 1274 3822 789 1274 3823 793 1274 3824 789 1275 3825 790 1275 3826 793 1275 3827 790 1276 3828 792 1276 3829 793 1276 3830 792 1277 3831 791 1277 3832 793 1277 3833 875 1278 3834 841 1278 3835 833 1278 3836 858 1279 3837 820 1279 3838 798 1279 3839 821 1280 3840 835 1280 3841 810 1280 3842 839 1281 3843 874 1281 3844 869 1281 3845 833 1282 3846 831 1282 3847 844 1282 3848 884 1283 3849 832 1283 3850 843 1283 3851 835 1284 3852 870 1284 3853 856 1284 3854 865 1285 3855 825 1285 3856 915 1285 3857 869 1286 3858 842 1286 3859 839 1286 3860 799 1287 3861 868 1287 3862 884 1287 3863 826 1288 3864 909 1288 3865 912 1288 3866 827 1289 3867 858 1289 3868 798 1289 3869 810 1290 3870 856 1290 3871 845 1290 3872 837 1291 3873 868 1291 3874 799 1291 3875 865 1292 3876 917 1292 3877 913 1292 3878 802 1293 3879 814 1293 3880 875 1293 3881 876 1294 3882 895 1294 3883 893 1294 3884 879 1295 3885 852 1295 3886 878 1295 3887 872 1296 3888 855 1296 3889 888 1296 3890 861 1297 3891 809 1297 3892 878 1297 3893 837 1298 3894 866 1298 3895 867 1298 3896 886 1299 3897 908 1299 3898 907 1299 3899 856 1300 3900 850 1300 3901 845 1300 3902 846 1301 3903 798 1301 3904 820 1301 3905 868 1302 3906 832 1302 3907 884 1302 3908 847 1303 3909 857 1303 3910 912 1303 3911 834 1304 3912 819 1304 3913 861 1304 3914 822 1305 3915 824 1305 3916 803 1305 3917 866 1306 3918 803 1306 3919 824 1306 3920 867 1307 3921 824 1307 3922 823 1307 3923 837 1308 3924 885 1308 3925 838 1308 3926 839 1309 3927 897 1309 3928 899 1309 3929 826 1310 3930 857 1310 3931 869 1310 3932 816 1311 3933 855 1311 3934 819 1311 3935 801 1312 3936 840 1312 3937 825 1312 3938 801 1313 3939 811 1313 3940 840 1313 3941 876 1314 3942 875 1314 3943 828 1314 3944 877 1315 3945 842 1315 3946 894 1315 3947 858 1316 3948 921 1316 3949 918 1316 3950 820 1317 3951 847 1317 3952 925 1317 3953 816 1318 3954 854 1318 3955 830 1318 3956 861 1319 3957 862 1319 3958 809 1319 3959 810 1320 3960 845 1320 3961 849 1320 3962 873 1321 3963 800 1321 3964 811 1321 3965 873 1322 3966 886 1322 3967 800 1322 3968 827 1323 3969 883 1323 3970 813 1323 3971 847 1324 3972 919 1324 3973 920 1324 3974 881 1325 3975 808 1325 3976 852 1325 3977 804 1326 3978 881 1326 3979 879 1326 3980 881 1327 3981 806 1327 3982 808 1327 3983 829 1328 3984 886 1328 3985 887 1328 3986 836 1329 3987 850 1329 3988 856 1329 3989 816 1330 3990 888 1330 3991 855 1330 3992 855 1331 3993 863 1331 3994 821 1331 3995 850 1332 3996 833 1332 3997 845 1332 3998 828 1333 3999 833 1333 4000 850 1333 4001 799 1334 4002 846 1334 4003 803 1334 4004 827 1335 4005 798 1335 4006 848 1335 4007 818 1336 4008 858 1336 4009 827 1336 4010 808 1337 4011 859 1337 4012 807 1337 4013 843 1338 4014 859 1338 4015 806 1338 4016 807 1339 4017 860 1339 4018 808 1339 4019 860 1340 4020 834 1340 4021 808 1340 4022 834 1341 4023 861 1341 4024 808 1341 4025 860 1342 4026 830 1342 4027 834 1342 4028 830 1343 4029 854 1343 4030 834 1343 4031 819 1344 4032 821 1344 4033 862 1344 4034 863 1345 4035 871 1345 4036 835 1345 4037 870 1346 4038 835 1346 4039 871 1346 4040 872 1347 4041 801 1347 4042 825 1347 4043 865 1348 4044 836 1348 4045 864 1348 4046 814 1349 4047 813 1349 4048 815 1349 4049 877 1350 4050 892 1350 4051 890 1350 4052 867 1351 4053 866 1351 4054 824 1351 4055 839 1352 4056 877 1352 4057 900 1352 4058 800 1353 4059 874 1353 4060 865 1353 4061 804 1354 4062 843 1354 4063 806 1354 4064 815 1355 4065 882 1355 4066 831 1355 4067 802 1356 4068 818 1356 4069 827 1356 4070 831 1357 4071 882 1357 4072 844 1357 4073 883 1358 4074 853 1358 4075 882 1358 4076 883 1359 4077 843 1359 4078 853 1359 4079 848 1360 4080 884 1360 4081 843 1360 4082 887 1361 4083 860 1361 4084 885 1361 4085 886 1362 4086 873 1362 4087 817 1362 4088 873 1363 4089 801 1363 4090 817 1363 4091 817 1364 4092 801 1364 4093 888 1364 4094 837 1365 4095 799 1365 4096 866 1365 4097 819 1366 4098 855 1366 4099 821 1366 4100 836 1367 4101 876 1367 4102 805 1367 4103 812 1368 4104 823 1368 4105 851 1368 4106 813 1369 4107 883 1369 4108 882 1369 4109 876 1370 4110 802 1370 4111 875 1370 4112 837 1371 4113 887 1371 4114 885 1371 4115 848 1372 4116 798 1372 4117 884 1372 4118 884 1373 4119 798 1373 4120 846 1373 4121 842 1374 4122 869 1374 4123 904 1374 4124 828 1375 4125 875 1375 4126 833 1375 4127 859 1376 4128 843 1376 4129 832 1376 4130 834 1377 4131 854 1377 4132 819 1377 4133 861 1378 4134 819 1378 4135 862 1378 4136 836 1379 4137 865 1379 4138 890 1379 4139 869 1380 4140 874 1380 4141 826 1380 4142 870 1381 4143 825 1381 4144 865 1381 4145 878 1382 4146 880 1382 4147 879 1382 4148 885 1383 4149 860 1383 4150 807 1383 4151 867 1384 4152 887 1384 4153 837 1384 4154 817 1385 4155 816 1385 4156 830 1385 4157 801 1386 4158 872 1386 4159 888 1386 4160 851 1387 4161 930 1387 4162 927 1387 4163 852 1388 4164 861 1388 4165 878 1388 4166 805 1389 4167 828 1389 4168 850 1389 4169 842 1390 4170 902 1390 4171 901 1390 4172 800 1391 4173 886 1391 4174 874 1391 4175 846 1392 4176 799 1392 4177 884 1392 4178 809 1393 4179 849 1393 4180 878 1393 4181 809 1394 4182 862 1394 4183 810 1394 4184 862 1395 4185 821 1395 4186 810 1395 4187 866 1396 4188 799 1396 4189 803 1396 4190 826 1397 4191 812 1397 4192 851 1397 4193 815 1398 4194 813 1398 4195 882 1398 4196 875 1399 4197 814 1399 4198 841 1399 4199 879 1400 4200 880 1400 4201 804 1400 4202 880 1401 4203 853 1401 4204 804 1401 4205 885 1402 4206 807 1402 4207 859 1402 4208 872 1403 4209 863 1403 4210 855 1403 4211 833 1404 4212 841 1404 4213 831 1404 4214 808 1405 4215 861 1405 4216 852 1405 4217 809 1406 4218 810 1406 4219 849 1406 4220 870 1407 4221 864 1407 4222 856 1407 4223 836 1408 4224 805 1408 4225 850 1408 4226 883 1409 4227 827 1409 4228 848 1409 4229 802 1410 4230 842 1410 4231 818 1410 4232 803 1411 4233 820 1411 4234 923 1411 4235 879 1412 4236 881 1412 4237 852 1412 4238 804 1413 4239 853 1413 4240 843 1413 4241 849 1414 4242 845 1414 4243 844 1414 4244 803 1415 4245 846 1415 4246 820 1415 4247 823 1416 4248 928 1416 4249 930 1416 4250 808 1417 4251 806 1417 4252 859 1417 4253 859 1418 4254 832 1418 4255 868 1418 4256 887 1419 4257 830 1419 4258 860 1419 4259 821 1420 4260 863 1420 4261 835 1420 4262 870 1421 4263 865 1421 4264 864 1421 4265 823 1422 4266 824 1422 4267 822 1422 4268 812 1423 4269 867 1423 4270 823 1423 4271 829 1424 4272 867 1424 4273 812 1424 4274 837 1425 4275 838 1425 4276 868 1425 4277 838 1426 4278 859 1426 4279 868 1426 4280 870 1427 4281 871 1427 4282 825 1427 4283 863 1428 4284 872 1428 4285 871 1428 4286 801 1429 4287 873 1429 4288 811 1429 4289 826 1430 4290 874 1430 4291 907 1430 4292 841 1431 4293 815 1431 4294 831 1431 4295 814 1432 4296 827 1432 4297 813 1432 4298 814 1433 4299 802 1433 4300 827 1433 4301 805 1434 4302 876 1434 4303 828 1434 4304 877 1435 4305 839 1435 4306 842 1435 4307 818 1436 4308 857 1436 4309 858 1436 4310 849 1437 4311 880 1437 4312 878 1437 4313 844 1438 4314 880 1438 4315 849 1438 4316 844 1439 4317 853 1439 4318 880 1439 4319 844 1440 4320 882 1440 4321 853 1440 4322 883 1441 4323 848 1441 4324 843 1441 4325 838 1442 4326 885 1442 4327 859 1442 4328 867 1443 4329 829 1443 4330 887 1443 4331 829 1444 4332 812 1444 4333 886 1444 4334 887 1445 4335 817 1445 4336 830 1445 4337 887 1446 4338 886 1446 4339 817 1446 4340 816 1447 4341 817 1447 4342 888 1447 4343 892 1448 4344 891 1448 4345 890 1448 4346 890 1449 4347 891 1449 4348 889 1449 4349 877 1450 4350 876 1450 4351 891 1450 4352 876 1451 4353 836 1451 4354 889 1451 4355 895 1452 4356 894 1452 4357 893 1452 4358 896 1453 4359 894 1453 4360 895 1453 4361 877 1454 4362 896 1454 4363 895 1454 4364 802 1455 4365 893 1455 4366 894 1455 4367 899 1456 4368 897 1456 4369 898 1456 4370 898 1457 4371 897 1457 4372 900 1457 4373 877 1458 4374 865 1458 4375 898 1458 4376 865 1459 4377 874 1459 4378 899 1459 4379 902 1460 4380 903 1460 4381 901 1460 4382 904 1461 4383 903 1461 4384 902 1461 4385 857 1462 4386 903 1462 4387 904 1462 4388 857 1463 4389 818 1463 4390 901 1463 4391 908 1464 4392 905 1464 4393 907 1464 4394 907 1465 4395 905 1465 4396 906 1465 4397 826 1466 4398 906 1466 4399 905 1466 4400 886 1467 4401 812 1467 4402 905 1467 4403 909 1468 4404 911 1468 4405 910 1468 4406 909 1469 4407 910 1469 4408 912 1469 4409 847 1470 4410 910 1470 4411 911 1470 4412 826 1471 4413 851 1471 4414 911 1471 4415 916 1472 4416 913 1472 4417 917 1472 4418 914 1473 4419 913 1473 4420 916 1473 4421 840 1474 4422 916 1474 4423 915 1474 4424 811 1475 4425 800 1475 4426 913 1475 4427 811 1476 4428 914 1476 4429 916 1476 4430 920 1477 4431 919 1477 4432 921 1477 4433 919 1478 4434 918 1478 4435 921 1478 4436 847 1479 4437 820 1479 4438 918 1479 4439 858 1480 4440 857 1480 4441 920 1480 4442 822 1481 4443 924 1481 4444 925 1481 4445 803 1482 4446 922 1482 4447 924 1482 4448 822 1483 4449 847 1483 4450 927 1483 4451 823 1484 4452 822 1484 4453 929 1484 4454 930 1485 4455 928 1485 4456 927 1485 4457 927 1486 4458 928 1486 4459 929 1486 4460 924 1487 4461 922 1487 4462 926 1487 4463 922 1488 4464 923 1488 4465 926 1488 4466 923 1489 4467 925 1489 4468 926 1489 4469 925 1490 4470 924 1490 4471 926 1490 4472 1008 1491 4473 974 1491 4474 966 1491 4475 991 1492 4476 953 1492 4477 931 1492 4478 954 1493 4479 968 1493 4480 943 1493 4481 972 1494 4482 1007 1494 4483 1002 1494 4484 966 1495 4485 964 1495 4486 977 1495 4487 1017 1496 4488 965 1496 4489 976 1496 4490 968 1497 4491 1003 1497 4492 989 1497 4493 998 1498 4494 958 1498 4495 1048 1498 4496 1002 1499 4497 975 1499 4498 972 1499 4499 932 1500 4500 1001 1500 4501 1017 1500 4502 959 1501 4503 1042 1501 4504 1045 1501 4505 960 1502 4506 991 1502 4507 931 1502 4508 943 1503 4509 989 1503 4510 978 1503 4511 970 1504 4512 1001 1504 4513 932 1504 4514 998 1505 4515 1050 1505 4516 1046 1505 4517 935 1506 4518 947 1506 4519 1008 1506 4520 1009 1507 4521 1028 1507 4522 1026 1507 4523 1012 1508 4524 985 1508 4525 1011 1508 4526 1005 1509 4527 988 1509 4528 1021 1509 4529 994 1510 4530 942 1510 4531 1011 1510 4532 970 1511 4533 999 1511 4534 1000 1511 4535 1019 1512 4536 1041 1512 4537 1040 1512 4538 989 1513 4539 983 1513 4540 978 1513 4541 979 1514 4542 931 1514 4543 953 1514 4544 1001 1515 4545 965 1515 4546 1017 1515 4547 980 1516 4548 990 1516 4549 1045 1516 4550 967 1517 4551 952 1517 4552 994 1517 4553 955 1518 4554 957 1518 4555 936 1518 4556 999 1519 4557 936 1519 4558 957 1519 4559 1000 1520 4560 957 1520 4561 956 1520 4562 970 1521 4563 1018 1521 4564 971 1521 4565 972 1522 4566 1030 1522 4567 1032 1522 4568 959 1523 4569 990 1523 4570 1002 1523 4571 949 1524 4572 988 1524 4573 952 1524 4574 934 1525 4575 973 1525 4576 958 1525 4577 934 1526 4578 944 1526 4579 973 1526 4580 1009 1527 4581 1008 1527 4582 961 1527 4583 1010 1528 4584 975 1528 4585 1027 1528 4586 991 1529 4587 1054 1529 4588 1051 1529 4589 953 1530 4590 980 1530 4591 1058 1530 4592 949 1531 4593 987 1531 4594 963 1531 4595 994 1532 4596 995 1532 4597 942 1532 4598 943 1533 4599 978 1533 4600 982 1533 4601 1006 1534 4602 933 1534 4603 944 1534 4604 1006 1535 4605 1019 1535 4606 933 1535 4607 960 1536 4608 1016 1536 4609 946 1536 4610 980 1537 4611 1052 1537 4612 1053 1537 4613 1014 1538 4614 941 1538 4615 985 1538 4616 937 1539 4617 1014 1539 4618 1012 1539 4619 1014 1540 4620 939 1540 4621 941 1540 4622 962 1541 4623 1019 1541 4624 1020 1541 4625 969 1542 4626 983 1542 4627 989 1542 4628 949 1543 4629 1021 1543 4630 988 1543 4631 988 1544 4632 996 1544 4633 954 1544 4634 983 1545 4635 966 1545 4636 978 1545 4637 961 1546 4638 966 1546 4639 983 1546 4640 932 1547 4641 979 1547 4642 936 1547 4643 960 1548 4644 931 1548 4645 981 1548 4646 951 1549 4647 991 1549 4648 960 1549 4649 941 1550 4650 992 1550 4651 940 1550 4652 976 1551 4653 992 1551 4654 939 1551 4655 940 1552 4656 993 1552 4657 941 1552 4658 993 1553 4659 967 1553 4660 941 1553 4661 967 1554 4662 994 1554 4663 941 1554 4664 993 1555 4665 963 1555 4666 967 1555 4667 963 1556 4668 987 1556 4669 967 1556 4670 952 1557 4671 954 1557 4672 995 1557 4673 996 1558 4674 1004 1558 4675 968 1558 4676 1003 1559 4677 968 1559 4678 1004 1559 4679 1005 1560 4680 934 1560 4681 958 1560 4682 998 1561 4683 969 1561 4684 997 1561 4685 947 1562 4686 946 1562 4687 948 1562 4688 1010 1563 4689 1025 1563 4690 1023 1563 4691 1000 1564 4692 999 1564 4693 957 1564 4694 972 1565 4695 1010 1565 4696 1033 1565 4697 933 1566 4698 1007 1566 4699 998 1566 4700 937 1567 4701 976 1567 4702 939 1567 4703 948 1568 4704 1015 1568 4705 964 1568 4706 935 1569 4707 951 1569 4708 960 1569 4709 964 1570 4710 1015 1570 4711 977 1570 4712 1016 1571 4713 986 1571 4714 1015 1571 4715 1016 1572 4716 976 1572 4717 986 1572 4718 981 1573 4719 1017 1573 4720 976 1573 4721 1020 1574 4722 993 1574 4723 1018 1574 4724 1019 1575 4725 1006 1575 4726 950 1575 4727 1006 1576 4728 934 1576 4729 950 1576 4730 950 1577 4731 934 1577 4732 1021 1577 4733 970 1578 4734 932 1578 4735 999 1578 4736 952 1579 4737 988 1579 4738 954 1579 4739 969 1580 4740 1009 1580 4741 938 1580 4742 945 1581 4743 956 1581 4744 984 1581 4745 946 1582 4746 1016 1582 4747 1015 1582 4748 1009 1583 4749 935 1583 4750 1008 1583 4751 970 1584 4752 1020 1584 4753 1018 1584 4754 981 1585 4755 931 1585 4756 1017 1585 4757 1017 1586 4758 931 1586 4759 979 1586 4760 975 1587 4761 1002 1587 4762 1037 1587 4763 961 1588 4764 1008 1588 4765 966 1588 4766 992 1589 4767 976 1589 4768 965 1589 4769 967 1590 4770 987 1590 4771 952 1590 4772 994 1591 4773 952 1591 4774 995 1591 4775 969 1592 4776 998 1592 4777 1023 1592 4778 1002 1593 4779 1007 1593 4780 959 1593 4781 1003 1594 4782 958 1594 4783 998 1594 4784 1011 1595 4785 1013 1595 4786 1012 1595 4787 1018 1596 4788 993 1596 4789 940 1596 4790 1000 1597 4791 1020 1597 4792 970 1597 4793 950 1598 4794 949 1598 4795 963 1598 4796 934 1599 4797 1005 1599 4798 1021 1599 4799 984 1600 4800 1063 1600 4801 1060 1600 4802 985 1601 4803 994 1601 4804 1011 1601 4805 938 1602 4806 961 1602 4807 983 1602 4808 975 1603 4809 1035 1603 4810 1034 1603 4811 933 1604 4812 1019 1604 4813 1007 1604 4814 979 1605 4815 932 1605 4816 1017 1605 4817 942 1606 4818 982 1606 4819 1011 1606 4820 942 1607 4821 995 1607 4822 943 1607 4823 995 1608 4824 954 1608 4825 943 1608 4826 999 1609 4827 932 1609 4828 936 1609 4829 959 1610 4830 945 1610 4831 984 1610 4832 948 1611 4833 946 1611 4834 1015 1611 4835 1008 1612 4836 947 1612 4837 974 1612 4838 1012 1613 4839 1013 1613 4840 937 1613 4841 1013 1614 4842 986 1614 4843 937 1614 4844 1018 1615 4845 940 1615 4846 992 1615 4847 1005 1616 4848 996 1616 4849 988 1616 4850 966 1617 4851 974 1617 4852 964 1617 4853 941 1618 4854 994 1618 4855 985 1618 4856 942 1619 4857 943 1619 4858 982 1619 4859 1003 1620 4860 997 1620 4861 989 1620 4862 969 1621 4863 938 1621 4864 983 1621 4865 1016 1622 4866 960 1622 4867 981 1622 4868 935 1623 4869 975 1623 4870 951 1623 4871 936 1624 4872 953 1624 4873 1056 1624 4874 1012 1625 4875 1014 1625 4876 985 1625 4877 937 1626 4878 986 1626 4879 976 1626 4880 982 1627 4881 978 1627 4882 977 1627 4883 936 1628 4884 979 1628 4885 953 1628 4886 956 1629 4887 1061 1629 4888 1063 1629 4889 941 1630 4890 939 1630 4891 992 1630 4892 992 1631 4893 965 1631 4894 1001 1631 4895 1020 1632 4896 963 1632 4897 993 1632 4898 954 1633 4899 996 1633 4900 968 1633 4901 1003 1634 4902 998 1634 4903 997 1634 4904 956 1635 4905 957 1635 4906 955 1635 4907 945 1636 4908 1000 1636 4909 956 1636 4910 962 1637 4911 1000 1637 4912 945 1637 4913 970 1638 4914 971 1638 4915 1001 1638 4916 971 1639 4917 992 1639 4918 1001 1639 4919 1003 1640 4920 1004 1640 4921 958 1640 4922 996 1641 4923 1005 1641 4924 1004 1641 4925 934 1642 4926 1006 1642 4927 944 1642 4928 959 1643 4929 1007 1643 4930 1040 1643 4931 974 1644 4932 948 1644 4933 964 1644 4934 947 1645 4935 960 1645 4936 946 1645 4937 947 1646 4938 935 1646 4939 960 1646 4940 938 1647 4941 1009 1647 4942 961 1647 4943 1010 1648 4944 972 1648 4945 975 1648 4946 951 1649 4947 990 1649 4948 991 1649 4949 982 1650 4950 1013 1650 4951 1011 1650 4952 977 1651 4953 1013 1651 4954 982 1651 4955 977 1652 4956 986 1652 4957 1013 1652 4958 977 1653 4959 1015 1653 4960 986 1653 4961 1016 1654 4962 981 1654 4963 976 1654 4964 971 1655 4965 1018 1655 4966 992 1655 4967 1000 1656 4968 962 1656 4969 1020 1656 4970 962 1657 4971 945 1657 4972 1019 1657 4973 1020 1658 4974 950 1658 4975 963 1658 4976 1020 1659 4977 1019 1659 4978 950 1659 4979 949 1660 4980 950 1660 4981 1021 1660 4982 1025 1661 4983 1024 1661 4984 1023 1661 4985 1023 1662 4986 1024 1662 4987 1022 1662 4988 1010 1663 4989 1009 1663 4990 1024 1663 4991 1009 1664 4992 969 1664 4993 1022 1664 4994 1028 1665 4995 1027 1665 4996 1026 1665 4997 1029 1666 4998 1027 1666 4999 1028 1666 5000 1010 1667 5001 1029 1667 5002 1028 1667 5003 935 1668 5004 1026 1668 5005 1027 1668 5006 1032 1669 5007 1030 1669 5008 1031 1669 5009 1031 1670 5010 1030 1670 5011 1033 1670 5012 1010 1671 5013 998 1671 5014 1031 1671 5015 998 1672 5016 1007 1672 5017 1032 1672 5018 1035 1673 5019 1036 1673 5020 1034 1673 5021 1037 1674 5022 1036 1674 5023 1035 1674 5024 990 1675 5025 1036 1675 5026 1037 1675 5027 990 1676 5028 951 1676 5029 1034 1676 5030 1041 1677 5031 1038 1677 5032 1040 1677 5033 1040 1678 5034 1038 1678 5035 1039 1678 5036 959 1679 5037 1039 1679 5038 1038 1679 5039 1019 1680 5040 945 1680 5041 1038 1680 5042 1042 1681 5043 1044 1681 5044 1043 1681 5045 1042 1682 5046 1043 1682 5047 1045 1682 5048 980 1683 5049 1043 1683 5050 1044 1683 5051 959 1684 5052 984 1684 5053 1044 1684 5054 1049 1685 5055 1046 1685 5056 1050 1685 5057 1047 1686 5058 1046 1686 5059 1049 1686 5060 973 1687 5061 1049 1687 5062 1048 1687 5063 944 1688 5064 933 1688 5065 1046 1688 5066 944 1689 5067 1047 1689 5068 1049 1689 5069 1053 1690 5070 1052 1690 5071 1054 1690 5072 1052 1691 5073 1051 1691 5074 1054 1691 5075 980 1692 5076 953 1692 5077 1051 1692 5078 991 1693 5079 990 1693 5080 1053 1693 5081 955 1694 5082 1057 1694 5083 1058 1694 5084 936 1695 5085 1055 1695 5086 1057 1695 5087 955 1696 5088 980 1696 5089 1060 1696 5090 956 1697 5091 955 1697 5092 1062 1697 5093 1063 1698 5094 1061 1698 5095 1060 1698 5096 1060 1699 5097 1061 1699 5098 1062 1699 5099 1057 1700 5100 1055 1700 5101 1059 1700 5102 1055 1701 5103 1056 1701 5104 1059 1701 5105 1056 1702 5106 1058 1702 5107 1059 1702 5108 1058 1703 5109 1057 1703 5110 1059 1703 5111 47 1704 5112 35 1704 5113 46 1704 5114 12 1705 5115 37 1705 5116 58 1705 5117 119 1706 5118 67 1706 5119 117 1706 5120 59 1707 5121 28 1707 5122 114 1707 5123 2 1708 5124 67 1708 5125 115 1708 5126 4 1709 5127 78 1709 5128 95 1709 5129 76 1710 5130 88 1710 5131 109 1710 5132 112 1711 5133 49 1711 5134 114 1711 5135 76 1712 5136 41 1712 5137 101 1712 5138 56 1713 5139 18 1713 5140 21 1713 5141 98 1714 5142 79 1714 5143 96 1714 5144 22 1715 5145 60 1715 5146 120 1715 5147 125 1716 5148 22 1716 5149 127 1716 5150 59 1717 5151 49 1717 5152 122 1717 5153 66 1718 5154 38 1718 5155 58 1718 5156 73 1719 5157 74 1719 5158 27 1719 5159 43 1720 5160 16 1720 5161 17 1720 5162 67 1721 5163 79 1721 5164 92 1721 5165 99 1722 5166 41 1722 5167 102 1722 5168 83 1723 5169 6 1723 5170 8 1723 5171 104 1724 5172 44 1724 5173 106 1724 5174 91 1725 5175 38 1725 5176 92 1725 5177 49 1726 5178 53 1726 5179 129 1726 5180 20 1727 5181 44 1727 5182 103 1727 5183 124 1728 5184 5 1728 5185 125 1728 5186 53 1729 5187 25 1729 5188 132 1729 5189 108 1730 5190 28 1730 5191 109 1730 5192 94 1731 5193 79 1731 5194 93 1731 5195 93 1732 5196 78 1732 5197 91 1732 5198 78 1733 5199 79 1733 5200 97 1733 5201 44 1734 5202 4 1734 5203 96 1734 5204 102 1735 5205 79 1735 5206 100 1735 5207 100 1736 5208 67 1736 5209 101 1736 5210 71 1737 5211 59 1737 5212 106 1737 5213 105 1738 5214 59 1738 5215 103 1738 5216 14 1739 5217 28 1739 5218 107 1739 5219 110 1740 5220 88 1740 5221 107 1740 5222 53 1741 5223 49 1741 5224 113 1741 5225 111 1742 5226 28 1742 5227 113 1742 5228 117 1743 5229 118 1743 5230 119 1743 5231 27 1744 5232 42 1744 5233 117 1744 5234 116 1745 5235 13 1745 5236 115 1745 5237 42 1746 5238 13 1746 5239 118 1746 5240 121 1747 5241 49 1747 5242 120 1747 5243 123 1748 5244 60 1748 5245 122 1748 5246 49 1749 5247 24 1749 5248 127 1749 5249 24 1750 5250 5 1750 5251 126 1750 5252 131 1751 5253 24 1751 5254 129 1751 5255 130 1752 5256 25 1752 5257 131 1752 5258 180 1753 5259 168 1753 5260 179 1753 5261 145 1754 5262 170 1754 5263 191 1754 5264 252 1755 5265 200 1755 5266 250 1755 5267 192 1756 5268 161 1756 5269 247 1756 5270 135 1757 5271 200 1757 5272 248 1757 5273 137 1758 5274 211 1758 5275 228 1758 5276 209 1759 5277 221 1759 5278 242 1759 5279 245 1760 5280 182 1760 5281 247 1760 5282 209 1761 5283 174 1761 5284 234 1761 5285 189 1762 5286 151 1762 5287 154 1762 5288 231 1763 5289 212 1763 5290 229 1763 5291 155 1764 5292 193 1764 5293 253 1764 5294 258 1765 5295 155 1765 5296 260 1765 5297 192 1766 5298 182 1766 5299 255 1766 5300 199 1767 5301 171 1767 5302 191 1767 5303 206 1768 5304 207 1768 5305 160 1768 5306 176 1769 5307 149 1769 5308 150 1769 5309 200 1770 5310 212 1770 5311 225 1770 5312 232 1771 5313 174 1771 5314 235 1771 5315 216 1772 5316 139 1772 5317 141 1772 5318 237 1773 5319 177 1773 5320 239 1773 5321 224 1774 5322 171 1774 5323 225 1774 5324 182 1775 5325 186 1775 5326 262 1775 5327 153 1776 5328 177 1776 5329 236 1776 5330 257 1777 5331 138 1777 5332 258 1777 5333 186 1778 5334 158 1778 5335 265 1778 5336 241 1779 5337 161 1779 5338 242 1779 5339 227 1780 5340 212 1780 5341 226 1780 5342 226 1781 5343 211 1781 5344 224 1781 5345 211 1782 5346 212 1782 5347 230 1782 5348 177 1783 5349 137 1783 5350 229 1783 5351 235 1784 5352 212 1784 5353 233 1784 5354 233 1785 5355 200 1785 5356 234 1785 5357 204 1786 5358 192 1786 5359 239 1786 5360 238 1787 5361 192 1787 5362 236 1787 5363 147 1788 5364 161 1788 5365 240 1788 5366 243 1789 5367 221 1789 5368 240 1789 5369 186 1790 5370 182 1790 5371 246 1790 5372 244 1791 5373 161 1791 5374 246 1791 5375 250 1792 5376 251 1792 5377 252 1792 5378 160 1793 5379 175 1793 5380 250 1793 5381 249 1794 5382 146 1794 5383 248 1794 5384 175 1795 5385 146 1795 5386 251 1795 5387 254 1796 5388 182 1796 5389 253 1796 5390 256 1797 5391 193 1797 5392 255 1797 5393 182 1798 5394 157 1798 5395 260 1798 5396 157 1799 5397 138 1799 5398 259 1799 5399 264 1800 5400 157 1800 5401 262 1800 5402 263 1801 5403 158 1801 5404 264 1801 5405 313 1802 5406 301 1802 5407 312 1802 5408 278 1803 5409 303 1803 5410 324 1803 5411 333 1804 5412 293 1804 5413 385 1804 5414 325 1805 5415 294 1805 5416 380 1805 5417 268 1806 5418 333 1806 5419 381 1806 5420 270 1807 5421 344 1807 5422 361 1807 5423 342 1808 5424 354 1808 5425 375 1808 5426 378 1809 5427 315 1809 5428 380 1809 5429 342 1810 5430 307 1810 5431 367 1810 5432 322 1811 5433 284 1811 5434 287 1811 5435 364 1812 5436 345 1812 5437 362 1812 5438 288 1813 5439 326 1813 5440 386 1813 5441 391 1814 5442 288 1814 5443 393 1814 5444 325 1815 5445 315 1815 5446 388 1815 5447 332 1816 5448 304 1816 5449 324 1816 5450 339 1817 5451 340 1817 5452 293 1817 5453 309 1818 5454 282 1818 5455 283 1818 5456 333 1819 5457 345 1819 5458 358 1819 5459 365 1820 5460 307 1820 5461 368 1820 5462 349 1821 5463 272 1821 5464 274 1821 5465 370 1822 5466 310 1822 5467 372 1822 5468 357 1823 5469 304 1823 5470 358 1823 5471 315 1824 5472 319 1824 5473 395 1824 5474 286 1825 5475 310 1825 5476 369 1825 5477 390 1826 5478 271 1826 5479 391 1826 5480 319 1827 5481 291 1827 5482 398 1827 5483 374 1828 5484 294 1828 5485 375 1828 5486 360 1829 5487 345 1829 5488 359 1829 5489 359 1830 5490 344 1830 5491 357 1830 5492 363 1831 5493 344 1831 5494 364 1831 5495 310 1832 5496 270 1832 5497 362 1832 5498 345 1833 5499 333 1833 5500 368 1833 5501 366 1834 5502 333 1834 5503 367 1834 5504 337 1835 5505 325 1835 5506 372 1835 5507 371 1836 5508 325 1836 5509 369 1836 5510 280 1837 5511 294 1837 5512 373 1837 5513 376 1838 5514 354 1838 5515 373 1838 5516 319 1839 5517 315 1839 5518 379 1839 5519 377 1840 5520 294 1840 5521 379 1840 5522 383 1841 5523 384 1841 5524 385 1841 5525 293 1842 5526 308 1842 5527 383 1842 5528 382 1843 5529 279 1843 5530 381 1843 5531 384 1844 5532 308 1844 5533 382 1844 5534 387 1845 5535 315 1845 5536 386 1845 5537 389 1846 5538 326 1846 5539 388 1846 5540 315 1847 5541 290 1847 5542 393 1847 5543 290 1848 5544 271 1848 5545 392 1848 5546 397 1849 5547 290 1849 5548 395 1849 5549 396 1850 5550 291 1850 5551 397 1850 5552 446 1851 5553 434 1851 5554 445 1851 5555 411 1852 5556 436 1852 5557 457 1852 5558 518 1853 5559 466 1853 5560 516 1853 5561 458 1854 5562 427 1854 5563 513 1854 5564 401 1855 5565 466 1855 5566 514 1855 5567 403 1856 5568 477 1856 5569 494 1856 5570 475 1857 5571 487 1857 5572 508 1857 5573 511 1858 5574 448 1858 5575 513 1858 5576 475 1859 5577 440 1859 5578 500 1859 5579 455 1860 5580 417 1860 5581 420 1860 5582 497 1861 5583 478 1861 5584 495 1861 5585 421 1862 5586 459 1862 5587 519 1862 5588 524 1863 5589 421 1863 5590 526 1863 5591 458 1864 5592 448 1864 5593 521 1864 5594 465 1865 5595 437 1865 5596 457 1865 5597 472 1866 5598 473 1866 5599 426 1866 5600 442 1867 5601 415 1867 5602 416 1867 5603 466 1868 5604 478 1868 5605 491 1868 5606 498 1869 5607 440 1869 5608 501 1869 5609 482 1870 5610 405 1870 5611 407 1870 5612 503 1871 5613 443 1871 5614 505 1871 5615 490 1872 5616 437 1872 5617 491 1872 5618 448 1873 5619 452 1873 5620 528 1873 5621 419 1874 5622 443 1874 5623 502 1874 5624 523 1875 5625 404 1875 5626 524 1875 5627 452 1876 5628 424 1876 5629 531 1876 5630 507 1877 5631 427 1877 5632 508 1877 5633 493 1878 5634 478 1878 5635 492 1878 5636 492 1879 5637 477 1879 5638 490 1879 5639 477 1880 5640 478 1880 5641 496 1880 5642 443 1881 5643 403 1881 5644 495 1881 5645 501 1882 5646 478 1882 5647 499 1882 5648 499 1883 5649 466 1883 5650 500 1883 5651 470 1884 5652 458 1884 5653 505 1884 5654 504 1885 5655 458 1885 5656 502 1885 5657 413 1886 5658 427 1886 5659 506 1886 5660 509 1887 5661 487 1887 5662 506 1887 5663 452 1888 5664 448 1888 5665 512 1888 5666 510 1889 5667 427 1889 5668 512 1889 5669 516 1890 5670 517 1890 5671 518 1890 5672 426 1891 5673 441 1891 5674 516 1891 5675 515 1892 5676 412 1892 5677 514 1892 5678 441 1893 5679 412 1893 5680 517 1893 5681 520 1894 5682 448 1894 5683 519 1894 5684 522 1895 5685 459 1895 5686 521 1895 5687 448 1896 5688 423 1896 5689 526 1896 5690 423 1897 5691 404 1897 5692 525 1897 5693 530 1898 5694 423 1898 5695 528 1898 5696 529 1899 5697 424 1899 5698 530 1899 5699 579 1900 5700 567 1900 5701 578 1900 5702 544 1901 5703 569 1901 5704 590 1901 5705 651 1902 5706 599 1902 5707 649 1902 5708 591 1903 5709 560 1903 5710 646 1903 5711 534 1904 5712 599 1904 5713 647 1904 5714 536 1905 5715 610 1905 5716 627 1905 5717 608 1906 5718 620 1906 5719 641 1906 5720 644 1907 5721 581 1907 5722 646 1907 5723 608 1908 5724 573 1908 5725 633 1908 5726 588 1909 5727 550 1909 5728 553 1909 5729 630 1910 5730 611 1910 5731 628 1910 5732 554 1911 5733 592 1911 5734 652 1911 5735 657 1912 5736 554 1912 5737 659 1912 5738 591 1913 5739 581 1913 5740 654 1913 5741 598 1914 5742 570 1914 5743 590 1914 5744 605 1915 5745 606 1915 5746 559 1915 5747 575 1916 5748 548 1916 5749 549 1916 5750 599 1917 5751 611 1917 5752 624 1917 5753 631 1918 5754 573 1918 5755 634 1918 5756 615 1919 5757 538 1919 5758 540 1919 5759 636 1920 5760 576 1920 5761 638 1920 5762 623 1921 5763 570 1921 5764 624 1921 5765 581 1922 5766 585 1922 5767 661 1922 5768 552 1923 5769 576 1923 5770 635 1923 5771 656 1924 5772 537 1924 5773 657 1924 5774 585 1925 5775 557 1925 5776 664 1925 5777 640 1926 5778 560 1926 5779 641 1926 5780 626 1927 5781 611 1927 5782 625 1927 5783 625 1928 5784 610 1928 5785 623 1928 5786 610 1929 5787 611 1929 5788 629 1929 5789 576 1930 5790 536 1930 5791 628 1930 5792 634 1931 5793 611 1931 5794 632 1931 5795 632 1932 5796 599 1932 5797 633 1932 5798 603 1933 5799 591 1933 5800 638 1933 5801 637 1934 5802 591 1934 5803 635 1934 5804 546 1935 5805 560 1935 5806 639 1935 5807 642 1936 5808 620 1936 5809 639 1936 5810 585 1937 5811 581 1937 5812 645 1937 5813 643 1938 5814 560 1938 5815 645 1938 5816 649 1939 5817 650 1939 5818 651 1939 5819 559 1940 5820 574 1940 5821 649 1940 5822 648 1941 5823 545 1941 5824 647 1941 5825 574 1942 5826 545 1942 5827 650 1942 5828 653 1943 5829 581 1943 5830 652 1943 5831 655 1944 5832 592 1944 5833 654 1944 5834 581 1945 5835 556 1945 5836 659 1945 5837 556 1946 5838 537 1946 5839 658 1946 5840 663 1947 5841 556 1947 5842 661 1947 5843 662 1948 5844 557 1948 5845 663 1948 5846 712 1949 5847 700 1949 5848 711 1949 5849 677 1950 5850 702 1950 5851 723 1950 5852 732 1951 5853 692 1951 5854 784 1951 5855 724 1952 5856 693 1952 5857 779 1952 5858 667 1953 5859 732 1953 5860 780 1953 5861 669 1954 5862 743 1954 5863 760 1954 5864 774 1955 5865 741 1955 5866 775 1955 5867 777 1956 5868 714 1956 5869 779 1956 5870 741 1957 5871 706 1957 5872 766 1957 5873 721 1958 5874 683 1958 5875 686 1958 5876 763 1959 5877 744 1959 5878 761 1959 5879 687 1960 5880 725 1960 5881 785 1960 5882 790 1961 5883 687 1961 5884 792 1961 5885 787 1962 5886 724 1962 5887 786 1962 5888 731 1963 5889 703 1963 5890 723 1963 5891 738 1964 5892 739 1964 5893 692 1964 5894 682 1965 5895 708 1965 5896 680 1965 5897 732 1966 5898 744 1966 5899 757 1966 5900 706 1967 5901 744 1967 5902 764 1967 5903 748 1968 5904 671 1968 5905 673 1968 5906 769 1969 5907 709 1969 5908 771 1969 5909 756 1970 5910 703 1970 5911 757 1970 5912 714 1971 5913 718 1971 5914 794 1971 5915 685 1972 5916 709 1972 5917 768 1972 5918 789 1973 5919 670 1973 5920 790 1973 5921 718 1974 5922 690 1974 5923 797 1974 5924 693 1975 5925 741 1975 5926 773 1975 5927 759 1976 5928 744 1976 5929 758 1976 5930 758 1977 5931 743 1977 5932 756 1977 5933 762 1978 5934 743 1978 5935 763 1978 5936 709 1979 5937 669 1979 5938 761 1979 5939 744 1980 5940 732 1980 5941 767 1980 5942 765 1981 5943 732 1981 5944 766 1981 5945 736 1982 5946 724 1982 5947 771 1982 5948 770 1983 5949 724 1983 5950 768 1983 5951 679 1984 5952 693 1984 5953 772 1984 5954 775 1985 5955 753 1985 5956 772 1985 5957 718 1986 5958 714 1986 5959 778 1986 5960 776 1987 5961 693 1987 5962 778 1987 5963 782 1988 5964 783 1988 5965 784 1988 5966 692 1989 5967 707 1989 5968 782 1989 5969 781 1990 5970 678 1990 5971 780 1990 5972 783 1991 5973 707 1991 5974 781 1991 5975 786 1992 5976 714 1992 5977 785 1992 5978 788 1993 5979 725 1993 5980 787 1993 5981 714 1994 5982 689 1994 5983 792 1994 5984 689 1995 5985 670 1995 5986 791 1995 5987 796 1996 5988 689 1996 5989 794 1996 5990 795 1997 5991 690 1997 5992 796 1997 5993 845 1998 5994 833 1998 5995 844 1998 5996 810 1999 5997 835 1999 5998 856 1999 5999 917 2000 6000 865 2000 6001 915 2000 6002 857 2001 6003 826 2001 6004 912 2001 6005 800 2002 6006 865 2002 6007 913 2002 6008 802 2003 6009 876 2003 6010 893 2003 6011 874 2004 6012 886 2004 6013 907 2004 6014 910 2005 6015 847 2005 6016 912 2005 6017 874 2006 6018 839 2006 6019 899 2006 6020 854 2007 6021 816 2007 6022 819 2007 6023 896 2008 6024 877 2008 6025 894 2008 6026 820 2009 6027 858 2009 6028 918 2009 6029 923 2010 6030 820 2010 6031 925 2010 6032 857 2011 6033 847 2011 6034 920 2011 6035 864 2012 6036 836 2012 6037 856 2012 6038 871 2013 6039 872 2013 6040 825 2013 6041 841 2014 6042 814 2014 6043 815 2014 6044 865 2015 6045 877 2015 6046 890 2015 6047 897 2016 6048 839 2016 6049 900 2016 6050 881 2017 6051 804 2017 6052 806 2017 6053 902 2018 6054 842 2018 6055 904 2018 6056 889 2019 6057 836 2019 6058 890 2019 6059 847 2020 6060 851 2020 6061 927 2020 6062 818 2021 6063 842 2021 6064 901 2021 6065 922 2022 6066 803 2022 6067 923 2022 6068 851 2023 6069 823 2023 6070 930 2023 6071 906 2024 6072 826 2024 6073 907 2024 6074 892 2025 6075 877 2025 6076 891 2025 6077 891 2026 6078 876 2026 6079 889 2026 6080 876 2027 6081 877 2027 6082 895 2027 6083 842 2028 6084 802 2028 6085 894 2028 6086 900 2029 6087 877 2029 6088 898 2029 6089 898 2030 6090 865 2030 6091 899 2030 6092 869 2031 6093 857 2031 6094 904 2031 6095 903 2032 6096 857 2032 6097 901 2032 6098 812 2033 6099 826 2033 6100 905 2033 6101 908 2034 6102 886 2034 6103 905 2034 6104 851 2035 6105 847 2035 6106 911 2035 6107 909 2036 6108 826 2036 6109 911 2036 6110 915 2037 6111 916 2037 6112 917 2037 6113 825 2038 6114 840 2038 6115 915 2038 6116 914 2039 6117 811 2039 6118 913 2039 6119 840 2040 6120 811 2040 6121 916 2040 6122 919 2041 6123 847 2041 6124 918 2041 6125 921 2042 6126 858 2042 6127 920 2042 6128 847 2043 6129 822 2043 6130 925 2043 6131 822 2044 6132 803 2044 6133 924 2044 6134 929 2045 6135 822 2045 6136 927 2045 6137 928 2046 6138 823 2046 6139 929 2046 6140 978 2047 6141 966 2047 6142 977 2047 6143 943 2048 6144 968 2048 6145 989 2048 6146 1050 2049 6147 998 2049 6148 1048 2049 6149 990 2050 6150 959 2050 6151 1045 2050 6152 933 2051 6153 998 2051 6154 1046 2051 6155 935 2052 6156 1009 2052 6157 1026 2052 6158 1007 2053 6159 1019 2053 6160 1040 2053 6161 1043 2054 6162 980 2054 6163 1045 2054 6164 1007 2055 6165 972 2055 6166 1032 2055 6167 987 2056 6168 949 2056 6169 952 2056 6170 1029 2057 6171 1010 2057 6172 1027 2057 6173 953 2058 6174 991 2058 6175 1051 2058 6176 1056 2059 6177 953 2059 6178 1058 2059 6179 990 2060 6180 980 2060 6181 1053 2060 6182 997 2061 6183 969 2061 6184 989 2061 6185 1004 2062 6186 1005 2062 6187 958 2062 6188 974 2063 6189 947 2063 6190 948 2063 6191 998 2064 6192 1010 2064 6193 1023 2064 6194 1030 2065 6195 972 2065 6196 1033 2065 6197 1014 2066 6198 937 2066 6199 939 2066 6200 1035 2067 6201 975 2067 6202 1037 2067 6203 1022 2068 6204 969 2068 6205 1023 2068 6206 980 2069 6207 984 2069 6208 1060 2069 6209 951 2070 6210 975 2070 6211 1034 2070 6212 1055 2071 6213 936 2071 6214 1056 2071 6215 984 2072 6216 956 2072 6217 1063 2072 6218 1039 2073 6219 959 2073 6220 1040 2073 6221 1025 2074 6222 1010 2074 6223 1024 2074 6224 1024 2075 6225 1009 2075 6226 1022 2075 6227 1009 2076 6228 1010 2076 6229 1028 2076 6230 975 2077 6231 935 2077 6232 1027 2077 6233 1033 2078 6234 1010 2078 6235 1031 2078 6236 1031 2079 6237 998 2079 6238 1032 2079 6239 1002 2080 6240 990 2080 6241 1037 2080 6242 1036 2081 6243 990 2081 6244 1034 2081 6245 945 2082 6246 959 2082 6247 1038 2082 6248 1041 2083 6249 1019 2083 6250 1038 2083 6251 984 2084 6252 980 2084 6253 1044 2084 6254 1042 2085 6255 959 2085 6256 1044 2085 6257 1048 2086 6258 1049 2086 6259 1050 2086 6260 958 2087 6261 973 2087 6262 1048 2087 6263 1047 2088 6264 944 2088 6265 1046 2088 6266 973 2089 6267 944 2089 6268 1049 2089 6269 1052 2090 6270 980 2090 6271 1051 2090 6272 1054 2091 6273 991 2091 6274 1053 2091 6275 980 2092 6276 955 2092 6277 1058 2092 6278 955 2093 6279 936 2093 6280 1057 2093 6281 1062 2094 6282 955 2094 6283 1060 2094 6284 1061 2095 6285 956 2095 6286 1062 2095 6287

+
+
+
+
+ + + + + 1 0 0 0 0 -8.78176e-7 -1 0 0 1 -8.78176e-7 0 0 0 0 1 + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/Objects3D/features/enginetreereplacement/enginetreereplacement.s3o b/Objects3D/features/enginetreereplacement/enginetreereplacement.s3o new file mode 100644 index 000000000..1faf66d5c Binary files /dev/null and b/Objects3D/features/enginetreereplacement/enginetreereplacement.s3o differ diff --git a/Objects3D/hoverfac.s3o b/Objects3D/hoverfac.s3o deleted file mode 100644 index a587a7d7a..000000000 Binary files a/Objects3D/hoverfac.s3o and /dev/null differ diff --git a/Objects3D/laserturret.s3o b/Objects3D/laserturret.s3o new file mode 100644 index 000000000..d32f9d7a5 Binary files /dev/null and b/Objects3D/laserturret.s3o differ diff --git a/Objects3D/lilypad.3ds b/Objects3D/lilypad.3ds deleted file mode 100644 index 32b664b6b..000000000 Binary files a/Objects3D/lilypad.3ds and /dev/null differ diff --git a/Objects3D/lozcommandtank-battle.s3o b/Objects3D/lozcommandtank-battle.s3o new file mode 100644 index 000000000..1fc27c44f Binary files /dev/null and b/Objects3D/lozcommandtank-battle.s3o differ diff --git a/Objects3D/lozcommandtank.s3o b/Objects3D/lozcommandtank.s3o new file mode 100644 index 000000000..1504e266e Binary files /dev/null and b/Objects3D/lozcommandtank.s3o differ diff --git a/Objects3D/missilesmalllauncher.s3o b/Objects3D/missilesmalllauncher.s3o index 6be30a2ac..6c20e7b82 100644 Binary files a/Objects3D/missilesmalllauncher.s3o and b/Objects3D/missilesmalllauncher.s3o differ diff --git a/Objects3D/missilesmallvlaunch.s3o b/Objects3D/missilesmallvlaunch.s3o index 13105b891..0531d7e7c 100644 Binary files a/Objects3D/missilesmallvlaunch.s3o and b/Objects3D/missilesmallvlaunch.s3o differ diff --git a/Objects3D/nanopylon.s3o b/Objects3D/nanopylon.s3o new file mode 100644 index 000000000..bd7355687 Binary files /dev/null and b/Objects3D/nanopylon.s3o differ diff --git a/Objects3D/scavs/big/eamphibbuggy2big.s3o b/Objects3D/scavs/big/eamphibbuggy2big.s3o new file mode 100644 index 000000000..c4bd457f2 Binary files /dev/null and b/Objects3D/scavs/big/eamphibbuggy2big.s3o differ diff --git a/Objects3D/scavs/boss/eallterranarchidboss.s3o b/Objects3D/scavs/boss/eallterranarchidboss.s3o new file mode 100644 index 000000000..74263de45 Binary files /dev/null and b/Objects3D/scavs/boss/eallterranarchidboss.s3o differ diff --git a/Objects3D/scavs/boss/eamphiblevelerboss.s3o b/Objects3D/scavs/boss/eamphiblevelerboss.s3o new file mode 100644 index 000000000..9d0c4fb05 Binary files /dev/null and b/Objects3D/scavs/boss/eamphiblevelerboss.s3o differ diff --git a/Objects3D/scavs/boss/ehbotkargannethboss.s3o b/Objects3D/scavs/boss/ehbotkargannethboss.s3o new file mode 100644 index 000000000..618c590a4 Binary files /dev/null and b/Objects3D/scavs/boss/ehbotkargannethboss.s3o differ diff --git a/Objects3D/scavs/boss/ekrowboss.s3o b/Objects3D/scavs/boss/ekrowboss.s3o new file mode 100644 index 000000000..f8e0635a2 Binary files /dev/null and b/Objects3D/scavs/boss/ekrowboss.s3o differ diff --git a/Objects3D/scavs/boss/elaceratorboss.s3o b/Objects3D/scavs/boss/elaceratorboss.s3o new file mode 100644 index 000000000..28d19bd06 Binary files /dev/null and b/Objects3D/scavs/boss/elaceratorboss.s3o differ diff --git a/Objects3D/scavs/cube.s3o b/Objects3D/scavs/cube.s3o new file mode 100644 index 000000000..db5f06ec1 Binary files /dev/null and b/Objects3D/scavs/cube.s3o differ diff --git a/Objects3D/scavs/scavbeacon.s3o b/Objects3D/scavs/scavbeacon.s3o new file mode 100644 index 000000000..8e477dc59 Binary files /dev/null and b/Objects3D/scavs/scavbeacon.s3o differ diff --git a/Objects3D/scavs/scavbeacondroppod.s3o b/Objects3D/scavs/scavbeacondroppod.s3o new file mode 100644 index 000000000..bd7cd29d1 Binary files /dev/null and b/Objects3D/scavs/scavbeacondroppod.s3o differ diff --git a/Objects3D/scavs/scavcrate.s3o b/Objects3D/scavs/scavcrate.s3o new file mode 100644 index 000000000..50082876f Binary files /dev/null and b/Objects3D/scavs/scavcrate.s3o differ diff --git a/Objects3D/taatank2.s3o b/Objects3D/taatank2.s3o deleted file mode 100644 index 7d5c85e3a..000000000 Binary files a/Objects3D/taatank2.s3o and /dev/null differ diff --git a/Objects3D/taircon.s3o b/Objects3D/taircon.s3o deleted file mode 100644 index aad5bddcd..000000000 Binary files a/Objects3D/taircon.s3o and /dev/null differ diff --git a/Objects3D/tbinoc.s3o b/Objects3D/tbinoc.s3o deleted file mode 100644 index 9a1ca1504..000000000 Binary files a/Objects3D/tbinoc.s3o and /dev/null differ diff --git a/Objects3D/techdodad.s3o b/Objects3D/techdodad.s3o new file mode 100644 index 000000000..c89e57424 Binary files /dev/null and b/Objects3D/techdodad.s3o differ diff --git a/Objects3D/tengineer3.s3o b/Objects3D/tengineer3.s3o deleted file mode 100644 index 26a3bd468..000000000 Binary files a/Objects3D/tengineer3.s3o and /dev/null differ diff --git a/Objects3D/tfact.s3o b/Objects3D/tfact.s3o deleted file mode 100644 index de230c137..000000000 Binary files a/Objects3D/tfact.s3o and /dev/null differ diff --git a/Objects3D/tfusion2.s3o b/Objects3D/tfusion2.s3o deleted file mode 100644 index 4a954e7b4..000000000 Binary files a/Objects3D/tfusion2.s3o and /dev/null differ diff --git a/Objects3D/tgeothermal.s3o b/Objects3D/tgeothermal.s3o deleted file mode 100644 index 7f25a1cc6..000000000 Binary files a/Objects3D/tgeothermal.s3o and /dev/null differ diff --git a/Objects3D/tlighttank3.s3o b/Objects3D/tlighttank3.s3o deleted file mode 100644 index d0f0ab828..000000000 Binary files a/Objects3D/tlighttank3.s3o and /dev/null differ diff --git a/Objects3D/tlightturret.s3o b/Objects3D/tlightturret.s3o deleted file mode 100644 index 01994b288..000000000 Binary files a/Objects3D/tlightturret.s3o and /dev/null differ diff --git a/Objects3D/tmetalextractor.s3o b/Objects3D/tmetalextractor.s3o deleted file mode 100644 index b7a82629f..000000000 Binary files a/Objects3D/tmetalextractor.s3o and /dev/null differ diff --git a/Objects3D/torpedo.s3o b/Objects3D/torpedo.s3o deleted file mode 100644 index f786c6811..000000000 Binary files a/Objects3D/torpedo.s3o and /dev/null differ diff --git a/Objects3D/transport2.s3o b/Objects3D/transport2.s3o deleted file mode 100644 index bc49768f1..000000000 Binary files a/Objects3D/transport2.s3o and /dev/null differ diff --git a/Objects3D/tslicer2.s3o b/Objects3D/tslicer2.s3o deleted file mode 100644 index 79872797b..000000000 Binary files a/Objects3D/tslicer2.s3o and /dev/null differ diff --git a/Objects3D/tsolar2.s3o b/Objects3D/tsolar2.s3o deleted file mode 100644 index 5ec57f06d..000000000 Binary files a/Objects3D/tsolar2.s3o and /dev/null differ diff --git a/Objects3D/tstorage.s3o b/Objects3D/tstorage.s3o deleted file mode 100644 index d077e642d..000000000 Binary files a/Objects3D/tstorage.s3o and /dev/null differ diff --git a/Objects3D/units/scavboss/dummyfile.txt b/Objects3D/units/scavboss/dummyfile.txt new file mode 100644 index 000000000..7c4a013e5 --- /dev/null +++ b/Objects3D/units/scavboss/dummyfile.txt @@ -0,0 +1 @@ +aaa \ No newline at end of file diff --git a/Objects3D/unused legos/medium tank.s3o b/Objects3D/unused legos/medium tank.s3o index 21861384d..691676cbb 100644 Binary files a/Objects3D/unused legos/medium tank.s3o and b/Objects3D/unused legos/medium tank.s3o differ diff --git a/Objects3D/xmasball.s3o b/Objects3D/xmasball.s3o new file mode 100644 index 000000000..4b14c90ec Binary files /dev/null and b/Objects3D/xmasball.s3o differ diff --git a/Objects3D/zaal/spike.s3o b/Objects3D/zaal/spike.s3o new file mode 100644 index 000000000..87f51022d Binary files /dev/null and b/Objects3D/zaal/spike.s3o differ diff --git a/Objects3D/zaal/zairbomber.s3o b/Objects3D/zaal/zairbomber.s3o new file mode 100644 index 000000000..4ea6ff98e Binary files /dev/null and b/Objects3D/zaal/zairbomber.s3o differ diff --git a/Objects3D/zaal/zairscout.s3o b/Objects3D/zaal/zairscout.s3o new file mode 100644 index 000000000..5eacedf98 Binary files /dev/null and b/Objects3D/zaal/zairscout.s3o differ diff --git a/Objects3D/zaal/zairtoairfighter.s3o b/Objects3D/zaal/zairtoairfighter.s3o new file mode 100644 index 000000000..1c4470a41 Binary files /dev/null and b/Objects3D/zaal/zairtoairfighter.s3o differ diff --git a/Objects3D/zaal/zairtogroundfighter.s3o b/Objects3D/zaal/zairtogroundfighter.s3o new file mode 100644 index 000000000..ba7a387b0 Binary files /dev/null and b/Objects3D/zaal/zairtogroundfighter.s3o differ diff --git a/Objects3D/zaal/zarm.s3o b/Objects3D/zaal/zarm.s3o new file mode 100644 index 000000000..adc65c019 Binary files /dev/null and b/Objects3D/zaal/zarm.s3o differ diff --git a/Objects3D/zaal/zarty.s3o b/Objects3D/zaal/zarty.s3o new file mode 100644 index 000000000..7b3e9c3a2 Binary files /dev/null and b/Objects3D/zaal/zarty.s3o differ diff --git a/Objects3D/zaal/zassault.s3o b/Objects3D/zaal/zassault.s3o new file mode 100644 index 000000000..0e0e3fdc8 Binary files /dev/null and b/Objects3D/zaal/zassault.s3o differ diff --git a/Objects3D/zaal/zespire1.s3o b/Objects3D/zaal/zespire1.s3o new file mode 100644 index 000000000..9c1d5221c Binary files /dev/null and b/Objects3D/zaal/zespire1.s3o differ diff --git a/Objects3D/zaal/zespire4.s3o b/Objects3D/zaal/zespire4.s3o new file mode 100644 index 000000000..1c95ed587 Binary files /dev/null and b/Objects3D/zaal/zespire4.s3o differ diff --git a/Objects3D/zaal/zespire5.s3o b/Objects3D/zaal/zespire5.s3o new file mode 100644 index 000000000..750a03d3b Binary files /dev/null and b/Objects3D/zaal/zespire5.s3o differ diff --git a/Objects3D/zaal/zfactory.s3o b/Objects3D/zaal/zfactory.s3o new file mode 100644 index 000000000..ab379b302 Binary files /dev/null and b/Objects3D/zaal/zfactory.s3o differ diff --git a/Objects3D/zaal/zfactory_up1.s3o b/Objects3D/zaal/zfactory_up1.s3o new file mode 100644 index 000000000..ac30daf31 Binary files /dev/null and b/Objects3D/zaal/zfactory_up1.s3o differ diff --git a/Objects3D/zaal/zfactory_up2.s3o b/Objects3D/zaal/zfactory_up2.s3o new file mode 100644 index 000000000..245b259d5 Binary files /dev/null and b/Objects3D/zaal/zfactory_up2.s3o differ diff --git a/Objects3D/zaal/zfactory_up3.s3o b/Objects3D/zaal/zfactory_up3.s3o new file mode 100644 index 000000000..dc6f4351a Binary files /dev/null and b/Objects3D/zaal/zfactory_up3.s3o differ diff --git a/Objects3D/zaal/zhive.s3o b/Objects3D/zaal/zhive.s3o new file mode 100644 index 000000000..7b05e61e3 Binary files /dev/null and b/Objects3D/zaal/zhive.s3o differ diff --git a/Objects3D/zaal/zkamikaze.s3o b/Objects3D/zaal/zkamikaze.s3o new file mode 100644 index 000000000..818cf43a8 Binary files /dev/null and b/Objects3D/zaal/zkamikaze.s3o differ diff --git a/Objects3D/zaal/zlightswarm.s3o b/Objects3D/zaal/zlightswarm.s3o new file mode 100644 index 000000000..4d4c37bc4 Binary files /dev/null and b/Objects3D/zaal/zlightswarm.s3o differ diff --git a/Objects3D/zaal/zmedswarm.s3o b/Objects3D/zaal/zmedswarm.s3o new file mode 100644 index 000000000..efcc1a67f Binary files /dev/null and b/Objects3D/zaal/zmedswarm.s3o differ diff --git a/Objects3D/zaal/zmex.s3o b/Objects3D/zaal/zmex.s3o new file mode 100644 index 000000000..23942dd01 Binary files /dev/null and b/Objects3D/zaal/zmex.s3o differ diff --git a/Objects3D/zaal/zpyro.s3o b/Objects3D/zaal/zpyro.s3o new file mode 100644 index 000000000..1ffedf734 Binary files /dev/null and b/Objects3D/zaal/zpyro.s3o differ diff --git a/Objects3D/zaal/zqueen.s3o b/Objects3D/zaal/zqueen.s3o new file mode 100644 index 000000000..e52cc9e24 Binary files /dev/null and b/Objects3D/zaal/zqueen.s3o differ diff --git a/Objects3D/zaal/zroost.s3o b/Objects3D/zaal/zroost.s3o new file mode 100644 index 000000000..5e59350b4 Binary files /dev/null and b/Objects3D/zaal/zroost.s3o differ diff --git a/Objects3D/zaal/zskirmisher.s3o b/Objects3D/zaal/zskirmisher.s3o new file mode 100644 index 000000000..561f9a6ba Binary files /dev/null and b/Objects3D/zaal/zskirmisher.s3o differ diff --git a/Objects3D/zaal/ztenticle.s3o b/Objects3D/zaal/ztenticle.s3o new file mode 100644 index 000000000..068d6fa3d Binary files /dev/null and b/Objects3D/zaal/ztenticle.s3o differ diff --git a/Objects3D/zaal/ztiberium.s3o b/Objects3D/zaal/ztiberium.s3o new file mode 100644 index 000000000..d07c8f058 Binary files /dev/null and b/Objects3D/zaal/ztiberium.s3o differ diff --git a/Objects3D/zaal/ztiberium_small.s3o b/Objects3D/zaal/ztiberium_small.s3o new file mode 100644 index 000000000..6aaaa326e Binary files /dev/null and b/Objects3D/zaal/ztiberium_small.s3o differ diff --git a/Objects3D/zaal/ztumor.s3o b/Objects3D/zaal/ztumor.s3o new file mode 100644 index 000000000..87e81e4f0 Binary files /dev/null and b/Objects3D/zaal/ztumor.s3o differ diff --git a/README.md b/README.md index 03b14207f..de03ae6be 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,3 @@ -

Evolution RTS

+Join our Discord community at: https://discord.gg/WUbAs2f -Evolution RTS is a free an Open Source RTS game designed using the Spring Engine. It has been in development for over 5 years and receives updates often. Its gameplay is designed specifically to appeal to gamers of all skill levels. The gameplay is designed around the use of unit groups, and the mixture of your unit group often will determine how successful you are in battle, as opposed to churning out hundreds of the same unit continually. - -The economy and teching system is easy to learn and use. The game itself supplies many tools that make managing your economy easier so that you can focus more on crushing your enemy than of playing simcity in your base. Units interact using realistic physics and varied terrain (you can actually micro units in order to dodge projectiles!). - -

Below is a very short list of the features that Evolution RTS has to offer:

- -

Realistic Physics

-Projectiles and units use a realistic physics system which allow for unprecedented control and gameplay. Micro your units to avoid projectiles. Hide behind terrain for cover. - -

Epic and Macro scales

-Control the battlefield and a level that feels the most comfortable to you, whether zoomed in controlling individual units, zoomed out viewing the entire map and issuing orders on a macro scale, or somewhere in between! You are in complete control! - -

Fine tuning controls for builders

-Set builders on repeat so that they repeat the orders you give infinitely until they die. Adjust builder priority in order to control the amount of resources allocated to that specific builder’s construction project. - -

Unique Cover System allows you to easily set up ambushes

-Hide your army in rocks and foilage completely undetected and lie in wait to ambush your enemy! - -

Gameplay geared towards casual gamers in addition to hardcore rts fans, as opposed to only being fun to play at the higher levels

-Gameplay designed around being easy to learn yet hard to master. As a newbie you can be up and running in no time, and the gameplay ensures that just because you are new, you aren’t necessarily at a huge disadvantage. - -

Hundreds of units at once

-The Spring Engine allows for hundreds or thousands of units to be beating the daylights out of each other all at once. Gameplay scales seamlessly to fit! - -

Unique unit abilities

-Discover units with special abilities, such as the ORB with it’s incredible area healing abilities, or the Overseer with it’s EMP ability! - -

Simple Economy

-The economy is designed to be easy to learn, and use. There are only two resources in the game; Energy and Metal. Energy is used for utility purposes such as unit ammunition, powering shields, and building nuclear missiles, whereas metal is used to construct structures and units. Metal income is split between allies and resources that overflow the player’s capacity automatically flow into allies banks. - -

Easy to learn teching system

-Simple teching system that revolves around using the same buildings that supply energy as a means to increase your tech availability ensure seamless transitions into heavier unit technologies. - -

Incredible effects

-Full particle effects engine and beautiful effects painstakingly created down to the last detail ensure that every battle will be visually stunning! - -

Full Soundtrack

-Full in-game soundtrack that highlights the mood based upon whether you are building structures in your base or engaged in an all out no holds barred war for survival will keep you on your toes and fuel your need for dominance! Over 40+ tracks! - -

Easy battle formations

-Easy to use battle formations via selecting a group of units, right-clicking and dragging on the map make it easy for you to give complex orders to your units, even in the midst of a battle! - -

Intelligent Unit Targeting AI

-Units automatically target the best enemy units to attack on their own, leaving you to concentrate on formations, flanking, and commanding your army! - -

Give orders via the mini-map

-Full unit orders can be given via the minimap, so you can control your units intuitively no matter where your camera is pointing. - -

Place map markers with or without labels, and draw directly on the map

-Map markers, drawing, and labels make it easy for you and your allies to communicate your battle plans, and illustrate them! - -

Unit balance dependent on unit mixture instead of one unit owning an entire army all by itself

-Unit balance is designed so that composition matters more than simply churning out hordes of the most expensive unit. - -

Intelligent builder AI

-Builders have a plethora of tools and options available to use to help you with macro tasks so that you can focus on kicking robotic ass! - -

Completely customizeable GUI

-The in-game gui can easily be moved around, resized, and position exactly how you like it! Be your own boss! - -

Gorgeously detailed unit textures and designs

- -

Weekly scheduled gaming events that are streamed live!

-Streamed live every Saturday at 5pm GMT at http://www.evolutionrts.info/stream and http://www.twitch.tv/evolutionrts - -

Automatic ladder ranking and replay system -http://replays.springrts.com/ - -Completely free, forever! -Open Source! -http://www.source.evolutionrts.info - -Evolution RTS is a continually evolving and developing game; Come and join our community! We love having more people to talk to and play with! Pre-emptively, welcome to our community! \ No newline at end of file +Evolution RTS is a free and Open Source RTS game designed using the Spring Engine. Unfortunately, keeping this readme up to date is nearly impossible, so I recommend that you visit the website at https://www.evolutionrts.info diff --git a/Scripts/ChickenDefenseScripts/chicken1.bos b/Scripts/ChickenDefenseScripts/chicken1.bos new file mode 100644 index 000000000..843457c28 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chicken1.bos @@ -0,0 +1,186 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearm,lupperarm,lblade,rforearm,rupperarm,rblade; + +static-var aMoving, bMoving, lasthit; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return 100; +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lforearm to y-axis <-140> speed <600>; + turn rforearm to y-axis <140> speed <600>; + turn lblade to y-axis <140> speed <600>; + turn rblade to y-axis <-140> speed <600>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0> speed <120>; + turn rforearm to y-axis <0> speed <120>; + turn lblade to y-axis <0> speed <120>; + turn rblade to y-axis <0> speed <120>; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chicken1.cob b/Scripts/ChickenDefenseScripts/chicken1.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1b.cob b/Scripts/ChickenDefenseScripts/chicken1b.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1c.cob b/Scripts/ChickenDefenseScripts/chicken1c.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1c.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1d.cob b/Scripts/ChickenDefenseScripts/chicken1d.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1d.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1x.cob b/Scripts/ChickenDefenseScripts/chicken1x.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1x.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1y.cob b/Scripts/ChickenDefenseScripts/chicken1y.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1y.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken1z.cob b/Scripts/ChickenDefenseScripts/chicken1z.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken1z.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken2.bos b/Scripts/ChickenDefenseScripts/chicken2.bos new file mode 100644 index 000000000..363eb11be --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chicken2.bos @@ -0,0 +1,182 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, head, tail, lthigh, lknee, lshin, lfoot, rthigh, + rknee, rshin, rfoot, lforearm, lupperarm, lblade, rforearm, rupperarm, + rblade; + +static-var bMoving, Static_Var_2, Static_Var_3; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + while( bMoving ) + { + Static_Var_2 = 1; + if( bMoving ) + { + turn lthigh to x-axis <70.000000> speed <230.000000>; + turn lknee to x-axis <-40.000000> speed <270.000000>; + turn lshin to x-axis <20.000000> speed <270.000000>; + turn lfoot to x-axis <-50.000000> speed <420.000000>; + turn rthigh to x-axis <-20.000000> speed <420.000000>; + turn rknee to x-axis <-60.000000> speed <420.000000>; + turn rshin to x-axis <50.000000> speed <420.000000>; + turn rfoot to x-axis <30.000000> speed <420.000000>; + turn body to z-axis <5.000000> speed <40.000000>; + turn lthigh to z-axis <-5.000000> speed <40.000000>; + turn rthigh to z-axis <-5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn tail to y-axis <10.000000> speed <80.000000>; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn lthigh around x-axis; + } + if( bMoving ) + { + turn lthigh to x-axis <-10.000000> speed <320.000000>; + turn lknee to x-axis <15.000000> speed <270.000000>; + turn lshin to x-axis <-60.000000> speed <500.000000>; + turn lfoot to x-axis <30.000000> speed <270.000000>; + turn rthigh to x-axis <40.000000> speed <270.000000>; + turn rknee to x-axis <-35.000000> speed <270.000000>; + turn rshin to x-axis <-40.000000> speed <270.000000>; + turn rfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn lshin around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <70.000000> speed <230.000000>; + turn rknee to x-axis <-40.000000> speed <270.000000>; + turn rshin to x-axis <20.000000> speed <270.000000>; + turn rfoot to x-axis <-50.000000> speed <420.000000>; + turn lthigh to x-axis <-20.000000> speed <420.000000>; + turn lknee to x-axis <-60.000000> speed <420.000000>; + turn lshin to x-axis <50.000000> speed <420.000000>; + turn lfoot to x-axis <30.000000> speed <420.000000>; + turn tail to y-axis <-10.000000> speed <80.000000>; + turn body to z-axis <-5.000000> speed <40.000000>; + turn lthigh to z-axis <5.000000> speed <40.000000>; + turn rthigh to z-axis <5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn rthigh around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <-10.000000> speed <320.000000>; + turn rknee to x-axis <15.000000> speed <270.000000>; + turn rshin to x-axis <-60.000000> speed <500.000000>; + turn rfoot to x-axis <30.000000> speed <270.000000>; + turn lthigh to x-axis <40.000000> speed <270.000000>; + turn lknee to x-axis <-35.000000> speed <270.000000>; + turn lshin to x-axis <-40.000000> speed <270.000000>; + turn lfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn rshin around x-axis; + } + } +} + +Halt() +{ + sleep 150; + if( !bMoving ) + { + Static_Var_2 = 0; + turn lfoot to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lshin to x-axis <0.000000> speed <200.000000>; + turn rshin to x-axis <0.000000> speed <200.000000>; + turn lknee to x-axis <0.000000> speed <200.000000>; + turn rknee to x-axis <0.000000> speed <200.000000>; + } +} + +StartMoving() +{ + bMoving = TRUE; + if( !Static_Var_2 ) + { + start-script walk(); + } +} + +StopMoving() +{ + bMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return (100); +} + +Create() +{ + emit-sfx 1024 + 2 from body; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +AimFromPrimary(piecenum) +{ + piecenum = head; +} + +QueryPrimary(piecenum) +{ + piecenum = head; +} + +RestoreAfterDelay() +{ + sleep 1000; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250.000000>; + turn head to x-axis <0.000000> - pitch speed <200.000000>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + return (1); +} + +Shot1() +{ + turn lforearm to y-axis <-140.000000> speed <600.000000>; + turn rforearm to y-axis <140.000000> speed <600.000000>; + turn lblade to y-axis <140.000000> speed <600.000000>; + turn rblade to y-axis <-140.000000> speed <600.000000>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0.000000> speed <250.000000>; + turn rforearm to y-axis <0.000000> speed <250.000000>; + turn lblade to y-axis <0.000000> speed <250.000000>; + turn rblade to y-axis <0.000000> speed <250.000000>; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + emit-sfx 1025 from body; +} diff --git a/Scripts/ChickenDefenseScripts/chicken2.cob b/Scripts/ChickenDefenseScripts/chicken2.cob new file mode 100644 index 000000000..339b102f8 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken2b.bos b/Scripts/ChickenDefenseScripts/chicken2b.bos new file mode 100644 index 000000000..f34f62392 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chicken2b.bos @@ -0,0 +1,182 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, head, tail, lthigh, lknee, lshin, lfoot, rthigh, + rknee, rshin, rfoot, lforearm, lupperarm, lblade, rforearm, rupperarm, + rblade; + +static-var bMoving, Static_Var_2, Static_Var_3; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + while( bMoving ) + { + Static_Var_2 = 1; + if( bMoving ) + { + turn lthigh to x-axis <70.000000> speed <230.000000>; + turn lknee to x-axis <-40.000000> speed <270.000000>; + turn lshin to x-axis <20.000000> speed <270.000000>; + turn lfoot to x-axis <-50.000000> speed <420.000000>; + turn rthigh to x-axis <-20.000000> speed <420.000000>; + turn rknee to x-axis <-60.000000> speed <420.000000>; + turn rshin to x-axis <50.000000> speed <420.000000>; + turn rfoot to x-axis <30.000000> speed <420.000000>; + turn body to z-axis <5.000000> speed <40.000000>; + turn lthigh to z-axis <-5.000000> speed <40.000000>; + turn rthigh to z-axis <-5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn tail to y-axis <10.000000> speed <80.000000>; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn lthigh around x-axis; + } + if( bMoving ) + { + turn lthigh to x-axis <-10.000000> speed <320.000000>; + turn lknee to x-axis <15.000000> speed <270.000000>; + turn lshin to x-axis <-60.000000> speed <500.000000>; + turn lfoot to x-axis <30.000000> speed <270.000000>; + turn rthigh to x-axis <40.000000> speed <270.000000>; + turn rknee to x-axis <-35.000000> speed <270.000000>; + turn rshin to x-axis <-40.000000> speed <270.000000>; + turn rfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn lshin around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <70.000000> speed <230.000000>; + turn rknee to x-axis <-40.000000> speed <270.000000>; + turn rshin to x-axis <20.000000> speed <270.000000>; + turn rfoot to x-axis <-50.000000> speed <420.000000>; + turn lthigh to x-axis <-20.000000> speed <420.000000>; + turn lknee to x-axis <-60.000000> speed <420.000000>; + turn lshin to x-axis <50.000000> speed <420.000000>; + turn lfoot to x-axis <30.000000> speed <420.000000>; + turn tail to y-axis <-10.000000> speed <80.000000>; + turn body to z-axis <-5.000000> speed <40.000000>; + turn lthigh to z-axis <5.000000> speed <40.000000>; + turn rthigh to z-axis <5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn rthigh around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <-10.000000> speed <320.000000>; + turn rknee to x-axis <15.000000> speed <270.000000>; + turn rshin to x-axis <-60.000000> speed <500.000000>; + turn rfoot to x-axis <30.000000> speed <270.000000>; + turn lthigh to x-axis <40.000000> speed <270.000000>; + turn lknee to x-axis <-35.000000> speed <270.000000>; + turn lshin to x-axis <-40.000000> speed <270.000000>; + turn lfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn rshin around x-axis; + } + } +} + +Halt() +{ + sleep 150; + if( !bMoving ) + { + Static_Var_2 = 0; + turn lfoot to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lshin to x-axis <0.000000> speed <200.000000>; + turn rshin to x-axis <0.000000> speed <200.000000>; + turn lknee to x-axis <0.000000> speed <200.000000>; + turn rknee to x-axis <0.000000> speed <200.000000>; + } +} + +StartMoving() +{ + bMoving = TRUE; + if( !Static_Var_2 ) + { + start-script walk(); + } +} + +StopMoving() +{ + bMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return (100); +} + +Create() +{ + emit-sfx 1024 + 2 from body; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +AimFromPrimary(piecenum) +{ + piecenum = head; +} + +QueryPrimary(piecenum) +{ + piecenum = head; +} + +RestoreAfterDelay() +{ + sleep 1000; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250.000000>; + turn head to x-axis <0.000000> - pitch speed <200.000000>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + return (1); +} + +Shot1() +{ + turn lforearm to y-axis <-140.000000> speed <700.000000>; + turn rforearm to y-axis <140.000000> speed <700.000000>; + turn lblade to y-axis <140.000000> speed <700.000000>; + turn rblade to y-axis <-140.000000> speed <700.000000>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0.000000> speed <400.000000>; + turn rforearm to y-axis <0.000000> speed <400.000000>; + turn lblade to y-axis <0.000000> speed <400.000000>; + turn rblade to y-axis <0.000000> speed <400.000000>; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + emit-sfx 1025 from body; +} diff --git a/Scripts/ChickenDefenseScripts/chicken2b.cob b/Scripts/ChickenDefenseScripts/chicken2b.cob new file mode 100644 index 000000000..6ff60ca6b Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken2b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken_dodo1.bos b/Scripts/ChickenDefenseScripts/chicken_dodo1.bos new file mode 100644 index 000000000..d7aa0e0b0 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chicken_dodo1.bos @@ -0,0 +1,203 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lblade,rblade; +//piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,rblade,lblade,mblade,spike1,spike2,spike3; + +static-var Static_Var_3, aMoving, bMoving, lasthit, counter; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if( Static_Var_3 <= 2 ) + { + emit-sfx 5 from lfoot; + emit-sfx 5 from rfoot; + emit-sfx 3 from lfoot; + emit-sfx 3 from rfoot; + } + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn lthigh around x-axis; + } + if( Static_Var_3 <= 2 ) + { + emit-sfx 5 from lfoot; + emit-sfx 5 from rfoot; + emit-sfx 3 from lfoot; + emit-sfx 3 from rfoot; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn lshin around x-axis; + } + if( Static_Var_3 <= 2 ) + { + emit-sfx 5 from lfoot; + emit-sfx 5 from rfoot; + emit-sfx 3 from lfoot; + emit-sfx 3 from rfoot; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn rthigh around x-axis; + } + if( Static_Var_3 <= 2 ) + { + emit-sfx 5 from lfoot; + emit-sfx 5 from rfoot; + emit-sfx 3 from lfoot; + emit-sfx 3 from rfoot; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn rshin around x-axis; + } + if( Static_Var_3 <= 2 ) + { + emit-sfx 5 from lfoot; + emit-sfx 5 from rfoot; + emit-sfx 3 from lfoot; + emit-sfx 3 from rfoot; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + + +RestoreAfterDelay() + { + sleep 1000; + } + + + +HitByWeaponId() + { + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode body type FALL | FIRE | BITMAP1 | NOHEATCLOUD; + explode tail type FALL | FIRE | BITMAP1 | NOHEATCLOUD; + explode head type FALL | FIRE | BITMAP1 | NOHEATCLOUD; + explode lblade type FALL | FIRE | BITMAP2 | NOHEATCLOUD; + //explode rblade type FALL | FIRE | BITMAP2 | NOHEATCLOUD; + //explode lblade type FALL | NOHEATCLOUD; + //explode rblade type FALL | NOHEATCLOUD; + //explode lblade type FALL | NOHEATCLOUD; + //explode rblade type FALL | NOHEATCLOUD; + //explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + //explode rfoot type FALL | NOHEATCLOUD; + explode lfoot type FALL | NOHEATCLOUD; + + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chicken_dodo1.cob b/Scripts/ChickenDefenseScripts/chicken_dodo1.cob new file mode 100644 index 000000000..a077b6d97 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken_dodo1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chicken_dodo2.bos b/Scripts/ChickenDefenseScripts/chicken_dodo2.bos new file mode 100644 index 000000000..fa20d8173 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chicken_dodo2.bos @@ -0,0 +1,173 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lblade,rblade; +//piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,rblade,lblade,mblade,spike1,spike2,spike3; + +static-var Static_Var_3, aMoving, bMoving, lasthit, counter; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + emit-sfx 1024 from body; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + emit-sfx 1024 from body; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + emit-sfx 1024 from body; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + emit-sfx 1024 from body; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + + +RestoreAfterDelay() + { + sleep 1000; + } + + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode body type FALL | SMOKE | FIRE | BITMAP1 | NOHEATCLOUD; + explode tail type FALL | SMOKE | FIRE | BITMAP1 | NOHEATCLOUD; + explode head type FALL | SMOKE | FIRE | BITMAP1 | NOHEATCLOUD; + explode lblade type FALL | SMOKE | FIRE | BITMAP1 | NOHEATCLOUD; + explode rblade type FALL | SMOKE | FIRE | BITMAP2 | NOHEATCLOUD; + //explode lblade type FALL | SMOKE | FIRE | BITMAP2 | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + //explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + //explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + //explode rfoot type FALL | NOHEATCLOUD; + explode lfoot type FALL | NOHEATCLOUD; + + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chicken_dodo2.cob b/Scripts/ChickenDefenseScripts/chicken_dodo2.cob new file mode 100644 index 000000000..27a7e204f Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chicken_dodo2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickena1.bos b/Scripts/ChickenDefenseScripts/chickena1.bos new file mode 100644 index 000000000..b1f518a96 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickena1.bos @@ -0,0 +1,251 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearml,lbladel,rforearml,rbladel,lforearmu,lbladeu,rforearmu,rbladeu; + +static-var gun_1, aMoving, bMoving, aaheading, aapitch; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; +} + if (aMoving) { + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + gun_1 = 1; + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + return(TRUE); + } + +AimSecondary(heading,pitch) + { + aapitch = pitch; + aaheading = heading; + return(TRUE); + } + +Shot1() + { + ++gun_1; + if (gun_1 > 4) + { + gun_1 = 1; + } + if (gun_1 == 1) + { + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 2) + { + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + } + if (gun_1 == 3) + { + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 4) + { + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + } + } + +Shot2() + { + turn head to x-axis 0 -aapitch speed <400>; + turn head to y-axis aaheading speed <300>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + emit-sfx 1024+3 from lforearmu; + emit-sfx 1024+3 from lforearml; + emit-sfx 1024+3 from rforearmu; + emit-sfx 1024+3 from rforearml; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + turn head to y-axis 0 speed <120>; + turn head to x-axis 0 speed <120>; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickena1.cob b/Scripts/ChickenDefenseScripts/chickena1.cob new file mode 100644 index 000000000..560e79c42 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickena1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickena1b.cob b/Scripts/ChickenDefenseScripts/chickena1b.cob new file mode 100644 index 000000000..560e79c42 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickena1b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickena1c.cob b/Scripts/ChickenDefenseScripts/chickena1c.cob new file mode 100644 index 000000000..560e79c42 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickena1c.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickena2.bos b/Scripts/ChickenDefenseScripts/chickena2.bos new file mode 100644 index 000000000..730980a57 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickena2.bos @@ -0,0 +1,250 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearml,lbladel,rforearml,rbladel,lforearmu,lbladeu,rforearmu,rbladeu; + +static-var gun_1, aMoving, bMoving, aapitch, aaheading; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<70>; + turn lknee to x-axis <-40> speed<88>; + turn lshin to x-axis <20> speed<88>; + turn lfoot to x-axis <-50> speed<127>; + + turn rthigh to x-axis <-20> speed<127>; + turn rknee to x-axis <-60> speed<127>; + turn rshin to x-axis <50> speed<127>; + turn rfoot to x-axis <30> speed<127>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<97>; + turn lknee to x-axis <15> speed<88>; + turn lshin to x-axis <-60> speed<151>; + turn lfoot to x-axis <30> speed<88>; + + turn rthigh to x-axis <40> speed<88>; + turn rknee to x-axis <-35> speed<88>; + turn rshin to x-axis <-40> speed<88>; + turn rfoot to x-axis <35> speed<88>; + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<70>; + turn rknee to x-axis <-40> speed<88>; + turn rshin to x-axis <20> speed<88>; + turn rfoot to x-axis <-50> speed<127>; + + turn lthigh to x-axis <-20> speed<127>; + turn lknee to x-axis <-60> speed<127>; + turn lshin to x-axis <50> speed<127>; + turn lfoot to x-axis <30> speed<127>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<97>; + turn rknee to x-axis <15> speed<88>; + turn rshin to x-axis <-60> speed<151>; + turn rfoot to x-axis <30> speed<88>; + + turn lthigh to x-axis <40> speed<88>; + turn lknee to x-axis <-35> speed<88>; + turn lshin to x-axis <-40> speed<88>; + turn lfoot to x-axis <35> speed<88>; + + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + gun_1 = 1; + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + return(TRUE); + } + +AimSecondary(heading,pitch) + { + aapitch = pitch; + aaheading = heading; + return(TRUE); + } + +Shot1() + { + ++gun_1; + if (gun_1 > 4) + { + gun_1 = 1; + } + if (gun_1 == 1) + { + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 2) + { + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + } + if (gun_1 == 3) + { + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 4) + { + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + } + } + +Shot2() + { + turn head to x-axis 0 -aapitch speed <400>; + turn head to y-axis aaheading speed <300>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + emit-sfx 1024+3 from lforearmu; + emit-sfx 1024+3 from lforearml; + emit-sfx 1024+3 from rforearmu; + emit-sfx 1024+3 from rforearml; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + turn head to y-axis 0 speed <120>; + turn head to x-axis 0 speed <120>; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickena2.cob b/Scripts/ChickenDefenseScripts/chickena2.cob new file mode 100644 index 000000000..21fca000b Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickena2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickena2b.cob b/Scripts/ChickenDefenseScripts/chickena2b.cob new file mode 100644 index 000000000..21fca000b Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickena2b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenc1.bos b/Scripts/ChickenDefenseScripts/chickenc1.bos new file mode 100644 index 000000000..d5be24b87 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenc1.bos @@ -0,0 +1,235 @@ +piece body,head,tail,lthighf,lkneef,lshinf,lfootf,rthighf,rkneef,rshinf,rfootf,rblade,lblade,lthighb,lkneeb,lshinb,lfootb,rthighb,rkneeb,rshinb,rfootb; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn lthighf to x-axis <70> speed<115>; + turn lkneef to x-axis <-40> speed<145>; + turn lshinf to x-axis <20> speed<145>; + turn lfootf to x-axis <-50> speed<310>; + + turn rthighf to x-axis <-20> speed<310>; + turn rkneef to x-axis <-60> speed<310>; + turn rshinf to x-axis <50> speed<310>; + turn rfootf to x-axis <30> speed<310>; + + turn lthighb to x-axis <70> speed<115>; + turn lkneeb to x-axis <-40> speed<145>; + turn lshinb to x-axis <20> speed<145>; + turn lfootb to x-axis <-50> speed<310>; + + turn rthighb to x-axis <-20> speed<310>; + turn rkneeb to x-axis <-60> speed<310>; + turn rshinb to x-axis <50> speed<310>; + turn rfootb to x-axis <30> speed<310>; + + turn body to z-axis <5> speed <20>; + turn lthighf to z-axis <-5> speed <20>; + turn rthighf to z-axis <-5> speed <20>; + turn lthighb to z-axis <-5> speed <20>; + turn rthighb to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn lthighf to x-axis <-10> speed<160>; + turn lkneef to x-axis <15> speed<145>; + turn lshinf to x-axis <-60> speed<250>; + turn lfootf to x-axis <30> speed<145>; + + turn rthighf to x-axis <40> speed<145>; + turn rkneef to x-axis <-35> speed<145>; + turn rshinf to x-axis <-40> speed<145>; + turn rfootf to x-axis <35> speed<145>; + + turn lthighb to x-axis <-10> speed<160>; + turn lkneeb to x-axis <15> speed<145>; + turn lshinb to x-axis <-60> speed<250>; + turn lfootb to x-axis <30> speed<145>; + + turn rthighb to x-axis <40> speed<145>; + turn rkneeb to x-axis <-35> speed<145>; + turn rshinb to x-axis <-40> speed<145>; + turn rfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshinf around x-axis;} + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn rthighf to x-axis <70> speed<115>; + turn rkneef to x-axis <-40> speed<145>; + turn rshinf to x-axis <20> speed<145>; + turn rfootf to x-axis <-50> speed<310>; + + turn lthighf to x-axis <-20> speed<310>; + turn lkneef to x-axis <-60> speed<310>; + turn lshinf to x-axis <50> speed<310>; + turn lfootf to x-axis <30> speed<310>; + + turn rthighb to x-axis <70> speed<115>; + turn rkneeb to x-axis <-40> speed<145>; + turn rshinb to x-axis <20> speed<145>; + turn rfootb to x-axis <-50> speed<310>; + + turn lthighb to x-axis <-20> speed<310>; + turn lkneeb to x-axis <-60> speed<310>; + turn lshinb to x-axis <50> speed<310>; + turn lfootb to x-axis <30> speed<310>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthighf to z-axis <5> speed <20>; + turn rthighf to z-axis <5> speed <20>; + turn lthighb to z-axis <5> speed <20>; + turn rthighb to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn rthighf to x-axis <-10> speed<160>; + turn rkneef to x-axis <15> speed<145>; + turn rshinf to x-axis <-60> speed<250>; + turn rfootf to x-axis <30> speed<145>; + + turn lthighf to x-axis <40> speed<145>; + turn lkneef to x-axis <-35> speed<145>; + turn lshinf to x-axis <-40> speed<145>; + turn lfootf to x-axis <35> speed<145>; + + turn rthighb to x-axis <-10> speed<160>; + turn rkneeb to x-axis <15> speed<145>; + turn rshinb to x-axis <-60> speed<250>; + turn rfootb to x-axis <30> speed<145>; + + turn lthighb to x-axis <40> speed<145>; + turn lkneeb to x-axis <-35> speed<145>; + turn lshinb to x-axis <-40> speed<145>; + turn lfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshinf around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + move body to y-axis [0.000000] speed [200.000000]; + turn lfootf to x-axis <0> speed <200>; + turn rfootf to x-axis <0> speed <200>; + turn rthighf to x-axis <0> speed <200>; + turn lthighf to x-axis <0> speed <200>; + turn lshinf to x-axis <0> speed <200>; + turn rshinf to x-axis <0> speed <200>; + turn lkneef to x-axis <0> speed <200>; + turn rkneef to x-axis <0> speed <200>; + turn lfootb to x-axis <0> speed <200>; + turn rfootb to x-axis <0> speed <200>; + turn rthighb to x-axis <0> speed <200>; + turn lthighb to x-axis <0> speed <200>; + turn lshinb to x-axis <0> speed <200>; + turn rshinb to x-axis <0> speed <200>; + turn lkneeb to x-axis <0> speed <200>; + turn rkneeb to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lblade to y-axis <40> speed [1]; + turn rblade to y-axis <-40> speed [1]; + wait-for-turn lblade around y-axis; + turn lblade to y-axis <0> speed [0.3]; + turn rblade to y-axis <0> speed [0.3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenc1.cob b/Scripts/ChickenDefenseScripts/chickenc1.cob new file mode 100644 index 000000000..de99a0753 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenc1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenc2.cob b/Scripts/ChickenDefenseScripts/chickenc2.cob new file mode 100644 index 000000000..de99a0753 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenc2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenc3.bos b/Scripts/ChickenDefenseScripts/chickenc3.bos new file mode 100644 index 000000000..cd7a1d6bb --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenc3.bos @@ -0,0 +1,235 @@ +piece body,head,tail,lthighf,lkneef,lshinf,lfootf,rthighf,rkneef,rshinf,rfootf,rblade,lblade,lthighb,lkneeb,lshinb,lfootb,rthighb,rkneeb,rshinb,rfootb; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn lthighf to x-axis <70> speed<115>; + turn lkneef to x-axis <-40> speed<190>; + turn lshinf to x-axis <20> speed<190>; + turn lfootf to x-axis <-50> speed<410>; + + turn rthighf to x-axis <-20> speed<410>; + turn rkneef to x-axis <-60> speed<410>; + turn rshinf to x-axis <50> speed<410>; + turn rfootf to x-axis <30> speed<410>; + + turn lthighb to x-axis <70> speed<115>; + turn lkneeb to x-axis <-40> speed<190>; + turn lshinb to x-axis <20> speed<190>; + turn lfootb to x-axis <-50> speed<410>; + + turn rthighb to x-axis <-20> speed<410>; + turn rkneeb to x-axis <-60> speed<410>; + turn rshinb to x-axis <50> speed<410>; + turn rfootb to x-axis <30> speed<410>; + + turn body to z-axis <5> speed <20>; + turn lthighf to z-axis <-5> speed <20>; + turn rthighf to z-axis <-5> speed <20>; + turn lthighb to z-axis <-5> speed <20>; + turn rthighb to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn lthighf to x-axis <-10> speed<160>; + turn lkneef to x-axis <15> speed<190>; + turn lshinf to x-axis <-60> speed<250>; + turn lfootf to x-axis <30> speed<190>; + + turn rthighf to x-axis <40> speed<190>; + turn rkneef to x-axis <-35> speed<190>; + turn rshinf to x-axis <-40> speed<190>; + turn rfootf to x-axis <35> speed<190>; + + turn lthighb to x-axis <-10> speed<160>; + turn lkneeb to x-axis <15> speed<190>; + turn lshinb to x-axis <-60> speed<250>; + turn lfootb to x-axis <30> speed<190>; + + turn rthighb to x-axis <40> speed<190>; + turn rkneeb to x-axis <-35> speed<190>; + turn rshinb to x-axis <-40> speed<190>; + turn rfootb to x-axis <35> speed<190>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshinf around x-axis;} + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn rthighf to x-axis <70> speed<115>; + turn rkneef to x-axis <-40> speed<190>; + turn rshinf to x-axis <20> speed<190>; + turn rfootf to x-axis <-50> speed<410>; + + turn lthighf to x-axis <-20> speed<410>; + turn lkneef to x-axis <-60> speed<410>; + turn lshinf to x-axis <50> speed<410>; + turn lfootf to x-axis <30> speed<410>; + + turn rthighb to x-axis <70> speed<115>; + turn rkneeb to x-axis <-40> speed<190>; + turn rshinb to x-axis <20> speed<190>; + turn rfootb to x-axis <-50> speed<410>; + + turn lthighb to x-axis <-20> speed<410>; + turn lkneeb to x-axis <-60> speed<410>; + turn lshinb to x-axis <50> speed<410>; + turn lfootb to x-axis <30> speed<410>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthighf to z-axis <5> speed <20>; + turn rthighf to z-axis <5> speed <20>; + turn lthighb to z-axis <5> speed <20>; + turn rthighb to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn rthighf to x-axis <-10> speed<160>; + turn rkneef to x-axis <15> speed<190>; + turn rshinf to x-axis <-60> speed<250>; + turn rfootf to x-axis <30> speed<190>; + + turn lthighf to x-axis <40> speed<190>; + turn lkneef to x-axis <-35> speed<190>; + turn lshinf to x-axis <-40> speed<190>; + turn lfootf to x-axis <35> speed<190>; + + turn rthighb to x-axis <-10> speed<160>; + turn rkneeb to x-axis <15> speed<190>; + turn rshinb to x-axis <-60> speed<250>; + turn rfootb to x-axis <30> speed<190>; + + turn lthighb to x-axis <40> speed<190>; + turn lkneeb to x-axis <-35> speed<190>; + turn lshinb to x-axis <-40> speed<190>; + turn lfootb to x-axis <35> speed<190>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshinf around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + move body to y-axis [0.000000] speed [200.000000]; + turn lfootf to x-axis <0> speed <200>; + turn rfootf to x-axis <0> speed <200>; + turn rthighf to x-axis <0> speed <200>; + turn lthighf to x-axis <0> speed <200>; + turn lshinf to x-axis <0> speed <200>; + turn rshinf to x-axis <0> speed <200>; + turn lkneef to x-axis <0> speed <200>; + turn rkneef to x-axis <0> speed <200>; + turn lfootb to x-axis <0> speed <200>; + turn rfootb to x-axis <0> speed <200>; + turn rthighb to x-axis <0> speed <200>; + turn lthighb to x-axis <0> speed <200>; + turn lshinb to x-axis <0> speed <200>; + turn rshinb to x-axis <0> speed <200>; + turn lkneeb to x-axis <0> speed <200>; + turn rkneeb to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lblade to y-axis <40> speed [1]; + turn rblade to y-axis <-40> speed [1]; + wait-for-turn lblade around y-axis; + turn lblade to y-axis <0> speed [0.3]; + turn rblade to y-axis <0> speed [0.3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenc3.cob b/Scripts/ChickenDefenseScripts/chickenc3.cob new file mode 100644 index 000000000..63bef320c Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenc3.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenc3b.cob b/Scripts/ChickenDefenseScripts/chickenc3b.cob new file mode 100644 index 000000000..63bef320c Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenc3b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenc3c.cob b/Scripts/ChickenDefenseScripts/chickenc3c.cob new file mode 100644 index 000000000..63bef320c Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenc3c.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickend1.bos b/Scripts/ChickenDefenseScripts/chickend1.bos new file mode 100644 index 000000000..b4aaad2ce --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickend1.bos @@ -0,0 +1,66 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, firepoint; + +// Signal definitions +#define SIG_AIM 2 + +Create() +{ + turn body to y-axis Rand(0, 65534) now; + emit-sfx 1024+2 from body; + move body to y-axis [-20] now; + move body to y-axis [0] speed [8]; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + sleep 30; + return (TRUE); +} + +AimFromPrimary(piecenum) +{ + piecenum = firepoint; +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +HitByWeaponId() +{ + emit-sfx 1024 from body; + return 100; +} + +Killed( severity, corpsetype ) +{ + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); +} + +StartBuilding(Func_Var_1, Func_Var_2) +{ +} + +StopBuilding() +{ +} + +QueryNanoPiece(piecenum) +{ + piecenum = firepoint; +} diff --git a/Scripts/ChickenDefenseScripts/chickend1.cob b/Scripts/ChickenDefenseScripts/chickend1.cob new file mode 100644 index 000000000..afba783f0 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickend1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenf1.bos b/Scripts/ChickenDefenseScripts/chickenf1.bos new file mode 100644 index 000000000..f8a8cde77 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenf1.bos @@ -0,0 +1,109 @@ +piece body,head,tail,lwing,rwing,lblade,mblade,rblade,rsack,lsack; + +static-var bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +fly() +{ + if (bMoving) + { + turn lwing to z-axis <-40> speed<60>; + turn rwing to z-axis <40> speed<60>; + wait-for-turn lwing around z-axis; + turn lwing to z-axis <40> speed<120>; + turn rwing to z-axis <-40> speed<120>; + wait-for-turn lwing around z-axis; + start-script fly(); + } +} + +stopfly () +{ + turn lwing to z-axis <0> speed <200>; + turn rwing to z-axis <0> speed <200>; +} + +StartMoving() +{ + bMoving = TRUE; + start-script fly(); +} + +StopMoving() +{ + bMoving = FALSE; + start-script stopfly(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to x-axis 0 -pitch speed <200>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1024 from lwing; + emit-sfx 1024 from rwing; + explode body type SHATTER | NOHEATCLOUD; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lwing type FALL | NOHEATCLOUD; + explode rwing type FALL | NOHEATCLOUD; + explode mblade type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenf1.cob b/Scripts/ChickenDefenseScripts/chickenf1.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenf1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenf1b.cob b/Scripts/ChickenDefenseScripts/chickenf1b.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenf1b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenf2.cob b/Scripts/ChickenDefenseScripts/chickenf2.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenf2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh1.bos b/Scripts/ChickenDefenseScripts/chickenh1.bos new file mode 100644 index 000000000..65888cca6 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenh1.bos @@ -0,0 +1,187 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearm,lupperarm,lblade,rforearm,rupperarm,rblade; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + hide rblade; + hide lblade; + emit-sfx 1024+2 from body; +} + +StartBuilding() +{ + set INBUILDSTANCE to 1; +} + +StopBuilding() +{ + set INBUILDSTANCE to 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = head; +} + + +SweetSpot(piecenum) + { piecenum=body; } + + +RestoreAfterDelay() + { + sleep 1000; + } + + +Shot1() + { + turn lforearm to y-axis <-140> speed <600>; + turn rforearm to y-axis <140> speed <600>; + //turn lblade to y-axis <140> speed <600>; + //turn rblade to y-axis <-140> speed <600>; + //wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0> speed <120>; + turn rforearm to y-axis <0> speed <120>; + //turn lblade to y-axis <0> speed <120>; + //turn rblade to y-axis <0> speed <120>; + } + + +HitByWeaponId() + { + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + explode head type FALL | NOHEATCLOUD; + explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenh1.cob b/Scripts/ChickenDefenseScripts/chickenh1.cob new file mode 100644 index 000000000..c5b26ccee Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh1b.cob b/Scripts/ChickenDefenseScripts/chickenh1b.cob new file mode 100644 index 000000000..c5b26ccee Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh1b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh2.cob b/Scripts/ChickenDefenseScripts/chickenh2.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh3.cob b/Scripts/ChickenDefenseScripts/chickenh3.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh3.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh4.cob b/Scripts/ChickenDefenseScripts/chickenh4.cob new file mode 100644 index 000000000..4170b1fea Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh4.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenh5.bos b/Scripts/ChickenDefenseScripts/chickenh5.bos new file mode 100644 index 000000000..03a29c197 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenh5.bos @@ -0,0 +1,256 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearm,lupperarm,lblade,rforearm,rupperarm,rblade,head_emit; + +static-var aMoving, bMoving, lasthit; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define CHANGE_TARGET 98 + +#include "sfxtype.h" +#include "exptype.h" + + +FxEmit() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + emit-sfx 1024+3 from head_emit; + sleep 600; + } +} + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return 100; +} + +Create() +{ + emit-sfx 1024+2 from body; + start-script FxEmit(); +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + turn head to y-axis 0 speed <250>; + turn head to x-axis 0 speed <200>; + } + +AimPrimary(heading,pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); +} + +AimSecondary(heading,pitch) +{ + signal SIG_AIM_2; + set-signal-mask SIG_AIM_2; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); +} + + +Shot1() + { + turn lforearm to y-axis <-140> speed <600>; + turn rforearm to y-axis <140> speed <600>; + turn lblade to y-axis <140> speed <600>; + turn rblade to y-axis <-140> speed <600>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0> speed <120>; + turn rforearm to y-axis <0> speed <120>; + turn lblade to y-axis <0> speed <120>; + turn rblade to y-axis <0> speed <120>; + } + +Shot2() + { + turn lforearm to y-axis <-450> speed <600>; + turn rforearm to y-axis <45> speed <600>; + turn lblade to y-axis <45> speed <600>; + turn rblade to y-axis <-45> speed <600>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0> speed <120>; + turn rforearm to y-axis <0> speed <120>; + turn lblade to y-axis <0> speed <120>; + turn rblade to y-axis <0> speed <120>; + set CHANGE_TARGET to 2; + } + +QuerySecondary(piecenum) + { piecenum=head; } + + AimFromSecondary(piecenum) + { piecenum=head; } + + +StartBuilding(heading, pitch) +{ + turn head to y-axis heading speed <250.000000>; + set INBUILDSTANCE to 1; +} + +StopBuilding() +{ + set INBUILDSTANCE to 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = head_emit; +} + + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lblade type FALL | NOHEATCLOUD; + explode rblade type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenh5.cob b/Scripts/ChickenDefenseScripts/chickenh5.cob new file mode 100644 index 000000000..7beef661e Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenh5.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenp1.bos b/Scripts/ChickenDefenseScripts/chickenp1.bos new file mode 100644 index 000000000..ff2f72985 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenp1.bos @@ -0,0 +1,234 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack; + +static-var aMoving, bMoving, bAiming, bCanAim, shooting_num, base_speed, restore_delay; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define SIG_RESTORE 32 + +#include "sfxtype.h" +#include "exptype.h" + + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <100>; + turn rfoot to x-axis <0> speed <100>; + turn rthigh to x-axis <0> speed <100>; + turn lthigh to x-axis <0> speed <100>; + turn lshin to x-axis <0> speed <100>; + turn rshin to x-axis <0> speed <100>; + turn lfoot to y-axis <0> speed <100>; + turn rfoot to y-axis <0> speed <100>; + turn rthigh to y-axis <0> speed <100>; + turn lthigh to y-axis <0> speed <100>; + turn lshin to y-axis <0> speed <100>; + turn rshin to y-axis <0> speed <100>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Activate() +{ + +} + +Deactivate() +{ + +} + +RestoreAfterDelay() +{ + sleep 1000; + +} + +Create() +{ + emit-sfx 1024+2 from body; + + start-script RestoreAfterDelay(); +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + while( 255 > heading ) + { + set UNKNOWN_UNIT_VALUE(82) to 0 - 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading + 1000; + sleep 1; + } + while( heading > 255 ) + { + set UNKNOWN_UNIT_VALUE(82) to 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading - 1000; + sleep 1; + } + return (1); +} + +AimSecondary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <175>; + turn head to x-axis 0 -pitch speed <175>; + wait-for-turn head around y-axis; + wait-for-turn head around x-axis; + return(1); + } + +Shot2() + { + turn lsack to y-axis <30> speed <200>; + turn rsack to y-axis <-30> speed <200>; + move rsack to x-axis [-1] speed [9]; + move lsack to x-axis [1] speed [9];; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed <20>; + turn rsack to y-axis <0> speed <20>; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + } + +SweetSpot(piecenum) + { piecenum=body; } + +HitByWeaponId() + { + emit-sfx 1024 from head; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from head; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lthigh type FALL | NOHEATCLOUD; + explode rthigh type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenp1.cob b/Scripts/ChickenDefenseScripts/chickenp1.cob new file mode 100644 index 000000000..d462be4a1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenp1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenr1.bos b/Scripts/ChickenDefenseScripts/chickenr1.bos new file mode 100644 index 000000000..a7e5dc6bf --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenr1.bos @@ -0,0 +1,189 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define CHANGE_TARGET 98 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <30> speed <200>; + turn rsack to y-axis <-30> speed <200>; + move rsack to x-axis [-1] speed [9]; + move lsack to x-axis [1] speed [9];; + wait-for-turn lsack around y-axis; + set CHANGE_TARGET to 1; + turn lsack to y-axis <0> speed <20>; + turn rsack to y-axis <0> speed <20>; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenr1.cob b/Scripts/ChickenDefenseScripts/chickenr1.cob new file mode 100644 index 000000000..4fc8ab168 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenr1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenr2.bos b/Scripts/ChickenDefenseScripts/chickenr2.bos new file mode 100644 index 000000000..7da71aa81 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenr2.bos @@ -0,0 +1,238 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack; + +static-var aMoving, bMoving, bAiming, bCanAim, shooting_num, base_speed, restore_delay; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define SIG_RESTORE 32 + +#include "sfxtype.h" +#include "exptype.h" + + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + emit-sfx 1024 from head; + } + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + + } + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + emit-sfx 1024 from head; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <100>; + turn rfoot to x-axis <0> speed <100>; + turn rthigh to x-axis <0> speed <100>; + turn lthigh to x-axis <0> speed <100>; + turn lshin to x-axis <0> speed <100>; + turn rshin to x-axis <0> speed <100>; + turn lfoot to y-axis <0> speed <100>; + turn rfoot to y-axis <0> speed <100>; + turn rthigh to y-axis <0> speed <100>; + turn lthigh to y-axis <0> speed <100>; + turn lshin to y-axis <0> speed <100>; + turn rshin to y-axis <0> speed <100>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Activate() +{ + +} + +Deactivate() +{ + +} + +RestoreAfterDelay() +{ + sleep 1000; + +} + +Create() +{ + emit-sfx 1024+2 from body; + + start-script RestoreAfterDelay(); +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + while( 255 > heading ) + { + set UNKNOWN_UNIT_VALUE(82) to 0 - 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading + 1000; + sleep 1; + } + while( heading > 255 ) + { + set UNKNOWN_UNIT_VALUE(82) to 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading - 1000; + sleep 1; + } + return (1); +} + +AimSecondary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <175>; + turn head to x-axis 0 -pitch speed <175>; + wait-for-turn head around y-axis; + wait-for-turn head around x-axis; + return(1); + } + +Shot2() + { + turn lsack to y-axis <30> speed <200>; + turn rsack to y-axis <-30> speed <200>; + move rsack to x-axis [-1] speed [9]; + move lsack to x-axis [1] speed [9];; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed <20>; + turn rsack to y-axis <0> speed <20>; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + } + +SweetSpot(piecenum) + { piecenum=body; } + +HitByWeaponId() + { + emit-sfx 1024+1 from head; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1024+2 from head; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lthigh type FALL | NOHEATCLOUD; + explode rthigh type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenr2.cob b/Scripts/ChickenDefenseScripts/chickenr2.cob new file mode 100644 index 000000000..6adf136bf Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenr2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenr3.bos b/Scripts/ChickenDefenseScripts/chickenr3.bos new file mode 100644 index 000000000..19d73f328 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenr3.bos @@ -0,0 +1,198 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, head, tail, lthigh, lknee, lshin, lfoot, rthigh, + rknee, rshin, rfoot, rsack, lsack; + +static-var bMoving, Static_Var_2; + +// Signal definitions +#define SIG_AIM 2 +#define CHANGE_TARGET 98 + +walk() +{ + while( bMoving ) + { + Static_Var_2 = 1; + if( bMoving ) + { + turn lthigh to x-axis <70.000000> speed <115.000000>; + turn lknee to x-axis <-40.000000> speed <145.000000>; + turn lshin to x-axis <20.000000> speed <145.000000>; + turn lfoot to x-axis <-50.000000> speed <210.000000>; + turn rthigh to x-axis <-20.000000> speed <210.000000>; + turn rknee to x-axis <-60.000000> speed <210.000000>; + turn rshin to x-axis <50.000000> speed <210.000000>; + turn rfoot to x-axis <30.000000> speed <210.000000>; + turn body to z-axis <5.000000> speed <20.000000>; + turn lthigh to z-axis <-5.000000> speed <20.000000>; + turn rthigh to z-axis <-5.000000> speed <20.000000>; + move body to y-axis [0.700000] speed [4.443359]; + turn tail to y-axis <10.000000> speed <40.000000>; + turn head to x-axis <-10.000000> speed <20.000000>; + turn tail to x-axis <10.000000> speed <20.000000>; + wait-for-turn lthigh around x-axis; + } + if( bMoving ) + { + turn lthigh to x-axis <-10.000000> speed <160.000000>; + turn lknee to x-axis <15.000000> speed <145.000000>; + turn lshin to x-axis <-60.000000> speed <250.000000>; + turn lfoot to x-axis <30.000000> speed <145.000000>; + turn rthigh to x-axis <40.000000> speed <145.000000>; + turn rknee to x-axis <-35.000000> speed <145.000000>; + turn rshin to x-axis <-40.000000> speed <145.000000>; + turn rfoot to x-axis <35.000000> speed <145.000000>; + move body to y-axis [0.000000] speed [4.443359]; + turn head to x-axis <10.000000> speed <20.000000>; + turn tail to x-axis <-10.000000> speed <20.000000>; + wait-for-turn lshin around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <70.000000> speed <115.000000>; + turn rknee to x-axis <-40.000000> speed <145.000000>; + turn rshin to x-axis <20.000000> speed <145.000000>; + turn rfoot to x-axis <-50.000000> speed <210.000000>; + turn lthigh to x-axis <-20.000000> speed <210.000000>; + turn lknee to x-axis <-60.000000> speed <210.000000>; + turn lshin to x-axis <50.000000> speed <210.000000>; + turn lfoot to x-axis <30.000000> speed <210.000000>; + turn tail to y-axis <-10.000000> speed <40.000000>; + turn body to z-axis <-5.000000> speed <20.000000>; + turn lthigh to z-axis <5.000000> speed <20.000000>; + turn rthigh to z-axis <5.000000> speed <20.000000>; + move body to y-axis [0.700000] speed [4.443359]; + turn head to x-axis <-10.000000> speed <20.000000>; + turn tail to x-axis <10.000000> speed <20.000000>; + wait-for-turn rthigh around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <-10.000000> speed <160.000000>; + turn rknee to x-axis <15.000000> speed <145.000000>; + turn rshin to x-axis <-60.000000> speed <250.000000>; + turn rfoot to x-axis <30.000000> speed <145.000000>; + turn lthigh to x-axis <40.000000> speed <145.000000>; + turn lknee to x-axis <-35.000000> speed <145.000000>; + turn lshin to x-axis <-40.000000> speed <145.000000>; + turn lfoot to x-axis <35.000000> speed <145.000000>; + move body to y-axis [0.000000] speed [4.443359]; + turn head to x-axis <10.000000> speed <20.000000>; + turn tail to x-axis <-10.000000> speed <20.000000>; + wait-for-turn rshin around x-axis; + } + } +} + +Halt() +{ + sleep 150; + if( !bMoving ) + { + Static_Var_2 = 0; + turn lfoot to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lshin to x-axis <0.000000> speed <200.000000>; + turn rshin to x-axis <0.000000> speed <200.000000>; + turn lknee to x-axis <0.000000> speed <200.000000>; + turn rknee to x-axis <0.000000> speed <200.000000>; + } +} + +StartMoving() +{ + bMoving = TRUE; + if( !Static_Var_2 ) + { + start-script walk(); + } +} + +StopMoving() +{ + bMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024 + 2 from body; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +AimFromPrimary(piecenum) +{ + piecenum = head; +} + +QueryPrimary(piecenum) +{ + piecenum = head; +} + +RestoreAfterDelay() +{ + sleep 1000; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250.000000>; + turn head to x-axis <0.000000> - pitch speed <200.000000>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + return (1); +} + +Shot1() +{ + turn lsack to y-axis <30.000000> speed <200.000000>; + turn rsack to y-axis <-30.000000> speed <200.000000>; + move rsack to x-axis [-1.000000] speed [9.000000]; + move lsack to x-axis [1.000000] speed [9.000000]; + wait-for-turn lsack around y-axis; + set CHANGE_TARGET to 1; + turn lsack to y-axis <0.000000> speed <20.000000>; + turn rsack to y-axis <0.000000> speed <20.000000>; + move rsack to x-axis [0.000000] speed [0.300000]; + move lsack to x-axis [0.000000] speed [0.300000]; +} + +HitByWeaponId() +{ + emit-sfx 1024 from body; + return (100); +} + + +Killed(severity, corpsetype) +{ + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1025 from head; + emit-sfx 1025 from tail; + emit-sfx 1025 from lsack; + explode body type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode head type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode tail type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthigh type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lknee type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshin type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthigh type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rknee type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshin type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rsack type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lsack type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; +} diff --git a/Scripts/ChickenDefenseScripts/chickenr3.cob b/Scripts/ChickenDefenseScripts/chickenr3.cob new file mode 100644 index 000000000..3661264f2 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenr3.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickens1.bos b/Scripts/ChickenDefenseScripts/chickens1.bos new file mode 100644 index 000000000..636ed0c8a --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickens1.bos @@ -0,0 +1,223 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,rblade,lblade,mblade,spike1,spike2,spike3; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis;} + if (aMoving) { + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +AimSecondary(heading,pitch) + { + if ( get IN_WATER(0) == 0 ) + { + return (0); + } + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +Shot2() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickens1.cob b/Scripts/ChickenDefenseScripts/chickens1.cob new file mode 100644 index 000000000..a6e7a4439 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickens1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickens2.bos b/Scripts/ChickenDefenseScripts/chickens2.bos new file mode 100644 index 000000000..af3a93e9b --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickens2.bos @@ -0,0 +1,224 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,rblade,lblade,mblade,spike1,spike2,spike3; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<310>; + + turn rthigh to x-axis <-20> speed<310>; + turn rknee to x-axis <-60> speed<310>; + turn rshin to x-axis <50> speed<310>; + turn rfoot to x-axis <30> speed<310>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis;} + if (aMoving) { + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<225>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<225>; + + turn rthigh to x-axis <40> speed<225>; + turn rknee to x-axis <-35> speed<225>; + turn rshin to x-axis <-40> speed<225>; + turn rfoot to x-axis <35> speed<225>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<225>; + turn rshin to x-axis <20> speed<225>; + turn rfoot to x-axis <-50> speed<310>; + + turn lthigh to x-axis <-20> speed<310>; + turn lknee to x-axis <-60> speed<310>; + turn lshin to x-axis <50> speed<310>; + turn lfoot to x-axis <30> speed<310>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<225>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<225>; + + turn lthigh to x-axis <40> speed<225>; + turn lknee to x-axis <-35> speed<225>; + turn lshin to x-axis <-40> speed<225>; + turn lfoot to x-axis <35> speed<225>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + sleep 300; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +AimSecondary(heading,pitch) + { + if ( get IN_WATER(0) == 0 ) + { + return (0); + } + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <250>; + turn head to x-axis 0 -pitch speed <200>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +Shot2() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickens2.cob b/Scripts/ChickenDefenseScripts/chickens2.cob new file mode 100644 index 000000000..d22783cb6 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickens2.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickens3.cob b/Scripts/ChickenDefenseScripts/chickens3.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickens3.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenw1.bos b/Scripts/ChickenDefenseScripts/chickenw1.bos new file mode 100644 index 000000000..1e8802701 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/chickenw1.bos @@ -0,0 +1,118 @@ +piece body,head,tail,lwing,rwing,lblade,mblade,rblade,rsack,lsack; + +static-var bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + + +fly() +{ + if (bMoving) + { + turn lwing to z-axis <-40> speed<120>; + turn rwing to z-axis <40> speed<120>; + wait-for-turn lwing around z-axis; + turn lwing to z-axis <40> speed<240>; + turn rwing to z-axis <-40> speed<240>; + wait-for-turn lwing around z-axis; + start-script fly(); + } +} + +stopfly () +{ + turn lwing to z-axis <0> speed <200>; + turn rwing to z-axis <0> speed <200>; +} + + +Go() +{ + call-script fly(); +} + +Stop() +{ + call-script stopfly(); +} + +StartMoving() +{ + bMoving = TRUE; + start-script fly(); +} + +StopMoving() +{ + bMoving = FALSE; + start-script stopfly(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + + RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to x-axis 0 -pitch speed <200>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +SweetSpot(piecenum) + { piecenum=body; } + + + +HitByWeaponId() + { + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode head type FALL; + explode lwing type FALL; + explode rwing type FALL; + explode mblade type FALL | EXPLODE_ON_HIT; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/chickenw1.cob b/Scripts/ChickenDefenseScripts/chickenw1.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenw1.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenw1b.cob b/Scripts/ChickenDefenseScripts/chickenw1b.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenw1b.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenw1c.cob b/Scripts/ChickenDefenseScripts/chickenw1c.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenw1c.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenw1d.cob b/Scripts/ChickenDefenseScripts/chickenw1d.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenw1d.cob differ diff --git a/Scripts/ChickenDefenseScripts/chickenw2.cob b/Scripts/ChickenDefenseScripts/chickenw2.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/chickenw2.cob differ diff --git a/Scripts/ChickenDefenseScripts/e_chickenq.cob b/Scripts/ChickenDefenseScripts/e_chickenq.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/e_chickenq.cob differ diff --git a/Scripts/ChickenDefenseScripts/epic_chickenq.bos b/Scripts/ChickenDefenseScripts/epic_chickenq.bos new file mode 100644 index 000000000..6846e62e4 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/epic_chickenq.bos @@ -0,0 +1,425 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, head, tail, lthighf, lkneef, lshinf, lfootf, rthighf, + rkneef, rshinf, rfootf, lthighb, lkneeb, lshinb, lfootb, rthighb, + rkneeb, rshinb, rfootb, lforearml, lbladel, rforearml, rbladel, lforearmu, + lbladeu, rforearmu, rbladeu, spike1, spike2, spike3, firepoint; + +static-var bMoving, Static_Var_2, Static_Var_3, Static_Var_4, Static_Var_5; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + while( bMoving ) + { + Static_Var_2 = 1; + if( bMoving ) + { + turn lthighf to x-axis <70.000000> speed <115.000000>; + turn lkneef to x-axis <-40.000000> speed <145.000000>; + turn lshinf to x-axis <20.000000> speed <145.000000>; + turn lfootf to x-axis <-50.000000> speed <210.000000>; + turn rthighf to x-axis <-20.000000> speed <210.000000>; + turn rkneef to x-axis <-60.000000> speed <210.000000>; + turn rshinf to x-axis <50.000000> speed <210.000000>; + turn rfootf to x-axis <30.000000> speed <210.000000>; + turn rthighb to x-axis <70.000000> speed <115.000000>; + turn rkneeb to x-axis <-40.000000> speed <145.000000>; + turn rshinb to x-axis <20.000000> speed <145.000000>; + turn rfootb to x-axis <-50.000000> speed <210.000000>; + turn lthighb to x-axis <-20.000000> speed <210.000000>; + turn lkneeb to x-axis <-60.000000> speed <210.000000>; + turn lshinb to x-axis <50.000000> speed <210.000000>; + turn lfootb to x-axis <30.000000> speed <210.000000>; + turn body to z-axis <5.000000> speed <20.000000>; + turn lthighf to z-axis <-5.000000> speed <20.000000>; + turn rthighf to z-axis <-5.000000> speed <20.000000>; + turn lthighb to z-axis <-5.000000> speed <20.000000>; + turn rthighb to z-axis <-5.000000> speed <20.000000>; + move body to y-axis [0.700000] speed [4.443359]; + turn tail to y-axis <10.000000> speed <40.000000>; + turn head to x-axis <-10.000000> speed <20.000000>; + turn tail to x-axis <10.000000> speed <20.000000>; + wait-for-turn lthighf around x-axis; + emit-sfx 1024+3 from lthighf; + emit-sfx 1024+3 from spike1; + } + if( bMoving ) + { + turn lthighf to x-axis <-10.000000> speed <160.000000>; + turn lkneef to x-axis <15.000000> speed <145.000000>; + turn lshinf to x-axis <-60.000000> speed <250.000000>; + turn lfootf to x-axis <30.000000> speed <145.000000>; + turn rthighf to x-axis <40.000000> speed <145.000000>; + turn rkneef to x-axis <-35.000000> speed <145.000000>; + turn rshinf to x-axis <-40.000000> speed <145.000000>; + turn rfootf to x-axis <35.000000> speed <145.000000>; + turn rthighb to x-axis <-10.000000> speed <160.000000>; + turn rkneeb to x-axis <15.000000> speed <145.000000>; + turn rshinb to x-axis <-60.000000> speed <250.000000>; + turn rfootb to x-axis <30.000000> speed <145.000000>; + turn lthighb to x-axis <40.000000> speed <145.000000>; + turn lkneeb to x-axis <-35.000000> speed <145.000000>; + turn lshinb to x-axis <-40.000000> speed <145.000000>; + turn lfootb to x-axis <35.000000> speed <145.000000>; + move body to y-axis [0.000000] speed [4.443359]; + turn head to x-axis <10.000000> speed <20.000000>; + turn tail to x-axis <-10.000000> speed <20.000000>; + wait-for-turn lshinf around x-axis; + emit-sfx 1024+3 from lshinf; + emit-sfx 1024+3 from spike2; + } + if( bMoving ) + { + turn rthighf to x-axis <70.000000> speed <115.000000>; + turn rkneef to x-axis <-40.000000> speed <145.000000>; + turn rshinf to x-axis <20.000000> speed <145.000000>; + turn rfootf to x-axis <-50.000000> speed <210.000000>; + turn lthighf to x-axis <-20.000000> speed <210.000000>; + turn lkneef to x-axis <-60.000000> speed <210.000000>; + turn lshinf to x-axis <50.000000> speed <210.000000>; + turn lfootf to x-axis <30.000000> speed <210.000000>; + turn lthighb to x-axis <70.000000> speed <115.000000>; + turn lkneeb to x-axis <-40.000000> speed <145.000000>; + turn lshinb to x-axis <20.000000> speed <145.000000>; + turn lfootb to x-axis <-50.000000> speed <210.000000>; + turn rthighb to x-axis <-20.000000> speed <210.000000>; + turn rkneeb to x-axis <-60.000000> speed <210.000000>; + turn rshinb to x-axis <50.000000> speed <210.000000>; + turn rfootb to x-axis <30.000000> speed <210.000000>; + turn tail to y-axis <-10.000000> speed <40.000000>; + turn body to z-axis <-5.000000> speed <20.000000>; + turn lthighf to z-axis <5.000000> speed <20.000000>; + turn rthighf to z-axis <5.000000> speed <20.000000>; + turn lthighb to z-axis <5.000000> speed <20.000000>; + turn rthighb to z-axis <5.000000> speed <20.000000>; + move body to y-axis [0.700000] speed [4.443359]; + turn head to x-axis <-10.000000> speed <20.000000>; + turn tail to x-axis <10.000000> speed <20.000000>; + wait-for-turn rthighf around x-axis; + emit-sfx 1024+3 from rthighf; + emit-sfx 1024+3 from spike3; + } + if( bMoving ) + { + turn rthighf to x-axis <-10.000000> speed <160.000000>; + turn rkneef to x-axis <15.000000> speed <145.000000>; + turn rshinf to x-axis <-60.000000> speed <250.000000>; + turn rfootf to x-axis <30.000000> speed <145.000000>; + turn lthighf to x-axis <40.000000> speed <145.000000>; + turn lkneef to x-axis <-35.000000> speed <145.000000>; + turn lshinf to x-axis <-40.000000> speed <145.000000>; + turn lfootf to x-axis <35.000000> speed <145.000000>; + turn lthighb to x-axis <-10.000000> speed <160.000000>; + turn lkneeb to x-axis <15.000000> speed <145.000000>; + turn lshinb to x-axis <-60.000000> speed <250.000000>; + turn lfootb to x-axis <30.000000> speed <145.000000>; + turn rthighb to x-axis <40.000000> speed <145.000000>; + turn rkneeb to x-axis <-35.000000> speed <145.000000>; + turn rshinb to x-axis <-40.000000> speed <145.000000>; + turn rfootb to x-axis <35.000000> speed <145.000000>; + move body to y-axis [0.000000] speed [4.443359]; + turn head to x-axis <10.000000> speed <20.000000>; + turn tail to x-axis <-10.000000> speed <20.000000>; + wait-for-turn rshinf around x-axis; + emit-sfx 1024+3 from rshinf; + emit-sfx 1024+3 from head; + } + } +} + +Halt() +{ + sleep 150; + if( !bMoving ) + { + Static_Var_2 = 0; + turn lfootf to x-axis <0.000000> speed <200.000000>; + turn rfootf to x-axis <0.000000> speed <200.000000>; + turn rthighf to x-axis <0.000000> speed <200.000000>; + turn lthighf to x-axis <0.000000> speed <200.000000>; + turn lshinf to x-axis <0.000000> speed <200.000000>; + turn rshinf to x-axis <0.000000> speed <200.000000>; + turn lkneef to x-axis <0.000000> speed <200.000000>; + turn rkneef to x-axis <0.000000> speed <200.000000>; + turn lfootb to x-axis <0.000000> speed <200.000000>; + turn rfootb to x-axis <0.000000> speed <200.000000>; + turn rthighb to x-axis <0.000000> speed <200.000000>; + turn lthighb to x-axis <0.000000> speed <200.000000>; + turn lshinb to x-axis <0.000000> speed <200.000000>; + turn rshinb to x-axis <0.000000> speed <200.000000>; + turn lkneeb to x-axis <0.000000> speed <200.000000>; + turn rkneeb to x-axis <0.000000> speed <200.000000>; + } +} + +StartMoving() +{ + bMoving = TRUE; + if( !Static_Var_2 ) + { + start-script walk(); + } +} + +StopMoving() +{ + bMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1026 from body; + emit-sfx 1026 from head; + emit-sfx 1026 from tail; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +AimFromPrimary(piecenum) +{ + piecenum = firepoint; +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint; +} + +AimFromWeapon2(Func_Var_1) +{ + Func_Var_1 = 27; +} + +QueryWeapon2(Func_Var_1) +{ + Func_Var_1 = 27; +} + +AimFromWeapon3(Func_Var_1) +{ + Func_Var_1 = 28; +} + +QueryWeapon3(Func_Var_1) +{ + Func_Var_1 = 28; +} + +AimFromWeapon4(Func_Var_1) +{ + Func_Var_1 = 29; +} + +QueryWeapon4(Func_Var_1) +{ + Func_Var_1 = 29; +} + +AimFromWeapon5(Func_Var_1) +{ + Func_Var_1 = 30; +} + +QueryWeapon5(Func_Var_1) +{ + Func_Var_1 = 30; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <350.000000>; + turn head to x-axis <0.000000> - pitch speed <300.000000>; + wait-for-turn head around y-axis; + return (1); +} + +AimWeapon2() +{ + return (1); +} + +AimWeapon3() +{ + return (1); +} + +AimWeapon4() +{ + return (1); +} + +AimWeapon5(Func_Var_1, Func_Var_2) +{ + Static_Var_4 = Func_Var_2; + Static_Var_5 = Func_Var_1; + return (1); +} + +Shot1() +{ + ++Static_Var_3; + if( Static_Var_3 > 4 ) + { + Static_Var_3 = 1; + } + if( Static_Var_3 == 1 ) + { + turn lforearmu to y-axis <-140.000000> speed <600.000000>; + turn lbladeu to y-axis <140.000000> speed <600.000000>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0.000000> speed <120.000000>; + turn lbladeu to y-axis <0.000000> speed <120.000000>; + } + if( Static_Var_3 == 2 ) + { + turn lforearml to y-axis <-140.000000> speed <600.000000>; + turn lbladel to y-axis <140.000000> speed <600.000000>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0.000000> speed <120.000000>; + turn lbladel to y-axis <0.000000> speed <120.000000>; + } + if( Static_Var_3 == 3 ) + { + turn rforearmu to y-axis <140.000000> speed <600.000000>; + turn rbladeu to y-axis <-140.000000> speed <600.000000>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0.000000> speed <120.000000>; + turn rbladeu to y-axis <0.000000> speed <120.000000>; + } + if( Static_Var_3 == 4 ) + { + turn rforearml to y-axis <140.000000> speed <600.000000>; + turn rbladel to y-axis <-140.000000> speed <600.000000>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0.000000> speed <120.000000>; + turn rbladel to y-axis <0.000000> speed <120.000000>; + } +} + +Shot2() +{ + set UNKNOWN_UNIT_VALUE(98) to 2; +} + +Shot3() +{ + set UNKNOWN_UNIT_VALUE(98) to 3; +} + +Shot4() +{ + set UNKNOWN_UNIT_VALUE(98) to 4; +} + +Shot5() +{ + turn head to x-axis <0.000000> - Static_Var_4 speed <400.000000>; + turn head to y-axis Static_Var_5 speed <300.000000>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140.000000> speed <600.000000>; + turn lbladeu to y-axis <140.000000> speed <600.000000>; + turn lforearml to y-axis <-140.000000> speed <600.000000>; + turn lbladel to y-axis <140.000000> speed <600.000000>; + turn rforearmu to y-axis <140.000000> speed <600.000000>; + turn rbladeu to y-axis <-140.000000> speed <600.000000>; + turn rforearml to y-axis <140.000000> speed <600.000000>; + turn rbladel to y-axis <-140.000000> speed <600.000000>; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0.000000> speed <120.000000>; + turn lbladeu to y-axis <0.000000> speed <120.000000>; + turn lforearml to y-axis <0.000000> speed <120.000000>; + turn lbladel to y-axis <0.000000> speed <120.000000>; + turn rforearmu to y-axis <0.000000> speed <120.000000>; + turn rbladeu to y-axis <0.000000> speed <120.000000>; + turn rforearml to y-axis <0.000000> speed <120.000000>; + turn rbladel to y-axis <0.000000> speed <120.000000>; +} + +HitByWeaponId(Func_Var_1, Func_Var_2, Func_Var_3, Func_Var_4) +{ + if( Func_Var_3 == 51 ) + { + emit-sfx 1025 from head; + emit-sfx 1025 from body; + emit-sfx 1024 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1024 from lthighf; + emit-sfx 1025 from lthighb; + } + return (100); +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1025 from head; + emit-sfx 1025 from rbladeu; + emit-sfx 1025 from lbladel; + emit-sfx 1025 from tail; + emit-sfx 1025 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1025 from lthighf; + emit-sfx 1025 from lthighb; + emit-sfx 1024 from rfootf; + emit-sfx 1024 from rfootb; + emit-sfx 1024 from lfootf; + emit-sfx 1024 from lfootb; + sleep 50; + emit-sfx 2048 + 4 from body; + emit-sfx 2048 + 4 from head; + emit-sfx 2048 + 4 from tail; + emit-sfx 2048 + 4 from lthighf; + emit-sfx 2048 + 4 from rthighf; + emit-sfx 2048 + 4 from rthighb; + emit-sfx 2048 + 4 from lthighb; + emit-sfx 2048 + 4 from spike1; + emit-sfx 2048 + 4 from spike2; + emit-sfx 2048 + 4 from spike3; + explode head type FALL | FIRE | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike1 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike2 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike3 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode tail type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode body type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; +} diff --git a/Scripts/ChickenDefenseScripts/epic_chickenq.cob b/Scripts/ChickenDefenseScripts/epic_chickenq.cob new file mode 100644 index 000000000..f4a39cf49 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/epic_chickenq.cob differ diff --git a/Scripts/ChickenDefenseScripts/h_chickenq.cob b/Scripts/ChickenDefenseScripts/h_chickenq.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/h_chickenq.cob differ diff --git a/Scripts/ChickenDefenseScripts/n_chickenq.bos b/Scripts/ChickenDefenseScripts/n_chickenq.bos new file mode 100644 index 000000000..37008dfcb --- /dev/null +++ b/Scripts/ChickenDefenseScripts/n_chickenq.bos @@ -0,0 +1,417 @@ +piece body,head,tail,lthighf,lkneef,lshinf,lfootf,rthighf,rkneef,rshinf,rfootf,lthighb,lkneeb,lshinb,lfootb,rthighb,rkneeb,rshinb,rfootb,lforearml,lbladel,rforearml,rbladel,lforearmu,lbladeu,rforearmu,rbladeu,spike1,spike2,spike3,firepoint; + +static-var aMoving, bMoving, gun_1, shot5pitch, shot5heading; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define CHANGE_TARGET 98 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthighf to x-axis <70> speed<115>; + turn lkneef to x-axis <-40> speed<145>; + turn lshinf to x-axis <20> speed<145>; + turn lfootf to x-axis <-50> speed<210>; + + turn rthighf to x-axis <-20> speed<210>; + turn rkneef to x-axis <-60> speed<210>; + turn rshinf to x-axis <50> speed<210>; + turn rfootf to x-axis <30> speed<210>; + + turn rthighb to x-axis <70> speed<115>; + turn rkneeb to x-axis <-40> speed<145>; + turn rshinb to x-axis <20> speed<145>; + turn rfootb to x-axis <-50> speed<210>; + + turn lthighb to x-axis <-20> speed<210>; + turn lkneeb to x-axis <-60> speed<210>; + turn lshinb to x-axis <50> speed<210>; + turn lfootb to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthighf to z-axis <-5> speed <20>; + turn rthighf to z-axis <-5> speed <20>; + turn lthighb to z-axis <-5> speed <20>; + turn rthighb to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthighf around x-axis;} + + if (aMoving) { + turn lthighf to x-axis <-10> speed<160>; + turn lkneef to x-axis <15> speed<145>; + turn lshinf to x-axis <-60> speed<250>; + turn lfootf to x-axis <30> speed<145>; + + turn rthighf to x-axis <40> speed<145>; + turn rkneef to x-axis <-35> speed<145>; + turn rshinf to x-axis <-40> speed<145>; + turn rfootf to x-axis <35> speed<145>; + + turn rthighb to x-axis <-10> speed<160>; + turn rkneeb to x-axis <15> speed<145>; + turn rshinb to x-axis <-60> speed<250>; + turn rfootb to x-axis <30> speed<145>; + + turn lthighb to x-axis <40> speed<145>; + turn lkneeb to x-axis <-35> speed<145>; + turn lshinb to x-axis <-40> speed<145>; + turn lfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshinf around x-axis;} + if (aMoving) { + + turn rthighf to x-axis <70> speed<115>; + turn rkneef to x-axis <-40> speed<145>; + turn rshinf to x-axis <20> speed<145>; + turn rfootf to x-axis <-50> speed<210>; + + turn lthighf to x-axis <-20> speed<210>; + turn lkneef to x-axis <-60> speed<210>; + turn lshinf to x-axis <50> speed<210>; + turn lfootf to x-axis <30> speed<210>; + + turn lthighb to x-axis <70> speed<115>; + turn lkneeb to x-axis <-40> speed<145>; + turn lshinb to x-axis <20> speed<145>; + turn lfootb to x-axis <-50> speed<210>; + + turn rthighb to x-axis <-20> speed<210>; + turn rkneeb to x-axis <-60> speed<210>; + turn rshinb to x-axis <50> speed<210>; + turn rfootb to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthighf to z-axis <5> speed <20>; + turn rthighf to z-axis <5> speed <20>; + turn lthighb to z-axis <5> speed <20>; + turn rthighb to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthighf around x-axis;} + if (aMoving) { + + turn rthighf to x-axis <-10> speed<160>; + turn rkneef to x-axis <15> speed<145>; + turn rshinf to x-axis <-60> speed<250>; + turn rfootf to x-axis <30> speed<145>; + + turn lthighf to x-axis <40> speed<145>; + turn lkneef to x-axis <-35> speed<145>; + turn lshinf to x-axis <-40> speed<145>; + turn lfootf to x-axis <35> speed<145>; + + turn lthighb to x-axis <-10> speed<160>; + turn lkneeb to x-axis <15> speed<145>; + turn lshinb to x-axis <-60> speed<250>; + turn lfootb to x-axis <30> speed<145>; + + turn rthighb to x-axis <40> speed<145>; + turn rkneeb to x-axis <-35> speed<145>; + turn rshinb to x-axis <-40> speed<145>; + turn rfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshinf around x-axis; + + } + + } + + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfootf to x-axis <0> speed <200>; + turn rfootf to x-axis <0> speed <200>; + turn rthighf to x-axis <0> speed <200>; + turn lthighf to x-axis <0> speed <200>; + turn lshinf to x-axis <0> speed <200>; + turn rshinf to x-axis <0> speed <200>; + turn lkneef to x-axis <0> speed <200>; + turn rkneef to x-axis <0> speed <200>; + turn lfootb to x-axis <0> speed <200>; + turn rfootb to x-axis <0> speed <200>; + turn rthighb to x-axis <0> speed <200>; + turn lthighb to x-axis <0> speed <200>; + turn lshinb to x-axis <0> speed <200>; + turn rshinb to x-axis <0> speed <200>; + turn lkneeb to x-axis <0> speed <200>; + turn rkneeb to x-axis <0> speed <200>; + } +} + + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Create() +{ + emit-sfx 1026 from body; + emit-sfx 1026 from head; + emit-sfx 1026 from tail; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=firepoint; } + +QueryPrimary(piecenum) + { piecenum=firepoint; } + +AimFromWeapon2(piecenum) + { piecenum=spike1; } + +QueryWeapon2(piecenum) + { piecenum=spike1; } + +AimFromWeapon3(piecenum) + { piecenum=spike2; } + +QueryWeapon3(piecenum) + { piecenum=spike2; } + +AimFromWeapon4(piecenum) + { piecenum=spike3; } + +QueryWeapon4(piecenum) + { piecenum=spike3; } + +AimFromWeapon5(piecenum) + { piecenum=firepoint; } + +QueryWeapon5(piecenum) + { piecenum=firepoint; } + + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <350>; + turn head to x-axis 0 -pitch speed <300>; + + wait-for-turn head around y-axis; + + return(TRUE); + } + +AimWeapon2() + { + return(TRUE); + } + +AimWeapon3() + { + return(TRUE); + } + +AimWeapon4() + { + return(TRUE); + } + +AimWeapon5(heading,pitch) + { + shot5pitch = pitch; + shot5heading = heading; + return(TRUE); + } + + +Shot1() + { + ++gun_1; + if (gun_1 > 4) + { + gun_1 = 1; + } + if (gun_1 == 1) + { + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 2) + { + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + } + if (gun_1 == 3) + { + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 4) + { + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + } + } + + +Shot2() +{ + set CHANGE_TARGET to 2; +} + +Shot3() +{ + set CHANGE_TARGET to 3; +} + +Shot4() +{ +set CHANGE_TARGET to 4; +} + +Shot5() +{ + turn head to x-axis 0 -shot5pitch speed <400>; + turn head to y-axis shot5heading speed <300>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; +} + + +HitByWeaponId(z,x,weapon_id,shot_power) + { + if (weapon_id == 51) + { + emit-sfx 1025 from head; + emit-sfx 1025 from body; + emit-sfx 1024 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1024 from lthighf; + emit-sfx 1025 from lthighb; + } + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1025 from head; + emit-sfx 1025 from rbladeu; + emit-sfx 1025 from lbladel; + emit-sfx 1025 from tail; + emit-sfx 1025 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1025 from lthighf; + emit-sfx 1025 from lthighb; + emit-sfx 1024 from rfootf; + emit-sfx 1024 from rfootb; + emit-sfx 1024 from lfootf; + emit-sfx 1024 from lfootb; + sleep 50; + emit-sfx 2048+4 from body; + emit-sfx 2048+4 from head; + emit-sfx 2048+4 from tail; + emit-sfx 2048+4 from lthighf; + emit-sfx 2048+4 from rthighf; + emit-sfx 2048+4 from rthighb; + emit-sfx 2048+4 from lthighb; + emit-sfx 2048+4 from spike1; + emit-sfx 2048+4 from spike2; + emit-sfx 2048+4 from spike3; + explode head type FALL | FIRE | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD;; + explode lbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike1 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike2 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike3 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode tail type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode body type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/ChickenDefenseScripts/n_chickenq.cob b/Scripts/ChickenDefenseScripts/n_chickenq.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/n_chickenq.cob differ diff --git a/Scripts/ChickenDefenseScripts/roost.bos b/Scripts/ChickenDefenseScripts/roost.bos new file mode 100644 index 000000000..94796f953 --- /dev/null +++ b/Scripts/ChickenDefenseScripts/roost.bos @@ -0,0 +1,55 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, emit, launcher, arm; + + +Create() +{ + hide launcher; + hide emit; + hide base; + dont-shade base; + dont-cache base; + set ARMORED to 0; + move launcher to y-axis [3000.000000] speed [10000.000000]; + move launcher to x-axis [0.000000] speed [10000.000000]; + move launcher to z-axis [0.000000] speed [10000.000000]; + turn launcher to y-axis <90.000000> speed <10000.000000>; + turn launcher to x-axis <90.000000> speed <10000.000000>; + turn launcher to z-axis <90.000000> speed <10000.000000>; + sleep 100; + spin arm around y-axis speed <21.978022>; + turn arm to x-axis Rand( <0.005495>, <40.989011> ) speed <1000.000000>; + sleep Rand( 1, 100 ); + emit-sfx 2048 from launcher; + sleep 3000; + show base; +} + +Killed(severity, corpsetype) +{ + emit-sfx 1025 from emit; +} + +QueryNanoPiece(piecenum) +{ + piecenum = base; +} + +QueryWeapon1(piecenum) +{ + piecenum = base; +} + +AimFromWeapon1(piecenum) +{ + piecenum = base; +} + +QueryLandingPad(Func_Var_1) +{ + Func_Var_1 = 1; +} diff --git a/Scripts/ChickenDefenseScripts/roost.cob b/Scripts/ChickenDefenseScripts/roost.cob new file mode 100644 index 000000000..5eedd9a0d Binary files /dev/null and b/Scripts/ChickenDefenseScripts/roost.cob differ diff --git a/Scripts/ChickenDefenseScripts/ve_chickenq.cob b/Scripts/ChickenDefenseScripts/ve_chickenq.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/ve_chickenq.cob differ diff --git a/Scripts/ChickenDefenseScripts/vh_chickenq.cob b/Scripts/ChickenDefenseScripts/vh_chickenq.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/ChickenDefenseScripts/vh_chickenq.cob differ diff --git a/Scripts/Units/scavboss/exptype.h b/Scripts/Units/scavboss/exptype.h new file mode 100644 index 000000000..7a83187b2 --- /dev/null +++ b/Scripts/Units/scavboss/exptype.h @@ -0,0 +1,193 @@ +/* +** EXPtype.h -- Explosion Type information and GET/SET constants for scripts +** +** This Script contains constants compatible only with Spring RTS engine +** not for use with Total Annihilation or TA:Kindgoms +*/ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +// Indices for emit-sfx +#ifndef __SFXTYPE_H_ +#define SFXTYPE_VTOL 0 +//#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 // same as SFX_WAKE +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 // same as SFX_REVERSE_WAKE + +#define SFXTYPE_WHITESMOKE 257 +#define SFXTYPE_BLACKSMOKE 258 +#define SFXTYPE_SUBBUBBLES 259 +#endif + +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define NOCEGTRAIL 64 // Disables the cegtrail for the specific piece (defined in the unit fbi) +#define NOHEATCLOUD 128 // No engine default heat cloud for explosion +#define BITMAP 10000001 + +// Bitmap Explosion Types +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 + +//Customized effects (in FBI/TDF/LUA) +// Explosion generators +#define UNIT_SFX0 1024 +#define UNIT_SFX1 1025 +#define UNIT_SFX2 1026 +#define UNIT_SFX3 1027 +#define UNIT_SFX4 1028 +#define UNIT_SFX5 1029 +#define UNIT_SFX6 1030 +#define UNIT_SFX7 1031 +#define UNIT_SFX8 1032 +#define UNIT_SFX9 1033 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 +#define FIRE_W9 2056 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 +#define DETO_W9 4104 + + +// COB constants +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get +#define REVERSING 109 // get + +// Indices for SET, GET, and GET_UNIT_VALUE for LUA return values +#define LUA0 110 // (LUA0 returns the lua call status, 0 or 1) +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) get WEAPON_RELOADSTATE(weaponNum) for GET +#define WEAPON_RELOADTIME 126 // get (with fake set) get WEAPON_RELOADSTATE(-weaponNum,val) for SET +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define WEAPON_STOCKPILE_COUNT 139 // get (with fake set) + + +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get +#define KSIN 135 // get, kiloSine 1024*sin(x) as COB uses only integers +#define KCOS 136 // get, kiloCosine 1024*cos(x) + +#define KTAN 137 // get, kiloTangent 1024*tan(x) carefull with angles close to 90 deg. might cause overflow +#define SQRT 138 // get, square root (floored to integer) + +#define ENERGY_MAKE 140 // set or get (100*E production) + +#define METAL_MAKE 141 // set or get (100*M production) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif \ No newline at end of file diff --git a/LuaIntro/README.md b/Scripts/Units/scavboss/sfxtype.h similarity index 100% rename from LuaIntro/README.md rename to Scripts/Units/scavboss/sfxtype.h diff --git a/Scripts/Units/scavboss/unitDefsTurretSpeeds.h b/Scripts/Units/scavboss/unitDefsTurretSpeeds.h new file mode 100644 index 000000000..c30940742 --- /dev/null +++ b/Scripts/Units/scavboss/unitDefsTurretSpeeds.h @@ -0,0 +1,68 @@ +/* unitDefsTurretSpeeds.h -- sets turret speed via unitDefs (through lua gadget Spring.CallCOBScript()) + The following variables are assumed to exist: + Weapon1TurretX, Weapon1TurretY + ... + Weapon10TurretX, Weapon10TurretY +*/ + +static-var Weapon1TurretX, Weapon1TurretY; +static-var Weapon2TurretX, Weapon2TurretY; +static-var Weapon3TurretX, Weapon3TurretY; +static-var Weapon4TurretX, Weapon4TurretY; +static-var Weapon5TurretX, Weapon5TurretY; +static-var Weapon6TurretX, Weapon6TurretY; +static-var Weapon7TurretX, Weapon7TurretY; +static-var Weapon8TurretX, Weapon8TurretY; +static-var Weapon9TurretX, Weapon9TurretY; +static-var Weapon10TurretX, Weapon10TurretY; + +SetWeapon1TurretSpeed(var1,var2) +{ + Weapon1TurretX = var1; + Weapon1TurretY = var2; +} +SetWeapon2TurretSpeed(var1,var2) +{ + Weapon2TurretX = var1; + Weapon2TurretY = var2; +} +SetWeapon3TurretSpeed(var1,var2) +{ + Weapon3TurretX = var1; + Weapon3TurretY = var2; +} +SetWeapon4TurretSpeed(var1,var2) +{ + Weapon4TurretX = var1; + Weapon4TurretY = var2; +} +SetWeapon5TurretSpeed(var1,var2) +{ + Weapon5TurretX = var1; + Weapon5TurretY = var2; +} +SetWeapon6TurretSpeed(var1,var2) +{ + Weapon6TurretX = var1; + Weapon6TurretY = var2; +} +SetWeapon7TurretSpeed(var1,var2) +{ + Weapon7TurretX = var1; + Weapon7TurretY = var2; +} +SetWeapon8TurretSpeed(var1,var2) +{ + Weapon8TurretX = var1; + Weapon8TurretY = var2; +} +SetWeapon9TurretSpeed(var1,var2) +{ + Weapon9TurretX = var1; + Weapon9TurretY = var2; +} +SetWeapon10TurretSpeed(var1,var2) +{ + Weapon10TurretX = var1; + Weapon10TurretY = var2; +} \ No newline at end of file diff --git a/Scripts/Units/scavboss/water2.h b/Scripts/Units/scavboss/water2.h new file mode 100644 index 000000000..b5a5be089 --- /dev/null +++ b/Scripts/Units/scavboss/water2.h @@ -0,0 +1,31 @@ +/* Rockunit.h -- Rock the unit when it fire a heavy weapon with lots of recoil */ + +#ifndef __ROCKUNIT_H_ +#define __ROCKUNIT_H_ + + +RockUnit(anglex,anglez) + { + + #define FIRST_SPEED 15 + #define SECOND_SPEED 12 + #define THIRD_SPEED 9 + + turn base to x-axis anglex speed ; + turn base to z-axis anglez speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (0-anglex) speed ; + turn base to z-axis (0-anglez) speed ; + + //wait-for-turn base around z-axis; + //wait-for-turn base around x-axis; + + //turn base to x-axis <0> speed ; + //turn base to z-axis <0> speed ; + + + } +#endif diff --git a/Scripts/Units/scavboss/water3.h b/Scripts/Units/scavboss/water3.h new file mode 100644 index 000000000..5066f3284 --- /dev/null +++ b/Scripts/Units/scavboss/water3.h @@ -0,0 +1,35 @@ +#ifndef __ROCKUNIT_H_ +#define __ROCKUNIT_H_ + + +RockUnit(anglex,anglez) + { + + #define FIRST_SPEED 10 + #define SECOND_SPEED 8 + #define THIRD_SPEED 6 + #define FIFTH_SPEED 4 + + turn base to x-axis anglex speed ; + turn base to z-axis anglez speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (0-anglex) speed ; + turn base to z-axis (0-anglez) speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (anglex/2) speed ; + turn base to z-axis (anglez/2) speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis <0> speed ; + turn base to z-axis <0> speed ; + } +#endif + diff --git a/Scripts/Units/scavboss/weapon1control.h b/Scripts/Units/scavboss/weapon1control.h new file mode 100644 index 000000000..c93a74dc8 --- /dev/null +++ b/Scripts/Units/scavboss/weapon1control.h @@ -0,0 +1,168 @@ +/* +HOW TO: +- Model MUST contain aimx1 and aimy1 pieces +- Script must have defined Weapon1TurretX and Weapon1TurretY static-vars (turret turn speeds) +- Script must have defined aimx1 and aimy1 pieces +- Change script as such: +Create() +{ + [...] + start-script InitialSetup1(); + [...] +} + +AimWeapon1(heading, pitch) +{ + [...] + start-script Weapon1Drawn(); -- can call a function that draws weapons and then calls Weapon1Drawn() when done if there is an actual animation (ie pw) + [...] -- Remove animations from aimWeapon scripts (use a DrawWeapon1() if an animation is needed, weapon1control will rotate the different aimpieces) + start-script Weapon1SetWtdAim(heading, pitch); + [...] + return (aim1); +} + +static-var Stunned; +ExecuteRestoreAfterDelay() +{ + if (Stunned) { + return (1); + } +} +SetStunned(State) +{ + Stunned = State; + if (!Stunned) { + start-script ExecuteRestoreAfterDelay(); + } +} +RestoreAfterDelay() +{ + [...] + sleep sleeptime; + start-script RestoreWeapon1(); + [...] -- other animations; + call-script Weapon1Restored(); + [...] -- tell script wpn has been restored if needed for walkscripts +} + +- Weapon1Control moves the aim pieces depending on turretSpeeds, sets pitch = 1 when pitch reached and head = 1 when head reached +- Weapon1Drawn allows unit to fire by setting wpnReady1 = 1 +- if pitch = 1, head = 1 and wpnReady = 1 then the weapon can shoot: aim1 = 1 and aimweapon returns aim1 +- Restore animations go in RestoreAfterDelay, RestoreWeapon1() restores aimy and aimx pieces orientation, Weapon1Restored() waits for these pieces to be restored +*/ + +static-var curHead1, wtdHead1, head1, curPitch1, wtdPitch1, pitch1, aim1, wpnReady1; + +Weapon1Control() +{ + while (TRUE) + { + if (curHead1 > <180>) + { + curHead1 = <-360> + curHead1; + } + if (curPitch1 > <180>) + { + curPitch1 = <-360> + curPitch1; + } + if (curHead1 < <-180>) + { + curHead1 = <360> + curHead1; + } + if (curPitch1 < <-180>) + { + curPitch1 = <360> + curPitch1; + } + if (Static_Var_3 == 1) + { + if (((get ABS(curHead1 - wtdHead1)) > <360>) OR(((get ABS(curHead1 - wtdHead1)) > (Weapon1TurretY / 30)) AND ((get ABS(curHead1 - wtdHead1)) < <360> - (Weapon1TurretY / 30)))) + { + head1 = 0; + if(curHead1 < wtdHead1) { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 + (Weapon1TurretY / 30); + else curHead1 = curHead1 - (Weapon1TurretY / 30); + } + + else { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 - (Weapon1TurretY / 30); + else curHead1 = curHead1 + (Weapon1TurretY / 30); + } + } + else + { + head1 = 1; + curHead1 = wtdHead1; + } + if (((get ABS(curPitch1 - wtdPitch1)) > <360>) OR(((get ABS(curPitch1 - wtdPitch1)) > (Weapon1TurretX / 30)) AND ((get ABS(curPitch1 - wtdPitch1)) < <360> - (Weapon1TurretX / 30)))) + { + pitch1 = 0; + if(curPitch1 < wtdPitch1) { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 + (Weapon1TurretX / 30); + else curPitch1 = curPitch1 - (Weapon1TurretX / 30); + } + + else { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 - (Weapon1TurretX / 30); + else curPitch1 = curPitch1 + (Weapon1TurretX / 30); + } + } + else + { + pitch1 = 1; + curPitch1 = wtdPitch1; + } + if (pitch1 == 1 AND head1 == 1 AND wpnReady1 == 1 AND wtdHead1 != 0) + { + aim1 = 1; + } + else + { + aim1 = 0; + } + turn aimy1 to y-axis curHead1 now; + turn aimx1 to x-axis curPitch1 now; + } + sleep 1; + } +} + +InitialSetup1() +{ + curHead1 = 0; + curPitch1 = 0; + wtdHead1 = 0; + wtdPitch1 = 0; + wpnReady1 = 0; + start-script Weapon1Control(); +} + +Weapon1Drawn() +{ + wpnReady1 = 1; +} + +RestoreWeapon1() +{ + wtdHead1 = 0; + wtdPitch1 = 0; +} + +Weapon1Restored() +{ + wpnReady1 = 0; + while (curHead1 != 0) + { + sleep 25; + } + return (TRUE); +} + +Weapon1SetWtdAim(pitch, heading) +{ + wtdHead1 = heading; + wtdPitch1 = <0> - pitch; +} \ No newline at end of file diff --git a/Scripts/Units/scavboss/yard.h b/Scripts/Units/scavboss/yard.h new file mode 100644 index 000000000..048994e28 --- /dev/null +++ b/Scripts/Units/scavboss/yard.h @@ -0,0 +1,35 @@ +#ifndef SCRIPTS_YARD_H +#define SCRIPTS_YARD_H + +// keep trying to open building's yard until we succeed +OpenYard() + { + set YARD_OPEN to TRUE; + + while(!(get YARD_OPEN)) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to TRUE; + } + + set BUGGER_OFF to FALSE; + } + + +// keep trying to close building's yard until we succeed +CloseYard() + { + set YARD_OPEN to FALSE; + + while(get YARD_OPEN) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to FALSE; + } + + set BUGGER_OFF to FALSE; + } + +#endif // SCRIPTS_YARD_H diff --git a/Scripts/airscout.bos b/Scripts/airscout.bos deleted file mode 100644 index 485648879..000000000 --- a/Scripts/airscout.bos +++ /dev/null @@ -1,96 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, flare1, flare2; - -static-var moving; - -#define jethtrail 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from flare1; - emit-sfx jethtrail from flare2; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - - -Create() - { - turn flare1 to y-axis <180> now; - turn flare2 to y-axis <180> now; - start-script Thrust(); - start-script SmokeUnit(); - } - - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/airscout.cob b/Scripts/airscout.cob deleted file mode 100644 index 5b971ddb5..000000000 Binary files a/Scripts/airscout.cob and /dev/null differ diff --git a/Scripts/annihilator.bos b/Scripts/annihilator.bos deleted file mode 100644 index 5ad545105..000000000 --- a/Scripts/annihilator.bos +++ /dev/null @@ -1,127 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece barricade; // these are the pieces of the model - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from barricade; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ - -sleep 75; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/annihilatortest.bos b/Scripts/annihilatortest.bos deleted file mode 100644 index 75fb14ba6..000000000 --- a/Scripts/annihilatortest.bos +++ /dev/null @@ -1,129 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1; // these are the pieces of the model - -static-var gun_1; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ - -sleep 75; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/annihilatortest.cob b/Scripts/annihilatortest.cob deleted file mode 100644 index d17d62cd4..000000000 Binary files a/Scripts/annihilatortest.cob and /dev/null differ diff --git a/Scripts/antiairtower.bos b/Scripts/antiairtower.bos deleted file mode 100644 index bd9423569..000000000 --- a/Scripts/antiairtower.bos +++ /dev/null @@ -1,128 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1; // these are the pieces of the model - -static-var gun_1; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -sleep 75; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/armflash.bos b/Scripts/armflash.bos deleted file mode 100644 index f91124eac..000000000 --- a/Scripts/armflash.bos +++ /dev/null @@ -1,174 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, sleeve, barrel1, barrel2, firepoint1, firepoint2, wheels1, wheels2, wheels3, wheels4, wheels5, dirt; // these are the pieces of the model - -static-var moving, gun_1, shooting_num; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - spin wheels1 around x-axis speed <500.005495>; - spin wheels2 around x-axis speed <500.005495>; - spin wheels3 around x-axis speed <500.005495>; - spin wheels4 around x-axis speed <500.005495>; - spin wheels5 around x-axis speed <500.005495>; - } - else - { - stop-spin wheels1 around x-axis decelerate <200.005495>; - stop-spin wheels2 around x-axis decelerate <200.005495>; - stop-spin wheels3 around x-axis decelerate <200.005495>; - stop-spin wheels4 around x-axis decelerate <200.005495>; - stop-spin wheels5 around x-axis decelerate <200.005495>; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - shooting_num=1; - start-script Thrust(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn sleeve to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn sleeve to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn sleeve around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - if(shooting_num==1) - { - emit-sfx 1024 from firepoint2; - } - - if(shooting_num==2) - { - emit-sfx 1024 from firepoint1; - } - - shooting_num=shooting_num+1; - - if( shooting_num == 3) - { - shooting_num=1; - } -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = sleeve; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if (shooting_num==1) - { - piecenum=firepoint1; - } - - if (shooting_num==2) - { - piecenum=firepoint2; - } -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode sleeve type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode sleeve type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode sleeve type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode sleeve type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/armflash.cob b/Scripts/armflash.cob deleted file mode 100644 index c5251519d..000000000 Binary files a/Scripts/armflash.cob and /dev/null differ diff --git a/Scripts/artillarytank.bos b/Scripts/artillarytank.bos deleted file mode 100644 index a29ed40fc..000000000 --- a/Scripts/artillarytank.bos +++ /dev/null @@ -1,165 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, turret, barrel1, firepoint1; - -static-var Static_Var_1, Static_Var_2, Static_Var_3; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from turret; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( Static_Var_3 ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(Func_Var_1) -{ - Static_Var_2 = Func_Var_1; - if( Static_Var_2 == 2 ) - { - move hull to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } - else - { - move hull to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - if( Static_Var_2 == 4 ) - { - move hull to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - else - { - move hull to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } -} - -Create() -{ - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn turret to y-axis <0.000000> speed <60.000000>; -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - while( Static_Var_1 >= 1 ) - { - sleep 100; - } - signal 2; - set-signal-mask 2; - turn turret to y-axis Func_Var_1 speed <225.000000>; - wait-for-turn turret around y-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() -{ - if( Static_Var_1 == 0 ) - { - emit-sfx 1024 + 0 from firepoint1; - move barrel1 to z-axis [-3.000000] speed [500.000000]; - sleep 75; - move barrel1 to z-axis [0.000000] speed [1.000000]; - } - ++Static_Var_1; - if( Static_Var_1 >= 1 ) - { - Static_Var_1 = 0; - } -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = 1; -} - -QueryWeapon1(Func_Var_1) -{ - if( Static_Var_1 == 0 ) - { - Func_Var_1 = 3; - } -} - -SweetSpot(piecenum) -{ - piecenum = hull; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode hull type BITMAPONLY | BITMAP1; - explode barrel1 type BITMAPONLY | BITMAP1; - explode turret type BITMAPONLY | BITMAP4; - return (0); - } - if( severity <= 80 ) - { - corpsetype = 2; - explode hull type BITMAPONLY | BITMAP4; - explode barrel1 type FALL | BITMAP1; - explode turret type SHATTER | BITMAP4; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode hull type BITMAPONLY | BITMAP1; - explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode turret type SHATTER | BITMAP4; - return (0); - } - corpsetype = 3; - explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/barricade.bos b/Scripts/barricade.bos deleted file mode 100644 index 9370e52a8..000000000 --- a/Scripts/barricade.bos +++ /dev/null @@ -1,13 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, rotator; // these are the pieces of the model - - -Create() // tells it what to do on creation -{ - spin rotator around y-axis speed <20.005495>; -} - diff --git a/Scripts/barricade.cob b/Scripts/barricade.cob deleted file mode 100644 index 619ba65e9..000000000 Binary files a/Scripts/barricade.cob and /dev/null differ diff --git a/Scripts/burrow.bos b/Scripts/burrow.bos deleted file mode 100644 index 05607a5ce..000000000 --- a/Scripts/burrow.bos +++ /dev/null @@ -1,94 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -static-var Static_Var_1, tech; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1025 from firepoint1; -// } - sleep 500; - } -} - - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1026 from firepoint1; -// } - sleep 500; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn firepoint1 to x-axis <-90> now; - start-script SmokeUnit(); -} -/* -TechLost() -{ - set ACTIVATION to 0; - tech=FALSE; -} - -TechGranted() -{ - set ACTIVATION to 1; - tech=TRUE; -} -*/ -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; -} diff --git a/Scripts/burrow.cob b/Scripts/burrow.cob deleted file mode 100644 index 83e7063d8..000000000 Binary files a/Scripts/burrow.cob and /dev/null differ diff --git a/Scripts/constants.h b/Scripts/constants.h new file mode 100644 index 000000000..5405aeeec --- /dev/null +++ b/Scripts/constants.h @@ -0,0 +1,146 @@ +//just replaced it with rattle's. plus no dealing with a pissy Argh claiming that now we have to GPL EEEVVVRRYYTHING +//Argh, if you read this: honestly, wtf were you thinking trying to GPL a list of #defines? +// With the original cavedog comments STILL IN THEM!? +// You could at least have made it less bloody obvious that it was a direct copy/paste. +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ +#endif + +#define SFXTYPE_VTOL 1 +#define SFXTYPE_THRUST 2 +#define SFXTYPE_WAKE1 3 +#define SFXTYPE_WAKE2 4 +#define SFXTYPE_REVERSEWAKE1 5 +#define SFXTYPE_REVERSEWAKE2 6 + +#define SFXTYPE_POINTBASED 256 +#define SFXTYPE_WHITESMOKE 256|1 +#define SFXTYPE_BLACKSMOKE 256|2 +#define SFXTYPE_SUBBUBBLES 256|3 + +#define SHATTER 1 +#define EXPLODE_ON_HIT 2 +#define FALL 4 +#define SMOKE 8 +#define FIRE 16 +#define BITMAPONLY 32 +#define BITMAP 10000001 + +// Explosion generators +#define UNIT_SFX1 1024 +#define UNIT_SFX2 1025 +#define UNIT_SFX3 1026 +#define UNIT_SFX4 1027 +#define UNIT_SFX5 1028 +#define UNIT_SFX6 1029 +#define UNIT_SFX7 1030 +#define UNIT_SFX8 1031 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 + +// COB constants, as in CobInstance.cpp +// Indices for set/get value +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +/*#define WEAPON_AIM_ABORTED 21 +#define WEAPON_READY 22 +#define WEAPON_LAUNCH_NOW 23 +#define FINISHED_DYING 26 +#define ORIENTATION 27*/ +#define IN_WATER 28 +#define CURRENT_SPEED 29 +//#define MAGIC_DEATH 31 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get + +// NOTE: [LUA0 - LUA9] are defined in CobThread.cpp as [110 - 119] + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) +#define WEAPON_RELOADTIME 126 // get (with fake set) +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get diff --git a/Scripts/cpweapon.bos b/Scripts/cpweapon.bos deleted file mode 100644 index 864ede030..000000000 --- a/Scripts/cpweapon.bos +++ /dev/null @@ -1,110 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, stock, barrels, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define gdmarty 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn stock to x-axis <0.000000> speed <30.000000>; -stop-spin barrels around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn stock to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn stock around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -spin barrels around z-axis speed <500.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = stock; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode turret type BITMAPONLY | BITMAP1; -explode barrels type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode turret type BITMAPONLY | BITMAP4; -explode barrels type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode turret type BITMAPONLY | BITMAP1; -explode barrels type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrels type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/cpweapon.cob b/Scripts/cpweapon.cob deleted file mode 100644 index 2058db233..000000000 Binary files a/Scripts/cpweapon.cob and /dev/null differ diff --git a/Scripts/eaatank.bos b/Scripts/eaatank.bos deleted file mode 100644 index 7da9960c7..000000000 --- a/Scripts/eaatank.bos +++ /dev/null @@ -1,152 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt; // these are the pieces of the model - -static-var terraintype, bmoving, moving; // these are the variables - -#include "ROCKUNIT.H" - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx 1025 + 0 from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/eaatank.cob b/Scripts/eaatank.cob deleted file mode 100644 index c9e3d9d94..000000000 Binary files a/Scripts/eaatank.cob and /dev/null differ diff --git a/Scripts/eaatank2.bos b/Scripts/eaatank2.bos deleted file mode 100644 index b7305f55b..000000000 --- a/Scripts/eaatank2.bos +++ /dev/null @@ -1,194 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, tanks, dirt; // these are the pieces of the model - -static-var terraintype, bmoving, moving, shooting_num; // these are the variables - -#include "ROCKUNIT.H" - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from tanks; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - shooting_num=1; - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - - if(shooting_num==1) - { - emit-sfx 1025 from firepoint2; - } - if(shooting_num==2) - { - emit-sfx 1025 from firepoint3; - } - if(shooting_num==3) - { - emit-sfx 1025 from firepoint4; - } - if(shooting_num==4) - { - emit-sfx 1025 from firepoint1; - } - - shooting_num=shooting_num+1; - - if( shooting_num == 5) - { - shooting_num=1; - } -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ - { - piecenum=firepoint1; - } - - if (shooting_num==2) - { - piecenum=firepoint2; - } - - if (shooting_num==3) - { - piecenum=firepoint3; - } - - if (shooting_num==4) - { - piecenum=firepoint4; - } -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode tanks type EXPLODE_ON_HIT; -} diff --git a/Scripts/eaatank2.cob b/Scripts/eaatank2.cob deleted file mode 100644 index e219e9be9..000000000 Binary files a/Scripts/eaatank2.cob and /dev/null differ diff --git a/Scripts/eaaturret.bos b/Scripts/eaaturret.bos deleted file mode 100644 index f8768511b..000000000 --- a/Scripts/eaaturret.bos +++ /dev/null @@ -1,137 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, sfxpoint1, lilypad; // these are the pieces of the model - -static-var CanFire, terraintype; - -// Signal definitions -#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag - -// Custom SFX -#define GDMARTY 1024+0 - -SmokeUnit()// this is a standard smoke point define -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.5] speed [50]; - show lilypad; - } - else - { - move base to y-axis [0] speed [50]; - hide lilypad; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - hide lilypad; - } - else - { - move base to y-axis [-0.85] speed [50]; - show lilypad; - } -} - -cannotfire() -{ - while( TRUE ) - { - if (!CanFire) - { - emit-sfx 1025 from sfxpoint1; - } - sleep 1500; - } -} - -Create() // tells it what to do on creation -{ - CanFire=TRUE; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); - start-script cannotfire(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ - sleep 3000; - turn turret to y-axis <0> speed <60>; - turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // aiming animation and firing authorization -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - while(!CanFire) - sleep 200; - turn turret to y-axis heading speed <500>; - turn barrel1 to x-axis <0> - pitch speed <300>; - wait-for-turn turret around y-axis; - wait-for-turn barrel1 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - emit-sfx GDMARTY from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ - piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is created at -{ - piecenum = firepoint1; -} - -/* -TechLost() -{ - CanFire=FALSE; - signal SIG_AIM; -} - -TechGranted() -{ - CanFire=TRUE; -} -*/ - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode turret type EXPLODE_ON_HIT; - explode barrel1 type EXPLODE_ON_HIT; -} diff --git a/Scripts/eaaturret.cob b/Scripts/eaaturret.cob deleted file mode 100644 index 5b06b8898..000000000 Binary files a/Scripts/eaaturret.cob and /dev/null differ diff --git a/Scripts/eaircon.bos b/Scripts/eaircon.bos deleted file mode 100644 index 96c1e05ea..000000000 --- a/Scripts/eaircon.bos +++ /dev/null @@ -1,208 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, fan1, fan2, firepoint1; - -static-var Static_Var_1, gun_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype; - -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from base; - sleep 200; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2049 from base; - sleep 10; - } -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - -QueryWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - - -Go() -{ - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -Create() -{ - call-script InitState(); - spin fan1 around y-axis speed <1000.005495>; - spin fan2 around y-axis speed <1000.005495>; - start-script SmokeUnit(); -} - - -StartBuilding(Func_Var_1) -{ - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = base; - Static_Var_5 = 1; - return (0); - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/eaircon.cob b/Scripts/eaircon.cob deleted file mode 100644 index 277f3243d..000000000 Binary files a/Scripts/eaircon.cob and /dev/null differ diff --git a/Scripts/eairemp.bos b/Scripts/eairemp.bos new file mode 100644 index 000000000..b271f60ee --- /dev/null +++ b/Scripts/eairemp.bos @@ -0,0 +1,130 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, frontengines, fengine1, fengine2, rearengines, rengine1, rengine2, missileleft, missileright, firepoint1; + +static-var moving, flames; + +#define jethtrail 1024+0 + +// Signal definitions +#define SIG_AIM 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx jethtrail from fengine1; + emit-sfx jethtrail from fengine2; + emit-sfx jethtrail from rengine1; + emit-sfx jethtrail from rengine2; + } + sleep 5; + } +} + +StartMoving() +{ + moving=1; +} + +StopMoving() +{ + moving=0; +} + +MoveRate0() +{ + flames=0; + turn frontengines to x-axis <-90.000000> speed <150.000000>; + turn rearengines to x-axis <-90.000000> speed <150.000000>; +} +MoveRate1() +{ + flames=0; + turn frontengines to x-axis <-70.005495> speed <150.000000>; + turn rearengines to x-axis <-70.005495> speed <150.000000>; +} +MoveRate2() +{ + flames=1; + turn frontengines to x-axis <0.000000> speed <150.000000>; + turn rearengines to x-axis <0.000000> speed <150.000000>; +} + +Create() + { +// start-script Thrust(); + start-script SmokeUnit(); + } + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ + sleep 3000; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + start-script RestoreAfterDelay(); + return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 1024 + 0 from firepoint1; +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ + piecenum = firepoint1; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ + piecenum = firepoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode frontengines type EXPLODE_ON_HIT; + explode rearengines type EXPLODE_ON_HIT; + explode missileright type EXPLODE_ON_HIT; + explode missileleft type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/eairemp.cob b/Scripts/eairemp.cob new file mode 100644 index 000000000..074df8d62 Binary files /dev/null and b/Scripts/eairemp.cob differ diff --git a/Scripts/eairengineer.bos b/Scripts/eairengineer.bos deleted file mode 100644 index dba8aed99..000000000 --- a/Scripts/eairengineer.bos +++ /dev/null @@ -1,174 +0,0 @@ -piece base, doorleft, doorright, nanopoint1, penis, wheel, frontwings, fengine1, fengine2, rearwings, rengine1, rengine2; - -#include "springdefs.h" -#define SIG_BUILD 8 -#define jethtrail 1024+0 -#define nanoflame 1025+0 - -static-var bMoving, terraintype, building, moving, flames; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from fengine1; - emit-sfx jethtrail from fengine2; - emit-sfx jethtrail from rengine1; - emit-sfx jethtrail from rengine2; - } - sleep 5; - } -} - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - -Create() -{ -// start-script Thrust(); - start-script SmokeUnit(); -// turn fengine1 to y-axis <180> now; -// turn fengine2 to y-axis <180> now; -// turn rengine1 to y-axis <180> now; -// turn rengine2 to y-axis <180> now; - start-script buildflame(); -} - -QueryWeapon1(piecenum) -{ - piecenum=nanopoint1; -} - -AimFromWeapon1(piecenum) -{ - piecenum=penis; -} - -AimWeapon1(h,p) -{ - return 0; -} - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - turn doorleft to y-axis <90> speed <100.000000>; - turn doorright to y-axis <-90> speed <100.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; -// turn base to y-axis heading speed <160.000000>; -// turn base to x-axis heading speed <160.000000>; -// wait-for-turn base around y-axis; -// wait-for-turn base around x-axis; - move penis to z-axis [4] speed [1]; - set INBUILDSTANCE to 1; - building = 1; - while (1) { -// emit-sfx 2048 from nanopoint1; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - move penis to z-axis [0] speed [2]; - turn doorleft to y-axis <0> speed <50.000000>; - turn doorright to y-axis <0> speed <50.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; -// turn base to y-axis <0.000000> speed <160.000000>; -// turn base to x-axis <0.000000> speed <160.000000>; -// wait-for-turn base around y-axis; -// wait-for-turn base around x-axis; - -} - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -MoveRate0() -{ - flames=0; - turn frontwings to x-axis <-90.000000> speed <150.000000>; - turn rearwings to x-axis <-90.000000> speed <150.000000>; -} -MoveRate1() -{ - flames=0; - turn frontwings to x-axis <-70.005495> speed <150.000000>; - turn rearwings to x-axis <-70.005495> speed <150.000000>; -} -MoveRate2() -{ - flames=1; - turn frontwings to x-axis <0.000000> speed <150.000000>; - turn rearwings to x-axis <0.000000> speed <150.000000>; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode doorleft type EXPLODE_ON_HIT; - explode doorright type EXPLODE_ON_HIT; - explode penis type EXPLODE_ON_HIT; - explode wheel type EXPLODE_ON_HIT; - explode frontwings type EXPLODE_ON_HIT; - explode fengine1 type EXPLODE_ON_HIT; - explode fengine2 type EXPLODE_ON_HIT; - explode rearwings type EXPLODE_ON_HIT; - explode rengine1 type EXPLODE_ON_HIT; - explode rengine2 type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eairengineer.cob b/Scripts/eairengineer.cob deleted file mode 100644 index 4cc70a17a..000000000 Binary files a/Scripts/eairengineer.cob and /dev/null differ diff --git a/Scripts/eairengineer2.bos b/Scripts/eairengineer2.bos deleted file mode 100644 index 147d3edae..000000000 --- a/Scripts/eairengineer2.bos +++ /dev/null @@ -1,179 +0,0 @@ -piece base, nanopoint1, nanopoint2, frontwings, fengine1, fengine2, rearwings, rengine1, rengine2, righttip, lefttip; - -#include "springdefs.h" -#define SIG_BUILD 8 -#define jethtrail 1024+0 -#define nanoflame 1025+0 - -static-var bMoving, terraintype, building, moving, flames, spray; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from fengine1; - emit-sfx jethtrail from fengine2; - emit-sfx jethtrail from rengine1; - emit-sfx jethtrail from rengine2; - } - sleep 5; - } -} - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - emit-sfx nanoflame from nanopoint2; - - } - sleep 600; - } -} - -Create() -{ -// start-script Thrust(); - start-script SmokeUnit(); -// turn fengine1 to y-axis <180> now; -// turn fengine2 to y-axis <180> now; -// turn rengine1 to y-axis <180> now; -// turn rengine2 to y-axis <180> now; - spray = nanopoint1; - start-script buildflame(); -} - -QueryWeapon1(piecenum) -{ - if( spray == 0 ) - { - piecenum = nanopoint1; - } - if( spray == 1 ) - { - piecenum = nanopoint2; - } - ++spray; - if( spray >= 2 ) - { - spray = 0; - } -} - -AimFromWeapon1(piecenum) -{ - if( spray == 0 ) - { - piecenum = nanopoint1; - } - if( spray == 1 ) - { - piecenum = nanopoint2; - } - ++spray; - if( spray >= 2 ) - { - spray = 0; - } -} - -AimWeapon1(h,p) -{ - return 0; -} - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 1; - building = 1; - while (1) { - spin lefttip around y-axis speed <50.005495>; - spin righttip around y-axis speed <50.005495>; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - stop-spin lefttip around y-axis decelerate <15.000000>; - stop-spin righttip around y-axis decelerate <15.000000>; -} - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -MoveRate0() -{ - flames=0; - turn frontwings to x-axis <-90.000000> speed <150.000000>; - turn rearwings to x-axis <-90.000000> speed <150.000000>; -} -MoveRate1() -{ - flames=0; - turn frontwings to x-axis <-70.005495> speed <150.000000>; - turn rearwings to x-axis <-70.005495> speed <150.000000>; -} -MoveRate2() -{ - flames=1; - turn frontwings to x-axis <0.000000> speed <150.000000>; - turn rearwings to x-axis <0.000000> speed <150.000000>; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode lefttip type EXPLODE_ON_HIT; - explode righttip type EXPLODE_ON_HIT; - explode base type EXPLODE_ON_HIT; - explode frontwings type EXPLODE_ON_HIT; - explode rearwings type EXPLODE_ON_HIT; -} diff --git a/Scripts/eairengineer2.cob b/Scripts/eairengineer2.cob deleted file mode 100644 index e239a263e..000000000 Binary files a/Scripts/eairengineer2.cob and /dev/null differ diff --git a/Scripts/eairplant.bos b/Scripts/eairplant.bos deleted file mode 100644 index a014d817a..000000000 --- a/Scripts/eairplant.bos +++ /dev/null @@ -1,203 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, door1, door2, elevator, nano1, nano2, spinner, nanopoint, bottom, backbone, bottombackbone; - -static-var Aztec, spray, building; - -// Signal definitions (they must be distincts power of 2) -#define SIG_ACTIVATE 2 -#define SIG_BUILDING 4 -#define SIG_TECH 8 - -#define nanoflame 1024+0 - -SmokeUnit() -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - - -Activate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Wait for tech: - while(!Aztec) - sleep 400; - // Open animation: - move elevator to y-axis [37] speed [5]; - wait-for-move elevator along y-axis; - turn door2 to z-axis <90> speed <50>; - turn door1 to z-axis <-90> speed <50>; - wait-for-turn door2 around z-axis; - wait-for-turn door1 around z-axis; - // Try to open the yard - set YARD_OPEN to TRUE; - // If yard not open, tell units around to bugger off until yard is open - while( !get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to TRUE; - } - set BUGGER_OFF to FALSE; - // Now yard is open. - // Allow the nano to flow: - set INBUILDSTANCE to TRUE; - building = 1; - // Send spinner spinning: - spin spinner around y-axis speed <50>; -} - -Deactivate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Wait for tech: - while(!Aztec) - sleep 400; - // Switch off the nano faucet: - set INBUILDSTANCE to FALSE; - building = 0; - // Halt spinner spin - stop-spin spinner around y-axis decelerate <30>; - // Try to close the yard - set YARD_OPEN to FALSE; - // If yard not closed, tell units around to bugger off until yard is closed - while( get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to FALSE; - } - set BUGGER_OFF to FALSE; - // Now yard is closed. - // Close animation: - turn door2 to z-axis <0> speed <10>; - turn door1 to z-axis <0> speed <10>; - wait-for-turn door2 around z-axis; - wait-for-turn door1 around z-axis; - move elevator to y-axis [0] speed [5]; - wait-for-move elevator along y-axis; -} - -StartBuilding() -{ - signal SIG_BUILDING; // Kill any other StartBuilding - set-signal-mask SIG_BUILDING; // Be killable -} - -StopBuilding() -{ - signal SIG_BUILDING; // Kill StartBuilding -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint; -} - -TechLost() -{ - signal SIG_TECH; - set-signal-mask SIG_TECH; - Aztec=FALSE; - set INBUILDSTANCE to FALSE;// Cut the nano - start-script Activate();// Just so it can resume once TechGranted again - while(TRUE) - { - - explode nanopoint type FALL | SMOKE; - sleep 200; - } -} - -TechGranted() -{ - signal SIG_TECH;// Kill TechLost - Aztec=TRUE; -} - -buildingfx() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nano1; - emit-sfx nanoflame from nano2; - } - sleep 600; - } -} - -buildingfx2() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1025 from nanopoint; - } - sleep 300; - } -} - -Create() -{ - Aztec = TRUE; - spray = nanopoint; - while(get BUILD_PERCENT_LEFT) - { - sleep 400; - } - start-script SmokeUnit(); - start-script buildingfx(); - start-script buildingfx2(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray != 0 ) - { - piecenum = nano2; - } - spray = !spray; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode door1 type EXPLODE_ON_HIT; - explode door2 type EXPLODE_ON_HIT; - explode elevator type EXPLODE_ON_HIT; - explode spinner type EXPLODE_ON_HIT; - explode backbone type EXPLODE_ON_HIT; - explode bottombackbone type EXPLODE_ON_HIT; -} diff --git a/Scripts/eairplant.cob b/Scripts/eairplant.cob deleted file mode 100644 index 167c3183b..000000000 Binary files a/Scripts/eairplant.cob and /dev/null differ diff --git a/Scripts/eairplant2.bos b/Scripts/eairplant2.bos deleted file mode 100644 index f7ae82491..000000000 --- a/Scripts/eairplant2.bos +++ /dev/null @@ -1,245 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, base1, base2, base3, base4, spinner1, spinner2, spinner3, spinner4, nanopoint1, nano1, nano2, nano3, nano4, sfxpoint1, sfxpoint2; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building; - -// Signal definitions -#define SIG_ACTIVATE 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -buildingfx() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1024 from nano1; - sleep 60; - emit-sfx 1024 from nano4; - sleep 60; - emit-sfx 1024 from nano3; - sleep 60; - emit-sfx 1024 from nano2; - sleep 60; - } - sleep 600; - } -} - -buildingfx2() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1025 from nanopoint1; - } - sleep 300; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1027 from sfxpoint1; - emit-sfx 1027 from sfxpoint2; -// } - sleep 500; - } -} - -OpenYard() -{ - spin spinner1 around y-axis speed <50.005495>; - spin spinner2 around y-axis speed <50.005495>; - spin spinner3 around y-axis speed <50.005495>; - spin spinner4 around y-axis speed <50.005495>; - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - stop-spin spinner1 around z-axis decelerate <15.000000>; - stop-spin spinner2 around z-axis decelerate <15.000000>; - stop-spin spinner3 around z-axis decelerate <15.000000>; - stop-spin spinner4 around z-axis decelerate <15.000000>; - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); - -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = 0; - call-script InitState(); - start-script SmokeUnit(); - start-script Buildingfx(); -// start-script Buildingfx2(); - start-script fx(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray == 1 ) - { - piecenum = nano2; - } - if( spray == 2 ) - { - piecenum = nano3; - } - if( spray == 3 ) - { - piecenum = nano4; - } - ++spray; - if( spray >= 4 ) - { - spray = 0; - } -} - - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -building = 1; -} - -StopBuilding() -{ -building = 0; -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base1 type EXPLODE_ON_HIT; - explode base2 type EXPLODE_ON_HIT; - explode base3 type EXPLODE_ON_HIT; - explode base4 type EXPLODE_ON_HIT; - explode spinner1 type EXPLODE_ON_HIT; - explode spinner2 type EXPLODE_ON_HIT; - explode spinner3 type EXPLODE_ON_HIT; - explode spinner4 type EXPLODE_ON_HIT; -} diff --git a/Scripts/eairplant2.cob b/Scripts/eairplant2.cob deleted file mode 100644 index e85e3c19d..000000000 Binary files a/Scripts/eairplant2.cob and /dev/null differ diff --git a/Scripts/eairplant3.bos b/Scripts/eairplant3.bos index 6194e769a..c102aeec6 100644 --- a/Scripts/eairplant3.bos +++ b/Scripts/eairplant3.bos @@ -172,7 +172,7 @@ Create() start-script Buildingfx(); // start-script Buildingfx2(); start-script fx(); - start-script Thrust(); +// start-script Thrust(); turn engine1 to x-axis <90> now; turn engine2 to x-axis <90> now; turn engine3 to x-axis <90> now; diff --git a/Scripts/eairplant3.cob b/Scripts/eairplant3.cob index 74bf6b3de..465135ca4 100644 Binary files a/Scripts/eairplant3.cob and b/Scripts/eairplant3.cob differ diff --git a/Scripts/eallterraa.bos b/Scripts/eallterraa.bos deleted file mode 100644 index 631c41226..000000000 --- a/Scripts/eallterraa.bos +++ /dev/null @@ -1,330 +0,0 @@ - -// One ninth of the full cycle duration, in millisecond -// The larger this value the slower the walk animation -#define WALK_PERIOD 50 - - -piece base,turret,barrel1,firepoint1, - rf1,rf2,lf1,lf2,rr1,rr2,lr1,lr2,rfdirt,rrdirt,lfdirt,lrdirt; - #define barrel barrel1 - -#include "ROCKUNIT.H" - -static-var maxreloadtime,moving; - -#define SIG_AIM1 2 -#define SIG_FIRE1 4 -#define SIG_MOVE 8 -#include "exptype.h" -#include "sfxtype.h" -#define SMOKEPIECE1 base -#include "SmokeUnit.h" - - - -#define FRONT_RIGHT_DOWN\ - turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDA\ - turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDB\ - turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_BACK\ - turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_UP\ - turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_FRONT\ - turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); - - - -#define FRONT_LEFT_DOWN\ - turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_MIDA\ - turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_LEFT_MIDB\ - turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_LEFT_BACK\ - turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_LEFT_UP\ - turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_FRONT\ - turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_RIGHT_DOWN\ - turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_MIDA\ - turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); - -#define REAR_RIGHT_MIDB\ - turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); - -#define REAR_RIGHT_BACK\ - turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); - -#define REAR_RIGHT_UP\ - turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_FRONT\ - turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_LEFT_DOWN\ - turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_LEFT_MIDA\ - turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); - -#define REAR_LEFT_MIDB\ - turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); - -#define REAR_LEFT_BACK\ - turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); - -#define REAR_LEFT_UP\ - turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_LEFT_FRONT\ - turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define WAIT_WALK\ - sleep WALK_PERIOD;\ - while(!moving)\ - {\ - sleep 111;\ - } - - - -DoTheWalking() -{ - while(TRUE) - { - WAIT_WALK//1 - FRONT_RIGHT_DOWN - emit-sfx 1025 + 0 from rfdirt; - FRONT_LEFT_BACK - REAR_RIGHT_BACK - REAR_LEFT_MIDA - WAIT_WALK//2 - FRONT_RIGHT_MIDA - WAIT_WALK//3 - FRONT_LEFT_UP - REAR_RIGHT_UP - REAR_LEFT_MIDB - WAIT_WALK//4 - FRONT_RIGHT_MIDB - FRONT_LEFT_FRONT - REAR_RIGHT_FRONT - WAIT_WALK//5 - FRONT_LEFT_DOWN - emit-sfx 1025 + 0 from lfdirt; - REAR_RIGHT_DOWN - emit-sfx 1025 + 0 from rrdirt; - REAR_LEFT_BACK - WAIT_WALK//6 - FRONT_RIGHT_BACK - FRONT_LEFT_MIDA - REAR_RIGHT_MIDA - WAIT_WALK//7 - REAR_LEFT_UP - WAIT_WALK//8 - FRONT_RIGHT_UP - FRONT_LEFT_MIDB - REAR_RIGHT_MIDB - REAR_LEFT_FRONT - WAIT_WALK//9 - FRONT_RIGHT_FRONT - REAR_LEFT_DOWN - emit-sfx 1025 + 0 from lrdirt; - } -} - -StartMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=TRUE; -} - -StopMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=FALSE; - - sleep 4*(WALK_PERIOD); - - turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around z-axis; - wait-for-turn rf2 around z-axis; - turn rf1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around y-axis; - turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around z-axis; - wait-for-turn lf2 around z-axis; - turn lf1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around y-axis; - turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around z-axis; - wait-for-turn rr2 around z-axis; - turn rr1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around y-axis; - turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around z-axis; - wait-for-turn lr2 around z-axis; - turn lr1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around y-axis; - turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); -} - - -Create() -{ - turn rf1 to y-axis <30> now; - turn lf1 to y-axis <-30> now; - turn rr1 to y-axis <-30> now; - turn lr1 to y-axis <30> now; - maxreloadtime=500; - moving=FALSE; - while(get BUILD_PERCENT_LEFT) - { - sleep 250; - } - start-script SmokeUnit(); - start-script DoTheWalking(); -// start-script Thrust(); -} - -SetMaxReloadTime(t) -{ - maxreloadtime=t; -} - -RestoreAfterDelay() -{ - sleep maxreloadtime*3/2; - turn turret to y-axis 0 speed <60>; - turn barrel1 to x-axis 0 speed <30>; - wait-for-turn turret around y-axis; - wait-for-turn barrel1 around x-axis; -} - -AimFromPrimary(p) -{ - p=turret; -} - -AimPrimary(heading,pitch) -{ - signal SIG_AIM1; - set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <150>; - wait-for-turn turret around y-axis; - wait-for-turn barrel1 around x-axis; - start-script RestoreAfterDelay(); - return(1); -} - -QueryPrimary(firefrom) -{ - firefrom=firepoint1; -} - -FirePrimary() -{ - signal SIG_FIRE1; - set-signal-mask SIG_FIRE1; - emit-sfx 1024 from firepoint1; -// move barrel to z-axis [-10] now; -// move barrel to z-axis [0] speed [4]; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode rf1 type EXPLODE_ON_HIT; - explode rf2 type EXPLODE_ON_HIT; - explode lf1 type EXPLODE_ON_HIT; - explode lf2 type EXPLODE_ON_HIT; - explode rr1 type EXPLODE_ON_HIT; - explode rr2 type EXPLODE_ON_HIT; - explode lr1 type EXPLODE_ON_HIT; - explode lr2 type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eallterraa.cob b/Scripts/eallterraa.cob deleted file mode 100644 index b76450eb4..000000000 Binary files a/Scripts/eallterraa.cob and /dev/null differ diff --git a/Scripts/eallterranarchid.bos b/Scripts/eallterranarchid.bos new file mode 100644 index 000000000..c5046c778 --- /dev/null +++ b/Scripts/eallterranarchid.bos @@ -0,0 +1,422 @@ + +// One ninth of the full cycle duration, in millisecond +// The larger this value the slower the walk animation +#define WALK_PERIOD 50 + + +piece base,turret1,barrel1,firepoint1,turret2,barrel2,firepoint2,turret3,barrel3,firepoint3, + rf1,rf2,lf1,lf2,rr1,rr2,lr1,lr2,rfdirt,rrdirt,lfdirt,lrdirt; + #define barrel barrel1 + +static-var maxreloadtime,moving; + +#define SIG_AIM1 2 +#define SIG_FIRE1 2 +#define SIG_AIM2 4 +#define SIG_FIRE2 4 +#define SIG_AIM3 16 +#define SIG_FIRE3 16 +#define SIG_MOVE 8 + +#include "sfxtype.h" +#define SMOKEPIECE1 base +#include "SmokeUnit.h" + + + +#define FRONT_RIGHT_DOWN\ + turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDA\ + turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDB\ + turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_BACK\ + turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_UP\ + turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_FRONT\ + turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); + + + +#define FRONT_LEFT_DOWN\ + turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_MIDA\ + turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_LEFT_MIDB\ + turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_LEFT_BACK\ + turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_LEFT_UP\ + turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_FRONT\ + turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_RIGHT_DOWN\ + turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_MIDA\ + turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); + +#define REAR_RIGHT_MIDB\ + turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); + +#define REAR_RIGHT_BACK\ + turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); + +#define REAR_RIGHT_UP\ + turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_FRONT\ + turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_LEFT_DOWN\ + turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_LEFT_MIDA\ + turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); + +#define REAR_LEFT_MIDB\ + turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); + +#define REAR_LEFT_BACK\ + turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); + +#define REAR_LEFT_UP\ + turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_LEFT_FRONT\ + turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define WAIT_WALK\ + sleep WALK_PERIOD;\ + while(!moving)\ + {\ + sleep 111;\ + } + + + +DoTheWalking() +{ + while(TRUE) + { + WAIT_WALK//1 + FRONT_RIGHT_DOWN + emit-sfx 1025 + 0 from rfdirt; + FRONT_LEFT_BACK + REAR_RIGHT_BACK + REAR_LEFT_MIDA + WAIT_WALK//2 + FRONT_RIGHT_MIDA + WAIT_WALK//3 + FRONT_LEFT_UP + REAR_RIGHT_UP + REAR_LEFT_MIDB + WAIT_WALK//4 + FRONT_RIGHT_MIDB + FRONT_LEFT_FRONT + REAR_RIGHT_FRONT + WAIT_WALK//5 + FRONT_LEFT_DOWN + emit-sfx 1025 + 0 from lfdirt; + REAR_RIGHT_DOWN + emit-sfx 1025 + 0 from rrdirt; + REAR_LEFT_BACK + WAIT_WALK//6 + FRONT_RIGHT_BACK + FRONT_LEFT_MIDA + REAR_RIGHT_MIDA + WAIT_WALK//7 + REAR_LEFT_UP + WAIT_WALK//8 + FRONT_RIGHT_UP + FRONT_LEFT_MIDB + REAR_RIGHT_MIDB + REAR_LEFT_FRONT + WAIT_WALK//9 + FRONT_RIGHT_FRONT + REAR_LEFT_DOWN + emit-sfx 1025 + 0 from lrdirt; + } +} + +StartMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=TRUE; +} + +StopMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=FALSE; + + sleep 4*(WALK_PERIOD); + + turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around z-axis; + wait-for-turn rf2 around z-axis; + turn rf1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around y-axis; + turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around z-axis; + wait-for-turn lf2 around z-axis; + turn lf1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around y-axis; + turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around z-axis; + wait-for-turn rr2 around z-axis; + turn rr1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around y-axis; + turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around z-axis; + wait-for-turn lr2 around z-axis; + turn lr1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around y-axis; + turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); +} + + +Create() +{ + turn rf1 to y-axis <30> now; + turn lf1 to y-axis <-30> now; + turn rr1 to y-axis <-30> now; + turn lr1 to y-axis <30> now; + maxreloadtime=500; + moving=FALSE; + while(get BUILD_PERCENT_LEFT) + { + sleep 250; + } + start-script SmokeUnit(); + start-script DoTheWalking(); +// start-script Thrust(); +} + +SetMaxReloadTime(t) +{ + maxreloadtime=t; +} + +RestoreAfterDelay() +{ + sleep maxreloadtime*3/2; + turn turret1 to y-axis 0 speed <60>; + turn barrel1 to x-axis 0 speed <30>; + turn turret2 to y-axis 0 speed <60>; + turn barrel2 to x-axis 0 speed <30>; + turn turret3 to y-axis 0 speed <60>; + turn barrel3 to x-axis 0 speed <30>; + wait-for-turn turret1 around y-axis; + wait-for-turn barrel1 around x-axis; + wait-for-turn turret2 around y-axis; + wait-for-turn barrel2 around x-axis; + wait-for-turn turret3 around y-axis; + wait-for-turn barrel3 around x-axis; +} + +AimFromPrimary(p) +{ + p=turret1; +} + +AimPrimary(heading,pitch) +{ + signal SIG_AIM1; + set-signal-mask SIG_AIM1; + turn turret1 to y-axis heading now; + turn barrel1 to x-axis 0 - pitch now; + wait-for-turn turret1 around y-axis; + wait-for-turn barrel1 around x-axis; + start-script RestoreAfterDelay(); + return(1); +} + +QueryPrimary(firefrom) +{ + firefrom=firepoint1; +} + +FirePrimary() +{ + signal SIG_FIRE1; + set-signal-mask SIG_FIRE1; + emit-sfx 1024 + 0 from firepoint1; +// move barrel to z-axis [-10] now; +// move barrel to z-axis [0] speed [4]; +} + +AimFromSecondary(p) +{ + p=turret2; +} + +AimSecondary(heading,pitch) +{ + signal SIG_AIM2; + set-signal-mask SIG_AIM2; + turn turret2 to y-axis heading now; + turn barrel2 to x-axis 0 - pitch now; + wait-for-turn turret2 around y-axis; + wait-for-turn barrel2 around x-axis; +// start-script RestoreAfterDelay(); + return(1); +} + +QuerySecondary(firefrom) +{ + firefrom=firepoint2; +} + +FireSecondary() +{ + signal SIG_FIRE2; + set-signal-mask SIG_FIRE2; + sleep 1; + emit-sfx 1026 from firepoint2; + sleep 1; + emit-sfx 1026 from firepoint2; + sleep 1; + emit-sfx 1026 from firepoint2; + sleep 1; + emit-sfx 1026 from firepoint2; +// move barrel to z-axis [-10] now; +// move barrel to z-axis [0] speed [4]; +} + + +AimFromTertiary(p) +{ + p=turret3; +} + +AimTertiary(heading,pitch) +{ + signal SIG_AIM3; + set-signal-mask SIG_AIM3; + turn turret3 to y-axis heading now; + turn barrel3 to x-axis 0 - pitch now; + wait-for-turn turret3 around y-axis; + wait-for-turn barrel3 around x-axis; +// start-script RestoreAfterDelay(); + return(1); +} + +QueryTertiary(firefrom) +{ + firefrom=firepoint3; +} + +FireTertiary() +{ + signal SIG_FIRE3; + set-signal-mask SIG_FIRE3; + sleep 1; + emit-sfx 1026 from firepoint3; + sleep 1; + emit-sfx 1026 from firepoint3; + sleep 1; + emit-sfx 1026 from firepoint3; + sleep 1; + emit-sfx 1026 from firepoint3; +// move barrel to z-axis [-10] now; +// move barrel to z-axis [0] speed [4]; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode barrel1 type EXPLODE_ON_HIT; + explode turret1 type EXPLODE_ON_HIT; + explode barrel2 type EXPLODE_ON_HIT; + explode turret2 type EXPLODE_ON_HIT; + explode barrel3 type EXPLODE_ON_HIT; + explode turret3 type EXPLODE_ON_HIT; + explode rf1 type EXPLODE_ON_HIT; + explode rf2 type EXPLODE_ON_HIT; + explode lf1 type EXPLODE_ON_HIT; + explode lf2 type EXPLODE_ON_HIT; + explode rr1 type EXPLODE_ON_HIT; + explode rr2 type EXPLODE_ON_HIT; + explode lr1 type EXPLODE_ON_HIT; + explode lr2 type EXPLODE_ON_HIT; + +} \ No newline at end of file diff --git a/Scripts/eallterranarchid.cob b/Scripts/eallterranarchid.cob new file mode 100644 index 000000000..374ee0862 Binary files /dev/null and b/Scripts/eallterranarchid.cob differ diff --git a/Scripts/eallterrassault.bos b/Scripts/eallterrassault.bos index a5889e852..727ae74b2 100644 --- a/Scripts/eallterrassault.bos +++ b/Scripts/eallterrassault.bos @@ -293,8 +293,8 @@ AimPrimary(heading,pitch) { signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <225>; - turn barrel1 to x-axis 0 - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eallterrassault.cob b/Scripts/eallterrassault.cob index a5125ce2b..394bec39f 100644 Binary files a/Scripts/eallterrassault.cob and b/Scripts/eallterrassault.cob differ diff --git a/Scripts/eallterrengineer.bos b/Scripts/eallterrengineer.bos deleted file mode 100644 index 6ce8b4e29..000000000 --- a/Scripts/eallterrengineer.bos +++ /dev/null @@ -1,382 +0,0 @@ - -// One ninth of the full cycle duration, in millisecond -// The larger this value the slower the walk animation -#define WALK_PERIOD 50 - - -piece base, nanopoint1, penis, wheel, doorleft, doorright, dirt, rf1, rf2, lf1, lf2, rr1, rr2, lr1, lr2, rfdirt, rrdirt, lfdirt, lrdirt; - -static-var maxreloadtime, moving, bMoving, terraintype, building; - -#define SIG_AIM1 2 -#define SIG_FIRE1 4 -#define SIG_MOVE 8 -#define SMOKEPIECE1 base -#include "springdefs.h" -#define SIG_BUILD 16 -#define nanoflame 1024+0 - - -#define FRONT_RIGHT_DOWN\ - turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDA\ - turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDB\ - turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_BACK\ - turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_UP\ - turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_FRONT\ - turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); - - - -#define FRONT_LEFT_DOWN\ - turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_MIDA\ - turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_LEFT_MIDB\ - turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_LEFT_BACK\ - turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_LEFT_UP\ - turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_FRONT\ - turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_RIGHT_DOWN\ - turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_MIDA\ - turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); - -#define REAR_RIGHT_MIDB\ - turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); - -#define REAR_RIGHT_BACK\ - turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); - -#define REAR_RIGHT_UP\ - turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_FRONT\ - turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_LEFT_DOWN\ - turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_LEFT_MIDA\ - turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); - -#define REAR_LEFT_MIDB\ - turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); - -#define REAR_LEFT_BACK\ - turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); - -#define REAR_LEFT_UP\ - turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_LEFT_FRONT\ - turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define WAIT_WALK\ - sleep WALK_PERIOD;\ - while(!moving)\ - {\ - sleep 111;\ - } - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -DoTheWalking() -{ - while(TRUE) - { - WAIT_WALK//1 - FRONT_RIGHT_DOWN - emit-sfx 1025 + 0 from rfdirt; - FRONT_LEFT_BACK - REAR_RIGHT_BACK - REAR_LEFT_MIDA - WAIT_WALK//2 - FRONT_RIGHT_MIDA - WAIT_WALK//3 - FRONT_LEFT_UP - REAR_RIGHT_UP - REAR_LEFT_MIDB - WAIT_WALK//4 - FRONT_RIGHT_MIDB - FRONT_LEFT_FRONT - REAR_RIGHT_FRONT - WAIT_WALK//5 - FRONT_LEFT_DOWN - emit-sfx 1025 + 0 from lfdirt; - REAR_RIGHT_DOWN - emit-sfx 1025 + 0 from rrdirt; - REAR_LEFT_BACK - WAIT_WALK//6 - FRONT_RIGHT_BACK - FRONT_LEFT_MIDA - REAR_RIGHT_MIDA - WAIT_WALK//7 - REAR_LEFT_UP - WAIT_WALK//8 - FRONT_RIGHT_UP - FRONT_LEFT_MIDB - REAR_RIGHT_MIDB - REAR_LEFT_FRONT - WAIT_WALK//9 - FRONT_RIGHT_FRONT - REAR_LEFT_DOWN - emit-sfx 1025 + 0 from lrdirt; - } -} - -StartMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=TRUE; - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=FALSE; - - sleep 4*(WALK_PERIOD); - - turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around z-axis; - wait-for-turn rf2 around z-axis; - turn rf1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around y-axis; - turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around z-axis; - wait-for-turn lf2 around z-axis; - turn lf1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around y-axis; - turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around z-axis; - wait-for-turn rr2 around z-axis; - turn rr1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around y-axis; - turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around z-axis; - wait-for-turn lr2 around z-axis; - turn lr1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around y-axis; - turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - -Create() -{ - turn rf1 to y-axis <30> now; - turn lf1 to y-axis <-30> now; - turn rr1 to y-axis <-30> now; - turn lr1 to y-axis <30> now; - maxreloadtime=500; - moving=FALSE; - while(get BUILD_PERCENT_LEFT) - { - sleep 250; - } - start-script SmokeUnit(); - start-script DoTheWalking(); -// start-script Thrust(); - start-script buildflame(); -} - -QueryWeapon1(piecenum) -{ - piecenum=nanopoint1; -} - -AimFromWeapon1(piecenum) -{ - piecenum=penis; -} - -AimWeapon1(h,p) -{ - return 0; -} - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - turn doorleft to y-axis <90> speed <100.000000>; - turn doorright to y-axis <-90> speed <100.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; - move penis to z-axis [4] speed [1]; - set INBUILDSTANCE to 1; - building = 1; - while (1) { -// emit-sfx 2048 from nanopoint1; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - move penis to z-axis [0] speed [2]; - turn doorleft to y-axis <0> speed <50.000000>; - turn doorright to y-axis <0> speed <50.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; - -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode rf1 type EXPLODE_ON_HIT; - explode rf2 type EXPLODE_ON_HIT; - explode lf1 type EXPLODE_ON_HIT; - explode lf2 type EXPLODE_ON_HIT; - explode rr1 type EXPLODE_ON_HIT; - explode rr2 type EXPLODE_ON_HIT; - explode lr1 type EXPLODE_ON_HIT; - explode lr2 type EXPLODE_ON_HIT; - explode penis type EXPLODE_ON_HIT; - explode wheel type EXPLODE_ON_HIT; - explode doorleft type EXPLODE_ON_HIT; - explode doorright type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eallterrengineer.cob b/Scripts/eallterrengineer.cob deleted file mode 100644 index 3af8c133e..000000000 Binary files a/Scripts/eallterrengineer.cob and /dev/null differ diff --git a/Scripts/eallterrfac.bos b/Scripts/eallterrfac.bos deleted file mode 100644 index ecb0fdcd7..000000000 --- a/Scripts/eallterrfac.bos +++ /dev/null @@ -1,241 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, rightgenerator, leftgenerator, nanospin1, nanospin2, nanospin3, nanospin4, nanopoint1, nano1, nano2, nano3, nano4, sfxpoint1, sfxpoint2, frontleftsupport, frontrightsupport, rearleftsupport, rearrightsupport, pipesleft, pipesright; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building, terraintype; - -// Signal definitions -#define SIG_ACTIVATE 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -buildingfx() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1024 from nano1; - sleep 60; - emit-sfx 1024 from nano4; - sleep 60; - emit-sfx 1024 from nano3; - sleep 60; - emit-sfx 1024 from nano2; - sleep 60; - } - sleep 600; - } -} - -buildingfx2() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1025 from nanopoint1; - } - sleep 300; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1027 from sfxpoint1; - emit-sfx 1027 from sfxpoint2; -// } - sleep 500; - } -} - -OpenYard() -{ - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); - -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = 0; - call-script InitState(); - start-script SmokeUnit(); - start-script Buildingfx(); -// start-script Buildingfx2(); - start-script fx(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray == 1 ) - { - piecenum = nano2; - } - if( spray == 2 ) - { - piecenum = nano3; - } - if( spray == 3 ) - { - piecenum = nano4; - } - ++spray; - if( spray >= 4 ) - { - spray = 0; - } -} - - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -building = 1; -} - -StopBuilding() -{ -building = 0; -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode nanospin1 type EXPLODE_ON_HIT; - explode nanospin2 type EXPLODE_ON_HIT; - explode nanospin3 type EXPLODE_ON_HIT; - explode nanospin4 type EXPLODE_ON_HIT; - explode frontleftsupport type EXPLODE_ON_HIT; - explode frontrightsupport type EXPLODE_ON_HIT; - explode rearleftsupport type EXPLODE_ON_HIT; - explode rearrightsupport type EXPLODE_ON_HIT; - explode rightgenerator type EXPLODE_ON_HIT; - explode leftgenerator type EXPLODE_ON_HIT; - -} diff --git a/Scripts/eallterrfac.cob b/Scripts/eallterrfac.cob deleted file mode 100644 index e7198bb38..000000000 Binary files a/Scripts/eallterrfac.cob and /dev/null differ diff --git a/Scripts/eallterrheavy.bos b/Scripts/eallterrheavy.bos index a83311f29..6c5c14a35 100644 --- a/Scripts/eallterrheavy.bos +++ b/Scripts/eallterrheavy.bos @@ -292,8 +292,8 @@ AimPrimary(heading,pitch) { signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -323,8 +323,8 @@ AimSecondary(heading,pitch) { signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; // start-script RestoreAfterDelay(); diff --git a/Scripts/eallterrheavy.cob b/Scripts/eallterrheavy.cob index 7c5eaf569..398b5864b 100644 Binary files a/Scripts/eallterrheavy.cob and b/Scripts/eallterrheavy.cob differ diff --git a/Scripts/eallterrlight.bos b/Scripts/eallterrlight.bos index b35ff4f40..a636f9bcb 100644 --- a/Scripts/eallterrlight.bos +++ b/Scripts/eallterrlight.bos @@ -289,8 +289,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d { signal SIG_AIM1; set-signal-mask SIG_AIM1; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <150>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eallterrlight.cob b/Scripts/eallterrlight.cob index 1406fa85b..2533fa95a 100644 Binary files a/Scripts/eallterrlight.cob and b/Scripts/eallterrlight.cob differ diff --git a/Scripts/eallterrmed.bos b/Scripts/eallterrmed.bos index a5889e852..727ae74b2 100644 --- a/Scripts/eallterrmed.bos +++ b/Scripts/eallterrmed.bos @@ -293,8 +293,8 @@ AimPrimary(heading,pitch) { signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <225>; - turn barrel1 to x-axis 0 - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eallterrmed.cob b/Scripts/eallterrmed.cob index a5125ce2b..394bec39f 100644 Binary files a/Scripts/eallterrmed.cob and b/Scripts/eallterrmed.cob differ diff --git a/Scripts/eallterrriot.bos b/Scripts/eallterrriot.bos index 7f1187c28..e76ec8338 100644 --- a/Scripts/eallterrriot.bos +++ b/Scripts/eallterrriot.bos @@ -299,8 +299,8 @@ AimPrimary(heading,pitch) if(!WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <255>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -339,8 +339,8 @@ AimSecondary(heading,pitch) if(WeaponTypeSelect OR (get WEAPON_RELOADSTATE(1) > get GAME_FRAME)) return (0); signal SIG_AIM1; set-signal-mask SIG_AIM1; - turn turret to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis 0 - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; // start-script RestoreAfterDelay(); diff --git a/Scripts/eallterrriot.cob b/Scripts/eallterrriot.cob index 22e8a325b..b16822a94 100644 Binary files a/Scripts/eallterrriot.cob and b/Scripts/eallterrriot.cob differ diff --git a/Scripts/eamphibaa.bos b/Scripts/eamphibaa.bos index f16cc9d53..09e71c8f3 100644 --- a/Scripts/eamphibaa.bos +++ b/Scripts/eamphibaa.bos @@ -99,8 +99,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d */ signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <1000>; -turn barrel1 to x-axis <0> - pitch speed <1000>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eamphibaa.cob b/Scripts/eamphibaa.cob index aba22a6ab..c5e515d25 100644 Binary files a/Scripts/eamphibaa.cob and b/Scripts/eamphibaa.cob differ diff --git a/Scripts/eamphibarty.bos b/Scripts/eamphibarty.bos deleted file mode 100644 index 14d96f2bd..000000000 --- a/Scripts/eamphibarty.bos +++ /dev/null @@ -1,165 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt, frontwheels, rearwheels; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var terraintype, bmoving, moving, underwater; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -/* - if ( get IN_WATER(0) == 1 ) - { - return (0); - } -*/ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ - - if ( get IN_WATER(0) == 0 ) - { - return (0); - } - -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode frontwheels type EXPLODE_ON_HIT; - explode rearwheels type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibarty.cob b/Scripts/eamphibarty.cob deleted file mode 100644 index cf0a8247f..000000000 Binary files a/Scripts/eamphibarty.cob and /dev/null differ diff --git a/Scripts/eamphibarty2.bos b/Scripts/eamphibarty2.bos index 8210fb88b..64dc3ec99 100644 --- a/Scripts/eamphibarty2.bos +++ b/Scripts/eamphibarty2.bos @@ -106,8 +106,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d */ signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -139,8 +139,8 @@ AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to d signal SIG_AIM_2; set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eamphibarty2.cob b/Scripts/eamphibarty2.cob index b7f3ffc22..e691c37e4 100644 Binary files a/Scripts/eamphibarty2.cob and b/Scripts/eamphibarty2.cob differ diff --git a/Scripts/eamphibbuggy.bos b/Scripts/eamphibbuggy.bos index 22b2cbc05..823bb2412 100644 --- a/Scripts/eamphibbuggy.bos +++ b/Scripts/eamphibbuggy.bos @@ -98,8 +98,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d */ signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <1000>; -turn barrel1 to x-axis <0> - pitch speed <1000>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -131,8 +131,8 @@ AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to d signal SIG_AIM_2; set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eamphibbuggy.cob b/Scripts/eamphibbuggy.cob index fa9eff47d..0fa6d5d3a 100644 Binary files a/Scripts/eamphibbuggy.cob and b/Scripts/eamphibbuggy.cob differ diff --git a/Scripts/eamphibbuggy_lus.lua b/Scripts/eamphibbuggy_lus.lua new file mode 100644 index 000000000..c4059b984 --- /dev/null +++ b/Scripts/eamphibbuggy_lus.lua @@ -0,0 +1,71 @@ +base, turret, barrel1, firepoint1, dirt, frontwheels, rearwheels = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'frontwheels', 'rearwheels') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) + Spin( frontwheels, 1, 50) + Spin( rearwheels, 1, 50) +end + +function script.StopMoving() + isMoving = false + StopSpin( frontwheels, 1, 50) + StopSpin( rearwheels, 1, 50) +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon(weaponID) + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon(weaponID) + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(frontwheels, SFX.EXPLODE_ON_HIT) + Explode(rearwheels, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eamphibdrone.bos b/Scripts/eamphibdrone.bos deleted file mode 100644 index 4d3dc371d..000000000 --- a/Scripts/eamphibdrone.bos +++ /dev/null @@ -1,146 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt, frontwheels, rearwheels; // these are the pieces of the model - -static-var terraintype, bmoving, moving, underwater; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eamphibdrone.cob b/Scripts/eamphibdrone.cob deleted file mode 100644 index 3fbf40706..000000000 Binary files a/Scripts/eamphibdrone.cob and /dev/null differ diff --git a/Scripts/eamphibengineer.bos b/Scripts/eamphibengineer.bos deleted file mode 100644 index 3db9b5391..000000000 --- a/Scripts/eamphibengineer.bos +++ /dev/null @@ -1,207 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, arm, spinwheels, frontwheels, rearwheels, nano1, dirt; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building, moving, underwater; - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - turn arm to x-axis <-90> speed <50>; - wait-for-turn base around y-axis; - wait-for-turn arm around x-axis; - spin spinwheels around x-axis speed <50.005495>; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn arm to x-axis <0> speed <50>; - stop-spin spinwheels around z-axis decelerate <2.000000>; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - underwater=1; - } - else - { - underwater=0; - } - if(terraintype == 4) - { - underwater=0; - } - else - { - underwater=1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nano1; - - } - sleep 600; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script Thrust(); - start-script SmokeUnit(); - turn nano1 to x-axis <90.000000> now; - start-script buildflame(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - piecenum = nano1; -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode arm type EXPLODE_ON_HIT; - explode spinwheels type EXPLODE_ON_HIT; - explode frontwheels type EXPLODE_ON_HIT; - explode rearwheels type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibengineer.cob b/Scripts/eamphibengineer.cob deleted file mode 100644 index 0b8fbc383..000000000 Binary files a/Scripts/eamphibengineer.cob and /dev/null differ diff --git a/Scripts/eamphibengineer2.bos b/Scripts/eamphibengineer2.bos deleted file mode 100644 index 4960c62ee..000000000 --- a/Scripts/eamphibengineer2.bos +++ /dev/null @@ -1,202 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, frontwheels, rearwheels, nanopoint1, dirt, penis; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building, moving, underwater; - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin penis around y-axis speed <50.005495>; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - stop-spin penis around y-axis decelerate <15.000000>; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - underwater=1; - } - else - { - underwater=0; - } - if(terraintype == 4) - { - underwater=0; - } - else - { - underwater=1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script Thrust(); - start-script SmokeUnit(); - start-script buildflame(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - piecenum = nanopoint1; -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode penis type EXPLODE_ON_HIT; - explode base type EXPLODE_ON_HIT; - explode frontwheels type EXPLODE_ON_HIT; - explode rearwheels type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibengineer2.cob b/Scripts/eamphibengineer2.cob deleted file mode 100644 index 2a850221b..000000000 Binary files a/Scripts/eamphibengineer2.cob and /dev/null differ diff --git a/Scripts/eamphibfac.bos b/Scripts/eamphibfac.bos deleted file mode 100644 index ce5afb951..000000000 --- a/Scripts/eamphibfac.bos +++ /dev/null @@ -1,204 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, door, spike, wheels, nanopoint, nano1; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building; - -// Signal definitions -#define SIG_ACTIVATE 2 - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -buildingfx() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nano1; - } - sleep 600; - } -} - -buildingfx2() -{ - while( TRUE ) - { - if (building) - { - emit-sfx 1025 from nanopoint; - } - sleep 300; - } -} - -OpenYard() -{ - spin wheels around z-axis speed <50.005495>; - move spike to y-axis [20] speed [5]; - turn door to x-axis <-90> speed <50>; - wait-for-move spike along y-axis; - wait-for-turn door around x-axis; - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - stop-spin wheels around z-axis decelerate <2.000000>; - move spike to y-axis [0] speed [5]; - turn door to x-axis <0> speed <50>; - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); - -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = nanopoint; - call-script InitState(); - start-script SmokeUnit(); - start-script Buildingfx(); - start-script Buildingfx2(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray != 0 ) - { - piecenum = nano1; - } - spray = !spray; -} - - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -building = 1; -} - -StopBuilding() -{ -building = 0; -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode door type EXPLODE_ON_HIT; - explode spike type EXPLODE_ON_HIT; - explode wheels type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibfac.cob b/Scripts/eamphibfac.cob deleted file mode 100644 index aec580506..000000000 Binary files a/Scripts/eamphibfac.cob and /dev/null differ diff --git a/Scripts/eextankdestroyer.bos b/Scripts/eamphibleveler.bos similarity index 100% rename from Scripts/eextankdestroyer.bos rename to Scripts/eamphibleveler.bos diff --git a/Scripts/eextankdestroyer.cob b/Scripts/eamphibleveler.cob similarity index 100% rename from Scripts/eextankdestroyer.cob rename to Scripts/eamphibleveler.cob diff --git a/Scripts/eamphibmedtank2.bos b/Scripts/eamphibmedtank2.bos index a57ea636f..07df50d29 100644 --- a/Scripts/eamphibmedtank2.bos +++ b/Scripts/eamphibmedtank2.bos @@ -102,8 +102,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d */ signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <1000>; -turn barrel1 to x-axis <0> - pitch speed <1000>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -137,8 +137,8 @@ AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to d signal SIG_AIM_2; set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eamphibmedtank2.cob b/Scripts/eamphibmedtank2.cob index 765af1c4e..c92f1edc9 100644 Binary files a/Scripts/eamphibmedtank2.cob and b/Scripts/eamphibmedtank2.cob differ diff --git a/Scripts/eamphibmedtank_lus.lua b/Scripts/eamphibmedtank_lus.lua new file mode 100644 index 000000000..9127f2c1c --- /dev/null +++ b/Scripts/eamphibmedtank_lus.lua @@ -0,0 +1,74 @@ +base, turret, barrel1, firepoint1, dirt, frontwheels, rearwheels, middlewheels = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'frontwheels', 'rearwheels', 'middlewheels') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) + Spin( frontwheels, 1, 50) + Spin( middlewheels, 1, 50) + Spin( rearwheels, 1, 50) +end + +function script.StopMoving() + isMoving = false + StopSpin( frontwheels, 1, 50) + StopSpin( middlewheels, 1, 50) + StopSpin( rearwheels, 1, 50) +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon(weaponID) + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon(weaponID) + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(frontwheels, SFX.EXPLODE_ON_HIT) + Explode(middlewheels, SFX.EXPLODE_ON_HIT) + Explode(rearwheels, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eamphibriot.bos b/Scripts/eamphibriot.bos index 2377f15c7..ec058053e 100644 --- a/Scripts/eamphibriot.bos +++ b/Scripts/eamphibriot.bos @@ -101,8 +101,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d if(!WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -138,8 +138,8 @@ AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to d if(WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eamphibriot.cob b/Scripts/eamphibriot.cob index cf57934ac..92274173a 100644 Binary files a/Scripts/eamphibriot.cob and b/Scripts/eamphibriot.cob differ diff --git a/Scripts/eamphibrock.bos b/Scripts/eamphibrock.bos deleted file mode 100644 index df98b7d9f..000000000 --- a/Scripts/eamphibrock.bos +++ /dev/null @@ -1,168 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, sleeve, barrel1, firepoint1, dirt, frontwheels, middlewheels, rearwheels; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var terraintype, bmoving, moving, underwater; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1025 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin middlewheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin middlewheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn sleeve to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -/* - if ( get IN_WATER(0) == 1 ) - { - return (0); - } -*/ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn sleeve to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn sleeve around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -// emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = sleeve; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ - - if ( get IN_WATER(0) == 0 ) - { - return (0); - } - -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <500>; -turn sleeve to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn sleeve around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -// emit-sfx shot from firepoint1; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = sleeve; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode frontwheels type EXPLODE_ON_HIT; - explode rearwheels type EXPLODE_ON_HIT; - explode middlewheels type EXPLODE_ON_HIT; - explode sleeve type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibrock.cob b/Scripts/eamphibrock.cob deleted file mode 100644 index 02d20ca21..000000000 Binary files a/Scripts/eamphibrock.cob and /dev/null differ diff --git a/Scripts/eamphibrock2.bos b/Scripts/eamphibrock2.bos deleted file mode 100644 index df1f0b217..000000000 --- a/Scripts/eamphibrock2.bos +++ /dev/null @@ -1,167 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt, frontwheels, middlewheels, rearwheels; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var terraintype, bmoving, moving, underwater; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1025 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -StartMoving() -{ - bMoving = TRUE; - moving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - moving = FALSE; -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - spin frontwheels around x-axis speed <500.005495>; - spin middlewheels around x-axis speed <500.005495>; - spin rearwheels around x-axis speed <500.005495>; - - } - else - { - stop-spin frontwheels around x-axis decelerate <200.000000>; - stop-spin middlewheels around x-axis decelerate <200.000000>; - stop-spin rearwheels around x-axis decelerate <200.000000>; - } - sleep 400; - } -} -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -/* - if ( get IN_WATER(0) == 1 ) - { - return (0); - } -*/ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -// emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ - - if ( get IN_WATER(0) == 0 ) - { - return (0); - } - -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -// emit-sfx shot from firepoint1; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode frontwheels type EXPLODE_ON_HIT; - explode rearwheels type EXPLODE_ON_HIT; - explode middlewheels type EXPLODE_ON_HIT; -} diff --git a/Scripts/eamphibrock2.cob b/Scripts/eamphibrock2.cob deleted file mode 100644 index 67bf77532..000000000 Binary files a/Scripts/eamphibrock2.cob and /dev/null differ diff --git a/Scripts/eamphibrock4.bos b/Scripts/eamphibrock4.bos index 7284c7a0d..5b0f1f946 100644 --- a/Scripts/eamphibrock4.bos +++ b/Scripts/eamphibrock4.bos @@ -112,16 +112,16 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d if(!WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret1 to y-axis heading speed <500>; -turn turret2 to y-axis heading speed <500>; -turn turret3 to y-axis heading speed <500>; -turn turret4 to y-axis heading speed <500>; -turn turret5 to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -turn barrel2 to x-axis <0> - pitch speed <300>; -turn barrel3 to x-axis <0> - pitch speed <300>; -turn barrel4 to x-axis <0> - pitch speed <300>; -turn barrel5 to x-axis <0> - pitch speed <300>; +turn turret1 to y-axis heading speed <5000>; +turn turret2 to y-axis heading speed <5000>; +turn turret3 to y-axis heading speed <5000>; +turn turret4 to y-axis heading speed <5000>; +turn turret5 to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; +turn barrel2 to x-axis <0> - pitch speed <5000>; +turn barrel3 to x-axis <0> - pitch speed <5000>; +turn barrel4 to x-axis <0> - pitch speed <5000>; +turn barrel5 to x-axis <0> - pitch speed <5000>; wait-for-turn turret1 around y-axis; wait-for-turn turret2 around y-axis; wait-for-turn turret3 around y-axis; @@ -216,16 +216,16 @@ AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to d if(WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret1 to y-axis heading speed <500>; -turn turret2 to y-axis heading speed <500>; -turn turret3 to y-axis heading speed <500>; -turn turret4 to y-axis heading speed <500>; -turn turret5 to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <300>; -turn barrel2 to x-axis <0> - pitch speed <300>; -turn barrel3 to x-axis <0> - pitch speed <300>; -turn barrel4 to x-axis <0> - pitch speed <300>; -turn barrel5 to x-axis <0> - pitch speed <300>; +turn turret1 to y-axis heading speed <5000>; +turn turret2 to y-axis heading speed <5000>; +turn turret3 to y-axis heading speed <5000>; +turn turret4 to y-axis heading speed <5000>; +turn turret5 to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; +turn barrel2 to x-axis <0> - pitch speed <5000>; +turn barrel3 to x-axis <0> - pitch speed <5000>; +turn barrel4 to x-axis <0> - pitch speed <5000>; +turn barrel5 to x-axis <0> - pitch speed <5000>; wait-for-turn turret1 around y-axis; wait-for-turn turret2 around y-axis; wait-for-turn turret3 around y-axis; diff --git a/Scripts/eamphibrock4.cob b/Scripts/eamphibrock4.cob index 58107aa17..2c9a59369 100644 Binary files a/Scripts/eamphibrock4.cob and b/Scripts/eamphibrock4.cob differ diff --git a/Scripts/eannihilator.cob b/Scripts/eannihilator.cob deleted file mode 100644 index d17d62cd4..000000000 Binary files a/Scripts/eannihilator.cob and /dev/null differ diff --git a/Scripts/eantiairtower.bos b/Scripts/eantiairtower.bos deleted file mode 100644 index 7aeebf479..000000000 --- a/Scripts/eantiairtower.bos +++ /dev/null @@ -1,128 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint; // these are the pieces of the model - -static-var gun_1; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -sleep 75; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eantiairtower.cob b/Scripts/eantiairtower.cob deleted file mode 100644 index 4355a3867..000000000 Binary files a/Scripts/eantiairtower.cob and /dev/null differ diff --git a/Scripts/eantiairtower2.bos b/Scripts/eantiairtower2.bos deleted file mode 100644 index 058a85cdb..000000000 --- a/Scripts/eantiairtower2.bos +++ /dev/null @@ -1,217 +0,0 @@ -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - -static-var firing; // these are the variables - -#define ELECTRICITY 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 -#define SIG_AIM_8 16 -#define SIG_AIM_16 32 -#define SIG_AIM_32 64 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -LightningThing() -{ -while (1) -{ -emit-sfx ELECTRICITY from firepoint1; -sleep 500; -} -} - -Create() // tells it what to do on creation -{ -start-script LightningThing(); -start-script SmokeUnit(); -} - - -AimWeapon1(heading, pitch) -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() -{ -} - -AimFromWeapon2(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon2(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon3(heading, pitch) -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon3() -{ -} - -AimFromWeapon3(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon3(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon4(heading, pitch) -{ -signal SIG_AIM_8; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon4() -{ -} - -AimFromWeapon4(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon4(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon5(heading, pitch) -{ -signal SIG_AIM_16; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon5() -{ -} - -AimFromWeapon5(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon5(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon6(heading, pitch) -{ -signal SIG_AIM_32; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon6() -{ -} - -AimFromWeapon6(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon6(piecenum) -{ -piecenum = firepoint1; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} \ No newline at end of file diff --git a/Scripts/eantiairtower2.cob b/Scripts/eantiairtower2.cob deleted file mode 100644 index b5413f42d..000000000 Binary files a/Scripts/eantiairtower2.cob and /dev/null differ diff --git a/Scripts/eartillarytank.cob b/Scripts/eartillarytank.cob deleted file mode 100644 index e0f2c5bd3..000000000 Binary files a/Scripts/eartillarytank.cob and /dev/null differ diff --git a/Scripts/eartytank.bos b/Scripts/eartytank.bos deleted file mode 100644 index babbd1d62..000000000 --- a/Scripts/eartytank.bos +++ /dev/null @@ -1,157 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, sleeve, barrel1, firepoint1, dirt; - -#include "ROCKUNIT.H" - -static-var Static_Var_1, Static_Var_2, Static_Var_3, bMoving, moving; - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( Static_Var_3 ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - - -setSFXoccupy(Func_Var_1) -{ - Static_Var_2 = Func_Var_1; - if( Static_Var_2 == 2 ) - { - move base to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } - else - { - move base to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - if( Static_Var_2 == 4 ) - { - move base to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - else - { - move base to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } -} - -Create() -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn turret to y-axis <0.000000> speed <60.000000>; - turn sleeve to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn sleeve to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn sleeve around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() -{ - - emit-sfx 1024 + 0 from firepoint1; - move barrel1 to z-axis [-5.000000] speed [500.000000]; - sleep 75; - move barrel1 to z-axis [0.000000] speed [1.000000]; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/eartytank.cob b/Scripts/eartytank.cob deleted file mode 100644 index 42d8fdbef..000000000 Binary files a/Scripts/eartytank.cob and /dev/null differ diff --git a/Scripts/eartytank2.bos b/Scripts/eartytank2.bos index dbf287ef9..5f6069dde 100644 --- a/Scripts/eartytank2.bos +++ b/Scripts/eartytank2.bos @@ -8,7 +8,7 @@ piece base, turret, barrel1, firepoint1, dirt; // these are the pieces of the mo #include "ROCKUNIT.H" -static-var gun_1, terraintype, bmoving, moving; // these are the variables +static-var gun_1, terraintype, bmoving, moving, WeaponTypeSelect; // these are the variables // Signal definitions #define SIG_AIM 2 // this is a aim define @@ -101,12 +101,18 @@ StopMoving() moving=0; } +WeaponType(select) +{ + WeaponTypeSelect = select; +} + Create() // tells it what to do on creation { start-script Thrust(); start-script setSFXoccupy(); start-script EmitWakes(); -start-script SmokeUnit(); + start-script SmokeUnit(); + WeaponTypeSelect = 1; } RestoreAfterDelay() // restore function to turn the turret and so forth back to start @@ -117,11 +123,12 @@ turn barrel1 to x-axis <0> speed <30>; } AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ +{ +if(!WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -133,6 +140,14 @@ FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets emit-sfx 1024 + 0 from firepoint1; } +BlockShot1(unit, block) +{ + if (!WeaponTypeSelect) + { + block = 1; + } +} + AimFromWeapon1(piecenum) // where it aims the weapon from { piecenum = turret; @@ -144,6 +159,42 @@ piecenum = firepoint1; } +AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +if(WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); +signal SIG_AIM; +set-signal-mask SIG_AIM; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; +wait-for-turn turret around y-axis; +wait-for-turn barrel1 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +BlockShot2(unit, block) +{ + if (WeaponTypeSelect) + { + block = 1; + } +} + +AimFromWeapon2(piecenum) // where it aims the weapon from +{ +piecenum = turret; +} + +QueryWeapon2(piecenum) // where the shot is called from +{ + piecenum=firepoint1; +} + + Killed(severity, corpsetype) // how it explodes { corpsetype = 1; diff --git a/Scripts/eartytank2.cob b/Scripts/eartytank2.cob index 4f81abae1..35af0c33d 100644 Binary files a/Scripts/eartytank2.cob and b/Scripts/eartytank2.cob differ diff --git a/Scripts/eartyturret.cob b/Scripts/eartyturret.cob new file mode 100644 index 000000000..024b6fc66 Binary files /dev/null and b/Scripts/eartyturret.cob differ diff --git a/Scripts/ebarricade.bos b/Scripts/ebarricade.bos deleted file mode 100644 index fa56f47db..000000000 --- a/Scripts/ebarricade.bos +++ /dev/null @@ -1,18 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, rotator; // these are the pieces of the model - - -Create() // tells it what to do on creation -{ - spin rotator around y-axis speed <20.005495>; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode rotator type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/ebarricade.cob b/Scripts/ebarricade.cob deleted file mode 100644 index ffc12ebab..000000000 Binary files a/Scripts/ebarricade.cob and /dev/null differ diff --git a/Scripts/ebarricade2.bos b/Scripts/ebarricade2.bos deleted file mode 100644 index e4ea4cbe4..000000000 --- a/Scripts/ebarricade2.bos +++ /dev/null @@ -1,74 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, ball, bottomring, topring, middlering; // these are the pieces of the model - -#define SIG_AIM 2 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1024 from ball; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ - spin ball around y-axis speed <20.005495>; - spin ball around z-axis speed <30.005495>; - spin middlering around y-axis speed <-20.005495>; - spin topring around y-axis speed <40.005495>; - spin bottomring around y-axis speed <30.005495>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = ball; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = ball; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode ball type EXPLODE_ON_HIT; - explode topring type EXPLODE_ON_HIT; - explode middlering type EXPLODE_ON_HIT; - explode bottomring type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/ebarricade2.cob b/Scripts/ebarricade2.cob deleted file mode 100644 index c8e056753..000000000 Binary files a/Scripts/ebarricade2.cob and /dev/null differ diff --git a/Scripts/ebomb.bos b/Scripts/ebomb.bos deleted file mode 100644 index 78b29bc08..000000000 --- a/Scripts/ebomb.bos +++ /dev/null @@ -1,35 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, nose; - -Create() -{ -spin base around z-axis speed <300.005495>; -spin nose around z-axis speed <600.005495>; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode nose type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} diff --git a/Scripts/ebomb.cob b/Scripts/ebomb.cob deleted file mode 100644 index 4706465d3..000000000 Binary files a/Scripts/ebomb.cob and /dev/null differ diff --git a/Scripts/ebomb2.bos b/Scripts/ebomb2.bos deleted file mode 100644 index 00c445066..000000000 --- a/Scripts/ebomb2.bos +++ /dev/null @@ -1,114 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, forwarddome, reardome, rearleftwing, frontleftwing, frontrightwing, rearrightwing, dirt; - -static-var terraintype, bmoving, moving, shooting_num; - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from forwarddome; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode forwarddome type EXPLODE_ON_HIT; - explode reardome type EXPLODE_ON_HIT; - explode rearleftwing type EXPLODE_ON_HIT; - explode rearrightwing type EXPLODE_ON_HIT; - explode frontleftwing type EXPLODE_ON_HIT; - explode frontrightwing type EXPLODE_ON_HIT; -} diff --git a/Scripts/ebomb2.cob b/Scripts/ebomb2.cob deleted file mode 100644 index 5a21df285..000000000 Binary files a/Scripts/ebomb2.cob and /dev/null differ diff --git a/Scripts/ebomber.bos b/Scripts/ebomber.bos deleted file mode 100644 index 4a6ec92eb..000000000 --- a/Scripts/ebomber.bos +++ /dev/null @@ -1,102 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, engine; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 - -#define jethtrail 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from engine; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - - - -Create() - { -// start-script Thrust(); -// turn engine to y-axis <180> now; - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; - explode engine type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/ebomber.cob b/Scripts/ebomber.cob deleted file mode 100644 index 51642a918..000000000 Binary files a/Scripts/ebomber.cob and /dev/null differ diff --git a/Scripts/ebox.bos b/Scripts/ebox.bos new file mode 100644 index 000000000..c65d84329 --- /dev/null +++ b/Scripts/ebox.bos @@ -0,0 +1,138 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, forwarddome, reardome, rearleftwing, frontleftwing, frontrightwing, rearrightwing, dirt; + +static-var terraintype, bmoving, moving, shooting_num; + +// Signal definitions +#define SIG_AIM 2 + +SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define +{ +while( get BUILD_PERCENT_LEFT ) +{ +sleep 400; +} +while( TRUE ) +{ +healthpercent = get HEALTH; +if( healthpercent < 66 ) +{ +smoketype = 256 | 2; +if( Rand( 1, 66 ) < healthpercent ) +{ +smoketype = 256 | 1; +} +emit-sfx 1026 from forwarddome; +} +sleeptime = healthpercent * 50; +if( sleeptime < 200 ) +{ +sleeptime = 200; +} +sleep sleeptime; +} +} + +EmitWakes() +{ + while( TRUE ) + { + if( bMoving ) + { + emit-sfx 2 from base; + } + sleep 300; + } +} + +setSFXoccupy(setSFXoccupy_argument) +{ +terraintype = setSFXoccupy_argument; + + if(terraintype == 2) + { + move base to y-axis [-0.85] speed [50]; + set UPRIGHT to 1; + } + else + { + move base to y-axis [0.0] speed [50]; + set UPRIGHT to 0; + } + if(terraintype == 4) + { + move base to y-axis [0] speed [50]; + set UPRIGHT to 0; + } + else + { + move base to y-axis [-0.85] speed [50]; + set UPRIGHT to 1; + } +} + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1024 + 0 from dirt; + } + sleep 400; + } +} + +StartMoving() +{ + moving=1; +} + +StopMoving() +{ + moving=0; +} + +Create() // tells it what to do on creation +{ + start-script Thrust(); + start-script setSFXoccupy(); + start-script EmitWakes(); + start-script SmokeUnit(); +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = forwarddome; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ +piecenum = forwarddome; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode forwarddome type EXPLODE_ON_HIT; + explode reardome type EXPLODE_ON_HIT; + explode rearleftwing type EXPLODE_ON_HIT; + explode rearrightwing type EXPLODE_ON_HIT; + explode frontleftwing type EXPLODE_ON_HIT; + explode frontrightwing type EXPLODE_ON_HIT; +} diff --git a/Scripts/ebox.cob b/Scripts/ebox.cob new file mode 100644 index 000000000..83ffc0673 Binary files /dev/null and b/Scripts/ebox.cob differ diff --git a/Scripts/ebox_lus.lua b/Scripts/ebox_lus.lua new file mode 100644 index 000000000..e9467f91a --- /dev/null +++ b/Scripts/ebox_lus.lua @@ -0,0 +1,41 @@ +base, forwarddome, reardome, rearleftwing, frontleftwing, frontrightwing, rearrightwing, dirt = piece('base', 'forwarddome', 'reardome', 'rearleftwing', 'frontleftwing', 'frontrightwing', 'rearrightwing', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + building = false + Move(base, y_axis, 5, 200) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +function script.Killed() + Explode(forwarddome, SFX.EXPLODE_ON_HIT) + Explode(reardome, SFX.EXPLODE_ON_HIT) + Explode(rearleftwing, SFX.EXPLODE_ON_HIT) + Explode(frontleftwing, SFX.EXPLODE_ON_HIT) + Explode(frontrightwing, SFX.EXPLODE_ON_HIT) + Explode(rearrightwing, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ecentralprocessing.bos b/Scripts/ecentralprocessing.bos deleted file mode 100644 index de28c9837..000000000 --- a/Scripts/ecentralprocessing.bos +++ /dev/null @@ -1,202 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, sfx, firepoint1, shield1, shield2; - -static-var Static_Var_1, gun_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype; - -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from sfx; - sleep 500; - } -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - -QueryWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - - -Go() -{ - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -Create() -{ - call-script InitState(); - move firepoint1 to y-axis [5000.000000] now; - spin base around y-axis speed <15.005495>; - move base to y-axis [100.000000] now; - start-script fx(); - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = base; -} - -StartBuilding(Func_Var_1) -{ - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = sfx; - Static_Var_5 = 1; - return (0); - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/ecentralprocessing.cob b/Scripts/ecentralprocessing.cob deleted file mode 100644 index 4ab12a820..000000000 Binary files a/Scripts/ecentralprocessing.cob and /dev/null differ diff --git a/Scripts/ecommander.bos b/Scripts/ecommander.bos deleted file mode 100644 index 48ac98dca..000000000 --- a/Scripts/ecommander.bos +++ /dev/null @@ -1,397 +0,0 @@ - -// One ninth of the full cycle duration, in millisecond -// The larger this value the slower the walk animation -#define WALK_PERIOD 50 - - -piece base, nanopoint1, penis, door, rf1, rf2, lf1, lf2, rr1, rr2, lr1, lr2, rfdirt, rrdirt, lfdirt, lrdirt, firepoint1; - -static-var maxreloadtime, moving, bMoving, terraintype, building; - -#define SIG_AIM1 2 -#define SIG_FIRE1 4 -#define SIG_MOVE 8 -#define SMOKEPIECE1 base -#include "springdefs.h" -#define SIG_BUILD 16 -#define SIG_AIM_2 32 -#define nanoflame 1024+0 - - -#define FRONT_RIGHT_DOWN\ - turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDA\ - turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDB\ - turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_BACK\ - turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_UP\ - turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_FRONT\ - turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); - - - -#define FRONT_LEFT_DOWN\ - turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_MIDA\ - turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_LEFT_MIDB\ - turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_LEFT_BACK\ - turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_LEFT_UP\ - turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_FRONT\ - turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_RIGHT_DOWN\ - turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_MIDA\ - turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); - -#define REAR_RIGHT_MIDB\ - turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); - -#define REAR_RIGHT_BACK\ - turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); - -#define REAR_RIGHT_UP\ - turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_FRONT\ - turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_LEFT_DOWN\ - turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_LEFT_MIDA\ - turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); - -#define REAR_LEFT_MIDB\ - turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); - -#define REAR_LEFT_BACK\ - turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); - -#define REAR_LEFT_UP\ - turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_LEFT_FRONT\ - turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define WAIT_WALK\ - sleep WALK_PERIOD;\ - while(!moving)\ - {\ - sleep 111;\ - } - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -DoTheWalking() -{ - while(TRUE) - { - WAIT_WALK//1 - FRONT_RIGHT_DOWN - emit-sfx 1025 + 0 from rfdirt; - FRONT_LEFT_BACK - REAR_RIGHT_BACK - REAR_LEFT_MIDA - WAIT_WALK//2 - FRONT_RIGHT_MIDA - WAIT_WALK//3 - FRONT_LEFT_UP - REAR_RIGHT_UP - REAR_LEFT_MIDB - WAIT_WALK//4 - FRONT_RIGHT_MIDB - FRONT_LEFT_FRONT - REAR_RIGHT_FRONT - WAIT_WALK//5 - FRONT_LEFT_DOWN - emit-sfx 1025 + 0 from lfdirt; - REAR_RIGHT_DOWN - emit-sfx 1025 + 0 from rrdirt; - REAR_LEFT_BACK - WAIT_WALK//6 - FRONT_RIGHT_BACK - FRONT_LEFT_MIDA - REAR_RIGHT_MIDA - WAIT_WALK//7 - REAR_LEFT_UP - WAIT_WALK//8 - FRONT_RIGHT_UP - FRONT_LEFT_MIDB - REAR_RIGHT_MIDB - REAR_LEFT_FRONT - WAIT_WALK//9 - FRONT_RIGHT_FRONT - REAR_LEFT_DOWN - emit-sfx 1025 + 0 from lrdirt; - } -} - -StartMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=TRUE; - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=FALSE; - - sleep 4*(WALK_PERIOD); - - turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around z-axis; - wait-for-turn rf2 around z-axis; - turn rf1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around y-axis; - turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around z-axis; - wait-for-turn lf2 around z-axis; - turn lf1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around y-axis; - turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around z-axis; - wait-for-turn rr2 around z-axis; - turn rr1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around y-axis; - turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around z-axis; - wait-for-turn lr2 around z-axis; - turn lr1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around y-axis; - turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); -} - -/* -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} -*/ - - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - - -Create() -{ - move firepoint1 to y-axis [1000] now; - turn rf1 to y-axis <25> now; - turn lf1 to y-axis <-25> now; - turn rr1 to y-axis <-25> now; - turn lr1 to y-axis <25> now; - maxreloadtime=500; - moving=FALSE; - while(get BUILD_PERCENT_LEFT) - { - sleep 250; - } - start-script SmokeUnit(); - start-script DoTheWalking(); -// start-script Thrust(); - start-script buildflame(); -} - -AimFromPrimary(p) -{ - p=firepoint1; -} - -AimPrimary(heading,pitch) -{ - signal SIG_AIM1; - set-signal-mask SIG_AIM1; - return(1); -} - -QueryPrimary(firefrom) -{ - firefrom=firepoint1; -} - -FirePrimary() -{ - signal SIG_FIRE1; - set-signal-mask SIG_FIRE1; -} - -//EMP Weapon End - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - turn door to x-axis <90> speed <150.000000>; - wait-for-turn door around y-axis; - move penis to z-axis [2] speed [1]; - set INBUILDSTANCE to 1; - building = 1; - while (1) { -// emit-sfx 2048 from nanopoint1; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - move penis to z-axis [0] speed [2]; - turn door to x-axis <0> speed <100.000000>; - wait-for-turn door around y-axis; - -} - -QueryNanoPiece(piecenum) -{ - piecenum = nanopoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode penis type EXPLODE_ON_HIT; - explode door type EXPLODE_ON_HIT; - explode rf1 type EXPLODE_ON_HIT; - explode rf2 type EXPLODE_ON_HIT; - explode lf1 type EXPLODE_ON_HIT; - explode lf2 type EXPLODE_ON_HIT; - explode rr1 type EXPLODE_ON_HIT; - explode rr2 type EXPLODE_ON_HIT; - explode lr1 type EXPLODE_ON_HIT; - explode lr2 type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/ecommander.cob b/Scripts/ecommander.cob deleted file mode 100644 index 5d13c0355..000000000 Binary files a/Scripts/ecommander.cob and /dev/null differ diff --git a/Scripts/ecommander3.bos b/Scripts/ecommander3.bos index 873307dff..17794c591 100644 --- a/Scripts/ecommander3.bos +++ b/Scripts/ecommander3.bos @@ -307,7 +307,7 @@ buildflame() Create() { - move firepoint1 to y-axis [1000] now; + //move firepoint1 to y-axis [1000] now; turn rf1 to y-axis <25> now; turn lf1 to y-axis <-25> now; turn rr1 to y-axis <-25> now; diff --git a/Scripts/ecommander3.cob b/Scripts/ecommander3.cob index d87b4230c..3275f5134 100644 Binary files a/Scripts/ecommander3.cob and b/Scripts/ecommander3.cob differ diff --git a/Scripts/ecommander3shield.bos b/Scripts/ecommander3shield.bos new file mode 100644 index 000000000..78c52e1a1 --- /dev/null +++ b/Scripts/ecommander3shield.bos @@ -0,0 +1,389 @@ + +// One ninth of the full cycle duration, in millisecond +// The larger this value the slower the walk animation +#define WALK_PERIOD 50 + + +piece base, nanopoint1, rf1, rf2, lf1, lf2, rr1, rr2, lr1, lr2, rfdirt, rrdirt, lfdirt, lrdirt, firepoint1, mandible; + +static-var maxreloadtime, moving, bMoving, terraintype, building; + +#define SIG_AIM1 2 +#define SIG_FIRE1 4 +#define SIG_MOVE 8 +#define SMOKEPIECE1 base +#include "springdefs.h" +#define SIG_BUILD 16 +#define SIG_AIM_2 32 +#define nanoflame 1024+0 + + +#define FRONT_RIGHT_DOWN\ + turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDA\ + turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDB\ + turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_BACK\ + turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_UP\ + turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_FRONT\ + turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); + + + +#define FRONT_LEFT_DOWN\ + turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_MIDA\ + turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_LEFT_MIDB\ + turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_LEFT_BACK\ + turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_LEFT_UP\ + turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_FRONT\ + turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_RIGHT_DOWN\ + turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_MIDA\ + turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); + +#define REAR_RIGHT_MIDB\ + turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); + +#define REAR_RIGHT_BACK\ + turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); + +#define REAR_RIGHT_UP\ + turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_FRONT\ + turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_LEFT_DOWN\ + turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_LEFT_MIDA\ + turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); + +#define REAR_LEFT_MIDB\ + turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); + +#define REAR_LEFT_BACK\ + turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); + +#define REAR_LEFT_UP\ + turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_LEFT_FRONT\ + turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define WAIT_WALK\ + sleep WALK_PERIOD;\ + while(!moving)\ + {\ + sleep 111;\ + } + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from nanopoint1; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +DoTheWalking() +{ + while(TRUE) + { + WAIT_WALK//1 + FRONT_RIGHT_DOWN + emit-sfx 1025 + 0 from rfdirt; + FRONT_LEFT_BACK + REAR_RIGHT_BACK + REAR_LEFT_MIDA + WAIT_WALK//2 + FRONT_RIGHT_MIDA + WAIT_WALK//3 + FRONT_LEFT_UP + REAR_RIGHT_UP + REAR_LEFT_MIDB + WAIT_WALK//4 + FRONT_RIGHT_MIDB + FRONT_LEFT_FRONT + REAR_RIGHT_FRONT + WAIT_WALK//5 + FRONT_LEFT_DOWN + emit-sfx 1025 + 0 from lfdirt; + REAR_RIGHT_DOWN + emit-sfx 1025 + 0 from rrdirt; + REAR_LEFT_BACK + WAIT_WALK//6 + FRONT_RIGHT_BACK + FRONT_LEFT_MIDA + REAR_RIGHT_MIDA + WAIT_WALK//7 + REAR_LEFT_UP + WAIT_WALK//8 + FRONT_RIGHT_UP + FRONT_LEFT_MIDB + REAR_RIGHT_MIDB + REAR_LEFT_FRONT + WAIT_WALK//9 + FRONT_RIGHT_FRONT + REAR_LEFT_DOWN + emit-sfx 1025 + 0 from lrdirt; + } +} + +StartMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=TRUE; + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=FALSE; + + sleep 4*(WALK_PERIOD); + + turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around z-axis; + wait-for-turn rf2 around z-axis; + turn rf1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around y-axis; + turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around z-axis; + wait-for-turn lf2 around z-axis; + turn lf1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around y-axis; + turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around z-axis; + wait-for-turn rr2 around z-axis; + turn rr1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around y-axis; + turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around z-axis; + wait-for-turn lr2 around z-axis; + turn lr1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around y-axis; + turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); +} + +/* +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1025 + 0 from dirt; + } + sleep 400; + } +} +*/ + + +buildflame() +{ + while( TRUE ) + { + if (building) + { + emit-sfx nanoflame from nanopoint1; + + } + sleep 600; + } +} + + +Create() +{ + //move firepoint1 to y-axis [1000] now; + turn rf1 to y-axis <25> now; + turn lf1 to y-axis <-25> now; + turn rr1 to y-axis <-25> now; + turn lr1 to y-axis <25> now; + maxreloadtime=500; + moving=FALSE; + while(get BUILD_PERCENT_LEFT) + { + sleep 250; + } + start-script SmokeUnit(); + start-script DoTheWalking(); +// start-script Thrust(); + start-script buildflame(); +} + +AimFromPrimary(p) +{ + p=base; +} + +AimPrimary(heading,pitch) +{ + signal SIG_AIM1; + set-signal-mask SIG_AIM1; + return(1); +} + +QueryPrimary(firefrom) +{ + firefrom=base; +} + +FirePrimary() +{ + signal SIG_FIRE1; + set-signal-mask SIG_FIRE1; +} + +//EMP Weapon End + +StartBuilding(heading, pitch) +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 1; + building = 1; + while (1) { +// emit-sfx 2048 from nanopoint1; + sleep 30; + } +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 0; + building = 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nanopoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode rf1 type EXPLODE_ON_HIT; + explode rf2 type EXPLODE_ON_HIT; + explode lf1 type EXPLODE_ON_HIT; + explode lf2 type EXPLODE_ON_HIT; + explode rr1 type EXPLODE_ON_HIT; + explode rr2 type EXPLODE_ON_HIT; + explode lr1 type EXPLODE_ON_HIT; + explode lr2 type EXPLODE_ON_HIT; + explode mandible type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/ecommander3shield.cob b/Scripts/ecommander3shield.cob new file mode 100644 index 000000000..bf516d09e Binary files /dev/null and b/Scripts/ecommander3shield.cob differ diff --git a/Scripts/ecommander4-battle.bos b/Scripts/ecommander4-battle.bos new file mode 100644 index 000000000..4385cb4e5 --- /dev/null +++ b/Scripts/ecommander4-battle.bos @@ -0,0 +1,400 @@ + +// One ninth of the full cycle duration, in millisecond +// The larger this value the slower the walk animation +#define WALK_PERIOD 50 + + +piece base, nanopoint1, rf1, rf2, lf1, lf2, rr1, rr2, lr1, lr2, rfdirt, rrdirt, lfdirt, lrdirt, firepoint1, mandible, firepoint2, turret2, barrel2; + +static-var maxreloadtime, moving, bMoving, terraintype, building; + +#define SIG_AIM1 2 +#define SIG_FIRE1 4 +#define SIG_MOVE 8 +#define SMOKEPIECE1 base +#include "springdefs.h" +#define SIG_BUILD 16 +#define SIG_AIM_2 32 +#define nanoflame 1024+0 + + +#define FRONT_RIGHT_DOWN\ + turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDA\ + turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDB\ + turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_BACK\ + turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_UP\ + turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_FRONT\ + turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); + + + +#define FRONT_LEFT_DOWN\ + turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_MIDA\ + turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_LEFT_MIDB\ + turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_LEFT_BACK\ + turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_LEFT_UP\ + turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_FRONT\ + turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_RIGHT_DOWN\ + turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_MIDA\ + turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); + +#define REAR_RIGHT_MIDB\ + turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); + +#define REAR_RIGHT_BACK\ + turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); + +#define REAR_RIGHT_UP\ + turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_FRONT\ + turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_LEFT_DOWN\ + turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_LEFT_MIDA\ + turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); + +#define REAR_LEFT_MIDB\ + turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); + +#define REAR_LEFT_BACK\ + turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); + +#define REAR_LEFT_UP\ + turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_LEFT_FRONT\ + turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define WAIT_WALK\ + sleep WALK_PERIOD;\ + while(!moving)\ + {\ + sleep 111;\ + } + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from nanopoint1; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +DoTheWalking() +{ + while(TRUE) + { + WAIT_WALK//1 + FRONT_RIGHT_DOWN + emit-sfx 1025 + 0 from rfdirt; + FRONT_LEFT_BACK + REAR_RIGHT_BACK + REAR_LEFT_MIDA + WAIT_WALK//2 + FRONT_RIGHT_MIDA + WAIT_WALK//3 + FRONT_LEFT_UP + REAR_RIGHT_UP + REAR_LEFT_MIDB + WAIT_WALK//4 + FRONT_RIGHT_MIDB + FRONT_LEFT_FRONT + REAR_RIGHT_FRONT + WAIT_WALK//5 + FRONT_LEFT_DOWN + emit-sfx 1025 + 0 from lfdirt; + REAR_RIGHT_DOWN + emit-sfx 1025 + 0 from rrdirt; + REAR_LEFT_BACK + WAIT_WALK//6 + FRONT_RIGHT_BACK + FRONT_LEFT_MIDA + REAR_RIGHT_MIDA + WAIT_WALK//7 + REAR_LEFT_UP + WAIT_WALK//8 + FRONT_RIGHT_UP + FRONT_LEFT_MIDB + REAR_RIGHT_MIDB + REAR_LEFT_FRONT + WAIT_WALK//9 + FRONT_RIGHT_FRONT + REAR_LEFT_DOWN + emit-sfx 1025 + 0 from lrdirt; + } +} + +StartMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=TRUE; + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=FALSE; + + sleep 4*(WALK_PERIOD); + + turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around z-axis; + wait-for-turn rf2 around z-axis; + turn rf1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around y-axis; + turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around z-axis; + wait-for-turn lf2 around z-axis; + turn lf1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around y-axis; + turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around z-axis; + wait-for-turn rr2 around z-axis; + turn rr1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around y-axis; + turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around z-axis; + wait-for-turn lr2 around z-axis; + turn lr1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around y-axis; + turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); +} + +/* +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1025 + 0 from dirt; + } + sleep 400; + } +} +*/ + + +buildflame() +{ + while( TRUE ) + { + if (building) + { + emit-sfx nanoflame from nanopoint1; + + } + sleep 600; + } +} + + +Create() +{ + //move firepoint1 to y-axis [1000] now; + turn rf1 to y-axis <25> now; + turn lf1 to y-axis <-25> now; + turn rr1 to y-axis <-25> now; + turn lr1 to y-axis <25> now; + maxreloadtime=500; + moving=FALSE; + while(get BUILD_PERCENT_LEFT) + { + sleep 250; + } + start-script SmokeUnit(); + start-script DoTheWalking(); +// start-script Thrust(); + start-script buildflame(); +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +turn turret2 to y-axis <0> speed <60>; +turn barrel2 to x-axis <0> speed <30>; +} + + +AimPrimary(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM_2; +set-signal-mask SIG_AIM_2; +turn turret2 to y-axis heading speed <5000>; +turn barrel2 to x-axis <0> - pitch speed <5000>; +wait-for-turn turret2 around y-axis; +wait-for-turn barrel2 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FirePrimary() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 1027 + 0 from firepoint2; +} + +AimFromPrimary(piecenum) // where it aims the weapon from +{ +piecenum = barrel2; +} + +QueryPrimary(piecenum) // where the shot is called from +{ +piecenum = firepoint2; +} + + +StartBuilding(heading, pitch) +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 1; + building = 1; + while (1) { +// emit-sfx 2048 from nanopoint1; + sleep 30; + } +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 0; + building = 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nanopoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode rf1 type EXPLODE_ON_HIT; + explode rf2 type EXPLODE_ON_HIT; + explode lf1 type EXPLODE_ON_HIT; + explode lf2 type EXPLODE_ON_HIT; + explode rr1 type EXPLODE_ON_HIT; + explode rr2 type EXPLODE_ON_HIT; + explode lr1 type EXPLODE_ON_HIT; + explode lr2 type EXPLODE_ON_HIT; + explode mandible type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/ecommander4-battle.cob b/Scripts/ecommander4-battle.cob new file mode 100644 index 000000000..234808d4a Binary files /dev/null and b/Scripts/ecommander4-battle.cob differ diff --git a/Scripts/ecommander4-meteor.bos b/Scripts/ecommander4-meteor.bos new file mode 100644 index 000000000..892b8b60f --- /dev/null +++ b/Scripts/ecommander4-meteor.bos @@ -0,0 +1,398 @@ + +// One ninth of the full cycle duration, in millisecond +// The larger this value the slower the walk animation +#define WALK_PERIOD 50 + + +piece base, nanopoint1, rf1, rf2, lf1, lf2, rr1, rr2, lr1, lr2, rfdirt, rrdirt, lfdirt, lrdirt, firepoint1, mandible, topantenna, innerring, outerring, centerring, emit; + +static-var maxreloadtime, moving, bMoving, terraintype, building; + +#define SIG_AIM1 2 +#define SIG_FIRE1 4 +#define SIG_MOVE 8 +#define SMOKEPIECE1 base +#include "springdefs.h" +#define SIG_BUILD 16 +#define SIG_AIM_2 32 +#define nanoflame 1024+0 + + +#define FRONT_RIGHT_DOWN\ + turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDA\ + turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_MIDB\ + turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_BACK\ + turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ + turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_RIGHT_UP\ + turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_RIGHT_FRONT\ + turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ + turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); + + + +#define FRONT_LEFT_DOWN\ + turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_MIDA\ + turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); + +#define FRONT_LEFT_MIDB\ + turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); + +#define FRONT_LEFT_BACK\ + turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ + turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); + +#define FRONT_LEFT_UP\ + turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); + +#define FRONT_LEFT_FRONT\ + turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ + turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ + turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_RIGHT_DOWN\ + turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_MIDA\ + turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); + +#define REAR_RIGHT_MIDB\ + turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); + +#define REAR_RIGHT_BACK\ + turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ + turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ + turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); + +#define REAR_RIGHT_UP\ + turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_RIGHT_FRONT\ + turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ + turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define REAR_LEFT_DOWN\ + turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); + +#define REAR_LEFT_MIDA\ + turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); + +#define REAR_LEFT_MIDB\ + turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); + +#define REAR_LEFT_BACK\ + turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ + turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ + turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); + +#define REAR_LEFT_UP\ + turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); + +#define REAR_LEFT_FRONT\ + turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ + turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ + turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); + + + +#define WAIT_WALK\ + sleep WALK_PERIOD;\ + while(!moving)\ + {\ + sleep 111;\ + } + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from nanopoint1; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +DoTheWalking() +{ + while(TRUE) + { + WAIT_WALK//1 + FRONT_RIGHT_DOWN + emit-sfx 1025 + 0 from rfdirt; + FRONT_LEFT_BACK + REAR_RIGHT_BACK + REAR_LEFT_MIDA + WAIT_WALK//2 + FRONT_RIGHT_MIDA + WAIT_WALK//3 + FRONT_LEFT_UP + REAR_RIGHT_UP + REAR_LEFT_MIDB + WAIT_WALK//4 + FRONT_RIGHT_MIDB + FRONT_LEFT_FRONT + REAR_RIGHT_FRONT + WAIT_WALK//5 + FRONT_LEFT_DOWN + emit-sfx 1025 + 0 from lfdirt; + REAR_RIGHT_DOWN + emit-sfx 1025 + 0 from rrdirt; + REAR_LEFT_BACK + WAIT_WALK//6 + FRONT_RIGHT_BACK + FRONT_LEFT_MIDA + REAR_RIGHT_MIDA + WAIT_WALK//7 + REAR_LEFT_UP + WAIT_WALK//8 + FRONT_RIGHT_UP + FRONT_LEFT_MIDB + REAR_RIGHT_MIDB + REAR_LEFT_FRONT + WAIT_WALK//9 + FRONT_RIGHT_FRONT + REAR_LEFT_DOWN + emit-sfx 1025 + 0 from lrdirt; + } +} + +StartMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=TRUE; + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=FALSE; + + sleep 4*(WALK_PERIOD); + + turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around z-axis; + wait-for-turn rf2 around z-axis; + turn rf1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rf1 around y-axis; + turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around z-axis; + wait-for-turn lf2 around z-axis; + turn lf1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lf1 around y-axis; + turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); + turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around z-axis; + wait-for-turn rr2 around z-axis; + turn rr1 to y-axis <-25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn rr1 around y-axis; + turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); + + turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); + turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around z-axis; + wait-for-turn lr2 around z-axis; + turn lr1 to y-axis <25> speed <30> *1000/(WALK_PERIOD); + wait-for-turn lr1 around y-axis; + turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); +} + +/* +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1025 + 0 from dirt; + } + sleep 400; + } +} +*/ + + +buildflame() +{ + while( TRUE ) + { + if (building) + { + emit-sfx nanoflame from nanopoint1; + + } + sleep 600; + } +} + + +Create() +{ + move firepoint1 to y-axis [5000] now; + turn rf1 to y-axis <25> now; + turn lf1 to y-axis <-25> now; + turn rr1 to y-axis <-25> now; + turn lr1 to y-axis <25> now; + maxreloadtime=500; + moving=FALSE; + while(get BUILD_PERCENT_LEFT) + { + sleep 250; + } + start-script SmokeUnit(); + start-script DoTheWalking(); +// start-script Thrust(); + start-script buildflame(); + spin topantenna around y-axis speed <8>; + spin topantenna around x-axis speed <2>; + spin innerring around y-axis speed <-3>; + spin centerring around y-axis speed <4>; + spin outerring around y-axis speed <-7>; +} + +AimFromPrimary(p) +{ + p=firepoint1; +} + +AimPrimary(heading,pitch) +{ + signal SIG_AIM1; + set-signal-mask SIG_AIM1; + return(1); +} + +QueryPrimary(firefrom) +{ + firefrom=firepoint1; +} + +FirePrimary() +{ + signal SIG_FIRE1; + set-signal-mask SIG_FIRE1; +} + +//EMP Weapon End + +StartBuilding(heading, pitch) +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 1; + building = 1; + while (1) { +// emit-sfx 2048 from nanopoint1; + sleep 30; + } +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 0; + building = 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nanopoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode rf1 type EXPLODE_ON_HIT; + explode rf2 type EXPLODE_ON_HIT; + explode lf1 type EXPLODE_ON_HIT; + explode lf2 type EXPLODE_ON_HIT; + explode rr1 type EXPLODE_ON_HIT; + explode rr2 type EXPLODE_ON_HIT; + explode lr1 type EXPLODE_ON_HIT; + explode lr2 type EXPLODE_ON_HIT; + explode mandible type EXPLODE_ON_HIT; + explode topantenna type EXPLODE_ON_HIT; + explode innerring type EXPLODE_ON_HIT; + explode centerring type EXPLODE_ON_HIT; + explode outerring type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/ecommander4-meteor.cob b/Scripts/ecommander4-meteor.cob new file mode 100644 index 000000000..468b343bb Binary files /dev/null and b/Scripts/ecommander4-meteor.cob differ diff --git a/Scripts/ecommandfact.cob b/Scripts/ecommandfact.cob deleted file mode 100644 index 6496ec6c0..000000000 Binary files a/Scripts/ecommandfact.cob and /dev/null differ diff --git a/Scripts/ecommandfactory.bos b/Scripts/ecommandfactory.bos deleted file mode 100644 index 59594a311..000000000 --- a/Scripts/ecommandfactory.bos +++ /dev/null @@ -1,239 +0,0 @@ - -#include "sfxtype.h" -#include "exptype.h" - -piece base, doors1, doors2, spikeleft1, spikeleft2, spikeleft3, spikeright1, spikeright2, spikeright3, spikes, topspin, wheelspin, sfxpoint1, nanopoint; - -static-var Maya; - -// Signal definitions (they must be distincts power of 2) -#define SIG_ACTIVATE 2 -#define SIG_BUILDING 4 - -#define NANOFLAME 1024+0 -#define FX1 2048 -#define FX2 2049 -#define FX3 2050 - -SmokeUnit() -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -Create() -{ - Maya=TRUE; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); - turn sfxpoint1 to x-axis <-90> now; -} - -QueryNanoPiece(piecenum) -{ - piecenum = spikes; -} - -Activate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Local variables - var FrameM14,r; - // Open animation: - turn doors1 to z-axis <-90> speed <100>; - turn doors2 to z-axis <90> speed <100>; - move spikes to y-axis [20] speed [5]; - // Try to open the yard - set YARD_OPEN to TRUE; - // If yard not open, tell units around to bugger off until yard is open - while( !get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to TRUE; - } - set BUGGER_OFF to FALSE; - // Now yard is open. - wait-for-move spikes along y-axis; - wait-for-turn doors1 around z-axis; - // Allow the nano to flow: - set INBUILDSTANCE to TRUE; - // Send wheel spinning: - spin wheelspin around x-axis speed <500>; - spin topspin around y-axis speed <50>; - - // The idle but activated animation - FrameM14=0; - while(TRUE) - { - if(Maya) - // Allow the nano to flow - set INBUILDSTANCE to TRUE; - while(Maya) - { - // Activated animation when having tech - emit-sfx FX1 from sfxpoint1; - sleep 5; - ++FrameM14; - if(FrameM14==15) - { - emit-sfx FX2 from sfxpoint1; - FrameM14=0; - } - } - if(!Maya) - // Cut the nano - set INBUILDSTANCE to FALSE; - while(!Maya) - { - // Activated animation when needing tech - r=rand(1,6); - if(r==1) - explode spikeleft1 type FALL | SMOKE; - if(r==2) - explode spikeleft2 type FALL | SMOKE; - if(r==3) - explode spikeleft3 type FALL | SMOKE; - if(r==4) - explode spikeright1 type FALL | SMOKE; - if(r==5) - explode spikeright2 type FALL | SMOKE; - if(r==6) - explode spikeright3 type FALL | SMOKE; - sleep 200; - } - } -} - -Deactivate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Switch off the nano faucet: - set INBUILDSTANCE to FALSE; - // Stop wheel spinning - stop-spin wheelspin around x-axis decelerate <30>; - stop-spin topspin around y-axis decelerate <10>; - // Try to close the yard - set YARD_OPEN to FALSE; - // If yard not closed, tell units around to bugger off until yard is closed - while( get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to FALSE; - } - set BUGGER_OFF to FALSE; - // Now yard is closed. - // Close animation: - turn doors1 to z-axis <0> speed <10>; - turn doors2 to z-axis <0> speed <10>; - move spikes to y-axis [0] speed [5]; -} - -StartBuilding() -{ - signal SIG_BUILDING; // Kill any other StartBuilding - set-signal-mask SIG_BUILDING; // Be killable - var f,r; - f=99999; - r=1; - turn spikeleft1 to y-axis (<-90>)-r*(<30>) now; - turn spikeleft2 to y-axis (<-90>)+r*(<30>) now; - turn spikeleft3 to y-axis (<-90>)-r*(<30>) now; - turn spikeright1 to y-axis (<90>)-r*(<30>) now; - turn spikeright2 to y-axis (<90>)+r*(<30>) now; - turn spikeright3 to y-axis (<90>)-r*(<30>) now; - while(TRUE) - { - emit-sfx NANOFLAME from spikeleft1; - emit-sfx NANOFLAME from spikeleft2; - emit-sfx NANOFLAME from spikeleft3; - emit-sfx NANOFLAME from spikeright1; - emit-sfx NANOFLAME from spikeright2; - emit-sfx NANOFLAME from spikeright3; - emit-sfx FX3 from spikeleft1; - emit-sfx FX3 from spikeleft2; - emit-sfx FX3 from spikeleft3; - emit-sfx FX3 from spikeright1; - emit-sfx FX3 from spikeright2; - emit-sfx FX3 from spikeright3; - sleep 5; - ++f; - if(f>59) - { - f=0; - turn spikeleft1 to y-axis (<-90>)+r*(<30>) speed <30>; - turn spikeleft2 to y-axis (<-90>)-r*(<30>) speed <30>; - turn spikeleft3 to y-axis (<-90>)+r*(<30>) speed <30>; - turn spikeright1 to y-axis (<90>)+r*(<30>) speed <30>; - turn spikeright2 to y-axis (<90>)-r*(<30>) speed <30>; - turn spikeright3 to y-axis (<90>)+r*(<30>) speed <30>; - r=0-r; - } - } -} - -StopBuilding() -{ - signal SIG_BUILDING; // Kill StartBuilding -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint; -} - -TechLost() -{ - Maya=FALSE; -} - -TechGranted() -{ - Maya=TRUE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} \ No newline at end of file diff --git a/Scripts/ecommandfactory.cob b/Scripts/ecommandfactory.cob deleted file mode 100644 index bc17c2c5c..000000000 Binary files a/Scripts/ecommandfactory.cob and /dev/null differ diff --git a/Scripts/ecommandtank.bos b/Scripts/ecommandtank.bos deleted file mode 100644 index a6c59ab8b..000000000 --- a/Scripts/ecommandtank.bos +++ /dev/null @@ -1,156 +0,0 @@ -#include "sfxtype.h" -#include "exptype.h" - -piece base, mast, firepoint1, load1, load2, load3, load4, load5, load6, load7, load8; // these are the pieces of the model -static-var frame, l1, l2, l3, l4, l5, l6, l7, l8; //couldn't get XOR working and didn't have much time - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from mast; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from mast; - sleep 100; - } -} - - -Create() // tells it what to do on creation -{ -start-script fx(); -start-script SmokeUnit(); -} - -TransportPickup(unitid) -{ -if (l8 != 0) return 0; -set BUSY to 1; -attach-unit unitid to base; -if (l1 == 0) {attach-unit unitid to load1; l1 = unitid; sleep 10; set BUSY to 0; return;} -if (l2 == 0) {attach-unit unitid to load2; l2 = unitid; sleep 10; set BUSY to 0; return;} -if (l3 == 0) {attach-unit unitid to load3; l3 = unitid; sleep 10; set BUSY to 0; return;} -if (l4 == 0) {attach-unit unitid to load4; l4 = unitid; sleep 10; set BUSY to 0; return;} -if (l5 == 0) {attach-unit unitid to load5; l5 = unitid; sleep 10; set BUSY to 0; return;} -if (l6 == 0) {attach-unit unitid to load6; l6 = unitid; sleep 10; set BUSY to 0; return;} -if (l7 == 0) {attach-unit unitid to load7; l7 = unitid; sleep 10; set BUSY to 0; return;} -if (l8 == 0) {attach-unit unitid to load8; l8 = unitid; sleep 10; set BUSY to 0; return;} -sleep 500; -drop-unit unitid; -set BUSY to 0; -} - -TransportDrop(unitid) -{ -if (l1 == unitid) l1 = 0; -if (l2 == unitid) l2 = 0; -if (l3 == unitid) l3 = 0; -if (l4 == unitid) l4 = 0; -if (l5 == unitid) l5 = 0; -if (l6 == unitid) l6 = 0; -if (l7 == unitid) l7 = 0; -if (l8 == unitid) l8 = 0; -drop-unit unitid; -} - -lua_frame() { - return 0; -} - -Deactivate() -{ -call-script lua_frame(); -frame = get 111; -get 81 (frame); -if (get 125 (1) < frame) { - emit-sfx 2048 from firepoint1; - get 125(-1, frame + get 126 (1)); -} -} - -Activate(){} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode mast type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode mast type FALL | BITMAP1; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode mast type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode mast type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} \ No newline at end of file diff --git a/Scripts/ecommandtank.cob b/Scripts/ecommandtank.cob deleted file mode 100644 index 9ad1e53b1..000000000 Binary files a/Scripts/ecommandtank.cob and /dev/null differ diff --git a/Scripts/ecommandtankweapon.bos b/Scripts/ecommandtankweapon.bos deleted file mode 100644 index ea4da0ccf..000000000 --- a/Scripts/ecommandtankweapon.bos +++ /dev/null @@ -1,110 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece turret, barrel1, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define gdmarty 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0.000000> speed <30.000000>; -stop-spin barrel1 around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0.000000> - pitch speed <500.000000>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -spin barrel1 around z-axis speed <500.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode turret type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode turret type BITMAPONLY | BITMAP4; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode turret type BITMAPONLY | BITMAP1; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel1 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/ecommandtankweapon.cob b/Scripts/ecommandtankweapon.cob deleted file mode 100644 index 23a0719f2..000000000 Binary files a/Scripts/ecommandtankweapon.cob and /dev/null differ diff --git a/Scripts/edrone.bos b/Scripts/edrone.bos deleted file mode 100644 index 3d0c6b7a9..000000000 --- a/Scripts/edrone.bos +++ /dev/null @@ -1,127 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, wingsfront, engine1, engine2, wingsrear, engine3; - -static-var moving, flames; - -#define jethtrail 1024+0 - -// Signal definitions -#define SIG_AIM 2 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from engine1; - emit-sfx jethtrail from engine2; - emit-sfx jethtrail from engine3; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -MoveRate0() -{ - flames=0; - turn wingsfront to x-axis <-90.000000> speed <150.000000>; - turn wingsrear to x-axis <-90.000000> speed <150.000000>; -} -MoveRate1() -{ - flames=0; - turn wingsfront to x-axis <-70.005495> speed <150.000000>; - turn wingsrear to x-axis <-70.005495> speed <150.000000>; - -} -MoveRate2() -{ - flames=1; - turn wingsfront to x-axis <0.000000> speed <150.000000>; - turn wingsrear to x-axis <0.000000> speed <150.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Create() - { -// start-script Thrust(); -// turn engine1 to y-axis <180> now; -// turn engine2 to y-axis <180> now; -// turn engine3 to y-axis <180> now; - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 3; - explode base type EXPLODE_ON_HIT; - explode wingsfront type EXPLODE_ON_HIT; - explode engine1 type EXPLODE_ON_HIT; - explode engine2 type EXPLODE_ON_HIT; - explode wingsrear type EXPLODE_ON_HIT; - explode engine3 type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/edrone.cob b/Scripts/edrone.cob deleted file mode 100644 index 7c5253f32..000000000 Binary files a/Scripts/edrone.cob and /dev/null differ diff --git a/Scripts/edrone2.bos b/Scripts/edrone2.bos index 4bcba00bc..bfb666c45 100644 --- a/Scripts/edrone2.bos +++ b/Scripts/edrone2.bos @@ -3,7 +3,7 @@ #include "sfxtype.h" #include "exptype.h" -piece base, firepoint1, frontengines, fengine1, fengine2, rearengines, rengine1, rengine2; +piece base, firepoint1, frontengines, fengine1, fengine2, rearengines, rengine1, rengine2, turret, barrel1; static-var moving, flames; @@ -84,25 +84,38 @@ MoveRate2() turn rearengines to x-axis <0.000000> speed <150.000000>; } +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ + sleep 3000; + turn turret to y-axis <0> speed <60>; + turn barrel1 to x-axis <0> speed <30>; +} + AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn turret to y-axis heading speed <500>; + turn barrel1 to x-axis <0> - pitch speed <500>; + wait-for-turn turret around y-axis; + wait-for-turn barrel1 around x-axis; + start-script RestoreAfterDelay(); + return (1); } FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets { +emit-sfx 1024 + 0 from firepoint1; } AimFromWeapon1(piecenum) // where it aims the weapon from { -piecenum = base; + piecenum = turret; } QueryWeapon1(piecenum) // where the shot is called from { -piecenum = firepoint1; + piecenum = firepoint1; } Create() diff --git a/Scripts/edrone2.cob b/Scripts/edrone2.cob index 67d5a8683..ec15c222b 100644 Binary files a/Scripts/edrone2.cob and b/Scripts/edrone2.cob differ diff --git a/Scripts/eengineer.cob b/Scripts/eengineer.cob deleted file mode 100644 index bfc0f34fa..000000000 Binary files a/Scripts/eengineer.cob and /dev/null differ diff --git a/Scripts/eengineer2.cob b/Scripts/eengineer2.cob deleted file mode 100644 index bfc0f34fa..000000000 Binary files a/Scripts/eengineer2.cob and /dev/null differ diff --git a/Scripts/eengineer3.bos b/Scripts/eengineer3.bos deleted file mode 100644 index db7706938..000000000 --- a/Scripts/eengineer3.bos +++ /dev/null @@ -1,238 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, nano1, nano2, nano3, nano4; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building; - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Buildingfx() -{ - while(building) - { - - emit-sfx nanoflame from nano1; - emit-sfx nanoflame from nano2; - emit-sfx nanoflame from nano3; - emit-sfx nanoflame from nano4; - - sleep 5; - } -} - -Go() -{ - turn base to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn base around y-axis; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn base to y-axis <0.000000> speed <160.000000>; - wait-for-turn base around y-axis; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); - start-script Buildingfx(); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nano1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nano2; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nano3; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; -} diff --git a/Scripts/eengineer3.cob b/Scripts/eengineer3.cob deleted file mode 100644 index dbffbcaa5..000000000 Binary files a/Scripts/eengineer3.cob and /dev/null differ diff --git a/Scripts/eengineer3up1.cob b/Scripts/eengineer3up1.cob deleted file mode 100644 index dbffbcaa5..000000000 Binary files a/Scripts/eengineer3up1.cob and /dev/null differ diff --git a/Scripts/eengineer4.bos b/Scripts/eengineer4.bos deleted file mode 100644 index d41948a84..000000000 --- a/Scripts/eengineer4.bos +++ /dev/null @@ -1,253 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, middlespinnything, rightspinnything, nano1, nano2, dirt; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building, moving; - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Buildingfx() -{ - while(building) - { - - emit-sfx nanoflame from nano1; -// emit-sfx nanoflame from nano2; - - sleep 5; - } -} - -Go() -{ - turn base to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn base around y-axis; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn base to y-axis <0.000000> speed <160.000000>; - wait-for-turn base around y-axis; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script setSFXoccupy(); - start-script Thrust(); - start-script EmitWakes(); - start-script SmokeUnit(); - turn top to x-axis <90.000000> now; -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); - spin middlespinnything around y-axis speed <100>; - spin rightspinnything around x-axis speed <100>; - turn top to x-axis <0.000000> speed <300.000000>; - start-script Buildingfx(); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); - stop-spin middlespinnything around y-axis decelerate <15>; - stop-spin rightspinnything around x-axis decelerate <15>; - turn top to x-axis <90.000000> speed <30.000000>; -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nano1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nano2; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nano1; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; -} diff --git a/Scripts/eengineer4.cob b/Scripts/eengineer4.cob deleted file mode 100644 index 3d8c345e9..000000000 Binary files a/Scripts/eengineer4.cob and /dev/null differ diff --git a/Scripts/eengineer5.bos b/Scripts/eengineer5.bos deleted file mode 100644 index 87f07b312..000000000 --- a/Scripts/eengineer5.bos +++ /dev/null @@ -1,194 +0,0 @@ -piece base, doorleft, doorright, nanopoint1, penis, dirt, wheel; - -#include "springdefs.h" -#define SIG_BUILD 8 -#define nanoflame 1024+0 - -static-var bMoving, terraintype, building, moving; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from wheel; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -/* -Buildingfx() -{ - while(building) - { - -// emit-sfx nanoflame from nanopoint1; -// emit-sfx nanoflame from nano2; - - sleep 5; - } -} - -*/ - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - -Create() -{ - start-script setSFXoccupy(); - start-script Thrust(); - start-script EmitWakes(); - start-script SmokeUnit(); - start-script buildflame(); -} - -QueryWeapon1(piecenum) -{ - piecenum=nanopoint1; -} - -AimFromWeapon1(piecenum) -{ - piecenum=penis; -} - -AimWeapon1(h,p) -{ - return 0; -} - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - turn doorleft to y-axis <90> speed <100.000000>; - turn doorright to y-axis <-90> speed <100.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; - move penis to z-axis [4] speed [1]; - set INBUILDSTANCE to 1; - building = 1; - while (1) { -// emit-sfx 2048 from nanopoint1; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - move penis to z-axis [0] speed [2]; - turn doorleft to y-axis <0> speed <50.000000>; - turn doorright to y-axis <0> speed <50.000000>; - wait-for-turn doorleft around y-axis; - wait-for-turn doorright around y-axis; - -} - -QueryNanoPiece(piecenum) -{ - piecenum = nanopoint1; -} - - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode doorleft type EXPLODE_ON_HIT; - explode doorright type EXPLODE_ON_HIT; - explode penis type EXPLODE_ON_HIT; - explode wheel type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eengineer5.cob b/Scripts/eengineer5.cob deleted file mode 100644 index 42e33258e..000000000 Binary files a/Scripts/eengineer5.cob and /dev/null differ diff --git a/Scripts/eengineer6.bos b/Scripts/eengineer6.bos deleted file mode 100644 index bdf108668..000000000 --- a/Scripts/eengineer6.bos +++ /dev/null @@ -1,184 +0,0 @@ -piece base, nanopoint1, penis, dirt, turret; - -#include "springdefs.h" -#define SIG_BUILD 8 -#define nanoflame 1024+0 - -static-var bMoving, terraintype, building, moving; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from turret; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -/* -Buildingfx() -{ - while(building) - { - -// emit-sfx nanoflame from nanopoint1; -// emit-sfx nanoflame from nano2; - - sleep 5; - } -} - -*/ - -buildflame() -{ - while( TRUE ) - { - if (building) - { - emit-sfx nanoflame from nanopoint1; - - } - sleep 600; - } -} - -Create() -{ - start-script setSFXoccupy(); - start-script Thrust(); - start-script EmitWakes(); - start-script SmokeUnit(); - start-script buildflame(); -} - -QueryWeapon1(piecenum) -{ - piecenum=nanopoint1; -} - -AimFromWeapon1(piecenum) -{ - piecenum=penis; -} - -AimWeapon1(h,p) -{ - return 0; -} - -StartBuilding(heading, pitch) -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - spin penis around y-axis speed <50.005495>; - set INBUILDSTANCE to 1; - building = 1; - while (1) { -// emit-sfx 2048 from nanopoint1; - sleep 30; - } -} - -StopBuilding() -{ - signal SIG_BUILD; - set-signal-mask SIG_BUILD; - set INBUILDSTANCE to 0; - building = 0; - stop-spin penis around z-axis decelerate <15.000000>; - -} - -QueryNanoPiece(piecenum) -{ - piecenum = nanopoint1; -} - - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode penis type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eengineer6.cob b/Scripts/eengineer6.cob deleted file mode 100644 index 3c90c8efd..000000000 Binary files a/Scripts/eengineer6.cob and /dev/null differ diff --git a/Scripts/eexecutioner.bos b/Scripts/eexecutioner.bos deleted file mode 100644 index 71505e7cd..000000000 --- a/Scripts/eexecutioner.bos +++ /dev/null @@ -1,110 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - - -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn turret to y-axis <0> speed <30>; -turn barrel1 to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <30>; -turn barrel1 to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eexecutioner.cob b/Scripts/eexecutioner.cob deleted file mode 100644 index 3a1d59213..000000000 Binary files a/Scripts/eexecutioner.cob and /dev/null differ diff --git a/Scripts/eexkrabgroth.bos b/Scripts/eexkrabgroth.bos deleted file mode 100644 index 13863fe5a..000000000 --- a/Scripts/eexkrabgroth.bos +++ /dev/null @@ -1,408 +0,0 @@ - -// One ninth of the full cycle duration, in millisecond -// The larger this value the slower the walk animation -#define WALK_PERIOD 250 - - -piece base,turret1,barrel1,firepoint1,turret2,barrel2,firepoint2,turret3,barrel3,firepoint3, - rf1,rf2,lf1,lf2,rr1,rr2,lr1,lr2,rfdirt,rrdirt,lfdirt,lrdirt; - #define barrel barrel1 - -static-var maxreloadtime,moving; - -#define SIG_AIM1 2 -#define SIG_FIRE1 2 -#define SIG_AIM2 4 -#define SIG_FIRE2 4 -#define SIG_AIM3 16 -#define SIG_FIRE3 16 -#define SIG_MOVE 8 -#include "exptype.h" -#include "sfxtype.h" -#define SMOKEPIECE1 base -#include "SmokeUnit.h" - - - -#define FRONT_RIGHT_DOWN\ - turn rf1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <-45> speed <45> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDA\ - turn rf1 to y-axis <50> speed <10> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <-8> speed <37> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_MIDB\ - turn rf1 to y-axis <30> speed <20> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <15> speed <23> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_BACK\ - turn rf1 to y-axis <0> speed <30> *500/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <9> *500/(WALK_PERIOD);\ - turn rf2 to z-axis <-32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_RIGHT_UP\ - turn rf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_RIGHT_FRONT\ - turn rf1 to y-axis <60> speed <60> *1000/(WALK_PERIOD);\ - turn rf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn rf2 to z-axis <45> speed <45> *1000/(WALK_PERIOD); - - - -#define FRONT_LEFT_DOWN\ - turn lf1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <45> speed <45> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-67> speed <22> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_MIDA\ - turn lf1 to y-axis <-50> speed <10> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <8> speed <37> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <-12> speed <55> *500/(WALK_PERIOD); - -#define FRONT_LEFT_MIDB\ - turn lf1 to y-axis <-30> speed <20> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-15> speed <23> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <20> speed <32> *500/(WALK_PERIOD); - -#define FRONT_LEFT_BACK\ - turn lf1 to y-axis <-0> speed <30> *500/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <9> *500/(WALK_PERIOD);\ - turn lf2 to z-axis <32> speed <12> *500/(WALK_PERIOD); - -#define FRONT_LEFT_UP\ - turn lf1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <0> speed <32> *1000/(WALK_PERIOD); - -#define FRONT_LEFT_FRONT\ - turn lf1 to y-axis <-60> speed <60> *1000/(WALK_PERIOD);\ - turn lf1 to z-axis <0> speed <24> *1000/(WALK_PERIOD);\ - turn lf2 to z-axis <-45> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_RIGHT_DOWN\ - turn rr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <10> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <-32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_MIDA\ - turn rr1 to y-axis <-30> speed <30> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <15> speed <9> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <-20> speed <12> *500/(WALK_PERIOD); - -#define REAR_RIGHT_MIDB\ - turn rr1 to y-axis <-50> speed <20> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-8> speed <23> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <12> speed <32> *500/(WALK_PERIOD); - -#define REAR_RIGHT_BACK\ - turn rr1 to y-axis <-60> speed <10> *500/(WALK_PERIOD);\ - turn rr1 to z-axis <-45> speed <37> *500/(WALK_PERIOD);\ - turn rr2 to z-axis <67> speed <55> *500/(WALK_PERIOD); - -#define REAR_RIGHT_UP\ - turn rr1 to y-axis <-60> speed <42> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_RIGHT_FRONT\ - turn rr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn rr1 to z-axis <24> speed <24> *1000/(WALK_PERIOD);\ - turn rr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define REAR_LEFT_DOWN\ - turn lr1 to y-axis <0> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <10> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <32> speed <32> *1000/(WALK_PERIOD); - -#define REAR_LEFT_MIDA\ - turn lr1 to y-axis <30> speed <30> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <-15> speed <9> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <20> speed <12> *500/(WALK_PERIOD); - -#define REAR_LEFT_MIDB\ - turn lr1 to y-axis <50> speed <20> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <8> speed <23> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-12> speed <32> *500/(WALK_PERIOD); - -#define REAR_LEFT_BACK\ - turn lr1 to y-axis <60> speed <10> *500/(WALK_PERIOD);\ - turn lr1 to z-axis <45> speed <37> *500/(WALK_PERIOD);\ - turn lr2 to z-axis <-67> speed <55> *500/(WALK_PERIOD); - -#define REAR_LEFT_UP\ - turn lr1 to y-axis <60> speed <42> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <0> speed <45> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <-45> speed <22> *1000/(WALK_PERIOD); - -#define REAR_LEFT_FRONT\ - turn lr1 to y-axis <0> speed <60> *1000/(WALK_PERIOD);\ - turn lr1 to z-axis <-24> speed <24> *1000/(WALK_PERIOD);\ - turn lr2 to z-axis <0> speed <45> *1000/(WALK_PERIOD); - - - -#define WAIT_WALK\ - sleep WALK_PERIOD;\ - while(!moving)\ - {\ - sleep 111;\ - } - - - -DoTheWalking() -{ - while(TRUE) - { - WAIT_WALK//1 - FRONT_RIGHT_DOWN - emit-sfx 1025 + 0 from rfdirt; - FRONT_LEFT_BACK - REAR_RIGHT_BACK - REAR_LEFT_MIDA - WAIT_WALK//2 - FRONT_RIGHT_MIDA - WAIT_WALK//3 - FRONT_LEFT_UP - REAR_RIGHT_UP - REAR_LEFT_MIDB - WAIT_WALK//4 - FRONT_RIGHT_MIDB - FRONT_LEFT_FRONT - REAR_RIGHT_FRONT - WAIT_WALK//5 - FRONT_LEFT_DOWN - emit-sfx 1025 + 0 from lfdirt; - REAR_RIGHT_DOWN - emit-sfx 1025 + 0 from rrdirt; - REAR_LEFT_BACK - WAIT_WALK//6 - FRONT_RIGHT_BACK - FRONT_LEFT_MIDA - REAR_RIGHT_MIDA - WAIT_WALK//7 - REAR_LEFT_UP - WAIT_WALK//8 - FRONT_RIGHT_UP - FRONT_LEFT_MIDB - REAR_RIGHT_MIDB - REAR_LEFT_FRONT - WAIT_WALK//9 - FRONT_RIGHT_FRONT - REAR_LEFT_DOWN - emit-sfx 1025 + 0 from lrdirt; - } -} - -StartMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=TRUE; -} - -StopMoving() -{ - signal SIG_MOVE; - set-signal-mask SIG_MOVE; - moving=FALSE; - - sleep 4*(WALK_PERIOD); - - turn rf1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around z-axis; - wait-for-turn rf2 around z-axis; - turn rf1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rf1 around y-axis; - turn rf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lf1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lf2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around z-axis; - wait-for-turn lf2 around z-axis; - turn lf1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lf1 around y-axis; - turn lf1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn rr1 to z-axis <45> speed <30> *1000/(WALK_PERIOD); - turn rr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around z-axis; - wait-for-turn rr2 around z-axis; - turn rr1 to y-axis <-30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn rr1 around y-axis; - turn rr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); - - turn lr1 to z-axis <-45> speed <30> *1000/(WALK_PERIOD); - turn lr2 to z-axis <0> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around z-axis; - wait-for-turn lr2 around z-axis; - turn lr1 to y-axis <30> speed <30> *1000/(WALK_PERIOD); - wait-for-turn lr1 around y-axis; - turn lr1 to z-axis <0> speed <40> *1000/(WALK_PERIOD); -} - - -Create() -{ - turn rf1 to y-axis <30> now; - turn lf1 to y-axis <-30> now; - turn rr1 to y-axis <-30> now; - turn lr1 to y-axis <30> now; - maxreloadtime=500; - moving=FALSE; - while(get BUILD_PERCENT_LEFT) - { - sleep 250; - } - start-script SmokeUnit(); - start-script DoTheWalking(); -// start-script Thrust(); -} - -SetMaxReloadTime(t) -{ - maxreloadtime=t; -} - -RestoreAfterDelay() -{ - sleep maxreloadtime*3/2; - turn turret1 to y-axis 0 speed <60>; - turn barrel1 to x-axis 0 speed <30>; - turn turret2 to y-axis 0 speed <60>; - turn barrel2 to x-axis 0 speed <30>; - turn turret3 to y-axis 0 speed <60>; - turn barrel3 to x-axis 0 speed <30>; - wait-for-turn turret1 around y-axis; - wait-for-turn barrel1 around x-axis; - wait-for-turn turret2 around y-axis; - wait-for-turn barrel2 around x-axis; - wait-for-turn turret3 around y-axis; - wait-for-turn barrel3 around x-axis; -} - -AimFromPrimary(p) -{ - p=turret1; -} - -AimPrimary(heading,pitch) -{ - signal SIG_AIM1; - set-signal-mask SIG_AIM1; - turn turret1 to y-axis heading speed <255>; - turn barrel1 to x-axis 0 - pitch speed <150>; - wait-for-turn turret1 around y-axis; - wait-for-turn barrel1 around x-axis; - start-script RestoreAfterDelay(); - return(1); -} - -QueryPrimary(firefrom) -{ - firefrom=firepoint1; -} - -FirePrimary() -{ - signal SIG_FIRE1; - set-signal-mask SIG_FIRE1; - emit-sfx 1024 + 0 from firepoint1; -// move barrel to z-axis [-10] now; -// move barrel to z-axis [0] speed [4]; -} - -AimFromSecondary(p) -{ - p=turret2; -} - -AimSecondary(heading,pitch) -{ - signal SIG_AIM2; - set-signal-mask SIG_AIM2; - turn turret2 to y-axis heading speed <255>; - turn barrel2 to x-axis 0 - pitch speed <150>; - wait-for-turn turret2 around y-axis; - wait-for-turn barrel2 around x-axis; -// start-script RestoreAfterDelay(); - return(1); -} - -QuerySecondary(firefrom) -{ - firefrom=firepoint2; -} - -FireSecondary() -{ - signal SIG_FIRE2; - set-signal-mask SIG_FIRE2; - emit-sfx 1024 + 0 from firepoint2; -// move barrel to z-axis [-10] now; -// move barrel to z-axis [0] speed [4]; -} - - -AimFromTertiary(p) -{ - p=turret3; -} - -AimTertiary(heading,pitch) -{ - signal SIG_AIM3; - set-signal-mask SIG_AIM3; - turn turret3 to y-axis heading speed <255>; - turn barrel3 to x-axis 0 - pitch speed <150>; - wait-for-turn turret3 around y-axis; - wait-for-turn barrel3 around x-axis; -// start-script RestoreAfterDelay(); - return(1); -} - -QueryTertiary(firefrom) -{ - firefrom=firepoint3; -} - -FireTertiary() -{ - signal SIG_FIRE3; - set-signal-mask SIG_FIRE3; - emit-sfx 1024 + 0 from firepoint3; -// move barrel to z-axis [-10] now; -// move barrel to z-axis [0] speed [4]; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret1 type EXPLODE_ON_HIT; - explode barrel2 type EXPLODE_ON_HIT; - explode turret2 type EXPLODE_ON_HIT; - explode barrel3 type EXPLODE_ON_HIT; - explode turret3 type EXPLODE_ON_HIT; - explode rf1 type EXPLODE_ON_HIT; - explode rf2 type EXPLODE_ON_HIT; - explode lf1 type EXPLODE_ON_HIT; - explode lf2 type EXPLODE_ON_HIT; - explode rr1 type EXPLODE_ON_HIT; - explode rr2 type EXPLODE_ON_HIT; - explode lr1 type EXPLODE_ON_HIT; - explode lr2 type EXPLODE_ON_HIT; - -} \ No newline at end of file diff --git a/Scripts/eexkrabgroth.cob b/Scripts/eexkrabgroth.cob deleted file mode 100644 index 2047541f0..000000000 Binary files a/Scripts/eexkrabgroth.cob and /dev/null differ diff --git a/Scripts/eexnukearty.bos b/Scripts/eexnukearty.bos deleted file mode 100644 index 4ef948036..000000000 --- a/Scripts/eexnukearty.bos +++ /dev/null @@ -1,152 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, bMoving, moving; - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from barrel1; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( Static_Var_3 ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - - -setSFXoccupy(Func_Var_1) -{ - Static_Var_2 = Func_Var_1; - if( Static_Var_2 == 2 ) - { - move base to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } - else - { - move base to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - if( Static_Var_2 == 4 ) - { - move base to y-axis [0.000000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 0; - } - else - { - move base to y-axis [-0.850000] speed [50.000000]; - set UNKNOWN_UNIT_VALUE(79) to 1; - } -} - -Create() -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn turret to y-axis <0.000000> speed <60.000000>; - turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <100>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() -{ - - emit-sfx 1024 + 0 from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/eexnukearty.cob b/Scripts/eexnukearty.cob deleted file mode 100644 index 3efe77e8e..000000000 Binary files a/Scripts/eexnukearty.cob and /dev/null differ diff --git a/Scripts/eexperimentalfac.bos b/Scripts/eexperimentalfac.bos deleted file mode 100644 index 6d221cf5b..000000000 --- a/Scripts/eexperimentalfac.bos +++ /dev/null @@ -1,182 +0,0 @@ - -#include "sfxtype.h" -#include "exptype.h" - -piece base, doorsright, doorsleft, frontsouthdoors, frontnorthdoors, rearsouthdoors, rearnorthdoors, nanopoint; - -static-var Maya; - -// Signal definitions (they must be distincts power of 2) -#define SIG_ACTIVATE 2 -#define SIG_BUILDING 4 - -#define NANO 1024+0 -#define FX1 2048 -#define FX2 2049 -#define FX3 2050 - -SmokeUnit() -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -Create() -{ - Maya=TRUE; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); -// turn sfxpoint1 to x-axis <-90> now; -} - -QueryNanoPiece(piecenum) -{ - piecenum = nanopoint; -} - -Activate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Local variables - var FrameM14,r; - // Open animation: - turn frontnorthdoors to x-axis <90> speed <100>; - turn frontsouthdoors to x-axis <-90> speed <100>; - turn rearnorthdoors to x-axis <90> speed <100>; - turn rearsouthdoors to x-axis <-90> speed <100>; - wait-for-turn frontnorthdoors around x-axis; - wait-for-turn frontsouthdoors around x-axis; - wait-for-turn rearnorthdoors around x-axis; - wait-for-turn rearsouthdoors around x-axis; - turn doorsright to z-axis <90> speed <100>; - turn doorsleft to z-axis <-90> speed <100>; - // Try to open the yard - set YARD_OPEN to TRUE; - // If yard not open, tell units around to bugger off until yard is open - while( !get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to TRUE; - } - set BUGGER_OFF to FALSE; - // Now yard is open. - // Allow the nano to flow: - set INBUILDSTANCE to TRUE; - - // The idle but activated animation - FrameM14=0; - while(TRUE) - { - if(Maya) - // Allow the nano to flow - set INBUILDSTANCE to TRUE; - while(Maya) - { - // Activated animation when having tech - sleep 5; - ++FrameM14; - if(FrameM14==15) - { - FrameM14=0; - } - } - if(!Maya) - // Cut the nano - set INBUILDSTANCE to FALSE; - while(!Maya) - { - // Activated animation when needing tech - sleep 200; - } - } -} - -Deactivate() -{ - // Kill any other Activate or Deactivate: - signal SIG_ACTIVATE; - // Flag self so it can be killed: - set-signal-mask SIG_ACTIVATE; - // Switch off the nano faucet: - set INBUILDSTANCE to FALSE; - // Stop wheel spinning - // Try to close the yard - set YARD_OPEN to FALSE; - // If yard not closed, tell units around to bugger off until yard is closed - while( get YARD_OPEN ) - { - set BUGGER_OFF to TRUE; - sleep 1500; - set YARD_OPEN to FALSE; - } - set BUGGER_OFF to FALSE; - // Now yard is closed. - // Close animation: - turn doorsright to z-axis <0> speed <75>; - turn doorsleft to z-axis <0> speed <75>; - wait-for-turn doorsright around z-axis; - wait-for-turn doorsleft around z-axis; - turn frontnorthdoors to x-axis <0> speed <75>; - turn frontsouthdoors to x-axis <0> speed <75>; - turn rearnorthdoors to x-axis <0> speed <75>; - turn rearsouthdoors to x-axis <0> speed <75>; -} - -StartBuilding() -{ - signal SIG_BUILDING; // Kill any other StartBuilding - set-signal-mask SIG_BUILDING; // Be killable - while(TRUE) - { - emit-sfx NANO from nanopoint; - sleep 300; - } -} - -StopBuilding() -{ - signal SIG_BUILDING; // Kill StartBuilding -} - -QueryBuildInfo(piecenum) -{ - piecenum = nanopoint; -} - -TechLost() -{ - Maya=FALSE; -} - -TechGranted() -{ - Maya=TRUE; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode frontsouthdoors type EXPLODE_ON_HIT; - explode frontnorthdoors type EXPLODE_ON_HIT; - explode rearsouthdoors type EXPLODE_ON_HIT; - explode rearnorthdoors type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eexperimentalfac.cob b/Scripts/eexperimentalfac.cob deleted file mode 100644 index 7a66125af..000000000 Binary files a/Scripts/eexperimentalfac.cob and /dev/null differ diff --git a/Scripts/efactory.cob b/Scripts/efactory.cob deleted file mode 100644 index 121233355..000000000 Binary files a/Scripts/efactory.cob and /dev/null differ diff --git a/Scripts/efatso.bos b/Scripts/efatso.bos deleted file mode 100644 index e20dbc171..000000000 --- a/Scripts/efatso.bos +++ /dev/null @@ -1,213 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, turret2, turret3, firepoint1, firepoint2, firepoint3; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -turn turret1 to x-axis <0> speed <30>; -turn turret2 to y-axis <0> speed <60>; -turn turret2 to x-axis <0> speed <30>; -turn turret3 to y-axis <0> speed <60>; -turn turret3 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret1 to y-axis heading speed <225>; -turn turret1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret1 around y-axis; -wait-for-turn turret1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret2 to y-axis heading speed <225>; -turn turret2 to x-axis <0> - pitch speed <150>; -wait-for-turn turret2 around y-axis; -wait-for-turn turret2 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM_4; -turn turret3 to y-axis heading speed <225>; -turn turret3 to x-axis <0> - pitch speed <150>; -wait-for-turn turret3 around y-axis; -wait-for-turn turret3 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = turret3; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type FALL | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/efatso.cob b/Scripts/efatso.cob deleted file mode 100644 index 6e1592754..000000000 Binary files a/Scripts/efatso.cob and /dev/null differ diff --git a/Scripts/efatso2.bos b/Scripts/efatso2.bos deleted file mode 100644 index 36a097585..000000000 --- a/Scripts/efatso2.bos +++ /dev/null @@ -1,177 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece firepoint1, firepoint2, base, turret, barrel1, dirt; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var terraintype, bmoving, moving, shooting_num; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - shooting_num=1; - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn turret to y-axis <0.000000> speed <35.005495>; - turn barrel1 to x-axis <0.000000> speed <15.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - - if(shooting_num==1) - { - emit-sfx 1024 from firepoint2; - } - - if(shooting_num==2) - { - emit-sfx 1024 from firepoint1; - } - - shooting_num=shooting_num+1; - - if( shooting_num == 3) - { - shooting_num=1; - } -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if (shooting_num==1) - { - piecenum=firepoint1; - } - - if (shooting_num==2) - { - piecenum=firepoint2; - } -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/efatso2.cob b/Scripts/efatso2.cob deleted file mode 100644 index 3583217b3..000000000 Binary files a/Scripts/efatso2.cob and /dev/null differ diff --git a/Scripts/efet.bos b/Scripts/efet.bos deleted file mode 100644 index 9998590ae..000000000 --- a/Scripts/efet.bos +++ /dev/null @@ -1,109 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define trail 1024+0 // this is a custom explosion generator thinging - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx trail from base; - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/efet.cob b/Scripts/efet.cob deleted file mode 100644 index 91a2e5aa2..000000000 Binary files a/Scripts/efet.cob and /dev/null differ diff --git a/Scripts/efighter.bos b/Scripts/efighter.bos deleted file mode 100644 index f31829e80..000000000 --- a/Scripts/efighter.bos +++ /dev/null @@ -1,102 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, firepoint3, firepoint4, firepoint5, engine; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 - -#define gdmarty 1024+0 // this is a custom explosion generator thinging -#define flame 1025+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from engine; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Create() - { - start-script SmokeUnit(); -// turn engine to y-axis <180> now; -// start-script Thrust(); - } - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; - explode engine type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/efighter.cob b/Scripts/efighter.cob deleted file mode 100644 index 537d36155..000000000 Binary files a/Scripts/efighter.cob and /dev/null differ diff --git a/Scripts/eflakturret.bos b/Scripts/eflakturret.bos new file mode 100644 index 000000000..6638a246f --- /dev/null +++ b/Scripts/eflakturret.bos @@ -0,0 +1,148 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, beams, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, lilypad; // these are the pieces of the model + +static-var shooting_num, terraintype; + +// Signal definitions +#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag + + +// Custom SFX +#define GDMARTY 1024+0 + +SmokeUnit()// this is a standard smoke point define +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1026 from turret; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + + +Create() // tells it what to do on creation +{ + shooting_num=1; + start-script SmokeUnit(); +} + + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +turn turret to y-axis <0> speed <60>; +turn barrel1 to x-axis <0> speed <30>; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +/* + if ( get IN_WATER(0) == 1 ) + { + return (0); + } +*/ +signal SIG_AIM; +set-signal-mask SIG_AIM; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; +wait-for-turn turret around y-axis; +wait-for-turn barrel1 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ + if(shooting_num==1) + { + emit-sfx 1024 from firepoint2; + } + + if(shooting_num==2) + { + emit-sfx 1024 from firepoint3; + } + + if(shooting_num==3) + { + emit-sfx 1024 from firepoint4; + } + + if(shooting_num==4) + { + emit-sfx 1024 from firepoint1; + } + + shooting_num=shooting_num+1; + + if( shooting_num == 5) + { + shooting_num=1; + } +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = barrel1; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ + if (shooting_num==1) + { + piecenum=firepoint1; + } + + if (shooting_num==2) + { + piecenum=firepoint2; + } + + if (shooting_num==3) + { + piecenum=firepoint3; + } + + if (shooting_num==4) + { + piecenum=firepoint4; + } +} +/* +TechLost() +{ + CanFire=FALSE; + signal SIG_AIM; + stop-spin turret around y-axis decelerate <10>; + stop-spin barrel1 around x-axis decelerate <10>; +} + +TechGranted() +{ + CanFire=TRUE; +} +*/ +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode beams type EXPLODE_ON_HIT; + explode lilypad type EXPLODE_ON_HIT; +} diff --git a/Scripts/eflakturret.cob b/Scripts/eflakturret.cob new file mode 100644 index 000000000..0ba4adcb9 Binary files /dev/null and b/Scripts/eflakturret.cob differ diff --git a/Scripts/eflametank.bos b/Scripts/eflametank.bos deleted file mode 100644 index da68a6ec5..000000000 --- a/Scripts/eflametank.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt, casing; // these are the pieces of the model - -static-var terraintype, bmoving, moving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging -#define f3 1024+1 -// Signal definitions -#define SIG_AIM 2 - -lua_FlameShot(weapon) //flame effect? -{ - return 0; -} - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); - move casing to z-axis [-2] speed [1000]; -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -move casing to z-axis [-2] speed [1]; -} - -AimPrimary(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FirePrimary() // what do while firing, fires 1 barrel then the next , and resets -{ -move casing to z-axis [2] speed [10]; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; -} - -AimFromPrimary(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryPrimary(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Shot1() -{ - call-script lua_FlameShot(1); - return (TRUE); -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode casing type EXPLODE_ON_HIT; -} diff --git a/Scripts/eflametank.cob b/Scripts/eflametank.cob deleted file mode 100644 index 5295752c4..000000000 Binary files a/Scripts/eflametank.cob and /dev/null differ diff --git a/Scripts/eflamethrower.bos b/Scripts/eflamethrower.bos deleted file mode 100644 index 4b609ebc0..000000000 --- a/Scripts/eflamethrower.bos +++ /dev/null @@ -1,143 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// Signal definitions -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; - -turn turret1 to y-axis heading speed <225>; -wait-for-turn turret1 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type FALL | BITMAP1; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -return (0); -} -corpsetype = 3; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -} diff --git a/Scripts/eflamethrower.cob b/Scripts/eflamethrower.cob deleted file mode 100644 index b3f2f1157..000000000 Binary files a/Scripts/eflamethrower.cob and /dev/null differ diff --git a/Scripts/efusion.cob b/Scripts/efusion.cob deleted file mode 100644 index 570a17396..000000000 Binary files a/Scripts/efusion.cob and /dev/null differ diff --git a/Scripts/egunship.cob b/Scripts/egunship.cob deleted file mode 100644 index 4e70e0e02..000000000 Binary files a/Scripts/egunship.cob and /dev/null differ diff --git a/Scripts/egunship2.bos b/Scripts/egunship2.bos deleted file mode 100644 index 759b808c3..000000000 --- a/Scripts/egunship2.bos +++ /dev/null @@ -1,158 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, frontengines, fengine1, fengine2, rearengines, rengine1, rengine2, engine; - -static-var moving, flames; - -#define jethtrail 1024+0 - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving && flames) - { - emit-sfx jethtrail from engine; - } - if (moving) - { - emit-sfx jethtrail from fengine1; - emit-sfx jethtrail from fengine2; - emit-sfx jethtrail from rengine1; - emit-sfx jethtrail from rengine2; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -MoveRate0() -{ - flames=0; - turn frontengines to x-axis <-90.000000> speed <150.000000>; - turn rearengines to x-axis <-90.000000> speed <150.000000>; -} -MoveRate1() -{ - flames=0; - turn frontengines to x-axis <-70.005495> speed <150.000000>; - turn rearengines to x-axis <-70.005495> speed <150.000000>; -} -MoveRate2() -{ - flames=1; - turn frontengines to x-axis <0.000000> speed <150.000000>; - turn rearengines to x-axis <0.000000> speed <150.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -Create() - { -// start-script Thrust(); -// turn engine to y-axis <180> now; -// turn fengine1 to y-axis <180> now; -// turn fengine2 to y-axis <180> now; -// turn rengine1 to y-axis <180> now; -// turn rengine2 to y-axis <180> now; - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; - explode frontengines type EXPLODE_ON_HIT; - explode fengine1 type EXPLODE_ON_HIT; - explode fengine2 type EXPLODE_ON_HIT; - explode rearengines type EXPLODE_ON_HIT; - explode rengine1 type EXPLODE_ON_HIT; - explode rengine2 type EXPLODE_ON_HIT; - explode engine type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/egunship2.cob b/Scripts/egunship2.cob deleted file mode 100644 index 6814abbe7..000000000 Binary files a/Scripts/egunship2.cob and /dev/null differ diff --git a/Scripts/ehbotengineer_lus.lua b/Scripts/ehbotengineer_lus.lua new file mode 100644 index 000000000..1b9377fb1 --- /dev/null +++ b/Scripts/ehbotengineer_lus.lua @@ -0,0 +1,77 @@ +base, turret, nanos, nanopoint1, nanopoint2, dirt, backpack, exhaust1, exhaust2 = piece('base', 'turret', 'nanos', 'nanopoint1', 'nanopoint2', 'dirt', 'backpack', 'exhaust1', 'exhaust2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) + StartThread(BuildFX) + building = false +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +function BuildFX() + while(building == true) do + EmitSfx (nanopoint1, 1024) + EmitSfx (nanopoint2, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(base, y_axis, 0, 5) + end +end + +local nanoPoints = {} +-- FIXME: this example has 2 nano pieces to alternate between +for i = 1, 2 do + -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model + nanoPoints[i] = piece("nanopoint" .. i) +end +Spring.SetUnitNanoPieces(unitID, nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + Turn(base, y_axis, heading, 100) + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + Explode(nanos, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotengineer_turret_lus.lua b/Scripts/ehbotengineer_turret_lus.lua new file mode 100644 index 000000000..c161686ea --- /dev/null +++ b/Scripts/ehbotengineer_turret_lus.lua @@ -0,0 +1,72 @@ +base, turret, nanos, nanopoint1, nanopoint2, dirt = piece('base', 'turret', 'nanos', 'nanopoint1', 'nanopoint2', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(BuildFX) + building = false + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +function BuildFX() + while(building == true) do + EmitSfx (nanopoint1, 1024) + EmitSfx (nanopoint2, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(turret, y_axis, 0, 5) + end +end + +local nanoPoints = {} +-- FIXME: this example has 2 nano pieces to alternate between +for i = 1, 2 do + -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model + nanoPoints[i] = piece("nanopoint" .. i) +end +Spring.SetUnitNanoPieces(unitID, nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + Turn(turret, y_axis, heading, 100) + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + Explode(nanos, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotfac.bos b/Scripts/ehbotfac.bos new file mode 100644 index 000000000..87158a730 --- /dev/null +++ b/Scripts/ehbotfac.bos @@ -0,0 +1,267 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, base1, base2, base3, base4, spinner1, spinner2, spinner3, spinner4, nanopoint1, nano1, nano2, nano3, nano4, sfxpoint1, sfxpoint2, lilypad; + +static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building, terraintype; + +// Signal definitions +#define SIG_ACTIVATE 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +setSFXoccupy(setSFXoccupy_argument) +{ +terraintype = setSFXoccupy_argument; + + if(terraintype == 2) + { + move base to y-axis [-3] speed [50]; + } + else + { + move base to y-axis [-3] speed [50]; + } + if(terraintype == 4) + { + move base to y-axis [-3] speed [50]; + } + else + { + move base to y-axis [-3] speed [50]; + } +} + +buildingfx() +{ + while( TRUE ) + { + if (building) + { + emit-sfx 1024 from nano1; + sleep 60; + emit-sfx 1024 from nano4; + sleep 60; + emit-sfx 1024 from nano3; + sleep 60; + emit-sfx 1024 from nano2; + sleep 60; + } + sleep 600; + } +} + +buildingfx2() +{ + while( TRUE ) + { + if (building) + { + emit-sfx 1025 from nanopoint1; + } + sleep 300; + } +} + +fx() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1027 from sfxpoint1; + emit-sfx 1027 from sfxpoint2; +// } + sleep 500; + } +} + +OpenYard() +{ + spin spinner1 around y-axis speed <50.005495>; + spin spinner2 around y-axis speed <50.005495>; + spin spinner3 around y-axis speed <50.005495>; + spin spinner4 around y-axis speed <50.005495>; + set YARD_OPEN to 1; + while( !get YARD_OPEN ) + { + set BUGGER_OFF to 1; + sleep 1500; + set YARD_OPEN to 1; + } + set BUGGER_OFF to 0; +} + +CloseYard() +{ + stop-spin spinner1 around z-axis decelerate <15.000000>; + stop-spin spinner2 around z-axis decelerate <15.000000>; + stop-spin spinner3 around z-axis decelerate <15.000000>; + stop-spin spinner4 around z-axis decelerate <15.000000>; + set YARD_OPEN to 0; + while( get YARD_OPEN ) + { + set BUGGER_OFF to 1; + sleep 1500; + set YARD_OPEN to 0; + } + set BUGGER_OFF to 0; +} + +Go() +{ + call-script OpenYard(); + set INBUILDSTANCE to 1; +} + +Stop() +{ + set INBUILDSTANCE to 0; + call-script CloseYard(); + +} + +InitState() +{ + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState == 0 ) + { + call-script Go(); + currentstate = 0; + } + if( statechg_DesiredState == 1 ) + { + call-script Stop(); + currentstate = 1; + } + } + statechg_StateChanging = FALSE; +} + +Create() +{ + unitviewer = FALSE; + spray = 0; + call-script InitState(); + start-script SmokeUnit(); + start-script Buildingfx(); +// start-script Buildingfx2(); + start-script fx(); +} + +QueryNanoPiece(piecenum) +{ + if( spray == 0 ) + { + piecenum = nano1; + } + if( spray == 1 ) + { + piecenum = nano2; + } + if( spray == 2 ) + { + piecenum = nano3; + } + if( spray == 3 ) + { + piecenum = nano4; + } + ++spray; + if( spray >= 4 ) + { + spray = 0; + } +} + + +Activate() +{ + signal SIG_ACTIVATE; + start-script RequestState(0); +} + +Deactivate() +{ + signal SIG_ACTIVATE; + set-signal-mask SIG_ACTIVATE; + + set-signal-mask 0; + start-script RequestState(1); +} + +StartBuilding() +{ +building = 1; +} + +StopBuilding() +{ +building = 0; +} + +QueryBuildInfo(piecenum) +{ + piecenum = nanopoint1; +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base1 type EXPLODE_ON_HIT; + explode base2 type EXPLODE_ON_HIT; + explode base3 type EXPLODE_ON_HIT; + explode base4 type EXPLODE_ON_HIT; + explode spinner1 type EXPLODE_ON_HIT; + explode spinner2 type EXPLODE_ON_HIT; + explode spinner3 type EXPLODE_ON_HIT; + explode spinner4 type EXPLODE_ON_HIT; +} diff --git a/Scripts/ehbotfac.cob b/Scripts/ehbotfac.cob new file mode 100644 index 000000000..81aa2c585 Binary files /dev/null and b/Scripts/ehbotfac.cob differ diff --git a/Scripts/ehbotkarganneth_lus.lua b/Scripts/ehbotkarganneth_lus.lua new file mode 100644 index 000000000..2fc2b8ea0 --- /dev/null +++ b/Scripts/ehbotkarganneth_lus.lua @@ -0,0 +1,79 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt, backpack, exhaust1, exhaust2, gat1, gat2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt', 'backpack', 'exhaust1', 'exhaust2', 'gat1', 'gat2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) + Spring.UnitScript.StopSpin( gat1, z_axis, 0.01) + Spring.UnitScript.StopSpin( gat2, z_axis, 0.01) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + Spring.UnitScript.Spin( gat1, z_axis, 5 ) + Spring.UnitScript.Spin( gat2, z_axis, -5 ) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(base, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + Explode(gat1, SFX.EXPLODE_ON_HIT) + Explode(gat2, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotkarganneth_turret_lus.lua b/Scripts/ehbotkarganneth_turret_lus.lua new file mode 100644 index 000000000..18c7f55ad --- /dev/null +++ b/Scripts/ehbotkarganneth_turret_lus.lua @@ -0,0 +1,74 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt, gat1, gat2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt', 'gat1', 'gat2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + Move(base, y_axis, -2, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) + Spring.UnitScript.StopSpin( gat1, z_axis, 0.01) + Spring.UnitScript.StopSpin( gat2, z_axis, 0.01) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + Spring.UnitScript.Spin( gat1, z_axis, 5 ) + Spring.UnitScript.Spin( gat2, z_axis, -5 ) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(gat1, SFX.EXPLODE_ON_HIT) + Explode(gat2, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotpeewee_lus.lua b/Scripts/ehbotpeewee_lus.lua new file mode 100644 index 000000000..a4f8d67f3 --- /dev/null +++ b/Scripts/ehbotpeewee_lus.lua @@ -0,0 +1,73 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt, backpack, exhaust1, exhaust2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt', 'backpack', 'exhaust1', 'exhaust2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(base, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotpeewee_turret_lus.lua b/Scripts/ehbotpeewee_turret_lus.lua new file mode 100644 index 000000000..daa343cbe --- /dev/null +++ b/Scripts/ehbotpeewee_turret_lus.lua @@ -0,0 +1,68 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotrocko_lus.lua b/Scripts/ehbotrocko_lus.lua new file mode 100644 index 000000000..1f4644738 --- /dev/null +++ b/Scripts/ehbotrocko_lus.lua @@ -0,0 +1,72 @@ +base, turret, barrel1, firepoint1, dirt, backpack, exhaust1, exhaust2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'backpack', 'exhaust1', 'exhaust2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(base, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotrocko_turret_lus.lua b/Scripts/ehbotrocko_turret_lus.lua new file mode 100644 index 000000000..712666a19 --- /dev/null +++ b/Scripts/ehbotrocko_turret_lus.lua @@ -0,0 +1,67 @@ +base, turret, barrel1, firepoint1, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotsniper_lus.lua b/Scripts/ehbotsniper_lus.lua new file mode 100644 index 000000000..1f4644738 --- /dev/null +++ b/Scripts/ehbotsniper_lus.lua @@ -0,0 +1,72 @@ +base, turret, barrel1, firepoint1, dirt, backpack, exhaust1, exhaust2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'backpack', 'exhaust1', 'exhaust2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(base, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotsniper_turret_lus.lua b/Scripts/ehbotsniper_turret_lus.lua new file mode 100644 index 000000000..712666a19 --- /dev/null +++ b/Scripts/ehbotsniper_turret_lus.lua @@ -0,0 +1,67 @@ +base, turret, barrel1, firepoint1, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotthud_lus.lua b/Scripts/ehbotthud_lus.lua new file mode 100644 index 000000000..a4f8d67f3 --- /dev/null +++ b/Scripts/ehbotthud_lus.lua @@ -0,0 +1,73 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt, backpack, exhaust1, exhaust2 = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt', 'backpack', 'exhaust1', 'exhaust2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + StartThread(doYouEvenLift) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function doYouEvenLift() + common.HbotLift() +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(base, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(base, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(base, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + Explode(backpack, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/ehbotthud_turret_lus.lua b/Scripts/ehbotthud_turret_lus.lua new file mode 100644 index 000000000..daa343cbe --- /dev/null +++ b/Scripts/ehbotthud_turret_lus.lua @@ -0,0 +1,68 @@ +base, turret, barrel1, firepoint1, firepoint2, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'firepoint2', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeapon(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +local firepoints = {firepoint1, firepoint2} +local currentFirepoint = 1 + +function script.QueryWeapon(weaponID) + return firepoints[currentFirepoint] +end + +function script.FireWeapon(weaponID) + currentFirepoint = 3 - currentFirepoint + EmitSfx (firepoints[currentFirepoint], 1024) +end + +function script.AimWeapon(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavylaserplatform.cob b/Scripts/eheavylaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/eheavylaserplatform.cob and /dev/null differ diff --git a/Scripts/eheavylaserplatform2.cob b/Scripts/eheavylaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/eheavylaserplatform2.cob and /dev/null differ diff --git a/Scripts/eheavymissiletank.bos b/Scripts/eheavymissiletank.bos deleted file mode 100644 index 4d002a34a..000000000 --- a/Scripts/eheavymissiletank.bos +++ /dev/null @@ -1,173 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1, firepoint2; // these are the pieces of the model - - -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 - -static-var terraintype, bmoving; // these are the variables - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn turret to y-axis <0> speed <30>; -turn turret to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <30>; -turn turret to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <30>; -turn turret to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eheavymissiletank.cob b/Scripts/eheavymissiletank.cob deleted file mode 100644 index d6ca55719..000000000 Binary files a/Scripts/eheavymissiletank.cob and /dev/null differ diff --git a/Scripts/eheavytank.bos b/Scripts/eheavytank.bos deleted file mode 100644 index 38ad71dae..000000000 --- a/Scripts/eheavytank.bos +++ /dev/null @@ -1,155 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, flare1, flare2, flare3, flare4; // these are the pieces of the model - -static-var gun_1, terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from flare1; -emit-sfx gdmarty from flare2; -emit-sfx gdmarty from flare3; -emit-sfx gdmarty from flare4; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eheavytank.cob b/Scripts/eheavytank.cob deleted file mode 100644 index c2dbd4a98..000000000 Binary files a/Scripts/eheavytank.cob and /dev/null differ diff --git a/Scripts/eheavytank2.bos b/Scripts/eheavytank2.bos deleted file mode 100644 index 38ad71dae..000000000 --- a/Scripts/eheavytank2.bos +++ /dev/null @@ -1,155 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, flare1, flare2, flare3, flare4; // these are the pieces of the model - -static-var gun_1, terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from flare1; -emit-sfx gdmarty from flare2; -emit-sfx gdmarty from flare3; -emit-sfx gdmarty from flare4; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eheavytank2.cob b/Scripts/eheavytank2.cob deleted file mode 100644 index c2dbd4a98..000000000 Binary files a/Scripts/eheavytank2.cob and /dev/null differ diff --git a/Scripts/eheavytank4.bos b/Scripts/eheavytank4.bos deleted file mode 100644 index dbf287ef9..000000000 --- a/Scripts/eheavytank4.bos +++ /dev/null @@ -1,152 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - - -piece base, turret, barrel1, firepoint1, dirt; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var gun_1, terraintype, bmoving, moving; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx 1024 + 0 from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/eheavytank4.cob b/Scripts/eheavytank4.cob deleted file mode 100644 index 4f81abae1..000000000 Binary files a/Scripts/eheavytank4.cob and /dev/null differ diff --git a/Scripts/eheavytank4_lus.lua b/Scripts/eheavytank4_lus.lua index 95ff1dbb6..f02f7c961 100644 --- a/Scripts/eheavytank4_lus.lua +++ b/Scripts/eheavytank4_lus.lua @@ -48,8 +48,8 @@ end function script.AimWeapon(weaponID, heading, pitch) Signal(SIG_AIM) SetSignalMask(SIG_AIM) - Turn(turret, y_axis, heading, 20) - Turn(barrel1, x_axis, pitch, 20) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) WaitForTurn(turret, y_axis) WaitForTurn(barrel1, x_axis) StartThread(RestoreAfterDelay) diff --git a/Scripts/eheavytank4_up2_lus.lua b/Scripts/eheavytank4_up2_lus.lua new file mode 100644 index 000000000..26a4b1eef --- /dev/null +++ b/Scripts/eheavytank4_up2_lus.lua @@ -0,0 +1,123 @@ +base, turret, barrel1, firepoint1, pd1, pd2, pd3, pd4, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'pd1', 'pd2', 'pd3', 'pd4', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon2() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon2() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd1 +end + +function script.AimWeapon2(heading, pitch) + Signal(SIG_AIM_2) + SetSignalMask(SIG_AIM_2) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon2() +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon3() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon3() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd2 +end + +function script.AimWeapon3(heading, pitch) + Signal(SIG_AIM_3) + SetSignalMask(SIG_AIM_3) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon3() +end + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavytank4_up3_lus.lua b/Scripts/eheavytank4_up3_lus.lua new file mode 100644 index 000000000..15d142a13 --- /dev/null +++ b/Scripts/eheavytank4_up3_lus.lua @@ -0,0 +1,171 @@ +base, turret, barrel1, firepoint1, pd1, pd2, pd3, pd4, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'pd1', 'pd2', 'pd3', 'pd4', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon2() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon2() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd1 +end + +function script.AimWeapon2(heading, pitch) + Signal(SIG_AIM_2) + SetSignalMask(SIG_AIM_2) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon2() +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon3() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon3() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd2 +end + +function script.AimWeapon3(heading, pitch) + Signal(SIG_AIM_3) + SetSignalMask(SIG_AIM_3) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon3() +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon4() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon4() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd3 +end + +function script.AimWeapon4(heading, pitch) + Signal(SIG_AIM_4) + SetSignalMask(SIG_AIM_4) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon4() +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon5() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon5() + --Spring.Echo("QueryWeapon: FireWeapon") + return pd4 +end + +function script.AimWeapon5(heading, pitch) + Signal(SIG_AIM_5) + SetSignalMask(SIG_AIM_5) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon5() +end + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavytank_t3.lua b/Scripts/eheavytank_t3.lua new file mode 100644 index 000000000..481e2fc15 --- /dev/null +++ b/Scripts/eheavytank_t3.lua @@ -0,0 +1,100 @@ +base, turret, barrel1, firepoint1, dirt, t3turret, t3barrel1, t3firepoint = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 't3turret', 't3barrel1', 't3firepoint') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +function script.AimFromWeaponPrimary(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeaponPrimary(weaponID) + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeaponPrimary(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeaponPrimary(weaponID) + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + + +function script.AimFromWeaponSecondary(weaponID) + --Spring.Echo("AimFromWeapon: FireWeapon") + return t3turret +end + +function script.QueryWeaponSecondary(weaponID) + --Spring.Echo("QueryWeapon: FireWeapon") + return t3firepoint1 +end + +function script.AimWeaponSecondary(weaponID, heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(t3turret, y_axis) + WaitForTurn(t3barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeaponSecondary(weaponID) + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (t3firepoint1, 1024) +end + + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(t3barrel1, SFX.EXPLODE_ON_HIT) + Explode(t3turret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavytank_t3_lus.lua b/Scripts/eheavytank_t3_lus.lua new file mode 100644 index 000000000..9fe59044c --- /dev/null +++ b/Scripts/eheavytank_t3_lus.lua @@ -0,0 +1,109 @@ +base, turret, barrel1, firepoint1, dirt, t3turret, t3barrel1, t3firepoint1 = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 't3turret', 't3barrel1', 't3firepoint1') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(20000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) + Turn(t3turret, y_axis, 0, 5) + Turn(t3barrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon2() + --Spring.Echo("AimFromWeapon: FireWeapon") + return t3turret +end + +function script.QueryWeapon2() + --Spring.Echo("QueryWeapon: FireWeapon") + return t3firepoint1 +end + +function script.AimWeapon2(heading, pitch) + Signal(SIG_AIM_2) + SetSignalMask(SIG_AIM_2) + Turn(t3turret, y_axis, heading, 100) + Turn(t3barrel1, x_axis, -pitch, 100) + WaitForTurn(t3turret, y_axis) + WaitForTurn(t3barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon2() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (t3firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(t3barrel1, SFX.EXPLODE_ON_HIT) + Explode(t3turret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavytank_upgraded_lus.lua b/Scripts/eheavytank_upgraded_lus.lua new file mode 100644 index 000000000..b235932e6 --- /dev/null +++ b/Scripts/eheavytank_upgraded_lus.lua @@ -0,0 +1,109 @@ +base, turret, barrel1, firepoint1, dirt, pdturret, pdbarrel1, pdfirepoint1 = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'pdturret', 'pdbarrel1', 'pdfirepoint1') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) + Turn(pdturret, y_axis, 0, 5) + Turn(pdbarrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon2() + --Spring.Echo("AimFromWeapon: FireWeapon") + return pdturret +end + +function script.QueryWeapon2() + --Spring.Echo("QueryWeapon: FireWeapon") + return pdfirepoint1 +end + +function script.AimWeapon2(heading, pitch) + Signal(SIG_AIM_2) + SetSignalMask(SIG_AIM_2) + Turn(pdturret, y_axis, heading, 100) + Turn(pdbarrel1, x_axis, -pitch, 100) + WaitForTurn(pdturret, y_axis) + WaitForTurn(pdbarrel1, x_axis) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon2() + --Spring.Echo("FireWeapon: FireWeapon") + common.CustomEmitter(pdfirepoint1, "factorysparks") -- Second argument is the piece name, third argument needs to be a string because it will be the name of the CEG effect used +end + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(pdbarrel1, SFX.EXPLODE_ON_HIT) + Explode(pdturret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/eheavyturret.bos b/Scripts/eheavyturret.bos deleted file mode 100644 index 6cb9d6ef8..000000000 --- a/Scripts/eheavyturret.bos +++ /dev/null @@ -1,112 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - - -#define gdhcannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdhcannon from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP3; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type BITMAPONLY | BITMAP3; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type BITMAPONLY | BITMAP3; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type BITMAPONLY | BITMAP3; -explode base type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eheavyturret.cob b/Scripts/eheavyturret.cob deleted file mode 100644 index d6cdb3239..000000000 Binary files a/Scripts/eheavyturret.cob and /dev/null differ diff --git a/Scripts/eheavyturret2.bos b/Scripts/eheavyturret2.bos index da2da2ffc..938415900 100644 --- a/Scripts/eheavyturret2.bos +++ b/Scripts/eheavyturret2.bos @@ -89,8 +89,8 @@ AimWeapon1(heading, pitch) // aiming animation and firing authorization set-signal-mask SIG_AIM; while(!CanFire) sleep 200; - turn turret to y-axis heading speed <225>; - turn barrel1 to x-axis <0> - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eheavyturret2.cob b/Scripts/eheavyturret2.cob index 5409120b2..f4bf7fcd5 100644 Binary files a/Scripts/eheavyturret2.cob and b/Scripts/eheavyturret2.cob differ diff --git a/Scripts/ehoverfac.bos b/Scripts/ehoverfac.bos index fe06e81c1..d6047a7f5 100644 --- a/Scripts/ehoverfac.bos +++ b/Scripts/ehoverfac.bos @@ -38,28 +38,6 @@ SmokeUnit(healthpercent, sleeptime, smoketype) } } -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-5] speed [50]; - } - else - { - move base to y-axis [-5] speed [50]; - } - if(terraintype == 4) - { - move base to y-axis [-5] speed [50]; - } - else - { - move base to y-axis [-5] speed [50]; - } -} - buildingfx() { while( TRUE ) diff --git a/Scripts/ehoverfac.cob b/Scripts/ehoverfac.cob index 264ef8d14..67ee4dda3 100644 Binary files a/Scripts/ehoverfac.cob and b/Scripts/ehoverfac.cob differ diff --git a/Scripts/einterceptor.bos b/Scripts/einterceptor.bos deleted file mode 100644 index 47d419c97..000000000 --- a/Scripts/einterceptor.bos +++ /dev/null @@ -1,92 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -// Signal definitions -#define SIG_AIM 2 - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from base; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = base; -} - -Create() - { - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/einterceptor.cob b/Scripts/einterceptor.cob deleted file mode 100644 index 356f56868..000000000 Binary files a/Scripts/einterceptor.cob and /dev/null differ diff --git a/Scripts/einterceptor2.bos b/Scripts/einterceptor2.bos deleted file mode 100644 index 6db5a0b67..000000000 --- a/Scripts/einterceptor2.bos +++ /dev/null @@ -1,140 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, firepoint3; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 - -#define gdmarty 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM_4; -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - - - -Create() - { - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/einterceptor2.cob b/Scripts/einterceptor2.cob deleted file mode 100644 index 8e409fe6c..000000000 Binary files a/Scripts/einterceptor2.cob and /dev/null differ diff --git a/Scripts/ejammer.bos b/Scripts/ejammer.bos deleted file mode 100644 index 50940644e..000000000 --- a/Scripts/ejammer.bos +++ /dev/null @@ -1,65 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Create() -{ - spin top around y-axis speed <10.005495>; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} \ No newline at end of file diff --git a/Scripts/ejammer.cob b/Scripts/ejammer.cob deleted file mode 100644 index 8195d8857..000000000 Binary files a/Scripts/ejammer.cob and /dev/null differ diff --git a/Scripts/ejammer2.bos b/Scripts/ejammer2.bos deleted file mode 100644 index 1ae40c51a..000000000 --- a/Scripts/ejammer2.bos +++ /dev/null @@ -1,50 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, topspin, bottomspin; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Create() -{ - spin top around y-axis speed <-15.005495>; - spin topspin around y-axis speed <10.005495>; - spin bottomspin around y-axis speed <-5.005495>; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode topspin type EXPLODE_ON_HIT; - explode bottomspin type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/ejammer2.cob b/Scripts/ejammer2.cob deleted file mode 100644 index 4d93386f6..000000000 Binary files a/Scripts/ejammer2.cob and /dev/null differ diff --git a/Scripts/ejammer3.bos b/Scripts/ejammer3.bos new file mode 100644 index 000000000..265c97f7d --- /dev/null +++ b/Scripts/ejammer3.bos @@ -0,0 +1,50 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, emitter, foot1, foot2, foot3; + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from emitter; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +Create() +{ + spin emitter around y-axis speed <-15.005495>; + start-script SmokeUnit(); +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode emitter type EXPLODE_ON_HIT; + explode foot1 type EXPLODE_ON_HIT; + explode foot2 type EXPLODE_ON_HIT; + explode foot3 type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/ejammer3.cob b/Scripts/ejammer3.cob new file mode 100644 index 000000000..993eded86 Binary files /dev/null and b/Scripts/ejammer3.cob differ diff --git a/Scripts/ejerik.bos b/Scripts/ejerik.bos deleted file mode 100644 index 21d03ac9c..000000000 --- a/Scripts/ejerik.bos +++ /dev/null @@ -1,296 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, firepoint3, firepoint4, firepoint5, firepoint6, firepoint7, firepoint8, missilefirepoint1, exhaust; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -#define flash 1024+0 -#define flame 1024+1 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from exhaust; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = missilefirepoint1; -} - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint3; -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - -AimWeapon4(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon4() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint4; -} - -AimFromWeapon4(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon4(piecenum) // where the shot is called from -{ -piecenum = firepoint4; -} - -AimWeapon5(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon5() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint5; -} - -AimFromWeapon5(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon5(piecenum) // where the shot is called from -{ -piecenum = firepoint5; -} - -AimWeapon6(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon6() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint6; -} - -AimFromWeapon6(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon6(piecenum) // where the shot is called from -{ -piecenum = firepoint6; -} - -AimWeapon7(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon7() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint7; -} - -AimFromWeapon7(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon7(piecenum) // where the shot is called from -{ -piecenum = firepoint7; -} - -AimWeapon8(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon8() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint8; -} - -AimFromWeapon8(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon8(piecenum) // where the shot is called from -{ -piecenum = firepoint8; -} - -AimWeapon9(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon9() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon9(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon9(piecenum) // where the shot is called from -{ -piecenum = missilefirepoint1; -} - -Create() - { - turn exhaust to y-axis <180> now; - start-script Thrust(); - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/ejerik.cob b/Scripts/ejerik.cob deleted file mode 100644 index 018227119..000000000 Binary files a/Scripts/ejerik.cob and /dev/null differ diff --git a/Scripts/ekrow.bos b/Scripts/ekrow.bos new file mode 100644 index 000000000..62e5e0654 --- /dev/null +++ b/Scripts/ekrow.bos @@ -0,0 +1,107 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, turret, barrel1, firepoint1, engine1, engine2, engine3, engine4, engine5, engine6, engine7, engine8; + +static-var moving, flames, shooting_num; + +// Signal definitions +#define SIG_AIM 2 + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + spin base around y-axis speed <50.005495>; + } + sleep 5; + } +} + +StartMoving() +{ + moving=1; +} + +StopMoving() +{ + moving=0; +} + +Create() + { + start-script SmokeUnit(); + } + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ + sleep 3000; + turn turret to y-axis <0> speed <60>; + turn barrel1 to x-axis <0> speed <30>; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn turret to y-axis heading speed <500>; + turn barrel1 to x-axis <0> - pitch speed <500>; + wait-for-turn turret around y-axis; + wait-for-turn barrel1 around x-axis; + start-script RestoreAfterDelay(); + return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 1024 + 0 from firepoint1; +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ + piecenum = turret; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ + piecenum = firepoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode turret type EXPLODE_ON_HIT; + explode barrel1 type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/ekrow.cob b/Scripts/ekrow.cob new file mode 100644 index 000000000..fb4b69d47 Binary files /dev/null and b/Scripts/ekrow.cob differ diff --git a/Scripts/elacerator.bos b/Scripts/elacerator.bos new file mode 100644 index 000000000..f85146de6 --- /dev/null +++ b/Scripts/elacerator.bos @@ -0,0 +1,152 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, turret, barrel1, firepoint1, dirt; + +static-var Static_Var_1, Static_Var_2, Static_Var_3, bMoving, moving; + +// Signal definitions +#define SIG_AIM 2 // this is a aim define + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from barrel1; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +EmitWakes() +{ + while( TRUE ) + { + if( Static_Var_3 ) + { + emit-sfx 2 from base; + } + sleep 300; + } +} + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1025 + 0 from dirt; + } + sleep 400; + } +} + +StartMoving() +{ + moving=1; +} + +StopMoving() +{ + moving=0; +} + + + +setSFXoccupy(Func_Var_1) +{ + Static_Var_2 = Func_Var_1; + if( Static_Var_2 == 2 ) + { + move base to y-axis [-0.850000] speed [50.000000]; + set UNKNOWN_UNIT_VALUE(79) to 1; + } + else + { + move base to y-axis [0.000000] speed [50.000000]; + set UNKNOWN_UNIT_VALUE(79) to 0; + } + if( Static_Var_2 == 4 ) + { + move base to y-axis [0.000000] speed [50.000000]; + set UNKNOWN_UNIT_VALUE(79) to 0; + } + else + { + move base to y-axis [-0.850000] speed [50.000000]; + set UNKNOWN_UNIT_VALUE(79) to 1; + } +} + +Create() +{ + start-script Thrust(); + start-script setSFXoccupy(); + start-script EmitWakes(); + start-script SmokeUnit(); +} + +RestoreAfterDelay() +{ + sleep 3000; + turn turret to y-axis <0.000000> speed <60.000000>; + turn barrel1 to x-axis <0> speed <30>; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +turn turret to y-axis heading now; +turn barrel1 to x-axis <0> - pitch now; +wait-for-turn turret around y-axis; +wait-for-turn barrel1 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FireWeapon1() +{ + + emit-sfx 1024 + 0 from firepoint1; +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = barrel1; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ +piecenum = firepoint1; +} + + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode barrel1 type EXPLODE_ON_HIT; + explode turret type EXPLODE_ON_HIT; +} diff --git a/Scripts/elacerator.cob b/Scripts/elacerator.cob new file mode 100644 index 000000000..19b8b40d2 Binary files /dev/null and b/Scripts/elacerator.cob differ diff --git a/Scripts/elaserbattery.bos b/Scripts/elaserbattery.bos new file mode 100644 index 000000000..3f491915d --- /dev/null +++ b/Scripts/elaserbattery.bos @@ -0,0 +1,116 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, beams, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, lilypad; // these are the pieces of the model + +static-var shooting_num, terraintype; + +// Signal definitions +#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag + + +// Custom SFX +#define GDMARTY 1024+0 + +SmokeUnit()// this is a standard smoke point define +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1026 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + + +setSFXoccupy(setSFXoccupy_argument) +{ +terraintype = setSFXoccupy_argument; + + if(terraintype == 2) + { + move base to y-axis [-0.5] speed [50]; + show lilypad; + } + else + { + move base to y-axis [0] speed [50]; + hide lilypad; + } + if(terraintype == 4) + { + move base to y-axis [0] speed [50]; + hide lilypad; + } + else + { + move base to y-axis [-0.85] speed [50]; + show lilypad; + } +} + + + +Create() // tells it what to do on creation +{ + shooting_num=1; + start-script SmokeUnit(); +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +} + +AimWeapon1(heading, pitch) // aiming animation and firing authorization +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ + piecenum = firepoint1; +} + +QueryWeapon1(piecenum) // where the shot is created at +{ + piecenum=firepoint1; +} +/* +TechLost() +{ + CanFire=FALSE; + signal SIG_AIM; + stop-spin turret around y-axis decelerate <10>; + stop-spin barrel1 around x-axis decelerate <10>; +} + +TechGranted() +{ + CanFire=TRUE; +} +*/ +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode beams type EXPLODE_ON_HIT; + explode lilypad type EXPLODE_ON_HIT; +} diff --git a/Scripts/elaserbattery.cob b/Scripts/elaserbattery.cob new file mode 100644 index 000000000..894d0c878 Binary files /dev/null and b/Scripts/elaserbattery.cob differ diff --git a/Scripts/elightlaserplatform.cob b/Scripts/elightlaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/elightlaserplatform.cob and /dev/null differ diff --git a/Scripts/elightlaserplatform2.cob b/Scripts/elightlaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/elightlaserplatform2.cob and /dev/null differ diff --git a/Scripts/elighttank.bos b/Scripts/elighttank.bos deleted file mode 100644 index cec9496e7..000000000 --- a/Scripts/elighttank.bos +++ /dev/null @@ -1,187 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, barrel2, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -turn barrel2 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel2 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/elighttank.cob b/Scripts/elighttank.cob deleted file mode 100644 index dcedf15d1..000000000 Binary files a/Scripts/elighttank.cob and /dev/null differ diff --git a/Scripts/elighttank2.bos b/Scripts/elighttank2.bos deleted file mode 100644 index cec9496e7..000000000 --- a/Scripts/elighttank2.bos +++ /dev/null @@ -1,187 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, barrel2, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -turn barrel2 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel2 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/elighttank2.cob b/Scripts/elighttank2.cob deleted file mode 100644 index dcedf15d1..000000000 Binary files a/Scripts/elighttank2.cob and /dev/null differ diff --git a/Scripts/elighttank3.bos b/Scripts/elighttank3.bos index 6b909046c..fd94ce19f 100644 --- a/Scripts/elighttank3.bos +++ b/Scripts/elighttank3.bos @@ -122,8 +122,8 @@ AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to d { signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/elighttank3.cob b/Scripts/elighttank3.cob index 4f23899b0..de3e8dc56 100644 Binary files a/Scripts/elighttank3.cob and b/Scripts/elighttank3.cob differ diff --git a/Scripts/elighttank3_lus.lua b/Scripts/elighttank3_lus.lua new file mode 100644 index 000000000..04db32dd8 --- /dev/null +++ b/Scripts/elighttank3_lus.lua @@ -0,0 +1,76 @@ +base, turret, barrel1, firepoint1, dirt = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/elighttank3_upgraded_lus.lua b/Scripts/elighttank3_upgraded_lus.lua new file mode 100644 index 000000000..b235932e6 --- /dev/null +++ b/Scripts/elighttank3_upgraded_lus.lua @@ -0,0 +1,109 @@ +base, turret, barrel1, firepoint1, dirt, pdturret, pdbarrel1, pdfirepoint1 = piece('base', 'turret', 'barrel1', 'firepoint1', 'dirt', 'pdturret', 'pdbarrel1', 'pdfirepoint1') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, turret, barrel1}) +end + +common = include("headers/common_includes_lus.lua") + +function script.setSFXoccupy(setSFXoccupy_argument) + common.setSFXoccupy(setSFXoccupy_argument) +end + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + + +local function RestoreAfterDelay() + Sleep(2000) + Turn(turret, y_axis, 0, 5) + Turn(barrel1, x_axis, 0, 5) + Turn(pdturret, y_axis, 0, 5) + Turn(pdbarrel1, x_axis, 0, 5) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return turret +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return firepoint1 +end + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + Turn(turret, y_axis, heading, 100) + Turn(barrel1, x_axis, -pitch, 100) + WaitForTurn(turret, y_axis) + WaitForTurn(barrel1, x_axis) + StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + EmitSfx (firepoint1, 1024) +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon2() + --Spring.Echo("AimFromWeapon: FireWeapon") + return pdturret +end + +function script.QueryWeapon2() + --Spring.Echo("QueryWeapon: FireWeapon") + return pdfirepoint1 +end + +function script.AimWeapon2(heading, pitch) + Signal(SIG_AIM_2) + SetSignalMask(SIG_AIM_2) + Turn(pdturret, y_axis, heading, 100) + Turn(pdbarrel1, x_axis, -pitch, 100) + WaitForTurn(pdturret, y_axis) + WaitForTurn(pdbarrel1, x_axis) + --StartThread(RestoreAfterDelay) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon2() + --Spring.Echo("FireWeapon: FireWeapon") + common.CustomEmitter(pdfirepoint1, "factorysparks") -- Second argument is the piece name, third argument needs to be a string because it will be the name of the CEG effect used +end + +------------------------------------------- +------------------------------------------- + +function script.Killed() + Explode(barrel1, SFX.EXPLODE_ON_HIT) + Explode(turret, SFX.EXPLODE_ON_HIT) + Explode(pdbarrel1, SFX.EXPLODE_ON_HIT) + Explode(pdturret, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/elightturret.bos b/Scripts/elightturret.bos deleted file mode 100644 index b4570f908..000000000 --- a/Scripts/elightturret.bos +++ /dev/null @@ -1,112 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define gdmarty 1024+0 -#define gdmarty1 1025+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0.000000> speed <30.000000>; -stop-spin barrel1 around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -emit-sfx gdmarty from firepoint1; -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty1 from firepoint1; -spin barrel1 around z-axis speed <120.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode turret type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode turret type BITMAPONLY | BITMAP4; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode turret type BITMAPONLY | BITMAP1; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel1 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/elightturret.cob b/Scripts/elightturret.cob deleted file mode 100644 index 04faf7f5b..000000000 Binary files a/Scripts/elightturret.cob and /dev/null differ diff --git a/Scripts/elightturret2.bos b/Scripts/elightturret2.bos index 17b787f66..84d056775 100644 --- a/Scripts/elightturret2.bos +++ b/Scripts/elightturret2.bos @@ -97,8 +97,8 @@ AimWeapon1(heading, pitch) // aiming animation and firing authorization set-signal-mask SIG_AIM; while(!CanFire) sleep 200; - turn turret to y-axis heading speed <225>; - turn barrel1 to x-axis <0> - pitch speed <150>; + turn turret to y-axis heading speed <5000>; + turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/elightturret2.cob b/Scripts/elightturret2.cob index 5409120b2..f4bf7fcd5 100644 Binary files a/Scripts/elightturret2.cob and b/Scripts/elightturret2.cob differ diff --git a/Scripts/elrpc.bos b/Scripts/elrpc.bos deleted file mode 100644 index 1a9deeebb..000000000 --- a/Scripts/elrpc.bos +++ /dev/null @@ -1,113 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, sfxpoint1; // these are the pieces of the model - -static-var CanFire; - -// Signal definitions -#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag - -// Custom SFX -#define gdmarty 1024+0 -#define gdmarty1 1025+0 - -SmokeUnit()// this is a standard smoke point define -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1027 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -cannotfire() -{ - while( TRUE ) - { - if (!CanFire) - { - emit-sfx 1026 from sfxpoint1; - } - sleep 1500; - } -} - -Create() // tells it what to do on creation -{ - CanFire=FALSE; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); - start-script cannotfire(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ - sleep 3000; - turn turret to y-axis <0> speed <60>; - turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // aiming animation and firing authorization -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - while(!CanFire) - sleep 200; - turn turret to y-axis heading speed <225>; - turn barrel1 to x-axis <0> - pitch speed <150>; - wait-for-turn turret around y-axis; - wait-for-turn barrel1 around x-axis; - emit-sfx gdmarty from firepoint1; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - emit-sfx gdmarty1 from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ - piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is created at -{ - piecenum = firepoint1; -} - -TechLost() -{ - CanFire=FALSE; - signal SIG_AIM; - stop-spin turret around y-axis decelerate <10>; - stop-spin barrel1 around x-axis decelerate <10>; -} - -TechGranted() -{ - CanFire=TRUE; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode turret type EXPLODE_ON_HIT; - explode barrel1 type EXPLODE_ON_HIT; -} diff --git a/Scripts/elrpc.cob b/Scripts/elrpc.cob deleted file mode 100644 index cd5d37051..000000000 Binary files a/Scripts/elrpc.cob and /dev/null differ diff --git a/Scripts/emaker.bos b/Scripts/emaker.bos deleted file mode 100644 index d622b9a09..000000000 --- a/Scripts/emaker.bos +++ /dev/null @@ -1,108 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, wheel, door1, door2, top, sfxpoint1; - -static-var statechg_DesiredState, statechg_StateChanging, maeksmoke; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - - -Smoke() -{ - while( TRUE ) - { - if (maeksmoke) - { - emit-sfx 1025 from sfxpoint1; - sleep 500; - } - sleep 500; - } -} - -Smoke2() -{ - while( TRUE ) - { - if (maeksmoke) - { - emit-sfx 1026 from sfxpoint1; - sleep 500; - } - sleep 500; - } -} - -Create() -{ - call-script InitState(); - start-script SmokeUnit(); - start-script Smoke(); - start-script Smoke2(); - turn sfxpoint1 to x-axis <-90> now; -} - - - -Activate() -{ - maeksmoke=1; - turn door1 to x-axis <-90> speed <100>; - turn door2 to x-axis <90> speed <100>; - spin wheel around y-axis speed <100.005495>; - move top to y-axis [8] speed [3]; -} - -Deactivate() -{ - maeksmoke=0; - turn door1 to x-axis <0> speed <10>; - turn door2 to x-axis <0> speed <10>; - stop-spin wheel around y-axis decelerate <30.000000>; - move top to y-axis [0] speed [5]; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode wheel type EXPLODE_ON_HIT; - explode door1 type EXPLODE_ON_HIT; - explode door2 type EXPLODE_ON_HIT; - explode top type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/emaker.cob b/Scripts/emaker.cob deleted file mode 100644 index 06183dc35..000000000 Binary files a/Scripts/emaker.cob and /dev/null differ diff --git a/Scripts/emaker2.bos b/Scripts/emaker2.bos deleted file mode 100644 index 4493a100f..000000000 --- a/Scripts/emaker2.bos +++ /dev/null @@ -1,102 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, accents, rings, struts, sfxpoint1, sfxpoint2, sfxpoint3; - -static-var statechg_DesiredState, statechg_StateChanging, maeksmoke; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - - -Smoke() -{ - while( TRUE ) - { - if (maeksmoke) - { - emit-sfx 1025 from sfxpoint2; - emit-sfx 1025 from sfxpoint3; - sleep 100; - } - sleep 500; - } -} - -Smoke2() -{ - while( TRUE ) - { - if (maeksmoke) - { - emit-sfx 1026 from sfxpoint1; - sleep 500; - } - sleep 500; - } -} - -Create() -{ - call-script InitState(); - start-script SmokeUnit(); - start-script Smoke(); - start-script Smoke2(); - turn sfxpoint1 to x-axis <-90> now; - turn sfxpoint3 to x-axis <180> now; -} - - - -Activate() -{ - maeksmoke=1; -} - -Deactivate() -{ - maeksmoke=0; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; - explode accents type EXPLODE_ON_HIT; - explode rings type EXPLODE_ON_HIT; - explode struts type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/emaker2.cob b/Scripts/emaker2.cob deleted file mode 100644 index 50a5b7796..000000000 Binary files a/Scripts/emaker2.cob and /dev/null differ diff --git a/Scripts/emaker3.bos b/Scripts/emaker3.bos index 31a8a2c13..cc604dfbf 100644 --- a/Scripts/emaker3.bos +++ b/Scripts/emaker3.bos @@ -49,9 +49,9 @@ Smoke() if (maeksmoke) { emit-sfx 1025 from sfxpoint2; - emit-sfx 1025 from sfxpoint3; - emit-sfx 1025 from sfxpoint4; - emit-sfx 1025 from sfxpoint5; + emit-sfx 1026 from sfxpoint3; + emit-sfx 1027 from sfxpoint4; + emit-sfx 1028 from sfxpoint5; sleep 100; } sleep 500; @@ -64,7 +64,7 @@ Smoke2() { if (maeksmoke) { - emit-sfx 1026 from sfxpoint1; + emit-sfx 1029 from sfxpoint1; sleep 500; } sleep 500; diff --git a/Scripts/emaker3.cob b/Scripts/emaker3.cob index 9979b0259..a6f4c6672 100644 Binary files a/Scripts/emaker3.cob and b/Scripts/emaker3.cob differ diff --git a/Scripts/emediumgen.bos b/Scripts/emediumgen.bos new file mode 100644 index 000000000..b54173a41 --- /dev/null +++ b/Scripts/emediumgen.bos @@ -0,0 +1,102 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, sfxpoint1, pylon1, pylon2, pylon3, pylon4, pylon5, pylon6, pipes; + +static-var Static_Var_1, tech; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +fx() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1025 from sfxpoint1; +// } + sleep 500; + } +} + + +fx2() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1026 from sfxpoint1; +// } + sleep 500; + } +} + +Create() +{ + start-script fx(); + start-script fx2(); + turn sfxpoint1 to x-axis <-90> now; + start-script SmokeUnit(); +} +/* +TechLost() +{ + set ACTIVATION to 0; + tech=FALSE; +} + +TechGranted() +{ + set ACTIVATION to 1; + tech=TRUE; +} +*/ +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode pylon1 type EXPLODE_ON_HIT; + explode pylon2 type EXPLODE_ON_HIT; + explode pylon3 type EXPLODE_ON_HIT; + explode pylon4 type EXPLODE_ON_HIT; + explode pylon5 type EXPLODE_ON_HIT; + explode pylon6 type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/emediumgen.cob b/Scripts/emediumgen.cob new file mode 100644 index 000000000..b1dd600f0 Binary files /dev/null and b/Scripts/emediumgen.cob differ diff --git a/Scripts/emediumlaserplatform.cob b/Scripts/emediumlaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/emediumlaserplatform.cob and /dev/null differ diff --git a/Scripts/emediumlaserplatform2.cob b/Scripts/emediumlaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/emediumlaserplatform2.cob and /dev/null differ diff --git a/Scripts/emediumtank.bos b/Scripts/emediumtank.bos deleted file mode 100644 index 487feb544..000000000 --- a/Scripts/emediumtank.bos +++ /dev/null @@ -1,149 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/emediumtank.cob b/Scripts/emediumtank.cob deleted file mode 100644 index 38352bb5b..000000000 Binary files a/Scripts/emediumtank.cob and /dev/null differ diff --git a/Scripts/emediumtank2.bos b/Scripts/emediumtank2.bos deleted file mode 100644 index 487feb544..000000000 --- a/Scripts/emediumtank2.bos +++ /dev/null @@ -1,149 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/emediumtank2.cob b/Scripts/emediumtank2.cob deleted file mode 100644 index 38352bb5b..000000000 Binary files a/Scripts/emediumtank2.cob and /dev/null differ diff --git a/Scripts/emediumtank3.bos b/Scripts/emediumtank3.bos deleted file mode 100644 index 6b909046c..000000000 --- a/Scripts/emediumtank3.bos +++ /dev/null @@ -1,154 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, dirt; // these are the pieces of the model - -#include "ROCKUNIT.H" - -static-var terraintype, bmoving, moving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/emediumtank3.cob b/Scripts/emediumtank3.cob deleted file mode 100644 index 4f23899b0..000000000 Binary files a/Scripts/emediumtank3.cob and /dev/null differ diff --git a/Scripts/emetalextractormk1.bos b/Scripts/emetalextractormk1.bos new file mode 100644 index 000000000..3581cd736 --- /dev/null +++ b/Scripts/emetalextractormk1.bos @@ -0,0 +1,165 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, pivotpoint, sfxpoint1, armleft, armright, armfront, armrear, tech1, tech2, tech3, tech4; + +static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging, ball1state, ball2state, ball3state, ball4state, ballstate; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Go() +{ + spin pivotpoint around y-axis speed <50> accelerate <10>; + ballstate = 1; + turn armfront to x-axis <60> speed <15>; + turn armrear to x-axis <-60> speed <15>; + turn armleft to z-axis <60> speed <15>; + turn armright to z-axis <-60> speed <15>; +} + +Stop() +{ + stop-spin pivotpoint around y-axis decelerate <25>; + wait-for-turn pivotpoint around y-axis; + ballstate = 0; + turn armfront to x-axis <0> speed <50>; + turn armrear to x-axis <0> speed <50>; + turn armleft to z-axis <0> speed <50>; + turn armright to z-axis <0> speed <50>; +} + +InitState() +{ + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState == 0 ) + { + call-script Go(); + currentstate = 0; + } + if( statechg_DesiredState == 1 ) + { + call-script Stop(); + currentstate = 1; + } + } + statechg_StateChanging = FALSE; +} + + + +fx() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1027 from tech1; +// } + sleep 500; + } +} + + +fx2() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1026 from sfxpoint1; +// } + sleep 500; + } +} + + +Create() +{ + start-script fx(); + start-script fx2(); + hide tech2; + hide tech3; + hide tech4; + Static_Var_1 = 0; + Static_Var_2 = 75; + Static_Var_3 = 50; + turn sfxpoint1 to x-axis <-90> now; + call-script InitState(); + start-script SmokeUnit(); +} + +Activate() +{ + start-script RequestState(0); +} + +Deactivate() +{ + start-script RequestState(1); +} + + +SetSpeed(Func_Var_1) +{ + Static_Var_1 = Func_Var_1 * 5; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode armleft type EXPLODE_ON_HIT; + explode armright type EXPLODE_ON_HIT; + explode armfront type EXPLODE_ON_HIT; + explode armrear type EXPLODE_ON_HIT; +} diff --git a/Scripts/emetalextractormk1.cob b/Scripts/emetalextractormk1.cob new file mode 100644 index 000000000..7e91d06dd Binary files /dev/null and b/Scripts/emetalextractormk1.cob differ diff --git a/Scripts/emetalextractornk1.cob b/Scripts/emetalextractornk1.cob new file mode 100644 index 000000000..7e91d06dd Binary files /dev/null and b/Scripts/emetalextractornk1.cob differ diff --git a/Scripts/emex.cob b/Scripts/emex.cob deleted file mode 100644 index 01ae649c1..000000000 Binary files a/Scripts/emex.cob and /dev/null differ diff --git a/Scripts/emex2.bos b/Scripts/emex2.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/emex2.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/emex2.cob b/Scripts/emex2.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/emex2.cob and /dev/null differ diff --git a/Scripts/emex2up1.bos b/Scripts/emex2up1.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/emex2up1.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/emex2up1.cob b/Scripts/emex2up1.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/emex2up1.cob and /dev/null differ diff --git a/Scripts/emex2up2.bos b/Scripts/emex2up2.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/emex2up2.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/emex2up2.cob b/Scripts/emex2up2.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/emex2up2.cob and /dev/null differ diff --git a/Scripts/emex2up3.bos b/Scripts/emex2up3.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/emex2up3.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/emex2up3.cob b/Scripts/emex2up3.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/emex2up3.cob and /dev/null differ diff --git a/Scripts/emexmoho.cob b/Scripts/emexmoho.cob deleted file mode 100644 index 01ae649c1..000000000 Binary files a/Scripts/emexmoho.cob and /dev/null differ diff --git a/Scripts/emine.bos b/Scripts/emine.bos index e4989d401..ddb8f8b63 100644 --- a/Scripts/emine.bos +++ b/Scripts/emine.bos @@ -3,9 +3,8 @@ #include "sfxtype.h" #include "exptype.h" -piece base, spinner; // these are the pieces of the model -static-var CanFire; +piece base, spinner; // these are the pieces of the model // Signal definitions #define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag @@ -14,31 +13,8 @@ static-var CanFire; // Custom SFX #define GDMARTY 1024+0 -SmokeUnit()// this is a standard smoke point define -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - Create() // tells it what to do on creation { - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); spin spinner around y-axis speed <20>; } @@ -63,7 +39,7 @@ AimFromWeapon1(piecenum) // where it aims the weapon from QueryWeapon1(piecenum) // where the shot is created at { - piecenum=spinner; + piecenum=spinner; } diff --git a/Scripts/emine.cob b/Scripts/emine.cob index 3ac7b2448..332992d7a 100644 Binary files a/Scripts/emine.cob and b/Scripts/emine.cob differ diff --git a/Scripts/emissilesiloemp.cob b/Scripts/emissilesiloemp.cob deleted file mode 100644 index 182790095..000000000 Binary files a/Scripts/emissilesiloemp.cob and /dev/null differ diff --git a/Scripts/emissiletank.bos b/Scripts/emissiletank.bos deleted file mode 100644 index 2f496c952..000000000 --- a/Scripts/emissiletank.bos +++ /dev/null @@ -1,170 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, firepoint2, sfxpoint1; // these are the pieces of the model - -static-var gun_1, terraintype, bmoving, moving, shooting_num; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from sfxpoint1; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn barrel1 to x-axis <-90> speed <800>; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - - if(shooting_num==1) - { - emit-sfx 1024 from firepoint2; - } - - if(shooting_num==2) - { - emit-sfx 1024 from firepoint1; - } - - shooting_num=shooting_num+1; - - if( shooting_num == 3) - { - shooting_num=1; - } -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if (shooting_num==1) - { - piecenum=firepoint1; - } - - if (shooting_num==2) - { - piecenum=firepoint2; - } -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; -} diff --git a/Scripts/emissiletank.cob b/Scripts/emissiletank.cob deleted file mode 100644 index 92df7722d..000000000 Binary files a/Scripts/emissiletank.cob and /dev/null differ diff --git a/Scripts/emissletank.cob b/Scripts/emissletank.cob deleted file mode 100644 index 87170db17..000000000 Binary files a/Scripts/emissletank.cob and /dev/null differ diff --git a/Scripts/emptower.bos b/Scripts/emptower.bos deleted file mode 100644 index 058a85cdb..000000000 --- a/Scripts/emptower.bos +++ /dev/null @@ -1,217 +0,0 @@ -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - -static-var firing; // these are the variables - -#define ELECTRICITY 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 -#define SIG_AIM_8 16 -#define SIG_AIM_16 32 -#define SIG_AIM_32 64 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -LightningThing() -{ -while (1) -{ -emit-sfx ELECTRICITY from firepoint1; -sleep 500; -} -} - -Create() // tells it what to do on creation -{ -start-script LightningThing(); -start-script SmokeUnit(); -} - - -AimWeapon1(heading, pitch) -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() -{ -} - -AimFromWeapon2(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon2(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon3(heading, pitch) -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon3() -{ -} - -AimFromWeapon3(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon3(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon4(heading, pitch) -{ -signal SIG_AIM_8; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon4() -{ -} - -AimFromWeapon4(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon4(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon5(heading, pitch) -{ -signal SIG_AIM_16; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon5() -{ -} - -AimFromWeapon5(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon5(piecenum) -{ -piecenum = firepoint1; -} - - -AimWeapon6(heading, pitch) -{ -signal SIG_AIM_32; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon6() -{ -} - -AimFromWeapon6(piecenum) -{ -piecenum = firepoint1; -} - -QueryWeapon6(piecenum) -{ -piecenum = firepoint1; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} \ No newline at end of file diff --git a/Scripts/emptower.cob b/Scripts/emptower.cob deleted file mode 100644 index b5413f42d..000000000 Binary files a/Scripts/emptower.cob and /dev/null differ diff --git a/Scripts/energycore.lua b/Scripts/energycore.lua new file mode 100644 index 000000000..2c28b43f3 --- /dev/null +++ b/Scripts/energycore.lua @@ -0,0 +1,23 @@ +local base = piece "base" +local f = 0 +local x = ((math.floor((math.random()*180)/90))*90)* math.pi / 180 +local z = ((math.floor((math.random()*180)/90))*90)* math.pi / 180 +local y = ((math.floor((math.random()*180)/90))*90)* math.pi / 180 + +function script.Create() + Turn (base, x_axis, x, x/1.25) + Turn (base, z_axis, z, z/1.25) + Turn (base, y_axis, y, y/1.25) +end + +function Sink() + StartThread(MoveDown) +end + +function MoveDown() + while f > -900 do + Move(base, 2, f) + f = f - 0.05 + Sleep(1) + end +end \ No newline at end of file diff --git a/Scripts/engineer.bos b/Scripts/engineer.bos deleted file mode 100644 index 09d1977a4..000000000 --- a/Scripts/engineer.bos +++ /dev/null @@ -1,219 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece engineer, nano1, nano2, nano3; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype; - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from engineer; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - turn engineer to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn engineer around y-axis; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn engineer to y-axis <0.000000> speed <160.000000>; - wait-for-turn engineer around y-axis; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from engineer; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move engineer to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move engineer to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move engineer to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move engineer to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -StartBuilding(Func_Var_1) -{ - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nano1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nano2; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nano3; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -SweetSpot(piecenum) -{ - piecenum = engineer; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode engineer type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode engineer type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode engineer type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode engineer type BITMAPONLY | BITMAP2; -} diff --git a/Scripts/engineermarbuk.cob b/Scripts/engineermarbuk.cob deleted file mode 100644 index 384544336..000000000 Binary files a/Scripts/engineermarbuk.cob and /dev/null differ diff --git a/Scripts/eorb.bos b/Scripts/eorb.bos deleted file mode 100644 index d6365ddc9..000000000 --- a/Scripts/eorb.bos +++ /dev/null @@ -1,241 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, ring, turret, barrel1, nano1, sfxpoint1, dirt; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building, moving; - -#define nanoflame 1024+0 -#define SIG_AIM_2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Buildingfx() -{ - while(building) - { - - emit-sfx 2048 from nano1; - - sleep 5; - } -} - -buildflame() -{ - while(building) - { - - emit-sfx nanoflame from nano1; - - sleep 600; - } -} - -Go() -{ - turn turret to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn turret around y-axis; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn turret to y-axis <0.000000> speed <160.000000>; - wait-for-turn turret around y-axis; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = dirt; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = dirt; -} - - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script Thrust(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); - spin ring around y-axis speed <100>; - start-script Buildingfx(); - start-script buildflame(); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); - stop-spin ring around y-axis decelerate <15>; -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nano1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nano1; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nano1; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode base type EXPLODE_ON_HIT; - explode ring type EXPLODE_ON_HIT; -} diff --git a/Scripts/eorb.cob b/Scripts/eorb.cob deleted file mode 100644 index d178ede8a..000000000 Binary files a/Scripts/eorb.cob and /dev/null differ diff --git a/Scripts/eorb2.bos b/Scripts/eorb2.bos deleted file mode 100644 index 99283bf84..000000000 --- a/Scripts/eorb2.bos +++ /dev/null @@ -1,205 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, fins, nanopoint1; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building, moving; - -#define nanoflame 1024+0 -#define SIG_AIM_2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1026 from fins; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -buildflame() -{ - while(building) - { - - emit-sfx nanoflame from nanopoint1; - - sleep 600; - } -} - -Go() -{ -/* turn turret to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn turret around y-axis; */ - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ -/* turn turret to y-axis <0.000000> speed <160.000000>; - wait-for-turn turret around y-axis; */ - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from base; - } - sleep 400; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script Thrust(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); - spin fins around y-axis speed <100>; -/* start-script Buildingfx(); */ - start-script buildflame(); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); - stop-spin fins around y-axis decelerate <15>; -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nanopoint1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nanopoint1; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nanopoint1; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; - moving=1; -} - -StopMoving() -{ - bMoving = FALSE; - moving=0; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode fins type EXPLODE_ON_HIT; -} diff --git a/Scripts/eorb2.cob b/Scripts/eorb2.cob deleted file mode 100644 index 228cad683..000000000 Binary files a/Scripts/eorb2.cob and /dev/null differ diff --git a/Scripts/eorb3.bos b/Scripts/eorb3.bos index aba2c66aa..4ca7e3629 100644 --- a/Scripts/eorb3.bos +++ b/Scripts/eorb3.bos @@ -134,6 +134,7 @@ Thrust() Create() { + move base to y-axis [8] now; Static_Var_3 = 0; Static_Var_1 = 0; call-script InitState(); diff --git a/Scripts/eorb3.cob b/Scripts/eorb3.cob index 00d5360c0..2fa5144c3 100644 Binary files a/Scripts/eorb3.cob and b/Scripts/eorb3.cob differ diff --git a/Scripts/eradar.cob b/Scripts/eradar.cob deleted file mode 100644 index 1d1feecab..000000000 Binary files a/Scripts/eradar.cob and /dev/null differ diff --git a/Scripts/eradar2.bos b/Scripts/eradar2.bos deleted file mode 100644 index ff784ebd8..000000000 --- a/Scripts/eradar2.bos +++ /dev/null @@ -1,66 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top; - -static-var statechg_DesiredState, statechg_StateChanging; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -radaranimation() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - spin top around y-axis speed <25> accelerate <5>; -sleep 400; -} -} -} - - -Create() -{ - start-script radaranimation(); - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode top type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/eradar2.cob b/Scripts/eradar2.cob deleted file mode 100644 index 8ee5a3a75..000000000 Binary files a/Scripts/eradar2.cob and /dev/null differ diff --git a/Scripts/eraider.bos b/Scripts/eraider.bos new file mode 100644 index 000000000..66da246b2 --- /dev/null +++ b/Scripts/eraider.bos @@ -0,0 +1,134 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, frontengines, fengine1, fengine2, rearengines, rengine1, rengine2, turret, barrel1, firepoint1; + +static-var moving, flames; + +#define jethtrail 1024+0 + +// Signal definitions +#define SIG_AIM 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx jethtrail from fengine1; + emit-sfx jethtrail from fengine2; + emit-sfx jethtrail from rengine1; + emit-sfx jethtrail from rengine2; + } + sleep 5; + } +} + +StartMoving() +{ + moving=1; +} + +StopMoving() +{ + moving=0; +} + +MoveRate0() +{ + flames=0; + turn frontengines to x-axis <-90.000000> speed <150.000000>; + turn rearengines to x-axis <-90.000000> speed <150.000000>; +} +MoveRate1() +{ + flames=0; + turn frontengines to x-axis <-70.005495> speed <150.000000>; + turn rearengines to x-axis <-70.005495> speed <150.000000>; +} +MoveRate2() +{ + flames=1; + turn frontengines to x-axis <0.000000> speed <150.000000>; + turn rearengines to x-axis <0.000000> speed <150.000000>; +} + +Create() + { +// start-script Thrust(); + start-script SmokeUnit(); + } + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ + sleep 3000; + turn turret to y-axis <0> speed <60>; + turn barrel1 to x-axis <0> speed <30>; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn turret to y-axis heading speed <500>; + turn barrel1 to x-axis <0> - pitch speed <500>; + wait-for-turn turret around y-axis; + wait-for-turn barrel1 around x-axis; + start-script RestoreAfterDelay(); + return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 1024 + 0 from firepoint1; +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ + piecenum = turret; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ + piecenum = firepoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode frontengines type EXPLODE_ON_HIT; + explode rearengines type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/eraider.cob b/Scripts/eraider.cob new file mode 100644 index 000000000..4baf099d4 Binary files /dev/null and b/Scripts/eraider.cob differ diff --git a/Scripts/eresearch.cob b/Scripts/eresearch.cob deleted file mode 100644 index c0e97da71..000000000 Binary files a/Scripts/eresearch.cob and /dev/null differ diff --git a/Scripts/eriottank.bos b/Scripts/eriottank.bos deleted file mode 100644 index 2c929a67c..000000000 --- a/Scripts/eriottank.bos +++ /dev/null @@ -1,147 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1; // these are the pieces of the model - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -#define SIG_AIM 2 // this is a aim define - -static-var terraintype, bmoving; // these are the variables - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn turret to y-axis <0> speed <30>; -turn turret to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <30>; -turn turret to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/eriottank.cob b/Scripts/eriottank.cob deleted file mode 100644 index ef47a2920..000000000 Binary files a/Scripts/eriottank.cob and /dev/null differ diff --git a/Scripts/eriottank2.bos b/Scripts/eriottank2.bos deleted file mode 100644 index ab56a40d8..000000000 --- a/Scripts/eriottank2.bos +++ /dev/null @@ -1,182 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1, dirt, magazine, barrel1; // these are the pieces of the model - -#include "ROCKUNIT.H" - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -#define SIG_AIM 2 // this is a aim define - -static-var terraintype, bmoving, moving; // these are the variables - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1026 from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn turret to y-axis <0> speed <255>; -turn barrel1 to x-axis <0> speed <255>; -stop-spin magazine around z-axis decelerate <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <255>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -spin magazine around z-axis speed <100>; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -// start-script RestoreAfterDelay(); -spin magazine around z-axis speed <100>; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode barrel1 type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode magazine type EXPLODE_ON_HIT; -} diff --git a/Scripts/eriottank2.cob b/Scripts/eriottank2.cob deleted file mode 100644 index a329602c2..000000000 Binary files a/Scripts/eriottank2.cob and /dev/null differ diff --git a/Scripts/eriottank3.bos b/Scripts/eriottank3.bos index b951ffeba..1d36de004 100644 --- a/Scripts/eriottank3.bos +++ b/Scripts/eriottank3.bos @@ -125,8 +125,8 @@ AimPrimary(heading, pitch) // single weapon with 2 fires this tell sit what to d if(!WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <255>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); @@ -161,8 +161,8 @@ AimSecondary(heading, pitch) // single weapon with 2 fires this tell sit what to if(WeaponTypeSelect OR (get WEAPON_RELOADSTATE(2) > get GAME_FRAME)) return (0); signal SIG_AIM; set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <255>; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; wait-for-turn turret around y-axis; wait-for-turn barrel1 around x-axis; start-script RestoreAfterDelay(); diff --git a/Scripts/eriottank3.cob b/Scripts/eriottank3.cob index be3dfa79c..82c5d6b04 100644 Binary files a/Scripts/eriottank3.cob and b/Scripts/eriottank3.cob differ diff --git a/Scripts/escout.bos b/Scripts/escout.bos deleted file mode 100644 index 3ae29cefd..000000000 --- a/Scripts/escout.bos +++ /dev/null @@ -1,75 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, flare; - -static-var moving; - -#define jethtrail 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from flare; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - - -Create() - { -// turn flare to y-axis <180> now; -// start-script Thrust(); - start-script SmokeUnit(); - } - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; -} \ No newline at end of file diff --git a/Scripts/escout.cob b/Scripts/escout.cob deleted file mode 100644 index d6f443de7..000000000 Binary files a/Scripts/escout.cob and /dev/null differ diff --git a/Scripts/eshieldgen.bos b/Scripts/eshieldgen.bos deleted file mode 100644 index 2bfadf721..000000000 --- a/Scripts/eshieldgen.bos +++ /dev/null @@ -1,150 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, ring; // these are the pieces of the model - -static-var terraintype, bmoving, moving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx 1024 from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2050 from firepoint1; - sleep 30; - } -} - - -Create() // tells it what to do on creation -{ - start-script SmokeUnit(); -// start-script fx(); - - spin ring around y-axis speed <150.005495>; -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <-90> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = base; -} - -/* -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx 2049 from firepoint1; -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} -*/ - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode turret type EXPLODE_ON_HIT; - explode barrel1 type EXPLODE_ON_HIT; - explode ring type EXPLODE_ON_HIT; -} diff --git a/Scripts/eshieldgen.cob b/Scripts/eshieldgen.cob deleted file mode 100644 index 422cbeded..000000000 Binary files a/Scripts/eshieldgen.cob and /dev/null differ diff --git a/Scripts/eshieldgen2.bos b/Scripts/eshieldgen2.bos new file mode 100644 index 000000000..57fc4bc74 --- /dev/null +++ b/Scripts/eshieldgen2.bos @@ -0,0 +1,147 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, firepoint1, spinner; // these are the pieces of the model + +static-var terraintype, bmoving, moving; // these are the variables + +// #define gdscannon 1024+0 // this is a custom explosion generator thinging + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 // this is a aim define + +SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define +{ +while( get BUILD_PERCENT_LEFT ) +{ +sleep 400; +} +while( TRUE ) +{ +healthpercent = get HEALTH; +if( healthpercent < 66 ) +{ +smoketype = 256 | 2; +if( Rand( 1, 66 ) < healthpercent ) +{ +smoketype = 256 | 1; +} +emit-sfx 1024 from spinner; +} +sleeptime = healthpercent * 50; +if( sleeptime < 200 ) +{ +sleeptime = 200; +} +sleep sleeptime; +} +} + + +fx() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + emit-sfx 2050 from firepoint1; + sleep 30; + } +} + + +Create() // tells it what to do on creation +{ + start-script SmokeUnit(); +// start-script fx(); + + spin spinner around y-axis speed <150.005495>; +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = firepoint1; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ +piecenum = firepoint1; +} + +AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +return (1); +} + +FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon2(piecenum) // where it aims the weapon from +{ +piecenum = base; +} + +QueryWeapon2(piecenum) // where the shot is called from +{ +piecenum = base; +} + +/* +AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM_2; +set-signal-mask SIG_AIM_2; +turn turret to y-axis heading speed <255>; +turn barrel1 to x-axis <0> - pitch speed <150>; +wait-for-turn turret around y-axis; +wait-for-turn barrel1 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 2049 from firepoint1; +} + +AimFromWeapon3(piecenum) // where it aims the weapon from +{ +piecenum = barrel1; +} + +QueryWeapon3(piecenum) // where the shot is called from +{ +piecenum = firepoint1; +} +*/ + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode spinner type EXPLODE_ON_HIT; +} diff --git a/Scripts/eshieldgen2.cob b/Scripts/eshieldgen2.cob new file mode 100644 index 000000000..cacf2bf33 Binary files /dev/null and b/Scripts/eshieldgen2.cob differ diff --git a/Scripts/esilo.bos b/Scripts/esilo.bos deleted file mode 100644 index 848f7b3b7..000000000 --- a/Scripts/esilo.bos +++ /dev/null @@ -1,121 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, wheel1, wheel2, door1, door2, nuke, firepoint1, sfxpoint1; // these are the pieces of the model - -static-var CanFire; - -// Signal definitions -#define SIG_AIM 2 - -SmokeUnit()// this is a standard smoke point define -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -cannotfire() -{ - while( TRUE ) - { - if (!CanFire) - { - emit-sfx 1024 from sfxpoint1; - } - sleep 1500; - } -} - -Create() // tells it what to do on creation -{ - CanFire=FALSE; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); - start-script cannotfire(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -stop-spin wheel1 around z-axis decelerate <5.000000>; -stop-spin wheel2 around z-axis decelerate <5.000000>; - turn door1 to z-axis <0> speed <50>; - turn door2 to z-axis <0> speed <50>; - move nuke to y-axis [0] speed [10]; - wait-for-turn door1 around z-axis; - wait-for-turn door2 around z-axis; - wait-for-move nuke along y-axis; - show nuke; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; - while(!CanFire) - sleep 200; - turn door1 to z-axis <90> speed <100>; - turn door2 to z-axis <-90> speed <100>; - spin wheel1 around z-axis speed <100.005495>; - spin wheel2 around z-axis speed <100.005495>; - move nuke to y-axis [40] speed [10]; - wait-for-turn door1 around z-axis; - wait-for-turn door2 around z-axis; - wait-for-move nuke along y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -hide nuke; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -TechLost() -{ - CanFire=FALSE; - signal SIG_AIM; - -} - -TechGranted() -{ - CanFire=TRUE; -} - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode wheel1 type EXPLODE_ON_HIT; - explode wheel2 type EXPLODE_ON_HIT; - explode door1 type EXPLODE_ON_HIT; - explode door2 type EXPLODE_ON_HIT; - explode nuke type EXPLODE_ON_HIT; -} diff --git a/Scripts/esilo.cob b/Scripts/esilo.cob deleted file mode 100644 index f07bf2c20..000000000 Binary files a/Scripts/esilo.cob and /dev/null differ diff --git a/Scripts/esilo2.bos b/Scripts/esilo2.bos new file mode 100644 index 000000000..84c1ea070 --- /dev/null +++ b/Scripts/esilo2.bos @@ -0,0 +1,91 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, pylon1, pylon2, pylon3, pylon4, upright1, upright2, pipes, lilypad, firepoint1, sfxpoint1; // these are the pieces of the model + +static-var steaming; // these are the variables + +// Signal definitions +#define SIG_AIM 2 + +SmokeUnit()// this is a standard smoke point define +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + +Steam() +{ + while( TRUE ) + { + if (steaming) + { + emit-sfx 1026 + 0 from sfxpoint1; + } + sleep 128; + } +} + +Create() // tells it what to do on creation +{ + start-script SmokeUnit(); + start-script Steam(); + steaming=TRUE; +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +start-script RestoreAfterDelay(); +start-script Steam(); +return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = base; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ +piecenum = firepoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode pylon1 type EXPLODE_ON_HIT; + explode pylon2 type EXPLODE_ON_HIT; + explode pylon3 type EXPLODE_ON_HIT; + explode pylon4 type EXPLODE_ON_HIT; + explode upright1 type EXPLODE_ON_HIT; + explode upright2 type EXPLODE_ON_HIT; + explode lilypad type EXPLODE_ON_HIT; + explode base type EXPLODE_ON_HIT; +} diff --git a/Scripts/esilo2.cob b/Scripts/esilo2.cob new file mode 100644 index 000000000..e28d9f809 Binary files /dev/null and b/Scripts/esilo2.cob differ diff --git a/Scripts/esolar.bos b/Scripts/esolar.bos deleted file mode 100644 index 3ae3c8d89..000000000 --- a/Scripts/esolar.bos +++ /dev/null @@ -1,71 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece solar; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from solar; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Create() -{ - - start-script SmokeUnit(); -} - -SweetSpot(piecenum) -{ - piecenum = solar; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode solar type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode solar type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode solar type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode solar type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/esolar.cob b/Scripts/esolar.cob deleted file mode 100644 index 928ea393c..000000000 Binary files a/Scripts/esolar.cob and /dev/null differ diff --git a/Scripts/especialfactory.cob b/Scripts/especialfactory.cob deleted file mode 100644 index 6496ec6c0..000000000 Binary files a/Scripts/especialfactory.cob and /dev/null differ diff --git a/Scripts/estealthbomber.bos b/Scripts/estealthbomber.bos deleted file mode 100644 index 9270b3b84..000000000 --- a/Scripts/estealthbomber.bos +++ /dev/null @@ -1,143 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, flare1; - -static-var gun_1, gun_2, moving; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -#define jethtrail 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from flare1; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Create() - { - start-script Thrust(); - turn flare1 to y-axis <180> now; - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/estealthbomber.cob b/Scripts/estealthbomber.cob deleted file mode 100644 index f6336426c..000000000 Binary files a/Scripts/estealthbomber.cob and /dev/null differ diff --git a/Scripts/estealthbomber2.bos b/Scripts/estealthbomber2.bos deleted file mode 100644 index 37ea07c12..000000000 --- a/Scripts/estealthbomber2.bos +++ /dev/null @@ -1,143 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, flare1; - -static-var gun_1, gun_2, moving; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -#define jethtrail 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx jethtrail from flare1; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Create() - { - start-script Thrust(); - turn flare1 to y-axis <180> now; - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/estealthbomber2.cob b/Scripts/estealthbomber2.cob deleted file mode 100644 index f6336426c..000000000 Binary files a/Scripts/estealthbomber2.cob and /dev/null differ diff --git a/Scripts/estorage.bos b/Scripts/estorage.bos deleted file mode 100644 index 5f8031018..000000000 --- a/Scripts/estorage.bos +++ /dev/null @@ -1,86 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, sfxpoint1; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1024 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1025 from sfxpoint1; -// } - sleep 500; - } -} - - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1026 from sfxpoint1; -// } - sleep 500; - } -} - - -Create() -{ - start-script fx(); - start-script fx2(); - turn sfxpoint1 to x-axis <-90> now; - spin top around y-axis speed <50.005495>; - start-script SmokeUnit(); -} - - - -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; -} diff --git a/Scripts/estorage.cob b/Scripts/estorage.cob deleted file mode 100644 index 53869106b..000000000 Binary files a/Scripts/estorage.cob and /dev/null differ diff --git a/Scripts/estorage2.bos b/Scripts/estorage2.bos index 9e0fa44e5..12066ff44 100644 --- a/Scripts/estorage2.bos +++ b/Scripts/estorage2.bos @@ -46,7 +46,7 @@ fx() // if (tech) // { emit-sfx 1025 from sfxpoint1; - emit-sfx 1025 from sfxpoint3; + emit-sfx 1026 from sfxpoint3; // } sleep 500; } @@ -63,7 +63,7 @@ fx2() { // if (tech) // { - emit-sfx 1026 from sfxpoint2; + emit-sfx 1027 from sfxpoint2; // } sleep 500; } diff --git a/Scripts/estorage2.cob b/Scripts/estorage2.cob index 7f4558323..6aa111587 100644 Binary files a/Scripts/estorage2.cob and b/Scripts/estorage2.cob differ diff --git a/Scripts/esubmarine.bos b/Scripts/esubmarine.bos deleted file mode 100644 index 619667ddd..000000000 --- a/Scripts/esubmarine.bos +++ /dev/null @@ -1,124 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, rightwing, leftwing, rearrightwing, rearleftwing, firepoint1, engines; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 - -#define flame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from engines; - - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Create() - { - start-script SmokeUnit(); -// move base to y-axis [10] speed [5]; -// emit-sfx 1025 + 0 from base; - turn engines to y-axis <180> now; - turn rearrightwing to z-axis <90> speed <10>; - turn rearleftwing to z-axis <-90> speed <10>; - turn rightwing to y-axis <-90> speed <10>; - turn leftwing to y-axis <90> speed <10>; - start-script Thrust(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/esubmarine.cob b/Scripts/esubmarine.cob deleted file mode 100644 index b49f67ec7..000000000 Binary files a/Scripts/esubmarine.cob and /dev/null differ diff --git a/Scripts/esubplane.bos b/Scripts/esubplane.bos deleted file mode 100644 index ea5b95562..000000000 --- a/Scripts/esubplane.bos +++ /dev/null @@ -1,118 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, rightwing, leftwing, rearrightwing, rearleftwing, firepoint1, engines; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 - -#define flame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from engines; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Create() - { - start-script SmokeUnit(); -// turn engines to y-axis <180> now; -// start-script Thrust(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/esubplane.cob b/Scripts/esubplane.cob deleted file mode 100644 index cda8f5daa..000000000 Binary files a/Scripts/esubplane.cob and /dev/null differ diff --git a/Scripts/etransport.bos b/Scripts/etransport.bos deleted file mode 100644 index 498441bf4..000000000 --- a/Scripts/etransport.bos +++ /dev/null @@ -1,156 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, link, engine1, engine2, wingsfront, wingsrear, tail; - -static-var Static_Var_1, unitviewer, statechg_DesiredState, statechg_StateChanging, moving; - -// Signal definitions -#define SIG_MOVE 4 -#define flame 1024+0 - - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx 1025 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from engine1; - emit-sfx flame from engine2; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -MoveRate0() -{ - turn tail to x-axis <-90.000000> speed <150.000000>; - turn wingsfront to x-axis <-90.000000> speed <150.000000>; - turn wingsrear to x-axis <-90.000000> speed <150.000000>; -} -MoveRate1() -{ - - turn wingsfront to x-axis <-70.005495> speed <150.000000>; - turn wingsrear to x-axis <-70.005495> speed <150.000000>; -} -MoveRate2() -{ - turn tail to x-axis <0.000000> speed <150.000000>; - turn wingsfront to x-axis <0.000000> speed <150.000000>; - turn wingsrear to x-axis <0.000000> speed <150.000000>; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - unitviewer = FALSE; - call-script InitState(); -// turn engine1 to y-axis <180> now; -// turn engine2 to y-axis <180> now; - turn tail to x-axis <-90> now; - turn wingsfront to x-axis <-90> now; - turn wingsrear to x-axis <-90> now; -// start-script Thrust(); - start-script SmokeUnit(); -} - -QueryTransport(Func_Var_1) -{ - Func_Var_1 = 1; -} - -BeginTransport(Func_Var_1) -{ - move link to y-axis [0.000000] - Func_Var_1 now; -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -EndTransport() -{ -} - -Killed(severity, corpsetype) // how it explodes -{ - -} diff --git a/Scripts/etransport.cob b/Scripts/etransport.cob deleted file mode 100644 index 48b5dd614..000000000 Binary files a/Scripts/etransport.cob and /dev/null differ diff --git a/Scripts/euwfusion2.bos b/Scripts/euwfusion2.bos deleted file mode 100644 index 3a248bcdc..000000000 --- a/Scripts/euwfusion2.bos +++ /dev/null @@ -1,112 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -static-var Static_Var_1, tech; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 2048 from firepoint1; -// } - sleep 32; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 1024 from firepoint1; -// } - sleep 100; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn firepoint1 to x-axis <-90> now; - start-script SmokeUnit(); -} -/* -TechLost() -{ - set ACTIVATION to 0; - tech=FALSE; -} - -TechGranted() -{ - set ACTIVATION to 1; - tech=TRUE; -} -*/ -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/euwfusion2.cob b/Scripts/euwfusion2.cob deleted file mode 100644 index 001e614f5..000000000 Binary files a/Scripts/euwfusion2.cob and /dev/null differ diff --git a/Scripts/euwmetalextractor.bos b/Scripts/euwmetalextractor.bos deleted file mode 100644 index 966a0c9a1..000000000 --- a/Scripts/euwmetalextractor.bos +++ /dev/null @@ -1,168 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, pivotpoint, sfxpoint1; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging, ball1state, ball2state, ball3state, ball4state, ballstate; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin pivotpoint around y-axis speed <100> accelerate <10>; - ballstate = 1; -} - -Stop() -{ - stop-spin pivotpoint around y-axis decelerate <25>; - wait-for-turn pivotpoint around y-axis; - ballstate = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from sfxpoint1; - - sleep 32; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - - emit-sfx 1024 from sfxpoint1; - sleep 400; - } -} - - -Create() -{ - start-script fx(); - start-script fx2(); - Static_Var_1 = 0; - Static_Var_2 = 75; - Static_Var_3 = 50; - turn sfxpoint1 to x-axis <-90> now; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode pivotpoint type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode pivotpoint type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode pivotpoint type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode pivotpoint type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/euwmetalextractor.cob b/Scripts/euwmetalextractor.cob deleted file mode 100644 index 574f0d949..000000000 Binary files a/Scripts/euwmetalextractor.cob and /dev/null differ diff --git a/Scripts/euwsolar2.bos b/Scripts/euwsolar2.bos deleted file mode 100644 index 94236b0c0..000000000 --- a/Scripts/euwsolar2.bos +++ /dev/null @@ -1,113 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, nub, firepoint1; - -static-var Static_Var_1, tech; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - emit-sfx 2048 from firepoint1; -// } - sleep 32; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -// if (tech) -// { - spin nub around y-axis speed <50.005495>; - emit-sfx 1024 from firepoint1; -// } - sleep 100; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn firepoint1 to x-axis <-90> now; - start-script SmokeUnit(); -} -/* -TechLost() -{ - set ACTIVATION to 0; - tech=FALSE; -} - -TechGranted() -{ - set ACTIVATION to 1; - tech=TRUE; -} -*/ -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/euwsolar2.cob b/Scripts/euwsolar2.cob deleted file mode 100644 index 2905e07ef..000000000 Binary files a/Scripts/euwsolar2.cob and /dev/null differ diff --git a/Scripts/euwstorage.bos b/Scripts/euwstorage.bos deleted file mode 100644 index 22121644e..000000000 --- a/Scripts/euwstorage.bos +++ /dev/null @@ -1,98 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, sfxpoint1; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from sfxpoint1; - sleep 32; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from sfxpoint1; - sleep 100; - } -} - - -Create() -{ - start-script fx(); - start-script fx2(); - turn sfxpoint1 to x-axis <-90> now; - spin top around y-axis speed <50.005495>; - start-script SmokeUnit(); -} - - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/euwstorage.cob b/Scripts/euwstorage.cob deleted file mode 100644 index b9d5edd2b..000000000 Binary files a/Scripts/euwstorage.cob and /dev/null differ diff --git a/Scripts/euwturret.bos b/Scripts/euwturret.bos deleted file mode 100644 index 0757e902a..000000000 --- a/Scripts/euwturret.bos +++ /dev/null @@ -1,141 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel, firepoint1, firepoint2; // these are the pieces of the model - -static-var CanFire, shooting_num; - -// Signal definitions -#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag - - -// Custom SFX -#define GDMARTY 1024+0 - -SmokeUnit()// this is a standard smoke point define -{ - var healthpercent, sleeptime, smoketype; - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = SFXTYPE_BLACKSMOKE; - if( Rand( 1, 66 ) < healthpercent ) - smoketype = SFXTYPE_WHITESMOKE; - emit-sfx 1026 from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - sleeptime = 200; - sleep sleeptime; - } -} - -cannotfire() -{ - while( TRUE ) - { - if (!CanFire) - { - emit-sfx 1025 from base; - } - sleep 1500; - } -} - -Create() // tells it what to do on creation -{ - CanFire=TRUE; - shooting_num=1; - while( get BUILD_PERCENT_LEFT ) - sleep 400; - start-script SmokeUnit(); - start-script cannotfire(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ - sleep 3000; - turn turret to y-axis <0> speed <60>; - turn barrel to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // aiming animation and firing authorization -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - while(!CanFire) - sleep 200; - turn turret to y-axis heading speed <225>; - turn barrel to x-axis <0> - pitch speed <150>; - wait-for-turn turret around y-axis; - wait-for-turn barrel around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ - - if(shooting_num==1) - { - emit-sfx GDMARTY from firepoint2; - } - - if(shooting_num==2) - { - emit-sfx GDMARTY from firepoint1; - } - - shooting_num=shooting_num+1; - - if( shooting_num == 3) - { - shooting_num=1; - } - -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ - piecenum = barrel; -} - -QueryWeapon1(piecenum) // where the shot is created at -{ - - if (shooting_num==1) - { - piecenum=firepoint1; - } - - if (shooting_num==2) - { - piecenum=firepoint2; - } - -} -/* -TechLost() -{ - CanFire=FALSE; - signal SIG_AIM; - stop-spin turret around y-axis decelerate <10>; - stop-spin barrel around x-axis decelerate <10>; -} - -TechGranted() -{ - CanFire=TRUE; -} -*/ -Killed(severity, corpsetype) // how it explodes -{ - corpsetype = 1; - explode base type EXPLODE_ON_HIT; - explode turret type EXPLODE_ON_HIT; - explode barrel type EXPLODE_ON_HIT; -} diff --git a/Scripts/euwturret.cob b/Scripts/euwturret.cob deleted file mode 100644 index 1fb1dba12..000000000 Binary files a/Scripts/euwturret.cob and /dev/null differ diff --git a/Scripts/f2engineer_lus.lua b/Scripts/f2engineer_lus.lua new file mode 100644 index 000000000..85f1accf9 --- /dev/null +++ b/Scripts/f2engineer_lus.lua @@ -0,0 +1,65 @@ +base, spinner, nano1, dirt = piece('base', 'spinner', 'nano1', 'dirt') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base, spinner}) + StartThread(BuildFX) + building = false +end + +common = include("headers/common_includes_lus.lua") + +function script.StartMoving() + isMoving = true + StartThread(thrust) +end + +function script.StopMoving() + isMoving = false +end + +function thrust() + common.DirtTrail() +end + +function BuildFX() + while(building == true) do + EmitSfx (nano1, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(base, y_axis, 0, 5) + end +end + +local nanoPoints = {nano1} + +Spring.SetUnitNanoPieces(unitID, nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end + +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + Explode(spinner, SFX.EXPLODE_ON_HIT) + Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/f3.BOS b/Scripts/f3.BOS deleted file mode 100644 index b080b5f32..000000000 --- a/Scripts/f3.BOS +++ /dev/null @@ -1,63 +0,0 @@ -piece GP, base, turret, pillar, fire1; - -#define SIG_AIM_1 2 -#define SIG_AIM_2 4 - -#define f3 1024+0 -Create() -{ hide fire1; } - -AimFromWeapon1(piecenum) -{ piecenum=turret; } - -QueryWeapon1(piecenum) -{ piecenum=fire1; } - -QueryWeapon2(piecenum) -{ piecenum=fire1; } - -AimWeapon1(heading,pitch) -{ - signal SIG_AIM_1; - set-signal-mask SIG_AIM_1; - - turn pillar to y-axis heading speed <256>; - turn turret to x-axis (0-pitch) speed <150>; - wait-for-turn pillar around y-axis; - wait-for-turn turret around x-axis; - - return 1; -} - -FireWeapon1() -{ - sleep 60; - emit-sfx f3 from fire1; - sleep 60; - emit-sfx f3 from fire1; - sleep 60; - emit-sfx f3 from fire1; - sleep 60; - emit-sfx f3 from fire1; -} - -AimWeapon2(heading,pitch) -{ - signal SIG_AIM_2; - set-signal-mask SIG_AIM_2; - - return 1; -} - -FireWeapon2() -{ - show fire1; - sleep 120; - hide fire1; -} - -Killed(severity, corpsetype) -{ - corpsetype = 3; - return 0; -} \ No newline at end of file diff --git a/Scripts/faction/exptype.h b/Scripts/faction/exptype.h new file mode 100644 index 000000000..7a83187b2 --- /dev/null +++ b/Scripts/faction/exptype.h @@ -0,0 +1,193 @@ +/* +** EXPtype.h -- Explosion Type information and GET/SET constants for scripts +** +** This Script contains constants compatible only with Spring RTS engine +** not for use with Total Annihilation or TA:Kindgoms +*/ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +// Indices for emit-sfx +#ifndef __SFXTYPE_H_ +#define SFXTYPE_VTOL 0 +//#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 // same as SFX_WAKE +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 // same as SFX_REVERSE_WAKE + +#define SFXTYPE_WHITESMOKE 257 +#define SFXTYPE_BLACKSMOKE 258 +#define SFXTYPE_SUBBUBBLES 259 +#endif + +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define NOCEGTRAIL 64 // Disables the cegtrail for the specific piece (defined in the unit fbi) +#define NOHEATCLOUD 128 // No engine default heat cloud for explosion +#define BITMAP 10000001 + +// Bitmap Explosion Types +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 + +//Customized effects (in FBI/TDF/LUA) +// Explosion generators +#define UNIT_SFX0 1024 +#define UNIT_SFX1 1025 +#define UNIT_SFX2 1026 +#define UNIT_SFX3 1027 +#define UNIT_SFX4 1028 +#define UNIT_SFX5 1029 +#define UNIT_SFX6 1030 +#define UNIT_SFX7 1031 +#define UNIT_SFX8 1032 +#define UNIT_SFX9 1033 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 +#define FIRE_W9 2056 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 +#define DETO_W9 4104 + + +// COB constants +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get +#define REVERSING 109 // get + +// Indices for SET, GET, and GET_UNIT_VALUE for LUA return values +#define LUA0 110 // (LUA0 returns the lua call status, 0 or 1) +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) get WEAPON_RELOADSTATE(weaponNum) for GET +#define WEAPON_RELOADTIME 126 // get (with fake set) get WEAPON_RELOADSTATE(-weaponNum,val) for SET +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define WEAPON_STOCKPILE_COUNT 139 // get (with fake set) + + +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get +#define KSIN 135 // get, kiloSine 1024*sin(x) as COB uses only integers +#define KCOS 136 // get, kiloCosine 1024*cos(x) + +#define KTAN 137 // get, kiloTangent 1024*tan(x) carefull with angles close to 90 deg. might cause overflow +#define SQRT 138 // get, square root (floored to integer) + +#define ENERGY_MAKE 140 // set or get (100*E production) + +#define METAL_MAKE 141 // set or get (100*M production) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif \ No newline at end of file diff --git a/LuaIntro/chili/chili/skins/default/Sav33A.tmp b/Scripts/faction/sfxtype.h similarity index 100% rename from LuaIntro/chili/chili/skins/default/Sav33A.tmp rename to Scripts/faction/sfxtype.h diff --git a/Scripts/faction/unitDefsTurretSpeeds.h b/Scripts/faction/unitDefsTurretSpeeds.h new file mode 100644 index 000000000..a96c7278d --- /dev/null +++ b/Scripts/faction/unitDefsTurretSpeeds.h @@ -0,0 +1,68 @@ +/* unitDefsTurretSpeeds.h -- sets turret speed via unitDefs (through lua gadget Spring.CallCOBScript()) + The following variables are assumed to exist: + Weapon1TurretX, Weapon1TurretY + ... + Weapon10TurretX, Weapon10TurretY +*/ + +static-var Weapon1TurretX, Weapon1TurretY; +static-var Weapon2TurretX, Weapon2TurretY; +static-var Weapon3TurretX, Weapon3TurretY; +static-var Weapon4TurretX, Weapon4TurretY; +static-var Weapon5TurretX, Weapon5TurretY; +static-var Weapon6TurretX, Weapon6TurretY; +static-var Weapon7TurretX, Weapon7TurretY; +static-var Weapon8TurretX, Weapon8TurretY; +static-var Weapon9TurretX, Weapon9TurretY; +static-var Weapon10TurretX, Weapon10TurretY; + +SetWeapon1TurretSpeed(var1,var2) +{ + Weapon1TurretX = 500; + Weapon1TurretY = 500; +} +SetWeapon2TurretSpeed(var1,var2) +{ + Weapon2TurretX = 500; + Weapon2TurretY = 500; +} +SetWeapon3TurretSpeed(var1,var2) +{ + Weapon3TurretX = 500; + Weapon3TurretY = 500; +} +SetWeapon4TurretSpeed(var1,var2) +{ + Weapon4TurretX = 500; + Weapon4TurretY = 500; +} +SetWeapon5TurretSpeed(var1,var2) +{ + Weapon5TurretX = 500; + Weapon5TurretY = 500; +} +SetWeapon6TurretSpeed(var1,var2) +{ + Weapon6TurretX = 500; + Weapon6TurretY = 500; +} +SetWeapon7TurretSpeed(var1,var2) +{ + Weapon7TurretX = 500; + Weapon7TurretY = 500; +} +SetWeapon8TurretSpeed(var1,var2) +{ + Weapon8TurretX = 500; + Weapon8TurretY = 500; +} +SetWeapon9TurretSpeed(var1,var2) +{ + Weapon9TurretX = 500; + Weapon9TurretY = 500; +} +SetWeapon10TurretSpeed(var1,var2) +{ + Weapon10TurretX = 500; + Weapon10TurretY = 500; +} \ No newline at end of file diff --git a/Scripts/faction/weapon1control.h b/Scripts/faction/weapon1control.h new file mode 100644 index 000000000..d1c1acd4f --- /dev/null +++ b/Scripts/faction/weapon1control.h @@ -0,0 +1,154 @@ +/* +HOW TO: +- Model MUST contain aimx1 and aimy1 pieces +- Script must have defined Weapon1TurretX and Weapon1TurretY static-vars (turret turn speeds) +- Script must have defined aimx1 and aimy1 pieces +- Change script as such: +Create() +{ + [...] + start-script InitialSetup1(); + [...] +} + +AimWeapon1(heading, pitch) +{ + [...] + start-script Weapon1Drawn(); -- can call a function that draws weapons and then calls Weapon1Drawn() when done if there is an actual animation (ie pw) + [...] -- Remove animations from aimWeapon scripts (use a DrawWeapon1() if an animation is needed, weapon1control will rotate the different aimpieces) + start-script Weapon1SetWtdAim(heading, pitch); + [...] + return (aim1); +} + +RestoreAfterDelay() +{ + [...] + sleep sleeptime; + start-script RestoreWeapon1(); + [...] -- other animations; + call-script Weapon1Restored(); + [...] -- tell script wpn has been restored if needed for walkscripts +} + +- Weapon1Control moves the aim pieces depending on turretSpeeds, sets pitch = 1 when pitch reached and head = 1 when head reached +- Weapon1Drawn allows unit to fire by setting wpnReady1 = 1 +- if pitch = 1, head = 1 and wpnReady = 1 then the weapon can shoot: aim1 = 1 and aimweapon returns aim1 +- Restore animations go in RestoreAfterDelay, RestoreWeapon1() restores aimy and aimx pieces orientation, Weapon1Restored() waits for these pieces to be restored +*/ + +static-var curHead1, wtdHead1, head1, curPitch1, wtdPitch1, pitch1, aim1, wpnReady1; + +Weapon1Control() +{ + while (TRUE) + { + if (curHead1 > <180>) + { + curHead1 = <-360> + curHead1; + } + if (curPitch1 > <180>) + { + curPitch1 = <-360> + curPitch1; + } + if (curHead1 < <-180>) + { + curHead1 = <360> + curHead1; + } + if (curPitch1 < <-180>) + { + curPitch1 = <360> + curPitch1; + } + if (Static_Var_3 == 1) + { + if (((get ABS(curHead1 - wtdHead1)) > <360>) OR(((get ABS(curHead1 - wtdHead1)) > (Weapon1TurretY / 30)) AND ((get ABS(curHead1 - wtdHead1)) < <360> - (Weapon1TurretY / 30)))) + { + head1 = 0; + if(curHead1 < wtdHead1) { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 + (Weapon1TurretY / 30); + else curHead1 = curHead1 - (Weapon1TurretY / 30); + } + + else { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 - (Weapon1TurretY / 30); + else curHead1 = curHead1 + (Weapon1TurretY / 30); + } + } + else + { + head1 = 1; + curHead1 = wtdHead1; + } + if (((get ABS(curPitch1 - wtdPitch1)) > <360>) OR(((get ABS(curPitch1 - wtdPitch1)) > (Weapon1TurretX / 30)) AND ((get ABS(curPitch1 - wtdPitch1)) < <360> - (Weapon1TurretX / 30)))) + { + pitch1 = 0; + if(curPitch1 < wtdPitch1) { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 + (Weapon1TurretX / 30); + else curPitch1 = curPitch1 - (Weapon1TurretX / 30); + } + + else { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 - (Weapon1TurretX / 30); + else curPitch1 = curPitch1 + (Weapon1TurretX / 30); + } + } + else + { + pitch1 = 1; + curPitch1 = wtdPitch1; + } + if (pitch1 == 1 AND head1 == 1 AND wpnReady1 == 1 AND wtdHead1 != 0) + { + aim1 = 1; + } + else + { + aim1 = 0; + } + turn aimy1 to y-axis curHead1 now; + turn aimx1 to x-axis curPitch1 now; + } + sleep 1; + } +} + +InitialSetup1() +{ + curHead1 = 0; + curPitch1 = 0; + wtdHead1 = 0; + wtdPitch1 = 0; + wpnReady1 = 0; + start-script Weapon1Control(); +} + +Weapon1Drawn() +{ + wpnReady1 = 1; +} + +RestoreWeapon1() +{ + wtdHead1 = 0; + wtdPitch1 = 0; +} + +Weapon1Restored() +{ + wpnReady1 = 0; + while (curHead1 != 0) + { + sleep 25; + } + return (TRUE); +} + +Weapon1SetWtdAim(pitch, heading) +{ + wtdHead1 = heading; + wtdPitch1 = <0> - pitch; +} \ No newline at end of file diff --git a/Scripts/faction/xantinuke.bos b/Scripts/faction/xantinuke.bos new file mode 100644 index 000000000..2a1d45a42 --- /dev/null +++ b/Scripts/faction/xantinuke.bos @@ -0,0 +1,208 @@ +// * Header Info * +// VersionSignature 4 +// NumberOfScripts 17 +// NumberOfPieces 9 +// LengthOfScripts 3ce +// NumberOfStaticVars 5 +// UKZero 0 +// OffsetToScriptCodeIndexArray f64 +// OffsetToScriptNameOffsetArray fa8 +// OffsetToPieceNameOffsetArray fec +// OffsetToScriptCode 2c +// OffsetToNameArray 1010 + +// OffsetToFirstName 1010 + +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, firepoint, door1, door2; + +static-var Static_Var_1, restore_delay, gun_1, statechg_DesiredState, statechg_StateChanging; + +// Signal definitions +#define SIG_AIM 2 + + +activatescr() +{ + if( TRUE ) + { + turn door1 to z-axis <0.000000> now; + turn door1 to z-axis <0> speed <500.000000>; + turn door2 to z-axis <0.000000> now; + turn door2 to z-axis <-0> speed <500.000000>; + } + + sleep 3; + return (0); +} + +deactivatescr() +{ + if( TRUE ) + { + turn door1 to z-axis <-0> now; + turn door1 to z-axis <0.000000> speed <500.000000>; + turn door2 to z-axis <90> now; + turn door2 to z-axis <0.000000> speed <500.000000>; + } + + sleep 14; + return (0); +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + var Func_Var_4; + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + Func_Var_4 = Rand( 1, 4 ); + if( Func_Var_4 == 1 ) + { + emit-sfx smoketype from door1; + } + if( Func_Var_4 == 2 ) + { + emit-sfx smoketype from door2; + } + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } + return (0); +} + +Go() +{ + call-script activatescr(); + Static_Var_1 = 1; + return (0); +} + +Stop() +{ + Static_Var_1 = 0; + call-script deactivatescr(); + return (0); +} + +InitState() +{ + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; + return (0); +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState == 0 ) + { + call-script Go(); + currentstate = 0; + } + if( statechg_DesiredState == 1 ) + { + call-script Stop(); + currentstate = 1; + } + } + statechg_StateChanging = FALSE; + return (0); +} + +Create() +{ + Static_Var_1 = 0; + gun_1 = firepoint; + restore_delay = 3000; + call-script InitState(); + start-script SmokeUnit(); + return (0); +} + +Activate() +{ + start-script RequestState(0); + return (0); +} + +Deactivate() +{ + start-script RequestState(1); + return (0); +} + +SetMaxReloadTime(Func_Var_1) +{ + restore_delay = Func_Var_1 * 2; + return (0); +} + +AimPrimary(heading, pitch) +{ + start-script RequestState(0); + signal SIG_AIM; + set-signal-mask SIG_AIM; + return (1); +} + +FirePrimary() +{ + gun_1 = firepoint; + return (0); +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint; + return (0); +} + +AimFromPrimary(piecenum) +{ + piecenum = firepoint; + return (0); +} + +SweetSpot(piecenum) +{ + piecenum = base; + return (0); +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode door1 type EXPLODE_ON_HIT; + explode door2 type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xantinuke.cob b/Scripts/faction/xantinuke.cob new file mode 100644 index 000000000..94d87d7be Binary files /dev/null and b/Scripts/faction/xantinuke.cob differ diff --git a/Scripts/faction/xcommander.bos b/Scripts/faction/xcommander.bos new file mode 100644 index 000000000..16330bd90 --- /dev/null +++ b/Scripts/faction/xcommander.bos @@ -0,0 +1,742 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece torso, lfirept, rbigflash, nanospray, nanolathe, luparm, ruparm, pelvis, + rthigh, lthigh, biggun, lleg, l_foot, rleg, r_foot, head, teleport; + +static-var bMoving, bAiming, Busy, gun_3, gun_2, counter, + bIsBuilding, buildPitch, buildHeading, maxSpeed, currentSpeed, animSpeed, justMoved; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + + if (bMoving) + { + //step 1 + turn rthigh to x-axis <46> speed <197.142857> * animSpeed / 100; + turn rleg to x-axis <-31> speed <132.857143> * animSpeed / 100; + turn r_foot to x-axis <-14> speed <60.000000> * animSpeed / 100; + + turn lthigh to x-axis <-49> speed <60.000000> * animSpeed / 100; + turn lleg to x-axis <31> speed <85.714286> * animSpeed / 100; + turn l_foot to x-axis <0> speed <30.000000> * animSpeed / 100; + + turn luparm to x-axis <5> speed <21.428571> * animSpeed / 100; + turn nanolathe to x-axis <15> speed <64.285714> * animSpeed / 100; + turn ruparm to x-axis <-25> speed <107.142857> * animSpeed / 100; + turn biggun to x-axis <0> now; + + move pelvis to y-axis [-2] speed [8.571429] * animSpeed / 100; + turn torso to x-axis <0> now; + turn torso to y-axis <-3> speed <12.857143> * animSpeed / 100; + turn head to y-axis <2> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <-1> speed <4.285714> * animSpeed / 100; + + //sleep 215 * currentSpeed / 100; + sleep 215;// * currentSpeed / 100; + } + if (bMoving) + { + + + //step 2 + turn rthigh to x-axis <52> speed <25.714286> * animSpeed / 100; + turn rleg to x-axis <-5> speed <111.428571> * animSpeed / 100; + turn r_foot to x-axis <-8> speed <25.714286> * animSpeed / 100; + + turn lthigh to x-axis <-28> speed <90.000000> * animSpeed / 100; + turn lleg to x-axis <-35> speed <282.857143> * animSpeed / 100; + turn l_foot to x-axis <32> speed <137.142857> * animSpeed / 100; + + turn luparm to x-axis <15> speed <42.857143> * animSpeed / 100; + turn nanolathe to x-axis <45> speed <128.571429> * animSpeed / 100; + + turn ruparm to x-axis <-40> speed <64.285714> * animSpeed / 100; + turn biggun to x-axis <15> speed <64.285714> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn torso to x-axis <4> speed <17.142857> * animSpeed / 100; + turn torso to y-axis <-5> speed <8.571429> * animSpeed / 100; + turn head to y-axis <3> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <-2> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } + if (bMoving) + { + + //step 3 + turn rthigh to x-axis <-6> speed <248.571429> * animSpeed / 100; + turn rleg to x-axis <64> speed <295.714286> * animSpeed / 100; + turn r_foot to x-axis <-11> speed <12.857143> * animSpeed / 100; + + turn lthigh to x-axis <-20> speed <34.285714> * animSpeed / 100; + turn lleg to x-axis <-23> speed <51.428571> * animSpeed / 100; + turn l_foot to x-axis <43> speed <47.142857> * animSpeed / 100; + + turn luparm to x-axis <5> speed <42.857143> * animSpeed / 100; + turn nanolathe to x-axis <15> speed <128.571429> * animSpeed / 100; + turn ruparm to x-axis <-25> speed <64.285714> * animSpeed / 100; + turn biggun to x-axis <0> speed <64.285714> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn torso to x-axis <2> speed <8.571429> * animSpeed / 100; + turn torso to y-axis <-3> speed <8.571429> * animSpeed / 100; + turn head to y-axis <2> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <-1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 4 + turn rthigh to x-axis <-35> speed <124.285714> * animSpeed / 100; + turn rleg to x-axis <51> speed <55.714286> * animSpeed / 100; + turn r_foot to x-axis <-7> speed <17.142857> * animSpeed / 100; + turn lthigh to x-axis <0> speed <85.714286> * animSpeed / 100; + turn lleg to x-axis <0> speed <98.571429> * animSpeed / 100; + turn l_foot to x-axis <0> speed <184.285714> * animSpeed / 100; + + turn luparm to x-axis <0> speed <21.428571> * animSpeed / 100; + turn nanolathe to x-axis <0> speed <64.285714> * animSpeed / 100; + turn ruparm to x-axis <0> speed <107.142857> * animSpeed / 100; + turn biggun to x-axis <0> now; + + move pelvis to y-axis [0] speed [8.571429] * animSpeed / 100; + turn torso to x-axis <0> speed <8.571429> * animSpeed / 100; + turn torso to y-axis <0> speed <12.857143> * animSpeed / 100; + turn head to y-axis <0> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <0> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 5 + turn rthigh to x-axis <-49> speed <60.000000> * animSpeed / 100; + turn rleg to x-axis <31> speed <85.714286> * animSpeed / 100; + turn r_foot to x-axis <0> speed <30.000000> * animSpeed / 100; + + turn lthigh to x-axis <46> speed <197.142857> * animSpeed / 100; + turn lleg to x-axis <-31> speed <132.857143> * animSpeed / 100; + turn l_foot to x-axis <-14> speed <60.000000> * animSpeed / 100; + + turn luparm to x-axis <-25> speed <107.142857> * animSpeed / 100; + turn nanolathe to x-axis <0> now; + turn ruparm to x-axis <5> speed <21.428571> * animSpeed / 100; + turn biggun to x-axis <15> speed <64.285714> * animSpeed / 100; + + move pelvis to y-axis [-2] speed [8.571429] * animSpeed / 100; + turn torso to x-axis <0> now; + turn torso to y-axis <3> speed <12.857143> * animSpeed / 100; + turn head to y-axis <-2> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 6 + turn rthigh to x-axis <-28> speed <90.000000> * animSpeed / 100; + turn rleg to x-axis <-35> speed <282.857143> * animSpeed / 100; + turn r_foot to x-axis <32> speed <137.142857> * animSpeed / 100; + + turn lthigh to x-axis <52> speed <25.714286> * animSpeed / 100; + turn lleg to x-axis <-5> speed <111.428571> * animSpeed / 100; + turn l_foot to x-axis <-8> speed <25.714286> * animSpeed / 100; + + turn luparm to x-axis <-40> speed <64.285714> * animSpeed / 100; + turn nanolathe to x-axis <15> speed <64.285714> * animSpeed / 100; + turn ruparm to x-axis <15> speed <42.857143> * animSpeed / 100; + turn biggun to x-axis <45> speed <128.571429> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn torso to x-axis <4> speed <17.142857> * animSpeed / 100; + turn torso to y-axis <5> speed <8.571429> * animSpeed / 100; + turn head to y-axis <-3> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <2> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } + if (bMoving) + { + + //step 7 + turn rthigh to x-axis <-20> speed <34.285714> * animSpeed / 100; + turn rleg to x-axis <-23> speed <51.428571> * animSpeed / 100; + turn r_foot to x-axis <43> speed <47.142857> * animSpeed / 100; + + turn lthigh to x-axis <-6> speed <248.571429> * animSpeed / 100; + turn lleg to x-axis <64> speed <295.714286> * animSpeed / 100; + turn l_foot to x-axis <-11> speed <12.857143> * animSpeed / 100; + + turn luparm to x-axis <-25> speed <64.285714> * animSpeed / 100; + turn nanolathe to x-axis <0> speed <64.285714> * animSpeed / 100; + turn ruparm to x-axis <5> speed <42.857143> * animSpeed / 100; + turn biggun to x-axis <15> speed <128.571429> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn torso to x-axis <2> speed <8.571429> * animSpeed / 100; + turn torso to y-axis <3> speed <8.571429> * animSpeed / 100; + turn head to y-axis <-2> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } + + if (bMoving) + { + //step 0 + turn rthigh to x-axis <0> speed <85.714286> * animSpeed / 100; + turn rleg to x-axis <0> speed <98.571429> * animSpeed / 100; + turn r_foot to x-axis <0> speed <184.285714> * animSpeed / 100; + + turn lthigh to x-axis <-35> speed <124.285714> * animSpeed / 100; + turn lleg to x-axis <51> speed <55.714286> * animSpeed / 100; + turn l_foot to x-axis <-7> speed <17.142857> * animSpeed / 100; + + turn luparm to x-axis <0> speed <107.142857> * animSpeed / 100; + turn nanolathe to x-axis <0> now; + + turn ruparm to x-axis <0> speed <21.428571> * animSpeed / 100; + turn biggun to x-axis <0> speed <64.285714> * animSpeed / 100; + + move pelvis to y-axis [0] speed [8.571429] * animSpeed / 100; + turn torso to x-axis <0> speed <8.571429> * animSpeed / 100; + turn torso to y-axis <0> speed <12.857143> * animSpeed / 100; + turn head to y-axis <0> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <0> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + +} + +walklegs() +{ + + if (bMoving) + { + //step 0 + turn rthigh to x-axis <0> speed <85.714286> * animSpeed / 100; + turn rleg to x-axis <0> speed <98.571429> * animSpeed / 100; + turn r_foot to x-axis <0> speed <184.285714> * animSpeed / 100; + + turn lthigh to x-axis <-35> speed <124.285714> * animSpeed / 100; + turn lleg to x-axis <51> speed <55.714286> * animSpeed / 100; + turn l_foot to x-axis <-7> speed <17.142857> * animSpeed / 100; + + + move pelvis to y-axis [0] speed [8.571429] * animSpeed / 100; + turn head to y-axis <0> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <0> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + //step 1 + turn rthigh to x-axis <46> speed <197.142857> * animSpeed / 100; + turn rleg to x-axis <-31> speed <132.857143> * animSpeed / 100; + turn r_foot to x-axis <-14> speed <60.000000> * animSpeed / 100; + + turn lthigh to x-axis <-49> speed <60.000000> * animSpeed / 100; + turn lleg to x-axis <31> speed <85.714286> * animSpeed / 100; + turn l_foot to x-axis <0> speed <30.000000> * animSpeed / 100; + move pelvis to y-axis [-2] speed [8.571429] * animSpeed / 100; + turn head to y-axis <2> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <-1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 2 + turn rthigh to x-axis <52> speed <25.714286> * animSpeed / 100; + turn rleg to x-axis <-5> speed <111.428571> * animSpeed / 100; + turn r_foot to x-axis <-8> speed <25.714286> * animSpeed / 100; + + turn lthigh to x-axis <-28> speed <90.000000> * animSpeed / 100; + turn lleg to x-axis <-35> speed <282.857143> * animSpeed / 100; + turn l_foot to x-axis <32> speed <137.142857> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn head to y-axis <3> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <-2> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } + if (bMoving) + { + + //step 3 + turn rthigh to x-axis <-6> speed <248.571429> * animSpeed / 100; + turn rleg to x-axis <64> speed <295.714286> * animSpeed / 100; + turn r_foot to x-axis <-11> speed <12.857143> * animSpeed / 100; + + turn lthigh to x-axis <-20> speed <34.285714> * animSpeed / 100; + turn lleg to x-axis <-23> speed <51.428571> * animSpeed / 100; + turn l_foot to x-axis <43> speed <47.142857> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn head to y-axis <2> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <-1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 4 + turn rthigh to x-axis <-35> speed <124.285714> * animSpeed / 100; + turn rleg to x-axis <51> speed <55.714286> * animSpeed / 100; + turn r_foot to x-axis <-7> speed <17.142857> * animSpeed / 100; + turn lthigh to x-axis <0> speed <85.714286> * animSpeed / 100; + turn lleg to x-axis <0> speed <98.571429> * animSpeed / 100; + turn l_foot to x-axis <0> speed <184.285714> * animSpeed / 100; + + + move pelvis to y-axis [0] speed [8.571429] * animSpeed / 100; + turn head to y-axis <0> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <0> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 5 + turn rthigh to x-axis <-49> speed <60.000000> * animSpeed / 100; + turn rleg to x-axis <31> speed <85.714286> * animSpeed / 100; + turn r_foot to x-axis <0> speed <30.000000> * animSpeed / 100; + + turn lthigh to x-axis <46> speed <197.142857> * animSpeed / 100; + turn lleg to x-axis <-31> speed <132.857143> * animSpeed / 100; + turn l_foot to x-axis <-14> speed <60.000000> * animSpeed / 100; + + + move pelvis to y-axis [-2] speed [8.571429] * animSpeed / 100; + turn head to y-axis <-2> speed <8.571429> * animSpeed / 100; + turn pelvis to z-axis <1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + } + if (bMoving) + { + + + //step 6 + turn rthigh to x-axis <-28> speed <90.000000> * animSpeed / 100; + turn rleg to x-axis <-35> speed <282.857143> * animSpeed / 100; + turn r_foot to x-axis <32> speed <137.142857> * animSpeed / 100; + + turn lthigh to x-axis <52> speed <25.714286> * animSpeed / 100; + turn lleg to x-axis <-5> speed <111.428571> * animSpeed / 100; + turn l_foot to x-axis <-8> speed <25.714286> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn head to y-axis <-3> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <2> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } + if (bMoving) + { + + //step 7 + turn rthigh to x-axis <-20> speed <34.285714> * animSpeed / 100; + turn rleg to x-axis <-23> speed <51.428571> * animSpeed / 100; + turn r_foot to x-axis <43> speed <47.142857> * animSpeed / 100; + + turn lthigh to x-axis <-6> speed <248.571429> * animSpeed / 100; + turn lleg to x-axis <64> speed <295.714286> * animSpeed / 100; + turn l_foot to x-axis <-11> speed <12.857143> * animSpeed / 100; + + move pelvis to y-axis [-2] now; + turn head to y-axis <-2> speed <4.285714> * animSpeed / 100; + turn pelvis to z-axis <1> speed <4.285714> * animSpeed / 100; + + sleep 215 * currentSpeed / 100; + + } +} + +stand() +{ + + turn rthigh to x-axis <0> speed <200>; + turn rleg to x-axis <0> speed <200>; + turn r_foot to x-axis <0> speed <200>; + + turn lthigh to x-axis <0> speed <200>; + turn lleg to x-axis <0> speed <200>; + turn l_foot to x-axis <0> speed <200>; + + move pelvis to y-axis [0] speed [20]; + turn head to y-axis <-2> speed <4.285714>; + turn pelvis to z-axis <1> speed <4.285714>; + + sleep 200; + return (0); +} + +bigfire() +{ + turn ruparm to x-axis <40> now; + turn biggun to x-axis <-40> now; + turn ruparm to x-axis <0> speed <80>; + turn biggun to x-axis <0> speed <80>; + sleep 100; + return (0); +} + +UnitSpeed() +{ + while( TRUE ) + { + currentSpeed = (get CURRENT_SPEED) * 100 / maxSpeed; + + //get PRINT(currentSpeed, maxSpeed, animSpeed); + if( currentSpeed < 40 ) + { + currentSpeed = 40; + } + animSpeed=currentSpeed; + + currentSpeed = 10000/currentSpeed; + sleep 60; + } + return (0); +} + +MotionControl(Func_Var_1, Func_Var_2) +{ + while( TRUE ) + { + Func_Var_1 = bMoving; + Func_Var_2 = bAiming; + if( Func_Var_1 ) + { + gun_3 = torso; + if( Func_Var_2 ) + { + Busy = 1; + call-script walklegs(); + } + else + { + Busy = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Busy = 1; + if( justmoved ) + { + call-script stand(); + justmoved=FALSE; + } + else + { + sleep 30; + } + } + } + return (0); +} + +TeleportControl() +{ + move teleport to y-axis [700.000000] now; + turn teleport to x-axis <90.000000> now; + sleep 100; + emit-sfx 1025 from teleport; + sleep 2200; + emit-sfx 1026 from pelvis; + sleep 100; + while (counter < 23) + { + emit-sfx 2051 from teleport; + sleep 65; + ++counter; + } + sleep 1000; + move teleport to y-axis [0.000000] now; +} + +Create() +{ + hide rbigflash; + hide lfirept; + bMoving = FALSE; + bAiming = FALSE; + bIsBuilding = 0; + gun_2 = torso; + Busy = 1; + gun_3 = torso; + buildHeading = 0; + buildPitch = 0; + counter = 0; + //maxSpeed = get UNKNOWN_UNIT_VALUE(75); + maxSpeed = get MAX_SPEED; + currentSpeed = 100; + start-script MotionControl(); + start-script UnitSpeed(); + //call-script TeleportControl(); + return (0); +} + +StartMoving() +{ + bMoving = TRUE; + gun_3 = torso; + return (0); +} + +StopMoving() +{ + bMoving = FALSE; + return (0); +} + +SweetSpot(piecenum) +{ + piecenum = torso; + return (0); +} + +QueryNanoPiece(piecenum) +{ + piecenum = nanospray; + return (0); +} + +RestorePosition() +{ + gun_3 = torso; + turn torso to y-axis <0.000000> speed <90.000000>; + wait-for-turn torso around y-axis; + bAiming = FALSE; + return (0); +} + +ResumeBuilding() +{ + sleep 400; + if( bIsBuilding AND ( !gun_2 ) ) + { + turn torso to y-axis buildHeading speed <150.000000>; + turn luparm to x-axis <-30.000000> - buildPitch speed <45.000000>; + } + return (0); +} + +AimFromPrimary(piecenum) +{ + piecenum = torso; + return (0); +} + +QueryPrimary(piecenum) +{ + piecenum = lfirept; + return (0); +} + +AimPrimary(heading, pitch) +{ + if( gun_3 == 1 ) + { + return (0); + } + signal SIG_AIM; + set-signal-mask SIG_AIM; + bAiming = TRUE; + turn torso to y-axis heading speed <300.000000>; + turn luparm to x-axis <-5.000000> - pitch speed <250.000000>; + turn nanolathe to x-axis <000000> speed <250.000000>; + wait-for-turn torso around y-axis; + wait-for-turn luparm around x-axis; + gun_2 = lfirept; + if( bIsBuilding == 1 ) + { + start-script ResumeBuilding(); + } + return (1); +} + +FirePrimary() +{ + show lfirept; + sleep 100; + hide lfirept; + sleep 400; + gun_2 = torso; + return (0); +} + +AimFromTertiary(piecenum) +{ + piecenum = biggun; + return (0); +} + +QueryTertiary(piecenum) +{ + piecenum = rbigflash; + return (0); +} + +AimTertiary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + gun_3 = lfirept; + bAiming = TRUE; + turn torso to y-axis heading speed <300.000000>; + turn biggun to x-axis <0.000000> - pitch speed <150.000000>; + turn ruparm to x-axis <0> speed <300>; + wait-for-turn torso around y-axis; + wait-for-turn biggun around x-axis; + return (1); +} + +FireTertiary() +{ + emit-sfx 1024 + 0 from rbigflash; + gun_3 = torso; + call-script bigfire(); + return (0); +} + +AimFromSecondary(piecenum) +{ + piecenum = lfirept; + return (0); +} + +QuerySecondary(piecenum) +{ + piecenum = lfirept; + return (0); +} + +AimSecondary(heading, pitch) +{ + if( get PIECE_Y(head) > 0 ) + { + return (0); + } + if( gun_3 == 1 ) + { + return (0); + } + if( bIsBuilding ) + { + return (0); + } + signal SIG_AIM; + set-signal-mask SIG_AIM; + bAiming = TRUE; + turn torso to y-axis heading speed <300.000000>; + turn luparm to x-axis <-5.000000> - pitch speed <250.000000>; + turn nanolathe to x-axis <000000> speed <250.000000>; + wait-for-turn torso around y-axis; + wait-for-turn luparm around x-axis; + gun_2 = lfirept; + if( bIsBuilding == 1 ) + { + start-script ResumeBuilding(); + } + return (1); +} + +FireSecondary() +{ + show lfirept; + emit-sfx 1024 + 0 from lfirept; + sleep 100; + hide lfirept; + emit-sfx 1024 + 0 from lfirept; + sleep 400; + gun_2 = torso; + return (0); +} + +AimFromWeapon4(piecenum) +{ + piecenum = torso; +} + +QueryWeapon4(piecenum) +{ + piecenum = torso; +} + +StartBuilding(heading, pitch) +{ + gun_3 = torso; + signal SIG_AIM; + set-signal-mask SIG_AIM; + bAiming = TRUE; + bIsBuilding = 1; + while( !Busy ) + { + sleep 30; + } + buildHeading = heading; + buildPitch = pitch; + turn torso to y-axis heading speed <300.000000>; + turn luparm to x-axis <-30.000000> - pitch speed <90.000000>; + wait-for-turn torso around y-axis; + wait-for-turn luparm around x-axis; + set INBUILDSTANCE to 1; + return (0); +} + +TargetCleared(Func_Var_1) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + call-script RestorePosition(); + return (0); +} + +StopBuilding() +{ + bIsBuilding = 0; + set INBUILDSTANCE to 0; + signal SIG_AIM; + set-signal-mask SIG_AIM; + call-script RestorePosition(); + return (0); +} + +Killed( severity, corpsetype ) +{ + corpsetype = 1; + return(corpsetype); +} \ No newline at end of file diff --git a/Scripts/faction/xcommander.cob b/Scripts/faction/xcommander.cob new file mode 100644 index 000000000..ed07bbbb4 Binary files /dev/null and b/Scripts/faction/xcommander.cob differ diff --git a/Scripts/faction/xcrasher.bos b/Scripts/faction/xcrasher.bos new file mode 100644 index 000000000..f1c01b8b6 --- /dev/null +++ b/Scripts/faction/xcrasher.bos @@ -0,0 +1,285 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece firepoint1, firepoint2, torso, pelvis, lleg, rleg, lbarrel, + rbarrel,head,lthigh,rthigh; + +static-var gun_3, notMoving, restore_delay, currentSpeed, moveSpeed,wpn3_lasthead,shooting_num; + +// Signal definitions +#define SIG_MOVE 2 +#define SIG_WALK 4 +#define SIG_AIM_3 8 + + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = (get CURRENT_SPEED)*20/moveSpeed; + if (currentSpeed<4) currentSpeed=4; + sleep 142; + } +} + +walk() +{ + signal SIG_WALK; + set-signal-mask SIG_WALK; + notMoving = FALSE; + start-script UnitSpeed(); + while( TRUE ) + { + move pelvis to y-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + move lleg to z-axis [4.375000] speed [3.281250] *currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [-4.000000] speed [3.000000] *currentSpeed; + turn pelvis to x-axis <6.000000> speed <4.500000> *currentSpeed; + turn lleg to x-axis <-6.000000> speed <4.500000> *currentSpeed; + turn rleg to x-axis <0.000000> now; + sleep 1200 / currentSpeed; + + move pelvis to y-axis [-1.250000] speed [1.875000] *currentSpeed; + move lleg to y-axis [1.250000] speed [1.875000] *currentSpeed; + move rleg to y-axis [1.250000] speed [1.875000] *currentSpeed; + turn pelvis to x-axis <4.912088> speed <1.631868> *currentSpeed; + turn lleg to x-axis <-4.912088> speed <1.631868> *currentSpeed; + turn rleg to x-axis <1.049451> speed <1.574176> *currentSpeed; + sleep 600 / currentSpeed; + + move pelvis to y-axis [-0.750000] speed [0.750000] *currentSpeed; + move lleg to y-axis [0.750000] speed [0.750000] *currentSpeed; + move rleg to y-axis [0.750000] speed [0.750000] *currentSpeed; + turn pelvis to x-axis <2.093407> speed <4.228021> *currentSpeed; + turn lleg to x-axis <-2.093407> speed <4.228021> *currentSpeed; + turn rleg to x-axis <2.802198> speed <2.629121> *currentSpeed; + sleep 400 / currentSpeed; + + move pelvis to y-axis [-0.250000] speed [0.750000] *currentSpeed; + move lleg to y-axis [0.250000] speed [0.750000] *currentSpeed; + move rleg to y-axis [0.250000] speed [0.750000] *currentSpeed; + turn pelvis to x-axis <1.049451> speed <1.565934> *currentSpeed; + turn lleg to x-axis <-1.038462> speed <1.582418> *currentSpeed; + turn rleg to x-axis <3.159341> speed <0.535714> *currentSpeed; + sleep 200 / currentSpeed; + + move pelvis to y-axis [0.000000] speed [0.187500] *currentSpeed; + move lleg to y-axis [0.000000] speed [0.187500] *currentSpeed; + move rleg to y-axis [2.750000] speed [1.875000] *currentSpeed; + move rleg to z-axis [-4.625000] speed [0.468750] *currentSpeed; + turn pelvis to x-axis <0.000000> speed <0.787088> *currentSpeed; + turn lleg to x-axis <0.000000> speed <0.778846> *currentSpeed; + turn rleg to x-axis <0.000000> speed <2.369506> *currentSpeed; + sleep 1200 / currentSpeed; + + move lleg to z-axis [2.500000] speed [1.406250] *currentSpeed; + move rleg to z-axis [-0.875000] speed [2.812500] *currentSpeed; + sleep 1200 / currentSpeed; + + move lleg to y-axis [0.000000] now; + move lleg to z-axis [0.000000] speed [1.875000] *currentSpeed; + move rleg to z-axis [0.000000] speed [0.656250] *currentSpeed; + turn pelvis to x-axis <0.000000> now; + turn lleg to x-axis <0.000000> now; + turn rleg to x-axis <0.000000> now; + sleep 1200 / currentSpeed; + + move lleg to z-axis [-1.500000] speed [0.562500] *currentSpeed; + move rleg to z-axis [2.125000] speed [0.796875] *currentSpeed; + turn rleg to x-axis <-9.137363> speed <3.426511> *currentSpeed; + sleep 2000 / currentSpeed; + + move lleg to z-axis [-3.000000] speed [1.125000] *currentSpeed; + move rleg to y-axis [0.000000] speed [2.062500] *currentSpeed; + turn pelvis to x-axis <6.000000> speed <4.500000> *currentSpeed; + turn rleg to x-axis <-6.000000> speed <2.353022> *currentSpeed; + sleep 1200 / currentSpeed; + + move pelvis to y-axis [-1.224991] speed [1.837487] *currentSpeed; + move lleg to y-axis [1.250000] speed [1.875000] *currentSpeed; + move rleg to y-axis [1.250000] speed [1.875000] *currentSpeed; + turn pelvis to x-axis <4.560440> speed <2.159340> *currentSpeed; + turn lleg to x-axis <0.692308> speed <1.038462> *currentSpeed; + turn rleg to x-axis <-4.912088> speed <1.631868> *currentSpeed; + sleep 600 / currentSpeed; + + move pelvis to y-axis [-0.699997] speed [0.787491] *currentSpeed; + move lleg to y-axis [0.750000] speed [0.750000] *currentSpeed; + move rleg to y-axis [0.750000] speed [0.750000] *currentSpeed; + turn pelvis to x-axis <2.093407> speed <3.700549> *currentSpeed; + turn lleg to x-axis <2.802198> speed <3.164835> *currentSpeed; + turn rleg to x-axis <-2.093407> speed <4.228021> *currentSpeed; + sleep 400 / currentSpeed; + + move pelvis to y-axis [-0.250000] speed [0.674995] *currentSpeed; + move lleg to y-axis [0.250000] speed [0.750000] *currentSpeed; + move rleg to y-axis [0.250000] speed [0.750000] *currentSpeed; + turn pelvis to x-axis <1.049451> speed <1.565934> *currentSpeed; + turn lleg to x-axis <2.456044> speed <0.519231> *currentSpeed; + turn rleg to x-axis <-1.038462> speed <1.582418> *currentSpeed; + sleep 200 / currentSpeed; + + move lleg to y-axis [2.750000] speed [1.875000] *currentSpeed; + move lleg to z-axis [-3.875000] speed [0.656250] *currentSpeed; + move rleg to y-axis [1.250000] speed [0.750000] *currentSpeed; + turn pelvis to x-axis <0.000000> speed <0.787088> *currentSpeed; + turn lleg to x-axis <0.000000> speed <1.842033> *currentSpeed; + turn rleg to x-axis <0.000000> speed <0.778846> *currentSpeed; + sleep 1200 / currentSpeed; + + move lleg to z-axis [-1.750000] speed [1.593750] *currentSpeed; + move rleg to z-axis [0.500000] speed [1.218750] *currentSpeed; + sleep 1200 / currentSpeed; + + move lleg to z-axis [1.125000] speed [2.156250] *currentSpeed; + move rleg to y-axis [0.000000] speed [0.937500] *currentSpeed; + move rleg to z-axis [-0.750000] speed [0.937500] *currentSpeed; + turn rleg to x-axis <0.000000> now; + sleep 1200 / currentSpeed; + + move lleg to z-axis [2.500000] speed [0.515625] *currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [-3.250000] speed [0.937500] *currentSpeed; + turn lleg to x-axis <-10.192308> speed <3.822116> *currentSpeed; + turn rleg to x-axis <0.000000> now; + sleep 2000 / currentSpeed; + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + +StartMoving() +{ + signal SIG_MOVE; + if( notMoving ) start-script walk(); +} + +StopMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + sleep 120; + signal SIG_WALK; + notMoving = TRUE; +} + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM_3; + sleep restore_delay; + turn torso to y-axis <0.000000> speed <90.000000>; + wpn3_lasthead = 1000000; + return (0); +} + +Create() +{ + gun_3 = firepoint2; + restore_delay = 300; + notMoving = TRUE; + moveSpeed = get MAX_SPEED; + currentSpeed = 100; + start-script StopMoving(); + start-script SmokeUnit(); +} + +SetMaxReloadTime(Func_Var_1) +{ + restore_delay = Func_Var_1 * 5; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM_3; + turn torso to y-axis heading speed <5000.000000>; + turn head to x-axis <0.000000> - pitch speed <5000.000000>; + start-script RestoreAfterDelay(); + return (1); +} + +AimFromPrimary(piecenum) +{ + piecenum = head; +} + +QueryPrimary(piecenum) +{ + if (shooting_num==1) + { + piecenum=firepoint1; + } + + if (shooting_num==2) + { + piecenum=firepoint2; + } +} + +FirePrimary() +{ + if(shooting_num==1) + { + emit-sfx 1024 from firepoint2; + } + if(shooting_num==2) + { + emit-sfx 1024 from firepoint1; + } + shooting_num=shooting_num+1; + + if( shooting_num == 3) + { + shooting_num=1; + } +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode torso type EXPLODE_ON_HIT; + explode head type EXPLODE_ON_HIT; + explode rbarrel type EXPLODE_ON_HIT; + explode lbarrel type EXPLODE_ON_HIT; + explode lthigh type EXPLODE_ON_HIT; + explode lleg type EXPLODE_ON_HIT; + explode rthigh type EXPLODE_ON_HIT; + explode rleg type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xcrasher.cob b/Scripts/faction/xcrasher.cob new file mode 100644 index 000000000..43cf2b2cc Binary files /dev/null and b/Scripts/faction/xcrasher.cob differ diff --git a/Scripts/faction/xflea.bos b/Scripts/faction/xflea.bos new file mode 100644 index 000000000..f3e8cc9d3 --- /dev/null +++ b/Scripts/faction/xflea.bos @@ -0,0 +1,306 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, turret, lfupleg, lrupleg, rrupleg, + rfupleg, rrleg, rfleg, lrleg, lfleg; + +static-var bMoving, bAiming, Static_Var_3, restore_delay, wpn1_lasthead; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + if( bMoving ) + { + move lfupleg to y-axis [0.000000] now; + move lfupleg to y-axis [0.250000] speed [2.000000]; + move lrupleg to y-axis [0.000000] now; + move lrupleg to y-axis [0.900000] speed [8.000000]; + move rrupleg to y-axis [0.000000] now; + move rrupleg to y-axis [0.800000] speed [7.000000]; + turn base to x-axis <11.829670> now; + turn base to x-axis <22.000000> speed <94.000000>; + move base to y-axis [2] speed [20]; + turn lfupleg to x-axis <-50.208791> now; + turn lfupleg to x-axis <-22.000000> speed <254.000000>; + turn lrupleg to x-axis <23.203297> now; + turn lrupleg to x-axis <-28.005495> speed <473.000000>; + turn rfupleg to x-axis <-49.269231> now; + turn rfupleg to x-axis <-32.005495> speed <150.000000>; + turn rrupleg to x-axis <27.472527> now; + turn rrupleg to x-axis <-20.000000> speed <439.000000>; + turn rrleg to x-axis <45.010989> now; + turn rrleg to x-axis <-24.005495> speed <633.000000>; + turn rfleg to x-axis <0.000000> now; + turn rfleg to x-axis <12.000000> speed <111.000000>; + turn lrleg to x-axis <44.527473> now; + turn lrleg to x-axis <-9.000000> speed <495.000000>; + sleep 110; + } + if( bMoving ) + { + move lfupleg to y-axis [0.750000] speed [4.000000]; + move lrupleg to y-axis [1.600000] speed [6.000000]; + move rfupleg to y-axis [0.850000] speed [7.000000]; + move rrupleg to y-axis [1.450000] speed [5.000000]; + turn base to x-axis <0.000000> speed <188.000000>; + move base to y-axis [3] speed [10]; + turn lfupleg to x-axis <53.010989> speed <670.000000>; + turn lrupleg to x-axis <-39.005495> speed <96.000000>; + turn rfupleg to x-axis <51.010989> speed <742.000000>; + turn rrupleg to x-axis <-32.005495> speed <100.000000>; + turn rrleg to x-axis <14.000000> speed <348.000000>; + turn rfleg to x-axis <-52.010989> speed <570.000000>; + turn lrleg to x-axis <25.005495> speed <314.000000>; + turn lfleg to x-axis <-52.010989> speed <465.000000>; + sleep 113; + } + if( bMoving ) + { + move lrupleg to y-axis [1.819995] speed [4.000000]; + move rrupleg to y-axis [1.719995] speed [4.000000]; + turn base to x-axis <-12.000000> speed <241.000000>; + + move base to y-axis [2] speed [10]; + turn lfupleg to x-axis <87.016484> speed <604.000000>; + turn lrupleg to x-axis <-61.010989> speed <380.000000>; + turn rfupleg to x-axis <82.016484> speed <562.000000>; + turn rrupleg to x-axis <-61.010989> speed <528.000000>; + turn rrleg to x-axis <72.016484> speed <1036.000000>; + turn rfleg to x-axis <-58.010989> speed <105.000000>; + turn lrleg to x-axis <71.016484> speed <820.000000>; + sleep 56; + } + if( bMoving ) + { + move lrupleg to y-axis [1.650000] speed [3.000000]; + move rrupleg to y-axis [1.700000] speed [0.000000]; + turn base to x-axis <-26.005495> speed <232.000000>; + + move base to y-axis [0] speed [20]; + turn lfupleg to x-axis <121.027473> speed <584.000000>; + turn lrupleg to x-axis <-32.005495> speed <498.000000>; + turn rfupleg to x-axis <114.027473> speed <543.000000>; + turn rrupleg to x-axis <-31.005495> speed <526.000000>; + turn rrleg to x-axis <54.010989> speed <306.000000>; + turn rfleg to x-axis <-63.010989> speed <102.000000>; + turn lrleg to x-axis <57.010989> speed <245.000000>; + sleep 58; + } + if( bMoving ) + { + move lrupleg to y-axis [0.950000] speed [6.000000]; + move rrupleg to y-axis [1.100000] speed [5.000000]; + turn base to x-axis <0.000000> speed <232.000000>; + turn lfupleg to x-axis <60.010989> speed <545.000000>; + turn lrupleg to x-axis <3.000000> speed <321.000000>; + turn rfupleg to x-axis <53.010989> speed <545.000000>; + turn rrupleg to x-axis <-3.000000> speed <249.000000>; + turn rrleg to x-axis <30.005495> speed <219.000000>; + turn rfleg to x-axis <26.005495> speed <807.000000>; + turn lrleg to x-axis <22.000000> speed <308.000000>; + turn lfleg to x-axis <13.000000> speed <588.000000>; + sleep 112; + } +} + +walklegs() +{ + if( bMoving ) + { + move lfupleg to y-axis [0.000000] now; + move lfupleg to y-axis [0.250000] speed [2.000000]; + move lrupleg to y-axis [0.000000] now; + move lrupleg to y-axis [0.900000] speed [8.000000]; + move rrupleg to y-axis [0.000000] now; + move rrupleg to y-axis [0.800000] speed [7.000000]; + turn base to x-axis <11.829670> now; + turn base to x-axis <22.000000> speed <94.000000>; + move base to y-axis [2] speed [20]; + turn lfupleg to x-axis <-50.208791> now; + turn lfupleg to x-axis <-22.000000> speed <254.000000>; + turn lrupleg to x-axis <23.203297> now; + turn lrupleg to x-axis <-28.005495> speed <473.000000>; + turn rfupleg to x-axis <-49.269231> now; + turn rfupleg to x-axis <-32.005495> speed <150.000000>; + turn rrupleg to x-axis <27.472527> now; + turn rrupleg to x-axis <-20.000000> speed <439.000000>; + turn rrleg to x-axis <45.010989> now; + turn rrleg to x-axis <-24.005495> speed <633.000000>; + turn rfleg to x-axis <0.000000> now; + turn rfleg to x-axis <12.000000> speed <111.000000>; + turn lrleg to x-axis <44.527473> now; + turn lrleg to x-axis <-9.000000> speed <495.000000>; + sleep 110; + } + if( bMoving ) + { + move lfupleg to y-axis [0.750000] speed [4.000000]; + move lrupleg to y-axis [1.600000] speed [6.000000]; + move rfupleg to y-axis [0.850000] speed [7.000000]; + move rrupleg to y-axis [1.450000] speed [5.000000]; + turn base to x-axis <0.000000> speed <188.000000>; + move base to y-axis [3] speed [10]; + turn lfupleg to x-axis <53.010989> speed <670.000000>; + turn lrupleg to x-axis <-39.005495> speed <96.000000>; + turn rfupleg to x-axis <51.010989> speed <742.000000>; + turn rrupleg to x-axis <-32.005495> speed <100.000000>; + turn rrleg to x-axis <14.000000> speed <348.000000>; + turn rfleg to x-axis <-52.010989> speed <570.000000>; + turn lrleg to x-axis <25.005495> speed <314.000000>; + turn lfleg to x-axis <-52.010989> speed <465.000000>; + sleep 113; + } + if( bMoving ) + { + move lrupleg to y-axis [1.819995] speed [4.000000]; + move rrupleg to y-axis [1.719995] speed [4.000000]; + turn base to x-axis <-12.000000> speed <241.000000>; + + move base to y-axis [2] speed [10]; + turn lfupleg to x-axis <87.016484> speed <604.000000>; + turn lrupleg to x-axis <-61.010989> speed <380.000000>; + turn rfupleg to x-axis <82.016484> speed <562.000000>; + turn rrupleg to x-axis <-61.010989> speed <528.000000>; + turn rrleg to x-axis <72.016484> speed <1036.000000>; + turn rfleg to x-axis <-58.010989> speed <105.000000>; + turn lrleg to x-axis <71.016484> speed <820.000000>; + sleep 56; + } + if( bMoving ) + { + move lrupleg to y-axis [1.650000] speed [3.000000]; + move rrupleg to y-axis [1.700000] speed [0.000000]; + turn base to x-axis <-26.005495> speed <232.000000>; + + move base to y-axis [0] speed [20]; + turn lfupleg to x-axis <121.027473> speed <584.000000>; + turn lrupleg to x-axis <-32.005495> speed <498.000000>; + turn rfupleg to x-axis <114.027473> speed <543.000000>; + turn rrupleg to x-axis <-31.005495> speed <526.000000>; + turn rrleg to x-axis <54.010989> speed <306.000000>; + turn rfleg to x-axis <-63.010989> speed <102.000000>; + turn lrleg to x-axis <57.010989> speed <245.000000>; + sleep 58; + } + if( bMoving ) + { + move lrupleg to y-axis [0.950000] speed [6.000000]; + move rrupleg to y-axis [1.100000] speed [5.000000]; + turn base to x-axis <0.000000> speed <232.000000>; + turn lfupleg to x-axis <60.010989> speed <545.000000>; + turn lrupleg to x-axis <3.000000> speed <321.000000>; + turn rfupleg to x-axis <53.010989> speed <545.000000>; + turn rrupleg to x-axis <-3.000000> speed <249.000000>; + turn rrleg to x-axis <30.005495> speed <219.000000>; + turn rfleg to x-axis <26.005495> speed <807.000000>; + turn lrleg to x-axis <22.000000> speed <308.000000>; + turn lfleg to x-axis <13.000000> speed <588.000000>; + sleep 112; + } +} + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = bAiming; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + move lrupleg to y-axis [0.000000] speed [5.000000]; + move rfupleg to y-axis [0.000000] speed [5.000000]; + move rrupleg to y-axis [0.000000] speed [5.000000]; + turn lfupleg to x-axis <0.000000> speed <200.000000>; + turn lrupleg to x-axis <0.000000> speed <200.000000>; + turn rfupleg to x-axis <0.000000> speed <200.000000>; + turn rrupleg to x-axis <0.000000> speed <200.000000>; + turn rrleg to x-axis <0.000000> speed <200.000000>; + turn lrleg to x-axis <0.000000> speed <200.000000>; + move base to y-axis [0] speed [20]; + turn base to x-axis <0> speed <200>; + justmoved = FALSE; + } + sleep 100; + } + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from turret; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + bMoving = FALSE; + bAiming = FALSE; + Static_Var_3 = 1; + start-script SmokeUnit(); +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode turret type EXPLODE_ON_HIT; + explode lrleg type EXPLODE_ON_HIT; + explode lfleg type EXPLODE_ON_HIT; + explode rfleg type EXPLODE_ON_HIT; + explode rrleg type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/faction/xflea.cob b/Scripts/faction/xflea.cob new file mode 100644 index 000000000..25765627d Binary files /dev/null and b/Scripts/faction/xflea.cob differ diff --git a/Scripts/faction/xhammer.bos b/Scripts/faction/xhammer.bos new file mode 100644 index 000000000..df8ec921e --- /dev/null +++ b/Scripts/faction/xhammer.bos @@ -0,0 +1,624 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece pelvis, firepoint1, firepoint2, lvent, rvent, lthigh, rthigh, + torso, rleg, rfoot, lleg, lfoot, rarm, larm, rbarrel, lbarrel; + +static-var bMoving, Static_Var_2, Static_Var_3, Static_Var_4, gun_1, gun_2, + restore_delay, statechg_DesiredState, statechg_StateChanging, + moveSpeed, currentSpeed, restore, wpn1_lasthead, shooting_num; + +// Signal definitions +#define SIG_AIM 2 + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + +RockUnit(anglex, anglez) +{ + turn pelvis to x-axis anglex speed <50.000000>; + turn pelvis to z-axis <0> - anglez speed <50.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <20.000000>; + turn pelvis to x-axis <0.000000> speed <20.000000>; +} + + + +walk() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [4.267241] * currentSpeed / 100; + turn lthigh to x-axis <-62.934066> speed <537.109701> * currentSpeed / 100; + turn rthigh to x-axis <3.505495> speed <29.917587> * currentSpeed / 100; + turn torso to z-axis <-4.560440> speed <38.920997> * currentSpeed / 100; + turn rleg to x-axis <82.978022> speed <708.174498> * currentSpeed / 100; + turn rfoot to x-axis <-36.901099> speed <314.931793> * currentSpeed / 100; + turn lleg to x-axis <57.302198> speed <489.044621> * currentSpeed / 100; + turn lfoot to x-axis <5.258242> speed <44.876376> * currentSpeed / 100; + sleep 7000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.981928] * currentSpeed / 100; + turn lthigh to x-axis <-51.681319> speed <134.219512> * currentSpeed / 100; + turn rthigh to x-axis <-8.071429> speed <138.086202> * currentSpeed / 100; + turn torso to z-axis <0.000000> speed <54.395610> * currentSpeed / 100; + turn rleg to x-axis <105.835165> speed <272.633392> * currentSpeed / 100; + turn rfoot to x-axis <-27.071429> speed <117.245461> * currentSpeed / 100; + turn lleg to x-axis <45.346154> speed <142.608236> * currentSpeed / 100; + turn lfoot to x-axis <5.967033> speed <8.454254> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-39.368132> speed <146.868134> * currentSpeed / 100; + turn rthigh to x-axis <-20.027473> speed <142.608236> * currentSpeed / 100; + turn rleg to x-axis <118.846154> speed <155.191315> * currentSpeed / 100; + turn lleg to x-axis <38.670330> speed <79.627298> * currentSpeed / 100; + turn lfoot to x-axis <1.049451> speed <58.655496> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-29.170330> speed <121.636433> * currentSpeed / 100; + turn rthigh to x-axis <-30.236264> speed <121.767507> * currentSpeed / 100; + turn torso to z-axis <1.747253> speed <20.840729> * currentSpeed / 100; + turn rleg to x-axis <72.769231> speed <549.592214> * currentSpeed / 100; + turn rfoot to x-axis <-33.758242> speed <79.758372> * currentSpeed / 100; + turn lleg to x-axis <29.868132> speed <104.990073> * currentSpeed / 100; + turn lfoot to x-axis <-0.692308> speed <20.775198> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-20.390110> speed <104.727925> * currentSpeed / 100; + turn rthigh to x-axis <-56.258242> speed <310.382629> * currentSpeed / 100; + turn torso to z-axis <7.725275> speed <71.304118> * currentSpeed / 100; + turn rleg to x-axis <58.357143> speed <171.903218> * currentSpeed / 100; + turn lleg to x-axis <41.126374> speed <134.285055> * currentSpeed / 100; + turn lfoot to x-axis <-21.093407> speed <243.338410> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-16.516484> speed <46.203491> * currentSpeed / 100; + turn rthigh to x-axis <-57.659341> speed <16.711904> * currentSpeed / 100; + turn torso to z-axis <9.835165> speed <25.166158> * currentSpeed / 100; + turn rleg to x-axis <-10.192308> speed <817.638030> * currentSpeed / 100; + turn lleg to x-axis <59.412088> speed <218.106709> * currentSpeed / 100; + turn lfoot to x-axis <-31.637363> speed <125.765258> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-4.560440> speed <142.608236> * currentSpeed / 100; + turn rthigh to x-axis <-65.401099> speed <92.341451> * currentSpeed / 100; + turn torso to z-axis <10.192308> speed <4.259898> * currentSpeed / 100; + turn rleg to x-axis <35.857143> speed <549.264536> * currentSpeed / 100; + turn lleg to x-axis <53.434066> speed <71.304118> * currentSpeed / 100; + turn lfoot to x-axis <-33.758242> speed <25.297231> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <2.802198> speed <87.819417> * currentSpeed / 100; + turn rthigh to x-axis <-66.445055> speed <12.452005> * currentSpeed / 100; + turn torso to z-axis <7.027473> speed <37.749237> * currentSpeed / 100; + turn rleg to x-axis <43.236264> speed <88.016022> * currentSpeed / 100; + turn rfoot to x-axis <-7.725275> speed <310.513703> * currentSpeed / 100; + turn lleg to x-axis <57.313187> speed <46.269034> * currentSpeed / 100; + turn lfoot to x-axis <-29.527473> speed <50.463389> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.853448] * currentSpeed / 100; + turn lthigh to x-axis <5.269231> speed <21.054851> * currentSpeed / 100; + turn rthigh to x-axis <-61.527473> speed <41.969019> * currentSpeed / 100; + turn torso to z-axis <4.912088> speed <18.053717> * currentSpeed / 100; + turn rleg to x-axis <44.648352> speed <12.051441> * currentSpeed / 100; + turn rfoot to x-axis <16.868132> speed <209.892008> * currentSpeed / 100; + turn lleg to x-axis <78.401099> speed <179.974421> * currentSpeed / 100; + turn lfoot to x-axis <-34.791209> speed <44.923264> * currentSpeed / 100; + sleep 7000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-4.912088> speed <121.439829> * currentSpeed / 100; + turn rthigh to x-axis <-52.390110> speed <108.987824> * currentSpeed / 100; + turn torso to z-axis <0.000000> speed <58.589965> * currentSpeed / 100; + turn rleg to x-axis <43.236264> speed <16.842977> * currentSpeed / 100; + turn rfoot to x-axis <9.137363> speed <92.210377> * currentSpeed / 100; + turn lleg to x-axis <100.560440> speed <264.310212> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-21.445055> speed <197.200450> * currentSpeed / 100; + turn rthigh to x-axis <-36.214286> speed <192.940551> * currentSpeed / 100; + turn torso to z-axis <0.000000> now; + turn rfoot to x-axis <-7.027473> speed <192.809490> * currentSpeed / 100; + turn lleg to x-axis <103.725275> speed <37.749237> * currentSpeed / 100; + turn lfoot to x-axis <-52.736264> speed <214.043427> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-32.681319> speed <134.022908> * currentSpeed / 100; + turn rthigh to x-axis <-21.791209> speed <172.034292> * currentSpeed / 100; + turn torso to z-axis <-8.071429> speed <96.273671> * currentSpeed / 100; + turn rleg to x-axis <38.670330> speed <54.461140> * currentSpeed / 100; + turn rfoot to x-axis <-13.346154> speed <75.367400> * currentSpeed / 100; + turn lleg to x-axis <84.736264> speed <226.495432> * currentSpeed / 100; + turn lfoot to x-axis <-45.357143> speed <88.016022> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-68.912088> speed <432.150136> * currentSpeed / 100; + turn rthigh to x-axis <-10.890110> speed <130.025157> * currentSpeed / 100; + turn torso to z-axis <-10.192308> speed <25.297231> * currentSpeed / 100; + turn rleg to x-axis <37.615385> speed <12.583079> * currentSpeed / 100; + turn rfoot to x-axis <-21.445055> speed <96.601349> * currentSpeed / 100; + turn lleg to x-axis <79.104396> speed <67.175293> * currentSpeed / 100; + turn lfoot to x-axis <-37.967033> speed <88.147095> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-61.181319> speed <92.210377> * currentSpeed / 100; + turn rthigh to x-axis <3.505495> speed <171.706614> * currentSpeed / 100; + turn torso to z-axis <-8.769231> speed <16.974051> * currentSpeed / 100; + turn rleg to x-axis <26.357143> speed <134.285055> * currentSpeed / 100; + turn rfoot to x-axis <-22.846154> speed <16.711904> * currentSpeed / 100; + turn lleg to x-axis <9.835165> speed <826.223358> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + move pelvis to y-axis [-0.400000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-63.291209> speed <25.166158> * currentSpeed / 100; + turn rthigh to x-axis <17.214286> speed <163.514495> * currentSpeed / 100; + turn torso to z-axis <-7.027473> speed <20.775186> * currentSpeed / 100; + turn rleg to x-axis <29.170330> speed <33.554881> * currentSpeed / 100; + turn rfoot to x-axis <-21.093407> speed <20.906259> * currentSpeed / 100; + turn lleg to x-axis <28.824176> speed <226.495432> * currentSpeed / 100; + turn lfoot to x-axis <-1.390110> speed <436.278961> * currentSpeed / 100; + sleep 6000 / currentSpeed; +} + +walklegs() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [0.853448] * currentSpeed / 100; + turn lthigh to x-axis <-62.934066> speed <3.048031> * currentSpeed / 100; + turn rthigh to x-axis <3.505495> speed <116.997440> * currentSpeed / 100; + turn rleg to x-axis <82.978022> speed <459.220820> * currentSpeed / 100; + turn rfoot to x-axis <-36.901099> speed <134.910475> * currentSpeed / 100; + turn lleg to x-axis <57.302198> speed <243.045188> * currentSpeed / 100; + turn lfoot to x-axis <5.258242> speed <56.740246> * currentSpeed / 100; + sleep 7000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.981928] * currentSpeed / 100; + turn lthigh to x-axis <-51.681319> speed <134.219512> * currentSpeed / 100; + turn rthigh to x-axis <-8.071429> speed <138.086202> * currentSpeed / 100; + turn rleg to x-axis <105.835165> speed <272.633392> * currentSpeed / 100; + turn rfoot to x-axis <-27.071429> speed <117.245461> * currentSpeed / 100; + turn lleg to x-axis <45.346154> speed <142.608236> * currentSpeed / 100; + turn lfoot to x-axis <5.967033> speed <8.454254> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-39.368132> speed <146.868134> * currentSpeed / 100; + turn rthigh to x-axis <-20.027473> speed <142.608236> * currentSpeed / 100; + turn rleg to x-axis <118.846154> speed <155.191315> * currentSpeed / 100; + turn lleg to x-axis <38.670330> speed <79.627298> * currentSpeed / 100; + turn lfoot to x-axis <1.049451> speed <58.655496> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-29.170330> speed <121.636433> * currentSpeed / 100; + turn rthigh to x-axis <-30.236264> speed <121.767507> * currentSpeed / 100; + turn rleg to x-axis <72.769231> speed <549.592214> * currentSpeed / 100; + turn rfoot to x-axis <-33.758242> speed <79.758372> * currentSpeed / 100; + turn lleg to x-axis <29.868132> speed <104.990073> * currentSpeed / 100; + turn lfoot to x-axis <-0.692308> speed <20.775198> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-20.390110> speed <104.727925> * currentSpeed / 100; + turn rthigh to x-axis <-56.258242> speed <310.382629> * currentSpeed / 100; + turn rleg to x-axis <58.357143> speed <171.903218> * currentSpeed / 100; + turn lleg to x-axis <41.126374> speed <134.285055> * currentSpeed / 100; + turn lfoot to x-axis <-21.093407> speed <243.338410> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-16.516484> speed <46.203491> * currentSpeed / 100; + turn rthigh to x-axis <-57.659341> speed <16.711904> * currentSpeed / 100; + turn rleg to x-axis <-10.192308> speed <817.638030> * currentSpeed / 100; + turn lleg to x-axis <59.412088> speed <218.106709> * currentSpeed / 100; + turn lfoot to x-axis <-31.637363> speed <125.765258> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-4.560440> speed <142.608236> * currentSpeed / 100; + turn rthigh to x-axis <-65.401099> speed <92.341451> * currentSpeed / 100; + turn rleg to x-axis <35.857143> speed <549.264536> * currentSpeed / 100; + turn lleg to x-axis <53.434066> speed <71.304118> * currentSpeed / 100; + turn lfoot to x-axis <-33.758242> speed <25.297231> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <2.802198> speed <87.819417> * currentSpeed / 100; + turn rthigh to x-axis <-66.445055> speed <12.452005> * currentSpeed / 100; + turn rleg to x-axis <43.236264> speed <88.016022> * currentSpeed / 100; + turn rfoot to x-axis <-7.725275> speed <310.513703> * currentSpeed / 100; + turn lleg to x-axis <57.313187> speed <46.269034> * currentSpeed / 100; + turn lfoot to x-axis <-29.527473> speed <50.463389> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.853448] * currentSpeed / 100; + turn lthigh to x-axis <5.269231> speed <21.054851> * currentSpeed / 100; + turn rthigh to x-axis <-61.527473> speed <41.969019> * currentSpeed / 100; + turn rleg to x-axis <44.648352> speed <12.051441> * currentSpeed / 100; + turn rfoot to x-axis <16.868132> speed <209.892008> * currentSpeed / 100; + turn lleg to x-axis <78.401099> speed <179.974421> * currentSpeed / 100; + turn lfoot to x-axis <-34.791209> speed <44.923264> * currentSpeed / 100; + sleep 7000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-4.912088> speed <121.439829> * currentSpeed / 100; + turn rthigh to x-axis <-52.390110> speed <108.987824> * currentSpeed / 100; + turn rleg to x-axis <43.236264> speed <16.842977> * currentSpeed / 100; + turn rfoot to x-axis <9.137363> speed <92.210377> * currentSpeed / 100; + turn lleg to x-axis <100.560440> speed <264.310212> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-21.445055> speed <197.200450> * currentSpeed / 100; + turn rthigh to x-axis <-36.214286> speed <192.940551> * currentSpeed / 100; + turn rfoot to x-axis <-7.027473> speed <192.809490> * currentSpeed / 100; + turn lleg to x-axis <103.725275> speed <37.749237> * currentSpeed / 100; + turn lfoot to x-axis <-52.736264> speed <214.043427> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-32.681319> speed <134.022908> * currentSpeed / 100; + turn rthigh to x-axis <-21.791209> speed <172.034292> * currentSpeed / 100; + turn rleg to x-axis <38.670330> speed <54.461140> * currentSpeed / 100; + turn rfoot to x-axis <-13.346154> speed <75.367400> * currentSpeed / 100; + turn lleg to x-axis <84.736264> speed <226.495432> * currentSpeed / 100; + turn lfoot to x-axis <-45.357143> speed <88.016022> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.192771] * currentSpeed / 100; + turn lthigh to x-axis <-68.912088> speed <432.150136> * currentSpeed / 100; + turn rthigh to x-axis <-10.890110> speed <130.025157> * currentSpeed / 100; + turn rleg to x-axis <37.615385> speed <12.583079> * currentSpeed / 100; + turn rfoot to x-axis <-21.445055> speed <96.601349> * currentSpeed / 100; + turn lleg to x-axis <79.104396> speed <67.175293> * currentSpeed / 100; + turn lfoot to x-axis <-37.967033> speed <88.147095> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-61.181319> speed <92.210377> * currentSpeed / 100; + turn rthigh to x-axis <3.505495> speed <171.706614> * currentSpeed / 100; + turn rleg to x-axis <26.357143> speed <134.285055> * currentSpeed / 100; + turn rfoot to x-axis <-22.846154> speed <16.711904> * currentSpeed / 100; + turn lleg to x-axis <9.835165> speed <826.223358> * currentSpeed / 100; + sleep 6000 / currentSpeed; + } + move pelvis to y-axis [-0.400000] speed [1.789157] * currentSpeed / 100; + turn lthigh to x-axis <-63.291209> speed <25.166158> * currentSpeed / 100; + turn rthigh to x-axis <17.214286> speed <163.514495> * currentSpeed / 100; + turn rleg to x-axis <29.170330> speed <33.554881> * currentSpeed / 100; + turn rfoot to x-axis <-21.093407> speed <20.906259> * currentSpeed / 100; + turn lleg to x-axis <28.824176> speed <226.495432> * currentSpeed / 100; + turn lfoot to x-axis <-1.390110> speed <436.278961> * currentSpeed / 100; + sleep 6000 / currentSpeed; +} + +Go() +{ + Static_Var_2 = 1; + if( !Static_Var_4 ) + { + while( !Static_Var_3 ) + { + sleep 75; + } + move lvent to x-axis [-1.200000] speed [2.400000]; + move lvent to z-axis [-0.400000] speed [0.800000]; + move rvent to x-axis [1.200000] speed [2.400000]; + move rvent to z-axis [-0.400000] speed [0.800000]; + sleep 300; + Static_Var_4 = 1; + } +} + +Stop() +{ + if( Static_Var_4 ) + { + Static_Var_4 = 0; + move lvent to x-axis [0.000000] speed [2.400000]; + move lvent to z-axis [0.000000] speed [0.800000]; + move rvent to x-axis [0.000000] speed [2.400000]; + move rvent to z-axis [0.000000] speed [0.800000]; + sleep 300; + } + Static_Var_2 = 0; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState ) + { + call-script Stop(); + currentstate = 1; + } + else + { + call-script Go(); + currentstate = 0; + } + } + statechg_StateChanging = FALSE; +} + + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = Static_Var_2; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + move pelvis to y-axis [0.000000] speed [1.000000]; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn rleg to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lleg to x-axis <0.000000> speed <200.000000>; + if( !aiming ) + { + turn torso to y-axis <0.000000> speed <90.000000>; + } + justmoved = FALSE; + } + sleep 50; + } + } +} + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = 2 * (get CURRENT_SPEED)*100/moveSpeed; + if (currentSpeed<40) currentSpeed=40; + sleep 142; + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script UnitSpeed(); + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx 1025 from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + bMoving = FALSE; + Static_Var_2 = 0; + Static_Var_3 = 1; + Static_Var_4 = 0; + gun_1 = pelvis; + restore_delay = 3000; + hide firepoint2; + hide firepoint1; + restore = TRUE; + moveSpeed = get MAX_SPEED; + currentSpeed = 100; + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; + start-script SmokeUnit(); +} + +SetMaxReloadTime(Func_Var_1) +{ + restore_delay = Func_Var_1 * 2; +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM; + while (restore == FALSE) // attempt to block restore when switching from 1 to 2 or 2 to 1. + { + sleep 50; + } + sleep 50; + if (restore == TRUE) + { + sleep restore_delay; + set-signal-mask 0; + turn torso to y-axis <0.000000> speed <90.000000>; + turn larm to x-axis <0.000000> speed <45.000000>; + turn rarm to x-axis <0.000000> speed <45.000000>; + wpn1_lasthead = 1000000; + start-script RequestState(1); + } +} + +AimPrimary(heading, pitch) +{ + start-script RequestState(0); + signal SIG_AIM; + turn torso to y-axis heading speed <5000.000000>; + turn larm to x-axis <0.000000> - pitch speed <5000.000000>; + turn rarm to x-axis <0.000000> - pitch speed <5000.000000>; + + start-script RestoreAfterDelay(); + return (1); +} + +AimFromPrimary(piecenum) +{ + piecenum = torso; +} + +QueryPrimary(piecenum) +{ + if (shooting_num==1) + { + piecenum=firepoint1; + } + + if (shooting_num==2) + { + piecenum=firepoint2; + } +} + +FirePrimary() +{ + if(shooting_num==1) + { + emit-sfx 1024 from firepoint2; + } + if(shooting_num==2) + { + emit-sfx 1024 from firepoint1; + } + shooting_num=shooting_num+1; + + if( shooting_num == 3) + { + shooting_num=1; + } +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode lthigh type EXPLODE_ON_HIT; + explode rthigh type EXPLODE_ON_HIT; + explode lleg type EXPLODE_ON_HIT; + explode rleg type EXPLODE_ON_HIT; + explode lbarrel type EXPLODE_ON_HIT; + explode rbarrel type EXPLODE_ON_HIT; + explode larm type EXPLODE_ON_HIT; + explode rarm type EXPLODE_ON_HIT; + explode torso type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xhammer.cob b/Scripts/faction/xhammer.cob new file mode 100644 index 000000000..e94d3f2f2 Binary files /dev/null and b/Scripts/faction/xhammer.cob differ diff --git a/Scripts/faction/xkconstructor.bos b/Scripts/faction/xkconstructor.bos new file mode 100644 index 000000000..0714f051b --- /dev/null +++ b/Scripts/faction/xkconstructor.bos @@ -0,0 +1,399 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +#define SIG_BUILD 4 + +piece torso, pelvis, lthigh, rthigh, rleg, lleg, beamhinge, + rfoot, lfoot, beamcase, nano; + +static-var notBuilding, bMoving, moveSpeed, currentSpeed, + statechg_DesiredState, statechg_StateChanging; + + +walk() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.500000]; + move lthigh to y-axis [0.000000] now; + move rthigh to y-axis [0.000000] now; + move rleg to y-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + turn lthigh to x-axis <-44.291209> speed <364.368135>; + turn rthigh to x-axis <12.291209> speed <184.368135>; + turn rleg to x-axis <17.571429> speed <263.571435>; + turn rfoot to x-axis <-24.956044> speed <374.340660>; + turn lleg to x-axis <36.203297> speed <343.049455>; + turn lfoot to x-axis <2.445055> speed <36.675825>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.250000]; + turn lthigh to x-axis <-46.758242> speed <37.005495>; + turn rthigh to x-axis <20.390110> speed <121.483515>; + turn rfoot to x-axis <-31.280220> speed <94.862640>; + turn lleg to x-axis <20.390110> speed <237.197805>; + turn lfoot to x-axis <14.401099> speed <179.340660>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [2.250000]; + turn lthigh to x-axis <-46.758242> speed <701.373630>; + turn rthigh to x-axis <30.582418> speed <152.884620>; + turn rleg to x-axis <22.137363> speed <68.489010>; + turn rfoot to x-axis <-34.456044> speed <47.637360>; + turn lleg to x-axis <3.505495> speed <253.269225>; + turn lfoot to x-axis <9.489011> speed <73.681320>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [1.000000]; + turn lthigh to x-axis <-44.291209> speed <24.670330>; + turn rthigh to x-axis <43.236264> speed <126.538460>; + turn rleg to x-axis <20.027473> speed <21.098900>; + turn rfoot to x-axis <-42.538462> speed <80.824180>; + turn lleg to x-axis <44.291209> speed <407.857140>; + turn lfoot to x-axis <0.000000> speed <94.890110>; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [1.500000]; + turn lthigh to x-axis <-36.560440> speed <115.961535>; + turn rthigh to x-axis <24.956044> speed <274.203300>; + turn rleg to x-axis <49.214286> speed <437.802195>; + turn rfoot to x-axis <-54.148352> speed <174.148350>; + turn lleg to x-axis <44.291209> speed <664.368135>; + turn lfoot to x-axis <-8.769231> speed <131.538465>; + sleep 5300 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.250000]; + turn lthigh to x-axis <-27.071429> speed <142.335165>; + turn rthigh to x-axis <9.137363> speed <237.280215>; + turn rleg to x-axis <60.467033> speed <168.791205>; + turn rfoot to x-axis <-56.258242> speed <31.648350>; + turn lleg to x-axis <44.291209> now; + turn lfoot to x-axis <-17.923077> speed <137.307690>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.900000] speed [9.750000]; + turn lthigh to x-axis <-16.516484> speed <158.324175>; + turn rthigh to x-axis <0.000000> speed <137.060445>; + turn rleg to x-axis <60.115385> speed <5.274720>; + turn rfoot to x-axis <-47.467033> speed <131.868135>; + turn lleg to x-axis <33.038462> speed <168.791205>; + turn lfoot to x-axis <-16.516484> speed <21.098895>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [13.500000]; + turn lthigh to x-axis <-4.912088> speed <174.065940>; + turn rthigh to x-axis <-19.681319> speed <295.219785>; + turn rleg to x-axis <60.824176> speed <10.631865>; + turn rfoot to x-axis <-36.560440> speed <163.598895>; + turn lleg to x-axis <22.505495> speed <157.994505>; + turn lfoot to x-axis <-17.571429> speed <15.824175>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [1.500000]; + turn lthigh to x-axis <4.912088> speed <147.362640>; + turn rthigh to x-axis <-46.401099> speed <400.796700>; + turn rfoot to x-axis <-19.681319> speed <253.186815>; + turn lleg to x-axis <23.203297> speed <10.467030>; + turn lfoot to x-axis <-25.313187> speed <116.126370>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.250000]; + turn lthigh to x-axis <16.170330> speed <168.873630>; + turn rthigh to x-axis <-46.049451> speed <5.274720>; + turn rleg to x-axis <18.615385> speed <633.131865>; + turn rfoot to x-axis <13.000000> speed <490.219785>; + turn lleg to x-axis <22.505495> speed <10.467030>; + turn lfoot to x-axis <-34.456044> speed <137.142855>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [2.250000]; + turn lthigh to x-axis <20.390110> speed <63.296700>; + turn rthigh to x-axis <-46.401099> speed <5.274720>; + turn rleg to x-axis <-8.423077> speed <405.576930>; + turn rfoot to x-axis <26.357143> speed <200.357145>; + turn lfoot to x-axis <-35.148352> speed <10.384620>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.500000] speed [1.000000]; + turn lthigh to x-axis <23.203297> speed <28.131870>; + turn rthigh to x-axis <-45.005495> speed <13.956040>; + turn rleg to x-axis <46.049451> speed <544.725280>; + turn rfoot to x-axis <-1.390110> speed <277.472530>; + turn lleg to x-axis <37.615385> speed <151.098900>; + turn lfoot to x-axis <-43.593407> speed <84.450550>; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [1.500000]; + turn lthigh to x-axis <15.456044> speed <116.208795>; + turn rthigh to x-axis <-39.725275> speed <79.203300>; + turn rfoot to x-axis <-6.313187> speed <73.846155>; + turn lleg to x-axis <63.291209> speed <385.137360>; + turn lfoot to x-axis <-52.736264> speed <137.142855>; + sleep 5300 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.250000] speed [2.250000]; + turn lthigh to x-axis <6.670330> speed <131.785710>; + turn rthigh to x-axis <-30.582418> speed <137.142855>; + turn rfoot to x-axis <-15.456044> speed <137.142855>; + turn lleg to x-axis <66.445055> speed <47.307690>; + turn lfoot to x-axis <-51.324176> speed <21.181320>; + sleep 4700 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [2.250000]; + turn lthigh to x-axis <-2.445055> speed <136.730775>; + turn rthigh to x-axis <-20.027473> speed <158.324175>; + turn rleg to x-axis <41.835165> speed <63.214290>; + turn rfoot to x-axis <-21.791209> speed <95.027475>; + turn lleg to x-axis <66.802198> speed <5.357145>; + turn lfoot to x-axis <-55.901099> speed <68.653845>; + sleep 4700 / currentSpeed; + } + move pelvis to y-axis [0.000000] speed [1.500000]; + turn lthigh to x-axis <-18.626374> speed <242.719785>; + turn rthigh to x-axis <2.802198> speed <342.445065>; + turn rleg to x-axis <17.571429> speed <363.956040>; + turn rfoot to x-axis <-20.736264> speed <15.824175>; + turn lleg to x-axis <54.148352> speed <189.807690>; + turn lfoot to x-axis <-36.560440> speed <290.109885>; + sleep 4700 / currentSpeed; +} + +MotionControl(Func_Var_1, Func_Var_2) +{ + while( TRUE ) + { + Func_Var_1 = bMoving; + //Func_Var_2 = notBuilding; + if( Func_Var_1 ) + { + call-script walk(); + /* + if( Func_Var_2 ) + { + call-script walk(); + } + else + { + call-script walk(); + } + */ + } + else + { + sleep 200; + } + } +} + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = (get CURRENT_SPEED)*100/moveSpeed; + if (currentSpeed<20) currentSpeed=20; + sleep 142; + } +} + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script UnitSpeed(); + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Go() +{ + turn beamcase to z-axis <-90> speed <180>; + wait-for-turn beamcase around z-axis; + + turn beamhinge to x-axis <90> speed <360>; + wait-for-turn beamhinge around x-axis; +} + +Stop() +{ + set INBUILDSTANCE to 0; + + turn beamhinge to x-axis <0> speed <360>; + wait-for-turn beamhinge around x-axis; + + turn beamcase to z-axis <0> speed <180>; + wait-for-turn beamcase around z-axis; + + + + turn torso to y-axis <0.000000> speed <160.000000>; + wait-for-turn torso around y-axis; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState ) + { + call-script Stop(); + notBuilding = 1; + currentstate = 1; + } + else + { + call-script Go(); + notBuilding = 0; + currentstate = 0; + } + } + statechg_StateChanging = FALSE; +} + +Create() +{ + bMoving = FALSE; + notBuilding = 1; + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; + moveSpeed = get MAX_SPEED; + currentSpeed = 100; + start-script SmokeUnit(); +} + +Activate() +{ + start-script RequestState(0); +} + +Deactivate() +{ + start-script RequestState(1); +} + +StartBuilding(heading, pitch) +{ + start-script RequestState(0); + while( notBuilding ) sleep 100; + signal SIG_BUILD; + turn torso to y-axis heading speed <600.000000>; + wait-for-turn torso around y-axis; + set INBUILDSTANCE to 1; +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + sleep 6000; + set-signal-mask 0; + signal SIG_BUILD; + start-script RequestState(1); +} + +StartMoving() +{ + bMoving = TRUE; + currentSpeed = 50; +} + +StopMoving() +{ + bMoving = FALSE; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nano; +} + +/* +TargetHeading(Func_Var_1) +{ + Static_Var_1 = 0 - Func_Var_1; +} +*/ + +SweetSpot(piecenum) +{ + piecenum = torso; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode torso type EXPLODE_ON_HIT; + explode beamhinge type EXPLODE_ON_HIT; + explode beamcase type EXPLODE_ON_HIT; + explode lleg type EXPLODE_ON_HIT; + explode lfoot type EXPLODE_ON_HIT; + explode rleg type EXPLODE_ON_HIT; + explode rfoot type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xkconstructor.cob b/Scripts/faction/xkconstructor.cob new file mode 100644 index 000000000..8d2b6e577 Binary files /dev/null and b/Scripts/faction/xkconstructor.cob differ diff --git a/Scripts/faction/xklab.bos b/Scripts/faction/xklab.bos new file mode 100644 index 000000000..f2bb349b3 --- /dev/null +++ b/Scripts/faction/xklab.bos @@ -0,0 +1,184 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base,head1,head2,nano1,nano2,nano3,nano4,center1,center2,side1,side2,pad,nanojoined1,nanojoined2; + +static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building, terraintype; + +// Signal definitions +#define SIG_ACTIVATE 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +OpenYard() +{ + set YARD_OPEN to 1; + while( !get YARD_OPEN ) + { + set BUGGER_OFF to 1; + sleep 1500; + set YARD_OPEN to 1; + } + set BUGGER_OFF to 0; +} + +CloseYard() +{ + set YARD_OPEN to 0; + while( get YARD_OPEN ) + { + set BUGGER_OFF to 1; + sleep 1500; + set YARD_OPEN to 0; + } + set BUGGER_OFF to 0; +} + +Go() +{ + call-script OpenYard(); + set INBUILDSTANCE to 1; +} + +Stop() +{ + set INBUILDSTANCE to 0; + call-script CloseYard(); + +} + +InitState() +{ + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState == 0 ) + { + call-script Go(); + currentstate = 0; + } + if( statechg_DesiredState == 1 ) + { + call-script Stop(); + currentstate = 1; + } + } + statechg_StateChanging = FALSE; +} + +Create() +{ + unitviewer = FALSE; + spray = 0; + call-script InitState(); + start-script SmokeUnit(); +} + +QueryNanoPiece(piecenum) +{ + if( spray == 0 ) + { + piecenum = nano1; + } + if( spray == 1 ) + { + piecenum = nano2; + } + if( spray == 2 ) + { + piecenum = nano3; + } + if( spray == 3 ) + { + piecenum = nano4; + } + ++spray; + if( spray >= 4 ) + { + spray = 0; + } +} + + +Activate() +{ + signal SIG_ACTIVATE; + start-script RequestState(0); +} + +Deactivate() +{ + signal SIG_ACTIVATE; + set-signal-mask SIG_ACTIVATE; + + set-signal-mask 0; + start-script RequestState(1); +} + +StartBuilding() +{ +building = 1; +} + +StopBuilding() +{ +building = 0; +} + +QueryBuildInfo(piecenum) +{ + piecenum = pad; +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode head1 type EXPLODE_ON_HIT; + explode head2 type EXPLODE_ON_HIT; + explode side1 type EXPLODE_ON_HIT; + explode side2 type EXPLODE_ON_HIT; + explode center1 type EXPLODE_ON_HIT; + explode center2 type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xklab.cob b/Scripts/faction/xklab.cob new file mode 100644 index 000000000..464d229a1 Binary files /dev/null and b/Scripts/faction/xklab.cob differ diff --git a/Scripts/faction/xllt.bos b/Scripts/faction/xllt.bos new file mode 100644 index 000000000..a4a649ce2 --- /dev/null +++ b/Scripts/faction/xllt.bos @@ -0,0 +1,86 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, firepoint, turret, sleeve, barrel; + +// Signal definitions +#define SIG_AIM 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + hide firepoint; + dont-cache firepoint; + dont-cache turret; + dont-cache sleeve; + dont-cache barrel; + dont-shade firepoint; + dont-shade turret; + dont-shade sleeve; + dont-shade barrel; + start-script SmokeUnit(); +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn turret to y-axis heading speed <5000.000000>; + turn sleeve to x-axis <0.000000> - pitch speed <5000.000000>; + wait-for-turn turret around y-axis; + wait-for-turn sleeve around x-axis; + return (1); +} + +FirePrimary() +{ + emit-sfx 1024 + 0 from firepoint; +} + +AimFromPrimary(piecenum) +{ + piecenum = sleeve; +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode turret type EXPLODE_ON_HIT; + explode sleeve type EXPLODE_ON_HIT; + explode barrel type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xllt.cob b/Scripts/faction/xllt.cob new file mode 100644 index 000000000..d6327dc10 Binary files /dev/null and b/Scripts/faction/xllt.cob differ diff --git a/Scripts/faction/xmetalextractor.bos b/Scripts/faction/xmetalextractor.bos new file mode 100644 index 000000000..dc3f42734 --- /dev/null +++ b/Scripts/faction/xmetalextractor.bos @@ -0,0 +1,103 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, arms1, arms2; + +static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging, ball1state, ball2state, ball3state, ball4state, ballstate; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Go() +{ + spin arms1 around y-axis speed <50> accelerate <10>; + spin arms2 around y-axis speed <-75> accelerate <10>; +} + +Stop() +{ + stop-spin arms1 around y-axis decelerate <25>; + stop-spin arms2 around y-axis decelerate <25>; +} + +InitState() +{ + statechg_DesiredState = TRUE; + statechg_StateChanging = FALSE; +} + +RequestState(requestedstate, currentstate) +{ + if( statechg_StateChanging ) + { + statechg_DesiredState = requestedstate; + return (0); + } + statechg_StateChanging = TRUE; + currentstate = statechg_DesiredState; + statechg_DesiredState = requestedstate; + while( statechg_DesiredState != currentstate ) + { + if( statechg_DesiredState == 0 ) + { + call-script Go(); + currentstate = 0; + } + if( statechg_DesiredState == 1 ) + { + call-script Stop(); + currentstate = 1; + } + } + statechg_StateChanging = FALSE; +} + +Create() +{ + call-script InitState(); + start-script SmokeUnit(); +} + +Activate() +{ + start-script RequestState(0); +} + +Deactivate() +{ + start-script RequestState(1); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode arms1 type EXPLODE_ON_HIT; + explode arms2 type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xmetalextractor.cob b/Scripts/faction/xmetalextractor.cob new file mode 100644 index 000000000..e415a4aff Binary files /dev/null and b/Scripts/faction/xmetalextractor.cob differ diff --git a/Scripts/faction/xnukesilo.bos b/Scripts/faction/xnukesilo.bos new file mode 100644 index 000000000..82d410eaf --- /dev/null +++ b/Scripts/faction/xnukesilo.bos @@ -0,0 +1,84 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, firepoint; // these are the pieces of the model + +static-var steaming; // these are the variables + +// Signal definitions +#define SIG_AIM 2 + +SmokeUnit()// this is a standard smoke point define +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + +Steam() +{ + while( TRUE ) + { + if (steaming) + { + emit-sfx 1026 + 0 from firepoint; + } + sleep 128; + } +} + +Create() // tells it what to do on creation +{ + start-script SmokeUnit(); + start-script Steam(); + steaming=TRUE; +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +start-script RestoreAfterDelay(); +start-script Steam(); +return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = base; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ +piecenum = firepoint; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xnukesilo.cob b/Scripts/faction/xnukesilo.cob new file mode 100644 index 000000000..8e2a418ff Binary files /dev/null and b/Scripts/faction/xnukesilo.cob differ diff --git a/Scripts/faction/xrocketturret.bos b/Scripts/faction/xrocketturret.bos new file mode 100644 index 000000000..139024f5b --- /dev/null +++ b/Scripts/faction/xrocketturret.bos @@ -0,0 +1,95 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, firepoint1, turret, launcher, sleeve; + +static-var gun_1; + +// Signal definitions +#define SIG_AIM 2 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx smoketype from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } + return (0); +} + +Create() +{ + start-script SmokeUnit(); + return (0); +} + +RestoreAfterDelay() +{ + sleep 3000; + stop-spin sleeve around x-axis decelerate <15.000000>; + turn turret to y-axis <0> speed <60>; + turn launcher to x-axis <0> speed <30>; +} + + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn turret to y-axis heading speed <5000.000000>; + turn launcher to x-axis <0.000000> - pitch speed <5000.000000>; + spin sleeve around z-axis speed <100.000000>; + wait-for-turn turret around y-axis; + wait-for-turn launcher around x-axis; + start-script RestoreAfterDelay(); + return (1); +} + +FirePrimary() +{ + emit-sfx 1024 from firepoint1; + return (0); +} + +AimFromPrimary(piecenum) +{ + piecenum = turret; + return (0); +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint1; + return (0); +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; + explode turret type EXPLODE_ON_HIT; + explode launcher type EXPLODE_ON_HIT; + explode sleeve type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xrocketturret.cob b/Scripts/faction/xrocketturret.cob new file mode 100644 index 000000000..396f663e8 Binary files /dev/null and b/Scripts/faction/xrocketturret.cob differ diff --git a/Scripts/faction/xrocko.bos b/Scripts/faction/xrocko.bos new file mode 100644 index 000000000..9d925a519 --- /dev/null +++ b/Scripts/faction/xrocko.bos @@ -0,0 +1,538 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece torso, lbarrel, lmisspod, rshield, pelvis, rfoot, lfoot, lthigh, + rthigh, lleg, rleg, firepoint, exhaust; + +static-var bMoving, bAiming, Static_Var_3, restore_delay, moveSpeed, currentSpeed, wpn1_lasthead; + +// Signal definitions +#define SIG_AIM 4 + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + + + +walk() +{ + if( bMoving ) + { + move pelvis to y-axis [0.350000] speed [2.987069] * currentSpeed / 100; + move torso to y-axis [0.000000] now; + move rfoot to y-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lfoot to y-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + turn pelvis to y-axis <0.000000> now; + turn pelvis to z-axis <0.021978> speed <0.187571> * currentSpeed / 100; + turn torso to z-axis <-8.087912> speed <69.026146> * currentSpeed / 100; + turn lthigh to x-axis <-5.868132> speed <50.081471> * currentSpeed / 100; + turn rthigh to x-axis <8.379121> speed <71.511464> * currentSpeed / 100; + turn rfoot to x-axis <-8.379121> speed <71.511464> * currentSpeed / 100; + turn rfoot to z-axis <7.961538> speed <67.947609> * currentSpeed / 100; + turn lleg to x-axis <48.626374> speed <415.000951> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.250000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-2.934066> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.109890> speed <0.750283> * currentSpeed / 100; + turn torso to z-axis <-5.626374> speed <21.007954> * currentSpeed / 100; + turn lthigh to x-axis <-15.087912> speed <78.686053> * currentSpeed / 100; + turn rthigh to x-axis <10.060440> speed <14.349188> * currentSpeed / 100; + turn rfoot to x-axis <-6.285714> speed <17.866146> * currentSpeed / 100; + turn rfoot to z-axis <5.445055> speed <21.476881> * currentSpeed / 100; + turn lleg to x-axis <22.214286> speed <225.413510> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-6.285714> speed <28.604582> * currentSpeed / 100; + turn pelvis to z-axis <0.148352> speed <0.328253> * currentSpeed / 100; + turn torso to z-axis <-2.109890> speed <30.011372> * currentSpeed / 100; + turn lthigh to x-axis <-24.313187> speed <78.732950> * currentSpeed / 100; + turn rthigh to x-axis <12.153846> speed <17.866137> * currentSpeed / 100; + turn rfoot to x-axis <-9.219780> speed <25.040736> * currentSpeed / 100; + turn rfoot to z-axis <7.961538> speed <21.476881> * currentSpeed / 100; + turn lleg to x-axis <9.637363> speed <107.337532> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.050000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-9.219780> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.060440> speed <0.750283> * currentSpeed / 100; + turn torso to z-axis <1.406593> speed <30.011364> * currentSpeed / 100; + turn rleg to x-axis <18.021978> speed <153.808261> * currentSpeed / 100; + turn rfoot to x-axis <-12.994505> speed <32.215325> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.426724] * currentSpeed / 100; + move torso to y-axis [-0.399994] speed [3.413742] * currentSpeed / 100; + turn pelvis to y-axis <-12.153846> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.027473> speed <0.750292> * currentSpeed / 100; + turn torso to z-axis <4.219780> speed <24.009096> * currentSpeed / 100; + turn lthigh to x-axis <-27.247253> speed <25.040736> * currentSpeed / 100; + turn rthigh to x-axis <24.313187> speed <103.773686> * currentSpeed / 100; + turn rleg to x-axis <20.120879> speed <17.913034> * currentSpeed / 100; + turn rfoot to x-axis <-5.868132> speed <60.819907> * currentSpeed / 100; + turn rfoot to z-axis <0.000000> speed <67.947609> * currentSpeed / 100; + turn lleg to x-axis <30.598901> speed <178.895885> * currentSpeed / 100; + turn lfoot to x-axis <-3.351648> speed <28.604582> * currentSpeed / 100; + turn lfoot to z-axis <-2.510989> speed <21.429992> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move torso to y-axis [-0.199994] speed [3.960000] * currentSpeed / 100; + turn pelvis to y-axis <-10.043956> speed <41.775822> * currentSpeed / 100; + turn pelvis to z-axis <-0.027473> now; + sleep 2000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [1.280172] * currentSpeed / 100; + move torso to y-axis [0.000000] speed [1.706845] * currentSpeed / 100; + turn pelvis to y-axis <-6.285714> speed <32.074652> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> speed <0.093785> * currentSpeed / 100; + turn torso to z-axis <6.329670> speed <18.006820> * currentSpeed / 100; + turn lthigh to x-axis <-15.928571> speed <96.599096> * currentSpeed / 100; + turn rthigh to x-axis <15.087912> speed <78.732950> * currentSpeed / 100; + turn rleg to x-axis <26.406593> speed <53.645318> * currentSpeed / 100; + turn lfoot to x-axis <-14.247253> speed <92.988353> * currentSpeed / 100; + turn lfoot to z-axis <-6.285714> speed <32.215325> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.250000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-2.934066> speed <28.604582> * currentSpeed / 100; + turn pelvis to z-axis <0.087912> speed <1.078537> * currentSpeed / 100; + turn torso to z-axis <7.032967> speed <6.002276> * currentSpeed / 100; + turn lthigh to x-axis <-9.637363> speed <53.692206> * currentSpeed / 100; + turn rthigh to x-axis <5.027473> speed <85.860643> * currentSpeed / 100; + turn rleg to x-axis <9.637363> speed <143.116704> * currentSpeed / 100; + turn lleg to x-axis <23.054945> speed <64.383762> * currentSpeed / 100; + turn lfoot to x-axis <-12.571429> speed <14.302291> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.350000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <0.000000> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.054945> speed <1.219211> * currentSpeed / 100; + turn torso to z-axis <8.439560> speed <12.004544> * currentSpeed / 100; + turn lthigh to x-axis <16.763736> speed <225.319724> * currentSpeed / 100; + turn rthigh to x-axis <-5.868132> speed <92.988353> * currentSpeed / 100; + turn rleg to x-axis <0.000000> speed <82.249908> * currentSpeed / 100; + turn rfoot to x-axis <0.000000> speed <50.081471> * currentSpeed / 100; + turn lleg to x-axis <0.000000> speed <196.762031> * currentSpeed / 100; + turn lfoot to x-axis <-7.543956> speed <42.906882> * currentSpeed / 100; + turn lfoot to z-axis <-7.961538> speed <14.302291> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [1.706897] * currentSpeed / 100; + turn pelvis to y-axis <6.285714> speed <53.645318> * currentSpeed / 100; + turn pelvis to z-axis <-0.010989> speed <0.375142> * currentSpeed / 100; + turn torso to z-axis <2.109890> speed <54.020459> * currentSpeed / 100; + turn lthigh to x-axis <20.120879> speed <28.651479> * currentSpeed / 100; + turn rthigh to x-axis <-12.571429> speed <57.209173> * currentSpeed / 100; + turn lleg to x-axis <5.027473> speed <42.906882> * currentSpeed / 100; + turn lfoot to x-axis <-11.736264> speed <35.779180> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.050000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <9.219780> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.148352> speed <1.359893> * currentSpeed / 100; + turn torso to z-axis <-1.054945> speed <27.010230> * currentSpeed / 100; + turn rthigh to x-axis <-20.538462> speed <67.994506> * currentSpeed / 100; + turn lleg to x-axis <16.346154> speed <96.599088> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.426724] * currentSpeed / 100; + move torso to y-axis [-0.399994] speed [3.413742] * currentSpeed / 100; + turn pelvis to y-axis <12.153846> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> speed <1.594361> * currentSpeed / 100; + turn torso to z-axis <-4.923077> speed <33.012506> * currentSpeed / 100; + turn lthigh to x-axis <24.313187> speed <35.779180> * currentSpeed / 100; + turn rthigh to x-axis <-27.247253> speed <57.256061> * currentSpeed / 100; + turn rleg to x-axis <30.598901> speed <261.145793> * currentSpeed / 100; + turn rfoot to x-axis <-4.186813> speed <35.732283> * currentSpeed / 100; + turn rfoot to z-axis <4.186813> speed <35.732283> * currentSpeed / 100; + turn lleg to x-axis <20.956044> speed <39.343027> * currentSpeed / 100; + turn lfoot to x-axis <-7.543956> speed <35.779180> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move torso to y-axis [-0.199994] speed [3.960000] * currentSpeed / 100; + turn pelvis to y-axis <10.043956> speed <41.775822> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> now; + turn torso to z-axis <-4.571429> speed <6.962630> * currentSpeed / 100; + sleep 2000 / currentSpeed; + } + move torso to y-axis [0.000000] speed [1.706845] * currentSpeed / 100; + turn pelvis to y-axis <6.285714> speed <32.074652> * currentSpeed / 100; + turn pelvis to z-axis <0.038462> speed <0.656507> * currentSpeed / 100; + turn torso to z-axis <-6.329670> speed <15.005677> * currentSpeed / 100; + turn lthigh to x-axis <14.247253> speed <85.907540> * currentSpeed / 100; + turn rthigh to x-axis <-21.796703> speed <46.517625> * currentSpeed / 100; + turn rfoot to x-axis <-7.543956> speed <28.651479> * currentSpeed / 100; + turn rfoot to z-axis <5.868132> speed <14.349188> * currentSpeed / 100; + turn lleg to x-axis <33.950549> speed <110.901379> * currentSpeed / 100; + sleep 8000 / currentSpeed; +} + +walklegs() +{ + if( bMoving ) + { + move pelvis to y-axis [0.350000] speed [2.987069] * currentSpeed / 100; + move rfoot to y-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lfoot to y-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + turn pelvis to y-axis <0.000000> speed <53.645318> * currentSpeed / 100; + turn pelvis to z-axis <0.021978> speed <0.140682> * currentSpeed / 100; + turn lthigh to x-axis <-5.868132> speed <171.674406> * currentSpeed / 100; + turn rthigh to x-axis <8.379121> speed <257.535050> * currentSpeed / 100; + turn rfoot to x-axis <-8.379121> speed <7.127701> * currentSpeed / 100; + turn rfoot to z-axis <7.961538> speed <17.866137> * currentSpeed / 100; + turn lleg to x-axis <48.626374> speed <125.250575> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.250000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-2.934066> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.109890> speed <0.750283> * currentSpeed / 100; + turn lthigh to x-axis <-15.087912> speed <78.686053> * currentSpeed / 100; + turn rthigh to x-axis <10.060440> speed <14.349188> * currentSpeed / 100; + turn rfoot to x-axis <-6.285714> speed <17.866146> * currentSpeed / 100; + turn rfoot to z-axis <5.445055> speed <21.476881> * currentSpeed / 100; + turn lleg to x-axis <22.214286> speed <225.413510> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-6.285714> speed <28.604582> * currentSpeed / 100; + turn pelvis to z-axis <0.148352> speed <0.328253> * currentSpeed / 100; + turn lthigh to x-axis <-24.313187> speed <78.732950> * currentSpeed / 100; + turn rthigh to x-axis <12.153846> speed <17.866137> * currentSpeed / 100; + turn rfoot to x-axis <-9.219780> speed <25.040736> * currentSpeed / 100; + turn rfoot to z-axis <7.961538> speed <21.476881> * currentSpeed / 100; + turn lleg to x-axis <9.637363> speed <107.337532> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.050000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-9.219780> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.060440> speed <0.750283> * currentSpeed / 100; + turn rleg to x-axis <18.021978> speed <107.337532> * currentSpeed / 100; + turn rfoot to x-axis <-12.994505> speed <32.215325> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.426724] * currentSpeed / 100; + turn pelvis to y-axis <-12.153846> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.027473> speed <0.750292> * currentSpeed / 100; + turn lthigh to x-axis <-27.247253> speed <25.040736> * currentSpeed / 100; + turn rthigh to x-axis <24.313187> speed <103.773686> * currentSpeed / 100; + turn rleg to x-axis <20.120879> speed <17.913034> * currentSpeed / 100; + turn rfoot to x-axis <-5.868132> speed <60.819907> * currentSpeed / 100; + turn rfoot to z-axis <0.000000> speed <67.947609> * currentSpeed / 100; + turn lleg to x-axis <30.598901> speed <178.895885> * currentSpeed / 100; + turn lfoot to x-axis <-3.351648> speed <35.779180> * currentSpeed / 100; + turn lfoot to z-axis <-2.510989> speed <46.517616> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [1.280172] * currentSpeed / 100; + turn pelvis to y-axis <-6.285714> speed <50.081471> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> speed <0.093785> * currentSpeed / 100; + turn lthigh to x-axis <-15.928571> speed <96.599096> * currentSpeed / 100; + turn rthigh to x-axis <15.087912> speed <78.732950> * currentSpeed / 100; + turn rleg to x-axis <26.406593> speed <53.645318> * currentSpeed / 100; + turn lfoot to x-axis <-14.247253> speed <92.988353> * currentSpeed / 100; + turn lfoot to z-axis <-6.285714> speed <32.215325> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.250000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <-2.934066> speed <28.604582> * currentSpeed / 100; + turn pelvis to z-axis <0.087912> speed <1.078537> * currentSpeed / 100; + turn lthigh to x-axis <-9.637363> speed <53.692206> * currentSpeed / 100; + turn rthigh to x-axis <5.027473> speed <85.860643> * currentSpeed / 100; + turn rleg to x-axis <9.637363> speed <143.116704> * currentSpeed / 100; + turn lleg to x-axis <23.054945> speed <64.383762> * currentSpeed / 100; + turn lfoot to x-axis <-12.571429> speed <14.302291> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.350000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <0.000000> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.054945> speed <1.219211> * currentSpeed / 100; + turn lthigh to x-axis <16.763736> speed <225.319724> * currentSpeed / 100; + turn rthigh to x-axis <-5.868132> speed <92.988353> * currentSpeed / 100; + turn rleg to x-axis <0.000000> speed <82.249908> * currentSpeed / 100; + turn rfoot to x-axis <0.000000> speed <50.081471> * currentSpeed / 100; + turn lleg to x-axis <0.000000> speed <196.762031> * currentSpeed / 100; + turn lfoot to x-axis <-7.543956> speed <42.906882> * currentSpeed / 100; + turn lfoot to z-axis <-7.961538> speed <14.302291> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.150000] speed [1.706897] * currentSpeed / 100; + turn pelvis to y-axis <6.285714> speed <53.645318> * currentSpeed / 100; + turn pelvis to z-axis <-0.010989> speed <0.375142> * currentSpeed / 100; + turn lthigh to x-axis <20.120879> speed <28.651479> * currentSpeed / 100; + turn rthigh to x-axis <-12.571429> speed <57.209173> * currentSpeed / 100; + turn lleg to x-axis <5.027473> speed <42.906882> * currentSpeed / 100; + turn lfoot to x-axis <-11.736264> speed <35.779180> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.050000] speed [0.853448] * currentSpeed / 100; + turn pelvis to y-axis <9.219780> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <0.148352> speed <1.359893> * currentSpeed / 100; + turn rthigh to x-axis <-20.538462> speed <67.994506> * currentSpeed / 100; + turn lleg to x-axis <16.346154> speed <96.599088> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.426724] * currentSpeed / 100; + turn pelvis to y-axis <12.153846> speed <25.040736> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> speed <1.594361> * currentSpeed / 100; + turn lthigh to x-axis <24.313187> speed <35.779180> * currentSpeed / 100; + turn rthigh to x-axis <-27.247253> speed <57.256061> * currentSpeed / 100; + turn rleg to x-axis <30.598901> speed <261.145793> * currentSpeed / 100; + turn rfoot to x-axis <-4.186813> speed <35.732283> * currentSpeed / 100; + turn rfoot to z-axis <4.186813> speed <35.732283> * currentSpeed / 100; + turn lleg to x-axis <20.956044> speed <39.343027> * currentSpeed / 100; + turn lfoot to x-axis <-7.543956> speed <35.779180> * currentSpeed / 100; + sleep 8000 / currentSpeed; + } + if( bMoving ) + { + turn pelvis to y-axis <10.043956> speed <41.775822> * currentSpeed / 100; + turn pelvis to z-axis <-0.038462> now; + sleep 2000 / currentSpeed; + } + turn pelvis to y-axis <6.285714> speed <32.074652> * currentSpeed / 100; + turn pelvis to z-axis <0.038462> speed <0.656507> * currentSpeed / 100; + turn lthigh to x-axis <14.247253> speed <85.907540> * currentSpeed / 100; + turn rthigh to x-axis <-21.796703> speed <46.517625> * currentSpeed / 100; + turn rfoot to x-axis <-7.543956> speed <28.651479> * currentSpeed / 100; + turn rfoot to z-axis <5.868132> speed <14.349188> * currentSpeed / 100; + turn lleg to x-axis <33.950549> speed <110.901379> * currentSpeed / 100; + sleep 8000 / currentSpeed; +} + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = bAiming; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + move pelvis to y-axis [0.000000] speed [1.000000]; + turn rthigh to x-axis <0.000000> speed <200.043956>; + turn rleg to x-axis <0.000000> speed <200.043956>; + turn rfoot to x-axis <0.000000> speed <200.043956>; + turn lthigh to x-axis <0.000000> speed <200.043956>; + turn lleg to x-axis <0.000000> speed <200.043956>; + turn lfoot to x-axis <0.000000> speed <200.043956>; + turn torso to x-axis <0.000000> speed <90.021978>; + turn torso to z-axis <0.000000> speed <90.021978>; + if( !aiming ) + { + turn torso to y-axis <0.000000> speed <90.021978>; + turn lmisspod to x-axis <0.000000> speed <200.043956>; + } + justmoved = FALSE; + } + sleep 100; + } + } +} + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = 2 * (get CURRENT_SPEED)*100/moveSpeed; + if (currentSpeed<40) currentSpeed=40; + sleep 142; + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script UnitSpeed(); + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + bMoving = FALSE; + bAiming = FALSE; + Static_Var_3 = 1; + restore_delay = 3000; + moveSpeed = get MAX_SPEED; + currentSpeed = 100; + start-script SmokeUnit(); +} + +SetMaxReloadTime(Func_Var_1) +{ + restore_delay = Func_Var_1 * 2; +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + +SweetSpot(piecenum) +{ + piecenum = torso; +} + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM; + sleep restore_delay; + turn torso to y-axis <0.000000> speed <90.021978>; + turn lmisspod to x-axis <0.000000> speed <90.010989>; + wait-for-turn torso around y-axis; + wait-for-turn lmisspod around x-axis; + wpn1_lasthead = 1000000; + bAiming = FALSE; +} + +AimFromPrimary(piecenum) +{ + piecenum = torso; +} + +QueryPrimary(piecenum) +{ + piecenum = lbarrel; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + bAiming = TRUE; + while( !Static_Var_3 ) + { + return(0); + } + turn torso to y-axis heading speed <5000.027473>; + turn lmisspod to x-axis <-90> - pitch speed <5000.021978>; + if (((get ABS(wpn1_lasthead - heading)) > 65536) OR(((get ABS(wpn1_lasthead - heading)) > 1300) AND ((get ABS(wpn1_lasthead - heading)) < 64236))) + { + wpn1_lasthead = 1000000; + wait-for-turn torso around y-axis; + wait-for-turn lmisspod around x-axis; + } + start-script RestoreAfterDelay(); + wpn1_lasthead = heading; + return (1); +} + +FirePrimary() +{ + emit-sfx 1024 + 0 from firepoint; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode torso type EXPLODE_ON_HIT; + explode rshield type EXPLODE_ON_HIT; + explode lmisspod type EXPLODE_ON_HIT; + explode lbarrel type EXPLODE_ON_HIT; + explode rthigh type EXPLODE_ON_HIT; + explode rleg type EXPLODE_ON_HIT; + explode rfoot type EXPLODE_ON_HIT; + explode lthigh type EXPLODE_ON_HIT; + explode lleg type EXPLODE_ON_HIT; + explode lfoot type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xrocko.cob b/Scripts/faction/xrocko.cob new file mode 100644 index 000000000..83b0ca23b Binary files /dev/null and b/Scripts/faction/xrocko.cob differ diff --git a/Scripts/faction/xskulk.bos b/Scripts/faction/xskulk.bos new file mode 100644 index 000000000..303bb6dc7 --- /dev/null +++ b/Scripts/faction/xskulk.bos @@ -0,0 +1,671 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece torso, ruparm, luparm, rfire, lfire, rloarm, lloarm, pelvis, + rleg, rfoot, lleg, lfoot, lthigh, rthigh,lknee,rknee, aimy1, aimx1; + +static-var bMoving, bAiming, Static_Var_3, gun_1, moveSpeed, currentSpeed, animSpeed, wpn1_lasthead, shooting_num; + +// Signal definitions +#define SIG_AIM 4 + + +walk() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.337500] * currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + move lleg to z-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + move luparm to x-axis [0.000000] now; + move luparm to y-axis [0.000000] now; + move luparm to z-axis [0.000000] now; + move ruparm to x-axis [0.000000] now; + move ruparm to y-axis [0.000000] now; + move ruparm to z-axis [0.000000] now; + move rloarm to x-axis [0.000000] now; + move rfire to x-axis [0.000000] now; + move lloarm to x-axis [0.000000] now; + move lfire to x-axis [0.000000] now; + turn pelvis to x-axis <-0.423077> speed <0.317308> * currentSpeed; + turn torso to x-axis <12.648352> speed <9.486264> * currentSpeed; + turn lthigh to x-axis <11.060440> speed <8.295330> * currentSpeed; + turn rthigh to x-axis <-42.060440> speed <31.545330> * currentSpeed; + turn rleg to x-axis <-4.857143> speed <3.642857> * currentSpeed; + turn rfoot to x-axis <46.934066> speed <35.200550> * currentSpeed; + turn lleg to x-axis <61.000000> speed <45.750000> * currentSpeed; + turn lfoot to x-axis <-50.390110> speed <37.792583> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <34.093407> speed <17.274725> * currentSpeed; + turn rthigh to x-axis <-27.890110> speed <10.627747> * currentSpeed; + turn rleg to x-axis <-6.637363> speed <1.335165> * currentSpeed; + turn rfoot to x-axis <37.637363> speed <6.972527> * currentSpeed; + turn lleg to x-axis <33.615385> speed <20.538461> * currentSpeed; + turn lfoot to x-axis <-24.604396> speed <19.339285> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <28.747253> speed <4.009615> * currentSpeed; + turn rthigh to x-axis <-19.027473> speed <6.646978> * currentSpeed; + turn rleg to x-axis <-4.412088> speed <1.668956> * currentSpeed; + turn rfoot to x-axis <27.890110> speed <7.310440> * currentSpeed; + turn lleg to x-axis <13.725275> speed <14.917583> * currentSpeed; + turn lfoot to x-axis <-25.978022> speed <1.030219> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <12.813187> speed <11.950550> * currentSpeed; + turn rthigh to x-axis <0.000000> speed <14.270605> * currentSpeed; + turn rleg to x-axis <3.082418> speed <5.620879> * currentSpeed; + turn rfoot to x-axis <2.203297> speed <19.265110> * currentSpeed; + turn lleg to x-axis <-12.335165> speed <19.545330> * currentSpeed; + turn lfoot to x-axis <7.648352> speed <25.219780> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.302198> speed <0.259615> * currentSpeed; + turn lthigh to x-axis <-19.467033> speed <24.210165> * currentSpeed; + turn rthigh to x-axis <1.758242> speed <1.318682> * currentSpeed; + turn rleg to x-axis <8.401099> speed <3.989011> * currentSpeed; + turn rfoot to x-axis <-6.181319> speed <6.288462> * currentSpeed; + turn lleg to x-axis <-16.813187> speed <3.358516> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <26.142857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.302198> now; + turn lthigh to x-axis <-32.324176> speed <9.642857> * currentSpeed; + turn rthigh to x-axis <13.280220> speed <8.641484> * currentSpeed; + turn rleg to x-axis <23.159341> speed <11.068682> * currentSpeed; + turn rfoot to x-axis <-33.170330> speed <20.241758> * currentSpeed; + turn lfoot to x-axis <7.357143> speed <26.361264> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> speed <0.259615> * currentSpeed; + turn lthigh to x-axis <-36.291209> speed <2.975275> * currentSpeed; + turn rleg to x-axis <43.571429> speed <15.309066> * currentSpeed; + turn rfoot to x-axis <-43.148352> speed <7.483517> * currentSpeed; + turn lleg to x-axis <-10.082418> speed <5.048077> * currentSpeed; + turn lfoot to x-axis <28.236264> speed <15.659341> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> now; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-42.060440> speed <4.326923> * currentSpeed; + turn rthigh to x-axis <12.824176> speed <0.342033> * currentSpeed; + turn rleg to x-axis <60.692308> speed <12.840659> * currentSpeed; + turn rfoot to x-axis <-44.824176> speed <1.256868> * currentSpeed; + turn lleg to x-axis <-4.412088> speed <4.252748> * currentSpeed; + turn lfoot to x-axis <46.934066> speed <14.023352> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-32.758242> speed <6.976648> * currentSpeed; + turn rthigh to x-axis <34.093407> speed <15.951923> * currentSpeed; + turn rleg to x-axis <23.615385> speed <27.807692> * currentSpeed; + turn rfoot to x-axis <-10.791209> speed <25.524725> * currentSpeed; + turn lleg to x-axis <-5.747253> speed <1.001374> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <3.321428> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-25.225275> speed <5.649725> * currentSpeed; + turn rthigh to x-axis <28.769231> speed <3.993132> * currentSpeed; + turn rleg to x-axis <10.527473> speed <9.815934> * currentSpeed; + turn rfoot to x-axis <-20.978022> speed <7.640110> * currentSpeed; + turn lleg to x-axis <-3.978022> speed <1.326923> * currentSpeed; + turn lfoot to x-axis <33.648352> speed <6.642857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-12.390110> speed <9.626374> * currentSpeed; + turn rthigh to x-axis <-0.423077> speed <21.894231> * currentSpeed; + turn rleg to x-axis <-11.659341> speed <16.640110> * currentSpeed; + turn rfoot to x-axis <22.978022> speed <32.967033> * currentSpeed; + turn lleg to x-axis <4.115385> speed <6.070055> * currentSpeed; + turn lfoot to x-axis <14.016484> speed <14.723901> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <0.000000> speed <9.292582> * currentSpeed; + turn rthigh to x-axis <-19.467033> speed <14.282967> * currentSpeed; + turn rleg to x-axis <-20.302198> speed <6.482143> * currentSpeed; + turn rfoot to x-axis <23.445055> speed <0.350275> * currentSpeed; + turn lleg to x-axis <24.203297> speed <15.065934> * currentSpeed; + turn lfoot to x-axis <-20.736264> speed <26.064561> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <9.280220> speed <6.960165> * currentSpeed; + turn rthigh to x-axis <-28.769231> speed <6.976649> * currentSpeed; + turn rleg to x-axis <-25.225275> speed <3.692308> * currentSpeed; + turn rfoot to x-axis <26.115385> speed <2.002747> * currentSpeed; + turn lleg to x-axis <31.868132> speed <5.748626> * currentSpeed; + turn lfoot to x-axis <-37.637363> speed <12.675824> * currentSpeed; + sleep animSpeed; + } + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <11.060440> speed <1.335165> * currentSpeed; + turn rthigh to x-axis <-37.192308> speed <6.317308> * currentSpeed; + turn rleg to x-axis <-9.280220> speed <11.958791> * currentSpeed; + turn rfoot to x-axis <6.104396> speed <15.008242> * currentSpeed; + turn lleg to x-axis <47.604396> speed <11.802198> * currentSpeed; + turn lfoot to x-axis <-47.412088> speed <7.331044> * currentSpeed; + sleep animSpeed; +} + +walklegs() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + move lleg to z-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + move luparm to x-axis [0.000000] now; + move luparm to y-axis [0.000000] now; + move luparm to z-axis [0.000000] now; + move ruparm to x-axis [0.000000] now; + move ruparm to y-axis [0.000000] now; + move ruparm to z-axis [0.000000] now; + move rloarm to x-axis [0.000000] now; + move rfire to x-axis [0.000000] now; + move lloarm to x-axis [0.000000] now; + move lfire to x-axis [0.000000] now; + turn pelvis to x-axis <-0.423077> now; + turn lthigh to x-axis <11.060440> now; + turn rthigh to x-axis <-42.060440> speed <3.651099> * currentSpeed; + turn rleg to x-axis <-4.857143> speed <3.317308> * currentSpeed; + turn rfoot to x-axis <46.934066> speed <30.622253> * currentSpeed; + turn lleg to x-axis <61.000000> speed <10.046703> * currentSpeed; + turn lfoot to x-axis <-50.390110> speed <2.233517> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <34.093407> speed <17.274725> * currentSpeed; + turn rthigh to x-axis <-27.890110> speed <10.627747> * currentSpeed; + turn rleg to x-axis <-6.637363> speed <1.335165> * currentSpeed; + turn rfoot to x-axis <37.637363> speed <6.972527> * currentSpeed; + turn lleg to x-axis <33.615385> speed <20.538461> * currentSpeed; + turn lfoot to x-axis <-24.604396> speed <19.339285> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <28.747253> speed <4.009615> * currentSpeed; + turn rthigh to x-axis <-19.027473> speed <6.646978> * currentSpeed; + turn rleg to x-axis <-4.412088> speed <1.668956> * currentSpeed; + turn rfoot to x-axis <27.890110> speed <7.310440> * currentSpeed; + turn lleg to x-axis <13.725275> speed <14.917583> * currentSpeed; + turn lfoot to x-axis <-25.978022> speed <1.030219> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <12.813187> speed <11.950550> * currentSpeed; + turn rthigh to x-axis <0.000000> speed <14.270605> * currentSpeed; + turn rleg to x-axis <3.082418> speed <5.620879> * currentSpeed; + turn rfoot to x-axis <2.203297> speed <19.265110> * currentSpeed; + turn lleg to x-axis <-12.335165> speed <19.545330> * currentSpeed; + turn lfoot to x-axis <7.648352> speed <25.219780> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <-19.467033> speed <24.210165> * currentSpeed; + turn rthigh to x-axis <1.758242> speed <1.318682> * currentSpeed; + turn rleg to x-axis <8.401099> speed <3.989011> * currentSpeed; + turn rfoot to x-axis <-6.181319> speed <6.288462> * currentSpeed; + turn lleg to x-axis <-16.813187> speed <3.358516> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <26.142857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <-32.324176> speed <9.642857> * currentSpeed; + turn rthigh to x-axis <13.280220> speed <8.641484> * currentSpeed; + turn rleg to x-axis <23.159341> speed <11.068682> * currentSpeed; + turn rfoot to x-axis <-33.170330> speed <20.241758> * currentSpeed; + turn lfoot to x-axis <7.357143> speed <26.361264> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <-36.291209> speed <2.975275> * currentSpeed; + turn rleg to x-axis <43.571429> speed <15.309066> * currentSpeed; + turn rfoot to x-axis <-43.148352> speed <7.483517> * currentSpeed; + turn lleg to x-axis <-10.082418> speed <5.048077> * currentSpeed; + turn lfoot to x-axis <28.236264> speed <15.659341> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> now; + turn lthigh to x-axis <-42.060440> speed <4.326923> * currentSpeed; + turn rthigh to x-axis <12.824176> speed <0.342033> * currentSpeed; + turn rleg to x-axis <60.692308> speed <12.840659> * currentSpeed; + turn rfoot to x-axis <-44.824176> speed <1.256868> * currentSpeed; + turn lleg to x-axis <-4.412088> speed <4.252748> * currentSpeed; + turn lfoot to x-axis <46.934066> speed <14.023352> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <-32.758242> speed <6.976648> * currentSpeed; + turn rthigh to x-axis <34.093407> speed <15.951923> * currentSpeed; + turn rleg to x-axis <23.615385> speed <27.807692> * currentSpeed; + turn rfoot to x-axis <-10.791209> speed <25.524725> * currentSpeed; + turn lleg to x-axis <-5.747253> speed <1.001374> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <3.321428> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <-25.225275> speed <5.649725> * currentSpeed; + turn rthigh to x-axis <28.769231> speed <3.993132> * currentSpeed; + turn rleg to x-axis <10.527473> speed <9.815934> * currentSpeed; + turn rfoot to x-axis <-20.978022> speed <7.640110> * currentSpeed; + turn lleg to x-axis <-3.978022> speed <1.326923> * currentSpeed; + turn lfoot to x-axis <33.648352> speed <6.642857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <-12.390110> speed <9.626374> * currentSpeed; + turn rthigh to x-axis <-0.423077> speed <21.894231> * currentSpeed; + turn rleg to x-axis <-11.659341> speed <16.640110> * currentSpeed; + turn rfoot to x-axis <22.978022> speed <32.967033> * currentSpeed; + turn lleg to x-axis <4.115385> speed <6.070055> * currentSpeed; + turn lfoot to x-axis <14.016484> speed <14.723901> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <0.000000> speed <9.292582> * currentSpeed; + turn rthigh to x-axis <-19.467033> speed <14.282967> * currentSpeed; + turn rleg to x-axis <-20.302198> speed <6.482143> * currentSpeed; + turn rfoot to x-axis <23.445055> speed <0.350275> * currentSpeed; + turn lleg to x-axis <24.203297> speed <15.065934> * currentSpeed; + turn lfoot to x-axis <-20.736264> speed <26.064561> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <9.280220> speed <6.960165> * currentSpeed; + turn rthigh to x-axis <-28.769231> speed <6.976649> * currentSpeed; + turn rleg to x-axis <-25.225275> speed <3.692308> * currentSpeed; + turn rfoot to x-axis <26.115385> speed <2.002747> * currentSpeed; + turn lleg to x-axis <31.868132> speed <5.748626> * currentSpeed; + turn lfoot to x-axis <-37.637363> speed <12.675824> * currentSpeed; + sleep animSpeed; + } + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <11.060440> speed <1.335165> * currentSpeed; + turn rthigh to x-axis <-37.192308> speed <6.317308> * currentSpeed; + turn rleg to x-axis <-9.280220> speed <11.958791> * currentSpeed; + turn rfoot to x-axis <6.104396> speed <15.008242> * currentSpeed; + turn lleg to x-axis <47.604396> speed <11.802198> * currentSpeed; + turn lfoot to x-axis <-47.412088> speed <7.331044> * currentSpeed; + sleep animSpeed; +} + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = (get CURRENT_SPEED)*100/moveSpeed; + if (currentSpeed<20) currentSpeed=20; + animSpeed = 3700 / currentSpeed; + sleep 142; + } +} + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = bAiming; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + move pelvis to y-axis [0.000000] speed [1.000000]; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn rleg to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lleg to x-axis <0.000000> speed <200.000000>; + turn lfoot to x-axis <0.000000> speed <200.000000>; + if( !aiming ) + { + turn torso to y-axis <0.000000> speed <90.000000>; + turn rloarm to x-axis <0.000000> speed <200.000000>; + turn ruparm to x-axis <0.000000> speed <200.000000>; + turn lloarm to x-axis <0.000000> speed <200.000000>; + turn luparm to x-axis <0.000000> speed <200.000000>; + } + justmoved = FALSE; + } + sleep 100; + } + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script UnitSpeed(); + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + hide rfire; + hide lfire; + bMoving = FALSE; + bAiming = FALSE; + Static_Var_3 = 1; + gun_1 = torso; + shooting_num=1; + currentSpeed = 100; + moveSpeed = get MAX_SPEED; + animSpeed = 38; + //start-script InitialSetup1(); + start-script SmokeUnit(); +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + +SweetSpot(piecenum) +{ + piecenum = torso; +} + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM; + sleep 2750; + bAiming = FALSE; + turn torso to y-axis <0> speed <60>; + turn rloarm to x-axis <0> speed <30>; + turn lloarm to x-axis <0> speed <30>; +} + +AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM; +set-signal-mask SIG_AIM; +turn torso to y-axis heading speed <5000>; +turn rloarm to x-axis <0> - pitch speed <5000>; +turn lloarm to x-axis <0> - pitch speed <5000>; +wait-for-turn torso around y-axis; +wait-for-turn rloarm around x-axis; +wait-for-turn lloarm around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets +{ + + if(shooting_num==1) + { + emit-sfx 1024 from rfire; + } + + if(shooting_num==2) + { + emit-sfx 1024 from lfire; + } + + shooting_num=shooting_num+1; + + if( shooting_num == 3) + { + shooting_num=1; + } +} + +AimFromWeapon1(piecenum) // where it aims the weapon from +{ +piecenum = torso; +} + +QueryWeapon1(piecenum) // where the shot is called from +{ + if (shooting_num==1) + { + piecenum=lfire; + } + + if (shooting_num==2) + { + piecenum=rfire; + } +} + +Killed(severity, corpsetype) +{ + hide rfire; + hide lfire; + if( severity <= 25 ) + { + corpsetype = 1 ; + explode pelvis type BITMAPONLY | NOHEATCLOUD; + explode torso type BITMAPONLY | NOHEATCLOUD; + //explode ruparm type BITMAPONLY | NOHEATCLOUD; + //explode rloarm type BITMAPONLY | NOHEATCLOUD; + //explode rfire type BITMAPONLY | NOHEATCLOUD; + //explode luparm type BITMAPONLY | NOHEATCLOUD; + //explode lloarm type BITMAPONLY | NOHEATCLOUD; + //explode lfire type BITMAPONLY | NOHEATCLOUD; + //explode rthigh type BITMAPONLY | NOHEATCLOUD; + //explode rknee type BITMAPONLY | NOHEATCLOUD; + //explode rleg type BITMAPONLY | NOHEATCLOUD; + //explode rfoot type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lthigh type BITMAPONLY | NOHEATCLOUD; + //explode lknee type BITMAPONLY | NOHEATCLOUD; + //explode lleg type BITMAPONLY | NOHEATCLOUD; + //explode lfoot type BITMAPONLY | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 50 ) + { + corpsetype = 2 ; + explode pelvis type BITMAPONLY | NOHEATCLOUD; + explode torso type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode ruparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfire type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode luparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lfire type FALL | NOHEATCLOUD; + explode rthigh type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rknee type FALL | NOHEATCLOUD; + //explode rleg type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfoot type FALL | NOHEATCLOUD; + explode lthigh type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type FALL | NOHEATCLOUD; + explode lleg type FALL | NOHEATCLOUD; + explode lfoot type FIRE | SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 99 ) + { + corpsetype = 3 ; + explode pelvis type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode torso type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode ruparm type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfire type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode luparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lloarm type SMOKE | FALL | NOHEATCLOUD; + //explode lfire type SMOKE | FALL | NOHEATCLOUD; + //explode rthigh type SMOKE | FALL | NOHEATCLOUD; + //explode rknee type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rleg type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rfoot type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode lthigh type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lleg type SMOKE | FALL | NOHEATCLOUD; + explode lfoot type SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + corpsetype = 3 ; + explode pelvis type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode torso type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode ruparm type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode rfire type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode luparm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode lloarm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode lfire type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rthigh type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode rknee type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rleg type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode rfoot type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lthigh type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lleg type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lfoot type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + return corpsetype; +} diff --git a/Scripts/faction/xskulk.bosoriginal b/Scripts/faction/xskulk.bosoriginal new file mode 100644 index 000000000..2907d98d8 --- /dev/null +++ b/Scripts/faction/xskulk.bosoriginal @@ -0,0 +1,644 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" +#include "unitDefsTurretSpeeds.h" + +piece torso, ruparm, luparm, rfire, lfire, rloarm, lloarm, pelvis, + rleg, rfoot, lleg, lfoot, lthigh, rthigh,lknee,rknee, aimy1, aimx1; + +static-var bMoving, bAiming, Static_Var_3, gun_1, moveSpeed, currentSpeed, animSpeed, wpn1_lasthead; + +#include "weapon1control.h" + +// Signal definitions +#define SIG_AIM 4 + + +walk() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.337500] * currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + move lleg to z-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + move luparm to x-axis [0.000000] now; + move luparm to y-axis [0.000000] now; + move luparm to z-axis [0.000000] now; + move ruparm to x-axis [0.000000] now; + move ruparm to y-axis [0.000000] now; + move ruparm to z-axis [0.000000] now; + move rloarm to x-axis [0.000000] now; + move rfire to x-axis [0.000000] now; + move lloarm to x-axis [0.000000] now; + move lfire to x-axis [0.000000] now; + turn pelvis to x-axis <-0.423077> speed <0.317308> * currentSpeed; + turn torso to x-axis <12.648352> speed <9.486264> * currentSpeed; + turn lthigh to x-axis <11.060440> speed <8.295330> * currentSpeed; + turn rthigh to x-axis <-42.060440> speed <31.545330> * currentSpeed; + turn rleg to x-axis <-4.857143> speed <3.642857> * currentSpeed; + turn rfoot to x-axis <46.934066> speed <35.200550> * currentSpeed; + turn lleg to x-axis <61.000000> speed <45.750000> * currentSpeed; + turn lfoot to x-axis <-50.390110> speed <37.792583> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <34.093407> speed <17.274725> * currentSpeed; + turn rthigh to x-axis <-27.890110> speed <10.627747> * currentSpeed; + turn rleg to x-axis <-6.637363> speed <1.335165> * currentSpeed; + turn rfoot to x-axis <37.637363> speed <6.972527> * currentSpeed; + turn lleg to x-axis <33.615385> speed <20.538461> * currentSpeed; + turn lfoot to x-axis <-24.604396> speed <19.339285> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <28.747253> speed <4.009615> * currentSpeed; + turn rthigh to x-axis <-19.027473> speed <6.646978> * currentSpeed; + turn rleg to x-axis <-4.412088> speed <1.668956> * currentSpeed; + turn rfoot to x-axis <27.890110> speed <7.310440> * currentSpeed; + turn lleg to x-axis <13.725275> speed <14.917583> * currentSpeed; + turn lfoot to x-axis <-25.978022> speed <1.030219> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <12.813187> speed <11.950550> * currentSpeed; + turn rthigh to x-axis <0.000000> speed <14.270605> * currentSpeed; + turn rleg to x-axis <3.082418> speed <5.620879> * currentSpeed; + turn rfoot to x-axis <2.203297> speed <19.265110> * currentSpeed; + turn lleg to x-axis <-12.335165> speed <19.545330> * currentSpeed; + turn lfoot to x-axis <7.648352> speed <25.219780> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.302198> speed <0.259615> * currentSpeed; + turn lthigh to x-axis <-19.467033> speed <24.210165> * currentSpeed; + turn rthigh to x-axis <1.758242> speed <1.318682> * currentSpeed; + turn rleg to x-axis <8.401099> speed <3.989011> * currentSpeed; + turn rfoot to x-axis <-6.181319> speed <6.288462> * currentSpeed; + turn lleg to x-axis <-16.813187> speed <3.358516> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <26.142857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.302198> now; + turn lthigh to x-axis <-32.324176> speed <9.642857> * currentSpeed; + turn rthigh to x-axis <13.280220> speed <8.641484> * currentSpeed; + turn rleg to x-axis <23.159341> speed <11.068682> * currentSpeed; + turn rfoot to x-axis <-33.170330> speed <20.241758> * currentSpeed; + turn lfoot to x-axis <7.357143> speed <26.361264> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> speed <0.259615> * currentSpeed; + turn lthigh to x-axis <-36.291209> speed <2.975275> * currentSpeed; + turn rleg to x-axis <43.571429> speed <15.309066> * currentSpeed; + turn rfoot to x-axis <-43.148352> speed <7.483517> * currentSpeed; + turn lleg to x-axis <-10.082418> speed <5.048077> * currentSpeed; + turn lfoot to x-axis <28.236264> speed <15.659341> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> now; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-42.060440> speed <4.326923> * currentSpeed; + turn rthigh to x-axis <12.824176> speed <0.342033> * currentSpeed; + turn rleg to x-axis <60.692308> speed <12.840659> * currentSpeed; + turn rfoot to x-axis <-44.824176> speed <1.256868> * currentSpeed; + turn lleg to x-axis <-4.412088> speed <4.252748> * currentSpeed; + turn lfoot to x-axis <46.934066> speed <14.023352> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-32.758242> speed <6.976648> * currentSpeed; + turn rthigh to x-axis <34.093407> speed <15.951923> * currentSpeed; + turn rleg to x-axis <23.615385> speed <27.807692> * currentSpeed; + turn rfoot to x-axis <-10.791209> speed <25.524725> * currentSpeed; + turn lleg to x-axis <-5.747253> speed <1.001374> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <3.321428> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-25.225275> speed <5.649725> * currentSpeed; + turn rthigh to x-axis <28.769231> speed <3.993132> * currentSpeed; + turn rleg to x-axis <10.527473> speed <9.815934> * currentSpeed; + turn rfoot to x-axis <-20.978022> speed <7.640110> * currentSpeed; + turn lleg to x-axis <-3.978022> speed <1.326923> * currentSpeed; + turn lfoot to x-axis <33.648352> speed <6.642857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <-12.390110> speed <9.626374> * currentSpeed; + turn rthigh to x-axis <-0.423077> speed <21.894231> * currentSpeed; + turn rleg to x-axis <-11.659341> speed <16.640110> * currentSpeed; + turn rfoot to x-axis <22.978022> speed <32.967033> * currentSpeed; + turn lleg to x-axis <4.115385> speed <6.070055> * currentSpeed; + turn lfoot to x-axis <14.016484> speed <14.723901> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <0.000000> speed <9.292582> * currentSpeed; + turn rthigh to x-axis <-19.467033> speed <14.282967> * currentSpeed; + turn rleg to x-axis <-20.302198> speed <6.482143> * currentSpeed; + turn rfoot to x-axis <23.445055> speed <0.350275> * currentSpeed; + turn lleg to x-axis <24.203297> speed <15.065934> * currentSpeed; + turn lfoot to x-axis <-20.736264> speed <26.064561> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <9.280220> speed <6.960165> * currentSpeed; + turn rthigh to x-axis <-28.769231> speed <6.976649> * currentSpeed; + turn rleg to x-axis <-25.225275> speed <3.692308> * currentSpeed; + turn rfoot to x-axis <26.115385> speed <2.002747> * currentSpeed; + turn lleg to x-axis <31.868132> speed <5.748626> * currentSpeed; + turn lfoot to x-axis <-37.637363> speed <12.675824> * currentSpeed; + sleep animSpeed; + } + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn torso to x-axis <12.648352> now; + turn lthigh to x-axis <11.060440> speed <1.335165> * currentSpeed; + turn rthigh to x-axis <-37.192308> speed <6.317308> * currentSpeed; + turn rleg to x-axis <-9.280220> speed <11.958791> * currentSpeed; + turn rfoot to x-axis <6.104396> speed <15.008242> * currentSpeed; + turn lleg to x-axis <47.604396> speed <11.802198> * currentSpeed; + turn lfoot to x-axis <-47.412088> speed <7.331044> * currentSpeed; + sleep animSpeed; +} + +walklegs() +{ + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + move rleg to y-axis [0.000000] now; + move rleg to z-axis [0.000000] now; + move rfoot to z-axis [0.000000] now; + move lleg to y-axis [0.000000] now; + move lleg to z-axis [0.000000] now; + move lfoot to z-axis [0.000000] now; + move luparm to x-axis [0.000000] now; + move luparm to y-axis [0.000000] now; + move luparm to z-axis [0.000000] now; + move ruparm to x-axis [0.000000] now; + move ruparm to y-axis [0.000000] now; + move ruparm to z-axis [0.000000] now; + move rloarm to x-axis [0.000000] now; + move rfire to x-axis [0.000000] now; + move lloarm to x-axis [0.000000] now; + move lfire to x-axis [0.000000] now; + turn pelvis to x-axis <-0.423077> now; + turn lthigh to x-axis <11.060440> now; + turn rthigh to x-axis <-42.060440> speed <3.651099> * currentSpeed; + turn rleg to x-axis <-4.857143> speed <3.317308> * currentSpeed; + turn rfoot to x-axis <46.934066> speed <30.622253> * currentSpeed; + turn lleg to x-axis <61.000000> speed <10.046703> * currentSpeed; + turn lfoot to x-axis <-50.390110> speed <2.233517> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <34.093407> speed <17.274725> * currentSpeed; + turn rthigh to x-axis <-27.890110> speed <10.627747> * currentSpeed; + turn rleg to x-axis <-6.637363> speed <1.335165> * currentSpeed; + turn rfoot to x-axis <37.637363> speed <6.972527> * currentSpeed; + turn lleg to x-axis <33.615385> speed <20.538461> * currentSpeed; + turn lfoot to x-axis <-24.604396> speed <19.339285> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <28.747253> speed <4.009615> * currentSpeed; + turn rthigh to x-axis <-19.027473> speed <6.646978> * currentSpeed; + turn rleg to x-axis <-4.412088> speed <1.668956> * currentSpeed; + turn rfoot to x-axis <27.890110> speed <7.310440> * currentSpeed; + turn lleg to x-axis <13.725275> speed <14.917583> * currentSpeed; + turn lfoot to x-axis <-25.978022> speed <1.030219> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <12.813187> speed <11.950550> * currentSpeed; + turn rthigh to x-axis <0.000000> speed <14.270605> * currentSpeed; + turn rleg to x-axis <3.082418> speed <5.620879> * currentSpeed; + turn rfoot to x-axis <2.203297> speed <19.265110> * currentSpeed; + turn lleg to x-axis <-12.335165> speed <19.545330> * currentSpeed; + turn lfoot to x-axis <7.648352> speed <25.219780> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <-19.467033> speed <24.210165> * currentSpeed; + turn rthigh to x-axis <1.758242> speed <1.318682> * currentSpeed; + turn rleg to x-axis <8.401099> speed <3.989011> * currentSpeed; + turn rfoot to x-axis <-6.181319> speed <6.288462> * currentSpeed; + turn lleg to x-axis <-16.813187> speed <3.358516> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <26.142857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <-32.324176> speed <9.642857> * currentSpeed; + turn rthigh to x-axis <13.280220> speed <8.641484> * currentSpeed; + turn rleg to x-axis <23.159341> speed <11.068682> * currentSpeed; + turn rfoot to x-axis <-33.170330> speed <20.241758> * currentSpeed; + turn lfoot to x-axis <7.357143> speed <26.361264> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <-36.291209> speed <2.975275> * currentSpeed; + turn rleg to x-axis <43.571429> speed <15.309066> * currentSpeed; + turn rfoot to x-axis <-43.148352> speed <7.483517> * currentSpeed; + turn lleg to x-axis <-10.082418> speed <5.048077> * currentSpeed; + turn lfoot to x-axis <28.236264> speed <15.659341> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.450000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> now; + turn lthigh to x-axis <-42.060440> speed <4.326923> * currentSpeed; + turn rthigh to x-axis <12.824176> speed <0.342033> * currentSpeed; + turn rleg to x-axis <60.692308> speed <12.840659> * currentSpeed; + turn rfoot to x-axis <-44.824176> speed <1.256868> * currentSpeed; + turn lleg to x-axis <-4.412088> speed <4.252748> * currentSpeed; + turn lfoot to x-axis <46.934066> speed <14.023352> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <-32.758242> speed <6.976648> * currentSpeed; + turn rthigh to x-axis <34.093407> speed <15.951923> * currentSpeed; + turn rleg to x-axis <23.615385> speed <27.807692> * currentSpeed; + turn rfoot to x-axis <-10.791209> speed <25.524725> * currentSpeed; + turn lleg to x-axis <-5.747253> speed <1.001374> * currentSpeed; + turn lfoot to x-axis <42.505495> speed <3.321428> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.300000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <-25.225275> speed <5.649725> * currentSpeed; + turn rthigh to x-axis <28.769231> speed <3.993132> * currentSpeed; + turn rleg to x-axis <10.527473> speed <9.815934> * currentSpeed; + turn rfoot to x-axis <-20.978022> speed <7.640110> * currentSpeed; + turn lleg to x-axis <-3.978022> speed <1.326923> * currentSpeed; + turn lfoot to x-axis <33.648352> speed <6.642857> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.100000] speed [0.150000] * currentSpeed; + turn pelvis to x-axis <-6.181319> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <-12.390110> speed <9.626374> * currentSpeed; + turn rthigh to x-axis <-0.423077> speed <21.894231> * currentSpeed; + turn rleg to x-axis <-11.659341> speed <16.640110> * currentSpeed; + turn rfoot to x-axis <22.978022> speed <32.967033> * currentSpeed; + turn lleg to x-axis <4.115385> speed <6.070055> * currentSpeed; + turn lfoot to x-axis <14.016484> speed <14.723901> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [0.000000] speed [0.075000] * currentSpeed; + turn pelvis to x-axis <-4.857143> speed <0.993132> * currentSpeed; + turn lthigh to x-axis <0.000000> speed <9.292582> * currentSpeed; + turn rthigh to x-axis <-19.467033> speed <14.282967> * currentSpeed; + turn rleg to x-axis <-20.302198> speed <6.482143> * currentSpeed; + turn rfoot to x-axis <23.445055> speed <0.350275> * currentSpeed; + turn lleg to x-axis <24.203297> speed <15.065934> * currentSpeed; + turn lfoot to x-axis <-20.736264> speed <26.064561> * currentSpeed; + sleep animSpeed; + } + if( bMoving ) + { + move pelvis to y-axis [-0.350000] speed [0.262500] * currentSpeed; + turn pelvis to x-axis <-3.082418> speed <1.331044> * currentSpeed; + turn lthigh to x-axis <9.280220> speed <6.960165> * currentSpeed; + turn rthigh to x-axis <-28.769231> speed <6.976649> * currentSpeed; + turn rleg to x-axis <-25.225275> speed <3.692308> * currentSpeed; + turn rfoot to x-axis <26.115385> speed <2.002747> * currentSpeed; + turn lleg to x-axis <31.868132> speed <5.748626> * currentSpeed; + turn lfoot to x-axis <-37.637363> speed <12.675824> * currentSpeed; + sleep animSpeed; + } + move pelvis to y-axis [-0.400000] speed [0.037500] * currentSpeed; + turn pelvis to x-axis <-0.423077> speed <1.994506> * currentSpeed; + turn lthigh to x-axis <11.060440> speed <1.335165> * currentSpeed; + turn rthigh to x-axis <-37.192308> speed <6.317308> * currentSpeed; + turn rleg to x-axis <-9.280220> speed <11.958791> * currentSpeed; + turn rfoot to x-axis <6.104396> speed <15.008242> * currentSpeed; + turn lleg to x-axis <47.604396> speed <11.802198> * currentSpeed; + turn lfoot to x-axis <-47.412088> speed <7.331044> * currentSpeed; + sleep animSpeed; +} + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + + +UnitSpeed() +{ + while(TRUE) + { + currentSpeed = (get CURRENT_SPEED)*100/moveSpeed; + if (currentSpeed<20) currentSpeed=20; + animSpeed = 3700 / currentSpeed; + sleep 142; + } +} + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = bAiming; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + move pelvis to y-axis [0.000000] speed [1.000000]; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn rleg to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lleg to x-axis <0.000000> speed <200.000000>; + turn lfoot to x-axis <0.000000> speed <200.000000>; + if( !aiming ) + { + turn torso to y-axis <0.000000> speed <90.000000>; + turn rloarm to x-axis <0.000000> speed <200.000000>; + turn ruparm to x-axis <0.000000> speed <200.000000>; + turn lloarm to x-axis <0.000000> speed <200.000000>; + turn luparm to x-axis <0.000000> speed <200.000000>; + } + justmoved = FALSE; + } + sleep 100; + } + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script UnitSpeed(); + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + hide rfire; + hide lfire; + bMoving = FALSE; + bAiming = FALSE; + Static_Var_3 = 1; + gun_1 = torso; + currentSpeed = 100; + moveSpeed = get MAX_SPEED; + animSpeed = 38; + start-script InitialSetup1(); + start-script SmokeUnit(); +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + +SweetSpot(piecenum) +{ + piecenum = torso; +} + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM; + sleep 2750; + start-script RestoreWeapon1(); + call-script Weapon1Restored(); + bAiming = FALSE; +} + +AimFromPrimary(piecenum) +{ + piecenum = aimy1; +} + +QueryPrimary(piecenum) +{ + piecenum = rfire + gun_1; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + bAiming = TRUE; + start-script Weapon1Drawn(); + start-script Weapon1SetWtdAim(heading, pitch); + start-script RestoreAfterDelay(); + return (aim1); +} + +FirePrimary() +{ + gun_1 = !gun_1; +} + +Killed(severity, corpsetype) +{ + hide rfire; + hide lfire; + if( severity <= 25 ) + { + corpsetype = 1 ; + explode pelvis type BITMAPONLY | NOHEATCLOUD; + explode torso type BITMAPONLY | NOHEATCLOUD; + //explode ruparm type BITMAPONLY | NOHEATCLOUD; + //explode rloarm type BITMAPONLY | NOHEATCLOUD; + //explode rfire type BITMAPONLY | NOHEATCLOUD; + //explode luparm type BITMAPONLY | NOHEATCLOUD; + //explode lloarm type BITMAPONLY | NOHEATCLOUD; + //explode lfire type BITMAPONLY | NOHEATCLOUD; + //explode rthigh type BITMAPONLY | NOHEATCLOUD; + //explode rknee type BITMAPONLY | NOHEATCLOUD; + //explode rleg type BITMAPONLY | NOHEATCLOUD; + //explode rfoot type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lthigh type BITMAPONLY | NOHEATCLOUD; + //explode lknee type BITMAPONLY | NOHEATCLOUD; + //explode lleg type BITMAPONLY | NOHEATCLOUD; + //explode lfoot type BITMAPONLY | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 50 ) + { + corpsetype = 2 ; + explode pelvis type BITMAPONLY | NOHEATCLOUD; + explode torso type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode ruparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfire type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode luparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lfire type FALL | NOHEATCLOUD; + explode rthigh type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rknee type FALL | NOHEATCLOUD; + //explode rleg type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfoot type FALL | NOHEATCLOUD; + explode lthigh type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type FALL | NOHEATCLOUD; + explode lleg type FALL | NOHEATCLOUD; + explode lfoot type FIRE | SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + if( severity <= 99 ) + { + corpsetype = 3 ; + explode pelvis type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode torso type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode ruparm type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rfire type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode luparm type FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode lloarm type SMOKE | FALL | NOHEATCLOUD; + //explode lfire type SMOKE | FALL | NOHEATCLOUD; + //explode rthigh type SMOKE | FALL | NOHEATCLOUD; + //explode rknee type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rleg type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode rfoot type EXPLODE_ON_HIT | SMOKE | FALL | NOHEATCLOUD; + explode lthigh type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lleg type SMOKE | FALL | NOHEATCLOUD; + explode lfoot type SMOKE | FALL | NOHEATCLOUD; + return(corpsetype); + } + corpsetype = 3 ; + explode pelvis type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode torso type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode ruparm type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rloarm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode rfire type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode luparm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode lloarm type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode lfire type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + //explode rthigh type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + //explode rknee type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode rleg type EXPLODE_ON_HIT | FIRE | FALL | NOHEATCLOUD; + explode rfoot type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lthigh type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lknee type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lleg type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + explode lfoot type EXPLODE_ON_HIT | FIRE | SMOKE | FALL | NOHEATCLOUD; + return corpsetype; +} diff --git a/Scripts/faction/xskulk.cob b/Scripts/faction/xskulk.cob new file mode 100644 index 000000000..ee5213a29 Binary files /dev/null and b/Scripts/faction/xskulk.cob differ diff --git a/Scripts/faction/xsolar.bos b/Scripts/faction/xsolar.bos new file mode 100644 index 000000000..7daee4bbb --- /dev/null +++ b/Scripts/faction/xsolar.bos @@ -0,0 +1,44 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + start-script SmokeUnit(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/faction/xsolar.cob b/Scripts/faction/xsolar.cob new file mode 100644 index 000000000..d126d83c9 Binary files /dev/null and b/Scripts/faction/xsolar.cob differ diff --git a/Scripts/faction/xstorage.bos b/Scripts/faction/xstorage.bos new file mode 100644 index 000000000..6ddfb9499 --- /dev/null +++ b/Scripts/faction/xstorage.bos @@ -0,0 +1,69 @@ +// * Header Info * +// VersionSignature 4 +// NumberOfScripts 4 +// NumberOfPieces 5 +// LengthOfScripts 161 +// NumberOfStaticVars 0 +// UKZero 0 +// OffsetToScriptCodeIndexArray 5b0 +// OffsetToScriptNameOffsetArray 5c0 +// OffsetToPieceNameOffsetArray 5d0 +// OffsetToScriptCode 2c +// OffsetToNameArray 5e4 + +// OffsetToFirstName 5e4 + +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +/* 3:*/{ +/* 6:*/ while( get BUILD_PERCENT_LEFT ) +/* 8:*/ { +/* a:*/ sleep 400; +/* d:*/ } +/* f:*/ while( TRUE ) +/* 11:*/ { +/* 14:*/ healthpercent = get HEALTH; +/* 1b:*/ if( healthpercent < 66 ) +/* 1d:*/ { +/* 22:*/ smoketype = 256 | 2; +/* 2c:*/ if( Rand( 1, 66 ) < healthpercent ) +/* 2e:*/ { +/* 33:*/ smoketype = 256 | 1; +/* 35:*/ } +/* 37:*/ emit-sfx smoketype from base; +/* 39:*/ } +/* 3e:*/ sleeptime = healthpercent * 50; +/* 45:*/ if( sleeptime < 200 ) +/* 47:*/ { +/* 49:*/ sleeptime = 200; +/* 4b:*/ } +/* 4d:*/ sleep sleeptime; +/* 50:*/ } +/* 52:*/ return (0); +/* 53:*/ // Build by COBBLER Ver4.0 Copyright @1998 DIGITAL CONCEPT SOFTWARE (MANU@inext.fr) / http://www.annihilationcenter.com/DCS/ +/* 80:*/} + +Create() +/* 78:*/{ +/* 7c:*/ start-script SmokeUnit(); +/* 81:*/ return (0); +/* 82:*/} + +SweetSpot(piecenum) +/* 83:*/{ +/* 85:*/ piecenum = base; +/* 89:*/ return (0); +/* 8a:*/} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode base type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xstorage.cob b/Scripts/faction/xstorage.cob new file mode 100644 index 000000000..aa7430f5a Binary files /dev/null and b/Scripts/faction/xstorage.cob differ diff --git a/Scripts/faction/xwarrior.bos b/Scripts/faction/xwarrior.bos new file mode 100644 index 000000000..e294936ca --- /dev/null +++ b/Scripts/faction/xwarrior.bos @@ -0,0 +1,451 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece torso,firepoint2, firepoint1 , pelvis, lthigh, rthigh, luparm, + ruparm, rarm, larm, rleg, rfoot, lleg, lfoot; + +static-var bMoving, bAiming, Static_Var_3, restore_delay, gun_1, wpn1_lasthead; + +// Signal definitions +#define SIG_AIM 4 + +HitByWeapon(anglex, anglez) +{ + turn pelvis to z-axis anglez speed <105.000000>; + turn pelvis to x-axis <0> - anglex speed <105.000000>; + wait-for-turn pelvis around z-axis; + wait-for-turn pelvis around x-axis; + turn pelvis to z-axis <0.000000> speed <30.000000>; + turn pelvis to x-axis <0.000000> speed <30.000000>; +} + + +walk() +{ + + //maxvelocity = 1.4, speed = 45 elmos/sec + //animspeed 36 elmos per cycle + + + if( bMoving ) + { + //step 0 + + turn rthigh to x-axis <0> speed <277.500000>; + turn rleg to x-axis <0> speed <142.500000>; + turn rfoot to x-axis <0> speed <202.500000>; + turn lthigh to x-axis <9> speed <427.500000>; + turn lleg to x-axis <34> speed <450.000000>; + turn lfoot to x-axis <-40> speed <427.500000>; + + turn luparm to x-axis <-10> speed <75.000000>; + turn larm to x-axis <5> speed <75.000000>; + turn ruparm to x-axis <10> speed <75.000000>; + turn rarm to x-axis <25> speed <75.000000>; + + move pelvis to y-axis [0] speed [11.250000]; + turn torso to y-axis <-5> speed <37.500000>; + + sleep 130; + } + if( bMoving ) + { + //step 1 + + turn rthigh to x-axis <51> speed <382.500000>; + turn rleg to x-axis <-36> speed <270.000000>; + turn rfoot to x-axis <14> speed <105.000000>; + turn lthigh to x-axis <-44> speed <397.500000>; + turn lleg to x-axis <34> now; + turn lfoot to x-axis <0> speed <300.000000>; + + turn luparm to x-axis <10> speed <150.000000>; + turn larm to x-axis <25> speed <150.000000>; + turn ruparm to x-axis <-10> speed <150.000000>; + turn rarm to x-axis <5> speed <150.000000>; + + move pelvis to y-axis [-1] speed [7.500000]; + turn torso to y-axis <5> speed <75.000000>; + + sleep 130; + } + + if( bMoving ) + { + //step 2 + + turn rthigh to x-axis <66> speed <112.500000>; + turn rleg to x-axis <-26> speed <75.000000>; + turn rfoot to x-axis <17> speed <22.500000>; + turn lthigh to x-axis <-37> speed <52.500000>; + turn lleg to x-axis <-19> speed <397.500000>; + turn lfoot to x-axis <27> speed <202.500000>; + + turn luparm to x-axis <20> speed <75.000000>; + turn larm to x-axis <35> speed <75.000000>; + turn ruparm to x-axis <-20> speed <75.000000>; + turn rarm to x-axis <-5> speed <75.000000>; + + move pelvis to y-axis [-1.5] speed [3.750000]; + turn torso to y-axis <10> speed <37.500000>; + + sleep 130; + } + + if( bMoving ) + { + //step 3 + + turn rthigh to x-axis <9> speed <427.500000>; + turn rleg to x-axis <34> speed <450.000000>; + turn rfoot to x-axis <-40> speed <427.500000>; + turn lthigh to x-axis <0> speed <277.500000>; + turn lleg to x-axis <0> speed <142.500000>; + turn lfoot to x-axis <0> speed <202.500000>; + + turn luparm to x-axis <10> speed <75.000000>; + turn larm to x-axis <25> speed <75.000000>; + turn ruparm to x-axis <-10> speed <75.000000>; + turn rarm to x-axis <5> speed <75.000000>; + + move pelvis to y-axis [0] speed [11.250000]; + turn torso to y-axis <5> speed <37.500000>; + + sleep 130; + } + + if( bMoving ) + { + //step 4 + + turn rthigh to x-axis <-44> speed <397.500000>; + turn rleg to x-axis <34> now; + turn rfoot to x-axis <0> speed <300.000000>; + turn lthigh to x-axis <51> speed <382.500000>; + turn lleg to x-axis <-36> speed <270.000000>; + turn lfoot to x-axis <14> speed <105.000000>; + + turn luparm to x-axis <-10> speed <150.000000>; + turn larm to x-axis <5> speed <150.000000>; + turn ruparm to x-axis <10> speed <150.000000>; + turn rarm to x-axis <25> speed <150.000000>; + + move pelvis to y-axis [-1] speed [7.500000]; + turn torso to y-axis <-5> speed <75.000000>; + + sleep 130; + } + + if( bMoving ) + { + //step 5 + + turn rthigh to x-axis <-37> speed <52.500000>; + turn rleg to x-axis <-19> speed <397.500000>; + turn rfoot to x-axis <27> speed <202.500000>; + turn lthigh to x-axis <66> speed <112.500000>; + turn lleg to x-axis <-26> speed <75.000000>; + turn lfoot to x-axis <17> speed <22.500000>; + + turn luparm to x-axis <-20> speed <75.000000>; + turn larm to x-axis <-5> speed <75.000000>; + turn ruparm to x-axis <20> speed <75.000000>; + turn rarm to x-axis <35> speed <75.000000>; + + move pelvis to y-axis [-1.5] speed [3.750000]; + turn torso to y-axis <-10> speed <37.500000>; + + sleep 130; + } + +} + +walklegs() +{ + + + if( bMoving ) + { + //step 0 + + turn rthigh to x-axis <0> speed <277.500000>; + turn rleg to x-axis <0> speed <142.500000>; + turn rfoot to x-axis <0> speed <202.500000>; + turn lthigh to x-axis <9> speed <427.500000>; + turn lleg to x-axis <34> speed <450.000000>; + turn lfoot to x-axis <-40> speed <427.500000>; + move pelvis to y-axis [0] speed [11.250000]; + + sleep 130; + } + if( bMoving ) + { + //step 1 + + turn rthigh to x-axis <51> speed <382.500000>; + turn rleg to x-axis <-36> speed <270.000000>; + turn rfoot to x-axis <14> speed <105.000000>; + turn lthigh to x-axis <-44> speed <397.500000>; + turn lleg to x-axis <34> now; + turn lfoot to x-axis <0> speed <300.000000>; + + move pelvis to y-axis [-1] speed [7.500000]; + + sleep 130; + } + + if( bMoving ) + { + //step 2 + + turn rthigh to x-axis <66> speed <112.500000>; + turn rleg to x-axis <-26> speed <75.000000>; + turn rfoot to x-axis <17> speed <22.500000>; + turn lthigh to x-axis <-37> speed <52.500000>; + turn lleg to x-axis <-19> speed <397.500000>; + turn lfoot to x-axis <27> speed <202.500000>; + + move pelvis to y-axis [-1.5] speed [3.750000]; + + sleep 130; + } + + if( bMoving ) + { + //step 3 + + turn rthigh to x-axis <9> speed <427.500000>; + turn rleg to x-axis <34> speed <450.000000>; + turn rfoot to x-axis <-40> speed <427.500000>; + turn lthigh to x-axis <0> speed <277.500000>; + turn lleg to x-axis <0> speed <142.500000>; + turn lfoot to x-axis <0> speed <202.500000>; + + move pelvis to y-axis [0] speed [11.250000]; + + sleep 130; + } + + if( bMoving ) + { + //step 4 + + turn rthigh to x-axis <-44> speed <397.500000>; + turn rleg to x-axis <34> now; + turn rfoot to x-axis <0> speed <300.000000>; + turn lthigh to x-axis <51> speed <382.500000>; + turn lleg to x-axis <-36> speed <270.000000>; + turn lfoot to x-axis <14> speed <105.000000>; + move pelvis to y-axis [-1] speed [7.500000]; + + sleep 130; + } + + if( bMoving ) + { + //step 5 + + turn rthigh to x-axis <-37> speed <52.500000>; + turn rleg to x-axis <-19> speed <397.500000>; + turn rfoot to x-axis <27> speed <202.500000>; + turn lthigh to x-axis <66> speed <112.500000>; + turn lleg to x-axis <-26> speed <75.000000>; + turn lfoot to x-axis <17> speed <22.500000>; + + move pelvis to y-axis [-1.5] speed [3.750000]; + + sleep 130; + } +} + +MotionControl(moving, aiming, justmoved) +{ + justmoved = TRUE; + while( TRUE ) + { + moving = bMoving; + aiming = bAiming; + if( moving ) + { + if( aiming ) + { + Static_Var_3 = 1; + call-script walklegs(); + } + else + { + Static_Var_3 = 0; + call-script walk(); + } + justmoved = TRUE; + } + else + { + Static_Var_3 = 1; + if( justmoved ) + { + turn rthigh to x-axis <0> speed <277.500000>; + turn rleg to x-axis <0> speed <142.500000>; + turn rfoot to x-axis <0> speed <202.500000>; + turn lthigh to x-axis <0> speed <277.500000>; + turn lleg to x-axis <0> speed <142.500000>; + turn lfoot to x-axis <0> speed <202.500000>; + + + move pelvis to y-axis [0] speed [11.250000]; + if( !aiming ) + { + turn luparm to x-axis <0> speed <75.000000>; + turn larm to x-axis <0> speed <75.000000>; + turn ruparm to x-axis <0> speed <75.000000>; + turn rarm to x-axis <0> speed <75.000000>; + turn torso to y-axis <0> speed <37.500000>; + } + justmoved = FALSE; + } + sleep 100; + } + } +} + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 500; + } + start-script MotionControl(); + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 258; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 257; + } + emit-sfx smoketype from torso; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + hide firepoint2; + hide firepoint1; + bMoving = FALSE; + bAiming = FALSE; + Static_Var_3 = 1; + restore_delay = 3000; + gun_1 = firepoint2; + start-script SmokeUnit(); +} + +SetMaxReloadTime(Func_Var_1) +{ + restore_delay = Func_Var_1 * 2; +} + +StartMoving() +{ + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; +} + +SweetSpot(piecenum) +{ + piecenum = torso; +} + +RestoreAfterDelay() +{ + set-signal-mask SIG_AIM; + sleep restore_delay; + turn torso to y-axis <0.000000> speed <90.000000>; + turn ruparm to x-axis <0.000000> speed <45.000000>; + turn rarm to y-axis <0.000000> speed <45.000000>; + turn luparm to x-axis <0.000000> speed <45.000000>; + wait-for-turn torso around y-axis; + wait-for-turn ruparm around x-axis; + wait-for-turn rarm around y-axis; + wait-for-turn luparm around x-axis; + wpn1_lasthead = 1000000; + bAiming = FALSE; +} + +AimFromPrimary(piecenum) +{ + piecenum = torso; +} + +QueryPrimary(piecenum) +{ + piecenum = firepoint2 + gun_1; +} + +FirePrimary() +{ + if( gun_1 ) + { + emit-sfx 1024 from firepoint2; + } + else + { + emit-sfx 1024 from firepoint1; + } + gun_1 = !gun_1; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + bAiming = TRUE; + while( !Static_Var_3 ) + { + return(0); + } + turn torso to y-axis heading speed <5000.000000>; + turn ruparm to x-axis <0.000000> - pitch speed <5000.000000>; + turn rarm to x-axis <0.000000> speed <5000.000000>; + turn luparm to x-axis <0.000000> - pitch speed <5000.000000>; + turn larm to x-axis <0.000000> speed <5000.000000>; + if (((get ABS(wpn1_lasthead - heading)) > 65536) OR(((get ABS(wpn1_lasthead - heading)) > 1300) AND ((get ABS(wpn1_lasthead - heading)) < 64236))) + { + wpn1_lasthead = 1000000; + wait-for-turn torso around y-axis; + wait-for-turn luparm around x-axis; + wait-for-turn ruparm around x-axis; + } + start-script RestoreAfterDelay(); + wpn1_lasthead = heading; + return (1); +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + explode rthigh type EXPLODE_ON_HIT; + explode rleg type EXPLODE_ON_HIT; + explode rfoot type EXPLODE_ON_HIT; + explode lthigh type EXPLODE_ON_HIT; + explode lleg type EXPLODE_ON_HIT; + explode lfoot type EXPLODE_ON_HIT; + explode torso type EXPLODE_ON_HIT; + explode luparm type EXPLODE_ON_HIT; + explode larm type EXPLODE_ON_HIT; + explode ruparm type EXPLODE_ON_HIT; + explode rarm type EXPLODE_ON_HIT; +} diff --git a/Scripts/faction/xwarrior.cob b/Scripts/faction/xwarrior.cob new file mode 100644 index 000000000..93b869cfb Binary files /dev/null and b/Scripts/faction/xwarrior.cob differ diff --git a/Scripts/factory.bos b/Scripts/factory.bos deleted file mode 100644 index e5ecf64b8..000000000 --- a/Scripts/factory.bos +++ /dev/null @@ -1,195 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece factory, shield, nano1, nano2; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging; - -// Signal definitions -#define SIG_ACTIVATE 2 - - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from factory; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -OpenYard() -{ - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = factory; - call-script InitState(); - start-script SmokeUnit(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray != 0 ) - { - piecenum = nano2; - } - spray = !spray; -} - -Demo() -{ - unitviewer = TRUE; -} - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - if( !unitviewer ) - { - sleep 5000; - } - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -} - -StopBuilding() -{ -} - -QueryBuildInfo(piecenum) -{ - piecenum = shield; -} - -SweetSpot(piecenum) -{ - piecenum = factory; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode factory type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode factory type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode factory type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode factory type BITMAPONLY | BITMAP1; - -} diff --git a/Scripts/fatso.bos b/Scripts/fatso.bos deleted file mode 100644 index 1fc88346e..000000000 --- a/Scripts/fatso.bos +++ /dev/null @@ -1,204 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, turret2, turret3, firepoint1, firepoint2, firepoint3; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -turn turret2 to y-axis <0> speed <60>; -turn turret3 to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret1 to y-axis heading speed <225>; -wait-for-turn turret1 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret2 to y-axis heading speed <225>; -wait-for-turn turret2 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM_4; -turn turret3 to y-axis heading speed <225>; -wait-for-turn turret3 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = turret3; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type FALL | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret2 type BITMAPONLY | BITMAP3; -explode turret3 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/fatso.cob b/Scripts/fatso.cob deleted file mode 100644 index ca41ea29c..000000000 Binary files a/Scripts/fatso.cob and /dev/null differ diff --git a/Scripts/fusion.bos b/Scripts/fusion.bos deleted file mode 100644 index 4eba1191b..000000000 --- a/Scripts/fusion.bos +++ /dev/null @@ -1,85 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece fusion, sfx; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from fusion; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from sfx; - sleep 100; - } -} - -Create() -{ - start-script fx(); - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = fusion; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode fusion type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode fusion type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode fusion type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode fusion type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/geovent.bos b/Scripts/geovent.bos deleted file mode 100644 index af562a0f0..000000000 --- a/Scripts/geovent.bos +++ /dev/null @@ -1,73 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, bottomfan, topfan; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Create() -{ - spin topfan around y-axis speed <50.005495>; - spin bottomfan around y-axis speed <-50.005495>; - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/geovent.cob b/Scripts/geovent.cob deleted file mode 100644 index 4046f5601..000000000 Binary files a/Scripts/geovent.cob and /dev/null differ diff --git a/Scripts/glsl_test.bos b/Scripts/glsl_test.bos deleted file mode 100644 index 99c27b857..000000000 --- a/Scripts/glsl_test.bos +++ /dev/null @@ -1,61 +0,0 @@ -// Argh's Skyscraper1 Script - -// This script is hereby released under GPL v. 2 or later by Wolfe Games, 2007 -// All contents were created by Wolfe Games. - -// This Include is absolutely VITAL. -// You must call it FIRST. PERIOD. -// Don't say I didn't warn you ;-) -#include "STANDARD_COMMANDS_WORLDovm_builder.h" - -piece base, orbiter, orbit, light; - -lua_CreateLightMe(arg) { return (0); } -lua_DestroyLightMe(arg) { return (0); } - -StartBuilding(heading,pitch) -{ -set INBUILDSTANCE to 1; - return (0); -} - -StopBuilding() -{ -set INBUILDSTANCE to 0; - return (0); -} - -QueryNanoPiece(piecenum) -{ - piecenum = base; -} - -randomLight() -{ - var R,G,B,A; - while(TRUE) - { - R = rand(0,255); - G = rand(0,255); - B = rand(0,255); - A = rand(64,200); - call-script lua_CreateLightMe(light, R, G, B, A); - sleep 1000; - } -} - -Create() -{ -set INBUILDSTANCE to 1; - spin orbiter around y-axis speed <-45>; - spin orbit around y-axis speed <30>; - start-script randomLight(); - - return (0); -} - -Killed() -{ - call-script lua_DestroyLightMe(); - return (0); -} \ No newline at end of file diff --git a/Scripts/glsl_test.cob b/Scripts/glsl_test.cob deleted file mode 100644 index 6d2a12709..000000000 Binary files a/Scripts/glsl_test.cob and /dev/null differ diff --git a/Scripts/goldtree.bos b/Scripts/goldtree.bos deleted file mode 100644 index f16048dad..000000000 --- a/Scripts/goldtree.bos +++ /dev/null @@ -1,112 +0,0 @@ -piece gp,base; -static-var shooting_num,shooting_num3,shooting_num4,missile_num,happened,notdead,burning; - -#define zapImpact 1024+0 -#define RED_EXPLOSION 1024+1 -#define BIGBOMB_EXPLOSION 1024+2 -#define COMM_EXPLOSION 1024+3 - -static-var ISBUILDING; - -#define CRASHLANDING 4096+4 - -#define SMOKEPIECE1 base - -#define SIG_AIM 2 - -#include "\headers\smoke.h" - -Thrusters(sleeptime, smoketype) -{ - smoketype = 256 | 2; - - while( get BUILD_PERCENT_LEFT ) - { sleep 400; } - - while( TRUE ) - { - emit-sfx zapImpact from base; - sleep 150; - } -} - -//------------------------------------------------------ -//start ups :) -//------------------------------------------------------ -Create() - { - ISBUILDING = FALSE; - - start-script SmokeUnit(); - start-script Thrusters(); - } - - -SweetSpot(piecenum) - { piecenum=gp; } - -QueryNanoPiece(piecenum) - { piecenum=base; } -/*============================================== -//nano functions -==============================================*/ - -StartBuilding(heading,pitch) - { - ISBUILDING = TRUE; - while (!ISBUILDING) - { sleep 100; } - set INBUILDSTANCE to TRUE; - } - -TargetCleared(which) - { - signal SIG_AIM; - set-signal-mask SIG_AIM; - sleep 500; - ISBUILDING = FALSE; - } - -StopBuilding() - { - set INBUILDSTANCE to FALSE; - signal SIG_AIM; - set-signal-mask SIG_AIM; - sleep 500; - ISBUILDING = FALSE; - } - -/*=============================================\ -| Death function | -\=============================================*/ - Killed( severity, corpsetype ) - { - //RED_EXPLOSION - //BIGBOMB_EXPLOSION - //COMM_EXPLOSION - if (severity <= 25) - { - corpsetype = 1; - //explode base type SHATTER | BITMAP3; - return( 0 ); - } - - if (severity <= 50) - { - corpsetype = 2; - //explode base type SHATTER | BITMAP3; - return( 0 ); - } - - if (severity <= 99) - { - corpsetype = 3; - //explode base type SHATTER | BITMAP3; - return( 0 ); - } - - corpsetype = 3; -// explode base type SHATTER | BITMAP3; - return( 0 ); - return( 0 ); - } \ No newline at end of file diff --git a/Scripts/goldtree.cob b/Scripts/goldtree.cob deleted file mode 100644 index 5bb3c3475..000000000 Binary files a/Scripts/goldtree.cob and /dev/null differ diff --git a/Scripts/headers/common_includes_lus.lua b/Scripts/headers/common_includes_lus.lua index 1b3d4558f..0a08119d0 100644 --- a/Scripts/headers/common_includes_lus.lua +++ b/Scripts/headers/common_includes_lus.lua @@ -6,7 +6,12 @@ common = { Spring.SpawnCEG(effectName, x,y,z, dx, dy, dz) end, - + + HbotLift = function () + Move(base, y_axis, 20, 200) + --Spring.Echo("Bruh I lift") + end, + setSFXoccupy = function (setSFXoccupy_argument) --Spring.Echo(type(setSFXoccupy_argument)) --Spring.Echo("common.setSFXoccupy is being called", setSFXoccupy_argument) diff --git a/Scripts/heavytank.bos b/Scripts/heavytank.bos deleted file mode 100644 index 3501478f8..000000000 --- a/Scripts/heavytank.bos +++ /dev/null @@ -1,174 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var gun_1, terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move hull to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move hull to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -emit-sfx gdmarty from firepoint1; -move barrel1 to z-axis [-2] speed [500]; -sleep 75; -move barrel1 to z-axis [0] speed [1]; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = hull; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode hull type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/lightlaserplatform.bos b/Scripts/lightlaserplatform.bos deleted file mode 100644 index 924869a12..000000000 --- a/Scripts/lightlaserplatform.bos +++ /dev/null @@ -1,118 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, ring, sfx; // these are the pieces of the model - -static-var gun_1; // these are the variables - -#define BLUE_EXPLOSION_SMALL 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -spin ring around y-axis speed <50.005495>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -emit-sfx BLUE_EXPLOSION_SMALL from sfx; -spin base around y-axis speed <-25.005495>; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = sfx; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode ring type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode ring type FALL | BITMAP1; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode ring type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode ring type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/lightlaserplatform2.bos b/Scripts/lightlaserplatform2.bos deleted file mode 100644 index 8ca828f14..000000000 --- a/Scripts/lightlaserplatform2.bos +++ /dev/null @@ -1,108 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - -static-var gun_1; // these are the variables - -#define BLUE_EXPLOSION_SMALL 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -emit-sfx BLUE_EXPLOSION_SMALL from firepoint1; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/lightlaserplatform2.cob b/Scripts/lightlaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/lightlaserplatform2.cob and /dev/null differ diff --git a/Scripts/lighttank.bos b/Scripts/lighttank.bos deleted file mode 100644 index de773f41c..000000000 --- a/Scripts/lighttank.bos +++ /dev/null @@ -1,179 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, turret, barrel1, firepoint1, barrel2, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move hull to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move hull to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode hull type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/lootboxes/exptype.h b/Scripts/lootboxes/exptype.h new file mode 100644 index 000000000..7a83187b2 --- /dev/null +++ b/Scripts/lootboxes/exptype.h @@ -0,0 +1,193 @@ +/* +** EXPtype.h -- Explosion Type information and GET/SET constants for scripts +** +** This Script contains constants compatible only with Spring RTS engine +** not for use with Total Annihilation or TA:Kindgoms +*/ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +// Indices for emit-sfx +#ifndef __SFXTYPE_H_ +#define SFXTYPE_VTOL 0 +//#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 // same as SFX_WAKE +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 // same as SFX_REVERSE_WAKE + +#define SFXTYPE_WHITESMOKE 257 +#define SFXTYPE_BLACKSMOKE 258 +#define SFXTYPE_SUBBUBBLES 259 +#endif + +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define NOCEGTRAIL 64 // Disables the cegtrail for the specific piece (defined in the unit fbi) +#define NOHEATCLOUD 128 // No engine default heat cloud for explosion +#define BITMAP 10000001 + +// Bitmap Explosion Types +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 + +//Customized effects (in FBI/TDF/LUA) +// Explosion generators +#define UNIT_SFX0 1024 +#define UNIT_SFX1 1025 +#define UNIT_SFX2 1026 +#define UNIT_SFX3 1027 +#define UNIT_SFX4 1028 +#define UNIT_SFX5 1029 +#define UNIT_SFX6 1030 +#define UNIT_SFX7 1031 +#define UNIT_SFX8 1032 +#define UNIT_SFX9 1033 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 +#define FIRE_W9 2056 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 +#define DETO_W9 4104 + + +// COB constants +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get +#define REVERSING 109 // get + +// Indices for SET, GET, and GET_UNIT_VALUE for LUA return values +#define LUA0 110 // (LUA0 returns the lua call status, 0 or 1) +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) get WEAPON_RELOADSTATE(weaponNum) for GET +#define WEAPON_RELOADTIME 126 // get (with fake set) get WEAPON_RELOADSTATE(-weaponNum,val) for SET +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define WEAPON_STOCKPILE_COUNT 139 // get (with fake set) + + +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get +#define KSIN 135 // get, kiloSine 1024*sin(x) as COB uses only integers +#define KCOS 136 // get, kiloCosine 1024*cos(x) + +#define KTAN 137 // get, kiloTangent 1024*tan(x) carefull with angles close to 90 deg. might cause overflow +#define SQRT 138 // get, square root (floored to integer) + +#define ENERGY_MAKE 140 // set or get (100*E production) + +#define METAL_MAKE 141 // set or get (100*M production) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif \ No newline at end of file diff --git a/Scripts/lootboxes/lootboxgold.bos b/Scripts/lootboxes/lootboxgold.bos new file mode 100644 index 000000000..784a3de5f --- /dev/null +++ b/Scripts/lootboxes/lootboxgold.bos @@ -0,0 +1,40 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, dbl, dtr, dbr, dtl, emit, blinka, blinkb, blinkc, blinkd; + +Lights() +{ + while( TRUE ) + { + emit-sfx 1024 + 0 from blinka; + sleep 90; + emit-sfx 1024 + 0 from blinkb; + sleep 90; + emit-sfx 1024 + 0 from blinkc; + sleep 90; + emit-sfx 1024 + 0 from blinkd; + sleep 3000; + } + sleep 2000; + start-script Lights(); +} + +Beacon() +{ + while( TRUE ) + { + emit-sfx 1024 + 1 from emit; + sleep 5000; + } + sleep 2000; + start-script Beacon(); +} + +Create() +{ + start-script Lights(); + start-script Beacon(); +} \ No newline at end of file diff --git a/Scripts/lootboxes/lootboxgold.cob b/Scripts/lootboxes/lootboxgold.cob new file mode 100644 index 000000000..cfcdd269f Binary files /dev/null and b/Scripts/lootboxes/lootboxgold.cob differ diff --git a/LuaIntro/chili/chili/skins/default/Sav38D.tmp b/Scripts/lootboxes/sfxtype.h similarity index 100% rename from LuaIntro/chili/chili/skins/default/Sav38D.tmp rename to Scripts/lootboxes/sfxtype.h diff --git a/Scripts/lozcommandtank.bos b/Scripts/lozcommandtank.bos new file mode 100644 index 000000000..fc86e4833 --- /dev/null +++ b/Scripts/lozcommandtank.bos @@ -0,0 +1,184 @@ + +// One ninth of the full cycle duration, in millisecond +// The larger this value the slower the walk animation +#define WALK_PERIOD 50 + + +piece base, nano, nanopoint1, rearwheels, frontwheels, sidetanks, reartanks, turret, barrel1, firepoint1, dirt; + +static-var maxreloadtime, moving, bMoving, terraintype, building; + +#define SIG_AIM1 2 +#define SIG_FIRE1 4 +#define SIG_MOVE 8 +#define SMOKEPIECE1 base +#include "springdefs.h" +#define SIG_BUILD 16 +#define SIG_AIM_2 32 +#define nanoflame 1024+0 + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1026 from turret; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + + + +StartMoving() +{ + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=TRUE; + bMoving = TRUE; +} + +StopMoving() +{ + bMoving = FALSE; + signal SIG_MOVE; + set-signal-mask SIG_MOVE; + moving=FALSE; +} + + +Thrust() +{ + while( TRUE ) + { + if (moving) + { + emit-sfx 1025 + 0 from dirt; + spin frontwheels around x-axis speed <500.005495>; + spin rearwheels around x-axis speed <500.005495>; + + } + else + { + stop-spin frontwheels around x-axis decelerate <200.000000>; + stop-spin rearwheels around x-axis decelerate <200.000000>; + } + sleep 400; + } +} + + +buildflame() +{ + while( TRUE ) + { + if (building) + { + emit-sfx nanoflame from nanopoint1; + + } + sleep 600; + } +} + + +Create() +{ + moving=FALSE; + while(get BUILD_PERCENT_LEFT) + { + sleep 250; + } + start-script SmokeUnit(); + start-script Thrust(); + start-script buildflame(); +} + +RestoreAfterDelay() // restore function to turn the turret and so forth back to start +{ +sleep 3000; +turn turret to y-axis <0> speed <60>; +turn barrel1 to x-axis <0> speed <30>; +} + + +AimPrimary(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming +{ +signal SIG_AIM_2; +set-signal-mask SIG_AIM_2; +turn turret to y-axis heading speed <5000>; +turn barrel1 to x-axis <0> - pitch speed <5000>; +wait-for-turn turret around y-axis; +wait-for-turn barrel1 around x-axis; +start-script RestoreAfterDelay(); +return (1); +} + +FirePrimary() // what do while firing, fires 1 barrel then the next , and resets +{ +emit-sfx 1027 + 0 from firepoint1; +} + +AimFromPrimary(piecenum) // where it aims the weapon from +{ +piecenum = barrel1; +} + +QueryPrimary(piecenum) // where the shot is called from +{ +piecenum = firepoint1; +} + + +StartBuilding(heading, pitch) +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 1; + building = 1; + while (1) { +// emit-sfx 2048 from nanopoint1; + sleep 30; + } +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 0; + building = 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nanopoint1; +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode frontwheels type EXPLODE_ON_HIT; + explode rearwheels type EXPLODE_ON_HIT; + explode reartanks type EXPLODE_ON_HIT; + explode sidetanks type EXPLODE_ON_HIT; + explode nano type EXPLODE_ON_HIT; + explode barrel1 type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/lozcommandtank.cob b/Scripts/lozcommandtank.cob new file mode 100644 index 000000000..ddf26e520 Binary files /dev/null and b/Scripts/lozcommandtank.cob differ diff --git a/Scripts/mediumtank.bos b/Scripts/mediumtank.bos deleted file mode 100644 index ba0d950e5..000000000 --- a/Scripts/mediumtank.bos +++ /dev/null @@ -1,149 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/metalsenthesizer.bos b/Scripts/metalsenthesizer.bos deleted file mode 100644 index 2b63abf66..000000000 --- a/Scripts/metalsenthesizer.bos +++ /dev/null @@ -1,119 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base; - -static-var statechg_DesiredState, statechg_StateChanging; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - -} - -Stop() -{ - -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/metalsenthesizer.cob b/Scripts/metalsenthesizer.cob deleted file mode 100644 index b89c781c5..000000000 Binary files a/Scripts/metalsenthesizer.cob and /dev/null differ diff --git a/Scripts/mex.bos b/Scripts/mex.bos deleted file mode 100644 index 209075f3a..000000000 --- a/Scripts/mex.bos +++ /dev/null @@ -1,136 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece mexbase, mextop; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from mexbase; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin mextop around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin mextop around y-axis decelerate Static_Var_3; - wait-for-turn mextop around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - Static_Var_2 = 50; - Static_Var_3 = 182; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -SweetSpot(piecenum) -{ - piecenum = mexbase; -} - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 45; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode mextop type BITMAPONLY | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode mextop type SHATTER | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode mextop type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode mextop type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode mexbase type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/mexmoho.bos b/Scripts/mexmoho.bos deleted file mode 100644 index 209075f3a..000000000 --- a/Scripts/mexmoho.bos +++ /dev/null @@ -1,136 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece mexbase, mextop; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from mexbase; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin mextop around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin mextop around y-axis decelerate Static_Var_3; - wait-for-turn mextop around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - Static_Var_2 = 50; - Static_Var_3 = 182; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -SweetSpot(piecenum) -{ - piecenum = mexbase; -} - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 45; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode mextop type BITMAPONLY | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode mextop type SHATTER | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode mextop type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode mexbase type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode mextop type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode mexbase type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/missilesiloemp.bos b/Scripts/missilesiloemp.bos deleted file mode 100644 index 4b513d524..000000000 --- a/Scripts/missilesiloemp.bos +++ /dev/null @@ -1,89 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/missletank.bos b/Scripts/missletank.bos deleted file mode 100644 index edce05a63..000000000 --- a/Scripts/missletank.bos +++ /dev/null @@ -1,192 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, firepoint1, firepoint2; // these are the pieces of the model - -static-var gun_1, gun_2, terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from hull; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move hull to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move hull to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); - start-script setSFXoccupy(); - start-script EmitWakes(); -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -// emit-sfx gdscannon from firepoint1; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = hull; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = hull; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_2 >= 1) -{ -sleep 100; -} -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_2 == 0 ) -{ -// emit-sfx gdscannon from firepoint2; -} -gun_2 = gun_2 + 1; -if( gun_2 >= 1 ) -{ -gun_2=0; -} -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = hull; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -if( gun_2 == 0 ) -{ -piecenum = firepoint2; -} -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode hull type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode hull type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode hull type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode hull type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/neutralradar.BOS b/Scripts/neutralradar.BOS deleted file mode 100644 index c5228e813..000000000 --- a/Scripts/neutralradar.BOS +++ /dev/null @@ -1,63 +0,0 @@ -piece gp, base, turret, dish; - -// State variables -static-var ISMOVING, ISAIMING, speedMult; - -#define SMOKEPIECE1 base - -#include "\headers\smoke.h" -#include "\headers\walk.h" - -//------------------------------------------------------ -//start ups :) -//------------------------------------------------------ -Create() - { - // Initial State - ISMOVING = FALSE; - ISAIMING = FALSE; - - speedMult = 2.4; - - start-script SmokeUnit(); - start-script MotionControl(); - } - -SweetSpot(piecenum) - { piecenum=GP; } - -Killed( severity, corpsetype ) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type FALL; - explode cod type BITMAPONLY; - explode head type FALL; - return( 0 ); - } - - if (severity <= 50) - { - corpsetype = 2; - explode base type FALL; - explode cod type FALL; - explode head type FALL; - return( 0 ); - } - - if (severity <= 99) - { - corpsetype = 3; - explode base type BITMAPONLY; - explode cod type BITMAPONLY; - explode head type BITMAPONLY; - return( 0 ); - } - - corpsetype = 3; - explode base type BITMAPONLY;; - explode cod type BITMAPONLY; - explode head type FALL; - return( 0 ); - } \ No newline at end of file diff --git a/Scripts/neutralradar.cob b/Scripts/neutralradar.cob deleted file mode 100644 index 10b9d2f2b..000000000 Binary files a/Scripts/neutralradar.cob and /dev/null differ diff --git a/Scripts/plasmabattery.bos b/Scripts/plasmabattery.bos deleted file mode 100644 index 500affb98..000000000 --- a/Scripts/plasmabattery.bos +++ /dev/null @@ -1,182 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, bottomturret, topturret, topbarrel, firepoint1, bottombarrel, firepoint2; // these are the pieces of the model - -static-var gun_1, gun_2; // these are the variables - -#define gdhcannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from topturret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn topturret to y-axis <0> speed <60>; -turn bottomturret to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn topturret to y-axis heading speed <225>; -wait-for-turn topturret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -emit-sfx gdhcannon from firepoint2; -move topbarrel to z-axis [-2] speed [500]; -sleep 75; -move topbarrel to z-axis [0] speed [1]; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = topturret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint2; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_2 >= 1) -{ -sleep 100; -} -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn bottomturret to y-axis heading speed <225>; -wait-for-turn bottomturret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_2 == 0 ) -{ -emit-sfx gdhcannon from firepoint2; -move bottombarrel to z-axis [-2] speed [500]; -sleep 75; -move bottombarrel to z-axis [0] speed [1]; -} -gun_2 = gun_2 + 1; -if( gun_2 >= 1 ) -{ -gun_2=0; -} -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = bottomturret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -if( gun_2 == 0 ) -{ -piecenum = firepoint1; -} -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode topbarrel type BITMAPONLY | BITMAP1; -explode bottombarrel type BITMAPONLY | BITMAP3; -explode bottomturret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode topbarrel type FALL | BITMAP1; -explode bottombarrel type BITMAPONLY | BITMAP3; -explode bottomturret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode topbarrel type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode bottombarrel type BITMAPONLY | BITMAP3; -explode bottomturret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode topbarrel type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode bottombarrel type BITMAPONLY | BITMAP3; -explode bottomturret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/plasmabattery.cob b/Scripts/plasmabattery.cob deleted file mode 100644 index b019a59d8..000000000 Binary files a/Scripts/plasmabattery.cob and /dev/null differ diff --git a/Scripts/radar.bos b/Scripts/radar.bos deleted file mode 100644 index d7c25c5bf..000000000 --- a/Scripts/radar.bos +++ /dev/null @@ -1,71 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece radar; - -static-var statechg_DesiredState, statechg_StateChanging; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from radar; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Create() -{ - start-script SmokeUnit(); -} - -SweetSpot(piecenum) -{ - piecenum = radar; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode radar type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode radar type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode radar type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode radar type BITMAPONLY | BITMAP1; -} \ No newline at end of file diff --git a/Scripts/research.bos b/Scripts/research.bos deleted file mode 100644 index 67b0a9ec1..000000000 --- a/Scripts/research.bos +++ /dev/null @@ -1,92 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, sfx; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = sfx; -} - -QueryWeapon1(Func_Var_1) -{ - Func_Var_1 = sfx; -} - - -Create() -{ - move sfx to y-axis [5000.000000] now; - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/scavs/beacon.bos b/Scripts/scavs/beacon.bos new file mode 100644 index 000000000..cb8960b35 --- /dev/null +++ b/Scripts/scavs/beacon.bos @@ -0,0 +1,37 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, topantenna, innerring, outerring, centerring, emit; + +Standby() +{ + while( TRUE ) + { + emit-sfx 1024 + 0 from emit; + sleep 1150; + } + sleep 50; + start-script Standby(); +} + +Create() +{ + spin topantenna around y-axis speed <8>; + spin topantenna around x-axis speed <2>; + spin innerring around y-axis speed <-3>; + spin centerring around y-axis speed <4>; + spin outerring around y-axis speed <-7>; + start-script Standby(); +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; + explode topantenna type EXPLODE_ON_HIT; + explode innerring type EXPLODE_ON_HIT; + explode centerring type EXPLODE_ON_HIT; + explode outerring type EXPLODE_ON_HIT; +} \ No newline at end of file diff --git a/Scripts/scavs/beacon.cob b/Scripts/scavs/beacon.cob new file mode 100644 index 000000000..043cc41dd Binary files /dev/null and b/Scripts/scavs/beacon.cob differ diff --git a/Scripts/scavs/droppod.bos b/Scripts/scavs/droppod.bos new file mode 100644 index 000000000..1864cc305 --- /dev/null +++ b/Scripts/scavs/droppod.bos @@ -0,0 +1,56 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, emit, launcher, arm; + + +Create() +{ + hide launcher; + hide emit; + hide base; + hide arm; + dont-shade base; + dont-cache base; + set ARMORED to 0; + move launcher to y-axis [10000.000000] speed [50000.000000]; + move launcher to x-axis [0.000000] speed [50000.000000]; + move launcher to z-axis [0.000000] speed [50000.000000]; + turn launcher to y-axis <90.000000> speed <10000.000000>; + turn launcher to x-axis <90.000000> speed <10000.000000>; + turn launcher to z-axis <90.000000> speed <10000.000000>; + sleep 100; + spin arm around y-axis speed <21.978022>; + turn arm to x-axis Rand( <0.005495>, <40.989011> ) speed <1000.000000>; + sleep Rand( 1, 100 ); + emit-sfx 2048 from launcher; + sleep 3000; + //show base; +} + +Killed(severity, corpsetype) +{ + emit-sfx 1025 from emit; +} + +QueryNanoPiece(piecenum) +{ + piecenum = base; +} + +QueryWeapon1(piecenum) +{ + piecenum = base; +} + +AimFromWeapon1(piecenum) +{ + piecenum = base; +} + +QueryLandingPad(Func_Var_1) +{ + Func_Var_1 = 1; +} diff --git a/Scripts/scavs/droppod.cob b/Scripts/scavs/droppod.cob new file mode 100644 index 000000000..a82e73aef Binary files /dev/null and b/Scripts/scavs/droppod.cob differ diff --git a/Scripts/scavs/exptype.h b/Scripts/scavs/exptype.h new file mode 100644 index 000000000..7a83187b2 --- /dev/null +++ b/Scripts/scavs/exptype.h @@ -0,0 +1,193 @@ +/* +** EXPtype.h -- Explosion Type information and GET/SET constants for scripts +** +** This Script contains constants compatible only with Spring RTS engine +** not for use with Total Annihilation or TA:Kindgoms +*/ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +// Indices for emit-sfx +#ifndef __SFXTYPE_H_ +#define SFXTYPE_VTOL 0 +//#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 // same as SFX_WAKE +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 // same as SFX_REVERSE_WAKE + +#define SFXTYPE_WHITESMOKE 257 +#define SFXTYPE_BLACKSMOKE 258 +#define SFXTYPE_SUBBUBBLES 259 +#endif + +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define NOCEGTRAIL 64 // Disables the cegtrail for the specific piece (defined in the unit fbi) +#define NOHEATCLOUD 128 // No engine default heat cloud for explosion +#define BITMAP 10000001 + +// Bitmap Explosion Types +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 + +//Customized effects (in FBI/TDF/LUA) +// Explosion generators +#define UNIT_SFX0 1024 +#define UNIT_SFX1 1025 +#define UNIT_SFX2 1026 +#define UNIT_SFX3 1027 +#define UNIT_SFX4 1028 +#define UNIT_SFX5 1029 +#define UNIT_SFX6 1030 +#define UNIT_SFX7 1031 +#define UNIT_SFX8 1032 +#define UNIT_SFX9 1033 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 +#define FIRE_W9 2056 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 +#define DETO_W9 4104 + + +// COB constants +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get +#define REVERSING 109 // get + +// Indices for SET, GET, and GET_UNIT_VALUE for LUA return values +#define LUA0 110 // (LUA0 returns the lua call status, 0 or 1) +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) get WEAPON_RELOADSTATE(weaponNum) for GET +#define WEAPON_RELOADTIME 126 // get (with fake set) get WEAPON_RELOADSTATE(-weaponNum,val) for SET +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define WEAPON_STOCKPILE_COUNT 139 // get (with fake set) + + +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get +#define KSIN 135 // get, kiloSine 1024*sin(x) as COB uses only integers +#define KCOS 136 // get, kiloCosine 1024*cos(x) + +#define KTAN 137 // get, kiloTangent 1024*tan(x) carefull with angles close to 90 deg. might cause overflow +#define SQRT 138 // get, square root (floored to integer) + +#define ENERGY_MAKE 140 // set or get (100*E production) + +#define METAL_MAKE 141 // set or get (100*M production) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif \ No newline at end of file diff --git a/Scripts/scavs/sfxtype.h b/Scripts/scavs/sfxtype.h new file mode 100644 index 000000000..e69de29bb diff --git a/Scripts/scavs/unitDefsTurretSpeeds.h b/Scripts/scavs/unitDefsTurretSpeeds.h new file mode 100644 index 000000000..c30940742 --- /dev/null +++ b/Scripts/scavs/unitDefsTurretSpeeds.h @@ -0,0 +1,68 @@ +/* unitDefsTurretSpeeds.h -- sets turret speed via unitDefs (through lua gadget Spring.CallCOBScript()) + The following variables are assumed to exist: + Weapon1TurretX, Weapon1TurretY + ... + Weapon10TurretX, Weapon10TurretY +*/ + +static-var Weapon1TurretX, Weapon1TurretY; +static-var Weapon2TurretX, Weapon2TurretY; +static-var Weapon3TurretX, Weapon3TurretY; +static-var Weapon4TurretX, Weapon4TurretY; +static-var Weapon5TurretX, Weapon5TurretY; +static-var Weapon6TurretX, Weapon6TurretY; +static-var Weapon7TurretX, Weapon7TurretY; +static-var Weapon8TurretX, Weapon8TurretY; +static-var Weapon9TurretX, Weapon9TurretY; +static-var Weapon10TurretX, Weapon10TurretY; + +SetWeapon1TurretSpeed(var1,var2) +{ + Weapon1TurretX = var1; + Weapon1TurretY = var2; +} +SetWeapon2TurretSpeed(var1,var2) +{ + Weapon2TurretX = var1; + Weapon2TurretY = var2; +} +SetWeapon3TurretSpeed(var1,var2) +{ + Weapon3TurretX = var1; + Weapon3TurretY = var2; +} +SetWeapon4TurretSpeed(var1,var2) +{ + Weapon4TurretX = var1; + Weapon4TurretY = var2; +} +SetWeapon5TurretSpeed(var1,var2) +{ + Weapon5TurretX = var1; + Weapon5TurretY = var2; +} +SetWeapon6TurretSpeed(var1,var2) +{ + Weapon6TurretX = var1; + Weapon6TurretY = var2; +} +SetWeapon7TurretSpeed(var1,var2) +{ + Weapon7TurretX = var1; + Weapon7TurretY = var2; +} +SetWeapon8TurretSpeed(var1,var2) +{ + Weapon8TurretX = var1; + Weapon8TurretY = var2; +} +SetWeapon9TurretSpeed(var1,var2) +{ + Weapon9TurretX = var1; + Weapon9TurretY = var2; +} +SetWeapon10TurretSpeed(var1,var2) +{ + Weapon10TurretX = var1; + Weapon10TurretY = var2; +} \ No newline at end of file diff --git a/Scripts/scavs/water2.h b/Scripts/scavs/water2.h new file mode 100644 index 000000000..b5a5be089 --- /dev/null +++ b/Scripts/scavs/water2.h @@ -0,0 +1,31 @@ +/* Rockunit.h -- Rock the unit when it fire a heavy weapon with lots of recoil */ + +#ifndef __ROCKUNIT_H_ +#define __ROCKUNIT_H_ + + +RockUnit(anglex,anglez) + { + + #define FIRST_SPEED 15 + #define SECOND_SPEED 12 + #define THIRD_SPEED 9 + + turn base to x-axis anglex speed ; + turn base to z-axis anglez speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (0-anglex) speed ; + turn base to z-axis (0-anglez) speed ; + + //wait-for-turn base around z-axis; + //wait-for-turn base around x-axis; + + //turn base to x-axis <0> speed ; + //turn base to z-axis <0> speed ; + + + } +#endif diff --git a/Scripts/scavs/water3.h b/Scripts/scavs/water3.h new file mode 100644 index 000000000..5066f3284 --- /dev/null +++ b/Scripts/scavs/water3.h @@ -0,0 +1,35 @@ +#ifndef __ROCKUNIT_H_ +#define __ROCKUNIT_H_ + + +RockUnit(anglex,anglez) + { + + #define FIRST_SPEED 10 + #define SECOND_SPEED 8 + #define THIRD_SPEED 6 + #define FIFTH_SPEED 4 + + turn base to x-axis anglex speed ; + turn base to z-axis anglez speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (0-anglex) speed ; + turn base to z-axis (0-anglez) speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis (anglex/2) speed ; + turn base to z-axis (anglez/2) speed ; + + wait-for-turn base around z-axis; + wait-for-turn base around x-axis; + + turn base to x-axis <0> speed ; + turn base to z-axis <0> speed ; + } +#endif + diff --git a/Scripts/scavs/weapon1control.h b/Scripts/scavs/weapon1control.h new file mode 100644 index 000000000..d1c1acd4f --- /dev/null +++ b/Scripts/scavs/weapon1control.h @@ -0,0 +1,154 @@ +/* +HOW TO: +- Model MUST contain aimx1 and aimy1 pieces +- Script must have defined Weapon1TurretX and Weapon1TurretY static-vars (turret turn speeds) +- Script must have defined aimx1 and aimy1 pieces +- Change script as such: +Create() +{ + [...] + start-script InitialSetup1(); + [...] +} + +AimWeapon1(heading, pitch) +{ + [...] + start-script Weapon1Drawn(); -- can call a function that draws weapons and then calls Weapon1Drawn() when done if there is an actual animation (ie pw) + [...] -- Remove animations from aimWeapon scripts (use a DrawWeapon1() if an animation is needed, weapon1control will rotate the different aimpieces) + start-script Weapon1SetWtdAim(heading, pitch); + [...] + return (aim1); +} + +RestoreAfterDelay() +{ + [...] + sleep sleeptime; + start-script RestoreWeapon1(); + [...] -- other animations; + call-script Weapon1Restored(); + [...] -- tell script wpn has been restored if needed for walkscripts +} + +- Weapon1Control moves the aim pieces depending on turretSpeeds, sets pitch = 1 when pitch reached and head = 1 when head reached +- Weapon1Drawn allows unit to fire by setting wpnReady1 = 1 +- if pitch = 1, head = 1 and wpnReady = 1 then the weapon can shoot: aim1 = 1 and aimweapon returns aim1 +- Restore animations go in RestoreAfterDelay, RestoreWeapon1() restores aimy and aimx pieces orientation, Weapon1Restored() waits for these pieces to be restored +*/ + +static-var curHead1, wtdHead1, head1, curPitch1, wtdPitch1, pitch1, aim1, wpnReady1; + +Weapon1Control() +{ + while (TRUE) + { + if (curHead1 > <180>) + { + curHead1 = <-360> + curHead1; + } + if (curPitch1 > <180>) + { + curPitch1 = <-360> + curPitch1; + } + if (curHead1 < <-180>) + { + curHead1 = <360> + curHead1; + } + if (curPitch1 < <-180>) + { + curPitch1 = <360> + curPitch1; + } + if (Static_Var_3 == 1) + { + if (((get ABS(curHead1 - wtdHead1)) > <360>) OR(((get ABS(curHead1 - wtdHead1)) > (Weapon1TurretY / 30)) AND ((get ABS(curHead1 - wtdHead1)) < <360> - (Weapon1TurretY / 30)))) + { + head1 = 0; + if(curHead1 < wtdHead1) { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 + (Weapon1TurretY / 30); + else curHead1 = curHead1 - (Weapon1TurretY / 30); + } + + else { + if(get ABS(curHead1 - wtdHead1)< <180>) + curHead1 = curHead1 - (Weapon1TurretY / 30); + else curHead1 = curHead1 + (Weapon1TurretY / 30); + } + } + else + { + head1 = 1; + curHead1 = wtdHead1; + } + if (((get ABS(curPitch1 - wtdPitch1)) > <360>) OR(((get ABS(curPitch1 - wtdPitch1)) > (Weapon1TurretX / 30)) AND ((get ABS(curPitch1 - wtdPitch1)) < <360> - (Weapon1TurretX / 30)))) + { + pitch1 = 0; + if(curPitch1 < wtdPitch1) { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 + (Weapon1TurretX / 30); + else curPitch1 = curPitch1 - (Weapon1TurretX / 30); + } + + else { + if(get ABS(curPitch1 - wtdPitch1)< <180>) + curPitch1 = curPitch1 - (Weapon1TurretX / 30); + else curPitch1 = curPitch1 + (Weapon1TurretX / 30); + } + } + else + { + pitch1 = 1; + curPitch1 = wtdPitch1; + } + if (pitch1 == 1 AND head1 == 1 AND wpnReady1 == 1 AND wtdHead1 != 0) + { + aim1 = 1; + } + else + { + aim1 = 0; + } + turn aimy1 to y-axis curHead1 now; + turn aimx1 to x-axis curPitch1 now; + } + sleep 1; + } +} + +InitialSetup1() +{ + curHead1 = 0; + curPitch1 = 0; + wtdHead1 = 0; + wtdPitch1 = 0; + wpnReady1 = 0; + start-script Weapon1Control(); +} + +Weapon1Drawn() +{ + wpnReady1 = 1; +} + +RestoreWeapon1() +{ + wtdHead1 = 0; + wtdPitch1 = 0; +} + +Weapon1Restored() +{ + wpnReady1 = 0; + while (curHead1 != 0) + { + sleep 25; + } + return (TRUE); +} + +Weapon1SetWtdAim(pitch, heading) +{ + wtdHead1 = heading; + wtdPitch1 = <0> - pitch; +} \ No newline at end of file diff --git a/Scripts/scavs/yard.h b/Scripts/scavs/yard.h new file mode 100644 index 000000000..048994e28 --- /dev/null +++ b/Scripts/scavs/yard.h @@ -0,0 +1,35 @@ +#ifndef SCRIPTS_YARD_H +#define SCRIPTS_YARD_H + +// keep trying to open building's yard until we succeed +OpenYard() + { + set YARD_OPEN to TRUE; + + while(!(get YARD_OPEN)) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to TRUE; + } + + set BUGGER_OFF to FALSE; + } + + +// keep trying to close building's yard until we succeed +CloseYard() + { + set YARD_OPEN to FALSE; + + while(get YARD_OPEN) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to FALSE; + } + + set BUGGER_OFF to FALSE; + } + +#endif // SCRIPTS_YARD_H diff --git a/Scripts/smokestack.BOS b/Scripts/smokestack.BOS deleted file mode 100644 index 0773eadec..000000000 --- a/Scripts/smokestack.BOS +++ /dev/null @@ -1,29 +0,0 @@ -piece gp, smoke1, smoke2, base; - -#include "\headers\definitions.h" -#define smoke 1024+0 - - Flamingass() - { - while(TRUE) - { - emit-sfx smoke from smoke1; - sleep 20; - emit-sfx smoke from smoke2; - sleep 20; - } - - } - -Create() - { - start-script Flamingass(); - } - - - - -Killed( severity, corpsetype ) - { - - } \ No newline at end of file diff --git a/Scripts/smokestack.cob b/Scripts/smokestack.cob deleted file mode 100644 index 5726f6602..000000000 Binary files a/Scripts/smokestack.cob and /dev/null differ diff --git a/Scripts/smokestacktall.BOS b/Scripts/smokestacktall.BOS deleted file mode 100644 index 29249ebc3..000000000 --- a/Scripts/smokestacktall.BOS +++ /dev/null @@ -1,27 +0,0 @@ -piece GP, smoke1, base; - -#include "\headers\definitions.h" -#define smoke 1024+0 - - Flamingass() - { - while(TRUE) - { - emit-sfx smoke from smoke1; - sleep 20; - } - - } - -Create() - { - start-script Flamingass(); - } - - - - -Killed( severity, corpsetype ) - { - - } \ No newline at end of file diff --git a/Scripts/smokestacktall.cob b/Scripts/smokestacktall.cob deleted file mode 100644 index 729faae82..000000000 Binary files a/Scripts/smokestacktall.cob and /dev/null differ diff --git a/Scripts/solar.bos b/Scripts/solar.bos deleted file mode 100644 index 31e864972..000000000 --- a/Scripts/solar.bos +++ /dev/null @@ -1,72 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece solar; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from solar; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Create() -{ - spin solar around y-axis speed <50.005495>; - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = solar; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode solar type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode solar type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode solar type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode solar type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/specialfactory.bos b/Scripts/specialfactory.bos deleted file mode 100644 index 802b22e87..000000000 --- a/Scripts/specialfactory.bos +++ /dev/null @@ -1,193 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece specialfactory, shield, nano1, nano2; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging; - -// Signal definitions -#define SIG_ACTIVATE 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from specialfactory; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -OpenYard() -{ - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = specialfactory; - call-script InitState(); - start-script SmokeUnit(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray != 0 ) - { - piecenum = nano2; - } - spray = !spray; -} - -Demo() -{ - unitviewer = TRUE; -} - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - if( !unitviewer ) - { - sleep 5000; - } - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -} - -StopBuilding() -{ -} - -QueryBuildInfo(piecenum) -{ - piecenum = shield; -} - -SweetSpot(piecenum) -{ - piecenum = specialfactory; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode specialfactory type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode specialfactory type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode specialfactory type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode specialfactory type BITMAPONLY | BITMAP1; -} diff --git a/Scripts/storage.bos b/Scripts/storage.bos deleted file mode 100644 index 69a3ff079..000000000 --- a/Scripts/storage.bos +++ /dev/null @@ -1,71 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece storage; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from storage; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Create() -{ - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = storage; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode storage type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode storage type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode storage type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode storage type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/storage.cob b/Scripts/storage.cob deleted file mode 100644 index d8d92debb..000000000 Binary files a/Scripts/storage.cob and /dev/null differ diff --git a/Scripts/taatank.bos b/Scripts/taatank.bos deleted file mode 100644 index 1ca20b515..000000000 --- a/Scripts/taatank.bos +++ /dev/null @@ -1,154 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -stop-spin barrel1 around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -spin barrel1 around z-axis speed <500.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/taatank.cob b/Scripts/taatank.cob deleted file mode 100644 index a905e99fb..000000000 Binary files a/Scripts/taatank.cob and /dev/null differ diff --git a/Scripts/taatank2.bos b/Scripts/taatank2.bos deleted file mode 100644 index e07260053..000000000 --- a/Scripts/taatank2.bos +++ /dev/null @@ -1,177 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, rotator, dirt; // these are the pieces of the model - -static-var terraintype, bmoving, moving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from dirt; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -stop-spin barrel1 around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn rotator to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn rotator around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -spin barrel1 around z-axis speed <500.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/taatank2.cob b/Scripts/taatank2.cob deleted file mode 100644 index 49ae3cf9e..000000000 Binary files a/Scripts/taatank2.cob and /dev/null differ diff --git a/Scripts/taircon.bos b/Scripts/taircon.bos deleted file mode 100644 index 0b084d3f3..000000000 --- a/Scripts/taircon.bos +++ /dev/null @@ -1,194 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, fan1, fan2, firepoint1; - -static-var Static_Var_1, gun_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype; - -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from base; - sleep 200; - } -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - -QueryWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - -Go() -{ - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -Create() -{ - call-script InitState(); - spin fan1 around y-axis speed <1000.005495>; - spin fan2 around y-axis speed <1000.005495>; - start-script SmokeUnit(); -} - - -StartBuilding(Func_Var_1) -{ - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = base; - Static_Var_5 = 1; - return (0); - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/taircon.cob b/Scripts/taircon.cob deleted file mode 100644 index 0d2d21676..000000000 Binary files a/Scripts/taircon.cob and /dev/null differ diff --git a/Scripts/tannihilator.cob b/Scripts/tannihilator.cob deleted file mode 100644 index d17d62cd4..000000000 Binary files a/Scripts/tannihilator.cob and /dev/null differ diff --git a/Scripts/tantiairtower.bos b/Scripts/tantiairtower.bos deleted file mode 100644 index 7aeebf479..000000000 --- a/Scripts/tantiairtower.bos +++ /dev/null @@ -1,128 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, firepoint; // these are the pieces of the model - -static-var gun_1; // these are the variables - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn turret to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -sleep 75; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint; -} -} - -SweetSpot(piecenum) // not sure what this is for -{ -piecenum = base; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tantiairtower.cob b/Scripts/tantiairtower.cob deleted file mode 100644 index 4355a3867..000000000 Binary files a/Scripts/tantiairtower.cob and /dev/null differ diff --git a/Scripts/tantiairtower2.bos b/Scripts/tantiairtower2.bos deleted file mode 100644 index 4279fe7e9..000000000 --- a/Scripts/tantiairtower2.bos +++ /dev/null @@ -1,108 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define gdmarty 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -turn turret1 to x-axis <0.000000> speed <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret1 to y-axis heading speed <225>; -turn turret1 to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret1 around y-axis; -wait-for-turn turret1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret1 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tantiairtower2.cob b/Scripts/tantiairtower2.cob deleted file mode 100644 index 7016f9d78..000000000 Binary files a/Scripts/tantiairtower2.cob and /dev/null differ diff --git a/Scripts/tartillarytank.bos b/Scripts/tartillarytank.bos deleted file mode 100644 index caa614ec6..000000000 --- a/Scripts/tartillarytank.bos +++ /dev/null @@ -1,151 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var gun_1, terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - explode barrel1 type BITMAPONLY | BITMAP1; - explode turret type BITMAPONLY | BITMAP4; - return (0); - } - if( severity <= 80 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP4; - explode barrel1 type FALL | BITMAP1; - explode turret type SHATTER | BITMAP4; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode turret type SHATTER | BITMAP4; - return (0); - } - corpsetype = 3; - explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tartillarytank.cob b/Scripts/tartillarytank.cob deleted file mode 100644 index a5ff1e0b1..000000000 Binary files a/Scripts/tartillarytank.cob and /dev/null differ diff --git a/Scripts/tassimilator.bos b/Scripts/tassimilator.bos deleted file mode 100644 index 188150e8d..000000000 --- a/Scripts/tassimilator.bos +++ /dev/null @@ -1,149 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define BLUE_EXPLOSION_SMALL 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -turn turret1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; - -turn turret1 to y-axis heading speed <225>; -turn turret1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret1 around x-axis; -wait-for-turn turret1 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx BLUE_EXPLOSION_SMALL from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type FALL | BITMAP1; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -return (0); -} -corpsetype = 3; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -} diff --git a/Scripts/tassimilator.cob b/Scripts/tassimilator.cob deleted file mode 100644 index 5cd79ba83..000000000 Binary files a/Scripts/tassimilator.cob and /dev/null differ diff --git a/Scripts/tbinoc.bos b/Scripts/tbinoc.bos deleted file mode 100644 index 7543a444b..000000000 --- a/Scripts/tbinoc.bos +++ /dev/null @@ -1,128 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, sfxpoint1; - -static-var terraintype, bmoving, moving; // these are the variables - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1024 + 0 from sfxpoint1; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} \ No newline at end of file diff --git a/Scripts/tbinoc.cob b/Scripts/tbinoc.cob deleted file mode 100644 index 4b9914a41..000000000 Binary files a/Scripts/tbinoc.cob and /dev/null differ diff --git a/Scripts/tcentralprocessing.bos b/Scripts/tcentralprocessing.bos deleted file mode 100644 index de28c9837..000000000 --- a/Scripts/tcentralprocessing.bos +++ /dev/null @@ -1,202 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, sfx, firepoint1, shield1, shield2; - -static-var Static_Var_1, gun_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype; - -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from sfx; - sleep 500; - } -} - -AimWeapon1(Func_Var_1, Func_Var_2) -{ - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - -QueryWeapon1(Func_Var_1) -{ - Func_Var_1 = firepoint1; -} - - -Go() -{ - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -Create() -{ - call-script InitState(); - move firepoint1 to y-axis [5000.000000] now; - spin base around y-axis speed <15.005495>; - move base to y-axis [100.000000] now; - start-script fx(); - start-script SmokeUnit(); -} - - -SweetSpot(piecenum) -{ - piecenum = base; -} - -StartBuilding(Func_Var_1) -{ - Static_Var_1 = Func_Var_1; - start-script RequestState(0); -} - -StopBuilding() -{ - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = sfx; - Static_Var_5 = 1; - return (0); - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tcentralprocessing.cob b/Scripts/tcentralprocessing.cob deleted file mode 100644 index 4ab12a820..000000000 Binary files a/Scripts/tcentralprocessing.cob and /dev/null differ diff --git a/Scripts/tcommandfact.cob b/Scripts/tcommandfact.cob deleted file mode 100644 index 6496ec6c0..000000000 Binary files a/Scripts/tcommandfact.cob and /dev/null differ diff --git a/Scripts/tdecimator.bos b/Scripts/tdecimator.bos deleted file mode 100644 index ea8204e45..000000000 --- a/Scripts/tdecimator.bos +++ /dev/null @@ -1,136 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - - -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn turret to y-axis <0> speed <30>; -turn barrel1 to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <30>; -turn barrel1 to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <30>; -turn barrel1 to x-axis <0> - pitch speed <10>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tdecimator.cob b/Scripts/tdecimator.cob deleted file mode 100644 index 9c62bf960..000000000 Binary files a/Scripts/tdecimator.cob and /dev/null differ diff --git a/Scripts/tengineer.cob b/Scripts/tengineer.cob deleted file mode 100644 index bfc0f34fa..000000000 Binary files a/Scripts/tengineer.cob and /dev/null differ diff --git a/Scripts/tengineer2.cob b/Scripts/tengineer2.cob deleted file mode 100644 index bfc0f34fa..000000000 Binary files a/Scripts/tengineer2.cob and /dev/null differ diff --git a/Scripts/tengineer3.bos b/Scripts/tengineer3.bos deleted file mode 100644 index db7706938..000000000 --- a/Scripts/tengineer3.bos +++ /dev/null @@ -1,238 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, nano1, nano2, nano3, nano4; - -static-var Static_Var_1, Static_Var_3, Static_Var_5, statechg_DesiredState, statechg_StateChanging, bMoving, terraintype, building; - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Buildingfx() -{ - while(building) - { - - emit-sfx nanoflame from nano1; - emit-sfx nanoflame from nano2; - emit-sfx nanoflame from nano3; - emit-sfx nanoflame from nano4; - - sleep 5; - } -} - -Go() -{ - turn base to y-axis Static_Var_1 speed <160.000000>; - wait-for-turn base around y-axis; - Static_Var_3 = 1; - if( Static_Var_3 ) - { - - } - sleep 15; - set INBUILDSTANCE to 1; -} - -Stop() -{ - turn base to y-axis <0.000000> speed <160.000000>; - wait-for-turn base around y-axis; - set INBUILDSTANCE to 0; - if( Static_Var_3 ) - { - - } - sleep 20; - Static_Var_3 = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() -{ - Static_Var_3 = 0; - Static_Var_1 = 0; - call-script InitState(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -StartBuilding(Func_Var_1) -{ - building=1; - Static_Var_1 = Func_Var_1; - start-script RequestState(0); - start-script Buildingfx(); -} - -StopBuilding() -{ - building=0; - start-script RequestState(1); -} - -QueryNanoPiece(piecenum) -{ - if( Static_Var_5 == 0 ) - { - piecenum = nano1; - Static_Var_5 = 1; - - } - if( Static_Var_5 == 1 ) - { - piecenum = nano2; - Static_Var_5 = 2; - return (0); - } - if( Static_Var_5 == 2 ) - { - piecenum = nano3; - Static_Var_5 = 0; - - } -} - -TargetHeading(Func_Var_1) -{ - Static_Var_1 = 0 - Func_Var_1; -} - -StartMoving() -{ - bMoving = TRUE; -} - -StopMoving() -{ - bMoving = FALSE; -} - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP2; -} diff --git a/Scripts/tengineer3.cob b/Scripts/tengineer3.cob deleted file mode 100644 index dbffbcaa5..000000000 Binary files a/Scripts/tengineer3.cob and /dev/null differ diff --git a/Scripts/tengineer3up1.cob b/Scripts/tengineer3up1.cob deleted file mode 100644 index dbffbcaa5..000000000 Binary files a/Scripts/tengineer3up1.cob and /dev/null differ diff --git a/Scripts/tfact.bos b/Scripts/tfact.bos deleted file mode 100644 index ee481f759..000000000 --- a/Scripts/tfact.bos +++ /dev/null @@ -1,210 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, nano1, nano2, sfxpoint1, sfxpoint2, sfxpoint3, sfxpoint4, sfxpoint5, sfxpoint6; - -static-var spray, unitviewer, statechg_DesiredState, statechg_StateChanging, building; - -// Signal definitions -#define SIG_ACTIVATE 2 - -#define nanoflame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Buildingfx() -{ - while(building) - { - - emit-sfx nanoflame from sfxpoint1; - emit-sfx nanoflame from sfxpoint2; - emit-sfx nanoflame from sfxpoint3; - emit-sfx nanoflame from sfxpoint4; - emit-sfx nanoflame from sfxpoint5; - emit-sfx nanoflame from sfxpoint6; - - sleep 5; - } -} - - -OpenYard() -{ - set YARD_OPEN to 1; - while( !get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 1; - } - set BUGGER_OFF to 0; -} - -CloseYard() -{ - set YARD_OPEN to 0; - while( get YARD_OPEN ) - { - set BUGGER_OFF to 1; - sleep 1500; - set YARD_OPEN to 0; - } - set BUGGER_OFF to 0; -} - -Go() -{ - call-script OpenYard(); - set INBUILDSTANCE to 1; -} - -Stop() -{ - set INBUILDSTANCE to 0; - call-script CloseYard(); - -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - building=1; - start-script Buildingfx(); - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - building=0; - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - unitviewer = FALSE; - spray = base; - turn sfxpoint1 to y-axis <90> now; - turn sfxpoint2 to y-axis <90> now; - turn sfxpoint3 to y-axis <90> now; - turn sfxpoint4 to y-axis <-90> now; - turn sfxpoint5 to y-axis <-90> now; - turn sfxpoint6 to y-axis <-90> now; - call-script InitState(); - start-script SmokeUnit(); -} - -QueryNanoPiece(piecenum) -{ - if( spray == 0 ) - { - piecenum = nano1; - } - if( spray != 0 ) - { - piecenum = nano2; - } - spray = !spray; -} - - -Activate() -{ - signal SIG_ACTIVATE; - start-script RequestState(0); -} - -Deactivate() -{ - signal SIG_ACTIVATE; - set-signal-mask SIG_ACTIVATE; - - set-signal-mask 0; - start-script RequestState(1); -} - -StartBuilding() -{ -} - -StopBuilding() -{ -} - -QueryBuildInfo(piecenum) -{ - piecenum = base; -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} diff --git a/Scripts/tfact.cob b/Scripts/tfact.cob deleted file mode 100644 index f1e4d3ed0..000000000 Binary files a/Scripts/tfact.cob and /dev/null differ diff --git a/Scripts/tfactory.cob b/Scripts/tfactory.cob deleted file mode 100644 index 121233355..000000000 Binary files a/Scripts/tfactory.cob and /dev/null differ diff --git a/Scripts/tfusion.cob b/Scripts/tfusion.cob deleted file mode 100644 index 570a17396..000000000 Binary files a/Scripts/tfusion.cob and /dev/null differ diff --git a/Scripts/tfusion2.bos b/Scripts/tfusion2.bos deleted file mode 100644 index c16568f48..000000000 --- a/Scripts/tfusion2.bos +++ /dev/null @@ -1,123 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, sfxpoint1, sfxpoint2, sfxpoint3, sfxpoint4, sfxpoint5, sfxpoint6, sfxpoint7, sfxpoint8; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from sfxpoint1; - emit-sfx 2050 from sfxpoint2; - emit-sfx 2050 from sfxpoint3; - emit-sfx 2052 from sfxpoint8; - sleep 5; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2049 from sfxpoint1; - sleep 400; - } -} - -fx3() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2051 from sfxpoint3; - emit-sfx 2051 from sfxpoint4; - emit-sfx 2051 from sfxpoint5; - emit-sfx 2051 from sfxpoint6; - emit-sfx 2051 from sfxpoint7; - sleep 200; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - start-script fx3(); - turn sfxpoint1 to x-axis <-90> now; - turn sfxpoint3 to x-axis <-90> now; - turn sfxpoint4 to x-axis <-90> now; - turn sfxpoint5 to x-axis <-90> now; - turn sfxpoint6 to x-axis <-90> now; - turn sfxpoint7 to x-axis <-90> now; - turn sfxpoint2 to x-axis <90> now; - spin top around y-axis speed <50.005495>; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tfusion2.cob b/Scripts/tfusion2.cob deleted file mode 100644 index 8c5f65f3a..000000000 Binary files a/Scripts/tfusion2.cob and /dev/null differ diff --git a/Scripts/tgeothermal.bos b/Scripts/tgeothermal.bos deleted file mode 100644 index 85fef8d53..000000000 --- a/Scripts/tgeothermal.bos +++ /dev/null @@ -1,96 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, sfxpoint1; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from sfxpoint1; - sleep 5; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2049 from sfxpoint1; - sleep 400; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn sfxpoint1 to x-axis <-90> now; - spin top around y-axis speed <50.005495>; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tgeothermal.cob b/Scripts/tgeothermal.cob deleted file mode 100644 index 9d1e2d2d1..000000000 Binary files a/Scripts/tgeothermal.cob and /dev/null differ diff --git a/Scripts/tgunship.bos b/Scripts/tgunship.bos deleted file mode 100644 index 038350ced..000000000 --- a/Scripts/tgunship.bos +++ /dev/null @@ -1,117 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2; - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -Create() - { - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/tgunship.cob b/Scripts/tgunship.cob deleted file mode 100644 index 4e70e0e02..000000000 Binary files a/Scripts/tgunship.cob and /dev/null differ diff --git a/Scripts/theavylaserplatform.cob b/Scripts/theavylaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/theavylaserplatform.cob and /dev/null differ diff --git a/Scripts/theavylaserplatform2.cob b/Scripts/theavylaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/theavylaserplatform2.cob and /dev/null differ diff --git a/Scripts/theavyraidtank.bos b/Scripts/theavyraidtank.bos deleted file mode 100644 index 4ba0121e8..000000000 --- a/Scripts/theavyraidtank.bos +++ /dev/null @@ -1,133 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define ELECTRICITY 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx ELECTRICITY from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = firepoint1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/theavyraidtank.cob b/Scripts/theavyraidtank.cob deleted file mode 100644 index fdc33b6ac..000000000 Binary files a/Scripts/theavyraidtank.cob and /dev/null differ diff --git a/Scripts/theavytank.bos b/Scripts/theavytank.bos deleted file mode 100644 index 7b6c6adfd..000000000 --- a/Scripts/theavytank.bos +++ /dev/null @@ -1,201 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, barrel1, firepoint1, firepoint2, firepoint3; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging -#define f3 1024+1 - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn barrel1 to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn barrel1 to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn barrel1 around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() -{ - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint3; -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel1 type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/theavytank.cob b/Scripts/theavytank.cob deleted file mode 100644 index 1508840e1..000000000 Binary files a/Scripts/theavytank.cob and /dev/null differ diff --git a/Scripts/theavytank2.cob b/Scripts/theavytank2.cob deleted file mode 100644 index e0f2c5bd3..000000000 Binary files a/Scripts/theavytank2.cob and /dev/null differ diff --git a/Scripts/thellfire-backup.bos b/Scripts/thellfire-backup.bos deleted file mode 100644 index 0af7c8bf7..000000000 --- a/Scripts/thellfire-backup.bos +++ /dev/null @@ -1,213 +0,0 @@ -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, firepoint5, firepoint6, firepoint7, firepoint8, firepoint9; // these are the pieces of the model - -static-var terraintype, bmoving, firing; // these are the variables - -// #define hellfirelaser 2048+0 - -// Signal definitions -#define SIG_AIM 2 -#define SIG_FIRE 4 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -FireScriptThing() -{ -while(1){ - if (firing == 1){ - emit-sfx 2048 from firepoint2; - emit-sfx 2049 from firepoint9; - emit-sfx 2050 from firepoint8; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint3; - emit-sfx 2049 from firepoint2; - emit-sfx 2050 from firepoint9; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint4; - emit-sfx 2049 from firepoint3; - emit-sfx 2050 from firepoint2; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint5; - emit-sfx 2049 from firepoint4; - emit-sfx 2050 from firepoint3; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint6; - emit-sfx 2049 from firepoint5; - emit-sfx 2050 from firepoint4; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint7; - emit-sfx 2049 from firepoint6; - emit-sfx 2050 from firepoint5; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint8; - emit-sfx 2049 from firepoint7; - emit-sfx 2050 from firepoint6; - } - sleep 30; - if (firing == 1){ - emit-sfx 2048 from firepoint9; - emit-sfx 2049 from firepoint8; - emit-sfx 2050 from firepoint7; - } - sleep 30; -} -} - -Create() // tells it what to do on creation -{ -start-script setSFXoccupy(); -start-script EmitWakes(); -start-script SmokeUnit(); -start-script FireScriptThing(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -stop-spin barrel1 around z-axis decelerate <5.000000>; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <100>; -turn turret to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -spin barrel1 around z-axis speed <100.005495>; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -signal SIG_FIRE; -set-signal-mask SIG_FIRE; -firing = 1; -sleep 1000; -firing = 0; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} \ No newline at end of file diff --git a/Scripts/thellfire.bos b/Scripts/thellfire.bos deleted file mode 100644 index b7600f0fe..000000000 --- a/Scripts/thellfire.bos +++ /dev/null @@ -1,213 +0,0 @@ -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, firepoint5, firepoint6, firepoint7, firepoint8, firepoint9; // these are the pieces of the model - -static-var terraintype, bmoving, firing; // these are the variables - -// #define hellfirelaser 2048+0 - -// Signal definitions -#define SIG_AIM 2 -#define SIG_FIRE 4 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -FireScriptThing() -{ -while(1){ - if (firing == 1){ - emit-sfx 2049 from firepoint2; - emit-sfx 2049 from firepoint9; - emit-sfx 2049 from firepoint8; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint3; - emit-sfx 2049 from firepoint2; - emit-sfx 2049 from firepoint9; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint4; - emit-sfx 2049 from firepoint3; - emit-sfx 2049 from firepoint2; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint5; - emit-sfx 2049 from firepoint4; - emit-sfx 2049 from firepoint3; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint6; - emit-sfx 2049 from firepoint5; - emit-sfx 2049 from firepoint4; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint7; - emit-sfx 2049 from firepoint6; - emit-sfx 2049 from firepoint5; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint8; - emit-sfx 2049 from firepoint7; - emit-sfx 2049 from firepoint6; - } - sleep 150; - if (firing == 1){ - emit-sfx 2049 from firepoint9; - emit-sfx 2049 from firepoint8; - emit-sfx 2049 from firepoint7; - } - sleep 150; -} -} - -Create() // tells it what to do on creation -{ -start-script setSFXoccupy(); -start-script EmitWakes(); -start-script SmokeUnit(); -start-script FireScriptThing(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -stop-spin barrel1 around z-axis decelerate <5.000000>; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <30>; -turn turret to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn turret around x-axis; -spin barrel1 around z-axis speed <-100.005495>; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -signal SIG_FIRE; -set-signal-mask SIG_FIRE; -firing = 1; -sleep 1000; -firing = 0; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} \ No newline at end of file diff --git a/Scripts/thellfire.cob b/Scripts/thellfire.cob deleted file mode 100644 index 1598134d6..000000000 Binary files a/Scripts/thellfire.cob and /dev/null differ diff --git a/Scripts/tinfantryelectric.bos b/Scripts/tinfantryelectric.bos deleted file mode 100644 index 743241475..000000000 --- a/Scripts/tinfantryelectric.bos +++ /dev/null @@ -1,215 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - - -static-var moving, walking, aiming; -piece torso, leftgun, firepointleft, rightgun, firepointright, leftlegtop, leftlegbottom, rightlegtop, rightlegbottom; - -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 -#define THIGH_F <-15> -#define THIGH_B <10> -#define THIGHSPEED_F <50> -#define THIGHSPEED_B <50> -#define SHIN_F <0> -#define SHIN_B <20> -#define SHINSPEED_F <80> -#define SHINSPEED_B <80> -#define TORSO <15> -#define torsoSPEED <50> -#define WALKBOB [1] -#define BOBSPEED [4] -#define ELECTRICITY 1024+0 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from torso; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Walk() { - if(walking) return 0; //semaphore - walking=1; - - turn leftlegtop to x-axis 0 now; - turn leftlegbottom to x-axis 0 now; - turn rightlegtop to x-axis <0> now; - turn rightlegbottom to x-axis <0> now; - turn torso to z-axis TORSO now; - while(moving) { - if (moving) { - turn rightlegtop to x-axis THIGH_F speed THIGHSPEED_F; - turn rightlegbottom to x-axis SHIN_B speed SHINSPEED_B; - wait-for-turn leftlegtop around x-axis; - } - if (moving) { - turn leftlegtop to x-axis THIGH_B speed THIGHSPEED_B; - turn torso to z-axis 0 - torso speed torsoSPEED; - wait-for-turn rightlegbottom around x-axis; - } - if (moving) { - turn rightlegbottom to x-axis SHIN_F speed SHINSPEED_F; - wait-for-turn rightlegtop around x-axis; - } - if (moving) { - turn rightlegtop to x-axis THIGH_B speed THIGHSPEED_B; - turn torso to z-axis torso speed torsoSPEED; - wait-for-turn leftlegtop around x-axis; - } - if (moving) { - turn leftlegtop to x-axis THIGH_F speed THIGHSPEED_F; - turn leftlegbottom to x-axis SHIN_B speed SHINSPEED_B; - wait-for-turn leftlegbottom around x-axis; - } - if (moving) { - turn leftlegbottom to x-axis SHIN_F speed SHINSPEED_F; - wait-for-turn rightlegtop around x-axis; - } - } - walking=0; - turn rightlegtop to x-axis 0 speed THIGHSPEED_F; - turn leftlegtop to x-axis 0 speed THIGHSPEED_F; - turn rightlegbottom to x-axis 0 speed SHINSPEED_F; - turn leftlegbottom to x-axis 0 speed SHINSPEED_F; - turn torso to z-axis 0 speed torsoSPEED; -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from firepointleft; - emit-sfx 1024 from firepointright; - sleep 150; - } -} - -Create() -{ -moving = 0; -start-script Walk(); -start-script SmokeUnit(); -start-script fx(); -} - -StartMoving() { moving=1; - start-script Walk(); } -StopMoving() { moving=0; } - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn torso to y-axis <0> speed <30>; -turn leftgun to x-axis <0> speed <10>; -turn rightgun to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn torso to y-axis heading speed <30>; -turn leftgun to x-axis <0> - pitch speed <10>; -wait-for-turn torso around y-axis; -wait-for-turn leftgun around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = torso; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepointleft; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn torso to y-axis heading speed <30>; -turn rightgun to x-axis <0> - pitch speed <10>; -wait-for-turn torso around y-axis; -wait-for-turn rightgun around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = torso; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepointright; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode leftgun type BITMAPONLY | BITMAP1; -explode rightgun type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode leftgun type BITMAPONLY | BITMAP4; -explode rightgun type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode leftgun type BITMAPONLY | BITMAP1; -explode rightgun type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode torso type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tinfantryelectric.cob b/Scripts/tinfantryelectric.cob deleted file mode 100644 index dd44c23d5..000000000 Binary files a/Scripts/tinfantryelectric.cob and /dev/null differ diff --git a/Scripts/tinfantrylaser.bos b/Scripts/tinfantrylaser.bos deleted file mode 100644 index 743241475..000000000 --- a/Scripts/tinfantrylaser.bos +++ /dev/null @@ -1,215 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - - -static-var moving, walking, aiming; -piece torso, leftgun, firepointleft, rightgun, firepointright, leftlegtop, leftlegbottom, rightlegtop, rightlegbottom; - -#define SIG_AIM 2 // this is a aim define -#define SIG_AIM_2 4 -#define THIGH_F <-15> -#define THIGH_B <10> -#define THIGHSPEED_F <50> -#define THIGHSPEED_B <50> -#define SHIN_F <0> -#define SHIN_B <20> -#define SHINSPEED_F <80> -#define SHINSPEED_B <80> -#define TORSO <15> -#define torsoSPEED <50> -#define WALKBOB [1] -#define BOBSPEED [4] -#define ELECTRICITY 1024+0 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from torso; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Walk() { - if(walking) return 0; //semaphore - walking=1; - - turn leftlegtop to x-axis 0 now; - turn leftlegbottom to x-axis 0 now; - turn rightlegtop to x-axis <0> now; - turn rightlegbottom to x-axis <0> now; - turn torso to z-axis TORSO now; - while(moving) { - if (moving) { - turn rightlegtop to x-axis THIGH_F speed THIGHSPEED_F; - turn rightlegbottom to x-axis SHIN_B speed SHINSPEED_B; - wait-for-turn leftlegtop around x-axis; - } - if (moving) { - turn leftlegtop to x-axis THIGH_B speed THIGHSPEED_B; - turn torso to z-axis 0 - torso speed torsoSPEED; - wait-for-turn rightlegbottom around x-axis; - } - if (moving) { - turn rightlegbottom to x-axis SHIN_F speed SHINSPEED_F; - wait-for-turn rightlegtop around x-axis; - } - if (moving) { - turn rightlegtop to x-axis THIGH_B speed THIGHSPEED_B; - turn torso to z-axis torso speed torsoSPEED; - wait-for-turn leftlegtop around x-axis; - } - if (moving) { - turn leftlegtop to x-axis THIGH_F speed THIGHSPEED_F; - turn leftlegbottom to x-axis SHIN_B speed SHINSPEED_B; - wait-for-turn leftlegbottom around x-axis; - } - if (moving) { - turn leftlegbottom to x-axis SHIN_F speed SHINSPEED_F; - wait-for-turn rightlegtop around x-axis; - } - } - walking=0; - turn rightlegtop to x-axis 0 speed THIGHSPEED_F; - turn leftlegtop to x-axis 0 speed THIGHSPEED_F; - turn rightlegbottom to x-axis 0 speed SHINSPEED_F; - turn leftlegbottom to x-axis 0 speed SHINSPEED_F; - turn torso to z-axis 0 speed torsoSPEED; -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 1024 from firepointleft; - emit-sfx 1024 from firepointright; - sleep 150; - } -} - -Create() -{ -moving = 0; -start-script Walk(); -start-script SmokeUnit(); -start-script fx(); -} - -StartMoving() { moving=1; - start-script Walk(); } -StopMoving() { moving=0; } - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 10000; -turn torso to y-axis <0> speed <30>; -turn leftgun to x-axis <0> speed <10>; -turn rightgun to x-axis <0> speed <10>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn torso to y-axis heading speed <30>; -turn leftgun to x-axis <0> - pitch speed <10>; -wait-for-turn torso around y-axis; -wait-for-turn leftgun around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = torso; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepointleft; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn torso to y-axis heading speed <30>; -turn rightgun to x-axis <0> - pitch speed <10>; -wait-for-turn torso around y-axis; -wait-for-turn rightgun around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = torso; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepointright; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode leftgun type BITMAPONLY | BITMAP1; -explode rightgun type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode leftgun type BITMAPONLY | BITMAP4; -explode rightgun type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode leftgun type BITMAPONLY | BITMAP1; -explode rightgun type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode torso type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tinfantrylaser.cob b/Scripts/tinfantrylaser.cob deleted file mode 100644 index dd44c23d5..000000000 Binary files a/Scripts/tinfantrylaser.cob and /dev/null differ diff --git a/Scripts/tinterceptor.bos b/Scripts/tinterceptor.bos deleted file mode 100644 index 47d419c97..000000000 --- a/Scripts/tinterceptor.bos +++ /dev/null @@ -1,92 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -// Signal definitions -#define SIG_AIM 2 - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from base; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = base; -} - -Create() - { - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/tinterceptor.cob b/Scripts/tinterceptor.cob deleted file mode 100644 index 356f56868..000000000 Binary files a/Scripts/tinterceptor.cob and /dev/null differ diff --git a/Scripts/tinterceptor2.bos b/Scripts/tinterceptor2.bos deleted file mode 100644 index 94f179ce3..000000000 --- a/Scripts/tinterceptor2.bos +++ /dev/null @@ -1,211 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, firepoint3, firepoint4, exhaust; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 - -#define flash 1024+0 -#define flame 1024+1 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from exhaust; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint3; -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - -AimWeapon4(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon4() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx flash from firepoint4; -} - -AimFromWeapon4(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon4(piecenum) // where the shot is called from -{ -piecenum = firepoint4; -} - - -AimWeapon5(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon5() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon5(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon5(piecenum) // where the shot is called from -{ -piecenum = base; -} - - - -Create() - { - turn exhaust to y-axis <180> now; - start-script Thrust(); - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/tinterceptor2.cob b/Scripts/tinterceptor2.cob deleted file mode 100644 index 658172458..000000000 Binary files a/Scripts/tinterceptor2.cob and /dev/null differ diff --git a/Scripts/tlasermech.bos b/Scripts/tlasermech.bos deleted file mode 100644 index 31574f67e..000000000 --- a/Scripts/tlasermech.bos +++ /dev/null @@ -1,392 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece torso, upleg1, lowleg1, foot1, upleg2, lowleg2, foot2, firepoint1, firepoint2, arm1, arm2; - -static-var moving; - -#define f3 1024+0 - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 -#define SIG_AIM_8 16 - -Walkscript() -{ - while(1) - { - if (moving) - // Step 1 - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 2 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 3 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 4 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 5 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 6 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - //Step 7 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 8 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - } -} - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from torso; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -Create() -{ - turn upleg1 to x-axis <-35.0> speed <500.000000>; - turn lowleg1 to x-axis <10.0> speed <500.000000>; - turn foot1 to x-axis <25.0> speed <500.000000>; - turn upleg2 to x-axis <-35.0> speed <500.000000>; - turn lowleg2 to x-axis <10.0> speed <500.000000>; - turn foot2 to x-axis <25.0> speed <500.000000>; - moving = FALSE; - start-script Walkscript(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn torso to y-axis <0.0> speed <70.0>; - turn arm1 to x-axis <0.0> speed <50.0>; - turn arm2 to x-axis <0.0> speed <50.0>; -} - -AimWeapon1(heading, pitch) -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - turn torso to y-axis heading speed <150.0>; - turn arm1 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm1 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() -{ - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; - sleep 1; - emit-sfx f3 from firepoint1; -} - -AimFromWeapon1(piecenum) -{ - piecenum = torso; -} - -QueryWeapon1(piecenum) -{ - piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) -{ - signal SIG_AIM_2; - set-signal-mask SIG_AIM_2; - turn torso to y-axis heading speed <150.0>; - turn arm2 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm2 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon2() -{ - sleep 1; - emit-sfx f3 from firepoint2; - sleep 1; - emit-sfx f3 from firepoint2; - sleep 1; - emit-sfx f3 from firepoint2; - sleep 1; - emit-sfx f3 from firepoint2; -} - -AimFromWeapon2(piecenum) -{ - piecenum = torso; -} - -QueryWeapon2(piecenum) -{ - piecenum = firepoint2; -} - - -StartMoving() -{ - moving = TRUE; -} - -StopMoving() -{ - moving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode torso type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode torso type FALL | BITMAP3; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode torso type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; - return (0); - } - corpsetype = 3; - explode torso type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; -} diff --git a/Scripts/tlasermech.cob b/Scripts/tlasermech.cob deleted file mode 100644 index 70bbeacd1..000000000 Binary files a/Scripts/tlasermech.cob and /dev/null differ diff --git a/Scripts/tlightlaserplatform.cob b/Scripts/tlightlaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/tlightlaserplatform.cob and /dev/null differ diff --git a/Scripts/tlightlaserplatform2.bos b/Scripts/tlightlaserplatform2.bos deleted file mode 100644 index 8ca828f14..000000000 --- a/Scripts/tlightlaserplatform2.bos +++ /dev/null @@ -1,108 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; // these are the pieces of the model - -static-var gun_1; // these are the variables - -#define BLUE_EXPLOSION_SMALL 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -Create() // tells it what to do on creation -{ -start-script SmokeUnit(); -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -while( gun_1 >= 1) -{ -sleep 100; -} -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -if( gun_1 == 0 ) -{ -emit-sfx BLUE_EXPLOSION_SMALL from firepoint1; -} -gun_1 = gun_1 + 1; -if( gun_1 >= 1 ) -{ -gun_1=0; -} -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -if( gun_1 == 0 ) -{ -piecenum = firepoint1; -} -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tlightlaserplatform2.cob b/Scripts/tlightlaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/tlightlaserplatform2.cob and /dev/null differ diff --git a/Scripts/tlightmech.bos b/Scripts/tlightmech.bos deleted file mode 100644 index 64bd1b315..000000000 --- a/Scripts/tlightmech.bos +++ /dev/null @@ -1,425 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece torso, upleg1, lowleg1, foot1, upleg2, lowleg2, foot2, firepoint1, firepoint2, firepoint3, firepoint4, arm1, arm2; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_4 8 -#define SIG_AIM_8 16 - -Walkscript() -{ - while(1) - { - if (moving) - // Step 1 - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 2 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 3 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 4 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 5 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 6 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - //Step 7 - if (moving) - { - - turn upleg1 to x-axis <-35> speed <300.000000>; - turn lowleg1 to x-axis <10> speed <300.000000>; - turn foot1 to x-axis <25> speed <300.000000>; - - - turn upleg2 to x-axis <5> speed <200.000000>; - turn lowleg2 to x-axis <-45> speed <200.000000>; - turn foot2 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - // Step 8 - if (moving) - { - - turn upleg2 to x-axis <-35> speed <300.000000>; - turn lowleg2 to x-axis <10> speed <300.000000>; - turn foot2 to x-axis <25> speed <300.000000>; - - - turn upleg1 to x-axis <5> speed <200.000000>; - turn lowleg1 to x-axis <-45> speed <200.000000>; - turn foot1 to x-axis <30> speed <100.000000>; - - - sleep 400; - } - while(!moving) - { - sleep 50; - turn upleg1 to x-axis <-35.0> speed <300.000000>; - turn lowleg1 to x-axis <10.0> speed <300.000000>; - turn foot1 to x-axis <25.0> speed <300.000000>; - turn upleg2 to x-axis <-35.0> speed <300.000000>; - turn lowleg2 to x-axis <10.0> speed <300.000000>; - turn foot2 to x-axis <25.0> speed <300.000000>; - sleep 50; - } - } -} - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from torso; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -Create() -{ - turn upleg1 to x-axis <-35.0> speed <500.000000>; - turn lowleg1 to x-axis <10.0> speed <500.000000>; - turn foot1 to x-axis <25.0> speed <500.000000>; - turn upleg2 to x-axis <-35.0> speed <500.000000>; - turn lowleg2 to x-axis <10.0> speed <500.000000>; - turn foot2 to x-axis <25.0> speed <500.000000>; - moving = FALSE; - start-script Walkscript(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() -{ - sleep 3000; - turn torso to y-axis <0.0> speed <70.0>; - turn arm1 to x-axis <0.0> speed <50.0>; - turn arm2 to x-axis <0.0> speed <50.0>; -} - -AimWeapon1(heading, pitch) -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - turn torso to y-axis heading speed <150.0>; - turn arm1 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm1 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() -{ -} - -AimFromWeapon1(piecenum) -{ - piecenum = torso; -} - -QueryWeapon1(piecenum) -{ - piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) -{ - signal SIG_AIM_2; - set-signal-mask SIG_AIM_2; - turn torso to y-axis heading speed <150.0>; - turn arm1 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm1 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon2() -{ -} - -AimFromWeapon2(piecenum) -{ - piecenum = torso; -} - -QueryWeapon2(piecenum) -{ - piecenum = firepoint2; -} - -AimWeapon3(heading, pitch) -{ - signal SIG_AIM_4; - set-signal-mask SIG_AIM_4; - turn torso to y-axis heading speed <150.0>; - turn arm2 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm2 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon3() -{ -} - -AimFromWeapon3(piecenum) -{ - piecenum = torso; -} - -QueryWeapon3(piecenum) -{ - piecenum = firepoint3; -} - -AimWeapon4(heading, pitch) -{ - signal SIG_AIM_8; - set-signal-mask SIG_AIM_8; - turn torso to y-axis heading speed <150.0>; - turn arm2 to x-axis <0.0> - pitch speed <100.0>; - wait-for-turn torso around y-axis; - wait-for-turn arm2 around x-axis; - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon4() -{ -} - -AimFromWeapon4(piecenum) -{ - piecenum = torso; -} - -QueryWeapon4(piecenum) -{ - piecenum = firepoint4; -} - -StartMoving() -{ - moving = TRUE; -} - -StopMoving() -{ - moving = FALSE; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode torso type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode torso type FALL | BITMAP3; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode torso type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; - return (0); - } - corpsetype = 3; - explode torso type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; -} diff --git a/Scripts/tlightmech.cob b/Scripts/tlightmech.cob deleted file mode 100644 index 7746c7fe6..000000000 Binary files a/Scripts/tlightmech.cob and /dev/null differ diff --git a/Scripts/tlighttank-nemo.bos b/Scripts/tlighttank-nemo.bos deleted file mode 100644 index 80a8bf70a..000000000 --- a/Scripts/tlighttank-nemo.bos +++ /dev/null @@ -1,166 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var terraintype, bMoving, bAiming; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging -#define beam 2048+1 -// Signal definitions -#define SIG_AIM 2 // this is an aim define -#define SIG_AIM2 4 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -BeamControl() -{ - while (1) - { - while (bAiming==1) - { - emit-sfx beam from firepoint1; - sleep 20; - } - sleep 1000; - } -} - - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); - start-script BeamControl(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -bAiming=0; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -bAiming=1; -turn turret to y-axis heading speed <600>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (0); -} - -FireWeapon1(heading) -{ - return (0); -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tlighttank-nemo.cob b/Scripts/tlighttank-nemo.cob deleted file mode 100644 index 32faf5846..000000000 Binary files a/Scripts/tlighttank-nemo.cob and /dev/null differ diff --git a/Scripts/tlighttank.bos b/Scripts/tlighttank.bos deleted file mode 100644 index 264eea3eb..000000000 --- a/Scripts/tlighttank.bos +++ /dev/null @@ -1,150 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <600>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tlighttank.cob b/Scripts/tlighttank.cob deleted file mode 100644 index 01199dcec..000000000 Binary files a/Scripts/tlighttank.cob and /dev/null differ diff --git a/Scripts/tlighttank2.bos b/Scripts/tlighttank2.bos deleted file mode 100644 index de773f41c..000000000 --- a/Scripts/tlighttank2.bos +++ /dev/null @@ -1,179 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, turret, barrel1, firepoint1, barrel2, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move hull to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move hull to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = barrel2; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode hull type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tlighttank2.cob b/Scripts/tlighttank2.cob deleted file mode 100644 index 9e2615069..000000000 Binary files a/Scripts/tlighttank2.cob and /dev/null differ diff --git a/Scripts/tlighttank3.bos b/Scripts/tlighttank3.bos deleted file mode 100644 index bf1cc8078..000000000 --- a/Scripts/tlighttank3.bos +++ /dev/null @@ -1,177 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, sfxpoint1; // these are the pieces of the model - -static-var terraintype, bmoving, moving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx 1025 + 0 from sfxpoint1; - } - sleep 400; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -Create() // tells it what to do on creation -{ - start-script Thrust(); - start-script setSFXoccupy(); - start-script EmitWakes(); - start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = barrel1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tlighttank3.cob b/Scripts/tlighttank3.cob deleted file mode 100644 index d50f9b761..000000000 Binary files a/Scripts/tlighttank3.cob and /dev/null differ diff --git a/Scripts/tlightturret.bos b/Scripts/tlightturret.bos deleted file mode 100644 index 864ede030..000000000 --- a/Scripts/tlightturret.bos +++ /dev/null @@ -1,110 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, stock, barrels, firepoint1; // these are the pieces of the model - - -// Signal definitions -#define SIG_AIM 2 // this is a aim define - -#define gdmarty 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - - -Create() // tells it what to do on creation -{ - -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn stock to x-axis <0.000000> speed <30.000000>; -stop-spin barrels around z-axis decelerate <30.000000>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn stock to x-axis <0.000000> - pitch speed <150.000000>; -wait-for-turn turret around y-axis; -wait-for-turn stock around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -spin barrels around z-axis speed <500.005495>; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = stock; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode turret type BITMAPONLY | BITMAP1; -explode barrels type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode turret type BITMAPONLY | BITMAP4; -explode barrels type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode turret type BITMAPONLY | BITMAP1; -explode barrels type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrels type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tlightturret.cob b/Scripts/tlightturret.cob deleted file mode 100644 index 95406d0ae..000000000 Binary files a/Scripts/tlightturret.cob and /dev/null differ diff --git a/Scripts/tmediumlaserplatform.cob b/Scripts/tmediumlaserplatform.cob deleted file mode 100644 index 3cef92462..000000000 Binary files a/Scripts/tmediumlaserplatform.cob and /dev/null differ diff --git a/Scripts/tmediumlaserplatform2.cob b/Scripts/tmediumlaserplatform2.cob deleted file mode 100644 index 09066877b..000000000 Binary files a/Scripts/tmediumlaserplatform2.cob and /dev/null differ diff --git a/Scripts/tmediumtank.bos b/Scripts/tmediumtank.bos deleted file mode 100644 index 22210a8ec..000000000 --- a/Scripts/tmediumtank.bos +++ /dev/null @@ -1,178 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, barrel2, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -turn barrel2 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <500>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <225>; -turn barrel2 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel2 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx gdmarty from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tmediumtank.cob b/Scripts/tmediumtank.cob deleted file mode 100644 index 2ef91a3b5..000000000 Binary files a/Scripts/tmediumtank.cob and /dev/null differ diff --git a/Scripts/tmediumtank2.cob b/Scripts/tmediumtank2.cob deleted file mode 100644 index e0f2c5bd3..000000000 Binary files a/Scripts/tmediumtank2.cob and /dev/null differ diff --git a/Scripts/tmetalextractor.bos b/Scripts/tmetalextractor.bos deleted file mode 100644 index 0b569850c..000000000 --- a/Scripts/tmetalextractor.bos +++ /dev/null @@ -1,197 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1, firepoint2, ball1, ball2, ball3, ball4, bottom, middle, top, fireball1, fireball2, fireball3, fireball4; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging, ball1state, ball2state, ball3state, ball4state, ballstate; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; - ballstate = 1; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; - ballstate = 0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -mexanimation() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx 1024 from firepoint2; -sleep 400; -} -} -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from fireball1; - emit-sfx 2048 from fireball2; - emit-sfx 2048 from fireball3; - emit-sfx 2048 from fireball4; - - - sleep 5; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - - emit-sfx 2049 from fireball1; - emit-sfx 2049 from fireball2; - emit-sfx 2049 from fireball3; - emit-sfx 2049 from fireball4; - sleep 400; - } -} - - -Create() -{ - start-script mexanimation(); - start-script fx(); - start-script fx2(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - turn firepoint1 to x-axis <-90> now; - turn fireball1 to x-axis <-90> now; - turn fireball2 to x-axis <-90> now; - turn fireball3 to x-axis <-90> now; - turn fireball4 to x-axis <-90> now; - spin bottom around y-axis speed <-10.000000>; - spin middle around y-axis speed <-20.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/tmetalextractor.cob b/Scripts/tmetalextractor.cob deleted file mode 100644 index 9f43e523c..000000000 Binary files a/Scripts/tmetalextractor.cob and /dev/null differ diff --git a/Scripts/tmex.cob b/Scripts/tmex.cob deleted file mode 100644 index 01ae649c1..000000000 Binary files a/Scripts/tmex.cob and /dev/null differ diff --git a/Scripts/tmex2.bos b/Scripts/tmex2.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/tmex2.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/tmex2.cob b/Scripts/tmex2.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/tmex2.cob and /dev/null differ diff --git a/Scripts/tmex2up1.bos b/Scripts/tmex2up1.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/tmex2up1.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/tmex2up1.cob b/Scripts/tmex2up1.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/tmex2up1.cob and /dev/null differ diff --git a/Scripts/tmex2up2.bos b/Scripts/tmex2up2.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/tmex2up2.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/tmex2up2.cob b/Scripts/tmex2up2.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/tmex2up2.cob and /dev/null differ diff --git a/Scripts/tmex2up3.bos b/Scripts/tmex2up3.bos deleted file mode 100644 index 8a5743891..000000000 --- a/Scripts/tmex2up3.bos +++ /dev/null @@ -1,171 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top, firepoint1, firepoint2; - -static-var Static_Var_1, Static_Var_2, Static_Var_3, statechg_DesiredState, statechg_StateChanging; - -#define topsfx 1024+0 // this is a custom explosion generator thinging -#define basesfx 1025+0 // this is a custom explosion generator thinging - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Go() -{ - spin top around y-axis speed Static_Var_1 accelerate Static_Var_2; -} - -Stop() -{ - stop-spin top around y-axis decelerate Static_Var_3; - wait-for-turn top around y-axis; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script Go(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script Stop(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - - -TopEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx topsfx from firepoint1; -sleep 500; -} -} -} - -BaseEffect() -{ -while (1) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { -emit-sfx basesfx from firepoint2; -sleep 500; -} -} -} - - -Create() -{ - start-script TopEffect(); - start-script BaseEffect(); - Static_Var_1 = 0; - Static_Var_2 = 25; - Static_Var_3 = 50; - spin base around y-axis speed <-10.000000>; - call-script InitState(); - start-script SmokeUnit(); -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - - -SetSpeed(Func_Var_1) -{ - Static_Var_1 = Func_Var_1 * 5; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode top type BITMAPONLY | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode top type SHATTER | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode top type SHATTER | EXPLODE_ON_HIT | BITMAP1; - explode base type BITMAPONLY | BITMAP2; - return (0); - } - corpsetype = 3; - explode top type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP2; -} diff --git a/Scripts/tmex2up3.cob b/Scripts/tmex2up3.cob deleted file mode 100644 index e21862f99..000000000 Binary files a/Scripts/tmex2up3.cob and /dev/null differ diff --git a/Scripts/tmexmoho.cob b/Scripts/tmexmoho.cob deleted file mode 100644 index 01ae649c1..000000000 Binary files a/Scripts/tmexmoho.cob and /dev/null differ diff --git a/Scripts/tmine.bos b/Scripts/tmine.bos deleted file mode 100644 index dce627e99..000000000 --- a/Scripts/tmine.bos +++ /dev/null @@ -1,33 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull; - -Create() -{ -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode hull type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode hull type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode hull type BITMAPONLY | BITMAP1; -} diff --git a/Scripts/tmine.cob b/Scripts/tmine.cob deleted file mode 100644 index fa0da8a05..000000000 Binary files a/Scripts/tmine.cob and /dev/null differ diff --git a/Scripts/tmissilearty.bos b/Scripts/tmissilearty.bos deleted file mode 100644 index 3a992963e..000000000 --- a/Scripts/tmissilearty.bos +++ /dev/null @@ -1,534 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, barrels, firepoint1, firepoint2, firepoint3, firepoint4, firepoint5, firepoint6, firepoint7, firepoint8, firepoint9, firepoint10, firepoint11, firepoint12, firepoint13, firepoint14, firepoint15, firepoint16, firepoint17, firepoint18, firepoint19, firepoint20, firepoint21, firepoint22, firepoint23, firepoint24, firepoint25, firepoint26, firepoint27, firepoint28, firepoint29, firepoint30, firepoint31, firepoint32, exhaustpoint1, exhaustpoint2, exhaustpoint3, exhaustpoint4, exhaustpoint5, exhaustpoint6, exhaustpoint7, exhaustpoint8, exhaustpoint9, exhaustpoint10, exhaustpoint11, exhaustpoint12, exhaustpoint13, exhaustpoint14, exhaustpoint15, exhaustpoint16, exhaustpoint17, exhaustpoint18, exhaustpoint19, exhaustpoint20, exhaustpoint21, exhaustpoint22, exhaustpoint23, exhaustpoint24, exhaustpoint25, exhaustpoint26, exhaustpoint27, exhaustpoint28, exhaustpoint29, exhaustpoint30, exhaustpoint31, exhaustpoint32; - -static-var moving, gun_1, missilefire, missile, bmoving, terraintype; - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 -#define SIG_AIM_3 8 - -#define rocketlaunchback 1024+0 - -#define SFACTOR -2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - - gun_1 = 0; - missile = 0; - moving = FALSE; - start-script SmokeUnit(); -} - -SlowReload() -{ - if( missilefire > 0 AND missilefire < 32 ) - { - while( missilefire > 0 AND missile == 0 ) - { - --missilefire; - sleep 666; - } - } -} - -Reload() -{ - sleep 18000; - gun_1 = 0; -} - -RestoreAfterDelay() -{ - sleep 3000; - turn barrels to y-axis <0> speed <60>; - turn barrels to x-axis <0> speed <30>; - if( gun_1 == 0 ) - { - start-script SlowReload(); - } - missile = 0; -} - -//Weapon1 - -AimWeapon1(heading, pitch) -{ - signal SIG_AIM; - set-signal-mask SIG_AIM; - turn barrels to y-axis heading speed <225>; - turn barrels to x-axis <0> - pitch speed <150>; - wait-for-turn barrels around y-axis; - wait-for-turn barrels around x-axis; - missile = 1; - while( gun_1 == 1 ) - { - sleep 100; - } - while( moving ) - { - sleep 100; - } - start-script RestoreAfterDelay(); - return (1); -} - -FireWeapon1() -{ - if( missilefire >= 0 AND missilefire < 32 ) - { - if( missilefire == 0 ) - { - - emit-sfx rocketlaunchback from exhaustpoint1; - sleep 100; - } - if( missilefire == 1 ) - { - - emit-sfx rocketlaunchback from exhaustpoint2; - sleep 100; - - } - if( missilefire == 2 ) - { - - emit-sfx rocketlaunchback from exhaustpoint3; - sleep 100; - } - if( missilefire == 3 ) - { - - emit-sfx rocketlaunchback from exhaustpoint4; - sleep 100; - } - if( missilefire == 4 ) - { - - emit-sfx rocketlaunchback from exhaustpoint5; - sleep 100; - } - if( missilefire == 5 ) - { - - emit-sfx rocketlaunchback from exhaustpoint6; - sleep 100; - } - if( missilefire == 6 ) - { - - emit-sfx rocketlaunchback from exhaustpoint7; - sleep 100; - } - if( missilefire == 7 ) - { - - emit-sfx rocketlaunchback from exhaustpoint8; - sleep 100; - } - if( missilefire == 8 ) - { - - emit-sfx rocketlaunchback from exhaustpoint9; - sleep 100; - } - if( missilefire == 9 ) - { - - emit-sfx rocketlaunchback from exhaustpoint10; - sleep 100; - } - if( missilefire == 10 ) - { - - emit-sfx rocketlaunchback from exhaustpoint11; - sleep 100; - } - if( missilefire == 11 ) - { - - emit-sfx rocketlaunchback from exhaustpoint12; - sleep 100; - } - if( missilefire == 12 ) - { - - emit-sfx rocketlaunchback from exhaustpoint13; - sleep 100; - } - if( missilefire == 13 ) - { - - emit-sfx rocketlaunchback from exhaustpoint14; - sleep 100; - } - if( missilefire == 14 ) - { - - emit-sfx rocketlaunchback from exhaustpoint15; - sleep 100; - } - if( missilefire == 15 ) - { - - emit-sfx rocketlaunchback from exhaustpoint16; - sleep 100; - } - if( missilefire == 16 ) - { - - emit-sfx rocketlaunchback from exhaustpoint17; - sleep 100; - } - if( missilefire == 17 ) - { - - emit-sfx rocketlaunchback from exhaustpoint18; - sleep 100; - } - if( missilefire == 18 ) - { - - emit-sfx rocketlaunchback from exhaustpoint19; - sleep 100; - } - if( missilefire == 19 ) - { - - emit-sfx rocketlaunchback from exhaustpoint20; - sleep 100; - } - if( missilefire == 20 ) - { - - emit-sfx rocketlaunchback from exhaustpoint21; - sleep 100; - } - if( missilefire == 21 ) - { - - emit-sfx rocketlaunchback from exhaustpoint22; - sleep 100; - } - if( missilefire == 22 ) - { - - emit-sfx rocketlaunchback from exhaustpoint23; - sleep 100; - } - if( missilefire == 23 ) - { - - emit-sfx rocketlaunchback from exhaustpoint24; - sleep 100; - } - if( missilefire == 24 ) - { - - emit-sfx rocketlaunchback from exhaustpoint25; - sleep 100; - } - if( missilefire == 25 ) - { - - emit-sfx rocketlaunchback from exhaustpoint26; - sleep 100; - } - if( missilefire == 26 ) - { - - emit-sfx rocketlaunchback from exhaustpoint27; - sleep 100; - } - if( missilefire == 27 ) - { - - emit-sfx rocketlaunchback from exhaustpoint28; - sleep 100; - } - if( missilefire == 28 ) - { - - emit-sfx rocketlaunchback from exhaustpoint29; - sleep 100; - } - if( missilefire == 29 ) - { - - emit-sfx rocketlaunchback from exhaustpoint30; - sleep 100; - } - if( missilefire == 30 ) - { - - emit-sfx rocketlaunchback from exhaustpoint31; - sleep 100; - } - if( missilefire == 31 ) - { - gun_1 = 1; - start-script Reload(); - emit-sfx rocketlaunchback from exhaustpoint32; - sleep 100; - } - } - ++missilefire; - if( missilefire >= 32 ) - { - missilefire = 0; - } -} - -AimFromWeapon1(piecenum) -{ - piecenum = barrels; -} - - -QueryWeapon1(piecenum) -{ - if( missilefire >= 0 AND missilefire < 32 ) - { - if( missilefire == 0 ) - { - piecenum = firepoint1; - } - if( missilefire == 1 ) - { - piecenum = firepoint2; - } - if( missilefire == 2 ) - { - piecenum = firepoint3; - } - if( missilefire == 3 ) - { - piecenum = firepoint4; - } - if( missilefire == 4 ) - { - piecenum = firepoint5; - } - if( missilefire == 5 ) - { - piecenum = firepoint6; - } - if( missilefire == 6 ) - { - piecenum = firepoint7; - } - if( missilefire == 7 ) - { - piecenum = firepoint8; - } - if( missilefire == 8 ) - { - piecenum = firepoint9; - } - if( missilefire == 9 ) - { - piecenum = firepoint10; - } - if( missilefire == 10 ) - { - piecenum = firepoint11; - } - if( missilefire == 11 ) - { - piecenum = firepoint12; - } - if( missilefire == 12 ) - { - piecenum = firepoint13; - } - if( missilefire == 13 ) - { - piecenum = firepoint14; - } - if( missilefire == 14 ) - { - piecenum = firepoint15; - } - if( missilefire == 15 ) - { - piecenum = firepoint16; - } - if( missilefire == 16 ) - { - piecenum = firepoint17; - } - if( missilefire == 17 ) - { - piecenum = firepoint18; - } - if( missilefire == 18 ) - { - piecenum = firepoint19; - } - if( missilefire == 19 ) - { - piecenum = firepoint20; - } - if( missilefire == 20 ) - { - piecenum = firepoint21; - } - if( missilefire == 21 ) - { - piecenum = firepoint22; - } - if( missilefire == 22 ) - { - piecenum = firepoint23; - } - if( missilefire == 23 ) - { - piecenum = firepoint24; - } - if( missilefire == 24 ) - { - piecenum = firepoint25; - } - if( missilefire == 25 ) - { - piecenum = firepoint26; - } - if( missilefire == 26 ) - { - piecenum = firepoint27; - } - if( missilefire == 27 ) - { - piecenum = firepoint28; - } - if( missilefire == 28 ) - { - piecenum = firepoint29; - } - if( missilefire == 29 ) - { - piecenum = firepoint30; - } - if( missilefire == 30 ) - { - piecenum = firepoint31; - } - if( missilefire == 31 ) - { - piecenum = firepoint32; - } - } -} - -StartMoving() -{ - moving = TRUE; -} - -StopMoving() -{ - moving = FALSE; -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - explode barrels type BITMAPONLY | BITMAP3; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type FALL | BITMAP3; - explode barrels type BITMAPONLY | BITMAP3; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; - explode barrels type BITMAPONLY | BITMAP3; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; - explode barrels type BITMAPONLY | BITMAP3; -} diff --git a/Scripts/tmissilearty.cob b/Scripts/tmissilearty.cob deleted file mode 100644 index 2180ca06a..000000000 Binary files a/Scripts/tmissilearty.cob and /dev/null differ diff --git a/Scripts/tmissilesiloemp.cob b/Scripts/tmissilesiloemp.cob deleted file mode 100644 index 182790095..000000000 Binary files a/Scripts/tmissilesiloemp.cob and /dev/null differ diff --git a/Scripts/tmissletank.bos b/Scripts/tmissletank.bos deleted file mode 100644 index 1cbe53bdc..000000000 --- a/Scripts/tmissletank.bos +++ /dev/null @@ -1,175 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, barrel1, firepoint1, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -#define gdmarty 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn barrel1 to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <225>; -turn barrel1 to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn barrel1 around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tmissletank.cob b/Scripts/tmissletank.cob deleted file mode 100644 index 813773a86..000000000 Binary files a/Scripts/tmissletank.cob and /dev/null differ diff --git a/Scripts/tmobileradar.bos b/Scripts/tmobileradar.bos deleted file mode 100644 index 7318ffe23..000000000 --- a/Scripts/tmobileradar.bos +++ /dev/null @@ -1,107 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, top; - -static-var terraintype, bmoving; // these are the variables - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - - -Create() -{ - start-script setSFXoccupy(); - start-script EmitWakes(); - spin top around y-axis speed <10.005495>; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type BITMAPONLY | BITMAP1; -} \ No newline at end of file diff --git a/Scripts/tmobileradar.cob b/Scripts/tmobileradar.cob deleted file mode 100644 index 79a76d253..000000000 Binary files a/Scripts/tmobileradar.cob and /dev/null differ diff --git a/Scripts/tomega.bos b/Scripts/tomega.bos deleted file mode 100644 index 4b609ebc0..000000000 --- a/Scripts/tomega.bos +++ /dev/null @@ -1,143 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret1, firepoint1; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// Signal definitions -#define SIG_AIM 2 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from base; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret1 to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; - -turn turret1 to y-axis heading speed <225>; -wait-for-turn turret1 around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret1; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type BITMAPONLY | BITMAP1; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode turret1 type FALL | BITMAP1; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -return (0); -} -corpsetype = 3; -explode turret1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode base type BITMAPONLY | BITMAP3; -} diff --git a/Scripts/tomega.cob b/Scripts/tomega.cob deleted file mode 100644 index b3f2f1157..000000000 Binary files a/Scripts/tomega.cob and /dev/null differ diff --git a/Scripts/tradar.cob b/Scripts/tradar.cob deleted file mode 100644 index 1d1feecab..000000000 Binary files a/Scripts/tradar.cob and /dev/null differ diff --git a/Scripts/transport.bos b/Scripts/transport.bos deleted file mode 100644 index f5b8fd1f1..000000000 --- a/Scripts/transport.bos +++ /dev/null @@ -1,130 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, link; - -static-var Static_Var_1, unitviewer, statechg_DesiredState, statechg_StateChanging; - -// Signal definitions -#define SIG_MOVE 4 - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - unitviewer = FALSE; - call-script InitState(); - start-script SmokeUnit(); -} - -QueryTransport(Func_Var_1) -{ - Func_Var_1 = 1; -} - -BeginTransport(Func_Var_1) -{ - move link to y-axis [0.000000] - Func_Var_1 now; -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -EndTransport() -{ -} - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP4; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; -} diff --git a/Scripts/transport.cob b/Scripts/transport.cob deleted file mode 100644 index 0d15faa0a..000000000 Binary files a/Scripts/transport.cob and /dev/null differ diff --git a/Scripts/transport2.bos b/Scripts/transport2.bos deleted file mode 100644 index 158de124f..000000000 --- a/Scripts/transport2.bos +++ /dev/null @@ -1,184 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, link, engines, enginefire1, enginefirepoint2; - -static-var Static_Var_1, unitviewer, statechg_DesiredState, statechg_StateChanging, moving; - -// Signal definitions -#define SIG_MOVE 4 -#define flame 1024+0 - - -activatescr() -{ - if( TRUE ) - { - emit-sfx flame from enginefire1; - emit-sfx flame from enginefirepoint2; - turn engines to x-axis <0> speed <50.192308>; - } - sleep 5; -} - -deactivatescr() -{ - if( TRUE ) - { - emit-sfx flame from enginefire1; - emit-sfx flame from enginefirepoint2; - turn engines to x-axis <-90> speed <50.192308>; - } - sleep 5; -} - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from enginefire1; - emit-sfx flame from enginefirepoint2; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - call-script activatescr(); - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - call-script deactivatescr(); - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - unitviewer = FALSE; - call-script InitState(); - turn enginefire1 to y-axis <180> now; - turn enginefirepoint2 to y-axis <180> now; - turn engines to x-axis <-90> now; - start-script Thrust(); - start-script SmokeUnit(); -} - -QueryTransport(Func_Var_1) -{ - Func_Var_1 = 1; -} - -BeginTransport(Func_Var_1) -{ - move link to y-axis [0.000000] - Func_Var_1 now; -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -EndTransport() -{ -} - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP4; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; -} diff --git a/Scripts/transport2.bosbackup b/Scripts/transport2.bosbackup deleted file mode 100644 index bdc860138..000000000 --- a/Scripts/transport2.bosbackup +++ /dev/null @@ -1,157 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, link, engines, enginefire1, enginefirepoint2; - -static-var Static_Var_1, unitviewer, statechg_DesiredState, statechg_StateChanging, moving; - -// Signal definitions -#define SIG_MOVE 4 -#define flame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from enginefire1; - emit-sfx flame from enginefirepoint2; - - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - -InitState() -{ - statechg_DesiredState = TRUE; - statechg_StateChanging = FALSE; -} - -RequestState(requestedstate, currentstate) -{ - if( statechg_StateChanging ) - { - statechg_DesiredState = requestedstate; - return (0); - } - statechg_StateChanging = TRUE; - currentstate = statechg_DesiredState; - statechg_DesiredState = requestedstate; - while( statechg_DesiredState != currentstate ) - { - if( statechg_DesiredState == 0 ) - { - currentstate = 0; - } - if( statechg_DesiredState == 1 ) - { - currentstate = 1; - } - } - statechg_StateChanging = FALSE; -} - -Create() -{ - Static_Var_1 = 0; - unitviewer = FALSE; - call-script InitState(); - turn enginefire1 to y-axis <180> now; - turn enginefirepoint2 to y-axis <180> now; - start-script Thrust(); - start-script SmokeUnit(); -} - -QueryTransport(Func_Var_1) -{ - Func_Var_1 = 1; -} - -BeginTransport(Func_Var_1) -{ - move link to y-axis [0.000000] - Func_Var_1 now; -} - -Activate() -{ - start-script RequestState(0); -} - -Deactivate() -{ - start-script RequestState(1); -} - -EndTransport() -{ -} - -SweetSpot(piecenum) -{ - piecenum = base; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP4; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3; -} diff --git a/Scripts/transport2.cob b/Scripts/transport2.cob deleted file mode 100644 index 4a89ad0de..000000000 Binary files a/Scripts/transport2.cob and /dev/null differ diff --git a/Scripts/tresearch.cob b/Scripts/tresearch.cob deleted file mode 100644 index c0e97da71..000000000 Binary files a/Scripts/tresearch.cob and /dev/null differ diff --git a/Scripts/trocketmech.cob b/Scripts/trocketmech.cob deleted file mode 100644 index 14f062d71..000000000 Binary files a/Scripts/trocketmech.cob and /dev/null differ diff --git a/Scripts/tslicer.bos b/Scripts/tslicer.bos deleted file mode 100644 index 83c61288e..000000000 --- a/Scripts/tslicer.bos +++ /dev/null @@ -1,261 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece hull, turret, barrel1, firepoint1, barrel2, firepoint2, barrel3, firepoint3, barrel4, firepoint4, barrel5, firepoint5; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define -#define SIG_AIM_4 8 -#define SIG_AIM_8 16 -#define SIG_AIM_16 32 -#define SIG_AIM_32 64 - - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from hull; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from hull; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move hull to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move hull to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move hull to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -{ -piecenum = firepoint1; -} -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - -AimWeapon3(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_4; -set-signal-mask SIG_AIM_2; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon3() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon3(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon3(piecenum) // where the shot is called from -{ -piecenum = firepoint3; -} - - - -AimWeapon4(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_8; -set-signal-mask SIG_AIM_4; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon4() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon4(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon4(piecenum) // where the shot is called from -{ -piecenum = firepoint4; -} - - -AimWeapon5(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_16; -set-signal-mask SIG_AIM_8; -turn turret to y-axis heading speed <900>; -wait-for-turn turret around y-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon5() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon5(piecenum) // where it aims the weapon from -{ -piecenum = turret; -} - -QueryWeapon5(piecenum) // where the shot is called from -{ -piecenum = firepoint5; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type BITMAPONLY | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode hull type BITMAPONLY | BITMAP4; -explode barrel1 type FALL | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode hull type BITMAPONLY | BITMAP1; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode barrel1 type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode barrel2 type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tslicer.cob b/Scripts/tslicer.cob deleted file mode 100644 index 0243ab5f3..000000000 Binary files a/Scripts/tslicer.cob and /dev/null differ diff --git a/Scripts/tslicer2.bos b/Scripts/tslicer2.bos deleted file mode 100644 index e347c008b..000000000 --- a/Scripts/tslicer2.bos +++ /dev/null @@ -1,183 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, turret, guns, firepoint1, firepoint2; // these are the pieces of the model - -static-var terraintype, bmoving; // these are the variables - -// #define gdscannon 1024+0 // this is a custom explosion generator thinging - -// Signal definitions -#define SIG_AIM 2 -#define SIG_AIM_2 4 // this is a aim define - -#define shot 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) // this is a standard smoke point define -{ -while( get BUILD_PERCENT_LEFT ) -{ -sleep 400; -} -while( TRUE ) -{ -healthpercent = get HEALTH; -if( healthpercent < 66 ) -{ -smoketype = 256 | 2; -if( Rand( 1, 66 ) < healthpercent ) -{ -smoketype = 256 | 1; -} -emit-sfx smoketype from turret; -} -sleeptime = healthpercent * 50; -if( sleeptime < 200 ) -{ -sleeptime = 200; -} -sleep sleeptime; -} -} - -EmitWakes() -{ - while( TRUE ) - { - if( bMoving ) - { - emit-sfx 2 from base; - } - sleep 300; - } -} - -setSFXoccupy(setSFXoccupy_argument) -{ -terraintype = setSFXoccupy_argument; - - if(terraintype == 2) - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } - else - { - move base to y-axis [0.0] speed [50]; - set UPRIGHT to 0; - } - if(terraintype == 4) - { - move base to y-axis [0] speed [50]; - set UPRIGHT to 0; - } - else - { - move base to y-axis [-0.85] speed [50]; - set UPRIGHT to 1; - } -} - -Create() // tells it what to do on creation -{ - start-script setSFXoccupy(); - start-script EmitWakes(); -start-script SmokeUnit(); -} - -RestoreAfterDelay() // restore function to turn the turret and so forth back to start -{ -sleep 3000; -turn turret to y-axis <0> speed <60>; -turn turret to x-axis <0> speed <30>; -} - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn guns to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn guns around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint1; -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = guns; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = firepoint1; -} - - -AimWeapon2(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM_2; -set-signal-mask SIG_AIM; -turn turret to y-axis heading speed <255>; -turn guns to x-axis <0> - pitch speed <150>; -wait-for-turn turret around y-axis; -wait-for-turn guns around x-axis; -start-script RestoreAfterDelay(); -return (1); -} - -FireWeapon2() // what do while firing, fires 1 barrel then the next , and resets -{ -emit-sfx shot from firepoint2; -} - -AimFromWeapon2(piecenum) // where it aims the weapon from -{ -piecenum = guns; -} - -QueryWeapon2(piecenum) // where the shot is called from -{ -piecenum = firepoint2; -} - - - -Killed(severity, corpsetype) // how it explodes -{ -if( severity <= 25 ) -{ -corpsetype = 1; -explode base type BITMAPONLY | BITMAP1; -explode guns type BITMAPONLY | BITMAP1; -explode turret type BITMAPONLY | BITMAP4; -return (0); -} -if( severity <= 80 ) -{ -corpsetype = 2; -explode base type BITMAPONLY | BITMAP4; -explode guns type FALL | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -if( severity <= 99 ) -{ -corpsetype = 3; -explode base type BITMAPONLY | BITMAP1; -explode guns type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -explode turret type SHATTER | BITMAP4; -return (0); -} -corpsetype = 3; -explode guns type BITMAPONLY | BITMAP3; -explode turret type SHATTER | EXPLODE_ON_HIT | BITMAP4; -} diff --git a/Scripts/tslicer2.cob b/Scripts/tslicer2.cob deleted file mode 100644 index 337c66f7a..000000000 Binary files a/Scripts/tslicer2.cob and /dev/null differ diff --git a/Scripts/tsolar.bos b/Scripts/tsolar.bos deleted file mode 100644 index b7219a76f..000000000 --- a/Scripts/tsolar.bos +++ /dev/null @@ -1,70 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece solar; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from solar; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -Create() -{ - start-script SmokeUnit(); -} - -SweetSpot(piecenum) -{ - piecenum = solar; -} - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode solar type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode solar type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode solar type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode solar type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tsolar.cob b/Scripts/tsolar.cob deleted file mode 100644 index 928ea393c..000000000 Binary files a/Scripts/tsolar.cob and /dev/null differ diff --git a/Scripts/tsolar2.bos b/Scripts/tsolar2.bos deleted file mode 100644 index d5d56955c..000000000 --- a/Scripts/tsolar2.bos +++ /dev/null @@ -1,96 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from firepoint1; - sleep 5; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - - emit-sfx 2049 from firepoint1; - sleep 400; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn firepoint1 to x-axis <-90> now; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tsolar2.cob b/Scripts/tsolar2.cob deleted file mode 100644 index 4fdf8953c..000000000 Binary files a/Scripts/tsolar2.cob and /dev/null differ diff --git a/Scripts/tspecialfactory.cob b/Scripts/tspecialfactory.cob deleted file mode 100644 index 6496ec6c0..000000000 Binary files a/Scripts/tspecialfactory.cob and /dev/null differ diff --git a/Scripts/tstealthbomber.cob b/Scripts/tstealthbomber.cob deleted file mode 100644 index 42f0353e0..000000000 Binary files a/Scripts/tstealthbomber.cob and /dev/null differ diff --git a/Scripts/tstealthbomber2.bos b/Scripts/tstealthbomber2.bos deleted file mode 100644 index e3286e714..000000000 --- a/Scripts/tstealthbomber2.bos +++ /dev/null @@ -1,117 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, exhaust; - -static-var moving; - -// Signal definitions -#define SIG_AIM 2 - -#define flame 1024+0 - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - - -Thrust() -{ - while( TRUE ) - { - if (moving) - { - emit-sfx flame from exhaust; - } - sleep 5; - } -} - -StartMoving() -{ - moving=1; -} - -StopMoving() -{ - moving=0; -} - - -AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming -{ -signal SIG_AIM; -set-signal-mask SIG_AIM; -return (1); -} - -FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets -{ -} - -AimFromWeapon1(piecenum) // where it aims the weapon from -{ -piecenum = base; -} - -QueryWeapon1(piecenum) // where the shot is called from -{ -piecenum = exhaust; -} - -Create() - { - turn exhaust to y-axis <180> now; - start-script Thrust(); - start-script SmokeUnit(); - } - -Killed(severity, corpsetype) - { - if (severity <= 25) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP2; - return(0); - } - if (severity <= 50) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return(0); - } - if (severity <= 99) - { - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2; - return(0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; - return(0); - } \ No newline at end of file diff --git a/Scripts/tstealthbomber2.cob b/Scripts/tstealthbomber2.cob deleted file mode 100644 index 6e3d0494b..000000000 Binary files a/Scripts/tstealthbomber2.cob and /dev/null differ diff --git a/Scripts/tstorage.bos b/Scripts/tstorage.bos deleted file mode 100644 index d5d56955c..000000000 --- a/Scripts/tstorage.bos +++ /dev/null @@ -1,96 +0,0 @@ -#define TA // This is a TA script - -#include "sfxtype.h" -#include "exptype.h" - -piece base, firepoint1; - -static-var Static_Var_1; - - -SmokeUnit(healthpercent, sleeptime, smoketype) -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - healthpercent = get HEALTH; - if( healthpercent < 66 ) - { - smoketype = 256 | 2; - if( Rand( 1, 66 ) < healthpercent ) - { - smoketype = 256 | 1; - } - emit-sfx smoketype from base; - } - sleeptime = healthpercent * 50; - if( sleeptime < 200 ) - { - sleeptime = 200; - } - sleep sleeptime; - } -} - -fx() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - emit-sfx 2048 from firepoint1; - sleep 5; - } -} - -fx2() -{ - while( get BUILD_PERCENT_LEFT ) - { - sleep 400; - } - while( TRUE ) - { - - emit-sfx 2049 from firepoint1; - sleep 400; - } -} - -Create() -{ - start-script fx(); - start-script fx2(); - turn firepoint1 to x-axis <-90> now; - start-script SmokeUnit(); -} - - -Killed(severity, corpsetype) -{ - if( severity <= 25 ) - { - corpsetype = 1; - explode base type BITMAPONLY | BITMAP1; - return (0); - } - if( severity <= 50 ) - { - corpsetype = 2; - explode base type SHATTER | BITMAP1; - return (0); - } - if( severity <= 99 ) - { - corpsetype = 3; - explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1; - return (0); - } - corpsetype = 3; - explode base type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; -} diff --git a/Scripts/tstorage.cob b/Scripts/tstorage.cob deleted file mode 100644 index 4fdf8953c..000000000 Binary files a/Scripts/tstorage.cob and /dev/null differ diff --git a/Scripts/xmasball.lua b/Scripts/xmasball.lua new file mode 100644 index 000000000..648ccfd51 --- /dev/null +++ b/Scripts/xmasball.lua @@ -0,0 +1,20 @@ +local base = piece "base" +local f = 0 + +function script.Create() + Turn (base, x_axis, math.random()*360, 90) + Turn (base, y_axis, math.random()*360, 90) + Turn (base, z_axis, math.random()*360, 90) +end + +function Sink() + StartThread(MoveDown) +end + +function MoveDown() + while f > -900 do + Move(base, 2, f) + f = f - 0.03 + Sleep(1) + end +end \ No newline at end of file diff --git a/Scripts/zaal/constants.h b/Scripts/zaal/constants.h new file mode 100644 index 000000000..5405aeeec --- /dev/null +++ b/Scripts/zaal/constants.h @@ -0,0 +1,146 @@ +//just replaced it with rattle's. plus no dealing with a pissy Argh claiming that now we have to GPL EEEVVVRRYYTHING +//Argh, if you read this: honestly, wtf were you thinking trying to GPL a list of #defines? +// With the original cavedog comments STILL IN THEM!? +// You could at least have made it less bloody obvious that it was a direct copy/paste. +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ +#endif + +#define SFXTYPE_VTOL 1 +#define SFXTYPE_THRUST 2 +#define SFXTYPE_WAKE1 3 +#define SFXTYPE_WAKE2 4 +#define SFXTYPE_REVERSEWAKE1 5 +#define SFXTYPE_REVERSEWAKE2 6 + +#define SFXTYPE_POINTBASED 256 +#define SFXTYPE_WHITESMOKE 256|1 +#define SFXTYPE_BLACKSMOKE 256|2 +#define SFXTYPE_SUBBUBBLES 256|3 + +#define SHATTER 1 +#define EXPLODE_ON_HIT 2 +#define FALL 4 +#define SMOKE 8 +#define FIRE 16 +#define BITMAPONLY 32 +#define BITMAP 10000001 + +// Explosion generators +#define UNIT_SFX1 1024 +#define UNIT_SFX2 1025 +#define UNIT_SFX3 1026 +#define UNIT_SFX4 1027 +#define UNIT_SFX5 1028 +#define UNIT_SFX6 1029 +#define UNIT_SFX7 1030 +#define UNIT_SFX8 1031 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 + +// COB constants, as in CobInstance.cpp +// Indices for set/get value +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +/*#define WEAPON_AIM_ABORTED 21 +#define WEAPON_READY 22 +#define WEAPON_LAUNCH_NOW 23 +#define FINISHED_DYING 26 +#define ORIENTATION 27*/ +#define IN_WATER 28 +#define CURRENT_SPEED 29 +//#define MAGIC_DEATH 31 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get + +// NOTE: [LUA0 - LUA9] are defined in CobThread.cpp as [110 - 119] + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) +#define WEAPON_RELOADTIME 126 // get (with fake set) +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get diff --git a/Scripts/zaal/exptype.h b/Scripts/zaal/exptype.h new file mode 100644 index 000000000..932fb4f47 --- /dev/null +++ b/Scripts/zaal/exptype.h @@ -0,0 +1,192 @@ +/* +** EXPtype.h -- Explosion Type information and GET/SET constants for scripts +** +** This Script contains constants compatible only with Spring RTS engine +** not for use with Total Annihilation or TA:Kindgoms +*/ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +// Indices for emit-sfx +#ifndef __SFXTYPE_H_ +#define SFXTYPE_VTOL 0 +//#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 // same as SFX_WAKE +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 // same as SFX_REVERSE_WAKE + +#define SFXTYPE_WHITESMOKE 257 +#define SFXTYPE_BLACKSMOKE 258 +#define SFXTYPE_SUBBUBBLES 259 +#endif + +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define NOCEGTRAIL 64 // Disables the cegtrail for the specific piece (defined in the unit fbi) +#define BITMAP 10000001 + +// Bitmap Explosion Types +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 + +//Customized effects (in FBI/TDF/LUA) +// Explosion generators +#define UNIT_SFX0 1024 +#define UNIT_SFX1 1025 +#define UNIT_SFX2 1026 +#define UNIT_SFX3 1027 +#define UNIT_SFX4 1028 +#define UNIT_SFX5 1029 +#define UNIT_SFX6 1030 +#define UNIT_SFX7 1031 +#define UNIT_SFX8 1032 +#define UNIT_SFX9 1033 + +// Weapons +#define FIRE_W1 2048 +#define FIRE_W2 2049 +#define FIRE_W3 2050 +#define FIRE_W4 2051 +#define FIRE_W5 2052 +#define FIRE_W6 2053 +#define FIRE_W7 2054 +#define FIRE_W8 2055 +#define FIRE_W9 2056 + +#define DETO_W1 4096 +#define DETO_W2 4097 +#define DETO_W3 4098 +#define DETO_W4 4099 +#define DETO_W5 4100 +#define DETO_W6 4101 +#define DETO_W7 4102 +#define DETO_W8 4103 +#define DETO_W9 4104 + + +// COB constants +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define SONAR_STEALTH 108 // set or get +#define REVERSING 109 // get + +// Indices for SET, GET, and GET_UNIT_VALUE for LUA return values +#define LUA0 110 // (LUA0 returns the lua call status, 0 or 1) +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 + +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) get WEAPON_RELOADSTATE(weaponNum) for GET +#define WEAPON_RELOADTIME 126 // get (with fake set) get WEAPON_RELOADSTATE(-weaponNum,val) for SET +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) +#define WEAPON_STOCKPILE_COUNT 139 // get (with fake set) + + +#define MIN 131 // get +#define MAX 132 // get +#define ABS 133 // get +#define GAME_FRAME 134 // get +#define KSIN 135 // get, kiloSine 1024*sin(x) as COB uses only integers +#define KCOS 136 // get, kiloCosine 1024*cos(x) + +#define KTAN 137 // get, kiloTangent 1024*tan(x) carefull with angles close to 90 deg. might cause overflow +#define SQRT 138 // get, square root (floored to integer) + +#define ENERGY_MAKE 140 // set or get (100*E production) + +#define METAL_MAKE 141 // set or get (100*M production) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif \ No newline at end of file diff --git a/Scripts/zaal/sfxtype.h b/Scripts/zaal/sfxtype.h new file mode 100644 index 000000000..610241a23 --- /dev/null +++ b/Scripts/zaal/sfxtype.h @@ -0,0 +1,51 @@ +/* +** SFXtype.h -- Special Effects Type information for scripts +** +** Copyright 1997 Cavedog Entertainment +*/ + +#ifndef __SFXTYPE_H_ +#define __SFXTYPE_H_ + +/* +Special Effect Particles referenced in the scripting language +with the command "emit-sfx". This file is included by any +scripts that use the command, as well as TAObjScr.cpp in the game, +so it can start the proper effect. +*/ + +// IMPORTANT: If you change these defines, copy the file to +// v:\totala\cdimage\scripts so the scripts have +// access to the proper data, and recompile them. + + +// Vector-based special effects + +#define SFXTYPE_VTOL 0 +#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 + + + +// Point-based (piece origin) special effects + +#define SFXTYPE_POINTBASED 256 + +#define SFXTYPE_WHITESMOKE (SFXTYPE_POINTBASED | 1) +#define SFXTYPE_BLACKSMOKE (SFXTYPE_POINTBASED | 2) +#define SFXTYPE_SUBBUBBLES +// New in TA:K +#define SFXTYPE_SMALLDAMAGEFLAME (SFXTYPE_POINTBASED | 4) + + +// Sound priorities in TA:K +#define PLAYSOUND_PRIORITY_BATTLE 4 + + +// SFX Occupy States +#define SFXOCCUPY_AIR 5 + +#endif \ No newline at end of file diff --git a/Scripts/zaal/smokeunit.h b/Scripts/zaal/smokeunit.h new file mode 100644 index 000000000..0bec00f0e --- /dev/null +++ b/Scripts/zaal/smokeunit.h @@ -0,0 +1,100 @@ +/* SmokeUnit.h -- Process unit smoke when damaged */ + +#ifndef SMOKE_H_ +#define SMOKE_H_ + +#include "SFXtype.h" +#include "EXPtype.h" + +// Figure out how many smoking pieces are defined + +#ifdef SMOKEPIECE4 + #define NUM_SMOKE_PIECES 4 +#else + #ifdef SMOKEPIECE3 + #define NUM_SMOKE_PIECES 3 + #else + #ifdef SMOKEPIECE2 + #define NUM_SMOKE_PIECES 2 + #else + #define NUM_SMOKE_PIECES 1 + #ifndef SMOKEPIECE1 + #define SMOKEPIECE1 SMOKEPIECE + #endif + #endif + #endif +#endif + + +SmokeUnit() +{ + var healthpercent; + var sleeptime; + var smoketype; + +#if NUM_SMOKE_PIECES > 1 + var choice; +#endif + + // Wait until the unit is actually built + while (get BUILD_PERCENT_LEFT) + { + sleep 400; + } + + // Smoke loop + while (TRUE) + { + // How is the unit doing? + healthpercent = get HEALTH; + + if (healthpercent < 66) + { + // Emit a puff of smoke + + smoketype = SFXTYPE_BLACKSMOKE; + + if (rand( 1, 66 ) < healthpercent) + { + smoketype = SFXTYPE_WHITESMOKE; + } + + // Figure out which piece the smoke will emit from, and spit it out + +#if NUM_SMOKE_PIECES == 1 + emit-sfx 1026 from SMOKEPIECE1; +#else + choice = rand( 1, NUM_SMOKE_PIECES ); + + if (choice == 1) + { emit-sfx 1026 from SMOKEPIECE1; } + if (choice == 2) + { emit-sfx 1026 from SMOKEPIECE2; } + #if NUM_SMOKE_PIECES >= 3 + if (choice == 3) + { emit-sfx 1026 from SMOKEPIECE3; } + #if NUM_SMOKE_PIECES >= 4 + if (choice == 4) + { emit-sfx 1026 from SMOKEPIECE4; } + #endif + #endif +#endif + } + + // Delay between puffs + + sleeptime = healthpercent * 50; + if (sleeptime < 200) + { + sleeptime = 200; // Fastest rate is five times per second + } + + sleep sleeptime; + } +} + + +// Clean up pre-processor +#undef NUM_SMOKE_PIECES + +#endif diff --git a/Scripts/zaal/springdefs.h b/Scripts/zaal/springdefs.h new file mode 100644 index 000000000..cada4991d --- /dev/null +++ b/Scripts/zaal/springdefs.h @@ -0,0 +1,164 @@ +//============================================================================== +// +// Constants and macros for Spring /units/*.BOS +// +// Made by merging the exptype.h and sfxtype.h that are tradionally shipped with Scriptor +// Which are themselves edited from the ones inside Cavedog's Totala1.hpi +// And the #define from https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobInstance.cpp +// +//============================================================================== + +#ifndef SPRING_SCRIPTS_H +#define SPRING_SCRIPTS_H + + +// To use with the "emit-sfx" command: + +// Vector-based special effects +#define SFXTYPE_VTOL 0 +#define SFXTYPE_THRUST 1 +#define SFXTYPE_WAKE1 2 +#define SFXTYPE_WAKE2 3 +#define SFXTYPE_REVERSEWAKE1 4 +#define SFXTYPE_REVERSEWAKE2 5 + +// Point-based (piece origin) special effects +#define SFXTYPE_POINTBASED 256 +#define SFXTYPE_WHITESMOKE (SFXTYPE_POINTBASED | 1) +#define SFXTYPE_BLACKSMOKE (SFXTYPE_POINTBASED | 2) +#define SFXTYPE_SUBBUBBLES (SFXTYPE_POINTBASED | 3) +// TA:K sfx, maybe not implemented in Spring +#define SFXTYPE_SMALLDAMAGEFLAME (SFXTYPE_POINTBASED | 4) +#define SFXTYPE_MEDIUMDAMAGEFLAME (SFXTYPE_POINTBASED | 5) +#define SFXTYPE_LARGEDAMAGEFLAME (SFXTYPE_POINTBASED | 6) + +// Probably not implemented in Spring, TA:K stuff +#define PLAYSOUND_PRIORITY_BATTLE 4 + +// Probably not implemented in Spring, probably TA:K stuff +#define SFXOCCUPY_AIR 5 // SFX Occupy States + +// To use with the "explode" command: +#define SHATTER 1 // The piece will shatter instead of remaining whole +#define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground +#define FALL 4 // The piece will fall due to gravity instead of just flying off +#define SMOKE 8 // A smoke trail will follow the piece through the air +#define FIRE 16 // A fire trail will follow the piece through the air +#define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered. +#define BITMAP1 256 +#define BITMAP2 512 +#define BITMAP3 1024 +#define BITMAP4 2048 +#define BITMAP5 4096 +#define BITMAPNUKE 8192 +#define BITMAPMASK 16128 // Mask of the possible bitmap bits + +// Probably not implemented in Spring, TA:K stuff +#define EXPTYPE_SMALLEXPLOSION 256 +#define EXPTYPE_MEDIUMEXPLOSION 512 +#define EXPTYPE_LARGEEXPLOSION 1024 +#define EXPTYPE_XLARGEEXPLOSION 2048 +#define EXPTYPE_BLOODEXPLOSION 4096 +#define EXPTYPE_SMALLSMOKE 8192 +#define EXPTYPE_MEDIUMSMOKE 16384 +#define EXPTYPE_XLARGESMOKE 65536 + +// Probably not implemented in Spring, TA:K stuff (DT stands for Damage Type) +#define DT_FIRE 2 +#define DT_EXPLOSION 3 +#define DT_PARALYZER 4 + +// Indices for set/get value +#define ACTIVATION 1 // set or get +#define STANDINGMOVEORDERS 2 // set or get +#define STANDINGFIREORDERS 3 // set or get +#define HEALTH 4 // get (0-100%) +#define INBUILDSTANCE 5 // set or get +#define BUSY 6 // set or get (used by misc. special case missions like transport ships) +#define PIECE_XZ 7 // get +#define PIECE_Y 8 // get +#define UNIT_XZ 9 // get +#define UNIT_Y 10 // get +#define UNIT_HEIGHT 11 // get +#define XZ_ATAN 12 // get atan of packed x,z coords +#define XZ_HYPOT 13 // get hypot of packed x,z coords +#define ATAN 14 // get ordinary two-parameter atan +#define HYPOT 15 // get ordinary two-parameter hypot +#define GROUND_HEIGHT 16 // get land height, 0 if below water +#define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build +#define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes) +#define BUGGER_OFF 19 // set or get (ask other units to clear the area) +#define ARMORED 20 // set or get + +#define WEAPON_AIM_ABORTED 21 // Not implemented in Spring, TAK stuff +#define WEAPON_READY 22 // Not implemented in Spring, TAK stuff +#define WEAPON_LAUNCH_NOW 23 // Not implemented in Spring, TAK stuff +#define FINISHED_DYING 26 // Not implemented in Spring, TAK stuff +#define ORIENTATION 27 // Not implemented in Spring, TAK stuff +#define IN_WATER 28 +#define CURRENT_SPEED 29 +#define MAGIC_DEATH 31 // Not implemented in Spring, TAK stuff +#define VETERAN_LEVEL 32 +#define ON_ROAD 34 + +#define MAX_ID 70 +#define MY_ID 71 +#define UNIT_TEAM 72 +#define UNIT_BUILD_PERCENT_LEFT 73 +#define UNIT_ALLIED 74 +#define MAX_SPEED 75 +#define CLOAKED 76 +#define WANT_CLOAK 77 +#define GROUND_WATER_HEIGHT 78 // get land height, negative if below water +#define UPRIGHT 79 // set or get +#define POW 80 // get +#define PRINT 81 // get, so multiple args can be passed +#define HEADING 82 // get +#define TARGET_ID 83 // get +#define LAST_ATTACKER_ID 84 // get +#define LOS_RADIUS 85 // set or get +#define AIR_LOS_RADIUS 86 // set or get +#define RADAR_RADIUS 87 // set or get +#define JAMMER_RADIUS 88 // set or get +#define SONAR_RADIUS 89 // set or get +#define SONAR_JAM_RADIUS 90 // set or get +#define SEISMIC_RADIUS 91 // set or get +#define DO_SEISMIC_PING 92 // get +#define CURRENT_FUEL 93 // set or get +#define TRANSPORT_ID 94 // get +#define SHIELD_POWER 95 // set or get +#define STEALTH 96 // set or get +#define CRASHING 97 // set or get, returns whether aircraft isCrashing state +#define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon +#define CEG_DAMAGE 99 // set +#define COB_ID 100 // get +#define PLAY_SOUND 101 // get, so multiple args can be passed +#define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false) +#define ALPHA_THRESHOLD 103 // set or get +#define SET_WEAPON_UNIT_TARGET 106 // get (fake set) +#define SET_WEAPON_GROUND_TARGET 107 // get (fake set) +#define LUA0 110 +#define LUA1 111 +#define LUA2 112 +#define LUA3 113 +#define LUA4 114 +#define LUA5 115 +#define LUA6 116 +#define LUA7 117 +#define LUA8 118 +#define LUA9 119 +#define FLANK_B_MODE 120 // set or get +#define FLANK_B_DIR 121 // set or get, set is through get for multiple args +#define FLANK_B_MOBILITY_ADD 122 // set or get +#define FLANK_B_MAX_DAMAGE 123 // set or get +#define FLANK_B_MIN_DAMAGE 124 // set or get +#define WEAPON_RELOADSTATE 125 // get (with fake set) +#define WEAPON_RELOADTIME 126 // get (with fake set) +#define WEAPON_ACCURACY 127 // get (with fake set) +#define WEAPON_SPRAY 128 // get (with fake set) +#define WEAPON_RANGE 129 // get (with fake set) +#define WEAPON_PROJECTILE_SPEED 130 // get (with fake set) + +// NOTE: shared variables use codes [1024 - 5119] + +#endif // SPRING_SCRIPTS_H diff --git a/Scripts/zaal/zairbomber.bos b/Scripts/zaal/zairbomber.bos new file mode 100644 index 000000000..f8a8cde77 --- /dev/null +++ b/Scripts/zaal/zairbomber.bos @@ -0,0 +1,109 @@ +piece body,head,tail,lwing,rwing,lblade,mblade,rblade,rsack,lsack; + +static-var bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +fly() +{ + if (bMoving) + { + turn lwing to z-axis <-40> speed<60>; + turn rwing to z-axis <40> speed<60>; + wait-for-turn lwing around z-axis; + turn lwing to z-axis <40> speed<120>; + turn rwing to z-axis <-40> speed<120>; + wait-for-turn lwing around z-axis; + start-script fly(); + } +} + +stopfly () +{ + turn lwing to z-axis <0> speed <200>; + turn rwing to z-axis <0> speed <200>; +} + +StartMoving() +{ + bMoving = TRUE; + start-script fly(); +} + +StopMoving() +{ + bMoving = FALSE; + start-script stopfly(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to x-axis 0 -pitch speed <200>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1024 from lwing; + emit-sfx 1024 from rwing; + explode body type SHATTER | NOHEATCLOUD; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lwing type FALL | NOHEATCLOUD; + explode rwing type FALL | NOHEATCLOUD; + explode mblade type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zairbomber.cob b/Scripts/zaal/zairbomber.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/zaal/zairbomber.cob differ diff --git a/Scripts/zaal/zairscout.bos b/Scripts/zaal/zairscout.bos new file mode 100644 index 000000000..f8a8cde77 --- /dev/null +++ b/Scripts/zaal/zairscout.bos @@ -0,0 +1,109 @@ +piece body,head,tail,lwing,rwing,lblade,mblade,rblade,rsack,lsack; + +static-var bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +fly() +{ + if (bMoving) + { + turn lwing to z-axis <-40> speed<60>; + turn rwing to z-axis <40> speed<60>; + wait-for-turn lwing around z-axis; + turn lwing to z-axis <40> speed<120>; + turn rwing to z-axis <-40> speed<120>; + wait-for-turn lwing around z-axis; + start-script fly(); + } +} + +stopfly () +{ + turn lwing to z-axis <0> speed <200>; + turn rwing to z-axis <0> speed <200>; +} + +StartMoving() +{ + bMoving = TRUE; + start-script fly(); +} + +StopMoving() +{ + bMoving = FALSE; + start-script stopfly(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to x-axis 0 -pitch speed <200>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1024 from lwing; + emit-sfx 1024 from rwing; + explode body type SHATTER | NOHEATCLOUD; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lwing type FALL | NOHEATCLOUD; + explode rwing type FALL | NOHEATCLOUD; + explode mblade type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zairscout.cob b/Scripts/zaal/zairscout.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/zaal/zairscout.cob differ diff --git a/Scripts/zaal/zairtoairfighter.bos b/Scripts/zaal/zairtoairfighter.bos new file mode 100644 index 000000000..1e8802701 --- /dev/null +++ b/Scripts/zaal/zairtoairfighter.bos @@ -0,0 +1,118 @@ +piece body,head,tail,lwing,rwing,lblade,mblade,rblade,rsack,lsack; + +static-var bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + + +fly() +{ + if (bMoving) + { + turn lwing to z-axis <-40> speed<120>; + turn rwing to z-axis <40> speed<120>; + wait-for-turn lwing around z-axis; + turn lwing to z-axis <40> speed<240>; + turn rwing to z-axis <-40> speed<240>; + wait-for-turn lwing around z-axis; + start-script fly(); + } +} + +stopfly () +{ + turn lwing to z-axis <0> speed <200>; + turn rwing to z-axis <0> speed <200>; +} + + +Go() +{ + call-script fly(); +} + +Stop() +{ + call-script stopfly(); +} + +StartMoving() +{ + bMoving = TRUE; + start-script fly(); +} + +StopMoving() +{ + bMoving = FALSE; + start-script stopfly(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + + RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to x-axis 0 -pitch speed <200>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +SweetSpot(piecenum) + { piecenum=body; } + + + +HitByWeaponId() + { + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode head type FALL; + explode lwing type FALL; + explode rwing type FALL; + explode mblade type FALL | EXPLODE_ON_HIT; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zairtoairfighter.cob b/Scripts/zaal/zairtoairfighter.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/zaal/zairtoairfighter.cob differ diff --git a/Scripts/zaal/zairtogroundfighter.cob b/Scripts/zaal/zairtogroundfighter.cob new file mode 100644 index 000000000..0b61548c1 Binary files /dev/null and b/Scripts/zaal/zairtogroundfighter.cob differ diff --git a/Scripts/zaal/zarm_lus.lua b/Scripts/zaal/zarm_lus.lua new file mode 100644 index 000000000..19f09c95b --- /dev/null +++ b/Scripts/zaal/zarm_lus.lua @@ -0,0 +1,85 @@ +base, point1 = piece('base', 'point1', 'point2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base}) + StartThread(BuildFX) + building = false + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function BuildFX() + while(building == true) do + --EmitSfx (point1, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(point1, y_axis, 0, 5) + end +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return point1 +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return point1 +end + + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + --EmitSfx (point1, 1024) +end + +------------------------------------------- +------------------------------------------- + +local nanoPoints = {} +-- FIXME: this example has 2 nano pieces to alternate between +for i = 1, 2 do + -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model + nanoPoints[i] = piece("point" .. i) +end +Spring.SetUnitNanoPieces(unitID, nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + Turn(point1, y_axis, heading, 100) + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + --Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/zaal/zarty.bos b/Scripts/zaal/zarty.bos new file mode 100644 index 000000000..8d827818d --- /dev/null +++ b/Scripts/zaal/zarty.bos @@ -0,0 +1,235 @@ +piece body,head,tail,lthighf,lkneef,lshinf,lfootf,rthighf,rkneef,rshinf,rfootf,rblade,lblade,lthighb,lkneeb,lshinb,lfootb,rthighb,rkneeb,rshinb,rfootb; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn lthighf to x-axis <70> speed<115>; + turn lkneef to x-axis <-40> speed<145>; + turn lshinf to x-axis <20> speed<145>; + turn lfootf to x-axis <-50> speed<310>; + + turn rthighf to x-axis <-20> speed<310>; + turn rkneef to x-axis <-60> speed<310>; + turn rshinf to x-axis <50> speed<310>; + turn rfootf to x-axis <30> speed<310>; + + turn lthighb to x-axis <70> speed<115>; + turn lkneeb to x-axis <-40> speed<145>; + turn lshinb to x-axis <20> speed<145>; + turn lfootb to x-axis <-50> speed<310>; + + turn rthighb to x-axis <-20> speed<310>; + turn rkneeb to x-axis <-60> speed<310>; + turn rshinb to x-axis <50> speed<310>; + turn rfootb to x-axis <30> speed<310>; + + turn body to z-axis <5> speed <20>; + turn lthighf to z-axis <-5> speed <20>; + turn rthighf to z-axis <-5> speed <20>; + turn lthighb to z-axis <-5> speed <20>; + turn rthighb to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn lthighf to x-axis <-10> speed<160>; + turn lkneef to x-axis <15> speed<145>; + turn lshinf to x-axis <-60> speed<250>; + turn lfootf to x-axis <30> speed<145>; + + turn rthighf to x-axis <40> speed<145>; + turn rkneef to x-axis <-35> speed<145>; + turn rshinf to x-axis <-40> speed<145>; + turn rfootf to x-axis <35> speed<145>; + + turn lthighb to x-axis <-10> speed<160>; + turn lkneeb to x-axis <15> speed<145>; + turn lshinb to x-axis <-60> speed<250>; + turn lfootb to x-axis <30> speed<145>; + + turn rthighb to x-axis <40> speed<145>; + turn rkneeb to x-axis <-35> speed<145>; + turn rshinb to x-axis <-40> speed<145>; + turn rfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshinf around x-axis;} + if (aMoving) { + move body to y-axis [100.000000] speed [60.000000]; + turn rthighf to x-axis <70> speed<115>; + turn rkneef to x-axis <-40> speed<145>; + turn rshinf to x-axis <20> speed<145>; + turn rfootf to x-axis <-50> speed<310>; + + turn lthighf to x-axis <-20> speed<310>; + turn lkneef to x-axis <-60> speed<310>; + turn lshinf to x-axis <50> speed<310>; + turn lfootf to x-axis <30> speed<310>; + + turn rthighb to x-axis <70> speed<115>; + turn rkneeb to x-axis <-40> speed<145>; + turn rshinb to x-axis <20> speed<145>; + turn rfootb to x-axis <-50> speed<310>; + + turn lthighb to x-axis <-20> speed<310>; + turn lkneeb to x-axis <-60> speed<310>; + turn lshinb to x-axis <50> speed<310>; + turn lfootb to x-axis <30> speed<310>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthighf to z-axis <5> speed <20>; + turn rthighf to z-axis <5> speed <20>; + turn lthighb to z-axis <5> speed <20>; + turn rthighb to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthighf around x-axis;} + if (aMoving) { + move body to y-axis [0.000000] speed [120.000000]; + turn rthighf to x-axis <-10> speed<160>; + turn rkneef to x-axis <15> speed<145>; + turn rshinf to x-axis <-60> speed<250>; + turn rfootf to x-axis <30> speed<145>; + + turn lthighf to x-axis <40> speed<145>; + turn lkneef to x-axis <-35> speed<145>; + turn lshinf to x-axis <-40> speed<145>; + turn lfootf to x-axis <35> speed<145>; + + turn rthighb to x-axis <-10> speed<160>; + turn rkneeb to x-axis <15> speed<145>; + turn rshinb to x-axis <-60> speed<250>; + turn rfootb to x-axis <30> speed<145>; + + turn lthighb to x-axis <40> speed<145>; + turn lkneeb to x-axis <-35> speed<145>; + turn lshinb to x-axis <-40> speed<145>; + turn lfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshinf around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + move body to y-axis [0.000000] speed [200.000000]; + turn lfootf to x-axis <0> speed <200>; + turn rfootf to x-axis <0> speed <200>; + turn rthighf to x-axis <0> speed <200>; + turn lthighf to x-axis <0> speed <200>; + turn lshinf to x-axis <0> speed <200>; + turn rshinf to x-axis <0> speed <200>; + turn lkneef to x-axis <0> speed <200>; + turn rkneef to x-axis <0> speed <200>; + turn lfootb to x-axis <0> speed <200>; + turn rfootb to x-axis <0> speed <200>; + turn rthighb to x-axis <0> speed <200>; + turn lthighb to x-axis <0> speed <200>; + turn lshinb to x-axis <0> speed <200>; + turn rshinb to x-axis <0> speed <200>; + turn lkneeb to x-axis <0> speed <200>; + turn rkneeb to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lblade to y-axis <40> speed [1]; + turn rblade to y-axis <-40> speed [1]; + wait-for-turn lblade around y-axis; + turn lblade to y-axis <0> speed [0.3]; + turn rblade to y-axis <0> speed [0.3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zarty.cob b/Scripts/zaal/zarty.cob new file mode 100644 index 000000000..25463e2ae Binary files /dev/null and b/Scripts/zaal/zarty.cob differ diff --git a/Scripts/zaal/zassault.bos b/Scripts/zaal/zassault.bos new file mode 100644 index 000000000..9efdb687b --- /dev/null +++ b/Scripts/zaal/zassault.bos @@ -0,0 +1,250 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearml,lbladel,rforearml,rbladel,lforearmu,lbladeu,rforearmu,rbladeu; + +static-var gun_1, aMoving, bMoving, aapitch, aaheading; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<70>; + turn lknee to x-axis <-40> speed<88>; + turn lshin to x-axis <20> speed<88>; + turn lfoot to x-axis <-50> speed<127>; + + turn rthigh to x-axis <-20> speed<127>; + turn rknee to x-axis <-60> speed<127>; + turn rshin to x-axis <50> speed<127>; + turn rfoot to x-axis <30> speed<127>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<97>; + turn lknee to x-axis <15> speed<88>; + turn lshin to x-axis <-60> speed<151>; + turn lfoot to x-axis <30> speed<88>; + + turn rthigh to x-axis <40> speed<88>; + turn rknee to x-axis <-35> speed<88>; + turn rshin to x-axis <-40> speed<88>; + turn rfoot to x-axis <35> speed<88>; + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<70>; + turn rknee to x-axis <-40> speed<88>; + turn rshin to x-axis <20> speed<88>; + turn rfoot to x-axis <-50> speed<127>; + + turn lthigh to x-axis <-20> speed<127>; + turn lknee to x-axis <-60> speed<127>; + turn lshin to x-axis <50> speed<127>; + turn lfoot to x-axis <30> speed<127>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<97>; + turn rknee to x-axis <15> speed<88>; + turn rshin to x-axis <-60> speed<151>; + turn rfoot to x-axis <30> speed<88>; + + turn lthigh to x-axis <40> speed<88>; + turn lknee to x-axis <-35> speed<88>; + turn lshin to x-axis <-40> speed<88>; + turn lfoot to x-axis <35> speed<88>; + + + move body to y-axis <0> speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + gun_1 = 1; + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + return(TRUE); + } + +AimSecondary(heading,pitch) + { + aapitch = pitch; + aaheading = heading; + return(TRUE); + } + +Shot1() + { + ++gun_1; + if (gun_1 > 4) + { + gun_1 = 1; + } + if (gun_1 == 1) + { + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 2) + { + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + } + if (gun_1 == 3) + { + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 4) + { + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + } + } + +Shot2() + { + turn head to x-axis 0 -aapitch speed <400>; + turn head to y-axis aaheading speed <300>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + emit-sfx 1024+3 from lforearmu; + emit-sfx 1024+3 from lforearml; + emit-sfx 1024+3 from rforearmu; + emit-sfx 1024+3 from rforearml; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + turn head to y-axis 0 speed <120>; + turn head to x-axis 0 speed <120>; + } + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zassault.cob b/Scripts/zaal/zassault.cob new file mode 100644 index 000000000..1fa57561c Binary files /dev/null and b/Scripts/zaal/zassault.cob differ diff --git a/Scripts/zaal/zconstructor.bos b/Scripts/zaal/zconstructor.bos new file mode 100644 index 000000000..ece50a29f --- /dev/null +++ b/Scripts/zaal/zconstructor.bos @@ -0,0 +1,196 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,nano1; + +static-var aMoving, bMoving, bAiming, bCanAim, shooting_num, base_speed, restore_delay, building; + +// Signal definitions +#define SIG_BUILD 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define SIG_RESTORE 32 + +#include "sfxtype.h" +#include "exptype.h" + + + + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + emit-sfx 1024 from head; + } + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + + } + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + emit-sfx 1024 from head; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <100>; + turn rfoot to x-axis <0> speed <100>; + turn rthigh to x-axis <0> speed <100>; + turn lthigh to x-axis <0> speed <100>; + turn lshin to x-axis <0> speed <100>; + turn rshin to x-axis <0> speed <100>; + turn lfoot to y-axis <0> speed <100>; + turn rfoot to y-axis <0> speed <100>; + turn rthigh to y-axis <0> speed <100>; + turn lthigh to y-axis <0> speed <100>; + turn lshin to y-axis <0> speed <100>; + turn rshin to y-axis <0> speed <100>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Activate() +{ + +} + +Deactivate() +{ + +} + +RestoreAfterDelay() +{ + sleep 1000; + +} + +Create() +{ + start-script RestoreAfterDelay(); +} + +StartBuilding(heading, pitch) +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 1; + building = 1; + while (1) { +// emit-sfx 2048 from nanopoint1; + sleep 30; + } +} + +StopBuilding() +{ + signal SIG_BUILD; + set-signal-mask SIG_BUILD; + set INBUILDSTANCE to 0; + building = 0; +} + +QueryNanoPiece(piecenum) +{ + piecenum = nano1; +} + +SweetSpot(piecenum) + { piecenum=body; } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zconstructor.cob b/Scripts/zaal/zconstructor.cob new file mode 100644 index 000000000..d5a0c70a0 Binary files /dev/null and b/Scripts/zaal/zconstructor.cob differ diff --git a/Scripts/zaal/zespire1.bos b/Scripts/zaal/zespire1.bos new file mode 100644 index 000000000..406924272 --- /dev/null +++ b/Scripts/zaal/zespire1.bos @@ -0,0 +1,43 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + start-script SmokeUnit(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/zaal/zespire1.cob b/Scripts/zaal/zespire1.cob new file mode 100644 index 000000000..d126d83c9 Binary files /dev/null and b/Scripts/zaal/zespire1.cob differ diff --git a/Scripts/zaal/zespire4.bos b/Scripts/zaal/zespire4.bos new file mode 100644 index 000000000..406924272 --- /dev/null +++ b/Scripts/zaal/zespire4.bos @@ -0,0 +1,43 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + start-script SmokeUnit(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/zaal/zespire4.cob b/Scripts/zaal/zespire4.cob new file mode 100644 index 000000000..d126d83c9 Binary files /dev/null and b/Scripts/zaal/zespire4.cob differ diff --git a/Scripts/zaal/zespire5.bos b/Scripts/zaal/zespire5.bos new file mode 100644 index 000000000..406924272 --- /dev/null +++ b/Scripts/zaal/zespire5.bos @@ -0,0 +1,43 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + start-script SmokeUnit(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/zaal/zespire5.cob b/Scripts/zaal/zespire5.cob new file mode 100644 index 000000000..d126d83c9 Binary files /dev/null and b/Scripts/zaal/zespire5.cob differ diff --git a/Scripts/zaal/zfactory.bos b/Scripts/zaal/zfactory.bos new file mode 100644 index 000000000..633808cab --- /dev/null +++ b/Scripts/zaal/zfactory.bos @@ -0,0 +1,143 @@ + +#include "sfxtype.h" +#include "exptype.h" + +piece base, nano1, nano2, nano3, nano4; + +static-var Maya, building, spray; + +// Signal definitions (they must be distincts power of 2) +#define SIG_ACTIVATE 2 +#define SIG_BUILDING 4 + +SmokeUnit() +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1025 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + + + +Create() +{ + spray = 0; + while( get BUILD_PERCENT_LEFT ) + sleep 400; + start-script SmokeUnit(); +} + + +QueryNanoPiece(piecenum) +{ + if( spray == 0 ) + { + piecenum = nano1; + } + if( spray == 1 ) + { + piecenum = nano2; + } + if( spray == 2 ) + { + piecenum = nano3; + } + if( spray == 3 ) + { + piecenum = nano4; + } + ++spray; + if( spray >= 4 ) + { + spray = 0; + } +} + +Activate() +{ + // Kill any other Activate or Deactivate: + signal SIG_ACTIVATE; + // Flag self so it can be killed: + set-signal-mask SIG_ACTIVATE; + // Local variables + // Open animation: + // Try to open the yard + set YARD_OPEN to TRUE; + // If yard not open, tell units around to bugger off until yard is open + while( !get YARD_OPEN ) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to TRUE; + } + set BUGGER_OFF to FALSE; + // Now yard is open. + // Allow the nano to flow: + set INBUILDSTANCE to TRUE; + // Send wheel spinning: + // The idle but activated animation +} + +Deactivate() +{ + // Kill any other Activate or Deactivate: + signal SIG_ACTIVATE; + // Flag self so it can be killed: + set-signal-mask SIG_ACTIVATE; + // Switch off the nano faucet: + set INBUILDSTANCE to FALSE; + // Stop wheel spinning + // Try to close the yard + set YARD_OPEN to FALSE; + // If yard not closed, tell units around to bugger off until yard is closed + while( get YARD_OPEN ) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to FALSE; + } + set BUGGER_OFF to FALSE; + // Now yard is closed. + // Close animation: +} + +StartBuilding() +{ + signal SIG_BUILDING; // Kill any other StartBuilding + set-signal-mask SIG_BUILDING; // Be killable + building = 1; + while(TRUE) + { + sleep 600; + } +} + +StopBuilding() +{ + signal SIG_BUILDING; // Kill StartBuilding + building = 0; +} + +QueryBuildInfo(piecenum) +{ + piecenum = base; +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} \ No newline at end of file diff --git a/Scripts/zaal/zfactory.cob b/Scripts/zaal/zfactory.cob new file mode 100644 index 000000000..848092d56 Binary files /dev/null and b/Scripts/zaal/zfactory.cob differ diff --git a/Scripts/zaal/zhive.bos b/Scripts/zaal/zhive.bos new file mode 100644 index 000000000..5b25590e8 --- /dev/null +++ b/Scripts/zaal/zhive.bos @@ -0,0 +1,136 @@ + +#include "sfxtype.h" +#include "exptype.h" + +piece base, nanopoint1, nanopoint2, mouth; + +static-var Maya, building, spray; + +// Signal definitions (they must be distincts power of 2) +#define SIG_ACTIVATE 2 +#define SIG_BUILDING 4 + +SmokeUnit() +{ + var healthpercent, sleeptime, smoketype; + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = SFXTYPE_BLACKSMOKE; + if( Rand( 1, 66 ) < healthpercent ) + smoketype = SFXTYPE_WHITESMOKE; + emit-sfx 1025 from mouth; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + sleeptime = 200; + sleep sleeptime; + } +} + + +buildingfx() +{ + while( TRUE ) + { + if (building) + { + emit-sfx 1024 from mouth; + } + sleep 300; + } +} + +Create() +{ + spray = 0; + while( get BUILD_PERCENT_LEFT ) + sleep 400; + start-script SmokeUnit(); + start-script Buildingfx(); +} + + +QueryNanoPiece(piecenum) +{ + piecenum = nanopoint2; +} + +Activate() +{ + // Kill any other Activate or Deactivate: + signal SIG_ACTIVATE; + // Flag self so it can be killed: + set-signal-mask SIG_ACTIVATE; + // Local variables + // Open animation: + // Try to open the yard + set YARD_OPEN to TRUE; + // If yard not open, tell units around to bugger off until yard is open + while( !get YARD_OPEN ) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to TRUE; + } + set BUGGER_OFF to FALSE; + // Now yard is open. + // Allow the nano to flow: + set INBUILDSTANCE to TRUE; + // Send wheel spinning: + // The idle but activated animation +} + +Deactivate() +{ + // Kill any other Activate or Deactivate: + signal SIG_ACTIVATE; + // Flag self so it can be killed: + set-signal-mask SIG_ACTIVATE; + // Switch off the nano faucet: + set INBUILDSTANCE to FALSE; + // Stop wheel spinning + // Try to close the yard + set YARD_OPEN to FALSE; + // If yard not closed, tell units around to bugger off until yard is closed + while( get YARD_OPEN ) + { + set BUGGER_OFF to TRUE; + sleep 1500; + set YARD_OPEN to FALSE; + } + set BUGGER_OFF to FALSE; + // Now yard is closed. + // Close animation: +} + +StartBuilding() +{ + signal SIG_BUILDING; // Kill any other StartBuilding + set-signal-mask SIG_BUILDING; // Be killable + building = 1; + while(TRUE) + { + emit-sfx 1024 from nanopoint2; + sleep 600; + } +} + +StopBuilding() +{ + signal SIG_BUILDING; // Kill StartBuilding + building = 0; +} + +QueryBuildInfo(piecenum) +{ + piecenum = nanopoint1; +} + + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} \ No newline at end of file diff --git a/Scripts/zaal/zhive.cob b/Scripts/zaal/zhive.cob new file mode 100644 index 000000000..258caf262 Binary files /dev/null and b/Scripts/zaal/zhive.cob differ diff --git a/Scripts/zaal/zkamikaze.bos b/Scripts/zaal/zkamikaze.bos new file mode 100644 index 000000000..7da71aa81 --- /dev/null +++ b/Scripts/zaal/zkamikaze.bos @@ -0,0 +1,238 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack; + +static-var aMoving, bMoving, bAiming, bCanAim, shooting_num, base_speed, restore_delay; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define SIG_RESTORE 32 + +#include "sfxtype.h" +#include "exptype.h" + + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis; + emit-sfx 1024 from head; + } + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis; + + } + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + emit-sfx 1024 from head; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <100>; + turn rfoot to x-axis <0> speed <100>; + turn rthigh to x-axis <0> speed <100>; + turn lthigh to x-axis <0> speed <100>; + turn lshin to x-axis <0> speed <100>; + turn rshin to x-axis <0> speed <100>; + turn lfoot to y-axis <0> speed <100>; + turn rfoot to y-axis <0> speed <100>; + turn rthigh to y-axis <0> speed <100>; + turn lthigh to y-axis <0> speed <100>; + turn lshin to y-axis <0> speed <100>; + turn rshin to y-axis <0> speed <100>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Activate() +{ + +} + +Deactivate() +{ + +} + +RestoreAfterDelay() +{ + sleep 1000; + +} + +Create() +{ + emit-sfx 1024+2 from body; + + start-script RestoreAfterDelay(); +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + while( 255 > heading ) + { + set UNKNOWN_UNIT_VALUE(82) to 0 - 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading + 1000; + sleep 1; + } + while( heading > 255 ) + { + set UNKNOWN_UNIT_VALUE(82) to 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading - 1000; + sleep 1; + } + return (1); +} + +AimSecondary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <175>; + turn head to x-axis 0 -pitch speed <175>; + wait-for-turn head around y-axis; + wait-for-turn head around x-axis; + return(1); + } + +Shot2() + { + turn lsack to y-axis <30> speed <200>; + turn rsack to y-axis <-30> speed <200>; + move rsack to x-axis [-1] speed [9]; + move lsack to x-axis [1] speed [9];; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed <20>; + turn rsack to y-axis <0> speed <20>; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + } + +SweetSpot(piecenum) + { piecenum=body; } + +HitByWeaponId() + { + emit-sfx 1024+1 from head; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1024+2 from head; + explode head type FALL | NOHEATCLOUD; + explode tail type FALL | NOHEATCLOUD; + explode lthigh type FALL | NOHEATCLOUD; + explode rthigh type FALL | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zkamikaze.cob b/Scripts/zaal/zkamikaze.cob new file mode 100644 index 000000000..6adf136bf Binary files /dev/null and b/Scripts/zaal/zkamikaze.cob differ diff --git a/Scripts/zaal/zlightswarm.bos b/Scripts/zaal/zlightswarm.bos new file mode 100644 index 000000000..10e57c76b --- /dev/null +++ b/Scripts/zaal/zlightswarm.bos @@ -0,0 +1,186 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,lforearm,lupperarm,lblade,rforearm,rupperarm,rblade; + +static-var aMoving, bMoving, lasthit; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<230>; + turn lknee to x-axis <-40> speed<270>; + turn lshin to x-axis <20> speed<270>; + turn lfoot to x-axis <-50> speed<420>; + + turn rthigh to x-axis <-20> speed<420>; + turn rknee to x-axis <-60> speed<420>; + turn rshin to x-axis <50> speed<420>; + turn rfoot to x-axis <30> speed<420>; + + turn body to z-axis <5> speed <40>; + turn lthigh to z-axis <-5> speed <40>; + turn rthigh to z-axis <-5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn tail to y-axis <10> speed <80>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + turn lthigh to x-axis <-10> speed<320>; + turn lknee to x-axis <15> speed<270>; + turn lshin to x-axis <-60> speed<500>; + turn lfoot to x-axis <30> speed<270>; + + turn rthigh to x-axis <40> speed<270>; + turn rknee to x-axis <-35> speed<270>; + turn rshin to x-axis <-40> speed<270>; + turn rfoot to x-axis <35> speed<270>; + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn lshin around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <70> speed<230>; + turn rknee to x-axis <-40> speed<270>; + turn rshin to x-axis <20> speed<270>; + turn rfoot to x-axis <-50> speed<420>; + + turn lthigh to x-axis <-20> speed<420>; + turn lknee to x-axis <-60> speed<420>; + turn lshin to x-axis <50> speed<420>; + turn lfoot to x-axis <30> speed<420>; + + turn tail to y-axis <-10> speed <80>; + turn body to z-axis <-5> speed <40>; + turn lthigh to z-axis <5> speed <40>; + turn rthigh to z-axis <5> speed <40>; + move body to y-axis [0.7] speed <8000>; + turn head to x-axis <-10> speed <40>; + turn tail to x-axis <10> speed <40>; + wait-for-turn rthigh around x-axis; + } + if (aMoving) { + turn rthigh to x-axis <-10> speed<320>; + turn rknee to x-axis <15> speed<270>; + turn rshin to x-axis <-60> speed<500>; + turn rfoot to x-axis <30> speed<270>; + + turn lthigh to x-axis <40> speed<270>; + turn lknee to x-axis <-35> speed<270>; + turn lshin to x-axis <-40> speed<270>; + turn lfoot to x-axis <35> speed<270>; + + + move body to y-axis <0> speed <8000>; + turn head to x-axis <10> speed <40>; + turn tail to x-axis <-10> speed <40>; + wait-for-turn rshin around x-axis; + } + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return 100; +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lforearm to y-axis <-140> speed <600>; + turn rforearm to y-axis <140> speed <600>; + turn lblade to y-axis <140> speed <600>; + turn rblade to y-axis <-140> speed <600>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0> speed <120>; + turn rforearm to y-axis <0> speed <120>; + turn lblade to y-axis <0> speed <120>; + turn rblade to y-axis <0> speed <120>; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + explode head type FALL; + explode tail type FALL; + explode lblade type FALL; + explode rblade type FALL; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zlightswarm.cob b/Scripts/zaal/zlightswarm.cob new file mode 100644 index 000000000..5210f6130 Binary files /dev/null and b/Scripts/zaal/zlightswarm.cob differ diff --git a/Scripts/zaal/zmedswarm.bos b/Scripts/zaal/zmedswarm.bos new file mode 100644 index 000000000..ba681560b --- /dev/null +++ b/Scripts/zaal/zmedswarm.bos @@ -0,0 +1,182 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece body, head, tail, lthigh, lknee, lshin, lfoot, rthigh, + rknee, rshin, rfoot, lforearm, lupperarm, lblade, rforearm, rupperarm, + rblade; + +static-var bMoving, Static_Var_2, Static_Var_3; + +// Signal definitions +#define SIG_AIM 2 + + +walk() +{ + while( bMoving ) + { + Static_Var_2 = 1; + if( bMoving ) + { + turn lthigh to x-axis <70.000000> speed <230.000000>; + turn lknee to x-axis <-40.000000> speed <270.000000>; + turn lshin to x-axis <20.000000> speed <270.000000>; + turn lfoot to x-axis <-50.000000> speed <420.000000>; + turn rthigh to x-axis <-20.000000> speed <420.000000>; + turn rknee to x-axis <-60.000000> speed <420.000000>; + turn rshin to x-axis <50.000000> speed <420.000000>; + turn rfoot to x-axis <30.000000> speed <420.000000>; + turn body to z-axis <5.000000> speed <40.000000>; + turn lthigh to z-axis <-5.000000> speed <40.000000>; + turn rthigh to z-axis <-5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn tail to y-axis <10.000000> speed <80.000000>; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn lthigh around x-axis; + } + if( bMoving ) + { + turn lthigh to x-axis <-10.000000> speed <320.000000>; + turn lknee to x-axis <15.000000> speed <270.000000>; + turn lshin to x-axis <-60.000000> speed <500.000000>; + turn lfoot to x-axis <30.000000> speed <270.000000>; + turn rthigh to x-axis <40.000000> speed <270.000000>; + turn rknee to x-axis <-35.000000> speed <270.000000>; + turn rshin to x-axis <-40.000000> speed <270.000000>; + turn rfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn lshin around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <70.000000> speed <230.000000>; + turn rknee to x-axis <-40.000000> speed <270.000000>; + turn rshin to x-axis <20.000000> speed <270.000000>; + turn rfoot to x-axis <-50.000000> speed <420.000000>; + turn lthigh to x-axis <-20.000000> speed <420.000000>; + turn lknee to x-axis <-60.000000> speed <420.000000>; + turn lshin to x-axis <50.000000> speed <420.000000>; + turn lfoot to x-axis <30.000000> speed <420.000000>; + turn tail to y-axis <-10.000000> speed <80.000000>; + turn body to z-axis <-5.000000> speed <40.000000>; + turn lthigh to z-axis <5.000000> speed <40.000000>; + turn rthigh to z-axis <5.000000> speed <40.000000>; + move body to y-axis [0.700000] speed [8.886719]; + turn head to x-axis <-10.000000> speed <40.000000>; + turn tail to x-axis <10.000000> speed <40.000000>; + wait-for-turn rthigh around x-axis; + } + if( bMoving ) + { + turn rthigh to x-axis <-10.000000> speed <320.000000>; + turn rknee to x-axis <15.000000> speed <270.000000>; + turn rshin to x-axis <-60.000000> speed <500.000000>; + turn rfoot to x-axis <30.000000> speed <270.000000>; + turn lthigh to x-axis <40.000000> speed <270.000000>; + turn lknee to x-axis <-35.000000> speed <270.000000>; + turn lshin to x-axis <-40.000000> speed <270.000000>; + turn lfoot to x-axis <35.000000> speed <270.000000>; + move body to y-axis [0.000000] speed [8.886719]; + turn head to x-axis <10.000000> speed <40.000000>; + turn tail to x-axis <-10.000000> speed <40.000000>; + wait-for-turn rshin around x-axis; + } + } +} + +Halt() +{ + sleep 150; + if( !bMoving ) + { + Static_Var_2 = 0; + turn lfoot to x-axis <0.000000> speed <200.000000>; + turn rfoot to x-axis <0.000000> speed <200.000000>; + turn rthigh to x-axis <0.000000> speed <200.000000>; + turn lthigh to x-axis <0.000000> speed <200.000000>; + turn lshin to x-axis <0.000000> speed <200.000000>; + turn rshin to x-axis <0.000000> speed <200.000000>; + turn lknee to x-axis <0.000000> speed <200.000000>; + turn rknee to x-axis <0.000000> speed <200.000000>; + } +} + +StartMoving() +{ + bMoving = TRUE; + if( !Static_Var_2 ) + { + start-script walk(); + } +} + +StopMoving() +{ + bMoving = FALSE; + start-script Halt(); +} + +HitByWeaponId() +{ + return (100); +} + +Create() +{ + emit-sfx 1024 + 2 from body; +} + +SweetSpot(piecenum) +{ + piecenum = body; +} + +AimFromPrimary(piecenum) +{ + piecenum = head; +} + +QueryPrimary(piecenum) +{ + piecenum = head; +} + +RestoreAfterDelay() +{ + sleep 1000; +} + +AimPrimary(heading, pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis <0.000000> - pitch speed <5000>; + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + return (1); +} + +Shot1() +{ + turn lforearm to y-axis <-140.000000> speed <700.000000>; + turn rforearm to y-axis <140.000000> speed <700.000000>; + turn lblade to y-axis <140.000000> speed <700.000000>; + turn rblade to y-axis <-140.000000> speed <700.000000>; + wait-for-turn rblade around y-axis; + turn lforearm to y-axis <0.000000> speed <400.000000>; + turn rforearm to y-axis <0.000000> speed <400.000000>; + turn lblade to y-axis <0.000000> speed <400.000000>; + turn rblade to y-axis <0.000000> speed <400.000000>; +} + +Killed(severity, corpsetype) +{ + corpsetype = 1; + emit-sfx 1025 from body; +} diff --git a/Scripts/zaal/zmedswarm.cob b/Scripts/zaal/zmedswarm.cob new file mode 100644 index 000000000..38c302ee6 Binary files /dev/null and b/Scripts/zaal/zmedswarm.cob differ diff --git a/Scripts/zaal/zmex.bos b/Scripts/zaal/zmex.bos new file mode 100644 index 000000000..811851b82 --- /dev/null +++ b/Scripts/zaal/zmex.bos @@ -0,0 +1,63 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base, mouth; + +static-var none; + + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +fx() +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { +// if (tech) +// { + emit-sfx 1024 from mouth; +// } + sleep 500; + } +} + +Create() +{ + start-script SmokeUnit(); + start-script fx(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/zaal/zmex.cob b/Scripts/zaal/zmex.cob new file mode 100644 index 000000000..136e2a16c Binary files /dev/null and b/Scripts/zaal/zmex.cob differ diff --git a/Scripts/zaal/zpyro.bos b/Scripts/zaal/zpyro.bos new file mode 100644 index 000000000..bd7e02fcb --- /dev/null +++ b/Scripts/zaal/zpyro.bos @@ -0,0 +1,235 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack; + +static-var aMoving, bMoving, bAiming, bCanAim, shooting_num, base_speed, restore_delay; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define SIG_RESTORE 32 + +#include "sfxtype.h" +#include "exptype.h" + + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis; + } + if (aMoving) { + + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <100>; + turn rfoot to x-axis <0> speed <100>; + turn rthigh to x-axis <0> speed <100>; + turn lthigh to x-axis <0> speed <100>; + turn lshin to x-axis <0> speed <100>; + turn rshin to x-axis <0> speed <100>; + turn lfoot to y-axis <0> speed <100>; + turn rfoot to y-axis <0> speed <100>; + turn rthigh to y-axis <0> speed <100>; + turn lthigh to y-axis <0> speed <100>; + turn lshin to y-axis <0> speed <100>; + turn rshin to y-axis <0> speed <100>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Activate() +{ + +} + +Deactivate() +{ + +} + +RestoreAfterDelay() +{ + sleep 1000; + +} + +Create() +{ + emit-sfx 1024+2 from body; + + start-script RestoreAfterDelay(); +} + +AimFromPrimary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + + +AimPrimary(heading,pitch) +{ + signal SIG_AIM; + set-signal-mask SIG_AIM; + while( 255 > heading ) + { + set UNKNOWN_UNIT_VALUE(82) to 0 - 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading + 1000; + sleep 1; + } + while( heading > 255 ) + { + set UNKNOWN_UNIT_VALUE(82) to 1000 + get UNKNOWN_UNIT_VALUE(82); + heading = heading - 1000; + sleep 1; + } + return (1); +} + +AimSecondary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + wait-for-turn head around y-axis; + wait-for-turn head around x-axis; + return(1); + } + +Shot2() + { + turn lsack to y-axis <30> speed <200>; + turn rsack to y-axis <-30> speed <200>; + move rsack to x-axis [-1] speed [9]; + move lsack to x-axis [1] speed [9];; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed <20>; + turn rsack to y-axis <0> speed <20>; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + emit-sfx 1027 from head; + } + +SweetSpot(piecenum) + { piecenum=body; } + +HitByWeaponId() + { + emit-sfx 1024 from head; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from head; + explode head type EXPLODE_ON_HIT; + explode tail type EXPLODE_ON_HIT; + explode lthigh type EXPLODE_ON_HIT; + explode rthigh type EXPLODE_ON_HIT; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zpyro.cob b/Scripts/zaal/zpyro.cob new file mode 100644 index 000000000..0cf174b1e Binary files /dev/null and b/Scripts/zaal/zpyro.cob differ diff --git a/Scripts/zaal/zqueen.bos b/Scripts/zaal/zqueen.bos new file mode 100644 index 000000000..37008dfcb --- /dev/null +++ b/Scripts/zaal/zqueen.bos @@ -0,0 +1,417 @@ +piece body,head,tail,lthighf,lkneef,lshinf,lfootf,rthighf,rkneef,rshinf,rfootf,lthighb,lkneeb,lshinb,lfootb,rthighb,rkneeb,rshinb,rfootb,lforearml,lbladel,rforearml,rbladel,lforearmu,lbladeu,rforearmu,rbladeu,spike1,spike2,spike3,firepoint; + +static-var aMoving, bMoving, gun_1, shot5pitch, shot5heading; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 +#define CHANGE_TARGET 98 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthighf to x-axis <70> speed<115>; + turn lkneef to x-axis <-40> speed<145>; + turn lshinf to x-axis <20> speed<145>; + turn lfootf to x-axis <-50> speed<210>; + + turn rthighf to x-axis <-20> speed<210>; + turn rkneef to x-axis <-60> speed<210>; + turn rshinf to x-axis <50> speed<210>; + turn rfootf to x-axis <30> speed<210>; + + turn rthighb to x-axis <70> speed<115>; + turn rkneeb to x-axis <-40> speed<145>; + turn rshinb to x-axis <20> speed<145>; + turn rfootb to x-axis <-50> speed<210>; + + turn lthighb to x-axis <-20> speed<210>; + turn lkneeb to x-axis <-60> speed<210>; + turn lshinb to x-axis <50> speed<210>; + turn lfootb to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthighf to z-axis <-5> speed <20>; + turn rthighf to z-axis <-5> speed <20>; + turn lthighb to z-axis <-5> speed <20>; + turn rthighb to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthighf around x-axis;} + + if (aMoving) { + turn lthighf to x-axis <-10> speed<160>; + turn lkneef to x-axis <15> speed<145>; + turn lshinf to x-axis <-60> speed<250>; + turn lfootf to x-axis <30> speed<145>; + + turn rthighf to x-axis <40> speed<145>; + turn rkneef to x-axis <-35> speed<145>; + turn rshinf to x-axis <-40> speed<145>; + turn rfootf to x-axis <35> speed<145>; + + turn rthighb to x-axis <-10> speed<160>; + turn rkneeb to x-axis <15> speed<145>; + turn rshinb to x-axis <-60> speed<250>; + turn rfootb to x-axis <30> speed<145>; + + turn lthighb to x-axis <40> speed<145>; + turn lkneeb to x-axis <-35> speed<145>; + turn lshinb to x-axis <-40> speed<145>; + turn lfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshinf around x-axis;} + if (aMoving) { + + turn rthighf to x-axis <70> speed<115>; + turn rkneef to x-axis <-40> speed<145>; + turn rshinf to x-axis <20> speed<145>; + turn rfootf to x-axis <-50> speed<210>; + + turn lthighf to x-axis <-20> speed<210>; + turn lkneef to x-axis <-60> speed<210>; + turn lshinf to x-axis <50> speed<210>; + turn lfootf to x-axis <30> speed<210>; + + turn lthighb to x-axis <70> speed<115>; + turn lkneeb to x-axis <-40> speed<145>; + turn lshinb to x-axis <20> speed<145>; + turn lfootb to x-axis <-50> speed<210>; + + turn rthighb to x-axis <-20> speed<210>; + turn rkneeb to x-axis <-60> speed<210>; + turn rshinb to x-axis <50> speed<210>; + turn rfootb to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthighf to z-axis <5> speed <20>; + turn rthighf to z-axis <5> speed <20>; + turn lthighb to z-axis <5> speed <20>; + turn rthighb to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthighf around x-axis;} + if (aMoving) { + + turn rthighf to x-axis <-10> speed<160>; + turn rkneef to x-axis <15> speed<145>; + turn rshinf to x-axis <-60> speed<250>; + turn rfootf to x-axis <30> speed<145>; + + turn lthighf to x-axis <40> speed<145>; + turn lkneef to x-axis <-35> speed<145>; + turn lshinf to x-axis <-40> speed<145>; + turn lfootf to x-axis <35> speed<145>; + + turn lthighb to x-axis <-10> speed<160>; + turn lkneeb to x-axis <15> speed<145>; + turn lshinb to x-axis <-60> speed<250>; + turn lfootb to x-axis <30> speed<145>; + + turn rthighb to x-axis <40> speed<145>; + turn rkneeb to x-axis <-35> speed<145>; + turn rshinb to x-axis <-40> speed<145>; + turn rfootb to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshinf around x-axis; + + } + + } + + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfootf to x-axis <0> speed <200>; + turn rfootf to x-axis <0> speed <200>; + turn rthighf to x-axis <0> speed <200>; + turn lthighf to x-axis <0> speed <200>; + turn lshinf to x-axis <0> speed <200>; + turn rshinf to x-axis <0> speed <200>; + turn lkneef to x-axis <0> speed <200>; + turn rkneef to x-axis <0> speed <200>; + turn lfootb to x-axis <0> speed <200>; + turn rfootb to x-axis <0> speed <200>; + turn rthighb to x-axis <0> speed <200>; + turn lthighb to x-axis <0> speed <200>; + turn lshinb to x-axis <0> speed <200>; + turn rshinb to x-axis <0> speed <200>; + turn lkneeb to x-axis <0> speed <200>; + turn rkneeb to x-axis <0> speed <200>; + } +} + + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + + +Create() +{ + emit-sfx 1026 from body; + emit-sfx 1026 from head; + emit-sfx 1026 from tail; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=firepoint; } + +QueryPrimary(piecenum) + { piecenum=firepoint; } + +AimFromWeapon2(piecenum) + { piecenum=spike1; } + +QueryWeapon2(piecenum) + { piecenum=spike1; } + +AimFromWeapon3(piecenum) + { piecenum=spike2; } + +QueryWeapon3(piecenum) + { piecenum=spike2; } + +AimFromWeapon4(piecenum) + { piecenum=spike3; } + +QueryWeapon4(piecenum) + { piecenum=spike3; } + +AimFromWeapon5(piecenum) + { piecenum=firepoint; } + +QueryWeapon5(piecenum) + { piecenum=firepoint; } + + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <350>; + turn head to x-axis 0 -pitch speed <300>; + + wait-for-turn head around y-axis; + + return(TRUE); + } + +AimWeapon2() + { + return(TRUE); + } + +AimWeapon3() + { + return(TRUE); + } + +AimWeapon4() + { + return(TRUE); + } + +AimWeapon5(heading,pitch) + { + shot5pitch = pitch; + shot5heading = heading; + return(TRUE); + } + + +Shot1() + { + ++gun_1; + if (gun_1 > 4) + { + gun_1 = 1; + } + if (gun_1 == 1) + { + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + wait-for-turn lbladeu around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 2) + { + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + wait-for-turn lbladel around y-axis; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + } + if (gun_1 == 3) + { + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + wait-for-turn rbladeu around y-axis; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + } + if (gun_1 == 4) + { + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn rbladel around y-axis; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; + } + } + + +Shot2() +{ + set CHANGE_TARGET to 2; +} + +Shot3() +{ + set CHANGE_TARGET to 3; +} + +Shot4() +{ +set CHANGE_TARGET to 4; +} + +Shot5() +{ + turn head to x-axis 0 -shot5pitch speed <400>; + turn head to y-axis shot5heading speed <300>; + wait-for-turn head around x-axis; + turn lforearmu to y-axis <-140> speed <600>; + turn lbladeu to y-axis <140> speed <600>; + turn lforearml to y-axis <-140> speed <600>; + turn lbladel to y-axis <140> speed <600>; + turn rforearmu to y-axis <140> speed <600>; + turn rbladeu to y-axis <-140> speed <600>; + turn rforearml to y-axis <140> speed <600>; + turn rbladel to y-axis <-140> speed <600>; + wait-for-turn lbladeu around y-axis; + wait-for-turn lbladel around y-axis; + wait-for-turn rbladeu around y-axis; + wait-for-turn rbladel around y-axis; + turn lforearmu to y-axis <0> speed <120>; + turn lbladeu to y-axis <0> speed <120>; + turn lforearml to y-axis <0> speed <120>; + turn lbladel to y-axis <0> speed <120>; + turn rforearmu to y-axis <0> speed <120>; + turn rbladeu to y-axis <0> speed <120>; + turn rforearml to y-axis <0> speed <120>; + turn rbladel to y-axis <0> speed <120>; +} + + +HitByWeaponId(z,x,weapon_id,shot_power) + { + if (weapon_id == 51) + { + emit-sfx 1025 from head; + emit-sfx 1025 from body; + emit-sfx 1024 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1024 from lthighf; + emit-sfx 1025 from lthighb; + } + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + emit-sfx 1025 from head; + emit-sfx 1025 from rbladeu; + emit-sfx 1025 from lbladel; + emit-sfx 1025 from tail; + emit-sfx 1025 from rthighf; + emit-sfx 1025 from rthighb; + emit-sfx 1025 from lthighf; + emit-sfx 1025 from lthighb; + emit-sfx 1024 from rfootf; + emit-sfx 1024 from rfootb; + emit-sfx 1024 from lfootf; + emit-sfx 1024 from lfootb; + sleep 50; + emit-sfx 2048+4 from body; + emit-sfx 2048+4 from head; + emit-sfx 2048+4 from tail; + emit-sfx 2048+4 from lthighf; + emit-sfx 2048+4 from rthighf; + emit-sfx 2048+4 from rthighb; + emit-sfx 2048+4 from lthighb; + emit-sfx 2048+4 from spike1; + emit-sfx 2048+4 from spike2; + emit-sfx 2048+4 from spike3; + explode head type FALL | FIRE | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearml type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladel type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD;; + explode lbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rforearmu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rbladeu type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike1 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike2 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode spike3 type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode tail type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode body type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneef type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootf type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode lfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rthighb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rkneeb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rshinb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + explode rfootb type FALL | EXPLODE_ON_HIT | NOHEATCLOUD; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zqueen.cob b/Scripts/zaal/zqueen.cob new file mode 100644 index 000000000..e630ee1c1 Binary files /dev/null and b/Scripts/zaal/zqueen.cob differ diff --git a/Scripts/zaal/zskirmisher.bos b/Scripts/zaal/zskirmisher.bos new file mode 100644 index 000000000..160308788 --- /dev/null +++ b/Scripts/zaal/zskirmisher.bos @@ -0,0 +1,223 @@ +piece body,head,tail,lthigh,lknee,lshin,lfoot,rthigh,rknee,rshin,rfoot,rsack,lsack,rblade,lblade,mblade,spike1,spike2,spike3; + +static-var aMoving, bMoving; + +// Signal definitions +#define SIG_AIM 2 +#define SIG_AIM_2 4 +#define SIG_MOVE 16 + +#include "sfxtype.h" +#include "exptype.h" + +walk() +{ + while (aMoving) + { + bMoving = TRUE; + if (aMoving) { + turn lthigh to x-axis <70> speed<115>; + turn lknee to x-axis <-40> speed<145>; + turn lshin to x-axis <20> speed<145>; + turn lfoot to x-axis <-50> speed<210>; + + turn rthigh to x-axis <-20> speed<210>; + turn rknee to x-axis <-60> speed<210>; + turn rshin to x-axis <50> speed<210>; + turn rfoot to x-axis <30> speed<210>; + + turn body to z-axis <5> speed <20>; + turn lthigh to z-axis <-5> speed <20>; + turn rthigh to z-axis <-5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn tail to y-axis <10> speed <40>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn lthigh around x-axis;} + if (aMoving) { + turn lthigh to x-axis <-10> speed<160>; + turn lknee to x-axis <15> speed<145>; + turn lshin to x-axis <-60> speed<250>; + turn lfoot to x-axis <30> speed<145>; + + turn rthigh to x-axis <40> speed<145>; + turn rknee to x-axis <-35> speed<145>; + turn rshin to x-axis <-40> speed<145>; + turn rfoot to x-axis <35> speed<145>; + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn lshin around x-axis;} + if (aMoving) { + turn rthigh to x-axis <70> speed<115>; + turn rknee to x-axis <-40> speed<145>; + turn rshin to x-axis <20> speed<145>; + turn rfoot to x-axis <-50> speed<210>; + + turn lthigh to x-axis <-20> speed<210>; + turn lknee to x-axis <-60> speed<210>; + turn lshin to x-axis <50> speed<210>; + turn lfoot to x-axis <30> speed<210>; + + turn tail to y-axis <-10> speed <40>; + turn body to z-axis <-5> speed <20>; + turn lthigh to z-axis <5> speed <20>; + turn rthigh to z-axis <5> speed <20>; + move body to y-axis [0.7] speed <4000>; + turn head to x-axis <-10> speed <20>; + turn tail to x-axis <10> speed <20>; + wait-for-turn rthigh around x-axis;} + if (aMoving) { + + turn rthigh to x-axis <-10> speed<160>; + turn rknee to x-axis <15> speed<145>; + turn rshin to x-axis <-60> speed<250>; + turn rfoot to x-axis <30> speed<145>; + + turn lthigh to x-axis <40> speed<145>; + turn lknee to x-axis <-35> speed<145>; + turn lshin to x-axis <-40> speed<145>; + turn lfoot to x-axis <35> speed<145>; + + + move body to y-axis [0] speed <4000>; + turn head to x-axis <10> speed <20>; + turn tail to x-axis <-10> speed <20>; + wait-for-turn rshin around x-axis; + } + + } + return 0; +} + +Halt() +{ + sleep 150; + if(!aMoving) + { + bMoving = FALSE; + turn lfoot to x-axis <0> speed <200>; + turn rfoot to x-axis <0> speed <200>; + turn rthigh to x-axis <0> speed <200>; + turn lthigh to x-axis <0> speed <200>; + turn lshin to x-axis <0> speed <200>; + turn rshin to x-axis <0> speed <200>; + turn lknee to x-axis <0> speed <200>; + turn rknee to x-axis <0> speed <200>; + } +} + +StartMoving() +{ + aMoving = TRUE; + if (!bMoving) + { + start-script Walk(); + } +} + +StopMoving() +{ + aMoving = FALSE; + start-script Halt(); +} + +Create() +{ + emit-sfx 1024+2 from body; +} + +SweetSpot(piecenum) + { piecenum=body; } + +AimFromPrimary(piecenum) + { piecenum=head; } + +AimFromSecondary(piecenum) + { piecenum=head; } + +QueryPrimary(piecenum) + { piecenum=head; } + +QuerySecondary(piecenum) + { piecenum=head; } + +RestoreAfterDelay() + { + sleep 1000; + } + +AimPrimary(heading,pitch) + { + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +AimSecondary(heading,pitch) + { + if ( get IN_WATER(0) == 0 ) + { + return (0); + } + signal SIG_AIM; + set-signal-mask SIG_AIM; + turn head to y-axis heading speed <5000>; + turn head to x-axis 0 -pitch speed <5000>; + + wait-for-turn head around y-axis; + start-script RestoreAfterDelay(); + + return(TRUE); + } + +Shot1() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + +Shot2() + { + turn lsack to y-axis <40> speed [1]; + turn rsack to y-axis <-40> speed [1]; + move rsack to x-axis [-1] speed [1]; + move lsack to x-axis [1] speed [1]; + move mblade to z-axis [-8] speed [100]; + wait-for-turn lsack around y-axis; + turn lsack to y-axis <0> speed [0.3]; + turn rsack to y-axis <0> speed [0.3]; + move rsack to x-axis [0] speed [0.3]; + move lsack to x-axis [0] speed [0.3]; + move mblade to z-axis <0> speed [3]; + } + + +HitByWeaponId() + { + emit-sfx 1024 from body; + return 100; + } + +Killed( severity, corpsetype ) + { + corpsetype = 1; + emit-sfx 1025 from body; + return( 0 ); + } \ No newline at end of file diff --git a/Scripts/zaal/zskirmisher.cob b/Scripts/zaal/zskirmisher.cob new file mode 100644 index 000000000..00de212d4 Binary files /dev/null and b/Scripts/zaal/zskirmisher.cob differ diff --git a/Scripts/zaal/ztenticle_lus.lua b/Scripts/zaal/ztenticle_lus.lua new file mode 100644 index 000000000..19f09c95b --- /dev/null +++ b/Scripts/zaal/ztenticle_lus.lua @@ -0,0 +1,85 @@ +base, point1 = piece('base', 'point1', 'point2') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base}) + StartThread(BuildFX) + building = false + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function BuildFX() + while(building == true) do + --EmitSfx (point1, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(point1, y_axis, 0, 5) + end +end + +------------------------------------------- +------------------------------------------- + +function script.AimFromWeapon1() + --Spring.Echo("AimFromWeapon: FireWeapon") + return point1 +end + +function script.QueryWeapon1() + --Spring.Echo("QueryWeapon: FireWeapon") + return point1 +end + + +function script.AimWeapon1(heading, pitch) + Signal(SIG_AIM) + SetSignalMask(SIG_AIM) + --Spring.Echo("AimWeapon: FireWeapon") + return true +end + +function script.FireWeapon1() + --Spring.Echo("FireWeapon: FireWeapon") + --EmitSfx (point1, 1024) +end + +------------------------------------------- +------------------------------------------- + +local nanoPoints = {} +-- FIXME: this example has 2 nano pieces to alternate between +for i = 1, 2 do + -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model + nanoPoints[i] = piece("point" .. i) +end +Spring.SetUnitNanoPieces(unitID, nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + Turn(point1, y_axis, heading, 100) + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + --Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Scripts/zaal/ztiberium.bos b/Scripts/zaal/ztiberium.bos new file mode 100644 index 000000000..406924272 --- /dev/null +++ b/Scripts/zaal/ztiberium.bos @@ -0,0 +1,43 @@ +#define TA // This is a TA script + +#include "sfxtype.h" +#include "exptype.h" + +piece base; + +SmokeUnit(healthpercent, sleeptime, smoketype) +{ + while( get BUILD_PERCENT_LEFT ) + { + sleep 400; + } + while( TRUE ) + { + healthpercent = get HEALTH; + if( healthpercent < 66 ) + { + smoketype = 256 | 2; + if( Rand( 1, 66 ) < healthpercent ) + { + smoketype = 256 | 1; + } + emit-sfx 1024 from base; + } + sleeptime = healthpercent * 50; + if( sleeptime < 200 ) + { + sleeptime = 200; + } + sleep sleeptime; + } +} + +Create() +{ + start-script SmokeUnit(); +} + +Killed(severity, corpsetype) // how it explodes +{ + corpsetype = 1; +} diff --git a/Scripts/zaal/ztiberium.cob b/Scripts/zaal/ztiberium.cob new file mode 100644 index 000000000..d126d83c9 Binary files /dev/null and b/Scripts/zaal/ztiberium.cob differ diff --git a/Scripts/zaal/ztumor_lus.lua b/Scripts/zaal/ztumor_lus.lua new file mode 100644 index 000000000..62db939f6 --- /dev/null +++ b/Scripts/zaal/ztumor_lus.lua @@ -0,0 +1,58 @@ +base, point1 = piece('base', 'nanopoint1') +local SIG_AIM = {} + +-- state variables +isMoving = "isMoving" +terrainType = "terrainType" + +function script.Create() + StartThread(common.SmokeUnit, {base}) + StartThread(BuildFX) + building = false + Move(base, y_axis, -1, 50) +end + +common = include("headers/common_includes_lus.lua") + +function BuildFX() + while(building == true) do + --EmitSfx (point1, 1024) + Sleep(550) + end +end + +function RestoreAfterDelay() + if building == false then + Sleep(2000) + Turn(point1, y_axis, 0, 5) + end +end + +------------------------------------------- +------------------------------------------- + +------------------------------------------- +------------------------------------------- + +local nanoPoints = piece("nanopoint1") + +Spring.SetUnitNanoPieces(nanoPoints) + +function script.StartBuilding(heading, pitch) + -- TODO: This is where you would add your unpack / point towards animation + Turn(point1, y_axis, heading, 100) + SetUnitValue(COB.INBUILDSTANCE, true) + building = true + StartThread(BuildFX) +end +function script.StopBuilding() + -- TODO: This is where you would add your pack-up animation + SetUnitValue(COB.INBUILDSTANCE, false) + building = false + StartThread(RestoreAfterDelay) +end + +function script.Killed() + --Explode(base, SFX.EXPLODE_ON_HIT) + return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos +end \ No newline at end of file diff --git a/Unit Reassignments.txt b/Unit Reassignments.txt new file mode 100644 index 000000000..d0daae0a3 --- /dev/null +++ b/Unit Reassignments.txt @@ -0,0 +1,38 @@ +No buildings in/on water anymore + +Faction 1 - Remove Hovertank and replace with normal tank + +f1landfac + +Tech1 +eallterrlight +ehbotpeewee +eallterrriot_shotgun +ehbotthud +eallterrassault + +Tech2 +eallterrmed +ehbotsniper +eallterrheavy +ehbotrocko +eallterrshield + + +Faction 2 - Remove Waterweapon1 - Reintroduce slow movement underwater + +ebasefactory + +Tech 1 +eamphibbuggy +elighttank3 +eriottank_shotgun +eamphibneedle +eartytank +ebox + +Tech 2 +eamphibmedtank +eheavytank3 +eamphibrock +emissiletank3 \ No newline at end of file diff --git a/UnitPic Tools/!Add Constripes.exe b/UnitPic Tools/!Add Constripes.exe new file mode 100644 index 000000000..4bb4cef89 Binary files /dev/null and b/UnitPic Tools/!Add Constripes.exe differ diff --git a/UnitPic Tools/!Photoshop Actionset for buildpics - Buildpics.atn b/UnitPic Tools/!Photoshop Actionset for buildpics - Buildpics.atn new file mode 100644 index 000000000..9f2f3e245 Binary files /dev/null and b/UnitPic Tools/!Photoshop Actionset for buildpics - Buildpics.atn differ diff --git a/UnitPic Tools/!Resize buildpics.exe b/UnitPic Tools/!Resize buildpics.exe new file mode 100644 index 000000000..b62dab08b Binary files /dev/null and b/UnitPic Tools/!Resize buildpics.exe differ diff --git a/UnitPic Tools/!buildpic background image.png b/UnitPic Tools/!buildpic background image.png new file mode 100644 index 000000000..21c1c8a43 Binary files /dev/null and b/UnitPic Tools/!buildpic background image.png differ diff --git a/UnitPic Tools/constripe frame.png b/UnitPic Tools/constripe frame.png new file mode 100644 index 000000000..4a76eddb6 Binary files /dev/null and b/UnitPic Tools/constripe frame.png differ diff --git a/UnitPic Tools/lozengineer.png b/UnitPic Tools/lozengineer.png new file mode 100644 index 000000000..b3a034ca8 Binary files /dev/null and b/UnitPic Tools/lozengineer.png differ diff --git a/UnitTextures/ad0_pine_1.tga b/UnitTextures/ad0_pine_1.tga new file mode 100644 index 000000000..08be10220 Binary files /dev/null and b/UnitTextures/ad0_pine_1.tga differ diff --git a/UnitTextures/ad0_pine_2.tga b/UnitTextures/ad0_pine_2.tga new file mode 100644 index 000000000..faacff02c Binary files /dev/null and b/UnitTextures/ad0_pine_2.tga differ diff --git a/UnitTextures/ammobox2.png b/UnitTextures/ammobox2.png index adbe4f203..93fffa315 100644 Binary files a/UnitTextures/ammobox2.png and b/UnitTextures/ammobox2.png differ diff --git a/UnitTextures/ammobox2glowy.png b/UnitTextures/ammobox2glowy.png index 4cab32f04..200a72c50 100644 Binary files a/UnitTextures/ammobox2glowy.png and b/UnitTextures/ammobox2glowy.png differ diff --git a/UnitTextures/apexchicken.dds b/UnitTextures/apexchicken.dds new file mode 100644 index 000000000..6132c28ee Binary files /dev/null and b/UnitTextures/apexchicken.dds differ diff --git a/UnitTextures/aquachicken.dds b/UnitTextures/aquachicken.dds new file mode 100644 index 000000000..beef4e324 Binary files /dev/null and b/UnitTextures/aquachicken.dds differ diff --git a/UnitTextures/bfaction_normals.dds b/UnitTextures/bfaction_normals.dds new file mode 100644 index 000000000..cc8d42749 Binary files /dev/null and b/UnitTextures/bfaction_normals.dds differ diff --git a/UnitTextures/bfaction_tex1.dds b/UnitTextures/bfaction_tex1.dds new file mode 100644 index 000000000..7aada7911 Binary files /dev/null and b/UnitTextures/bfaction_tex1.dds differ diff --git a/UnitTextures/bfaction_tex2.dds b/UnitTextures/bfaction_tex2.dds new file mode 100644 index 000000000..c5e23dbc1 Binary files /dev/null and b/UnitTextures/bfaction_tex2.dds differ diff --git a/UnitTextures/blackchicken.dds b/UnitTextures/blackchicken.dds new file mode 100644 index 000000000..41d544235 Binary files /dev/null and b/UnitTextures/blackchicken.dds differ diff --git a/UnitTextures/blank_normal.tga b/UnitTextures/blank_normal.tga new file mode 100644 index 000000000..afb0e3f90 Binary files /dev/null and b/UnitTextures/blank_normal.tga differ diff --git a/UnitTextures/bluechicken.dds b/UnitTextures/bluechicken.dds new file mode 100644 index 000000000..a5912f457 Binary files /dev/null and b/UnitTextures/bluechicken.dds differ diff --git a/UnitTextures/brownchicken.dds b/UnitTextures/brownchicken.dds new file mode 100644 index 000000000..ffa8aee0b Binary files /dev/null and b/UnitTextures/brownchicken.dds differ diff --git a/UnitTextures/chicken1.dds b/UnitTextures/chicken1.dds new file mode 100644 index 000000000..affbd4fda Binary files /dev/null and b/UnitTextures/chicken1.dds differ diff --git a/UnitTextures/chicken1b.dds b/UnitTextures/chicken1b.dds new file mode 100644 index 000000000..a0ae30690 Binary files /dev/null and b/UnitTextures/chicken1b.dds differ diff --git a/UnitTextures/chicken1c.dds b/UnitTextures/chicken1c.dds new file mode 100644 index 000000000..120f4733b Binary files /dev/null and b/UnitTextures/chicken1c.dds differ diff --git a/UnitTextures/chicken1d.dds b/UnitTextures/chicken1d.dds new file mode 100644 index 000000000..dfca57d7b Binary files /dev/null and b/UnitTextures/chicken1d.dds differ diff --git a/UnitTextures/chicken1x.dds b/UnitTextures/chicken1x.dds new file mode 100644 index 000000000..0ae7dbc26 Binary files /dev/null and b/UnitTextures/chicken1x.dds differ diff --git a/UnitTextures/chicken1y.dds b/UnitTextures/chicken1y.dds new file mode 100644 index 000000000..16f5190c6 Binary files /dev/null and b/UnitTextures/chicken1y.dds differ diff --git a/UnitTextures/chicken1z.dds b/UnitTextures/chicken1z.dds new file mode 100644 index 000000000..8fe3a6771 Binary files /dev/null and b/UnitTextures/chicken1z.dds differ diff --git a/UnitTextures/chicken2.dds b/UnitTextures/chicken2.dds new file mode 100644 index 000000000..d42dec432 Binary files /dev/null and b/UnitTextures/chicken2.dds differ diff --git a/UnitTextures/chicken2b.dds b/UnitTextures/chicken2b.dds new file mode 100644 index 000000000..298a76a7a Binary files /dev/null and b/UnitTextures/chicken2b.dds differ diff --git a/UnitTextures/chickenc3.dds b/UnitTextures/chickenc3.dds new file mode 100644 index 000000000..ce72da910 Binary files /dev/null and b/UnitTextures/chickenc3.dds differ diff --git a/UnitTextures/chickenc3b.dds b/UnitTextures/chickenc3b.dds new file mode 100644 index 000000000..839d60419 Binary files /dev/null and b/UnitTextures/chickenc3b.dds differ diff --git a/UnitTextures/chickenc3c.dds b/UnitTextures/chickenc3c.dds new file mode 100644 index 000000000..014701dbb Binary files /dev/null and b/UnitTextures/chickenc3c.dds differ diff --git a/UnitTextures/chickenegg.dds b/UnitTextures/chickenegg.dds new file mode 100644 index 000000000..1627a9eda Binary files /dev/null and b/UnitTextures/chickenegg.dds differ diff --git a/UnitTextures/chickeneggb.dds b/UnitTextures/chickeneggb.dds new file mode 100644 index 000000000..13ef45259 Binary files /dev/null and b/UnitTextures/chickeneggb.dds differ diff --git a/UnitTextures/chickeneggc.dds b/UnitTextures/chickeneggc.dds new file mode 100644 index 000000000..8d3234ffc Binary files /dev/null and b/UnitTextures/chickeneggc.dds differ diff --git a/UnitTextures/chickeneggd.dds b/UnitTextures/chickeneggd.dds new file mode 100644 index 000000000..03309fd2d Binary files /dev/null and b/UnitTextures/chickeneggd.dds differ diff --git a/UnitTextures/chickeneggred.dds b/UnitTextures/chickeneggred.dds new file mode 100644 index 000000000..45066de3e Binary files /dev/null and b/UnitTextures/chickeneggred.dds differ diff --git a/UnitTextures/chickeneggyellow.dds b/UnitTextures/chickeneggyellow.dds new file mode 100644 index 000000000..ad628cf4a Binary files /dev/null and b/UnitTextures/chickeneggyellow.dds differ diff --git a/UnitTextures/chickengroundplate.dds b/UnitTextures/chickengroundplate.dds new file mode 100644 index 000000000..5574b10ff Binary files /dev/null and b/UnitTextures/chickengroundplate.dds differ diff --git a/UnitTextures/crimsonchicken.dds b/UnitTextures/crimsonchicken.dds new file mode 100644 index 000000000..144945089 Binary files /dev/null and b/UnitTextures/crimsonchicken.dds differ diff --git a/UnitTextures/crystal.png b/UnitTextures/crystal.png new file mode 100644 index 000000000..873aed52b Binary files /dev/null and b/UnitTextures/crystal.png differ diff --git a/UnitTextures/default_tree_normal.tga b/UnitTextures/default_tree_normal.tga new file mode 100644 index 000000000..38953b670 Binary files /dev/null and b/UnitTextures/default_tree_normal.tga differ diff --git a/UnitTextures/desktop.ini b/UnitTextures/desktop.ini new file mode 100644 index 000000000..95f0b5ac1 Binary files /dev/null and b/UnitTextures/desktop.ini differ diff --git a/UnitTextures/greenchicken.dds b/UnitTextures/greenchicken.dds new file mode 100644 index 000000000..3abfeb888 Binary files /dev/null and b/UnitTextures/greenchicken.dds differ diff --git a/UnitTextures/greenchicken_normals.dds b/UnitTextures/greenchicken_normals.dds new file mode 100644 index 000000000..eb6da4b44 Binary files /dev/null and b/UnitTextures/greenchicken_normals.dds differ diff --git a/UnitTextures/greenchickenglowy.dds b/UnitTextures/greenchickenglowy.dds new file mode 100644 index 000000000..b0bee0b12 Binary files /dev/null and b/UnitTextures/greenchickenglowy.dds differ diff --git a/UnitTextures/greyrock2.tga b/UnitTextures/greyrock2.tga new file mode 100644 index 000000000..20c10b452 Binary files /dev/null and b/UnitTextures/greyrock2.tga differ diff --git a/UnitTextures/groundplate.dds b/UnitTextures/groundplate.dds new file mode 100644 index 000000000..1d032875e Binary files /dev/null and b/UnitTextures/groundplate.dds differ diff --git a/UnitTextures/lego2skin_explorer - backup.png b/UnitTextures/lego2skin_explorer - backup.png deleted file mode 100644 index e485b4854..000000000 Binary files a/UnitTextures/lego2skin_explorer - backup.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorer - backup2.png b/UnitTextures/lego2skin_explorer - backup2.png deleted file mode 100644 index 174a1178b..000000000 Binary files a/UnitTextures/lego2skin_explorer - backup2.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorer-alt.dds b/UnitTextures/lego2skin_explorer-alt.dds deleted file mode 100644 index 4ac0baee0..000000000 Binary files a/UnitTextures/lego2skin_explorer-alt.dds and /dev/null differ diff --git a/UnitTextures/lego2skin_explorer.dds b/UnitTextures/lego2skin_explorer.dds index b9d45c32d..cd3a069cf 100644 Binary files a/UnitTextures/lego2skin_explorer.dds and b/UnitTextures/lego2skin_explorer.dds differ diff --git a/UnitTextures/lego2skin_explorer.png b/UnitTextures/lego2skin_explorer.png deleted file mode 100644 index 447dc9250..000000000 Binary files a/UnitTextures/lego2skin_explorer.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorer512.png b/UnitTextures/lego2skin_explorer512.png deleted file mode 100644 index 1fbcaf99a..000000000 Binary files a/UnitTextures/lego2skin_explorer512.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorerbumpmap.png b/UnitTextures/lego2skin_explorerbumpmap.png deleted file mode 100644 index 150d02a4f..000000000 Binary files a/UnitTextures/lego2skin_explorerbumpmap.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorerglowy - backup.png b/UnitTextures/lego2skin_explorerglowy - backup.png deleted file mode 100644 index ed09b3068..000000000 Binary files a/UnitTextures/lego2skin_explorerglowy - backup.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorerglowy-alt.dds b/UnitTextures/lego2skin_explorerglowy-alt.dds deleted file mode 100644 index a717936e0..000000000 Binary files a/UnitTextures/lego2skin_explorerglowy-alt.dds and /dev/null differ diff --git a/UnitTextures/lego2skin_explorerglowy.dds b/UnitTextures/lego2skin_explorerglowy.dds index aaa349eae..af8644b20 100644 Binary files a/UnitTextures/lego2skin_explorerglowy.dds and b/UnitTextures/lego2skin_explorerglowy.dds differ diff --git a/UnitTextures/lego2skin_explorerglowy.png b/UnitTextures/lego2skin_explorerglowy.png deleted file mode 100644 index b7913deb4..000000000 Binary files a/UnitTextures/lego2skin_explorerglowy.png and /dev/null differ diff --git a/UnitTextures/lego2skin_explorernormal-alt.dds b/UnitTextures/lego2skin_explorernormal-alt.dds deleted file mode 100644 index b0d9aae1a..000000000 Binary files a/UnitTextures/lego2skin_explorernormal-alt.dds and /dev/null differ diff --git a/UnitTextures/lego2skin_explorernormal.png b/UnitTextures/lego2skin_explorernormal.png deleted file mode 100644 index 4b57b80f3..000000000 Binary files a/UnitTextures/lego2skin_explorernormal.png and /dev/null differ diff --git a/UnitTextures/meat.dds b/UnitTextures/meat.dds new file mode 100644 index 000000000..d3dff5def Binary files /dev/null and b/UnitTextures/meat.dds differ diff --git a/UnitTextures/multichicken.dds b/UnitTextures/multichicken.dds new file mode 100644 index 000000000..c477c9f6e Binary files /dev/null and b/UnitTextures/multichicken.dds differ diff --git a/UnitTextures/pinkchicken.dds b/UnitTextures/pinkchicken.dds new file mode 100644 index 000000000..d1e16dc30 Binary files /dev/null and b/UnitTextures/pinkchicken.dds differ diff --git a/UnitTextures/redchicken.dds b/UnitTextures/redchicken.dds new file mode 100644 index 000000000..f32bce8ac Binary files /dev/null and b/UnitTextures/redchicken.dds differ diff --git a/UnitTextures/redchickenb.dds b/UnitTextures/redchickenb.dds new file mode 100644 index 000000000..4ac6b5b2d Binary files /dev/null and b/UnitTextures/redchickenb.dds differ diff --git a/UnitTextures/redchickenc.dds b/UnitTextures/redchickenc.dds new file mode 100644 index 000000000..fcfe40071 Binary files /dev/null and b/UnitTextures/redchickenc.dds differ diff --git a/UnitTextures/redhead4.dds b/UnitTextures/redhead4.dds new file mode 100644 index 000000000..1c8f317c7 Binary files /dev/null and b/UnitTextures/redhead4.dds differ diff --git a/UnitTextures/scavbeacon.dds b/UnitTextures/scavbeacon.dds new file mode 100644 index 000000000..224f384c9 Binary files /dev/null and b/UnitTextures/scavbeacon.dds differ diff --git a/UnitTextures/scavbeacon2.dds b/UnitTextures/scavbeacon2.dds new file mode 100644 index 000000000..eb8c973a1 Binary files /dev/null and b/UnitTextures/scavbeacon2.dds differ diff --git a/UnitTextures/scavbeacon_normals.dds b/UnitTextures/scavbeacon_normals.dds new file mode 100644 index 000000000..6f8dadfd7 Binary files /dev/null and b/UnitTextures/scavbeacon_normals.dds differ diff --git a/UnitTextures/scavbeacondropped.png b/UnitTextures/scavbeacondropped.png new file mode 100644 index 000000000..3b229e8fe Binary files /dev/null and b/UnitTextures/scavbeacondropped.png differ diff --git a/UnitTextures/scavbeacondropped2.png b/UnitTextures/scavbeacondropped2.png new file mode 100644 index 000000000..d4ee0d7ec Binary files /dev/null and b/UnitTextures/scavbeacondropped2.png differ diff --git a/UnitTextures/scavcrate.png b/UnitTextures/scavcrate.png new file mode 100644 index 000000000..93fffa315 Binary files /dev/null and b/UnitTextures/scavcrate.png differ diff --git a/UnitTextures/scavcrate2.png b/UnitTextures/scavcrate2.png new file mode 100644 index 000000000..200a72c50 Binary files /dev/null and b/UnitTextures/scavcrate2.png differ diff --git a/UnitTextures/sgreyrock1.tga b/UnitTextures/sgreyrock1.tga new file mode 100644 index 000000000..883ffbb17 Binary files /dev/null and b/UnitTextures/sgreyrock1.tga differ diff --git a/UnitTextures/tatex/Thumbs.db b/UnitTextures/tatex/Thumbs.db deleted file mode 100644 index 7374d74cc..000000000 Binary files a/UnitTextures/tatex/Thumbs.db and /dev/null differ diff --git a/UnitTextures/texgroups.cfg b/UnitTextures/texgroups.cfg new file mode 100644 index 000000000..95f0b5ac1 Binary files /dev/null and b/UnitTextures/texgroups.cfg differ diff --git a/UnitTextures/vcrimsonchicken.dds b/UnitTextures/vcrimsonchicken.dds new file mode 100644 index 000000000..ec62328ca Binary files /dev/null and b/UnitTextures/vcrimsonchicken.dds differ diff --git a/UnitTextures/whitechicken.dds b/UnitTextures/whitechicken.dds new file mode 100644 index 000000000..4ebbca8b2 Binary files /dev/null and b/UnitTextures/whitechicken.dds differ diff --git a/UnitTextures/whitechickenhc.dds b/UnitTextures/whitechickenhc.dds new file mode 100644 index 000000000..97ef348a2 Binary files /dev/null and b/UnitTextures/whitechickenhc.dds differ diff --git a/UnitTextures/xmasball.dds b/UnitTextures/xmasball.dds new file mode 100644 index 000000000..4f6afd347 Binary files /dev/null and b/UnitTextures/xmasball.dds differ diff --git a/UnitTextures/xmasball2.dds b/UnitTextures/xmasball2.dds new file mode 100644 index 000000000..bf3b4b66a Binary files /dev/null and b/UnitTextures/xmasball2.dds differ diff --git a/UnitTextures/yellowchicken.dds b/UnitTextures/yellowchicken.dds new file mode 100644 index 000000000..8e450f7c5 Binary files /dev/null and b/UnitTextures/yellowchicken.dds differ diff --git a/UnitTextures/yellowchickenb.dds b/UnitTextures/yellowchickenb.dds new file mode 100644 index 000000000..f8ff3b286 Binary files /dev/null and b/UnitTextures/yellowchickenb.dds differ diff --git a/UnitTextures/z_glowy.dds b/UnitTextures/z_glowy.dds new file mode 100644 index 000000000..ae0493f0a Binary files /dev/null and b/UnitTextures/z_glowy.dds differ diff --git a/UnitTextures/z_normals.dds b/UnitTextures/z_normals.dds new file mode 100644 index 000000000..eb6da4b44 Binary files /dev/null and b/UnitTextures/z_normals.dds differ diff --git a/UnitTextures/zarm.dds b/UnitTextures/zarm.dds new file mode 100644 index 000000000..dfe34e2c9 Binary files /dev/null and b/UnitTextures/zarm.dds differ diff --git a/UnitTextures/zarm_normals.dds b/UnitTextures/zarm_normals.dds new file mode 100644 index 000000000..71259b916 Binary files /dev/null and b/UnitTextures/zarm_normals.dds differ diff --git a/UnitTextures/zarmglowy.dds b/UnitTextures/zarmglowy.dds new file mode 100644 index 000000000..596b5b7ba Binary files /dev/null and b/UnitTextures/zarmglowy.dds differ diff --git a/UnitTextures/zblack.dds b/UnitTextures/zblack.dds new file mode 100644 index 000000000..41d544235 Binary files /dev/null and b/UnitTextures/zblack.dds differ diff --git a/UnitTextures/zblue.dds b/UnitTextures/zblue.dds new file mode 100644 index 000000000..1b503226b Binary files /dev/null and b/UnitTextures/zblue.dds differ diff --git a/UnitTextures/zcrimson.dds b/UnitTextures/zcrimson.dds new file mode 100644 index 000000000..144945089 Binary files /dev/null and b/UnitTextures/zcrimson.dds differ diff --git a/UnitTextures/zespire1.dds b/UnitTextures/zespire1.dds new file mode 100644 index 000000000..c424ae6a8 Binary files /dev/null and b/UnitTextures/zespire1.dds differ diff --git a/UnitTextures/zespire1_glowy.dds b/UnitTextures/zespire1_glowy.dds new file mode 100644 index 000000000..9e268ce5f Binary files /dev/null and b/UnitTextures/zespire1_glowy.dds differ diff --git a/UnitTextures/zespire1_normals.dds b/UnitTextures/zespire1_normals.dds new file mode 100644 index 000000000..41a942e07 Binary files /dev/null and b/UnitTextures/zespire1_normals.dds differ diff --git a/UnitTextures/zespire4.dds b/UnitTextures/zespire4.dds new file mode 100644 index 000000000..da49ec168 Binary files /dev/null and b/UnitTextures/zespire4.dds differ diff --git a/UnitTextures/zespire4_glowy.dds b/UnitTextures/zespire4_glowy.dds new file mode 100644 index 000000000..5e99d1cd3 Binary files /dev/null and b/UnitTextures/zespire4_glowy.dds differ diff --git a/UnitTextures/zespire4_normals.dds b/UnitTextures/zespire4_normals.dds new file mode 100644 index 000000000..6f8276bd2 Binary files /dev/null and b/UnitTextures/zespire4_normals.dds differ diff --git a/UnitTextures/zespire5.dds b/UnitTextures/zespire5.dds new file mode 100644 index 000000000..5cac43f5d Binary files /dev/null and b/UnitTextures/zespire5.dds differ diff --git a/UnitTextures/zespire5_glowy.dds b/UnitTextures/zespire5_glowy.dds new file mode 100644 index 000000000..f454271b2 Binary files /dev/null and b/UnitTextures/zespire5_glowy.dds differ diff --git a/UnitTextures/zespire5_normals.dds b/UnitTextures/zespire5_normals.dds new file mode 100644 index 000000000..7d7e005fb Binary files /dev/null and b/UnitTextures/zespire5_normals.dds differ diff --git a/UnitTextures/zgreen.dds b/UnitTextures/zgreen.dds new file mode 100644 index 000000000..3abfeb888 Binary files /dev/null and b/UnitTextures/zgreen.dds differ diff --git a/UnitTextures/zgreengray.dds b/UnitTextures/zgreengray.dds new file mode 100644 index 000000000..652837f14 Binary files /dev/null and b/UnitTextures/zgreengray.dds differ diff --git a/UnitTextures/zgroundtexture-hirez.dds b/UnitTextures/zgroundtexture-hirez.dds new file mode 100644 index 000000000..26047898b Binary files /dev/null and b/UnitTextures/zgroundtexture-hirez.dds differ diff --git a/UnitTextures/zgroundtexture-hirez2.dds b/UnitTextures/zgroundtexture-hirez2.dds new file mode 100644 index 000000000..4b8467ca3 Binary files /dev/null and b/UnitTextures/zgroundtexture-hirez2.dds differ diff --git a/UnitTextures/zgroundtexture.dds b/UnitTextures/zgroundtexture.dds new file mode 100644 index 000000000..3f1e06d05 Binary files /dev/null and b/UnitTextures/zgroundtexture.dds differ diff --git a/UnitTextures/zgroundtexture2.dds b/UnitTextures/zgroundtexture2.dds new file mode 100644 index 000000000..569ad18ef Binary files /dev/null and b/UnitTextures/zgroundtexture2.dds differ diff --git a/UnitTextures/zhive.dds b/UnitTextures/zhive.dds new file mode 100644 index 000000000..d6257522d Binary files /dev/null and b/UnitTextures/zhive.dds differ diff --git a/UnitTextures/zhive_normals.dds b/UnitTextures/zhive_normals.dds new file mode 100644 index 000000000..74970c493 Binary files /dev/null and b/UnitTextures/zhive_normals.dds differ diff --git a/UnitTextures/zhiveglowy.dds b/UnitTextures/zhiveglowy.dds new file mode 100644 index 000000000..b7b74441e Binary files /dev/null and b/UnitTextures/zhiveglowy.dds differ diff --git a/UnitTextures/zpurple.dds b/UnitTextures/zpurple.dds new file mode 100644 index 000000000..0eb4204a1 Binary files /dev/null and b/UnitTextures/zpurple.dds differ diff --git a/UnitTextures/zred.dds b/UnitTextures/zred.dds new file mode 100644 index 000000000..074a96b4b Binary files /dev/null and b/UnitTextures/zred.dds differ diff --git a/UnitTextures/zred2.dds b/UnitTextures/zred2.dds new file mode 100644 index 000000000..a53daebb3 Binary files /dev/null and b/UnitTextures/zred2.dds differ diff --git a/UnitTextures/ztiberium.dds b/UnitTextures/ztiberium.dds new file mode 100644 index 000000000..5da86ec06 Binary files /dev/null and b/UnitTextures/ztiberium.dds differ diff --git a/UnitTextures/ztiberium_glowy.dds b/UnitTextures/ztiberium_glowy.dds new file mode 100644 index 000000000..1f5ce95f9 Binary files /dev/null and b/UnitTextures/ztiberium_glowy.dds differ diff --git a/UnitTextures/ztiberium_normals.dds b/UnitTextures/ztiberium_normals.dds new file mode 100644 index 000000000..edb9265fc Binary files /dev/null and b/UnitTextures/ztiberium_normals.dds differ diff --git a/UnitTextures/ztumor.dds b/UnitTextures/ztumor.dds new file mode 100644 index 000000000..4f784ab20 Binary files /dev/null and b/UnitTextures/ztumor.dds differ diff --git a/UnitTextures/ztumor.psd b/UnitTextures/ztumor.psd new file mode 100644 index 000000000..4b4b051fa Binary files /dev/null and b/UnitTextures/ztumor.psd differ diff --git a/UnitTextures/ztumor_glowy.dds b/UnitTextures/ztumor_glowy.dds new file mode 100644 index 000000000..676fa2532 Binary files /dev/null and b/UnitTextures/ztumor_glowy.dds differ diff --git a/UnitTextures/ztumor_normals.dds b/UnitTextures/ztumor_normals.dds new file mode 100644 index 000000000..e2cbbc702 Binary files /dev/null and b/UnitTextures/ztumor_normals.dds differ diff --git a/UnitTextures/zwhite.dds b/UnitTextures/zwhite.dds new file mode 100644 index 000000000..4ac8aa44e Binary files /dev/null and b/UnitTextures/zwhite.dds differ diff --git a/UnitTextures/zyellow.dds b/UnitTextures/zyellow.dds new file mode 100644 index 000000000..679332224 Binary files /dev/null and b/UnitTextures/zyellow.dds differ diff --git a/Units-Configs-Basedefs/basedefs/Faction 2/f2engineer_basedef.lua b/Units-Configs-Basedefs/basedefs/Faction 2/f2engineer_basedef.lua new file mode 100644 index 000000000..7b9d58713 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/Faction 2/f2engineer_basedef.lua @@ -0,0 +1,103 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildpic = "lozengineer.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + canBuild = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + footprintX = 2, + footprintZ = 2, + iconType = "engineer", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = maxDamage, + maxVelocity = 4.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, --Because he was the first one to get the "Lobster" pun + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = false, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 250, + unitname = unitName, + workerTime = 1, + capturespeed = 1, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildListLoz, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = [[tech0]], + canbetransported = "true", + death_sounds = "generic", + armortype = armortype, + nofriendlyfire = "1", + noenergycost = true, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "Loz Alliance", + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/air/eairemp_basedef.lua b/Units-Configs-Basedefs/basedefs/air/eairemp_basedef.lua new file mode 100644 index 000000000..a9957bc82 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/eairemp_basedef.lua @@ -0,0 +1,193 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 86, + builder = false, + buildTime = 2.5, + buildpic = "escout.png", + canAttack = true, + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL", + collide = false, + cruiseAlt = 160, + description = [[EMP Attack Craft]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + hoverAttack = false, + floater = true, + iconType = "scout", + idleAutoHeal = .5, + idleTime = 2200, + loopbackattack = true, + maxAcc = 1, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + maxDamage = 640, + maxSlope = 90, + maxVelocity = 10, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "ARM", + sightDistance = 1500, + smoothAnim = true, + stealth = false, + transportbyenemy = false; + turnRate = 5000, + turnRadius = 250, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + explosiongenerators = { + "custom:gdhcannon", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "missile", + badTargetCategory = "ARMORED LIGHT VTOL", + mainDir = "0 0 1", + maxAngleDif = 90, + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 1, + isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + missile = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + commandfire = true, + cegTag = "emptrail-optimized", + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + energypershot = 0, + edgeEffectiveness = 0.1, + fireStarter = 70, + + id = 136, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "missile.s3o", + name = "Rockets", + range = 750, + reloadtime = 30, + weaponType = "MissileLauncher", + + paralyzer = true, + paralyzetime = 10, + + smokeTrail = false, + soundHit = "explosions/unitexplodebig.wav", + soundHitWet = "explosions/subhitbomb.wav", + soundHitVolume = 10, + soundStart = "weapons/bomberlaunch.wav", + soundStartVolume = 10, + + startVelocity = 500, + tolerance = 5000, + turnRate = 10000, + tracks = false, + turret = false, + weaponAcceleration = 10, + waterweapon = true, + flightTime = 10, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 5000, + }, + }, + + airraider = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + colorMap = "1 0.5 1 1 1 0.5 1 1 1 0.5 1 1 1 0.5 1 0.01", + stages = 1, + cegTag = "airraidershot", + explosionGenerator = "custom:genericshellexplosion-medium-blue", + energypershot = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + name = unitName .. "Weapon", + paralyzer = true, + paralyzetime = 2.5, + range = 300, + reloadtime = 0.1, + size = 3, + weaponType = "Cannon", + soundstart = "weapons/tmediumtankfire.wav", + sprayangle = 2500, + tolerance = 10000, + turret = true, + weaponVelocity = 750, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 15, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua b/Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua new file mode 100644 index 000000000..41a49c78e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua @@ -0,0 +1,93 @@ +unitDef = { + activatewhenbuilt = true, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 2.5, + buildpic = "eairplant.png", + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canstop = true, + category = "BUILDING NOTAIR VTOL", + description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]], + energyStorage = 0, + energyUse = 0, + energyMake = 0, + explodeAs = "hugeBuildingExplosionGenericRed", + floater = true, + footprintX = 9, + footprintZ = 9, + iconType = "factory", + idleAutoHeal = .5, + idleTime = 2200, + levelground = false, + maxDamage = maxDamage, + maxSlope = 90, + maxWaterDepth = 999999, + metalStorage = 0, + metalMake = 0, + mobilestandorders = "1", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericRed", + showNanoSpray = true, + sightDistance = 388, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + unitnumber = "83", + workerTime = 1, + yardMap = "oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo", + -- usePieceCollisionVolumes = true, + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:nano", + "custom:blacksmoke", + "custom:fusionreactionbasic", + "custom:airfactoryhtrail", + }, + }, + zbuffer = "1", + + buildoptions = airPlantBuildList, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdfactoryselect", + }, + }, + customParams = { + unittype = "factory", + death_sounds = "generic", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + -- ProvideTech = "1 Powergrid", + -- ProvideTechRange = "1500", + -- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", + -- groundtexselectxsize = 1500, -- optional + -- groundtexselectzsize = 1500, -- optional + }, + -- useGroundDecal = true, + -- BuildingGroundDecalType = "factorygroundplate.dds", + -- BuildingGroundDecalSizeX = 20, + -- BuildingGroundDecalSizeY = 20, + -- BuildingGroundDecalDecaySpeed = 0.9, +} diff --git a/Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua b/Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua new file mode 100644 index 000000000..c5b0c6d5f --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua @@ -0,0 +1,200 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 60, + builder = false, + buildTime = 2.5, + buildpic = "ebomber.png", + canAttack = true, + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRARMORED VTOL", + collide = true, + cruiseAlt = 400, + description = [[Bomber]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGeneric", + footprintX = 2, + footprintZ = 2, + floater = true, + hoverAttack = false, + iconType = "air_bomb", + idleAutoHeal = .5, + idleTime = 2200, + loopbackattack = true, + maxacc = 1, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + maxDamage = 670, + maxSlope = 90, + maxVelocity = 13, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + repairable = false, + selfDestructAs = "largeExplosionGeneric", + side = "CORE", + sightDistance = 400, + smoothAnim = true, + stealth = false, + transportbyenemy = false; + turnRate = 5000, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jethtrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "bomb", + onlyTargetCategory = "BUILDING", + noChaseCategory = "VTOL LIGHT ARMORED", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "generic", + nofriendlyfire = "1", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + + missile = { + AreaOfEffect = 300, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "bombertrail-optimized", + explosionGenerator = "custom:genericshellexplosion-large-red", + energypershot = 0, + edgeEffectiveness = 0.1, + fireStarter = 70, + + id = 136, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "missile.s3o", + name = "Rockets", + range = 800, + reloadtime = 6, + weaponType = "MissileLauncher", + + smokeTrail = false, + soundHit = "other/18402_inferno_xplo.wav", + soundHitWet = "explosions/subhitbomb.wav", + soundHitVolume = 10, + soundStart = "weapons/bomberlaunch.wav", + soundStartVolume = 10, + + startVelocity = 200, + tolerance = 8000, + turnRate = 15000, + tracks = false, + turret = false, + weaponAcceleration = 50, + waterweapon = true, + flightTime = 10, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuilding", + nofriendlyfire = 1, + }, + damage = { + default = 500, + }, + }, + + bomb = { + AreaOfEffect = 150, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + cylinderTargeting = 0, + burst = 10, + burstrate = 0.1, + cegTag = "genericshellexplosion-large-sparks-burn", + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-red", + fallOffRate = 1, + fireStarter = 50, + impulseFactor = 0, + minintensity = "1", + name = "Cluster Bomb", + range = 1000, + reloadtime = 6, + WeaponType = "Cannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/bombdrop.wav", + soundHit = "other/18402_inferno_xplo.wav", + soundHitWet = "explosions/subhitbomb.wav", + sprayangle = 5000, + size = 4, + --texture1 = "shot", + --texture2 = "empty", + thickness = 15, + tolerance = 7500, + turret = false, + weaponVelocity = 150, + customparams = { + damagetype = "antibuilding", + isupgraded = isUpgraded, + nofriendlyfire = 1, + }, + damage = { + default = 100, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/edrone_basedef.lua b/Units-Configs-Basedefs/basedefs/air/edrone_basedef.lua new file mode 100644 index 000000000..abdf4aa3a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/edrone_basedef.lua @@ -0,0 +1,159 @@ +unitDef = { + acceleration = 0.5, + airStrafe = true, + bankscale = "1", + brakeRate = 0.7, + buildCostEnergy = 0, + buildCostMetal = 33, + buildTime = 2.5, + buildpic = "edrone.png", + canAttack = true, + canDropFlare = false, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL DRONE", + collide = false, + cruiseAlt = 75, + description = [[Harassment Specialist Drone]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericPurple", + flareDelay = 0.1, + flareDropVector = "0 0 -1", + flareefficieny = "0.3", + flareReload = 3, + footprintX = 2, + footprintZ = 2, + hoverAttack = true, + iconType = "drone", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 560, + maxSlope = 90, + maxVelocity = 11, + --verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericPurple", + side = "CORE", + sightDistance = 500, + SonarDistance = 500, + smoothAnim = true, + stealth = true, + turnRate = 5000, + unitname = unitName, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jetstrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "droneweapon", + badTargetCategory = "LIGHT ARMORED", + }, + }, + customParams = { + unittype = "mobile", + isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + supply_cost = supply, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + retreatRangeDAI = 0, + }, +} + + +-------------------------------------------------------------------------------- + +weaponDefs = { + droneweapon = { + --accuracy = 500, + AreaOfEffect = 25, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.5, + beamTime = 0.1, + beamTTL = 10, + beamDecay = 1, + burnblow = true, + largeBeamLaser = true, + laserflaresize = 7, + minIntensity = 1, + --cegTag = "railgun", + duration = 0.6, + edgeeffectiveness = 1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-sparks-burn", + fallOffRate = 0.1, + fireStarter = 50, + impulseFactor = 0, + fallOffRate = 0, + interceptedByShieldType = 4, + minintensity = 1, + name = unitName .. "Weapon", + range = 300, + reloadtime = 0.5, + WeaponType = "BeamLaser", + waterweapon = true, + rgbColor = "0.1 0.5 0.2", + rgbColor2 = "0 1 0", + soundTrigger = true, + soundstart = "weapons/18389_inferno_medlas.wav", + --soundHit = "explosions/artyhit.wav", + texture1 = "lightning", + texture2 = "laserend", + thickness = 5, + tolerance = 10000, + turret = true, + weaponVelocity = 750, + customparams = { + damagetype = "light", + isupgraded = isUpgraded, + }, + damage = { + default = 15, + }, + }, +} +unitDef.weaponDefs = weaponDefs + + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/air/efighter_basedef.lua b/Units-Configs-Basedefs/basedefs/air/efighter_basedef.lua new file mode 100644 index 000000000..88769940e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/efighter_basedef.lua @@ -0,0 +1,145 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 53, + buildTime = 2.5, + buildpic = "efighter.png", + canAttack = true, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRLIGHT VTOL", + collide = true, + cruiseAlt = 140, + description = [[Light Gunship]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericWhite", + floater = true, + footprintX = 2, + footprintZ = 2, + hoverAttack = false, + iconType = "air_lit", + idleAutoHeal = .5, + idleTime = 2200, + maxacc = 1, + maxDamage = 812, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + maxSlope = 90, + maxVelocity = 12, + maxWaterDepth = 255, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericWhite", + side = "ARM", + sightDistance = 1000, + smoothAnim = true, + sonarDistance = 0, + transportbyenemy = false; + turnRate = 5000, + turnradius = 250, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:jethtrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "aircannon", + badTargetCategory = "ARMORED BUILDING VTOL", + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + aircannon = { + AreaOfEffect = 100, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.5, + burnblow = true, + --cegTag = "railgun", + duration = 0.05, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + fallOffRate = 1, + fireStarter = 50, + impulseFactor = 0, + minintensity = "1", + name = "Laser", + range = 500, + reloadtime = 0.1, + WeaponType = "Cannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "other/ejerikfiresingle.wav", + sprayangle = 1000, + size = 4, + --texture1 = "shot", + --texture2 = "empty", + thickness = 15, + tolerance = 7500, + turret = false, + weaponVelocity = 1250, + customparams = { + damagetype = "light", + isupgraded = isUpgraded, + }, + damage = { + default = 25, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua b/Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua new file mode 100644 index 000000000..59bdf7340 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua @@ -0,0 +1,150 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 76, + buildTime = 2.5, + buildpic = "egunship2.png", + canAttack = true, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRARMORED VTOL", + collide = true, + cruiseAlt = 125, + description = [[Anti-Armor Gunship]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericRed", + floater = true, + footprintX = 2, + footprintZ = 2, + hoverAttack = false, + iconType = "air_arm", + idleAutoHeal = .5, + idleTime = 2200, + maxacc = 1, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + maxDamage = 940, + maxSlope = 90, + maxVelocity = 15, + maxWaterDepth = 0, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericRed", + side = "CORE", + sightDistance = 1400, + smoothAnim = true, + sonarDistance = 0, + transportbyenemy = false; + turnRate = 5000, + turnradius = 250, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jethtrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "gunshipweapon", + BadTargetCategory = "BUILDING WALL", + mainDir = "0 0 1", + maxAngleDif = 90, + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + isupgraded = isUpgraded, + canareaattack ="1", + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + + gunshipweapon = { + AreaOfEffect = 1, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "gunshiptrail-optimized", + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + edgeEffectiveness = 0.1, + fireStarter = 70, + tracks = true, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "missilesmalllauncher.s3o", + name = "Rockets", + range = 700, + reloadtime = 1, + weaponType = "MissileLauncher", + waterweapon = true, + smokeTrail = false, + soundHit = "explosions/bombhit.wav", + soundHitWet = "weapons/subhit.wav", + soundHitVolume = 10, + soundStart = "weapons/18395_inferno_rltx.wav", + soundStartVolume = 10, + startVelocity = 50, + tolerance = 5000, + turnRate = 20000, + turret = false, + weaponAcceleration = 100, + flightTime = 2.5, + weaponVelocity = 700, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 150, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua b/Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua new file mode 100644 index 000000000..c97a1b0b1 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua @@ -0,0 +1,154 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + BadTargetCategory = "VTOL", + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 875, + builder = false, + buildTime = 2.5, + buildpic = "ekrow.png", + canAttack = true, + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRARMORED VTOL", + collide = true, + cruiseAlt = 150, + description = [[Endbringer Flying Fortress]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGeneric", + footprintX = 10, + footprintZ = 10, + floater = true, + hoverAttack = true, + iconType = "krow", + idleAutoHeal = .5, + idleTime = 2200, + loopbackattack = false, + maxDamage = 24000, + maxSlope = 90, + maxVelocity = 2.5, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGeneric", + side = "CORE", + sightDistance = 1050, + smoothAnim = true, + stealth = false, + transportbyenemy = false; + turnRate = 100, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "aircannon", + noChaseCategory = "VTOL LIGHT ARMORED", + badTargetCategory = "VTOL LIGHT ARMORED", + mainDir = "0 -1 0", + maxAngleDif = 170, + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "generic", + nofriendlyfire = "1", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + aircannon = { + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.5, + beamTime = 0.1, + beamTTL = 10, + beamDecay = 1, + burnblow = true, + largeBeamLaser = true, + laserflaresize = 7, + minIntensity = 1, + --cegTag = "railgun", + heightmod = 1, + duration = 0.6, + edgeeffectiveness = 1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-red", + fallOffRate = 0.1, + fireStarter = 50, + impulseFactor = 0, + fallOffRate = 0, + interceptedByShieldType = 4, + minintensity = 1, + name = "Laser", + range = 750, + reloadtime = 1, + WeaponType = "BeamLaser", + waterweapon = true, + rgbColor = "0.4 0.2 0.5", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/eturretfire.wav", + soundHit = "explosions/artyhit.wav", + texture1 = "lightning", + texture2 = "laserend", + thickness = 25, + tolerance = 10000, + turret = true, + weaponVelocity = 750, + customparams = { + damagetype = "antibuilding", + isupgraded = isUpgraded, + }, + damage = { + default = 300, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/eraider_basedef.lua b/Units-Configs-Basedefs/basedefs/air/eraider_basedef.lua new file mode 100644 index 000000000..a9d96035c --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/eraider_basedef.lua @@ -0,0 +1,186 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 86, + builder = false, + buildTime = 2.5, + buildpic = "escout.png", + canAttack = true, + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL", + collide = false, + cruiseAlt = 800, + description = [[EMP Attack Craft]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + hoverAttack = false, + floater = true, + iconType = "scout", + idleAutoHeal = .5, + idleTime = 2200, + loopbackattack = true, + maxAcc = 1, + maxDamage = 320, + maxSlope = 90, + maxVelocity = 10, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "ARM", + sightDistance = 1500, + smoothAnim = true, + stealth = false, + transportbyenemy = false; + turnRate = 5000, + turnRadius = 250, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + explosiongenerators = { + "custom:gdhcannon", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "missile", + badTargetCategory = "ARMORED LIGHT VTOL", + mainDir = "0 0 1", + maxAngleDif = 90, + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 1, + isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + missile = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "missiletrailgunship", + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + energypershot = 0, + edgeEffectiveness = 0.1, + fireStarter = 70, + + id = 136, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "missile.s3o", + name = "Rockets", + range = 750, + reloadtime = 30, + weaponType = "MissileLauncher", + + paralyzer = true, + paralyzetime = 10, + + smokeTrail = false, + soundHit = "explosions/unitexplodebig.wav", + soundHitWet = "explosions/subhitbomb.wav", + soundHitVolume = 10, + soundStart = "weapons/bomberlaunch.wav", + soundStartVolume = 10, + + startVelocity = 500, + tolerance = 5000, + turnRate = 10000, + tracks = false, + turret = false, + weaponAcceleration = 10, + waterweapon = true, + flightTime = 10, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "eraider", + nofriendlyfire = 1, + }, + damage = { + default = 5000, + }, + }, + + airraider = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + colorMap = "1 0.5 1 1 1 0.5 1 1 1 0.5 1 1 1 0.5 1 0.01", + stages = 1, + cegTag = "airraidershot", + explosionGenerator = "custom:genericshellexplosion-medium-blue", + energypershot = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + name = unitName .. "Weapon", + paralyzer = true, + paralyzetime = 2.5, + range = 300, + reloadtime = 0.1, + size = 3, + weaponType = "Cannon", + soundstart = "weapons/tmediumtankfire.wav", + sprayangle = 2500, + tolerance = 10000, + turret = true, + weaponVelocity = 750, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 15, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/escout_basedef.lua b/Units-Configs-Basedefs/basedefs/air/escout_basedef.lua new file mode 100644 index 000000000..2ca663e36 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/escout_basedef.lua @@ -0,0 +1,94 @@ +unitDef = { + acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 40, + builder = false, + buildTime = 2.5, + buildpic = "escout.png", + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL", + collide = false, + cruiseAlt = 135, + description = [[Air Scout/Radar Plane]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + hoverAttack = true, + floater = true, + iconType = "scout", + idleAutoHeal = .5, + idleTime = 2200, + isTargetingUpgrade = false, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + maxDamage = 160, + maxSlope = 90, + maxVelocity = 10, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 1500, + SonarDistance = 1500, + SeismicDistance = 1500, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "ARM", + sightDistance = 750, + smoothAnim = true, + transportbyenemy = false; + turnRate = 5000, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jethtrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 1, + isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 5000, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/air/escoutdrone_basedef.lua b/Units-Configs-Basedefs/basedefs/air/escoutdrone_basedef.lua new file mode 100644 index 000000000..170822fd7 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/escoutdrone_basedef.lua @@ -0,0 +1,101 @@ +unitDef = { + acceleration = 0.5, + airStrafe = true, + bankscale = "1", + brakeRate = 0.7, + buildCostEnergy = 0, + buildCostMetal = 10, + buildTime = 2.5, + buildpic = "edrone.png", + canAttack = true, + canDropFlare = false, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL DRONE", + collide = false, + cruiseAlt = 75, + description = [[Scouting Drone]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericPurple", + flareDelay = 0.1, + flareDropVector = "0 0 -1", + flareefficieny = "0.3", + flareReload = 3, + footprintX = 2, + footprintZ = 2, + hoverAttack = true, + iconType = "drone", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 220, + maxSlope = 90, + maxVelocity = 15, + --verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericPurple", + side = "CORE", + sightDistance = 1000, + SonarDistance = 1000, + smoothAnim = true, + stealth = true, + turnRate = 5000, + unitname = unitName, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jetstrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "droneweapon", + -- badTargetCategory = "LIGHT ARMORED", + -- }, + }, + customParams = { + unittype = "mobile", + --isupgraded = isUpgraded, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + --supply_cost = supply, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + retreatRangeDAI = 5000, + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/air/etransport_basedef.lua b/Units-Configs-Basedefs/basedefs/air/etransport_basedef.lua new file mode 100644 index 000000000..663be4c6d --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/air/etransport_basedef.lua @@ -0,0 +1,94 @@ +unitDef = { + acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + brakeRate = 2, + buildCostEnergy = 0, + buildCostMetal = 60, + builder = false, + buildTime = 2.5, + buildpic = "etransport.png", + canAttack = false, + canFly = true, + canGuard = false, + canMove = true, + canload = true, + canPatrol = false, + canstop = "1", + category = "AIRARMORED VTOL", + collide = true, + cruiseAlt = 110, + description = [[Fast Armored Transport]], + energyMake = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericPurple", + fallSpeed = 1000, + footprintX = 2, + footprintZ = 2, + hoverAttack = true, + holdSteady = true, + -- hoverAttack = true, + icontype = "etransport", + maxDamage = 500, + maxSlope = 90, + maxVelocity = 7, + + maxAileron = 0.01, + maxElevator = 0.01, + maxRudder = 0.01, + maxBank = 0.01, + + verticalSpeed = 30, + name = humanName, + objectName = objectName, + script = script, + releaseHeld = true, + repairable = false, + selfDestructAs = "mediumExplosionGenericPurple", + side = "GD", + sightDistance = 500, + smoothAnim = true, + transportbyenemy = false; + transportCapacity = 32, + transportMass = 10000, + transportSize = 8, + transportUnloadMethod = 0, + fallSpeed = 10, + loadingRadius = 220, --float + turnRate = 5000, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:jethtrail", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + isupgraded = isUpgraded, + death_sounds = "generic", +-- RequireTech = tech, + armortype = armortype, + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua new file mode 100644 index 000000000..9e25942b9 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua @@ -0,0 +1,199 @@ +unitDef = { + + acceleration = 0.18, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 875, + builder = false, + buildTime = 5, + buildpic = "eallterranarchid.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + cantBeTransported = true, + category = "ARMORED NOTAIR SKIRMISHER", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 150, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Endbringer Class Obliteration Strider]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericRed", + firestandorders = "1", + footprintX = 6, + footprintZ = 6, + iconType = "anarchid", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 20000, + maxVelocity = 2.5, + maxReverseVelocity = 1, + maxWaterDepth = 80, + metalStorage = 0, + movementClass = "ALLTERRTANK6", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + pushResistant = true, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericRed", + shootme = "1", + sightDistance = 1000, + smoothAnim = true, + stealth = true, + seismicSignature = 4, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + unitnumber = "110", + upright = false, + -- usePieceCollisionVolumes = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:flamethrowerrange750", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "heavybeamweapon", + }, + [2] = { + def = "flamethrower", + }, + [3] = { + def = "flamethrower", + }, + }, + customParams = { + unittype = "mobile", + isupgraded = isUpgraded, + death_sounds = "nuke", + RequireTech = tech, + armortype = armortype, + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + heavybeamweapon = { + AreaOfEffect = 10, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 1, + cameraShake = 1, + coreThickness = 0.2, + -- cegTag = "mediumcannonweapon3", + -- duration = 0.2, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + minintensity = "1", + name = "Laser", + range = 1000, + reloadtime = 1, + WeaponType = "BeamLaser", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/krabprimary.wav", + -- soundHit = "explosions/mediumcannonhit.wav", + -- sweepfire = true, + texture1 = "shot", + texture2 = "empty", + thickness = 6, + tolerance = 1000, + turret = true, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuilding", + }, + damage = { + default = 440, + }, + }, + + flamethrower = { + + accuracy = 0, + AreaOfEffect = 10, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + explosionGenerator = "custom:burnblack", + coreThickness = 0, + duration = 1, + energypershot = 0, + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + soundstart = "weapons/flamethrower1.wav", + + minintensity = 1, + impulseFactor = 0, + name = "Something with Flames", + range = 750, + reloadtime = 0.1, + WeaponType = [[LaserCannon]], + rgbColor = "0 0 0", + rgbColor2 = "0 0 0", + thickness = 0, + tolerance = 1000, + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmored", + }, + damage = { + default = 6, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua new file mode 100644 index 000000000..fe084ec16 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua @@ -0,0 +1,153 @@ +unitDef = { + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 60, + builder = false, + buildTime = 5, + buildpic = "eallterrassault.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SKIRMISHER", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Self-Propelled Precision Artillery]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGeneric", + firestandorders = "1", + footprintX = 3, + footprintZ = 3, + iconType = "arty_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 475, + maxVelocity = 2.4, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK3", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGeneric", + shootme = "1", + sightDistance = 400, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + unitnumber = "110", + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "assaulttankcannon", + badTargetCategory = "VTOL LIGHT ARMORED BIO", + }, + }, + customParams = { + unittype = "mobile", + isupgraded = isUpgraded, + canbetransported = "true", + needed_cover = 4, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + assaulttankcannon = { + AreaOfEffect = 1, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.3, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-purple", + fallOffRate = 0, + fireStarter = 100, + impulseFactor = 0, + interceptedByShieldType = 4, + minintensity = "1", + name = "Laser", + range = 1200, + reloadtime = 3, + WeaponType = "LaserCannon", + rgbColor = "0.5 0 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/allterrassaultshot.wav", + soundHit = "explosions/assaultshothit.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuildingarty", + }, + damage = { + default = 150, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua new file mode 100644 index 000000000..149b8a60a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua @@ -0,0 +1,157 @@ +unitDef = { + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 64, + builder = false, + buildTime = 5, + buildpic = "eallterrheavy.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SKIRMISHER", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Main Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericGreen", + firestandorders = "1", + footprintX = 2, + footprintZ = 2, + iconType = "td_arm_all", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 545, + maxVelocity = 2.8, + turninplacespeedlimit = 2.8, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericGreen", + shootme = "1", + sightDistance = 700, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + unitnumber = "110", + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "heavytankweapon", + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + unittype = "mobile", + isupgraded = isUpgraded, + canbetransported = "true", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + heavytankweapon = { + + AreaOfEffect = 1, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + + coreThickness = 0.5, + -- cegTag = "mediumcannonweapon3", + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-green", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 700, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 1 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/allterrheavyshot.wav", + soundHit = "explosions/mediumcannonhit.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 125, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua new file mode 100644 index 000000000..7b732e5d2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua @@ -0,0 +1,150 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 22, + builder = false, + buildTime = 5, + buildpic = "eallterrlight.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Raider]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGeneric", + firestandorders = "1", + footprintX = 2, + footprintZ = 2, + iconType = "raider", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 245, + maxVelocity = 5.5, + maxReverseVelocity = 2, + turninplacespeedlimit = 5.5, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGeneric", + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:factorysparks", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "lighttankweapon", + badTargetCategory = "BUILDING ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + + weaponDefs = { + lighttankweapon = { + + AreaOfEffect = 1, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-blue", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 350, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0.5 0.8 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/heavycannonGD.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 6, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 50, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua new file mode 100644 index 000000000..c3210ac0c --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua @@ -0,0 +1,156 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 44, + builder = false, + buildTime = 5, + buildpic = "eallterrmed.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SKIRMISHER", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Heavy Anti-Armor Tank Destroyer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericPurple", + footprintX = 2, + footprintZ = 2, + iconType = "td_arm_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 250, + maxSlope = 180, + maxVelocity = 3.5, + maxReverseVelocity = 1, + turninplacespeedlimit = 4, + maxWaterDepth = 10, + metalStorage = 0, + mobilestandorders = "1", + movementClass = "ALLTERRTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericPurple", + sightDistance = 600, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = "eallterrmed", + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "mediumtankcannon", + badTargetCategory = "BUILDING LIGHT WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + mediumtankcannon = { + + AreaOfEffect = 1, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + + coreThickness = 0.5, + -- cegTag = "mediumcannonweapon3", + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 600, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/medallterrweapon.wav", + soundHit = "explosions/mediumcannonhit.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmored", + }, + damage = { + default = 150, + }, + }, + +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua new file mode 100644 index 000000000..c5ad79489 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua @@ -0,0 +1,196 @@ +unitDef = { + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 27, + builder = false, + buildTime = 5, + buildpic = "eallterrriot.png", + canAttack = true, + + -- canDgun = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RIOT", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[EMP/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericRed", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 400, + maxSlope = 180, + maxVelocity = 4.5, + maxReverseVelocity = 1, + turninplacespeedlimit = 3.3, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericRed", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + onlyTargetCategory = "BIO LIGHT ARMORED BUILDING", + badTargetCategory = "WALL", + }, + -- [2] = { + -- def = "riottankshotgun", + -- onlyTargetCategory = "BIO LIGHT ARMORED BUILDING", + -- badTargetCategory = "WALL BUILDING", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "Laser", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 450, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "bruisercannon", + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + --projectiles = 10, + range = 500, + reloadtime = 5, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/bruisercannon.wav", + --sprayangle = 2000, + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 300, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua new file mode 100644 index 000000000..83feba2a4 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua @@ -0,0 +1,204 @@ +unitDef = { + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 27, + builder = false, + buildTime = 5, + buildpic = "eallterrriot.png", + canAttack = true, + + -- canDgun = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RIOT", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 70, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Shotgun/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericRed", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 400, + maxSlope = 180, + maxVelocity = 4.5, + maxReverseVelocity = 1, + turninplacespeedlimit = 3.3, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericRed", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- onlyTargetCategory = "BIO LIGHT ARMORED BUILDING", + -- badTargetCategory = "WALL", + -- }, + [1] = { + def = "riottankshotgun", + onlyTargetCategory = "BIO LIGHT ARMORED BUILDING", + badTargetCategory = "WALL BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + }, +} + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "Laser", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 450, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + areaofeffect = 75, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + --burstrate = 0.2, + --burst = 5, + + cegTag = "bruisercannon", + edgeeffectiveness = 1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + noSelfDamage = true, + noexplode = true, + projectiles = 5, + range = 500, + reloadtime = 5, + sprayangle = 3500, + size = 2, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/Shotgun Boom 103.wav", + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = true, + single_hit = true, + }, + damage = { + default = 150, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua new file mode 100644 index 000000000..eff573e2c --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua @@ -0,0 +1,158 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 28, + builder = false, + buildTime = 5, + buildpic = "eallterrshield.png", + canAttack = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 150, + decloakOnFire = false, + decloakSpherical = true, + initCloaked = true, + -- Starting out cloaked will dramatically increase the initial cost, however, it is much more convenient from a micromanagement standpoint. + -- End Cloaking + + description = [[Shield/Cloak Field Emitter]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGenericPurple", + fireState = "0", + footprintX = 2, + footprintZ = 2, + iconType = "shield_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 500, + maxVelocity = 3.5, + maxReverseVelocity = 2, + turninplacespeedlimit = 4, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ALLTERRTANK2", + moveState = "0", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGenericPurple", + sightDistance = 800, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = "eallterrshield", + upright = false, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "allterrshield", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + shield_power = 500, + shield_radius = 300, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 600, + + decloakradiushalved = true, + + area_cloak = 1, -- Can this unit emit a cloaking field? + area_cloak_upkeep = 5, -- How much energy does it cost to maintain the cloaking field? + area_cloak_radius = 150, -- How large is the cloaking field? + --area_cloak_grow_rate = 200, -- When the cloaking field is turned on, how fast does the field expand to it's full size? + --area_cloak_shrink_rate = 200, -- When the cloaking field is turned off, how fast does the field shrink to nothingness? + area_cloak_decloak_distance = 150, -- How close does something have to be in order to decloak a unit within a cloaking shield? + area_cloak_init = true, -- Start up the cloak shield the moment the unit is built? + area_cloak_draw = true, -- No idea what this does + area_cloak_self = true, -- Does the cloak shield cloak the unit emitting it? + }, +} + + +-------------------------------------------------------------------------------- + +weaponDefs = { + allterrshield = { + + Smartshield = true, + Exteriorshield = true, + Visibleshield = false, + Visibleshieldrepulse = false, + ShieldStartingPower = 0, + Shieldenergyuse = 0, + Shieldradius = 300, + Shieldpower = 500, + Shieldpowerregen = 25, + Shieldpowerregenenergy = 25, + Shieldintercepttype = 4, + Shieldgoodcolor = "0.0 0.2 1.0", + Shieldbadcolor = "1.0 0 0", + Shieldalpha = 0.2, + + texture1 = "shield4", + + visibleShieldHitFrames = 0, + weaponType = [[Shield]], + + customparams = { + isshieldupgraded = isUpgraded, + }, + + damage = { + default = 0, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/allterrain/eminifac_basedef.lua b/Units-Configs-Basedefs/basedefs/allterrain/eminifac_basedef.lua new file mode 100644 index 000000000..c3f4b816e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/allterrain/eminifac_basedef.lua @@ -0,0 +1,105 @@ +-- ALL TERRAIN FACTORY : DEFFOS FOR INHERITING + +unitDef = { + activatewhenbuilt = false, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 5, + buildpic = "eminifac.png", + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canstop = true, + category = "BUILDING NOTAIR", + + collisionVolumeOffsets = "0 60 0", + collisionVolumeScales = "298 142 168", + collisionVolumeTest = 1, + collisionVolumeType = "box", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + minCloakDistance = 250, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = false, + + -- End Cloaking + + description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]], + energyStorage = 0, + energyUse = 0, + energyMake = 0, + explodeAs = "largeExplosionGenericGreen", + footprintX = 11, + footprintZ = 11, + iconType = "factory", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 90, + maxWaterDepth = 0, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericGreen", + showNanoSpray = true, + sightDistance = 388, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + workerTime = 1, + yardMap = "ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ccccccccccc ", + -- usePieceCollisionVolumes = true, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:nano", + "custom:blacksmoke", + "custom:fusionreactionbasic", + }, + }, + buildoptions = AllTerrainFactoryBuildList, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdfactoryselect", + }, + }, + customParams = { + unittype = "factory", + death_sounds = "generic", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + decloakradiushalved = true, + -- ProvideTech = "1 Powergrid", + -- ProvideTechRange = "1500", + -- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", + -- groundtexselectxsize = 1500, -- optional + -- groundtexselectzsize = 1500, -- optional + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 27, + BuildingGroundDecalSizeY = 27, + BuildingGroundDecalDecaySpeed = 0.9, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibarty_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibarty_basedef.lua new file mode 100644 index 000000000..6122e2db2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibarty_basedef.lua @@ -0,0 +1,141 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 36, + builder = false, + buildTime = 5, + buildpic = "eamphibarty.png", + canAttack = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB SUPPORT", + description = [[Self-Propelled Laser Artillery]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + iconType = "arty_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 28, + maxVelocity = 3.5, + maxReverseVelocity = 1, + minWaterDepth = 10, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericBlue", + sightDistance = 365, + SonarDistance = 365, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.0, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 300, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:factorysparks", + "custom:emptydirt", + "custom:blacksmoke", + }, +}, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "assimilatorbeamweapon", + badTargetCategory = "VTOL LIGHT ARMORED BIO", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + assimilatorbeamweapon = { + + AreaOfEffect = 0, + avoidFeature = false, + avoidFriendly = false, + beamTime = 1.8, + collideFeature = false, + collideFriendly = false, + rgbColor = "0 0 0.5", + rgbColor2 = "0.5 0.5 0.5", + coreThickness = 0.5, + duration = 0.4, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + fallOffRate = 0.1, + fireStarter = 50, + interceptedByShieldType = 4, + largeBeamLaser = true, + laserflaresize = 5, + leadlimit = 20, + minintensity = 1, + name = "Laser", + range = 1100, + reloadtime = 2, + WeaponType = "BeamLaser", + --soundHit = "explosions/amphibartyshothit.wav", + soundStart = "weapons/laserbeam02.wav", + soundTrigger = true, + texture1 = "lightning", + texture2 = "laserend", + thickness = 20, + tolerance = 500, + turret = true, + weaponVelocity = 1500, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuildingarty", + }, + damage = { + default = 100, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibbuggy_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibbuggy_basedef.lua new file mode 100644 index 000000000..d34e194bd --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibbuggy_basedef.lua @@ -0,0 +1,146 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 18, + builder = false, + buildTime = 5, + buildpic = "eamphibbuggy.png", + canAttack = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB RAID", + description = [[Raider]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericRed", + footprintX = 2, + footprintZ = 2, + iconType = "raider", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 120, + maxSlope = 28, + maxVelocity = 6.5, + maxReverseVelocity = 2, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericRed", + sightDistance = 650, + sonarDistance = 650, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 6.0, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + workerTime = 0, + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:factorysparks", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "lightbeamlaser", + badTargetCategory = "ARMORED BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = "light", + nofriendlyfire = "1", + supply_cost = 1, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + lightbeamlaser = { + TargetMoveError = 0.3, + AreaOfEffect = 0, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.2, + duration = 0.1, + explosionGenerator = "custom:genericshellexplosion-small-sparks-burn", + energypershot = 0, + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0.1, + laserflaresize = 5, + largebeamlaser = true, + leadlimit = 10, + minintensity = 1, + name = "Laser", + range = 300, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "0.5 0 0", + rgbColor2 = "0.8 0.8 0.8", + soundTrigger = true, + soundstart = "weapons/amphibbuggytankshothit.wav", + -- soundHit = "weapons/amphibbuggytankshothit.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 5, + tolerance = 3000, + turret = true, + weaponVelocity = 1000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 13.5, -- multiply * 1.2 for correct dps output + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibfac_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibfac_basedef.lua new file mode 100644 index 000000000..cea468d3a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibfac_basedef.lua @@ -0,0 +1,93 @@ +unitDef = { + + activatewhenbuilt = false, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 5, + buildpic = "eamphibfac.png", + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canstop = true, + category = "BUILDING NOTAIR AMPHIB", + -- collisionVolumeOffsets = "0 20 0", + -- collisionVolumeScales = "238 92 128", + -- collisionVolumeTest = 1, + -- collisionVolumeType = "box", + description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]], + energyStorage = 0, + energyUse = 0, + energyMake = 0, + explodeAs = "hugeBuildingExplosionGenericBlue", + footprintX = 8, + footprintZ = 8, + iconType = "factory", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 25, + maxWaterDepth = 5000, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericBlue", + showNanoSpray = true, + side = "CORE", + sightDistance = 388, +-- SonarDistance = 175, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + workerTime = 1, + yardMap = "cccccccc cccccccc cccccccc cccccccc cccccccc cccccccc cccccccc cccccccc cccccccc ", + -- usePieceCollisionVolumes = true, + + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 18, + BuildingGroundDecalSizeY = 18, + BuildingGroundDecalDecaySpeed = 0.9, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:nano", + "custom:blacksmoke", + "custom:fusionreactionbasic", + }, + }, + buildoptions = amphibFactoryBuildList, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdfactoryselect", + }, + }, + customParams = { + unittype = "factory", + death_sounds = "generic", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + -- ProvideTech = "1 Powergrid", + -- ProvideTechRange = "1500", + -- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", + -- groundtexselectxsize = 1500, -- optional + -- groundtexselectzsize = 1500, -- optional + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibleveler_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibleveler_basedef.lua new file mode 100644 index 000000000..7ab5284d5 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibleveler_basedef.lua @@ -0,0 +1,172 @@ +unitDef = { + acceleration = 0.18, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 875, + builder = false, + buildTime = 5, + buildpic = "eamphibleveler.png", + canAttack = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED AMPHIB SKIRMISHER", + description = [[Endbringer Class Mobile Target Evaporator]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericBlue", + footprintX = 6, + footprintZ = 6, + iconType = "leveller", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 20000, + maxSlope = 28, + maxVelocity = 4.5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK6", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericBlue", + side = "CORE", + sightDistance = 750, + sonarDistance = 750, + smoothAnim = true, + stealth = true, + seismicSignature = 4, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/UnitsUnderattack1.wav", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "tankkillerlaser", + }, + [2] = { + def = "machinegun", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + death_sounds = "nuke", + RequireTech = tech, + armortype = armortype, + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + tankkillerlaser = { + AreaOfEffect = 8, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + coreThickness = 0.5, + duration = 0.2, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-large-purple", + fallOffRate = 0, + fireStarter = 100, + interceptedByShieldType = 4, + impulseFactor = 0.1, + minintensity = "1", + name = "Anti-Tank Laser", + range = 750, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0.2 0 0.5", + rgbColor2 = "0.8 0.8 0.8", + soundTrigger = true, + soundstart = "weapons/tankdestroyermaingunfire.wav", + texture1 = "pulseshot2", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmored", + }, + damage = { + default = 250, + }, + }, + + machinegun = { + accuracy = 300, + AreaOfEffect = 8, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + coreThickness = 0.5, + duration = 0.1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = energycosttofire2, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + minintensity = "1", + name = "Machine Gun", + range = 750, + reloadtime = 0.1, + WeaponType = "LaserCannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/tankdestroyerfire.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 5, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 6, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibmedtank_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibmedtank_basedef.lua new file mode 100644 index 000000000..efacc9bbf --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibmedtank_basedef.lua @@ -0,0 +1,148 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 53, + builder = false, + buildTime = 5, + buildpic = "eamphibmedtank.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB SKIRMISHER", + description = [[Light Main Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + footprintX = 2, + footprintZ = 2, + iconType = "td_lit_all", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 360, + maxSlope = 28, + maxVelocity = 5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + side = "CORE", + sightDistance = 550, + sonarDistance = 550, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 4.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:factorysparks", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "medtankbeamlaser", + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + medtankbeamlaser = { + + TargetMoveError = 0.3, + AreaOfEffect = 0, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.5, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0.1, + + largebeamlaser = true, + laserflaresize = 5, + leadlimit = 15, + minintensity = 1, + name = "Laser", + range = 550, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "0 0.5 0", + rgbColor2 = "0.8 0.8 0.8", + soundTrigger = true, + soundstart = "weapons/amphibmedtankshothit.wav", + -- soundHit = "weapons/amphibmedtankshothit.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 4, + tolerance = 3000, + turret = true, + weaponVelocity = 1000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 16, -- multiply * 1.2 for correct dps output + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibneedle_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibneedle_basedef.lua new file mode 100644 index 000000000..7694a919f --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibneedle_basedef.lua @@ -0,0 +1,146 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 42, + builder = false, + buildTime = 5, + buildpic = "eamphibneedle.png", + canAttack = true, + + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB RAID", + description = [[Light Tank Destroyer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericPurple", + footprintX = 2, + footprintZ = 2, + iconType = "td_lit_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 340, + maxSlope = 28, + maxVelocity = 6, + maxReverseVelocity = 2, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericPurple", + sightDistance = 400, + sonarDistance = 400, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 6.0, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitNeedle, + workerTime = 0, + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "medtankbeamlaser", + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = "light", + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + + medtankbeamlaser = { + AreaOfEffect = 0, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.2, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + largebeamlaser = true, + laserflaresize = 5, + leadlimit = 15, + minintensity = 1, + name = "Laser", + range = 400, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "0.25 0 0.6", + rgbColor2 = "0.8 0.8 0.8", + soundTrigger = true, + soundstart = "weapons/plasma2.wav", + -- soundHit = "weapons/amphibmedtankshothit.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 10, + tolerance = 3000, + turret = true, + weaponVelocity = 1000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 20, -- multiply * 1.2 for correct dps output + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_basedef.lua new file mode 100644 index 000000000..620955d9e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_basedef.lua @@ -0,0 +1,183 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 23, + builder = false, + buildTime = 5, + buildpic = "eamphibriot.png", + canAttack = true, + + -- canDgun = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB RIOT", + description = [[EMP/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericWhite", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 340, + maxSlope = 28, + maxVelocity = 5.5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericWhite", + side = "CORE", + sightDistance = 500, + sonarDistance = 500, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.7, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + badTargetCategory = "WALL", + }, + -- [2] = { + -- def = "riottankshotgun", + -- badTargetCategory = "WALL BUILDING", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = "light", + nofriendlyfire = "1", + supply_cost = 3, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "Laser", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 400, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "bruisercannon", + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + --projectiles = 10, + range = 500, + reloadtime = 5, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/bruisercannon.wav", + --sprayangle = 2000, + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 300, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua new file mode 100644 index 000000000..2345dab85 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua @@ -0,0 +1,191 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 23, + builder = false, + buildTime = 5, + buildpic = "eamphibriot.png", + canAttack = true, + + -- canDgun = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB RIOT", + description = [[Shotgun/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericWhite", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 340, + maxSlope = 28, + maxVelocity = 5.5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericWhite", + side = "CORE", + sightDistance = 500, + sonarDistance = 500, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.7, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- badTargetCategory = "WALL", + -- }, + [1] = { + def = "riottankshotgun", + badTargetCategory = "WALL BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = "light", + nofriendlyfire = "1", + supply_cost = 3, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "Laser", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 400, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + AreaOfEffect = 75, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + --burstrate = 0.2, + --burst = 5, + + cegTag = "bruisercannon", + edgeeffectiveness = 1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + noSelfDamage = true, + noexplode = true, + projectiles = 5, + range = 500, + reloadtime = 5, + sprayangle = 3500, + size = 2, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/Shotgun Boom 101.wav", + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = true, + single_hit = true, + }, + damage = { + default = 150, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/amphib/eamphibrock_basedef.lua b/Units-Configs-Basedefs/basedefs/amphib/eamphibrock_basedef.lua new file mode 100644 index 000000000..af788216e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/amphib/eamphibrock_basedef.lua @@ -0,0 +1,181 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 59, + builder = false, + buildTime = 5, + buildpic = "eamphibrock.png", + canAttack = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT AMPHIB SUPPORT", + description = [[Anti-Armor Missile Support Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGeneric", + footprintX = 2, + footprintZ = 2, + iconType = "mtd_lit_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 320, + maxSlope = 28, + maxVelocity = 4, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "TANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGeneric", + side = "CORE", + sightDistance = 650, + sonarDistance = 650, + stealth = true, + seismicSignature = 2, + sonarStealth = false, + smoothAnim = true, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.4, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:emptydirt", + "custom:blacksmoke", + "custom:jethtrail", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "antiarmorrockets", + badTargetCategory = "BUILDING LIGHT WALL", + }, + -- [2] = { + -- def = "antiarmorrocketssalvo", + -- badTargetCategory = "BUILDING LIGHT WALL", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + canareaattack ="1", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + + antiarmorrockets = { + AreaOfEffect = 0, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "amphibrocktrail-optimized", + explosionGenerator = "custom:genericshellexplosion-medium-red", + energypershot = 0, + fireStarter = 70, + tracks = true, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "missilesmalllauncher.s3o", + name = "Rockets", + range = 700, + reloadtime = 1, + weaponType = "MissileLauncher", + smokeTrail = false, + soundStart = "weapons/rocket1.wav", + soundHit = "explosions/explode5.wav", + startVelocity = 250, + tolerance = 8000, + turnrate = 30000, + turret = true, + weaponAcceleration = 400, + flightTime = 5, + weaponVelocity = 3000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmoredair", + }, + damage = { + default = 200, + }, + }, + + antiarmorrocketssalvo = { + AreaOfEffect = 0, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + burst = 5, + burstrate = 0.1, + cegTag = "missiletrailsmall", + explosionGenerator = "custom:genericshellexplosion-medium-red", + energypershot = energycosttofire2, + fireStarter = 70, + tracks = true, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "missilesmalllauncher.s3o", + name = "Rockets", + range = 700, + reloadtime = 5, + weaponType = "MissileLauncher", + smokeTrail = false, + soundStart = "weapons/rocket1.wav", + soundHit = "explosions/explode5.wav", + startVelocity = 250, + tolerance = 8000, + turnrate = 30000, + turret = true, + weaponAcceleration = 400, + flightTime = 5, + weaponVelocity = 3000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmoredair", + }, + damage = { + default = 200, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/buildings/eartyturret_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/eartyturret_basedef.lua new file mode 100644 index 000000000..662ff9aa7 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/eartyturret_basedef.lua @@ -0,0 +1,120 @@ +unitDef = { + buildCostEnergy = 0, + buildCostMetal = 500, + builder = false, + buildTime = 5, + buildpic = "eartyturret.png", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + description = [[Long Range Artillery Turret]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGeneric", + floater = true, + footprintX = 8, + footprintZ = 8, + icontype = "turret_arty", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 6250, + maxSlope = 60, + maxWaterDepth = 99999999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + noAutoFire = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGeneric", + sightDistance = 500, + smoothAnim = true, + unitname = unitName, + yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "artyweapon", + badtargetcategory = "LIGHT ARMORED VTOL", + --onlyTargetCategory = "BUILDING BIO", + }, + }, + customParams = { + RequireTech = tech, + isupgraded = isUpgraded, + unittype = "turret", + --supply_cost = supply, + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, + }, +} + +weaponDefs = { + artyweapon = { + AreaOfEffect = AreaOfEffect, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "artyshot2", + avoidNeutral = false, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + energypershot = 0, + edgeEffectiveness = 0.1, + + impulseFactor = 0, + interceptedByShieldType = 4, + + minIntensity = 1, + + name = "Plasma Cannon", + range = 8000, + reloadtime = 30, + size = 16, + weaponType = "Cannon", + soundHit = "explosions/artyhit.wav", + soundStart = "weapons/arty2.wav", + + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "antibuilding", + isupgraded = isUpgraded, + --effectedByunitHealthModifier = true, + }, + damage = { + default = 1000, + }, + }, + +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/eflakturret_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/eflakturret_basedef.lua new file mode 100644 index 000000000..5cf9f0876 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/eflakturret_basedef.lua @@ -0,0 +1,134 @@ +unitDef = { + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = 50, + builder = false, + buildTime = 5, + buildpic = "elaserbattery.png", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + collisionVolumeTest = "1", + description = [[Anti-AIR Flak Defense Platform]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGeneric", + footprintX = 3, + footprintZ = 3, + floater = true, + idleAutoHeal = .5, + idleTime = 2200, + iconType = "turret_lit", + maxDamage = 625, + maxSlope = 60, + maxWaterDepth = 999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + onlytargetcategory2 = "NOTAIR", + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGeneric", + side = "CORE", + sightDistance = 100, + airsightdistance = 1500, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = "oooo oooo oooo oooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "aircannon", + onlyTargetCategory = "VTOL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "turret", + RequireTech = tech, + needed_cover = 2, + --supply_cost = supply, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} + +weaponDefs = { + aircannon = { + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + canAttackGround = false, + coreThickness = 0.5, + burnblow = true, + --cegTag = "railgun", + duration = 0.05, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-purple", + edgeEffectiveness = 1, + fallOffRate = 1, + fireStarter = 50, + impulseFactor = 0, + minintensity = "1", + name = "Laser", + range = 1500, + reloadtime = 1, + WeaponType = "Cannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + projectiles = 4, + soundTrigger = true, + soundstart = "weapons/Assault Rifle Shot_05.wav", + soundhit = "deathsounds/generic/Explosion Fireworks_01.wav", + sprayangle = 3000, + size = 5, + --texture1 = "shot", + --texture2 = "empty", + tolerance = 7500, + turret = true, + weaponVelocity = 3000, + customparams = { + damagetype = "antiair", + isupgraded = isUpgraded, + effectedByunitHealthModifier = true, + }, + damage = { + default = 125, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/eheavyturret2_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/eheavyturret2_basedef.lua new file mode 100644 index 000000000..a1fdcf179 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/eheavyturret2_basedef.lua @@ -0,0 +1,134 @@ +unitDef = { + buildAngle = 8192, + buildCostEnergy = 0, + buildCostMetal = 60, + builder = false, + buildTime = 5, + buildpic = "eheavyturret2.png", + collisionVolumeOffsets = "0 0 0", + collisionVolumeScales = "80 115 80", + collisionVolumeTest = 1, + collisionVolumeType = "box", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + description = [[Heavy Plasma Battery (Anti-Armor)]], + energyStorage = 0, + energyUse = 0, + explodeAs = "largeBuildingExplosionGenericRed", + footprintX = 3, + footprintZ = 3, + floater = true, + idleAutoHeal = .5, + idleTime = 2200, + iconType = "turret_arm", + maxDamage = 1200, + maxSlope = 60, + maxWaterDepth = 999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericRed", + side = "CORE", + sightDistance = 750, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "eheavyturretweapon2", + badTargetCategory = "LIGHT VTOL BUILDING", + onlyTargetCategory = "BIO ARMORED LIGHT", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "turret", + needed_cover = 5, + --supply_cost = supply, + RequireTech = tech, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} + +weaponDefs = { + eheavyturretweapon2 = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + duration = 0.25, + energypershot = 0, + edgeeffectiveness = 0, + explosionGenerator = "custom:genericshellexplosion-medium", + fallOffRate = 0, + fireStarter = 100, + impulseFactor = 0, + interceptedByShieldType = 4, + minintensity = "1", + name = "Laser", + range = 750, + reloadtime = 2, + WeaponType = "LaserCannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/heavyturretshot.wav", + soundHit = "explosions/explode5.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 3000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "turretantilightarmored", + effectedByunitHealthModifier = true, + }, + damage = { + default = 500, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/elaserbattery_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/elaserbattery_basedef.lua new file mode 100644 index 000000000..7ec880e9a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/elaserbattery_basedef.lua @@ -0,0 +1,137 @@ +unitDef = { + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = 50, + builder = false, + buildTime = 5, + buildpic = "elaserbattery.png", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + collisionVolumeTest = "1", + description = [[Anti-AIR Laser Defense Platform]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGeneric", + footprintX = 3, + footprintZ = 3, + floater = true, + idleAutoHeal = .5, + idleTime = 2200, + iconType = "turret_lit", + maxDamage = 625, + maxSlope = 60, + maxWaterDepth = 999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + onlytargetcategory2 = "NOTAIR", + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGeneric", + side = "CORE", + sightDistance = 100, + airsightdistance = 1000, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = "oooo oooo oooo oooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:electricity", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "lighteweapon", + onlyTargetCategory = "VTOL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "turret", + RequireTech = tech, + needed_cover = 2, + --supply_cost = supply, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} + +weaponDefs = { + lighteweapon = { + predictboost = 0.3, + AreaOfEffect = 0, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + collideFeature = false, + collideFriendly = false, + canAttackGround = false, + coreThickness = 0.5, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0.1, + + largebeamlaser = true, + laserflaresize = 8, + minintensity = 1, + name = "Laser", + range = 1000, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "0.25 0 0.6", + rgbColor2 = "0.8 0.8 0.8", + soundTrigger = true, + soundstart = "weapons/aegis.wav", + -- soundHit = "weapons/amphibmedtankshothit.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 6, + tolerance = 3000, + turret = true, + weaponVelocity = 1000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiair", + effectedByunitHealthModifier = true, + }, + damage = { + default = 30, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/elightturret2_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/elightturret2_basedef.lua new file mode 100644 index 000000000..efa83eeb5 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/elightturret2_basedef.lua @@ -0,0 +1,132 @@ +unitDef = { + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = 27, + builder = false, + buildTime = 5, + buildpic = "elightturret2.png", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + collisionVolumeTest = "1", + description = [[Anti-Raid Defense Platform (Anti-Light)]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGeneric", + footprintX = 2, + footprintZ = 2, + floater = true, + idleAutoHeal = .5, + idleTime = 2200, + iconType = "turret_lit", + maxDamage = 625, + maxSlope = 60, + maxWaterDepth = 999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + onlytargetcategory2 = "NOTAIR", + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGeneric", + side = "CORE", + sightDistance = 650, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = "oooo oooo oooo oooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "lighteweapon", + badTargetCategory = "VTOL ARMORED BUILDING", + onlyTargetCategory = "BIO LIGHT VTOL ARMORED", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "turret", + RequireTech = tech, + needed_cover = 2, + --supply_cost = supply, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 6, + BuildingGroundDecalSizeY = 6, + BuildingGroundDecalDecaySpeed = 0.9, +} + +weaponDefs = { + lighteweapon = { + AreaOfEffect = 25, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + cegTag = "railgun", + coreThickness = 0.5, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-blue", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 650, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0 0 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/lightturret.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 12, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + waterweapon = true, + customparams = { + isupgraded = isUpgraded, + damagetype = "turretantilight", + unittype = "turret", + effectedByunitHealthModifier = true, + }, + damage = { + default = 100, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/emetalextractor_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/emetalextractor_basedef.lua new file mode 100644 index 000000000..bb415c0eb --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/emetalextractor_basedef.lua @@ -0,0 +1,81 @@ +unitDef = { + + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildingMask = 0, + builder = false, + buildTime = 5, + buildPic = "emetalextractor.png", + canAttack = false, + category = "BUILDING NOTAIR ECO", + description = [[Generates Metal from Resource Nodes]], + energyStorage = 0, + energyUse = energyUse, + explodeAs = "largeBuildingExplosionGenericRed", + makesMetal = 0, + footprintX = 9, + footprintZ = 9, + iconType = "eco", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = buildCostMetal * 12.5, + maxSlope = 90, + maxWaterDepth = 5000, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + onoffable = true, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericRed", + selfDestructCountdown = 15, + side = "CORE", + sightDistance = 200, + smoothAnim = true, + unitName = unitName, + workerTime = 0, + yardMap = "yyyyyyyyy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yyyyyyyyy", + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + primaryCEG, + "custom:skyhatelaser", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdmex", + }, + }, + weapons = { + }, + customParams = { + RequireTech = tech, + unittype = "building", + metal_extractor = metalMultiplier, + iseco = 1, + needed_cover = 3, + death_sounds = "generic", + armortype = armortype, + noenergycost = true, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 9, + BuildingGroundDecalSizeY = 9, + BuildingGroundDecalDecaySpeed = 0.9, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/buildings/eradar2_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/eradar2_basedef.lua new file mode 100644 index 000000000..adc30b62e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/eradar2_basedef.lua @@ -0,0 +1,76 @@ +unitDef = { + activateWhenBuilt = true, + buildAngle = 16384, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + category = "BUILDING NOTAIR", + description = [[Radar Dome/Sensor Tower]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeBuildingExplosionGenericWhite", + footprintX = 6, + footprintZ = 6, + floater = true, + iconType = "radar", + idleAutoHeal = .5, + idleTime = 2200, + isTargetingUpgrade = false, + maxDamage = 250, + maxSlope = 75, + maxWaterDepth = 999999, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = "eradar3.cob", + onoffable = false, + radarDistance = radarDistance, + radarEmitHeight = radarEmitHeight, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericWhite", + side = "CORE", + sightDistance = sightDistance, + smoothAnim = true, + sonarDistance = sonarDistance, + seismicDistance = seismicDistance, + unitname = "eradar2", + workerTime = 0, + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdradar", + }, + }, + customParams = { + RequireTech = tech, + unittype = "building", + needed_cover = 2, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} diff --git a/Units-Configs-Basedefs/basedefs/buildings/euwturret_basedef.lua b/Units-Configs-Basedefs/basedefs/buildings/euwturret_basedef.lua new file mode 100644 index 000000000..db1d837dd --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/buildings/euwturret_basedef.lua @@ -0,0 +1,127 @@ +unitDef = { + + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = 40, + builder = false, + buildTime = 5, + buildpic = "euwturret.png", + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + collisionVolumeTest = "1", + description = [[Anti-Amphibious Defense Platform • Uses +]] .. supply .. [[ Supply]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGenericGreen", + floater = true, + footprintX = 4, + footprintZ = 4, + idleAutoHeal = .5, + idleTime = 2200, + iconType = "turret_lit", + maxDamage = 500, + maxSlope = 60, + minWaterDepth = 20, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + onlytargetcategory2 = "NOTAIR", + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGenericGreen", + side = "CORE", + sightDistance = 250, +-- SonarDistance = 600, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = "oooo oooo oooo oooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:electricity", + "custom:needspower", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "euwturretmissile", + onlyTargetCategory = "LIGHT ARMORED", + -- MainDir = [[0 -1 0]], + -- MaxAngleDif = 180, + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "turret", + RequireTech = tech, + needed_cover = 2, + supply_cost = supply, + death_sounds = "generic", + -- twokhotkey = 't', + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + euwturretmissile = { + AreaOfEffect = 10, + avoidFriendly = false, + avoidFeature = false, + cegTag = "torpedotrailuwturret", + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:torpedoexplosion", + energypershot = 0, + fireStarter = 80, + impulseFactor = 0.1, + interceptedByShieldType = 4, + model = "missilesmall.s3o", + name = "Underwater Torpedo", + range = 600, + reloadtime = 1, + weaponType = "TorpedoLauncher", + soundHit = "weapons/torpedolaunch.wav", + soundStart = "weapons/subhit.wav", + tolerance = 3000, + turret = true, + startVelocity = 200, + acceleration = 2000, + weaponVelocity = 10000, + tracks = true, + turnrate = 100000, + flighttime = 8, + sprayangle = 5000, + waterweapon = true, + + customparams = { + isupgraded = isUpgraded, + damagetype = "euwturret", + }, + damage = { + default = 120, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/chickens/croost_basedef.lua b/Units-Configs-Basedefs/basedefs/chickens/croost_basedef.lua new file mode 100644 index 000000000..703cfa00a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/chickens/croost_basedef.lua @@ -0,0 +1,106 @@ +unitDef = { + + activateWhenBuilt = true, + acceleration = 1, + brakeRate = 0.24, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildingMask = 0, + buildDistance = 1500, + builder = true, + buildTime = 5, + buildPic = "chicken_unitpics/roost.png", + capturable = false, + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + category = "BUILDING NOTAIR ECO", + description = [[Generates Metal from Resource Nodes]], + energyStorage = 0, + energyUse = energyUse, + explodeAs = "largeBuildingExplosionGenericRed", + makesMetal = 0, + footprintX = 2, + footprintZ = 2, + iconType = "eco", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 1000, + maxSlope = 90, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + movementClass = "HOVERHBOT4", + pushResistant = true, + script = script, + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericRed", + selfDestructCountdown = 15, + side = "CORE", + sightDistance = 200, + smoothAnim = true, + unitName = unitName, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + yardMap = "yyyyyyyyy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yoooooooy yyyyyyyyy", + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + --primaryCEG, + --"custom:skyhatelaser", + }, + }, + buildoptions = Shared.buildListChicken, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdmex", + }, + }, + weapons = { + }, + customParams = { + --RequireTech = tech, + unittype = "building", + metal_extractor = metalMultiplier, + iseco = 1, + needed_cover = 3, + death_sounds = "generic", + armortype = armortype, + noenergycost = true, + --normaltex = "unittextures/lego2skin_explorernormal.dds", + --buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "chickens", + --corpse = "energycore", + helptext = [[]], + customgrounddecal = true, + }, + useGroundDecal = true, + BuildingGroundDecalType = "chickengroundplate.dds", + BuildingGroundDecalSizeX = 18, + BuildingGroundDecalSizeY = 18, + BuildingGroundDecalDecaySpeed = 0.9, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/commander_basedef.lua b/Units-Configs-Basedefs/basedefs/commander_basedef.lua new file mode 100644 index 000000000..cba38873f --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/commander_basedef.lua @@ -0,0 +1,381 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = buildpicture, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = footprintx, + footprintZ = footprintz, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = maxdamage, + maxSlope = 180, + maxVelocity = maxvelocity, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = movementclass, + moveState = "0", + name = humanname, + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = objectname, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 1, -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = buildlist, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = weapon1, + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplygiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +weaponDefs = { + + machinegun = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 200, + }, + }, + + machinegun_up1 = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0.5 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 300, + }, + }, + + machinegun_up2 = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 1 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 450, + }, + }, + + machinegun_up3 = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 675, + }, + }, + + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, + + heavybeamweapon = { + AreaOfEffect = 10, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + largebeamlaser = true, + beamTime = 0.5, + cameraShake = 0, + coreThickness = 0.5, + -- cegTag = "mediumcannonweapon3", + -- duration = 0.2, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + minintensity = 1, + name = "Laser", + range = 800, + reloadtime = 0.5, + WeaponType = "BeamLaser", + rgbColor = "0 0 1", + rgbColor2 = "0.5 0.5 0.5", + soundTrigger = true, + soundstart = "weapons/Sci Fi Beam 3-short.wav", + -- soundHit = "explosions/mediumcannonhit.wav", + -- sweepfire = true, + texture1 = "lightning", + texture2 = "laserend", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 500, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/eorb_basedef.lua b/Units-Configs-Basedefs/basedefs/eorb_basedef.lua new file mode 100644 index 000000000..dc6434014 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/eorb_basedef.lua @@ -0,0 +1,120 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + + acceleration = 1, + brakeRate = 0.24, + buildCostEnergy = 0, + buildCostMetal = 30, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildPic = "eorb.png", + CanAttack = false, + CanAssist = true, + CanBeAssisted = true, + CanCapture = false, + CanRepair = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Field Medic / Construction Assistant]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + footprintX = 2, + footprintZ = 2, + fireState = "0", + iconType = "orb", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 600, + maxSlope = 90, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "HOVERHBOT2", + moveState = "2", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + --radarDistanceJam = 20, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = true, + side = "ARM", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 1020, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = workerTime, + capturespeed = 0, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + repairspeed = 0.3125, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = buildlist, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + isupgraded = isUpgraded, + RequireTech = tech, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + energycorecollect = true, + armortype = armortype, + noenergycost = true, + area_mex_def = "emetalextractor", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + retreatRangeDAI = buildDistance*2, + + -- groundtexselectimg = ":nc:bitmaps/icons/repairzone.png", + -- groundtexselectxsize = 1000, + -- groundtexselectzsize = 1000, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua new file mode 100644 index 000000000..8db03603a --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua @@ -0,0 +1,88 @@ +unitDef = { + + activatewhenbuilt = false, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 5, + buildpic = [[ehbotfac.png]], + canAttack = false, + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canstop = true, + category = "BUILDING NOTAIR", + description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]], + energyStorage = 0, + energyUse = 0, + energyMake = 0, + explodeAs = "hugeBuildingExplosionGeneric", + footprintX = 10, + footprintZ = 10, + floater = true, + iconType = "factory", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 25, + maxWaterDepth = 99999999999, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGeneric", + showNanoSpray = true, + side = "CORE", + sightDistance = 388, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + workerTime = 1, + yardMap = "cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc ", + -- usePieceCollisionVolumes = true, + -- modelCenterOffset = {108, 10, 0}, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:nano", + "custom:blacksmoke", + "custom:fusionreactionbasic", + }, + }, + buildoptions = hbotFactoryBuildList, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdfactoryselect", + }, + }, + weapons = { + }, + customParams = { + unittype = "factory", + death_sounds = "generic", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[]], + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 20, + BuildingGroundDecalSizeY = 20, + BuildingGroundDecalDecaySpeed = 0.9, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua new file mode 100644 index 000000000..d7868b392 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua @@ -0,0 +1,152 @@ +unitDef = { + + --mobileunit + transportbyenemy = false, + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 750, + builder = false, + buildTime = 5, + buildpic = [[ehbotkarganneth.png]], + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Endbringer Class Freedom Dispenser]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGenericPurple", + footprintX = 8, + footprintZ = 8, + iconType = "leveller", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 17500, + maxSlope = 90, + maxVelocity = 1.75, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERHBOT8", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGenericPurple", + side = "CORE", + sightDistance = 1000, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + badTargetCategory = "WALL BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + machinegun = { + accuracy = 500, + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + minintensity = "1", + name = "Gatling Laser Cannon", + largebeamlaser = true, + laserflaresize = 5, + range = 1000, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/plasma2.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 8, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmored", + }, + damage = { + default = 40, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua new file mode 100644 index 000000000..459209ae2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua @@ -0,0 +1,149 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 22, + builder = false, + buildTime = 5, + buildpic = [[ehbotpeewee.png]], + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + description = [[Raider]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + iconType = "raider", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 90, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERHBOT2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "CORE", + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "flashweapon", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + badTargetCategory = "VTOL ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + flashweapon = { + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "railgun", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", + edgeEffectiveness = 1, + energypershot = 0, + fallOffRate = 0, + duration = 0.25, + impulseFactor = 0, + interceptedByShieldType = 4, + name = "E.M.G.", + range = 650, + reloadtime = 0.5, + --projectiles = 5, + weaponType = "LaserCannon", + soundStart = "weapons/plasma3c.wav", + texture1 = "shot", + texture2 = "empty", + coreThickness = 0.6, + thickness = 6, + tolerance = 10000, + turret = true, + weaponTimer = 1, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + single_hit = true, + isupgraded = isUpgraded, + }, + damage = { + default = 45, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua new file mode 100644 index 000000000..fe4928009 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua @@ -0,0 +1,148 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 40, + builder = false, + buildTime = 5, + buildpic = [[ehbotrocko.png]], + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + description = [[Long-Range Light Main Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericRed", + footprintX = 2, + footprintZ = 2, + --highTrajectory = 2, + iconType = "mtd_lit_all", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 350, + maxSlope = 90, + maxVelocity = 2, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERHBOT2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericRed", + side = "CORE", + sightDistance = 300, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "rockets", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + badTargetCategory = "BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + rockets = { + accuracy = 1000, + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "ehbotrocko-optimized", + explosionGenerator = "custom:genericshellexplosion-large-red", + energypershot = 0, + fireStarter = 70, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "missilesmalllauncher.s3o", + name = "Rockets", + range = 850, + reloadtime = 2.5, + weaponType = "MissileLauncher", + smokeTrail = false, + soundStart = "weapons/emediumtankfire2.wav", + soundHit = "explosions/explode5.wav", + startVelocity = 250, + tolerance = 8000, + turnrate = 30000, + turret = true, + tracks = true, + weaponAcceleration = 400, + flightTime = 5, + weaponVelocity = 3000, + customparams = { + damagetype = "antilightarmored", + isupgraded = isUpgraded, + }, + damage = { + default = 100, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua new file mode 100644 index 000000000..7b88bb421 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua @@ -0,0 +1,153 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 35, + builder = false, + buildTime = 5, + buildpic = [[ehbotsniper.png]], + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + description = [[Light Anti-Armor Tank Destroyer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericPurple", + footprintX = 2, + footprintZ = 2, + --highTrajectory = 2, + iconType = "td_lit_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 2.25, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERHBOT2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericPurple", + side = "CORE", + sightDistance = 300, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "sniper", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + badTargetCategory = "LIGHT VTOL BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + sniper = { + AreaOfEffect = 10, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.5, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-purple", + fallOffRate = 0, + fireStarter = 100, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 900, + reloadtime = 7.5, + WeaponType = "LaserCannon", + rgbColor = "0 0.5 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/snipershot.wav", + soundHit = "explosions/explode5.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 3000, + customparams = { + damagetype = "antilightarmored", + isupgraded = isUpgraded, + }, + damage = { + default = 500, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua new file mode 100644 index 000000000..1737d887d --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua @@ -0,0 +1,150 @@ +unitDef = { + + --mobileunit + transportbyenemy = false; + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 27, + builder = false, + buildTime = 5, + buildpic = [[ehbotthud.png]], + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + description = [[Light Tank Destroyer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGeneric", + footprintX = 2, + footprintZ = 2, + highTrajectory = 2, + iconType = "td_lit_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 325, + maxSlope = 90, + maxVelocity = 2.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERHBOT2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGeneric", + side = "CORE", + sightDistance = 800, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + upright = true, + --usePieceCollisionVolumes = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "plasmacannon", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + badTargetCategory = "VTOL ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + plasmacannon = { + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "thudshot", + --burst = burst, + --burstrate = 0.1, + edgeEffectiveness = 1, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + --duration = 0.25, + highTrajectory = 2, + impulseFactor = 0, + interceptedByShieldType = 4, + name = "Plasma Cannon", + --noExplode = true, + range = 800, + reloadtime = 2, + size = 8, + --projectiles = projectiles, + weaponType = "Cannon", + soundStart = "weapons/bruisercannon.wav", + soundHit = "explosions/mediumcannonhit.wav", + soundTrigger = true, + --sprayAngle = 1000, + tolerance = 10000, + turret = true, + weaponTimer = 1, + weaponVelocity = 600, + customparams = { + damagetype = "antilight", + isupgraded = isUpgraded, + }, + damage = { + default = 150, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua new file mode 100644 index 000000000..0ba9b754f --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua @@ -0,0 +1,153 @@ +unitDef = { + + --mobileunit + transportbyenemy = false, + --cantBeTransported = true, + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 750, + builder = false, + buildTime = 5, + buildpic = [[ehbotkarganneth_turret.png]], + canAttack = true, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Endbringer Class Freedom Dispensation Turret]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGenericPurple", + footprintX = 8, + footprintZ = 8, + iconType = "leveller", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 17500, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "HOVERHBOT8", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGenericPurple", + side = "CORE", + sightDistance = 1000, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + --onlyTargetCategory = "LIGHT ARMORED BIO", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + machinegun = { + accuracy = 500, + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + minintensity = "1", + name = "Gatling Laser Cannon", + largebeamlaser = true, + laserflaresize = 5, + range = 1000, + reloadtime = 0.1, + WeaponType = "BeamLaser", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/plasma2.wav", + scrollspeed = 5, + texture1 = "lightning", + texture2 = "laserend", + thickness = 8, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antiarmored", + }, + damage = { + default = 40*1.33, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua new file mode 100644 index 000000000..295f6a95f --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua @@ -0,0 +1,147 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 72, + builder = false, + buildTime = 5, + canAttack = true, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Anti-Raider Turret]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + floater = true, + footprintX = 2, + footprintZ = 2, + iconType = "turret_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "HOVERHBOT5", + pushResistant = true, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "CORE", + sightDistance = 650, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "flashweapon", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + --onlyTargetCategory = "LIGHT ARMORED BIO", + badTargetCategory = "VTOL ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + flashweapon = { + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "railgun", + rgbColor = "1 0 0", + rgbColor2 = "1 1 1", + explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", + edgeEffectiveness = 1, + energypershot = 0, + fallOffRate = 0, + duration = 0.25, + impulseFactor = 0, + interceptedByShieldType = 4, + name = "E.M.G.", + range = 650, + reloadtime = 0.5, + --projectiles = 5, + weaponType = "LaserCannon", + soundStart = "weapons/plasma3c.wav", + texture1 = "shot", + texture2 = "empty", + coreThickness = 0.6, + thickness = 6, + tolerance = 10000, + turret = true, + weaponTimer = 1, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + single_hit = true, + isupgraded = isUpgraded, + }, + damage = { + default = 45*1.33, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua new file mode 100644 index 000000000..9d86b69c4 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua @@ -0,0 +1,146 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 110, + builder = false, + buildTime = 5, + canAttack = true, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Long-Range Light Main Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericRed", + floater = true, + footprintX = 2, + footprintZ = 2, + --highTrajectory = 2, + iconType = "turret_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 350, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "HOVERHBOT3", + pushResistant = true, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericRed", + side = "CORE", + sightDistance = 300, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "rockets", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + --onlyTargetCategory = "LIGHT ARMORED BIO", + --badTargetCategory = "BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + rockets = { + accuracy = 1000, + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "ehbotrocko-optimized", + explosionGenerator = "custom:genericshellexplosion-large-red", + energypershot = 0, + fireStarter = 70, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "missilesmalllauncher.s3o", + name = "Rockets", + range = 850, + reloadtime = 2.5, + weaponType = "MissileLauncher", + smokeTrail = false, + soundStart = "weapons/emediumtankfire2.wav", + soundHit = "explosions/explode5.wav", + startVelocity = 250, + tolerance = 8000, + turnrate = 1500, + turret = true, + tracks = true, + weaponAcceleration = 100, + flightTime = 3, + weaponVelocity = 1500, + customparams = { + damagetype = "antilightarmored", + isupgraded = isUpgraded, + }, + damage = { + default = 100*1.33, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua new file mode 100644 index 000000000..b48c996e6 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua @@ -0,0 +1,192 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 100, + builder = false, + buildTime = 5, + canAttack = true, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Tank Sniper Turret]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericPurple", + floater = true, + footprintX = 2, + footprintZ = 2, + --highTrajectory = 2, + iconType = "turret_arm", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "HOVERHBOT3", + pushResistant = true, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericPurple", + side = "CORE", + sightDistance = 300, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 475, + unitname = unitName, + --usePieceCollisionVolumes = true, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "sniper", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + --onlyTargetCategory = "LIGHT ARMORED BIO", + badTargetCategory = "LIGHT", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + sniper = { + + AreaOfEffect = 10, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.5, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-purple", + fallOffRate = 0, + fireStarter = 100, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 900, + reloadtime = 7.5, + WeaponType = "LaserCannon", + rgbColor = "0 0.5 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/snipershot.wav", + soundHit = "explosions/explode5.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 9, + tolerance = 1000, + turret = true, + weaponVelocity = 3000, + customparams = { + damagetype = "antilightarmored", + isupgraded = isUpgraded, + }, + damage = { + default = 500*1.33, + }, + }, + + -- flamethrower = { + + -- accuracy = 0, + -- AreaOfEffect = weapon1AOE, + -- avoidFeature = false, + -- avoidFriendly = false, + -- collideFeature = false, + -- collideFriendly = false, + -- edgeEffectiveness = 1, + -- explosionGenerator = "custom:burnblack", + -- coreThickness = 0, + -- duration = 1, + -- energypershot = energycosttofire, + -- fallOffRate = 1, + -- fireStarter = 50, + -- interceptedByShieldType = 4, + -- impulseFactor = 0, + -- soundstart = "weapons/flamethrower1.wav", + -- noexplode = true, + -- minintensity = 1, + -- impulseFactor = 0, + -- name = "Something with Flames", + -- range = 500, + -- reloadtime = 0.1, + -- WeaponType = [[LaserCannon]], + -- rgbColor = "0 0 0", + -- rgbColor2 = "0 0 0", + -- thickness = 0, + -- tolerance = 1000, + -- turret = true, + -- weaponVelocity = 400, + -- customparams = { + -- damagetype = "ehbotpyro", + -- single_hit = true, + -- }, + -- damage = { + -- default = weapon1Damage, + -- }, + -- }, +} diff --git a/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua new file mode 100644 index 000000000..2f948ddfc --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua @@ -0,0 +1,148 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 77, + builder = false, + buildTime = 5, + canAttack = true, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Tank Destroyer Turret]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGeneric", + floater = true, + footprintX = 2, + footprintZ = 2, + highTrajectory = 2, + iconType = "turret_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 325, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "HOVERHBOT3", + pushResistant = true, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGeneric", + side = "CORE", + sightDistance = 800, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 475, + unitname = unitName, + upright = true, + --usePieceCollisionVolumes = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + "custom:airfactoryhtrail", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "plasmacannon", +-- mainDir = "0 0 1", -- x:0 y:0 z:1 => that's forward! +-- maxAngleDif = 70, + --onlyTargetCategory = "LIGHT ARMORED BIO", + badTargetCategory = "VTOL ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + plasmacannon = { + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "thudshot", + --burst = burst, + --burstrate = 0.1, + edgeEffectiveness = 1, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + --duration = 0.25, + highTrajectory = 2, + impulseFactor = 0, + interceptedByShieldType = 4, + name = "Plasma Cannon", + --noExplode = true, + range = 800, + reloadtime = 2, + size = 8, + --projectiles = projectiles, + weaponType = "Cannon", + soundStart = "weapons/bruisercannon.wav", + soundHit = "explosions/mediumcannonhit.wav", + soundTrigger = true, + --sprayAngle = 1000, + tolerance = 10000, + turret = true, + weaponTimer = 1, + weaponVelocity = 600, + customparams = { + damagetype = "antilight", + isupgraded = isUpgraded, + }, + damage = { + default = 150*1.33, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/eartytank_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/eartytank_basedef.lua new file mode 100644 index 000000000..5166c2ad5 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/eartytank_basedef.lua @@ -0,0 +1,178 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 36, + builder = false, + buildTime = 5, + buildpic = "eartytank.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR SUPPORT", + description = [[Self-Propelled Long-Range Artillery]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGeneric", + footprintX = 2, + footprintZ = 2, + iconType = "arty_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxVelocity = 2.3, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, --Because he was the first one to get the "Lobster" pun + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGeneric", + side = "CORE", + sightDistance = 425, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 250, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "Artilleryweapon", + badTargetCategory = "VTOL LIGHT ARMORED BIO", + }, + -- [2] = { + -- def = "SaturationArtilleryweapon", + -- badTargetCategory = "VTOL", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + canareaattack ="1", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- + +weaponDefs = { + Artilleryweapon = { + + accuracy = 500, + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "artyshot2", + avoidNeutral = false, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + + impulseFactor = 0, + interceptedByShieldType = 4, + highTrajectory = 0, + name = "Plasma Cannon", + range = 1300, + reloadtime = 5, + size = 16, + weaponType = "Cannon", + soundHit = "explosions/artyhit.wav", + soundStart = "weapons/arty2.wav", + + turret = true, + weaponVelocity = 500, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuildingarty", + }, + damage = { + default = 200, + }, + }, + + SaturationArtilleryweapon = { + + accuracy = 750, + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "artyshot2", + avoidNeutral = false, + explosionGenerator = "custom:genericshellexplosion-large", + energypershot = 0, + edgeEffectiveness = 1, + + impulseFactor = 0, + interceptedByShieldType = 4, + highTrajectory = 1, + size = 16, + name = "Plasma Cannon", + range = 1300, + reloadtime = 0.5, + weaponType = "Cannon", + soundHit = "explosions/artyhit.wav", + soundStart = "weapons/arty2.wav", + + turret = true, + weaponVelocity = 500, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuildingarty", + }, + damage = { + default = 20, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/eartytanksaturation_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/eartytanksaturation_basedef.lua new file mode 100644 index 000000000..e5cc800e2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/eartytanksaturation_basedef.lua @@ -0,0 +1,144 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 36, + builder = false, + buildTime = 5, + buildpic = "eartytank.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR SUPPORT", + description = [[Self-Propelled Long-Range Saturation Artillery]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGeneric", + footprintX = 2, + footprintZ = 2, + iconType = "arty_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxVelocity = 2.3, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, --Because he was the first one to get the "Lobster" pun + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGeneric", + side = "CORE", + sightDistance = 425, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 250, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "SaturationArtilleryweapon", + badTargetCategory = "VTOL LIGHT ARMORED BIO", + }, + -- [2] = { + -- def = "SaturationArtilleryweapon", + -- badTargetCategory = "VTOL", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + canareaattack ="1", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- + +weaponDefs = { + SaturationArtilleryweapon = { + + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "artyshot3", + avoidNeutral = false, + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + + burst = 20, + burstRate = 0.25, + + impulseFactor = 0, + interceptedByShieldType = 4, + --highTrajectory = 1, + size = 4, + name = "Plasma Cannon", + range = 1300, + reloadtime = 30, + weaponType = "Cannon", + soundHit = "explosions/artyhit.wav", + soundStart = "weapons/arty2.wav", + sprayAngle = 1500, + + turret = true, + weaponVelocity = 500, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuildingarty", + }, + damage = { + default = 100, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/ebasefactory_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/ebasefactory_basedef.lua new file mode 100644 index 000000000..967c8bbc2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/ebasefactory_basedef.lua @@ -0,0 +1,83 @@ +unitDef = { + + activatewhenbuilt = false, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 5, + buildpic = "ebasefactory.png", + canAttack = false, + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canstop = true, + category = "BUILDING NOTAIR", + description = [[Build a Tech Facility to unlock units. Build Supply Depots to increase your army size.]], + energyStorage = 0, + energyUse = 0, + energyMake = 0, + explodeAs = "hugeBuildingExplosionGeneric", + footprintX = 10, + footprintZ = 10, + floater = true, + iconType = "factory", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 25, + maxWaterDepth = 99999999999, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGeneric", + showNanoSpray = true, + side = "CORE", + sightDistance = 388, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + workerTime = 1, + yardMap = "cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc ", + -- usePieceCollisionVolumes = true, + -- modelCenterOffset = {108, 10, 0}, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:nano", + "custom:blacksmoke", + "custom:fusionreactionbasic", + }, + }, + buildoptions = hoverFactoryBuildList, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdfactoryselect", + }, + }, + weapons = { + }, + customParams = { + unittype = "factory", + death_sounds = "generic", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/eheavytank3_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/eheavytank3_basedef.lua new file mode 100644 index 000000000..0b1e3ca52 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/eheavytank3_basedef.lua @@ -0,0 +1,130 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 59, + builder = false, + buildTime = 5, + buildpic = "eheavytank3.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SKIRMISHER", + description = [[Main Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericRed", + footprintX = 2, + footprintZ = 2, + iconType = "td_arm_all", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 375, + maxSlope = 26, + maxVelocity = 3.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericRed", + side = "CORE", + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "heavytankweapon", + onlyTargetCategory = "BIO LIGHT ARMORED BUILDING", + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + } +} + +weaponDefs = { + heavytankweapon = { + AreaOfEffect = 0, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "antiassualtshot2", + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + name = unitName .. "Weapon", + range = 650, + reloadtime = 1, + size = 16, + weaponType = "Cannon", + soundHit = "explosions/42024_digifishmusic_Missile_Strike.wav", + soundStart = "weapons/triotfire.wav", + tolerance = 2000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 150, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/elacerator_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/elacerator_basedef.lua new file mode 100644 index 000000000..6381e3383 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/elacerator_basedef.lua @@ -0,0 +1,128 @@ +unitDef = { + acceleration = 0.18, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 875, + builder = false, + buildTime = 5, + buildpic = "elacerator.png", + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SUPPORT", + description = [[Endbringer Class Nuclear Battle Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericPurple", + footprintX = 6, + footprintZ = 6, + --highTrajectory = 1, + iconType = "lacerator", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 20000, + maxVelocity = 2.3, + maxReverseVelocity = 1, + maxWaterDepth = 20, + metalStorage = 0, + movementClass = "HOVERTANK6", + noChaseCategory = "VTOL", + name = humanName, + objectName = objectName, + script = script, + pushResistant = true, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGenericPurple", + side = "CORE", + sightDistance = 1200, + smoothAnim = true, + stealth = true, + seismicSignature = 4, + transportbyenemy = false; + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "nukeartyweapon", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + death_sounds = "nuke", + RequireTech = tech, + armortype = armortype, + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + +weaponDefs = { + nukeartyweapon = { + accuracy = 500, + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "nukeartyshot", + explosionGenerator = "custom:genericshellexplosion-large-red", + edgeEffectiveness = 0.1, + energypershot = 0, + id = 172, + impulseFactor = 0, + interceptedByShieldType = 4, + name = "Light Cannon", + range = 1200, + reloadtime = 1, + size = 16, + weaponType = "Cannon", + soundHit = "explosions/42024_digifishmusic_Missile_Strike.wav", + soundStart = "weapons/nukeartyshot.wav", + + tolerance = 2000, + turret = true, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "antibuilding", + }, + damage = { + default = 280, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/elighttank3_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/elighttank3_basedef.lua new file mode 100644 index 000000000..7466baccc --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/elighttank3_basedef.lua @@ -0,0 +1,143 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 27, + builder = false, + buildTime = 5, + buildpic = "elighttank3.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR RAID", + description = [[Raider]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + iconType = "raider", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 245, + maxSlope = 26, + maxVelocity = 4.5, + maxReverseVelocity = 2, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallExplosionGenericBlue", + side = "CORE", + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 5.5, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 475, + unitname = unitName, + upright = true, + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:electricity", + "custom:emptydirt", + "custom:blacksmoke", + }, + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "lighttankweapon", + badTargetCategory = "VTOL ARMORED WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- +-- Energy Per Shot Calculation is: dmg / 20 * ((aoe / 1000) + 1) + +weaponDefs = { + lighttankweapon = { + + AreaOfEffect = 25, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + craterBoost = 0, + craterMult = 0, + beamTTL = 10, + explosionGenerator = "custom:genericshellexplosion-small-lightning", + energypershot = 0, + edgeeffectiveness = 1, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + name = "elighttank3weapon", + noSelfDamage = true, + range = 550, + reloadtime = 1, + WeaponType = "LightningCannon", + rgbColor = "0.1 0.2 0.5", + rgbColor2 = "0 0 1", + soundStart = "weapons/lightningstrike.wav", + + texture1 = "lightning", + thickness = 5, + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightbuilding", + }, + damage = { + default = 60, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/emissiletank_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/emissiletank_basedef.lua new file mode 100644 index 000000000..daf2fcce2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/emissiletank_basedef.lua @@ -0,0 +1,149 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.2, + buildCostEnergy = 0, + buildCostMetal = 62, + builder = false, + buildTime = 5, + buildpic = "emissiletank.png", + canAttack = true, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR SUPPORT", + description = [[Missile Support Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGeneric", + footprintX = 2, + footprintZ = 2, + iconType = "mtd_lit_all", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 320, + maxSlope = 26, + maxVelocity = 2.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeExplosionGeneric", + side = "ARM", + sightDistance = 850, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.6, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 300, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:factorysparks", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "missletankweapon", + badTargetCategory = "BUILDING LIGHT", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + canareaattack ="1", + needed_cover = 3, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- +-- Energy Per Shot Calculation is: dmg / 20 * ((aoe / 1000) + 1) + +weaponDefs = { + missletankweapon = { + + AreaOfEffect = 100, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "emissiletanktrail-optimized", + craterBoost = 0, + craterMult = 0, + explosionGenerator = "custom:genericshellexplosion-medium-red", + energypershot = 0, + fireStarter = 100, + flightTime = 5, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + model = "missilesmallvlaunch.s3o", + name = "Rocket", + range = 850, + reloadtime = 3, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explode_large.wav", + soundStart = "weapons/missile_launch1.wav", + + tracks = true, + turnrate = 30000, + + weaponAcceleration = 400, + weaponTimer = 1, + weaponType = "StarburstLauncher", + weaponVelocity = 3000, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 150, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/hover/eriottank2_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/eriottank2_basedef.lua new file mode 100644 index 000000000..6ede05de5 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/eriottank2_basedef.lua @@ -0,0 +1,186 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 25, + builder = false, + buildTime = 5, + buildpic = "eriottank2.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR RIOT", + description = [[EMP/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 4, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericBlue", + side = "CORE", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + badTargetCategory = "WALL", + }, + -- [2] = { + -- def = "riottankshotgun", + -- badTargetCategory = "WALL BUILDING", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- +-- Energy Per Shot Calculation is: dmg / 20 * ((aoe / 1000) + 1) + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "bruisercannon", + explosionGenerator = "custom:genericshellexplosion-medium", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + --projectiles = 10, + range = 500, + reloadtime = 5, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/bruisercannon.wav", + --sprayangle = 2000, + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + }, + damage = { + default = 300, + }, + }, + +} diff --git a/Units-Configs-Basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua b/Units-Configs-Basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua new file mode 100644 index 000000000..0c73a2647 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua @@ -0,0 +1,193 @@ +unitDef = { + acceleration = 1, + brakeRate = 0.1, + buildCostEnergy = 0, + buildCostMetal = 25, + builder = false, + buildTime = 5, + buildpic = "eriottank2.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR RIOT", + description = [[Shotgun/Riot Tank]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + iconType = "riot_lit", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 4, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericBlue", + side = "CORE", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 3.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 430, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- badTargetCategory = "WALL", + -- }, + [1] = { + def = "riottankshotgun", + badTargetCategory = "WALL BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 2, + death_sounds = "generic", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- +-- Energy Per Shot Calculation is: dmg / 20 * ((aoe / 1000) + 1) + +weaponDefs = { + riottankempweapon = { + + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-blue", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + + riottankshotgun = { + AreaOfEffect = 75, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + --burstrate = 0.2, + --burst = 5, + + cegTag = "bruisercannon", + edgeeffectiveness = 1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = 0, + interceptedByShieldType = 4, + impulseFactor = 0, + name = "Shotgun", + noSelfDamage = true, + noexplode = true, + projectiles = 5, + range = 500, + reloadtime = 5, + sprayangle = 3500, + size = 2, + weaponType = "Cannon", + soundHit = "explosions/mediumcannonhit.wav", + soundStart = "weapons/Shotgun Boom 102.wav", + + turret = true, + weaponVelocity = 400, + customparams = { + isupgraded = isUpgraded, + damagetype = "light", + nofriendlyfire = true, + single_hit = true, + }, + damage = { + default = 150, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/scavs/boss/ekrowboss_basedef.lua b/Units-Configs-Basedefs/basedefs/scavs/boss/ekrowboss_basedef.lua new file mode 100644 index 000000000..95bf31280 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/scavs/boss/ekrowboss_basedef.lua @@ -0,0 +1,154 @@ +unitDef = { + --acceleration = 0.5, + airStrafe = false, + airHoverFactor = 0, + BadTargetCategory = "VTOL", + --brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1750, + builder = false, + buildTime = 2.5, + buildpic = "ekrow.png", + canAttack = true, + canFly = true, + canGuard = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRARMORED VTOL", + collide = true, + cruiseAlt = 150, + description = [[Endbringer Flying Fortress]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeExplosionGeneric", + footprintX = 10, + footprintZ = 10, + floater = true, + hoverAttack = true, + iconType = "krow", + idleAutoHeal = .5, + idleTime = 2200, + loopbackattack = false, + maxDamage = 24000, + maxSlope = 90, + maxVelocity = 2.5, + verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeExplosionGeneric", + side = "CORE", + sightDistance = 1050, + smoothAnim = true, + stealth = false, + transportbyenemy = false; + turnRate = 100, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "aircannon", + noChaseCategory = "VTOL LIGHT ARMORED", + badTargetCategory = "VTOL LIGHT ARMORED", + mainDir = "0 -1 0", + maxAngleDif = 170, + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "generic", + nofriendlyfire = "1", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + aircannon = { + AreaOfEffect = 250, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.5, + beamTime = 0.1, + beamTTL = 10, + beamDecay = 1, + burnblow = true, + largeBeamLaser = true, + laserflaresize = 7, + minIntensity = 1, + --cegTag = "railgun", + heightmod = 1, + duration = 0.6, + edgeeffectiveness = 1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-red", + fallOffRate = 0.1, + fireStarter = 50, + impulseFactor = 0, + fallOffRate = 0, + interceptedByShieldType = 4, + minintensity = 1, + name = "Laser", + range = 750, + reloadtime = 1, + WeaponType = "BeamLaser", + waterweapon = true, + rgbColor = "0.4 0.2 0.5", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/eturretfire.wav", + soundHit = "explosions/artyhit.wav", + texture1 = "lightning", + texture2 = "laserend", + thickness = 25, + tolerance = 10000, + turret = true, + weaponVelocity = 750, + customparams = { + damagetype = "antibuilding", + isupgraded = isUpgraded, + }, + damage = { + default = 300, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zairbomber_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zairbomber_basedef.lua new file mode 100644 index 000000000..d8bc01b38 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zairbomber_basedef.lua @@ -0,0 +1,135 @@ +unitDef = { + acceleration = 1, + airStrafe = false, + airHoverFactor = 0, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 60, + buildTime = 2.5, + buildpic = "zaal_unitpics/zairbomber.png", + canAttack = true, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRLIGHT VTOL", + collide = true, + cruiseAlt = 140, + description = [[Heavy Bomber]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 7, + footprintZ = 7, + hoverAttack = false, + iconType = "zbomber", + idleAutoHeal = 2.5, + idleTime = 5, + maxacc = 1, + maxDamage = 812, + maxSlope = 90, + maxVelocity = 12, + maxWaterDepth = 255, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "ARM", + sightDistance = 1000, + smoothAnim = true, + sonarDistance = 0, + transportbyenemy = false; + turnRate = 5000, + turnradius = 250, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + onlytargetcategory = "BUILDING", + def = "WEAPON", + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + factionname = "zaal", + corpse = "energycore", + normaltex = "unittextures/z_normals.dds", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 150, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + burst = 12, + burstrate = 0.2, + --cegTag = "zaalspiketrail-optimized", + explosionGenerator = "custom:genericshellexplosion-medium-red", + energypershot = 0, + fireStarter = 70, + tracks = false, + impulseFactor = 0, + interceptedByShieldType = 4, + model = "ChickenDefenseModels/chickeneggyellow.s3o", + name = "Spikes", + range = 700, + reloadtime = 9, + weaponType = "MissileLauncher", + smokeTrail = false, + soundStart = "weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 4.wav", + --soundHit = "explosions/explode5.wav", + startVelocity = 250, + tolerance = 8000, + turnrate = 0, + predictBoost = 0.5, + turret = true, + weaponAcceleration = 50, + flightTime = 5, + sprayangle = 3000, + weaponVelocity = 1000, + waterWeapon = true, + customparams = { + damagetype = "antibuilding", + nofriendlyfire = 1, + }, + damage = { + default = 250, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zairscout_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zairscout_basedef.lua new file mode 100644 index 000000000..72c8c2cf4 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zairscout_basedef.lua @@ -0,0 +1,89 @@ +unitDef = { + acceleration = 1, + airStrafe = true, + bankscale = "1", + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 5, + buildTime = 2.5, + buildpic = "zaal_unitpics/zairscout.png", + canAttack = true, + canDropFlare = false, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "AIRLIGHT VTOL", + collide = false, + cruiseAlt = 75, + description = [[Fast Scout]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_SMALL", + footprintX = 5, + footprintZ = 5, + hoverAttack = true, + iconType = "zairscout", + idleAutoHeal = 2.5, + idleTime = 5, + maxDamage = 560, + maxSlope = 90, + maxVelocity = 11, + --verticalSpeed = 15, + maxWaterDepth = 0, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_SMALL", + side = "CORE", + sightDistance = 1500, + SonarDistance = 1500, + smoothAnim = true, + stealth = true, + turnRate = 5000, + unitname = unitName, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + }, + customParams = { + unittype = "mobile", + death_sounds = "bug", + normaltex = "unittextures/z_normals.dds", + RequireTech = tech, + armortype = armortype, + supply_cost = supply, + nofriendlyfire = "1", + factionname = "zaal", + retreatRangeDAI = 5000, + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/zaal/zairtoairfighter_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zairtoairfighter_basedef.lua new file mode 100644 index 000000000..4cbde37f2 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zairtoairfighter_basedef.lua @@ -0,0 +1,135 @@ +unitDef = { + acceleration = 1, + airStrafe = false, + airHoverFactor = 0, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 30, + buildTime = 2.5, + buildpic = "zaal_unitpics/zairtoairfighter.png", + canAttack = true, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRLIGHT VTOL", + collide = true, + cruiseAlt = 140, + description = [[Air Superiority]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 3, + footprintZ = 3, + hoverAttack = false, + iconType = "zairtoairfighter", + idleAutoHeal = 2.5, + idleTime = 5, + maxacc = 1, + maxDamage = 812, + maxSlope = 90, + maxVelocity = 20, + maxWaterDepth = 255, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "ARM", + sightDistance = 1000, + smoothAnim = true, + sonarDistance = 0, + transportbyenemy = false; + turnRate = 5000, + turnradius = 250, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + onlytargetcategory = "VTOL", + def = "WEAPON", + maindir = "0 0 1", + maxangledif = 90, + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + factionname = "zaal", + corpse = "energycore", + normaltex = "unittextures/z_normals.dds", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + weapon = { + interceptedByShieldType = 4, + areaofeffect = 32, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + cegTag = "zaalspiketrail-optimized", + burnblow = true, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + impulseboost = 1, + impulsefactor = 1, + interceptedbyshieldtype = 4, + model = "ChickenDefenseModels/spike.s3o", + name = "Spike", + noselfdamage = true, + predictboost = 1, + range = 600, + reloadtime = 1, + smoketrail = true, + soundstart = "ChickenDefenseSounds/talonattack", + startvelocity = 600, + texture1 = "", + texture2 = "sporetrail", + turret = true, + weaponacceleration = 250, + weapontimer = 1, + weaponvelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zairtogroundfighter_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zairtogroundfighter_basedef.lua new file mode 100644 index 000000000..49b9314f0 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zairtogroundfighter_basedef.lua @@ -0,0 +1,133 @@ +unitDef = { + acceleration = 1, + airStrafe = false, + airHoverFactor = 0, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 53, + buildTime = 2.5, + buildpic = "zaal_unitpics/zairtogroundfighter.png", + canAttack = true, + canFly = true, + canGuard = true, + canLoopbackAttack = true, + canMove = true, + canPatrol = true, + canstop = true, + category = "AIRLIGHT VTOL", + collide = true, + cruiseAlt = 140, + description = [[Air to Ground Fighter]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 3, + footprintZ = 3, + hoverAttack = false, + iconType = "zairtogroundfighter", + idleAutoHeal = 2.5, + idleTime = 5, + maxacc = 1, + maxDamage = 812, + maxSlope = 90, + maxVelocity = 15, + maxWaterDepth = 255, + metalStorage = 0, + moverate1 = "8", + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "ARM", + sightDistance = 1000, + smoothAnim = true, + sonarDistance = 0, + transportbyenemy = false; + turnRate = 5000, + turnradius = 250, + unitname = unitName, + upright = true, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + badtargetcategory = "VTOL BUILDING", + def = "WEAPON", + maindir = "0 0 1", + maxangledif = 180, + }, + }, + customParams = { + unittype = "mobile", + -- needed_cover = 2, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + factionname = "zaal", + corpse = "energycore", + normaltex = "unittextures/z_normals.dds", + retreatRangeDAI = 0, + }, +} + +weaponDefs = { + weapon = { + interceptedByShieldType = 4, + accuracy = 1100, + areaofeffect = 24, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + burnblow = true, + cegTag = "zaalspiketrail-optimized", + craterboost = 0, + cratermult = 0, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + impulseboost = 0, + impulsefactor = 0, + interceptedbyshieldtype = 4, + model = "ChickenDefenseModels/spike.s3o", + name = "Spike", + noselfdamage = true, + range = 350, + reloadtime = 2, + soundstart = "ChickenDefenseSounds/talonattack", + startvelocity = 200, + submissile = 1, + turret = true, + waterWeapon = true, + weaponacceleration = 100, + weapontimer = 1, + weaponvelocity = 350, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua new file mode 100644 index 000000000..3527ddae7 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua @@ -0,0 +1,153 @@ +unitDef = { + + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildpic = "zaal_unitpics/zarm.png", + blocking = true, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + cantBeTransported = true, + canGuard = true, + canHover = false, + canMove = false, + canPatrol = false, + canreclaim = true, + canstop = true, + category = "BUILDING", + description = [[Provides Tech/Builds Construction Bugs]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 6, + footprintZ = 6, + iconType = "engineer", + autoHeal = 10, + idleAutoHeal = 25, + idleTime = 5, + levelground = true, + maxDamage = 500, + maxSlope = 90, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + --movementClass = "ZAALKBOT6", + moveState = 2, + name = humanName, + noChaseCategory = "VTOL LIGHT ARMORED BUILDING", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + showNanoSpray = true, + side = "ARM", + sightDistance = 500, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + unitname = unitName, + upright = true, + yardmap = "oooooo oooooo oooooo oooooo oooooo oooooo", + workerTime = 2, + TerraformSpeed = 2147000, + usePieceCollisionVolumes = true, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + buildoptions = Shared.buildListZaalArm, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "BugSelect", + }, + }, + weapons = { + [1] = { + def = "spores1", + --onlyTargetCategory = "VTOL", + }, + }, + customParams = { + iscommander = true, + shownametag = true, + noalert = false, + unittype = "building", + ProvideTech = techprovided, + canbetransported = "false", + needed_cover = 1, + death_sounds = "bug", + armortype = armortype, + normaltex = "unittextures/zarm_normals.dds", + factionname = "zaal", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, +} + +weaponDefs = { + spores1 = { + areaofeffect = 1, + cegTag = "gunshiptrail-optimized", + explosiongenerator = "custom:chickenspike-large-sparks-burn", + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + --canAttackGround = false, + flighttime = 5, + impulsefactor = 0, + name = "Missiles", + noselfdamage = true, + proximitypriority = 3, + range = 2500, + reloadtime = 2.5, + smoketrail = false, + soundhit = "ChickenDefenseSounds/e25", + soundstart = "weapons/zaal/large monster attack/large monster attack 5.wav", + startvelocity = 200, + tolerance = 10000, + tracks = true, + turnrate = 48000, + turret = true, + waterweapon = true, + weaponacceleration = 200, + weapontype = "MissileLauncher", + weaponvelocity = 2500, + customparams = { + damagetype = "antilightarmored", + nofriendlyfire = 1, + }, + damage = { + default = 1000, + }, + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/zaal/zarty_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zarty_basedef.lua new file mode 100644 index 000000000..022029891 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zarty_basedef.lua @@ -0,0 +1,142 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 25, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zarty.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR SUPPORT", + description = [[Self-Propelled Long-Range Artillery]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_SMALL", + footprintX = 3, + footprintZ = 3, + iconType = "zarty", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 300, + maxVelocity = 3.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK3", + name = humanName, --Because he was the first one to get the "Lobster" pun + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_SMALL", + side = "CORE", + sightDistance = 425, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.3, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 250, + unitname = unitName, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:gdhcannon", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "Artilleryweapon", + onlyTargetCategory = "BUILDING", + }, + -- [2] = { + -- def = "SaturationArtilleryweapon", + -- badTargetCategory = "VTOL", + -- }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + + +-------------------------------------------------------------------------------- + +weaponDefs = { + Artilleryweapon = { + + accuracy = 1500, + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + cegTag = "artyshot2", + avoidNeutral = false, + explosionGenerator = "custom:genericshellexplosion-large", + energypershot = 0, + fireSubmersed = false, + + impulseFactor = 0, + interceptedByShieldType = 4, + highTrajectory = 1, + name = "Plasma Cannon", + range = 1500, + reloadtime = 5, + rgbcolor = "0.1 0.6 1", + size = 16, + weaponType = "Cannon", + soundHit = "deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_25.wav", + soundStart = "weapons/zaal/Large monster Growls/Large monster Growls 5.wav", + + turret = true, + waterWeapon = true, + weaponVelocity = 500, + customparams = { + damagetype = "antibuilding", + nofriendlyfire = 1, + }, + damage = { + default = 600, + }, + }, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zassault_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zassault_basedef.lua new file mode 100644 index 000000000..c03dc54e3 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zassault_basedef.lua @@ -0,0 +1,140 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 100, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zassault.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR", + description = [[Armored Assault Defense Buster]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_LARGE", + footprintX = 4, + footprintZ = 4, + iconType = "zassault", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 1750, + maxSlope = 26, + maxVelocity = 4, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_LARGE", + side = "CORE", + sightDistance = 700, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "WEAPON", + --maindir = "0 0 1", + --maxangledif = 180, + badTargetCategory = "NOTAIR", + onlyTargetCategory = "NOTAIR BUILDING", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 200, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-blue", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 250, + reloadtime = 10, + WeaponType = "LaserCannon", + rgbColor = "1 1 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 1.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + waterWeapon = true, + customparams = { + damagetype = "antilightarmored", + nofriendlyfire = 1, + }, + damage = { + default = 1500, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua new file mode 100644 index 000000000..fc8fe1c65 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua @@ -0,0 +1,100 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 10, + builder = true, + buildTime = 5, + buildDistance = buildDistance, + buildpic = "zaal_unitpics/zkamikaze.png", + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + cantBeTransported = true, + canGuard = true, + canHover = false, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR", + description = [[Construction Bug]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_SMALL", + footprintX = 2, + footprintZ = 2, + iconType = "raider", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 50, + maxSlope = 26, + maxVelocity = 10, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ZAALKBOT2", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + showNanoSpray = false, + selfDestructAs = "BUG_DEATH_SMALL", + side = "CORE", + sightDistance = 200, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0.5, + TerraformSpeed = 2147000, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + buildoptions = Shared.buildListZaalConstructor, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + area_mex_def = "zmex", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + noenergycost = true, + armortype = armortype, + --nofriendlyfire = "1", + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zespire1_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zespire1_basedef.lua new file mode 100644 index 000000000..889209b23 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zespire1_basedef.lua @@ -0,0 +1,73 @@ +unitDef = { + + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = 0, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zespire1.png", + blocking = true, + cantBeTransported = true, + canMove = false, + category = "BUILDING", + description = [[Creates Energy]], + energyMake = energyMake, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = false, + footprintX = 8, + footprintZ = 8, + icontype = "generator", + idleAutoHeal = 5, + idleTime = 300, + levelground = true, + maxDamage = 500, + maxSlope = 90, + maxWaterDepth = 99999999999, + metalmake = 0, + metalStorage = 0, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + sightDistance = 250, + smoothAnim = true, + stealth = false, + unitname = unitName, + upright = true, + yardmap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + customParams = { + unittype = "building", + needed_cover = 1, + death_sounds = "bug", + armortype = armortype, + normaltex = "unittextures/zespire1_normals.dds", + factionname = "zaal", + supply_granted = supplygranted, + RequireTech = tech, + noenergycost = true, + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/zaal/zhive_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zhive_basedef.lua new file mode 100644 index 000000000..bc4191c76 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zhive_basedef.lua @@ -0,0 +1,84 @@ +unitDef = { + activatewhenbuilt = true, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = true, + buildTime = 5, + buildpic = "zaal_unitpics/zhatch.png", + canAttack = true, + canBeAssisted = true, + canGuard = true, + canMove = true, + canPatrol = true, + canReclaim = false, + canRepair = true, + canstop = true, + category = "BUILDING NOTAIR", + description = [[Builds new Units - Upgrade to unlock new Tech levels]], +-- energyStorage = energyStorage, +-- energyUse = energyUse, +-- energyMake = energyMake, + explodeAs = "BUG_DEATH_LARGE", + footprintX = 24, + footprintZ = 24, + floater = true, + iconType = "energy", + idleAutoHeal = 5, + idleTime = 300, + maxDamage = 1, + maxSlope = 90, + maxWaterDepth = 99999999999, +-- metalStorage = metalStorage, +-- metalMake = metalMultiplier, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_LARGE", + showNanoSpray = true, + side = "CORE", + sightDistance = 250, + smoothAnim = true, + TEDClass = "PLANT", + unitname = unitName, + -- unitRestricted = 1, + workerTime = 1, + yardMap = [[yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyyy]], + --usePieceCollisionVolumes = true, + -- modelCenterOffset = {108, 10, 0}, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + buildoptions = Shared.buildListZaal, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "BugSelect", + }, + }, + weapons = { + }, + customParams = { + noalert = true, + --ProvideTech = techprovided, + unittype = "building", + death_sounds = "bug", + armortype = "building", + normaltex = "unittextures/zarm_normals.dds", + factionname = "zaal", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 28, + BuildingGroundDecalSizeY = 28, + BuildingGroundDecalDecaySpeed = 0.9, +} diff --git a/Units-Configs-Basedefs/basedefs/zaal/zkamikaze_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zkamikaze_basedef.lua new file mode 100644 index 000000000..430dccb73 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zkamikaze_basedef.lua @@ -0,0 +1,91 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 10, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zkamikaze.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Kamikaze Bug]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_KAMIKAZE", + footprintX = 4, + footprintZ = 4, + iconType = "raider", + idleAutoHeal = 2.5, + idleTime = 5, + kamikaze = true, + kamikazedistance = 50, + leaveTracks = false, + maxDamage = 50, + maxSlope = 26, + maxVelocity = 20, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_KAMIKAZE", + side = "CORE", + sightDistance = 700, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + --nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zlightswarm_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zlightswarm_basedef.lua new file mode 100644 index 000000000..2ceb1e366 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zlightswarm_basedef.lua @@ -0,0 +1,140 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 20, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zlightswarm.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Light Swarmer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_SMALL", + footprintX = 4, + footprintZ = 4, + iconType = "zlightswarm", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 225, + maxSlope = 26, + maxVelocity = 10, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_SMALL", + side = "CORE", + sightDistance = 300, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "WEAPON", + --maindir = "0 0 1", + --maxangledif = 180, + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + --isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + retreatRangeDAI = 20, + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 1, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-blue", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 300, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0.5 0.8 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/zaal/lingspit.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 6, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + waterWeapon = true, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 50, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zmedswarm_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zmedswarm_basedef.lua new file mode 100644 index 000000000..e2f9d5304 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zmedswarm_basedef.lua @@ -0,0 +1,139 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 30, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zmedswarm.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR", + description = [[Medium Swarmer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + footprintX = 4, + footprintZ = 4, + iconType = "zmedswarm", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 300, + maxSlope = 26, + maxVelocity = 7.5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "CORE", + sightDistance = 400, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "WEAPON", + --maindir = "0 0 1", + --maxangledif = 180, + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 1, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-red", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 400, + reloadtime = 0.75, + WeaponType = "LaserCannon", + rgbColor = "1 0.8 0.5", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/zaal/roachspit.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 6, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + waterWeapon = true, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 100, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zmex_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zmex_basedef.lua new file mode 100644 index 000000000..e99913a40 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zmex_basedef.lua @@ -0,0 +1,75 @@ +unitDef = { + + activatewhenbuilt = true, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildingMask = 0, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zmex.png", + canAttack = false, + category = "BUILDING NOTAIR", + description = [[Generates Metal from Resource Nodes]], + energyStorage = 0, + energyUse = energyUse, + energyMake = 0, + explodeAs = "BUG_DEATH_LARGE", + footprintX = 9, + footprintZ = 9, + iconType = "eco", + idleAutoHeal = 5, + idleTime = 300, + maxDamage = 1, + maxSlope = 90, + maxWaterDepth = 99999999999, + metalStorage = 0, + metalMake = 0, + name = humanName, + objectName = objectName, + script = script, + onoffable = true, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_LARGE", + sightDistance = 250, + smoothAnim = true, + unitname = unitName, + yardMap = "ooooooooo ooooooooo ooooooooo ooooooooo ooooooooo ooooooooo ooooooooo ooooooooo ooooooooo", + usePieceCollisionVolumes = false, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + primaryCEG, + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "BugSelect", + }, + }, + weapons = { + }, + customParams = { + RequireTech = tech, + unittype = "building", + metal_extractor = metalMultiplier, + noenergycost = true, + iseco = 1, + death_sounds = "bug", + armortype = "building", + normaltex = "unittextures/zhive_normals.dds", + factionname = "zaal", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture2.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zpyro_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zpyro_basedef.lua new file mode 100644 index 000000000..b8ea4e349 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zpyro_basedef.lua @@ -0,0 +1,140 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 45, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zpyro.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "LIGHT NOTAIR SKIRMISHER", + description = [[Defense Assault]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH", + footprintX = 4, + footprintZ = 4, + iconType = "zpyro", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 500, + maxSlope = 26, + maxVelocity = 6, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH", + side = "CORE", + sightDistance = 250, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "WEAPON", + --maindir = "0 0 1", + --maxangledif = 180, + badTargetCategory = "NOTAIR LIGHT ARMORED", + onlyTargetCategory = "BUILDING NOTAIR", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 100, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-blue", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 250, + reloadtime = 7.5, + WeaponType = "LaserCannon", + rgbColor = "1 1 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/zaal/Medium monster attack/Medium monster attack 4.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 20, + tolerance = 1000, + turret = true, + waterWeapon = true, + weaponVelocity = 2000, + customparams = { + damagetype = "antilightbuilding", + nofriendlyfire = 1, + }, + damage = { + default = 600, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zqueen_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zqueen_basedef.lua new file mode 100644 index 000000000..417699d82 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zqueen_basedef.lua @@ -0,0 +1,340 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 500, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zqueen.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR", + description = [[Queen]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_LARGE", + footprintX = 4, + footprintZ = 4, + iconType = "zqueen", + idleAutoHeal = 10, + idleTime = 5, + leaveTracks = false, + maxDamage = 5000, + maxSlope = 26, + maxVelocity = 3.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_LARGE", + side = "CORE", + sightDistance = 700, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "MELEE", + maindir = "0 0 1", + maxangledif = 155, + }, + [2] = { + badtargetcategory = "NOTAIR", + def = "SPORES1", + }, + [3] = { + def = "SPORES2", + }, + [4] = { + def = "SPORES3", + }, + [5] = { + def = "GOO", + maindir = "0 0 1", + maxangledif = 180, + onlytargetcategory = "NOTAIR BUILDING", + badtargetcategory = "NOTAIR", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bugqueen", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + +weaponDefs = { + goo = { + interceptedByShieldType = 4, + accuracy = 300, + areaofeffect = 200, + avoidfeature = 0, + avoidfriendly = 0, + burst = 8, + burstrate = 0.01, + cegtag = "missiletrailgunshiplesssmokey", + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.33, + explosiongenerator = "custom:gundam_MISSILE_EXPLOSION", + impulseboost = 0, + impulsefactor = 0, + intensity = 0.7, + interceptedbyshieldtype = 1, + model = "ChickenDefenseModels/SGreyRock1.S3O", + name = "Blob", + noselfdamage = true, + proximitypriority = -4, + range = 1200, + reloadtime = 5, + rgbcolor = "0.1 0.6 1", + size = 8, + sizedecay = 0, + soundhit = "ChickenDefenseSounds/e16", + soundstart = "weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 10.wav", + soundTrigger = true, + sprayangle = 6000, + tolerance = 5000, + turret = true, + weapontimer = 0.2, + weaponvelocity = 400, + customparams = { + damagetype = "antilightarmored", + nofriendlyfire = 1, + }, + damage = { + default = 200, + }, + }, + melee = { + interceptedByShieldType = 4, + areaofeffect = 200, + avoidfeature = 0, + avoidfriendly = 0, + camerashake = 0, + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + impulseboost = 1.5, + impulsefactor = 1.5, + name = "ChickenClaws", + noselfdamage = true, + proximitypriority = -3, + range = 280, + reloadtime = 2.5, + model = "ChickenDefenseModels/spike.s3o", + soundstart = "weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 7.wav", + tolerance = 5000, + turret = true, + waterweapon = true, + weapontype = "Cannon", + weaponvelocity = 2500, + customparams = { + damagetype = "antilightarmored", + nofriendlyfire = 1, + }, + damage = { + default = 600, + }, + }, + spores1 = { + interceptedByShieldType = 4, + areaofeffect = 72, + avoidfriendly = 0, + burnblow = 1, + burst = 3, + burstrate = 0.11, + collidefriendly = false, + craterboost = 0, + cratermult = 0, + dance = 20, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + firestarter = 0, + flighttime = 5, + groundbounce = 1, + heightmod = 0.5, + impulseboost = 0, + impulsefactor = 0.4, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "ChickenDefenseModels/spike.s3o", + name = "Missiles", + noselfdamage = true, + proximitypriority = 3, + range = 700, + reloadtime = 1.5, + smoketrail = true, + soundhit = "ChickenDefenseSounds/e25", + soundstart = "weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 1.wav", + startvelocity = 200, + texture1 = "", + texture2 = "sporetrail", + tolerance = 10000, + tracks = true, + trajectoryheight = 2, + turnrate = 48000, + turret = true, + waterweapon = true, + weaponacceleration = 200, + weapontype = "MissileLauncher", + weaponvelocity = 1000, + wobble = 64000, + customparams = { + damagetype = "antiarmoredair", + nofriendlyfire = 1, + }, + damage = { + default = 145, + }, + }, + spores2 = { + interceptedByShieldType = 4, + areaofeffect = 72, + avoidfeature = 0, + avoidfriendly = false, + burnblow = 1, + burst = 3, + burstrate = 0.09, + collidefriendly = false, + craterboost = 0, + cratermult = 0, + dance = 20, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + firestarter = 0, + flighttime = 5, + groundbounce = 1, + heightmod = 0.5, + impulseboost = 0, + impulsefactor = 0.4, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "ChickenDefenseModels/spike.s3o", + name = "Missiles", + noselfdamage = true, + range = 700, + reloadtime = 1.25, + smoketrail = true, + soundhit = "ChickenDefenseSounds/e25", + soundstart = "weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 2.wav", + startvelocity = 200, + texture1 = "", + texture2 = "sporetrail", + tolerance = 10000, + tracks = true, + trajectoryheight = 2, + turnrate = 48000, + turret = true, + waterweapon = true, + weaponacceleration = 200, + weapontype = "MissileLauncher", + weaponvelocity = 1000, + wobble = 64000, + customparams = { + damagetype = "antiarmoredair", + nofriendlyfire = 1, + }, + damage = { + default = 145, + }, + }, + spores3 = { + interceptedByShieldType = 4, + areaofeffect = 72, + avoidfriendly = false, + burnblow = 1, + burst = 3, + burstrate = 0.1, + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + dance = 20, + explosiongenerator = "custom:chickenspike-large-sparks-burn", + firestarter = 0, + flighttime = 5, + groundbounce = 1, + heightmod = 0.5, + impulseboost = 0, + impulsefactor = 0.4, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "ChickenDefenseModels/spike.s3o", + name = "Missiles", + noselfdamage = true, + proximitypriority = -3, + range = 700, + reloadtime = 1.75, + smoketrail = true, + soundhit = "ChickenDefenseSounds/e25", + soundstart = "weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 3.wav", + startvelocity = 200, + texture1 = "", + texture2 = "sporetrail", + tolerance = 10000, + tracks = true, + trajectoryheight = 2, + turnrate = 48000, + turret = true, + waterweapon = true, + weaponacceleration = 200, + weapontype = "MissileLauncher", + weaponvelocity = 1000, + wobble = 64000, + customparams = { + damagetype = "antiarmoredair", + nofriendlyfire = 1, + }, + damage = { + default = 145, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/zskirmisher_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zskirmisher_basedef.lua new file mode 100644 index 000000000..bd35f97a7 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/zskirmisher_basedef.lua @@ -0,0 +1,139 @@ +unitDef = { + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 35, + builder = false, + buildTime = 5, + buildpic = "zaal_unitpics/zskirmisher.png", + canAttack = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR SKIRMISHER", + description = [[Armored Skirmisher]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + footprintX = 4, + footprintZ = 4, + iconType = "zskirmisher", + idleAutoHeal = 2.5, + idleTime = 5, + leaveTracks = false, + maxDamage = 400, + maxSlope = 26, + maxVelocity = 6.5, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalStorage = 0, + movementClass = "ZAALKBOT4", + name = humanName, + noChaseCategory = "VTOL", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "CORE", + sightDistance = 450, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + transportbyenemy = false; + -- turnInPlace = false, + -- turnInPlaceSpeedLimit = 2.8, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 350, + unitname = unitName, + upright = true, + workerTime = 0, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + "custom:blood_explode", + "custom:emptydirt", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "WEAPON", + --maindir = "0 0 1", + --maxangledif = 180, + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + isupgraded = isUpgraded, + unittype = "mobile", + canbetransported = "true", + needed_cover = 3, + death_sounds = "bug", + RequireTech = tech, + armortype = armortype, + nofriendlyfire = "1", + supply_cost = supply, + normaltex = "unittextures/z_normals.dds", + factionname = "zaal", + --corpse = "energycore", + }, +} + +weaponDefs = { + weapon = { + AreaOfEffect = 1, + avoidFeature = false, + avoidFriendly = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.3, + duration = 0.1, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-small-green", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 450, + reloadtime = 2, + WeaponType = "LaserCannon", + rgbColor = "0.5 1 0.5", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/zaal/large monster attack/large monster attack 1.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 6, + tolerance = 1000, + turret = true, + weaponVelocity = 2000, + waterWeapon = true, + customparams = { + damagetype = "antilightarmored", + nofriendlyfire = 1, + }, + damage = { + default = 300, + }, + }, +} \ No newline at end of file diff --git a/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua new file mode 100644 index 000000000..02ae7dd4e --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua @@ -0,0 +1,104 @@ +unitDef = { + + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildpic = "zaal_unitpics/ztenticle.png", + blocking = true, + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + cantBeTransported = true, + canGuard = true, + canHover = false, + canMove = false, + canPatrol = false, + canreclaim = true, + canstop = true, + category = "BUILDING", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 3, + footprintZ = 3, + iconType = "engineer", + autoHeal = 10, + idleAutoHeal = 25, + idleTime = 5, + levelground = true, + maxDamage = 500, + maxSlope = 90, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + --movementClass = "ZAALKBOT6", + moveState = 2, + name = humanName, + noChaseCategory = "VTOL LIGHT ARMORED BUILDING", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + showNanoSpray = true, + side = "ARM", + sightDistance = 500, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + unitname = unitName, + upright = true, + yardmap = "ooo ooo ooo", + workerTime = 1, + TerraformSpeed = 2147000, + usePieceCollisionVolumes = true, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "BugSelect", + }, + }, + customParams = { + unittype = "building", + ProvideTech = techprovided, + canbetransported = "false", + needed_cover = 1, + death_sounds = "bug", + armortype = armortype, + normaltex = "unittextures/zarm_normals.dds", + factionname = "zaal", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/zaal/ztiberium_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/ztiberium_basedef.lua new file mode 100644 index 000000000..6da997f27 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/ztiberium_basedef.lua @@ -0,0 +1,77 @@ +unitDef = { + activateWhenBuilt = true, + buildAngle = 8196, + buildCostEnergy = 0, + buildCostMetal = 15, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + description = [[Provides +]] .. supplygranted .. [[ Supply • Provides +]] .. storage .. [[ Metal/Energy Storage]], + energyStorage = storage, + metalStorage = storage, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + footprintX = 4, + footprintZ = 4, + idleAutoHeal = .5, + idleTime = 2200, + icontype = "storage", + maxDamage = 500, + maxSlope = 90, + maxWaterDepth = 99999999999, + name = humanName, + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + side = "CORE", + sightDistance = 250, + smoothAnim = true, + unitname = unitName, + workerTime = 0, + yardMap = [[oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo]], + + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + BugSelect, + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 2, + supply_granted = supplygranted, + death_sounds = "bug", + armortype = "building", + noenergycost = true, + normaltex = "unittextures/ztiberium_normals.dds", + factionname = "zaal", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units-Configs-Basedefs/basedefs/zaal/ztumor_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/ztumor_basedef.lua new file mode 100644 index 000000000..8c6a22e63 --- /dev/null +++ b/Units-Configs-Basedefs/basedefs/zaal/ztumor_basedef.lua @@ -0,0 +1,118 @@ +unitDef = { + + buildCostEnergy = 0, + buildCostMetal = 5, + buildDistance = buildDistance, + builder = true, + buildTime = 10, + buildpic = "zaal_unitpics/ztumor.png", + blocking = false, + CanAttack = true, + CanAssist = false, + canBeAssisted = false, + CanCapture = false, + CanRepair = false, + canRestore = false, + cantBeTransported = true, + canGuard = false, + canHover = false, + canMove = false, + canPatrol = false, + canreclaim = false, + canstop = true, + category = "BUILDING", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 0, + decloakOnFire = false, + decloakSpherical = true, + initCloaked = true, + + -- End Cloaking + + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "BUG_DEATH_MEDIUM", + floater = true, + footprintX = 2, + footprintZ = 2, + iconType = "boxsmall", + levelground = false, + maxDamage = 100, + maxSlope = 90, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + --movementClass = "ZAALKBOT6", + moveState = 2, + name = humanName, + noChaseCategory = "VTOL LIGHT ARMORED BUILDING", + objectName = objectName, + script = script, + radarDistance = 0, + repairable = false, + selfDestructAs = "BUG_DEATH_MEDIUM", + showNanoSpray = false, + sightDistance = 0, + smoothAnim = true, + stealth = false, + seismicDistance = buildDistance, + seismicSignature = 2, + unitname = unitName, + upright = false, + yardmap = "oooo oooo oooo oooo", + workerTime = 1, + TerraformSpeed = 2147000, + usePieceCollisionVolumes = false, + sfxtypes = { + pieceExplosionGenerators = { + "blood_spray", + }, + + explosiongenerators = { + "custom:blood_spray", + }, + }, + buildoptions = Shared.buildListZaalTumor, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "BugSelect", + }, + }, + customParams = { + unittype = "building", + --area_mex_def = "zhatch", + --ProvideTech = techprovided, + unitdefbuildtime = true, + decloakradiusmodifier = 1, + canbetransported = "false", + needed_cover = 1, + death_sounds = "bug", + armortype = armortype, + normaltex = "unittextures/ztumor_normals.dds", + factionname = "zaal", + }, + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Federation of Kala - Faction 1/f1landfac.lua b/Units/Federation of Kala - Faction 1/f1landfac.lua new file mode 100644 index 000000000..500e7c3ed --- /dev/null +++ b/Units/Federation of Kala - Faction 1/f1landfac.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- f1landfac -- +-------------------------------------------------------------------------------- + +unitName = "f1landfac" + +-------------------------------------------------------------------------------- + +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Land Factory]] + +objectName = "eallterrfac2.s3o" +script = "eallterrfac2.cob" + +AllTerrainFactoryBuildList = Shared.buildListf1landfac + +VFS.Include("units-configs-basedefs/basedefs/allterrain/eminifac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Federation of Kala - Faction 1/fedcommander.lua b/Units/Federation of Kala - Faction 1/fedcommander.lua new file mode 100644 index 000000000..d519aa1de --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedcommander.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- fedcommander -- +-------------------------------------------------------------------------------- + +unitName = [[fedcommander]] + +-------------------------------------------------------------------------------- + +humanname = [[Federation of Kala Command Unit]] +buildpicture = [[ecommander.png]] + +armortype = [[light]] +supplygiven = [[0]] +techprovided = [[tech0, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 2000 +maxvelocity = 3 +workertime = 1 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[ecommander4-battle.s3o]] +script = [[ecommander4-battle.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListFed + +weapon1 = [[machinegun]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Federation of Kala - Faction 1/fedcommander_up1.lua b/Units/Federation of Kala - Faction 1/fedcommander_up1.lua new file mode 100644 index 000000000..a87ffbac0 --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedcommander_up1.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- fedcommander_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[fedcommander_up1]] + +-------------------------------------------------------------------------------- + +humanname = [[Federation of Kala Command Unit]] +buildpicture = [[ecommander.png]] + +armortype = [[light]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 5000 +maxvelocity = 3 +workertime = 2 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[ecommander4-battle.s3o]] +script = [[ecommander4-battle.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListFed + +weapon1 = [[machinegun_up1]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Federation of Kala - Faction 1/fedcommander_up2.lua b/Units/Federation of Kala - Faction 1/fedcommander_up2.lua new file mode 100644 index 000000000..963973cea --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedcommander_up2.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- fedcommander_up2 -- +-------------------------------------------------------------------------------- + +unitName = [[fedcommander_up2]] + +-------------------------------------------------------------------------------- + +humanname = [[Federation of Kala Command Unit]] +buildpicture = [[ecommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 10000 +maxvelocity = 3 +workertime = 3 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[ecommander4-battle.s3o]] +script = [[ecommander4-battle.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListFed + +weapon1 = [[machinegun_up2]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Federation of Kala - Faction 1/fedcommander_up3.lua b/Units/Federation of Kala - Faction 1/fedcommander_up3.lua new file mode 100644 index 000000000..ad8734c6b --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedcommander_up3.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- fedcommander_up3 -- +-------------------------------------------------------------------------------- + +unitName = [[fedcommander_up3]] + +-------------------------------------------------------------------------------- + +humanname = [[Federation of Kala Command Unit]] +buildpicture = [[ecommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, tech3, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 15000 +maxvelocity = 3 +workertime = 4 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[ecommander4-battle.s3o]] +script = [[ecommander4-battle.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListFed + +weapon1 = [[machinegun_up3]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Federation of Kala - Faction 1/fedcommander_up4.lua b/Units/Federation of Kala - Faction 1/fedcommander_up4.lua new file mode 100644 index 000000000..2ab6d4885 --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedcommander_up4.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- fedcommander_up4 -- +-------------------------------------------------------------------------------- + +unitName = [[fedcommander_up4]] + +-------------------------------------------------------------------------------- + +humanname = [[Federation of Kala BattleMech Command Unit]] +buildpicture = [[ecommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, tech3, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 20000 +maxvelocity = 3 +workertime = 5 + +movementclass = [[COMMANDERTANK6]] + +objectname = [[ecommander4-battle-large.s3o]] +script = [[ecommander4-battle.cob]] + +footprintx = 6 +footprintz = 6 + +buildlist = Shared.buildListFed + +weapon1 = [[heavybeamweapon]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Federation of Kala - Faction 1/fedengineer.lua b/Units/Federation of Kala - Faction 1/fedengineer.lua new file mode 100644 index 000000000..bf8bf40f4 --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedengineer.lua @@ -0,0 +1,131 @@ +-- UNITDEF -- FEDENGINEER -- +-------------------------------------------------------------------------------- + +local unitName = "fedengineer" + +-------------------------------------------------------------------------------- + +local buildCostMetal = 40 +local maxDamage = 400 +local buildDistance = 350 + +local armortype = [[light]] +--local supply = [[2]] + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + + acceleration = 1, + brakeRate = 0.24, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildpic = "ehbotengineer.png", + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + footprintX = 2, + footprintZ = 2, + iconType = "engineer", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = maxDamage, + maxSlope = 90, + maxVelocity = 4.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalmake = 0, + metalStorage = 0, + movementClass = "HOVERHBOT2", + moveState = "2", + name = "The Lifter", + objectName = "ehbotengineer2.s3o", + script = "ehbotengineer_lus.lua", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = false, + side = "ARM", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 1020, + unitname = unitName, + upright = true, + workerTime = 1, + capturespeed = 1, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildListFed, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = [[tech0]], + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, + noenergycost = true, +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Federation of Kala - Faction 1/fedengineer_turret.lua b/Units/Federation of Kala - Faction 1/fedengineer_turret.lua new file mode 100644 index 000000000..a4f7f73b8 --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedengineer_turret.lua @@ -0,0 +1,129 @@ +-- UNITDEF -- FEDENGINEER_turret -- +-------------------------------------------------------------------------------- + +local unitName = "fedengineer_turret" + +-------------------------------------------------------------------------------- + +local buildCostMetal = 90 +local maxDamage = 400 +local buildDistance = 800 + +local armortype = [[light]] +--local supply = [[2]] + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + + acceleration = 1, + brakeRate = 0.24, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + buildpic = "ehbotengineer_turret.png", + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + floater = true, + footprintX = 2, + footprintZ = 2, + iconType = "engineer", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = maxDamage, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "HOVERHBOT2", + moveState = "0", + pushResistant = true, + name = "The Lifter Turret", + objectName = "ehbotengineer_turret.s3o", + script = "ehbotengineer_turret_lus.lua", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = false, + side = "ARM", + sightDistance = buildDistance, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + -- turnInPlace = false, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 1020, + unitname = unitName, + upright = true, + workerTime = 1, + capturespeed = 1, + TerraformSpeed = 100000, + ReclaimSpeed = 0, + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildListTurret, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Federation of Kala - Faction 1/fedorb.lua b/Units/Federation of Kala - Faction 1/fedorb.lua new file mode 100644 index 000000000..7e5cda2da --- /dev/null +++ b/Units/Federation of Kala - Faction 1/fedorb.lua @@ -0,0 +1,29 @@ +-------------------------------------------------------------------------------- + +unitName = [[fedorb]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[O.R.B.]] + +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] + +workerTime = 1 +buildDistance = 350 + +tech = [[tech0]] +armortype = [[light]] + +buildlist = Shared.fedOrb + +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/f2landfac.lua b/Units/Loz Alliance - Faction 2/f2landfac.lua new file mode 100644 index 000000000..3084be068 --- /dev/null +++ b/Units/Loz Alliance - Faction 2/f2landfac.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- f2landfac -- +-------------------------------------------------------------------------------- + +unitName = "f2landfac" + +-------------------------------------------------------------------------------- + +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Land Factory]] + +objectName = "ehoverfactory.s3o" +script = "ehoverfac.cob" + +hoverFactoryBuildList = Shared.buildListf2landfac + +VFS.Include("units-configs-basedefs/basedefs/hover/ebasefactory_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Loz Alliance - Faction 2/lozcommander.lua b/Units/Loz Alliance - Faction 2/lozcommander.lua new file mode 100644 index 000000000..35fb813d4 --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozcommander.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- lozcommander -- +-------------------------------------------------------------------------------- + +unitName = [[lozcommander]] + +-------------------------------------------------------------------------------- + +humanname = [[Loz Alliance Command Unit]] +buildpicture = [[lozcommander.png]] + +armortype = [[light]] +supplygiven = [[0]] +techprovided = [[tech0, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 2000 +maxvelocity = 3 +workertime = 1 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[lozcommandtank.s3o]] +script = [[lozcommandtank.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListLoz + +weapon1 = [[machinegun]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/lozcommander_up1.lua b/Units/Loz Alliance - Faction 2/lozcommander_up1.lua new file mode 100644 index 000000000..766a128e9 --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozcommander_up1.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- lozcommander_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[lozcommander_up1]] + +-------------------------------------------------------------------------------- + +humanname = [[Loz Alliance Command Unit]] +buildpicture = [[lozcommander.png]] + +armortype = [[light]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 5000 +maxvelocity = 3 +workertime = 2 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[lozcommandtank.s3o]] +script = [[lozcommandtank.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListLoz + +weapon1 = [[machinegun_up1]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/lozcommander_up2.lua b/Units/Loz Alliance - Faction 2/lozcommander_up2.lua new file mode 100644 index 000000000..21cc0678f --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozcommander_up2.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- lozcommander_up2 -- +-------------------------------------------------------------------------------- + +unitName = [[lozcommander_up2]] + +-------------------------------------------------------------------------------- + +humanname = [[Loz Alliance Command Unit]] +buildpicture = [[lozcommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 10000 +maxvelocity = 3 +workertime = 3 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[lozcommandtank.s3o]] +script = [[lozcommandtank.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListLoz + +weapon1 = [[machinegun_up2]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/lozcommander_up3.lua b/Units/Loz Alliance - Faction 2/lozcommander_up3.lua new file mode 100644 index 000000000..450f6b89e --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozcommander_up3.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- lozcommander_up3 -- +-------------------------------------------------------------------------------- + +unitName = [[lozcommander_up3]] + +-------------------------------------------------------------------------------- + +humanname = [[Loz Alliance Command Unit]] +buildpicture = [[lozcommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, tech3, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 15000 +maxvelocity = 3 +workertime = 4 + +movementclass = [[COMMANDERTANK4]] + +objectname = [[lozcommandtank.s3o]] +script = [[lozcommandtank.cob]] + +footprintx = 4 +footprintz = 4 + +buildlist = Shared.buildListLoz + +weapon1 = [[machinegun_up3]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/lozcommander_up4.lua b/Units/Loz Alliance - Faction 2/lozcommander_up4.lua new file mode 100644 index 000000000..659d98e1a --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozcommander_up4.lua @@ -0,0 +1,39 @@ +-- UNITDEF -- lozcommander_up4 -- +-------------------------------------------------------------------------------- + +unitName = [[lozcommander_up4]] + +-------------------------------------------------------------------------------- + +humanname = [[Loz Alliance BattleMech Command Unit]] +buildpicture = [[lozcommander.png]] + +armortype = [[armored]] +supplygiven = [[0]] +techprovided = [[tech0, tech1, tech2, tech3, -overseer]] +techrequired = [[0 overseer]] + +maxdamage = 20000 +maxvelocity = 3 +workertime = 5 + +movementclass = [[COMMANDERTANK6]] + +objectname = [[lozcommandtank-battle.s3o]] +script = [[lozcommandtank.cob]] + +footprintx = 6 +footprintz = 6 + +buildlist = Shared.buildListLoz + +weapon1 = [[heavybeamweapon]] + +VFS.Include("units-configs-basedefs/basedefs/commander_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/Loz Alliance - Faction 2/lozengineer.lua b/Units/Loz Alliance - Faction 2/lozengineer.lua new file mode 100644 index 000000000..887c96b22 --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozengineer.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- lozengineer -- +-------------------------------------------------------------------------------- + +unitName = "lozengineer" + +-------------------------------------------------------------------------------- + +buildCostMetal = 40 +buildDistance = 350 + +maxDamage = 500 + +humanName = [[Architect]] + +objectName = [[f2engineer.s3o]] +script = [[f2engineer_lus.lua]] + +armortype = [[light]] + +VFS.Include("units-configs-basedefs/basedefs/Faction 2/f2engineer_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/Loz Alliance - Faction 2/lozorb.lua b/Units/Loz Alliance - Faction 2/lozorb.lua new file mode 100644 index 000000000..57b3fc328 --- /dev/null +++ b/Units/Loz Alliance - Faction 2/lozorb.lua @@ -0,0 +1,29 @@ +-------------------------------------------------------------------------------- + +unitName = [[lozorb]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[O.R.B.]] + +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] + +workerTime = 1 +buildDistance = 350 + +tech = [[tech0]] +armortype = [[light]] + +buildlist = Shared.lozOrb + +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/aiunits/ecommanderbattleai.lua b/Units/aiunits/ecommanderbattleai.lua new file mode 100644 index 000000000..17be64ed9 --- /dev/null +++ b/Units/aiunits/ecommanderbattleai.lua @@ -0,0 +1,326 @@ +-- UNITDEF -- ECOMMANDERBATTLEAI -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderbattleai" + +-------------------------------------------------------------------------------- +local armortype = [[armored]] +local supplyGiven = [[0]] +local techprovided = [[tech0, tech1, tech2, tech3, 1 tech0ai]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + +local weapon2Damage = 25 +local weapon2AOE = 10 +local energycosttofire2 = weapon2Damage / 10 * ((weapon2AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false, + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 500, + buildDistance = 1000, + builder = true, + buildTime = 25, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = true, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT ARMORED", + description = [[AI Overseer • Builds Units • Provides support in battles]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 5000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 9500, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Battle Overseer (AI)", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 1000, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 1000, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 100000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 100, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 20, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + waterweapon = true, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + waterweapon = true, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, + machinegun = { + accuracy = 300, + AreaOfEffect = weapon2AOE, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + + coreThickness = 0.5, + duration = 0.1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = energycosttofire2, + fallOffRate = 1, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Machine Gun", + range = 800, + reloadtime = 0.05, + WeaponType = "LaserCannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/tankdestroyerfire.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 5, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + waterweapon = true, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = weapon2Damage, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/aiunits/ecommanderbuildai.lua b/Units/aiunits/ecommanderbuildai.lua new file mode 100644 index 000000000..2ab3e6c75 --- /dev/null +++ b/Units/aiunits/ecommanderbuildai.lua @@ -0,0 +1,290 @@ +-- UNITDEF -- ECOMMANDERBUILD -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderbuildai" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 1500, + builder = true, + buildTime = 2.5, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units x3 as fast]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 20000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Builder Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 3, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 1.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[Armortype: ]] ..armortype.. [[ +x3 Buildpower + +1000 EMP Damage vs Light/Armored/Building + +Reclaims any energy cores within it's proximity.]], + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 5, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/aiunits/ecommandercloakai.lua b/Units/aiunits/ecommandercloakai.lua new file mode 100644 index 000000000..1e81ab080 --- /dev/null +++ b/Units/aiunits/ecommandercloakai.lua @@ -0,0 +1,296 @@ +-- UNITDEF -- ECOMMANDERCLOAK -- +-------------------------------------------------------------------------------- + +local unitName = "ecommandercloakai" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 1000, + builder = true, + buildTime = 2.5, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units • Provides Cloak Field]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 30000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Cloaking Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3.cob", + radarDistance = 0, + radarDistanceJam = 800, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + + area_cloak = 1, -- Can this unit emit a cloaking field? + area_cloak_upkeep = 0, -- How much energy does it cost to maintain the cloaking field? + area_cloak_radius = 1000, -- How large is the cloaking field? + --area_cloak_grow_rate = 200, -- When the cloaking field is turned on, how fast does the field expand to it's full size? + --area_cloak_shrink_rate = 200, -- When the cloaking field is turned off, how fast does the field shrink to nothingness? + area_cloak_decloak_distance = 150, -- How close does something have to be in order to decloak a unit within a cloaking shield? + area_cloak_init = true, -- Start up the cloak shield the moment the unit is built? + area_cloak_draw = true, -- No idea what this does + area_cloak_self = true, -- Does the cloak shield cloak the unit emitting it? + + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/aiunits/ecommanderfactoryai.lua b/Units/aiunits/ecommanderfactoryai.lua new file mode 100644 index 000000000..ebd3b3d4b --- /dev/null +++ b/Units/aiunits/ecommanderfactoryai.lua @@ -0,0 +1,284 @@ +-- UNITDEF -- ECOMMANDERFACTORY -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderfactoryai" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[15]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 500, + builder = true, + buildTime = 2.5, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Creates buildings and mobile units • Gives ]] ..supplyGiven.. [[ Supply]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 30000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Factory Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 3, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 1.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildListFactory, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/aiunits/ecommanderhealerai.lua b/Units/aiunits/ecommanderhealerai.lua new file mode 100644 index 000000000..6ba73bd90 --- /dev/null +++ b/Units/aiunits/ecommanderhealerai.lua @@ -0,0 +1,284 @@ +-- UNITDEF -- ECOMMANDER -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderhealerai" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 1000, + builder = true, + buildTime = 2.5, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 10000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Healer Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "riottankempweapon", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/aiunits/ecommandershieldai.lua b/Units/aiunits/ecommandershieldai.lua new file mode 100644 index 000000000..4038038f4 --- /dev/null +++ b/Units/aiunits/ecommandershieldai.lua @@ -0,0 +1,324 @@ +-- UNITDEF -- ECOMMANDERSHIELD -- +-------------------------------------------------------------------------------- + +local unitName = "ecommandershieldai" + +-------------------------------------------------------------------------------- + +local armortype = [[armored]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local shield1Power = 5000 +local shield1PowerRegen = 50 +local shield1PowerRegenEnergy = 0 + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 1000, + builder = true, + buildTime = 2.5, + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = false, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units • Provides large shielding]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + hideDamage = true, + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 15000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Shielded Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3shield.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + [1] = { + def = "shield", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[Armortype: ]] ..armortype.. [[ + +Generates a large shield + +Reclaims any energy cores within it's proximity.]], + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + shield = { + + Smartshield = true, + Exteriorshield = true, + Visibleshield = false, + Visibleshieldrepulse = false, + ShieldStartingPower = 0, + Shieldenergyuse = 0, + Shieldradius = 500, + Shieldpower = shield1Power, + Shieldpowerregen = shield1PowerRegen, + Shieldpowerregenenergy = shield1PowerRegenEnergy, + Shieldintercepttype = 4, + Shieldgoodcolor = "0.0 0.2 1.0", + Shieldbadcolor = "1.0 0 0", + Shieldalpha = 0.2, + + texture1 = "shield4", + + visibleShieldHitFrames = 1, + weaponType = [[Shield]], + customparams = { + nocosttofire = true, + }, + damage = { + default = 1, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/arm/armflash.lua b/Units/arm/armflash.lua deleted file mode 100644 index f121fb26e..000000000 --- a/Units/arm/armflash.lua +++ /dev/null @@ -1,151 +0,0 @@ --- UNITDEF -- ARMFLASH -- --------------------------------------------------------------------------------- - -local unitName = "armflash" - --------------------------------------------------------------------------------- - -local unitDef = { ---Begin tags entered from Notepad++ en masse - pieceTrailCEGTag = "deathceg", - pieceTrailCEGRange = 2, ---End tags entered from Notepad++ - acceleration = 0.18, - bmcode = "1", - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 1000, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR", - copyright = "Copyright 1997 Humongous Entertainment. All rights reserved.", - corpse = "ammobox", - defaultmissiontype = "Standby", - description = "Assault Tank Upgrade 2", - designation = "", - energyMake = 0.5, - energyStorage = 0, - energyUse = 0.5, - explodeAs = "mediumExplosionGeneric", - firestandorders = "1", - footprintX = 2, - footprintZ = 2, - frenchdescription = "Char d'assaut", - frenchname = "Agitator", - germandescription = "Gefechtspanzer", - germanname = "Instigator", - idleAutoHeal = .5, - idleTime = 2200, - italiandescription = "Carro armato d'assalto", - italianname = "Instigator", - leaveTracks = false, - maneuverleashlength = "640", - maxDamage = 10000, - maxSlope = 28, - maxVelocity = 3.5, - maxWaterDepth = 5000, - metalStorage = 0, - mobilestandorders = "1", - movementClass = "TANK2", - movestate = 0, - name = "Flash", - noAutoFire = false, - noChaseCategory = "VTOL GROUND", - objectName = "armflash.s3o", - ovradjust = "1", - radarDistance = 0, - selfDestructAs = "mediumExplosionGeneric", - shootme = "1", - side = "CORE", - sightDistance = 600, - smoothAnim = true, - spanishdescription = "Tanque de asalto", - spanishname = "Instigator", - standingfireorder = "2", - standingmoveorder = "1", - steeringmode = "1", - threed = "1", - trackOffset = 3, - trackStrength = 5, - trackStretch = 1, - trackType = "VehTrack", - trackWidth = 24, - turnRate = 1000, - unitname = "armflash", - unitnumber = "108", - upright = false, - version = "1", - workerTime = 0, - zbuffer = "1", - sfxtypes = { - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "flashweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - }, - }, - customParams = { - death_sounds = "generic", - RequireTech = "4 Power", - armortype = "armored", - normalstex = "unittextures/armregskinnormal.png", - }, -} - --------------------------------------------------------------------------------- - -local weaponDefs = { - flashweapon = { - AreaOfEffect = 8, - avoidFriendly = false, - collideFriendly = false, - rgbColor = "0.8 0.5 0", - rgbColor2 = "0.5 0.5 0.5", - explosionGenerator = "custom:genericshellexplosion-small", - id = 19, - lineOfSight = true, - name = "E.M.G.", - range = 510, - reloadtime = 0.1, - weaponType = "Cannon", - soundStart = "tgunshipfire.wav", - soundTrigger = true, - sprayAngle = 1024, - startsmoke = "1", - tolerance = 1000, - turret = true, - weaponTimer = 1, - weaponVelocity = 400, - damage = { - default = 7, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/chicken/burrow.lua b/Units/chicken/burrow.lua deleted file mode 100644 index 42ea862d2..000000000 --- a/Units/chicken/burrow.lua +++ /dev/null @@ -1,84 +0,0 @@ --- UNITDEF -- BURROW -- --------------------------------------------------------------------------------- - -local unitName = "burrow" - --------------------------------------------------------------------------------- - -local unitDef = { ---Begin tags entered from Notepad++ en masse - pieceTrailCEGTag = "deathceg", - pieceTrailCEGRange = 2, ---End tags entered from Notepad++ - activateWhenBuilt = true, - buildAngle = 2500, - buildCostEnergy = 0, - buildCostMetal = 500, - builder = false, - buildTime = 10, - canAttack = false, - category = "NOTAIR ECO BUILDING", - corpse = "ammobox", - description = "Produces Unlimited Energy and Metal", - energyMake = 998, - energyStorage = 900, - energyUse = 0, - explodeAs = "FUSIONPOP", - footprintX = 8, - footprintZ = 8, - iconType = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 2500, - maxSlope = 60, - maxWaterDepth = 5000, - metalmake = 998, - metalStorage = 900, - name = "Plot Device", - objectName = "efusion2.s3o", - radarDistance = 1000, - reclaimable = false, - selfDestructAs = "FUSIONPOP", - side = "ARM", - sightDistance = 1000, - smoothAnim = true, - unitname = "burrow", - workerTime = 0, - - sfxtypes = { - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionburrow", - "custom:skyhatelaser", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - death_sounds = "generic", - ProvideTech = "50 Power", - armortype = "building", - supply_granted = 200, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/chicken/queen.lua b/Units/chicken/queen.lua deleted file mode 100644 index 90f2325ca..000000000 --- a/Units/chicken/queen.lua +++ /dev/null @@ -1,257 +0,0 @@ --- UNITDEF -- EEXKRABGOTH -- --------------------------------------------------------------------------------- - -local unitName = "queen" - --------------------------------------------------------------------------------- - -local unitDef = { - - acceleration = 0.18, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 1000, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - cantBeTransported = true, - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - description =[[Primary Laser: -600 Damage/s vs Building -60 Damage/s vs Light/Armored - -Secondary Concussion Cannons: -320 Damage/s vs Light/Armored -32 Damage/s vs Buildings]], - energyMake = 998, - energyStorage = 900, - energyUse = 0, - explodeAs = "nukemissile", - firestandorders = "1", - footprintX = 12, - footprintZ = 12, - iconType = "allterr", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 50000, - maxVelocity = 2.5, - maxReverseVelocity = 1, - maxWaterDepth = 80, - metalmake = 998, - metalStorage = 900, - movementClass = "EXPERIMENTALTANK12", - name = "Queen", - noChaseCategory = "VTOL", - objectName = "ekrabgroth.s3o", - pushResistant = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "krabblast", - shootme = "1", - sightDistance = 1500, - smoothAnim = true, - turnInPlace = true, - turnRate = 1000, - unitname = "queen", - unitnumber = "110", - unitRestricted = 1, - upright = false, --- usePieceCollisionVolumes = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:flamethrowerrange500", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "heavybeamweapon", - onlyTargetCategory = "BUILDING", - }, - [2] = { - def = "concussioncannon", - onlyTargetCategory = "LIGHT ARMORED", - }, - [3] = { - def = "concussioncannon", - onlyTargetCategory = "LIGHT ARMORED", - }, - }, - customParams = { - death_sounds = "nuke", - RequireTech = "40 Power", - armortype = "armored", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - heavybeamweapon = { - badTargetCategory = [[ARMORED LIGHT]], - AreaOfEffect = 0, - avoidFeature = false, - avoidFriendly = false, - beamTime = 1, - beamWeapon = true, - cameraShake = 1, - collideFeature = false, - collideFriendly = false, - coreThickness = 1, --- cegTag = "mediumcannonweapon3", --- duration = 0.2, - energypershot = 30, - explosionGenerator = "custom:genericshellexplosion-large-purple", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 1500, - reloadtime = 1, - WeaponType = "BeamLaser", - rgbColor = "1 0 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "krabprimary.wav", - sweepfire = true, --- soundHit = "mediumcannonhit.wav", --- sweepfire = true, - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 800, - customparams = { - damagetype = "queenbeam", - }, - damage = { - default = 600, - }, - }, - concussioncannon = { - accuracy = 1, - AreaOfEffect = 150, - avoidFriendly = false, - avoidFeature = false, - ballistic = true, - collideFriendly = false, - collideFeature = false, - cylinderTargeting = true, - burnblow = true, - endsmoke = "1", - explosionGenerator = "custom:genericshellexplosion-large", - energypershot = 4, - fireStarter = 80, - id = 1, - impulseFactor = 0.1, - interceptedByShieldType = 4, - name = "Concussion Cannon", - pitchtolerance = "500", - range = 1500, - reloadtime = 0.5, - weaponType = "Cannon", - soundHit = "explode2", - soundStart = "krabsecondary.wav", - startsmoke = "1", - tolerance = 500, - turret = true, - weaponVelocity = 5000, - customparams = { - damagetype = "queencannon", - }, - damage = { - default = 160, - }, - }, - - nukemissile = { - AreaOfEffect = 2000, - avoidFriendly = false, - cegTag = "NUKETRAIL", - collideFriendly = false, - commandfire = true, - craterBoost = 0, - craterMult = 0, - energypershot = 12000, - explosionGenerator = "custom:NUKEDATBEWM", - fireStarter = 100, - flightTime = 400, - guidance = true, - id = 124, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 2, - lineOfSight = true, - metalpershot = 0, - model = "enuke.s3o", - name = "Nuke", - range = 32000, - reloadtime = 15, - weaponType = "MissileLauncher", - selfprop = true, - smokedelay = "0.1", - smokeTrail = false, - soundHit = "explosion_enormous.wav", - soundStart = "nukelaunch.wav", - startsmoke = "0", - stockpile = true, - stockpileTime = 240, - startVelocity = 500, - tracks = true, - turnRate = 30000, - targetable = 1, - vlaunch = true, - weaponAcceleration = 0, - weaponTimer = 10, - weaponType = "StarburstLauncher", - weaponVelocity = 500, - customparams = { - damagetype = "default", - death_sounds = "nuke", - }, - damage = { - default = 50000, - }, - }, - -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- - diff --git a/Units/dev/atm.lua b/Units/dev/atm.lua new file mode 100644 index 000000000..b011361c1 --- /dev/null +++ b/Units/dev/atm.lua @@ -0,0 +1,85 @@ +-- UNITDEF -- ATM -- +-------------------------------------------------------------------------------- + +local unitName = "atm" + +-------------------------------------------------------------------------------- + +local unitDef = { + --Begin tags entered from Notepad++ en masse + pieceTrailCEGTag = "deathceg", + pieceTrailCEGRange = 2, + --End tags entered from Notepad++ + activateWhenBuilt = true, + buildAngle = 2500, + buildCostEnergy = 0, + buildCostMetal = 500, + builder = false, + buildTime = 10, + canAttack = false, + category = "NOTAIR ECO BUILDING", + description = "Produces Unlimited Energy and Metal", + energyMake = 998, + energyStorage = 900, + energyUse = 0, + explodeAs = "FUSIONPOP", + footprintX = 8, + footprintZ = 8, + iconType = "energy", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 2500, + maxSlope = 60, + maxWaterDepth = 5000, + metalmake = 998, + metalStorage = 900, + name = "ATM Machine", + objectName = "efusion2.s3o", + script = "efusion2.cob", + radarDistance = 1000, + reclaimable = false, + selfDestructAs = "FUSIONPOP", + side = "ARM", + sightDistance = 1000, + smoothAnim = true, + unitname = "atm", + workerTime = 0, + + sfxtypes = { + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionburrow", + "custom:skyhatelaser", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + weapons = { + }, + customParams = { + death_sounds = "generic", + ProvideTech = "50 Power, tech0, tech1, tech2, tech3", + armortype = "building", + supply_granted = 200, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, +} + + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairemp.lua b/Units/eair/eairemp.lua new file mode 100644 index 000000000..44b1b91de --- /dev/null +++ b/Units/eair/eairemp.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- eairemp -- +-------------------------------------------------------------------------------- + +unitName = "eairemp" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Gridlock]] + +objectName = "eairemp.s3o" +script = "eairemp.cob" + + +tech = [[tech3]] +armortype = [[air]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/eairemp_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairemp_up1.lua b/Units/eair/eairemp_up1.lua new file mode 100644 index 000000000..a5951b5a3 --- /dev/null +++ b/Units/eair/eairemp_up1.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- eairemp_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eairemp_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Gridlock MK II]] + +objectName = "eairemp.s3o" +script = "eairemp.cob" + + +tech = [[tech3]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/eairemp_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairemp_up2.lua b/Units/eair/eairemp_up2.lua new file mode 100644 index 000000000..b72ae1e25 --- /dev/null +++ b/Units/eair/eairemp_up2.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- eairemp_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eairemp_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Gridlock MK III]] + +objectName = "eairemp.s3o" +script = "eairemp.cob" + + +tech = [[tech3]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/eairemp_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairemp_up3.lua b/Units/eair/eairemp_up3.lua new file mode 100644 index 000000000..13c65a9ee --- /dev/null +++ b/Units/eair/eairemp_up3.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- eairemp_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eairemp_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Gridlock MK IV]] + +objectName = "eairemp.s3o" +script = "eairemp.cob" + + +tech = [[tech3]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/eairemp_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairengineer.lua b/Units/eair/eairengineer.lua deleted file mode 100644 index e7d5d906f..000000000 --- a/Units/eair/eairengineer.lua +++ /dev/null @@ -1,145 +0,0 @@ --- UNITDEF -- EAIRENGINEER -- --------------------------------------------------------------------------------- - -local unitName = "eairengineer" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.2, - airStrafe = true, - brakeRate = 3.5, - buildCostEnergy = 0, - buildCostMetal = 60, - buildTime = 2.5, - builder = true, - buildDistance = 600, - canAttack = false, - CanAssist = true, - canBeAssisted = true, - CanCapture = false, - CanRepair = true, - canDropFlare = true, - canFly = true, - canGuard = true, - canLoopbackAttack = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "LIGHT VTOL", - collide = true, - corpse = "ammobox", - cruiseAlt = 300, - description = "Airborne Engineer :: Armortype: Light", - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - flareDelay = 0.1, - flareDropVector = "0 0 -1", - flareefficieny = "0.3", - flareReload = 3, - floater = true, - footprintX = 4, - footprintZ = 4, - hoverAttack = true, - iconType = "engineer", - idleAutoHeal = .5, - idleTime = 2200, - maxBank = 5, - maxDamage = 600, - maxSlope = 90, - maxVelocity = 7, - verticalSpeed = 15, - maxWaterDepth = 0, - metalStorage = 0, - moverate1 = "8", - moveState = "2", - name = "The Originator", - objectName = "eairengineer2.s3o", - script = "eairengineer2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - showNanoSpray = false, - sightDistance = 600, - smoothAnim = true, - turnRate = 920, - unitname = "eairengineer", - unitnumber = "148", - workerTime = 1, - capturespeed = 1, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - repairspeed = 0.15625, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jethtrail", - "custom:nanoorb", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eminifac", --new - "ebasefactory", --new - "eamphibfac", - "eairplant", - "eexperimentalfac", - "emetalextractor", --new - "emaker", --new - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ekmar", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - "euwturret", - "elrpc", - "eshieldgen", - "esilo", - "emine", - "eorb", - "ecommander", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { --- needed_cover = 2, - death_sounds = "generic", --- airdronespawner = "1", - armortype = "light", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eair/eairplant.lua b/Units/eair/eairplant.lua index e335a0f8a..e8ccc02c2 100644 --- a/Units/eair/eairplant.lua +++ b/Units/eair/eairplant.lua @@ -1,112 +1,24 @@ -- UNITDEF -- EAIRPLANT -- -------------------------------------------------------------------------------- -local unitName = "eairplant" +unitName = "eairplant" -------------------------------------------------------------------------------- -local unitDef = { +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 - activatewhenbuilt = true, - buildCostEnergy = 0, - buildCostMetal = 60, - builder = true, - buildTime = 2.5, - canBeAssisted = true, - canGuard = true, - canMove = true, - canPatrol = true, - canReclaim = false, - canstop = true, - category = "BUILDING NOTAIR VTOL", - corpse = "ammobox", - description = [[Place generators near this factory to unlock higher tier units]], - energyStorage = 0, - energyUse = 0, - energyMake = 0, - explodeAs = "MEXPOP2", - floater = true, - footprintX = 18, - footprintZ = 18, - iconType = "factory", - idleAutoHeal = .5, - idleTime = 2200, - levelground = false, - maxDamage = 1500, - maxSlope = 90, - maxWaterDepth = 999999, - metalStorage = 0, - metalMake = 0, - mobilestandorders = "1", - name = "Aircraft Plant", - objectName = "eairplant3.s3o", - script = "eairplant3.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - showNanoSpray = "0", - sightDistance = 388, - smoothAnim = true, - TEDClass = "PLANT", - unitname = "eairplant", --- unitRestricted = 1, - unitnumber = "83", - workerTime = 1, - yardMap = "oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo oooooooooooooooooo", --- usePieceCollisionVolumes = true, +humanName = [[VTOL Factory]] - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +objectName = "eairplant3.s3o" +script = "eairplant3.cob" - explosiongenerators = { - "custom:nanoorb", - "custom:nano", - "custom:blacksmoke", - "custom:fusionreactionbasic", - "custom:airfactoryhtrail", - }, - }, - zbuffer = "1", - buildoptions = { - "eairengineer", - "escout", --new - "egunship2", --new - "efighter", --new - "ebomber", --new - "etransport", --new - - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdfactoryselect", - }, - }, - customParams = { - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", --- ProvideTech = "1 Powergrid", --- ProvideTechRange = "1500", --- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", --- groundtexselectxsize = 1500, -- optional --- groundtexselectzsize = 1500, -- optional - }, --- useBuildingGroundDecal = true, --- BuildingGroundDecalType = "factorygroundplate.dds", --- BuildingGroundDecalSizeX = 20, --- BuildingGroundDecalSizeY = 20, --- BuildingGroundDecalDecaySpeed = 0.9, -} +airPlantBuildList = Shared.buildListAirPlant +VFS.Include("Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua") -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eair/eairplant_up1.lua b/Units/eair/eairplant_up1.lua new file mode 100644 index 000000000..2891fa7dc --- /dev/null +++ b/Units/eair/eairplant_up1.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAIRPLANT -- +-------------------------------------------------------------------------------- + +unitName = "eairplant_up1" + +-------------------------------------------------------------------------------- + +buildCostMetal = 270 +maxDamage = buildCostMetal * 12.5 + +humanName = [[VTOL Factory Mark II]] + +objectName = "eairplant3.s3o" +script = "eairplant3.cob" + +airPlantBuildList = Shared.buildListAirPlant_up1 + +VFS.Include("Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairplant_up2.lua b/Units/eair/eairplant_up2.lua new file mode 100644 index 000000000..a61c92f8f --- /dev/null +++ b/Units/eair/eairplant_up2.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAIRPLANT -- +-------------------------------------------------------------------------------- + +unitName = "eairplant_up2" + +-------------------------------------------------------------------------------- + +buildCostMetal = 510 +maxDamage = buildCostMetal * 12.5 + +humanName = [[VTOL Factory Mark III]] + +objectName = "eairplant3.s3o" +script = "eairplant3.cob" + +airPlantBuildList = Shared.buildListAirPlant_up2 + +VFS.Include("Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/eairplant_up3.lua b/Units/eair/eairplant_up3.lua new file mode 100644 index 000000000..e0d22b518 --- /dev/null +++ b/Units/eair/eairplant_up3.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAIRPLANT -- +-------------------------------------------------------------------------------- + +unitName = "eairplant_up3" + +-------------------------------------------------------------------------------- + +buildCostMetal = 750 +maxDamage = buildCostMetal * 12.5 + +humanName = [[VTOL Factory Mark IV]] + +objectName = "eairplant3.s3o" +script = "eairplant3.cob" + +airPlantBuildList = Shared.buildListAirPlant_up3 + +VFS.Include("Units-Configs-Basedefs/basedefs/air/eairplant_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ebomber.lua b/Units/eair/ebomber.lua index 4fb1ec466..a0abd0dff 100644 --- a/Units/eair/ebomber.lua +++ b/Units/eair/ebomber.lua @@ -1,178 +1,26 @@ -- UNITDEF -- EBOMBER -- -------------------------------------------------------------------------------- -local unitName = "ebomber" +unitName = "ebomber" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Kamper]] ---** +objectName = "ebomber2-small.s3o" +script = "ebomber2.cob" - acceleration = 0.2, - airStrafe = true, - BadTargetCategory = "VTOL", - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 2.5, - canAttack = true, - canFly = true, - canGuard = true, - canMove = true, - canPatrol = true, - canstop = true, - category = "ARMORED VTOL", - collide = true, - corpse = "ammobox", - cruiseAlt = 350, - description = [[Bomber -Armored -1000 Damage vs Buildings -250 Damage vs Light/Armored - -Requires +10 Power -Uses +10 Supply +tech = [[tech2]] +armortype = [[air]] +supply = [[5]] -Must be forcefired on the target]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "hugeExplosionGeneric", - footprintX = 7, - footprintZ = 7, --- fireState = 0, - floater = true, - hoverAttack = true, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - loopbackattack = false, - maxAcc = 0.18, - maxDamage = 540, - maxSlope = 10, - maxVelocity = 11, - verticalSpeed = 15, - maxWaterDepth = 0, - metalStorage = 0, - name = "Cardinal", - noChaseCategory = "VTOL", - objectName = "ebomber2.s3o", - script = "ebomber2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "hugeExplosionGeneric", - side = "CORE", - sightDistance = 900, - smoothAnim = true, - stealth = false, - turnRate = 400, - unitname = "ebomber", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +VFS.Include("Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua") - explosiongenerators = { - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "SBOMB", - noChaseCategory = "VTOL", - onlyTargetCategory = "BUILDING", - }, - }, - customParams = { --- needed_cover = 2, - death_sounds = "generic", - nofriendlyfire = "1", - RequireTech = "10 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 10, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 1000 - -local weaponDefs = { - SBOMB = { - AreaOfEffect = 500, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - cegTag = "missiletrailgunship", - commandfire = "true", - explosionGenerator = "custom:genericshellexplosion-large-red", - energypershot = weapon1Damage / 20, - edgeEffectiveness = 0.1, - fireStarter = 70, - guidance = false, - id = 136, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - metalpershot = 0, - model = "missile.s3o", - name = "Rockets", - range = 900, - reloadtime = 30, - weaponType = "MissileLauncher", -- This causes the missile trail to go off kilter --- rendertype = 1, - selfprop = true, - smokedelay = ".1", - smokeTrail = false, - soundHit = "unitexplodebig.wav", - soundHitVolume = 10, - soundStart = "bomberlaunch.wav", - soundStartVolume = 10, - startsmoke = "0", - startVelocity = 500, - tolerance = 8000, - turnRate = 10000, - tracks = false, - turret = false, - weaponAcceleration = 10, - flightTime = 10, - weaponVelocity = 800, - customparams = { - damagetype = "ebomber", - nofriendlyfire = 1, - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - -------------------------------------------------------------------------------- return lowerkeys({ [unitName] = unitDef }) diff --git a/Units/eair/ebomber2_up1.lua b/Units/eair/ebomber2_up1.lua new file mode 100644 index 000000000..3c9eb0e88 --- /dev/null +++ b/Units/eair/ebomber2_up1.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EBOMBER -- +-------------------------------------------------------------------------------- + +unitName = "ebomber_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Kamper Mark II]] + +objectName = "ebomber2-small.s3o" +script = "ebomber2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ebomber2_up2.lua b/Units/eair/ebomber2_up2.lua new file mode 100644 index 000000000..d4693989f --- /dev/null +++ b/Units/eair/ebomber2_up2.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EBOMBER -- +-------------------------------------------------------------------------------- + +unitName = "ebomber_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Kamper Mark III]] + +objectName = "ebomber2-small.s3o" +script = "ebomber2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ebomber2_up3.lua b/Units/eair/ebomber2_up3.lua new file mode 100644 index 000000000..7ededa36d --- /dev/null +++ b/Units/eair/ebomber2_up3.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EBOMBER -- +-------------------------------------------------------------------------------- + +unitName = "ebomber_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Kamper Mark IV]] + +objectName = "ebomber2-small.s3o" +script = "ebomber2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ebomber_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/edrone.lua b/Units/eair/edrone.lua deleted file mode 100644 index 0638732af..000000000 --- a/Units/eair/edrone.lua +++ /dev/null @@ -1,170 +0,0 @@ --- UNITDEF -- EDRONE -- --------------------------------------------------------------------------------- - -local unitName = "edrone" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.5, - airStrafe = true, - bankscale = "1", - brakeRate = 0.5, - buildCostEnergy = 1, - buildCostMetal = 5, - buildTime = 2.5, - canAttack = true, - canDropFlare = false, - canFly = true, - canGuard = true, - canLoopbackAttack = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT VTOL", - collide = false, --- corpse = "ammobox", - cruiseAlt = 100, - description = [[Gunship Drone -Light -3 Damage vs Light/Armored/Building]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "smallExplosionGenericPurple", - flareDelay = 0.1, - flareDropVector = "0 0 -1", - flareefficieny = "0.3", - flareReload = 3, - footprintX = 3, - footprintZ = 3, - hoverAttack = true, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 100, - maxSlope = 30, - maxVelocity = 30, - verticalSpeed = 15, - maxWaterDepth = 0, - metalStorage = 0, - moverate1 = "8", - name = "MidKnight", - objectName = "edrone2.s3o", - script = "edrone2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "smallExplosionGenericPurple", - side = "CORE", - sightDistance = 300, - smoothAnim = true, - stealth = true, - turnRate = 920, - unitname = "edrone", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jetstrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "droneweapon", - mainDir = "0 0 1", - maxAngleDif = 45, - badTargetCategory = "WALL", - }, - }, - customParams = { --- needed_cover = 1, - armortype = "light", - death_sounds = "generic", - nofriendlyfire = "1", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 3 - -local weaponDefs = { - droneweapon = { - accuracy = 500, - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.2, - beamWeapon = true, - coreThickness = 0.5, - craterBoost = 0, - craterMult = 0, - duration = 0.05, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-sparks", - fallOffRate = 0.1, - impulseFactor = 0, - interceptedByShieldType = 4, - largeBeamLaser = true, - lineOfSight = true, - name = "Light Laser", - noSelfDamage = true, - range = 800, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0.1 0.5 0.2", - rgbColor2 = "0 1 0", - selfprop = true, - soundHit = "18393_inferno_reject.wav", - soundStart = "18389_inferno_medlas.wav", - soundTrigger = true, - startVelocity = 1000, - targetMoveError = 0, - texture1 = "plasmaball", - texture2 = "empty", - texture3 = "empty", - texture4 = "empty", - thickness = 5, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "edrone", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eair/efighter.lua b/Units/eair/efighter.lua index 33f09b39a..9e325db28 100644 --- a/Units/eair/efighter.lua +++ b/Units/eair/efighter.lua @@ -1,166 +1,26 @@ -- UNITDEF -- EFIGHTER -- -------------------------------------------------------------------------------- -local unitName = "efighter" +unitName = "efighter" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Koyote]] ---** +objectName = "efighter2-small.s3o" +script = "efighter2.cob" - acceleration = 0.5, - airStrafe = true, - bankscale = "1", - brakeRate = 0.5, - buildCostEnergy = 0, - buildCostMetal = 30, - buildTime = 2.5, - canAttack = true, - canFly = true, - canGuard = true, - canLoopbackAttack = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT VTOL", - collide = true, - corpse = "ammobox", - cruiseAlt = 400, - description = [[Air Superiority Fighter -Light -300 Damage vs Light/Armored/s -75 Damage vs Building/s - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericWhite", - footprintX = 5, - footprintZ = 5, - hoverAttack = true, - floater = true, - iconType = "aa", - idleAutoHeal = .5, - idleTime = 2200, - maxAcc = 0.25, - maxBank = 5, - maxDamage = 450, - maxSlope = 10, - maxVelocity = 16, - verticalSpeed = 15, - maxWaterDepth = 255, - metalStorage = 0, - moverate1 = "8", - name = "Coyote", - noChaseCategory = "NOTAIR", - objectName = "efighter2.s3o", - script = "efighter2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericWhite", - side = "ARM", - sightDistance = 1500, - smoothAnim = true, - sonarDistance = 0, - turnRate = 1500, - unitname = "efighter", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +tech = [[tech2]] +armortype = [[air]] +supply = [[2]] - explosiongenerators = { - "custom:gdhcannon", - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "antiaircannon", - onlyTargetCategory = "VTOL", - }, - }, - customParams = { --- needed_cover = 2, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} +VFS.Include("units-configs-basedefs/basedefs/air/efighter_basedef.lua") - --------------------------------------------------------------------------------- -local weapon1Damage = 30 - -local weaponDefs = { - antiaircannon = { - AreaOfEffect = 25, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - canAttackGround = false, - coreThickness = 0.4, - burnblow = true, --- cegTag = "mediumcannonweapon3", - duration = 0.05, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-small", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 1500, - reloadtime = 0.1, - WeaponType = "LaserCannon", - rgbColor = "1 0.5 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "tmediumtankfire.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 6, - tolerance = 10000, - turret = false, - weaponVelocity = 2500, - customparams = { - damagetype = "efighter", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - -------------------------------------------------------------------------------- return lowerkeys({ [unitName] = unitDef }) diff --git a/Units/eair/efighter_up1.lua b/Units/eair/efighter_up1.lua new file mode 100644 index 000000000..93c0aca1a --- /dev/null +++ b/Units/eair/efighter_up1.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EFIGHTER -- +-------------------------------------------------------------------------------- + +unitName = "efighter_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Koyote Mark II]] + +objectName = "efighter2-small.s3o" +script = "efighter2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/efighter_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eair/efighter_up2.lua b/Units/eair/efighter_up2.lua new file mode 100644 index 000000000..e8e8686e5 --- /dev/null +++ b/Units/eair/efighter_up2.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EFIGHTER -- +-------------------------------------------------------------------------------- + +unitName = "efighter_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Koyote Mark III]] + +objectName = "efighter2-small.s3o" +script = "efighter2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/efighter_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eair/efighter_up3.lua b/Units/eair/efighter_up3.lua new file mode 100644 index 000000000..f575c5e22 --- /dev/null +++ b/Units/eair/efighter_up3.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EFIGHTER -- +-------------------------------------------------------------------------------- + +unitName = "efighter_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Koyote Mark IV]] + +objectName = "efighter2-small.s3o" +script = "efighter2.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/air/efighter_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eair/egunship2.lua b/Units/eair/egunship2.lua index ffcb50b36..5acab7c7e 100644 --- a/Units/eair/egunship2.lua +++ b/Units/eair/egunship2.lua @@ -1,226 +1,26 @@ --- UNITDEF -- EGUNSHIP2 -- +-- UNITDEF -- EGUNSHIP -- -------------------------------------------------------------------------------- -local unitName = "egunship2" +unitName = "egunship2" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Wildkat]] ---** +objectName = "egunship3-small.s3o" +script = "egunship3.cob" - acceleration = 0.5, - airStrafe = true, - brakeRate = 0.5, - buildCostEnergy = 0, - buildCostMetal = 35, - buildTime = 2.5, - canAttack = true, - canDropFlare = false, - canFly = true, - canGuard = true, - canLoopbackAttack = true, - canMove = true, - canPatrol = true, - canstop = true, - category = "LIGHT VTOL", - collide = true, - corpse = "ammobox", - cruiseAlt = 300, - description = [[Gunship Tank Destroyer -Light -100 Damage vs Light/Armored -50 Damage vs Building +tech = [[tech2]] +armortype = [[air]] +supply = [[4]] -Can switch firemodes to torpedos +VFS.Include("Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua") -Requires +7 Power -Uses +7 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericRed", - flareDelay = 0.1, - flareDropVector = "0 0 -1", - flareefficieny = "0.3", - flareReload = 3, - floater = true, - footprintX = 4, - footprintZ = 4, - hoverAttack = true, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 600, - maxSlope = 90, - maxVelocity = 14, - verticalSpeed = 15, - maxWaterDepth = 0, - metalStorage = 0, - moverate1 = "8", - name = "Wildcat", - noChaseCategory = "VTOL", - objectName = "egunship3.s3o", - script = "egunship3.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericRed", - side = "CORE", - sightDistance = 800, - smoothAnim = true, - turnRate = 920, - unitname = "egunship2", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "gunshipweapon", - mainDir = "0 0 1", - maxAngleDif = 90, - OnlyTargetCategory = "NOTAIR AMPHIB", - BadTargetCategory = "VTOL BUILDING WALL", - noChaseCategory = "VTOL", - }, - [2] = { - def = "gunshiptorpedo", - mainDir = "0 0 1", - maxAngleDif = 180, - OnlyTargetCategory = "NOTAIR AMPHIB SUB", - noChaseCategory = "VTOL", - }, - }, - customParams = { --- needed_cover = 2, - canareaattack="1", - death_sounds = "generic", - RequireTech = "7 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 7, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 100 -local weapon2Damage = 100 - -local weaponDefs = { - gunshipweapon = { - badTargetCategory = [[BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - cegTag = "missiletrailgunshiplesssmokey", - explosionGenerator = "custom:genericshellexplosion-medium", - energypershot = weapon1Damage / 20, - edgeEffectiveness = 0.1, - fireStarter = 70, - guidance = false, - id = 136, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - metalpershot = 0, - model = "missilegunship.s3o", - name = "Rockets", - range = 520, - reloadtime = 1, - weaponType = "Cannon", -- This causes the missile trail to go off kilter --- rendertype = 1, - selfprop = true, - smokedelay = ".1", - smokeTrail = false, - soundHit = "bombhit.wav", - soundHitVolume = 10, - soundStart = "18395_inferno_rltx.wav", - soundStartVolume = 10, - startsmoke = "0", - startVelocity = 250, - tolerance = 8000, - turnRate = 4680, - turret = true, - tracks = true, - weaponAcceleration = 131, - weaponTimer = 100, - weaponVelocity = 1200, - customparams = { - damagetype = "egunship2", - }, - damage = { - default = weapon1Damage, - }, - }, - - gunshiptorpedo = { - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - cegTag = "torpedotrailuwturret", - cylinderTargeting = true, - explosionGenerator = "custom:torpedoexplosion", - energypershot = weapon2Damage / 20, - fireStarter = 80, - impulseFactor = 0.1, - interceptedByShieldType = 4, - model = "missilesmall.s3o", - name = "Underwater Torpedo", - pitchtolerance = 3000, - range = 520, - reloadtime = 1, - weaponType = "TorpedoLauncher", - soundHit = "torpedolaunch.wav", - soundStart = "18393_inferno_reject.wav", - tolerance = 3000, - turret = true, - startVelocity = 200, - acceleration = 2000, - weaponVelocity = 10000, - tracks = true, - turnrate = 100000, - flighttime = 4, - customparams = { - damagetype = "egunship2", - }, - damage = { - default = weapon2Damage, - }, - }, - -} unitDef.weaponDefs = weaponDefs - -------------------------------------------------------------------------------- return lowerkeys({ [unitName] = unitDef }) diff --git a/Units/eair/egunship2_up1.lua b/Units/eair/egunship2_up1.lua new file mode 100644 index 000000000..5fa577ca3 --- /dev/null +++ b/Units/eair/egunship2_up1.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EGUNSHIP -- +-------------------------------------------------------------------------------- + +unitName = "egunship2_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Wildkat Mark II]] + +objectName = "egunship3-small.s3o" +script = "egunship3.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/egunship2_up2.lua b/Units/eair/egunship2_up2.lua new file mode 100644 index 000000000..4ca8f6209 --- /dev/null +++ b/Units/eair/egunship2_up2.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EGUNSHIP -- +-------------------------------------------------------------------------------- + +unitName = "egunship2_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Wildkat Mark III]] + +objectName = "egunship3-small.s3o" +script = "egunship3.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/egunship2_up3.lua b/Units/eair/egunship2_up3.lua new file mode 100644 index 000000000..545b7828f --- /dev/null +++ b/Units/eair/egunship2_up3.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- EGUNSHIP -- +-------------------------------------------------------------------------------- + +unitName = "egunship2_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Wildkat Mark IV]] + +objectName = "egunship3-small.s3o" +script = "egunship3.cob" + + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/egunship2_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ekrow.lua b/Units/eair/ekrow.lua new file mode 100644 index 000000000..5da3bde41 --- /dev/null +++ b/Units/eair/ekrow.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- EKROW -- +-------------------------------------------------------------------------------- + +unitName = "ekrow" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Krow]] + +objectName = "ekrow.s3o" +script = "ekrow.cob" + + +tech = [[tech3]] +armortype = [[air]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ekrow_up1.lua b/Units/eair/ekrow_up1.lua new file mode 100644 index 000000000..c157dc3c4 --- /dev/null +++ b/Units/eair/ekrow_up1.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- EKROW_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ekrow_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Krow MK II]] + +objectName = "ekrow.s3o" +script = "ekrow.cob" + + +tech = [[tech3]] +armortype = [[light]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ekrow_up2.lua b/Units/eair/ekrow_up2.lua new file mode 100644 index 000000000..4dde44435 --- /dev/null +++ b/Units/eair/ekrow_up2.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- EKROW_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ekrow_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Krow MK III]] + +objectName = "ekrow.s3o" +script = "ekrow.cob" + + +tech = [[tech3]] +armortype = [[light]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/ekrow_up3.lua b/Units/eair/ekrow_up3.lua new file mode 100644 index 000000000..aeaee9656 --- /dev/null +++ b/Units/eair/ekrow_up3.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- EKROW_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ekrow_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Krow MK IV]] + +objectName = "ekrow.s3o" +script = "ekrow.cob" + + +tech = [[tech3]] +armortype = [[light]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/escout.lua b/Units/eair/escout.lua deleted file mode 100644 index faabacda1..000000000 --- a/Units/eair/escout.lua +++ /dev/null @@ -1,106 +0,0 @@ --- UNITDEF -- ESCOUT -- --------------------------------------------------------------------------------- - -local unitName = "escout" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.5, - airStrafe = true, - brakeRate = 0.5, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 2.5, - canFly = true, - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT VTOL", - collide = false, - corpse = "ammobox", - cruiseAlt = 180, - description = [[Air Scout -Light - -Requires +2 Power -Uses +2 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericBlue", - footprintX = 4, - footprintZ = 4, - hoverAttack = true, - floater = true, - iconType = "air", - idleAutoHeal = .5, - idleTime = 2200, - isTargetingUpgrade = false, - maxAcc = 0.5, - maxDamage = 320, - maxSlope = 10, - maxVelocity = 20, - verticalSpeed = 15, - maxWaterDepth = 0, - metalStorage = 0, - name = "AirScout", - objectName = "escout2.s3o", - script = "escout2.cob", - radarDistance = 1500, - SonarDistance = 1500, - repairable = false, - selfDestructAs = "mediumExplosionGenericBlue", - side = "ARM", - sightDistance = 750, - smoothAnim = true, - turnRate = 800, - unitname = "escout", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { --- needed_cover = 1, - death_sounds = "generic", - RequireTech = "2 Power", - armortype = "light", - supply_cost = 2, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eair/escoutdrone.lua b/Units/eair/escoutdrone.lua new file mode 100644 index 000000000..6c6a9ecde --- /dev/null +++ b/Units/eair/escoutdrone.lua @@ -0,0 +1,23 @@ +-- UNITDEF -- ESCOUTDRONE -- +-------------------------------------------------------------------------------- + +unitName = "escoutdrone" + +-------------------------------------------------------------------------------- + +humanName = [[Mosquito]] + +objectName = "edrone2.s3o" +script = "edrone2.cob" + +armortype = [[air]] + +tech = [[tech0]] + +VFS.Include("units-configs-basedefs/basedefs/air/escoutdrone_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/esubplane.lua b/Units/eair/esubplane.lua deleted file mode 100644 index 6852860cc..000000000 --- a/Units/eair/esubplane.lua +++ /dev/null @@ -1,165 +0,0 @@ --- UNITDEF -- ESUBPLANE -- --------------------------------------------------------------------------------- - -local unitName = "esubplane" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.2, - airStrafe = true, - brakeRate = 7, - buildCostEnergy = 0, - buildCostMetal = 25, - buildTime = 2.5, - canAttack = true, - canDropFlare = false, - canFly = true, - canGuard = true, - canLoopbackAttack = true, - canMove = true, - canPatrol = true, - canstop = true, - category = "LIGHT VTOL", - collide = true, ---Collision Volumes... Because the engine devs are silly. - collisionVolumeScales = [[35 35 35]], ---End Collision volumes - corpse = "ammobox", - cruiseAlt = 350, - description = "Stealth Sonar Plane - Can morph into a submarine", - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "BIG_UNIT", - flareDelay = 0.1, - flareDropVector = "0 0 -1", - flareefficieny = "0.3", - flareReload = 3, - floater = true, - footprintX = 3, - footprintZ = 3, - hoverAttack = true, - iconType = "air", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 280, - maxSlope = 10, - maxVelocity = 18, - verticalSpeed = 15, - maxWaterDepth = 6000, - amphibious = true, - canSubmerge = true, - metalStorage = 0, - name = "SeaGull", - noChaseCategory = "VTOL", - objectName = "esubplane.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "BIG_UNIT", - sightDistance = 800, - sonardistance = 1000, - smoothAnim = true, - stealth = false, - turnRate = 920, - unitname = "esubplane", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "esubplanetorpedo", - OnlyTargetCategory = "BUILDING AMPHIB", - noChaseCategory = "VTOL", - }, - }, - - customParams = { --- needed_cover = 2, - death_sounds = "generic", - twokhotkey = 't', - nofriendlyfire = "1", - RequireTech = "10 Power", - armortype = "armored", - normalstex = "unittextures/esubplanenormal.png", - }, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - esubplanetorpedo = { - AreaOfEffect = 10, - avoidFriendly = false, - avoidFeature = false, - canattackground = false, - cegTag = "torpedotrailuwturret", - collideFriendly = false, - collideFeature = false, - cylinderTargeting = true, - explosionGenerator = "custom:torpedoexplosion", - energypershot = 3, - fireStarter = 80, - impulseFactor = 0.1, - interceptedByShieldType = 4, - model = "missilesmall.s3o", - name = "Underwater Torpedo", - pitchtolerance = 3000, - range = 1000, - reloadtime = 1, - weaponType = "TorpedoLauncher", - soundHit = "torpedolaunch.wav", - soundStart = "18393_inferno_reject.wav", - tolerance = 3000, - turret = true, - startVelocity = 200, - acceleration = 2000, - weaponVelocity = 10000, - tracks = true, - turnrate = 100000, - flighttime = 4, - sprayangle = 5000, - waterweapon = true, - - customparams = { - damagetype = "euwturret", - }, - damage = { - default = 60, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eair/etransport.lua b/Units/eair/etransport.lua index 44590938f..192777b27 100644 --- a/Units/eair/etransport.lua +++ b/Units/eair/etransport.lua @@ -1,105 +1,25 @@ -- UNITDEF -- ETRANSPORT -- -------------------------------------------------------------------------------- -local unitName = "etransport" +unitName = "etransport" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Kharter]] ---** +objectName = "etransport2-small.s3o" +script = "etransport2.cob" - acceleration = 0.5, - airStrafe = true, - airHoverFactor = 0, - brakeRate = 0.5, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 2.5, - canAttack = false, - canFly = true, - canGuard = false, - canMove = true, - canload = true, - canPatrol = false, - canstop = "1", - category = "ARMORED VTOL", - collide = true, - corpse = "ammobox", - cruiseAlt = 150, - description = [[Fast Armored Transport -Armored - -Requires +2 Power -Uses +2 Supply]], - energyMake = 0, - energyUse = 0, - explodeAs = "hugeExplosionGenericRed", - fallSpeed = 1000, - footprintX = 8, - footprintZ = 8, - hoverAttack = true, - holdSteady = true, --- hoverAttack = true, - icontype = "support", - maxAcc = 0.3, - maxDamage = 340, - maxSlope = 60, - maxVelocity = 18, - verticalSpeed = 30, - name = "Charter", - objectName = "etransport2.s3o", - script = "etransport2.cob", - releaseHeld = true, - repairable = false, - selfDestructAs = "hugeExplosionGenericRed", - side = "GD", - sightDistance = 500, - smoothAnim = true, - transportCapacity = 1, - transportMass = 10000, - transportSize = 6, --- transportUnloadMethod = 1, - turnRate = 900, - unitname = "etransport", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:jethtrail", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { --- needed_cover = 2, - death_sounds = "generic", - RequireTech = "2 Power", - armortype = "armored", - supply_cost = 2, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} +--tech = [[tech1]] +armortype = [[armored]] +supply = [[0]] +VFS.Include("units-configs-basedefs/basedefs/air/etransport_basedef.lua") +-- unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- return lowerkeys({ [unitName] = unitDef }) diff --git a/Units/eair/etransport_up1.lua b/Units/eair/etransport_up1.lua new file mode 100644 index 000000000..5c233a5eb --- /dev/null +++ b/Units/eair/etransport_up1.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ETRANSPORT -- +-------------------------------------------------------------------------------- + +unitName = "etransport_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Kharter Mark II]] + +objectName = "etransport2-small.s3o" +script = "etransport2.cob" + + +--tech = [[tech1]] +armortype = [[armored]] +supply = [[0]] + +VFS.Include("units-configs-basedefs/basedefs/air/etransport_basedef.lua") + +-- unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/etransport_up2.lua b/Units/eair/etransport_up2.lua new file mode 100644 index 000000000..36b45af74 --- /dev/null +++ b/Units/eair/etransport_up2.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ETRANSPORT -- +-------------------------------------------------------------------------------- + +unitName = "etransport_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Kharter Mark III]] + +objectName = "etransport2-small.s3o" +script = "etransport2.cob" + + +--tech = [[tech1]] +armortype = [[armored]] +supply = [[0]] + +VFS.Include("units-configs-basedefs/basedefs/air/etransport_basedef.lua") + +-- unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eair/etransport_up3.lua b/Units/eair/etransport_up3.lua new file mode 100644 index 000000000..b2ec29ab3 --- /dev/null +++ b/Units/eair/etransport_up3.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ETRANSPORT -- +-------------------------------------------------------------------------------- + +unitName = "etransport_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Kharter Mark IV]] + +objectName = "etransport2-small.s3o" +script = "etransport2.cob" + + +--tech = [[tech1]] +armortype = [[armored]] +supply = [[0]] + +VFS.Include("units-configs-basedefs/basedefs/air/etransport_basedef.lua") + +-- unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterraa.lua b/Units/eallterrain/eallterraa.lua deleted file mode 100644 index a711d1cf4..000000000 --- a/Units/eallterrain/eallterraa.lua +++ /dev/null @@ -1,183 +0,0 @@ --- UNITDEF -- EALLTERRAA -- --------------------------------------------------------------------------------- - -local unitName = "eallterraa" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 26, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - --- Cloaking - - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description =[[Armored Dedicated Anti-Air -Armored -100 Damage vs Armored -66 Damage vs Light/Building - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericPurple", - firestandorders = "1", - footprintX = 6, - footprintZ = 6, - iconType = "aa", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 600, - maxVelocity = 3, - turninplacespeedlimit = 2.8, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK6", - name = "Shredder", - noChaseCategory = "VTOL", - objectName = "eallterraa.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericPurple", - shootme = "1", - sightDistance = 750, - smoothAnim = true, - stealth = true, - seismicSignature = 4, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterraa", - unitnumber = "110", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "heavytankweapon", - onlyTargetCategory = "VTOL", - }, - }, - customParams = { - needed_cover = 3, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 - -local weaponDefs = { - heavytankweapon = { - badTargetCategory = [[BUILDING]], - AreaOfEffect = 50, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - burnblow = true, - canAttackGround = false, - coreThickness = 0.5, - cegTag = "railgun", - duration = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:BulletImpact3", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 800, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0 0 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "railgun.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 15, - tolerance = 1000, - turret = true, - weaponVelocity = 5000, - customparams = { - damagetype = "eallterraa", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- - diff --git a/Units/eallterrain/eallterranarchid.lua b/Units/eallterrain/eallterranarchid.lua new file mode 100644 index 000000000..bf8179cf8 --- /dev/null +++ b/Units/eallterrain/eallterranarchid.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterranarchid -- Anarchid -- +-------------------------------------------------------------------------------- + +unitName = "eallterranarchid" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Anarchid]] + +objectName = "eallterranarchid.s3o" +script = "eallterranarchid.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[35]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterranarchid_up1.lua b/Units/eallterrain/eallterranarchid_up1.lua new file mode 100644 index 000000000..2f87a19b9 --- /dev/null +++ b/Units/eallterrain/eallterranarchid_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterranarchid -- Anarchid -- +-------------------------------------------------------------------------------- + +unitName = "eallterranarchid_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Anarchid Mark II]] + +objectName = "eallterranarchid.s3o" +script = "eallterranarchid.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[35]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterranarchid_up2.lua b/Units/eallterrain/eallterranarchid_up2.lua new file mode 100644 index 000000000..d16b804bc --- /dev/null +++ b/Units/eallterrain/eallterranarchid_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterranarchid -- Anarchid -- +-------------------------------------------------------------------------------- + +unitName = "eallterranarchid_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Anarchid Mark III]] + +objectName = "eallterranarchid.s3o" +script = "eallterranarchid.cob" + +tech = [[tech3]] +armortype = [[armored]] +---supply = [[35]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterranarchid_up3.lua b/Units/eallterrain/eallterranarchid_up3.lua new file mode 100644 index 000000000..3d6e463e5 --- /dev/null +++ b/Units/eallterrain/eallterranarchid_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterranarchid -- Anarchid -- +-------------------------------------------------------------------------------- + +unitName = "eallterranarchid_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Anarchid Mark IV]] + +objectName = "eallterranarchid.s3o" +script = "eallterranarchid.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[35]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrassault.lua b/Units/eallterrain/eallterrassault.lua index 4652d4cc3..00a53a3e5 100644 --- a/Units/eallterrain/eallterrassault.lua +++ b/Units/eallterrain/eallterrassault.lua @@ -1,186 +1,26 @@ --- UNITDEF -- EALLTERRASSAULT -- +-- UNITDEF -- eallterrassault -- Anvil -- -------------------------------------------------------------------------------- -local unitName = "eallterrassault" +unitName = "eallterrassault" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Anvil]] ---** +objectName = "eallterrassault.s3o" +script = "eallterrassault.cob" +tech = [[tech1]] +armortype = [[armored]] +supply = [[8]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description =[[Armored Dedicated Anti-Base Tank -Armored -400 Damage vs Buildings -50 Damage vs Light/Armored - -This unit can only fire at buildings! - -Requires +10 Power -Uses +10 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "hugeExplosionGeneric", - firestandorders = "1", - footprintX = 6, - footprintZ = 6, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 4000, - maxVelocity = 2.8, - maxReverseVelocity = 1, - turninplacespeedlimit = 2.5, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK6", - name = "Anvil", - noChaseCategory = "VTOL", - objectName = "eallterrassault.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "hugeExplosionGeneric", - shootme = "1", - sightDistance = 800, - smoothAnim = true, - stealth = true, - seismicSignature = 6, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrassault", - unitnumber = "110", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "assaulttankcannon", - onlyTargetCategory = "BUILDING", - }, - }, - customParams = { - needed_cover = 4, - death_sounds = "generic", - RequireTech = "10 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 10, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 400 - -local weaponDefs = { - assaulttankcannon = { - badTargetCategory = [[ARMORED LIGHT]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.1, - beamWeapon = true, - coreThickness = 0.6, --- cegTag = "mediumcannonweapon3", - duration = 0.4, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-large-purple", - fallOffRate = 1, - fireStarter = 100, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 750, - reloadtime = 2.5, - WeaponType = "LaserCannon", - rgbColor = "0.5 0 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "allterrassaultshot.wav", - soundHit = "assaultshothit.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 250, - customparams = { - damagetype = "eallterrassault", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- +return lowerkeys({ [unitName] = unitDef }) +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrassault_up1.lua b/Units/eallterrain/eallterrassault_up1.lua new file mode 100644 index 000000000..60004af75 --- /dev/null +++ b/Units/eallterrain/eallterrassault_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrassault -- Anvil -- +-------------------------------------------------------------------------------- + +unitName = "eallterrassault_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Anvil Mark II]] + +objectName = "eallterrassault.s3o" +script = "eallterrassault.cob" + +tech = [[tech1]] +armortype = [[armored]] +supply = [[8]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrassault_up2.lua b/Units/eallterrain/eallterrassault_up2.lua new file mode 100644 index 000000000..002e3ef1b --- /dev/null +++ b/Units/eallterrain/eallterrassault_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrassault -- Anvil -- +-------------------------------------------------------------------------------- + +unitName = "eallterrassault_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Anvil Mark III]] + +objectName = "eallterrassault.s3o" +script = "eallterrassault.cob" + +tech = [[tech1]] +armortype = [[armored]] +supply = [[8]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrassault_up3.lua b/Units/eallterrain/eallterrassault_up3.lua new file mode 100644 index 000000000..6730e15ca --- /dev/null +++ b/Units/eallterrain/eallterrassault_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrassault -- Anvil -- +-------------------------------------------------------------------------------- + +unitName = "eallterrassault_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Anvil Mark IV]] + +objectName = "eallterrassault.s3o" +script = "eallterrassault.cob" + +tech = [[tech1]] +armortype = [[armored]] +supply = [[8]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrassault_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrengineer.lua b/Units/eallterrain/eallterrengineer.lua deleted file mode 100644 index e7652d4e6..000000000 --- a/Units/eallterrain/eallterrengineer.lua +++ /dev/null @@ -1,151 +0,0 @@ --- UNITDEF -- EALLTERRENGINEER -- --------------------------------------------------------------------------------- - -local unitName = "eallterrengineer" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 45, - buildDistance = 800, - builder = true, - buildTime = 5, - CanAttack = false, - CanAssist = true, - canBeAssisted = true, - CanCapture = false, - CanRepair = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "LIGHT NOTAIR SUPPORT", - corpse = "ammobox", - --- Cloaking - - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description = [[Engineer -Light]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - footprintX = 3, - footprintZ = 3, - iconType = "engineer", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 600, - maxSlope = 180, - maxVelocity = 3, - maxReverseVelocity = 1, - turninplacespeedlimit = 3, - maxWaterDepth = 10, - metalmake = 0, - metalStorage = 0, - mobilestandorders = "1", - movementClass = "ALLTERRTANK3", - moveState = "2", - name = "The Architect", - objectName = "eallterrengineer.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - showNanoSpray = "0", - sightDistance = 500, - smoothAnim = true, - stealth = true, - seismicSignature = 3, - turnInPlace = true, - turnRate = 1020, - unitname = "eallterrengineer", - unitnumber = "20", - workerTime = 1, - capturespeed = 1, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - repairspeed = 0.15625, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:nanoorb", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eminifac", --new - "ebasefactory", --new - "eamphibfac", - "eairplant", - "eexperimentalfac", - "emetalextractor", --new - "emaker", --new - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ekmar", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - "euwturret", - "elrpc", - "eshieldgen", - "esilo", - "emine", - "eorb", - "ecommander", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - dronespawner = "1", - armortype = "light", - normalstex = "unittextures/con_legonormal.png", - }, -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrheavy.lua b/Units/eallterrain/eallterrheavy.lua index 3fb64d92f..b0a8b1876 100644 --- a/Units/eallterrain/eallterrheavy.lua +++ b/Units/eallterrain/eallterrheavy.lua @@ -1,185 +1,26 @@ --- UNITDEF -- EALLTERRHEAVY -- +-- UNITDEF -- eallterrheavy -- Sledge -- -------------------------------------------------------------------------------- -local unitName = "eallterrheavy" +unitName = "eallterrheavy" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Sledge]] ---** +objectName = "eallterrheavy2.s3o" +script = "eallterrheavy.cob" +tech = [[tech2]] +armortype = [[armored]] +supply = [[6]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 34, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description =[[Armored Tank Destroyer -Armored -100 Damage vs Light/Armored -60 Damage vs Buildings - -Requires +6 Power -Uses +6 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericGreen", - firestandorders = "1", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 650, - maxVelocity = 2.8, - turninplacespeedlimit = 2.8, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK4", - name = "Sledge", - noChaseCategory = "VTOL", - objectName = "eallterrheavy2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericGreen", - shootme = "1", - sightDistance = 650, - smoothAnim = true, - stealth = true, - seismicSignature = 4, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrheavy", - unitnumber = "110", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "heavytankweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING WALL", - }, - }, - customParams = { - needed_cover = 3, - death_sounds = "generic", - RequireTech = "6 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 6, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 100 - -local weaponDefs = { - heavytankweapon = { - badTargetCategory = [[BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.1, - beamWeapon = true, - coreThickness = 0.5, --- cegTag = "mediumcannonweapon3", - duration = 0.2, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium-green", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 650, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0 1 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "allterrheavyshot.wav", - soundHit = "mediumcannonhit.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 800, - customparams = { - damagetype = "eallterrheavy", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- +return lowerkeys({ [unitName] = unitDef }) +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrheavy_up1.lua b/Units/eallterrain/eallterrheavy_up1.lua new file mode 100644 index 000000000..4ac9e5464 --- /dev/null +++ b/Units/eallterrain/eallterrheavy_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrheavy -- Sledge -- +-------------------------------------------------------------------------------- + +unitName = "eallterrheavy_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Sledge Mark II]] + +objectName = "eallterrheavy2.s3o" +script = "eallterrheavy.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrheavy_up2.lua b/Units/eallterrain/eallterrheavy_up2.lua new file mode 100644 index 000000000..8a471eb28 --- /dev/null +++ b/Units/eallterrain/eallterrheavy_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrheavy -- Sledge -- +-------------------------------------------------------------------------------- + +unitName = "eallterrheavy_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Sledge Mark III]] + +objectName = "eallterrheavy2.s3o" +script = "eallterrheavy.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrheavy_up3.lua b/Units/eallterrain/eallterrheavy_up3.lua new file mode 100644 index 000000000..3e10421f5 --- /dev/null +++ b/Units/eallterrain/eallterrheavy_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrheavy -- Sledge -- +-------------------------------------------------------------------------------- + +unitName = "eallterrheavy_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Sledge Mark IV]] + +objectName = "eallterrheavy2.s3o" +script = "eallterrheavy.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrheavy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrlight.lua b/Units/eallterrain/eallterrlight.lua index 0844b287e..f7ec6a305 100644 --- a/Units/eallterrain/eallterrlight.lua +++ b/Units/eallterrain/eallterrlight.lua @@ -1,179 +1,26 @@ --- UNITDEF -- EALLTERRLIGHT -- +-- UNITDEF -- eallterrlight -- Recluse -- -------------------------------------------------------------------------------- -local unitName = "eallterrlight" +unitName = "eallterrlight" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Recluse]] ---** +objectName = "eallterrlight2.s3o" +script = "eallterrlight.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[2]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 22, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR RAID", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description = [[Raider -Light -50 Damage vs Light -25 Damage vs Armored/Building - -Requires +2 Power -Uses +2 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "smallExplosionGeneric", - firestandorders = "1", - footprintX = 4, - footprintZ = 4, - iconType = "allterrraider", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 250, - maxVelocity = 5.5, - maxReverseVelocity = 2, - turninplacespeedlimit = 5.5, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK4", - name = "Recluse", - noChaseCategory = "VTOL", - objectName = "eallterrlight2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "smallExplosionGeneric", - sightDistance = 500, - smoothAnim = true, - stealth = true, - seismicSignature = 4, - seismicDistance = 500, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrlight", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:factorysparks", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "lighttankweapon", - badTargetCategory = "VTOL", - badTargetCategory = "BUILDING ARMORED WALL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "2 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 2, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 50 - -local weaponDefs = { - lighttankweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 1, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.3, - duration = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-small-blue", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 350, - reloadtime = 0.5, - WeaponType = "LaserCannon", - rgbColor = "0.5 0.8 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "heavycannonGD.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 6, - tolerance = 1000, - turret = true, - weaponVelocity = 2000, - customparams = { - damagetype = "eallterrlight", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrlight_up1.lua b/Units/eallterrain/eallterrlight_up1.lua new file mode 100644 index 000000000..1df1aefc4 --- /dev/null +++ b/Units/eallterrain/eallterrlight_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrlight -- Recluse -- +-------------------------------------------------------------------------------- + +unitName = "eallterrlight_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Recluse Mark II]] + +objectName = "eallterrlight2.s3o" +script = "eallterrlight.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrlight_up2.lua b/Units/eallterrain/eallterrlight_up2.lua new file mode 100644 index 000000000..d07e6e2cd --- /dev/null +++ b/Units/eallterrain/eallterrlight_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrlight -- Recluse -- +-------------------------------------------------------------------------------- + +unitName = "eallterrlight_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Recluse Mark III]] + +objectName = "eallterrlight2.s3o" +script = "eallterrlight.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrlight_up3.lua b/Units/eallterrain/eallterrlight_up3.lua new file mode 100644 index 000000000..3db5ad6a1 --- /dev/null +++ b/Units/eallterrain/eallterrlight_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrlight -- Recluse -- +-------------------------------------------------------------------------------- + +unitName = "eallterrlight_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Recluse Mark IV]] + +objectName = "eallterrlight2.s3o" +script = "eallterrlight.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrlight_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrmed.lua b/Units/eallterrain/eallterrmed.lua index 2070f7d62..fd50fc005 100644 --- a/Units/eallterrain/eallterrmed.lua +++ b/Units/eallterrain/eallterrmed.lua @@ -1,184 +1,26 @@ --- UNITDEF -- EALLTERRMED -- +-- UNITDEF -- eallterrmed -- Basher -- -------------------------------------------------------------------------------- -local unitName = "eallterrmed" +unitName = "eallterrmed" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Basher]] ---** +objectName = "eallterrmed2.s3o" +script = "eallterrmed.cob" +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 29, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR SKIRMISHER", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description = [[Light Tank Destroyer -Light -200 Damage vs Armored -100 Damage vs Light/Building - -Requires +4 Power -Uses +4 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericPurple", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 500, - maxSlope = 180, - maxVelocity = 3.5, - maxReverseVelocity = 1, - turninplacespeedlimit = 4, - maxWaterDepth = 10, - metalStorage = 0, - mobilestandorders = "1", - movementClass = "ALLTERRTANK4", - name = "Basher", - noChaseCategory = "VTOL", - objectName = "eallterrmed2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericPurple", - sightDistance = 600, - smoothAnim = true, - stealth = true, - seismicSignature = 4, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrmed", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "mediumtankcannon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "4 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 4, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 - -local weaponDefs = { - mediumtankcannon = { - badTargetCategory = [[BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.1, - beamWeapon = true, - coreThickness = 0.5, --- cegTag = "mediumcannonweapon3", - duration = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 600, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "1 0.5 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "medallterrweapon.wav", - soundHit = "mediumcannonhit.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 600, - customparams = { - damagetype = "eallterrmed", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrmed_up1.lua b/Units/eallterrain/eallterrmed_up1.lua new file mode 100644 index 000000000..4e79640c1 --- /dev/null +++ b/Units/eallterrain/eallterrmed_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrmed -- Basher -- +-------------------------------------------------------------------------------- + +unitName = "eallterrmed_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Basher Mark II]] + +objectName = "eallterrmed2.s3o" +script = "eallterrmed.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrmed_up2.lua b/Units/eallterrain/eallterrmed_up2.lua new file mode 100644 index 000000000..9aba14501 --- /dev/null +++ b/Units/eallterrain/eallterrmed_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrmed -- Basher -- +-------------------------------------------------------------------------------- + +unitName = "eallterrmed_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Basher Mark III]] + +objectName = "eallterrmed2.s3o" +script = "eallterrmed.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrmed_up3.lua b/Units/eallterrain/eallterrmed_up3.lua new file mode 100644 index 000000000..d2830e8b0 --- /dev/null +++ b/Units/eallterrain/eallterrmed_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrmed -- Basher -- +-------------------------------------------------------------------------------- + +unitName = "eallterrmed_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Basher Mark IV]] + +objectName = "eallterrmed2.s3o" +script = "eallterrmed.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrmed_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot.lua b/Units/eallterrain/eallterrriot.lua index 2bf903d1a..d1781e159 100644 --- a/Units/eallterrain/eallterrriot.lua +++ b/Units/eallterrain/eallterrriot.lua @@ -1,229 +1,26 @@ --- UNITDEF -- EALLTERRRIOT -- +-- UNITDEF -- eallterrriot -- Mossberg -- -------------------------------------------------------------------------------- -local unitName = "eallterrriot" +unitName = "eallterrriot" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Mossberg]] ---** +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 27, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", --- canDgun = true, - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR RIOT", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description = [[Anti-Swarm EMP/Riot Tank -Armored -200 Paralysis Damage vs Light -100 Paralysis Damage vs Armored/Building -20 Damage vs All - -• Paralyzes enemy units -• Projectile can hit multiple units - -Alternate fire mode fires 10 projectiles in a shotgun spread with a small area of effect. Reduced damage vs buildings when in shotgun mode. - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericRed", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 400, - maxSlope = 180, - maxVelocity = 3.5, - maxReverseVelocity = 1, - turninplacespeedlimit = 3.3, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK4", - name = "Mossberg", - noChaseCategory = "VTOL", - objectName = "eallterrriot2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericRed", - sightDistance = 500, - smoothAnim = true, - stealth = true, - seismicSignature = 4, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrriot", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "riottankempweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - [2] = { - def = "riottankshotgun", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 -local weapon2Damage = 75 -local weapon2Projectiles = 10 - -local weaponDefs = { - riottankempweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 250, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.6, --- cegTag = "mediumcannonweapon3", - duration = 0.05, - edgeeffectiveness = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium-blue", - fallOffRate = 1, - fireStarter = 100, - impulseFactor = 0, - lineOfSight = true, - minintensity = 1, - name = "Laser", - noexplode = true, - paralyzer = true, - paralyzetime = 2.5, - range = 450, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0 0.2 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "fnubeamfire.wav", - soundHit = "phasegun1hit.wav", - texture1 = "wave", - texture2 = "empty", - thickness = 40, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "eallterrriot", - nofriendlyfire = 1, - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - riottankshotgun = { - AreaOfEffect = 100, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "bruisercannon", - explosionGenerator = "custom:genericshellexplosion-small", - energypershot = weapon2Damage / 20 * weapon2Projectiles, - interceptedByShieldType = 4, - impulseFactor = 0, - name = "Light Cannon", - projectiles = weapon2Projectiles, - range = 600, - reloadtime = 5, - weaponType = "Cannon", - soundHit = "mediumcannonhit.wav", - soundStart = "bruisercannon.wav", - sprayangle = 2000, - startsmoke = "1", - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "eallterrriotshotgun", - }, - damage = { - default = weapon2Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot_shotgun.lua b/Units/eallterrain/eallterrriot_shotgun.lua new file mode 100644 index 000000000..da8faaa4d --- /dev/null +++ b/Units/eallterrain/eallterrriot_shotgun.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot_shotgun -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_shotgun" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Mossberg]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot_shotgun_up1.lua b/Units/eallterrain/eallterrriot_shotgun_up1.lua new file mode 100644 index 000000000..28660568a --- /dev/null +++ b/Units/eallterrain/eallterrriot_shotgun_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot_shotgun_up1 -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_shotgun_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Mossberg]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot_shotgun_up2.lua b/Units/eallterrain/eallterrriot_shotgun_up2.lua new file mode 100644 index 000000000..a985965dc --- /dev/null +++ b/Units/eallterrain/eallterrriot_shotgun_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot_shotgun_up2 -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_shotgun_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Mossberg]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot_shotgun_up3.lua b/Units/eallterrain/eallterrriot_shotgun_up3.lua new file mode 100644 index 000000000..151f008ee --- /dev/null +++ b/Units/eallterrain/eallterrriot_shotgun_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot_shotgun_up3 -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_shotgun_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Mossberg]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrriot_up1.lua b/Units/eallterrain/eallterrriot_up1.lua new file mode 100644 index 000000000..0ca78d512 --- /dev/null +++ b/Units/eallterrain/eallterrriot_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Mossberg Mark II]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrriot_up2.lua b/Units/eallterrain/eallterrriot_up2.lua new file mode 100644 index 000000000..4c126c90c --- /dev/null +++ b/Units/eallterrain/eallterrriot_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Mossberg Mark III]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrriot_up3.lua b/Units/eallterrain/eallterrriot_up3.lua new file mode 100644 index 000000000..3ab790167 --- /dev/null +++ b/Units/eallterrain/eallterrriot_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrriot -- Mossberg -- +-------------------------------------------------------------------------------- + +unitName = "eallterrriot_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Mossberg Mark IV]] + +objectName = "eallterrriot2.s3o" +script = "eallterrriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrshield.lua b/Units/eallterrain/eallterrshield.lua index b55ddc74b..a278643a6 100644 --- a/Units/eallterrain/eallterrshield.lua +++ b/Units/eallterrain/eallterrshield.lua @@ -1,162 +1,26 @@ --- UNITDEF -- EALLTERRSHIELD -- +-- UNITDEF -- eallterrshield -- Widow -- -------------------------------------------------------------------------------- -local unitName = "eallterrshield" +unitName = "eallterrshield" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Widow]] ---** +objectName = "eallterrshield.s3o" +script = "eallterrshield.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[5]] - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 28, - builder = false, - buildTime = 5, - canAttack = false, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR RAID", - corpse = "ammobox", - --- Cloaking +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua") - cancloak = true, - cloakCost = 1, - cloakCostMoving = 2, - minCloakDistance = 150, - decloakOnFire = false, - decloakSpherical = true, - initCloaked = true, --- Starting out cloaked will dramatically increase the initial cost, however, it is much more convenient from a micromanagement standpoint. --- End Cloaking - - description = [[Shield Emitter -Light -Shield absorbs 1000 damage -Shield can link with other shield units to increase charging and capacity -Generates a Cloaking Field - -Requires +5 Power -+Uses +5 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "hugeExplosionGenericPurple", - fireState = "0", - footprintX = 5, - footprintZ = 5, - iconType = "support", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 500, - maxVelocity = 3.5, - maxReverseVelocity = 2, - turninplacespeedlimit = 4, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "ALLTERRTANK5", - moveState = "0", - name = "Widow", - noChaseCategory = "VTOL", - objectName = "eallterrshield.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "hugeExplosionGenericPurple", - sightDistance = 800, - smoothAnim = true, - stealth = true, - seismicSignature = 5, - turnInPlace = true, - turnRate = 1000, - unitname = "eallterrshield", - upright = false, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "allterrshield", - }, - }, - customParams = { - needed_cover = 3, - death_sounds = "generic", - RequireTech = "5 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 5, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local shield1PowerRegen = 10 - -local weaponDefs = { - allterrshield = { - IsShield = true, - Smartshield = true, - Exteriorshield = true, - Visibleshield = true, - Visibleshieldrepulse = true, - ShieldStartingPower = 0, - Shieldenergyuse = 0, - Shieldradius = 300, - Shieldpower = 1000, - Shieldpowerregen = shield1PowerRegen, - Shieldpowerregenenergy = shield1PowerRegen / 20, - Shieldintercepttype = 4, - Shieldgoodcolor = "0.0 0.2 1.0", - Shieldbadcolor = "1.0 0 0", - Shieldalpha = 0.3, - ShieldRepulsor = false, - texture1 = "shield4", - visibleShieldHit = true, - visibleShieldHitFrames = 50, - weaponType = [[Shield]], - damage = { - default = 1, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/eallterrshield_up2.lua b/Units/eallterrain/eallterrshield_up2.lua new file mode 100644 index 000000000..41bce9040 --- /dev/null +++ b/Units/eallterrain/eallterrshield_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrshield -- Widow -- +-------------------------------------------------------------------------------- + +unitName = "eallterrshield_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Widow Mark III]] + +objectName = "eallterrshield.s3o" +script = "eallterrshield.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eallterrshield_up3.lua b/Units/eallterrain/eallterrshield_up3.lua new file mode 100644 index 000000000..e12c85c7c --- /dev/null +++ b/Units/eallterrain/eallterrshield_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrshield -- Widow -- +-------------------------------------------------------------------------------- + +unitName = "eallterrshield_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Widow Mark IV]] + +objectName = "eallterrshield.s3o" +script = "eallterrshield.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eallterrain/ealltershield_up1.lua b/Units/eallterrain/ealltershield_up1.lua new file mode 100644 index 000000000..3d6b3f8f5 --- /dev/null +++ b/Units/eallterrain/ealltershield_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterrshield -- Widow -- +-------------------------------------------------------------------------------- + +unitName = "eallterrshield_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Widow Mark II]] + +objectName = "eallterrshield.s3o" +script = "eallterrshield.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterrshield_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eminifac.lua b/Units/eallterrain/eminifac.lua index efdbec87a..a5fa7397e 100644 --- a/Units/eallterrain/eminifac.lua +++ b/Units/eallterrain/eminifac.lua @@ -1,127 +1,24 @@ -- UNITDEF -- EMINIFAC -- -------------------------------------------------------------------------------- -local unitName = "eminifac" +unitName = "eminifac" -------------------------------------------------------------------------------- -local unitDef = { +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 - activatewhenbuilt = false, - buildAngle = 1024, - buildCostEnergy = 0, - buildCostMetal = 60, - builder = true, - buildTime = 5, - canBeAssisted = true, - canGuard = true, - canMove = true, - canPatrol = true, - canReclaim = false, - canstop = true, - category = "BUILDING NOTAIR", - - collisionVolumeOffsets = "0 60 0", - collisionVolumeScales = "298 142 168", - collisionVolumeTest = 1, - collisionVolumeType = "box", - - corpse = "ammobox", - --- Cloaking +humanName = [[All-Terrain Strider Factory]] - cancloak = true, - cloakCost = 1, - minCloakDistance = 250, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = false, - --- End Cloaking - - description = [[Place generators near this factory to unlock higher tier units]], - energyStorage = 0, - energyUse = 0, - energyMake = 0, - explodeAs = "MEXPOP2", - footprintX = 22, - footprintZ = 22, - iconType = "factory", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 1500, - maxSlope = 90, - maxWaterDepth = 0, - metalStorage = 0, - metalMake = 0, - name = "All-Terrain Factory", - objectName = "eallterrfac2.s3o", - script = "eallterrfac2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - showNanoSpray = "0", - sightDistance = 388, - smoothAnim = true, - stealth = true, - seismicSignature = 1, - TEDClass = "PLANT", - unitname = "eminifac", --- unitRestricted = 1, - workerTime = 1, - yardMap = "oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo oooooooyyyyyyyyooooooo", --- usePieceCollisionVolumes = true, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +objectName = "eallterrfac2.s3o" +script = "eallterrfac2.cob" - explosiongenerators = { - "custom:nanoorb", - "custom:nano", - "custom:blacksmoke", - "custom:fusionreactionbasic", - }, - }, - buildoptions = { - "eallterrengineer", --new - "eallterrlight", - "eallterrriot", - "eallterraa", - "eallterrmed", - "eallterrheavy", - "eallterrassault", - "eallterrshield", - "ecommander", - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdfactoryselect", - }, - }, - customParams = { - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", --- ProvideTech = "1 Powergrid", --- ProvideTechRange = "1500", --- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", --- groundtexselectxsize = 1500, -- optional --- groundtexselectzsize = 1500, -- optional - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 27, - BuildingGroundDecalSizeY = 27, - BuildingGroundDecalDecaySpeed = 0.9, -} +AllTerrainFactoryBuildList = Shared.buildListAllTerrainFactory +VFS.Include("units-configs-basedefs/basedefs/allterrain/eminifac_basedef.lua") -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eminifac_up1.lua b/Units/eallterrain/eminifac_up1.lua new file mode 100644 index 000000000..cd7d9a60b --- /dev/null +++ b/Units/eallterrain/eminifac_up1.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EMINIFAC -- +-------------------------------------------------------------------------------- + +unitName = "eminifac_up1" + +-------------------------------------------------------------------------------- + +buildCostMetal = 270 +maxDamage = buildCostMetal * 12.5 + +humanName = [[All-Terrain Strider Factory Mark II]] + +objectName = "eallterrfac2.s3o" +script = "eallterrfac2.cob" + +AllTerrainFactoryBuildList = Shared.buildListAllTerrainFactory_up1 + +VFS.Include("units-configs-basedefs/basedefs/allterrain/eminifac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eminifac_up2.lua b/Units/eallterrain/eminifac_up2.lua new file mode 100644 index 000000000..79d25b5b8 --- /dev/null +++ b/Units/eallterrain/eminifac_up2.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EMINIFAC -- +-------------------------------------------------------------------------------- + +unitName = "eminifac_up2" + +-------------------------------------------------------------------------------- + +buildCostMetal = 510 +maxDamage = buildCostMetal * 12.5 + +humanName = [[All-Terrain Strider Factory Mk III]] + +objectName = "eallterrfac2.s3o" +script = "eallterrfac2.cob" + +AllTerrainFactoryBuildList = Shared.buildListAllTerrainFactory_up2 + +VFS.Include("units-configs-basedefs/basedefs/allterrain/eminifac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eallterrain/eminifac_up3.lua b/Units/eallterrain/eminifac_up3.lua new file mode 100644 index 000000000..541ad0a58 --- /dev/null +++ b/Units/eallterrain/eminifac_up3.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EMINIFAC -- +-------------------------------------------------------------------------------- + +unitName = "eminifac_up3" + +-------------------------------------------------------------------------------- + +buildCostMetal = 750 +maxDamage = buildCostMetal * 12.5 + +humanName = [[All-Terrain Strider Factory Mark IV]] + +objectName = "eallterrfac2.s3o" +script = "eallterrfac2.cob" + +AllTerrainFactoryBuildList = Shared.buildListAllTerrainFactory_up3 + +VFS.Include("units-configs-basedefs/basedefs/allterrain/eminifac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibaa.lua b/Units/eamphib/eamphibaa.lua deleted file mode 100644 index 3ec7636a8..000000000 --- a/Units/eamphib/eamphibaa.lua +++ /dev/null @@ -1,170 +0,0 @@ --- UNITDEF -- eamphibaa -- --------------------------------------------------------------------------------- - -local unitName = "eamphibaa" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 24, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB RAID", - corpse = "ammobox", - description = [[Dedicated Anti-Air -Light -200 Damage/s vs Light -100 Damages/s vs Armored/Building - -Requires +2 Power -Uses +2 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericPurple", - footprintX = 4, - footprintZ = 4, - iconType = "aa", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 340, - maxSlope = 28, - maxVelocity = 3.8, - maxReverseVelocity = 2, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "TANK4", - name = "Ikinz", - objectName = "eamphibaa.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericPurple", - sightDistance = 800, - SonarDistance = 800, - stealth = true, - sonarStealth = false, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 6.0, - turnRate = 1000, --- turnrate = 475, - unitname = "eamphibaa", - workerTime = 0, - - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "antiaircannon", - onlyTargetCategory = "VTOL", - }, ---[[ - [2] = { - def = "TORP", - }, -]]-- - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "2 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 2, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 30 - -local weaponDefs = { - antiaircannon = { - AreaOfEffect = 25, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - canAttackGround = false, - coreThickness = 0.4, - burnblow = true, --- cegTag = "mediumcannonweapon3", - duration = 0.05, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-small", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 800, - reloadtime = 0.1, - WeaponType = "LaserCannon", - rgbColor = "1 0.5 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "tmediumtankfire.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 6, - tolerance = 1000, - turret = true, - weaponVelocity = 2500, - customparams = { - damagetype = "eamphibaa", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibarty.lua b/Units/eamphib/eamphibarty.lua index 19026fdb3..ab453151a 100644 --- a/Units/eamphib/eamphibarty.lua +++ b/Units/eamphib/eamphibarty.lua @@ -1,175 +1,24 @@ -- UNITDEF -- EAMPHIBARTY -- -------------------------------------------------------------------------------- -local unitName = "eamphibarty" +unitName = "eamphibarty" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Assimilator]] ---** +objectName = "eamphibarty2.s3o" +script = "eamphibarty2.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[5]] - acceleration = 1, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 36, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB SUPPORT", - corpse = "ammobox", - description = [["Laser Support Artillery -Light -300 Damage vs Buildings -75 Damage vs Light/Armored +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibarty_basedef.lua") - • Can fire while underwater - -Requires + 10 Power -Uses +10 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericBlue", - footprintX = 4, - footprintZ = 4, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 300, - maxSlope = 28, - maxVelocity = 1.8, - maxReverseVelocity = 1, - minWaterDepth = 10, - metalStorage = 0, - movementClass = "TANK4", - name = "Assimilator", - objectName = "eamphibarty2.s3o", - script = "eamphibarty2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericBlue", - sightDistance = 1175, - SonarDistance = 1175, - stealth = true, - sonarStealth = false, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 3.0, - turnRate = 1000, --- turnrate = 300, - unitname = "eamphibarty", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:factorysparks", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "assimilatorbeamweapon", - onlyTargetCategory = "BUILDING", - }, ---[[ - [2] = { - def = "TORP", - }, -]]-- - }, - customParams = { - needed_cover = 3, - death_sounds = "generic", - RequireTech = "10 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 10, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 300 - -local weaponDefs = { - assimilatorbeamweapon = { - badTargetCategory = [[ARMORED LIGHT]], - AreaOfEffect = 1, - avoidFeature = false, - avoidFriendly = false, - beamTime = 1.8, - collideFeature = false, - collideFriendly = false, - rgbColor = "0 0 0.5", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.5, - duration = 0.4, - explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", - energypershot = weapon1Damage / 20, - fallOffRate = 0.1, - fireStarter = 50, - interceptedByShieldType = 4, - largeBeamLaser = true, - laserflaresize = 5, - lineOfSight = true, - leadlimit = 20, - minintensity = 1, - name = "Laser", - range = 1175, - reloadtime = 9, - WeaponType = "BeamLaser", - soundHit = "amphibartyshothit.wav", - soundStart = "laserbeam02.wav", - soundTrigger = true, - texture1 = "lightning", - texture2 = "laserend", - thickness = 20, - tolerance = 500, - turret = true, - weaponVelocity = 1500, - waterweapon = true, - customparams = { - damagetype = "eamphibarty", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- return lowerkeys({ [unitName] = unitDef }) diff --git a/Units/eamphib/eamphibarty_up1.lua b/Units/eamphib/eamphibarty_up1.lua new file mode 100644 index 000000000..8ee73cc6f --- /dev/null +++ b/Units/eamphib/eamphibarty_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBARTY_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibarty_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Assimilator Mark II]] + +objectName = "eamphibarty2.s3o" +script = "eamphibarty2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibarty_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibarty_up2.lua b/Units/eamphib/eamphibarty_up2.lua new file mode 100644 index 000000000..4aea4dae7 --- /dev/null +++ b/Units/eamphib/eamphibarty_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBARTY_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibarty_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Assimilator Mark III]] + +objectName = "eamphibarty2.s3o" +script = "eamphibarty2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibarty_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibarty_up3.lua b/Units/eamphib/eamphibarty_up3.lua new file mode 100644 index 000000000..2bf6e47d2 --- /dev/null +++ b/Units/eamphib/eamphibarty_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBARTY_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibarty_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Assimilator Mark IV]] + +objectName = "eamphibarty2.s3o" +script = "eamphibarty2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibarty_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibbuggy.lua b/Units/eamphib/eamphibbuggy.lua index 4a10fe101..b8d94a86d 100644 --- a/Units/eamphib/eamphibbuggy.lua +++ b/Units/eamphib/eamphibbuggy.lua @@ -1,180 +1,26 @@ -- UNITDEF -- EAMPHIBBUGGY -- -------------------------------------------------------------------------------- -local unitName = "eamphibbuggy" +unitName = "eamphibbuggy" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Snake]] ---** +objectName = "eamphibbuggy2.s3o" +script = "eamphibbuggy_lus.lua" +tech = [[tech1]] +armortype = [[light]] +supply = [[1]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 18, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB RAID", - corpse = "ammobox", - description = [[Scout/Raider -Light -160 Damage/s vs Light -80 Damages/s vs Armored/Building - • Can fire while underwater +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibbuggy_basedef.lua") -Requires +1 Power -Uses +1 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "smallExplosionGenericRed", - footprintX = 2, - footprintZ = 2, - iconType = "raider", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 120, - maxSlope = 28, - maxVelocity = 6.0, - maxReverseVelocity = 2, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "TANK2", - name = "Snake", - noChaseCategory = "VTOL", - objectName = "eamphibbuggy2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "smallExplosionGenericRed", - sightDistance = 500, - SonarDistance = 500, - stealth = true, - sonarStealth = false, - smoothAnim = true, - seismicDistance = 300, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 6.0, - turnRate = 1000, --- turnrate = 475, - unitname = "eamphibbuggy", - workerTime = 0, - - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:factorysparks", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "lightbeamlaser", - badTargetCategory = "ARMORED BUILDING WALL", - }, ---[[ - [2] = { - def = "TORP", - }, -]]-- - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "1 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 1, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 32 - -local weaponDefs = { - lightbeamlaser = { - badTargetCategory = [[ARMORED BUILDING VTOL]], - TargetMoveError = 0.3, - AreaOfEffect = 1, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.2, - beamlaser = true, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.2, - duration = 0.2, - explosionGenerator = "custom:genericshellexplosion-small-sparks-burn", - energypershot = weapon1Damage / 20, - fallOffRate = 1, - fireStarter = 50, - interceptedByShieldType = 4, - impulsefactor = 0.1, - lineOfSight = true, - laserflaresize = 5, - largebeamlaser = true, - leadlimit = 10, - minintensity = 1, - name = "Laser", - range = 300, - reloadtime = 0.2, - WeaponType = "BeamLaser", - rgbColor = "0.5 0 0", - rgbColor2 = "0.8 0.8 0.8", - soundTrigger = true, - soundstart = "amphibbuggytankshothit.wav", --- soundHit = "amphibbuggytankshothit.wav", - scrollspeed = 5, - texture1 = "lightning", - texture2 = "laserend", - thickness = 5, - tolerance = 3000, - turret = true, - weaponVelocity = 1000, - waterweapon = true, - customparams = { - damagetype = "eamphibbuggy", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, -- multiply * 1.2 for correct dps output - }, - }, -} unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibbuggy_up1.lua b/Units/eamphib/eamphibbuggy_up1.lua new file mode 100644 index 000000000..38fdaf8e6 --- /dev/null +++ b/Units/eamphib/eamphibbuggy_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBBUGGY_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibbuggy_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Snake Mark II]] + +objectName = "eamphibbuggy2.s3o" +script = "eamphibbuggy_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[1]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibbuggy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibbuggy_up2.lua b/Units/eamphib/eamphibbuggy_up2.lua new file mode 100644 index 000000000..889f74b14 --- /dev/null +++ b/Units/eamphib/eamphibbuggy_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBBUGGY_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibbuggy_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Snake Mark III]] + +objectName = "eamphibbuggy2.s3o" +script = "eamphibbuggy_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[1]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibbuggy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibbuggy_up3.lua b/Units/eamphib/eamphibbuggy_up3.lua new file mode 100644 index 000000000..f238b1dac --- /dev/null +++ b/Units/eamphib/eamphibbuggy_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBBUGGY_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibbuggy_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Snake Mark IV]] + +objectName = "eamphibbuggy2.s3o" +script = "eamphibbuggy_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[1]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibbuggy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibengineer.lua b/Units/eamphib/eamphibengineer.lua deleted file mode 100644 index b7e875499..000000000 --- a/Units/eamphib/eamphibengineer.lua +++ /dev/null @@ -1,141 +0,0 @@ --- UNITDEF -- EAMPHIBENGINEER -- --------------------------------------------------------------------------------- - -local unitName = "eamphibengineer" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.24, - buildCostEnergy = 0, - buildCostMetal = 35, - buildDistance = 800, - builder = true, - buildTime = 5, - CanAttack = false, - CanAssist = true, - canBeAssisted = true, - CanCapture = false, - CanRepair = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "LIGHT AMPHIB SUPPORT", - description = [[Engineer -Light]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - footprintX = 4, - footprintZ = 4, - iconType = "engineer", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 600, - maxSlope = 28, - maxVelocity = 4, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalmake = 0, - metalStorage = 0, - movementClass = "TANK4", - moveState = "2", - name = "The Developer", - objectName = "eamphibengineer2.s3o", - script = "eamphibengineer2.cob", - radarDistance = 0, - radarDistanceJam = 20, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - showNanoSpray = "0", - side = "ARM", - sightDistance = 500, - SonarDistance = 500, - smoothAnim = true, - stealth = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 4, - turnRate = 1000, --- turnrate = 1020, - unitname = "eamphibengineer", - workerTime = 1, - capturespeed = 1, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - repairspeed = 0.15625, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:nanoorb", - "custom:dirt", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eminifac", --new - "ebasefactory", --new - "eamphibfac", - "eairplant", - "eexperimentalfac", - "emetalextractor", --new - "emaker", --new - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ekmar", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - "euwturret", - "elrpc", - "eshieldgen", - "esilo", - "emine", - "eorb", - "ecommander", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - dronespawner = "1", - armortype = "light", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibfac.lua b/Units/eamphib/eamphibfac.lua index cd77baa03..99d0a99ee 100644 --- a/Units/eamphib/eamphibfac.lua +++ b/Units/eamphib/eamphibfac.lua @@ -1,113 +1,24 @@ -- UNITDEF -- EAMPHIBFAC -- -------------------------------------------------------------------------------- -local unitName = "eamphibfac" +unitName = "eamphibfac" -------------------------------------------------------------------------------- -local unitDef = { +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 - activatewhenbuilt = false, - buildAngle = 1024, - buildCostEnergy = 0, - buildCostMetal = 60, - builder = true, - buildTime = 5, - canBeAssisted = true, - canGuard = true, - canMove = true, - canPatrol = true, - canReclaim = false, - canstop = true, - category = "BUILDING NOTAIR AMPHIB", --- collisionVolumeOffsets = "0 20 0", --- collisionVolumeScales = "238 92 128", --- collisionVolumeTest = 1, --- collisionVolumeType = "box", - corpse = "ammobox", - description = [[Place generators near this factory to unlock higher tier units]], - energyStorage = 0, - energyUse = 0, - energyMake = 0, - explodeAs = "MEXPOP2", - footprintX = 16, - footprintZ = 16, - iconType = "factory", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 1500, - maxSlope = 25, - maxWaterDepth = 5000, - metalStorage = 0, - metalMake = 0, - name = "Amphibious Tank Factory", - objectName = "eamphibfac2.s3o", - script = "eamphibfac2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - showNanoSpray = "0", - side = "CORE", - sightDistance = 388, - SonarDistance = 175, - smoothAnim = true, - TEDClass = "PLANT", - unitname = "eamphibfac", --- unitRestricted = 1, - workerTime = 1, - yardMap = "yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo yyyyyyyyoooooooo", --- usePieceCollisionVolumes = true, - - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 18, - BuildingGroundDecalSizeY = 18, - BuildingGroundDecalDecaySpeed = 0.9, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +humanName = [[Amphibious Tank Factory]] - explosiongenerators = { - "custom:nanoorb", - "custom:nano", - "custom:blacksmoke", - "custom:fusionreactionbasic", - }, - }, - buildoptions = { - "eamphibengineer", --new - "eamphibbuggy", --new - "eamphibriot", --new - "eamphibaa", - "eamphibmedtank", --new - "eamphibrock", --new - "eamphibarty", --new - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdfactoryselect", - }, - }, - customParams = { - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", --- ProvideTech = "1 Powergrid", --- ProvideTechRange = "1500", --- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", --- groundtexselectxsize = 1500, -- optional --- groundtexselectzsize = 1500, -- optional - }, -} +objectName = "eamphibfac2.s3o" +script = "eamphibfac2.cob" +amphibFactoryBuildList = Shared.buildListAmphibFactory + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibfac_basedef.lua") -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibfac_up1.lua b/Units/eamphib/eamphibfac_up1.lua new file mode 100644 index 000000000..571998876 --- /dev/null +++ b/Units/eamphib/eamphibfac_up1.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAMPHIBFAC_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibfac_up1" + +-------------------------------------------------------------------------------- + +buildCostMetal = 270 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Amphibious Tank Factory Mark II]] + +objectName = "eamphibfac2.s3o" +script = "eamphibfac2.cob" + +amphibFactoryBuildList = Shared.buildListAmphibFactory_up1 + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibfac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibfac_up2.lua b/Units/eamphib/eamphibfac_up2.lua new file mode 100644 index 000000000..0605b4331 --- /dev/null +++ b/Units/eamphib/eamphibfac_up2.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAMPHIBFAC_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibfac_up2" + +-------------------------------------------------------------------------------- + +buildCostMetal = 510 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Amphibious Tank Factory Mark III]] + +objectName = "eamphibfac2.s3o" +script = "eamphibfac2.cob" + +amphibFactoryBuildList = Shared.buildListAmphibFactory_up2 + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibfac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibfac_up3.lua b/Units/eamphib/eamphibfac_up3.lua new file mode 100644 index 000000000..a265a94eb --- /dev/null +++ b/Units/eamphib/eamphibfac_up3.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EAMPHIBFAC_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibfac_up3" + +-------------------------------------------------------------------------------- + +buildCostMetal = 750 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Amphibious Tank Factory Mark IV]] + +objectName = "eamphibfac2.s3o" +script = "eamphibfac2.cob" + +amphibFactoryBuildList = Shared.buildListAmphibFactory_up3 + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibfac_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibleveler.lua b/Units/eamphib/eamphibleveler.lua new file mode 100644 index 000000000..b8659d237 --- /dev/null +++ b/Units/eamphib/eamphibleveler.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibleveler -- +-------------------------------------------------------------------------------- + +unitName = "eamphibleveler" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Leveler]] + +objectName = "eamphibleveler.s3o" +script = "eamphibleveler.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[30]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibleveler_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibleveler_up1.lua b/Units/eamphib/eamphibleveler_up1.lua new file mode 100644 index 000000000..108f54712 --- /dev/null +++ b/Units/eamphib/eamphibleveler_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibleveler_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibleveler_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Leveler Mark II]] + +objectName = "eamphibleveler.s3o" +script = "eamphibleveler.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[30]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibleveler_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibleveler_up2.lua b/Units/eamphib/eamphibleveler_up2.lua new file mode 100644 index 000000000..4a37333c3 --- /dev/null +++ b/Units/eamphib/eamphibleveler_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibleveler_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibleveler_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Leveler Mark III]] + +objectName = "eamphibleveler.s3o" +script = "eamphibleveler.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[30]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibleveler_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibleveler_up3.lua b/Units/eamphib/eamphibleveler_up3.lua new file mode 100644 index 000000000..ea71e1947 --- /dev/null +++ b/Units/eamphib/eamphibleveler_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibleveler_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibleveler_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Leveler Mark IV]] + +objectName = "eamphibleveler.s3o" +script = "eamphibleveler.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[30]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibleveler_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibmedtank.lua b/Units/eamphib/eamphibmedtank.lua index 7cb943877..b37ffb6cd 100644 --- a/Units/eamphib/eamphibmedtank.lua +++ b/Units/eamphib/eamphibmedtank.lua @@ -1,182 +1,26 @@ -- UNITDEF -- EAMPHIBMEDTANK -- -------------------------------------------------------------------------------- -local unitName = "eamphibmedtank" +unitName = "eamphibmedtank" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Razor]] ---** +objectName = "eamphibmedtank2.s3o" +script = "eamphibmedtank_lus.lua" +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 28, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB SKIRMISHER", - corpse = "ammobox", - description = [[Tank Destroyer -Light -140 Damage vs Light/Armored -70 Damage vs Building +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibmedtank_basedef.lua") - • Can fire while underwater - -Requires +4 Power -Uses +4 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - footprintX = 3, - footprintZ = 3, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 360, - maxSlope = 28, - maxVelocity = 4.5, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "TANK3", - name = "Razor", - noChaseCategory = "VTOL", - objectName = "eamphibmedtank2.s3o", - script = "eamphibmedtank2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - side = "CORE", - sightDistance = 550, - SonarDistance = 550, - stealth = true, - sonarStealth = false, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 4.5, - turnRate = 1000, --- turnrate = 430, - unitname = "eamphibmedtank", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:factorysparks", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "medtankbeamlaser", - badTargetCategory = "BUILDING WALL", - }, ---[[ - [2] = { - def = "TORP", - }, -]]-- - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "4 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 4, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 28 - -local weaponDefs = { - medtankbeamlaser = { - badTargetCategory = [[BUILDING]], - TargetMoveError = 0.3, - AreaOfEffect = 1, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.2, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.5, - duration = 0.2, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium-sparks-burn", - fallOffRate = 1, - fireStarter = 50, - interceptedByShieldType = 4, - impulsefactor = 0.1, - lineOfSight = true, - largebeamlaser = true, - laserflaresize = 5, - leadlimit = 15, - minintensity = 1, - name = "Laser", - range = 550, - reloadtime = 0.2, - WeaponType = "BeamLaser", - rgbColor = "0 0.5 0", - rgbColor2 = "0.8 0.8 0.8", - soundTrigger = true, - soundstart = "amphibmedtankshothit.wav", --- soundHit = "amphibmedtankshothit.wav", - scrollspeed = 5, - texture1 = "lightning", - texture2 = "laserend", - thickness = 4, - tolerance = 3000, - turret = true, - weaponVelocity = 1000, - waterweapon = true, - customparams = { - damagetype = "eamphibmedtank", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, -- multiply * 1.2 for correct dps output - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibmedtank_up1.lua b/Units/eamphib/eamphibmedtank_up1.lua new file mode 100644 index 000000000..64d3dbfe7 --- /dev/null +++ b/Units/eamphib/eamphibmedtank_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBMEDTANK_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibmedtank_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Razor Mark II]] + +objectName = "eamphibmedtank2.s3o" +script = "eamphibmedtank_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibmedtank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibmedtank_up2.lua b/Units/eamphib/eamphibmedtank_up2.lua new file mode 100644 index 000000000..8e1887fc7 --- /dev/null +++ b/Units/eamphib/eamphibmedtank_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBMEDTANK_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibmedtank_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Razor Mark III]] + +objectName = "eamphibmedtank2.s3o" +script = "eamphibmedtank_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibmedtank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibmedtank_up3.lua b/Units/eamphib/eamphibmedtank_up3.lua new file mode 100644 index 000000000..dc5e11999 --- /dev/null +++ b/Units/eamphib/eamphibmedtank_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBMEDTANK_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibmedtank_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Razor Mark IV]] + +objectName = "eamphibmedtank2.s3o" +script = "eamphibmedtank_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibmedtank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibneedle.lua b/Units/eamphib/eamphibneedle.lua new file mode 100644 index 000000000..ed5ba5af0 --- /dev/null +++ b/Units/eamphib/eamphibneedle.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibneedle -- +-------------------------------------------------------------------------------- + +unitName = "eamphibneedle" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Ikinz]] + +objectName = "eamphibaa.s3o" +script = "eamphibaa.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibneedle_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibneedle_up1.lua b/Units/eamphib/eamphibneedle_up1.lua new file mode 100644 index 000000000..480e99510 --- /dev/null +++ b/Units/eamphib/eamphibneedle_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibneedle_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibneedle_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Ikinz Mark II]] + +objectName = "eamphibaa.s3o" +script = "eamphibaa.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibneedle_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibneedle_up2.lua b/Units/eamphib/eamphibneedle_up2.lua new file mode 100644 index 000000000..5dd38201f --- /dev/null +++ b/Units/eamphib/eamphibneedle_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibneedle_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibneedle_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Ikinz Mark III]] + +objectName = "eamphibaa.s3o" +script = "eamphibaa.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibneedle_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibneedle_up3.lua b/Units/eamphib/eamphibneedle_up3.lua new file mode 100644 index 000000000..8cc4ec732 --- /dev/null +++ b/Units/eamphib/eamphibneedle_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibneedle_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibneedle_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Ikinz Mark IV]] + +objectName = "eamphibaa.s3o" +script = "eamphibaa.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibneedle_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot.lua b/Units/eamphib/eamphibriot.lua index 756b36a21..de23002fb 100644 --- a/Units/eamphib/eamphibriot.lua +++ b/Units/eamphib/eamphibriot.lua @@ -1,217 +1,26 @@ -- UNITDEF -- EAMPHIBRIOT-- -------------------------------------------------------------------------------- -local unitName = "eamphibriot" +unitName = "eamphibriot" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Dicer]] ---** +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 23, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", --- canDgun = true, - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB RIOT", - corpse = "ammobox", - description = [[Anti-Swarm EMP/Riot Tank -Light -200 Paralysis Damage vs Light -100 Paralysis Damage vs Armored/Building +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_basedef.lua") -• Paralyzes enemy units -• Projectile can hit multiple units - -Alternate fire mode fires 10 projectiles in a shotgun spread with a small area of effect. Reduced damage vs buildings when in shotgun mode. - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericWhite", - footprintX = 3, - footprintZ = 3, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 340, - maxSlope = 28, - maxVelocity = 4.4, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "TANK3", - name = "Dicer", - noChaseCategory = "VTOL", - objectName = "eamphibriot2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericWhite", - side = "CORE", - sightDistance = 500, - SonarDistance = 500, - stealth = true, - sonarStealth = false, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 3.7, - turnRate = 1000, --- turnrate = 430, - unitname = "eamphibriot", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "riottankempweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - [2] = { - def = "riottankshotgun", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 -local weapon2Damage = 75 -local weapon2Projectiles = 10 - -local weaponDefs = { - riottankempweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 250, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.6, --- cegTag = "mediumcannonweapon3", - duration = 0.05, - edgeeffectiveness = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium-blue", - fallOffRate = 1, - fireStarter = 100, - impulseFactor = 0, - lineOfSight = true, - minintensity = 1, - name = "Laser", - noexplode = true, - paralyzer = true, - paralyzetime = 2.5, - range = 400, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0 0.2 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "fnubeamfire.wav", - soundHit = "phasegun1hit.wav", - texture1 = "wave", - texture2 = "empty", - thickness = 40, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "eamphibriot", - nofriendlyfire = 1, - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - riottankshotgun = { - AreaOfEffect = 100, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "bruisercannon", - explosionGenerator = "custom:genericshellexplosion-small", - energypershot = weapon2Damage / 20 * weapon2Projectiles, - interceptedByShieldType = 4, - impulseFactor = 0, - name = "Light Cannon", - projectiles = weapon2Projectiles, - range = 600, - reloadtime = 5, - weaponType = "Cannon", - soundHit = "mediumcannonhit.wav", - soundStart = "bruisercannon.wav", - sprayangle = 2000, - startsmoke = "1", - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "eallterrriotshotgun", - }, - damage = { - default = weapon2Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_shotgun.lua b/Units/eamphib/eamphibriot_shotgun.lua new file mode 100644 index 000000000..abce08ee1 --- /dev/null +++ b/Units/eamphib/eamphibriot_shotgun.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_shotgun-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_shotgun" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Dicer]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_shotgun_up1.lua b/Units/eamphib/eamphibriot_shotgun_up1.lua new file mode 100644 index 000000000..7f913ad04 --- /dev/null +++ b/Units/eamphib/eamphibriot_shotgun_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_shotgun_up1-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_shotgun_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Dicer Mark II]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_shotgun_up2.lua b/Units/eamphib/eamphibriot_shotgun_up2.lua new file mode 100644 index 000000000..576f1f315 --- /dev/null +++ b/Units/eamphib/eamphibriot_shotgun_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_shotgun_up2-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_shotgun_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Dicer Mark III]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_shotgun_up3.lua b/Units/eamphib/eamphibriot_shotgun_up3.lua new file mode 100644 index 000000000..b171c8feb --- /dev/null +++ b/Units/eamphib/eamphibriot_shotgun_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_shotgun_up3-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_shotgun_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Dicer Mark IV]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_up1.lua b/Units/eamphib/eamphibriot_up1.lua new file mode 100644 index 000000000..e1dab0d1e --- /dev/null +++ b/Units/eamphib/eamphibriot_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_up1-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Dicer Mark II]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_up2.lua b/Units/eamphib/eamphibriot_up2.lua new file mode 100644 index 000000000..2b0b80021 --- /dev/null +++ b/Units/eamphib/eamphibriot_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_up2-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Dicer Mark III]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibriot_up3.lua b/Units/eamphib/eamphibriot_up3.lua new file mode 100644 index 000000000..3c969b198 --- /dev/null +++ b/Units/eamphib/eamphibriot_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBRIOT_up3-- +-------------------------------------------------------------------------------- + +unitName = "eamphibriot_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Dicer Mark IV]] + +objectName = "eamphibriot2.s3o" +script = "eamphibriot.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibriot_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibrock.lua b/Units/eamphib/eamphibrock.lua index 5c76905ab..59f06e86f 100644 --- a/Units/eamphib/eamphibrock.lua +++ b/Units/eamphib/eamphibrock.lua @@ -1,226 +1,26 @@ -- UNITDEF -- EAMPHIBROCK -- -------------------------------------------------------------------------------- -local unitName = "eamphibrock" +unitName = "eamphibrock" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Spitter]] ---** +objectName = "eamphibrock4.s3o" +script = "eamphibrock4.cob" +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 34, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT AMPHIB SUPPORT", - corpse = "ammobox", - description = [[Missile support tank -Light -200 Damage vs Light -100 Damage vs Armored/Building -20 Damage vs All +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibrock_basedef.lua") -Requires +5 Power -Uses +5 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGeneric", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 320, - maxSlope = 28, - maxVelocity = 3.4, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "TANK4", - name = "Spitter", - noChaseCategory = "VTOL", - objectName = "eamphibrock4.s3o", - script = "eamphibrock4.cob", - onlytargetcategory2 = "VTOL", - onlytargetcategory3 = "VTOL", - onlytargetcategory4 = "VTOL", - onlytargetcategory5 = "VTOL", - onlytargetcategory6 = "VTOL", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGeneric", - side = "CORE", - sightDistance = 650, - SonarDistance = 650, - stealth = true, - sonarStealth = false, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 3.4, - turnRate = 1000, --- turnrate = 430, - unitname = "eamphibrock", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:dirt", - "custom:blacksmoke", - "custom:jethtrail", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "antiarmorrockets", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT WALL", - }, - [2] = { - def = "antiarmorrocketssalvo", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT WALL", - }, - }, - customParams = { - canareaattack="1", - needed_cover = 2, - death_sounds = "generic", - RequireTech = "5 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 5, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 -local weapon2Damage = 200 -local weapon2Burst = 5 - -local weaponDefs = { - - antiarmorrockets = { - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - cegTag = "missiletrailsmall", - explosionGenerator = "custom:genericshellexplosion-medium-red", - energypershot = weapon1Damage / 20, - fireStarter = 70, - tracks = true, - impulseFactor = 0, - interceptedByShieldType = 4, - model = "missilesmalllauncher.s3o", - name = "Rockets", - range = 700, - reloadtime = 1, - weaponType = "MissileLauncher", - smokeTrail = false, - soundStart = "rocket1.wav", - soundHit = "explode5.wav", - startVelocity = 250, - tolerance = 8000, - turnrate = 2500, - predictBoost = 0.5, - turret = true, - weaponAcceleration = 50, - flightTime = 5, - trajectoryHeight = 1.5, - weaponVelocity = 500, - customparams = { - damagetype = "eamphibrock", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - antiarmorrocketssalvo = { - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - burst = weapon2Burst, - burstrate = 0.1, - cegTag = "missiletrailsmall", - explosionGenerator = "custom:genericshellexplosion-medium-red", - energypershot = weapon2Damage / 20 * weapon2Burst, - fireStarter = 70, - tracks = true, - impulseFactor = 0, - interceptedByShieldType = 4, - model = "missilesmalllauncher.s3o", - name = "Rockets", - range = 700, - reloadtime = 5, - weaponType = "MissileLauncher", - smokeTrail = false, - soundStart = "rocket1.wav", - soundHit = "explode5.wav", - startVelocity = 250, - tolerance = 8000, - turnrate = 10000, - predictBoost = 0.5, - turret = true, - weaponAcceleration = 50, - flightTime = 5, - trajectoryHeight = 1.5, - sprayangle = 10000, - weaponVelocity = 500, - customparams = { - damagetype = "eamphibrock", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon2Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibrock_up1.lua b/Units/eamphib/eamphibrock_up1.lua new file mode 100644 index 000000000..c388b3b8f --- /dev/null +++ b/Units/eamphib/eamphibrock_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBROCK_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibrock_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Spitter Mark II]] + +objectName = "eamphibrock4.s3o" +script = "eamphibrock4.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibrock_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibrock_up2.lua b/Units/eamphib/eamphibrock_up2.lua new file mode 100644 index 000000000..262af3edb --- /dev/null +++ b/Units/eamphib/eamphibrock_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBROCK_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibrock_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Spitter Mark III]] + +objectName = "eamphibrock4.s3o" +script = "eamphibrock4.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibrock_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/eamphibrock_up3.lua b/Units/eamphib/eamphibrock_up3.lua new file mode 100644 index 000000000..dd7f57b31 --- /dev/null +++ b/Units/eamphib/eamphibrock_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBROCK_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eamphibrock_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Spitter Mark IV]] + +objectName = "eamphibrock4.s3o" +script = "eamphibrock4.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibrock_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eamphib/esubmarine.lua b/Units/eamphib/esubmarine.lua deleted file mode 100644 index 4b8270d61..000000000 --- a/Units/eamphib/esubmarine.lua +++ /dev/null @@ -1,144 +0,0 @@ --- UNITDEF -- ESUBMARINE -- --------------------------------------------------------------------------------- - -local unitName = "esubmarine" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.18, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 90, - builder = false, - buildTime = 2.5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT SUB", - corpse = "ammobox", - description = "Anti-Amphibious Submarine", - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_UNIT", - footprintX = 4, - footprintZ = 4, - iconType = "sub", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 300, - maxSlope = 60, - maxVelocity = 4.0, - maxReverseVelocity = 1, - minWaterDepth = 10, - metalStorage = 0, - movementClass = "UBOAT4", - name = "Lurker", - noChaseCategory = "VTOL", - objectName = "esubplane.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "MEDIUM_UNIT", - side = "CORE", - sightDistance = 500, - SonarDistance = 700, - smoothAnim = true, - turnInPlace = false, - turnRate = 430, - unitname = "esubmarine", - workerTime = 0, - waterline = 30, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:dirt", - "custom:warp", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "TORP", - OnlyTargetCategory = "AMPHIB SUB", - BadTargetCategory = "VTOL", - noChaseCategory = "VTOL", - }, - }, - - customParams = { - death_sounds = "generic", - armortype = "light", - normalstex = "unittextures/esubplanenormal.png", - }, - -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - TORP = { - AreaOfEffect = 10, - avoidFriendly = false, - avoidFeature = false, - ballistic = false, - cegTag = "torpedotrail", - collideFriendly = false, - cylinderTargeting = true, - explosionGenerator = "custom:torpedoexplosion", - id = 5, - - model = "missile.s3o", - name = "Bombs", - noSelfDamage = true, - range = 300, - reloadtime = 8, - soundHit = "subhit.wav", - soundStart = "torpedolaunch.wav", - startVelocity = 100, - turret = true, - tracks = true, - tolerance = 1000, - turnrate = 900, - weaponVelocity = 400, - WeaponType = "TorpedoLauncher", - WeaponAcceleration = 100, - flighttime = 10, - waterweapon = true, - damage = { - default = 100, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebox.lua b/Units/ebox.lua new file mode 100644 index 000000000..03c3d4822 --- /dev/null +++ b/Units/ebox.lua @@ -0,0 +1,113 @@ +-- UNITDEF -- EBOX -- +-------------------------------------------------------------------------------- + +local unitName = "ebox" + +-------------------------------------------------------------------------------- + +local armortype = [[armored]] + +local techrequired = [[tech1]] + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 1, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 15, + buildDistance = 400, + builder = false, + buildTime = 5, + canAttack = false, + canCapture = false, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canstop = "1", + category = "ARMORED NOTAIR", + description = [[Long Range Radar and Seismic Detection]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "largeExplosionGenericWhite", + footprintX = 2, + footprintZ = 2, + iconType = "box", + idleAutoHeal = .5, + idleTime = 2200, + leaveTracks = false, + maxDamage = 400, + maxSlope = 26, + maxVelocity = 4, + maxReverseVelocity = 4, + maxWaterDepth = 10, + metalStorage = 0, + movementClass = "HOVERTANK2", + name = "B.O.X.", + noChaseCategory = "VTOL", + objectName = "ebox_small.s3o", + script = "ebox_lus.lua", + radarDistance = 1250, + repairable = false, + selfDestructAs = "largeExplosionGenericWhite", + side = "CORE", + sightDistance = 750, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + seismicDistance = 1250, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = true, + workerTime = 2, + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + explosiongenerators = { + "custom:emptydirt", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + RequireTech = techrequired, + unittype = "mobile", + canbetransported = "true", + armortype = armortype, + energycoredronespawner = true, + needed_cover = 1, + death_sounds = "generic", + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[]], + retreatRangeDAI = 1250, + }, +} + +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ebuilding/eaaturret.lua b/Units/ebuilding/eaaturret.lua deleted file mode 100644 index c6ae9b2da..000000000 --- a/Units/ebuilding/eaaturret.lua +++ /dev/null @@ -1,137 +0,0 @@ --- UNITDEF -- EAATURRET -- --------------------------------------------------------------------------------- - -local unitName = "eaaturret" - --------------------------------------------------------------------------------- - -local unitDef = { - - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Anti-Air Flak Turret - Building - 112.5 Damage vs Armored - 75 Damage vs Light/Building - ]], - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_BUILDING", - floater = true, - footprintX = 5, - footprintZ = 5, - icontype = "defense", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 800, - maxSlope = 60, - maxWaterDepth = 99999999999, - metalStorage = 0, - name = "Copperhead", - noAutoFire = false, - objectName = "eaaturret2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "MEDIUM_BUILDING", - sightDistance = 1000, - smoothAnim = true, - unitname = "eaaturret", - yardMap = "ooooo ooooo ooooo ooooo ooooo", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:needspower", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "antiairgunflak", - onlytargetcategory = "VTOL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - armortype = "building", - nofriendlyfire = "1", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 7, - BuildingGroundDecalSizeY = 7, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 112.5 - -local weaponDefs = { - antiairgunflak = { - AreaOfEffect = 300, - avoidFriendly = false, - avoidFeature = false, - ballistic = true, - collideFriendly = false, - collideFeature = false, - cylinderTargeting = true, - burnblow = true, - endsmoke = "1", - explosionGenerator = "custom:xamelImpact", - energypershot = weapon1Damage / 20, - fireStarter = 80, - id = 1, - impulseFactor = 0, - interceptedByShieldType = 4, - name = "AA Cannon", - pitchtolerance = "500", - range = 1000, - reloadtime = 1, - weaponType = "Cannon", - soundHit = "flakhit", - soundStart = "flakgun_shoot.wav", - startsmoke = "1", - tolerance = 500, - turret = true, - toairweapon = true, - canAttackGround = false, - weaponVelocity = 5000, - customparams = { - damagetype = "eaaturret", - nofriendlyfire = 1, - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/eartyturret.lua b/Units/ebuilding/eartyturret.lua new file mode 100644 index 000000000..e79acafa2 --- /dev/null +++ b/Units/ebuilding/eartyturret.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EARTYTURRET -- +-------------------------------------------------------------------------------- + +unitName = [[eartyturret]] + +isUpgraded = [[0]] + +humanName = [[Lobster]] +objectName = [[eartyturret.s3o]] +script = [[eartyturret.cob]] + +tech = [[tech3]] +armortype = [[building]] + +AreaOfEffect = 500 + +VFS.Include("units-configs-basedefs/basedefs/buildings/eartyturret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/eartyturret_up1.lua b/Units/ebuilding/eartyturret_up1.lua new file mode 100644 index 000000000..b44b819b8 --- /dev/null +++ b/Units/ebuilding/eartyturret_up1.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EARTYTURRET_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[eartyturret_up1]] + +isUpgraded = [[1]] + +humanName = [[Lobster MK II]] +objectName = [[eartyturret.s3o]] +script = [[eartyturret.cob]] + +tech = [[tech3]] +armortype = [[building]] + +AreaOfEffect = 200 + +VFS.Include("units-configs-basedefs/basedefs/buildings/eartyturret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/eartyturret_up2.lua b/Units/ebuilding/eartyturret_up2.lua new file mode 100644 index 000000000..1ac8029c8 --- /dev/null +++ b/Units/ebuilding/eartyturret_up2.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EARTYTURRET_up2 -- +-------------------------------------------------------------------------------- + +unitName = [[eartyturret_up2]] + +isUpgraded = [[2]] + +humanName = [[Lobster MK III]] +objectName = [[eartyturret.s3o]] +script = [[eartyturret.cob]] + +tech = [[tech3]] +armortype = [[building]] + +AreaOfEffect = 400 + +VFS.Include("units-configs-basedefs/basedefs/buildings/eartyturret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/eartyturret_up3.lua b/Units/ebuilding/eartyturret_up3.lua new file mode 100644 index 000000000..ab5044e34 --- /dev/null +++ b/Units/ebuilding/eartyturret_up3.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- EARTYTURRET_up3 -- +-------------------------------------------------------------------------------- + +unitName = [[eartyturret_up3]] + +isUpgraded = [[3]] + +humanName = [[Lobster MK IV]] +objectName = [[eartyturret.s3o]] +script = [[eartyturret.cob]] + +tech = [[tech3]] +armortype = [[building]] + +AreaOfEffect = 600 + +VFS.Include("units-configs-basedefs/basedefs/buildings/eartyturret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/ebarricade.lua b/Units/ebuilding/ebarricade.lua deleted file mode 100644 index 97b9f4630..000000000 --- a/Units/ebuilding/ebarricade.lua +++ /dev/null @@ -1,89 +0,0 @@ --- UNITDEF -- EBARRICADE -- --------------------------------------------------------------------------------- - -local unitName = "ebarricade" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 4096, - buildCostEnergy = 0, - buildCostMetal = 5, - builder = false, - buildTime = 1, - canAttack = false, - canstop = "1", - category = "BUILDING NOTAIR WALL", - collisionVolumeOffsets = "0 0 0", - collisionVolumeScales = "48 72 48", - collisionVolumeTest = 1, - collisionVolumeType = "box", - damageModifier = 0.2, - description = "Organic Barricade - Regenerates Health :: Armortype: Armored Building", - energyStorage = 0, - energyUse = 0, - explodeAs = "ESTOR_BUILDING", - footprintX = 3, - footprintZ = 3, - autoHeal = 20, - iconType = "barricade", - idleTime = 0, - maxDamage = 1000, - maxSlope = 60, - maxWaterDepth = 0, - mass = 1000, - metalStorage = 0, - name = "Thorn", - objectName = "ebarricade.s3o", - repairable = false, - selfDestructAs = "ESTOR_BUILDING", - selfDestructCountdown = 0, - side = "ARM", - sightDistance = 0, - smoothAnim = true, - TEDClass = "FORT", - unitname = "ebarricade", - workerTime = 0, - yardMap = "ooo ooo ooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/ebarricadenormal.png", - helptext = [[Organic Barricade - -Regenerates Hitpoints as it takes damage. Provides cover for your units or structures. - -+20 Hitpoints regenerated per second]], - }, - buildingGroundDecalDecaySpeed=30, - buildingGroundDecalSizeX=5, - buildingGroundDecalSizeY=5, - useBuildingGroundDecal = true, - buildingGroundDecalType=[[ebarricade_aoplane.dds]], -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/eflakturret.lua b/Units/ebuilding/eflakturret.lua new file mode 100644 index 000000000..d7beba03b --- /dev/null +++ b/Units/ebuilding/eflakturret.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EFLAKTURRET -- +-------------------------------------------------------------------------------- + +unitName = [[eflakturret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Fortifier]] + +objectName = [[eflakturret.s3o]] +script = [[eflakturret.cob]] + +tech = [[tech2]] +armortype = [[building]] +--supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/buildings/eflakturret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/efusion2.lua b/Units/ebuilding/efusion2.lua index 4fc03d795..9652d7e8d 100644 --- a/Units/ebuilding/efusion2.lua +++ b/Units/ebuilding/efusion2.lua @@ -1,109 +1,104 @@ -- UNITDEF -- EFUSION2 -- -------------------------------------------------------------------------------- -local unitName = "efusion2" +local unitName = "efusion2" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2500, - buildCostEnergy = 0, - buildCostMetal = 180, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = [[Produces +10 Energy -Provides +10 Power -Provides +30 Supply]], --- energyMake = 10, - energyStorage = 0, - energyUse = -10, - explodeAs = "FUSIONPOP", - footprintX = 8, - footprintZ = 8, - iconType = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 2400, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Advanced Generator", - objectName = "efusion2.s3o", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "FUSIONPOP", - side = "ARM", - sightDistance = 367, - smoothAnim = true, - unitname = "efusion2", - workerTime = 0, - yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", +local armortype = [[building]] +local techrequired = [[tech3]] +local energyproduced = [[50]] - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +local buildCostMetal = 400 +local maxDamage = buildCostMetal * 12.5 - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionnuclear", - "custom:skyhatelaser", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 5, - death_sounds = "generic", - ProvideTech = "10 Power", - ProvideTechRange = "800", --- RequireTech = "1 Powergrid", - armortype = "building", - supply_granted = 30, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - groundtexselectimg = ":nc:bitmaps/power/power.png", - groundtexselectimg1 = ":nc:bitmaps/power/power1.png", - groundtexselectimg2 = ":nc:bitmaps/power/power2.png", - groundtexselectimg3 = ":nc:bitmaps/power/power3.png", - groundtexselectimg4 = ":nc:bitmaps/power/power4.png", - groundtexselectimg5 = ":nc:bitmaps/power/power5.png", - groundtexselectimg6 = ":nc:bitmaps/power/power6.png", - groundtexselectxsize = 800, -- optional - groundtexselectzsize = 800, -- optional - helptext = [[Nuclear Powerplant +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2500, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + description = [[Produces +]] .. energyproduced .. [[ Energy]], + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "hugeBuildingExplosionGenericBlueEMP", + footprintX = 12, + footprintZ = 12, + iconType = "generator", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Cold Fusion Energy Generator", + objectName = "efusion2-huge.s3o", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericBlueEMP", + side = "ARM", + sightDistance = 367, + smoothAnim = true, + unitname = "efusion2", + yardMap = "oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo", -Produces energy and power in an increased capacity and radius + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, -+10 Energy - -+10 Power - -+1000 Power Radius]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionnuclear-huge-4color", + "custom:skyhatelaser", + }, + }, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy.wav", + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 5, + death_sounds = "generic", + RequireTech = techrequired, + armortype = armortype, + noenergycost = true, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 800, -- optional +-- groundtexselectzsize = 800, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 14, + BuildingGroundDecalSizeY = 14, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/egeothermal.lua b/Units/ebuilding/egeothermal.lua index 1b961b460..883985992 100644 --- a/Units/ebuilding/egeothermal.lua +++ b/Units/ebuilding/egeothermal.lua @@ -1,111 +1,110 @@ -- UNITDEF -- EGEOTHERMAL -- -------------------------------------------------------------------------------- -local unitName = "egeothermal" +local unitName = "egeothermal" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 100, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = [[Produces +7 Energy -Provides +7 Power -Provides +20 Supply]], - energyMake = 7, - energyStorage = 0, - energyUse = 0, - explodeAs = "GEOPOP", - footprintX = 4, - footprintZ = 4, - iconType = "eco", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 2000, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Geothermal Generator", - objectName = "egeothermal2.s3o", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "GEOPOP", - side = "ARM", - sightDistance = 367, - smoothAnim = true, - unitname = "egeothermal", - workerTime = 0, - yardMap = "oooo oGGo oGGo oooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactiongeo", - "custom:skyhatelaser", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 2, - death_sounds = "generic", - ProvideTech = "7 Power", - ProvideTechRange = "600", - armortype = "building", - supply_granted = 20, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - groundtexselectimg = ":nc:bitmaps/power/power.png", - groundtexselectimg1 = ":nc:bitmaps/power/power1.png", - groundtexselectimg2 = ":nc:bitmaps/power/power2.png", - groundtexselectimg3 = ":nc:bitmaps/power/power3.png", - groundtexselectimg4 = ":nc:bitmaps/power/power4.png", - groundtexselectimg5 = ":nc:bitmaps/power/power5.png", - groundtexselectimg6 = ":nc:bitmaps/power/power6.png", - groundtexselectxsize = 600, -- optional - groundtexselectzsize = 600, -- optional - helptext = [[Geothermal Powerplant - -Produces energy and power in an increased capacity and radius +local armortype = [[building]] +local techrequired = [[tech2]] +local energyproduced = [[30]] -+7 Energy +local buildCostMetal = 280 +local maxDamage = buildCostMetal * 12.5 -+7 Power +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildingMask = 0, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + description = [[Produces +]] .. energyproduced .. [[ Energy]], + energyMake = energyproduced, + energyStorage = 0, + explodeAs = "largeBuildingExplosionGenericBlueEMP", + footprintX = 4, + footprintZ = 4, + iconType = "generator", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Fusion Energy Generator", + objectName = "egeothermal2.s3o", + script = "egeothermal.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericBlueEMP", + side = "ARM", + sightDistance = 367, + smoothAnim = true, + unitname = "egeothermal", + workerTime = 0, + yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", -+600 Power Radius + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionnuclear-2color", + "custom:skyhatelaser", + }, + }, -Can only be built upon a geothermal vent]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 6, - BuildingGroundDecalSizeY = 6, - BuildingGroundDecalDecaySpeed = 0.9, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 2, + death_sounds = "generic", + RequireTech = techrequired, +-- ProvideTech = techprovided, +-- ProvideTechRange = powerradius, + armortype = armortype, + noenergycost = true, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 600, -- optional +-- groundtexselectzsize = 600, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/eheavyturret2.lua b/Units/ebuilding/eheavyturret2.lua index c8eb92ddc..f3f9a6cda 100644 --- a/Units/ebuilding/eheavyturret2.lua +++ b/Units/ebuilding/eheavyturret2.lua @@ -1,157 +1,26 @@ -- UNITDEF -- EHEAVYTURRET2 -- -------------------------------------------------------------------------------- -local unitName = "eheavyturret2" +unitName = [[eheavyturret2]] -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] - buildAngle = 8192, - buildCostEnergy = 0, - buildCostMetal = 90, - builder = false, - buildTime = 5, - collisionVolumeOffsets = "0 0 0", - collisionVolumeScales = "80 115 80", - collisionVolumeTest = 1, - collisionVolumeType = "box", - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Heavy Plasma Battery (Anti-Armor) +humanName = [[Immolator]] -Building -300 Damage vs Armored -125 Damage vs Light -30 Damage vs Buildings +objectName = [[eheavyturret3.s3o]] +script = [[eheavyturret2.cob]] -Uses +2 Supply]], - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_BUILDING", - footprintX = 6, - footprintZ = 6, - floater = true, - idleAutoHeal = .5, - idleTime = 2200, - iconType = "defense", - maxDamage = 1250, - maxSlope = 60, - maxWaterDepth = 999999, - metalStorage = 0, - name = "Immolator", - objectName = "eheavyturret3.s3o", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "MEDIUM_BUILDING", - side = "CORE", - sightDistance = 1000, - smoothAnim = true, - unitname = "eheavyturret2", - workerTime = 0, - yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo", +tech = [[tech2]] +armortype = [[building]] +--supply = [[5]] - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +VFS.Include("units-configs-basedefs/basedefs/buildings/eheavyturret2_basedef.lua") - explosiongenerators = { - "custom:gdhcannon", - "custom:needspower", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "eheavyturretweapon2", - badTargetCategory = "LIGHT VTOL", - onlyTargetCategory = "ARMORED LIGHT", - }, - }, - customParams = { - needed_cover = 5, - supply_cost = 2, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 8, - BuildingGroundDecalSizeY = 8, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 300 - -local weaponDefs = { - eheavyturretweapon2 = { - badTargetCategory = [[BUILDING LIGHT]], - AreaOfEffect = 50, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.6, --- cegTag = "mediumcannonweapon3", - duration = 0.4, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium", - fallOffRate = 1, - fireStarter = 100, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 1000, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "1 0.5 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "heavyturretshot.wav", - soundHit = "explode5.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 750, - customparams = { - damagetype = "eheavyturret2", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/ejammer2.lua b/Units/ebuilding/ejammer2.lua index 9bef5d3a3..525b8433d 100644 --- a/Units/ebuilding/ejammer2.lua +++ b/Units/ebuilding/ejammer2.lua @@ -1,82 +1,102 @@ -- UNITDEF -- EJAMMER2 -- -------------------------------------------------------------------------------- -local unitName = "ejammer2" +local unitName = "ejammer2" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 16384, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Radar Jamming Tower - - Drains -5 Energy while emitting cloaking field]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_BUILDING", - footprintX = 4, - footprintZ = 4, - iconType = "radarjam", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 280, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Radar Jamming/Cloaking Tower", - objectName = "ejammer2.s3o", - onoffable = true, - radarDistanceJam = 500, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - sonarDistance = 0, - unitname = "ejammer2", - workerTime = 0, - yardMap = "oooo oooo oooo oooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", +local armortype = [[building]] + +local techrequired = [[tech2]] + +local buildCostMetal = 20 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 16384, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + category = "BUILDING NOTAIR", + description = [[Radar Jamming Tower • Generates a Cloaking Field]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallBuildingExplosionGenericPurple", + footprintX = 2, + footprintZ = 2, + iconType = "radarjam", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Radar Jamming/Cloaking Tower", + objectName = "ejammer3.s3o", + script = "ejammer3.cob", + onoffable = true, + radarDistanceJam = 500, + repairable = false, + selfDestructAs = "smallBuildingExplosionGenericPurple", + side = "CORE", + sightDistance = 500, + smoothAnim = true, + sonarDistance = 0, + unitname = "ejammer2", + workerTime = 0, + yardMap = "oooo oooo oooo oooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + explosiongenerators = { + "custom:blacksmoke", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdradar", + }, + }, + customParams = { + RequireTech = techrequired, + unittype = "building", + cannotcloak = true, + needed_cover = 3, + death_sounds = "generic", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + corpse = "energycore", + factionname = "ateran", + + area_cloak = 1, -- Can this unit emit a cloaking field? + area_cloak_upkeep = 5, -- How much energy does it cost to maintain the cloaking field? + area_cloak_radius = 500, -- How large is the cloaking field? + --area_cloak_grow_rate = 200, -- When the cloaking field is turned on, how fast does the field expand to it's full size? + --area_cloak_shrink_rate = 200, -- When the cloaking field is turned off, how fast does the field shrink to nothingness? + area_cloak_decloak_distance = 150, -- How close does something have to be in order to decloak a unit within a cloaking shield? + area_cloak_init = true, -- Start up the cloak shield the moment the unit is built? + area_cloak_draw = true, -- No idea what this does + area_cloak_self = false, -- Does the cloak shield cloak the unit emitting it? }, - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdradar", - }, - }, - customParams = { - cannotcloak = true, - needed_cover = 3, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/ejammer2normal.png", - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 6, - BuildingGroundDecalSizeY = 6, - BuildingGroundDecalDecaySpeed = 0.9, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 6, + BuildingGroundDecalSizeY = 6, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/ekmar.lua b/Units/ebuilding/ekmar.lua index 8b3d4ee0d..5b756a7ad 100644 --- a/Units/ebuilding/ekmar.lua +++ b/Units/ebuilding/ekmar.lua @@ -1,129 +1,138 @@ -- UNITDEF -- EKMAR -- -------------------------------------------------------------------------------- -local unitName = "ekmar" +local unitName = "ekmar" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 4096, - buildCostEnergy = 0, - buildCostMetal = 60, - builder = false, - buildTime = 1, - canAttack = false, - canstop = "1", - category = "BUILDING NOTAIR WALL", - damageModifier = 0.2, - description = [[Protective Turret Shield - - Shield recharges at a rate of 25hp/s - Maximum shield power is 1000hp]], - energyStorage = 0, - energyUse = 0, - explodeAs = "ESTOR_BUILDING", - footprintX = 3, - footprintZ = 3, - floater = true, - iconType = "barricade", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 250, - maxSlope = 60, - maxWaterDepth = 999999, - mass = 1000, - metalStorage = 0, - name = "Kmar", - objectName = "ebarricade3.s3o", - script = "ebarricade3.cob", - repairable = false, - selfDestructAs = "ESTOR_BUILDING", - selfDestructCountdown = 0, - side = "ARM", - sightDistance = 0, - smoothAnim = true, - TEDClass = "FORT", - unitname = "ekmar", - workerTime = 0, - yardMap = "ooo ooo ooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", +local armortype = [[building]] + +local techrequired = [[tech2]] + +local shield1Power = 2500 +local shield1PowerRegen = 25 +local shield1PowerRegenEnergy = 25 +local buildCostMetal = 50 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 4096, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 1, + canAttack = false, + canstop = "1", + category = "BUILDING NOTAIR WALL", + damageModifier = 0.2, + description = [[Protective Shield • Shield can link with other shield units to increase charging and capacity]], + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumBuildingExplosionGenericBlue", + footprintX = 2, + footprintZ = 2, + floater = true, + iconType = "baseshield", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 999999, + mass = 1000, + metalStorage = 0, + name = "Kmar", + objectName = "ebarricade3.s3o", + script = "ebarricade3.cob", + repairable = false, + selfDestructAs = "mediumBuildingExplosionGenericBlue", + selfDestructCountdown = 0, + side = "ARM", + sightDistance = 0, + smoothAnim = true, + TEDClass = "FORT", + unitname = "ekmar", + workerTime = 0, + yardMap = "ooo ooo ooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, }, - - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - - weapons = { - [1] = { - def = "shield", - }, - }, - - customParams = { - needed_cover = 1, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 5, - BuildingGroundDecalSizeY = 5, - BuildingGroundDecalDecaySpeed = 0.9, + + weapons = { + [1] = { + def = "shield", + }, + }, + + customParams = { + RequireTech = techrequired, + unittype = "shield", + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, + shield_power = shield1Power, + shield_radius = 1000, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 5, + BuildingGroundDecalSizeY = 5, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -local shield1PowerRegen = 15 - -local weaponDefs = { - shield = { - IsShield = true, - Smartshield = true, - Exteriorshield = true, - Visibleshield = true, - Visibleshieldrepulse = true, - ShieldStartingPower = 0, - Shieldenergyuse = 0, - Shieldradius = 200, - Shieldpower = 1000, - Shieldpowerregen = shield1PowerRegen, - Shieldpowerregenenergy = shield1PowerRegen / 20, - Shieldintercepttype = 4, - Shieldgoodcolor = "0.0 0.2 1.0", - Shieldbadcolor = "1.0 0 0", - Shieldalpha = 0.3, - ShieldRepulsor = false, - texture1 = "shield4", - visibleShieldHit = true, - visibleShieldHitFrames = 50, - weaponType = [[Shield]], - damage = { - default = 1, - }, - }, + +local weaponDefs = { + shield = { + + Smartshield = true, + Exteriorshield = true, + Visibleshield = false, + Visibleshieldrepulse = false, + ShieldStartingPower = 0, + Shieldenergyuse = 0, + Shieldradius = 750, + Shieldpower = shield1Power, + Shieldpowerregen = shield1PowerRegen, + Shieldpowerregenenergy = shield1PowerRegenEnergy, + Shieldintercepttype = 4, + Shieldgoodcolor = "0.0 0.2 1.0", + Shieldbadcolor = "1.0 0 0", + Shieldalpha = 0.2, + + texture1 = "shield4", + + visibleShieldHitFrames = 1, + weaponType = [[Shield]], + damage = { + default = 1, + }, + }, } -unitDef.weaponDefs = weaponDefs +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/elaserbattery.lua b/Units/ebuilding/elaserbattery.lua new file mode 100644 index 000000000..5fe5b00f2 --- /dev/null +++ b/Units/ebuilding/elaserbattery.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ELASERBATTERY -- +-------------------------------------------------------------------------------- + +unitName = [[elaserbattery]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Aegis]] + +objectName = [[elaserbattery.s3o]] +script = [[elaserbattery.cob]] + +tech = [[tech1]] +armortype = [[building]] +--supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/buildings/elaserbattery_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/elightturret2.lua b/Units/ebuilding/elightturret2.lua index 904fa1257..8482c0007 100644 --- a/Units/ebuilding/elightturret2.lua +++ b/Units/ebuilding/elightturret2.lua @@ -1,144 +1,26 @@ -- UNITDEF -- ELIGHTTURRET2 -- -------------------------------------------------------------------------------- -local unitName = "elightturret2" +unitName = [[elightturret2]] -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 5, - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - collisionVolumeTest = "1", - corpse = "ammobox", - description = [[Anti-Raid Defense Platform (Anti-Light) -Building -125 Damage vs Light -31.25 Damage vs Armored -12.5 Damage vs Buildings +humanName = [[Pincushion]] -Uses +1 Supply]], - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_BUILDING", - footprintX = 4, - footprintZ = 4, - floater = true, - idleAutoHeal = .5, - idleTime = 2200, - iconType = "defense", - maxDamage = 750, - maxSlope = 60, - maxWaterDepth = 999999, - metalStorage = 0, - name = "Lightning Rod", - objectName = "elightturret3.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, --- script = "elightturret2-script.lua", - selfDestructAs = "MEDIUM_BUILDING", - side = "CORE", - sightDistance = 600, - smoothAnim = true, - unitname = "elightturret2", - workerTime = 0, - yardMap = "oooo oooo oooo oooo", +objectName = [[elightturret3.s3o]] +script = [[elightturret2.cob]] - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +tech = [[tech0]] +armortype = [[building]] +--supply = [[3]] - explosiongenerators = { - "custom:electricity", - "custom:needspower", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "lighteweapon", - badTargetCategory = "VTOL ARMORED", - onlyTargetCategory = "LIGHT VTOL ARMORED", - }, - }, - customParams = { - needed_cover = 2, - supply_cost = 1, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 6, - BuildingGroundDecalSizeY = 6, - BuildingGroundDecalDecaySpeed = 0.9, -} +VFS.Include("units-configs-basedefs/basedefs/buildings/elightturret2_basedef.lua") - --------------------------------------------------------------------------------- -local weapon1Damage = 125 - -local weaponDefs = { - lighteweapon = { - AreaOfEffect = 25, - avoidFriendly = false, - collideFriendly = false, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:genericshellexplosion-medium-lightning", - energypershot = weapon1Damage / 20, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - noSelfDamage = true, - range = 600, - reloadtime = 1, - WeaponType = "LightningCannon", - rgbColor = "0.1 0.2 0.5", - rgbColor2 = "0 0 1", - soundStart = "jacobs.wav", - startsmoke = "1", - texture1 = "lightning", - thickness = 10, - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "elightturret2", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/elrpc.lua b/Units/ebuilding/elrpc.lua deleted file mode 100644 index 76a1885d3..000000000 --- a/Units/ebuilding/elrpc.lua +++ /dev/null @@ -1,150 +0,0 @@ --- UNITDEF -- ELRPC -- --------------------------------------------------------------------------------- - -local unitName = "elrpc" - --------------------------------------------------------------------------------- - -local unitDef = { - - activateWhenBuilt = true, - buildCostEnergy = 0, - buildCostMetal = 750, - builder = false, - buildTime = 5, - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - - collisionVolumeOffsets = "0 0 0", - collisionVolumeScales = "120 310 120", - collisionVolumeTest = 1, - collisionVolumeType = "box", - - corpse = "ammobox", - description = [[Long Range Plasma Cannon - 100e Per Shot -Building -2000 Damage vs Buildings -500 Damage vs Light/Armored]], - energyStorage = 0, - energyUse = 0, - explodeAs = "LARGE_BUILDING", - footprintX = 8, - footprintZ = 8, - iconType = "elrpc", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 4800, - maxSlope = 30, - maxWaterDepth = 0, - metalStorage = 0, - name = "Executioner", - noChaseCategory = "VTOL", - objectName = "elrpc.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - side = "ARM", - sightDistance = 900, - smoothAnim = true, - unitname = "elrpc", - workerTime = 0, - yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:electricity", - "custom:factorysparks", - "custom:needspower", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "lrpcweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "LIGHT ARMORED WALL", - }, - }, - customParams = { - canareaattack="1", - death_sounds = "generic", - RequireTech = "0 Power", - armortype = "building", - normalstex = "unittextures/elrpcnormal.png", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 2000 - -local weaponDefs = { - lrpcweapon = { - accuracy = 500, - AreaOfEffect = 500, - avoidFriendly = false, - cegTag = "BURNGREEN", - collideFriendly = false, - explosionGenerator = "custom:genericshellexplosion-large-green", - fireStarter = 70, - guidance = false, - id = 136, - impulsefactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - energypershot = weapon1Damage / 20, - edgeEffectiveness = 0.1, - model = "rocket.s3o", - name = "Rockets", - range = 6000, - reloadtime = 35, - weaponType = "Cannon", - selfprop = true, - smokedelay = ".1", - smokeTrail = false, - soundHit = "lrpchit.wav", - soundStart = "lrpcshot2.wav", - startsmoke = "0", - tolerance = 8000, - turnRate = 4680, - turret = true, - weaponTimer = 5, - weaponVelocity = 800, - customparams = { - damagetype = "elrpc", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/emaker.lua b/Units/ebuilding/emaker.lua deleted file mode 100644 index 39f1a5870..000000000 --- a/Units/ebuilding/emaker.lua +++ /dev/null @@ -1,94 +0,0 @@ --- UNITDEF -- EMAKER -- --------------------------------------------------------------------------------- - -local unitName = "emaker" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 8192, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR", - corpse = "ammobox", - damageModifier = 0.5, - description = [[Converts Energy into Metal - --5 Energy per Second -+0.5 Metal per Second]], - energyStorage = 0, - energyUse = 5, - explodeAs = "LARGE_BUILDING", - footprintX = 8, - footprintZ = 8, - iconType = "eco", - idleAutoHeal = .5, - idleTime = 2200, - makesMetal = 0.5, - maxDamage = 500, - maxSlope = 30, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Metal Maker", - objectName = "emaker3.s3o", - script = "emaker3.cob", - onoffable = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - side = "ARM", - sightDistance = 360, - smoothAnim = true, - unitname = "emaker", - workerTime = 0, - yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionmakernew", - "custom:skyhatelaser", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdmex", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 8, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[Metal Maker - -Creates metal from stored energy. Drains -5 energy per +0.5 metal generated]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 12, - BuildingGroundDecalSizeY = 12, - BuildingGroundDecalDecaySpeed = 0.9, -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/emediumgen.lua b/Units/ebuilding/emediumgen.lua new file mode 100644 index 000000000..2ce9ab364 --- /dev/null +++ b/Units/ebuilding/emediumgen.lua @@ -0,0 +1,110 @@ +-- UNITDEF -- EMEDIUMGEN -- +-------------------------------------------------------------------------------- + +local unitName = "emediumgen" + +-------------------------------------------------------------------------------- + +local armortype = [[building]] +local energyproduced = [[5]] +local powerprovided = [[5 power]] +local powerradius = [[500]] +--local supplygranted = [[25]] + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = 90, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + damageModifier = 0.33333, + description = [[Armortype: ]] ..armortype.. [[ + +Produces +]] .. energyproduced .. [[ Energy + +Provides +]] .. powerprovided, + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "largeBuildingExplosionGenericBlueEMP", + footprintX = 3, + footprintZ = 3, + icontype = "generator", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = 1400, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Medium Generator", + objectName = "emediumgen.s3o", + script = "emediumgen.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "largeBuildingExplosionGenericBlueEMP", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = "emediumgen", + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo ", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionnuclear", + "custom:skyhatelaser", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 4, + death_sounds = "generic", + ProvideTech = powerprovided, +-- ProvideTechRange = powerradius, + -- RequireTech = "1 Powergrid", + armortype = armortype, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 500, -- optional +-- groundtexselectzsize = 500, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 8, + BuildingGroundDecalSizeY = 8, + BuildingGroundDecalDecaySpeed = 0.9, +} +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ebuilding/emetalextractor.lua b/Units/ebuilding/emetalextractor.lua index 2fb281354..9d8e6221d 100644 --- a/Units/ebuilding/emetalextractor.lua +++ b/Units/ebuilding/emetalextractor.lua @@ -1,94 +1,32 @@ -- UNITDEF -- EMETALEXTRACTOR -- -------------------------------------------------------------------------------- -local unitName = "emetalextractor" +unitName = [[emetalextractor]] -------------------------------------------------------------------------------- -local unitDef = { +ateranMexCost = Spring.GetModOptions().metalextractorcostateran or 50 - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = "Extracts Metal", - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_BUILDING", - extractsMetal = 0.0000001, - makesMetal = 0, - footprintX = 7, - footprintZ = 7, - iconType = "eco", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 500, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - metalMake = 0, - name = "Metal Extractor", - objectName = "emetalextractor2.s3o", - onoffable = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - selfDestructCountdown = 1, - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "emetalextractor", - workerTime = 0, - yardMap = "ooooooo ooooooo ooooooo ooooooo ooooooo ooooooo ooooooo", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +metalMultiplier = 1 - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionmex", - "custom:skyhatelaser", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdmex", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 3, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[Metal Extractor +buildCostMetal = ateranMexCost +energyUse = 0 -Extracts metal from exposed resource points on the map. Provides +1 metal income +primaryCEG = "custom:fusionreactionnuclear-1color" -+1 Metal]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 9, - BuildingGroundDecalSizeY = 9, - BuildingGroundDecalDecaySpeed = 0.9, -} +humanName = [[Metal Extractor]] +objectName = [[emetalextractor2_small.s3o]] +script = [[emetalextractor.cob]] --------------------------------------------------------------------------------- +tech = [[tech0]] +armortype = [[building]] -return lowerkeys({ [unitName] = unitDef }) +VFS.Include("units-configs-basedefs/basedefs/buildings/emetalextractor_basedef.lua") +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/emetalextractor_up1.lua b/Units/ebuilding/emetalextractor_up1.lua new file mode 100644 index 000000000..0bf8c1b86 --- /dev/null +++ b/Units/ebuilding/emetalextractor_up1.lua @@ -0,0 +1,30 @@ +-- UNITDEF -- EMETALEXTRACTOR_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[emetalextractor_up1]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 2 + +buildCostMetal = 150 +energyUse = 2 + +primaryCEG = "custom:fusionreactionnuclear-2color" + +humanName = [[Metal Extractor Mk II]] + +objectName = [[emetalextractor2_up1.s3o]] +script = [[emetalextractor.cob]] + +tech = [[tech1]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/buildings/emetalextractor_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/emetalextractor_up2.lua b/Units/ebuilding/emetalextractor_up2.lua new file mode 100644 index 000000000..80fb77189 --- /dev/null +++ b/Units/ebuilding/emetalextractor_up2.lua @@ -0,0 +1,30 @@ +-- UNITDEF -- EMETALEXTRACTOR_up2 -- +-------------------------------------------------------------------------------- + +unitName = [[emetalextractor_up2]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 4 + +buildCostMetal = 300 +energyUse = 25 + +primaryCEG = "custom:fusionreactionnuclear-3color" + +humanName = [[Metal Extractor Mk III]] + +objectName = [[emetalextractor2_up2.s3o]] +script = [[emetalextractor.cob]] + +tech = [[tech2]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/buildings/emetalextractor_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/emetalextractor_up3.lua b/Units/ebuilding/emetalextractor_up3.lua new file mode 100644 index 000000000..1e5ae3181 --- /dev/null +++ b/Units/ebuilding/emetalextractor_up3.lua @@ -0,0 +1,30 @@ +-- UNITDEF -- EMETALEXTRACTOR_up3 -- +-------------------------------------------------------------------------------- + +unitName = [[emetalextractor_up3]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 8 + +buildCostMetal = 600 +energyUse = 50 + +primaryCEG = "custom:fusionreactionnuclear-4color" + +humanName = [[Metal Extractor Mk IV]] + +objectName = [[emetalextractor2_up3.s3o]] +script = [[emetalextractor.cob]] + +tech = [[tech3]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/buildings/emetalextractor_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/emine.lua b/Units/ebuilding/emine.lua index d4b7df14b..120e22ed7 100644 --- a/Units/ebuilding/emine.lua +++ b/Units/ebuilding/emine.lua @@ -1,137 +1,172 @@ -- UNITDEF -- EMINE -- -------------------------------------------------------------------------------- -local unitName = "emine" +local unitName = "emine" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - blocking = false, - buildAngle = 1024, - buildCostEnergy = 0, - buildCostMetal = 15, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR", - --- Cloaking - - cancloak = true, - cloakCost = 0, - cloakCostMoving = 0, - minCloakDistance = 200, - decloakOnFire = false, - decloakSpherical = true, - initCloaked = true, +local armortype = [[building]] +--local supply = [[1]] + +local weapon1Damage = 1000 +local weapon1AOE = 25 + +local function roundToFirstDecimal(energycosttofire) + return math.floor(energycosttofire*10 + 0.5)*0.1 +end + +local unitDef = { + activateWhenBuilt = true, + blocking = false, + buildAngle = 1024, + buildCostEnergy = 0, + buildCostMetal = 5, + builder = false, + buildTime = 5, + category = "LIGHT NOTAIR", + + -- Cloaking + + cancloak = true, + cloakCost = 0, + cloakCostMoving = 0, + minCloakDistance = 0, + decloakOnFire = true, + decloakSpherical = true, + initCloaked = true, --- End Cloaking - - description = [[Explodes on contact dealing 650 damage to anything caught within it's large blast envelope. Very difficult to detect! - - Costs +1 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "emineboom", - footprintX = 1, - footprintZ = 1, - iconType = "mine", - idleAutoHeal = .5, - idleTime = 2200, - kamikaze = true, - kamikazeDistance = 100, - levelground = false, - maxDamage = 200, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Land Mine", - objectName = "emine.s3o", - script = "emine.cob", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "emineboom", - selfDestructCountdown = 0, - side = "CORE", - sightDistance = 50, - smoothAnim = true, - sonarDistance = 0, - seismicDistance = 0, - stealth = true, - unitname = "emine", - workerTime = 0, - yardMap = "o o o o", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", + -- End Cloaking + + description = [[Air/Land Mine]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "smallBuildingExplosionGenericWhite", + footprintX = 2, + footprintZ = 2, + iconType = "mine", + idleAutoHeal = .5, + idleTime = 2200, + levelground = false, + maxDamage = 100, + maxSlope = 60, + maxWaterDepth = 0, + metalStorage = 0, + name = "Land Mine", + objectName = "emine.s3o", + script = "emine.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "smallBuildingExplosionGenericWhite", + selfDestructCountdown = 0, + side = "CORE", + sightDistance = 400, + smoothAnim = true, + sonarDistance = 0, + seismicDistance = 0, + stealth = false, + unitname = "emine", + workerTime = 0, + yardMap = "oo oo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + }, }, - - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - - customParams = { - needed_cover = 1, - supply_cost = 1, - death_sounds = "generic", - armortype = "armored", - nofriendlyfire = "1", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 1, - BuildingGroundDecalSizeY = 1, - BuildingGroundDecalDecaySpeed = 0.9, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + + weapons = { + [1] = { + def = "emineboom", + onlyTargetCategory = "BIO LIGHT ARMORED", + badTargetCategory = "DRONE VTOL", + }, + }, + + customParams = { + unittype = "landmine", + decloakradiusmodifier = 10, + needed_cover = 1, + death_sounds = "generic", + nofriendlyfire = "1", + armortype = armortype, + --supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, + useGroundDecal = false, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 3, + BuildingGroundDecalSizeY = 3, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -local weaponDefs = { - emineboom = { - name="Land Mine", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - edgeeffectiveness = 1, - range=100, - reloadtime=3.6, - weaponvelocity=1000, - AreaOfEffect=350, - soundhit="minedetonation.wav", - soundstart="minedetonation.wav", - explosiongenerator="custom:genericshellexplosion-large-white", - customparams = { - damagetype = "emine", - nofriendlyfire = "true", - }, - - damage = { - default = 650, - }, - }, +local weaponDefs = { + emineboom = { + name ="Land Mine", + AreaOfEffect = weapon1AOE, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + canAttackGround = false, + cegTag = "missiletrail", + flightTime = 2.5, + + tolerance = 1000, + turret = true, + impulseFactor = 0, + + model = "missilesmallvlaunch.s3o", + edgeeffectiveness = 1, + energypershot = 0, + range =400, + reloadtime =8, + weaponvelocity =2500, + + + smokeTrail = false, + tracks = true, + turnrate = 200000, + + weaponAcceleration = 800, + weaponTimer = 0.5, + weaponType = "StarburstLauncher", + weaponVelocity = 2500, + soundHit ="explosions/minedetonation.wav", + soundStart = "weapons/minewhir.wav", + explosiongenerator ="custom:genericshellexplosion-small-white", + customparams = { + damagetype = "light", + nofriendlyfire = "true", + effectedByunitHealthModifier = true, + }, + + damage = { + default = weapon1Damage, + }, + }, } -unitDef.weaponDefs = weaponDefs +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/eradar2.lua b/Units/ebuilding/eradar2.lua index cb84dce32..1ee47c0ba 100644 --- a/Units/ebuilding/eradar2.lua +++ b/Units/ebuilding/eradar2.lua @@ -1,87 +1,28 @@ --- UNITDEF -- ERADAR2 -- +-- UNITDEF -- eradar2 -- -------------------------------------------------------------------------------- -local unitName = "eradar2" +unitName = [[eradar2]] --------------------------------------------------------------------------------- +buildCostMetal = 5 -local unitDef = { - activateWhenBuilt = true, - buildAngle = 16384, - buildCostEnergy = 0, - buildCostMetal = 15, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = "Radar Dome", - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_BUILDING", - footprintX = 6, - footprintZ = 6, - floater = true, - iconType = "radar", - idleAutoHeal = .5, - idleTime = 2200, - isTargetingUpgrade = false, - maxDamage = 750, - maxSlope = 75, - maxWaterDepth = 999999, - metalStorage = 0, - name = "Radar Dome", - objectName = "eradar3.s3o", - script = "eradar3.cob", - onoffable = true, - radarDistance = 2500, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - sonarDistance = 2500, - seismicDistance = 1000, - unitname = "eradar2", - workerTime = 0, - yardMap = "oooo oooo oooo oooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdradar", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 8, - BuildingGroundDecalSizeY = 8, - BuildingGroundDecalDecaySpeed = 0.9, -} +humanName = [[Radar Tower]] +objectName = [[eradar3_small.s3o]] +radarDistance = 1000 +radarEmitHeight = 64 --------------------------------------------------------------------------------- +sightDistance = 750 +sonarDistance = 750 +seismicDistance = 750 + +tech = [[tech0]] +armortype = [[building]] -return lowerkeys({ [unitName] = unitDef }) + +VFS.Include("units-configs-basedefs/basedefs/buildings/eradar2_basedef.lua") -------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/eradar2_up1.lua b/Units/ebuilding/eradar2_up1.lua new file mode 100644 index 000000000..52d2660a1 --- /dev/null +++ b/Units/ebuilding/eradar2_up1.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- eradar2_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[eradar2_up1]] + +buildCostMetal = 40 + +humanName = [[Radar Tower]] +objectName = [[eradar3_large.s3o]] + +radarDistance = 3000 +radarEmitHeight = 128 + +sightDistance = 1500 +sonarDistance = 1500 +seismicDistance = 1500 + +tech = [[tech2]] +armortype = [[building]] + + +VFS.Include("units-configs-basedefs/basedefs/buildings/eradar2_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ebuilding/eshieldgen.lua b/Units/ebuilding/eshieldgen.lua index fb89d81d6..5014ec1bd 100644 --- a/Units/ebuilding/eshieldgen.lua +++ b/Units/ebuilding/eshieldgen.lua @@ -1,178 +1,162 @@ -- UNITDEF -- ESHIELDGEN -- -------------------------------------------------------------------------------- -local unitName = "eshieldgen" +local unitName = "eshieldgen" -------------------------------------------------------------------------------- -local unitDef = { - buildAngle = 8192, - buildCostEnergy = 0, - buildCostMetal = 250, - builder = false, - buildTime = 5, - canAttack = false, - canstop = "1", - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Anti-Nuke Platform -Anti-Artillery base shield Facility - -Drains -50 Energy while stockpiling Anti-Nuke Ammunition -Drains -2.5 Energy while charging shield - -Shield recharges at a rate of 50hp/s -Maximum shield power is 5000hp]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_BUILDING", - footprintX = 5, - footprintZ = 5, - iconType = "defense", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 4000, - maxSlope = 30, - maxWaterDepth = 0, - metalStorage = 0, - name = "Protector", - objectName = "eshieldgen.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "MEDIUM_BUILDING", - side = "ARM", - sightDistance = 600, - smoothAnim = true, - unitlimit = "2", - unitname = "eshieldgen", - workerTime = 0, - yardMap = "ooooo ooooo ooooo ooooo ooooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", +local armortype = [[building]] +--local supply = [[20]] +--local techprovided = [[-baseshield]] +local techrequired = [[tech2]] + +local weapon1Damage = 3001 +local weapon1AOE = 1 +--local stockpiletime = 60 + +local buildCostMetal = 450 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + buildAngle = 8192, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + canAttack = false, + canstop = "1", + category = "BUILDING NOTAIR", + description = [[Anti-Nuke Defense Facility]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "hugeBuildingExplosionGenericGreen", + footprintX = 5, + footprintZ = 5, + iconType = "nukeshield", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 30, + maxWaterDepth = 0, + metalStorage = 0, + name = "Tuning Fork", + objectName = "eantinuke.s3o", + script = "eshieldgen2.cob", + onlytargetcategory2 = "NOTAIR", + onlytargetcategory3 = "NOTAIR", + onlytargetcategory4 = "NOTAIR", + onlytargetcategory5 = "NOTAIR", + onlytargetcategory6 = "NOTAIR", + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericGreen", + side = "ARM", + sightDistance = 600, + smoothAnim = true, + unitlimit = "2", + unitname = unitName, + workerTime = 0, + yardMap = "ooooo ooooo ooooo ooooo ooooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, }, - - explosiongenerators = { - "custom:blacksmoke", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "nukeinterceptor", - }, - [2] = { - def = "shield", - }, - }, - customParams = { - needed_cover = 5, - death_sounds = "generic", - ProvideTechRange = "300", - armortype = "building", - normalstex = "unittextures/eshieldgennormal.png", - helptext = [[Anti-Nuke Platform / Anti-Artillery base shield Facility]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 7, - BuildingGroundDecalSizeY = 7, - BuildingGroundDecalDecaySpeed = 0.9, + weapons = { + [1] = { + def = "nukeinterceptor", + }, + }, + customParams = { + --ProvideTech = techprovided, + RequireTech = techrequired, + unittype = "building", + --supply_cost = supply, + needed_cover = 5, + death_sounds = "generic", + --ProvideTechRange = "300", + armortype = armortype, + normaltex = "unittextures/lego2skin_explorernormal.dds", + corpse = "energycore", + factionname = "ateran", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 7, + BuildingGroundDecalSizeY = 7, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -local weapon1Damage = 100000 -local shield1PowerRegen = 50 - -local weaponDefs = { - nukeinterceptor = { - AreaOfEffect = 8, - avoidFeature = false, - avoidFriendly = false, - beamTime = 5, - collideFeature = false, - collideFriendly = false, - coverage = 2500, - rgbColor = "0 0 0.5", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.5, - duration = 0.4, - explosionGenerator = "custom:genericshellexplosion-large-blue", - energypershot = weapon1Damage / 20, - fallOffRate = 0.1, - fireStarter = 50, - interceptor = 1, - interceptSolo = false, - largeBeamLaser = true, - laserflaresize = 5, - lineOfSight = true, - minintensity = 1, - name = "Laser", - range = 2500, - reloadtime = 5, - WeaponType = "BeamLaser", - soundStart = "antinukelaser.wav", - soundTrigger = true, - stockpile = true, - stockpiletime = 100, - texture1 = "lightning", - texture2 = "laserend", - thickness = 20, - tolerance = 500, - turret = true, - weaponVelocity = 1500, - waterweapon = true, - damage = { - default = weapon1Damage, - }, - }, - - shield = { - IsShield = true, - Smartshield = true, - Exteriorshield = true, - Visibleshield = true, - Visibleshieldrepulse = true, - ShieldStartingPower = 0, - Shieldenergyuse = 0, - Shieldradius = 1500, - Shieldpower = 5000, - Shieldpowerregen = shield1PowerRegen, - Shieldpowerregenenergy = shield1PowerRegen / 20, - Shieldintercepttype = 4, - Shieldgoodcolor = "0.0 0.2 1.0", - Shieldbadcolor = "1.0 0 0", - Shieldalpha = 0.3, - ShieldRepulsor = false, - texture1 = "shield4", - visibleShieldHit = true, - visibleShieldHitFrames = 50, - weaponType = [[Shield]], - damage = { - default = 1, - }, - }, + + +local weaponDefs = { + nukeinterceptor = { + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + beamTime = 5, + collideFeature = false, + collideFriendly = false, + coverage = 2000, + rgbColor = "0.5 0.5 0", + rgbColor2 = "0.5 0.5 0.5", + coreThickness = 0.5, + duration = 0.4, + explosionGenerator = "custom:genericshellexplosion-large-blue", + energypershot = 0, + fallOffRate = 0.1, + fireStarter = 50, + interceptor = 1, + interceptSolo = false, + largeBeamLaser = true, + laserflaresize = 5, + + minintensity = 1, + name = "Laser", + range = 2000, + reloadtime = 170, + WeaponType = "BeamLaser", + soundStart = "weapons/antinukelaser.wav", + soundTrigger = true, + --stockpile = true, + --stockpiletime = stockpiletime, + texture1 = "lightning", + texture2 = "laserend", + thickness = 20, + tolerance = 500, + turret = true, + weaponVelocity = 1500, + waterweapon = true, + customparams = { + nofriendlyfire = 1, + nocosttofire = true, + }, + damage = { + default = weapon1Damage, + }, + }, } -unitDef.weaponDefs = weaponDefs +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/esilo.lua b/Units/ebuilding/esilo.lua index 3aecb6589..e8a48b31b 100644 --- a/Units/ebuilding/esilo.lua +++ b/Units/ebuilding/esilo.lua @@ -1,162 +1,178 @@ -- UNITDEF -- ESILO -- -------------------------------------------------------------------------------- -local unitName = "esilo" +local unitName = "esilo" -------------------------------------------------------------------------------- -local unitDef = { - - buildAngle = 8192, - buildCostEnergy = 0, - buildCostMetal = 1000, - builder = false, - buildTime = 5, - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Nuclear Missile Silo - Missile takes 4 minutes to build - Drains 50e while building]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "nukemissile", - footprintX = 8, - footprintZ = 8, - iconType = "esilo", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 20000, - maxSlope = 30, - maxWaterDepth = 0, - metalStorage = 0, - name = "Eradicator", - objectName = "ESILO.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "nukemissile", - side = "ARM", - sightDistance = 600, - smoothAnim = true, - unitlimit = "2", - unitname = "esilo", - workerTime = 0, - yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", - - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:needspower", - "custom:blacksmoke", - }, - }, - - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "nukemissile", - onlyTargetCategory = "NOTAIR", - }, - }, - customParams = { - needed_cover = 8, - RequireTech = "0 Power", - death_sounds = "nuke", - armortype = "building", - normalstex = "unittextures/esilonormal.png", - helptext = [[Nuclear Missile Silo - -Will completely devastate a large area - -+50000 Damage - -+2000 Area of Effect - --50 Energy (While missile is building) - -10s Reload Time]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, +local armortype = [[building]] +--local supply = [[50]] +--local techprovided = [[-nukesilo]] +local techrequired = [[tech3]] + +local weapon1Damage = 3000 +local weapon1AOE = 1500 +local energycosttofire = weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) +--local stockpiletime = 60 + +local function roundToFirstDecimal(energycosttofire) + return math.floor(energycosttofire*10 + 0.5)*0.1 +end + +local buildCostMetal = 1750 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + + buildAngle = 8192, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + canAttack = true, + canstop = "1", + category = "BUILDING NOTAIR", + description = [[ ]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "nukemissile", + floater = true, + fireState = 0, + footprintX = 16, + footprintZ = 16, + iconType = "esilo", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 30, + maxWaterDepth = 5000, + metalStorage = 0, + name = [[Eradicator: Nuclear Strike Facility]], + objectName = "esilo2.s3o", + radarDistance = 0, + repairable = false, + script = "esilo2.cob", + selfDestructAs = "nukemissile", + side = "ARM", + sightDistance = 600, + smoothAnim = true, + unitlimit = "2", + unitname = "esilo", + workerTime = 0, + yardMap = "oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo oooooooooooooooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:needspower", + "custom:blacksmoke", + "custom:steam", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/turretselect", + }, + }, + weapons = { + [1] = { + def = "nukemissile", + badTargetCategory = "LIGHT ARMORED", + }, + }, + customParams = { + --ProvideTech = techprovided, + RequireTech = techrequired, + unittype = "turret", + needed_cover = 8, + --supply_cost = supply, + death_sounds = "nuke", + armortype = "building", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + corpse = "energycore", + factionname = "ateran", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 18, + BuildingGroundDecalSizeY = 18, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -local weapon1Damage = 240000 - -local weaponDefs = { - nukemissile = { - AreaOfEffect = 2000, - avoidFriendly = false, - cegTag = "NUKETRAIL", - collideFriendly = false, - commandfire = true, - craterBoost = 0, - craterMult = 0, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:NUKEDATBEWM", - fireStarter = 100, - flightTime = 400, - guidance = true, - id = 124, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 2, - lineOfSight = true, - metalpershot = 0, - model = "enuke.s3o", - name = "Nuke", - range = 32000, - reloadtime = 15, - weaponType = "MissileLauncher", - selfprop = true, - smokedelay = "0.1", - smokeTrail = false, - soundHit = "explosion_enormous.wav", - soundStart = "nukelaunch.wav", - startsmoke = "0", - stockpile = true, - stockpileTime = 240, - startVelocity = 500, - tracks = true, - turnRate = 30000, - targetable = 1, - vlaunch = true, - weaponAcceleration = 0, - weaponTimer = 10, - weaponType = "StarburstLauncher", - weaponVelocity = 500, - customparams = { - damagetype = "default", - death_sounds = "nuke", - }, - damage = { - default = weapon1Damage, - }, - }, +-- Energy Per Shot Calculation is: dmg / 20 * ((aoe / 1000) + 1) + +local weaponDefs = { + nukemissile = { + AreaOfEffect = weapon1AOE, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandFire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 1, + energypershot = energycosttofire, + explosionGenerator = "custom:nukedatbewm", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + --interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 200, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 60, + weaponTimer = 5, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "antibuilding", + death_sounds = "nuke", + oldcosttofireforumula = true, + effectedByunitHealthModifier = true, + friendlyfireexception = true, + }, + damage = { + default = weapon1Damage, + }, + }, } -unitDef.weaponDefs = weaponDefs +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/esolar2.lua b/Units/ebuilding/esolar2.lua index 730b4bf3d..51cfe9ce3 100644 --- a/Units/ebuilding/esolar2.lua +++ b/Units/ebuilding/esolar2.lua @@ -1,109 +1,105 @@ -- UNITDEF -- ESOLAR2 -- -------------------------------------------------------------------------------- -local unitName = "esolar2" +local unitName = "esolar2" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - damageModifier = 0.33333, - description = [[Produces +1 Energy -Provides +1 Power -Provides +5 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = -1, - explodeAs = "POWERPLANTPOP", - footprintX = 4, - footprintZ = 4, - icontype = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 800, - maxSlope = 60, - maxWaterDepth = 5000, - metalStorage = 0, - name = "Basic Generator", - objectName = "epowerplant.s3o", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "POWERPLANTPOP", - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "esolar2", - yardMap = "oooo oooo oooo oooo", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionbasic", - "custom:skyhatelaser", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 2, - death_sounds = "generic", - ProvideTech = "1 Power", - ProvideTechRange = "400", --- RequireTech = "1 Powergrid", - armortype = "building", - supply_granted = 5, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - groundtexselectimg = ":nc:bitmaps/power/power.png", - groundtexselectimg1 = ":nc:bitmaps/power/power1.png", - groundtexselectimg2 = ":nc:bitmaps/power/power2.png", - groundtexselectimg3 = ":nc:bitmaps/power/power3.png", - groundtexselectimg4 = ":nc:bitmaps/power/power4.png", - groundtexselectimg5 = ":nc:bitmaps/power/power5.png", - groundtexselectimg6 = ":nc:bitmaps/power/power6.png", - groundtexselectxsize = 400, -- optional - groundtexselectzsize = 400, -- optional - helptext = [[Basic Powerplant +local armortype = [[building]] +local energyproduced = [[5]] -Produces energy and power in a radius +local buildCostMetal = 50 +local maxDamage = buildCostMetal * 12.5 -+1 Energy +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + description = [[Produces +]] .. energyproduced .. [[ Energy]], + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "mediumBuildingExplosionGenericBlueEMP", + footprintX = 2, + footprintZ = 2, + icontype = "generator", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Fission Energy Generator", + objectName = "epowerplant3x3.s3o", + script = "esolar2.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumBuildingExplosionGenericBlueEMP", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = "esolar2", + yardMap = "ooo ooo ooo", -+1 Power + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionnuclear-small-2color", + "custom:skyhatelaser", + }, + }, -+400 Power Radius]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 6, - BuildingGroundDecalSizeY = 6, - BuildingGroundDecalDecaySpeed = 0.9, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 2, + death_sounds = "generic", +-- ProvideTech = powerprovided, +-- ProvideTechRange = powerradius, + armortype = armortype, + noenergycost = true, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", + -- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 400, -- optional +-- groundtexselectzsize = 400, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 5, + BuildingGroundDecalSizeY = 5, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/estorage.lua b/Units/ebuilding/estorage.lua index ceb328df8..dce2a5938 100644 --- a/Units/ebuilding/estorage.lua +++ b/Units/ebuilding/estorage.lua @@ -1,98 +1,104 @@ -- UNITDEF -- ESTORAGE -- -------------------------------------------------------------------------------- -local unitName = "estorage" +local unitName = "estorage" -------------------------------------------------------------------------------- -local unitDef = { - activateWhenBuilt = true, - buildAngle = 8196, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - canAttack = false, - category = "BUILDING NOTAIR ECO", - - collisionVolumeScales = [[66 74 126]], - collisionVolumeOffsets = [[0 10 0]], - collisionVolumeTest = 1, - collisionVolumeType = "box", - - corpse = "ammobox", - description = "Resource Storage - Stores 50m/50e", - energyStorage = 50, - energyUse = 0, - explodeAs = "ESTOR_BUILDING", - footprintX = 4, - footprintZ = 8, - idleAutoHeal = .5, - idleTime = 2200, - icontype = "eco", - maxDamage = 1200, - maxSlope = 50, - maxWaterDepth = 5000, - metalStorage = 50, - name = "Storage", - objectName = "estorage2.s3o", - script = "estorage2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "ESTOR_BUILDING", - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "estorage", - workerTime = 0, - yardMap = "yyooooyy yyooooyy yyooooyy yyooooyy yyooooyy yyooooyy yyooooyy yyooooyy ", - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:blacksmoke", - "custom:fusionreactionstoragenew", - "custom:skyhatelaser", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - needed_cover = 2, - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[Storage Facility +local armortype = [[building]] +local storage = 50 +local supplygranted = 25 + +local buildCostMetal = 15 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 8196, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + canAttack = false, + category = "BUILDING NOTAIR ECO", + + collisionVolumeScales = [[66 74 126]], + collisionVolumeOffsets = [[0 10 0]], + collisionVolumeTest = 1, + collisionVolumeType = "box", -Will increase your storage reserves by +50 + description = [[Provides +]] .. supplygranted .. [[ Supply • Provides +]] .. storage .. [[ Metal/Energy Storage]], + energyStorage = storage, + metalStorage = storage, + energyUse = 0, + explodeAs = "smallBuildingExplosionGenericPurple", + footprintX = 2, + footprintZ = 4, + idleAutoHeal = .5, + idleTime = 2200, + icontype = "storage", + maxDamage = maxDamage, + maxSlope = 50, + maxWaterDepth = 5000, + --metalStorage = storage, + name = "Supply/Storage Depot", + objectName = "estorage2_small.s3o", + script = "estorage2.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "smallBuildingExplosionGenericPurple", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = "estorage", + workerTime = 0, + yardMap = "oo oo oo oo oo oo oo oo", -+50 Metal Storage + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionstoragenew-small", + "custom:fusionreactionstoragenew-blue-small", + "custom:skyhatelaser", + }, + }, -+50 Energy Storage]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + weapons = { + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 2, + supply_granted = supplygranted, + death_sounds = "generic", + armortype = "building", + noenergycost = true, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[]], + corpse = "energycore", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 4, + BuildingGroundDecalSizeY = 6, + BuildingGroundDecalDecaySpeed = 0.9, } -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ebuilding/etech1.lua b/Units/ebuilding/etech1.lua new file mode 100644 index 000000000..8dc5459bc --- /dev/null +++ b/Units/ebuilding/etech1.lua @@ -0,0 +1,110 @@ +-- UNITDEF -- ETECH1 -- +-------------------------------------------------------------------------------- + +local unitName = "etech1" + +-------------------------------------------------------------------------------- + +local armortype = [[building]] +local energyproduced = [[0]] +local techprovided = [[tech0, tech1]] +--local supplygranted = [[25]] + +local buildCostMetal = 100 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + buildpic = "emaker.png", + canAttack = false, + category = "BUILDING NOTAIR ECO", + damageModifier = 0.33333, + description = "Unlocks Tech 1 - Can be evolved to unlock Tech 2", + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "hugeBuildingExplosionGenericBlue", + footprintX = 4, + footprintZ = 4, + icontype = "energy", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Tech Facility", + objectName = "emaker3.s3o", + script = "emaker3.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericBlue", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = unitName, + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo ", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionmaker-orange", + "custom:fusionreactionmaker-blue", + "custom:fusionreactionmaker-orange", + "custom:fusionreactionmaker-blue", + "custom:skyhatelaser", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 4, + death_sounds = "generic", + ProvideTech = techprovided, +-- ProvideTechRange = powerradius, + -- RequireTech = "1 Powergrid", + armortype = armortype, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 500, -- optional +-- groundtexselectzsize = 500, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, +} +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ebuilding/etech2.lua b/Units/ebuilding/etech2.lua new file mode 100644 index 000000000..6235a5f05 --- /dev/null +++ b/Units/ebuilding/etech2.lua @@ -0,0 +1,113 @@ +-- UNITDEF -- ETECH2 -- +-------------------------------------------------------------------------------- + +local unitName = "etech2" + +-------------------------------------------------------------------------------- + +local armortype = [[building]] +local energyproduced = [[0]] +local techprovided = [[tech0, tech1, tech2, 1 baseshield]] + +local tech = [[tech1]] +--local supplygranted = [[25]] + +local buildCostMetal = 700 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + buildpic = "emaker.png", + canAttack = false, + category = "BUILDING NOTAIR ECO", + damageModifier = 0.33333, + description = "Unlocks Tech 2 - Can be evolved to unlock Tech 3", + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "hugeBuildingExplosionGenericPurple", + footprintX = 4, + footprintZ = 4, + icontype = "energy", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Tech Level 2 Facility", + objectName = "emaker3.s3o", + script = "emaker3.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericPurple", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = unitName, + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo ", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionmaker-orange", + "custom:fusionreactionmaker-purple", + "custom:fusionreactionmaker-blue", + "custom:fusionreactionmaker-purple", + "custom:skyhatelaser", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 4, + death_sounds = "generic", + ProvideTech = techprovided, + RequireTech = tech, +-- ProvideTechRange = powerradius, + -- RequireTech = "1 Powergrid", + armortype = armortype, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 500, -- optional +-- groundtexselectzsize = 500, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, +} +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ebuilding/etech3.lua b/Units/ebuilding/etech3.lua new file mode 100644 index 000000000..23947c5e5 --- /dev/null +++ b/Units/ebuilding/etech3.lua @@ -0,0 +1,113 @@ +-- UNITDEF -- ETECH3 -- +-------------------------------------------------------------------------------- + +local unitName = "etech3" + +-------------------------------------------------------------------------------- + +local armortype = [[building]] +local energyproduced = [[0]] +local techprovided = [[tech0, tech1, tech2, tech3]] + +local tech = [[tech1, tech2]] +--local supplygranted = [[25]] + +local buildCostMetal = 2100 +local maxDamage = buildCostMetal * 12.5 + +local unitDef = { + activateWhenBuilt = true, + buildAngle = 2048, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + builder = false, + buildTime = 5, + buildpic = "emaker.png", + canAttack = false, + category = "BUILDING NOTAIR ECO", + damageModifier = 0.33333, + description = "Unlocks Tech 3", + energyStorage = 0, + energyMake = energyproduced, + explodeAs = "hugeBuildingExplosionGenericGreen", + footprintX = 4, + footprintZ = 4, + icontype = "energy", + idleAutoHeal = .5, + idleTime = 2200, + maxDamage = maxDamage, + maxSlope = 60, + maxWaterDepth = 5000, + metalStorage = 0, + name = "Tech Level 3 Facility", + objectName = "emaker3.s3o", + script = "emaker3.cob", + onoffable = false, + radarDistance = 0, + repairable = false, + selfDestructAs = "hugeBuildingExplosionGenericGreen", + side = "CORE", + sightDistance = 367, + smoothAnim = true, + unitname = unitName, + yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo ", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:blacksmoke", + "custom:fusionreactionmaker-orange", + "custom:fusionreactionmaker-blue", + "custom:fusionreactionmaker-purple", + "custom:fusionreactionmaker-green", + "custom:skyhatelaser", + }, + }, + + sounds = { + underattack = "other/unitsunderattack1", + select = { + "other/gdenergy", + }, + }, + customParams = { + unittype = "building", + iseco = 1, + needed_cover = 4, + death_sounds = "generic", + ProvideTech = techprovided, + RequireTech = tech, +-- ProvideTechRange = powerradius, + -- RequireTech = "1 Powergrid", + armortype = armortype, +-- supply_granted = supplygranted, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + corpse = "energycore", +-- groundtexselectimg = ":nc:bitmaps/power/power.png", +-- groundtexselectimg1 = ":nc:bitmaps/power/power1.png", +-- groundtexselectimg2 = ":nc:bitmaps/power/power2.png", +-- groundtexselectimg3 = ":nc:bitmaps/power/power3.png", +-- groundtexselectimg4 = ":nc:bitmaps/power/power4.png", +-- groundtexselectimg5 = ":nc:bitmaps/power/power5.png", +-- groundtexselectimg6 = ":nc:bitmaps/power/power6.png", +-- groundtexselectxsize = 500, -- optional +-- groundtexselectzsize = 500, -- optional + helptext = [[]], + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, +} +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ebuilding/upgrades/elighttank3test.lua b/Units/ebuilding/upgrades/elighttank3test.lua deleted file mode 100644 index 3893cd8cd..000000000 --- a/Units/ebuilding/upgrades/elighttank3test.lua +++ /dev/null @@ -1,152 +0,0 @@ --- UNITDEF -- ELIGHTTANK3TEST -- --------------------------------------------------------------------------------- - -local unitName = "elighttank3test" - --------------------------------------------------------------------------------- - -local unitDef = { - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 27, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR RAID", - corpse = "ammobox", - description = [[Raider -Light -40 Damage vs Light/Armored/Building - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_UNIT", - footprintX = 2, - footprintZ = 2, - iconType = "raider", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 250, - maxSlope = 26, - maxVelocity = 5, - maxReverseVelocity = 2, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK2", - name = "Kite", - noChaseCategory = "VTOL", - objectName = "elighttank4.s3o", - script = "elighttank3.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "SMALL_UNIT", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - seismicDistance = 500, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 5.5, - turnRate = 1000, --- turnrate = 475, - unitname = "elighttank3test", - upright = true, - workerTime = 0, - -sfxtypes = { - explosiongenerators = { - "custom:factorysparks", - "custom:dirt", - "custom:blacksmoke", - }, - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "lighttankweapon", - badTargetCategory = "VTOL ARMORED WALL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - lighttankweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - collideFriendly = false, - avoidFeature = false, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:genericshellexplosion-medium-lightning", - energypershot = 2, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - noSelfDamage = true, - range = 500, - reloadtime = 1, - WeaponType = "LightningCannon", - rgbColor = "0.1 0.2 0.5", - rgbColor2 = "0 0 1", - soundStart = "jacobs.wav", - startsmoke = "1", - texture1 = "lightning", - thickness = 5, - turret = true, - weaponVelocity = 400, - customparams = { - upgradeClass = "groundweapons", - damagetype = "elighttank3", - }, - damage = { - default = 40, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/upgrades/uplvl1.lua b/Units/ebuilding/upgrades/uplvl1.lua deleted file mode 100644 index 5622d05cb..000000000 --- a/Units/ebuilding/upgrades/uplvl1.lua +++ /dev/null @@ -1,78 +0,0 @@ --- UNITDEF -- EUWSOLAR2 -- --------------------------------------------------------------------------------- - -local unitName = "uplvl1" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - damageModifier = 0.33333, - description = [[]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_BUILDING", - footprintX = 4, - footprintZ = 4, - icontype = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 800, - maxSlope = 60, - maxWaterDepth = 0, - metalStorage = 0, - name = "Upgrade Level 1", - objectName = "esolar2.s3o", - script = "euwsolar2.cob", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "uplvl1", - yardMap = "oooo oooo oooo oooo", - - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:bubbles", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - }, - customParams = { - iseco = 1, - death_sounds = "generic", - armortype = "BUILDING", - normalstex = "unittextures/esolar2normal.png", - upgradeTech = "groundweapons", - upgradeLevel = "1.15", - }, -} - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/water/euwfusion2.lua b/Units/ebuilding/water/euwfusion2.lua deleted file mode 100644 index d1f27aa3b..000000000 --- a/Units/ebuilding/water/euwfusion2.lua +++ /dev/null @@ -1,145 +0,0 @@ --- UNITDEF -- EUWFUSION2 -- --------------------------------------------------------------------------------- - -local unitName = "euwfusion2" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2500, - buildCostEnergy = 0, - buildCostMetal = 180, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = [[Produces +10 Energy -Provides +10 Power -Provides +10 Supply]], - energyMake = 10, - energyStorage = 0, - energyUse = 0, - explodeAs = "FUSIONPOP", - footprintX = 8, - footprintZ = 8, - iconType = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 3200, - maxSlope = 60, - minWaterDepth = 50, - maxWaterDepth = 10000, - metalStorage = 0, - name = "Underwater Advanced Generator", - objectName = "efusion.s3o", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "FUSIONPOP", - sightDistance = 367, - smoothAnim = true, - unitname = "euwfusion2", - workerTime = 0, - yardMap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", --- useBuildingGroundDecal = true, --- BuildingGroundDecalType = "powergrounddecal.png", --- BuildingGroundDecalSizeX = 50, --- BuildingGroundDecalSizeY = 50, --- BuildingGroundDecalDecaySpeed = 0.9, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:bubbles", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - [1] = { - def = "fusionfx", - }, - }, - customParams = { - iseco = 1, - death_sounds = "generic", - ProvideTech = "10 Power", - ProvideTechRange = "800", - armortype = "BUILDING", - supply_granted = 30, - normalstex = "unittextures/efusion2normal.png", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - groundtexselectimg = ":nc:bitmaps/power/power.png", - groundtexselectimg1 = ":nc:bitmaps/power/power1.png", - groundtexselectimg2 = ":nc:bitmaps/power/power2.png", - groundtexselectimg3 = ":nc:bitmaps/power/power3.png", - groundtexselectimg4 = ":nc:bitmaps/power/power4.png", - groundtexselectimg5 = ":nc:bitmaps/power/power5.png", - groundtexselectimg6 = ":nc:bitmaps/power/power6.png", - groundtexselectxsize = 800, -- optional - groundtexselectzsize = 800, -- optional - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 10, - BuildingGroundDecalSizeY = 10, - BuildingGroundDecalDecaySpeed = 0.9, -} - --------------------------------------------------------------------------------- - -local weaponDefs = { - fusionfx = { - - AreaOfEffect = 5, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - rgbColor = "0 0 1", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.1, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:bubbles", - fallOffRate = 0.5, - minintensity = 1, - impulseFactor = 0, - largeBeamLaser = true, - lineOfSight = true, - name = "fake", - noSelfDamage = true, - range = 650, - reloadtime = 0.1, - WeaponType = "BeamLaser", - selfprop = true, - soundTrigger = true, - startVelocity = 1500, - targetMoveError = 0.3, - thickness = 1, - turret = true, - weaponVelocity = 1500, - damage = { - default = 1E-06, - }, - }, -} -unitDef.weaponDefs = weaponDefs - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/water/euwmetalextractor.lua b/Units/ebuilding/water/euwmetalextractor.lua deleted file mode 100644 index 33e4bac98..000000000 --- a/Units/ebuilding/water/euwmetalextractor.lua +++ /dev/null @@ -1,129 +0,0 @@ --- UNITDEF -- EUWMETALEXTRACTOR -- --------------------------------------------------------------------------------- - -local unitName = "euwmetalextractor" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = "Extracts Metal", - energyStorage = 0, - energyUse = 0, - explodeAs = "SMALL_BUILDING", - extractsMetal = 0.0000001, - makesMetal = 0, - footprintX = 6, - footprintZ = 6, - iconType = "eco", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 1000, - maxSlope = 60, - minWaterDepth = 20, - maxWaterDepth = 10000, - metalStorage = 0, - metalMake = 0, - name = "Underwater Metal Extractor", - objectName = "euwmetalextractor.s3o", - onoffable = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - selfDestructCountdown = 1, - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "euwmetalextractor", - workerTime = 0, - yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:bubbles", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdmex", - }, - }, - weapons = { - [1] = { - def = "fusionfx", - }, - }, - customParams = { - iseco = 1, - death_sounds = "generic", - armortype = "BUILDING", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 8, - BuildingGroundDecalSizeY = 8, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - fusionfx = { - - AreaOfEffect = 5, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - rgbColor = "0 0 1", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.3, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:bubbles", - fallOffRate = 0.5, - minintensity = 1, - impulseFactor = 0, - largeBeamLaser = true, - lineOfSight = true, - name = "fake", - noSelfDamage = true, - range = 650, - reloadtime = 0.1, - WeaponType = "BeamLaser", - selfprop = true, - soundTrigger = true, - startVelocity = 1500, - targetMoveError = 0.3, - thickness = 1, - turret = true, - weaponVelocity = 1500, - damage = { - default = 1E-06, - }, - }, -} -unitDef.weaponDefs = weaponDefs --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/water/euwsolar2.lua b/Units/ebuilding/water/euwsolar2.lua deleted file mode 100644 index 587dd12e1..000000000 --- a/Units/ebuilding/water/euwsolar2.lua +++ /dev/null @@ -1,143 +0,0 @@ --- UNITDEF -- EUWSOLAR2 -- --------------------------------------------------------------------------------- - -local unitName = "euwsolar2" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - damageModifier = 0.33333, - description = [[Produces +1 Energy -Provides +1 Energy -Provides +5 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = -1, - explodeAs = "SMALL_BUILDING", - footprintX = 4, - footprintZ = 4, - icontype = "energy", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 800, - maxSlope = 60, - minWaterDepth = 20, - maxWaterDepth = 10000, - metalStorage = 0, - name = "Underwater Basic Generator", - objectName = "esolar2.s3o", - onoffable = false, - radarDistance = 0, - repairable = false, - selfDestructAs = "SMALL_BUILDING", - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "euwsolar2", - yardMap = "oooo oooo oooo oooo", - -- useBuildingGroundDecal = true, - -- BuildingGroundDecalType = "powergrounddecal.png", - -- BuildingGroundDecalSizeX = 40, - -- BuildingGroundDecalSizeY = 40, - -- BuildingGroundDecalDecaySpeed = 0.9, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:bubbles", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - [1] = { - def = "fusionfx", - }, - }, - customParams = { - iseco = 1, - death_sounds = "generic", - ProvideTech = "1 Power", - ProvideTechRange = "400", - armortype = "BUILDING", - supply_granted = 5, - normalstex = "unittextures/esolar2normal.png", - groundtexselectimg = ":nc:bitmaps/power/power.png", - groundtexselectimg1 = ":nc:bitmaps/power/power1.png", - groundtexselectimg2 = ":nc:bitmaps/power/power2.png", - groundtexselectimg3 = ":nc:bitmaps/power/power3.png", - groundtexselectimg4 = ":nc:bitmaps/power/power4.png", - groundtexselectimg5 = ":nc:bitmaps/power/power5.png", - groundtexselectimg6 = ":nc:bitmaps/power/power6.png", - groundtexselectxsize = 400, -- optional - groundtexselectzsize = 400, -- optional - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 6, - BuildingGroundDecalSizeY = 6, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - fusionfx = { - - AreaOfEffect = 5, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - rgbColor = "0 0 1", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.1, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:bubbles", - fallOffRate = 0.5, - minintensity = 1, - impulseFactor = 0, - largeBeamLaser = true, - lineOfSight = true, - name = "fake", - noSelfDamage = true, - range = 650, - reloadtime = 0.1, - WeaponType = "BeamLaser", - selfprop = true, - soundTrigger = true, - startVelocity = 1500, - targetMoveError = 0.3, - thickness = 1, - turret = true, - weaponVelocity = 1500, - damage = { - default = 1E-06, - }, - }, -} -unitDef.weaponDefs = weaponDefs --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/water/euwstorage.lua b/Units/ebuilding/water/euwstorage.lua deleted file mode 100644 index e8abe3b74..000000000 --- a/Units/ebuilding/water/euwstorage.lua +++ /dev/null @@ -1,121 +0,0 @@ --- UNITDEF -- EUWSTORAGE -- --------------------------------------------------------------------------------- - -local unitName = "euwstorage" - --------------------------------------------------------------------------------- - -local unitDef = { - activateWhenBuilt = true, - buildAngle = 8196, - buildCostEnergy = 0, - buildCostMetal = 20, - builder = false, - buildTime = 5, - category = "BUILDING NOTAIR ECO", - corpse = "ammobox", - description = "Resource Storage - Stores 50m/50e", - energyStorage = 50, - energyUse = 0, - explodeAs = "ESTOR_BUILDING", - footprintX = 6, - footprintZ = 6, - idleAutoHeal = .5, - idleTime = 2200, - icontype = "eco", - maxDamage = 1200, - maxSlope = 60, - minWaterDepth = 40, - maxWaterDepth = 10000, - metalStorage = 50, - name = "Underwater Storage", - objectName = "estorage.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "ESTOR_BUILDING", - side = "CORE", - sightDistance = 367, - smoothAnim = true, - unitname = "euwstorage", - workerTime = 0, - yardMap = "oooooo oooooo oooooo oooooo oooooo oooooo", - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - explosiongenerators = { - "custom:bubbles", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdenergy", - }, - }, - weapons = { - [1] = { - def = "fusionfx", - }, - }, - customParams = { - iseco = 1, - death_sounds = "generic", - armortype = "BUILDING", - normalstex = "unittextures/estoragenormal.png", - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 8, - BuildingGroundDecalSizeY = 8, - BuildingGroundDecalDecaySpeed = 0.9, -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - fusionfx = { - - AreaOfEffect = 5, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - rgbColor = "0 0 1", - rgbColor2 = "0.5 0.5 0.5", - coreThickness = 0.1, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:bubbles", - fallOffRate = 0.5, - minintensity = 1, - impulseFactor = 0, - largeBeamLaser = true, - lineOfSight = true, - name = "fake", - noSelfDamage = true, - range = 650, - reloadtime = 0.1, - WeaponType = "BeamLaser", - selfprop = true, - soundTrigger = true, - startVelocity = 1500, - targetMoveError = 0.3, - thickness = 1, - turret = true, - weaponVelocity = 1500, - damage = { - default = 1E-06, - }, - }, -} -unitDef.weaponDefs = weaponDefs --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ebuilding/water/euwturret.lua b/Units/ebuilding/water/euwturret.lua deleted file mode 100644 index aceaf55f8..000000000 --- a/Units/ebuilding/water/euwturret.lua +++ /dev/null @@ -1,150 +0,0 @@ --- UNITDEF -- EUWTURRET -- --------------------------------------------------------------------------------- - -local unitName = "euwturret" - --------------------------------------------------------------------------------- - -local unitDef = { - - buildAngle = 2048, - buildCostEnergy = 0, - buildCostMetal = 40, - builder = false, - buildTime = 5, - canAttack = true, - canstop = "1", - category = "BUILDING NOTAIR", - collisionVolumeTest = "1", - corpse = "ammobox", - description = [[Anti-Amphibious Defense Platform - Building - 120 Damage vs Light/Armored - 12 Damage vs Building - ]], - energyStorage = 0, - energyUse = 0, - explodeAs = "MEDIUM_BUILDING", - floater = true, - footprintX = 4, - footprintZ = 4, - idleAutoHeal = .5, - idleTime = 2200, - iconType = "defense", - maxDamage = 750, - maxSlope = 60, - minWaterDepth = 20, - metalStorage = 0, - name = "Rooter", - objectName = "euwturret.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "MEDIUM_BUILDING", - side = "CORE", - sightDistance = 250, - SonarDistance = 600, - smoothAnim = true, - unitname = "euwturret", - workerTime = 0, - yardMap = "oooo oooo oooo oooo", - - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:electricity", - "custom:needspower", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "turretselect", - }, - }, - weapons = { - [1] = { - def = "euwturretmissile", - onlyTargetCategory = "LIGHT ARMORED", --- MainDir = [[0 -1 0]], --- MaxAngleDif = 180, - }, - }, - customParams = { - needed_cover = 2, - supply_cost = 1, - death_sounds = "generic", - -- twokhotkey = 't', - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, - buildingGroundDecalDecaySpeed=30, - buildingGroundDecalSizeX=6, - buildingGroundDecalSizeY=6, - useBuildingGroundDecal = false, - buildingGroundDecalType=[[elightturret2_aoplane.dds]], -} - - --------------------------------------------------------------------------------- - -local weaponDefs = { - euwturretmissile = { - AreaOfEffect = 10, - avoidFriendly = false, - avoidFeature = false, - cegTag = "torpedotrailuwturret", - collideFriendly = false, - collideFeature = false, - explosionGenerator = "custom:torpedoexplosion", - energypershot = 12, - fireStarter = 80, - impulseFactor = 0.1, - interceptedByShieldType = 4, - model = "missilesmall.s3o", - name = "Underwater Torpedo", - pitchtolerance = 3000, - range = 600, - reloadtime = 1, - weaponType = "TorpedoLauncher", - soundHit = "torpedolaunch.wav", - soundStart = "subhit.wav", - tolerance = 3000, - turret = true, - startVelocity = 200, - acceleration = 2000, - weaponVelocity = 10000, - tracks = true, - turnrate = 100000, - flighttime = 8, - sprayangle = 5000, - waterweapon = true, - - customparams = { - damagetype = "euwturret", - }, - damage = { - default = 120, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ecommander.lua b/Units/ecommander.lua index e4cb65b6b..8c75f03e6 100644 --- a/Units/ecommander.lua +++ b/Units/ecommander.lua @@ -1,190 +1,238 @@ -- UNITDEF -- ECOMMANDER -- -------------------------------------------------------------------------------- -local unitName = "ecommander" +local unitName = "ecommander" -------------------------------------------------------------------------------- -local unitDef = { +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] ---mobileunit - transportbyenemy = false; ---** - acceleration = 0.2, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 150, - buildDistance = 1000, - builder = true, - buildTime = 2.5, - capturable = false, - CanAttack = true, - CanAssist = true, - canBeAssisted = true, - CanCapture = true, - CanRepair = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "NOTAIR SUPPORT LIGHT", - description = [[Armored - - • Armed with a small emp weapon capable of disabling light units for a short period of time (Must be manually fired!) - - There can only be one!]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "emp", - fireState = "0", - footprintX = 4, - footprintZ = 4, - hideDamage = true, - iconType = "commander", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 5000, - maxSlope = 180, - maxVelocity = 3, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalmake = 0, - metalStorage = 0, - movementClass = "COMMANDERTANK4", - moveState = "0", - name = "The Overseer", - noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", - objectName = "ecommander4.s3o", - script = "ecommander3.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "emp", - showPlayerName = true, - showNanoSpray = false, - sightDistance = 500, - smoothAnim = true, - stealth = false, - turnRate = 1000, - unitname = "ecommander", - unitRestricted = 1, - upright = false, - workerTime = 1, - capturespeed = 0.25, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - -- 0.03125 = 1 hp per second - repairspeed = 0.15625, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, - explosiongenerators = { - "custom:nanoorb", - "custom:dirt", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eminifac", --new - "ebasefactory", --new - "eamphibfac", - "eairplant", - "eexperimentalfac", - "emetalextractor", --new - "emaker", --new - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ekmar", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - "euwturret", - "elrpc", - "eshieldgen", - "esilo", - "emine", - "eorb", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "emp", - }, - }, - customParams = { - iscommander = true, - needed_cover = 2, - death_sounds = "generic", - cancollect = "1", - armortype = "light", - nofriendlyfire = "1", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 2000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 1, -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, } -------------------------------------------------------------------------------- -local weaponDefs = { - emp = { - AreaOfEffect = 500, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - commandfire = true, - explosionGenerator = "custom:genericshellexplosion-large-blue-emp", - tolerance = 1000, - energypershot = 0, - explosionScar = false, - impulseFactor = 0, - name = "Emp Blast Weapon", - paralyzer = true, - paralyzetime = 5, - range = 500, - reloadtime = 10, - weaponType = "Cannon", - soundhit = "emp.wav", - size = 0, - turret = true, - weaponVelocity = 10000, - customparams = { - damagetype = "default", - nofriendlyfire = 1, - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = 1000, - }, - }, +local weaponDefs = { + + machinegun = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0.2 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 200, + }, + }, + + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, } -unitDef.weaponDefs = weaponDefs +unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ecommanderbattle.lua b/Units/ecommanderbattle.lua new file mode 100644 index 000000000..c920721fe --- /dev/null +++ b/Units/ecommanderbattle.lua @@ -0,0 +1,423 @@ +-- UNITDEF -- ECOMMANDERBATTLE -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderbattle" + +-------------------------------------------------------------------------------- + +local armortype = [[armored]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + +local weapon2Damage = 75 +local weapon2AOE = 25 +local energycosttofire2 = weapon2Damage / 10 * ((weapon2AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT ARMORED", + description = [[Experimental Assault Overseer]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + autoHeal = 0.5, + idleAutoHeal = 50, + idleTime = 300, + levelground = true, + maxDamage = 15000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Battle Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:electricity", + }, + }, + --buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + [1] = { + def = "heavybeamweapon", + badTargetCategory = "BUILDING WALL", + }, + }, + customParams = { + unittype = "mobile", + --area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 2, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 20, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, + machinegun = { + accuracy = 300, + AreaOfEffect = weapon2AOE, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + beamTime = 0.1, + + coreThickness = 0.5, + duration = 0.1, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + energypershot = energycosttofire2, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Machine Gun", + range = 650, + reloadtime = 0.1, + WeaponType = "LaserCannon", + rgbColor = "1 0.5 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/tankdestroyerfire.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 5, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "antiarmored", + + nocosttofire = true, + }, + damage = { + default = weapon2Damage, + }, + }, + sniper = { + AreaOfEffect = 25, + avoidFeature = false, + avoidFriendly = false, + beamTime = 0.1, + + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.2, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-medium-purple", + fallOffRate = 0, + fireStarter = 100, + impulseFactor = 0, + interceptedByShieldType = 4, + + minintensity = "1", + name = "Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.5 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Blaster 4.wav", + soundHit = "explosions/explode5.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 5, + tolerance = 1000, + turret = true, + weaponVelocity = 3000, + customparams = { + damagetype = "antilightarmored", + }, + damage = { + default = 750, + }, + }, + + heavybeamweapon = { + AreaOfEffect = 10, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + largebeamlaser = true, + beamTime = 0.5, + cameraShake = 0, + coreThickness = 0.5, + -- cegTag = "mediumcannonweapon3", + -- duration = 0.2, + energypershot = 0, + explosionGenerator = "custom:genericshellexplosion-large-sparks-burn", + fallOffRate = 0, + fireStarter = 50, + impulseFactor = 0, + interceptedByShieldType = 4, + minintensity = 1, + name = "Laser", + range = 800, + reloadtime = 0.5, + WeaponType = "BeamLaser", + rgbColor = "0.25 0 0.25", + rgbColor2 = "0.5 0.5 0.5", + soundTrigger = true, + soundstart = "weapons/Sci Fi Beam 3-short.wav", + -- soundHit = "explosions/mediumcannonhit.wav", + -- sweepfire = true, + texture1 = "shot", + texture2 = "empty", + thickness = 5, + tolerance = 1000, + turret = true, + weaponVelocity = 800, + customparams = { + isupgraded = isUpgraded, + damagetype = "antilightarmored", + }, + damage = { + default = 500, + }, + }, + +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommanderbuild.lua b/Units/ecommanderbuild.lua new file mode 100644 index 000000000..533e94fc3 --- /dev/null +++ b/Units/ecommanderbuild.lua @@ -0,0 +1,332 @@ +-- UNITDEF -- ECOMMANDERBUILD -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderbuild" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 15 +local weapon1AOE = 25 +local energycosttofire1 = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 600, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Builds Units x8 as fast]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 6000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Builder Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 8, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 1.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[Armortype: ]] ..armortype.. [[ +x3 Buildpower + +1000 EMP Damage vs Light/Armored/Building + +Reclaims any energy cores within it's proximity.]], + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + machinegun = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0.2 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 200, + }, + }, + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 0.5, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 250, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 5, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommandercloak.lua b/Units/ecommandercloak.lua new file mode 100644 index 000000000..8ebf3556e --- /dev/null +++ b/Units/ecommandercloak.lua @@ -0,0 +1,297 @@ +-- UNITDEF -- ECOMMANDERCLOAK -- +-------------------------------------------------------------------------------- + +local unitName = "ecommandercloak" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 15 +local weapon1AOE = 25 +local energycosttofire1 = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Provides Massive Cloak Field]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 10000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Cloaking Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3.cob", + radarDistance = 0, + radarDistanceJam = 800, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 650, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + --buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + }, + customParams = { + unittype = "mobile", + --area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + + area_cloak = 1, -- Can this unit emit a cloaking field? + area_cloak_upkeep = 0, -- How much energy does it cost to maintain the cloaking field? + area_cloak_radius = 1000, -- How large is the cloaking field? + --area_cloak_grow_rate = 200, -- When the cloaking field is turned on, how fast does the field expand to it's full size? + --area_cloak_shrink_rate = 200, -- When the cloaking field is turned off, how fast does the field shrink to nothingness? + area_cloak_decloak_distance = 150, -- How close does something have to be in order to decloak a unit within a cloaking shield? + area_cloak_init = true, -- Start up the cloak shield the moment the unit is built? + area_cloak_draw = true, -- No idea what this does + area_cloak_self = true, -- Does the cloak shield cloak the unit emitting it? + + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommanderfactory.lua b/Units/ecommanderfactory.lua new file mode 100644 index 000000000..394559e95 --- /dev/null +++ b/Units/ecommanderfactory.lua @@ -0,0 +1,326 @@ +-- UNITDEF -- ECOMMANDERFACTORY -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderfactory" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[15]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local weapon1Damage = 15 +local weapon1AOE = 25 +local energycosttofire1 = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 250, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Creates buildings and mobile units • Gives ]] ..supplyGiven.. [[ Supply]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 15000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Factory Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 8, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 1.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = Shared.buildListeCommanderFactory, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", + }, + }, + customParams = { + unittype = "mobile", + --area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + machinegun = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0.2 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 200, + }, + }, + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommanderhealer.lua b/Units/ecommanderhealer.lua new file mode 100644 index 000000000..05cdb517a --- /dev/null +++ b/Units/ecommanderhealer.lua @@ -0,0 +1,238 @@ +-- UNITDEF -- ECOMMANDERHEALER -- +-------------------------------------------------------------------------------- + +local unitName = "ecommanderhealer" + +-------------------------------------------------------------------------------- + +local armortype = [[light]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Provides a Large Healing Area of Effect]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = 6000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Healer Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4-battle.s3o", + script = "ecommander4-battle.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 1, -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + [1] = { + def = "machinegun", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + machinegun = { + AreaOfEffect = 50, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + + coreThickness = 0.5, + duration = 0.2, + explosionGenerator = "custom:genericshellexplosion-small", + energypershot = 0, + fallOffRate = 0, + fireStarter = 50, + interceptedByShieldType = 4, + impulsefactor = 0, + + minintensity = "1", + name = "Overseer Pulse Laser", + range = 650, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "1 0.2 0", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/Sci Fi Sniper 10.wav", + texture1 = "shot", + texture2 = "empty", + thickness = 7, + tolerance = 1000, + turret = true, + weaponVelocity = 1500, + customparams = { + damagetype = "light", + nocosttofire = true, + }, + damage = { + default = 200, + }, + }, + + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommandermeteor.lua b/Units/ecommandermeteor.lua new file mode 100644 index 000000000..faf5506e1 --- /dev/null +++ b/Units/ecommandermeteor.lua @@ -0,0 +1,229 @@ +-- UNITDEF -- ECOMMANDERMETEOR -- +-------------------------------------------------------------------------------- + +local unitName = "ecommandermeteor" + +-------------------------------------------------------------------------------- + +local armortype = [[armored]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer, tech3]] + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = false, + canBeAssisted = true, + CanCapture = false, + CanRepair = false, + canRestore = false, + + canGuard = true, + canMove = false, + canPatrol = false, + canreclaim = false, + canstop = true, + category = "NOTAIR BUILDING", + description = [[Astrological Control Center]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 8, + footprintZ = 8, + + iconType = "commander", + idleAutoHeal = 5, + idleTime = 300, + levelground = true, + maxDamage = 20000, + maxSlope = 180, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + moveState = "0", + name = "The Meteor Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + fireState = 0, + objectName = "ecommander-meteor.s3o", + script = "ecommander4-meteor.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 250, + smoothAnim = true, + stealth = true, + unitname = unitName, + upright = false, + yardmap = "oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo", + + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + "custom:gdhcannon", + }, + }, + --buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + [1] = { + def = "meteor", + badtargetcategory = "VTOL LIGHT ARMORED", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, + useGroundDecal = true, + BuildingGroundDecalType = "factorygroundplate.dds", + BuildingGroundDecalSizeX = 10, + BuildingGroundDecalSizeY = 10, + BuildingGroundDecalDecaySpeed = 0.9, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + meteor = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + commandFire = true, + burst = 100, + burstrate = 0.1, + --projectiles = 5, + cegTag = "METEORTRAIL", + commandfire = true, + explosionGenerator = "custom:genericshellexplosion-large", + energypershot = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + name = unitName .. "Weapon", + range = 50000, + reloadtime = 120, + size = 16, + weaponType = "Cannon", + soundHit = "explosions/explode3.wav", + soundStart = "weapons/meteorwhoosh.wav", + sprayangle = 1000, + tolerance = 2000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "antibuilding", + friendlyfireexception = true, + }, + damage = { + default = 100, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ecommandershield.lua b/Units/ecommandershield.lua new file mode 100644 index 000000000..48dee7a5c --- /dev/null +++ b/Units/ecommandershield.lua @@ -0,0 +1,325 @@ +-- UNITDEF -- ECOMMANDERSHIELD -- +-------------------------------------------------------------------------------- + +local unitName = "ecommandershield" + +-------------------------------------------------------------------------------- + +local armortype = [[armored]] +local supplyGiven = [[0]] +local techprovided = [[tech0, -overseer]] +local techrequired = [[0 overseer]] + +local shield1Power = 5000 +local shield1PowerRegen = 50 +local shield1PowerRegenEnergy = 0 + +local weapon1Damage = 200 +local weapon1AOE = 250 +local energycosttofire = 0 --weapon1Damage / 10 * ((weapon1AOE / 1000) + 1) + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + acceleration = 0.2, + brakeRate = 1, + buildCostEnergy = 0, + buildCostMetal = 1000, + buildDistance = 350, + builder = true, + buildTime = 2.5, + buildpic = "ecommanderbattle.png", + capturable = false, + CanAttack = true, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "NOTAIR SUPPORT LIGHT", + description = [[Provides large shielding • Self-Heals out of combat 40hp/s when idle]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "commnuke", + footprintX = 4, + footprintZ = 4, + + iconType = "commander", + idleAutoHeal = 40, + idleTime = 5, + levelground = true, + maxDamage = 8000, + maxSlope = 180, + maxVelocity = 3, + maxReverseVelocity = 1, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "COMMANDERTANK4", + moveState = "0", + name = "The Shielded Overseer", + noChaseCategories = "NOTAIR SUPPORT VTOL AMPHIB", + objectName = "ecommander4.s3o", + script = "ecommander3shield.cob", + radarDistance = 0, + repairable = false, + selfDestructAs = "commnuke", + showPlayerName = true, + showNanoSpray = true, + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + turnInPlace = true, + turnRate = 5000, + unitname = unitName, + upright = false, + workerTime = 1, + capturespeed = 0.25, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + -- 0.03125 = 1 hp per second + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + --buildoptions = Shared.buildList, + sounds = { + build = "miscfx/buildstart.wav", + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + weapons = { + -- [1] = { + -- def = "riottankempweapon", + -- }, + [1] = { + def = "shield", + }, + }, + customParams = { + unittype = "mobile", + --area_mex_def = "emetalextractor", + ProvideTech = techprovided, + RequireTech = techrequired, + canbetransported = "true", + iscommander = true, + needed_cover = 2, + supply_granted = supplyGiven, + death_sounds = "generic", + + armortype = armortype, + nofriendlyfire = "1", + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + helptext = [[Armortype: ]] ..armortype.. [[ + +Generates a large shield + +Reclaims any energy cores within it's proximity.]], + }, +} + +-------------------------------------------------------------------------------- + +local weaponDefs = { + + riottankempweapon = { + + AreaOfEffect = weapon1AOE, + avoidFeature = false, + avoidFriendly = false, + avoidGround = false, + collideFeature = false, + collideFriendly = false, + coreThickness = 0.6, + -- cegTag = "mediumcannonweapon3", + duration = 0.05, + edgeeffectiveness = 0.1, + energypershot = energycosttofire, + explosionGenerator = "custom:genericshellexplosion-medium-lightning", + fallOffRate = 1, + fireStarter = 100, + impulseFactor = 0, + + minintensity = 1, + name = "EMP Blast Wave", + noexplode = true, + paralyzer = true, + paralyzetime = 2.5, + range = 500, + reloadtime = 1, + WeaponType = "LaserCannon", + rgbColor = "0 0.2 1", + rgbColor2 = "1 1 1", + soundTrigger = true, + soundstart = "weapons/fnubeamfire.wav", + soundHit = "explosions/phasegun1hit.wav", + texture1 = "wave", + texture2 = "empty", + thickness = 40, + tolerance = 1000, + turret = true, + weaponVelocity = 1000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = weapon1Damage, + }, + }, + + emp = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + collideFriendly = false, + collideFeature = false, + explosionGenerator = "custom:genericshellexplosion-large-blue-emp", + tolerance = 1000, + energypershot = 0, + explosionScar = false, + impulseFactor = 0, + name = "Emp Blast Weapon", + noSelfDamage = true, + paralyzer = true, + paralyzetime = 5, + range = 500, + reloadtime = 10, + weaponType = "Cannon", + soundhit = "explosions/emp.wav", + size = 0, + turret = true, + weaponVelocity = 10000, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + nocosttofire = true, + + --Upgrades-- + upgradeClass = "groundweapons", + }, + damage = { + default = 1000, + }, + }, + shield = { + + Smartshield = true, + Exteriorshield = true, + Visibleshield = false, + Visibleshieldrepulse = false, + ShieldStartingPower = 0, + Shieldenergyuse = 0, + Shieldradius = 500, + Shieldpower = shield1Power, + Shieldpowerregen = shield1PowerRegen, + Shieldpowerregenenergy = shield1PowerRegenEnergy, + Shieldintercepttype = 4, + Shieldgoodcolor = "0.0 0.2 1.0", + Shieldbadcolor = "1.0 0 0", + Shieldalpha = 0.2, + + texture1 = "shield4", + + visibleShieldHitFrames = 1, + weaponType = [[Shield]], + customparams = { + nocosttofire = true, + }, + damage = { + default = 1, + }, + }, + commnuke = { + AreaOfEffect = 500, + avoidFriendly = false, + avoidFeature = false, + cegTag = "NUKETRAIL", + collideFriendly = false, + collideFeature = false, + commandfire = true, + craterBoost = 0, + craterMult = 0, + edgeeffectiveness = 0.1, + energypershot = 0, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + fireStarter = 100, + flightTime = 400, + + id = 124, + impulseBoost = 0, + impulseFactor = 0, + interceptedByShieldType = 4, + + metalpershot = 0, + model = "enuke.s3o", + name = "Nuke", + range = 32000, + reloadtime = 60, + weaponType = "MissileLauncher", + + + smokeTrail = false, + soundHit = "explosions/explosion_enormous.wav", + soundStart = "weapons/nukelaunch.wav", + +-- stockpile = true, +-- stockpileTime = stockpiletime, + startVelocity = 10, + tracks = true, + turnRate = 3000, + targetable = 1, + + weaponAcceleration = 30, + weaponTimer = 15, + weaponType = "StarburstLauncher", + weaponVelocity = 1000, + customparams = { + damagetype = "light", + death_sounds = "nuke", + nocosttofire = true, + }, + damage = { + default = 1000, + }, + }, +} +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/eexperimental/eexkrabgroth.lua b/Units/eexperimental/eexkrabgroth.lua deleted file mode 100644 index 05b2cb4d8..000000000 --- a/Units/eexperimental/eexkrabgroth.lua +++ /dev/null @@ -1,224 +0,0 @@ --- UNITDEF -- EEXKRABGOTH -- --------------------------------------------------------------------------------- - -local unitName = "eexkrabgroth" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.18, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 450, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - cantBeTransported = true, - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - description =[[Endbringer Class Base Assault Walker -Armored - -Primary Laser: -600 Damage/s vs Building -60 Damage/s vs Light/Armored - -Secondary Cannons: -80 Damage vs Building -8 Damage vs Light/Armored - -Requires +25 Power -Uses +25 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "krabblast", - firestandorders = "1", - footprintX = 12, - footprintZ = 12, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 15000, - maxVelocity = 2.5, - maxReverseVelocity = 1, - maxWaterDepth = 80, - metalStorage = 0, - movementClass = "EXPERIMENTALTANK12", - name = "Anarchid", - noChaseCategory = "VTOL", - objectName = "ekrabgroth.s3o", - pushResistant = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "krabblast", - shootme = "1", - sightDistance = 1000, - smoothAnim = true, - turnInPlace = true, - turnRate = 1000, - unitname = "eexkrabgroth", - unitnumber = "110", - upright = false, --- usePieceCollisionVolumes = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirtsmall", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "heavybeamweapon", - onlyTargetCategory = "BUILDING", - }, - [2] = { - def = "concussioncannon", - onlyTargetCategory = "BUILDING", - }, - [3] = { - def = "concussioncannon", - onlyTargetCategory = "BUILDING", - }, - }, - customParams = { - death_sounds = "nuke", - RequireTech = "25 Power", - armortype = "armored", - supply_cost = 25, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 600 -local weapon2Damage = 600 - -local weaponDefs = { - heavybeamweapon = { - AreaOfEffect = 10, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 1, - beamWeapon = true, - cameraShake = 1, - coreThickness = 0.5, --- cegTag = "mediumcannonweapon3", --- duration = 0.2, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-large-purple", - fallOffRate = 1, - fireStarter = 50, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Laser", - range = 1000, - reloadtime = 1, - WeaponType = "BeamLaser", - rgbColor = "1 0 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "krabprimary.wav", --- soundHit = "mediumcannonhit.wav", --- sweepfire = true, - texture1 = "shot", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 800, - customparams = { - damagetype = "eexkrabgroth", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - concussioncannon = { - accuracy = 1, - AreaOfEffect = 10, - avoidFriendly = false, - avoidFeature = false, - ballistic = true, - collideFriendly = false, - collideFeature = false, - cylinderTargeting = true, - burnblow = true, - endsmoke = "1", - explosionGenerator = "custom:genericshellexplosion-medium", - energypershot = weapon2Damage / 20, - fireStarter = 80, - id = 1, - impulseFactor = 0.1, - interceptedByShieldType = 4, - name = "Concussion Cannon", - pitchtolerance = "500", - range = 1000, - reloadtime = 1, - weaponType = "Cannon", - soundHit = "explode2", - soundStart = "krabsecondary.wav", - startsmoke = "1", - tolerance = 500, - turret = true, - weaponVelocity = 5000, - customparams = { - damagetype = "eexkrabgroth", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon2Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- - diff --git a/Units/eexperimental/eexnukearty.lua b/Units/eexperimental/eexnukearty.lua deleted file mode 100644 index 52e0a2d04..000000000 --- a/Units/eexperimental/eexnukearty.lua +++ /dev/null @@ -1,158 +0,0 @@ --- UNITDEF -- EEXNUKEARTY -- --------------------------------------------------------------------------------- - -local unitName = "eexnukearty" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.18, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 750, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR SUPPORT", - corpse = "ammobox", - description = [[Endbringer Class Low Yeild Nuclear Artillery -Armored -2000 Damage vs Building -1000 Damage vs Light/Armored - -Requires +40 Power]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "BIG_UNIT", - footprintX = 9, - footprintZ = 9, - fireState = 0, - highTrajectory = 1, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 10000, - maxVelocity = 2.3, - maxReverseVelocity = 1, - maxWaterDepth = 20, - metalStorage = 0, - movementClass = "HOVERTANKEXPERIMENTAL9", - name = "Lacerator", - noChaseCategory = "VTOL", - objectName = "eexnukearty.s3o", - pushResistant = true, - radarDistance = 0, - repairable = false, - selfDestructAs = "BIG_UNIT", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - turnInPlace = false, - turnRate = 1000, - unitname = "eexnukearty", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "nukeartyweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "LIGHT ARMORED WALL", - }, - }, - customParams = { - death_sounds = "nuke", - RequireTech = "40 Power", - armortype = "armored", - supply_cost = 40, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 2000 - -local weaponDefs = { - nukeartyweapon = { - badTargetCategory = [[ARMORED LIGHT]], - accuracy = 200, - AreaOfEffect = 500, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "nukeartyshot", - explosionGenerator = "custom:nukeartyexpl", - edgeEffectiveness = 0.1, - energypershot = weapon1Damage / 20, - id = 172, - impulseFactor = 0, - interceptedByShieldType = 4, - name = "Light Cannon", - range = 3000, - reloadtime = 15, - weaponType = "Cannon", - soundHit = "nukeartyhit.wav", - soundStart = "nukeartyshot.wav", - startsmoke = "1", - tolerance = 2000, - turret = true, - weaponVelocity = 800, - customparams = { - damagetype = "eexnukearty", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eexperimental/eexperimentalfac.lua b/Units/eexperimental/eexperimentalfac.lua deleted file mode 100644 index ad962f7de..000000000 --- a/Units/eexperimental/eexperimentalfac.lua +++ /dev/null @@ -1,102 +0,0 @@ --- UNITDEF -- EEXPERIMENTALFAC -- --------------------------------------------------------------------------------- - -local unitName = "eexperimentalfac" - --------------------------------------------------------------------------------- - -local unitDef = { - - activatewhenbuilt = false, - buildAngle = 1024, - buildCostEnergy = 0, - buildCostMetal = 250, - builder = true, - buildTime = 2.5, - canBeAssisted = true, - canGuard = true, - canMove = true, - canPatrol = true, - canReclaim = false, - canstop = true, - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Place generators near this factory to unlock higher tier units]], - energyStorage = 0, - energyUse = 0, - energyMake = 0, - explodeAs = "MEXPOP2", - footprintX = 34, - footprintZ = 34, - iconType = "factory", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 5000, - maxSlope = 25, - maxWaterDepth = 0, - metalStorage = 0, - metalMake = 0, - name = "Endbringer Class Factory", - objectName = "eexperimentalfac.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - showNanoSpray = "0", - side = "CORE", - sightDistance = 388, - smoothAnim = true, - TEDClass = "PLANT", - unitname = "eexperimentalfac", - unitrestricted = 1, - workerTime = 1, - yardMap = "ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo ooooooooooccccccccccccccoooooooooo", --- usePieceCollisionVolumes = true, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 36, - BuildingGroundDecalSizeY = 36, - BuildingGroundDecalDecaySpeed = 0.9, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:nanohuge", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eextankdestroyer", --new - "eexkrabgroth", --new - "eexnukearty" --new - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdfactoryselect", - }, - }, - customParams = { - death_sounds = "nuke", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", --- ProvideTech = "1 Powergrid", --- ProvideTechRange = "1500", --- groundtexselectimg = ":nc:bitmaps/power/powergrid.png", --- groundtexselectxsize = 1500, -- optional --- groundtexselectzsize = 1500, -- optional - }, -} - - - --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/eexperimental/eextankdestroyer.lua b/Units/eexperimental/eextankdestroyer.lua deleted file mode 100644 index a13f2dc8a..000000000 --- a/Units/eexperimental/eextankdestroyer.lua +++ /dev/null @@ -1,215 +0,0 @@ --- UNITDEF -- EEXTANKDESTROYER -- --------------------------------------------------------------------------------- - -local unitName = "eextankdestroyer" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 0.18, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 500, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED AMPHIB SKIRMISHER", - corpse = "ammobox", - description = [[Endbringer Class Tank Destroyer -Armored - -Main Cannon: -500 Damage vs Light/Armored -50 Damage vs Building - -Secondary Machinegun: -120 Damage/s vs Light/Armored -12 Damage/s vs Building - -Requires +30 Power]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "krabblast", - footprintX = 12, - footprintZ = 12, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 12500, - maxSlope = 28, - maxVelocity = 2.8, - maxReverseVelocity = 1, - maxWaterDepth = 5000, - metalStorage = 0, - movementClass = "EXPERIMENTALTANK10", - name = "Leveler", - noChaseCategory = "VTOL", - objectName = "extankdestroyer.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "krabblast", - side = "CORE", - sightDistance = 750, - stealth = false, - smoothAnim = true, - turnInPlace = false, - turnRate = 1000, - unitname = "eextankdestroyer", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "tankkillerlaser", - onlyTargetCategory = "LIGHT ARMORED", - }, - [2] = { - def = "machinegun", - badTargetCategory = "LIGHT ARMORED", - }, - }, - customParams = { - death_sounds = "nuke", - RequireTech = "30 Power", - armortype = "armored", - supply_cost = 30, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 500 -local weapon2Damage = 12 - -local weaponDefs = { - tankkillerlaser = { - AreaOfEffect = 8, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.1, - beamWeapon = true, - coreThickness = 0.5, - duration = 0.2, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-large-purple", - fallOffRate = 1, - fireStarter = 100, - interceptedByShieldType = 4, - impulseFactor = 0.1, - lineOfSight = true, - minintensity = "1", - name = "Anti-Tank Laser", - range = 750, - reloadtime = 0.5, - WeaponType = "LaserCannon", - rgbColor = "0.2 0 0.5", - rgbColor2 = "0.8 0.8 0.8", - soundTrigger = true, - soundstart = "tankdestroyermaingunfire.wav", - texture1 = "pulseshot2", - texture2 = "empty", - thickness = 9, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "eextankdestroyer", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - machinegun = { - accuracy = 300, - AreaOfEffect = 8, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - beamTime = 0.1, - beamWeapon = true, - coreThickness = 0.5, - duration = 0.1, - energypershot = 0.6, - explosionGenerator = "custom:genericshellexplosion-small-red", - energypershot = weapon2Damage / 20, - fallOffRate = 1, - fireStarter = 50, - interceptedByShieldType = 4, - lineOfSight = true, - minintensity = "1", - name = "Machine Gun", - range = 750, - reloadtime = 0.1, - WeaponType = "LaserCannon", - rgbColor = "1 0.5 0", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "tankdestroyerfire.wav", - texture1 = "shot", - texture2 = "empty", - thickness = 5, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "eextankdestroyer", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon2Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehbot/mobile/ehbotfac.lua b/Units/ehbot/mobile/ehbotfac.lua new file mode 100644 index 000000000..535de8b8e --- /dev/null +++ b/Units/ehbot/mobile/ehbotfac.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- EHBOTFAC -- +-------------------------------------------------------------------------------- + +unitName = "ehbotfac" + +-------------------------------------------------------------------------------- + +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 + +humanName = [[H-Bot Factory]] + +objectName = "ehbotfac.s3o" +script = "ehbotfac.cob" + +hbotFactoryBuildList = Shared.buildListHbotFactory + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotfac_up1.lua b/Units/ehbot/mobile/ehbotfac_up1.lua new file mode 100644 index 000000000..ae47d6e66 --- /dev/null +++ b/Units/ehbot/mobile/ehbotfac_up1.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- EHBOTFAC_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotfac_up1" + +-------------------------------------------------------------------------------- + +buildCostMetal = 270 +maxDamage = buildCostMetal * 12.5 + +humanName = [[H-Bot Factory MK II]] + +objectName = "ehbotfac.s3o" +script = "ehbotfac.cob" + +hbotFactoryBuildList = Shared.buildListHbotFactory_up1 + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotfac_up2.lua b/Units/ehbot/mobile/ehbotfac_up2.lua new file mode 100644 index 000000000..7b1c1cc9b --- /dev/null +++ b/Units/ehbot/mobile/ehbotfac_up2.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- EHBOTFAC_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotfac_up2" + +-------------------------------------------------------------------------------- + +buildCostMetal = 510 +maxDamage = buildCostMetal * 12.5 + +humanName = [[H-Bot Factory MK III]] + +objectName = "ehbotfac.s3o" +script = "ehbotfac.cob" + +hbotFactoryBuildList = Shared.buildListHbotFactory_up2 + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotfac_up3.lua b/Units/ehbot/mobile/ehbotfac_up3.lua new file mode 100644 index 000000000..102f37c90 --- /dev/null +++ b/Units/ehbot/mobile/ehbotfac_up3.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- EHBOTFAC_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotfac_up3" + +-------------------------------------------------------------------------------- + +buildCostMetal = 750 +maxDamage = buildCostMetal * 12.5 + +humanName = [[H-Bot Factory MK IV]] + +objectName = "ehbotfac.s3o" +script = "ehbotfac.cob" + +hbotFactoryBuildList = Shared.buildListHbotFactory_up3 + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotfac_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotkarganneth.lua b/Units/ehbot/mobile/ehbotkarganneth.lua new file mode 100644 index 000000000..28d49450b --- /dev/null +++ b/Units/ehbot/mobile/ehbotkarganneth.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth -- +-------------------------------------------------------------------------------- + +unitName = "ehbotkarganneth" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Karganneth]] + +objectName = "ehbotkarganneth.s3o" +script = "ehbotkarganneth_lus.lua" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotkarganneth_up1.lua b/Units/ehbot/mobile/ehbotkarganneth_up1.lua new file mode 100644 index 000000000..c38a6e3fa --- /dev/null +++ b/Units/ehbot/mobile/ehbotkarganneth_up1.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotkarganneth_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Karganneth MK II]] + +objectName = "ehbotkarganneth.s3o" +script = "ehbotkarganneth_lus.lua" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotkarganneth_up2.lua b/Units/ehbot/mobile/ehbotkarganneth_up2.lua new file mode 100644 index 000000000..364948b8c --- /dev/null +++ b/Units/ehbot/mobile/ehbotkarganneth_up2.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotkarganneth_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Karganneth MK III]] + +objectName = "ehbotkarganneth.s3o" +script = "ehbotkarganneth_lus.lua" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotkarganneth_up3.lua b/Units/ehbot/mobile/ehbotkarganneth_up3.lua new file mode 100644 index 000000000..2b2a2a54b --- /dev/null +++ b/Units/ehbot/mobile/ehbotkarganneth_up3.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotkarganneth_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Karganneth MK IV]] + +objectName = "ehbotkarganneth.s3o" +script = "ehbotkarganneth_lus.lua" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotpeewee.lua b/Units/ehbot/mobile/ehbotpeewee.lua new file mode 100644 index 000000000..98df1b864 --- /dev/null +++ b/Units/ehbot/mobile/ehbotpeewee.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee -- +-------------------------------------------------------------------------------- + +unitName = "ehbotpeewee" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[A.K.]] + +objectName = "ehbotpeewee2.s3o" +script = "ehbotpeewee_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotpeewee_up1.lua b/Units/ehbot/mobile/ehbotpeewee_up1.lua new file mode 100644 index 000000000..ce06e4129 --- /dev/null +++ b/Units/ehbot/mobile/ehbotpeewee_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotpeewee_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[A.K. MK II]] + +objectName = "ehbotpeewee2.s3o" +script = "ehbotpeewee_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotpeewee_up2.lua b/Units/ehbot/mobile/ehbotpeewee_up2.lua new file mode 100644 index 000000000..22bad81a7 --- /dev/null +++ b/Units/ehbot/mobile/ehbotpeewee_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotpeewee_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[A.K. MK III]] + +objectName = "ehbotpeewee2.s3o" +script = "ehbotpeewee_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotpeewee_up3.lua b/Units/ehbot/mobile/ehbotpeewee_up3.lua new file mode 100644 index 000000000..f0c448a01 --- /dev/null +++ b/Units/ehbot/mobile/ehbotpeewee_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotpeewee_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[A.K. MK IV]] + +objectName = "ehbotpeewee2.s3o" +script = "ehbotpeewee_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotpeewee_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotrocko.lua b/Units/ehbot/mobile/ehbotrocko.lua new file mode 100644 index 000000000..04a144bb6 --- /dev/null +++ b/Units/ehbot/mobile/ehbotrocko.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud -- +-------------------------------------------------------------------------------- + +unitName = "ehbotrocko" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Rocko]] + +objectName = "ehbotrocko.s3o" +script = "ehbotrocko_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotrocko_up1.lua b/Units/ehbot/mobile/ehbotrocko_up1.lua new file mode 100644 index 000000000..6a113a322 --- /dev/null +++ b/Units/ehbot/mobile/ehbotrocko_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotrocko_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Rocko MKII]] + +objectName = "ehbotrocko.s3o" +script = "ehbotrocko_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotrocko_up2.lua b/Units/ehbot/mobile/ehbotrocko_up2.lua new file mode 100644 index 000000000..ac4994129 --- /dev/null +++ b/Units/ehbot/mobile/ehbotrocko_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotrocko_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Rocko MKIII]] + +objectName = "ehbotrocko.s3o" +script = "ehbotrocko_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotrocko_up3.lua b/Units/ehbot/mobile/ehbotrocko_up3.lua new file mode 100644 index 000000000..04b4ad076 --- /dev/null +++ b/Units/ehbot/mobile/ehbotrocko_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotrocko_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Rocko MK IV]] + +objectName = "ehbotrocko.s3o" +script = "ehbotrocko_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotrocko_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotsniper.lua b/Units/ehbot/mobile/ehbotsniper.lua new file mode 100644 index 000000000..5c7be5ba6 --- /dev/null +++ b/Units/ehbot/mobile/ehbotsniper.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper -- +-------------------------------------------------------------------------------- + +unitName = "ehbotsniper" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Sniper]] + +objectName = "ehbotsniper.s3o" +script = "ehbotsniper_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotsniper_u2.lua b/Units/ehbot/mobile/ehbotsniper_u2.lua new file mode 100644 index 000000000..fb970de2a --- /dev/null +++ b/Units/ehbot/mobile/ehbotsniper_u2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotsniper_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Sniper MK III]] + +objectName = "ehbotsniper.s3o" +script = "ehbotsniper_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotsniper_up1.lua b/Units/ehbot/mobile/ehbotsniper_up1.lua new file mode 100644 index 000000000..236ff6041 --- /dev/null +++ b/Units/ehbot/mobile/ehbotsniper_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotsniper_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Sniper MK II]] + +objectName = "ehbotsniper.s3o" +script = "ehbotsniper_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotsniper_up3.lua b/Units/ehbot/mobile/ehbotsniper_up3.lua new file mode 100644 index 000000000..d43c9f529 --- /dev/null +++ b/Units/ehbot/mobile/ehbotsniper_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotsniper_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Sniper MK IV]] + +objectName = "ehbotsniper.s3o" +script = "ehbotsniper_lus.lua" + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotsniper_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotthud.lua b/Units/ehbot/mobile/ehbotthud.lua new file mode 100644 index 000000000..5aea9389b --- /dev/null +++ b/Units/ehbot/mobile/ehbotthud.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud -- +-------------------------------------------------------------------------------- + +unitName = "ehbotthud" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Thud]] + +objectName = "ehbotthud.s3o" +script = "ehbotthud_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotthud_up1.lua b/Units/ehbot/mobile/ehbotthud_up1.lua new file mode 100644 index 000000000..74baf8bf7 --- /dev/null +++ b/Units/ehbot/mobile/ehbotthud_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotthud_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Thud MK II]] + +objectName = "ehbotthud.s3o" +script = "ehbotthud_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotthud_up2.lua b/Units/ehbot/mobile/ehbotthud_up2.lua new file mode 100644 index 000000000..e7127fd42 --- /dev/null +++ b/Units/ehbot/mobile/ehbotthud_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotthud_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Thud MK III]] + +objectName = "ehbotthud.s3o" +script = "ehbotthud_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/mobile/ehbotthud_up3.lua b/Units/ehbot/mobile/ehbotthud_up3.lua new file mode 100644 index 000000000..500aa6c68 --- /dev/null +++ b/Units/ehbot/mobile/ehbotthud_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ehbotthud_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Thud MK IV]] + +objectName = "ehbotthud.s3o" +script = "ehbotthud_lus.lua" + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotthud_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotkarganneth_turret.lua b/Units/ehbot/turret/ehbotkarganneth_turret.lua new file mode 100644 index 000000000..e2215360b --- /dev/null +++ b/Units/ehbot/turret/ehbotkarganneth_turret.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotkarganneth_turret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Karganneth (Deployed)]] + +objectName = [[ehbotkarganneth_turret.s3o]] +script = [[ehbotkarganneth_turret_lus.lua]] + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotkarganneth_turret_up1.lua b/Units/ehbot/turret/ehbotkarganneth_turret_up1.lua new file mode 100644 index 000000000..7932345ad --- /dev/null +++ b/Units/ehbot/turret/ehbotkarganneth_turret_up1.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_turret_up1 -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotkarganneth_turret_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Karganneth (Deployed) MK II]] + +objectName = [[ehbotkarganneth_turret.s3o]] +script = [[ehbotkarganneth_turret_lus.lua]] + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotkarganneth_turret_up2.lua b/Units/ehbot/turret/ehbotkarganneth_turret_up2.lua new file mode 100644 index 000000000..9e88bb5c7 --- /dev/null +++ b/Units/ehbot/turret/ehbotkarganneth_turret_up2.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_turret_up2 -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotkarganneth_turret_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Karganneth (Deployed) MK III]] + +objectName = [[ehbotkarganneth_turret.s3o]] +script = [[ehbotkarganneth_turret_lus.lua]] + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotkarganneth_turret_up3.lua b/Units/ehbot/turret/ehbotkarganneth_turret_up3.lua new file mode 100644 index 000000000..413109f39 --- /dev/null +++ b/Units/ehbot/turret/ehbotkarganneth_turret_up3.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth_turret_up3 -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotkarganneth_turret_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Karganneth (Deployed) MK IV]] + +objectName = [[ehbotkarganneth_turret.s3o]] +script = [[ehbotkarganneth_turret_lus.lua]] + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotkarganneth_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotpeewee_turret.lua b/Units/ehbot/turret/ehbotpeewee_turret.lua new file mode 100644 index 000000000..6c1b33433 --- /dev/null +++ b/Units/ehbot/turret/ehbotpeewee_turret.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotpeewee_turret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[A.K. (Deployed)]] + +objectName = [[ehbotpeewee_turret.s3o]] +script = [[ehbotpeewee_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotpeewee_turret_up1.lua b/Units/ehbot/turret/ehbotpeewee_turret_up1.lua new file mode 100644 index 000000000..aad9e5048 --- /dev/null +++ b/Units/ehbot/turret/ehbotpeewee_turret_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotpeewee_turret_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[A.K. Mk II (Deployed)]] + +objectName = [[ehbotpeewee_turret.s3o]] +script = [[ehbotpeewee_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotpeewee_turret_up2.lua b/Units/ehbot/turret/ehbotpeewee_turret_up2.lua new file mode 100644 index 000000000..3a61f66f7 --- /dev/null +++ b/Units/ehbot/turret/ehbotpeewee_turret_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotpeewee_turret_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[A.K. Mk III (Deployed)]] + +objectName = [[ehbotpeewee_turret.s3o]] +script = [[ehbotpeewee_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotpeewee_turret_up3.lua b/Units/ehbot/turret/ehbotpeewee_turret_up3.lua new file mode 100644 index 000000000..246f019fa --- /dev/null +++ b/Units/ehbot/turret/ehbotpeewee_turret_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotpeewee_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotpeewee_turret_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[A.K. Mk IV (Deployed)]] + +objectName = [[ehbotpeewee_turret.s3o]] +script = [[ehbotpeewee_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[6]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotpeewee_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotrocko_turret.lua b/Units/ehbot/turret/ehbotrocko_turret.lua new file mode 100644 index 000000000..b4480dad9 --- /dev/null +++ b/Units/ehbot/turret/ehbotrocko_turret.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotrocko_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotrocko_turret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Rocko (Deployed)]] + +objectName = [[ehbotrocko_turret.s3o]] +script = [[ehbotrocko_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotrocko_turret_up1.lua b/Units/ehbot/turret/ehbotrocko_turret_up1.lua new file mode 100644 index 000000000..394fd42f4 --- /dev/null +++ b/Units/ehbot/turret/ehbotrocko_turret_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotrocko_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotrocko_turret_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Rocko Mk II (Deployed)]] + +objectName = [[ehbotrocko_turret.s3o]] +script = [[ehbotrocko_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotrocko_turret_up2.lua b/Units/ehbot/turret/ehbotrocko_turret_up2.lua new file mode 100644 index 000000000..84c371c7a --- /dev/null +++ b/Units/ehbot/turret/ehbotrocko_turret_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotrocko_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotrocko_turret_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Rocko Mk III (Deployed)]] + +objectName = [[ehbotrocko_turret.s3o]] +script = [[ehbotrocko_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotrocko_turret_up3.lua b/Units/ehbot/turret/ehbotrocko_turret_up3.lua new file mode 100644 index 000000000..30aba9e33 --- /dev/null +++ b/Units/ehbot/turret/ehbotrocko_turret_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotrocko_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotrocko_turret_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Rocko Mk IV (Deployed)]] + +objectName = [[ehbotrocko_turret.s3o]] +script = [[ehbotrocko_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[15]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotrocko_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotsniper_turret.lua b/Units/ehbot/turret/ehbotsniper_turret.lua new file mode 100644 index 000000000..e4b45bc14 --- /dev/null +++ b/Units/ehbot/turret/ehbotsniper_turret.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotsniper_turret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Sniper (Deployed)]] + +objectName = [[ehbotsniper_turret.s3o]] +script = [[ehbotsniper_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotsniper_turret_up1.lua b/Units/ehbot/turret/ehbotsniper_turret_up1.lua new file mode 100644 index 000000000..4daf75d48 --- /dev/null +++ b/Units/ehbot/turret/ehbotsniper_turret_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotsniper_turret_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Sniper Mk II (Deployed)]] + +objectName = [[ehbotsniper_turret.s3o]] +script = [[ehbotsniper_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotsniper_turret_up2.lua b/Units/ehbot/turret/ehbotsniper_turret_up2.lua new file mode 100644 index 000000000..5fb323d85 --- /dev/null +++ b/Units/ehbot/turret/ehbotsniper_turret_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotsniper_turret_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Sniper Mk III (Deployed)]] + +objectName = [[ehbotsniper_turret.s3o]] +script = [[ehbotsniper_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotsniper_turret_up3.lua b/Units/ehbot/turret/ehbotsniper_turret_up3.lua new file mode 100644 index 000000000..ddae46628 --- /dev/null +++ b/Units/ehbot/turret/ehbotsniper_turret_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotsniper_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotsniper_turret_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Sniper Mk IV (Deployed)]] + +objectName = [[ehbotsniper_turret.s3o]] +script = [[ehbotsniper_turret_lus.lua]] + +tech = [[tech2]] +armortype = [[light]] +supply = [[9]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotsniper_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotthud_turret.lua b/Units/ehbot/turret/ehbotthud_turret.lua new file mode 100644 index 000000000..6274895b2 --- /dev/null +++ b/Units/ehbot/turret/ehbotthud_turret.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotthud_turret]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Thud (Deployed)]] + +objectName = [[ehbotthud_turret.s3o]] +script = [[ehbotthud_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotthud_turret_up1.lua b/Units/ehbot/turret/ehbotthud_turret_up1.lua new file mode 100644 index 000000000..ee6207a0c --- /dev/null +++ b/Units/ehbot/turret/ehbotthud_turret_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotthud_turret_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Thud Mk II (Deployed)]] + +objectName = [[ehbotthud_turret.s3o]] +script = [[ehbotthud_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotthud_turret_up2.lua b/Units/ehbot/turret/ehbotthud_turret_up2.lua new file mode 100644 index 000000000..c9068b1a2 --- /dev/null +++ b/Units/ehbot/turret/ehbotthud_turret_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotthud_turret_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Thud Mk III (Deployed)]] + +objectName = [[ehbotthud_turret.s3o]] +script = [[ehbotthud_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbot/turret/ehbotthud_turret_up3.lua b/Units/ehbot/turret/ehbotthud_turret_up3.lua new file mode 100644 index 000000000..a0ff7abba --- /dev/null +++ b/Units/ehbot/turret/ehbotthud_turret_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ehbotthud_turret -- +-------------------------------------------------------------------------------- + +unitName = [[ehbotthud_turret_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Thud Mk IV (Deployed)]] + +objectName = [[ehbotthud_turret.s3o]] +script = [[ehbotthud_turret_lus.lua]] + +tech = [[tech1]] +armortype = [[light]] +supply = [[7]] + +VFS.Include("Units-Configs-Basedefs/basedefs/hbot/turret/ehbotthud_turret_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/ehbotengineer.lua b/Units/ehbotengineer.lua new file mode 100644 index 000000000..1fabe17d4 --- /dev/null +++ b/Units/ehbotengineer.lua @@ -0,0 +1,130 @@ +-- UNITDEF -- EHBOTENGINEER -- +-------------------------------------------------------------------------------- + +local unitName = "ehbotengineer" + +-------------------------------------------------------------------------------- + +local buildCostMetal = 40 +local maxDamage = 400 +local buildDistance = 350 + +local armortype = [[light]] +--local supply = [[2]] + + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + + acceleration = 1, + brakeRate = 0.24, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + footprintX = 2, + footprintZ = 2, + iconType = "engineer", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = maxDamage, + maxSlope = 90, + maxVelocity = 4.5, + maxReverseVelocity = 1, + maxWaterDepth = 10, + metalmake = 0, + metalStorage = 0, + movementClass = "HOVERHBOT2", + moveState = "2", + name = "The Lifter", + objectName = "ehbotengineer2.s3o", + script = "ehbotengineer_lus.lua", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = false, + side = "ARM", + sightDistance = 500, + smoothAnim = true, + stealth = true, + seismicSignature = 2, + -- turnInPlace = false, + turnInPlace = true, + turnRate = 5000, + -- turnrate = 1020, + unitname = unitName, + upright = true, + workerTime = 1, + capturespeed = 1, + TerraformSpeed = 2147000, + ReclaimSpeed = 0, + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildList, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + ProvideTech = [[tech0]], + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, + noenergycost = true, +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + factionname = "ateran", + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehbotengineer_turret.lua b/Units/ehbotengineer_turret.lua new file mode 100644 index 000000000..cbff6d4e9 --- /dev/null +++ b/Units/ehbotengineer_turret.lua @@ -0,0 +1,128 @@ +-- UNITDEF -- EHBOTENGINEER_turret -- +-------------------------------------------------------------------------------- + +local unitName = "ehbotengineer_turret" + +-------------------------------------------------------------------------------- + +local buildCostMetal = 90 +local maxDamage = 400 +local buildDistance = 800 + +local armortype = [[light]] +--local supply = [[2]] + +local unitDef = { + + --mobileunit + transportbyenemy = false; + + --** + + + acceleration = 1, + brakeRate = 0.24, + buildCostEnergy = 0, + buildCostMetal = buildCostMetal, + buildDistance = buildDistance, + builder = true, + buildTime = 5, + CanAttack = false, + CanAssist = true, + canBeAssisted = true, + CanCapture = false, + CanRepair = true, + canRestore = false, + cantBeTransported = true, + canGuard = true, + canHover = true, + canMove = true, + canPatrol = true, + canreclaim = true, + canstop = true, + category = "LIGHT NOTAIR SUPPORT", + description = [[Builds Units]], + energyMake = 0, + energyStorage = 0, + energyUse = 0, + explodeAs = "mediumExplosionGenericGreen", + floater = true, + footprintX = 2, + footprintZ = 2, + iconType = "engineer", + idleAutoHeal = .5, + idleTime = 2200, + levelground = true, + maxDamage = maxDamage, + maxSlope = 26, + maxVelocity = 0.001, + maxReverseVelocity = 0.001, + maxWaterDepth = 5000, + metalmake = 0, + metalStorage = 0, + movementClass = "HOVERHBOT2", + moveState = "0", + pushResistant = true, + name = "The Lifter Turret", + objectName = "ehbotengineer_turret.s3o", + script = "ehbotengineer_turret_lus.lua", + radarDistance = 0, + repairable = false, + selfDestructAs = "mediumExplosionGenericGreen", + showNanoSpray = false, + side = "ARM", + sightDistance = buildDistance, + smoothAnim = true, + stealth = false, + seismicSignature = 2, + -- turnInPlace = false, + turnInPlace = true, + turnRate = 0.001, + -- turnrate = 1020, + unitname = unitName, + upright = true, + workerTime = 1, + capturespeed = 1, + TerraformSpeed = 100000, + ReclaimSpeed = 0, + repairspeed = 0.5, + sfxtypes = { + pieceExplosionGenerators = { + "deathceg3", + "deathceg4", + }, + + explosiongenerators = { + "custom:nanoorb", + "custom:emptydirt", + "custom:blacksmoke", + }, + }, + buildoptions = Shared.buildListTurret, + sounds = { + underattack = "other/unitsunderattack1", + ok = { + "ack", + }, + select = { + "unitselect", + }, + }, + customParams = { + unittype = "mobile", + area_mex_def = "emetalextractor", + canbetransported = "true", + needed_cover = 1, + death_sounds = "generic", + armortype = armortype, +-- supply_cost = supply, + normaltex = "unittextures/lego2skin_explorernormal.dds", + buckettex = "unittextures/lego2skin_explorerbucket.dds", + }, +} + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eaatank.lua b/Units/ehover/eaatank.lua deleted file mode 100644 index aeafeebe3..000000000 --- a/Units/ehover/eaatank.lua +++ /dev/null @@ -1,181 +0,0 @@ --- UNITDEF -- EAATANK -- --------------------------------------------------------------------------------- - -local unitName = "eaatank" - --------------------------------------------------------------------------------- - - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - bmcode = "1", - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 28, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR SUPPORT", - corpse = "ammobox", - defaultmissiontype = "Standby", - description = [[Anti-Air Support Tank -Armored -105 Damage vs Armored -70 Damage vs Light/Building - -• Fires 4 missiles in a burst - -Requires +5 Power -Uses +5 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "smallExplosionGeneric", - firestandorders = "1", - footprintX = 4, - footprintZ = 4, - iconType = "aa", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 600, - maxSlope = 26, - maxVelocity = 2.9, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - mobilestandorders = "1", - movementClass = "HOVERTANK4", - name = "Spewer", - noAutoFire = false, - noChaseCategory = "VTOL AMPHIB NOTAIR SUPPORT", - objectName = "eaatank2.s3o", - script = "eaatank2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "smallExplosionGeneric", - sightDistance = 750, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 2.9, - turnRate = 1000, --- turnrate = 430, - tolerance = 1000, - unitname = "eaatank", - upright = true, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:dirt", - "custom:gdhcannon", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "eaatankantiairmissile", - onlytargetcategory = "VTOL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 5, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[The spewer is the only dedicated mobile Anti-Air tank in Evolution RTS. It's range is quite limited, so make sure to bring along some scouts for the additional line of sight distance. Very large area of effect.]], - }, -} - - --------------------------------------------------------------------------------- - -local weapon1Damage = 105 - -local weaponDefs = { - eaatankantiairmissile = { - AreaOfEffect = 50, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - burst = 4, - burstrate = 0.5, - cegTag = "missiletrailaa", - canAttackGround = false, - edgeEffectiveness = 0.5, - explosionGenerator = "custom:BulletImpact3", - energypershot = weapon1Damage / 20, - fireStarter = 80, - impulseFactor = 0, - interceptedByShieldType = 4, - model = "missilesmall.s3o", - name = "AA Missile", - pitchtolerance = 3000, - range = 1000, - reloadtime = 4, - weaponType = "MissileLauncher", - soundHit = "mediumcannonhit.wav", - soundStart = "missilefiring.wav", - tolerance = 3000, - turret = true, - toairweapon = true, - startVelocity = 750, - acceleration = 2000, - weaponVelocity = 10000, - tracks = true, - turnrate = 100000, - flighttime = 2, - sprayangle = 5000, - - customparams = { - damagetype = "eaatank", - nofriendlyfire = 1, - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank.lua b/Units/ehover/eartytank.lua index 637927010..6f312f6e3 100644 --- a/Units/ehover/eartytank.lua +++ b/Units/ehover/eartytank.lua @@ -1,163 +1,26 @@ -- UNITDEF -- EARTYTANK -- -------------------------------------------------------------------------------- -local unitName = "eartytank" +unitName = "eartytank" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = "ShadowFury" ---** +objectName = "eartytank2.s3o" +script = "eartytank2.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[8]] - acceleration = 1, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 36, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR SUPPORT", - corpse = "ammobox", - description = [[Artillery Support Tank -Light -1000 Damage vs Buildings (Per Volley) -250 Damage vs Light/Armored (Per Volley) +VFS.Include("units-configs-basedefs/basedefs/hover/eartytank_basedef.lua") -Requires +8 Power -Uses +8 Supply]], - energyMake = 0.5, - energyStorage = 0, - energyUse = 0.5, - explodeAs = "mediumExplosionGeneric", - footprintX = 3, - footprintZ = 3, - highTrajectory = 2, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 300, - maxVelocity = 2.3, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK3", - name = "ShadowFury", --Because he was the first one to get the "Lobster" pun - noChaseCategory = "VTOL", - objectName = "eartytank2.s3o", - script = "eartytank2.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGeneric", - side = "CORE", - sightDistance = 1500, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 2.3, - turnRate = 1000, --- turnrate = 250, - unitname = "eartytank", - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "Artilleryweapon", - onlyTargetCategory = "BUILDING", - }, - }, - customParams = { - canareaattack="1", - needed_cover = 3, - death_sounds = "generic", - RequireTech = "8 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 8, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 - -local weaponDefs = { - Artilleryweapon = { - badTargetCategory = [[ARMORED LIGHT]], - accuracy = 500, - AreaOfEffect = 50, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "artyshot2", - avoidNeutral = false, - explosionGenerator = "custom:genericshellexplosion-large", - energypershot = weapon1Damage / 20, - id = 59, - impulse = "0", - impulseFactor = 0, - interceptedByShieldType = 4, - minbarrelangle = "-25", - name = "Plasma Cannon", - range = 1500, - reloadtime = 5, - weaponType = "Cannon", - soundHit = "artyhit.wav", - soundStart = "arty2.wav", - startsmoke = "1", - turret = true, - weaponVelocity = 500, - customparams = { - damagetype = "eartytank", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_saturation.lua b/Units/ehover/eartytank_saturation.lua new file mode 100644 index 000000000..094936c25 --- /dev/null +++ b/Units/ehover/eartytank_saturation.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_saturation -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_saturation" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "HellFury" + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytanksaturation_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_saturation_up1.lua b/Units/ehover/eartytank_saturation_up1.lua new file mode 100644 index 000000000..b87fe493d --- /dev/null +++ b/Units/ehover/eartytank_saturation_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_saturation_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_saturation_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = "HellFury MK II" + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytanksaturation_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_saturation_up2.lua b/Units/ehover/eartytank_saturation_up2.lua new file mode 100644 index 000000000..7b66a81ae --- /dev/null +++ b/Units/ehover/eartytank_saturation_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_saturation_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_saturation_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = "HellFury MK III" + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytanksaturation_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_saturation_up3.lua b/Units/ehover/eartytank_saturation_up3.lua new file mode 100644 index 000000000..8e652a24c --- /dev/null +++ b/Units/ehover/eartytank_saturation_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_saturation_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_saturation_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = "HellFury MK IV" + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytanksaturation_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_up1.lua b/Units/ehover/eartytank_up1.lua new file mode 100644 index 000000000..dcb249d54 --- /dev/null +++ b/Units/ehover/eartytank_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[ShadowFury Mark II]] + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_up2.lua b/Units/ehover/eartytank_up2.lua new file mode 100644 index 000000000..7afe4d0aa --- /dev/null +++ b/Units/ehover/eartytank_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[ShadowFury Mark III]] + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eartytank_up3.lua b/Units/ehover/eartytank_up3.lua new file mode 100644 index 000000000..948c49a25 --- /dev/null +++ b/Units/ehover/eartytank_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EARTYTANK_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eartytank_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[ShadowFury Mark IV]] + +objectName = "eartytank2.s3o" +script = "eartytank2.cob" + +tech = [[tech0]] +armortype = [[light]] +supply = [[8]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eartytank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/ebasefactory.lua b/Units/ehover/ebasefactory.lua index 387ab64ad..13b4d3f97 100644 --- a/Units/ehover/ebasefactory.lua +++ b/Units/ehover/ebasefactory.lua @@ -1,111 +1,23 @@ -- UNITDEF -- EBASEFACTORY -- -------------------------------------------------------------------------------- -local unitName = "ebasefactory" +unitName = "ebasefactory" -------------------------------------------------------------------------------- -local unitDef = { +buildCostMetal = 60 +maxDamage = buildCostMetal * 12.5 - activatewhenbuilt = false, - buildAngle = 1024, - buildCostEnergy = 0, - buildCostMetal = 60, - builder = true, - buildTime = 5, - canAttack = false, - canBeAssisted = true, - canGuard = true, - canMove = true, - canPatrol = true, - canReclaim = false, - canstop = true, - category = "BUILDING NOTAIR", - corpse = "ammobox", - description = [[Place generators near this factory to unlock higher tier units]], - energyStorage = 0, - energyUse = 0, - energyMake = 0, - explodeAs = "MEXPOP2", - footprintX = 20, - footprintZ = 20, - floater = true, - iconType = "factory", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 1500, - maxSlope = 25, - maxWaterDepth = 99999999999, - metalStorage = 0, - metalMake = 0, - name = "Hovertank Factory", - objectName = "ehoverfactory.s3o", - script = "ehoverfac.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "LARGE_BUILDING", - showNanoSpray = "0", - side = "CORE", - sightDistance = 388, - smoothAnim = true, - TEDClass = "PLANT", - unitname = "ebasefactory", --- unitRestricted = 1, - workerTime = 1, - yardMap = "ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo ooooooyyyyyyyyoooooo", --- usePieceCollisionVolumes = true, --- modelCenterOffset = {108, 10, 0}, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +humanName = "Hover Factory" +objectName = "ehoverfactory.s3o" +script = "ehoverfac.cob" - explosiongenerators = { - "custom:nanoorb", - "custom:nano", - "custom:blacksmoke", - "custom:fusionreactionbasic", - }, - }, - buildoptions = { - "eengineer5", --new - "elighttank3", --new --- "eflametank", --new - "eriottank2", --new --- "emediumtank3", --new - "eheavytank3", --new - "emissiletank", --new - "eaatank", --- "efatso2", --new - "eartytank", --new - "ebomb", - }, - sounds = { - underattack = "unitsunderattack1", - select = { - "gdfactoryselect", - }, - }, - weapons = { - }, - customParams = { - death_sounds = "generic", - armortype = "building", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[The hovertank factory is the most robust of all the technology avenues in Evolution RTS. Unlike their amphibious and all-terrain counterparts, the Hover Factory does not possess any innate traits, but the larger selection of units makes up for the lack of innate abilities.]], - }, - useBuildingGroundDecal = true, - BuildingGroundDecalType = "factorygroundplate.dds", - BuildingGroundDecalSizeX = 26, - BuildingGroundDecalSizeY = 26, - BuildingGroundDecalDecaySpeed = 0.9, -} +hoverFactoryBuildList = Shared.buildListHoverFactory + +VFS.Include("units-configs-basedefs/basedefs/hover/ebasefactory_basedef.lua") -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/ebasefactory_up1.lua b/Units/ehover/ebasefactory_up1.lua new file mode 100644 index 000000000..ba5092df2 --- /dev/null +++ b/Units/ehover/ebasefactory_up1.lua @@ -0,0 +1,23 @@ +-- UNITDEF -- EBASEFACTORY_up1 -- +-------------------------------------------------------------------------------- + +unitName = "ebasefactory_up1" + +-------------------------------------------------------------------------------- + +buildCostMetal = 270 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Hover Factory Mark II]] +objectName = "ehoverfactory.s3o" +script = "ehoverfac.cob" + +hoverFactoryBuildList = Shared.buildListHoverFactory_up1 + +VFS.Include("units-configs-basedefs/basedefs/hover/ebasefactory_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/ebasefactory_up2.lua b/Units/ehover/ebasefactory_up2.lua new file mode 100644 index 000000000..7c3a68109 --- /dev/null +++ b/Units/ehover/ebasefactory_up2.lua @@ -0,0 +1,23 @@ +-- UNITDEF -- EBASEFACTORY_up2 -- +-------------------------------------------------------------------------------- + +unitName = "ebasefactory_up2" + +-------------------------------------------------------------------------------- + +buildCostMetal = 510 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Hover Factory Mark III]] +objectName = "ehoverfactory.s3o" +script = "ehoverfac.cob" + +hoverFactoryBuildList = Shared.buildListHoverFactory_up2 + +VFS.Include("units-configs-basedefs/basedefs/hover/ebasefactory_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/ebasefactory_up3.lua b/Units/ehover/ebasefactory_up3.lua new file mode 100644 index 000000000..35ebef3f8 --- /dev/null +++ b/Units/ehover/ebasefactory_up3.lua @@ -0,0 +1,23 @@ +-- UNITDEF -- EBASEFACTORY_up3 -- +-------------------------------------------------------------------------------- + +unitName = "ebasefactory_up3" + +-------------------------------------------------------------------------------- + +buildCostMetal = 750 +maxDamage = buildCostMetal * 12.5 + +humanName = [[Hover Factory Mark IV]] +objectName = "ehoverfactory.s3o" +script = "ehoverfac.cob" + +hoverFactoryBuildList = Shared.buildListHoverFactory_up3 + +VFS.Include("units-configs-basedefs/basedefs/hover/ebasefactory_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/ebomb.lua b/Units/ehover/ebomb.lua deleted file mode 100644 index 0c1416b70..000000000 --- a/Units/ehover/ebomb.lua +++ /dev/null @@ -1,159 +0,0 @@ --- UNITDEF -- EBOMB -- --------------------------------------------------------------------------------- - -local unitName = "ebomb" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - acceleration = 1, - brakeRate = 1, - buildCostEnergy = 0, - buildCostMetal = 35, - builder = false, - buildTime = 5, - canAttack = true, - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR", - description = [[Hovering Bomb -Armored -500 Damage vs Buildings -250 Damage vs Light/Armored - -Requires +12 Power -Uses +12 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "ebombboom", - footprintX = 3, - footprintZ = 3, - iconType = "assault", - idleAutoHeal = .5, - idleTime = 2200, - kamikaze = true, - kamikazeDistance = 100, - leaveTracks = false, - maxDamage = 160, - maxSlope = 26, - maxVelocity = 10, - maxReverseVelocity = 5, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK3", - name = "Shellshock", - noChaseCategory = "VTOL", - objectName = "ebomb2.s3o", - script = "ebomb2.cob", - onlytargetcategory1 = "NOTAIR", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "ebombboom", - selfDestructCountdown = 0, - side = "CORE", - sightDistance = 175, - smoothAnim = true, - stealth = true, - turnInPlace = false, - turnRate = 1000, - unitname = "ebomb", - upright = true, - workerTime = 0, - -sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - explosiongenerators = { - "custom:dirt", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "ebombboom", - onlyTargetCategoy = "BUILDING", - badTargetCategory = "WALL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "12 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 12, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - --------------------------------------------------------------------------------- - -local weaponDefs = { - ebombboom = { - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - edgeeffectiveness = 0.5, - name="hoverbomb", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=100, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=1000, - soundstart="unitexplodemedium.wav", - soundhit="unitexplodemedium.wav", - explosiongenerator="custom:ebombexpl", - customparams = { - damagetype = "ebomb", - nofriendlyfire = "true", - nofriendlyfire = "1", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - - damage = { - default = 500, - }, - }, -} -unitDef.weaponDefs = weaponDefs - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/eengineer5.lua b/Units/ehover/eengineer5.lua deleted file mode 100644 index 8435439cc..000000000 --- a/Units/ehover/eengineer5.lua +++ /dev/null @@ -1,141 +0,0 @@ --- UNITDEF -- EENGINEER5 -- --------------------------------------------------------------------------------- - -local unitName = "eengineer5" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.24, - buildCostEnergy = 0, - buildCostMetal = 40, - buildDistance = 800, - builder = true, - buildTime = 5, - CanAttack = false, - CanAssist = true, - canBeAssisted = true, - CanCapture = false, - CanRepair = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "LIGHT NOTAIR SUPPORT", - description = [[Engineer -Light]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - footprintX = 4, - footprintZ = 4, - iconType = "engineer", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 600, - maxSlope = 26, - maxVelocity = 3, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalmake = 0, - metalStorage = 0, - movementClass = "HOVERTANK4", - moveState = "2", - name = "The Erector", - objectName = "eengineer6.s3o", - script = "eengineer6.cob", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - showNanoSpray = "0", - side = "ARM", - sightDistance = 500, - smoothAnim = true, - stealth = false, - -- turnInPlace = false, - turnRate = 1000, --- turnrate = 1020, - unitname = "eengineer5", - upright = true, - workerTime = 1, - capturespeed = 1, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - repairspeed = 0.15625, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:nanoorb", - "custom:dirt", - "custom:blacksmoke", - }, - }, - buildoptions = { - "eminifac", --new - "ebasefactory", --new - "eamphibfac", - "eairplant", - "eexperimentalfac", - "emetalextractor", --new - "emaker", --new - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ekmar", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - "euwturret", - "elrpc", - "eshieldgen", - "esilo", - "emine", - "eorb", - "ecommander", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - dronespawner = "1", - armortype = "light", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[The Erector can build new structures, reclaim features, turn energy cores into gunship drones, and capture enemy units. Upon it's death, it emits a wave of nanoparticles that will repair 100 hitpoints to any units in proximity]], - }, -} - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/efatso2.lua b/Units/ehover/efatso2.lua deleted file mode 100644 index 137fb790f..000000000 --- a/Units/ehover/efatso2.lua +++ /dev/null @@ -1,164 +0,0 @@ --- UNITDEF -- EFATSO2 -- --------------------------------------------------------------------------------- - -local unitName = "efatso2" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 24, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR ASSAULT", - corpse = "ammobox", - description = [[Armored Dedicated Anti-Base Tank -Armored -350 Damage vs Building -43.75 Damage vs Light/Armored - -This unit can only fire at buildings! - -Requires +10 Power -Uses +10 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericWhite", - footprintX = 5, - footprintZ = 5, - iconType = "hover", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 2500, - maxSlope = 26, - maxVelocity = 2.5, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK5", - name = "Fatso", - noChaseCategory = "VTOL", - objectName = "efatso2.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericWhite", - side = "CORE", - sightDistance = 800, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 2.2, - turnRate = 1000, --- turnRate = 1000, - unitname = "efatso2", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "eheavyturretweapon", - onlyTargetCategory = "BUILDING", - }, - [2] = { - def = "eheavyturretweapon", - onlyTargetCategory = "BUILDING", - slaveTo = 1, - }, - }, - customParams = { - needed_cover = 5, - death_sounds = "generic", - RequireTech = "5 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 5, - normalstex = "unittextures/efatso2normal.png", - helptext = [[The Fatso is the pinnacle of anti-base technology. It has enough hitpoints to allow it to take a beating and keep barreling down upon base structures and defenses, however, this amazing power comes at a cost. It is incapable of properly defending itself as it's weapon is slow to recharge and it simply is too slow to outmaneuver skirmish units. Bring an escort.]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 350 - -local weaponDefs = { - eheavyturretweapon = { - badTargetCategory = [[ARMORED LIGHT]], - accuracy = 1, - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "factorysparks", - collideFriendly = false, - explosionGenerator = "custom:genericshellexplosion-medium-white", - energypershot = weapon1Damage / 20, - id = 71, - interceptedByShieldType = 4, - impulse = "0", - impulseBoost = 0, - impulseFactor = 0, - name = "Plasma Cannon", - range = 750, - reloadtime = 1.25, - weaponType = "Cannon", - soundHit = "eturrethit.wav", - soundStart = "eturretfire.wav", - tolerance = 5000, - startsmoke = "1", - turret = true, - weaponVelocity = 315, - customparams = { - damagetype = "efatso", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/eflametank.lua b/Units/ehover/eflametank.lua deleted file mode 100644 index 74049e968..000000000 --- a/Units/ehover/eflametank.lua +++ /dev/null @@ -1,167 +0,0 @@ --- UNITDEF -- EFLAMETANK -- --------------------------------------------------------------------------------- - -local unitName = "eflametank" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 25, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR RAID", - corpse = "ammobox", - description = [[Flamethrower Raider -Light -200 Damage/s vs Buildings -100 Damage/s vs Light/Armored - -Energy Drain: 12.5/s - -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericRed", - footprintX = 3, - footprintZ = 3, - iconType = "hover", - idleAutoHeal = .5, - idleTime = 2200, - maxDamage = 400, - maxSlope = 26, - maxVelocity = 5, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK3", - name = "Firestorm", - noChaseCategory = "VTOL", - objectName = "eflametank.s3o", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericRed", - side = "CORE", - sightDistance = 750, - seismicDistance = 500, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 5, - turnRate = 1000, --- turnrate = 950, - unitname = "eflametank", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:dirt", - "custom:flamethrowerrange500", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "lightlaser", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "ARMORED LIGHT WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/eflametanknormal.png", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 25 - -local weaponDefs = { - lightlaser = { - badTargetCategory = [[LIGHT]], - accuracy = 0, - AreaOfEffect = 1, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - explosionGenerator = "custom:burnblack", - coreThickness = 0, - duration = 1, - energypershot = weapon1Damage / 20, - fallOffRate = 1, - fireStarter = 50, - interceptedByShieldType = 4, - soundstart = "flamethrower1.wav", - lineOfSight = true, - minintensity = 1, - impulseFactor = 0, - name = "Something with Flames", - range = 500, - reloadtime = 0.1, - WeaponType = [[LaserCannon]], - rgbColor = "0 0 0", - rgbColor2 = "0 0 0", - thickness = 0, - tolerance = 1000, - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "eflametank", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/eheavytank3.lua b/Units/ehover/eheavytank3.lua index d414bf372..6f9c0d8d9 100644 --- a/Units/ehover/eheavytank3.lua +++ b/Units/ehover/eheavytank3.lua @@ -1,162 +1,26 @@ -- UNITDEF -- EHEAVYTANK3 -- -------------------------------------------------------------------------------- -local unitName = "eheavytank3" +unitName = "eheavytank3" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = "Crusher" ---** +objectName = "eheavytank4.s3o" +script = "eheavytank4_lus.lua" +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] - acceleration = 1, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 29, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR SKIRMISHER", - corpse = "ammobox", - description = [[Armored Tank Destroyer -Armored -150 Damage vs Light/Armored -75 Damage vs Building - -Requires +4 Power -Uses +4 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGenericRed", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 450, - maxSlope = 26, - maxVelocity = 3.5, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK4", - name = "Crusher", - noChaseCategory = "VTOL", - objectName = "eheavytank4.s3o", - script = "eheavytank4_lus.lua", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGenericRed", - side = "CORE", - sightDistance = 650, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 2.8, - turnRate = 1000, --- turnrate = 350, - unitname = "eheavytank3", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "heavytankweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING WALL", - }, - }, - customParams = { - needed_cover = 3, - death_sounds = "generic", - RequireTech = "4 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 4, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 150 - -local weaponDefs = { - heavytankweapon = { - badTargetCategory = [[BUILDING]], - accuracy = 200, - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "antiassualtshot2", - explosionGenerator = "custom:genericshellexplosion-medium", - energypershot = weapon1Damage / 20, - id = 172, - impulseFactor = 0, - interceptedByShieldType = 4, - name = "Light Cannon", - range = 650, - reloadtime = 1, - weaponType = "Cannon", - soundHit = "42024_digifishmusic_Missile_Strike.wav", - soundStart = "triotfire.wav", - startsmoke = "1", - tolerance = 2000, - turret = true, - weaponVelocity = 800, - customparams = { - damagetype = "eheavytank3", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} +VFS.Include("units-configs-basedefs/basedefs/hover/eheavytank3_basedef.lua") + unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/eheavytank3_up1.lua b/Units/ehover/eheavytank3_up1.lua new file mode 100644 index 000000000..f98ffc8d6 --- /dev/null +++ b/Units/ehover/eheavytank3_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EHEAVYTANK3_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eheavytank3_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Crusher Mark II]] + +objectName = "eheavytank4.s3o" +script = "eheavytank4_lus.lua" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eheavytank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eheavytank3_up2.lua b/Units/ehover/eheavytank3_up2.lua new file mode 100644 index 000000000..2c0f5d0b1 --- /dev/null +++ b/Units/ehover/eheavytank3_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EHEAVYTANK3_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eheavytank3_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Crusher Mark III]] + +objectName = "eheavytank4.s3o" +script = "eheavytank4_lus.lua" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eheavytank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eheavytank3_up3.lua b/Units/ehover/eheavytank3_up3.lua new file mode 100644 index 000000000..16e85e625 --- /dev/null +++ b/Units/ehover/eheavytank3_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EHEAVYTANK3_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eheavytank3_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Crusher Mark IV]] + +objectName = "eheavytank4.s3o" +script = "eheavytank4_lus.lua" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/hover/eheavytank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elacerator.lua b/Units/ehover/elacerator.lua new file mode 100644 index 000000000..2253f2383 --- /dev/null +++ b/Units/ehover/elacerator.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- elacerator -- +-------------------------------------------------------------------------------- + +unitName = "elacerator" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Lacerator" + +objectName = "elacerator.s3o" +script = "elacerator.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[25]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elacerator_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elacerator_up1.lua b/Units/ehover/elacerator_up1.lua new file mode 100644 index 000000000..767964bc9 --- /dev/null +++ b/Units/ehover/elacerator_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- elacerator_up1 -- +-------------------------------------------------------------------------------- + +unitName = "elacerator_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Lacerator Mark II]] + +objectName = "elacerator.s3o" +script = "elacerator.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[25]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elacerator_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elacerator_up2.lua b/Units/ehover/elacerator_up2.lua new file mode 100644 index 000000000..0d8183d22 --- /dev/null +++ b/Units/ehover/elacerator_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- elacerator_up2 -- +-------------------------------------------------------------------------------- + +unitName = "elacerator_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Lacerator Mark III]] + +objectName = "elacerator.s3o" +script = "elacerator.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[25]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elacerator_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elacerator_up3.lua b/Units/ehover/elacerator_up3.lua new file mode 100644 index 000000000..c4602eb27 --- /dev/null +++ b/Units/ehover/elacerator_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- elacerator_up3 -- +-------------------------------------------------------------------------------- + +unitName = "elacerator_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Lacerator Mark IV]] + +objectName = "elacerator.s3o" +script = "elacerator.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[25]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elacerator_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elighttank3.lua b/Units/ehover/elighttank3.lua index 65357fb55..6acd89a19 100644 --- a/Units/ehover/elighttank3.lua +++ b/Units/ehover/elighttank3.lua @@ -1,164 +1,26 @@ -- UNITDEF -- ELIGHTTANK3 -- -------------------------------------------------------------------------------- -local unitName = "elighttank3" +unitName = [[elighttank3]] -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[Kite]] ---** +objectName = [[elighttank4.s3o]] +script = [[elighttank3_lus.lua]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 27, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR RAID", - corpse = "ammobox", - description = [[Raider -Light -43 Damage vs Light/Armored/Building +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "smallExplosionGenericBlue", - footprintX = 2, - footprintZ = 2, - iconType = "raider", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 250, - maxSlope = 26, - maxVelocity = 5, - maxReverseVelocity = 2, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK2", - name = "Kite", - noChaseCategory = "VTOL", - objectName = "elighttank4.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "smallExplosionGenericBlue", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - seismicDistance = 500, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 5.5, - turnRate = 1000, --- turnrate = 475, - unitname = "elighttank3", - upright = true, - workerTime = 0, +VFS.Include("units-configs-basedefs/basedefs/hover/elighttank3_basedef.lua") -sfxtypes = { - explosiongenerators = { - "custom:electricity", - "custom:dirt", - "custom:blacksmoke", - }, - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, -}, - - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "lighttankweapon", - badTargetCategory = "VTOL ARMORED WALL", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- - -local weapon1Damage = 43 - -local weaponDefs = { - lighttankweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:genericshellexplosion-medium-lightning", - energypershot = weapon1Damage / 20, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - name = "elighttank3weapon", - noSelfDamage = true, - range = 500, - reloadtime = 1, - WeaponType = "LightningCannon", - rgbColor = "0.1 0.2 0.5", - rgbColor2 = "0 0 1", - soundStart = "jacobs.wav", - startsmoke = "1", - texture1 = "lightning", - thickness = 5, - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "elighttank3", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/elighttank3_up1.lua b/Units/ehover/elighttank3_up1.lua new file mode 100644 index 000000000..00dbf97a6 --- /dev/null +++ b/Units/ehover/elighttank3_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ELIGHTTANK3_up1 -- +-------------------------------------------------------------------------------- + +unitName = "elighttank3_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Kite Mark II]] + +objectName = "elighttank4.s3o" +script = "elighttank3_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elighttank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elighttank3_up2.lua b/Units/ehover/elighttank3_up2.lua new file mode 100644 index 000000000..71de025da --- /dev/null +++ b/Units/ehover/elighttank3_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ELIGHTTANK3_up2 -- +-------------------------------------------------------------------------------- + +unitName = "elighttank3_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Kite Mark III]] + +objectName = "elighttank4.s3o" +script = "elighttank3_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elighttank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/elighttank3_up3.lua b/Units/ehover/elighttank3_up3.lua new file mode 100644 index 000000000..48e1906c5 --- /dev/null +++ b/Units/ehover/elighttank3_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ELIGHTTANK3_up3 -- +-------------------------------------------------------------------------------- + +unitName = "elighttank3_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Kite Mark IV]] + +objectName = "elighttank4.s3o" +script = "elighttank3_lus.lua" + +tech = [[tech0]] +armortype = [[light]] +supply = [[3]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elighttank3_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/emediumtank3.lua b/Units/ehover/emediumtank3.lua deleted file mode 100644 index 73c6d0510..000000000 --- a/Units/ehover/emediumtank3.lua +++ /dev/null @@ -1,156 +0,0 @@ --- UNITDEF -- EMEDIUMTANK3 -- --------------------------------------------------------------------------------- - -local unitName = "emediumtank3" - --------------------------------------------------------------------------------- - -local unitDef = { - ---mobileunit - transportbyenemy = false; - ---** - - - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 27, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR SKIRMISHER", - corpse = "ammobox", - description = [[Light Tank Destroyer -Light -200 Damage vs Armored -100 Damage vs Light/Building - -Requires +4 Power -Uses +4 supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGeneric", - footprintX = 3, - footprintZ = 3, - iconType = "hover", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 450, - maxSlope = 26, - maxVelocity = 4.0, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK3", - name = "Bruiser", - noChaseCategory = "VTOL", - objectName = "emediumtank3.s3o", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGeneric", - side = "CORE", - sightDistance = 600, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 4, - turnRate = 1000, --- turnrate = 430, - unitname = "emediumtank3", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "mediumtankcannon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "4 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 4, - normalstex = "unittextures/emediumtank3normal.png", - helptext = [[The brusier is a lightly armored tank destroyer, excellent versus raiders and other light units. Pair with light raiders and heavy tank destroyers for best results. - - It's description is a bit deceptive if you read it incorrectly. In truth, it decimates armored units. It is moderately effective vs light units and buildings.]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 - -local weaponDefs = { - mediumtankcannon = { - badTargetCategory = [[BUILDING]], - AreaOfEffect = 1, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "bruisercannon", - explosionGenerator = "custom:genericshellexplosion-small", - energypershot = weapon1Damage / 20, - id = 51, - interceptedByShieldType = 4, - impulseFactor = 0, - name = "Light Cannon", - range = 600, - reloadtime = 1.0, - weaponType = "Cannon", - soundHit = "mediumcannonhit.wav", - soundStart = "bruisercannon.wav", - startsmoke = "1", - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "emediumtank3", - }, - damage = { - default = weapon1Damage, - }, - }, -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/ehover/emissiletank.lua b/Units/ehover/emissiletank.lua index e28eb2e73..7b29f2ae3 100644 --- a/Units/ehover/emissiletank.lua +++ b/Units/ehover/emissiletank.lua @@ -1,184 +1,26 @@ -- UNITDEF -- EMISSILETANK -- -------------------------------------------------------------------------------- -local unitName = "emissiletank" +unitName = "emissiletank" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = "Droplet" ---** +objectName = "emissiletank2.s3o" +script = "emissiletank2.cob" +tech = [[tech2]] +armortype = [[light]] +supply = [[14]] - acceleration = 1, - brakeRate = 0.2, - buildCostEnergy = 0, - buildCostMetal = 32, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "LIGHT NOTAIR SUPPORT", - corpse = "ammobox", - description = [[Missile Support Tank -Light -100 Damage vs Light/Armored -50 Damage vs Building +VFS.Include("units-configs-basedefs/basedefs/hover/emissiletank_basedef.lua") -Requires +7 Power -Uses +7 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "largeExplosionGeneric", - footprintX = 4, - footprintZ = 4, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 320, - maxSlope = 26, - maxVelocity = 2.5, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK4", - name = "Droplet", - objectName = "emissiletank2.s3o", - script = "emissiletank2.cob", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "largeExplosionGeneric", - side = "ARM", - sightDistance = 850, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 2.6, - turnRate = 1000, --- turnrate = 300, - unitname = "emissiletank", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:factorysparks", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "missletankweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT", - }, - [2] = { - def = "missletankweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "BUILDING LIGHT WALL", - }, - }, - customParams = { - canareaattack="1", - needed_cover = 3, - death_sounds = "generic", - RequireTech = "7 Power", - armortype = "light", - nofriendlyfire = "1", - supply_cost = 7, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[The Droplet is a medium range missile artillery battery. It does the most damage to armored units. It's damage is lower than a light tank destroyer, but it's large area of effect makes up for anything it lacks in damage.]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 150 - -local weaponDefs = { - missletankweapon = { - badTargetCategory = [[LIGHT BUILDING]], - AreaOfEffect = 100, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - cegTag = "missiletrail", - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:genericshellexplosion-medium-red", - energypershot = weapon1Damage / 20, - fireStarter = 100, - flightTime = 10, - guidance = true, - id = 124, - impulseBoost = 0, - impulseFactor = 0, - interceptedByShieldType = 4, - lineOfSight = true, - model = "missilesmallvlaunch.s3o", - name = "Rocket", - range = 850, - reloadtime = 3, - weaponType = "MissileLauncher", - selfprop = true, - smokedelay = "0.1", - smokeTrail = false, - soundHit = "explode_large.wav", - soundStart = "missile_launch1.wav", - startsmoke = "0", - tracks = true, - turnrate = 30000, - vlaunch = true, - weaponAcceleration = 400, - weaponTimer = 1, - weaponType = "StarburstLauncher", - weaponVelocity = 1800, - customparams = { - damagetype = "emissiletank", - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, -} unitDef.weaponDefs = weaponDefs - - -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/emissiletank_up1.lua b/Units/ehover/emissiletank_up1.lua new file mode 100644 index 000000000..0c917c889 --- /dev/null +++ b/Units/ehover/emissiletank_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EMISSILETANK_up1 -- +-------------------------------------------------------------------------------- + +unitName = "emissiletank_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Droplet Mark II]] + +objectName = "emissiletank2.s3o" +script = "emissiletank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[14]] + +VFS.Include("units-configs-basedefs/basedefs/hover/emissiletank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/emissiletank_up2.lua b/Units/ehover/emissiletank_up2.lua new file mode 100644 index 000000000..0f676546e --- /dev/null +++ b/Units/ehover/emissiletank_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EMISSILETANK_up2 -- +-------------------------------------------------------------------------------- + +unitName = "emissiletank_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Droplet Mark III]] + +objectName = "emissiletank2.s3o" +script = "emissiletank2.cob" + +tech = [[tech2]] +armortype = [[light]] +supply = [[14]] + +VFS.Include("units-configs-basedefs/basedefs/hover/emissiletank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/emissiletank_up3.lua b/Units/ehover/emissiletank_up3.lua new file mode 100644 index 000000000..fa95c4953 --- /dev/null +++ b/Units/ehover/emissiletank_up3.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- EMISSILETANK_up3 -- +-------------------------------------------------------------------------------- + +unitName = "emissiletank_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Droplet Mark IV]] + +objectName = "emissiletank2.s3o" +script = "emissiletank2.cob" +tech = [[tech2]] +armortype = [[light]] +supply = [[14]] + +VFS.Include("units-configs-basedefs/basedefs/hover/emissiletank_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2.lua b/Units/ehover/eriottank2.lua index 068682f04..9ef4647b4 100644 --- a/Units/ehover/eriottank2.lua +++ b/Units/ehover/eriottank2.lua @@ -1,224 +1,26 @@ -- UNITDEF -- ERIOTTANK2 -- -------------------------------------------------------------------------------- -local unitName = "eriottank2" +unitName = "eriottank2" -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = "Spas" ---** +objectName = "eriottank3.s3o" +script = "eriottank3.cob" +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] - acceleration = 1, - brakeRate = 0.1, - buildCostEnergy = 0, - buildCostMetal = 25, - builder = false, - buildTime = 5, - canAttack = true, - cancollect = "1", --- canDgun = true, - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canstop = "1", - category = "ARMORED NOTAIR RIOT", - corpse = "ammobox", - description = [[Anti-Swarm EMP/Riot Tank -Armored -200 Paralysis Damage vs Light -100 Paralysis Damage vs Armored/Building -• Paralyzes enemy units -• Projectile can hit multiple units +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_basedef.lua") -Alternate fire mode fires 10 projectiles in a shotgun spread with a small area of effect. Reduced damage vs buildings when in shotgun mode. +unitDef.weaponDefs = weaponDefs-------------------------------------------------------------------------------- -Requires +3 Power -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericBlue", - footprintX = 3, - footprintZ = 3, - iconType = "tankdestroyer", - idleAutoHeal = .5, - idleTime = 2200, - leaveTracks = false, - maxDamage = 300, - maxSlope = 26, - maxVelocity = 4, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalStorage = 0, - movementClass = "HOVERTANK3", - name = "Spas", - noChaseCategory = "VTOL", - objectName = "eriottank3.s3o", - script = "eriottank3.cob", - onlytargetcategory2 = "NOTAIR", - onlytargetcategory3 = "NOTAIR", - onlytargetcategory4 = "NOTAIR", - onlytargetcategory5 = "NOTAIR", - onlytargetcategory6 = "NOTAIR", - radarDistance = 0, - repairable = false, - selfDestructAs = "mediumExplosionGenericBlue", - side = "CORE", - sightDistance = 500, - smoothAnim = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 3.3, - turnRate = 1000, --- turnrate = 430, - unitname = "eriottank2", - upright = true, - workerTime = 0, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - - explosiongenerators = { - "custom:gdhcannon", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "riottankempweapon", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - [2] = { - def = "riottankshotgun", - onlyTargetCategory = "NOTAIR AMPHIB", - badTargetCategory = "WALL", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - RequireTech = "3 Power", - armortype = "armored", - nofriendlyfire = "1", - supply_cost = 3, - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[]], - }, -} - - --------------------------------------------------------------------------------- -local weapon1Damage = 200 -local weapon2Damage = 75 -local weapon2Projectiles = 10 - -local weaponDefs = { - riottankempweapon = { - badTargetCategory = [[ARMORED BUILDING]], - AreaOfEffect = 250, - avoidFeature = false, - avoidFriendly = false, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.6, --- cegTag = "mediumcannonweapon3", - duration = 0.05, - edgeeffectiveness = 0.1, - energypershot = weapon1Damage / 20, - explosionGenerator = "custom:genericshellexplosion-medium-blue", - fallOffRate = 1, - fireStarter = 100, - impulseFactor = 0, - lineOfSight = true, - minintensity = 1, - name = "Laser", - noexplode = true, - paralyzer = true, - paralyzetime = 2.5, - range = 500, - reloadtime = 1, - WeaponType = "LaserCannon", - rgbColor = "0 0.2 1", - rgbColor2 = "1 1 1", - soundTrigger = true, - soundstart = "fnubeamfire.wav", - soundHit = "phasegun1hit.wav", - texture1 = "wave", - texture2 = "empty", - thickness = 40, - tolerance = 1000, - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "eriottank2", - nofriendlyfire = 1, - - --Upgrades-- - upgradeClass = "groundweapons", - }, - damage = { - default = weapon1Damage, - }, - }, - - riottankshotgun = { - AreaOfEffect = 100, - avoidFriendly = false, - avoidFeature = false, - collideFriendly = false, - collideFeature = false, - ballistic = true, - cegTag = "bruisercannon", - explosionGenerator = "custom:genericshellexplosion-small", - energypershot = weapon2Damage / 20 * weapon2Projectiles, - interceptedByShieldType = 4, - impulseFactor = 0, - name = "Light Cannon", - projectiles = weapon2Projectiles, - range = 600, - reloadtime = 5, - weaponType = "Cannon", - soundHit = "mediumcannonhit.wav", - soundStart = "bruisercannon.wav", - sprayangle = 2000, - startsmoke = "1", - turret = true, - weaponVelocity = 400, - customparams = { - damagetype = "eriottank2shotgun", - }, - damage = { - default = weapon2Damage, - }, - }, - -} -unitDef.weaponDefs = weaponDefs - - --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) -------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_shotgun.lua b/Units/ehover/eriottank2_shotgun.lua new file mode 100644 index 000000000..69fc63b7c --- /dev/null +++ b/Units/ehover/eriottank2_shotgun.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ERIOTTANK2_shotgun -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_shotgun" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Spas" + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_shotgun_up1.lua b/Units/ehover/eriottank2_shotgun_up1.lua new file mode 100644 index 000000000..da1e07cc0 --- /dev/null +++ b/Units/ehover/eriottank2_shotgun_up1.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ERIOTTANK2_shotgun_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_shotgun_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Spas Mark II]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_shotgun_up2.lua b/Units/ehover/eriottank2_shotgun_up2.lua new file mode 100644 index 000000000..948f56227 --- /dev/null +++ b/Units/ehover/eriottank2_shotgun_up2.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ERIOTTANK2_shotgun_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_shotgun_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Spas Mark III]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_shotgun_up3.lua b/Units/ehover/eriottank2_shotgun_up3.lua new file mode 100644 index 000000000..23edc2c5a --- /dev/null +++ b/Units/ehover/eriottank2_shotgun_up3.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ERIOTTANK2_shotgun_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_shotgun_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Spas Mark IV]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_shotgun_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_up1.lua b/Units/ehover/eriottank2_up1.lua new file mode 100644 index 000000000..1988a4342 --- /dev/null +++ b/Units/ehover/eriottank2_up1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ERIOTTANK2_up1 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_up1" + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[Spas Mark II]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_basedef.lua") + +unitDef.weaponDefs = weaponDefs-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_up2.lua b/Units/ehover/eriottank2_up2.lua new file mode 100644 index 000000000..acf2f6163 --- /dev/null +++ b/Units/ehover/eriottank2_up2.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ERIOTTANK2_up2 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_up2" + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[Spas Mark III]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_basedef.lua") + +unitDef.weaponDefs = weaponDefs-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/ehover/eriottank2_up3.lua b/Units/ehover/eriottank2_up3.lua new file mode 100644 index 000000000..49cdbc63b --- /dev/null +++ b/Units/ehover/eriottank2_up3.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ERIOTTANK2_up3 -- +-------------------------------------------------------------------------------- + +unitName = "eriottank2_up3" + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[Spas Mark IV]] + +objectName = "eriottank3.s3o" +script = "eriottank3.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[3]] + + +VFS.Include("units-configs-basedefs/basedefs/hover/eriottank2_basedef.lua") + +unitDef.weaponDefs = weaponDefs-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/energycore.lua b/Units/energycore.lua new file mode 100644 index 000000000..1712b2c5e --- /dev/null +++ b/Units/energycore.lua @@ -0,0 +1,53 @@ +local unitname = "energycore" +local unitDef = { + name = "energycore", + category = "LIGHT NOTAIR", + buildCostEnergy = 0, + buildCostMetal = 5, + buildTime = 5, + description = [[Energy Core + � Can be reclaimed for 5 Metal and 5 Energy by moving an O.R.B. in range + + � Can be converted to MidKnight Gunship Drone by moving a B.O.X. in range +]], + objectName = "ammobox2.s3o", -- for christmas: 'xmasball.3so' + script = 'energycore.lua', -- for christmas: 'xmasball.lua' + collisionvolumeoffsets = "0 6 0", + collisionvolumescales = "12 12 12", + collisionvolumetype = "Box", + footprintx = 1, + footprintz = 1, + height = 5, + blocking = true, + hitdensity = 0, + metal = 5, + energy = 5, + damage = 10000, + canattack = false, + canrepeat = false, + hidedamage = true, + reclaimable = false, + repairable = false, + autoreclaimable = false, + indestructible = true, + smokeTime = 0, + sightdistance = 0, + seismicsignature = 0, + stealth = true, + sonarStealth = true, + capturable = false, + canmove = true, + maxvelocity = 1, + movementclass = "ALLTERRTANK4", + usebuildinggrounddecal = false, +-- nodrawundergray = "1.0", + + customParams = { + provide_cover = 0, + nohealthbars = true, + needed_cover = 99999999, + cannotcloak = true, + }, + +} +return lowerkeys({[unitname] = unitDef}) \ No newline at end of file diff --git a/Units/eorb.lua b/Units/eorb.lua index 5f8179e62..5f332034d 100644 --- a/Units/eorb.lua +++ b/Units/eorb.lua @@ -1,159 +1,27 @@ --- UNITDEF -- EORB -- -------------------------------------------------------------------------------- -local unitName = "eorb" +unitName = [[eorb]] -------------------------------------------------------------------------------- -local unitDef = { +isUpgraded = [[0]] ---mobileunit - transportbyenemy = false; +humanName = [[O.R.B.]] ---** +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] +workerTime = 1 +buildDistance = 350 - acceleration = 1, - brakeRate = 0.24, - buildCostEnergy = 0, - buildCostMetal = 30, - buildDistance = 800, - builder = true, - buildTime = 5, - CanAttack = false, - CanAssist = true, - CanBeAssisted = true, - CanCapture = false, - CanRepair = true, - cancollect = "1", - canGuard = true, - canHover = true, - canMove = true, - canPatrol = true, - canreclaim = false, - canstop = true, - category = "LIGHT NOTAIR SUPPORT", - description = [[Field Medic -Light - • Automatically repairs mobile units in the area +tech = [[tech0]] +armortype = [[light]] -Uses +3 Supply]], - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "mediumExplosionGenericGreen", - footprintX = 6, - footprintZ = 6, - fireState = "0", - iconType = "orb", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 600, - maxSlope = 26, - maxVelocity = 3, - maxReverseVelocity = 1, - maxWaterDepth = 10, - metalmake = 0, - metalStorage = 0, - movementClass = "HOVERTANK6", - moveState = "2", - name = "ORB", - objectName = "eorb3.s3o", - script = "eorb3.cob", - radarDistance = 0, - --radarDistanceJam = 20, - repairable = false, - selfDestructAs = "mediumExplosionGenericGreen", - showNanoSpray = "0", - side = "ARM", - sightDistance = 500, - smoothAnim = true, - stealth = true, - -- turnInPlace = false, - -- turnInPlaceSpeedLimit = 3, - turnRate = 1000, --- turnrate = 1020, - unitname = "eorb", - upright = true, - workerTime = 1, - capturespeed = 0, - TerraformSpeed = 100000, - ReclaimSpeed = 0, - repairspeed = 0.3125, - sfxtypes = { - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") - explosiongenerators = { - "custom:nanoorb", - "custom:dirt", - "custom:blacksmoke", - }, - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - customParams = { - needed_cover = 2, - death_sounds = "generic", - cancollect = "1", - armortype = "light", - normalstex = "unittextures/lego2skin_explorernormal.dds", - buckettex = "unittextures/lego2skin_explorerbucket.dds", - factionname = "outer_colonies", - helptext = [[The ORB is a field medic designed to quickly repair damaged units. It has an Area Repair ability that will repair 10 hitpoints every second to any damaged unit (including allied units) in range. Unit must be out of combat for 5 seconds before repairs can take place. - - The ORB will also automatically reclaim and energy cores it gets close to. This means that if you include them in your unit groups, not only do you get excellent repair, you can also turn a profit from even a bad engagement.]], - - -- groundtexselectimg = ":nc:bitmaps/icons/repairzone.png", - -- groundtexselectxsize = 1000, - -- groundtexselectzsize = 1000, - }, -} - --------------------------------------------------------------------------------- - -local weaponDefs = { - - aoeheal = { - AreaOfEffect = 1000, - avoidFriendly = false, - ballistic = true, - collideFriendly = false, - commandfire = true, - explosionGenerator = "custom:AREAHEALING", - energypershot = 50, - edgeEffectiveness = 1, - impulseFactor = 0, - name = "Area Healing Device", - range = 50, - reloadtime = 10, - weaponType = "Cannon", - soundStart = "areaheal.wav", - startsmoke = "1", - turret = true, - weaponVelocity = 1000, - customparams = { - damagetype = "default", - noenemyfire = "1", - }, - damage = { - default = -250, - }, - }, -} unitDef.weaponDefs = weaponDefs -------------------------------------------------------------------------------- -return lowerkeys({ [unitName] = unitDef }) +return lowerkeys({ [unitName] = unitDef }) --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eorb_up1.lua b/Units/eorb_up1.lua new file mode 100644 index 000000000..4be7a1e61 --- /dev/null +++ b/Units/eorb_up1.lua @@ -0,0 +1,27 @@ +-------------------------------------------------------------------------------- + +unitName = [[eorb_up1]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[1]] + +humanName = [[O.R.B. MK II]] + +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] + +workerTime = 1.33 +buildDistance = 800 + +tech = [[tech0]] +armortype = [[light]] + +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eorb_up2.lua b/Units/eorb_up2.lua new file mode 100644 index 000000000..b0c24e410 --- /dev/null +++ b/Units/eorb_up2.lua @@ -0,0 +1,27 @@ +-------------------------------------------------------------------------------- + +unitName = [[eorb_up2]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[2]] + +humanName = [[O.R.B. MK III]] + +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] + +workerTime = 1.66 +buildDistance = 800 + +tech = [[tech0]] +armortype = [[light]] + +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/eorb_up3.lua b/Units/eorb_up3.lua new file mode 100644 index 000000000..5b795108b --- /dev/null +++ b/Units/eorb_up3.lua @@ -0,0 +1,27 @@ +-------------------------------------------------------------------------------- + +unitName = [[eorb_up3]] + +-------------------------------------------------------------------------------- + +isUpgraded = [[3]] + +humanName = [[O.R.B. MK IV]] + +objectName = [[eorb4.s3o]] +script = [[eorb3.cob]] + +workerTime = 2 +buildDistance = 800 + +tech = [[tech0]] +armortype = [[light]] + +VFS.Include("units-configs-basedefs/basedefs/eorb_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/lootboxes/lootboxbronze.lua b/Units/lootboxes/lootboxbronze.lua new file mode 100644 index 000000000..92d38eee2 --- /dev/null +++ b/Units/lootboxes/lootboxbronze.lua @@ -0,0 +1,71 @@ +return { + lootboxbronze = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1, + brakerate = 0, + buildcostenergy = 25000, + buildcostmetal = 375, + buildtime = 5000, + canfight = false, + canguard = false, + canhover = true, + canmove = false, + canpatrol = false, + canrepeat = false, + canselfdestruct = false, + canstop = false, + cantbetransported = false, + capturable = true, + category = "BUILDING", + + description = "Bronze Lootbox: While you maintain control of it, this lootbox will provide extra resources.", + energymake = 20, + explodeas = "lootboxExplosion1", + floater = true, + footprintx = 3, + footprintz = 3, + icontype = "lootbox", + idleautoheal = 10, + idletime = 1800, + levelground = false, + mass = 4000, + maxdamage = 3000, + maxslope = 10, + maxvelocity = 0.00000001, + maxwaterdepth = 0, + metalmake = 1, + movestate = 0, + name = "Lootbox", + noautofire = false, + objectname = "lootboxes/lootbox3x3.s3o", + pushResistant = true, + script = "lootboxes/lootboxgold.cob", + seismicsignature = 0, + selfdestructas = "lootboxExplosion1", + selfdestructcountdown = 9, + sightdistance = 96, + transportbyenemy = true, + turninplace = false, + turnrate = 0, + unitname = "lootboxgold", + upright = true, + usebuildinggrounddecal = true, + --waterline = 0, + yardmap = "ooo ooo ooo", + customparams = { + normaltex = "unittextures/bfaction_normals.dds", + subfolder = "other/lootboxes", + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:LootboxLightGold", + [2] = "custom:LootboxBeaconBronze", + }, + pieceexplosiongenerators = { + [1] = "deathceg3", + [2] = "deathceg4", + }, + }, + }, +} diff --git a/Units/lootboxes/lootboxgold.lua b/Units/lootboxes/lootboxgold.lua new file mode 100644 index 000000000..6c354fc00 --- /dev/null +++ b/Units/lootboxes/lootboxgold.lua @@ -0,0 +1,70 @@ +return { + lootboxgold = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1, + brakerate = 1, + buildcostenergy = 25000, + buildcostmetal = 1500, + buildtime = 5000, + canfight = false, + canguard = false, + canmove = false, + canpatrol = false, + canrepeat = false, + canselfdestruct = false, + canstop = false, + cantbetransported = false, + capturable = true, + category = "BUILDING", + + description = "Gold Lootbox: While you maintain control of it, this lootbox will provide extra resources.", + energymake = 40, + explodeas = "lootboxExplosion3", + floater = true, + footprintx = 5, + footprintz = 5, + icontype = "lootbox", + idleautoheal = 10, + idletime = 1800, + levelground = false, + mass = 4000, + maxdamage = 5000, + maxslope = 10, + maxvelocity = 0.00000001, + maxwaterdepth = 0, + metalmake = 3, + movestate = 0, + name = "Lootbox", + noautofire = false, + objectname = "lootboxes/lootbox5x5.s3o", + pushResistant = true, + script = "lootboxes/lootboxgold.cob", + seismicsignature = 0, + selfdestructas = "lootboxExplosion3", + selfdestructcountdown = 9, + sightdistance = 96, + transportbyenemy = true, + turninplace = false, + turnrate = 0, + unitname = "lootboxgold", + upright = true, + usebuildinggrounddecal = true, + --waterline = 0, + yardmap = "ooooo ooooo ooooo ooooo ooooo", + customparams = { + normaltex = "unittextures/bfaction_normals.dds", + subfolder = "other/lootboxes", + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:LootboxLightGold", + [2] = "custom:LootboxBeaconGold", + }, + pieceexplosiongenerators = { + [1] = "deathceg3", + [2] = "deathceg4", + }, + }, + }, +} diff --git a/Units/lootboxes/lootboxplatinum.lua b/Units/lootboxes/lootboxplatinum.lua new file mode 100644 index 000000000..6594c8633 --- /dev/null +++ b/Units/lootboxes/lootboxplatinum.lua @@ -0,0 +1,70 @@ +return { + lootboxplatinum = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1, + brakerate = 1, + buildcostenergy = 25000, + buildcostmetal = 2500, + buildtime = 5000, + canfight = false, + canguard = false, + canmove = false, + canpatrol = false, + canrepeat = false, + canselfdestruct = false, + canstop = false, + cantbetransported = false, + capturable = true, + category = "BUILDING", + + description = "Platinum Lootbox: While you maintain control of it, this lootbox will provide extra resources.", + energymake = 80, + explodeas = "lootboxExplosion4", + floater = true, + footprintx = 6, + footprintz = 6, + icontype = "lootbox", + idleautoheal = 10, + idletime = 1800, + levelground = false, + mass = 4000, + maxdamage = 6000, + maxslope = 10, + maxvelocity = 0.00000001, + maxwaterdepth = 0, + metalmake = 4, + movestate = 0, + name = "Lootbox", + noautofire = false, + objectname = "lootboxes/lootbox6x6.s3o", + pushResistant = true, + script = "lootboxes/lootboxgold.cob", + seismicsignature = 0, + selfdestructas = "lootboxExplosion4", + selfdestructcountdown = 9, + sightdistance = 96, + transportbyenemy = true, + turninplace = false, + turnrate = 0, + unitname = "lootboxgold", + upright = true, + usebuildinggrounddecal = true, + --waterline = 0, + yardmap = "oooooo oooooo oooooo oooooo oooooo oooooo", + customparams = { + normaltex = "unittextures/bfaction_normals.dds", + subfolder = "other/lootboxes", + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:LootboxLightGold", + [2] = "custom:LootboxBeaconPlatinum", + }, + pieceexplosiongenerators = { + [1] = "deathceg3", + [2] = "deathceg4", + }, + }, + }, +} diff --git a/Units/lootboxes/lootboxsilver.lua b/Units/lootboxes/lootboxsilver.lua new file mode 100644 index 000000000..7f285116a --- /dev/null +++ b/Units/lootboxes/lootboxsilver.lua @@ -0,0 +1,70 @@ +return { + lootboxsilver = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1, + brakerate = 1, + buildcostenergy = 25000, + buildcostmetal = 750, + buildtime = 5000, + canfight = false, + canguard = false, + canmove = false, + canpatrol = false, + canrepeat = false, + canselfdestruct = false, + canstop = false, + cantbetransported = false, + capturable = true, + category = "BUILDING", + + description = "Silver Lootbox: While you maintain control of it, this lootbox will provide extra resources.", + energymake = 30, + explodeas = "lootboxExplosion2", + floater = true, + footprintx = 4, + footprintz = 4, + icontype = "lootbox", + idleautoheal = 10, + idletime = 1800, + levelground = false, + mass = 4000, + maxdamage = 4000, + maxslope = 10, + maxvelocity = 0.00000001, + maxwaterdepth = 0, + metalmake = 2, + movestate = 0, + name = "Lootbox", + noautofire = false, + objectname = "lootboxes/lootbox4x4.s3o", + pushResistant = true, + script = "lootboxes/lootboxgold.cob", + seismicsignature = 0, + selfdestructas = "lootboxExplosion2", + selfdestructcountdown = 9, + sightdistance = 96, + transportbyenemy = true, + turninplace = false, + turnrate = 0, + unitname = "lootboxgold", + upright = true, + usebuildinggrounddecal = true, + --waterline = 0, + yardmap = "oooo oooo oooo oooo", + customparams = { + normaltex = "unittextures/bfaction_normals.dds", + subfolder = "other/lootboxes", + }, + sfxtypes = { + explosiongenerators = { + [1] = "custom:LootboxLightGold", + [2] = "custom:LootboxBeaconSilver", + }, + pieceexplosiongenerators = { + [1] = "deathceg3", + [2] = "deathceg4", + }, + }, + }, +} diff --git a/Units/lootboxes/lootdroppod_gold.lua b/Units/lootboxes/lootdroppod_gold.lua new file mode 100644 index 000000000..38f751846 --- /dev/null +++ b/Units/lootboxes/lootdroppod_gold.lua @@ -0,0 +1,110 @@ +return { + lootdroppod_gold = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1.8, + bmcode = "0", + brakerate = 0, + buildcostenergy = 25000, + buildcostmetal = 400, + builddistance = 90, + buildtime = 10500, + canmove = false, + capturable = false, + category = "ALL NOTLAND NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "0 0 0", + collisionvolumetype = "box", + description = "Drops LOOT in your battle", + energystorage = 1000, + explodeas = "", + footprintx = 0, + footprintz = 0, + idleautoheal = 10, + idletime = 90, + levelground = false, + mass = 165.75, + maxdamage = 1800, + maxvelocity = 0, + name = "Lootbox Droppod", + noautofire = false, + objectname = "scavs/cube.s3o", + pushResistant = true, + radardistance = 900, + script = "scavs/droppod.cob", + seismicsignature = 4, + selfdestructas = "", + selfdestructcountdown = 0, + side = "ARM", + sightdistance = 450, + smoothanim = true, + tedclass = "ENERGY", + turninplace = true, + turninplaceanglelimit = 90, + turnrate = 0, + unitname = "lootdroppod_gold", + upright = false, + waterline = 0, + workertime = 1500, + yardmap = "", + customparams = { + isairbase = true, + normaltex = "unittextures/bfaction_normals.dds", + subfolder = "other/lootboxes", + }, + featuredefs = {}, + sfxtypes = { + explosiongenerators = { + [1] = "custom:dirtpoof", + }, + }, + weapondefs = { + weapon = { + alwaysvisible = true, + areaofeffect = 500, + avoidfriendly = 0, + cegtag = "lootbox-trail", + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.3, + explosiongenerator = "custom:dirtpoof", + firestarter = 70, + flighttime = 800, + impulsefactor = 0.1, + interceptedbyshieldtype = 4, + metalpershot = 0, + --model = "Lootboxes/lootbox.s3o", + name = "Lootbox", + range = 59999, + reloadtime = 5, + rgbcolor = "0.95 0.78 0", + smoketrail = 1, + soundhit = "voice/scavengers/scavspawn", + startvelocity = 1, + targetborder = 0.75, + turret = 1, + weaponacceleration = 50, + weapontimer = 2, + weapontype = "MissileLauncher", + weaponvelocity = 100, + wobble = 50, + customparams = { + expl_light_color = "0.95 0.78 0", + expl_light_life_mult = 2.4, + expl_light_mult = 1.4, + expl_light_radius_mult = 1.6, + }, + damage = { + chicken = 1, + default = 1, + }, + }, + }, + weapons = { + [1] = { + def = "WEAPON", + }, + }, + }, +} diff --git a/Units/mission/engineermarbuk.lua b/Units/mission/engineermarbuk.lua deleted file mode 100644 index 19ed4b427..000000000 --- a/Units/mission/engineermarbuk.lua +++ /dev/null @@ -1,170 +0,0 @@ --- UNITDEF -- EALLTERRENGINEER -- --------------------------------------------------------------------------------- - -local unitName = "engineermarbuk" - --------------------------------------------------------------------------------- - -local unitDef = { - acceleration = 0.2, - brakeRate = 0.24, - buildCostEnergy = 0, - buildCostMetal = 5, - buildDistance = 400, - builder = true, - buildTime = 5, - CanAttack = false, - CanAssist = true, - CanCapture = false, - cancollect = true, - canGuard = true, - canMove = true, - canPatrol = true, - canreclamate = false, - canstop = true, - category = "LIGHT NOTAIR SUPPORT", - corpse = "ammobox", - collisionVolumeTest = 1, --- Cloaking - - cancloak = true, - cloakCost = 2, - cloakCostMoving = 2, - minCloakDistance = 70, - decloakOnFire = true, - decloakSpherical = true, - initCloaked = true, - --- End Cloaking - - description = "Engineer :: Armortype: Light", - energyMake = 0, - energyStorage = 0, - energyUse = 0, - explodeAs = "CONSTRUCTOR", - footprintX = 3, - footprintZ = 3, - iconType = "engineer", - idleAutoHeal = .5, - idleTime = 2200, - levelground = true, - maxDamage = 500, - maxSlope = 180, - maxVelocity = 3, - maxReverseVelocity = 1, - turninplacespeedlimit = 3, - maxWaterDepth = 10, - metalmake = 0, - metalStorage = 0, - mobilestandorders = "1", - movementClass = "ALLTERRTANK3", - name = "Engineer Marbuk", - objectName = "eallterrengineer.s3o", - radarDistance = 0, - selfDestructAs = "CONSTRUCTOR", - showNanoSpray = "0", - sightDistance = 1000, --- SonarDistance = 500; - smoothAnim = true, - stealth = true, - seismicSignature = 3, - turnInPlace = true, - turnRate = 1020, - unitname = "engineermarbuk", - workerTime = 2, - capturespeed = 1, - TerraformSpeed = 100000, - ReclaimSpeed = 1000, - repairspeed = 0.25, - sfxtypes = { - explosiongenerators = { - "custom:nanoorb", - "custom:dirtsmall", - }, - pieceExplosionGenerators = { - "deathceg0", - "deathceg1", - }, - }, - buildoptions = { - "esolar2", --new - "egeothermal", --new - "efusion2", --new - "estorage", --new - "eradar2", --new - "ejammer2", --new - "ebarricade", - "elightturret2", --new - "eheavyturret2", --new - "eaaturret", - }, - sounds = { - underattack = "unitsunderattack1", - ok = { - "ack", - }, - select = { - "unitselect", - }, - }, - weapons = { - [1] = { - def = "fusionfx", - }, - }, - customParams = { - needed_cover = 1, - death_sounds = "generic", - twokhotkey = 'e', - dronespawner = "1", - armortype = "light", - normalstex = "unittextures/con_legonormal.png", - }, -} - --------------------------------------------------------------------------------- - -local weaponDefs = { - fusionfx = { - - AreaOfEffect = 5, - avoidFeature = false, - avoidFriendly = false, - beamTime = 0.1, - beamWeapon = true, - collideFeature = false, - collideFriendly = false, - coreThickness = 0.1, - craterBoost = 0, - craterMult = 0, - explosionGenerator = "custom:empty", - fallOffRate = 0.5, - minintensity = 1, - impulseFactor = 0, - largeBeamLaser = true, - lineOfSight = true, - name = "Light Laser", - noSelfDamage = true, - range = 400, - reloadtime = 0.1, - WeaponType = "BeamLaser", - rgbColor = "0 0 0.5", - rgbColor2 = "0.2 0.2 0.2", - selfprop = true, - soundTrigger = true, - startVelocity = 1500, - targetMoveError = 0.3, - thickness = 1, - turret = true, - weaponVelocity = 1500, - damage = { - default = 0, - }, - }, -} -unitDef.weaponDefs = weaponDefs --------------------------------------------------------------------------------- - -return lowerkeys({ [unitName] = unitDef }) - --------------------------------------------------------------------------------- diff --git a/Units/other/Scavengers/big/eamphibbuggybig.lua b/Units/other/Scavengers/big/eamphibbuggybig.lua new file mode 100644 index 000000000..2b019bcc5 --- /dev/null +++ b/Units/other/Scavengers/big/eamphibbuggybig.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- EAMPHIBBUGGY -- +-------------------------------------------------------------------------------- + +unitName = "eamphibbuggybig" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = [[Big Snake]] + +objectName = "scavs/big/eamphibbuggy2big.s3o" +script = "eamphibbuggy_lus.lua" + +tech = [[tech3]] +armortype = [[light]] +supply = [[1]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibbuggy_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/other/Scavengers/boss/eallterranarchidboss.lua b/Units/other/Scavengers/boss/eallterranarchidboss.lua new file mode 100644 index 000000000..c75bd11d7 --- /dev/null +++ b/Units/other/Scavengers/boss/eallterranarchidboss.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eallterranarchid -- Anarchid -- +-------------------------------------------------------------------------------- + +unitName = "eallterranarchidboss" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = [[Mega Anarchid]] + +objectName = "scavs/boss/eallterranarchidboss.s3o" +script = "eallterranarchid.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[35]] + +VFS.Include("Units-Configs-Basedefs/basedefs/allterrain/eallterranarchid_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/other/Scavengers/boss/eamphiblevelerboss.lua b/Units/other/Scavengers/boss/eamphiblevelerboss.lua new file mode 100644 index 000000000..935b2d535 --- /dev/null +++ b/Units/other/Scavengers/boss/eamphiblevelerboss.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- eamphibleveler -- +-------------------------------------------------------------------------------- + +unitName = "eamphiblevelerboss" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = [[Mega Leveler]] + +objectName = "scavs/boss/eamphiblevelerboss.s3o" +script = "eamphibleveler.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[30]] + +VFS.Include("units-configs-basedefs/basedefs/amphib/eamphibleveler_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/other/Scavengers/boss/ehbotkargannethboss.lua b/Units/other/Scavengers/boss/ehbotkargannethboss.lua new file mode 100644 index 000000000..a4d3b9a0b --- /dev/null +++ b/Units/other/Scavengers/boss/ehbotkargannethboss.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ehbotkarganneth -- +-------------------------------------------------------------------------------- + +unitName = "ehbotkargannethboss" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = [[Mega Karganneth]] + +objectName = "scavs/boss/ehbotkargannethboss.s3o" +script = "ehbotkarganneth_lus.lua" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/hbot/mobile/ehbotkarganneth_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/other/Scavengers/boss/ekrowboss.lua b/Units/other/Scavengers/boss/ekrowboss.lua new file mode 100644 index 000000000..c0249cb4f --- /dev/null +++ b/Units/other/Scavengers/boss/ekrowboss.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- EKROW -- +-------------------------------------------------------------------------------- + +unitName = "ekrowboss" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = [[Mega Krow]] + +objectName = "scavs/boss/ekrowboss.s3o" +script = "ekrow.cob" + + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("Units-Configs-Basedefs/basedefs/air/ekrow_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/other/Scavengers/boss/elaceratorboss.lua b/Units/other/Scavengers/boss/elaceratorboss.lua new file mode 100644 index 000000000..ad169bac1 --- /dev/null +++ b/Units/other/Scavengers/boss/elaceratorboss.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- elacerator -- +-------------------------------------------------------------------------------- + +unitName = "elaceratorboss" + +-------------------------------------------------------------------------------- + +isUpgraded = [[boss]] + +humanName = "Mega Lacerator" + +objectName = "scavs/boss/elaceratorboss.s3o" +script = "elacerator.cob" + +tech = [[tech3]] +armortype = [[armored]] +--supply = [[25]] + +VFS.Include("units-configs-basedefs/basedefs/hover/elacerator_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/other/Scavengers/scavengerdroppod.lua b/Units/other/Scavengers/scavengerdroppod.lua new file mode 100644 index 000000000..c6e66f735 --- /dev/null +++ b/Units/other/Scavengers/scavengerdroppod.lua @@ -0,0 +1,112 @@ +return { + scavengerdroppod = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1.8, + bmcode = "0", + blocking = false, + brakerate = 0, + buildcostenergy = 25000, + buildcostmetal = 400, + builddistance = 90, + --builder = true, + --buildpic = "chickens/roost.PNG", + buildtime = 10500, + category = "ALL NOTLAND NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + canmove = false, + capturable = false, + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "0 0 0", + collisionvolumetype = "box", + description = "Spawning droppod for Scavengers", + energystorage = 1000, + explodeas = "", + footprintx = 0, + footprintz = 0, + idleautoheal = 10, + idletime = 90, + levelground = false, + mass = 165.75, + maxdamage = 1800, + maxvelocity = 0, + name = "Scavenger Droppod", + noautofire = false, + objectname = "scavs/cube.s3o", + radardistance = 900, + script = "scavs/droppod.cob", + seismicsignature = 4, + selfdestructcountdown = 0, + selfdestructas = "", + side = "ARM", + sightdistance = 450, + smoothanim = true, + tedclass = "ENERGY", + turninplace = true, + turninplaceanglelimit = 90, + turnrate = 0, + unitname = "scavengerdroppod_scav", + upright = false, + waterline = 0, + workertime = 1500, + yardmap = "", + customparams = { + subfolder = "scavengers", + isairbase = true, + normaltex = "unittextures/Core_normal.dds", + }, + featuredefs = {}, + sfxtypes = { + explosiongenerators = { + [1] = "custom:dirtpoof", + }, + }, + weapondefs = { + weapon = { + alwaysVisible = true, + areaofeffect = 500, + avoidfriendly = 0, + cegtag = "scaspawn-trail", + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.3, + explosiongenerator = "custom:dirtpoof", + firestarter = 70, + flighttime = 100, + impulsefactor = 0.1, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "scavs/scavbeacondroppod.s3o", + name = "Droppod", + range = 29999, + reloadtime = 5, + rgbcolor = "0.85 0 1", + smoketrail = 1, + soundhit = "voice/scavengers/scavspawn", + startvelocity = 1, + targetborder = 0.75, + turret = 1, + weaponacceleration = 1800, + weapontimer = 2, + weapontype = "MissileLauncher", + weaponvelocity = 1500, + wobble = 50, + customparams = { + expl_light_color = "0.85 0.10 1", + expl_light_life_mult = 1.2, + expl_light_mult = 1.0, + expl_light_radius_mult = 1.0, + }, + damage = { + chicken = 0, + default = 0, + }, + }, + }, + weapons = { + [1] = { + def = "WEAPON", + }, + }, + }, +} diff --git a/Units/other/Scavengers/scavengerdroppodbeacon.lua b/Units/other/Scavengers/scavengerdroppodbeacon.lua new file mode 100644 index 000000000..d4d366663 --- /dev/null +++ b/Units/other/Scavengers/scavengerdroppodbeacon.lua @@ -0,0 +1,123 @@ +return { + scavengerdroppodbeacon = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 10, + --bmcode = "0", + blocking = false, + brakerate = 0, + buildcostenergy = 25000, + buildcostmetal = 400, + builddistance = 90, + --builder = true, + --buildpic = "chickens/roost.PNG", + buildtime = 10500, + category = "BUILDING", + canmove = false, + canSelfDestruct = false, + capturable = false, + cantbetransported = false, + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "0 0 0", + collisionvolumetype = "box", + description = "Spawner", + energystorage = 1000, + explodeas = "mediumScavengerExplosionNuke", + footprintx = 10, + footprintz = 10, + idleautoheal = 10, + idletime = 90, + levelground = true, + mass = 165.75, + maxdamage = 2000, + maxvelocity = 0, + name = "Scavenger Spawn Beacon", + noautofire = false, + objectname = "scavs/scavbeacon.s3o", + radardistance = 0, + script = "scavs/beacon.cob", + seismicsignature = 4, + selfdestructcountdown = 1, + --selfdestructas = "ROOST_DEATH", + side = "ARM", + sightdistance = 0, + smoothanim = true, + tedclass = "ENERGY", + transportByEnemy = true, + turninplace = true, + turninplaceanglelimit = 90, + turnrate = 0, + unitname = "scavengerbeacon_scav", + upright = true, + waterline = 0, + workertime = 1500, + yardmap = "yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy yyyyyyyyyy", + -- + useGroundDecal = true, + BuildingGroundDecalType = "zgroundtexture2.dds", + BuildingGroundDecalSizeX = 18, + BuildingGroundDecalSizeY = 18, + BuildingGroundDecalDecaySpeed = 0.9, + -- + customparams = { + subfolder = "scavengers", + isairbase = true, + normaltex = "unittextures/scavbeacon_normals.dds", + armortype = "building", + }, + featuredefs = {}, + sfxtypes = { + explosiongenerators = { + [1] = "custom:PurpleLight", + }, + }, + weapondefs = { + weapon = { + alwaysVisible = true, + areaofeffect = 500, + avoidfriendly = 0, + cegtag = "scaspawn-trail", + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.3, + explosiongenerator = "custom:genericshellexplosion", + firestarter = 70, + flighttime = 100, + impulsefactor = 0.1, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "scavs/scavbeacondroppod.s3o", + name = "Droppod", + range = 256, + reloadtime = 5, + rgbcolor = "1 0 0", + smoketrail = 1, + soundhit = "voice/scavengers/scavspawn", + startvelocity = 1, + targetborder = 0.75, + turret = 1, + weaponacceleration = 1800, + weapontimer = 2, + weapontype = "MissileLauncher", + weaponvelocity = 1500, + wobble = 50, + customparams = { + expl_light_color = "1 0 0", + expl_light_life_mult = 1.2, + expl_light_mult = 1.0, + expl_light_radius_mult = 1.0, + }, + damage = { + chicken = 0, + default = 0, + }, + }, + }, + weapons = { + [1] = { + def = "WEAPON", + }, + }, + }, +} diff --git a/Units/other/Scavengers/scavengerdroppodfriendly.lua b/Units/other/Scavengers/scavengerdroppodfriendly.lua new file mode 100644 index 000000000..041437357 --- /dev/null +++ b/Units/other/Scavengers/scavengerdroppodfriendly.lua @@ -0,0 +1,110 @@ +return { + scavengerdroppodfriendly = { + acceleration = 0, + activatewhenbuilt = true, + autoheal = 1.8, + blocking = false, + bmcode = "0", + brakerate = 0, + buildcostenergy = 25000, + buildcostmetal = 400, + builddistance = 90, + buildtime = 10500, + canmove = false, + capturable = false, + category = "ALL NOTLAND NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOVER SURFACE EMPABLE", + collisionvolumeoffsets = "0 0 0", + collisionvolumescales = "0 0 0", + collisionvolumetype = "box", + description = "Spawning droppod for reinforments", + energystorage = 1000, + explodeas = "", + footprintx = 0, + footprintz = 0, + idleautoheal = 10, + idletime = 90, + levelground = false, + mass = 165.75, + maxdamage = 1800, + maxvelocity = 0, + name = "Friendly Droppod", + noautofire = false, + objectname = "scavs/cube.s3o", + radardistance = 900, + script = "scavs/droppod.cob", + seismicsignature = 4, + selfdestructas = "", + selfdestructcountdown = 0, + side = "ARM", + sightdistance = 450, + smoothanim = true, + tedclass = "ENERGY", + turninplace = true, + turninplaceanglelimit = 90, + turnrate = 0, + unitname = "scavengerfriendlydroppod", + upright = false, + waterline = 0, + workertime = 1500, + yardmap = "", + customparams = { + isairbase = true, + normaltex = "unittextures/Core_normal.dds", + subfolder = "other/scavengers", + }, + featuredefs = {}, + sfxtypes = { + explosiongenerators = { + [1] = "custom:dirtpoof", + }, + }, + weapondefs = { + weapon = { + alwaysvisible = true, + areaofeffect = 500, + avoidfriendly = 0, + cegtag = "scaspawn-greentrail", + collidefriendly = 0, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0.3, + explosiongenerator = "custom:dirtpoof", + firestarter = 70, + flighttime = 250, + impulsefactor = 0.1, + interceptedbyshieldtype = 4, + metalpershot = 0, + model = "scavs/scavbeacondroppod.s3o", + name = "Droppod", + range = 29999, + reloadtime = 5, + rgbcolor = "0 1 0", + smoketrail = 1, + soundhit = "voice/scavengers/scavspawn", + startvelocity = 1, + targetborder = 0.75, + turret = 1, + weaponacceleration = 450, + weapontimer = 2, + weapontype = "MissileLauncher", + weaponvelocity = 900, + wobble = 50, + customparams = { + expl_light_color = "0.1 0.95 0.1", + expl_light_life_mult = 1.1, + expl_light_mult = 0.65, + expl_light_radius_mult = 0.5, + }, + damage = { + chicken = 0, + default = 0, + }, + }, + }, + weapons = { + [1] = { + def = "WEAPON", + }, + }, + }, +} diff --git a/Units/zaal/buildings/zarm.lua b/Units/zaal/buildings/zarm.lua new file mode 100644 index 000000000..facba73af --- /dev/null +++ b/Units/zaal/buildings/zarm.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zarm -- +-------------------------------------------------------------------------------- + +unitName = "zarm" + +-------------------------------------------------------------------------------- + +buildDistance = 65000 + +humanName = "Arm" + +objectName = "zaal/zarm.s3o" +script = "zaal/zarm_lus.lua" + +armortype = [[building]] +techprovided = [[tech0]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zarm_up1.lua b/Units/zaal/buildings/zarm_up1.lua new file mode 100644 index 000000000..bae284f90 --- /dev/null +++ b/Units/zaal/buildings/zarm_up1.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zarm_up1 -- +-------------------------------------------------------------------------------- + +unitName = "zarm_up1" + +-------------------------------------------------------------------------------- + +buildDistance = 65000 + +humanName = "Arm" + +objectName = "zaal/zarm.s3o" +script = "zaal/zarm_lus.lua" + +armortype = [[building]] +techprovided = [[tech0, tech1]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zarm_up2.lua b/Units/zaal/buildings/zarm_up2.lua new file mode 100644 index 000000000..384fbfbea --- /dev/null +++ b/Units/zaal/buildings/zarm_up2.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zarm_up2 -- +-------------------------------------------------------------------------------- + +unitName = "zarm_up2" + +-------------------------------------------------------------------------------- + +buildDistance = 65000 + +humanName = "Arm" + +objectName = "zaal/zarm.s3o" +script = "zaal/zarm_lus.lua" + +armortype = [[building]] +techprovided = [[tech0, tech1, tech2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zarm_up3.lua b/Units/zaal/buildings/zarm_up3.lua new file mode 100644 index 000000000..88fd3ca5e --- /dev/null +++ b/Units/zaal/buildings/zarm_up3.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zarm_up3 -- +-------------------------------------------------------------------------------- + +unitName = "zarm_up3" + +-------------------------------------------------------------------------------- + +buildDistance = 65000 + +humanName = "Arm" + +objectName = "zaal/zarm.s3o" +script = "zaal/zarm_lus.lua" + +armortype = [[building]] +techprovided = [[tech0, tech1, tech2, tech3]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zespire1.lua b/Units/zaal/buildings/zespire1.lua new file mode 100644 index 000000000..aaf7b9497 --- /dev/null +++ b/Units/zaal/buildings/zespire1.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zespire1 -- +-------------------------------------------------------------------------------- + +unitName = "zespire1" + +-------------------------------------------------------------------------------- +buildCostMetal = 50 + +supplygranted = 0 +energyMake = 5 + +humanName = "Basic Energy Spire" + +objectName = "zaal/zespire1.s3o" +script = "zaal/zespire1.cob" + +armortype = [[building]] +tech = [[tech0]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zespire1_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zespire4.lua b/Units/zaal/buildings/zespire4.lua new file mode 100644 index 000000000..46630de60 --- /dev/null +++ b/Units/zaal/buildings/zespire4.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zespire4 -- +-------------------------------------------------------------------------------- + +unitName = "zespire4" + +-------------------------------------------------------------------------------- +buildCostMetal = 200 + +supplygranted = 0 +energyMake = 20 + +humanName = "Budding Energy Spire" + +objectName = "zaal/zespire4.s3o" +script = "zaal/zespire1.cob" + +armortype = [[building]] +tech = [[tech2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zespire1_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zespire5.lua b/Units/zaal/buildings/zespire5.lua new file mode 100644 index 000000000..5a6d788c7 --- /dev/null +++ b/Units/zaal/buildings/zespire5.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zespire5 -- +-------------------------------------------------------------------------------- + +unitName = "zespire5" + +-------------------------------------------------------------------------------- +buildCostMetal = 400 + +supplygranted = 0 +energyMake = 40 + +humanName = "Mature Energy Spire" + +objectName = "zaal/zespire5.s3o" +script = "zaal/zespire1.cob" + +armortype = [[building]] +tech = [[tech3]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zespire1_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/zhatch.lua b/Units/zaal/buildings/zhatch.lua new file mode 100644 index 000000000..4f63f7aec --- /dev/null +++ b/Units/zaal/buildings/zhatch.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ZHATCH -- +-------------------------------------------------------------------------------- + +unitName = [[zhatch]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 1 + +buildCostMetal = 50 + +humanName = [[Zaal Hatchery]] + +objectName = [[zaal/zfactory_up2.s3o]] +script = [[zaal/zfactory.cob]] + +--techprovided = [[tech1, tech0]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zhive_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/zhatch_up1.lua b/Units/zaal/buildings/zhatch_up1.lua new file mode 100644 index 000000000..eb3eba689 --- /dev/null +++ b/Units/zaal/buildings/zhatch_up1.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ZHATCH_UP1 -- +-------------------------------------------------------------------------------- + +unitName = [[zhatch_up1]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 1 + +buildCostMetal = 150 + +humanName = [[Zaal Lair]] + +objectName = [[zaal/zfactory_up1.s3o]] +script = [[zaal/zfactory.cob]] + +techprovided = [[tech2, tech1, tech0]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zhive_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) \ No newline at end of file diff --git a/Units/zaal/buildings/zhatch_up2.lua b/Units/zaal/buildings/zhatch_up2.lua new file mode 100644 index 000000000..f5496d73b --- /dev/null +++ b/Units/zaal/buildings/zhatch_up2.lua @@ -0,0 +1,27 @@ +-- UNITDEF -- ZHATCH_UP2 -- +-------------------------------------------------------------------------------- + +unitName = [[zhatch_up2]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 1 + +buildCostMetal = 300 + +humanName = [[Zaal Hive]] + +objectName = [[zaal/zfactory_up2.s3o]] +script = [[zaal/zfactory.cob]] + +techprovided = [[tech3, tech2, tech1, tech0]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zhive_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/zmex.lua b/Units/zaal/buildings/zmex.lua new file mode 100644 index 000000000..69687bb74 --- /dev/null +++ b/Units/zaal/buildings/zmex.lua @@ -0,0 +1,35 @@ +-- UNITDEF -- ZMEX -- +-------------------------------------------------------------------------------- + +unitName = [[zmex]] + +-------------------------------------------------------------------------------- + +zaalMexCost = Spring.GetModOptions().metalextractorcostzaal or 65 + +metalMultiplier = 1 + +energyUse = 0 + +buildCostMetal = zaalMexCost + +yardMap = [[oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo oooooooo]] + +primaryCEG = "custom:fusionreactionnuclear-1color" + +humanName = [[Zaal Metal Extractor]] + +objectName = [[zaal/zmex.s3o]] +script = [[zaal/zmex.cob]] + +tech = [[tech0]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zmex_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/zmex_up1.lua b/Units/zaal/buildings/zmex_up1.lua new file mode 100644 index 000000000..f773f31a1 --- /dev/null +++ b/Units/zaal/buildings/zmex_up1.lua @@ -0,0 +1,31 @@ +-- UNITDEF -- ZMEX_UP1 -- +-------------------------------------------------------------------------------- + +unitName = [[zmex_up1]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 1.33 + +energyUse = 2 + +buildCostMetal = 100 + +primaryCEG = "custom:fusionreactionnuclear-2color" + +humanName = [[Zaal Metal Extractor Mk II]] + +objectName = [[zaal/zmex.s3o]] +script = [[zaal/zmex.cob]] + +tech = [[tech1]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zmex_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/zmex_up2.lua b/Units/zaal/buildings/zmex_up2.lua new file mode 100644 index 000000000..ca540f3d1 --- /dev/null +++ b/Units/zaal/buildings/zmex_up2.lua @@ -0,0 +1,31 @@ +-- UNITDEF -- ZMEX_UP2 -- +-------------------------------------------------------------------------------- + +unitName = [[zmex_up2]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 1.66 + +energyUse = 5 + +buildCostMetal = 150 + +primaryCEG = "custom:fusionreactionnuclear-3color" + +humanName = [[Zaal Metal Extractor Mk III]] + +objectName = [[zaal/zmex.s3o]] +script = [[zaal/zmex.cob]] + +tech = [[tech2]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zmex_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/zmex_up3.lua b/Units/zaal/buildings/zmex_up3.lua new file mode 100644 index 000000000..2a2af4d68 --- /dev/null +++ b/Units/zaal/buildings/zmex_up3.lua @@ -0,0 +1,31 @@ +-- UNITDEF -- ZMEX_UP3 -- +-------------------------------------------------------------------------------- + +unitName = [[zmex_up3]] + +-------------------------------------------------------------------------------- + +metalMultiplier = 2 + +energyUse = 10 + +buildCostMetal = 200 + +primaryCEG = "custom:fusionreactionnuclear-4color" + +humanName = [[Zaal Metal Extractor Mk IV]] + +objectName = [[zaal/zmex.s3o]] +script = [[zaal/zmex.cob]] + +tech = [[tech3]] +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zmex_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Units/zaal/buildings/ztenticle.lua b/Units/zaal/buildings/ztenticle.lua new file mode 100644 index 000000000..cf14bb942 --- /dev/null +++ b/Units/zaal/buildings/ztenticle.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ztenticle -- +-------------------------------------------------------------------------------- + +unitName = "ztenticle" + +-------------------------------------------------------------------------------- + +buildDistance = 65000 +buildCostMetal = 40 + +humanName = "Tenticle" + +objectName = "zaal/ztenticle.s3o" +script = "zaal/ztenticle_lus.lua" + +armortype = [[building]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/ztenticle_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/ztiberium.lua b/Units/zaal/buildings/ztiberium.lua new file mode 100644 index 000000000..865b81eaa --- /dev/null +++ b/Units/zaal/buildings/ztiberium.lua @@ -0,0 +1,24 @@ +-- UNITDEF -- ztiberium -- +-------------------------------------------------------------------------------- + +unitName = "ztiberium" + +-------------------------------------------------------------------------------- +supplygranted = 25 +storage = 50 + +humanName = "Tiberium Supply/Storage" + +objectName = "zaal/ztiberium_small.s3o" +script = "zaal/ztiberium.cob" + +armortype = [[building]] +tech = [[tech0]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/ztiberium_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/buildings/ztumor.lua b/Units/zaal/buildings/ztumor.lua new file mode 100644 index 000000000..b6a3dc4db --- /dev/null +++ b/Units/zaal/buildings/ztumor.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- ztumor -- +-------------------------------------------------------------------------------- + +unitName = "ztumor" + +-------------------------------------------------------------------------------- + +buildDistance = 1500 + +humanName = "Tumor" + +objectName = "zaal/ztumor.s3o" +script = "zaal/ztumor_lus.lua" + +armortype = [[building]] +--techprovided = [[tech0]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/ztumor_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/air/zairbomber.lua b/Units/zaal/units/air/zairbomber.lua new file mode 100644 index 000000000..7753d5bc8 --- /dev/null +++ b/Units/zaal/units/air/zairbomber.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- zairbomber -- +-------------------------------------------------------------------------------- + +unitName = "zairbomber" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Scourge]] + +objectName = "zaal/zairbomber.s3o" +script = "zaal/zairbomber.cob" + + +tech = [[tech2]] +armortype = [[air]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zairbomber_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/air/zairscout.lua b/Units/zaal/units/air/zairscout.lua new file mode 100644 index 000000000..82feebd2c --- /dev/null +++ b/Units/zaal/units/air/zairscout.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zairscout -- +-------------------------------------------------------------------------------- + +unitName = "zairscout" + +-------------------------------------------------------------------------------- + +humanName = [[Sparrow]] + +objectName = "zaal/zairscout.s3o" +script = "zaal/zairscout.cob" + +armortype = [[air]] + +tech = [[tech1]] + +supply = [[1]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zairscout_basedef.lua") + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/air/zairtoairfighter.lua b/Units/zaal/units/air/zairtoairfighter.lua new file mode 100644 index 000000000..2693e5a97 --- /dev/null +++ b/Units/zaal/units/air/zairtoairfighter.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- zairtoairfighter -- +-------------------------------------------------------------------------------- + +unitName = "zairtoairfighter" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Corruptor]] + +objectName = "zaal/zairtoairfighter.s3o" +script = "zaal/zairtoairfighter.cob" + + +tech = [[tech2]] +armortype = [[air]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zairtoairfighter_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/air/zairtogroundfighter.lua b/Units/zaal/units/air/zairtogroundfighter.lua new file mode 100644 index 000000000..22953d376 --- /dev/null +++ b/Units/zaal/units/air/zairtogroundfighter.lua @@ -0,0 +1,28 @@ +-- UNITDEF -- zairtogroundfighter -- +-------------------------------------------------------------------------------- + +unitName = "zairtogroundfighter" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = [[Mutalisk]] + +objectName = "zaal/zairtogroundfighter.s3o" +script = "zaal/zairtogroundfighter.cob" + + +tech = [[tech3]] +armortype = [[air]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zairtogroundfighter_basedef.lua") + +unitDef.weaponDefs = weaponDefs + +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zarty.lua b/Units/zaal/units/land/zarty.lua new file mode 100644 index 000000000..1f06961b6 --- /dev/null +++ b/Units/zaal/units/land/zarty.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zarty -- +-------------------------------------------------------------------------------- + +unitName = "zarty" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Lurker" + +objectName = "zaal/zarty.s3o" +script = "zaal/zarty.cob" + +tech = [[tech3]] +armortype = [[armored]] +supply = [[5]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zarty_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zassault.lua b/Units/zaal/units/land/zassault.lua new file mode 100644 index 000000000..c034b0837 --- /dev/null +++ b/Units/zaal/units/land/zassault.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zassault -- +-------------------------------------------------------------------------------- + +unitName = "zassault" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Ultralisk" + +objectName = "zaal/zassault.s3o" +script = "zaal/zassault.cob" + +tech = [[tech3]] +armortype = [[armored]] +supply = [[7]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zassault_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zconstructor.lua b/Units/zaal/units/land/zconstructor.lua new file mode 100644 index 000000000..41980f97c --- /dev/null +++ b/Units/zaal/units/land/zconstructor.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zconstructor -- +-------------------------------------------------------------------------------- + +unitName = "zconstructor" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +buildDistance = 400 + +humanName = "Worker Drone" + +objectName = "zaal/zkamikaze.s3o" +script = "zaal/zconstructor.cob" + +armortype = [[light]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zconstructor_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zkamikaze.lua b/Units/zaal/units/land/zkamikaze.lua new file mode 100644 index 000000000..fec2ffdce --- /dev/null +++ b/Units/zaal/units/land/zkamikaze.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zkamikaze -- +-------------------------------------------------------------------------------- + +unitName = "zkamikaze" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Kamikaze" + +objectName = "zaal/zkamikaze.s3o" +script = "zaal/zkamikaze.cob" + +tech = [[tech3]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zkamikaze_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zlightswarm.lua b/Units/zaal/units/land/zlightswarm.lua new file mode 100644 index 000000000..3f9b9ec2f --- /dev/null +++ b/Units/zaal/units/land/zlightswarm.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zlightswarm -- +-------------------------------------------------------------------------------- + +unitName = "zlightswarm" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "ZaalLing" + +objectName = "zaal/zlightswarm.s3o" +script = "zaal/zlightswarm.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[2]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zlightswarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zmedswarm.lua b/Units/zaal/units/land/zmedswarm.lua new file mode 100644 index 000000000..01c7a1701 --- /dev/null +++ b/Units/zaal/units/land/zmedswarm.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zmedswarm -- +-------------------------------------------------------------------------------- + +unitName = "zmedswarm" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Roach" + +objectName = "zaal/zmedswarm.s3o" +script = "zaal/zmedswarm.cob" + +tech = [[tech1]] +armortype = [[light]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zmedswarm_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zpyro.lua b/Units/zaal/units/land/zpyro.lua new file mode 100644 index 000000000..3bbccb1f3 --- /dev/null +++ b/Units/zaal/units/land/zpyro.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- zpyro -- +-------------------------------------------------------------------------------- + +unitName = "zpyro" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Trike" + +objectName = "zaal/zpyro.s3o" +script = "zaal/zpyro.cob" + +tech = [[tech1]] +armortype = [[armored]] +supply = [[4]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zpyro_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zqueen.lua b/Units/zaal/units/land/zqueen.lua new file mode 100644 index 000000000..39263f0d6 --- /dev/null +++ b/Units/zaal/units/land/zqueen.lua @@ -0,0 +1,25 @@ +-- UNITDEF -- zqueen -- +-------------------------------------------------------------------------------- + +unitName = "zqueen" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Queen" + +objectName = "zaal/zqueen.s3o" +script = "zaal/zqueen.cob" + +tech = [[tech3]] +armortype = [[armored]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zqueen_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/Units/zaal/units/land/zskirmisher.lua b/Units/zaal/units/land/zskirmisher.lua new file mode 100644 index 000000000..b2e581675 --- /dev/null +++ b/Units/zaal/units/land/zskirmisher.lua @@ -0,0 +1,26 @@ +-- UNITDEF -- ZSKIRMISHER -- +-------------------------------------------------------------------------------- + +unitName = "zskirmisher" + +-------------------------------------------------------------------------------- + +isUpgraded = [[0]] + +humanName = "Ravager" + +objectName = "zaal/zskirmisher.s3o" +script = "zaal/zskirmisher.cob" + +tech = [[tech2]] +armortype = [[armored]] +supply = [[6]] + +VFS.Include("units-configs-basedefs/basedefs/zaal/zskirmisher_basedef.lua") + +unitDef.weaponDefs = weaponDefs +-------------------------------------------------------------------------------- + +return lowerkeys({ [unitName] = unitDef }) + +-------------------------------------------------------------------------------- diff --git a/bitmaps/detailtextures/TREE.png b/UnusedBitmaps/detailtextures/TREE.png similarity index 100% rename from bitmaps/detailtextures/TREE.png rename to UnusedBitmaps/detailtextures/TREE.png diff --git a/bitmaps/detailtextures/alien1.png b/UnusedBitmaps/detailtextures/alien1.png similarity index 100% rename from bitmaps/detailtextures/alien1.png rename to UnusedBitmaps/detailtextures/alien1.png diff --git a/bitmaps/detailtextures/alien2.png b/UnusedBitmaps/detailtextures/alien2.png similarity index 100% rename from bitmaps/detailtextures/alien2.png rename to UnusedBitmaps/detailtextures/alien2.png diff --git a/bitmaps/detailtextures/blueblobs.png b/UnusedBitmaps/detailtextures/blueblobs.png similarity index 100% rename from bitmaps/detailtextures/blueblobs.png rename to UnusedBitmaps/detailtextures/blueblobs.png diff --git a/bitmaps/detailtextures/camo1.png b/UnusedBitmaps/detailtextures/camo1.png similarity index 100% rename from bitmaps/detailtextures/camo1.png rename to UnusedBitmaps/detailtextures/camo1.png diff --git a/bitmaps/detailtextures/camo2.png b/UnusedBitmaps/detailtextures/camo2.png similarity index 100% rename from bitmaps/detailtextures/camo2.png rename to UnusedBitmaps/detailtextures/camo2.png diff --git a/bitmaps/detailtextures/camo3.png b/UnusedBitmaps/detailtextures/camo3.png similarity index 100% rename from bitmaps/detailtextures/camo3.png rename to UnusedBitmaps/detailtextures/camo3.png diff --git a/bitmaps/detailtextures/camo4.png b/UnusedBitmaps/detailtextures/camo4.png similarity index 100% rename from bitmaps/detailtextures/camo4.png rename to UnusedBitmaps/detailtextures/camo4.png diff --git a/bitmaps/detailtextures/caution1.png b/UnusedBitmaps/detailtextures/caution1.png similarity index 100% rename from bitmaps/detailtextures/caution1.png rename to UnusedBitmaps/detailtextures/caution1.png diff --git a/bitmaps/detailtextures/caution2.png b/UnusedBitmaps/detailtextures/caution2.png similarity index 100% rename from bitmaps/detailtextures/caution2.png rename to UnusedBitmaps/detailtextures/caution2.png diff --git a/bitmaps/detailtextures/circuits1.png b/UnusedBitmaps/detailtextures/circuits1.png similarity index 100% rename from bitmaps/detailtextures/circuits1.png rename to UnusedBitmaps/detailtextures/circuits1.png diff --git a/bitmaps/detailtextures/circuits2.png b/UnusedBitmaps/detailtextures/circuits2.png similarity index 100% rename from bitmaps/detailtextures/circuits2.png rename to UnusedBitmaps/detailtextures/circuits2.png diff --git a/bitmaps/detailtextures/darkembroidery1.png b/UnusedBitmaps/detailtextures/darkembroidery1.png similarity index 100% rename from bitmaps/detailtextures/darkembroidery1.png rename to UnusedBitmaps/detailtextures/darkembroidery1.png diff --git a/bitmaps/detailtextures/darkembroidery2.png b/UnusedBitmaps/detailtextures/darkembroidery2.png similarity index 100% rename from bitmaps/detailtextures/darkembroidery2.png rename to UnusedBitmaps/detailtextures/darkembroidery2.png diff --git a/bitmaps/detailtextures/fade1.png b/UnusedBitmaps/detailtextures/fade1.png similarity index 100% rename from bitmaps/detailtextures/fade1.png rename to UnusedBitmaps/detailtextures/fade1.png diff --git a/bitmaps/detailtextures/hex1.png b/UnusedBitmaps/detailtextures/hex1.png similarity index 100% rename from bitmaps/detailtextures/hex1.png rename to UnusedBitmaps/detailtextures/hex1.png diff --git a/bitmaps/detailtextures/hex2.png b/UnusedBitmaps/detailtextures/hex2.png similarity index 100% rename from bitmaps/detailtextures/hex2.png rename to UnusedBitmaps/detailtextures/hex2.png diff --git a/bitmaps/detailtextures/hex3.png b/UnusedBitmaps/detailtextures/hex3.png similarity index 100% rename from bitmaps/detailtextures/hex3.png rename to UnusedBitmaps/detailtextures/hex3.png diff --git a/bitmaps/detailtextures/hex4.png b/UnusedBitmaps/detailtextures/hex4.png similarity index 100% rename from bitmaps/detailtextures/hex4.png rename to UnusedBitmaps/detailtextures/hex4.png diff --git a/bitmaps/detailtextures/ladiesdress1.png b/UnusedBitmaps/detailtextures/ladiesdress1.png similarity index 100% rename from bitmaps/detailtextures/ladiesdress1.png rename to UnusedBitmaps/detailtextures/ladiesdress1.png diff --git a/bitmaps/detailtextures/metal.png b/UnusedBitmaps/detailtextures/metal.png similarity index 100% rename from bitmaps/detailtextures/metal.png rename to UnusedBitmaps/detailtextures/metal.png diff --git a/bitmaps/detailtextures/plasma1.png b/UnusedBitmaps/detailtextures/plasma1.png similarity index 100% rename from bitmaps/detailtextures/plasma1.png rename to UnusedBitmaps/detailtextures/plasma1.png diff --git a/bitmaps/detailtextures/plasma2.png b/UnusedBitmaps/detailtextures/plasma2.png similarity index 100% rename from bitmaps/detailtextures/plasma2.png rename to UnusedBitmaps/detailtextures/plasma2.png diff --git a/bitmaps/detailtextures/plating1.png b/UnusedBitmaps/detailtextures/plating1.png similarity index 100% rename from bitmaps/detailtextures/plating1.png rename to UnusedBitmaps/detailtextures/plating1.png diff --git a/bitmaps/detailtextures/qbert.png b/UnusedBitmaps/detailtextures/qbert.png similarity index 100% rename from bitmaps/detailtextures/qbert.png rename to UnusedBitmaps/detailtextures/qbert.png diff --git a/bitmaps/detailtextures/racingstripe1.png b/UnusedBitmaps/detailtextures/racingstripe1.png similarity index 100% rename from bitmaps/detailtextures/racingstripe1.png rename to UnusedBitmaps/detailtextures/racingstripe1.png diff --git a/bitmaps/detailtextures/racingstripe2.png b/UnusedBitmaps/detailtextures/racingstripe2.png similarity index 100% rename from bitmaps/detailtextures/racingstripe2.png rename to UnusedBitmaps/detailtextures/racingstripe2.png diff --git a/bitmaps/detailtextures/stripe1.png b/UnusedBitmaps/detailtextures/stripe1.png similarity index 100% rename from bitmaps/detailtextures/stripe1.png rename to UnusedBitmaps/detailtextures/stripe1.png diff --git a/bitmaps/detailtextures/techpanels1.png b/UnusedBitmaps/detailtextures/techpanels1.png similarity index 100% rename from bitmaps/detailtextures/techpanels1.png rename to UnusedBitmaps/detailtextures/techpanels1.png diff --git a/bitmaps/detailtextures/thedude1.png b/UnusedBitmaps/detailtextures/thedude1.png similarity index 100% rename from bitmaps/detailtextures/thedude1.png rename to UnusedBitmaps/detailtextures/thedude1.png diff --git a/bitmaps/detailtextures/tigerstripe1.png b/UnusedBitmaps/detailtextures/tigerstripe1.png similarity index 100% rename from bitmaps/detailtextures/tigerstripe1.png rename to UnusedBitmaps/detailtextures/tigerstripe1.png diff --git a/bitmaps/detailtextures/tigerstripe2.png b/UnusedBitmaps/detailtextures/tigerstripe2.png similarity index 100% rename from bitmaps/detailtextures/tigerstripe2.png rename to UnusedBitmaps/detailtextures/tigerstripe2.png diff --git a/bitmaps/detailtextures/water1.png b/UnusedBitmaps/detailtextures/water1.png similarity index 100% rename from bitmaps/detailtextures/water1.png rename to UnusedBitmaps/detailtextures/water1.png diff --git a/bitmaps/detailtextures/water2.png b/UnusedBitmaps/detailtextures/water2.png similarity index 100% rename from bitmaps/detailtextures/water2.png rename to UnusedBitmaps/detailtextures/water2.png diff --git a/bitmaps/icons/frames.psp b/UnusedBitmaps/icons/frames.psp similarity index 100% rename from bitmaps/icons/frames.psp rename to UnusedBitmaps/icons/frames.psp diff --git a/bitmaps/icons/repairzone.png b/UnusedBitmaps/icons/repairzone.png similarity index 100% rename from bitmaps/icons/repairzone.png rename to UnusedBitmaps/icons/repairzone.png diff --git a/bitmaps/icons/repairzone.psd b/UnusedBitmaps/icons/repairzone.psd similarity index 100% rename from bitmaps/icons/repairzone.psd rename to UnusedBitmaps/icons/repairzone.psd diff --git a/bitmaps/power/power.psd b/UnusedBitmaps/power/power.psd similarity index 100% rename from bitmaps/power/power.psd rename to UnusedBitmaps/power/power.psd diff --git a/bitmaps/power/powergrid.png b/UnusedBitmaps/power/powergrid.png similarity index 100% rename from bitmaps/power/powergrid.png rename to UnusedBitmaps/power/powergrid.png diff --git a/bitmaps/projectiletextures/plus5plus5psd.psd b/UnusedBitmaps/projectiletextures/plus5plus5psd.psd similarity index 100% rename from bitmaps/projectiletextures/plus5plus5psd.psd rename to UnusedBitmaps/projectiletextures/plus5plus5psd.psd diff --git a/UnusedBitmaps/projectiletextures/shield4-large.png b/UnusedBitmaps/projectiletextures/shield4-large.png new file mode 100644 index 000000000..7b5d1add2 Binary files /dev/null and b/UnusedBitmaps/projectiletextures/shield4-large.png differ diff --git a/bitmaps/spbackground.png b/UnusedBitmaps/spbackground.png similarity index 100% rename from bitmaps/spbackground.png rename to UnusedBitmaps/spbackground.png diff --git a/bitmaps/ui/background.jpg b/UnusedBitmaps/ui/background.jpg similarity index 100% rename from bitmaps/ui/background.jpg rename to UnusedBitmaps/ui/background.jpg diff --git a/bitmaps/ui/buckets/finish.png b/UnusedBitmaps/ui/buckets/finish.png similarity index 100% rename from bitmaps/ui/buckets/finish.png rename to UnusedBitmaps/ui/buckets/finish.png diff --git a/bitmaps/ui/buckets/finish2.png b/UnusedBitmaps/ui/buckets/finish2.png similarity index 100% rename from bitmaps/ui/buckets/finish2.png rename to UnusedBitmaps/ui/buckets/finish2.png diff --git a/bitmaps/ui/buckets/label.png b/UnusedBitmaps/ui/buckets/label.png similarity index 100% rename from bitmaps/ui/buckets/label.png rename to UnusedBitmaps/ui/buckets/label.png diff --git a/bitmaps/ui/buckets/metal.png b/UnusedBitmaps/ui/buckets/metal.png similarity index 100% rename from bitmaps/ui/buckets/metal.png rename to UnusedBitmaps/ui/buckets/metal.png diff --git a/bitmaps/ui/buckets/notexture.gif b/UnusedBitmaps/ui/buckets/notexture.gif similarity index 100% rename from bitmaps/ui/buckets/notexture.gif rename to UnusedBitmaps/ui/buckets/notexture.gif diff --git a/bitmaps/ui/buckets/paint.png b/UnusedBitmaps/ui/buckets/paint.png similarity index 100% rename from bitmaps/ui/buckets/paint.png rename to UnusedBitmaps/ui/buckets/paint.png diff --git a/bitmaps/ui/buckets/teamcolorsverticalstrip.png b/UnusedBitmaps/ui/buckets/teamcolorsverticalstrip.png similarity index 100% rename from bitmaps/ui/buckets/teamcolorsverticalstrip.png rename to UnusedBitmaps/ui/buckets/teamcolorsverticalstrip.png diff --git a/bitmaps/ui/buttons/bulb_off.png b/UnusedBitmaps/ui/buttons/bulb_off.png similarity index 100% rename from bitmaps/ui/buttons/bulb_off.png rename to UnusedBitmaps/ui/buttons/bulb_off.png diff --git a/bitmaps/ui/buttons/bulb_on.png b/UnusedBitmaps/ui/buttons/bulb_on.png similarity index 100% rename from bitmaps/ui/buttons/bulb_on.png rename to UnusedBitmaps/ui/buttons/bulb_on.png diff --git a/bitmaps/ui/buttons/buttons.psd b/UnusedBitmaps/ui/buttons/buttons.psd similarity index 100% rename from bitmaps/ui/buttons/buttons.psd rename to UnusedBitmaps/ui/buttons/buttons.psd diff --git a/bitmaps/ui/buttons/cmd_area_mex.png b/UnusedBitmaps/ui/buttons/cmd_area_mex.png similarity index 100% rename from bitmaps/ui/buttons/cmd_area_mex.png rename to UnusedBitmaps/ui/buttons/cmd_area_mex.png diff --git a/bitmaps/ui/buttons/cmd_areaattack.png b/UnusedBitmaps/ui/buttons/cmd_areaattack.png similarity index 100% rename from bitmaps/ui/buttons/cmd_areaattack.png rename to UnusedBitmaps/ui/buttons/cmd_areaattack.png diff --git a/bitmaps/ui/buttons/cmd_attack.png b/UnusedBitmaps/ui/buttons/cmd_attack.png similarity index 100% rename from bitmaps/ui/buttons/cmd_attack.png rename to UnusedBitmaps/ui/buttons/cmd_attack.png diff --git a/bitmaps/ui/buttons/cmd_autorepairlevel.png b/UnusedBitmaps/ui/buttons/cmd_autorepairlevel.png similarity index 100% rename from bitmaps/ui/buttons/cmd_autorepairlevel.png rename to UnusedBitmaps/ui/buttons/cmd_autorepairlevel.png diff --git a/bitmaps/ui/buttons/cmd_capture.png b/UnusedBitmaps/ui/buttons/cmd_capture.png similarity index 100% rename from bitmaps/ui/buttons/cmd_capture.png rename to UnusedBitmaps/ui/buttons/cmd_capture.png diff --git a/bitmaps/ui/buttons/cmd_cloakstate.png b/UnusedBitmaps/ui/buttons/cmd_cloakstate.png similarity index 100% rename from bitmaps/ui/buttons/cmd_cloakstate.png rename to UnusedBitmaps/ui/buttons/cmd_cloakstate.png diff --git a/bitmaps/ui/buttons/cmd_cloakstateoff.png b/UnusedBitmaps/ui/buttons/cmd_cloakstateoff.png similarity index 100% rename from bitmaps/ui/buttons/cmd_cloakstateoff.png rename to UnusedBitmaps/ui/buttons/cmd_cloakstateoff.png diff --git a/bitmaps/ui/buttons/cmd_cloakstateon.png b/UnusedBitmaps/ui/buttons/cmd_cloakstateon.png similarity index 100% rename from bitmaps/ui/buttons/cmd_cloakstateon.png rename to UnusedBitmaps/ui/buttons/cmd_cloakstateon.png diff --git a/bitmaps/ui/buttons/cmd_dgun.png b/UnusedBitmaps/ui/buttons/cmd_dgun.png similarity index 100% rename from bitmaps/ui/buttons/cmd_dgun.png rename to UnusedBitmaps/ui/buttons/cmd_dgun.png diff --git a/bitmaps/ui/buttons/cmd_fight.png b/UnusedBitmaps/ui/buttons/cmd_fight.png similarity index 100% rename from bitmaps/ui/buttons/cmd_fight.png rename to UnusedBitmaps/ui/buttons/cmd_fight.png diff --git a/bitmaps/ui/buttons/cmd_firestate.png b/UnusedBitmaps/ui/buttons/cmd_firestate.png similarity index 100% rename from bitmaps/ui/buttons/cmd_firestate.png rename to UnusedBitmaps/ui/buttons/cmd_firestate.png diff --git a/bitmaps/ui/buttons/cmd_firestatefireatwill.png b/UnusedBitmaps/ui/buttons/cmd_firestatefireatwill.png similarity index 100% rename from bitmaps/ui/buttons/cmd_firestatefireatwill.png rename to UnusedBitmaps/ui/buttons/cmd_firestatefireatwill.png diff --git a/bitmaps/ui/buttons/cmd_firestateholdfire.png b/UnusedBitmaps/ui/buttons/cmd_firestateholdfire.png similarity index 100% rename from bitmaps/ui/buttons/cmd_firestateholdfire.png rename to UnusedBitmaps/ui/buttons/cmd_firestateholdfire.png diff --git a/bitmaps/ui/buttons/cmd_firestatereturnfire.png b/UnusedBitmaps/ui/buttons/cmd_firestatereturnfire.png similarity index 100% rename from bitmaps/ui/buttons/cmd_firestatereturnfire.png rename to UnusedBitmaps/ui/buttons/cmd_firestatereturnfire.png diff --git a/bitmaps/ui/buttons/cmd_guard.png b/UnusedBitmaps/ui/buttons/cmd_guard.png similarity index 100% rename from bitmaps/ui/buttons/cmd_guard.png rename to UnusedBitmaps/ui/buttons/cmd_guard.png diff --git a/bitmaps/ui/buttons/cmd_land.png b/UnusedBitmaps/ui/buttons/cmd_land.png similarity index 100% rename from bitmaps/ui/buttons/cmd_land.png rename to UnusedBitmaps/ui/buttons/cmd_land.png diff --git a/bitmaps/ui/buttons/cmd_load.png b/UnusedBitmaps/ui/buttons/cmd_load.png similarity index 100% rename from bitmaps/ui/buttons/cmd_load.png rename to UnusedBitmaps/ui/buttons/cmd_load.png diff --git a/bitmaps/ui/buttons/cmd_loopbackattack.png b/UnusedBitmaps/ui/buttons/cmd_loopbackattack.png similarity index 100% rename from bitmaps/ui/buttons/cmd_loopbackattack.png rename to UnusedBitmaps/ui/buttons/cmd_loopbackattack.png diff --git a/bitmaps/ui/buttons/cmd_move.png b/UnusedBitmaps/ui/buttons/cmd_move.png similarity index 100% rename from bitmaps/ui/buttons/cmd_move.png rename to UnusedBitmaps/ui/buttons/cmd_move.png diff --git a/bitmaps/ui/buttons/cmd_movestate.png b/UnusedBitmaps/ui/buttons/cmd_movestate.png similarity index 100% rename from bitmaps/ui/buttons/cmd_movestate.png rename to UnusedBitmaps/ui/buttons/cmd_movestate.png diff --git a/bitmaps/ui/buttons/cmd_movestateholdposition.png b/UnusedBitmaps/ui/buttons/cmd_movestateholdposition.png similarity index 100% rename from bitmaps/ui/buttons/cmd_movestateholdposition.png rename to UnusedBitmaps/ui/buttons/cmd_movestateholdposition.png diff --git a/bitmaps/ui/buttons/cmd_movestatemaneuver.png b/UnusedBitmaps/ui/buttons/cmd_movestatemaneuver.png similarity index 100% rename from bitmaps/ui/buttons/cmd_movestatemaneuver.png rename to UnusedBitmaps/ui/buttons/cmd_movestatemaneuver.png diff --git a/bitmaps/ui/buttons/cmd_movestateroam.png b/UnusedBitmaps/ui/buttons/cmd_movestateroam.png similarity index 100% rename from bitmaps/ui/buttons/cmd_movestateroam.png rename to UnusedBitmaps/ui/buttons/cmd_movestateroam.png diff --git a/bitmaps/ui/buttons/cmd_off.png b/UnusedBitmaps/ui/buttons/cmd_off.png similarity index 100% rename from bitmaps/ui/buttons/cmd_off.png rename to UnusedBitmaps/ui/buttons/cmd_off.png diff --git a/bitmaps/ui/buttons/cmd_on.png b/UnusedBitmaps/ui/buttons/cmd_on.png similarity index 100% rename from bitmaps/ui/buttons/cmd_on.png rename to UnusedBitmaps/ui/buttons/cmd_on.png diff --git a/bitmaps/ui/buttons/cmd_patrol.png b/UnusedBitmaps/ui/buttons/cmd_patrol.png similarity index 100% rename from bitmaps/ui/buttons/cmd_patrol.png rename to UnusedBitmaps/ui/buttons/cmd_patrol.png diff --git a/bitmaps/ui/buttons/cmd_priority.png b/UnusedBitmaps/ui/buttons/cmd_priority.png similarity index 100% rename from bitmaps/ui/buttons/cmd_priority.png rename to UnusedBitmaps/ui/buttons/cmd_priority.png diff --git a/bitmaps/ui/buttons/cmd_priorityhigh.png b/UnusedBitmaps/ui/buttons/cmd_priorityhigh.png similarity index 100% rename from bitmaps/ui/buttons/cmd_priorityhigh.png rename to UnusedBitmaps/ui/buttons/cmd_priorityhigh.png diff --git a/bitmaps/ui/buttons/cmd_prioritylow.png b/UnusedBitmaps/ui/buttons/cmd_prioritylow.png similarity index 100% rename from bitmaps/ui/buttons/cmd_prioritylow.png rename to UnusedBitmaps/ui/buttons/cmd_prioritylow.png diff --git a/bitmaps/ui/buttons/cmd_prioritymed.png b/UnusedBitmaps/ui/buttons/cmd_prioritymed.png similarity index 100% rename from bitmaps/ui/buttons/cmd_prioritymed.png rename to UnusedBitmaps/ui/buttons/cmd_prioritymed.png diff --git a/bitmaps/ui/buttons/cmd_reclaim.png b/UnusedBitmaps/ui/buttons/cmd_reclaim.png similarity index 100% rename from bitmaps/ui/buttons/cmd_reclaim.png rename to UnusedBitmaps/ui/buttons/cmd_reclaim.png diff --git a/bitmaps/ui/buttons/cmd_repair.png b/UnusedBitmaps/ui/buttons/cmd_repair.png similarity index 100% rename from bitmaps/ui/buttons/cmd_repair.png rename to UnusedBitmaps/ui/buttons/cmd_repair.png diff --git a/bitmaps/ui/buttons/cmd_repeat.png b/UnusedBitmaps/ui/buttons/cmd_repeat.png similarity index 100% rename from bitmaps/ui/buttons/cmd_repeat.png rename to UnusedBitmaps/ui/buttons/cmd_repeat.png diff --git a/bitmaps/ui/buttons/cmd_repeatoff.png b/UnusedBitmaps/ui/buttons/cmd_repeatoff.png similarity index 100% rename from bitmaps/ui/buttons/cmd_repeatoff.png rename to UnusedBitmaps/ui/buttons/cmd_repeatoff.png diff --git a/bitmaps/ui/buttons/cmd_repeaton.png b/UnusedBitmaps/ui/buttons/cmd_repeaton.png similarity index 100% rename from bitmaps/ui/buttons/cmd_repeaton.png rename to UnusedBitmaps/ui/buttons/cmd_repeaton.png diff --git a/bitmaps/ui/buttons/cmd_restore.png b/UnusedBitmaps/ui/buttons/cmd_restore.png similarity index 100% rename from bitmaps/ui/buttons/cmd_restore.png rename to UnusedBitmaps/ui/buttons/cmd_restore.png diff --git a/bitmaps/ui/buttons/cmd_sell.png b/UnusedBitmaps/ui/buttons/cmd_sell.png similarity index 100% rename from bitmaps/ui/buttons/cmd_sell.png rename to UnusedBitmaps/ui/buttons/cmd_sell.png diff --git a/bitmaps/ui/buttons/cmd_stop.png b/UnusedBitmaps/ui/buttons/cmd_stop.png similarity index 100% rename from bitmaps/ui/buttons/cmd_stop.png rename to UnusedBitmaps/ui/buttons/cmd_stop.png diff --git a/bitmaps/ui/buttons/cmd_trajectory.png b/UnusedBitmaps/ui/buttons/cmd_trajectory.png similarity index 100% rename from bitmaps/ui/buttons/cmd_trajectory.png rename to UnusedBitmaps/ui/buttons/cmd_trajectory.png diff --git a/bitmaps/ui/buttons/cmd_unload.png b/UnusedBitmaps/ui/buttons/cmd_unload.png similarity index 100% rename from bitmaps/ui/buttons/cmd_unload.png rename to UnusedBitmaps/ui/buttons/cmd_unload.png diff --git a/bitmaps/ui/buttons/cmd_wait.png b/UnusedBitmaps/ui/buttons/cmd_wait.png similarity index 100% rename from bitmaps/ui/buttons/cmd_wait.png rename to UnusedBitmaps/ui/buttons/cmd_wait.png diff --git a/bitmaps/ui/buttons/retreat_30.png b/UnusedBitmaps/ui/buttons/retreat_30.png similarity index 100% rename from bitmaps/ui/buttons/retreat_30.png rename to UnusedBitmaps/ui/buttons/retreat_30.png diff --git a/bitmaps/ui/buttons/retreat_60.png b/UnusedBitmaps/ui/buttons/retreat_60.png similarity index 100% rename from bitmaps/ui/buttons/retreat_60.png rename to UnusedBitmaps/ui/buttons/retreat_60.png diff --git a/bitmaps/ui/buttons/retreat_90.png b/UnusedBitmaps/ui/buttons/retreat_90.png similarity index 100% rename from bitmaps/ui/buttons/retreat_90.png rename to UnusedBitmaps/ui/buttons/retreat_90.png diff --git a/bitmaps/ui/buttons/retreat_off.png b/UnusedBitmaps/ui/buttons/retreat_off.png similarity index 100% rename from bitmaps/ui/buttons/retreat_off.png rename to UnusedBitmaps/ui/buttons/retreat_off.png diff --git a/UnusedBitmaps/ui/loadingscreen/5units.png b/UnusedBitmaps/ui/loadingscreen/5units.png new file mode 100644 index 000000000..ed9e8a0ad Binary files /dev/null and b/UnusedBitmaps/ui/loadingscreen/5units.png differ diff --git a/UnusedBitmaps/ui/loadingscreen/awesome.png b/UnusedBitmaps/ui/loadingscreen/awesome.png new file mode 100644 index 000000000..ec9fc96d5 Binary files /dev/null and b/UnusedBitmaps/ui/loadingscreen/awesome.png differ diff --git a/bitmaps/ui/loadingscreen/background1.png b/UnusedBitmaps/ui/loadingscreen/background1.png similarity index 100% rename from bitmaps/ui/loadingscreen/background1.png rename to UnusedBitmaps/ui/loadingscreen/background1.png diff --git a/bitmaps/ui/loadingscreen/background2.png b/UnusedBitmaps/ui/loadingscreen/background2.png similarity index 100% rename from bitmaps/ui/loadingscreen/background2.png rename to UnusedBitmaps/ui/loadingscreen/background2.png diff --git a/bitmaps/ui/loadingscreen/background3.png b/UnusedBitmaps/ui/loadingscreen/background3.png similarity index 100% rename from bitmaps/ui/loadingscreen/background3.png rename to UnusedBitmaps/ui/loadingscreen/background3.png diff --git a/bitmaps/ui/loadingscreen/background4.png b/UnusedBitmaps/ui/loadingscreen/background4.png similarity index 100% rename from bitmaps/ui/loadingscreen/background4.png rename to UnusedBitmaps/ui/loadingscreen/background4.png diff --git a/bitmaps/ui/loadingscreen/background5.png b/UnusedBitmaps/ui/loadingscreen/background5.png similarity index 100% rename from bitmaps/ui/loadingscreen/background5.png rename to UnusedBitmaps/ui/loadingscreen/background5.png diff --git a/bitmaps/ui/loadingscreen/background6.png b/UnusedBitmaps/ui/loadingscreen/background6.png similarity index 100% rename from bitmaps/ui/loadingscreen/background6.png rename to UnusedBitmaps/ui/loadingscreen/background6.png diff --git a/bitmaps/ui/loadingscreen/background7.png b/UnusedBitmaps/ui/loadingscreen/background7.png similarity index 100% rename from bitmaps/ui/loadingscreen/background7.png rename to UnusedBitmaps/ui/loadingscreen/background7.png diff --git a/bitmaps/ui/loadingscreen/background8.png b/UnusedBitmaps/ui/loadingscreen/background8.png similarity index 100% rename from bitmaps/ui/loadingscreen/background8.png rename to UnusedBitmaps/ui/loadingscreen/background8.png diff --git a/bitmaps/ui/loadingscreen/background9.png b/UnusedBitmaps/ui/loadingscreen/background9.png similarity index 100% rename from bitmaps/ui/loadingscreen/background9.png rename to UnusedBitmaps/ui/loadingscreen/background9.png diff --git a/bitmaps/ui/loadingscreen/ebombtip.png b/UnusedBitmaps/ui/loadingscreen/ebombtip.png similarity index 100% rename from bitmaps/ui/loadingscreen/ebombtip.png rename to UnusedBitmaps/ui/loadingscreen/ebombtip.png diff --git a/bitmaps/ui/loadingscreen/edronetip.png b/UnusedBitmaps/ui/loadingscreen/edronetip.png similarity index 100% rename from bitmaps/ui/loadingscreen/edronetip.png rename to UnusedBitmaps/ui/loadingscreen/edronetip.png diff --git a/bitmaps/ui/loadingscreen/eextankdestroyertip.png b/UnusedBitmaps/ui/loadingscreen/eextankdestroyertip.png similarity index 100% rename from bitmaps/ui/loadingscreen/eextankdestroyertip.png rename to UnusedBitmaps/ui/loadingscreen/eextankdestroyertip.png diff --git a/bitmaps/ui/loadingscreen/efusion2tip.png b/UnusedBitmaps/ui/loadingscreen/efusion2tip.png similarity index 100% rename from bitmaps/ui/loadingscreen/efusion2tip.png rename to UnusedBitmaps/ui/loadingscreen/efusion2tip.png diff --git a/bitmaps/ui/loadingscreen/ekmartip.png b/UnusedBitmaps/ui/loadingscreen/ekmartip.png similarity index 100% rename from bitmaps/ui/loadingscreen/ekmartip.png rename to UnusedBitmaps/ui/loadingscreen/ekmartip.png diff --git a/bitmaps/ui/loadingscreen/emetalextractortip.png b/UnusedBitmaps/ui/loadingscreen/emetalextractortip.png similarity index 100% rename from bitmaps/ui/loadingscreen/emetalextractortip.png rename to UnusedBitmaps/ui/loadingscreen/emetalextractortip.png diff --git a/bitmaps/ui/loadingscreen/megusta.png b/UnusedBitmaps/ui/loadingscreen/megusta.png similarity index 100% rename from bitmaps/ui/loadingscreen/megusta.png rename to UnusedBitmaps/ui/loadingscreen/megusta.png diff --git a/bitmaps/ui/loadingscreen/orbtip.png b/UnusedBitmaps/ui/loadingscreen/orbtip.png similarity index 100% rename from bitmaps/ui/loadingscreen/orbtip.png rename to UnusedBitmaps/ui/loadingscreen/orbtip.png diff --git a/UnusedBitmaps/ui/loadingscreen/panels.png b/UnusedBitmaps/ui/loadingscreen/panels.png new file mode 100644 index 000000000..207b1c1e7 Binary files /dev/null and b/UnusedBitmaps/ui/loadingscreen/panels.png differ diff --git a/bitmaps/ui/loadingscreen/rainbows.png b/UnusedBitmaps/ui/loadingscreen/rainbows.png similarity index 100% rename from bitmaps/ui/loadingscreen/rainbows.png rename to UnusedBitmaps/ui/loadingscreen/rainbows.png diff --git a/bitmaps/ui/loadingscreen/repeattip.png b/UnusedBitmaps/ui/loadingscreen/repeattip.png similarity index 100% rename from bitmaps/ui/loadingscreen/repeattip.png rename to UnusedBitmaps/ui/loadingscreen/repeattip.png diff --git a/bitmaps/ui/loadingscreen/tiptemplate.psd b/UnusedBitmaps/ui/loadingscreen/tiptemplate.psd similarity index 100% rename from bitmaps/ui/loadingscreen/tiptemplate.psd rename to UnusedBitmaps/ui/loadingscreen/tiptemplate.psd diff --git a/UnusedBitmaps/ui/manual/1x1trans.png b/UnusedBitmaps/ui/manual/1x1trans.png new file mode 100644 index 000000000..4e0b79134 Binary files /dev/null and b/UnusedBitmaps/ui/manual/1x1trans.png differ diff --git a/UnitTextures/Editor_Daemon.dds b/UnusedUnittextures/Editor_Daemon.dds similarity index 100% rename from UnitTextures/Editor_Daemon.dds rename to UnusedUnittextures/Editor_Daemon.dds diff --git a/UnitTextures/Editor_Daemon_ColorAlpha.dds b/UnusedUnittextures/Editor_Daemon_ColorAlpha.dds similarity index 100% rename from UnitTextures/Editor_Daemon_ColorAlpha.dds rename to UnusedUnittextures/Editor_Daemon_ColorAlpha.dds diff --git a/UnitTextures/amphibfactdecal - Copy.png b/UnusedUnittextures/amphibfactdecal - Copy.png similarity index 100% rename from UnitTextures/amphibfactdecal - Copy.png rename to UnusedUnittextures/amphibfactdecal - Copy.png diff --git a/UnitTextures/amphibfactdecal.png b/UnusedUnittextures/amphibfactdecal.png similarity index 100% rename from UnitTextures/amphibfactdecal.png rename to UnusedUnittextures/amphibfactdecal.png diff --git a/UnitTextures/armregskin.png b/UnusedUnittextures/armregskin.png similarity index 100% rename from UnitTextures/armregskin.png rename to UnusedUnittextures/armregskin.png diff --git a/UnitTextures/armregskinglowy.png b/UnusedUnittextures/armregskinglowy.png similarity index 100% rename from UnitTextures/armregskinglowy.png rename to UnusedUnittextures/armregskinglowy.png diff --git a/UnitTextures/armregskinnormal.png b/UnusedUnittextures/armregskinnormal.png similarity index 100% rename from UnitTextures/armregskinnormal.png rename to UnusedUnittextures/armregskinnormal.png diff --git a/UnitTextures/backup legotex/lego2skin_explorer.png b/UnusedUnittextures/backup legotex/lego2skin_explorer.png similarity index 100% rename from UnitTextures/backup legotex/lego2skin_explorer.png rename to UnusedUnittextures/backup legotex/lego2skin_explorer.png diff --git a/UnitTextures/backup legotex/lego2skin_explorerglowy.png b/UnusedUnittextures/backup legotex/lego2skin_explorerglowy.png similarity index 100% rename from UnitTextures/backup legotex/lego2skin_explorerglowy.png rename to UnusedUnittextures/backup legotex/lego2skin_explorerglowy.png diff --git a/UnitTextures/backup legotex/lego2skin_explorernormal.png b/UnusedUnittextures/backup legotex/lego2skin_explorernormal.png similarity index 100% rename from UnitTextures/backup legotex/lego2skin_explorernormal.png rename to UnusedUnittextures/backup legotex/lego2skin_explorernormal.png diff --git a/UnitTextures/barricade.png b/UnusedUnittextures/barricade.png similarity index 100% rename from UnitTextures/barricade.png rename to UnusedUnittextures/barricade.png diff --git a/UnitTextures/barricadeglowy.png b/UnusedUnittextures/barricadeglowy.png similarity index 100% rename from UnitTextures/barricadeglowy.png rename to UnusedUnittextures/barricadeglowy.png diff --git a/UnitTextures/con_lego.png b/UnusedUnittextures/con_lego.png similarity index 100% rename from UnitTextures/con_lego.png rename to UnusedUnittextures/con_lego.png diff --git a/UnitTextures/con_legoglowy.png b/UnusedUnittextures/con_legoglowy.png similarity index 100% rename from UnitTextures/con_legoglowy.png rename to UnusedUnittextures/con_legoglowy.png diff --git a/UnitTextures/con_legonormal.png b/UnusedUnittextures/con_legonormal.png similarity index 100% rename from UnitTextures/con_legonormal.png rename to UnusedUnittextures/con_legonormal.png diff --git a/UnitTextures/eaatank.png b/UnusedUnittextures/eaatank.png similarity index 100% rename from UnitTextures/eaatank.png rename to UnusedUnittextures/eaatank.png diff --git a/UnitTextures/eaatankglowy.png b/UnusedUnittextures/eaatankglowy.png similarity index 100% rename from UnitTextures/eaatankglowy.png rename to UnusedUnittextures/eaatankglowy.png diff --git a/UnitTextures/eaatanknormal.png b/UnusedUnittextures/eaatanknormal.png similarity index 100% rename from UnitTextures/eaatanknormal.png rename to UnusedUnittextures/eaatanknormal.png diff --git a/UnitTextures/eaaturret.png b/UnusedUnittextures/eaaturret.png similarity index 100% rename from UnitTextures/eaaturret.png rename to UnusedUnittextures/eaaturret.png diff --git a/UnitTextures/eaaturret_aoplane.dds b/UnusedUnittextures/eaaturret_aoplane.dds similarity index 100% rename from UnitTextures/eaaturret_aoplane.dds rename to UnusedUnittextures/eaaturret_aoplane.dds diff --git a/UnitTextures/eaaturretglowy.png b/UnusedUnittextures/eaaturretglowy.png similarity index 100% rename from UnitTextures/eaaturretglowy.png rename to UnusedUnittextures/eaaturretglowy.png diff --git a/UnitTextures/eaaturretnormal.png b/UnusedUnittextures/eaaturretnormal.png similarity index 100% rename from UnitTextures/eaaturretnormal.png rename to UnusedUnittextures/eaaturretnormal.png diff --git a/UnitTextures/eairplant.png b/UnusedUnittextures/eairplant.png similarity index 100% rename from UnitTextures/eairplant.png rename to UnusedUnittextures/eairplant.png diff --git a/UnitTextures/eairplant_aoplane.dds b/UnusedUnittextures/eairplant_aoplane.dds similarity index 100% rename from UnitTextures/eairplant_aoplane.dds rename to UnusedUnittextures/eairplant_aoplane.dds diff --git a/UnitTextures/eairplantglowy.png b/UnusedUnittextures/eairplantglowy.png similarity index 100% rename from UnitTextures/eairplantglowy.png rename to UnusedUnittextures/eairplantglowy.png diff --git a/UnitTextures/eairplantnormal.png b/UnusedUnittextures/eairplantnormal.png similarity index 100% rename from UnitTextures/eairplantnormal.png rename to UnusedUnittextures/eairplantnormal.png diff --git a/UnitTextures/eallterrheavy.png b/UnusedUnittextures/eallterrheavy.png similarity index 100% rename from UnitTextures/eallterrheavy.png rename to UnusedUnittextures/eallterrheavy.png diff --git a/UnitTextures/eallterrheavyglowy.png b/UnusedUnittextures/eallterrheavyglowy.png similarity index 100% rename from UnitTextures/eallterrheavyglowy.png rename to UnusedUnittextures/eallterrheavyglowy.png diff --git a/UnitTextures/eallterrheavynormal.png b/UnusedUnittextures/eallterrheavynormal.png similarity index 100% rename from UnitTextures/eallterrheavynormal.png rename to UnusedUnittextures/eallterrheavynormal.png diff --git a/UnitTextures/eallterrlight.png b/UnusedUnittextures/eallterrlight.png similarity index 100% rename from UnitTextures/eallterrlight.png rename to UnusedUnittextures/eallterrlight.png diff --git a/UnitTextures/eallterrlightglowy.png b/UnusedUnittextures/eallterrlightglowy.png similarity index 100% rename from UnitTextures/eallterrlightglowy.png rename to UnusedUnittextures/eallterrlightglowy.png diff --git a/UnitTextures/eallterrlightnormal.png b/UnusedUnittextures/eallterrlightnormal.png similarity index 100% rename from UnitTextures/eallterrlightnormal.png rename to UnusedUnittextures/eallterrlightnormal.png diff --git a/UnitTextures/eallterrmed.png b/UnusedUnittextures/eallterrmed.png similarity index 100% rename from UnitTextures/eallterrmed.png rename to UnusedUnittextures/eallterrmed.png diff --git a/UnitTextures/eallterrmedglowy.png b/UnusedUnittextures/eallterrmedglowy.png similarity index 100% rename from UnitTextures/eallterrmedglowy.png rename to UnusedUnittextures/eallterrmedglowy.png diff --git a/UnitTextures/eallterrmednormal.png b/UnusedUnittextures/eallterrmednormal.png similarity index 100% rename from UnitTextures/eallterrmednormal.png rename to UnusedUnittextures/eallterrmednormal.png diff --git a/UnitTextures/eallterrriot.png b/UnusedUnittextures/eallterrriot.png similarity index 100% rename from UnitTextures/eallterrriot.png rename to UnusedUnittextures/eallterrriot.png diff --git a/UnitTextures/eallterrriotglowy.png b/UnusedUnittextures/eallterrriotglowy.png similarity index 100% rename from UnitTextures/eallterrriotglowy.png rename to UnusedUnittextures/eallterrriotglowy.png diff --git a/UnitTextures/eallterrriotnormal.png b/UnusedUnittextures/eallterrriotnormal.png similarity index 100% rename from UnitTextures/eallterrriotnormal.png rename to UnusedUnittextures/eallterrriotnormal.png diff --git a/UnitTextures/eamphibarty.png b/UnusedUnittextures/eamphibarty.png similarity index 100% rename from UnitTextures/eamphibarty.png rename to UnusedUnittextures/eamphibarty.png diff --git a/UnitTextures/eamphibartyglowy.png b/UnusedUnittextures/eamphibartyglowy.png similarity index 100% rename from UnitTextures/eamphibartyglowy.png rename to UnusedUnittextures/eamphibartyglowy.png diff --git a/UnitTextures/eamphibartynormal.png b/UnusedUnittextures/eamphibartynormal.png similarity index 100% rename from UnitTextures/eamphibartynormal.png rename to UnusedUnittextures/eamphibartynormal.png diff --git a/UnitTextures/eamphibbuggy.png b/UnusedUnittextures/eamphibbuggy.png similarity index 100% rename from UnitTextures/eamphibbuggy.png rename to UnusedUnittextures/eamphibbuggy.png diff --git a/UnitTextures/eamphibbuggyglowy.png b/UnusedUnittextures/eamphibbuggyglowy.png similarity index 100% rename from UnitTextures/eamphibbuggyglowy.png rename to UnusedUnittextures/eamphibbuggyglowy.png diff --git a/UnitTextures/eamphibbuggynormal.png b/UnusedUnittextures/eamphibbuggynormal.png similarity index 100% rename from UnitTextures/eamphibbuggynormal.png rename to UnusedUnittextures/eamphibbuggynormal.png diff --git a/UnitTextures/eamphibengineer.png b/UnusedUnittextures/eamphibengineer.png similarity index 100% rename from UnitTextures/eamphibengineer.png rename to UnusedUnittextures/eamphibengineer.png diff --git a/UnitTextures/eamphibengineerglowy.png b/UnusedUnittextures/eamphibengineerglowy.png similarity index 100% rename from UnitTextures/eamphibengineerglowy.png rename to UnusedUnittextures/eamphibengineerglowy.png diff --git a/UnitTextures/eamphibengineernormal.png b/UnusedUnittextures/eamphibengineernormal.png similarity index 100% rename from UnitTextures/eamphibengineernormal.png rename to UnusedUnittextures/eamphibengineernormal.png diff --git a/UnitTextures/eamphibfac.png b/UnusedUnittextures/eamphibfac.png similarity index 100% rename from UnitTextures/eamphibfac.png rename to UnusedUnittextures/eamphibfac.png diff --git a/UnitTextures/eamphibfac_aoplane.dds b/UnusedUnittextures/eamphibfac_aoplane.dds similarity index 100% rename from UnitTextures/eamphibfac_aoplane.dds rename to UnusedUnittextures/eamphibfac_aoplane.dds diff --git a/UnitTextures/eamphibfacglowy.png b/UnusedUnittextures/eamphibfacglowy.png similarity index 100% rename from UnitTextures/eamphibfacglowy.png rename to UnusedUnittextures/eamphibfacglowy.png diff --git a/UnitTextures/eamphibfacnormal.png b/UnusedUnittextures/eamphibfacnormal.png similarity index 100% rename from UnitTextures/eamphibfacnormal.png rename to UnusedUnittextures/eamphibfacnormal.png diff --git a/UnitTextures/eamphibmedtank.png b/UnusedUnittextures/eamphibmedtank.png similarity index 100% rename from UnitTextures/eamphibmedtank.png rename to UnusedUnittextures/eamphibmedtank.png diff --git a/UnitTextures/eamphibmedtankglowy.png b/UnusedUnittextures/eamphibmedtankglowy.png similarity index 100% rename from UnitTextures/eamphibmedtankglowy.png rename to UnusedUnittextures/eamphibmedtankglowy.png diff --git a/UnitTextures/eamphibmedtanknormal.png b/UnusedUnittextures/eamphibmedtanknormal.png similarity index 100% rename from UnitTextures/eamphibmedtanknormal.png rename to UnusedUnittextures/eamphibmedtanknormal.png diff --git a/UnitTextures/eamphibriot.png b/UnusedUnittextures/eamphibriot.png similarity index 100% rename from UnitTextures/eamphibriot.png rename to UnusedUnittextures/eamphibriot.png diff --git a/UnitTextures/eamphibriotglowy.png b/UnusedUnittextures/eamphibriotglowy.png similarity index 100% rename from UnitTextures/eamphibriotglowy.png rename to UnusedUnittextures/eamphibriotglowy.png diff --git a/UnitTextures/eamphibriotnormal.png b/UnusedUnittextures/eamphibriotnormal.png similarity index 100% rename from UnitTextures/eamphibriotnormal.png rename to UnusedUnittextures/eamphibriotnormal.png diff --git a/UnitTextures/eamphibrock.png b/UnusedUnittextures/eamphibrock.png similarity index 100% rename from UnitTextures/eamphibrock.png rename to UnusedUnittextures/eamphibrock.png diff --git a/UnitTextures/eamphibrockglowy.png b/UnusedUnittextures/eamphibrockglowy.png similarity index 100% rename from UnitTextures/eamphibrockglowy.png rename to UnusedUnittextures/eamphibrockglowy.png diff --git a/UnitTextures/eamphibrocknormal.png b/UnusedUnittextures/eamphibrocknormal.png similarity index 100% rename from UnitTextures/eamphibrocknormal.png rename to UnusedUnittextures/eamphibrocknormal.png diff --git a/UnitTextures/eartytank.png b/UnusedUnittextures/eartytank.png similarity index 100% rename from UnitTextures/eartytank.png rename to UnusedUnittextures/eartytank.png diff --git a/UnitTextures/eartytankglowy.png b/UnusedUnittextures/eartytankglowy.png similarity index 100% rename from UnitTextures/eartytankglowy.png rename to UnusedUnittextures/eartytankglowy.png diff --git a/UnitTextures/eartytanknormal.png b/UnusedUnittextures/eartytanknormal.png similarity index 100% rename from UnitTextures/eartytanknormal.png rename to UnusedUnittextures/eartytanknormal.png diff --git a/UnitTextures/ebarricade.png b/UnusedUnittextures/ebarricade.png similarity index 100% rename from UnitTextures/ebarricade.png rename to UnusedUnittextures/ebarricade.png diff --git a/UnitTextures/ebarricade_aoplane.dds b/UnusedUnittextures/ebarricade_aoplane.dds similarity index 100% rename from UnitTextures/ebarricade_aoplane.dds rename to UnusedUnittextures/ebarricade_aoplane.dds diff --git a/UnitTextures/ebarricadeglowy.png b/UnusedUnittextures/ebarricadeglowy.png similarity index 100% rename from UnitTextures/ebarricadeglowy.png rename to UnusedUnittextures/ebarricadeglowy.png diff --git a/UnitTextures/ebarricadenormal.png b/UnusedUnittextures/ebarricadenormal.png similarity index 100% rename from UnitTextures/ebarricadenormal.png rename to UnusedUnittextures/ebarricadenormal.png diff --git a/UnitTextures/ebasefactory.png b/UnusedUnittextures/ebasefactory.png similarity index 100% rename from UnitTextures/ebasefactory.png rename to UnusedUnittextures/ebasefactory.png diff --git a/UnitTextures/ebasefactory_aoplane.dds b/UnusedUnittextures/ebasefactory_aoplane.dds similarity index 100% rename from UnitTextures/ebasefactory_aoplane.dds rename to UnusedUnittextures/ebasefactory_aoplane.dds diff --git a/UnitTextures/ebasefactoryglowy.png b/UnusedUnittextures/ebasefactoryglowy.png similarity index 100% rename from UnitTextures/ebasefactoryglowy.png rename to UnusedUnittextures/ebasefactoryglowy.png diff --git a/UnitTextures/ebasefactorynormal.png b/UnusedUnittextures/ebasefactorynormal.png similarity index 100% rename from UnitTextures/ebasefactorynormal.png rename to UnusedUnittextures/ebasefactorynormal.png diff --git a/UnitTextures/ebomb.png b/UnusedUnittextures/ebomb.png similarity index 100% rename from UnitTextures/ebomb.png rename to UnusedUnittextures/ebomb.png diff --git a/UnitTextures/ebomber.png b/UnusedUnittextures/ebomber.png similarity index 100% rename from UnitTextures/ebomber.png rename to UnusedUnittextures/ebomber.png diff --git a/UnitTextures/ebomberglowy.png b/UnusedUnittextures/ebomberglowy.png similarity index 100% rename from UnitTextures/ebomberglowy.png rename to UnusedUnittextures/ebomberglowy.png diff --git a/UnitTextures/ebombernormal.png b/UnusedUnittextures/ebombernormal.png similarity index 100% rename from UnitTextures/ebombernormal.png rename to UnusedUnittextures/ebombernormal.png diff --git a/UnitTextures/ebombglowy.png b/UnusedUnittextures/ebombglowy.png similarity index 100% rename from UnitTextures/ebombglowy.png rename to UnusedUnittextures/ebombglowy.png diff --git a/UnitTextures/ebombnormal.png b/UnusedUnittextures/ebombnormal.png similarity index 100% rename from UnitTextures/ebombnormal.png rename to UnusedUnittextures/ebombnormal.png diff --git a/UnitTextures/ecommandfactory_aoplane.dds b/UnusedUnittextures/ecommandfactory_aoplane.dds similarity index 100% rename from UnitTextures/ecommandfactory_aoplane.dds rename to UnusedUnittextures/ecommandfactory_aoplane.dds diff --git a/UnitTextures/edrone.png b/UnusedUnittextures/edrone.png similarity index 100% rename from UnitTextures/edrone.png rename to UnusedUnittextures/edrone.png diff --git a/UnitTextures/edroneglowy.png b/UnusedUnittextures/edroneglowy.png similarity index 100% rename from UnitTextures/edroneglowy.png rename to UnusedUnittextures/edroneglowy.png diff --git a/UnitTextures/edronenormal.png b/UnusedUnittextures/edronenormal.png similarity index 100% rename from UnitTextures/edronenormal.png rename to UnusedUnittextures/edronenormal.png diff --git a/UnitTextures/eengineer4.png b/UnusedUnittextures/eengineer4.png similarity index 100% rename from UnitTextures/eengineer4.png rename to UnusedUnittextures/eengineer4.png diff --git a/UnitTextures/eengineer4glowy.png b/UnusedUnittextures/eengineer4glowy.png similarity index 100% rename from UnitTextures/eengineer4glowy.png rename to UnusedUnittextures/eengineer4glowy.png diff --git a/UnitTextures/efatso2.png b/UnusedUnittextures/efatso2.png similarity index 100% rename from UnitTextures/efatso2.png rename to UnusedUnittextures/efatso2.png diff --git a/UnitTextures/efatso2glowy.png b/UnusedUnittextures/efatso2glowy.png similarity index 100% rename from UnitTextures/efatso2glowy.png rename to UnusedUnittextures/efatso2glowy.png diff --git a/UnitTextures/efatso2normal.png b/UnusedUnittextures/efatso2normal.png similarity index 100% rename from UnitTextures/efatso2normal.png rename to UnusedUnittextures/efatso2normal.png diff --git a/UnitTextures/efighter.png b/UnusedUnittextures/efighter.png similarity index 100% rename from UnitTextures/efighter.png rename to UnusedUnittextures/efighter.png diff --git a/UnitTextures/efighterglowy.png b/UnusedUnittextures/efighterglowy.png similarity index 100% rename from UnitTextures/efighterglowy.png rename to UnusedUnittextures/efighterglowy.png diff --git a/UnitTextures/efighternormal.png b/UnusedUnittextures/efighternormal.png similarity index 100% rename from UnitTextures/efighternormal.png rename to UnusedUnittextures/efighternormal.png diff --git a/UnitTextures/eflametank.png b/UnusedUnittextures/eflametank.png similarity index 100% rename from UnitTextures/eflametank.png rename to UnusedUnittextures/eflametank.png diff --git a/UnitTextures/eflametankglowy.png b/UnusedUnittextures/eflametankglowy.png similarity index 100% rename from UnitTextures/eflametankglowy.png rename to UnusedUnittextures/eflametankglowy.png diff --git a/UnitTextures/eflametanknormal.png b/UnusedUnittextures/eflametanknormal.png similarity index 100% rename from UnitTextures/eflametanknormal.png rename to UnusedUnittextures/eflametanknormal.png diff --git a/UnitTextures/efusion2.png b/UnusedUnittextures/efusion2.png similarity index 100% rename from UnitTextures/efusion2.png rename to UnusedUnittextures/efusion2.png diff --git a/UnitTextures/efusion2_aoplane.dds b/UnusedUnittextures/efusion2_aoplane.dds similarity index 100% rename from UnitTextures/efusion2_aoplane.dds rename to UnusedUnittextures/efusion2_aoplane.dds diff --git a/UnitTextures/efusion2glowy.png b/UnusedUnittextures/efusion2glowy.png similarity index 100% rename from UnitTextures/efusion2glowy.png rename to UnusedUnittextures/efusion2glowy.png diff --git a/UnitTextures/efusion2normal.png b/UnusedUnittextures/efusion2normal.png similarity index 100% rename from UnitTextures/efusion2normal.png rename to UnusedUnittextures/efusion2normal.png diff --git a/UnitTextures/egeothermal.png b/UnusedUnittextures/egeothermal.png similarity index 100% rename from UnitTextures/egeothermal.png rename to UnusedUnittextures/egeothermal.png diff --git a/UnitTextures/egeothermal_aoplane.dds b/UnusedUnittextures/egeothermal_aoplane.dds similarity index 100% rename from UnitTextures/egeothermal_aoplane.dds rename to UnusedUnittextures/egeothermal_aoplane.dds diff --git a/UnitTextures/egeothermalglowy.png b/UnusedUnittextures/egeothermalglowy.png similarity index 100% rename from UnitTextures/egeothermalglowy.png rename to UnusedUnittextures/egeothermalglowy.png diff --git a/UnitTextures/egeothermalnormal.png b/UnusedUnittextures/egeothermalnormal.png similarity index 100% rename from UnitTextures/egeothermalnormal.png rename to UnusedUnittextures/egeothermalnormal.png diff --git a/UnitTextures/egunship2.png b/UnusedUnittextures/egunship2.png similarity index 100% rename from UnitTextures/egunship2.png rename to UnusedUnittextures/egunship2.png diff --git a/UnitTextures/egunship2glowy.png b/UnusedUnittextures/egunship2glowy.png similarity index 100% rename from UnitTextures/egunship2glowy.png rename to UnusedUnittextures/egunship2glowy.png diff --git a/UnitTextures/egunship2normal.png b/UnusedUnittextures/egunship2normal.png similarity index 100% rename from UnitTextures/egunship2normal.png rename to UnusedUnittextures/egunship2normal.png diff --git a/UnitTextures/eheavytank3.png b/UnusedUnittextures/eheavytank3.png similarity index 100% rename from UnitTextures/eheavytank3.png rename to UnusedUnittextures/eheavytank3.png diff --git a/UnitTextures/eheavytank3glowy.png b/UnusedUnittextures/eheavytank3glowy.png similarity index 100% rename from UnitTextures/eheavytank3glowy.png rename to UnusedUnittextures/eheavytank3glowy.png diff --git a/UnitTextures/eheavytank3normal.png b/UnusedUnittextures/eheavytank3normal.png similarity index 100% rename from UnitTextures/eheavytank3normal.png rename to UnusedUnittextures/eheavytank3normal.png diff --git a/UnitTextures/eheavyturret2.png b/UnusedUnittextures/eheavyturret2.png similarity index 100% rename from UnitTextures/eheavyturret2.png rename to UnusedUnittextures/eheavyturret2.png diff --git a/UnitTextures/eheavyturret2_aoplane.dds b/UnusedUnittextures/eheavyturret2_aoplane.dds similarity index 100% rename from UnitTextures/eheavyturret2_aoplane.dds rename to UnusedUnittextures/eheavyturret2_aoplane.dds diff --git a/UnitTextures/eheavyturret2glowy.png b/UnusedUnittextures/eheavyturret2glowy.png similarity index 100% rename from UnitTextures/eheavyturret2glowy.png rename to UnusedUnittextures/eheavyturret2glowy.png diff --git a/UnitTextures/eheavyturret2normal.png b/UnusedUnittextures/eheavyturret2normal.png similarity index 100% rename from UnitTextures/eheavyturret2normal.png rename to UnusedUnittextures/eheavyturret2normal.png diff --git a/UnitTextures/ejammer2.png b/UnusedUnittextures/ejammer2.png similarity index 100% rename from UnitTextures/ejammer2.png rename to UnusedUnittextures/ejammer2.png diff --git a/UnitTextures/ejammer2_aoplane.dds b/UnusedUnittextures/ejammer2_aoplane.dds similarity index 100% rename from UnitTextures/ejammer2_aoplane.dds rename to UnusedUnittextures/ejammer2_aoplane.dds diff --git a/UnitTextures/ejammer2glowy.png b/UnusedUnittextures/ejammer2glowy.png similarity index 100% rename from UnitTextures/ejammer2glowy.png rename to UnusedUnittextures/ejammer2glowy.png diff --git a/UnitTextures/ejammer2normal.png b/UnusedUnittextures/ejammer2normal.png similarity index 100% rename from UnitTextures/ejammer2normal.png rename to UnusedUnittextures/ejammer2normal.png diff --git a/UnitTextures/elighttank3 - (2).png b/UnusedUnittextures/elighttank3 - (2).png similarity index 100% rename from UnitTextures/elighttank3 - (2).png rename to UnusedUnittextures/elighttank3 - (2).png diff --git a/UnitTextures/elighttank3.png b/UnusedUnittextures/elighttank3.png similarity index 100% rename from UnitTextures/elighttank3.png rename to UnusedUnittextures/elighttank3.png diff --git a/UnitTextures/elighttank3glowy.png b/UnusedUnittextures/elighttank3glowy.png similarity index 100% rename from UnitTextures/elighttank3glowy.png rename to UnusedUnittextures/elighttank3glowy.png diff --git a/UnitTextures/elighttank3normal.png b/UnusedUnittextures/elighttank3normal.png similarity index 100% rename from UnitTextures/elighttank3normal.png rename to UnusedUnittextures/elighttank3normal.png diff --git a/UnitTextures/elightturret2.png b/UnusedUnittextures/elightturret2.png similarity index 100% rename from UnitTextures/elightturret2.png rename to UnusedUnittextures/elightturret2.png diff --git a/UnitTextures/elightturret2_aoplane.dds b/UnusedUnittextures/elightturret2_aoplane.dds similarity index 100% rename from UnitTextures/elightturret2_aoplane.dds rename to UnusedUnittextures/elightturret2_aoplane.dds diff --git a/UnitTextures/elightturret2glowy.png b/UnusedUnittextures/elightturret2glowy.png similarity index 100% rename from UnitTextures/elightturret2glowy.png rename to UnusedUnittextures/elightturret2glowy.png diff --git a/UnitTextures/elightturret2normal.png b/UnusedUnittextures/elightturret2normal.png similarity index 100% rename from UnitTextures/elightturret2normal.png rename to UnusedUnittextures/elightturret2normal.png diff --git a/UnitTextures/elightturretglowy.png b/UnusedUnittextures/elightturretglowy.png similarity index 100% rename from UnitTextures/elightturretglowy.png rename to UnusedUnittextures/elightturretglowy.png diff --git a/UnitTextures/elrpc.png b/UnusedUnittextures/elrpc.png similarity index 100% rename from UnitTextures/elrpc.png rename to UnusedUnittextures/elrpc.png diff --git a/UnitTextures/elrpc_aoplane.dds b/UnusedUnittextures/elrpc_aoplane.dds similarity index 100% rename from UnitTextures/elrpc_aoplane.dds rename to UnusedUnittextures/elrpc_aoplane.dds diff --git a/UnitTextures/elrpcglowy.png b/UnusedUnittextures/elrpcglowy.png similarity index 100% rename from UnitTextures/elrpcglowy.png rename to UnusedUnittextures/elrpcglowy.png diff --git a/UnitTextures/elrpcnormal.png b/UnusedUnittextures/elrpcnormal.png similarity index 100% rename from UnitTextures/elrpcnormal.png rename to UnusedUnittextures/elrpcnormal.png diff --git a/UnitTextures/emaker.png b/UnusedUnittextures/emaker.png similarity index 100% rename from UnitTextures/emaker.png rename to UnusedUnittextures/emaker.png diff --git a/UnitTextures/emaker_aoplane.dds b/UnusedUnittextures/emaker_aoplane.dds similarity index 100% rename from UnitTextures/emaker_aoplane.dds rename to UnusedUnittextures/emaker_aoplane.dds diff --git a/UnitTextures/emakerglowy.png b/UnusedUnittextures/emakerglowy.png similarity index 100% rename from UnitTextures/emakerglowy.png rename to UnusedUnittextures/emakerglowy.png diff --git a/UnitTextures/emakernormal.png b/UnusedUnittextures/emakernormal.png similarity index 100% rename from UnitTextures/emakernormal.png rename to UnusedUnittextures/emakernormal.png diff --git a/UnitTextures/emediumtank3.png b/UnusedUnittextures/emediumtank3.png similarity index 100% rename from UnitTextures/emediumtank3.png rename to UnusedUnittextures/emediumtank3.png diff --git a/UnitTextures/emediumtank3glowy.png b/UnusedUnittextures/emediumtank3glowy.png similarity index 100% rename from UnitTextures/emediumtank3glowy.png rename to UnusedUnittextures/emediumtank3glowy.png diff --git a/UnitTextures/emediumtank3normal.png b/UnusedUnittextures/emediumtank3normal.png similarity index 100% rename from UnitTextures/emediumtank3normal.png rename to UnusedUnittextures/emediumtank3normal.png diff --git a/UnitTextures/emetalextractor.png b/UnusedUnittextures/emetalextractor.png similarity index 100% rename from UnitTextures/emetalextractor.png rename to UnusedUnittextures/emetalextractor.png diff --git a/UnitTextures/emetalextractor_aoplane.dds b/UnusedUnittextures/emetalextractor_aoplane.dds similarity index 100% rename from UnitTextures/emetalextractor_aoplane.dds rename to UnusedUnittextures/emetalextractor_aoplane.dds diff --git a/UnitTextures/emetalextractorglowy.png b/UnusedUnittextures/emetalextractorglowy.png similarity index 100% rename from UnitTextures/emetalextractorglowy.png rename to UnusedUnittextures/emetalextractorglowy.png diff --git a/UnitTextures/emetalextractornormal.png b/UnusedUnittextures/emetalextractornormal.png similarity index 100% rename from UnitTextures/emetalextractornormal.png rename to UnusedUnittextures/emetalextractornormal.png diff --git a/UnitTextures/eminifac.png b/UnusedUnittextures/eminifac.png similarity index 100% rename from UnitTextures/eminifac.png rename to UnusedUnittextures/eminifac.png diff --git a/UnitTextures/eminifac_aoplane.dds b/UnusedUnittextures/eminifac_aoplane.dds similarity index 100% rename from UnitTextures/eminifac_aoplane.dds rename to UnusedUnittextures/eminifac_aoplane.dds diff --git a/UnitTextures/eminifacglowy.png b/UnusedUnittextures/eminifacglowy.png similarity index 100% rename from UnitTextures/eminifacglowy.png rename to UnusedUnittextures/eminifacglowy.png diff --git a/UnitTextures/eminifacnormal.png b/UnusedUnittextures/eminifacnormal.png similarity index 100% rename from UnitTextures/eminifacnormal.png rename to UnusedUnittextures/eminifacnormal.png diff --git a/UnitTextures/emissiletank.png b/UnusedUnittextures/emissiletank.png similarity index 100% rename from UnitTextures/emissiletank.png rename to UnusedUnittextures/emissiletank.png diff --git a/UnitTextures/emissiletankglowy.png b/UnusedUnittextures/emissiletankglowy.png similarity index 100% rename from UnitTextures/emissiletankglowy.png rename to UnusedUnittextures/emissiletankglowy.png diff --git a/UnitTextures/emissiletanknormal.png b/UnusedUnittextures/emissiletanknormal.png similarity index 100% rename from UnitTextures/emissiletanknormal.png rename to UnusedUnittextures/emissiletanknormal.png diff --git a/UnitTextures/eorb.png b/UnusedUnittextures/eorb.png similarity index 100% rename from UnitTextures/eorb.png rename to UnusedUnittextures/eorb.png diff --git a/UnitTextures/eorbglowy.png b/UnusedUnittextures/eorbglowy.png similarity index 100% rename from UnitTextures/eorbglowy.png rename to UnusedUnittextures/eorbglowy.png diff --git a/UnitTextures/eorbnormal.png b/UnusedUnittextures/eorbnormal.png similarity index 100% rename from UnitTextures/eorbnormal.png rename to UnusedUnittextures/eorbnormal.png diff --git a/UnitTextures/eradar2.png b/UnusedUnittextures/eradar2.png similarity index 100% rename from UnitTextures/eradar2.png rename to UnusedUnittextures/eradar2.png diff --git a/UnitTextures/eradar2_aoplane.dds b/UnusedUnittextures/eradar2_aoplane.dds similarity index 100% rename from UnitTextures/eradar2_aoplane.dds rename to UnusedUnittextures/eradar2_aoplane.dds diff --git a/UnitTextures/eradar2glowy.png b/UnusedUnittextures/eradar2glowy.png similarity index 100% rename from UnitTextures/eradar2glowy.png rename to UnusedUnittextures/eradar2glowy.png diff --git a/UnitTextures/eradar2normal.png b/UnusedUnittextures/eradar2normal.png similarity index 100% rename from UnitTextures/eradar2normal.png rename to UnusedUnittextures/eradar2normal.png diff --git a/UnitTextures/eriottank2.png b/UnusedUnittextures/eriottank2.png similarity index 100% rename from UnitTextures/eriottank2.png rename to UnusedUnittextures/eriottank2.png diff --git a/UnitTextures/eriottank2glowy.png b/UnusedUnittextures/eriottank2glowy.png similarity index 100% rename from UnitTextures/eriottank2glowy.png rename to UnusedUnittextures/eriottank2glowy.png diff --git a/UnitTextures/eriottank2normal.png b/UnusedUnittextures/eriottank2normal.png similarity index 100% rename from UnitTextures/eriottank2normal.png rename to UnusedUnittextures/eriottank2normal.png diff --git a/UnitTextures/escout.png b/UnusedUnittextures/escout.png similarity index 100% rename from UnitTextures/escout.png rename to UnusedUnittextures/escout.png diff --git a/UnitTextures/escoutglowy.png b/UnusedUnittextures/escoutglowy.png similarity index 100% rename from UnitTextures/escoutglowy.png rename to UnusedUnittextures/escoutglowy.png diff --git a/UnitTextures/escoutnormal.png b/UnusedUnittextures/escoutnormal.png similarity index 100% rename from UnitTextures/escoutnormal.png rename to UnusedUnittextures/escoutnormal.png diff --git a/UnitTextures/eshieldgen.png b/UnusedUnittextures/eshieldgen.png similarity index 100% rename from UnitTextures/eshieldgen.png rename to UnusedUnittextures/eshieldgen.png diff --git a/UnitTextures/eshieldgen_aoplane.dds b/UnusedUnittextures/eshieldgen_aoplane.dds similarity index 100% rename from UnitTextures/eshieldgen_aoplane.dds rename to UnusedUnittextures/eshieldgen_aoplane.dds diff --git a/UnitTextures/eshieldgenglowy.png b/UnusedUnittextures/eshieldgenglowy.png similarity index 100% rename from UnitTextures/eshieldgenglowy.png rename to UnusedUnittextures/eshieldgenglowy.png diff --git a/UnitTextures/eshieldgennormal.png b/UnusedUnittextures/eshieldgennormal.png similarity index 100% rename from UnitTextures/eshieldgennormal.png rename to UnusedUnittextures/eshieldgennormal.png diff --git a/UnusedUnittextures/esilo.png b/UnusedUnittextures/esilo.png new file mode 100644 index 000000000..b844179de Binary files /dev/null and b/UnusedUnittextures/esilo.png differ diff --git a/UnitTextures/esilo_aoplane.dds b/UnusedUnittextures/esilo_aoplane.dds similarity index 100% rename from UnitTextures/esilo_aoplane.dds rename to UnusedUnittextures/esilo_aoplane.dds diff --git a/UnusedUnittextures/esiloglowy.png b/UnusedUnittextures/esiloglowy.png new file mode 100644 index 000000000..f48899be4 Binary files /dev/null and b/UnusedUnittextures/esiloglowy.png differ diff --git a/UnitTextures/esilonormal.png b/UnusedUnittextures/esilonormal.png similarity index 100% rename from UnitTextures/esilonormal.png rename to UnusedUnittextures/esilonormal.png diff --git a/UnitTextures/esolar2.png b/UnusedUnittextures/esolar2.png similarity index 100% rename from UnitTextures/esolar2.png rename to UnusedUnittextures/esolar2.png diff --git a/UnitTextures/esolar2_aoplane.dds b/UnusedUnittextures/esolar2_aoplane.dds similarity index 100% rename from UnitTextures/esolar2_aoplane.dds rename to UnusedUnittextures/esolar2_aoplane.dds diff --git a/UnitTextures/esolar2glowy.png b/UnusedUnittextures/esolar2glowy.png similarity index 100% rename from UnitTextures/esolar2glowy.png rename to UnusedUnittextures/esolar2glowy.png diff --git a/UnitTextures/esolar2normal.png b/UnusedUnittextures/esolar2normal.png similarity index 100% rename from UnitTextures/esolar2normal.png rename to UnusedUnittextures/esolar2normal.png diff --git a/UnitTextures/estorage.png b/UnusedUnittextures/estorage.png similarity index 100% rename from UnitTextures/estorage.png rename to UnusedUnittextures/estorage.png diff --git a/UnitTextures/estorage_aoplane.dds b/UnusedUnittextures/estorage_aoplane.dds similarity index 100% rename from UnitTextures/estorage_aoplane.dds rename to UnusedUnittextures/estorage_aoplane.dds diff --git a/UnitTextures/estorageglowy.png b/UnusedUnittextures/estorageglowy.png similarity index 100% rename from UnitTextures/estorageglowy.png rename to UnusedUnittextures/estorageglowy.png diff --git a/UnitTextures/estoragenormal.png b/UnusedUnittextures/estoragenormal.png similarity index 100% rename from UnitTextures/estoragenormal.png rename to UnusedUnittextures/estoragenormal.png diff --git a/UnitTextures/esubplane.png b/UnusedUnittextures/esubplane.png similarity index 100% rename from UnitTextures/esubplane.png rename to UnusedUnittextures/esubplane.png diff --git a/UnitTextures/esubplaneglowy.png b/UnusedUnittextures/esubplaneglowy.png similarity index 100% rename from UnitTextures/esubplaneglowy.png rename to UnusedUnittextures/esubplaneglowy.png diff --git a/UnitTextures/esubplanenormal.png b/UnusedUnittextures/esubplanenormal.png similarity index 100% rename from UnitTextures/esubplanenormal.png rename to UnusedUnittextures/esubplanenormal.png diff --git a/UnitTextures/etransport.png b/UnusedUnittextures/etransport.png similarity index 100% rename from UnitTextures/etransport.png rename to UnusedUnittextures/etransport.png diff --git a/UnitTextures/etransport2.png b/UnusedUnittextures/etransport2.png similarity index 100% rename from UnitTextures/etransport2.png rename to UnusedUnittextures/etransport2.png diff --git a/UnitTextures/etransport2glowy.png b/UnusedUnittextures/etransport2glowy.png similarity index 100% rename from UnitTextures/etransport2glowy.png rename to UnusedUnittextures/etransport2glowy.png diff --git a/UnitTextures/etransport2normal.png b/UnusedUnittextures/etransport2normal.png similarity index 100% rename from UnitTextures/etransport2normal.png rename to UnusedUnittextures/etransport2normal.png diff --git a/UnitTextures/etransportglowy.png b/UnusedUnittextures/etransportglowy.png similarity index 100% rename from UnitTextures/etransportglowy.png rename to UnusedUnittextures/etransportglowy.png diff --git a/UnitTextures/euwfusion2_aoplane.dds b/UnusedUnittextures/euwfusion2_aoplane.dds similarity index 100% rename from UnitTextures/euwfusion2_aoplane.dds rename to UnusedUnittextures/euwfusion2_aoplane.dds diff --git a/UnitTextures/euwmetalextractor_aoplane.dds b/UnusedUnittextures/euwmetalextractor_aoplane.dds similarity index 100% rename from UnitTextures/euwmetalextractor_aoplane.dds rename to UnusedUnittextures/euwmetalextractor_aoplane.dds diff --git a/UnitTextures/euwsolar2_aoplane.dds b/UnusedUnittextures/euwsolar2_aoplane.dds similarity index 100% rename from UnitTextures/euwsolar2_aoplane.dds rename to UnusedUnittextures/euwsolar2_aoplane.dds diff --git a/UnitTextures/euwstorage_aoplane.dds b/UnusedUnittextures/euwstorage_aoplane.dds similarity index 100% rename from UnitTextures/euwstorage_aoplane.dds rename to UnusedUnittextures/euwstorage_aoplane.dds diff --git a/UnitTextures/experimentalfacgroundplate.png b/UnusedUnittextures/experimentalfacgroundplate.png similarity index 100% rename from UnitTextures/experimentalfacgroundplate.png rename to UnusedUnittextures/experimentalfacgroundplate.png diff --git a/UnitTextures/genericfacdecal.png b/UnusedUnittextures/genericfacdecal.png similarity index 100% rename from UnitTextures/genericfacdecal.png rename to UnusedUnittextures/genericfacdecal.png diff --git a/UnitTextures/glowy.png b/UnusedUnittextures/glowy.png similarity index 100% rename from UnitTextures/glowy.png rename to UnusedUnittextures/glowy.png diff --git a/UnitTextures/glsl_test_NormalMap.dds b/UnusedUnittextures/glsl_test_NormalMap.dds similarity index 100% rename from UnitTextures/glsl_test_NormalMap.dds rename to UnusedUnittextures/glsl_test_NormalMap.dds diff --git a/UnitTextures/groundplate.png b/UnusedUnittextures/groundplate.png similarity index 100% rename from UnitTextures/groundplate.png rename to UnusedUnittextures/groundplate.png diff --git a/UnitTextures/groundplate2.png b/UnusedUnittextures/groundplate2.png similarity index 100% rename from UnitTextures/groundplate2.png rename to UnusedUnittextures/groundplate2.png diff --git a/UnitTextures/hoverfactdecal.png b/UnusedUnittextures/hoverfactdecal.png similarity index 100% rename from UnitTextures/hoverfactdecal.png rename to UnusedUnittextures/hoverfactdecal.png diff --git a/UnusedUnittextures/lego2skin_explorer - 2048.dds b/UnusedUnittextures/lego2skin_explorer - 2048.dds new file mode 100644 index 000000000..cd3a069cf Binary files /dev/null and b/UnusedUnittextures/lego2skin_explorer - 2048.dds differ diff --git a/UnusedUnittextures/lego2skin_explorer-old.dds b/UnusedUnittextures/lego2skin_explorer-old.dds new file mode 100644 index 000000000..932459071 Binary files /dev/null and b/UnusedUnittextures/lego2skin_explorer-old.dds differ diff --git a/UnusedUnittextures/lego2skin_explorerglowy-old.dds b/UnusedUnittextures/lego2skin_explorerglowy-old.dds new file mode 100644 index 000000000..501168768 Binary files /dev/null and b/UnusedUnittextures/lego2skin_explorerglowy-old.dds differ diff --git a/UnitTextures/powergrounddecal.png b/UnusedUnittextures/powergrounddecal.png similarity index 100% rename from UnitTextures/powergrounddecal.png rename to UnusedUnittextures/powergrounddecal.png diff --git a/UnitTextures/taatank2.png b/UnusedUnittextures/taatank2.png similarity index 100% rename from UnitTextures/taatank2.png rename to UnusedUnittextures/taatank2.png diff --git a/UnitTextures/taatank2glowy.png b/UnusedUnittextures/taatank2glowy.png similarity index 100% rename from UnitTextures/taatank2glowy.png rename to UnusedUnittextures/taatank2glowy.png diff --git a/UnitTextures/tbinoc.png b/UnusedUnittextures/tbinoc.png similarity index 100% rename from UnitTextures/tbinoc.png rename to UnusedUnittextures/tbinoc.png diff --git a/UnitTextures/tbinocglowy.png b/UnusedUnittextures/tbinocglowy.png similarity index 100% rename from UnitTextures/tbinocglowy.png rename to UnusedUnittextures/tbinocglowy.png diff --git a/UnitTextures/tfact.png b/UnusedUnittextures/tfact.png similarity index 100% rename from UnitTextures/tfact.png rename to UnusedUnittextures/tfact.png diff --git a/UnitTextures/tfactglowy.png b/UnusedUnittextures/tfactglowy.png similarity index 100% rename from UnitTextures/tfactglowy.png rename to UnusedUnittextures/tfactglowy.png diff --git a/UnitTextures/tfusion2.png b/UnusedUnittextures/tfusion2.png similarity index 100% rename from UnitTextures/tfusion2.png rename to UnusedUnittextures/tfusion2.png diff --git a/UnitTextures/tfusion2glowy.png b/UnusedUnittextures/tfusion2glowy.png similarity index 100% rename from UnitTextures/tfusion2glowy.png rename to UnusedUnittextures/tfusion2glowy.png diff --git a/UnitTextures/tgeothermal.png b/UnusedUnittextures/tgeothermal.png similarity index 100% rename from UnitTextures/tgeothermal.png rename to UnusedUnittextures/tgeothermal.png diff --git a/UnitTextures/tgeothermalglowy.png b/UnusedUnittextures/tgeothermalglowy.png similarity index 100% rename from UnitTextures/tgeothermalglowy.png rename to UnusedUnittextures/tgeothermalglowy.png diff --git a/UnitTextures/tlighttank3.png b/UnusedUnittextures/tlighttank3.png similarity index 100% rename from UnitTextures/tlighttank3.png rename to UnusedUnittextures/tlighttank3.png diff --git a/UnitTextures/tlighttank3glowy.png b/UnusedUnittextures/tlighttank3glowy.png similarity index 100% rename from UnitTextures/tlighttank3glowy.png rename to UnusedUnittextures/tlighttank3glowy.png diff --git a/UnitTextures/tlightturret.png b/UnusedUnittextures/tlightturret.png similarity index 100% rename from UnitTextures/tlightturret.png rename to UnusedUnittextures/tlightturret.png diff --git a/UnitTextures/tlightturretglowy.png b/UnusedUnittextures/tlightturretglowy.png similarity index 100% rename from UnitTextures/tlightturretglowy.png rename to UnusedUnittextures/tlightturretglowy.png diff --git a/UnitTextures/tmetalextractor.png b/UnusedUnittextures/tmetalextractor.png similarity index 100% rename from UnitTextures/tmetalextractor.png rename to UnusedUnittextures/tmetalextractor.png diff --git a/UnitTextures/tmetalextractorglowy.png b/UnusedUnittextures/tmetalextractorglowy.png similarity index 100% rename from UnitTextures/tmetalextractorglowy.png rename to UnusedUnittextures/tmetalextractorglowy.png diff --git a/UnitTextures/towerdecal.png b/UnusedUnittextures/towerdecal.png similarity index 100% rename from UnitTextures/towerdecal.png rename to UnusedUnittextures/towerdecal.png diff --git a/UnitTextures/towerdecal2.png b/UnusedUnittextures/towerdecal2.png similarity index 100% rename from UnitTextures/towerdecal2.png rename to UnusedUnittextures/towerdecal2.png diff --git a/UnitTextures/tsolar2.png b/UnusedUnittextures/tsolar2.png similarity index 100% rename from UnitTextures/tsolar2.png rename to UnusedUnittextures/tsolar2.png diff --git a/UnitTextures/tsolar2glowy.png b/UnusedUnittextures/tsolar2glowy.png similarity index 100% rename from UnitTextures/tsolar2glowy.png rename to UnusedUnittextures/tsolar2glowy.png diff --git a/UnitTextures/tstorage.png b/UnusedUnittextures/tstorage.png similarity index 100% rename from UnitTextures/tstorage.png rename to UnusedUnittextures/tstorage.png diff --git a/UnitTextures/tstorage2.png b/UnusedUnittextures/tstorage2.png similarity index 100% rename from UnitTextures/tstorage2.png rename to UnusedUnittextures/tstorage2.png diff --git a/UnitTextures/tstorageglowy.png b/UnusedUnittextures/tstorageglowy.png similarity index 100% rename from UnitTextures/tstorageglowy.png rename to UnusedUnittextures/tstorageglowy.png diff --git a/Weapons/ChickenDefenseWeapons/bigbug_death.lua b/Weapons/ChickenDefenseWeapons/bigbug_death.lua new file mode 100644 index 000000000..06c013885 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/bigbug_death.lua @@ -0,0 +1,19 @@ +return { + bigbug_death = { + areaofeffect = "16", + craterboost = "0", + cratermult = "0", + explosiongenerator = "custom:chickenunitexplosion-large-red", + impulseboost = "0", + impulsefactor = "0.4", + name = "bigbug_death", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/bigbugdie", + turret = "1", + weaponvelocity = "250", + damage = { + default = "0.001", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/bug_death.lua b/Weapons/ChickenDefenseWeapons/bug_death.lua new file mode 100644 index 000000000..924ea5be2 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/bug_death.lua @@ -0,0 +1,86 @@ +return { + bug_death_small = { + areaofeffect = 100, + craterboost = 0, + cratermult = 0, + impulseboost = 0, + impulsefactor = 0, + explosiongenerator = "custom:chickenunitexplosion-small-red", + name = "bug_death", + range = 450, + reloadtime = 0, + --soundhit = "ChickenDefenseSounds/bugdie", + turret = 1, + weaponvelocity = 250, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 0, + }, + }, + bug_death_medium = { + areaofeffect = 100, + craterboost = 0, + cratermult = 0, + impulseboost = 0, + impulsefactor = 0, + explosiongenerator = "custom:chickenunitexplosion-medium-red", + name = "bug_death", + range = 450, + reloadtime = 0, + --soundhit = "ChickenDefenseSounds/bugdie", + turret = 1, + weaponvelocity = 250, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 0, + }, + }, + bug_death_large = { + areaofeffect = 100, + craterboost = 0, + cratermult = 0, + impulseboost = 0, + impulsefactor = 0, + explosiongenerator = "custom:chickenunitexplosion-large-red", + name = "bug_death", + range = 450, + reloadtime = 0, + --soundhit = "ChickenDefenseSounds/bugdie", + turret = 1, + weaponvelocity = 250, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 0, + }, + }, + bug_death_kamikaze = { + areaofeffect = 100, + craterboost = 0, + cratermult = 0, + impulseboost = 0, + impulsefactor = 0, + explosiongenerator = "custom:chickenunitexplosion-medium-red", + name = "bug_death", + range = 100, + reloadtime = 0, + --soundhit = "ChickenDefenseSounds/bugdie", + turret = 1, + weaponvelocity = 250, + customparams = { + damagetype = "light", + nofriendlyfire = 1, + }, + damage = { + default = 100, + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/burrow_spew.lua b/Weapons/ChickenDefenseWeapons/burrow_spew.lua new file mode 100644 index 000000000..90fb05766 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/burrow_spew.lua @@ -0,0 +1,19 @@ +return { + burrow_spew = { + areaofeffect = 50, + craterboost = 0, + cratermult = 0, + edgeeffectiveness = 0, + explosiongenerator = "custom:blood_explode", + impulseboost = 1, + impulsefactor = 1, + name = "burrow_spew", + range = 60, + reloadtime = 3.6, + turret = 1, + weaponvelocity = 70, + damage = { + default = 450, + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/dodo_death1.lua b/Weapons/ChickenDefenseWeapons/dodo_death1.lua new file mode 100644 index 000000000..dfb32dbdb --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/dodo_death1.lua @@ -0,0 +1,23 @@ +return { + dodo_death1 = { + areaofeffect = "300", + camerashake = "0", + craterboost = "0", + cratermult = "0", + edgeeffectiveness = "0.075", + explosiongenerator = "custom:chickenunitexplosion-medium-red", + impulseboost = "0.2", + impulsefactor = "0.2", + interceptedbyshieldtype = "1", + name = "CrawlingBomb", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/chicken_nuke", + soundstart = "ChickenDefenseSounds/smallchickendead", + turret = "1", + weaponvelocity = "250", + damage = { + default = "650", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/dodo_death2.lua b/Weapons/ChickenDefenseWeapons/dodo_death2.lua new file mode 100644 index 000000000..f3ce3942f --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/dodo_death2.lua @@ -0,0 +1,22 @@ +return { + dodo_death2 = { + areaofeffect = "350", + craterboost = "0", + cratermult = "0", + edgeeffectiveness = "0.1", + explosiongenerator = "custom:chickenunitexplosion-large-red", + impulseboost = "0.5", + impulsefactor = "0.5", + interceptedbyshieldtype = "1", + name = "CrawlingBomb", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/chicken_nuke", + soundstart = "ChickenDefenseSounds/smallchickendead", + turret = "1", + weaponvelocity = "250", + damage = { + default = "4000", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/flamebug_death.lua b/Weapons/ChickenDefenseWeapons/flamebug_death.lua new file mode 100644 index 000000000..ee712a3e1 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/flamebug_death.lua @@ -0,0 +1,24 @@ +return { + flamebug_death = { + areaofeffect = "120", + craterboost = "0", + cratermult = "0", + edgeeffectiveness = "0.7", + explosiongenerator = "custom:gundam_MISSILE_EXPLOSION", + impulseboost = "0", + impulsefactor = "0.4", + interceptedbyshieldtype = "1", + name = "flamebug_death", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/chicken_nuke", + soundstart = "ChickenDefenseSounds/bigbugdie", + turret = "1", + weaponvelocity = "250", + damage = { + chicken = "100", + default = "300", + tinychicken = "25", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/lobber_morph.lua b/Weapons/ChickenDefenseWeapons/lobber_morph.lua new file mode 100644 index 000000000..0ac91690b --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/lobber_morph.lua @@ -0,0 +1,19 @@ +return { + lobber_morph = { + areaofeffect = "8", + craterboost = "0", + cratermult = "0", + explosiongenerator = "custom:ELECTRIC_EXPLOSION", + impulseboost = "0", + impulsefactor = "0", + name = "lobberMorph", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/bigbugdie", + turret = "1", + weaponvelocity = "250", + damage = { + default = "0.001", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/queen_death.lua b/Weapons/ChickenDefenseWeapons/queen_death.lua new file mode 100644 index 000000000..74ec23c20 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/queen_death.lua @@ -0,0 +1,19 @@ +return { + queen_death = { + areaofeffect = "16", + craterboost = "0", + cratermult = "0", + impulseboost = "0", + impulsefactor = "0.4", + explosiongenerator = "custom:nukedatbewm-roost", + name = "queen_death", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/bigchickendead", + turret = "1", + weaponvelocity = "250", + damage = { + default = "0.001", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/roost_death.lua b/Weapons/ChickenDefenseWeapons/roost_death.lua new file mode 100644 index 000000000..56e92ae5c --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/roost_death.lua @@ -0,0 +1,19 @@ +return { + roost_death = { + areaofeffect = "16", + craterboost = "0", + cratermult = "0", + impulseboost = "0", + impulsefactor = "0.4", + explosiongenerator = "custom:chickenunitexplosion-large-red", + name = "roost_death", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/roostdie", + turret = "1", + weaponvelocity = "250", + damage = { + default = "0.001", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/talon_death.lua b/Weapons/ChickenDefenseWeapons/talon_death.lua new file mode 100644 index 000000000..d2529a5f0 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/talon_death.lua @@ -0,0 +1,19 @@ +return { + talon_death = { + areaofeffect = "16", + craterboost = "0", + cratermult = "0", + impulseboost = "0", + impulsefactor = "0.4", + explosiongenerator = "custom:chickenunitexplosion-small-red", + name = "talon_death", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/talondie", + turret = "1", + weaponvelocity = "250", + damage = { + default = "0.001", + }, + }, +} diff --git a/Weapons/ChickenDefenseWeapons/weaver_death.lua b/Weapons/ChickenDefenseWeapons/weaver_death.lua new file mode 100644 index 000000000..a02ffc208 --- /dev/null +++ b/Weapons/ChickenDefenseWeapons/weaver_death.lua @@ -0,0 +1,24 @@ +return { + weaver_death = { + areaofeffect = "128", + craterboost = "0", + cratermult = "0", + edgeeffectiveness = "0.5", + explosiongenerator = "custom:ELECTRIC_EXPLOSION", + impulseboost = "0", + impulsefactor = "0", + interceptedbyshieldtype = "1", + name = "WeaverEMPBomb", + range = "450", + reloadtime = "3.6", + soundhit = "ChickenDefenseSounds/junohit2edit", + soundstart = "ChickenDefenseSounds/smallchickendead", + turret = "1", + weaponvelocity = "250", + damage = { + chicken = "0.001", + default = "240", + tinychicken = "0.001", + }, + }, +} diff --git a/Weapons/NOWEAPON.lua b/Weapons/NOWEAPON.lua new file mode 100644 index 000000000..397e63807 --- /dev/null +++ b/Weapons/NOWEAPON.lua @@ -0,0 +1,14 @@ +unitDeaths = { + + NOWEAPON = { + weaponType = "Cannon", + impulseFactor = 0, + AreaOfEffect=0, + explosiongenerator="custom:empty", + cameraShake=0, + damage = { + default = 0, + }, + }, +} +return lowerkeys(unitDeaths) \ No newline at end of file diff --git a/Weapons/Unit_Explosions.lua b/Weapons/Unit_Explosions.lua index c0ff20f8e..63ccd1822 100644 --- a/Weapons/Unit_Explosions.lua +++ b/Weapons/Unit_Explosions.lua @@ -11,6 +11,335 @@ local hugeExplosionImpulseFactor = 0 unitDeaths = { +--BUILDING DEATHS-- + +--Orange + + smallBuildingExplosionGeneric = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGeneric = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGeneric = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGeneric = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--blue + + smallBuildingExplosionGenericBlue = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-blue", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericBlue = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-blue", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericBlue = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-blue", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericBlue = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-Blue", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--blue-emp + + smallBuildingExplosionGenericBlueEMP = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-blue-emp", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericBlueEMP = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-blue-emp", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericBlueEMP = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-blue-emp", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericBlueEMP = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-Blue-emp", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--green + + smallBuildingExplosionGenericGreen = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-green", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericGreen = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-green", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericGreen = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-green", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericGreen = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-green", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--purple + + smallBuildingExplosionGenericPurple = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-purple", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericPurple = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-purple", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericPurple = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-purple", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericPurple = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-purple", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--red + + smallBuildingExplosionGenericRed = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-red", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericRed = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-red", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericRed = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-red", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericRed = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-red", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + +--white + + smallBuildingExplosionGenericWhite = { + weaponType = "Cannon", + impulseFactor = smallExplosionImpulseFactor, + AreaOfEffect=smallExplosion, + explosiongenerator="custom:genericbuildingexplosion-small-white", + cameraShake=smallExplosion, + damage = { + default = 0, + }, + }, + + mediumBuildingExplosionGenericWhite = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericbuildingexplosion-medium-white", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + largeBuildingExplosionGenericWhite = { + weaponType = "Cannon", + impulseFactor = largeExplosionImpulseFactor, + AreaOfEffect=largeExplosion, + explosiongenerator="custom:genericbuildingexplosion-large-white", + cameraShake=largeExplosion, + damage = { + default = 0, + }, + }, + + hugeBuildingExplosionGenericWhite = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect=hugeExplosion, + explosiongenerator="custom:genericbuildingexplosion-huge-white", + cameraShake=hugeExplosion, + damage = { + default = 0, + }, + }, + + +--UNIT DEATHS-- + +--Orange + smallExplosionGeneric = { weaponType = "Cannon", impulseFactor = smallExplosionImpulseFactor, @@ -286,379 +615,6 @@ unitDeaths = { default = 0, }, }, - - - --- Old and busted -SMALL_BUILDING = { - name = "Small building", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode2.wav", - soundhit="explode2.wav", - explosiongenerator="custom:FACTORY_EXPLOSION_SMALL", - cameraShake=200, - damage = { - default = 0, - }, - }, - -MEDIUM_BUILDING = { - name="Medium building", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode4.wav", - soundhit="explode4.wav", - explosiongenerator="custom:FACTORY_EXPLOSION_MEDIUM", - cameraShake=400, - damage = { - default = 0, - }, - }, - -LARGE_BUILDING = { - - name="Large building", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode1.wav", - soundhit="explode1.wav", - explosiongenerator="custom:FACTORY_EXPLOSION", - cameraShake=600, - damage = { - default = 0, - }, - }, - -ESTOR_BUILDING = { - name="Small building", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode4.wav", - soundhit="explode4.wav", - explosiongenerator="custom:FACTORY_EXPLOSION_SMALL", - cameraShake=100, - damage = { - default = 0, - }, - }, - -SMALL_UNIT = { - - name="Small tank", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode2.wav", - soundhit="explode2.wav", - cameraShake=100, - - explosiongenerator="custom:SMALL_UNIT_Expl", - damage = { - default = 0, - }, - }, - - -MEDIUM_UNIT = { - - name="Medium Unit", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode4.wav", - soundhit="explode4.wav", - explosiongenerator="custom:MED_UNIT_Expl", - cameraShake=200, - damage = { - default = 0, - }, - }, - - - -BIG_UNIT = { - - name="Big Kbot", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode3.wav", - soundhit="explode3.wav", - explosiongenerator="custom:BIG_UNIT_Expl", - cameraShake=300, - damage = { - default = 0, - }, - }, - -CONSTRUCTOR = { - - name="con", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=500, - soundstart="explode5.wav", - soundhit="explode5.wav", - cameraShake=100, - - explosiongenerator="custom:greencannonimpact", - damage = { - default = -100, - }, - }, - -ebombblast = { - - name="hoverbomb", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=556, - soundstart="unitexplodemedium.wav", - soundhit="unitexplodemedium.wav", - explosiongenerator="custom:CRAWL_SUICIDE_Expl", - customparams = { - damagetype = "default", - nofriendlyfire = "1", - }, - - damage = { - default = 1000, - }, - }, - -krabblast = { - - name="krabblast", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="unitexplodemedium.wav", - soundhit="unitexplodemedium.wav", - explosiongenerator="custom:KRABDEATH", - cameraShake=500, - customparams = { - damagetype = "default", - }, - - damage = { - default = 0, - }, - }, - - -MEXPOP2 = { - name="Atomic Blast Weapon", - weaponType = "Cannon", - ballistic=1, - turret=1, - range=500, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode5.wav", - soundhit="explode5.wav", - impulse=0, - impulsefactor=0, - explosiongenerator="custom:NUKE", - - - damage = { - default = 0, - }, - }, - -PYRO_BLAST = { - - name="Pyro Blast", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="unitexplodesmall.wav", - soundhit="unitexplodesmall.wav", - explosiongenerator="custom:PYRO_UNIT_Expl", - cameraShake=100, - - damage = { - default = 0, - }, - }, - -FUSIONPOP = { - - name="Atomic Blast Weapon", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode3.wav", - soundhit="explode3.wav", - cameraShake=400, - - explosiongenerator="custom:POWERPLANT_EXPLOSION_BIG", - customparams = { - damagetype = "default", - }, - - damage = { - default = 0, - }, - }, -POWERPLANTPOP = { - - name="Atomic Blast Weapon", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=600, - AreaOfEffect=0, - soundstart="explode3.wav", - soundhit="explode3.wav", - cameraShake=200, - - explosiongenerator="custom:POWERPLANT_EXPLOSION", - customparams = { - damagetype = "default", - }, - - damage = { - default = 0, - }, - }, - -GEOPOP = { - - name="Atomic Blast Weapon", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=480, - reloadtime=3.6, - weaponvelocity=500, - AreaOfEffect=0, - soundstart="explode3.wav", - soundhit="explode3.wav", - cameraShake=300, - - explosiongenerator="custom:POWERPLANT_EXPLOSION_MEDIUM", - customparams = { - damagetype = "default", - }, - - damage = { - default = 0, - }, - }, - -HUGE_UNITEX = { - - name="Big Kbot", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=550, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode1.wav", - soundhit="explode1.wav", - explosiongenerator="custom:HUGE_UNIT_Expl", - cameraShake=500, - - damage = { - default = 0, - }, - }, - - -HUGE_UNIT = { - - name="Big Kbot", - weaponType = "Cannon", - ballistic=1, - turret=1, - impulseFactor = 0, - range=550, - reloadtime=3.6, - weaponvelocity=250, - AreaOfEffect=0, - soundstart="explode1.wav", - soundhit="explode1.wav", - explosiongenerator="custom:HUGE_UNIT_Expl", - cameraShake=500, - - damage = { - default = 0, - }, - }, } return lowerkeys(unitDeaths) diff --git a/Weapons/scavenger_explosions.lua b/Weapons/scavenger_explosions.lua new file mode 100644 index 000000000..ae80f3262 --- /dev/null +++ b/Weapons/scavenger_explosions.lua @@ -0,0 +1,49 @@ +-------------------------------------------------------------------------------- +-- These represent both the area of effect and the camerashake amount +local smallExplosion = 200 +local smallExplosionImpulseFactor = 0 +local mediumExplosion = 400 +local mediumExplosionImpulseFactor = 0 +local largeExplosion = 600 +local largeExplosionImpulseFactor = 0 +local hugeExplosion = 1000 +local hugeExplosionImpulseFactor = 0 + + +unitDeaths = { + + mediumScavengerExplosionGeneric = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosiongenerator="custom:genericscavengerbuildingexplosion-medium-purple", + cameraShake=mediumExplosion, + damage = { + default = 0, + }, + }, + + mediumScavengerExplosionNuke = { + weaponType = "Cannon", + impulseFactor = mediumExplosionImpulseFactor, + AreaOfEffect=mediumExplosion, + explosionGenerator = "custom:NUKEDATBEWMSMALL", + cameraShake=mediumExplosion, + damage = { + default = 5000, + }, + }, + + bossScavengerExplosionNuke = { + weaponType = "Cannon", + impulseFactor = hugeExplosionImpulseFactor, + AreaOfEffect = 1500, + explosionGenerator = "custom:NUKEDATBEWM", + cameraShake = hugeExplosion, + damage = { + default = 9999999, + }, + }, + +} +return lowerkeys(unitDeaths) \ No newline at end of file diff --git a/bitmaps/GPL/sporetrail.tga b/bitmaps/GPL/sporetrail.tga new file mode 100644 index 000000000..7dc3cb0ce Binary files /dev/null and b/bitmaps/GPL/sporetrail.tga differ diff --git a/bitmaps/PD/bloodblast.tga b/bitmaps/PD/bloodblast.tga new file mode 100644 index 000000000..3ab2e9d94 Binary files /dev/null and b/bitmaps/PD/bloodblast.tga differ diff --git a/bitmaps/PD/bloodblastwhite.tga b/bitmaps/PD/bloodblastwhite.tga new file mode 100644 index 000000000..1f662955a Binary files /dev/null and b/bitmaps/PD/bloodblastwhite.tga differ diff --git a/bitmaps/PD/blooddrop.tga b/bitmaps/PD/blooddrop.tga new file mode 100644 index 000000000..92a952830 Binary files /dev/null and b/bitmaps/PD/blooddrop.tga differ diff --git a/bitmaps/PD/blooddropwhite.tga b/bitmaps/PD/blooddropwhite.tga new file mode 100644 index 000000000..962493f73 Binary files /dev/null and b/bitmaps/PD/blooddropwhite.tga differ diff --git a/bitmaps/PD/bloodsplat.tga b/bitmaps/PD/bloodsplat.tga new file mode 100644 index 000000000..baa162786 Binary files /dev/null and b/bitmaps/PD/bloodsplat.tga differ diff --git a/bitmaps/PD/null.tga b/bitmaps/PD/null.tga new file mode 100644 index 000000000..66fcd6809 Binary files /dev/null and b/bitmaps/PD/null.tga differ diff --git a/bitmaps/cc/dirt.png b/bitmaps/cc/dirt.png new file mode 100644 index 000000000..2dd9dab95 Binary files /dev/null and b/bitmaps/cc/dirt.png differ diff --git a/bitmaps/cc/purpleexplo.tga b/bitmaps/cc/purpleexplo.tga new file mode 100644 index 000000000..da092a79f Binary files /dev/null and b/bitmaps/cc/purpleexplo.tga differ diff --git a/bitmaps/cc/uglynovaexplo.tga b/bitmaps/cc/uglynovaexplo.tga new file mode 100644 index 000000000..aab3b7ecd Binary files /dev/null and b/bitmaps/cc/uglynovaexplo.tga differ diff --git a/bitmaps/default/circularthingy.tga b/bitmaps/default/circularthingy.tga index f0b505e4f..321215c4a 100644 Binary files a/bitmaps/default/circularthingy.tga and b/bitmaps/default/circularthingy.tga differ diff --git a/bitmaps/default/metal_basic.dds b/bitmaps/default/metal_basic.dds new file mode 100644 index 000000000..681d444ec Binary files /dev/null and b/bitmaps/default/metal_basic.dds differ diff --git a/bitmaps/default/metalshimmer_color.dds b/bitmaps/default/metalshimmer_color.dds new file mode 100644 index 000000000..0fbda6f48 Binary files /dev/null and b/bitmaps/default/metalshimmer_color.dds differ diff --git a/bitmaps/default/metalshimmer_color2.dds b/bitmaps/default/metalshimmer_color2.dds new file mode 100644 index 000000000..3a29478fb Binary files /dev/null and b/bitmaps/default/metalshimmer_color2.dds differ diff --git a/bitmaps/default/metalshimmer_color3.dds b/bitmaps/default/metalshimmer_color3.dds new file mode 100644 index 000000000..06410ccb5 Binary files /dev/null and b/bitmaps/default/metalshimmer_color3.dds differ diff --git a/bitmaps/default/metalshimmer_color4.dds b/bitmaps/default/metalshimmer_color4.dds new file mode 100644 index 000000000..ea205a95e Binary files /dev/null and b/bitmaps/default/metalshimmer_color4.dds differ diff --git a/bitmaps/default/metalshimmer_color5.dds b/bitmaps/default/metalshimmer_color5.dds new file mode 100644 index 000000000..a4ef2f780 Binary files /dev/null and b/bitmaps/default/metalshimmer_color5.dds differ diff --git a/bitmaps/default/metalshimmer_color6.dds b/bitmaps/default/metalshimmer_color6.dds new file mode 100644 index 000000000..abfb6342b Binary files /dev/null and b/bitmaps/default/metalshimmer_color6.dds differ diff --git a/bitmaps/default/metalshimmer_color7.dds b/bitmaps/default/metalshimmer_color7.dds new file mode 100644 index 000000000..b20d8ecd8 Binary files /dev/null and b/bitmaps/default/metalshimmer_color7.dds differ diff --git a/bitmaps/default/metalshimmer_color8.dds b/bitmaps/default/metalshimmer_color8.dds new file mode 100644 index 000000000..f5c436bb9 Binary files /dev/null and b/bitmaps/default/metalshimmer_color8.dds differ diff --git a/bitmaps/default/metalshimmer_color9.dds b/bitmaps/default/metalshimmer_color9.dds new file mode 100644 index 000000000..eefd5f0d1 Binary files /dev/null and b/bitmaps/default/metalshimmer_color9.dds differ diff --git a/bitmaps/default/ocean.jpg b/bitmaps/default/ocean.jpg index cc80c1281..d0903a948 100644 Binary files a/bitmaps/default/ocean.jpg and b/bitmaps/default/ocean.jpg differ diff --git a/bitmaps/evologo.bmp b/bitmaps/evologo.bmp index 63491e561..f9f50e34b 100644 Binary files a/bitmaps/evologo.bmp and b/bitmaps/evologo.bmp differ diff --git a/bitmaps/evologo.png b/bitmaps/evologo.png index 49d1643e9..1c665a88d 100644 Binary files a/bitmaps/evologo.png and b/bitmaps/evologo.png differ diff --git a/bitmaps/fireball.tga b/bitmaps/fireball.tga new file mode 100644 index 000000000..77b43c996 Binary files /dev/null and b/bitmaps/fireball.tga differ diff --git a/bitmaps/graysmoke.tga b/bitmaps/graysmoke.tga new file mode 100644 index 000000000..d802a8724 Binary files /dev/null and b/bitmaps/graysmoke.tga differ diff --git a/bitmaps/icons/frame.png b/bitmaps/icons/frame.png index 53089e430..202d79c0f 100644 Binary files a/bitmaps/icons/frame.png and b/bitmaps/icons/frame.png differ diff --git a/bitmaps/icons/frame_slate_128x96.png b/bitmaps/icons/frame_slate_128x96.png index 53089e430..202d79c0f 100644 Binary files a/bitmaps/icons/frame_slate_128x96.png and b/bitmaps/icons/frame_slate_128x96.png differ diff --git a/bitmaps/icons/frame_slate_faded_128x96.png b/bitmaps/icons/frame_slate_faded_128x96.png index 53089e430..202d79c0f 100644 Binary files a/bitmaps/icons/frame_slate_faded_128x96.png and b/bitmaps/icons/frame_slate_faded_128x96.png differ diff --git a/bitmaps/loadpictures/start1.jpg b/bitmaps/loadpictures/start1.jpg index 1533a38fe..882f9eb04 100644 Binary files a/bitmaps/loadpictures/start1.jpg and b/bitmaps/loadpictures/start1.jpg differ diff --git a/bitmaps/loadpictures/start10.jpg b/bitmaps/loadpictures/start10.jpg new file mode 100644 index 000000000..05f4d336b Binary files /dev/null and b/bitmaps/loadpictures/start10.jpg differ diff --git a/bitmaps/loadpictures/start11.jpg b/bitmaps/loadpictures/start11.jpg new file mode 100644 index 000000000..13dfe5790 Binary files /dev/null and b/bitmaps/loadpictures/start11.jpg differ diff --git a/bitmaps/loadpictures/start12.jpg b/bitmaps/loadpictures/start12.jpg new file mode 100644 index 000000000..5da54c557 Binary files /dev/null and b/bitmaps/loadpictures/start12.jpg differ diff --git a/bitmaps/loadpictures/start13.jpg b/bitmaps/loadpictures/start13.jpg new file mode 100644 index 000000000..01e69f324 Binary files /dev/null and b/bitmaps/loadpictures/start13.jpg differ diff --git a/bitmaps/loadpictures/start14.jpg b/bitmaps/loadpictures/start14.jpg new file mode 100644 index 000000000..d8205c2db Binary files /dev/null and b/bitmaps/loadpictures/start14.jpg differ diff --git a/bitmaps/loadpictures/start15.jpg b/bitmaps/loadpictures/start15.jpg new file mode 100644 index 000000000..91c78e088 Binary files /dev/null and b/bitmaps/loadpictures/start15.jpg differ diff --git a/bitmaps/loadpictures/start16.jpg b/bitmaps/loadpictures/start16.jpg new file mode 100644 index 000000000..9204d0c39 Binary files /dev/null and b/bitmaps/loadpictures/start16.jpg differ diff --git a/bitmaps/loadpictures/start17.jpg b/bitmaps/loadpictures/start17.jpg new file mode 100644 index 000000000..ddfac663a Binary files /dev/null and b/bitmaps/loadpictures/start17.jpg differ diff --git a/bitmaps/loadpictures/start18.jpg b/bitmaps/loadpictures/start18.jpg new file mode 100644 index 000000000..fdfc034c4 Binary files /dev/null and b/bitmaps/loadpictures/start18.jpg differ diff --git a/bitmaps/loadpictures/start19.jpg b/bitmaps/loadpictures/start19.jpg new file mode 100644 index 000000000..6f0bd7cd1 Binary files /dev/null and b/bitmaps/loadpictures/start19.jpg differ diff --git a/bitmaps/loadpictures/start2.jpg b/bitmaps/loadpictures/start2.jpg index de488f91f..7d3c12f12 100644 Binary files a/bitmaps/loadpictures/start2.jpg and b/bitmaps/loadpictures/start2.jpg differ diff --git a/bitmaps/loadpictures/start20.jpg b/bitmaps/loadpictures/start20.jpg new file mode 100644 index 000000000..4459250af Binary files /dev/null and b/bitmaps/loadpictures/start20.jpg differ diff --git a/bitmaps/loadpictures/start21.jpg b/bitmaps/loadpictures/start21.jpg new file mode 100644 index 000000000..52226a460 Binary files /dev/null and b/bitmaps/loadpictures/start21.jpg differ diff --git a/bitmaps/loadpictures/start22.jpg b/bitmaps/loadpictures/start22.jpg new file mode 100644 index 000000000..0c4f709de Binary files /dev/null and b/bitmaps/loadpictures/start22.jpg differ diff --git a/bitmaps/loadpictures/start23.jpg b/bitmaps/loadpictures/start23.jpg new file mode 100644 index 000000000..51b444d6e Binary files /dev/null and b/bitmaps/loadpictures/start23.jpg differ diff --git a/bitmaps/loadpictures/start24.jpg b/bitmaps/loadpictures/start24.jpg new file mode 100644 index 000000000..4625e0c9f Binary files /dev/null and b/bitmaps/loadpictures/start24.jpg differ diff --git a/bitmaps/loadpictures/start25.jpg b/bitmaps/loadpictures/start25.jpg new file mode 100644 index 000000000..e2585b70b Binary files /dev/null and b/bitmaps/loadpictures/start25.jpg differ diff --git a/bitmaps/loadpictures/start26.jpg b/bitmaps/loadpictures/start26.jpg new file mode 100644 index 000000000..6cea7fbe0 Binary files /dev/null and b/bitmaps/loadpictures/start26.jpg differ diff --git a/bitmaps/loadpictures/start27.jpg b/bitmaps/loadpictures/start27.jpg new file mode 100644 index 000000000..8acb0da91 Binary files /dev/null and b/bitmaps/loadpictures/start27.jpg differ diff --git a/bitmaps/loadpictures/start28.jpg b/bitmaps/loadpictures/start28.jpg new file mode 100644 index 000000000..3c9d887d1 Binary files /dev/null and b/bitmaps/loadpictures/start28.jpg differ diff --git a/bitmaps/loadpictures/start3.jpg b/bitmaps/loadpictures/start3.jpg index 621527b09..f97818761 100644 Binary files a/bitmaps/loadpictures/start3.jpg and b/bitmaps/loadpictures/start3.jpg differ diff --git a/bitmaps/loadpictures/start4.jpg b/bitmaps/loadpictures/start4.jpg index 2baea09df..ee4a460e6 100644 Binary files a/bitmaps/loadpictures/start4.jpg and b/bitmaps/loadpictures/start4.jpg differ diff --git a/bitmaps/loadpictures/start5.jpg b/bitmaps/loadpictures/start5.jpg index 5e15bbe47..256529448 100644 Binary files a/bitmaps/loadpictures/start5.jpg and b/bitmaps/loadpictures/start5.jpg differ diff --git a/bitmaps/loadpictures/start6.jpg b/bitmaps/loadpictures/start6.jpg index b68f4983a..baf3d127f 100644 Binary files a/bitmaps/loadpictures/start6.jpg and b/bitmaps/loadpictures/start6.jpg differ diff --git a/bitmaps/loadpictures/start7.jpg b/bitmaps/loadpictures/start7.jpg index 78804cc88..f251e3cb7 100644 Binary files a/bitmaps/loadpictures/start7.jpg and b/bitmaps/loadpictures/start7.jpg differ diff --git a/bitmaps/loadpictures/start8.jpg b/bitmaps/loadpictures/start8.jpg index c8df16add..0bae58c3b 100644 Binary files a/bitmaps/loadpictures/start8.jpg and b/bitmaps/loadpictures/start8.jpg differ diff --git a/bitmaps/loadpictures/start9.jpg b/bitmaps/loadpictures/start9.jpg index 342a0eb89..92f1cb88e 100644 Binary files a/bitmaps/loadpictures/start9.jpg and b/bitmaps/loadpictures/start9.jpg differ diff --git a/bitmaps/minimapbuttons.png b/bitmaps/minimapbuttons.png new file mode 100644 index 000000000..d229c8a32 Binary files /dev/null and b/bitmaps/minimapbuttons.png differ diff --git a/bitmaps/projectiletextures/bigexplosmoke-chickens.tga b/bitmaps/projectiletextures/bigexplosmoke-chickens.tga new file mode 100644 index 000000000..97ba1cd90 Binary files /dev/null and b/bitmaps/projectiletextures/bigexplosmoke-chickens.tga differ diff --git a/bitmaps/projectiletextures/circlefx0.png b/bitmaps/projectiletextures/circlefx0.png new file mode 100644 index 000000000..26b5524f6 Binary files /dev/null and b/bitmaps/projectiletextures/circlefx0.png differ diff --git a/bitmaps/projectiletextures/circlefx1.png b/bitmaps/projectiletextures/circlefx1.png new file mode 100644 index 000000000..c45077162 Binary files /dev/null and b/bitmaps/projectiletextures/circlefx1.png differ diff --git a/bitmaps/projectiletextures/circlefx2.png b/bitmaps/projectiletextures/circlefx2.png new file mode 100644 index 000000000..0f6118278 Binary files /dev/null and b/bitmaps/projectiletextures/circlefx2.png differ diff --git a/bitmaps/projectiletextures/circlefx3.png b/bitmaps/projectiletextures/circlefx3.png new file mode 100644 index 000000000..9c3eb1c42 Binary files /dev/null and b/bitmaps/projectiletextures/circlefx3.png differ diff --git a/bitmaps/projectiletextures/circularthingy.tga b/bitmaps/projectiletextures/circularthingy.tga index f0b505e4f..321215c4a 100644 Binary files a/bitmaps/projectiletextures/circularthingy.tga and b/bitmaps/projectiletextures/circularthingy.tga differ diff --git a/bitmaps/projectiletextures/electnovaexplo.png b/bitmaps/projectiletextures/electnovaexplo.png deleted file mode 100644 index 7bc7ba8e1..000000000 Binary files a/bitmaps/projectiletextures/electnovaexplo.png and /dev/null differ diff --git a/bitmaps/projectiletextures/electricalarc.png b/bitmaps/projectiletextures/electricalarc.png index 5fe48d411..d0fff2f74 100644 Binary files a/bitmaps/projectiletextures/electricalarc.png and b/bitmaps/projectiletextures/electricalarc.png differ diff --git a/bitmaps/projectiletextures/explosionwave.png b/bitmaps/projectiletextures/explosionwave.png new file mode 100644 index 000000000..170558b82 Binary files /dev/null and b/bitmaps/projectiletextures/explosionwave.png differ diff --git a/bitmaps/projectiletextures/explowave.tga b/bitmaps/projectiletextures/explowave.tga deleted file mode 100644 index 9458bb5c3..000000000 Binary files a/bitmaps/projectiletextures/explowave.tga and /dev/null differ diff --git a/bitmaps/projectiletextures/flare-chickens.tga b/bitmaps/projectiletextures/flare-chickens.tga new file mode 100644 index 000000000..75934213f Binary files /dev/null and b/bitmaps/projectiletextures/flare-chickens.tga differ diff --git a/bitmaps/projectiletextures/flashside2-blue.tga b/bitmaps/projectiletextures/flashside2-blue.tga new file mode 100644 index 000000000..0e823fa2c Binary files /dev/null and b/bitmaps/projectiletextures/flashside2-blue.tga differ diff --git a/bitmaps/projectiletextures/flashside2-chickens.tga b/bitmaps/projectiletextures/flashside2-chickens.tga new file mode 100644 index 000000000..2d6ae04e4 Binary files /dev/null and b/bitmaps/projectiletextures/flashside2-chickens.tga differ diff --git a/bitmaps/projectiletextures/flashside2-orange.tga b/bitmaps/projectiletextures/flashside2-orange.tga new file mode 100644 index 000000000..268cf6c35 Binary files /dev/null and b/bitmaps/projectiletextures/flashside2-orange.tga differ diff --git a/bitmaps/projectiletextures/flashside2-purple.tga b/bitmaps/projectiletextures/flashside2-purple.tga new file mode 100644 index 000000000..e04dc4cce Binary files /dev/null and b/bitmaps/projectiletextures/flashside2-purple.tga differ diff --git a/bitmaps/projectiletextures/flashside2-red.tga b/bitmaps/projectiletextures/flashside2-red.tga new file mode 100644 index 000000000..f78e08092 Binary files /dev/null and b/bitmaps/projectiletextures/flashside2-red.tga differ diff --git a/bitmaps/projectiletextures/gunshot-chickens.tga b/bitmaps/projectiletextures/gunshot-chickens.tga new file mode 100644 index 000000000..c056dada7 Binary files /dev/null and b/bitmaps/projectiletextures/gunshot-chickens.tga differ diff --git a/bitmaps/projectiletextures/heal.png b/bitmaps/projectiletextures/heal.png index 1242186a4..0a67c906b 100644 Binary files a/bitmaps/projectiletextures/heal.png and b/bitmaps/projectiletextures/heal.png differ diff --git a/bitmaps/projectiletextures/lightb3-transparent.png b/bitmaps/projectiletextures/lightb3-transparent.png index 644f9a979..f7267c53e 100644 Binary files a/bitmaps/projectiletextures/lightb3-transparent.png and b/bitmaps/projectiletextures/lightb3-transparent.png differ diff --git a/bitmaps/projectiletextures/lightb4-bw.tga b/bitmaps/projectiletextures/lightb4-bw.tga new file mode 100644 index 000000000..1fbb8cb16 Binary files /dev/null and b/bitmaps/projectiletextures/lightb4-bw.tga differ diff --git a/bitmaps/projectiletextures/longshot.png b/bitmaps/projectiletextures/longshot.png index c4bdbbff5..0cbf02ba8 100644 Binary files a/bitmaps/projectiletextures/longshot.png and b/bitmaps/projectiletextures/longshot.png differ diff --git a/bitmaps/projectiletextures/moarpower.png b/bitmaps/projectiletextures/moarpower.png index 27cba7af0..ff18ab016 100644 Binary files a/bitmaps/projectiletextures/moarpower.png and b/bitmaps/projectiletextures/moarpower.png differ diff --git a/bitmaps/projectiletextures/randomdots-chickens.tga b/bitmaps/projectiletextures/randomdots-chickens.tga new file mode 100644 index 000000000..f0b505e4f Binary files /dev/null and b/bitmaps/projectiletextures/randomdots-chickens.tga differ diff --git a/bitmaps/projectiletextures/randomdots.tga b/bitmaps/projectiletextures/randomdots.tga new file mode 100644 index 000000000..f0b505e4f Binary files /dev/null and b/bitmaps/projectiletextures/randomdots.tga differ diff --git a/bitmaps/projectiletextures/shield4.png b/bitmaps/projectiletextures/shield4.png index 7b5d1add2..d11e9cf04 100644 Binary files a/bitmaps/projectiletextures/shield4.png and b/bitmaps/projectiletextures/shield4.png differ diff --git a/bitmaps/projectiletextures/smoke-chickens.tga b/bitmaps/projectiletextures/smoke-chickens.tga new file mode 100644 index 000000000..fd86903ab Binary files /dev/null and b/bitmaps/projectiletextures/smoke-chickens.tga differ diff --git a/bitmaps/projectiletextures/smoke_puff.png b/bitmaps/projectiletextures/smoke_puff.png new file mode 100644 index 000000000..ebf191938 Binary files /dev/null and b/bitmaps/projectiletextures/smoke_puff.png differ diff --git a/bitmaps/projectiletextures/wake-chickens.tga b/bitmaps/projectiletextures/wake-chickens.tga new file mode 100644 index 000000000..a8ac6b226 Binary files /dev/null and b/bitmaps/projectiletextures/wake-chickens.tga differ diff --git a/bitmaps/smoke/smoke0000.bmp b/bitmaps/smoke/smoke0000.bmp deleted file mode 100644 index 8a0dcd351..000000000 Binary files a/bitmaps/smoke/smoke0000.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0001.bmp b/bitmaps/smoke/smoke0001.bmp deleted file mode 100644 index f99b37734..000000000 Binary files a/bitmaps/smoke/smoke0001.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0002.bmp b/bitmaps/smoke/smoke0002.bmp deleted file mode 100644 index 8fee157ae..000000000 Binary files a/bitmaps/smoke/smoke0002.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0003.bmp b/bitmaps/smoke/smoke0003.bmp deleted file mode 100644 index e3ced2857..000000000 Binary files a/bitmaps/smoke/smoke0003.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0004.bmp b/bitmaps/smoke/smoke0004.bmp deleted file mode 100644 index d0f7ce1c5..000000000 Binary files a/bitmaps/smoke/smoke0004.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0005.bmp b/bitmaps/smoke/smoke0005.bmp deleted file mode 100644 index 8cdd8e342..000000000 Binary files a/bitmaps/smoke/smoke0005.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0006.bmp b/bitmaps/smoke/smoke0006.bmp deleted file mode 100644 index 6a25e91c5..000000000 Binary files a/bitmaps/smoke/smoke0006.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0007.bmp b/bitmaps/smoke/smoke0007.bmp deleted file mode 100644 index fc43b7dc8..000000000 Binary files a/bitmaps/smoke/smoke0007.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0008.bmp b/bitmaps/smoke/smoke0008.bmp deleted file mode 100644 index e5f06a7b0..000000000 Binary files a/bitmaps/smoke/smoke0008.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0009.bmp b/bitmaps/smoke/smoke0009.bmp deleted file mode 100644 index ee2906b01..000000000 Binary files a/bitmaps/smoke/smoke0009.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0010.bmp b/bitmaps/smoke/smoke0010.bmp deleted file mode 100644 index d154e4381..000000000 Binary files a/bitmaps/smoke/smoke0010.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0011.bmp b/bitmaps/smoke/smoke0011.bmp deleted file mode 100644 index ba8ead838..000000000 Binary files a/bitmaps/smoke/smoke0011.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke0012.bmp b/bitmaps/smoke/smoke0012.bmp deleted file mode 100644 index 306b53269..000000000 Binary files a/bitmaps/smoke/smoke0012.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0000.bmp b/bitmaps/smoke/smoke_Alpha0000.bmp deleted file mode 100644 index 90c49e769..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0000.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0001.bmp b/bitmaps/smoke/smoke_Alpha0001.bmp deleted file mode 100644 index 7221ed40e..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0001.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0002.bmp b/bitmaps/smoke/smoke_Alpha0002.bmp deleted file mode 100644 index 3482ace1e..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0002.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0003.bmp b/bitmaps/smoke/smoke_Alpha0003.bmp deleted file mode 100644 index 8e029ef7f..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0003.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0004.bmp b/bitmaps/smoke/smoke_Alpha0004.bmp deleted file mode 100644 index 40eda3308..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0004.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0005.bmp b/bitmaps/smoke/smoke_Alpha0005.bmp deleted file mode 100644 index 80320aebe..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0005.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0006.bmp b/bitmaps/smoke/smoke_Alpha0006.bmp deleted file mode 100644 index 704eb7328..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0006.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0007.bmp b/bitmaps/smoke/smoke_Alpha0007.bmp deleted file mode 100644 index be188c58d..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0007.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0008.bmp b/bitmaps/smoke/smoke_Alpha0008.bmp deleted file mode 100644 index 270524ce0..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0008.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0009.bmp b/bitmaps/smoke/smoke_Alpha0009.bmp deleted file mode 100644 index 72e357af1..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0009.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0010.bmp b/bitmaps/smoke/smoke_Alpha0010.bmp deleted file mode 100644 index 4a2973d6a..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0010.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0011.bmp b/bitmaps/smoke/smoke_Alpha0011.bmp deleted file mode 100644 index f13d5b95f..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0011.bmp and /dev/null differ diff --git a/bitmaps/smoke/smoke_Alpha0012.bmp b/bitmaps/smoke/smoke_Alpha0012.bmp deleted file mode 100644 index 12a977f02..000000000 Binary files a/bitmaps/smoke/smoke_Alpha0012.bmp and /dev/null differ diff --git a/bitmaps/tracks/chickentrack.bmp b/bitmaps/tracks/chickentrack.bmp new file mode 100644 index 000000000..fe52a8c79 Binary files /dev/null and b/bitmaps/tracks/chickentrack.bmp differ diff --git a/bitmaps/tracks/chickentrackpointy.bmp b/bitmaps/tracks/chickentrackpointy.bmp new file mode 100644 index 000000000..657069835 Binary files /dev/null and b/bitmaps/tracks/chickentrackpointy.bmp differ diff --git a/bitmaps/ui/loadingscreen/5units.png b/bitmaps/ui/loadingscreen/5units.png deleted file mode 100644 index fad1456bf..000000000 Binary files a/bitmaps/ui/loadingscreen/5units.png and /dev/null differ diff --git a/bitmaps/ui/loadingscreen/awesome.png b/bitmaps/ui/loadingscreen/awesome.png deleted file mode 100644 index f50bbf017..000000000 Binary files a/bitmaps/ui/loadingscreen/awesome.png and /dev/null differ diff --git a/bitmaps/ui/loadingscreen/panels.png b/bitmaps/ui/loadingscreen/panels.png deleted file mode 100644 index c18adf3fd..000000000 Binary files a/bitmaps/ui/loadingscreen/panels.png and /dev/null differ diff --git a/commandlist.txt b/commandlist.txt new file mode 100644 index 000000000..1bbc39b11 --- /dev/null +++ b/commandlist.txt @@ -0,0 +1,187 @@ +Spring Engine commands: + +/Atm (synced) Gives 1000 metal and 1000 energy to the issuing players team +/Cheat (synced) Enables/Disables cheating, which is required for a lot of other commands to be usable +/Destroy (synced) Destroys one or multiple units by unit-ID, instantly +/DevLua (synced) Enables/Disables Lua dev-mode (can cause desyncs if enabled) +/EditDefs (synced) Allows/Disallows editing of unit-, feature- and weapon-defs through Lua +/Give (synced) Places one or multiple units of a single or multiple types on the map, instantly; by default to your own team +/GlobalLOS (synced) Enables/Disables global line-of-sight, which makes the whole map permanently visible to everyone or to a specific allyteam +/GodMode (synced) Enables/Disables god-mode, which allows all players (even spectators) to control all units (even during replays, which will DESYNC them) +/LuaGaia (synced) Allows reloading or disabling LuaGaia, and to send a chat message to LuaGaia scripts +/LuaRules (synced) Allows reloading or disabling LuaRules, and to send a chat message to LuaRules scripts +/NoCost (synced) Enables/Disables everything-for-free, which allows everyone to build everything for zero resource costs +/NoHelp (synced) Enables/Disables widgets (LuaUI control) +/NoSpecDraw (synced) Allows/Disallows spectators to draw on the map +/NoSpectatorChat (synced) Enables/Disables spectators to use the chat +/ReloadCEGs (synced) Reloads CEG scripts +/ReloadCOB (synced) Reloads COB scripts +/Skip (synced) Fast-forwards to a given frame, or stops fast-forwarding +/Take (synced) Transfers all units of allied teams without any active players to the team of the issuing player +/AdvMapShading (unsynced) Set or toggle advanced map shading mode +/AdvModelShading (unsynced) Set or toggle advanced model shading mode +/AIControl (unsynced) Creates a new instance of a Skirmish AI, to let it controll a specific team +/AIKill (unsynced) Kills the Skirmish AI controlling a specified team +/AIList (unsynced) Prints a list of all currently active Skirmish AIs +/AIReload (unsynced) Reloads the Skirmish AI controlling a specified team +/AirMesh (unsynced) Show/Hide the smooth air-mesh map overlay +/AllMapMarks (unsynced) Show/Hide all map marks drawn so far +/Ally (unsynced) Starts/Ends alliance of the local players ally-team with another ally-team +/ATM (unsynced) Redirects command /ATM to its synced processor +/BufferText (unsynced) Write the argument string(s) directly to the console history, but not anywhere else. This is useful for fast manual issuing of the command, later on +/Chat (unsynced) Starts waiting for intput to be sent to +/ChatAll (unsynced) Starts waiting for intput to be sent to All +/ChatAlly (unsynced) Starts waiting for intput to be sent to Ally +/ChatSpec (unsynced) Starts waiting for intput to be sent to Spec +/ClearMapMarks (unsynced) Remove all map marks drawn so far +/Clock (unsynced) Shows a small digital clock indicating the local time +/CmdColors (unsynced) Reloads cmdcolors.txt +/CommandHelp (unsynced) Prints info about a specific chat command (so far only synced/unsynced and the description) +/CommandList (unsynced) Prints all the available chat commands with description (if available) to the console +/Console (unsynced) Enables/Disables the in-game console +/ControlUnit (unsynced) Start to first-person-control a unit +/Crash (unsynced) Invoke an artificial crash through a NULL-pointer dereference (SIGSEGV) +/CreateVideo (unsynced) Start/Stop capturing a video of the game in progress +/Cross (unsynced) Allows one to exchange and modify the appearance of the cross/mouse-pointer in first-person-control view +/CtrlPanel (unsynced) Reloads GUI config +/Debug (unsynced) Enable/Disable debug rendering mode +/DebugColVol (unsynced) Enable/Disable drawing of collision volumes +/DebugDrawAI (unsynced) Enables/Disables debug drawing for AIs +/DebugGL (unsynced) Enable/Disable OpenGL debug-context output +/DebugGLErrors (unsynced) Enable/Disable OpenGL debug-errors +/DebugInfo (unsynced) Print debug info to the chat/log-file about either: sound, profiling +/DebugPath (unsynced) Enable/Disable drawing of pathfinder debug-data +/DebugTraceRay (unsynced) Enable/Disable drawing of traceray debug-data +/DecGUIOpacity (unsynced) Decreases the the opacity(see-through-ness) of GUI elements +/DecreaseViewRadius (unsynced) Decrease the view radius (higher performance, uglier view) +/Deselect (unsynced) Deselects all currently selected units +/Destroy (unsynced) Destroys one or multiple units by unit-ID, instantly +/DistDraw (unsynced) Set the distance between units and camera, at which they turn into far-textures (flat/texture-only representation) (Graphic setting) +/DistIcon (unsynced) Set the distance between units and camera, at which they turn into icons (Graphic setting) +/DivByZero (unsynced) Invoke an artificial crash by performing a division-by-Zero +/DrawInMap (unsynced) Enables drawing on the map +/DrawLabel (unsynced) Draws a label on the map at the current mouse-pointer position +/DrawTrees (unsynced) Enable/Disable engine-tree rendering +/DumpState (unsynced) dump game-state to file +/DynamicSky (unsynced) Enable/Disable dynamic-sky rendering +/Echo (unsynced) Write a string to the log file +/EndGraph (unsynced) Enables/Disables the statistics graphs shown at the end of the game +/Exception (unsynced) Invoke an artificial crash by throwing an std::runtime_error +/Font (unsynced) Reloads the fonts +/FPS (unsynced) Shows/Hides the frames-per-second indicator +/FPSHud (unsynced) Enables/Disables HUD (GUI interface) shown in first-person-control mode +/Fullscreen (unsynced) Switches fullscreen mode +/GameInfo (unsynced) Enables/Disables game-info panel rendering +/GatherMode (unsynced) Enter/Leave gather-wait command mode +/Give (unsynced) Places one or multiple units of a single or multiple types on the map, instantly; by default to your own team +/GrabInput (unsynced) Prevents/Enables the mouse from leaving the game window (windowed mode only) +/GroundDecals (unsynced) Disable/Enable ground-decals rendering. Ground-decals are things like scars appearing on the map after an explosion. +/GroundDetail (unsynced) Set the level of ground detail +/Group (unsynced) Allows modifying the members of a group +/Group0 (unsynced) Allows modifying the members of group 0 +/Group1 (unsynced) Allows modifying the members of group 1 +/Group2 (unsynced) Allows modifying the members of group 2 +/Group3 (unsynced) Allows modifying the members of group 3 +/Group4 (unsynced) Allows modifying the members of group 4 +/Group5 (unsynced) Allows modifying the members of group 5 +/Group6 (unsynced) Allows modifying the members of group 6 +/Group7 (unsynced) Allows modifying the members of group 7 +/Group8 (unsynced) Allows modifying the members of group 8 +/Group9 (unsynced) Allows modifying the members of group 9 +/HardwareCursor (unsynced) Enables/Disables hardware mouse-cursor support +/HideInterface (unsynced) Hide/Show the GUI controlls +/IncGUIOpacity (unsynced) Increases the the opacity(see-through-ness) of GUI elements +/IncreaseViewRadius (unsynced) Increase the view radius (lower performance, nicer view) +/Info (unsynced) Shows/Hides the player roster +/InputTextGeo (unsynced) Move and/or resize the input-text field (the "Say: " thing) +/LastMsgPos (unsynced) Moves the camera to show the position of the last message +/LessClouds (unsynced) Decreases the density of clouds (higher performance) +/LessTrees (unsynced) Decreases distance from the camera at which trees are still drawn +/LODScale (unsynced) Set the scale for either of: LOD (level-of-detail), shadow-LOD, reflection-LOD, refraction-LOD +/LuaGaia (unsynced) Redirects command /LuaGaia to its synced processor +/LuaRules (unsynced) Redirects command /LuaRules to its synced processor +/LuaSave (unsynced) Save the game state to a specific file, add -y to overwrite when file is already present +/LuaUI (unsynced) Allows one to reload or disable LuaUI, or alternatively to send a chat message to LuaUI +/MapBorder (unsynced) Set or toggle map-border rendering +/MapMarks (unsynced) Enables/Disables map marks rendering +/mapmeshdrawer (unsynced) Switch map-mesh rendering modes: 0=GCM, 1=HLOD, 2=ROAM +/MapShadowPolyOffset (unsynced) +/MaxNanoParticles (unsynced) Set the maximum number of nano-particles (Graphic setting) +/MaxParticles (unsynced) Set the maximum number of particles (Graphics setting) +/MiniMap (unsynced) FIXME document subcommands +/MoreClouds (unsynced) Increases the density of clouds (lower performance) +/MoreTrees (unsynced) Increases distance from the camera at which trees are still drawn +/Mouse1 (unsynced) Simulates a mouse button press of button 1 +/Mouse2 (unsynced) Simulates a mouse button press of button 2 +/Mouse3 (unsynced) Simulates a mouse button press of button 3 +/Mouse4 (unsynced) Simulates a mouse button press of button 4 +/Mouse5 (unsynced) Simulates a mouse button press of button 5 +/MoveBack (unsynced) Moves the camera Back a bit +/MoveDown (unsynced) Moves the camera Down a bit +/MoveFast (unsynced) Moves the camera Fast a bit +/MoveForward (unsynced) Moves the camera Forward a bit +/MoveLeft (unsynced) Moves the camera Left a bit +/MoveRight (unsynced) Moves the camera Right a bit +/MoveSlow (unsynced) Moves the camera Slow a bit +/MoveUp (unsynced) Moves the camera Up a bit +/MuteSound (unsynced) Mute/Unmute the current sound system +/NoLuaDraw (unsynced) Allow/Disallow Lua to draw on the map +/PasteText (unsynced) Paste either the argument string(s) or if none given, the content of the clip-board to chat input +/Pause (unsynced) Pause/Unpause the game +/QuitForce (unsynced) Exits game to system +/QuitMenu (unsynced) Opens the quit-menu, if it is not already open +/QuitMessage (unsynced) Deprecated, see /Quit instead (was used to quite the game immediately) +/ReloadForce (unsynced) Exits game to menu +/ReloadGame (unsynced) Restarts the game with the initially provided start-script +/ReloadShaders (unsynced) Reloads all engine shaders +/ResBar (unsynced) Shows/Hides team resource storage indicator bar +/Resync (unsynced) Redirects command /Resync to its synced processor +/SafeGL (unsynced) Enables/Disables OpenGL safe-mode +/Save (unsynced) Save the game state to a specific file, add -y to overwrite when file is already present +/SaveGame (unsynced) Save the game state to QuickSave.ssf (BROKEN) +/Say (unsynced) Say something in (public) chat +/ScreenShot (unsynced) Take a screen-shot of the current view +/Select (unsynced) +/SelectCycle (unsynced) +/SelectUnits (unsynced) +/Send (unsynced) Send a string as raw network message to the game host (for debugging only) +/Set (unsynced) Set a config key=value pair +/Shadows (unsynced) Disables/Enables shadows rendering: -1=disabled, 0=off, 1=full shadows, 2=skip terrain shadows +/ShareDialog (unsynced) Opens the share dialog, which allows you to send units and resources to other players +/ShowElevation (unsynced) Enable rendering of the auxiliary height-map overlay +/ShowMetalMap (unsynced) Enable rendering of the auxiliary metal-map overlay +/ShowPathCost (unsynced) Enable rendering of the path cost-map overlay +/ShowPathFlow (unsynced) Enable/Disable rendering of the path flow-map overlay +/ShowPathHeat (unsynced) Enable/Disable rendering of the path heat-map overlay +/ShowPathTraversability (unsynced) Enable rendering of the path traversability-map overlay +/ShowPathType (unsynced) Shows path traversability for a given MoveDefName, MoveDefID or UnitDefName +/ShowStandard (unsynced) Disable rendering of all auxiliary map overlays +/SlowDown (unsynced) Decreases the simulation speed. The engine will try to simulate less frames per second +/SoundChannelEnable (unsynced) Enable/Disable specific sound channels: UnitReply, General, Battle, UserInterface, Music +/SoundDevice (unsynced) Switch the sound output system (currently only OpenAL / NullAudio) +/SpecFullView (unsynced) Sets or toggles between full LOS or ally-team LOS, if the local user is a spectator +/Spectator (unsynced) Lets the local user give up control over a team, and start spectating +/SpecTeam (unsynced) Lets the local user specify the team to follow, if he is a spectator +/Speed (unsynced) Shows/Hides the simulation speed indicator +/SpeedControl (unsynced) Sets how server adjusts speed according to player's load (CPU), 1: use average, 2: use highest, +/SpeedUp (unsynced) Increases the simulation speed. The engine will try to simulate more frames per second +/Take (unsynced) Redirects command /Take to its synced processor +/Team (unsynced) Lets the local user change to another team +/TeamHighlight (unsynced) Enables/Disables uncontrolled team blinking +/ToggleInfo (unsynced) Toggles current info texture view +/ToggleLOS (unsynced) Enable rendering of the auxiliary LOS-map overlay +/ToolTip (unsynced) Enables/Disables the general tool-tips, displayed when hovering over units. features or the map +/Track (unsynced) Start following the selected unit(s) with the camera +/TrackMode (unsynced) Shift through different ways of following selected unit(s) +/TrackOff (unsynced) Stop following the selected unit(s) with the camera +/TSet (unsynced) Set a config key=value pair in the overlay, meaning it will not be persisted for future games +/ViewSelection (unsynced) Moves the camera to the center of the currently selected units +/VSync (unsynced) Enables/Disables vertical-sync (Graphics setting) +/W (unsynced) Say something in private to a specific player, by player-name +/Water (unsynced) Set water rendering mode: 0=basic, 1=reflective, 2=dynamic, 3=reflective&refractive, 4=bump-mapped +/WByNum (unsynced) Say something in private to a specific player, by player-ID +/WireMap (unsynced) Toggle wireframe-mode drawing of map geometry +/WireModel (unsynced) Toggle wireframe-mode drawing of model geometry +/WireSky (unsynced) Toggle wireframe-mode drawing of skydome geometry +/WireTree (unsynced) Toggle wireframe-mode drawing of tree geometry +/WireWater (unsynced) Toggle wireframe-mode drawing of water geometry \ No newline at end of file diff --git a/credits.txt b/credits/credits.txt similarity index 86% rename from credits.txt rename to credits/credits.txt index 87eefd623..94ea4f3bc 100644 --- a/credits.txt +++ b/credits/credits.txt @@ -8,7 +8,22 @@ KaiserJ (Lead 3d Artist (Models, Textures)) Jay Sound (Sound Design http://www.impactgameaudio.com) -Music: +Floris +-UI Sex +-ControlVictory UI + +CommonPlayer +-Many fixes and enhancements +-Proper resource bars +-Addition of hotkeys and costs on build menu + +Dmdr +-Unit Icons + +Music: (Current Soundtrack) +The Enigma TNG http://theenigmatng.bandcamp.com/ + +Music: (Original Soundtrack) Wasp - Michael J. Powell Deathkillr84 http://deathkllr84.newgrounds.com/ FreddyFog http://freddyfog.newgrounds.com/ @@ -16,6 +31,10 @@ Fire118 http://fire118.newgrounds.com/ Lunyalex http://lunyalex.newgrounds.com/ Wahnsinn http://wahnsinn.newgrounds.com/ Coredxbitch http://coredxbitch.newgrounds.com/ +Deadly-dare http://deadly-dare.newgrounds.com/ +Nick Dyson http://nickdyson09.newgrounds.com/ +Fire118 http://fire118.newgrounds.com/ +winKoneR http://winkoner.newgrounds.com/ Zoombie (Writer - Prologue Storyline creator) diff --git a/credits/dmdr_license_for_unit_icons.txt b/credits/dmdr_license_for_unit_icons.txt new file mode 100644 index 000000000..6f1e7e73f --- /dev/null +++ b/credits/dmdr_license_for_unit_icons.txt @@ -0,0 +1,24 @@ +All dmdr_* icons were modified from the original images by me, dmdr, except for the lightning bolts in dmdr_riot_alt/lit.png and dmdr_energy.png which were created from scratch (wow so talented). +They were originally created for use in Forboding_Angel's open source real time strategy game 'Evolution RTS'. + +https://github.com/EvolutionRTS/Evolution-RTS + +Source files used: + +https://openclipart.org/detail/29029/bullet-silhouettes +https://openclipart.org/detail/253954/radioactive-transparent-icon +https://openclipart.org/detail/96985/hazard-warning-sign-explosion +https://openclipart.org/detail/239289/cartoon-cheese +https://openclipart.org/detail/127483/triangle-equilateral +https://openclipart.org/detail/264375/rocket-9 +https://openclipart.org/detail/180065/abomb-by-rones +https://openclipart.org/detail/149047/pacman-hexagons +https://openclipart.org/detail/220693/medieval-shields +https://openclipart.org/detail/15971/adjustable-spanner-silhouette +https://openclipart.org/detail/27178/peace-symbol +http://www.clker.com/clipart-85755.html +https://openclipart.org/detail/29242/rubiks-cube + +Because these are all public domain images, so far as I'm concerned all of my icons so created from them are also PD. Please include the links to the source files if you do reuse these icons in a different context, however, because that's the polite thing to do. + +Please note, however, that any icons found in the Evolution RTS data files that are NOT prefaced with dmdr_ were created by Forboding_Angel and others and as such are NOT subject to these licensing terms! Please consult the Evolution RTS license.txt, available at the GitHub link above, for further information. diff --git a/dummyfile.txt b/dummyfile.txt index e5c979cb5..b868c9703 100644 --- a/dummyfile.txt +++ b/dummyfile.txt @@ -1,4 +1 @@ -test -test 2 -test 3 -test4 \ No newline at end of file +This is for a junk commit \ No newline at end of file diff --git a/fonts/JosefinSans-SemiBold.ttf b/fonts/JosefinSans-SemiBold.ttf new file mode 100644 index 000000000..1ca56c76e Binary files /dev/null and b/fonts/JosefinSans-SemiBold.ttf differ diff --git a/goldwave settings/lasers.jpg b/goldwave settings/lasers.jpg new file mode 100644 index 000000000..0d00560ab Binary files /dev/null and b/goldwave settings/lasers.jpg differ diff --git a/howtoplay.txt b/howtoplay.txt new file mode 100644 index 000000000..fc7481bda --- /dev/null +++ b/howtoplay.txt @@ -0,0 +1,61 @@ +/Control_Points Section 1 + +Control Points are spread throughout the map. The points can be captured by simply moving units into the circle. It’s very similar to how Dawn of War or Battlefield control points works. Probably more similar to Battlefield. You and your opponent(s) start with a maximum score (by default right now it is 2750). For each Control Point that your opponent controls, you will lose that many points from your score every second. There are 7 points on each map that can be captured. This causes you to need to move out as quickly as possible, and you will find that you constantly are fighting over control points. When a player reaches a score of 0, that player’s units will explode. This makes for some very intense and exciting games. + +Because of this, capturing and holding control points is more important than directly attacking your enemy's base. It doesn't help to nearly destroy your enemy if you lose because he was holding all of the capture points. + +Additionally, there are 3 Control Victory modes: + +/Countdown Section 1.a +/Tug_of_War Section 1.b +/Domination Section 1.c + +Countdown is the game mode previously described. Both player’s score counts down until someone hits 0. + +Tug of war causes the points to be transferred from one player to another but with a small catch… Point values are doubled, meaning that if you own 7 points, you will receive 14 score points from your opponent every second. + +Domination requires that you own all of the Control Points for 30 seconds. If you accomplish this then you score 1000 points, at which point all of the Control Points capture status is reset (in other words all points go neutral after a score). First player to 3500 points wins! + +All of the parameters are highly configurable from the lobby, and you can change nearly everything about the gameplay with these configuration options. + + +/Metal Section 2 + +Metal is used solely for construction projects, whether you are trying to build a turret, factory, generator, tank, aircraft, etc, Metal is what is used for that construction project. More metal income means that you can build more things simultaneously, faster. Metal income is predetermined by how far the game has progressed. You start with +3 metal income which increases by +3 every 2.5 minutes until it caps at +15 total. + +If your available metal is equal to your maximum metal storage amount, metal income will be ignored, wasting potential resources. However, if you have allies a percentage is spilled over to them, providing that they aren't maxed out as well. Metal storage can be increased by building Supply Depots. + +You can supplement your metal and energy income by reclaiming Energy Cores. + + +/Energy Section 3 + +Energy is used specifically for utilitarian purposes. Those purposes include, Units firing, Recharging shields, Cloaking, etc. + +Energy is extremely important. The same buildings that provide energy also provide you with Power. The most basic reasons of why energy is so important is the fact that your units require it in order to fire their weapons. As a result, if you get in the middle of a battle and run out of energy, your units will no longer be able to fire, and that might not only cost you the battle, it might also cost you the game! + +Energy income is determined by how many of these generators are built. If your energy on hand is the same amount as your maximum energy storage, the energy from the energy income is wasted. However, if you have allies a percentage is spilled over to them, providing that they aren't maxed out as well, similar to the metal storage mechanic. + +Energy storage can be supplemented with Supply Depots. Energy storage is arguably as important or even more important than energy generation because energy is generally consumed in large bursts during battles or nuke launches as opposed to in a slow, gradual but consistent fashion like metal consumption, meaning that in peace time a high energy income is not useful. + +Energy can be obtained via the following buildings: + +Basic Generator Medium Generator Geothermal Generator Advanced Generator + + +/Generators Section 4 + +Generators is used by factories to unlock attack units, it is provided by the same buildings that produce Energy. They are the Basic/Medium/Geothermal/Advanced Generators. Generators give Power to factories anywhere on the map and thusly can be placed anywhere. + +/Note Section 4.a + +Geothermal Generators can only be placed on spots that have smoke coming out of it, you can find these spots easier if you click on a Geothermal Generator in the build menu. Geothermal spots will be highlighted on the minimap with a yellow X and on the map itself with a very tall yellow column. If you can place a Geothermal Generator near your start position, it is a good idea to build it rather than Basic Generators as you get to start with most units unlocked. + + +/Supply Section 5 + +Supply is similar to population seen in other RTS games. Attack units use Supply, and thus you cannot build any more of them once you reached the Supply limit. Supply Depots also increase Metal and Energy maximum reserves by +25/+25 per Depot. + +In addition to increasing your army supply limit, Supply Depots are excellent tools to help buffer your Metal and Energy reserves. When your Metal and Energy reserves are full, any excess is wasted (if in a 1v1 game, otherwise it spills over to your allies in team games), so it makes a lot of sense to have a large buffer zone for your resources. It can also help with Metal stalling with large construction projects, and more importantly, it can allow you to have much greater staying power in a large battles where your units are using tons of energy in order to keep fighting. + +Increased supply and resource storage can be obtained via the Supply Depot building. \ No newline at end of file diff --git a/icons/assault.png b/icons/assault.png index 68e0781b5..9f03ff40f 100644 Binary files a/icons/assault.png and b/icons/assault.png differ diff --git a/icons/commander.png b/icons/commander.png index babaaea12..c6191034f 100644 Binary files a/icons/commander.png and b/icons/commander.png differ diff --git a/icons/commander_old.png b/icons/commander_old.png new file mode 100644 index 000000000..babaaea12 Binary files /dev/null and b/icons/commander_old.png differ diff --git a/icons/default.png b/icons/default.png index 807b5291b..c282e68e3 100644 Binary files a/icons/default.png and b/icons/default.png differ diff --git a/icons/default_old.png b/icons/default_old.png new file mode 100644 index 000000000..807b5291b Binary files /dev/null and b/icons/default_old.png differ diff --git a/icons/defense.png b/icons/defense.png index 084b676b3..9349fe488 100644 Binary files a/icons/defense.png and b/icons/defense.png differ diff --git a/icons/defense_old.png b/icons/defense_old.png new file mode 100644 index 000000000..084b676b3 Binary files /dev/null and b/icons/defense_old.png differ diff --git a/icons/dmdr_air_all.png b/icons/dmdr_air_all.png new file mode 100644 index 000000000..f6079442c Binary files /dev/null and b/icons/dmdr_air_all.png differ diff --git a/icons/dmdr_air_arm.png b/icons/dmdr_air_arm.png new file mode 100644 index 000000000..8fd1a6b2b Binary files /dev/null and b/icons/dmdr_air_arm.png differ diff --git a/icons/dmdr_air_arm_old.png b/icons/dmdr_air_arm_old.png new file mode 100644 index 000000000..c692317ff Binary files /dev/null and b/icons/dmdr_air_arm_old.png differ diff --git a/icons/dmdr_air_bmb.png b/icons/dmdr_air_bmb.png new file mode 100644 index 000000000..c9bb81acf Binary files /dev/null and b/icons/dmdr_air_bmb.png differ diff --git a/icons/dmdr_air_bmb_old.png b/icons/dmdr_air_bmb_old.png new file mode 100644 index 000000000..d3cb5fc62 Binary files /dev/null and b/icons/dmdr_air_bmb_old.png differ diff --git a/icons/dmdr_air_lit.png b/icons/dmdr_air_lit.png new file mode 100644 index 000000000..663b26c07 Binary files /dev/null and b/icons/dmdr_air_lit.png differ diff --git a/icons/dmdr_air_lit_old.png b/icons/dmdr_air_lit_old.png new file mode 100644 index 000000000..76ba4a9f3 Binary files /dev/null and b/icons/dmdr_air_lit_old.png differ diff --git a/icons/dmdr_air_sct.png b/icons/dmdr_air_sct.png new file mode 100644 index 000000000..b68f122f3 Binary files /dev/null and b/icons/dmdr_air_sct.png differ diff --git a/icons/dmdr_arty_arm.png b/icons/dmdr_arty_arm.png new file mode 100644 index 000000000..b86699757 Binary files /dev/null and b/icons/dmdr_arty_arm.png differ diff --git a/icons/dmdr_arty_lit.png b/icons/dmdr_arty_lit.png new file mode 100644 index 000000000..4bc6a7c64 Binary files /dev/null and b/icons/dmdr_arty_lit.png differ diff --git a/icons/dmdr_box.png b/icons/dmdr_box.png new file mode 100644 index 000000000..e034b1849 Binary files /dev/null and b/icons/dmdr_box.png differ diff --git a/icons/dmdr_buckler.png b/icons/dmdr_buckler.png new file mode 100644 index 000000000..b23208571 Binary files /dev/null and b/icons/dmdr_buckler.png differ diff --git a/icons/dmdr_end_krow.png b/icons/dmdr_end_krow.png new file mode 100644 index 000000000..e6836acda Binary files /dev/null and b/icons/dmdr_end_krow.png differ diff --git a/icons/dmdr_end_lacr.png b/icons/dmdr_end_lacr.png new file mode 100644 index 000000000..819a45af1 Binary files /dev/null and b/icons/dmdr_end_lacr.png differ diff --git a/icons/dmdr_end_lvlr.png b/icons/dmdr_end_lvlr.png new file mode 100644 index 000000000..80b9fc68c Binary files /dev/null and b/icons/dmdr_end_lvlr.png differ diff --git a/icons/dmdr_end_nrkd.png b/icons/dmdr_end_nrkd.png new file mode 100644 index 000000000..73dd4540e Binary files /dev/null and b/icons/dmdr_end_nrkd.png differ diff --git a/icons/dmdr_end_nrkd2.png b/icons/dmdr_end_nrkd2.png new file mode 100644 index 000000000..177aac4b8 Binary files /dev/null and b/icons/dmdr_end_nrkd2.png differ diff --git a/icons/dmdr_energy.png b/icons/dmdr_energy.png new file mode 100644 index 000000000..fd52f9da7 Binary files /dev/null and b/icons/dmdr_energy.png differ diff --git a/icons/dmdr_engi.png b/icons/dmdr_engi.png new file mode 100644 index 000000000..8ffe79d22 Binary files /dev/null and b/icons/dmdr_engi.png differ diff --git a/icons/dmdr_mtd_aa.png b/icons/dmdr_mtd_aa.png new file mode 100644 index 000000000..6ab0a2a6f Binary files /dev/null and b/icons/dmdr_mtd_aa.png differ diff --git a/icons/dmdr_mtd_la.png b/icons/dmdr_mtd_la.png new file mode 100644 index 000000000..ef8139c07 Binary files /dev/null and b/icons/dmdr_mtd_la.png differ diff --git a/icons/dmdr_mtd_lb.png b/icons/dmdr_mtd_lb.png new file mode 100644 index 000000000..cc56a0c31 Binary files /dev/null and b/icons/dmdr_mtd_lb.png differ diff --git a/icons/dmdr_nuke.png b/icons/dmdr_nuke.png new file mode 100644 index 000000000..ef6bcb787 Binary files /dev/null and b/icons/dmdr_nuke.png differ diff --git a/icons/dmdr_orb.png b/icons/dmdr_orb.png new file mode 100644 index 000000000..b5c741582 Binary files /dev/null and b/icons/dmdr_orb.png differ diff --git a/icons/dmdr_raider.png b/icons/dmdr_raider.png new file mode 100644 index 000000000..cbbbcfc18 Binary files /dev/null and b/icons/dmdr_raider.png differ diff --git a/icons/dmdr_raider_old.png b/icons/dmdr_raider_old.png new file mode 100644 index 000000000..4a4abc9fc Binary files /dev/null and b/icons/dmdr_raider_old.png differ diff --git a/icons/dmdr_riot_arm.png b/icons/dmdr_riot_arm.png new file mode 100644 index 000000000..37ccbb4ff Binary files /dev/null and b/icons/dmdr_riot_arm.png differ diff --git a/icons/dmdr_riot_lit.png b/icons/dmdr_riot_lit.png new file mode 100644 index 000000000..dbda618c2 Binary files /dev/null and b/icons/dmdr_riot_lit.png differ diff --git a/icons/dmdr_shield.png b/icons/dmdr_shield.png new file mode 100644 index 000000000..71897a81f Binary files /dev/null and b/icons/dmdr_shield.png differ diff --git a/icons/dmdr_shield_base.png b/icons/dmdr_shield_base.png new file mode 100644 index 000000000..51044577f Binary files /dev/null and b/icons/dmdr_shield_base.png differ diff --git a/icons/dmdr_shield_mobile.png b/icons/dmdr_shield_mobile.png new file mode 100644 index 000000000..71897a81f Binary files /dev/null and b/icons/dmdr_shield_mobile.png differ diff --git a/icons/dmdr_shield_nuke.png b/icons/dmdr_shield_nuke.png new file mode 100644 index 000000000..0a36c3bc7 Binary files /dev/null and b/icons/dmdr_shield_nuke.png differ diff --git a/icons/dmdr_td_aa.png b/icons/dmdr_td_aa.png new file mode 100644 index 000000000..8499ec3ab Binary files /dev/null and b/icons/dmdr_td_aa.png differ diff --git a/icons/dmdr_td_ab.png b/icons/dmdr_td_ab.png new file mode 100644 index 000000000..d1991fc8e Binary files /dev/null and b/icons/dmdr_td_ab.png differ diff --git a/icons/dmdr_td_al.png b/icons/dmdr_td_al.png new file mode 100644 index 000000000..a9e204dcb Binary files /dev/null and b/icons/dmdr_td_al.png differ diff --git a/icons/dmdr_td_la.png b/icons/dmdr_td_la.png new file mode 100644 index 000000000..97a8141f4 Binary files /dev/null and b/icons/dmdr_td_la.png differ diff --git a/icons/dmdr_td_lb.png b/icons/dmdr_td_lb.png new file mode 100644 index 000000000..18af9140a Binary files /dev/null and b/icons/dmdr_td_lb.png differ diff --git a/icons/dmdr_td_ll.png b/icons/dmdr_td_ll.png new file mode 100644 index 000000000..340eb7375 Binary files /dev/null and b/icons/dmdr_td_ll.png differ diff --git a/icons/dmdr_tech.png b/icons/dmdr_tech.png new file mode 100644 index 000000000..96382ba38 Binary files /dev/null and b/icons/dmdr_tech.png differ diff --git a/icons/dmdr_tport.png b/icons/dmdr_tport.png new file mode 100644 index 000000000..edfbeb387 Binary files /dev/null and b/icons/dmdr_tport.png differ diff --git a/icons/engineer.png b/icons/engineer.png index 54249d6ef..6c96827a8 100644 Binary files a/icons/engineer.png and b/icons/engineer.png differ diff --git a/icons/etransport.png b/icons/etransport.png new file mode 100644 index 000000000..f0d99ac0c Binary files /dev/null and b/icons/etransport.png differ diff --git a/icons/factories.png b/icons/factories.png index 022064842..858dcfa69 100644 Binary files a/icons/factories.png and b/icons/factories.png differ diff --git a/icons/factories_old.png b/icons/factories_old.png new file mode 100644 index 000000000..022064842 Binary files /dev/null and b/icons/factories_old.png differ diff --git a/icons/factory.png b/icons/factory.png index 022064842..858dcfa69 100644 Binary files a/icons/factory.png and b/icons/factory.png differ diff --git a/icons/factory_old.png b/icons/factory_old.png new file mode 100644 index 000000000..022064842 Binary files /dev/null and b/icons/factory_old.png differ diff --git a/icons/orb.png b/icons/orb.png index 5346488ee..6c96827a8 100644 Binary files a/icons/orb.png and b/icons/orb.png differ diff --git a/icons/radar.png b/icons/radar.png index 46b0a62c4..2dda62b99 100644 Binary files a/icons/radar.png and b/icons/radar.png differ diff --git a/icons/radar_old.png b/icons/radar_old.png new file mode 100644 index 000000000..14fad73a8 Binary files /dev/null and b/icons/radar_old.png differ diff --git a/icons/radarjam.png b/icons/radarjam.png index 6df7c427e..f085bde46 100644 Binary files a/icons/radarjam.png and b/icons/radarjam.png differ diff --git a/icons/radarjam_old.png b/icons/radarjam_old.png new file mode 100644 index 000000000..40eeb8f5c Binary files /dev/null and b/icons/radarjam_old.png differ diff --git a/icons/special.png b/icons/special.png new file mode 100644 index 000000000..e0255c36f Binary files /dev/null and b/icons/special.png differ diff --git a/icons/storage.png b/icons/storage.png new file mode 100644 index 000000000..196501b04 Binary files /dev/null and b/icons/storage.png differ diff --git a/icons/support.png b/icons/support.png index f0d99ac0c..5070274b6 100644 Binary files a/icons/support.png and b/icons/support.png differ diff --git a/icons/support_old.png b/icons/support_old.png new file mode 100644 index 000000000..f0d99ac0c Binary files /dev/null and b/icons/support_old.png differ diff --git a/icons/support_old_new.png b/icons/support_old_new.png new file mode 100644 index 000000000..0a0f1d2f3 Binary files /dev/null and b/icons/support_old_new.png differ diff --git a/icons/trt_all.png b/icons/trt_all.png new file mode 100644 index 000000000..78981a6c7 Binary files /dev/null and b/icons/trt_all.png differ diff --git a/icons/trt_arm.png b/icons/trt_arm.png new file mode 100644 index 000000000..8d10cfd50 Binary files /dev/null and b/icons/trt_arm.png differ diff --git a/icons/trt_art.png b/icons/trt_art.png new file mode 100644 index 000000000..c7b84e318 Binary files /dev/null and b/icons/trt_art.png differ diff --git a/icons/trt_lit.png b/icons/trt_lit.png new file mode 100644 index 000000000..bb7d79915 Binary files /dev/null and b/icons/trt_lit.png differ diff --git a/icons/z/source/PNGs/Arty.png b/icons/z/source/PNGs/Arty.png new file mode 100644 index 000000000..f1d2a1009 Binary files /dev/null and b/icons/z/source/PNGs/Arty.png differ diff --git a/icons/z/source/PNGs/Endbringer.png b/icons/z/source/PNGs/Endbringer.png new file mode 100644 index 000000000..2cd52167c Binary files /dev/null and b/icons/z/source/PNGs/Endbringer.png differ diff --git a/icons/z/source/PNGs/Swarm.png b/icons/z/source/PNGs/Swarm.png new file mode 100644 index 000000000..91e5370cd Binary files /dev/null and b/icons/z/source/PNGs/Swarm.png differ diff --git a/icons/z/source/PNGs/ZaalAirToAirFighter.png b/icons/z/source/PNGs/ZaalAirToAirFighter.png new file mode 100644 index 000000000..d86e186e8 Binary files /dev/null and b/icons/z/source/PNGs/ZaalAirToAirFighter.png differ diff --git a/icons/z/source/PNGs/ZaalAirToGroundFighter.png b/icons/z/source/PNGs/ZaalAirToGroundFighter.png new file mode 100644 index 000000000..a12bf7aaa Binary files /dev/null and b/icons/z/source/PNGs/ZaalAirToGroundFighter.png differ diff --git a/icons/z/source/PNGs/ZaalArmoredAssault.png b/icons/z/source/PNGs/ZaalArmoredAssault.png new file mode 100644 index 000000000..3938109a9 Binary files /dev/null and b/icons/z/source/PNGs/ZaalArmoredAssault.png differ diff --git a/icons/z/source/PNGs/ZaalArty.png b/icons/z/source/PNGs/ZaalArty.png new file mode 100644 index 000000000..d7cbb6d9e Binary files /dev/null and b/icons/z/source/PNGs/ZaalArty.png differ diff --git a/icons/z/source/PNGs/ZaalBase.png b/icons/z/source/PNGs/ZaalBase.png new file mode 100644 index 000000000..d5af0a651 Binary files /dev/null and b/icons/z/source/PNGs/ZaalBase.png differ diff --git a/icons/z/source/PNGs/ZaalBomber.png b/icons/z/source/PNGs/ZaalBomber.png new file mode 100644 index 000000000..1e1cc1f7b Binary files /dev/null and b/icons/z/source/PNGs/ZaalBomber.png differ diff --git a/icons/z/source/PNGs/ZaalMediumSwarmer.png b/icons/z/source/PNGs/ZaalMediumSwarmer.png new file mode 100644 index 000000000..166afcdfc Binary files /dev/null and b/icons/z/source/PNGs/ZaalMediumSwarmer.png differ diff --git a/icons/z/source/PNGs/ZaalQueen.png b/icons/z/source/PNGs/ZaalQueen.png new file mode 100644 index 000000000..1e04f55a9 Binary files /dev/null and b/icons/z/source/PNGs/ZaalQueen.png differ diff --git a/icons/z/source/PNGs/ZaalScout.png b/icons/z/source/PNGs/ZaalScout.png new file mode 100644 index 000000000..b07b80ae0 Binary files /dev/null and b/icons/z/source/PNGs/ZaalScout.png differ diff --git a/icons/z/source/PNGs/ZaalSkirmisher.png b/icons/z/source/PNGs/ZaalSkirmisher.png new file mode 100644 index 000000000..0a27bd344 Binary files /dev/null and b/icons/z/source/PNGs/ZaalSkirmisher.png differ diff --git a/icons/z/source/PNGs/ZaalSwarmer2.png b/icons/z/source/PNGs/ZaalSwarmer2.png new file mode 100644 index 000000000..2b0d12ed2 Binary files /dev/null and b/icons/z/source/PNGs/ZaalSwarmer2.png differ diff --git a/icons/z/source/PNGs/armor1.png b/icons/z/source/PNGs/armor1.png new file mode 100644 index 000000000..db0aa3436 Binary files /dev/null and b/icons/z/source/PNGs/armor1.png differ diff --git a/icons/z/source/PNGs/armor2.png b/icons/z/source/PNGs/armor2.png new file mode 100644 index 000000000..82396aba4 Binary files /dev/null and b/icons/z/source/PNGs/armor2.png differ diff --git a/icons/z/source/PNGs/armor3.png b/icons/z/source/PNGs/armor3.png new file mode 100644 index 000000000..d50c96934 Binary files /dev/null and b/icons/z/source/PNGs/armor3.png differ diff --git a/icons/z/source/ZaalAirBase.xcf b/icons/z/source/ZaalAirBase.xcf new file mode 100644 index 000000000..9198a6fb7 Binary files /dev/null and b/icons/z/source/ZaalAirBase.xcf differ diff --git a/icons/z/source/ZaalAirBomber.xcf b/icons/z/source/ZaalAirBomber.xcf new file mode 100644 index 000000000..8217ff44a Binary files /dev/null and b/icons/z/source/ZaalAirBomber.xcf differ diff --git a/icons/z/source/ZaalAirToAirFighter.xcf b/icons/z/source/ZaalAirToAirFighter.xcf new file mode 100644 index 000000000..f8d1b5d47 Binary files /dev/null and b/icons/z/source/ZaalAirToAirFighter.xcf differ diff --git a/icons/z/source/ZaalAirToGroundFighter.xcf b/icons/z/source/ZaalAirToGroundFighter.xcf new file mode 100644 index 000000000..dc89b06b9 Binary files /dev/null and b/icons/z/source/ZaalAirToGroundFighter.xcf differ diff --git a/icons/z/source/ZaalArmoredAssault.xcf b/icons/z/source/ZaalArmoredAssault.xcf new file mode 100644 index 000000000..7039f09f3 Binary files /dev/null and b/icons/z/source/ZaalArmoredAssault.xcf differ diff --git a/icons/z/source/ZaalArty.xcf b/icons/z/source/ZaalArty.xcf new file mode 100644 index 000000000..03c65443b Binary files /dev/null and b/icons/z/source/ZaalArty.xcf differ diff --git a/icons/z/source/ZaalBase.xcf b/icons/z/source/ZaalBase.xcf new file mode 100644 index 000000000..66c9fb966 Binary files /dev/null and b/icons/z/source/ZaalBase.xcf differ diff --git a/icons/z/source/ZaalMediumSwarmer.xcf b/icons/z/source/ZaalMediumSwarmer.xcf new file mode 100644 index 000000000..4feec5d92 Binary files /dev/null and b/icons/z/source/ZaalMediumSwarmer.xcf differ diff --git a/icons/z/source/ZaalQueen.xcf b/icons/z/source/ZaalQueen.xcf new file mode 100644 index 000000000..d887131b9 Binary files /dev/null and b/icons/z/source/ZaalQueen.xcf differ diff --git a/icons/z/source/ZaalSkirmisher.xcf b/icons/z/source/ZaalSkirmisher.xcf new file mode 100644 index 000000000..ada72fb3d Binary files /dev/null and b/icons/z/source/ZaalSkirmisher.xcf differ diff --git a/icons/z/source/ZaalSwarmer.xcf b/icons/z/source/ZaalSwarmer.xcf new file mode 100644 index 000000000..af39ffcef Binary files /dev/null and b/icons/z/source/ZaalSwarmer.xcf differ diff --git a/icons/z/zairscout.png b/icons/z/zairscout.png new file mode 100644 index 000000000..b07b80ae0 Binary files /dev/null and b/icons/z/zairscout.png differ diff --git a/icons/z/zairtoairfighter.png b/icons/z/zairtoairfighter.png new file mode 100644 index 000000000..d86e186e8 Binary files /dev/null and b/icons/z/zairtoairfighter.png differ diff --git a/icons/z/zairtogroundfighter.png b/icons/z/zairtogroundfighter.png new file mode 100644 index 000000000..a12bf7aaa Binary files /dev/null and b/icons/z/zairtogroundfighter.png differ diff --git a/icons/z/zarty.png b/icons/z/zarty.png new file mode 100644 index 000000000..d7cbb6d9e Binary files /dev/null and b/icons/z/zarty.png differ diff --git a/icons/z/zassault.png b/icons/z/zassault.png new file mode 100644 index 000000000..3938109a9 Binary files /dev/null and b/icons/z/zassault.png differ diff --git a/icons/z/zbomber.png b/icons/z/zbomber.png new file mode 100644 index 000000000..1e1cc1f7b Binary files /dev/null and b/icons/z/zbomber.png differ diff --git a/icons/z/zmedswarm.png b/icons/z/zmedswarm.png new file mode 100644 index 000000000..166afcdfc Binary files /dev/null and b/icons/z/zmedswarm.png differ diff --git a/icons/z/zpyro.png b/icons/z/zpyro.png new file mode 100644 index 000000000..8015a4f19 Binary files /dev/null and b/icons/z/zpyro.png differ diff --git a/icons/z/zqueen.png b/icons/z/zqueen.png new file mode 100644 index 000000000..1e04f55a9 Binary files /dev/null and b/icons/z/zqueen.png differ diff --git a/icons/z/zskirmisher.png b/icons/z/zskirmisher.png new file mode 100644 index 000000000..0a27bd344 Binary files /dev/null and b/icons/z/zskirmisher.png differ diff --git a/icons/z/zswarm.png b/icons/z/zswarm.png new file mode 100644 index 000000000..2b0d12ed2 Binary files /dev/null and b/icons/z/zswarm.png differ diff --git a/luaui.lua b/luaui.lua index db491f602..67987c907 100644 --- a/luaui.lua +++ b/luaui.lua @@ -18,7 +18,7 @@ LUAUI_DIRNAME = 'LuaUI/' VFS.DEF_MODE = VFS.RAW_FIRST -local STARTUP_FILENAME = LUAUI_DIRNAME .. 'camain.lua' +local STARTUP_FILENAME = LUAUI_DIRNAME .. 'main_evo.lua' -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -26,10 +26,10 @@ local STARTUP_FILENAME = LUAUI_DIRNAME .. 'camain.lua' do -- use a versionned directory name if it exists local sansslash = string.sub(LUAUI_DIRNAME, 1, -2) - local versiondir = sansslash .. '-' .. Game.version .. '/' - if (VFS.FileExists(versiondir .. 'camain.lua', VFS.RAW_ONLY)) then + local versiondir = sansslash .. '-' .. ((Game and Game.version) or (Engine and Engine.version) or "Engine version error") .. '/' + if (VFS.FileExists(versiondir .. 'main_evo.lua', VFS.RAW_ONLY)) then LUAUI_DIRNAME = versiondir - STARTUP_FILENAME = LUAUI_DIRNAME .. 'camain.lua' + STARTUP_FILENAME = LUAUI_DIRNAME .. 'main_evo.lua' end end @@ -56,5 +56,5 @@ do end --------------------------------------------------------------------------------- --------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- diff --git a/lups/headers/general.lua b/lups/headers/general.lua index 1795029af..0fef94a43 100644 --- a/lups/headers/general.lua +++ b/lups/headers/general.lua @@ -31,6 +31,40 @@ function GetColor(colormap,life) col1[3]*ia + col2[3]*aa, col1[4]*ia + col2[4]*aa end +local function MergeShieldColor(col, frac) + return { + frac*col[1][1] + (1 - frac)*col[2][1], + frac*col[1][2] + (1 - frac)*col[2][2], + frac*col[1][3] + (1 - frac)*col[2][3], + frac*col[1][4] + (1 - frac)*col[2][4], + } +end + +local hitOpacityMult = {1.2, 1.5, 1.5} +local HIT_DURATION = 2 +function GetShieldColor(unitID, self) + local _, charge = Spring.GetUnitShieldState(unitID) + if charge ~= nil then + local frac = math.max(0, math.min(1, charge/(self.shieldCapacity or 10000))) + + local col1 = MergeShieldColor(self.colormap1, frac) + local col2 = self.colormap2 and MergeShieldColor(self.colormap2, frac) + + if self.hitResposeMult ~= 0 then + local hitTime = Spring.GetUnitRulesParam(unitID, "shieldHitFrame") + local frame = Spring.GetGameFrame() + if hitTime and (hitTime + HIT_DURATION > frame) then + col1[4] = col1[4]*hitOpacityMult[frame - hitTime + 1]*(self.hitResposeMult or 1) + if col2 then + col2[4] = col2[4]*hitOpacityMult[frame - hitTime + 1]*(self.hitResposeMult or 1) + end + end + end + + return col1, col2 + end +end + local type = type local pairs = pairs function CopyTable(outtable,intable) diff --git a/lups/headers/nanoupdate.lua b/lups/headers/nanoupdate.lua index 142d63612..161968ecf 100644 --- a/lups/headers/nanoupdate.lua +++ b/lups/headers/nanoupdate.lua @@ -13,6 +13,16 @@ --------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------- +local function GetUnitMidPos(unitID) + local _,_,_, x, y, z = Spring.GetUnitPosition(unitID, true) + return x, y, z +end + +local function GetFeatureMidPos(featureID) + local _,_,_, x, y, z = Spring.GetFeaturePosition(featureID, true) + return x, y, z +end + local function GetCmdTag(unitID) local cmdTag = 0 local cmds = Spring.GetFactoryCommands(unitID,1) @@ -36,13 +46,11 @@ end function UpdateNanoParticles(self) - --// UPDATE START- & FINALPOS - local lastup = self._lastupdate - if (not lastup)or(thisGameFrame-lastup > 1) then + local lastup = self._lastupdate or (thisGameFrame - 1) + if (not self._dead)and(thisGameFrame - lastup >= 1) then self._lastupdate = thisGameFrame - --// UPDATE STARTPOS local uid = self.unitID if Spring.ValidUnitID(uid) then @@ -60,7 +68,7 @@ function UpdateNanoParticles(self) if (tid >= 0) then if (not self.isFeature) then if Spring.ValidUnitID(tid) then - self.targetpos = {Spring.GetUnitPosition(tid)} + self.targetpos = {GetUnitMidPos(tid)} else if (not self._dead) then --// assigned target unit died @@ -70,7 +78,7 @@ function UpdateNanoParticles(self) end else if Spring.ValidFeatureID(tid) then - self.targetpos = {Spring.GetFeaturePosition(tid)} + self.targetpos = {GetFeatureMidPos(tid)} self.targetpos[2] = self.targetpos[2] + 25 else if (not self._dead) then @@ -81,24 +89,22 @@ function UpdateNanoParticles(self) end end end - - local cmdTag = GetCmdTag(self.unitID) if (cmdTag == 0 or cmdTag ~= self.cmdTag) then self._dead = true return end - end --// UPDATE LOS local allied = (self.allyID==LocalAllyTeamID)or(LocalAllyTeamID==Script.ALL_ACCESS_TEAM) - local lastup_los = self._lastupdate_los - if (not lastup_los)or - ((thisGameFrame-lastup_los > 16)and(not allied)) + local lastup_los = self._lastupdate_los or (thisGameFrame - 16) + if + (not self._lastupdate_los) or + ((thisGameFrame - lastup_los > 16)and(not allied)) then self._lastupdate_los = thisGameFrame diff --git a/lups/lups.lua b/lups/lups.lua index 459fbccc4..cfd5cc3c8 100644 --- a/lups/lups.lua +++ b/lups/lups.lua @@ -19,7 +19,7 @@ local function GetInfo() name = "Lups", desc = "Lua Particle System", author = "jK", - date = "Jan. 2008", + date = "2008-2014", license = "GNU GPL, v2 or later", layer = 1000, api = true, @@ -29,7 +29,7 @@ end --// FIXME --- 1. at los handling (inRadar,alwaysVisible, etc.) +-- 1. add los handling (inRadar,alwaysVisible, etc.) -------------------------------------------------------------------------------- @@ -76,6 +76,7 @@ local spGetUnitViewPosition = Spring.GetUnitViewPosition local spGetUnitDirection = Spring.GetUnitDirection local spGetHeadingFromVector = Spring.GetHeadingFromVector local spGetUnitIsActive = Spring.GetUnitIsActive +local spGetUnitRulesParam = Spring.GetUnitRulesParam local spGetGameFrame = Spring.GetGameFrame local spGetFrameTimeOffset = Spring.GetFrameTimeOffset local spGetUnitPieceList = Spring.GetUnitPieceList @@ -84,6 +85,8 @@ local spGetLocalAllyTeamID = Spring.GetLocalAllyTeamID local scGetReadAllyTeam = Script.GetReadAllyTeam local spGetUnitPieceMap = Spring.GetUnitPieceMap local spValidUnitID = Spring.ValidUnitID +local spGetUnitIsStunned = Spring.GetUnitIsStunned +local spGetProjectilePosition = Spring.GetProjectilePosition local glUnitPieceMatrix = gl.UnitPieceMatrix local glPushMatrix = gl.PushMatrix @@ -114,53 +117,16 @@ local GL_VERSION = 0x1F02 local glVendor = gl.GetString(GL_VENDOR) local glRenderer = (gl.GetString(GL_RENDERER)):lower() -local function DetectCard(vendor,renderer) - isNvidia = (vendor:find("NVIDIA")) - isATI = (vendor:find("ATI ")) - isMS = (vendor:find("Microsoft")) - isIntel = (vendor:find("Intel")) - - NVseries = ((isNvidia)and( - (renderer:find(" gf[xs]* 4%d%d") and 11) or --// Fermi - (renderer:find(" g[txs]* %d%d%d") and 10) or - (renderer:find(" 9") and 9) or - (renderer:find(" 8") and 8) or - (renderer:find(" 7") and 7) or - (renderer:find(" 6") and 6) or - (renderer:find(" 5") and 5) or - (renderer:find(" 4") and 4) or - (renderer:find(" 3") and 3) or - (renderer:find(" 2") and 2) or math.huge - )) or 0 - - renderer = renderer:lower() - ATIseries = ((isATI)and( - (renderer:find("radeon hd") and 3)or - (renderer:find("radeon x") and 2) or - (renderer:find("radeon 9") and 1) or 0 - )) or 0 - - canCTT = (gl.CopyToTexture ~= nil) - - --// old cards are capable to use CTT, but their performance is too bad - canCTT = (canCTT) and ((not isNvidia)or(NVseries>=6)) - canCTT = (canCTT) and ((not isATI) or(ATIseries>=2)) -end - -isNvidia = false -isATI = false -isMS = false -isIntel = false -NVseries = false -ATIseries = false -canCTT = false +isNvidia = (glVendor:find("NVIDIA")) +isATI = (glVendor:find("ATI ")) +isMS = (glVendor:find("Microsoft")) +isIntel = (glVendor:find("Intel")) +canCTT = (gl.CopyToTexture ~= nil) canFBO = (gl.DeleteTextureFBO ~= nil) canRTT = (gl.RenderToTexture ~= nil) canShader = (gl.CreateShader ~= nil) canDistortions = false --// check Initialize() -DetectCard(glVendor,glRenderer) - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -211,8 +177,7 @@ end -------------------------------------------------------------------------------- --// some global vars (so the effects can use them) -vsx, vsy = 0,0 -vpx, vpy = 0,0 --// view pos (only unequal zero, if dualscreen+minimapOnTheLeft) +vsx, vsy, vpx, vpy = Spring.GetViewGeometry() --// screen pos & view pos (view pos only unequal zero if dualscreen+minimapOnTheLeft) LocalAllyTeamID = 0 thisGameFrame = 0 frameOffset = 0 @@ -223,7 +188,7 @@ function SetUnitLuaDraw(unitID,nodraw) if (nodraw) then noDrawUnits[unitID] = (noDrawUnits[unitID] or 0) + 1 if (noDrawUnits[unitID]==1) then - --if (Game.version=="0.76b1") then + --if (Spring.Utilities.GetEngineVersion()=="0.76b1") then Spring.UnitRendering.ActivateMaterial(unitID,1) --Spring.UnitRendering.SetLODLength(unitID,1,-1000) for pieceID in ipairs(Spring.GetUnitPieceList(unitID) or {}) do @@ -236,7 +201,7 @@ function SetUnitLuaDraw(unitID,nodraw) else noDrawUnits[unitID] = (noDrawUnits[unitID] or 0) - 1 if (noDrawUnits[unitID]==0) then - --if (Game.version=="0.76b1") then + --if (Spring.Utilities.GetEngineVersion()=="0.76b1") then Spring.UnitRendering.DeactivateMaterial(unitID,1) --else -- Spring.UnitRendering.SetUnitLuaDraw(unitID,false) @@ -294,7 +259,7 @@ end --// saves all particles particles = {} -local particles = particles +local particles = particles local particlesCount = 0 local RenderSequence = {} --// mult-dim table with: [layer][partClass][unitID][fx] @@ -319,7 +284,7 @@ function AddParticles(Class,Options ,__id) print(PRIO_LESS,'LUPS->AddFX: no options given'); return -1; end - + if Options.quality and Options.quality > GetLupsSetting("quality", 3) then return -1; end @@ -346,7 +311,8 @@ function AddParticles(Class,Options ,__id) --// piecename to piecenum conversion (spring >=76b1 only!) if (Options.unit and Options.piece) then - Options.piecenum = spGetUnitPieceMap(Options.unit)[Options.piece] + local pieceMap = spGetUnitPieceMap(Options.unit) + Options.piecenum = pieceMap and pieceMap[Options.piece] --added check. switching spectator view can cause "attempt to index a nil value" if (not Options.piecenum) then local udid = Spring.GetUnitDefID(Options.unit) if (not udid) then @@ -403,6 +369,9 @@ function AddParticlesArray(array) end end +function GetParticles(particlesID) + return particles[particlesID] +end function RemoveParticles(particlesID) local fx = particles[particlesID] @@ -487,7 +456,6 @@ function GetErrorLog(minPriority) if (log~="") then local sysinfo = "Vendor:" .. glVendor .. "\nRenderer:" .. glRenderer .. - "\nNVseries:" .. NVseries .. (((isATI)and("\nisATI: true"))or("")) .. (((isMS)and("\nisMS: true"))or("")) .. (((isIntel)and("\nisIntel: true"))or("")) .. @@ -502,7 +470,6 @@ function GetErrorLog(minPriority) if (errorlog~="") then local sysinfo = "Vendor:" .. glVendor .. "\nRenderer:" .. glRenderer .. - "\nNVseries:" .. NVseries .. "\nisATI:" .. tostring(isATI) .. "\nisMS:" .. tostring(isMS) .. "\nisIntel:" .. tostring(isIntel) .. @@ -523,6 +490,31 @@ end local anyFXVisible = false local anyDistortionsVisible = false +local function IsUnitPositionKnown(unitID) + if LocalAllyTeamID < 0 then + return true + end + local targetVisiblityState = Spring.GetUnitLosState(unitID, LocalAllyTeamID, true) + local inLos = (targetVisiblityState == 15) + if inLos then + return true + end + local identified = (targetVisiblityState > 2) + + if not identified then + return false + end + local unitDefID = Spring.GetUnitDefID(unitID) + if not (unitDefID and UnitDefs[unitDefID]) then + return false + end + return not Spring.Utilities.getMovetype(UnitDefs[unitDefID]) +end + +local function RadarDotCheck(unitID) + return true +end + local function Draw(extension,layer) local FxLayer = RenderSequence[layer]; if (not FxLayer) then return end @@ -541,7 +533,7 @@ local function Draw(extension,layer) if (not next(Units)) then FxLayer[partClass]=nil else - for unitID,UnitEffects in pairs(Units) do + for unitID,UnitEffects in pairs(Units) do if (not UnitEffects[1]) then Units[unitID]=nil else @@ -552,7 +544,14 @@ local function Draw(extension,layer) -- render in unit/piece space ------------------------------------------------------ ------------------------------------------------------------------------------------ glPushMatrix() - glUnitMultMatrix(unitID) + if gadget and not IsUnitPositionKnown(unitID) then + local x, y, z = Spring.GetUnitPosition(unitID) + local a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44 = Spring.GetUnitTransformMatrix(unitID) + gl.MultMatrix(a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, x, y, z , a44) + else + glUnitMultMatrix(unitID) + end + --// render effects for i=1,#UnitEffects do @@ -583,11 +582,16 @@ local function Draw(extension,layer) for i=1,#UnitEffects do local fx = UnitEffects[i] if (fx.alwaysVisible or fx.visible) then + glPushMatrix() + if fx.projectile and not fx.worldspace then + local x,y,z = spGetProjectilePosition(fx.projectile) + glTranslate(x,y,z) + end drawfunc(fx) + glPopMatrix() end - end - - end + end -- for + end -- if end --if end --for end @@ -614,7 +618,7 @@ local function DrawParticlesOpaque() vsx, vsy, vpx, vpy = Spring.GetViewGeometry() if (vsx~=oldVsx)or(vsy~=oldVsy) then for _,partClass in pairs(fxClasses) do - if partClass.ViewResize then partClass.ViewResize(viewSizeX, viewSizeY) end + if partClass.ViewResize then partClass.ViewResize(vsx, vsy) end end oldVsx, oldVsy = vsx, vsy end @@ -679,6 +683,27 @@ local function DrawParticlesWater() end +-------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- +-- Unit activity +local activeUnit = {} +local activeUnitCheckTime = {} +local ACTIVE_CHECK_PERIOD = 10 + +local function GetUnitIsActive(unitID) + if activeUnitCheckTime[unitID] and activeUnitCheckTime[unitID] > thisGameFrame then + return activeUnit[unitID] + end + + activeUnitCheckTime[unitID] = thisGameFrame + ACTIVE_CHECK_PERIOD + activeUnit[unitID] = (spGetUnitIsActive(unitID) or spGetUnitRulesParam(unitID, "unitActiveOverride") == 1) + and (spGetUnitRulesParam(unitID, "disarmed") ~= 1) + and (spGetUnitRulesParam(unitID, "morphDisable") ~= 1) + and not spGetUnitIsStunned(unitID) + + return activeUnit[unitID] +end + -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- @@ -690,105 +715,130 @@ local DrawWorldShadowVisibleFx local DrawScreenEffectsVisibleFx local DrawInMiniMapVisibleFx -local function IsPosInLos(x,y,z) - local inLos = Spring.IsPosInLos(x,y,z, LocalAllyTeamID) - --local _,inLos = Spring.GetPositionLosState(x,y,z, LocalAllyTeamID) - return (inLos) +local function UpdateAllyTeamStatus() + local spec, specFullView = spGetSpectatingState() + if (specFullView) then + LocalAllyTeamID = scGetReadAllyTeam() or 0 + else + LocalAllyTeamID = spGetLocalAllyTeamID() or 0 + end end -local function CreateVisibleFxList() - local removeFX = {} - local removeCnt = 1 - - for layerID,layer in pairs(RenderSequence) do - for partClass,Units in pairs(layer) do - for unitID,UnitEffects in pairs(Units) do - if (unitID>-1) then - local x,y,z = spGetUnitViewPosition(unitID) - - local unitActive = -1 - - local unitRadius = 0 - local maxVisibleRadius = -1 - local minNotVisibleRadius = 1e9 - - --// check effects - for i=1,#UnitEffects do - local fx = UnitEffects[i] +function IsPosInLos(x,y,z) + if LocalAllyTeamID == 0 then + UpdateAllyTeamStatus() + end + return LocalAllyTeamID == Script.ALL_ACCESS_TEAM or (LocalAllyTeamID ~= Script.NO_ACCESS_TEAM and Spring.IsPosInLos(x,y,z, LocalAllyTeamID)) +end - if (fx.onActive and (unitActive == -1)) then - unitActive = spGetUnitIsActive(unitID) - if (unitActive == nil) then - unitActive = true - end - end +function IsPosInRadar(x,y,z) + if LocalAllyTeamID == 0 then + UpdateAllyTeamStatus() + end + return LocalAllyTeamID == Script.ALL_ACCESS_TEAM or (LocalAllyTeamID ~= Script.NO_ACCESS_TEAM and Spring.IsPosInRadar(x,y,z, LocalAllyTeamID)) +end - if (not fx.onActive)or(unitActive) then - if fx.alwaysVisible then - fx.visible = true - elseif (fx.Visible) then - fx.visible = fx:Visible() - else - unitRadius = unitRadius or (spGetUnitRadius(unitID) + 40) +function IsPosInAirLos(x,y,z) + if LocalAllyTeamID == 0 then + UpdateAllyTeamStatus() + end + return LocalAllyTeamID == Script.ALL_ACCESS_TEAM or (LocalAllyTeamID ~= Script.NO_ACCESS_TEAM and Spring.IsPosInAirLos(x,y,z, LocalAllyTeamID)) +end - local r = fx.radius or 0 - if (r > maxVisibleRadius)and(r < minNotVisibleRadius) then - if spIsSphereInView(x,y,z,unitRadius + r) then - maxVisibleRadius = r - else - minNotVisibleRadius = r - end - end +function GetUnitLosState(unitID) + if LocalAllyTeamID == 0 then + UpdateAllyTeamStatus() + end + return LocalAllyTeamID == Script.ALL_ACCESS_TEAM or (LocalAllyTeamID ~= Script.NO_ACCESS_TEAM and (Spring.GetUnitLosState(unitID, LocalAllyTeamID) or {}).los) or false +end - fx.visible = (r <= maxVisibleRadius) - end +local function IsUnitFXVisible(fx) + local unitActive = true + local unitID = fx.unit + if fx.onActive then + unitActive = GetUnitIsActive(unitID) + end + --Spring.Utilities.UnitEcho(unitID, "w") + if (not fx.onActive) or (unitActive) then + if fx.alwaysVisible then + return true + elseif (fx.Visible) then + return fx:Visible() + else + local unitRadius = (spGetUnitRadius(unitID) or 0) + 40 + local r = fx.radius or 0 + return Spring.IsUnitVisible(unitID, unitRadius + r, fx.noIconDraw) + end + else + return fx.alwaysVisible + end +end - if (fx.visible) then - if (not anyFXVisible) then anyFXVisible = true end - anyDistortionsVisible = anyDistortionsVisible or partClass.pi.distortion - end - else - fx.visible = fx.alwaysVisible - if (not anyFXVisible) then anyFXVisible = fx.alwaysVisible end - end - end +local function IsProjectileFXVisible(fx) + if fx.alwaysVisible then + return true + elseif fx.Visible then + return fx:Visible() + else + local proID = fx.projectile + local x,y,z = Spring.GetProjectilePosition(proID) + if (IsPosInLos(x,y,z)and (spIsSphereInView(x,y,z,(fx.radius or 200)+100)) ) then + return true + end + end +end - else +local function IsWorldFXVisible(fx) + if fx.alwaysVisible then + return true + elseif (fx.Visible) then + return fx:Visible() + elseif (fx.pos) then + local pos = fx.pos + if (IsPosInLos(pos[1],pos[2],pos[3]))and + (spIsSphereInView(pos[1],pos[2],pos[3],(fx.radius or 200)+100)) + then + return true + end + end +end - for i=1,#UnitEffects do - local fx = UnitEffects[i] - fx.visible = fx.alwaysVisible - if fx.alwaysVisible then +local function CreateVisibleFxList() + local removeFX = {} + local removeCnt = 1 + + local foo = 0 + for _,fx in pairs(particles) do + foo = foo + 1 + if ((fx.unit or -1) > -1) then + fx.visible = IsUnitFXVisible(fx) + if (fx.visible) then if (not anyFXVisible) then anyFXVisible = true end - anyDistortionsVisible = anyDistortionsVisible or partClass.pi.distortion - elseif (fx.Visible) then - if (fx:Visible()) then - fx.visible = true - if (not anyFXVisible) then anyFXVisible = true end - anyDistortionsVisible = anyDistortionsVisible or partClass.pi.distortion - end - elseif (fx.pos) then - local pos = fx.pos - if (IsPosInLos(pos[1],pos[2],pos[3]))and - (spIsSphereInView(pos[1],pos[2],pos[3],(fx.radius or 200)+100)) - then - fx.visible = true - if (not anyFXVisible) then anyFXVisible = true end - anyDistortionsVisible = anyDistortionsVisible or partClass.pi.distortion - end - end - - if (not fx.visible)and(fx.Valid and (not fx:Valid())) then - removeFX[removeCnt] = fx.id - removeCnt = removeCnt + 1 - end - end - - end --if - end --for - end --for - end --for + if (not anyDistortionsVisible) then anyDistortionsVisible = fx.pi.distortion end + end + elseif ((fx.projectile or -1) > -1) then + fx.visible = IsProjectileFXVisible(fx) + if (fx.visible) then + if (not anyFXVisible) then anyFXVisible = true end + if (not anyDistortionsVisible) then anyDistortionsVisible = fx.pi.distortion end + end + else + fx.visible = IsWorldFXVisible(fx) + if (fx.visible) then + if (not anyFXVisible) then anyFXVisible = true end + if (not anyDistortionsVisible) then anyDistortionsVisible = fx.pi.distortion end + elseif (fx.Valid and (not fx:Valid())) then + removeFX[removeCnt] = fx.id + removeCnt = removeCnt + 1 + end + end + end + --Spring.Echo("Lups fx cnt", foo) + + for i=1,removeCnt-1 do + RemoveParticles(removeFX[i]) + end end -------------------------------------------------------------------------------- @@ -841,14 +891,7 @@ local function GameFrame(_,n) if ((not next(particles)) and (not effectsInDelay[1])) then return end - --// update team/player status - local spec, specFullView = spGetSpectatingState() - if (specFullView) then - LocalAllyTeamID = scGetReadAllyTeam() - else - LocalAllyTeamID = spGetLocalAllyTeamID() - end - + UpdateAllyTeamStatus() --// create delayed FXs if (effectsInDelay[1]) then local remaingFXs,cnt={},1 @@ -932,21 +975,21 @@ end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- +local function CheckParticleClassReq(pi) + return + (canShader or (not pi.shader))and + (canFBO or (not pi.fbo))and + (canRTT or (not pi.rtt))and + (canCTT or (not pi.ctt))and + (canDistortions or (not pi.distortion))and + ((not isIntel) or (pi.intel~=0))and + ((not isMS) or (pi.ms~=0)) +end + + local function Initialize() LupsConfig = LoadConfig("./lups.cfg") - --// overwrite detected hardware with lups.cfg - local forcevendor = GetLupsSetting("vendor",nil) - local forcerenderer = GetLupsSetting("renderer",nil) - if (forcevendor or forcerenderer) then - glVendor,glRenderer = forcevendor or glVendor,forcerenderer or glRenderer - DetectCard(glVendor,glRenderer:lower()) - end - --canFBO = GetLupsSetting("fbo",canFBO) - --canRTT = GetLupsSetting("rtt",canRTT) - --canCTT = GetLupsSetting("ctt",canCTT) - --canShader = GetLupsSetting("shader",canShader) - --// set verbose level local showWarnings = LupsConfig.showwarnings if showWarnings then @@ -964,19 +1007,7 @@ local function Initialize() if DistortionClass then fxClasses["postdistortion"]=nil --// remove it from default classes local di = DistortionClass.pi - if (di)and - - (canShader or (not di.shader))and - (canFBO or (not di.fbo))and - (canRTT or (not di.rtt))and - (canCTT or (not di.ctt))and - - ( (isNvidia and (NVseries >= (di.nvseries or 0))) or true)and - ( (isATI and (ATIseries >= (di.atiseries or 0))) or true)and - - ((not isIntel) or (di.intel~=0))and - ((not isMS) or (di.ms~=0)) - then + if (di) and CheckParticleClassReq(di) then local fine = true if (DistortionClass.Initialize) then fine = DistortionClass.Initialize() end if (fine~=nil)and(fine==false) then @@ -1002,20 +1033,7 @@ local function Initialize() --// initialize particle classes for fxName,fxClass in pairs(fxClasses) do local fi = fxClass.pi --// .fi = fxClass.GetInfo() - if (fi)and - (not disableFX[fxName])and - - (canShader or (not fi.shader))and - (canFBO or (not fi.fbo))and - (canRTT or (not fi.rtt))and - (canCTT or (not fi.ctt))and - (canDistortions or (not fi.distortion))and - - ( (isNvidia and (NVseries >= (fi.nvseries or 0))) or true)and - ( (isATI and (ATIseries >= (fi.atiseries or 0))) or true)and - ((not isIntel) or (fi.intel~=0))and - ((not isMS) or (fi.ms~=0)) - then + if (not disableFX[fxName]) and (fi) and CheckParticleClassReq(fi) then local fine = true if (fxClass.Initialize) then fine = fxClass.Initialize() end if (fine~=nil)and(fine==false) then @@ -1051,6 +1069,7 @@ local function Initialize() GG.Lups.GetStats = GetStats GG.Lups.GetErrorLog = GetErrorLog GG.Lups.AddParticles = AddParticles + GG.Lups.GetParticles = GetParticles GG.Lups.RemoveParticles = RemoveParticles GG.Lups.AddParticlesArray = AddParticlesArray GG.Lups.HasParticleClass = HasParticleClass diff --git a/lups/particleclasses/ringparticles.lua b/lups/particleclasses/RingParticles.lua similarity index 100% rename from lups/particleclasses/ringparticles.lua rename to lups/particleclasses/RingParticles.lua diff --git a/lups/particleclasses/ShieldSphereColor.lua b/lups/particleclasses/ShieldSphereColor.lua new file mode 100644 index 000000000..4e4e0062c --- /dev/null +++ b/lups/particleclasses/ShieldSphereColor.lua @@ -0,0 +1,189 @@ +-- $Id: ShieldSphereColor.lua 3171 2008-11-06 09:06:29Z det $ +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +local ShieldSphereColorParticle = {} +ShieldSphereColorParticle.__index = ShieldSphereColorParticle + +local sphereList = {} +local shieldShader + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorParticle.GetInfo() + return { + name = "ShieldSphereColor", + backup = "ShieldSphereColorFallback", --// backup class, if this class doesn't work (old cards,ati's,etc.) + desc = "", + + layer = -23, --// extreme simply z-ordering :x + + --// gfx requirement + fbo = false, + shader = true, + rtt = false, + ctt = false, + } +end + +ShieldSphereColorParticle.Default = { + pos = {0,0,0}, -- start pos + layer = -23, + + life = math.huge, + + size = 10, + margin = 1, + + colormap1 = { {0, 0, 0, 0} }, + colormap2 = { {0, 0, 0, 0} }, + + repeatEffect = false, + shieldSize = "large", +} + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +local glMultiTexCoord = gl.MultiTexCoord +local glCallList = gl.CallList + +function ShieldSphereColorParticle:Visible() + return self.visibleToMyAllyTeam +end + +function ShieldSphereColorParticle:BeginDraw() + gl.DepthMask(false) + gl.UseShader(shieldShader) + gl.Culling(GL.FRONT) +end + +function ShieldSphereColorParticle:EndDraw() + gl.DepthMask(false) + gl.UseShader(0) + + gl.Culling(GL.BACK) + gl.Culling(false) + + glMultiTexCoord(1, 1,1,1,1) + glMultiTexCoord(2, 1,1,1,1) + glMultiTexCoord(3, 1,1,1,1) + glMultiTexCoord(4, 1,1,1,1) +end + +function ShieldSphereColorParticle:Draw() + local col1, col2 = GetShieldColor(self.unit, self) + glMultiTexCoord(1, col1[1],col1[2],col1[3],col1[4] or 1) + glMultiTexCoord(2, col2[1],col2[2],col2[3],col2[4] or 1) + local pos = self.pos + glMultiTexCoord(3, pos[1], pos[2], pos[3], 0) + glMultiTexCoord(4, self.margin, self.size, 1, 1) + + glCallList(sphereList[self.shieldSize]) + if self.drawBack then + gl.Scale(1,1,-1) + if pos[3] ~= 0 then + glMultiTexCoord(3, pos[1], pos[2], -pos[3], 0) + end + glMultiTexCoord(1, col1[1],col1[2],col1[3],(col1[4] or 1)*self.drawBack) + glMultiTexCoord(2, col2[1],col2[2],col2[3],(col2[4] or 1)*self.drawBack) + if self.drawBackMargin then + glMultiTexCoord(4, self.drawBackMargin, self.size, 1, 1) + end + glCallList(sphereList[self.shieldSize]) + end +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorParticle:Initialize() + shieldShader = gl.CreateShader({ + vertex = [[ + #define pos gl_MultiTexCoord3 + #define margin gl_MultiTexCoord4.x + #define size vec4(gl_MultiTexCoord4.yyy,1.0) + + varying float opac; + varying vec4 color1; + varying vec4 color2; + + void main() + { + gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex * size + pos); + vec3 normal = gl_NormalMatrix * gl_Normal; + vec3 vertex = vec3(gl_ModelViewMatrix * gl_Vertex); + float angle = dot(normal,vertex)*inversesqrt( dot(normal,normal)*dot(vertex,vertex) ); //dot(norm(n),norm(v)) + opac = pow( abs( angle ) , margin); + + color1 = gl_MultiTexCoord1; + color2 = gl_MultiTexCoord2; + } + ]], + fragment = [[ + varying float opac; + varying vec4 color1; + varying vec4 color2; + + void main(void) + { + gl_FragColor = mix(color1,color2,opac); + } + + ]], + uniform = { + margin = 1, + } + }) + + if (shieldShader == nil) then + print(PRIO_MAJOR,"LUPS->Shield: critical shader error: "..gl.GetShaderLog()) + return false + end + + sphereList = { + large = gl.CreateList(DrawSphere,0,0,0,1, 38,false), + small = gl.CreateList(DrawSphere,0,0,0,1, 24,false), + } +end + +function ShieldSphereColorParticle:Finalize() + gl.DeleteShader(shieldShader) + for _, list in pairs(sphereList) do + gl.DeleteList(list) + end +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorParticle:CreateParticle() + self.dieGameFrame = Spring.GetGameFrame() + self.life +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorParticle:Update() +end + +-- used if repeatEffect=true; +function ShieldSphereColorParticle:ReInitialize() + self.dieGameFrame = self.dieGameFrame + self.life +end + +function ShieldSphereColorParticle.Create(Options) + local newObject = MergeTable(Options, ShieldSphereColorParticle.Default) + setmetatable(newObject,ShieldSphereColorParticle) -- make handle lookup + newObject:CreateParticle() + return newObject +end + +function ShieldSphereColorParticle:Destroy() +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +return ShieldSphereColorParticle \ No newline at end of file diff --git a/lups/particleclasses/ShieldSphereColorFallback.lua b/lups/particleclasses/ShieldSphereColorFallback.lua new file mode 100644 index 000000000..c31d1d2dc --- /dev/null +++ b/lups/particleclasses/ShieldSphereColorFallback.lua @@ -0,0 +1,131 @@ +-- $Id: gimmick1.lua 3171 2008-11-06 09:06:29Z det $ +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +local ShieldSphereColorFallback = {} +ShieldSphereColorFallback.__index = ShieldSphereColorFallback + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorFallback.GetInfo() + return { + name = "ShieldSphereColorFallback", + backup = "", --// backup class, if this class doesn't work (old cards,ati's,etc.) + desc = "", + + layer = -24, --// extreme simply z-ordering :x + + --// gfx requirement + fbo = false, + shader = false, + rtt = false, + ctt = false, + } +end + +ShieldSphereColorFallback.Default = { + pos = {0,0,0}, + layer = -24, + life = math.huge, + repeatEffect = true, + shieldSize = "large", +} + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorFallback:Visible() + return self.visibleToMyAllyTeam +end + +function ShieldSphereColorFallback:BeginDraw() + gl.DepthMask(false) + gl.Lighting(true) + gl.Light(0, true ) + gl.Light(0, GL.POSITION, gl.GetSun() ) + gl.Light(0, GL.AMBIENT, gl.GetSun("ambient","unit") ) + gl.Light(0, GL.DIFFUSE, gl.GetSun("diffuse","unit") ) + gl.Light(0, GL.SPECULAR, gl.GetSun("specular") ) + --gl.Culling(GL.BACK) +end + +function ShieldSphereColorFallback:EndDraw() + gl.DepthMask(false) + gl.Lighting(false) + gl.Light(0, false) +end + +function ShieldSphereColorFallback:Draw() + local pos = self.pos + gl.Translate(pos[1],pos[2],pos[3]) + + local col = GetShieldColor(self.unit, self) + col[4] = col[4]*0.26 + + gl.Color(1, 1, 1, 1) + gl.Material({ + ambient = {col[1], col[2], col[3], col[4]}, + diffuse = {1,1,1,col[4]}, + specular = {1,1,1,col[4]}, + shininess = 120, + }) + + gl.Scale(self.size, self.size, self.size) + if self.texture then + gl.Texture(self.texture) + end + gl.CallList(self.SphereList[self.shieldSize]) + if self.texture then + gl.Texture(false) + end +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorFallback:Initialize() + ShieldSphereColorFallback.SphereList = { + large = gl.CreateList(DrawSphere,0,0,0,1, 32), + small = gl.CreateList(DrawSphere,0,0,0,1, 20), + } +end + +function ShieldSphereColorFallback:Finalize() + for _, list in pairs(ShieldSphereColorFallback.SphereList) do + gl.DeleteList(list) + end +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorFallback:CreateParticle() + self.dieGameFrame = Spring.GetGameFrame() + self.life +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function ShieldSphereColorFallback:Update() +end + +-- used if repeatEffect=true; +function ShieldSphereColorFallback:ReInitialize() + self.dieGameFrame = self.dieGameFrame + self.life +end + +function ShieldSphereColorFallback.Create(Options) + local newObject = MergeTable(Options, ShieldSphereColorFallback.Default) + setmetatable(newObject,ShieldSphereColorFallback) -- make handle lookup + newObject:CreateParticle() + return newObject +end + +function ShieldSphereColorFallback:Destroy() +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +return ShieldSphereColorFallback \ No newline at end of file diff --git a/lups/particleclasses/UnitPieceLight.lua b/lups/particleclasses/UnitPieceLight.lua new file mode 100644 index 000000000..9abe786c7 --- /dev/null +++ b/lups/particleclasses/UnitPieceLight.lua @@ -0,0 +1,359 @@ +-- $Id: UnitPieceLight.lua 3171 2008-11-06 09:06:29Z det $ +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +local UnitPieceLight = {} +UnitPieceLight.__index = UnitPieceLight + +local depthtex, offscreentex, blurtex +local offscreen4, offscreen8 +local blur4, blur8 + +local depthShader +local blurShader +local uniformScreenXY, uniformPixelSize, uniformDirection + +local GL_DEPTH_BITS = 0x0D56 + +local GL_DEPTH_COMPONENT = 0x1902 +local GL_DEPTH_COMPONENT16 = 0x81A5 +local GL_DEPTH_COMPONENT24 = 0x81A6 +local GL_DEPTH_COMPONENT32 = 0x81A7 + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function UnitPieceLight.GetInfo() + return { + name = "UnitPieceLight", + backup = "", --// backup class, if this class doesn't work (old cards,ati's,etc.) + desc = "", + + layer = 32, --// extreme simply z-ordering :x + + --// gfx requirement + fbo = true, + shader = true, + rtt = true, + ctt = true, + ms = 0, + } +end + + +UnitPieceLight.Default = { + layer = 32, + life = math.huge, + worldspace = true, + + piecenum = 0, + + colormap = { {1,1,1,0} }, + repeatEffect = true, + + --// internal + color = {1,1,1,0}, +} + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function UnitPieceLight:BeginDraw() + gl.CopyToTexture(depthtex, 0, 0, 0, 0, vsx, vsy) + gl.Texture(depthtex) + gl.UseShader(depthShader) + gl.Uniform(uniformScreenXY, math.ceil(vsx*0.5),math.ceil(vsy*0.5) ) + gl.RenderToTexture(offscreentex, gl.Clear, GL.COLOR_BUFFER_BIT ,0,0,0,0) +end + +function UnitPieceLight:EndDraw() + gl.Color(1,1,1,1) + gl.UseShader(0) + gl.RenderToTexture(offscreen4, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Texture(offscreentex) + gl.TexRect(-1,1,1,-1) + end) + + gl.Texture(offscreentex) + gl.UseShader(blurShader) + gl.RenderToTexture(blurtex, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Uniform(uniformDirection, 1,0 ) + gl.Uniform(uniformPixelSize, 1.0/math.ceil(vsx*0.5) ) + gl.TexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) + end) + gl.Texture(blurtex) + gl.RenderToTexture(offscreentex, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Uniform(uniformDirection, 0,1 ) + gl.Uniform(uniformPixelSize, math.ceil(vsy*0.5) ) + gl.TexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) + end) + + gl.Texture(offscreen4) + gl.RenderToTexture(blur4, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Uniform(uniformDirection, 1,0 ) + gl.Uniform(uniformPixelSize, 1.0/math.ceil(vsx*0.25) ) + gl.TexRect(-1-0.125/vsx,1+0.125/vsy,1+0.125/vsx,-1-0.125/vsy) + end) + gl.Texture(blur4) + gl.RenderToTexture(offscreen4, function() + gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) + gl.Uniform(uniformDirection, 0,1 ) + gl.Uniform(uniformPixelSize, 1.0/math.ceil(vsy*0.25) ) + gl.TexRect(-1-0.125/vsx,1+0.125/vsy,1+0.125/vsx,-1-0.125/vsy) + end) + + gl.UseShader(0) + gl.Blending(GL.ONE,GL.ONE) + + gl.MatrixMode(GL.PROJECTION); gl.PushMatrix(); gl.LoadIdentity() + gl.MatrixMode(GL.MODELVIEW); gl.PushMatrix(); gl.LoadIdentity() + + gl.Texture(offscreentex) + gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + gl.Texture(offscreen4) + gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) + + gl.MatrixMode(GL.PROJECTION); gl.PopMatrix() + gl.MatrixMode(GL.MODELVIEW); gl.PopMatrix() + + gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) + gl.Texture(false) + gl.UseShader(0) +end + +function UnitPieceLight:Draw() + gl.Color(self.color) + gl.RenderToTexture(offscreentex, function() + gl.PushMatrix() + gl.ResetMatrices() + gl.UnitMultMatrix(self.unit) + gl.UnitPieceMultMatrix(self.unit,self.piecenum) + gl.UnitPiece(self.unit,self.piecenum) + gl.PopMatrix() + end) +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function UnitPieceLight:Update() + self.life = self.life + self.life_incr + self.color = {GetColor(self.colormap,self.life)} +end + +-- used if repeatEffect=true; +function UnitPieceLight:ReInitialize() + self.life = 0 + self.dieGameFrame = self.dieGameFrame + self.clife +end + +function UnitPieceLight.Initialize() + depthShader = gl.CreateShader({ + fragment = [[ + uniform sampler2D tex0; + uniform vec2 screenXY; + + void main(void) + { + vec2 texCoord = vec2( gl_FragCoord.x/screenXY.x , gl_FragCoord.y/screenXY.y ); + float depth = texture2D(tex0, texCoord ).z; + + if (depth <= gl_FragCoord.z-0.0005) { + discard; + } + gl_FragColor = gl_Color; + } + ]], + uniformInt = { + tex0 = 0, + }, + uniform = { + screenXY = {math.ceil(vsx*0.5),math.ceil(vsy*0.5)}, + }, + }) + + if (depthShader == nil) then + print(PRIO_MAJOR,"LUPS->UnitPieceLights: Critical Shader Error: DepthShader: "..gl.GetShaderLog()) + return false + end + + blurShader = gl.CreateShader({ + fragment = [[ + float kernel[7]; + uniform sampler2D tex0; + uniform float pixelsize; + uniform vec2 dir; + + void InitKernel(void) { + kernel[0] = 0.013; + kernel[1] = 0.054; + kernel[2] = 0.069; + kernel[3] = 0.129; + kernel[4] = 0.212; + kernel[5] = 0.301; + kernel[6] = 0.372; + } + + void main(void) { + InitKernel(); + vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); + gl_FragColor = vec4(0.0); + + int n,i; + + i=1; + for(n=6; n >= 0; --n){ + gl_FragColor += kernel[n] * texture2D(tex0, texCoord.st + dir * float(i)*pixelsize ); + ++i; + } + + gl_FragColor += 0.4 * texture2D(tex0, texCoord ); + + i = -7; + for(n=0; n <= 6; ++n){ + gl_FragColor += kernel[n] * texture2D(tex0, texCoord.st + dir * float(i)*pixelsize ); + ++i; + } + } + ]], + uniformInt = { + tex0 = 0, + uniform = { + pixelsize = 1.0/math.ceil(vsx*0.5), + } + }, + }) + + + if (blurShader == nil) then + print(PRIO_MAJOR,"LUPS->UnitPieceLights: Critical Shader Error: BlurShader: "..gl.GetShaderLog()) + return false + end + + uniformScreenXY = gl.GetUniformLocation(depthShader, 'screenXY') + uniformPixelSize = gl.GetUniformLocation(blurShader, 'pixelsize') + uniformDirection = gl.GetUniformLocation(blurShader, 'dir') + + UnitPieceLight.ViewResize(vsx, vsy) +end + +function UnitPieceLight.Finalize() + gl.DeleteTexture(depthtex) + if (gl.DeleteTextureFBO) then + gl.DeleteTextureFBO(offscreentex) + gl.DeleteTextureFBO(blurtex) + end + + if (gl.DeleteShader) then + gl.DeleteShader(depthShader or 0) + gl.DeleteShader(blurShader or 0) + end +end + +function UnitPieceLight.ViewResize(vsx, vsy) + gl.DeleteTexture(depthtex or 0) + gl.DeleteTextureFBO(offscreentex or 0) + gl.DeleteTextureFBO(blurtex or 0) + + gl.DeleteTextureFBO(offscreen4 or 0) + gl.DeleteTextureFBO(blur4 or 0) + + depthtex = gl.CreateTexture(vsx,vsy, { + border = false, + format = GL_DEPTH_COMPONENT24, + min_filter = GL.NEAREST, + mag_filter = GL.NEAREST, + }) + + offscreentex = gl.CreateTexture(math.ceil(vsx*0.5),math.ceil(vsy*0.5), { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_BORDER, + wrap_t = GL.CLAMP_TO_BORDER, + fbo = true, + }) + + offscreen4 = gl.CreateTexture(math.ceil(vsx*0.25),math.ceil(vsy*0.25), { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_BORDER, + wrap_t = GL.CLAMP_TO_BORDER, + fbo = true, + }) + + blurtex = gl.CreateTexture(math.ceil(vsx*0.5),math.ceil(vsy*0.5), { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_BORDER, + wrap_t = GL.CLAMP_TO_BORDER, + fbo = true, + }) + + blur4 = gl.CreateTexture(math.ceil(vsx*0.25),math.ceil(vsy*0.25), { + border = false, + min_filter = GL.LINEAR, + mag_filter = GL.LINEAR, + wrap_s = GL.CLAMP_TO_BORDER, + wrap_t = GL.CLAMP_TO_BORDER, + fbo = true, + }) +end + + +function UnitPieceLight:Visible() + local ux,uy,uz = Spring.GetUnitViewPosition(self.unit) + if not ux then + return false + end + + local pos = {0,0,0} + pos[1],pos[2],pos[3] = pos[1]+ux,pos[2]+uy,pos[3]+uz + local radius = 300 + Spring.GetUnitRadius(self.unit) + local losState = Spring.GetUnitLosState(self.unit, LocalAllyTeamID) + + return (losState and losState.los)and(Spring.IsSphereInView(pos[1],pos[2],pos[3],radius)) +end + +function UnitPieceLight:Valid() + local ux = Spring.GetUnitViewPosition(self.unit) + if (ux) then + return true + else + return false + end +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function UnitPieceLight:CreateParticle() + self.clife = self.life + self.life_incr = 1/self.life + self.life = 0 + self.dieGameFrame = Spring.GetGameFrame() + self.clife +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +function UnitPieceLight.Create(Options) + local newObject = MergeTable(Options, UnitPieceLight.Default) + setmetatable(newObject,UnitPieceLight) -- make handle lookup + newObject:CreateParticle() + return newObject +end + +function UnitPieceLight:Destroy() +end + +----------------------------------------------------------------------------------------------------------------- +----------------------------------------------------------------------------------------------------------------- + +return UnitPieceLight \ No newline at end of file diff --git a/lups/particleclasses/airjet.lua b/lups/particleclasses/airjet.lua index 09f612610..29ead82e0 100644 --- a/lups/particleclasses/airjet.lua +++ b/lups/particleclasses/airjet.lua @@ -26,7 +26,6 @@ function AirJet.GetInfo() fbo = true, shader = true, distortion= true, - atiseries = 2, ms = -1, intel = -1, } @@ -34,6 +33,11 @@ end AirJet.Default = { + --// visibility check + los = true, + airLos = true, + radar = false, + layer = 4, life = math.huge, repeatEffect = true, @@ -55,6 +59,15 @@ AirJet.Default = { ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- +local spGetUnitViewPosition = Spring.GetUnitViewPosition +local spGetPositionLosState = Spring.GetPositionLosState +local spGetUnitLosState = Spring.GetUnitLosState +local spIsSphereInView = Spring.IsSphereInView +local spGetUnitRadius = Spring.GetUnitRadius + +local IsPosInLos = Spring.IsPosInLos +local IsPosInAirLos = Spring.IsPosInAirLos +local IsPosInRadar = Spring.IsPosInRadar local spGetGameSeconds = Spring.GetGameSeconds local glUseShader = gl.UseShader @@ -340,6 +353,31 @@ function AirJet:Destroy() glDeleteList(self.dList) end +function AirJet:Visible() + local radius = self.length + local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] + local losState + if (self.unit and not self.worldspace) then + losState = GetUnitLosState(self.unit) + local ux,uy,uz = spGetUnitViewPosition(self.unit) + if ux then + posX,posY,posZ = posX+ux,posY+uy,posZ+uz + radius = radius + (spGetUnitRadius(self.unit) or 30) + end + end + if (losState==nil) then + if (self.radar) then + losState = IsPosInRadar(posX,posY,posZ) + end + if ((not losState) and self.airLos) then + losState = IsPosInAirLos(posX,posY,posZ) + end + if ((not losState) and self.los) then + losState = IsPosInLos(posX,posY,posZ) + end + end + return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) +end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- diff --git a/lups/particleclasses/distortionfbo.lua b/lups/particleclasses/distortionfbo.lua index 8d2f85d4f..036792256 100644 --- a/lups/particleclasses/distortionfbo.lua +++ b/lups/particleclasses/distortionfbo.lua @@ -55,8 +55,7 @@ local FLOAT_TEXTURES = gl.HasExtension("GL_ARB_texture_float") PostDistortion.texRectangle = false PostDistortion.jitterformat = GL_RGBA16F_ARB PostDistortion.depthformat = GL_DEPTH_COMPONENT -PostDistortion.screenUpdateSkip = 0 -PostDistortion.copyDepthBuffer = (NVseries>=7)or(NVseries==0) +PostDistortion.copyDepthBuffer = true ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- @@ -78,7 +77,6 @@ function PostDistortion.GetInfo() shader = true, rtt = true, ctt = true, - atiseries = 2, ms = -1, } end @@ -136,23 +134,17 @@ local glCopyToTexture = gl.CopyToTexture local glCallList = gl.CallList local glTexture = gl.Texture -local CLEAR_FBO = function() gl.Clear(GL_COLOR_BUFFER_BIT,0,0,0,0); end -local screensUpdated = 0 function PostDistortion:BeginDraw() - glActiveFBO(fbo,CLEAR_FBO) --//clear jitterTex + glActiveFBO(fbo, gl.Clear, GL_COLOR_BUFFER_BIT, 0,0,0,0) --//clear jitterTex --// copy depthbuffer to a seperated depth texture, so we can use it in the MRT if (pd.copyDepthBuffer) then glCopyToTexture(depthTex, 0, 0, vpx, vpy, vsx, vsy) end - --// don't update the screen copies each frame (needed for gfxs with slow screen copies, geforce5 etc.) - screensUpdated = screensUpdated + 1 - if (screensUpdated>pd.screenUpdateSkip) then - glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) - screensUpdated = 0 - end + --// update screen copy + glCopyToTexture(screenCopyTex, 0, 0, vpx, vpy, vsx, vsy) end function PostDistortion:EndDraw() @@ -191,10 +183,6 @@ function PostDistortion.Initialize() ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ - if (type(LupsConfig.distortionupdateskip)=="number") then - pd.screenUpdateSkip = LupsConfig.distortionupdateskip - end - if (type(LupsConfig.distortioncopydepthbuffer)=="boolean") then pd.copyDepthBuffer = LupsConfig.distortioncopydepthbuffer end diff --git a/lups/particleclasses/groundflash.lua b/lups/particleclasses/groundflash.lua index 81c34b566..d6ebfcf30 100644 --- a/lups/particleclasses/groundflash.lua +++ b/lups/particleclasses/groundflash.lua @@ -91,7 +91,12 @@ function GroundFlash:Update(n) end --cheap hack for mobility if self.mobile then - local pos = {Spring.GetUnitPosition(self.unit)} + local pos + if self.unit then + pos = {Spring.GetUnitPosition(self.unit)} + elseif self.projectile then + pos = {Spring.GetProjectilePosition(self.projectile)} + end if pos[1] then self.pos = pos end diff --git a/lups/particleclasses/jet.lua b/lups/particleclasses/jet.lua index 3ff49fce4..c8e358f1e 100644 --- a/lups/particleclasses/jet.lua +++ b/lups/particleclasses/jet.lua @@ -23,7 +23,6 @@ function Jet.GetInfo() fbo = true, shader = true, distortion= true, - atiseries = 2, ms = -1, intel = -1, } diff --git a/lups/particleclasses/jitterparticles.lua b/lups/particleclasses/jitterparticles.lua index 82f928c7c..04136737c 100644 --- a/lups/particleclasses/jitterparticles.lua +++ b/lups/particleclasses/jitterparticles.lua @@ -24,7 +24,6 @@ function JitterParticles.GetInfo() distortion= true, rtt = false, ctt = false, - atiseries = 2, } end @@ -73,6 +72,7 @@ local spGetPositionLosState = Spring.GetPositionLosState local spGetUnitLosState = Spring.GetUnitLosState local spIsSphereInView = Spring.IsSphereInView local spGetUnitRadius = Spring.GetUnitRadius +local spGetProjectilePosition = Spring.GetProjectilePosition local glTexture = gl.Texture local glBlending = gl.Blending @@ -228,8 +228,10 @@ function JitterParticles:Initialize() gl_FragColor = vec4(noiseVec,0.0,gl_FragCoord.z); } ]], - uniform = { + uniformInt = { noiseMap = 0, + }, + uniform = { size = 0, frame = 0, movCoeff = 0, @@ -328,19 +330,29 @@ function JitterParticles:Visible() local radius = self.radius + self.uMovCoeff*self.maxSpeed + self.frame*(self.sphereGrowth) --FIXME: frame is only updated on Update() - local pos = self.pos + local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] local losState if (self.unit and not self.worldspace) then local ux,uy,uz = spGetUnitViewPosition(self.unit) - pos[1],pos[2],pos[3] = pos[1]+ux,pos[2]+uy,pos[3]+uz + posX,posY,posZ = posX+ux,posY+uy,posZ+uz radius = radius + spGetUnitRadius(self.unit) - losState = spGetUnitLosState(self.unit, LocalAllyTeamID) + losState = GetUnitLosState(self.unit) + elseif (self.projectile and not self.worldspace) then + local px,py,pz = spGetProjectilePosition(self.projectile) + posX,posY,posZ = posX+px,posY+py,posZ+pz end if (losState==nil) then - local visible,los,radar = spGetPositionLosState(pos[1],pos[2],pos[3], LocalAllyTeamID) - losState = {los=los} + if (self.radar) then + losState = IsPosInRadar(posX,posY,posZ) + end + if ((not losState) and self.airLos) then + losState = IsPosInAirLos(posX,posY,posZ) + end + if ((not losState) and self.los) then + losState = IsPosInLos(posX,posY,posZ) + end end - return (losState.los)and(spIsSphereInView(pos[1],pos[2],pos[3],radius)) + return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) end ----------------------------------------------------------------------------------------------------------------- diff --git a/lups/particleclasses/jitterparticles2.lua b/lups/particleclasses/jitterparticles2.lua index 831c7fd48..746f099f7 100644 --- a/lups/particleclasses/jitterparticles2.lua +++ b/lups/particleclasses/jitterparticles2.lua @@ -27,7 +27,6 @@ function JitterParticles2.GetInfo() distortion= true, rtt = false, ctt = false, - atiseries = 1, } end @@ -94,6 +93,7 @@ local spGetPositionLosState = Spring.GetPositionLosState local spGetUnitLosState = Spring.GetUnitLosState local spIsSphereInView = Spring.IsSphereInView local spGetUnitRadius = Spring.GetUnitRadius +local spGetProjectilePosition = Spring.GetProjectilePosition local IsPosInLos = Spring.IsPosInLos local IsPosInAirLos = Spring.IsPosInAirLos @@ -291,7 +291,7 @@ function JitterParticles2:Initialize() gl_FragColor = vec4(noiseVec,length(noiseVec)*heat,gl_FragCoord.z); } ]], - uniform = { + uniformInt = { noiseMap = 0, }, }) @@ -392,20 +392,23 @@ function JitterParticles2:Visible() local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] local losState if (self.unit and not self.worldspace) then - losState = (spGetUnitLosState(self.unit, LocalAllyTeamID) or {}).los or false local ux,uy,uz = spGetUnitViewPosition(self.unit) posX,posY,posZ = posX+ux,posY+uy,posZ+uz radius = radius + spGetUnitRadius(self.unit) + losState = GetUnitLosState(self.unit) + elseif (self.projectile and not self.worldspace) then + local px,py,pz = spGetProjectilePosition(self.projectile) + posX,posY,posZ = posX+px,posY+py,posZ+pz end if (losState==nil) then if (self.radar) then - losState = IsPosInRadar(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInRadar(posX,posY,posZ) end if ((not losState) and self.airLos) then - losState = IsPosInAirLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInAirLos(posX,posY,posZ) end if ((not losState) and self.los) then - losState = IsPosInLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInLos(posX,posY,posZ) end end return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) diff --git a/lups/particleclasses/nanolasers.lua b/lups/particleclasses/nanolasers.lua index ff19c1ac9..bc7de468a 100644 --- a/lups/particleclasses/nanolasers.lua +++ b/lups/particleclasses/nanolasers.lua @@ -169,7 +169,7 @@ function NanoLasers:ReInitialize() end function NanoLasers:Visible() - if (self.allyID ~= LocalAllyTeamID)and(self.visibility == 0) then + if (self.allyID ~= LocalAllyTeamID) and (LocalAllyTeamID >= 0) and(self.visibility == 0) then return false end diff --git a/lups/particleclasses/nanolasersnoshader.lua b/lups/particleclasses/nanolasersnoshader.lua index 0804988bf..496e6b139 100644 --- a/lups/particleclasses/nanolasersnoshader.lua +++ b/lups/particleclasses/nanolasersnoshader.lua @@ -108,7 +108,7 @@ end local function DrawNanoLasersNoShader(dir,dir_upright,visibility,streamThickness,core_alpha,core_thickness) local startF,endF = 0,1 - if (visibility<0) + if (visibility==0) then startF=-visibility else endF = visibility end @@ -206,7 +206,7 @@ end ----------------------------------------------------------------------------------------------------------------- function NanoLasersNoShader:CreateParticle() - --self.life = self.life + 1 --// so we can reuse existing fx's + self.life = self.life + 1 --// so we can reuse existing fx's self.firstGameFrame = thisGameFrame self.dieGameFrame = self.firstGameFrame + self.life diff --git a/lups/particleclasses/nanoparticles.lua b/lups/particleclasses/nanoparticles.lua index aabae23ae..f98a80760 100644 --- a/lups/particleclasses/nanoparticles.lua +++ b/lups/particleclasses/nanoparticles.lua @@ -15,7 +15,7 @@ local lastTexture = "" function NanoParticles.GetInfo() return { name = "NanoParticles", - backup = "", --// backup class, if this class doesn't work (old cards,ati's,etc.) + backup = "NanoLasers", --// backup class, if this class doesn't work (old cards,ati's,etc.) desc = "", layer = 0, --// extreme simply z-ordering :x @@ -25,7 +25,6 @@ function NanoParticles.GetInfo() shader = true, rtt = false, ctt = false, - atiseries = 1, } end @@ -62,7 +61,7 @@ NanoParticles.Default = { sizeGrowth = 0.05, rotSpeed = 0.15, particles = 1, - texture = 'bitmaps/PD/nano.tga', + texture = 'bitmaps/PD/nano.png', --// internal used dlist = 0, @@ -191,6 +190,12 @@ function NanoParticles:Draw() local startPos = self.pos local endPosNew = self.targetpos local endPosOld = self.targetposStart + + if (not self.pos) or (not self.targetpos) or (not self.targetposStart) then + self._dead = true + return + end + glMultiTexCoord(0, startPos[1], startPos[2], startPos[3], 1) glMultiTexCoord(1, endPosNew[1], endPosNew[2], endPosNew[3], 1) glMultiTexCoord(2, endPosOld[1], endPosOld[2], endPosOld[3], 1) @@ -400,4 +405,4 @@ end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- -return NanoParticles \ No newline at end of file +return NanoParticles diff --git a/lups/particleclasses/ribbons.lua b/lups/particleclasses/ribbons.lua index 2f2a53f35..44510a7f0 100644 --- a/lups/particleclasses/ribbons.lua +++ b/lups/particleclasses/ribbons.lua @@ -16,6 +16,7 @@ Ribbon.__index = Ribbon local RibbonShader local widthLoc, quadsLoc local oldPosUniform = {} +local lastTexture local DLists = {} @@ -42,15 +43,20 @@ Ribbon.Default = { layer = 1, life = math.huge, - unit = 0, + unit = nil, + projectile=nil, piece = 0, width = 1, - size = 24, --//max 32 + size = 24, --//max 256 color = {0.9,0.9,1,1}, + texture = "bitmaps/GPL/Lups/jet.bmp", + decayRate = 0.01, worldspace = true, repeatEffect = true, - dieGameFrame = math.huge + dieGameFrame = math.huge, + + isvalid = true, } ----------------------------------------------------------------------------------------------------------------- @@ -65,6 +71,8 @@ local spGetUnitPiecePosition = Spring.GetUnitPiecePosition local spGetUnitViewPosition = Spring.GetUnitViewPosition local spGetUnitPiecePosDir = Spring.GetUnitPiecePosDir local spGetUnitVectors = Spring.GetUnitVectors +local spGetProjectilePosition = Spring.GetProjectilePosition +local spGetProjectileVelocity = Spring.GetProjectileVelocity local glUniform = gl.Uniform local glUniformInt = gl.UniformInt local glUseShader = gl.UseShader @@ -90,7 +98,6 @@ end function Ribbon:BeginDraw() glUseShader(RibbonShader) - glTexture(0,":c:bitmaps/GPL/Lups/jet.bmp") glBlending(GL_SRC_ALPHA,GL_ONE) end @@ -99,13 +106,18 @@ function Ribbon:EndDraw() glUseShader(0) glBlending(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glTexture(0,false) + lastTexture = nil glColor(1,1,1,1) end function Ribbon:Draw() + local quads0 = self.quads0 - + if self.texture ~= lastTexture then + glTexture(0,":c:"..self.texture) + lastTexture = self.texture + end glUniform(widthLoc, self.width ) glUniformInt(quadsLoc, quads0 ) @@ -120,29 +132,28 @@ function Ribbon:Draw() --// insert interpolated current unit pos if (self.isvalid) then --local x,y,z = GetPiecePos(self.unit,self.piecenum) - local x,y,z = spGetUnitPiecePosDir(self.unit,self.piecenum) - if x and y and z then - glUniform( oldPosUniform[quads0+1] , x,y,z ) - - if (self.blendfactor<1) then - local clr = self.color - glColor(clr[1],clr[2],clr[3],clr[4]*self.blendfactor) - else - glColor(self.color) - end - - glCallList(DLists[quads0]) - else - --local dir = self.oldPos[j] - --glUniform( oldPosUniform[quads0+1] , dir[1], dir[2], dir[3] ) - end + local x,y,z + if self.unit then + x,y,z = spGetUnitPiecePosDir(self.unit,self.piecenum) + elseif self.projectile then + x,y,z = spGetProjectilePosition(self.projectile) + end + if x and y and z then + glUniform( oldPosUniform[quads0+1] , x,y,z ) + end else - --local dir = self.oldPos[j] - --glUniform( oldPosUniform[quads0+1] , dir[1], dir[2], dir[3] ) + local dir = self.oldPos[j] + glUniform( oldPosUniform[quads0+1] , dir[1], dir[2], dir[3] ) end --// define color and add speed blending (don't show ribbon for slow/landing units!) - + if (self.blendfactor<1) then + local clr = self.color + glColor(clr[1],clr[2],clr[3],clr[4]*self.blendfactor) + else + glColor(self.color) + end + glCallList(DLists[quads0]) end ----------------------------------------------------------------------------------------------------------------- @@ -153,7 +164,7 @@ function Ribbon.Initialize() vertex = [[ uniform float width; uniform int quads; - uniform vec3 oldPos[32]; + uniform vec3 oldPos[256]; varying vec2 texCoord; @@ -206,7 +217,7 @@ function Ribbon.Initialize() widthLoc = gl.GetUniformLocation(RibbonShader, 'width') quadsLoc = gl.GetUniformLocation(RibbonShader, 'quads') - for i=1,32 do + for i=1,256 do oldPosUniform[i] = gl.GetUniformLocation(RibbonShader,"oldPos["..(i-1).."]") end end @@ -228,27 +239,40 @@ end ----------------------------------------------------------------------------------------------------------------- function Ribbon:Update(n) - self.isvalid = not spGetUnitIsDead(self.unit) - + self.isvalid = (self.unit and spGetUnitIsDead(self.unit) == false) or (self.projectile and Spring.GetProjectileDefID(self.projectile)) if (self.isvalid) then - local x,y,z = spGetUnitPiecePosDir(self.unit,self.piecenum) + local x,y,z + if self.unit then + x, y, z = spGetUnitPiecePosDir(self.unit,self.piecenum) + elseif self.projectile then + x,y,z = spGetProjectilePosition(self.projectile) + end if x and y and z then self.posIdx = (self.posIdx % self.size)+1 self.oldPos[self.posIdx] = {x,y,z} - local vx,vy,vz = spGetUnitVelocity(self.unit) - if vx and vy and vz then - self.blendfactor = (vx*vx+vz*vz)/30 - end + local vx,vy,vz + if self.unit then + vx, vy, vz = spGetUnitVelocity(self.unit) + elseif self.projectile then + vx, vy, vz = spGetProjectileVelocity(self.projectile) + end + if vx and vy and vz then + self.blendfactor = (vx*vx+vy*vy+vz*vz)/30 + end end else - self.blendfactor = self.blendfactor - n * 0.01 + local lastIndex = self.posIdx + self.posIdx = (self.posIdx % self.size)+1 + self.oldPos[self.posIdx] = self.oldPos[lastIndex] + + self.blendfactor = self.blendfactor - n * self.decayRate end end function Ribbon:Visible() - self.isvalid = not spGetUnitIsDead(self.unit) + self.isvalid = (self.unit and spGetUnitIsDead(self.unit) == false) or (self.projectile and Spring.GetProjectileDefID(self.projectile)) local pos = self.oldPos[self.posIdx] return (self.blendfactor>0) and (spIsSphereInView(pos[1],pos[2],pos[3], self.radius)) end @@ -285,14 +309,19 @@ end function Ribbon:CreateParticle() - if (self.size>32) then self.size=32 - elseif (self.size<5) then self.size=5 end + if (self.size>256) then self.size=256 + elseif (self.size<2) then self.size=2 end self.posIdx = 1 self.quads0 = self.size-1 self.blendfactor = 1 - local x,y,z = spGetUnitPiecePosDir(self.unit,self.piecenum) + local x,y,z + if self.unit then + x,y,z = spGetUnitPiecePosDir(self.unit,self.piecenum) + elseif self.projectile then + x,y,z = spGetProjectilePosition(self.projectile) + end local curpos = {x,y,z} self.oldPos = {} @@ -300,8 +329,10 @@ function Ribbon:CreateParticle() self.oldPos[i] = curpos end - local udid = spGetUnitDefID(self.unit) - self.radius = (UnitDefs[udid].speed/30.0)*self.size + local udid = self.unit and spGetUnitDefID(self.unit) + local weapon = self.weapon + local speed = self.speed or (UnitDefs[udid] and UnitDefs[udid].speed) or (weapon and WeaponDefs[weapon] and WeaponDefs[weapon].projectilespeed*30) or 100 + self.radius = (speed/30.0)*self.size if (not DLists[self.quads0]) then DLists[self.quads0] = gl.CreateList(gl.BeginEnd,GL.QUADS,CreateDList,self.quads0) diff --git a/lups/particleclasses/shieldjitter.lua b/lups/particleclasses/shieldjitter.lua index 339663b9b..5cfb23730 100644 --- a/lups/particleclasses/shieldjitter.lua +++ b/lups/particleclasses/shieldjitter.lua @@ -8,6 +8,7 @@ ShieldJitter.__index = ShieldJitter local warpShader local timerUniform,strengthUniform local sphereList +local checkStunned = true ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- @@ -26,7 +27,6 @@ function ShieldJitter.GetInfo() distortion= true, rtt = false, ctt = true, - atiseries = 2, intel = 0, } end @@ -66,6 +66,12 @@ function ShieldJitter:EndDrawDistortion() end function ShieldJitter:DrawDistortion() + if checkStunned then + self.stunned = Spring.GetUnitIsStunned(self.unit) + end + if self.stunned then + return + end local pos = self.pos local size = self.size gl.Uniform(strengthUniform, self.strength ) @@ -148,7 +154,15 @@ end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- -function ShieldJitter:Update() +local time = 0 +function ShieldJitter:Update(dt) + time = time + dt + if time > 45 then + checkStunned = true + time = 0 + else + checkStunned = false + end end -- used if repeatEffect=true; diff --git a/lups/particleclasses/shieldsphere.lua b/lups/particleclasses/shieldsphere.lua index ef6cef39d..f23966f24 100644 --- a/lups/particleclasses/shieldsphere.lua +++ b/lups/particleclasses/shieldsphere.lua @@ -7,6 +7,7 @@ ShieldSphereParticle.__index = ShieldSphereParticle local sphereList local shieldShader +local checkStunned = true ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- @@ -51,7 +52,7 @@ local glMultiTexCoord = gl.MultiTexCoord local glCallList = gl.CallList function ShieldSphereParticle:BeginDraw() - gl.DepthMask(true) + gl.DepthMask(false) gl.UseShader(shieldShader) gl.Culling(GL.FRONT) end @@ -70,6 +71,12 @@ function ShieldSphereParticle:EndDraw() end function ShieldSphereParticle:Draw() + if checkStunned then + self.stunned = Spring.GetUnitIsStunned(self.unit) + end + if self.stunned then + return + end local color = self.color1 glMultiTexCoord(1, color[1],color[2],color[3],color[4] or 1) color = self.color2 @@ -157,7 +164,15 @@ end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- +local time = 0 function ShieldSphereParticle:Update(n) + time = time + n + if time > 45 then + checkStunned = true + time = 0 + else + checkStunned = false + end if (self.life<1) then self.life = self.life + n*self.life_incr self.size = self.size + n*self.sizeGrowth diff --git a/lups/particleclasses/shockwave.lua b/lups/particleclasses/shockwave.lua index f1b84ca7e..176c49f68 100644 --- a/lups/particleclasses/shockwave.lua +++ b/lups/particleclasses/shockwave.lua @@ -24,7 +24,6 @@ function ShockWave.GetInfo() fbo = true, shader = true, distortion= true, - atiseries = 2, intel = 0, } end diff --git a/lups/particleclasses/simpleparticles.lua b/lups/particleclasses/simpleparticles.lua index 6c003cead..32c1c5b7b 100644 --- a/lups/particleclasses/simpleparticles.lua +++ b/lups/particleclasses/simpleparticles.lua @@ -24,7 +24,6 @@ function SimpleParticles.GetInfo() shader = true, rtt = false, ctt = false, - atiseries = 1, } end @@ -87,6 +86,7 @@ local spGetPositionLosState = Spring.GetPositionLosState local spGetUnitLosState = Spring.GetUnitLosState local spIsSphereInView = Spring.IsSphereInView local spGetUnitRadius = Spring.GetUnitRadius +local spGetProjectilePosition = Spring.GetProjectilePosition local IsPosInLos = Spring.IsPosInLos local IsPosInAirLos = Spring.IsPosInAirLos @@ -386,20 +386,23 @@ function SimpleParticles:Visible() local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] local losState if (self.unit and not self.worldspace) then - losState = (spGetUnitLosState(self.unit, LocalAllyTeamID) or {}).los or false + losState = GetUnitLosState(self.unit) local ux,uy,uz = spGetUnitViewPosition(self.unit) posX,posY,posZ = posX+ux,posY+uy,posZ+uz radius = radius + spGetUnitRadius(self.unit) + elseif (self.projectile and not self.worldspace) then + local px,py,pz = spGetProjectilePosition(self.projectile) + posX,posY,posZ = posX+px,posY+py,posZ+pz end if (losState==nil) then if (self.radar) then - losState = IsPosInRadar(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInRadar(posX,posY,posZ) end if ((not losState) and self.airLos) then - losState = IsPosInAirLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInAirLos(posX,posY,posZ) end if ((not losState) and self.los) then - losState = IsPosInLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInLos(posX,posY,posZ) end end return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) diff --git a/lups/particleclasses/simpleparticles2.lua b/lups/particleclasses/simpleparticles2.lua index cfc3f528a..1f0ee9a1c 100644 --- a/lups/particleclasses/simpleparticles2.lua +++ b/lups/particleclasses/simpleparticles2.lua @@ -26,7 +26,6 @@ function SimpleParticles2.GetInfo() shader = true, rtt = false, ctt = false, - atiseries = 1, } end @@ -84,6 +83,7 @@ local spGetPositionLosState = Spring.GetPositionLosState local spGetUnitLosState = Spring.GetUnitLosState local spIsSphereInView = Spring.IsSphereInView local spGetUnitRadius = Spring.GetUnitRadius +local spGetProjectilePosition = Spring.GetProjectilePosition local IsPosInLos = Spring.IsPosInLos local IsPosInAirLos = Spring.IsPosInAirLos @@ -386,20 +386,23 @@ function SimpleParticles2:Visible() local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] local losState if (self.unit and not self.worldspace) then - losState = (spGetUnitLosState(self.unit, LocalAllyTeamID) or {}).los or false + losState = GetUnitLosState(self.unit) local ux,uy,uz = spGetUnitViewPosition(self.unit) posX,posY,posZ = posX+ux,posY+uy,posZ+uz radius = radius + spGetUnitRadius(self.unit) + elseif (self.projectile and not self.worldspace) then + local px,py,pz = spGetProjectilePosition(self.projectile) + posX,posY,posZ = posX+px,posY+py,posZ+pz end if (losState==nil) then if (self.radar) then - losState = IsPosInRadar(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInRadar(posX,posY,posZ) end if ((not losState) and self.airLos) then - losState = IsPosInAirLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInAirLos(posX,posY,posZ) end if ((not losState) and self.los) then - losState = IsPosInLos(posX,posY,posZ, LocalAllyTeamID) + losState = IsPosInLos(posX,posY,posZ) end end return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) diff --git a/lups/particleclasses/sound.lua b/lups/particleclasses/sound.lua index e681445aa..1239368d5 100644 --- a/lups/particleclasses/sound.lua +++ b/lups/particleclasses/sound.lua @@ -36,9 +36,6 @@ Sound.Default = { ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- -local GetUnitLosState = Spring.GetUnitLosState -local PlaySoundFile = Spring.PlaySoundFile - local lastPlayed = {} function Sound:Valid() @@ -54,8 +51,8 @@ function Sound:CreateParticle() local pos = self.pos if (self.unit) then - local losState = GetUnitLosState(self.unit,LocalAllyTeamID) or {} - if (not losState.los) then return false end + local losState = Spring.GetUnitLosState(self.unit,LocalAllyTeamID) or {} + if not(losState and losState.los) then return false end pos = {Spring.GetUnitPosition(self.unit)} end diff --git a/lups/particleclasses/spheredistortion.lua b/lups/particleclasses/spheredistortion.lua index 94c0af1c0..6b2e7b5fa 100644 --- a/lups/particleclasses/spheredistortion.lua +++ b/lups/particleclasses/spheredistortion.lua @@ -23,7 +23,6 @@ function SphereDistortion.GetInfo() fbo = true, shader = true, distortion= true, - atiseries = 2, intel = 0, } end diff --git a/lups/particleclasses/staticparticles.lua b/lups/particleclasses/staticparticles.lua index ecbd5a3f8..2092815b0 100644 --- a/lups/particleclasses/staticparticles.lua +++ b/lups/particleclasses/staticparticles.lua @@ -24,7 +24,6 @@ function StaticParticles.GetInfo() shader = true, rtt = false, ctt = false, - atiseries = 1, } end @@ -32,6 +31,11 @@ StaticParticles.Default = { particles = {}, dlist = 0, + --// visibility check + los = true, + airLos = true, + radar = false, + emitVector = {0,1,0}, pos = {0,0,0}, --// start pos partpos = "0,0,0", --// particle relative start pos (can contain lua code!) @@ -70,6 +74,7 @@ local spGetPositionLosState = Spring.GetPositionLosState local spGetUnitViewPosition = Spring.GetUnitViewPosition local spIsSphereInView = Spring.IsSphereInView local spGetUnitRadius = Spring.GetUnitRadius +local spGetProjectilePosition = Spring.GetProjectilePosition local glTexture = gl.Texture local glBlending = gl.Blending @@ -294,21 +299,32 @@ end function StaticParticles:Visible() local radius = self.radius + self.frame*(self.sphereGrowth) --FIXME: frame is only updated on Update() - local pos = {self.pos[1],self.pos[2],self.pos[3]} + local posX,posY,posZ = self.pos[1],self.pos[2],self.pos[3] local losState if (self.unit and not self.worldspace) then + losState = GetUnitLosState(self.unit) local ux,uy,uz = spGetUnitViewPosition(self.unit) - if ux and uy and uz then - pos[1],pos[2],pos[3] = pos[1]+ux,pos[2]+uy,pos[3]+uz - radius = radius + (spGetUnitRadius(self.unit) or 0) - losState = spGetUnitLosState(self.unit, LocalAllyTeamID) + if not ux then + return false end + posX,posY,posZ = posX+ux,posY+uy,posZ+uz + radius = radius + (spGetUnitRadius(self.unit) or 0) + elseif (self.projectile and not self.worldspace) then + local px,py,pz = spGetProjectilePosition(self.projectile) + posX,posY,posZ = posX+px,posY+py,posZ+pz end if (losState==nil) then - local visible,los,radar = Spring.GetPositionLosState(pos[1],pos[2],pos[3], LocalAllyTeamID) - losState = {los=los } + if (self.radar) then + losState = IsPosInRadar(posX,posY,posZ) + end + if ((not losState) and self.airLos) then + losState = IsPosInAirLos(posX,posY,posZ) + end + if ((not losState) and self.los) then + losState = IsPosInLos(posX,posY,posZ) + end end - return (losState.los)and(spIsSphereInView(pos[1],pos[2],pos[3],radius)) + return (losState)and(spIsSphereInView(posX,posY,posZ,radius)) end ----------------------------------------------------------------------------------------------------------------- diff --git a/lups/particleclasses/unitcloaker.lua b/lups/particleclasses/unitcloaker.lua index 01591da5a..443daa2f6 100644 --- a/lups/particleclasses/unitcloaker.lua +++ b/lups/particleclasses/unitcloaker.lua @@ -26,7 +26,6 @@ function UnitCloaker.GetInfo() shader = true, rtt = false, ctt = true, - atiseries = 2, intel = 0, } end @@ -259,15 +258,15 @@ function UnitCloaker:ReInitialize() end function UnitCloaker:CreateParticle() - local name = UnitDefs[self.unitDefID].model.name - self.isS3o = ((name:lower():find("s3o") or name:lower():find("obj")) and true) + local name = (UnitDefs[self.unitDefID].model and UnitDefs[self.unitDefID].model.name) or UnitDefs[self.unitDefID].modelname + self.isS3o = ((name:lower():find("s3o") or name:lower():find("obj") or name:lower():find("dae")) and true) self.firstGameFrame = thisGameFrame self.dieGameFrame = self.firstGameFrame + self.life end function UnitCloaker:Visible() if self.allyTeam == LocalAllyTeamID then - return Spring.IsUnitVisible(self.unit) + return Spring.IsUnitVisible(self.unit, 0, true) -- Don't draw for icons end local _, specFullView = Spring.GetSpectatingState() @@ -293,4 +292,4 @@ end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- -return UnitCloaker +return UnitCloaker \ No newline at end of file diff --git a/lups/particleclasses/unitjitter.lua b/lups/particleclasses/unitjitter.lua index 46aeb8284..d27a2397b 100644 --- a/lups/particleclasses/unitjitter.lua +++ b/lups/particleclasses/unitjitter.lua @@ -25,7 +25,6 @@ function UnitJitter.GetInfo() fbo = true, shader = true, distortion= true, - atiseries = 2, intel = 0, } end @@ -254,16 +253,17 @@ function UnitJitter:ReInitialize() end function UnitJitter:CreateParticle() - local name = UnitDefs[self.unitDefID].model.name - self.isS3o = ((name:lower():find("s3o") or name:lower():find("obj")) and true) + local name = (UnitDefs[self.unitDefID].model and UnitDefs[self.unitDefID].model.name) or UnitDefs[self.unitDefID].modelname + self.isS3o = ((name:lower():find("s3o") or name:lower():find("obj") or name:lower():find("dae")) and true) self.teamColor = {spGetTeamColor(self.team)} self.firstGameFrame = thisGameFrame self.dieGameFrame = self.firstGameFrame + self.life end function UnitJitter:Visible() - if self.allyTeam == LocalAllyTeamID then - return Spring.IsUnitVisible(self.unit) + if LocalAllyTeamID == -2 -- spec full view + or LocalAllyTeamID == self.allyTeam then + return Spring.IsUnitVisible(self.unit, 0, true) -- Don't draw for icons end local inLos = true @@ -275,7 +275,7 @@ function UnitJitter:Visible() local losState = Spring.GetUnitLosState(self.unit, LocalAllyTeamID) or {} inLos = (inLos)and(not losState.los) end - return (inLos)and(Spring.IsUnitVisible(self.unit)) + return (inLos)and(Spring.IsUnitVisible(self.unit, 0, true)) -- Don't draw for icons end ----------------------------------------------------------------------------------------------------------------- @@ -297,4 +297,4 @@ end ----------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------- -return UnitJitter +return UnitJitter \ No newline at end of file diff --git a/lups/particleclasses/unitpiecelight.lua b/lups/particleclasses/unitpiecelight.lua deleted file mode 100644 index 79592aa60..000000000 --- a/lups/particleclasses/unitpiecelight.lua +++ /dev/null @@ -1,471 +0,0 @@ --- $Id: UnitPieceLight.lua 3171 2008-11-06 09:06:29Z det $ ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -local UnitPieceLight = {} -UnitPieceLight.__index = UnitPieceLight - -local depthtex, offscreentex, blurtex -local offscreen4, offscreen8 -local blur4, blur8 - -local depthShader -local blurShader_h -local blurShader_v -local uniformScreenXY, uniformScreenX, uniformScreenY - -local GL_DEPTH_BITS = 0x0D56 - -local GL_DEPTH_COMPONENT = 0x1902 -local GL_DEPTH_COMPONENT16 = 0x81A5 -local GL_DEPTH_COMPONENT24 = 0x81A6 -local GL_DEPTH_COMPONENT32 = 0x81A7 - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -function UnitPieceLight.GetInfo() - return { - name = "UnitPieceLight", - backup = "", --// backup class, if this class doesn't work (old cards,ati's,etc.) - desc = "", - - layer = 32, --// extreme simply z-ordering :x - - --// gfx requirement - fbo = true, - shader = true, - rtt = true, - ctt = true, - atiseries = 2, - ms = 0, - } -end - - -UnitPieceLight.Default = { - layer = 32, - life = math.huge, - worldspace = true, - - piecenum = 0, - - colormap = { {1,1,1,0} }, - repeatEffect = true, - - --// internal - color = {1,1,1,0}, -} - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -function UnitPieceLight:BeginDraw() - gl.CopyToTexture(depthtex, 0, 0, 0, 0, vsx, vsy) - gl.Texture(depthtex) - gl.UseShader(depthShader) - gl.Uniform(uniformScreenXY, math.ceil(vsx*0.5),math.ceil(vsy*0.5) ) - gl.RenderToTexture(offscreentex, gl.Clear, GL.COLOR_BUFFER_BIT ,0,0,0,0) -end - -function UnitPieceLight:EndDraw() - gl.Color(1,1,1,1) - gl.UseShader(0) - gl.RenderToTexture(offscreen4, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.Texture(offscreentex) - gl.TexRect(-1,1,1,-1) - end) - gl.RenderToTexture(offscreen8, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.Texture(offscreen4) - gl.TexRect(-1,1,1,-1) - end) - - gl.Texture(offscreentex) - gl.RenderToTexture(blurtex, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_h) - gl.UniformInt(uniformScreenX, math.ceil(vsx*0.5) ) - gl.TexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) - end) - gl.Texture(blurtex) - gl.RenderToTexture(offscreentex, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_v) - gl.UniformInt(uniformScreenY, math.ceil(vsy*0.5) ) - gl.TexRect(-1-0.25/vsx,1+0.25/vsy,1+0.25/vsx,-1-0.25/vsy) - end) - - gl.Texture(offscreen4) - gl.RenderToTexture(blur4, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_h) - gl.UniformInt(uniformScreenX, math.ceil(vsx*0.25) ) - gl.TexRect(-1-0.125/vsx,1+0.125/vsy,1+0.125/vsx,-1-0.125/vsy) - end) - gl.Texture(blur4) - gl.RenderToTexture(offscreen4, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_v) - gl.UniformInt(uniformScreenY, math.ceil(vsy*0.25) ) - gl.TexRect(-1-0.125/vsx,1+0.125/vsy,1+0.125/vsx,-1-0.125/vsy) - end) - - gl.Texture(offscreen8) - gl.RenderToTexture(blur8, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_h) - gl.UniformInt(uniformScreenX, math.ceil(vsx*0.125) ) - gl.TexRect(-1-0.0625/vsx,1+0.0625/vsy,1+0.0625/vsx,-1-0.0625/vsy) - end) ---[[ - gl.Texture(blur8) - gl.RenderToTexture(offscreen8, function() - gl.Clear(GL.COLOR_BUFFER_BIT,0,0,0,0) - gl.UseShader(blurShader_v) - gl.UniformInt(uniformScreenY, math.ceil(vsy*0.125) ) - gl.TexRect(-1-0.0625/vsx,1+0.0625/vsy,1+0.0625/vsx,-1-0.0625/vsy) - end) ---]] - - gl.UseShader(0) - gl.Blending(GL.ONE,GL.ONE) - - gl.MatrixMode(GL.PROJECTION); gl.PushMatrix(); gl.LoadIdentity() - gl.MatrixMode(GL.MODELVIEW); gl.PushMatrix(); gl.LoadIdentity() - - gl.Texture(offscreentex) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - gl.Texture(offscreen4) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - gl.Texture(blur8) - --gl.Texture(offscreen8) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - gl.TexRect(-1-0.5/vsx,1+0.5/vsy,1+0.5/vsx,-1-0.5/vsy) - - gl.MatrixMode(GL.PROJECTION); gl.PopMatrix() - gl.MatrixMode(GL.MODELVIEW); gl.PopMatrix() - - gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) - gl.Texture(false) - gl.UseShader(0) -end - -function UnitPieceLight:Draw() - gl.Color(self.color[1],self.color[2],self.color[3],self.color[4]) - gl.RenderToTexture(offscreentex, function() - gl.PushMatrix() - gl.ResetMatrices() - gl.PushMatrix() - gl.UnitMultMatrix(self.unit) - --local x,y,z = Spring.GetUnitViewPosition(self.unit) - --local dx,_,dz = Spring.GetUnitDirection(self.unit) - --local h = Spring.GetHeadingFromVector(dx,dz) - --gl.Translate(x,y,z) - --gl.Rotate(h/360*2, 0, 1, 0) - --gl.UnitPieceMatrix(self.unit,self.piecenum) - gl.UnitPieceMultMatrix(self.unit,self.piecenum) - gl.UnitPiece(self.unit,self.piecenum) - gl.PopMatrix() - gl.PopMatrix() - end) -end - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -function UnitPieceLight:Update() - self.life = self.life + self.life_incr - self.color = {GetColor(self.colormap,self.life)} -end - --- used if repeatEffect=true; -function UnitPieceLight:ReInitialize() - self.life = 0 - self.dieGameFrame = self.dieGameFrame + self.clife -end - -function UnitPieceLight.Initialize() - depthShader = gl.CreateShader({ - fragment = [[ - uniform sampler2D tex0; - uniform vec2 screenXY; - - void main(void) - { - vec2 texCoord = vec2( gl_FragCoord.x/screenXY.x , gl_FragCoord.y/screenXY.y ); - float depth = texture2D(tex0, texCoord ).z; - - if (depth <= gl_FragCoord.z-0.0005) { - discard; - } - gl_FragColor = gl_Color; - } - ]], - uniformInt = { - tex0 = 0, - }, - uniform = { - screenXY = {math.ceil(vsx*0.5),math.ceil(vsy*0.5)}, - }, - }) - - if (depthShader == nil) then - print(PRIO_MAJOR,"LUPS->UnitPieceLights: Critical Shader Error: DepthShader: "..gl.GetShaderLog()) - return false - end - - blurShader_h = gl.CreateShader({ - fragment = [[ - float kernel[7]; //= float[7](0.013, 0.054, 0.069, 0.129, 0.212, 0.301, 0.372); - uniform sampler2D tex0; - uniform int screenX; - - void InitKernel(void) { - kernel[0] = 0.013; - kernel[1] = 0.054; - kernel[2] = 0.069; - kernel[3] = 0.129; - kernel[4] = 0.212; - kernel[5] = 0.301; - kernel[6] = 0.372; - } - - void main(void) { - InitKernel(); - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int n; - int i; - - float pixelsize = 1.0/float(screenX); - - i=1; - for(n=6; n >= 0; --n){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + float(i)*pixelsize,texCoord.t) ); - ++i; - } - - gl_FragColor += 0.4 * texture2D(tex0, texCoord ); - - i = -7; - for(n=0; n <= 6; ++n){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s + float(i)*pixelsize,texCoord.t) ); - ++i; - } - } - ]], - uniformInt = { - tex0 = 0, - screenX = math.ceil(vsx*0.5), - }, - }) - - - if (blurShader_h == nil) then - print(PRIO_MAJOR,"LUPS->UnitPieceLights: Critical Shader Error: HBlurShader: "..gl.GetShaderLog()) - return false - end - - blurShader_v = gl.CreateShader({ - fragment = [[ - float kernel[7]; //= float[7](0.013, 0.054, 0.069, 0.129, 0.212, 0.301, 0.372); - uniform sampler2D tex0; - uniform int screenY; - - void InitKernel(void) { - kernel[0] = 0.013; - kernel[1] = 0.054; - kernel[2] = 0.069; - kernel[3] = 0.129; - kernel[4] = 0.212; - kernel[5] = 0.301; - kernel[6] = 0.372; - } - - void main(void) { - vec2 texCoord = vec2(gl_TextureMatrix[0] * gl_TexCoord[0]); - gl_FragColor = vec4(0.0); - - int i; - int n; - - float pixelsize = 1.0/float(screenY); - - i=1; - for(n=6; n >= 0; --n){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + float(i)*pixelsize) ); - ++i; - } - - gl_FragColor += 0.4 * texture2D(tex0, texCoord ); - - i = -7; - for(n=0; n <= 6; ++n){ - gl_FragColor += kernel[n] * texture2D(tex0, vec2(texCoord.s,texCoord.t + float(i)*pixelsize) ); - ++i; - } - } - ]], - uniformInt = { - tex0 = 0, - screenY = math.ceil(vsy*0.5); - }, - }) - - if (blurShader_v == nil) then - print(PRIO_MAJOR,"LUPS->UnitPieceLights: Critical Shader Error: VBlurShader: "..gl.GetShaderLog()) - return false - end - - uniformScreenXY = gl.GetUniformLocation(depthShader, 'screenXY') - uniformScreenX = gl.GetUniformLocation(blurShader_h, 'screenX') - uniformScreenY = gl.GetUniformLocation(blurShader_v, 'screenY') - - UnitPieceLight.ViewResize() -end - -function UnitPieceLight.Finalize() - gl.DeleteTexture(depthtex) - if (gl.DeleteTextureFBO) then - gl.DeleteTextureFBO(offscreentex) - gl.DeleteTextureFBO(blurtex) - end - - if (gl.DeleteShader) then - gl.DeleteShader(depthShader or 0) - gl.DeleteShader(blurShader_h or 0) - gl.DeleteShader(blurShader_v or 0) - end -end - -function UnitPieceLight.ViewResize() - gl.DeleteTexture(depthtex or 0) - gl.DeleteTextureFBO(offscreentex or 0) - gl.DeleteTextureFBO(blurtex or 0) - - gl.DeleteTextureFBO(offscreen4 or 0) - gl.DeleteTextureFBO(offscreen8 or 0) - gl.DeleteTextureFBO(blur4 or 0) - gl.DeleteTextureFBO(blur8 or 0) - - depthtex = gl.CreateTexture(vsx,vsy, { - border = false, - format = GL_DEPTH_COMPONENT24, - min_filter = GL.NEAREST, - mag_filter = GL.NEAREST, - }) - - offscreentex = gl.CreateTexture(math.ceil(vsx*0.5),math.ceil(vsy*0.5), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - offscreen4 = gl.CreateTexture(math.ceil(vsx*0.25),math.ceil(vsy*0.25), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - offscreen8 = gl.CreateTexture(math.ceil(vsx*0.125),math.ceil(vsy*0.125), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - blurtex = gl.CreateTexture(math.ceil(vsx*0.5),math.ceil(vsy*0.5), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - blur4 = gl.CreateTexture(math.ceil(vsx*0.25),math.ceil(vsy*0.25), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) - - blur8 = gl.CreateTexture(math.ceil(vsx*0.125),math.ceil(vsy*0.125), { - border = false, - min_filter = GL.LINEAR, - mag_filter = GL.LINEAR, - wrap_s = GL.CLAMP, - wrap_t = GL.CLAMP, - fbo = true, - }) -end - - -function UnitPieceLight:Visible() - local radius = 300 - local pos = {0,0,0} - local losState - - local ux,uy,uz = Spring.GetUnitViewPosition(self.unit) - if (ux) then - pos[1],pos[2],pos[3] = pos[1]+ux,pos[2]+uy,pos[3]+uz - radius = radius + Spring.GetUnitRadius(self.unit) - losState = Spring.GetUnitLosState(self.unit, LocalAllyTeamID) - - return (losState.los)and(Spring.IsSphereInView(pos[1],pos[2],pos[3],radius)) - else - return false - end -end - -function UnitPieceLight:Valid() - local ux = Spring.GetUnitViewPosition(self.unit) - if (ux) then - return true - else - return false - end -end - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -function UnitPieceLight:CreateParticle() - self.clife = self.life - self.life_incr = 1/self.life - self.life = 0 - self.dieGameFrame = Spring.GetGameFrame() + self.clife -end - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -function UnitPieceLight.Create(Options) - local newObject = MergeTable(Options, UnitPieceLight.Default) - setmetatable(newObject,UnitPieceLight) -- make handle lookup - newObject:CreateParticle() - return newObject -end - -function UnitPieceLight:Destroy() -end - ------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------ - -return UnitPieceLight diff --git a/modinfo.lua b/modinfo.lua index cd8f7fa3e..3a800d498 100644 --- a/modinfo.lua +++ b/modinfo.lua @@ -10,17 +10,19 @@ -------------------------------------------------------------------------------- return { - name='Evolution RTS -', - description='EvoRTS', - shortname='EvoRTS', - version='$VERSION', - mutator='Official', - game='Evolution RTS', - shortGame='EvoRTS', - modtype=1, - depend = {"Spring Features 1.0"}, - - NTAI = { - tdfpath='EvoRTS'; - }, + name='Evolution RTS -', + description='EvoRTS', + shortname='EvoRTS', + version='dev', + mutator='Official', + game='Evolution RTS', + shortGame='EvoRTS', + modtype=1, + depend = { + "Evolution RTS Music Addon v3", + -- "Spring Features v1.9", + -- "Evolution RTS Music Addon v1", + -- "Shard LuaAI $VERSION", + -- "Evolution RTS Shard LuaAI $VERSION", + }, } diff --git a/sounds/ChickenDefenseSounds/bigbugdie.wav b/sounds/ChickenDefenseSounds/bigbugdie.wav new file mode 100644 index 000000000..7a0183bd2 Binary files /dev/null and b/sounds/ChickenDefenseSounds/bigbugdie.wav differ diff --git a/sounds/ChickenDefenseSounds/bigchickenbreath.wav b/sounds/ChickenDefenseSounds/bigchickenbreath.wav new file mode 100644 index 000000000..613abe56e Binary files /dev/null and b/sounds/ChickenDefenseSounds/bigchickenbreath.wav differ diff --git a/sounds/ChickenDefenseSounds/bigchickendead.wav b/sounds/ChickenDefenseSounds/bigchickendead.wav new file mode 100644 index 000000000..724074698 Binary files /dev/null and b/sounds/ChickenDefenseSounds/bigchickendead.wav differ diff --git a/sounds/ChickenDefenseSounds/bigchickenroar.wav b/sounds/ChickenDefenseSounds/bigchickenroar.wav new file mode 100644 index 000000000..4e081c9ee Binary files /dev/null and b/sounds/ChickenDefenseSounds/bigchickenroar.wav differ diff --git a/sounds/ChickenDefenseSounds/bugdie.wav b/sounds/ChickenDefenseSounds/bugdie.wav new file mode 100644 index 000000000..f7695c1e3 Binary files /dev/null and b/sounds/ChickenDefenseSounds/bugdie.wav differ diff --git a/sounds/ChickenDefenseSounds/chicken_nuke.wav b/sounds/ChickenDefenseSounds/chicken_nuke.wav new file mode 100644 index 000000000..1b0aaddd9 Binary files /dev/null and b/sounds/ChickenDefenseSounds/chicken_nuke.wav differ diff --git a/sounds/ChickenDefenseSounds/e16.wav b/sounds/ChickenDefenseSounds/e16.wav new file mode 100644 index 000000000..10690cd32 Binary files /dev/null and b/sounds/ChickenDefenseSounds/e16.wav differ diff --git a/sounds/ChickenDefenseSounds/e25.wav b/sounds/ChickenDefenseSounds/e25.wav new file mode 100644 index 000000000..f6c471db9 Binary files /dev/null and b/sounds/ChickenDefenseSounds/e25.wav differ diff --git a/sounds/ChickenDefenseSounds/flamhvy1.wav b/sounds/ChickenDefenseSounds/flamhvy1.wav new file mode 100644 index 000000000..ec8dcb8a8 Binary files /dev/null and b/sounds/ChickenDefenseSounds/flamhvy1.wav differ diff --git a/sounds/ChickenDefenseSounds/junohit2edit.wav b/sounds/ChickenDefenseSounds/junohit2edit.wav new file mode 100644 index 000000000..4eb0f1d50 Binary files /dev/null and b/sounds/ChickenDefenseSounds/junohit2edit.wav differ diff --git a/sounds/ChickenDefenseSounds/nuke4.wav b/sounds/ChickenDefenseSounds/nuke4.wav new file mode 100644 index 000000000..1b0aaddd9 Binary files /dev/null and b/sounds/ChickenDefenseSounds/nuke4.wav differ diff --git a/sounds/ChickenDefenseSounds/rangechickenhit.wav b/sounds/ChickenDefenseSounds/rangechickenhit.wav new file mode 100644 index 000000000..79bb2b20d Binary files /dev/null and b/sounds/ChickenDefenseSounds/rangechickenhit.wav differ diff --git a/sounds/ChickenDefenseSounds/rangechickenroar.wav b/sounds/ChickenDefenseSounds/rangechickenroar.wav new file mode 100644 index 000000000..c016f6d83 Binary files /dev/null and b/sounds/ChickenDefenseSounds/rangechickenroar.wav differ diff --git a/sounds/ChickenDefenseSounds/roostdie.wav b/sounds/ChickenDefenseSounds/roostdie.wav new file mode 100644 index 000000000..77957b057 Binary files /dev/null and b/sounds/ChickenDefenseSounds/roostdie.wav differ diff --git a/sounds/ChickenDefenseSounds/smallchickenattack.wav b/sounds/ChickenDefenseSounds/smallchickenattack.wav new file mode 100644 index 000000000..7a3086cff Binary files /dev/null and b/sounds/ChickenDefenseSounds/smallchickenattack.wav differ diff --git a/sounds/ChickenDefenseSounds/smallchickendead.wav b/sounds/ChickenDefenseSounds/smallchickendead.wav new file mode 100644 index 000000000..f4172de59 Binary files /dev/null and b/sounds/ChickenDefenseSounds/smallchickendead.wav differ diff --git a/sounds/ChickenDefenseSounds/talonattack.wav b/sounds/ChickenDefenseSounds/talonattack.wav new file mode 100644 index 000000000..1037e6dc1 Binary files /dev/null and b/sounds/ChickenDefenseSounds/talonattack.wav differ diff --git a/sounds/ChickenDefenseSounds/talondie.wav b/sounds/ChickenDefenseSounds/talondie.wav new file mode 100644 index 000000000..80e927474 Binary files /dev/null and b/sounds/ChickenDefenseSounds/talondie.wav differ diff --git a/sounds/acknowledgements/dothis.wav b/sounds/acknowledgements/dothis.wav new file mode 100644 index 000000000..e2ac0f66a Binary files /dev/null and b/sounds/acknowledgements/dothis.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Death 1.wav b/sounds/deathsounds/bug/Huge monster Death 1.wav new file mode 100644 index 000000000..6dfcb4a9b Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Death 1.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Death 2.wav b/sounds/deathsounds/bug/Huge monster Death 2.wav new file mode 100644 index 000000000..a0b2d6797 Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Death 2.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 1.wav b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 1.wav new file mode 100644 index 000000000..9f28afec5 Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 1.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 2.wav b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 2.wav new file mode 100644 index 000000000..fde421881 Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 2.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 3.wav b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 3.wav new file mode 100644 index 000000000..2eba3c5ea Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 3.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 4.wav b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 4.wav new file mode 100644 index 000000000..d2a131537 Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 4.wav differ diff --git a/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 5.wav b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 5.wav new file mode 100644 index 000000000..087f97da0 Binary files /dev/null and b/sounds/deathsounds/bug/Huge monster Grunt (Gets hit) 5.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Death 1.wav b/sounds/deathsounds/bug/Medium monster Death 1.wav new file mode 100644 index 000000000..e7b0a019e Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Death 1.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Death 2.wav b/sounds/deathsounds/bug/Medium monster Death 2.wav new file mode 100644 index 000000000..454f18be6 Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Death 2.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 1.wav b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 1.wav new file mode 100644 index 000000000..73b9cfd5b Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 1.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 2.wav b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 2.wav new file mode 100644 index 000000000..8f8c1727d Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 2.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 3.wav b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 3.wav new file mode 100644 index 000000000..05c520bea Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 3.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 4.wav b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 4.wav new file mode 100644 index 000000000..e32629e6b Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 4.wav differ diff --git a/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 5.wav b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 5.wav new file mode 100644 index 000000000..d7e9dc964 Binary files /dev/null and b/sounds/deathsounds/bug/Medium monster Grunt (Gets hit) 5.wav differ diff --git a/sounds/deathsounds/bug/Small monster Death 1.wav b/sounds/deathsounds/bug/Small monster Death 1.wav new file mode 100644 index 000000000..91d8b8307 Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Death 1.wav differ diff --git a/sounds/deathsounds/bug/Small monster Death 2.wav b/sounds/deathsounds/bug/Small monster Death 2.wav new file mode 100644 index 000000000..c895b305e Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Death 2.wav differ diff --git a/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 1.wav b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 1.wav new file mode 100644 index 000000000..9bb7088f1 Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 1.wav differ diff --git a/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 2.wav b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 2.wav new file mode 100644 index 000000000..3e05c4bfa Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 2.wav differ diff --git a/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 3.wav b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 3.wav new file mode 100644 index 000000000..79745d353 Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 3.wav differ diff --git a/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 4.wav b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 4.wav new file mode 100644 index 000000000..bd8e18236 Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 4.wav differ diff --git a/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 5.wav b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 5.wav new file mode 100644 index 000000000..fa575ca1b Binary files /dev/null and b/sounds/deathsounds/bug/Small monster Grunt (Gets hit) 5.wav differ diff --git a/sounds/deathsounds/bug/bugdie-12.wav b/sounds/deathsounds/bug/bugdie-12.wav new file mode 100644 index 000000000..a100d7957 Binary files /dev/null and b/sounds/deathsounds/bug/bugdie-12.wav differ diff --git a/sounds/deathsounds/bug/bugdie.wav b/sounds/deathsounds/bug/bugdie.wav new file mode 100644 index 000000000..f7695c1e3 Binary files /dev/null and b/sounds/deathsounds/bug/bugdie.wav differ diff --git a/sounds/deathsounds/bug/bugdie12.wav b/sounds/deathsounds/bug/bugdie12.wav new file mode 100644 index 000000000..750bf94f3 Binary files /dev/null and b/sounds/deathsounds/bug/bugdie12.wav differ diff --git a/sounds/deathsounds/bug/large monster Death 1.wav b/sounds/deathsounds/bug/large monster Death 1.wav new file mode 100644 index 000000000..0bffbb517 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Death 1.wav differ diff --git a/sounds/deathsounds/bug/large monster Death 2.wav b/sounds/deathsounds/bug/large monster Death 2.wav new file mode 100644 index 000000000..9a69fdf42 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Death 2.wav differ diff --git a/sounds/deathsounds/bug/large monster Grunt (Gets hit) 1.wav b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 1.wav new file mode 100644 index 000000000..3bebfcb51 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 1.wav differ diff --git a/sounds/deathsounds/bug/large monster Grunt (Gets hit) 2.wav b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 2.wav new file mode 100644 index 000000000..4d2f80d46 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 2.wav differ diff --git a/sounds/deathsounds/bug/large monster Grunt (Gets hit) 3.wav b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 3.wav new file mode 100644 index 000000000..918ece451 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 3.wav differ diff --git a/sounds/deathsounds/bug/large monster Grunt (Gets hit) 4.wav b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 4.wav new file mode 100644 index 000000000..3a35c9750 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 4.wav differ diff --git a/sounds/deathsounds/bug/large monster Grunt (Gets hit) 5.wav b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 5.wav new file mode 100644 index 000000000..a5c13e051 Binary files /dev/null and b/sounds/deathsounds/bug/large monster Grunt (Gets hit) 5.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 1.wav b/sounds/deathsounds/bugqueen/DEATH 1.wav new file mode 100644 index 000000000..d533a9c3b Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 1.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 10.wav b/sounds/deathsounds/bugqueen/DEATH 10.wav new file mode 100644 index 000000000..35b0a683c Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 10.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 2.wav b/sounds/deathsounds/bugqueen/DEATH 2.wav new file mode 100644 index 000000000..6794993c9 Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 2.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 3.wav b/sounds/deathsounds/bugqueen/DEATH 3.wav new file mode 100644 index 000000000..9b7911547 Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 3.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 4.wav b/sounds/deathsounds/bugqueen/DEATH 4.wav new file mode 100644 index 000000000..5eee4fd92 Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 4.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 5.wav b/sounds/deathsounds/bugqueen/DEATH 5.wav new file mode 100644 index 000000000..450c67e4d Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 5.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 6.wav b/sounds/deathsounds/bugqueen/DEATH 6.wav new file mode 100644 index 000000000..15a8f108a Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 6.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 7.wav b/sounds/deathsounds/bugqueen/DEATH 7.wav new file mode 100644 index 000000000..8fe5e5944 Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 7.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 8.wav b/sounds/deathsounds/bugqueen/DEATH 8.wav new file mode 100644 index 000000000..676977bbd Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 8.wav differ diff --git a/sounds/deathsounds/bugqueen/DEATH 9.wav b/sounds/deathsounds/bugqueen/DEATH 9.wav new file mode 100644 index 000000000..366d9ca5b Binary files /dev/null and b/sounds/deathsounds/bugqueen/DEATH 9.wav differ diff --git a/sounds/deathsounds/generic/Explosion Barrel_01.wav b/sounds/deathsounds/generic/Explosion Barrel_01.wav new file mode 100644 index 000000000..f0500f521 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Barrel_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion C4_01.wav b/sounds/deathsounds/generic/Explosion C4_01.wav new file mode 100644 index 000000000..a9665b159 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion C4_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion C4_02.wav b/sounds/deathsounds/generic/Explosion C4_02.wav new file mode 100644 index 000000000..3d7899ca6 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion C4_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Car_01.wav b/sounds/deathsounds/generic/Explosion Car_01.wav new file mode 100644 index 000000000..23fffc0e4 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Car_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Car_02.wav b/sounds/deathsounds/generic/Explosion Car_02.wav new file mode 100644 index 000000000..c88996a86 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Car_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Car_03.wav b/sounds/deathsounds/generic/Explosion Car_03.wav new file mode 100644 index 000000000..aff4750bb Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Car_03.wav differ diff --git a/sounds/deathsounds/generic/Explosion Car_04.wav b/sounds/deathsounds/generic/Explosion Car_04.wav new file mode 100644 index 000000000..160154cf8 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Car_04.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_01.wav b/sounds/deathsounds/generic/Explosion Classic_01.wav new file mode 100644 index 000000000..ae54a53fe Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_02.wav b/sounds/deathsounds/generic/Explosion Classic_02.wav new file mode 100644 index 000000000..e1c2299ad Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_03.wav b/sounds/deathsounds/generic/Explosion Classic_03.wav new file mode 100644 index 000000000..e42340694 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_03.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_04.wav b/sounds/deathsounds/generic/Explosion Classic_04.wav new file mode 100644 index 000000000..072936a33 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_04.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_05.wav b/sounds/deathsounds/generic/Explosion Classic_05.wav new file mode 100644 index 000000000..48565804b Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_05.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_06.wav b/sounds/deathsounds/generic/Explosion Classic_06.wav new file mode 100644 index 000000000..ce3d61149 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_06.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_07.wav b/sounds/deathsounds/generic/Explosion Classic_07.wav new file mode 100644 index 000000000..526a06686 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_07.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_08.wav b/sounds/deathsounds/generic/Explosion Classic_08.wav new file mode 100644 index 000000000..d1047cd14 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_08.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_09.wav b/sounds/deathsounds/generic/Explosion Classic_09.wav new file mode 100644 index 000000000..34919088d Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_09.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_10.wav b/sounds/deathsounds/generic/Explosion Classic_10.wav new file mode 100644 index 000000000..120d19481 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_10.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_11.wav b/sounds/deathsounds/generic/Explosion Classic_11.wav new file mode 100644 index 000000000..e81e9e338 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_11.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_12.wav b/sounds/deathsounds/generic/Explosion Classic_12.wav new file mode 100644 index 000000000..4dbdff109 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_12.wav differ diff --git a/sounds/deathsounds/generic/Explosion Classic_13.wav b/sounds/deathsounds/generic/Explosion Classic_13.wav new file mode 100644 index 000000000..5c892f077 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Classic_13.wav differ diff --git a/sounds/deathsounds/generic/Explosion Fireworks_01.wav b/sounds/deathsounds/generic/Explosion Fireworks_01.wav new file mode 100644 index 000000000..25d275c02 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Fireworks_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Fireworks_02.wav b/sounds/deathsounds/generic/Explosion Fireworks_02.wav new file mode 100644 index 000000000..5064a497e Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Fireworks_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_01.wav b/sounds/deathsounds/generic/Explosion Flesh_01.wav new file mode 100644 index 000000000..a898e68b2 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_02.wav b/sounds/deathsounds/generic/Explosion Flesh_02.wav new file mode 100644 index 000000000..456451911 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_03.wav b/sounds/deathsounds/generic/Explosion Flesh_03.wav new file mode 100644 index 000000000..7e57f7834 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_03.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_04.wav b/sounds/deathsounds/generic/Explosion Flesh_04.wav new file mode 100644 index 000000000..eccb5b331 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_04.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_05.wav b/sounds/deathsounds/generic/Explosion Flesh_05.wav new file mode 100644 index 000000000..3bf89b3d0 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_05.wav differ diff --git a/sounds/deathsounds/generic/Explosion Flesh_06.wav b/sounds/deathsounds/generic/Explosion Flesh_06.wav new file mode 100644 index 000000000..39d338daa Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Flesh_06.wav differ diff --git a/sounds/deathsounds/generic/Explosion Gas_01.wav b/sounds/deathsounds/generic/Explosion Gas_01.wav new file mode 100644 index 000000000..503c4c6c9 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Gas_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Gas_02.wav b/sounds/deathsounds/generic/Explosion Gas_02.wav new file mode 100644 index 000000000..54e61d506 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Gas_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Glass_01.wav b/sounds/deathsounds/generic/Explosion Glass_01.wav new file mode 100644 index 000000000..294297713 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Glass_01.wav differ diff --git a/sounds/deathsounds/generic/Explosion Glass_02.wav b/sounds/deathsounds/generic/Explosion Glass_02.wav new file mode 100644 index 000000000..d5dcf11c6 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Glass_02.wav differ diff --git a/sounds/deathsounds/generic/Explosion Glass_03.wav b/sounds/deathsounds/generic/Explosion Glass_03.wav new file mode 100644 index 000000000..fbd984a86 Binary files /dev/null and b/sounds/deathsounds/generic/Explosion Glass_03.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_01.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_01.wav new file mode 100644 index 000000000..9779c5a92 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_01.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_02.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_02.wav new file mode 100644 index 000000000..75d9d79c0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_02.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_03.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_03.wav new file mode 100644 index 000000000..93b4af5bb Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_03.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_04.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_04.wav new file mode 100644 index 000000000..4a32d746b Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_04.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_05.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_05.wav new file mode 100644 index 000000000..f6c2b151f Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_05.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_06.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_06.wav new file mode 100644 index 000000000..1bb9ee1de Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_06.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_07.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_07.wav new file mode 100644 index 000000000..f463ac490 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_07.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_08.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_08.wav new file mode 100644 index 000000000..0a8be7f51 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_08.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_09.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_09.wav new file mode 100644 index 000000000..a467d8c1d Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_09.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_10.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_10.wav new file mode 100644 index 000000000..b6c0afb42 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_10.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_11.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_11.wav new file mode 100644 index 000000000..b88b82179 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_11.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_12.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_12.wav new file mode 100644 index 000000000..ca1597ce0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_12.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_13.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_13.wav new file mode 100644 index 000000000..fd09f3ad8 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_13.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_14.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_14.wav new file mode 100644 index 000000000..85c9d6248 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_14.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_15.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_15.wav new file mode 100644 index 000000000..537451e78 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_15.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_16.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_16.wav new file mode 100644 index 000000000..1611a1fb3 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_16.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_17.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_17.wav new file mode 100644 index 000000000..fb873b229 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_17.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_18.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_18.wav new file mode 100644 index 000000000..e8d8860ad Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_18.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_19.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_19.wav new file mode 100644 index 000000000..7a73a9280 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_19.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_20.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_20.wav new file mode 100644 index 000000000..03db3df8d Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_20.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_21.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_21.wav new file mode 100644 index 000000000..b828126bf Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_21.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_22.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_22.wav new file mode 100644 index 000000000..cde9c2088 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_22.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_23.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_23.wav new file mode 100644 index 000000000..0bae15651 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_23.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_24.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_24.wav new file mode 100644 index 000000000..44d02bfce Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_24.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_25.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_25.wav new file mode 100644 index 000000000..08605716d Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_25.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_26.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_26.wav new file mode 100644 index 000000000..8441a5c6a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_26.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_27.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_27.wav new file mode 100644 index 000000000..ce386ba20 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_27.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_28.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_28.wav new file mode 100644 index 000000000..41b870f01 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_CloseExplosion_28.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_01.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_01.wav new file mode 100644 index 000000000..ee2b144e4 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_01.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_02.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_02.wav new file mode 100644 index 000000000..52d996d66 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_02.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_03.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_03.wav new file mode 100644 index 000000000..9d9ef7661 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_03.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_04.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_04.wav new file mode 100644 index 000000000..18e808e18 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_04.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_05.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_05.wav new file mode 100644 index 000000000..3c7296219 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_05.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_06.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_06.wav new file mode 100644 index 000000000..aebfeba9a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_06.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_07.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_07.wav new file mode 100644 index 000000000..0a6011455 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_07.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_08.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_08.wav new file mode 100644 index 000000000..46028dcdf Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_08.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_09.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_09.wav new file mode 100644 index 000000000..e77c108c2 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_09.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_10.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_10.wav new file mode 100644 index 000000000..4d6d8a762 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_10.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_11.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_11.wav new file mode 100644 index 000000000..ba177ae38 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_11.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_12.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_12.wav new file mode 100644 index 000000000..726bdba0a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_12.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_13.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_13.wav new file mode 100644 index 000000000..91ab5add9 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_13.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_14.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_14.wav new file mode 100644 index 000000000..6b2896d98 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_14.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_15.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_15.wav new file mode 100644 index 000000000..172d27c0a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_15.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_16.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_16.wav new file mode 100644 index 000000000..6adfb121d Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_16.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_17.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_17.wav new file mode 100644 index 000000000..29ce9b40e Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_17.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_18.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_18.wav new file mode 100644 index 000000000..e4d405ed0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_18.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_19.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_19.wav new file mode 100644 index 000000000..994ffb867 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_19.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_20.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_20.wav new file mode 100644 index 000000000..044fc9742 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_20.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_21.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_21.wav new file mode 100644 index 000000000..6838ba8ed Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_21.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_22.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_22.wav new file mode 100644 index 000000000..9b65c25a0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_22.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_23.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_23.wav new file mode 100644 index 000000000..4f4da3a92 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_23.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_24.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_24.wav new file mode 100644 index 000000000..6f19d169f Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_24.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_25.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_25.wav new file mode 100644 index 000000000..4c4d92fbf Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_25.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_26.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_26.wav new file mode 100644 index 000000000..a6c6f008a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_26.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_27.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_27.wav new file mode 100644 index 000000000..a6933c493 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_27.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_28.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_28.wav new file mode 100644 index 000000000..50b59fd48 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_DistantExplosion_28.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_01.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_01.wav new file mode 100644 index 000000000..4f7fa33ec Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_01.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_02.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_02.wav new file mode 100644 index 000000000..45970742c Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_02.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_03.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_03.wav new file mode 100644 index 000000000..6c50e1ae4 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_03.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_04.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_04.wav new file mode 100644 index 000000000..ec74f6965 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_04.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_05.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_05.wav new file mode 100644 index 000000000..4209819d3 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_05.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_06.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_06.wav new file mode 100644 index 000000000..8ffc4da51 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_06.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_07.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_07.wav new file mode 100644 index 000000000..25095ea77 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_07.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_08.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_08.wav new file mode 100644 index 000000000..fa2d416fd Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_08.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_09.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_09.wav new file mode 100644 index 000000000..a17863862 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_09.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_10.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_10.wav new file mode 100644 index 000000000..ba07c608a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_10.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_11.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_11.wav new file mode 100644 index 000000000..107a5fc1c Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_11.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_12.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_12.wav new file mode 100644 index 000000000..f00d12d26 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_12.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_13.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_13.wav new file mode 100644 index 000000000..6e7125935 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_13.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_14.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_14.wav new file mode 100644 index 000000000..485892f11 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_14.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_15.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_15.wav new file mode 100644 index 000000000..5a0ba3927 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_15.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_16.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_16.wav new file mode 100644 index 000000000..d7b2036cb Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_16.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_17.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_17.wav new file mode 100644 index 000000000..4e39c89b0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_17.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_18.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_18.wav new file mode 100644 index 000000000..8050d98a0 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_18.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_19.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_19.wav new file mode 100644 index 000000000..15bcb0a31 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_19.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_20.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_20.wav new file mode 100644 index 000000000..3d0a8de19 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_20.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_21.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_21.wav new file mode 100644 index 000000000..449709519 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_21.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_22.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_22.wav new file mode 100644 index 000000000..a7af8923c Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_22.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_23.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_23.wav new file mode 100644 index 000000000..406fd101e Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_23.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_24.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_24.wav new file mode 100644 index 000000000..fb9887c40 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_24.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_25.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_25.wav new file mode 100644 index 000000000..7a98b901a Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_25.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_26.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_26.wav new file mode 100644 index 000000000..b0fb9f493 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_26.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_27.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_27.wav new file mode 100644 index 000000000..1127a3ce4 Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_27.wav differ diff --git a/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_28.wav b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_28.wav new file mode 100644 index 000000000..76898400b Binary files /dev/null and b/sounds/deathsounds/generic/TomWinandySFX_Explosions Volume I_MediumExplosion_28.wav differ diff --git a/sounds/deathsounds/generic/e13.wav b/sounds/deathsounds/generic/e13.wav index a4471b81f..0e6470a17 100644 Binary files a/sounds/deathsounds/generic/e13.wav and b/sounds/deathsounds/generic/e13.wav differ diff --git a/sounds/deathsounds/generic/explo1.wav b/sounds/deathsounds/generic/explo1.wav new file mode 100644 index 000000000..28f43ef99 Binary files /dev/null and b/sounds/deathsounds/generic/explo1.wav differ diff --git a/sounds/deathsounds/generic/explo10.wav b/sounds/deathsounds/generic/explo10.wav new file mode 100644 index 000000000..d5c608fcf Binary files /dev/null and b/sounds/deathsounds/generic/explo10.wav differ diff --git a/sounds/deathsounds/generic/explo11.wav b/sounds/deathsounds/generic/explo11.wav new file mode 100644 index 000000000..cb3225743 Binary files /dev/null and b/sounds/deathsounds/generic/explo11.wav differ diff --git a/sounds/deathsounds/generic/explo12.wav b/sounds/deathsounds/generic/explo12.wav new file mode 100644 index 000000000..ca91a7798 Binary files /dev/null and b/sounds/deathsounds/generic/explo12.wav differ diff --git a/sounds/deathsounds/generic/explo13.wav b/sounds/deathsounds/generic/explo13.wav new file mode 100644 index 000000000..4d8a9ed42 Binary files /dev/null and b/sounds/deathsounds/generic/explo13.wav differ diff --git a/sounds/deathsounds/generic/explo14.wav b/sounds/deathsounds/generic/explo14.wav new file mode 100644 index 000000000..c1a401f7d Binary files /dev/null and b/sounds/deathsounds/generic/explo14.wav differ diff --git a/sounds/deathsounds/generic/explo15.wav b/sounds/deathsounds/generic/explo15.wav new file mode 100644 index 000000000..a5e1cf39f Binary files /dev/null and b/sounds/deathsounds/generic/explo15.wav differ diff --git a/sounds/deathsounds/generic/explo16.wav b/sounds/deathsounds/generic/explo16.wav new file mode 100644 index 000000000..984c92f79 Binary files /dev/null and b/sounds/deathsounds/generic/explo16.wav differ diff --git a/sounds/deathsounds/generic/explo17.wav b/sounds/deathsounds/generic/explo17.wav new file mode 100644 index 000000000..69035df62 Binary files /dev/null and b/sounds/deathsounds/generic/explo17.wav differ diff --git a/sounds/deathsounds/generic/explo18.wav b/sounds/deathsounds/generic/explo18.wav new file mode 100644 index 000000000..e814dce36 Binary files /dev/null and b/sounds/deathsounds/generic/explo18.wav differ diff --git a/sounds/deathsounds/generic/explo19.wav b/sounds/deathsounds/generic/explo19.wav new file mode 100644 index 000000000..9378c0b29 Binary files /dev/null and b/sounds/deathsounds/generic/explo19.wav differ diff --git a/sounds/deathsounds/generic/explo2.wav b/sounds/deathsounds/generic/explo2.wav new file mode 100644 index 000000000..9ff0b7d09 Binary files /dev/null and b/sounds/deathsounds/generic/explo2.wav differ diff --git a/sounds/deathsounds/generic/explo20.wav b/sounds/deathsounds/generic/explo20.wav new file mode 100644 index 000000000..ffbc42ba5 Binary files /dev/null and b/sounds/deathsounds/generic/explo20.wav differ diff --git a/sounds/deathsounds/generic/explo21.wav b/sounds/deathsounds/generic/explo21.wav new file mode 100644 index 000000000..3d6339a27 Binary files /dev/null and b/sounds/deathsounds/generic/explo21.wav differ diff --git a/sounds/deathsounds/generic/explo22.wav b/sounds/deathsounds/generic/explo22.wav new file mode 100644 index 000000000..6ebfe8fea Binary files /dev/null and b/sounds/deathsounds/generic/explo22.wav differ diff --git a/sounds/deathsounds/generic/explo23.wav b/sounds/deathsounds/generic/explo23.wav new file mode 100644 index 000000000..c2c32aa5c Binary files /dev/null and b/sounds/deathsounds/generic/explo23.wav differ diff --git a/sounds/deathsounds/generic/explo24.wav b/sounds/deathsounds/generic/explo24.wav new file mode 100644 index 000000000..dbe38ef74 Binary files /dev/null and b/sounds/deathsounds/generic/explo24.wav differ diff --git a/sounds/deathsounds/generic/explo25.wav b/sounds/deathsounds/generic/explo25.wav new file mode 100644 index 000000000..0b83a5290 Binary files /dev/null and b/sounds/deathsounds/generic/explo25.wav differ diff --git a/sounds/deathsounds/generic/explo26.wav b/sounds/deathsounds/generic/explo26.wav new file mode 100644 index 000000000..54b287c84 Binary files /dev/null and b/sounds/deathsounds/generic/explo26.wav differ diff --git a/sounds/deathsounds/generic/explo27.wav b/sounds/deathsounds/generic/explo27.wav new file mode 100644 index 000000000..63c1e5e5a Binary files /dev/null and b/sounds/deathsounds/generic/explo27.wav differ diff --git a/sounds/deathsounds/generic/explo28.wav b/sounds/deathsounds/generic/explo28.wav new file mode 100644 index 000000000..8a16578f2 Binary files /dev/null and b/sounds/deathsounds/generic/explo28.wav differ diff --git a/sounds/deathsounds/generic/explo29.wav b/sounds/deathsounds/generic/explo29.wav new file mode 100644 index 000000000..c59f8e0a7 Binary files /dev/null and b/sounds/deathsounds/generic/explo29.wav differ diff --git a/sounds/deathsounds/generic/explo3.wav b/sounds/deathsounds/generic/explo3.wav new file mode 100644 index 000000000..bbebc3998 Binary files /dev/null and b/sounds/deathsounds/generic/explo3.wav differ diff --git a/sounds/deathsounds/generic/explo30.wav b/sounds/deathsounds/generic/explo30.wav new file mode 100644 index 000000000..8591457d4 Binary files /dev/null and b/sounds/deathsounds/generic/explo30.wav differ diff --git a/sounds/deathsounds/generic/explo4.wav b/sounds/deathsounds/generic/explo4.wav new file mode 100644 index 000000000..0bf55dd7c Binary files /dev/null and b/sounds/deathsounds/generic/explo4.wav differ diff --git a/sounds/deathsounds/generic/explo5.wav b/sounds/deathsounds/generic/explo5.wav new file mode 100644 index 000000000..8a18ad0d8 Binary files /dev/null and b/sounds/deathsounds/generic/explo5.wav differ diff --git a/sounds/deathsounds/generic/explo6.wav b/sounds/deathsounds/generic/explo6.wav new file mode 100644 index 000000000..d2a3134f0 Binary files /dev/null and b/sounds/deathsounds/generic/explo6.wav differ diff --git a/sounds/deathsounds/generic/explo7.wav b/sounds/deathsounds/generic/explo7.wav new file mode 100644 index 000000000..3546c72a1 Binary files /dev/null and b/sounds/deathsounds/generic/explo7.wav differ diff --git a/sounds/deathsounds/generic/explo8.wav b/sounds/deathsounds/generic/explo8.wav new file mode 100644 index 000000000..ca87db12a Binary files /dev/null and b/sounds/deathsounds/generic/explo8.wav differ diff --git a/sounds/deathsounds/generic/explo9.wav b/sounds/deathsounds/generic/explo9.wav new file mode 100644 index 000000000..6bf5df6b5 Binary files /dev/null and b/sounds/deathsounds/generic/explo9.wav differ diff --git a/sounds/deathsounds/nuke/nukeexplo1.wav b/sounds/deathsounds/nuke/nukeexplo1.wav new file mode 100644 index 000000000..3761e860f Binary files /dev/null and b/sounds/deathsounds/nuke/nukeexplo1.wav differ diff --git a/sounds/42024_digifishmusic_Missile_Strike.wav b/sounds/explosions/42024_digifishmusic_Missile_Strike.wav similarity index 100% rename from sounds/42024_digifishmusic_Missile_Strike.wav rename to sounds/explosions/42024_digifishmusic_Missile_Strike.wav diff --git a/sounds/amphibartyshothit.wav b/sounds/explosions/amphibartyshothit.wav similarity index 100% rename from sounds/amphibartyshothit.wav rename to sounds/explosions/amphibartyshothit.wav diff --git a/sounds/artyhit.wav b/sounds/explosions/artyhit.wav similarity index 100% rename from sounds/artyhit.wav rename to sounds/explosions/artyhit.wav diff --git a/sounds/assaultshothit.wav b/sounds/explosions/assaultshothit.wav similarity index 100% rename from sounds/assaultshothit.wav rename to sounds/explosions/assaultshothit.wav diff --git a/sounds/bombhit.wav b/sounds/explosions/bombhit.wav similarity index 100% rename from sounds/bombhit.wav rename to sounds/explosions/bombhit.wav diff --git a/sounds/emp.wav b/sounds/explosions/emp.wav similarity index 100% rename from sounds/emp.wav rename to sounds/explosions/emp.wav diff --git a/sounds/eturrethit.wav b/sounds/explosions/eturrethit.wav similarity index 100% rename from sounds/eturrethit.wav rename to sounds/explosions/eturrethit.wav diff --git a/sounds/explode1.wav b/sounds/explosions/explode1.wav similarity index 100% rename from sounds/explode1.wav rename to sounds/explosions/explode1.wav diff --git a/sounds/explode2.wav b/sounds/explosions/explode2.wav similarity index 100% rename from sounds/explode2.wav rename to sounds/explosions/explode2.wav diff --git a/sounds/explode3.wav b/sounds/explosions/explode3.wav similarity index 100% rename from sounds/explode3.wav rename to sounds/explosions/explode3.wav diff --git a/sounds/explode4.wav b/sounds/explosions/explode4.wav similarity index 100% rename from sounds/explode4.wav rename to sounds/explosions/explode4.wav diff --git a/sounds/explode5.wav b/sounds/explosions/explode5.wav similarity index 100% rename from sounds/explode5.wav rename to sounds/explosions/explode5.wav diff --git a/sounds/explode_large.wav b/sounds/explosions/explode_large.wav similarity index 100% rename from sounds/explode_large.wav rename to sounds/explosions/explode_large.wav diff --git a/sounds/explosion_enormous.wav b/sounds/explosions/explosion_enormous.wav similarity index 100% rename from sounds/explosion_enormous.wav rename to sounds/explosions/explosion_enormous.wav diff --git a/sounds/lrpchit.wav b/sounds/explosions/lrpchit.wav similarity index 100% rename from sounds/lrpchit.wav rename to sounds/explosions/lrpchit.wav diff --git a/sounds/mediumcannonhit.wav b/sounds/explosions/mediumcannonhit.wav similarity index 100% rename from sounds/mediumcannonhit.wav rename to sounds/explosions/mediumcannonhit.wav diff --git a/sounds/minedetonation.wav b/sounds/explosions/minedetonation.wav similarity index 100% rename from sounds/minedetonation.wav rename to sounds/explosions/minedetonation.wav diff --git a/sounds/nukeartyhit.wav b/sounds/explosions/nukeartyhit.wav similarity index 100% rename from sounds/nukeartyhit.wav rename to sounds/explosions/nukeartyhit.wav diff --git a/sounds/phasegun1hit.wav b/sounds/explosions/phasegun1hit.wav similarity index 100% rename from sounds/phasegun1hit.wav rename to sounds/explosions/phasegun1hit.wav diff --git a/sounds/explosions/subhitbomb.wav b/sounds/explosions/subhitbomb.wav new file mode 100644 index 000000000..77cfda305 Binary files /dev/null and b/sounds/explosions/subhitbomb.wav differ diff --git a/sounds/unitexplodebig.wav b/sounds/explosions/unitexplodebig.wav similarity index 100% rename from sounds/unitexplodebig.wav rename to sounds/explosions/unitexplodebig.wav diff --git a/sounds/unitexplodemedium.WAV b/sounds/explosions/unitexplodemedium.WAV similarity index 100% rename from sounds/unitexplodemedium.WAV rename to sounds/explosions/unitexplodemedium.WAV diff --git a/sounds/unitexplodesmall.WAV b/sounds/explosions/unitexplodesmall.WAV similarity index 100% rename from sounds/unitexplodesmall.WAV rename to sounds/explosions/unitexplodesmall.WAV diff --git a/sounds/laserbeam02.wav b/sounds/laserbeam02.wav deleted file mode 100644 index 6fa66302e..000000000 Binary files a/sounds/laserbeam02.wav and /dev/null differ diff --git a/sounds/GDEnergy.wav b/sounds/miscfx/GDEnergy.wav similarity index 100% rename from sounds/GDEnergy.wav rename to sounds/miscfx/GDEnergy.wav diff --git a/sounds/GDFactoryselect.wav b/sounds/miscfx/GDFactoryselect.wav similarity index 100% rename from sounds/GDFactoryselect.wav rename to sounds/miscfx/GDFactoryselect.wav diff --git a/sounds/GDmex.wav b/sounds/miscfx/GDmex.wav similarity index 100% rename from sounds/GDmex.wav rename to sounds/miscfx/GDmex.wav diff --git a/sounds/areaheal.wav b/sounds/miscfx/areaheal.wav similarity index 100% rename from sounds/areaheal.wav rename to sounds/miscfx/areaheal.wav diff --git a/sounds/boxcollection.wav b/sounds/miscfx/boxcollection.wav similarity index 100% rename from sounds/boxcollection.wav rename to sounds/miscfx/boxcollection.wav diff --git a/sounds/miscfx/buildstart-mechanical.wav b/sounds/miscfx/buildstart-mechanical.wav new file mode 100644 index 000000000..af3aa8825 Binary files /dev/null and b/sounds/miscfx/buildstart-mechanical.wav differ diff --git a/sounds/miscfx/buildstart-nano.wav b/sounds/miscfx/buildstart-nano.wav new file mode 100644 index 000000000..f7d26332f Binary files /dev/null and b/sounds/miscfx/buildstart-nano.wav differ diff --git a/sounds/miscfx/buildstart.wav b/sounds/miscfx/buildstart.wav new file mode 100644 index 000000000..33a486f71 Binary files /dev/null and b/sounds/miscfx/buildstart.wav differ diff --git a/sounds/chaching.wav b/sounds/miscfx/chaching.wav similarity index 100% rename from sounds/chaching.wav rename to sounds/miscfx/chaching.wav diff --git a/sounds/cloak.wav b/sounds/miscfx/cloak.wav similarity index 100% rename from sounds/cloak.wav rename to sounds/miscfx/cloak.wav diff --git a/sounds/dronespawner.wav b/sounds/miscfx/energycoredronespawner.wav similarity index 100% rename from sounds/dronespawner.wav rename to sounds/miscfx/energycoredronespawner.wav diff --git a/sounds/heal.wav b/sounds/miscfx/heal.wav similarity index 100% rename from sounds/heal.wav rename to sounds/miscfx/heal.wav diff --git a/sounds/miscfx/nightvision_activated.wav b/sounds/miscfx/nightvision_activated.wav new file mode 100644 index 000000000..b472eb7f8 Binary files /dev/null and b/sounds/miscfx/nightvision_activated.wav differ diff --git a/sounds/miscfx/nightvision_deactivated.wav b/sounds/miscfx/nightvision_deactivated.wav new file mode 100644 index 000000000..731ffc90b Binary files /dev/null and b/sounds/miscfx/nightvision_deactivated.wav differ diff --git a/sounds/reclaimed.wav b/sounds/miscfx/reclaimed.wav similarity index 100% rename from sounds/reclaimed.wav rename to sounds/miscfx/reclaimed.wav diff --git a/sounds/turretselect.wav b/sounds/miscfx/turretselect.wav similarity index 100% rename from sounds/turretselect.wav rename to sounds/miscfx/turretselect.wav diff --git a/sounds/miscfx/unitexplodemedium.WAV b/sounds/miscfx/unitexplodemedium.WAV new file mode 100644 index 000000000..68017c179 Binary files /dev/null and b/sounds/miscfx/unitexplodemedium.WAV differ diff --git a/sounds/miscfx/unitexplodesmall.WAV b/sounds/miscfx/unitexplodesmall.WAV new file mode 100644 index 000000000..f13e9fa77 Binary files /dev/null and b/sounds/miscfx/unitexplodesmall.WAV differ diff --git a/sounds/unitselect.wav b/sounds/miscfx/unitselect.wav similarity index 100% rename from sounds/unitselect.wav rename to sounds/miscfx/unitselect.wav diff --git a/sounds/warning1.wav b/sounds/miscfx/warning1.wav similarity index 100% rename from sounds/warning1.wav rename to sounds/miscfx/warning1.wav diff --git a/sounds/warning2.wav b/sounds/miscfx/warning2.wav similarity index 100% rename from sounds/warning2.wav rename to sounds/miscfx/warning2.wav diff --git a/sounds/nukelaunch.wav b/sounds/nukelaunch.wav deleted file mode 100644 index 25555986b..000000000 Binary files a/sounds/nukelaunch.wav and /dev/null differ diff --git a/sounds/18377_inferno_aarl.wav b/sounds/other/18377_inferno_aarl.wav similarity index 100% rename from sounds/18377_inferno_aarl.wav rename to sounds/other/18377_inferno_aarl.wav diff --git a/sounds/18378_inferno_ftlas.wav b/sounds/other/18378_inferno_ftlas.wav similarity index 100% rename from sounds/18378_inferno_ftlas.wav rename to sounds/other/18378_inferno_ftlas.wav diff --git a/sounds/18380_inferno_hvrl.wav b/sounds/other/18380_inferno_hvrl.wav similarity index 100% rename from sounds/18380_inferno_hvrl.wav rename to sounds/other/18380_inferno_hvrl.wav diff --git a/sounds/18381_inferno_hvyelec.wav b/sounds/other/18381_inferno_hvyelec.wav similarity index 100% rename from sounds/18381_inferno_hvyelec.wav rename to sounds/other/18381_inferno_hvyelec.wav diff --git a/sounds/18382_inferno_hvylas.wav b/sounds/other/18382_inferno_hvylas.wav similarity index 100% rename from sounds/18382_inferno_hvylas.wav rename to sounds/other/18382_inferno_hvylas.wav diff --git a/sounds/18383_inferno_knokart.wav b/sounds/other/18383_inferno_knokart.wav similarity index 100% rename from sounds/18383_inferno_knokart.wav rename to sounds/other/18383_inferno_knokart.wav diff --git a/sounds/18384_inferno_largex.wav b/sounds/other/18384_inferno_largex.wav similarity index 100% rename from sounds/18384_inferno_largex.wav rename to sounds/other/18384_inferno_largex.wav diff --git a/sounds/18385_inferno_laserbeam.wav b/sounds/other/18385_inferno_laserbeam.wav similarity index 100% rename from sounds/18385_inferno_laserbeam.wav rename to sounds/other/18385_inferno_laserbeam.wav diff --git a/sounds/18386_inferno_lightrl.wav b/sounds/other/18386_inferno_lightrl.wav similarity index 100% rename from sounds/18386_inferno_lightrl.wav rename to sounds/other/18386_inferno_lightrl.wav diff --git a/sounds/18387_inferno_lsax.wav b/sounds/other/18387_inferno_lsax.wav similarity index 100% rename from sounds/18387_inferno_lsax.wav rename to sounds/other/18387_inferno_lsax.wav diff --git a/sounds/18388_inferno_mecann.wav b/sounds/other/18388_inferno_mecann.wav similarity index 100% rename from sounds/18388_inferno_mecann.wav rename to sounds/other/18388_inferno_mecann.wav diff --git a/sounds/18390_inferno_plascanh.wav b/sounds/other/18390_inferno_plascanh.wav similarity index 100% rename from sounds/18390_inferno_plascanh.wav rename to sounds/other/18390_inferno_plascanh.wav diff --git a/sounds/18391_inferno_plcan.wav b/sounds/other/18391_inferno_plcan.wav similarity index 100% rename from sounds/18391_inferno_plcan.wav rename to sounds/other/18391_inferno_plcan.wav diff --git a/sounds/18392_inferno_rapidgun.wav b/sounds/other/18392_inferno_rapidgun.wav similarity index 100% rename from sounds/18392_inferno_rapidgun.wav rename to sounds/other/18392_inferno_rapidgun.wav diff --git a/sounds/18394_inferno_rlhvyx.wav b/sounds/other/18394_inferno_rlhvyx.wav similarity index 100% rename from sounds/18394_inferno_rlhvyx.wav rename to sounds/other/18394_inferno_rlhvyx.wav diff --git a/sounds/18396_inferno_slighlas.wav b/sounds/other/18396_inferno_slighlas.wav similarity index 100% rename from sounds/18396_inferno_slighlas.wav rename to sounds/other/18396_inferno_slighlas.wav diff --git a/sounds/18397_inferno_smalllas.wav b/sounds/other/18397_inferno_smalllas.wav similarity index 100% rename from sounds/18397_inferno_smalllas.wav rename to sounds/other/18397_inferno_smalllas.wav diff --git a/sounds/18398_inferno_snplaz.wav b/sounds/other/18398_inferno_snplaz.wav similarity index 100% rename from sounds/18398_inferno_snplaz.wav rename to sounds/other/18398_inferno_snplaz.wav diff --git a/sounds/18399_inferno_stormplas.wav b/sounds/other/18399_inferno_stormplas.wav similarity index 100% rename from sounds/18399_inferno_stormplas.wav rename to sounds/other/18399_inferno_stormplas.wav diff --git a/sounds/18400_inferno_waterxplo.wav b/sounds/other/18400_inferno_waterxplo.wav similarity index 100% rename from sounds/18400_inferno_waterxplo.wav rename to sounds/other/18400_inferno_waterxplo.wav diff --git a/sounds/18401_inferno_xlaz.wav b/sounds/other/18401_inferno_xlaz.wav similarity index 100% rename from sounds/18401_inferno_xlaz.wav rename to sounds/other/18401_inferno_xlaz.wav diff --git a/sounds/18402_inferno_xplo.wav b/sounds/other/18402_inferno_xplo.wav similarity index 100% rename from sounds/18402_inferno_xplo.wav rename to sounds/other/18402_inferno_xplo.wav diff --git a/sounds/18403_inferno_xplosm.wav b/sounds/other/18403_inferno_xplosm.wav similarity index 100% rename from sounds/18403_inferno_xplosm.wav rename to sounds/other/18403_inferno_xplosm.wav diff --git a/sounds/18403_inferno_xplosm2.wav b/sounds/other/18403_inferno_xplosm2.wav similarity index 100% rename from sounds/18403_inferno_xplosm2.wav rename to sounds/other/18403_inferno_xplosm2.wav diff --git a/sounds/36846_EcoDTR_LaserRocket.wav b/sounds/other/36846_EcoDTR_LaserRocket.wav similarity index 100% rename from sounds/36846_EcoDTR_LaserRocket.wav rename to sounds/other/36846_EcoDTR_LaserRocket.wav diff --git a/sounds/other/GDEnergy.wav b/sounds/other/GDEnergy.wav new file mode 100644 index 000000000..b1a6699dd Binary files /dev/null and b/sounds/other/GDEnergy.wav differ diff --git a/sounds/other/GDFactoryselect.wav b/sounds/other/GDFactoryselect.wav new file mode 100644 index 000000000..f6f154721 Binary files /dev/null and b/sounds/other/GDFactoryselect.wav differ diff --git a/sounds/GDRadar.wav b/sounds/other/GDRadar.wav similarity index 100% rename from sounds/GDRadar.wav rename to sounds/other/GDRadar.wav diff --git a/sounds/other/GDmex.wav b/sounds/other/GDmex.wav new file mode 100644 index 000000000..f47a2fbc4 Binary files /dev/null and b/sounds/other/GDmex.wav differ diff --git a/sounds/UnitsUnderattack1.wav b/sounds/other/UnitsUnderattack1.wav similarity index 100% rename from sounds/UnitsUnderattack1.wav rename to sounds/other/UnitsUnderattack1.wav diff --git a/sounds/aatankshot.wav b/sounds/other/aatankshot.wav similarity index 100% rename from sounds/aatankshot.wav rename to sounds/other/aatankshot.wav diff --git a/sounds/aircraft_missile_01.wav b/sounds/other/aircraft_missile_01.wav similarity index 100% rename from sounds/aircraft_missile_01.wav rename to sounds/other/aircraft_missile_01.wav diff --git a/sounds/allterrriotweapon.wav b/sounds/other/allterrriotweapon.wav similarity index 100% rename from sounds/allterrriotweapon.wav rename to sounds/other/allterrriotweapon.wav diff --git a/sounds/allterrsupaweapon.wav b/sounds/other/allterrsupaweapon.wav similarity index 100% rename from sounds/allterrsupaweapon.wav rename to sounds/other/allterrsupaweapon.wav diff --git a/sounds/amphibbuggytankshot.wav b/sounds/other/amphibbuggytankshot.wav similarity index 100% rename from sounds/amphibbuggytankshot.wav rename to sounds/other/amphibbuggytankshot.wav diff --git a/sounds/amphibmedtankshot.wav b/sounds/other/amphibmedtankshot.wav similarity index 100% rename from sounds/amphibmedtankshot.wav rename to sounds/other/amphibmedtankshot.wav diff --git a/sounds/artytankshot.wav b/sounds/other/artytankshot.wav similarity index 100% rename from sounds/artytankshot.wav rename to sounds/other/artytankshot.wav diff --git a/sounds/buildmodeclick1.wav b/sounds/other/buildmodeclick1.wav similarity index 100% rename from sounds/buildmodeclick1.wav rename to sounds/other/buildmodeclick1.wav diff --git a/sounds/buildmodeclick2.wav b/sounds/other/buildmodeclick2.wav similarity index 100% rename from sounds/buildmodeclick2.wav rename to sounds/other/buildmodeclick2.wav diff --git a/sounds/buildmodeclickselect.wav b/sounds/other/buildmodeclickselect.wav similarity index 100% rename from sounds/buildmodeclickselect.wav rename to sounds/other/buildmodeclickselect.wav diff --git a/sounds/cpweaponfire.wav b/sounds/other/cpweaponfire.wav similarity index 100% rename from sounds/cpweaponfire.wav rename to sounds/other/cpweaponfire.wav diff --git a/sounds/cpweaponfiresingle.wav b/sounds/other/cpweaponfiresingle.wav similarity index 100% rename from sounds/cpweaponfiresingle.wav rename to sounds/other/cpweaponfiresingle.wav diff --git a/sounds/other/cruisemissilehit.wav b/sounds/other/cruisemissilehit.wav new file mode 100644 index 000000000..cbb4246d6 Binary files /dev/null and b/sounds/other/cruisemissilehit.wav differ diff --git a/sounds/doomlaser2.wav b/sounds/other/doomlaser2.wav similarity index 100% rename from sounds/doomlaser2.wav rename to sounds/other/doomlaser2.wav diff --git a/sounds/other/dronespawner.wav b/sounds/other/dronespawner.wav new file mode 100644 index 000000000..408671d30 Binary files /dev/null and b/sounds/other/dronespawner.wav differ diff --git a/sounds/other/eallterrassaultbeam.wav b/sounds/other/eallterrassaultbeam.wav new file mode 100644 index 000000000..2a7604a04 Binary files /dev/null and b/sounds/other/eallterrassaultbeam.wav differ diff --git a/sounds/eartillery.wav b/sounds/other/eartillery.wav similarity index 100% rename from sounds/eartillery.wav rename to sounds/other/eartillery.wav diff --git a/sounds/ejerikfire.wav b/sounds/other/ejerikfire.wav similarity index 100% rename from sounds/ejerikfire.wav rename to sounds/other/ejerikfire.wav diff --git a/sounds/ejerikfiresingle.wav b/sounds/other/ejerikfiresingle.wav similarity index 100% rename from sounds/ejerikfiresingle.wav rename to sounds/other/ejerikfiresingle.wav diff --git a/sounds/emediumtankfire.wav b/sounds/other/emediumtankfire.wav similarity index 100% rename from sounds/emediumtankfire.wav rename to sounds/other/emediumtankfire.wav diff --git a/sounds/flakhit.wav b/sounds/other/flakhit.wav similarity index 100% rename from sounds/flakhit.wav rename to sounds/other/flakhit.wav diff --git a/sounds/flamethrower.wav b/sounds/other/flamethrower.wav similarity index 100% rename from sounds/flamethrower.wav rename to sounds/other/flamethrower.wav diff --git a/sounds/heavylasershot.wav b/sounds/other/heavylasershot.wav similarity index 100% rename from sounds/heavylasershot.wav rename to sounds/other/heavylasershot.wav diff --git a/sounds/heavyplasmashot.wav b/sounds/other/heavyplasmashot.wav similarity index 100% rename from sounds/heavyplasmashot.wav rename to sounds/other/heavyplasmashot.wav diff --git a/sounds/heavyshot.wav b/sounds/other/heavyshot.wav similarity index 100% rename from sounds/heavyshot.wav rename to sounds/other/heavyshot.wav diff --git a/sounds/heavyshothit.wav b/sounds/other/heavyshothit.wav similarity index 100% rename from sounds/heavyshothit.wav rename to sounds/other/heavyshothit.wav diff --git a/sounds/interceptorgun.wav b/sounds/other/interceptorgun.wav similarity index 100% rename from sounds/interceptorgun.wav rename to sounds/other/interceptorgun.wav diff --git a/sounds/kloak1.wav b/sounds/other/kloak1.wav similarity index 100% rename from sounds/kloak1.wav rename to sounds/other/kloak1.wav diff --git a/sounds/kloak1un.wav b/sounds/other/kloak1un.wav similarity index 100% rename from sounds/kloak1un.wav rename to sounds/other/kloak1un.wav diff --git a/sounds/kloak2.wav b/sounds/other/kloak2.wav similarity index 100% rename from sounds/kloak2.wav rename to sounds/other/kloak2.wav diff --git a/sounds/kloak2un.wav b/sounds/other/kloak2un.wav similarity index 100% rename from sounds/kloak2un.wav rename to sounds/other/kloak2un.wav diff --git a/sounds/other/largerocketlaunch.wav b/sounds/other/largerocketlaunch.wav new file mode 100644 index 000000000..6baa976b1 Binary files /dev/null and b/sounds/other/largerocketlaunch.wav differ diff --git a/sounds/lazor.wav b/sounds/other/lazor.wav similarity index 100% rename from sounds/lazor.wav rename to sounds/other/lazor.wav diff --git a/sounds/lightinterceptorfire.wav b/sounds/other/lightinterceptorfire.wav similarity index 100% rename from sounds/lightinterceptorfire.wav rename to sounds/other/lightinterceptorfire.wav diff --git a/sounds/lrpcshot.wav b/sounds/other/lrpcshot.wav similarity index 100% rename from sounds/lrpcshot.wav rename to sounds/other/lrpcshot.wav diff --git a/sounds/medassualt_blast.wav b/sounds/other/medassualt_blast.wav similarity index 100% rename from sounds/medassualt_blast.wav rename to sounds/other/medassualt_blast.wav diff --git a/sounds/other/minewhir2.wav b/sounds/other/minewhir2.wav new file mode 100644 index 000000000..b7ffd0e49 Binary files /dev/null and b/sounds/other/minewhir2.wav differ diff --git a/sounds/phasegun1.wav b/sounds/other/phasegun1.wav similarity index 100% rename from sounds/phasegun1.wav rename to sounds/other/phasegun1.wav diff --git a/sounds/phasegun1start.wav b/sounds/other/phasegun1start.wav similarity index 100% rename from sounds/phasegun1start.wav rename to sounds/other/phasegun1start.wav diff --git a/sounds/plasma.wav b/sounds/other/plasma.wav similarity index 100% rename from sounds/plasma.wav rename to sounds/other/plasma.wav diff --git a/sounds/riottankshot.wav b/sounds/other/riottankshot.wav similarity index 100% rename from sounds/riottankshot.wav rename to sounds/other/riottankshot.wav diff --git a/sounds/rocket_launcher.wav b/sounds/other/rocket_launcher.wav similarity index 100% rename from sounds/rocket_launcher.wav rename to sounds/other/rocket_launcher.wav diff --git a/sounds/rocket_launcher2.wav b/sounds/other/rocket_launcher2.wav similarity index 100% rename from sounds/rocket_launcher2.wav rename to sounds/other/rocket_launcher2.wav diff --git a/sounds/other/smallemp.wav b/sounds/other/smallemp.wav new file mode 100644 index 000000000..891a33c11 Binary files /dev/null and b/sounds/other/smallemp.wav differ diff --git a/sounds/softblam.wav b/sounds/other/softblam.wav similarity index 100% rename from sounds/softblam.wav rename to sounds/other/softblam.wav diff --git a/sounds/softblam2.wav b/sounds/other/softblam2.wav similarity index 100% rename from sounds/softblam2.wav rename to sounds/other/softblam2.wav diff --git a/sounds/softblam3.wav b/sounds/other/softblam3.wav similarity index 100% rename from sounds/softblam3.wav rename to sounds/other/softblam3.wav diff --git a/sounds/softblat.wav b/sounds/other/softblat.wav similarity index 100% rename from sounds/softblat.wav rename to sounds/other/softblat.wav diff --git a/sounds/talk.wav b/sounds/other/talk.wav similarity index 100% rename from sounds/talk.wav rename to sounds/other/talk.wav diff --git a/sounds/tmissiletankfire.wav b/sounds/other/tmissiletankfire.wav similarity index 100% rename from sounds/tmissiletankfire.wav rename to sounds/other/tmissiletankfire.wav diff --git a/sounds/tomahawk_missile.wav b/sounds/other/tomahawk_missile.wav similarity index 100% rename from sounds/tomahawk_missile.wav rename to sounds/other/tomahawk_missile.wav diff --git a/sounds/other/turretselect.wav b/sounds/other/turretselect.wav new file mode 100644 index 000000000..6642ce0c4 Binary files /dev/null and b/sounds/other/turretselect.wav differ diff --git a/sounds/count1.wav b/sounds/selfdcountdown/count1.wav similarity index 100% rename from sounds/count1.wav rename to sounds/selfdcountdown/count1.wav diff --git a/sounds/count2.wav b/sounds/selfdcountdown/count2.wav similarity index 100% rename from sounds/count2.wav rename to sounds/selfdcountdown/count2.wav diff --git a/sounds/count3.wav b/sounds/selfdcountdown/count3.wav similarity index 100% rename from sounds/count3.wav rename to sounds/selfdcountdown/count3.wav diff --git a/sounds/count4.wav b/sounds/selfdcountdown/count4.wav similarity index 100% rename from sounds/count4.wav rename to sounds/selfdcountdown/count4.wav diff --git a/sounds/count5.wav b/sounds/selfdcountdown/count5.wav similarity index 100% rename from sounds/count5.wav rename to sounds/selfdcountdown/count5.wav diff --git a/sounds/count6.wav b/sounds/selfdcountdown/count6.wav similarity index 100% rename from sounds/count6.wav rename to sounds/selfdcountdown/count6.wav diff --git a/sounds/ack.wav b/sounds/ui/ack.wav similarity index 100% rename from sounds/ack.wav rename to sounds/ui/ack.wav diff --git a/sounds/ui/additionalgenerators.wav b/sounds/ui/additionalgenerators.wav new file mode 100644 index 000000000..244277814 Binary files /dev/null and b/sounds/ui/additionalgenerators.wav differ diff --git a/sounds/beep4.wav b/sounds/ui/beep4.wav similarity index 100% rename from sounds/beep4.wav rename to sounds/ui/beep4.wav diff --git a/sounds/beep6.wav b/sounds/ui/beep6.wav similarity index 100% rename from sounds/beep6.wav rename to sounds/ui/beep6.wav diff --git a/sounds/button9.wav b/sounds/ui/button9.wav similarity index 100% rename from sounds/button9.wav rename to sounds/ui/button9.wav diff --git a/sounds/cancel2.wav b/sounds/ui/cancel2.wav similarity index 100% rename from sounds/cancel2.wav rename to sounds/ui/cancel2.wav diff --git a/sounds/cantdo4.wav b/sounds/ui/cantdo4.wav similarity index 100% rename from sounds/cantdo4.wav rename to sounds/ui/cantdo4.wav diff --git a/sounds/ui/constructadditionalpylons.wav b/sounds/ui/constructadditionalpylons.wav new file mode 100644 index 000000000..9e7953000 Binary files /dev/null and b/sounds/ui/constructadditionalpylons.wav differ diff --git a/sounds/ui/controlpointscanbecaptured.wav b/sounds/ui/controlpointscanbecaptured.wav new file mode 100644 index 000000000..d52628f4d Binary files /dev/null and b/sounds/ui/controlpointscanbecaptured.wav differ diff --git a/sounds/ui/evolutionfinished.wav b/sounds/ui/evolutionfinished.wav new file mode 100644 index 000000000..1087535a2 Binary files /dev/null and b/sounds/ui/evolutionfinished.wav differ diff --git a/sounds/ui/metalincomeincrease.wav b/sounds/ui/metalincomeincrease.wav new file mode 100644 index 000000000..baf560960 Binary files /dev/null and b/sounds/ui/metalincomeincrease.wav differ diff --git a/sounds/moarpower.wav b/sounds/ui/moarpower.wav similarity index 100% rename from sounds/moarpower.wav rename to sounds/ui/moarpower.wav diff --git a/sounds/ui/useyourmetal.wav b/sounds/ui/useyourmetal.wav new file mode 100644 index 000000000..8062fd0ac Binary files /dev/null and b/sounds/ui/useyourmetal.wav differ diff --git a/sounds/ui/zaal/bugselect.wav b/sounds/ui/zaal/bugselect.wav new file mode 100644 index 000000000..0bb4c86d5 Binary files /dev/null and b/sounds/ui/zaal/bugselect.wav differ diff --git a/sounds/unitselections/amphibselect.wav b/sounds/unitselections/amphibselect.wav new file mode 100644 index 000000000..42aa31a06 Binary files /dev/null and b/sounds/unitselections/amphibselect.wav differ diff --git a/sounds/unitselections/engineidle.wav b/sounds/unitselections/engineidle.wav new file mode 100644 index 000000000..2dedf9ccf Binary files /dev/null and b/sounds/unitselections/engineidle.wav differ diff --git a/sounds/unitselections/enginestart.wav b/sounds/unitselections/enginestart.wav new file mode 100644 index 000000000..c7096928c Binary files /dev/null and b/sounds/unitselections/enginestart.wav differ diff --git a/sounds/voice/scavengers/BotrailcannonDetected.wav b/sounds/voice/scavengers/BotrailcannonDetected.wav new file mode 100644 index 000000000..7280a6c38 Binary files /dev/null and b/sounds/voice/scavengers/BotrailcannonDetected.wav differ diff --git a/sounds/voice/scavengers/DemonDetected.wav b/sounds/voice/scavengers/DemonDetected.wav new file mode 100644 index 000000000..2b0fb97fe Binary files /dev/null and b/sounds/voice/scavengers/DemonDetected.wav differ diff --git a/sounds/voice/scavengers/EpicDragonDetected.wav b/sounds/voice/scavengers/EpicDragonDetected.wav new file mode 100644 index 000000000..518304b9e Binary files /dev/null and b/sounds/voice/scavengers/EpicDragonDetected.wav differ diff --git a/sounds/voice/scavengers/EpicGruntDetected.wav b/sounds/voice/scavengers/EpicGruntDetected.wav new file mode 100644 index 000000000..48f50f2d6 Binary files /dev/null and b/sounds/voice/scavengers/EpicGruntDetected.wav differ diff --git a/sounds/voice/scavengers/EpicPawnDetected.wav b/sounds/voice/scavengers/EpicPawnDetected.wav new file mode 100644 index 000000000..9177aab12 Binary files /dev/null and b/sounds/voice/scavengers/EpicPawnDetected.wav differ diff --git a/sounds/voice/scavengers/EpicTzarDetected.wav b/sounds/voice/scavengers/EpicTzarDetected.wav new file mode 100644 index 000000000..d4e6d4fdd Binary files /dev/null and b/sounds/voice/scavengers/EpicTzarDetected.wav differ diff --git a/sounds/voice/scavengers/RatteDetected.wav b/sounds/voice/scavengers/RatteDetected.wav new file mode 100644 index 000000000..6ecbf8a21 Binary files /dev/null and b/sounds/voice/scavengers/RatteDetected.wav differ diff --git a/sounds/voice/scavengers/SuperKrogDetected.wav b/sounds/voice/scavengers/SuperKrogDetected.wav new file mode 100644 index 000000000..a615f3069 Binary files /dev/null and b/sounds/voice/scavengers/SuperKrogDetected.wav differ diff --git a/sounds/voice/scavengers/SuperKrowDetected.wav b/sounds/voice/scavengers/SuperKrowDetected.wav new file mode 100644 index 000000000..fbc1ad99f Binary files /dev/null and b/sounds/voice/scavengers/SuperKrowDetected.wav differ diff --git a/sounds/voice/scavengers/SuperPeeWeeDetected.wav b/sounds/voice/scavengers/SuperPeeWeeDetected.wav new file mode 100644 index 000000000..3a44c0fd1 Binary files /dev/null and b/sounds/voice/scavengers/SuperPeeWeeDetected.wav differ diff --git a/sounds/voice/scavengers/SuperStumpyDetected.wav b/sounds/voice/scavengers/SuperStumpyDetected.wav new file mode 100644 index 000000000..df9448f29 Binary files /dev/null and b/sounds/voice/scavengers/SuperStumpyDetected.wav differ diff --git a/sounds/voice/scavengers/additionalforcesjoining.wav b/sounds/voice/scavengers/additionalforcesjoining.wav new file mode 100644 index 000000000..ee5e86b2a Binary files /dev/null and b/sounds/voice/scavengers/additionalforcesjoining.wav differ diff --git a/sounds/voice/scavengers/additionalunitsdropping.wav b/sounds/voice/scavengers/additionalunitsdropping.wav new file mode 100644 index 000000000..4a7b100e5 Binary files /dev/null and b/sounds/voice/scavengers/additionalunitsdropping.wav differ diff --git a/sounds/voice/scavengers/classifiedAsScavengers.wav b/sounds/voice/scavengers/classifiedAsScavengers.wav new file mode 100644 index 000000000..5a5bc6f4b Binary files /dev/null and b/sounds/voice/scavengers/classifiedAsScavengers.wav differ diff --git a/sounds/voice/scavengers/droppingUnits.wav b/sounds/voice/scavengers/droppingUnits.wav new file mode 100644 index 000000000..a5e897a81 Binary files /dev/null and b/sounds/voice/scavengers/droppingUnits.wav differ diff --git a/sounds/voice/scavengers/droppodsDetectedInArea.wav b/sounds/voice/scavengers/droppodsDetectedInArea.wav new file mode 100644 index 000000000..05bfb0aba Binary files /dev/null and b/sounds/voice/scavengers/droppodsDetectedInArea.wav differ diff --git a/sounds/voice/scavengers/droppodsDetectedNearby.wav b/sounds/voice/scavengers/droppodsDetectedNearby.wav new file mode 100644 index 000000000..13f42627c Binary files /dev/null and b/sounds/voice/scavengers/droppodsDetectedNearby.wav differ diff --git a/sounds/voice/scavengers/newunitsdropshipped.wav b/sounds/voice/scavengers/newunitsdropshipped.wav new file mode 100644 index 000000000..48896d74e Binary files /dev/null and b/sounds/voice/scavengers/newunitsdropshipped.wav differ diff --git a/sounds/voice/scavengers/reinforcementshavearrived.wav b/sounds/voice/scavengers/reinforcementshavearrived.wav new file mode 100644 index 000000000..8276a92a7 Binary files /dev/null and b/sounds/voice/scavengers/reinforcementshavearrived.wav differ diff --git a/sounds/voice/scavengers/scav-event-airtransport.wav b/sounds/voice/scavengers/scav-event-airtransport.wav new file mode 100644 index 000000000..2b9ab1454 Binary files /dev/null and b/sounds/voice/scavengers/scav-event-airtransport.wav differ diff --git a/sounds/voice/scavengers/scav-event-cloud.wav b/sounds/voice/scavengers/scav-event-cloud.wav new file mode 100644 index 000000000..3b69354a4 Binary files /dev/null and b/sounds/voice/scavengers/scav-event-cloud.wav differ diff --git a/sounds/voice/scavengers/scav-event-malfunctions.wav b/sounds/voice/scavengers/scav-event-malfunctions.wav new file mode 100644 index 000000000..bf2727a14 Binary files /dev/null and b/sounds/voice/scavengers/scav-event-malfunctions.wav differ diff --git a/sounds/voice/scavengers/scav-event-miniboss.wav b/sounds/voice/scavengers/scav-event-miniboss.wav new file mode 100644 index 000000000..c2ee7e2bd Binary files /dev/null and b/sounds/voice/scavengers/scav-event-miniboss.wav differ diff --git a/sounds/voice/scavengers/scav-event-paralysis.wav b/sounds/voice/scavengers/scav-event-paralysis.wav new file mode 100644 index 000000000..0d5dee64b Binary files /dev/null and b/sounds/voice/scavengers/scav-event-paralysis.wav differ diff --git a/sounds/voice/scavengers/scav-event-rebellion.wav b/sounds/voice/scavengers/scav-event-rebellion.wav new file mode 100644 index 000000000..e6a31410d Binary files /dev/null and b/sounds/voice/scavengers/scav-event-rebellion.wav differ diff --git a/sounds/voice/scavengers/scav-event-swarmdetected.wav b/sounds/voice/scavengers/scav-event-swarmdetected.wav new file mode 100644 index 000000000..a751893e0 Binary files /dev/null and b/sounds/voice/scavengers/scav-event-swarmdetected.wav differ diff --git a/sounds/voice/scavengers/scavShutdownDetected.wav b/sounds/voice/scavengers/scavShutdownDetected.wav new file mode 100644 index 000000000..ecd4d51c3 Binary files /dev/null and b/sounds/voice/scavengers/scavShutdownDetected.wav differ diff --git a/sounds/voice/scavengers/scavadditionalcomdetected.wav b/sounds/voice/scavengers/scavadditionalcomdetected.wav new file mode 100644 index 000000000..7df5be596 Binary files /dev/null and b/sounds/voice/scavengers/scavadditionalcomdetected.wav differ diff --git a/sounds/voice/scavengers/scavanotherscavcomdetected.wav b/sounds/voice/scavengers/scavanotherscavcomdetected.wav new file mode 100644 index 000000000..49e962d02 Binary files /dev/null and b/sounds/voice/scavengers/scavanotherscavcomdetected.wav differ diff --git a/sounds/voice/scavengers/scavbossdetected.wav b/sounds/voice/scavengers/scavbossdetected.wav new file mode 100644 index 000000000..3456257d6 Binary files /dev/null and b/sounds/voice/scavengers/scavbossdetected.wav differ diff --git a/sounds/voice/scavengers/scavcomdetected.wav b/sounds/voice/scavengers/scavcomdetected.wav new file mode 100644 index 000000000..6df3c7178 Binary files /dev/null and b/sounds/voice/scavengers/scavcomdetected.wav differ diff --git a/sounds/voice/scavengers/scavcomnewdetect.wav b/sounds/voice/scavengers/scavcomnewdetect.wav new file mode 100644 index 000000000..f10dccb48 Binary files /dev/null and b/sounds/voice/scavengers/scavcomnewdetect.wav differ diff --git a/sounds/voice/scavengers/scavcomspotted.wav b/sounds/voice/scavengers/scavcomspotted.wav new file mode 100644 index 000000000..241808e58 Binary files /dev/null and b/sounds/voice/scavengers/scavcomspotted.wav differ diff --git a/sounds/voice/scavengers/scavdrop.wav b/sounds/voice/scavengers/scavdrop.wav new file mode 100644 index 000000000..d60eec7aa Binary files /dev/null and b/sounds/voice/scavengers/scavdrop.wav differ diff --git a/sounds/voice/scavengers/scavdroplootspawn.wav b/sounds/voice/scavengers/scavdroplootspawn.wav new file mode 100644 index 000000000..827847ccf Binary files /dev/null and b/sounds/voice/scavengers/scavdroplootspawn.wav differ diff --git a/sounds/voice/scavengers/scavdropspawn.wav b/sounds/voice/scavengers/scavdropspawn.wav new file mode 100644 index 000000000..a1dcf5dd5 Binary files /dev/null and b/sounds/voice/scavengers/scavdropspawn.wav differ diff --git a/sounds/voice/scavengers/scavdropspawnbeacon.wav b/sounds/voice/scavengers/scavdropspawnbeacon.wav new file mode 100644 index 000000000..5ca7e7ab0 Binary files /dev/null and b/sounds/voice/scavengers/scavdropspawnbeacon.wav differ diff --git a/sounds/voice/scavengers/scavdropspawnprinter.wav b/sounds/voice/scavengers/scavdropspawnprinter.wav new file mode 100644 index 000000000..1ab70c6ec Binary files /dev/null and b/sounds/voice/scavengers/scavdropspawnprinter.wav differ diff --git a/sounds/voice/scavengers/scavfinal01remain.wav b/sounds/voice/scavengers/scavfinal01remain.wav new file mode 100644 index 000000000..b5f224957 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal01remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal02remain.wav b/sounds/voice/scavengers/scavfinal02remain.wav new file mode 100644 index 000000000..e348dc0e0 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal02remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal03remain.wav b/sounds/voice/scavengers/scavfinal03remain.wav new file mode 100644 index 000000000..e30629230 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal03remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal04remain.wav b/sounds/voice/scavengers/scavfinal04remain.wav new file mode 100644 index 000000000..028f4166d Binary files /dev/null and b/sounds/voice/scavengers/scavfinal04remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal05remain.wav b/sounds/voice/scavengers/scavfinal05remain.wav new file mode 100644 index 000000000..b8c3e02f8 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal05remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal06remain.wav b/sounds/voice/scavengers/scavfinal06remain.wav new file mode 100644 index 000000000..3316c899c Binary files /dev/null and b/sounds/voice/scavengers/scavfinal06remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal07remain.wav b/sounds/voice/scavengers/scavfinal07remain.wav new file mode 100644 index 000000000..5aa1883e4 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal07remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal08remain.wav b/sounds/voice/scavengers/scavfinal08remain.wav new file mode 100644 index 000000000..667400062 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal08remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal09remain.wav b/sounds/voice/scavengers/scavfinal09remain.wav new file mode 100644 index 000000000..f59cadf6a Binary files /dev/null and b/sounds/voice/scavengers/scavfinal09remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal10remain.wav b/sounds/voice/scavengers/scavfinal10remain.wav new file mode 100644 index 000000000..457d87ac1 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal10remain.wav differ diff --git a/sounds/voice/scavengers/scavfinal12remain.wav b/sounds/voice/scavengers/scavfinal12remain.wav new file mode 100644 index 000000000..dd1d3f118 Binary files /dev/null and b/sounds/voice/scavengers/scavfinal12remain.wav differ diff --git a/sounds/voice/scavengers/scavfinalattack.wav b/sounds/voice/scavengers/scavfinalattack.wav new file mode 100644 index 000000000..f79cdfa25 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalattack.wav differ diff --git a/sounds/voice/scavengers/scavfinalboss.wav b/sounds/voice/scavengers/scavfinalboss.wav new file mode 100644 index 000000000..415ba5545 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalboss.wav differ diff --git a/sounds/voice/scavengers/scavfinalcountdown.wav b/sounds/voice/scavengers/scavfinalcountdown.wav new file mode 100644 index 000000000..c9b5a79c9 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalcountdown.wav differ diff --git a/sounds/voice/scavengers/scavfinalretreating.wav b/sounds/voice/scavengers/scavfinalretreating.wav new file mode 100644 index 000000000..32c8af636 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalretreating.wav differ diff --git a/sounds/voice/scavengers/scavfinalretreatingyes.wav b/sounds/voice/scavengers/scavfinalretreatingyes.wav new file mode 100644 index 000000000..4c5464ca8 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalretreatingyes.wav differ diff --git a/sounds/voice/scavengers/scavfinalsurvive10min.wav b/sounds/voice/scavengers/scavfinalsurvive10min.wav new file mode 100644 index 000000000..cf64a2578 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalsurvive10min.wav differ diff --git a/sounds/voice/scavengers/scavfinalsurvive15min.wav b/sounds/voice/scavengers/scavfinalsurvive15min.wav new file mode 100644 index 000000000..c8775147b Binary files /dev/null and b/sounds/voice/scavengers/scavfinalsurvive15min.wav differ diff --git a/sounds/voice/scavengers/scavfinalvictory.wav b/sounds/voice/scavengers/scavfinalvictory.wav new file mode 100644 index 000000000..e379716d5 Binary files /dev/null and b/sounds/voice/scavengers/scavfinalvictory.wav differ diff --git a/sounds/voice/scavengers/scavheavyairdetected.wav b/sounds/voice/scavengers/scavheavyairdetected.wav new file mode 100644 index 000000000..bf98ad595 Binary files /dev/null and b/sounds/voice/scavengers/scavheavyairdetected.wav differ diff --git a/sounds/voice/scavengers/scavheavyshipsdetected.wav b/sounds/voice/scavengers/scavheavyshipsdetected.wav new file mode 100644 index 000000000..8d6faa23a Binary files /dev/null and b/sounds/voice/scavengers/scavheavyshipsdetected.wav differ diff --git a/sounds/voice/scavengers/scavlootdrop.wav b/sounds/voice/scavengers/scavlootdrop.wav new file mode 100644 index 000000000..7178aa371 Binary files /dev/null and b/sounds/voice/scavengers/scavlootdrop.wav differ diff --git a/sounds/voice/scavengers/scavnewcomentered.wav b/sounds/voice/scavengers/scavnewcomentered.wav new file mode 100644 index 000000000..f733c7f93 Binary files /dev/null and b/sounds/voice/scavengers/scavnewcomentered.wav differ diff --git a/sounds/voice/scavengers/scavpreparingfinalattack.wav b/sounds/voice/scavengers/scavpreparingfinalattack.wav new file mode 100644 index 000000000..e7be7a320 Binary files /dev/null and b/sounds/voice/scavengers/scavpreparingfinalattack.wav differ diff --git a/sounds/voice/scavengers/scavspawn.wav b/sounds/voice/scavengers/scavspawn.wav new file mode 100644 index 000000000..a1a91b79a Binary files /dev/null and b/sounds/voice/scavengers/scavspawn.wav differ diff --git a/sounds/voice/scavengers/scavtech3.wav b/sounds/voice/scavengers/scavtech3.wav new file mode 100644 index 000000000..c5cb2af95 Binary files /dev/null and b/sounds/voice/scavengers/scavtech3.wav differ diff --git a/sounds/voice/scavengers/scavtech3b.wav b/sounds/voice/scavengers/scavtech3b.wav new file mode 100644 index 000000000..6fd5c2a7c Binary files /dev/null and b/sounds/voice/scavengers/scavtech3b.wav differ diff --git a/sounds/voice/scavengers/scavtech3c.wav b/sounds/voice/scavengers/scavtech3c.wav new file mode 100644 index 000000000..9dd699313 Binary files /dev/null and b/sounds/voice/scavengers/scavtech3c.wav differ diff --git a/sounds/voice/scavengers/scavtech3d.wav b/sounds/voice/scavengers/scavtech3d.wav new file mode 100644 index 000000000..c493e4a63 Binary files /dev/null and b/sounds/voice/scavengers/scavtech3d.wav differ diff --git a/sounds/voice/scavengers/scavtech3e.wav b/sounds/voice/scavengers/scavtech3e.wav new file mode 100644 index 000000000..c981538b8 Binary files /dev/null and b/sounds/voice/scavengers/scavtech3e.wav differ diff --git a/sounds/voice/scavengers/unidentifiedObjectsDetected.wav b/sounds/voice/scavengers/unidentifiedObjectsDetected.wav new file mode 100644 index 000000000..502721fd6 Binary files /dev/null and b/sounds/voice/scavengers/unidentifiedObjectsDetected.wav differ diff --git a/sounds/voice/scavengers/waitingForIntel.wav b/sounds/voice/scavengers/waitingForIntel.wav new file mode 100644 index 000000000..39c6f7b4d Binary files /dev/null and b/sounds/voice/scavengers/waitingForIntel.wav differ diff --git a/sounds/voice/scavengers/warning.wav b/sounds/voice/scavengers/warning.wav new file mode 100644 index 000000000..6b161dc9b Binary files /dev/null and b/sounds/voice/scavengers/warning.wav differ diff --git a/sounds/18379_inferno_hilas.wav b/sounds/weapons/18379_inferno_hilas.wav similarity index 100% rename from sounds/18379_inferno_hilas.wav rename to sounds/weapons/18379_inferno_hilas.wav diff --git a/sounds/18389_inferno_medlas.wav b/sounds/weapons/18389_inferno_medlas.wav similarity index 100% rename from sounds/18389_inferno_medlas.wav rename to sounds/weapons/18389_inferno_medlas.wav diff --git a/sounds/18393_inferno_reject.wav b/sounds/weapons/18393_inferno_reject.wav similarity index 100% rename from sounds/18393_inferno_reject.wav rename to sounds/weapons/18393_inferno_reject.wav diff --git a/sounds/18395_inferno_rltx.wav b/sounds/weapons/18395_inferno_rltx.wav similarity index 100% rename from sounds/18395_inferno_rltx.wav rename to sounds/weapons/18395_inferno_rltx.wav diff --git a/sounds/weapons/Assault Rifle Shot_05.wav b/sounds/weapons/Assault Rifle Shot_05.wav new file mode 100644 index 000000000..ad4d46315 Binary files /dev/null and b/sounds/weapons/Assault Rifle Shot_05.wav differ diff --git a/sounds/weapons/Machine Gun Shot_05.wav b/sounds/weapons/Machine Gun Shot_05.wav new file mode 100644 index 000000000..ff9c53f0b Binary files /dev/null and b/sounds/weapons/Machine Gun Shot_05.wav differ diff --git a/sounds/weapons/Sci Fi Beam 3-short.wav b/sounds/weapons/Sci Fi Beam 3-short.wav new file mode 100644 index 000000000..90a765134 Binary files /dev/null and b/sounds/weapons/Sci Fi Beam 3-short.wav differ diff --git a/sounds/weapons/Sci Fi Beam 3.wav b/sounds/weapons/Sci Fi Beam 3.wav new file mode 100644 index 000000000..2868a0a00 Binary files /dev/null and b/sounds/weapons/Sci Fi Beam 3.wav differ diff --git a/sounds/weapons/Sci Fi Blaster 4.wav b/sounds/weapons/Sci Fi Blaster 4.wav new file mode 100644 index 000000000..cd593acd7 Binary files /dev/null and b/sounds/weapons/Sci Fi Blaster 4.wav differ diff --git a/sounds/weapons/Sci Fi Sniper 10.wav b/sounds/weapons/Sci Fi Sniper 10.wav new file mode 100644 index 000000000..5c09315e3 Binary files /dev/null and b/sounds/weapons/Sci Fi Sniper 10.wav differ diff --git a/sounds/weapons/Shotgun Boom 101.wav b/sounds/weapons/Shotgun Boom 101.wav new file mode 100644 index 000000000..de85512e9 Binary files /dev/null and b/sounds/weapons/Shotgun Boom 101.wav differ diff --git a/sounds/weapons/Shotgun Boom 102.wav b/sounds/weapons/Shotgun Boom 102.wav new file mode 100644 index 000000000..6628ddcb0 Binary files /dev/null and b/sounds/weapons/Shotgun Boom 102.wav differ diff --git a/sounds/weapons/Shotgun Boom 103.wav b/sounds/weapons/Shotgun Boom 103.wav new file mode 100644 index 000000000..81b13969f Binary files /dev/null and b/sounds/weapons/Shotgun Boom 103.wav differ diff --git a/sounds/weapons/aegis.wav b/sounds/weapons/aegis.wav new file mode 100644 index 000000000..64148a034 Binary files /dev/null and b/sounds/weapons/aegis.wav differ diff --git a/sounds/allterrassaultshot.wav b/sounds/weapons/allterrassaultshot.wav similarity index 100% rename from sounds/allterrassaultshot.wav rename to sounds/weapons/allterrassaultshot.wav diff --git a/sounds/allterrheavyshot.wav b/sounds/weapons/allterrheavyshot.wav similarity index 100% rename from sounds/allterrheavyshot.wav rename to sounds/weapons/allterrheavyshot.wav diff --git a/sounds/amphibbuggytankshothit.wav b/sounds/weapons/amphibbuggytankshothit.wav similarity index 100% rename from sounds/amphibbuggytankshothit.wav rename to sounds/weapons/amphibbuggytankshothit.wav diff --git a/sounds/amphibmedtankshothit.wav b/sounds/weapons/amphibmedtankshothit.wav similarity index 100% rename from sounds/amphibmedtankshothit.wav rename to sounds/weapons/amphibmedtankshothit.wav diff --git a/sounds/antinukelaser.wav b/sounds/weapons/antinukelaser.wav similarity index 100% rename from sounds/antinukelaser.wav rename to sounds/weapons/antinukelaser.wav diff --git a/sounds/arty2.wav b/sounds/weapons/arty2.wav similarity index 100% rename from sounds/arty2.wav rename to sounds/weapons/arty2.wav diff --git a/sounds/weapons/bombdrop.wav b/sounds/weapons/bombdrop.wav new file mode 100644 index 000000000..e537d6b0a Binary files /dev/null and b/sounds/weapons/bombdrop.wav differ diff --git a/sounds/bomberlaunch.wav b/sounds/weapons/bomberlaunch.wav similarity index 100% rename from sounds/bomberlaunch.wav rename to sounds/weapons/bomberlaunch.wav diff --git a/sounds/bruisercannon.wav b/sounds/weapons/bruisercannon.wav similarity index 100% rename from sounds/bruisercannon.wav rename to sounds/weapons/bruisercannon.wav diff --git a/sounds/weapons/cruisemissilelaunch.wav b/sounds/weapons/cruisemissilelaunch.wav new file mode 100644 index 000000000..d05c52abb Binary files /dev/null and b/sounds/weapons/cruisemissilelaunch.wav differ diff --git a/sounds/weapons/ebomberlaser.wav b/sounds/weapons/ebomberlaser.wav new file mode 100644 index 000000000..41d42b027 Binary files /dev/null and b/sounds/weapons/ebomberlaser.wav differ diff --git a/sounds/weapons/efighterlaser.wav b/sounds/weapons/efighterlaser.wav new file mode 100644 index 000000000..0ebc82cbb Binary files /dev/null and b/sounds/weapons/efighterlaser.wav differ diff --git a/sounds/weapons/egunship2laser.wav b/sounds/weapons/egunship2laser.wav new file mode 100644 index 000000000..4e921cbe3 Binary files /dev/null and b/sounds/weapons/egunship2laser.wav differ diff --git a/sounds/weapons/electricboom.wav b/sounds/weapons/electricboom.wav new file mode 100644 index 000000000..d04275d2c Binary files /dev/null and b/sounds/weapons/electricboom.wav differ diff --git a/sounds/emediumtankfire2.wav b/sounds/weapons/emediumtankfire2.wav similarity index 100% rename from sounds/emediumtankfire2.wav rename to sounds/weapons/emediumtankfire2.wav diff --git a/sounds/eturretfire.wav b/sounds/weapons/eturretfire.wav similarity index 100% rename from sounds/eturretfire.wav rename to sounds/weapons/eturretfire.wav diff --git a/sounds/flakgun_shoot.wav b/sounds/weapons/flakgun_shoot.wav similarity index 100% rename from sounds/flakgun_shoot.wav rename to sounds/weapons/flakgun_shoot.wav diff --git a/sounds/flamethrower1.wav b/sounds/weapons/flamethrower1.wav similarity index 100% rename from sounds/flamethrower1.wav rename to sounds/weapons/flamethrower1.wav diff --git a/sounds/fnubeamfire.wav b/sounds/weapons/fnubeamfire.wav similarity index 100% rename from sounds/fnubeamfire.wav rename to sounds/weapons/fnubeamfire.wav diff --git a/sounds/heavycannonGD.wav b/sounds/weapons/heavycannonGD.wav similarity index 100% rename from sounds/heavycannonGD.wav rename to sounds/weapons/heavycannonGD.wav diff --git a/sounds/heavyturretshot.wav b/sounds/weapons/heavyturretshot.wav similarity index 100% rename from sounds/heavyturretshot.wav rename to sounds/weapons/heavyturretshot.wav diff --git a/sounds/jacobs.wav b/sounds/weapons/jacobs.wav similarity index 100% rename from sounds/jacobs.wav rename to sounds/weapons/jacobs.wav diff --git a/sounds/krabprimary.wav b/sounds/weapons/krabprimary.wav similarity index 100% rename from sounds/krabprimary.wav rename to sounds/weapons/krabprimary.wav diff --git a/sounds/krabsecondary.wav b/sounds/weapons/krabsecondary.wav similarity index 100% rename from sounds/krabsecondary.wav rename to sounds/weapons/krabsecondary.wav diff --git a/sounds/weapons/laserbeam02-short.wav b/sounds/weapons/laserbeam02-short.wav new file mode 100644 index 000000000..878bfd7e8 Binary files /dev/null and b/sounds/weapons/laserbeam02-short.wav differ diff --git a/sounds/weapons/laserbeam02.wav b/sounds/weapons/laserbeam02.wav new file mode 100644 index 000000000..8ca70b4f7 Binary files /dev/null and b/sounds/weapons/laserbeam02.wav differ diff --git a/sounds/weapons/lightning-metal-hit.wav b/sounds/weapons/lightning-metal-hit.wav new file mode 100644 index 000000000..9cd00ae2e Binary files /dev/null and b/sounds/weapons/lightning-metal-hit.wav differ diff --git a/sounds/weapons/lightningstrike.wav b/sounds/weapons/lightningstrike.wav new file mode 100644 index 000000000..5d4d8377b Binary files /dev/null and b/sounds/weapons/lightningstrike.wav differ diff --git a/sounds/weapons/lightturret.wav b/sounds/weapons/lightturret.wav new file mode 100644 index 000000000..a0e362a8b Binary files /dev/null and b/sounds/weapons/lightturret.wav differ diff --git a/sounds/lrpcshot2.wav b/sounds/weapons/lrpcshot2.wav similarity index 100% rename from sounds/lrpcshot2.wav rename to sounds/weapons/lrpcshot2.wav diff --git a/sounds/medallterrweapon.wav b/sounds/weapons/medallterrweapon.wav similarity index 100% rename from sounds/medallterrweapon.wav rename to sounds/weapons/medallterrweapon.wav diff --git a/sounds/weapons/meteorwhoosh.wav b/sounds/weapons/meteorwhoosh.wav new file mode 100644 index 000000000..43d0049ec Binary files /dev/null and b/sounds/weapons/meteorwhoosh.wav differ diff --git a/sounds/weapons/minewhir.wav b/sounds/weapons/minewhir.wav new file mode 100644 index 000000000..37c608349 Binary files /dev/null and b/sounds/weapons/minewhir.wav differ diff --git a/sounds/missile_launch1.wav b/sounds/weapons/missile_launch1.wav similarity index 100% rename from sounds/missile_launch1.wav rename to sounds/weapons/missile_launch1.wav diff --git a/sounds/missilefiring.wav b/sounds/weapons/missilefiring.wav similarity index 100% rename from sounds/missilefiring.wav rename to sounds/weapons/missilefiring.wav diff --git a/sounds/nukeartyshot.wav b/sounds/weapons/nukeartyshot.wav similarity index 100% rename from sounds/nukeartyshot.wav rename to sounds/weapons/nukeartyshot.wav diff --git a/sounds/weapons/nukelaunch.wav b/sounds/weapons/nukelaunch.wav new file mode 100644 index 000000000..c5fbeae76 Binary files /dev/null and b/sounds/weapons/nukelaunch.wav differ diff --git a/sounds/weapons/plasma2.wav b/sounds/weapons/plasma2.wav new file mode 100644 index 000000000..8a8671f2e Binary files /dev/null and b/sounds/weapons/plasma2.wav differ diff --git a/sounds/weapons/plasma3.wav b/sounds/weapons/plasma3.wav new file mode 100644 index 000000000..872e4297f Binary files /dev/null and b/sounds/weapons/plasma3.wav differ diff --git a/sounds/weapons/plasma3c.wav b/sounds/weapons/plasma3c.wav new file mode 100644 index 000000000..0017bdf94 Binary files /dev/null and b/sounds/weapons/plasma3c.wav differ diff --git a/sounds/weapons/pointdefensefire.wav b/sounds/weapons/pointdefensefire.wav new file mode 100644 index 000000000..2a508e76a Binary files /dev/null and b/sounds/weapons/pointdefensefire.wav differ diff --git a/sounds/railgun.wav b/sounds/weapons/railgun.wav similarity index 100% rename from sounds/railgun.wav rename to sounds/weapons/railgun.wav diff --git a/sounds/rocket1.wav b/sounds/weapons/rocket1.wav similarity index 100% rename from sounds/rocket1.wav rename to sounds/weapons/rocket1.wav diff --git a/sounds/weapons/shotgun-reload.wav b/sounds/weapons/shotgun-reload.wav new file mode 100644 index 000000000..26d27a9ec Binary files /dev/null and b/sounds/weapons/shotgun-reload.wav differ diff --git a/sounds/weapons/snipershot.wav b/sounds/weapons/snipershot.wav new file mode 100644 index 000000000..829b61543 Binary files /dev/null and b/sounds/weapons/snipershot.wav differ diff --git a/sounds/subhit.wav b/sounds/weapons/subhit.wav similarity index 100% rename from sounds/subhit.wav rename to sounds/weapons/subhit.wav diff --git a/sounds/tankdestroyerfire.wav b/sounds/weapons/tankdestroyerfire.wav similarity index 100% rename from sounds/tankdestroyerfire.wav rename to sounds/weapons/tankdestroyerfire.wav diff --git a/sounds/tankdestroyermaingunfire.wav b/sounds/weapons/tankdestroyermaingunfire.wav similarity index 100% rename from sounds/tankdestroyermaingunfire.wav rename to sounds/weapons/tankdestroyermaingunfire.wav diff --git a/sounds/tgunshipfire.wav b/sounds/weapons/tgunshipfire.wav similarity index 100% rename from sounds/tgunshipfire.wav rename to sounds/weapons/tgunshipfire.wav diff --git a/sounds/tmediumtankfire.wav b/sounds/weapons/tmediumtankfire.wav similarity index 100% rename from sounds/tmediumtankfire.wav rename to sounds/weapons/tmediumtankfire.wav diff --git a/sounds/torpedolaunch.wav b/sounds/weapons/torpedolaunch.wav similarity index 100% rename from sounds/torpedolaunch.wav rename to sounds/weapons/torpedolaunch.wav diff --git a/sounds/triotfire.wav b/sounds/weapons/triotfire.wav similarity index 100% rename from sounds/triotfire.wav rename to sounds/weapons/triotfire.wav diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 1.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 1.wav new file mode 100644 index 000000000..b65561fe5 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 1.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 2.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 2.wav new file mode 100644 index 000000000..e435298eb Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 2.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 3.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 3.wav new file mode 100644 index 000000000..391a550bf Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 3.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 4.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 4.wav new file mode 100644 index 000000000..fa27ed7e7 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 4.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 5.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 5.wav new file mode 100644 index 000000000..fc31c4292 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY BREATHING FIRE/BABY BREATHING FIRE 5.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 1.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 1.wav new file mode 100644 index 000000000..580751deb Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 1.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 2.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 2.wav new file mode 100644 index 000000000..92c549a40 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 2.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 3.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 3.wav new file mode 100644 index 000000000..abd43be00 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 3.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 4.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 4.wav new file mode 100644 index 000000000..c0a151e3a Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 4.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 5.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 5.wav new file mode 100644 index 000000000..146054541 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY FOOTSTEPS/BABY FOOTSTEPS 5.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 1.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 1.wav new file mode 100644 index 000000000..1afe6f524 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 1.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 2.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 2.wav new file mode 100644 index 000000000..649395fe5 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 2.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 3.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 3.wav new file mode 100644 index 000000000..dd49a6f13 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 3.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 4.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 4.wav new file mode 100644 index 000000000..185f441c3 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 4.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 5.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 5.wav new file mode 100644 index 000000000..197acf44c Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY ROAR/BABY ROAR 5.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 1.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 1.wav new file mode 100644 index 000000000..7382ecdfd Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 1.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 2.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 2.wav new file mode 100644 index 000000000..b7a66a712 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 2.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 3.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 3.wav new file mode 100644 index 000000000..cc48551c3 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 3.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 4.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 4.wav new file mode 100644 index 000000000..6e93fd744 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 4.wav differ diff --git a/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 5.wav b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 5.wav new file mode 100644 index 000000000..7cfbcc8a0 Binary files /dev/null and b/sounds/weapons/zaal/BABY DRAGONS/BABY TAKING DAMAGE/BABY TAKING DAMAGE 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 1.wav new file mode 100644 index 000000000..de9c23d5c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 2.wav new file mode 100644 index 000000000..fa19af3f1 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 3.wav new file mode 100644 index 000000000..a402f2c0f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 4.wav new file mode 100644 index 000000000..f8e1da6d3 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 5.wav new file mode 100644 index 000000000..b7e96f940 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON AGGRO/AGGRO 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 1.wav new file mode 100644 index 000000000..c04e12191 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 10.wav new file mode 100644 index 000000000..5e46f6837 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 2.wav new file mode 100644 index 000000000..e2297ce39 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 3.wav new file mode 100644 index 000000000..27b4ffe6e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 4.wav new file mode 100644 index 000000000..44b24b4ea Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 5.wav new file mode 100644 index 000000000..a7f25b6d6 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 6.wav new file mode 100644 index 000000000..06b856eda Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 7.wav new file mode 100644 index 000000000..e42b97784 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 8.wav new file mode 100644 index 000000000..e05ec81a2 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 9.wav new file mode 100644 index 000000000..383845fc6 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ATTACKS/DRAGON ATTACKS 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 1.wav new file mode 100644 index 000000000..3d8fa8442 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 10.wav new file mode 100644 index 000000000..08cfbac1d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 2.wav new file mode 100644 index 000000000..83c4c0c14 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 3.wav new file mode 100644 index 000000000..8d8883018 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 4.wav new file mode 100644 index 000000000..c19a74ae9 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 5.wav new file mode 100644 index 000000000..cc8dae6d9 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 6.wav new file mode 100644 index 000000000..02f5cdd91 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 7.wav new file mode 100644 index 000000000..acf47fd05 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 8.wav new file mode 100644 index 000000000..db9b7b7fb Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 9.wav new file mode 100644 index 000000000..dc6fdf9bb Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BITES/DRAGON BITES 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 1.wav new file mode 100644 index 000000000..87b41415e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 10.wav new file mode 100644 index 000000000..a1adf52a1 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 11.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 11.wav new file mode 100644 index 000000000..90f4e84f7 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 11.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 12.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 12.wav new file mode 100644 index 000000000..47be900f0 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 12.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 13.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 13.wav new file mode 100644 index 000000000..b699a4f7b Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 13.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 14.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 14.wav new file mode 100644 index 000000000..364a84069 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 14.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 15.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 15.wav new file mode 100644 index 000000000..7468bf85c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 15.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 16.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 16.wav new file mode 100644 index 000000000..6aa492203 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 16.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 17.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 17.wav new file mode 100644 index 000000000..5e7f9a79f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 17.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 18.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 18.wav new file mode 100644 index 000000000..51482347d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 18.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 19.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 19.wav new file mode 100644 index 000000000..603939cb4 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 19.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 2.wav new file mode 100644 index 000000000..b58be3ddc Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 20.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 20.wav new file mode 100644 index 000000000..f211ebf0b Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 20.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 21.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 21.wav new file mode 100644 index 000000000..b8e953e54 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 21.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 22.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 22.wav new file mode 100644 index 000000000..839a796c2 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 22.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 23.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 23.wav new file mode 100644 index 000000000..5d54349ec Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 23.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 3.wav new file mode 100644 index 000000000..bb01e3001 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 4.wav new file mode 100644 index 000000000..2b2e5dac4 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 5.wav new file mode 100644 index 000000000..4d8e5746f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 6.wav new file mode 100644 index 000000000..bac77c1f5 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 7.wav new file mode 100644 index 000000000..303e5a1f4 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 8.wav new file mode 100644 index 000000000..619dacd85 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 9.wav new file mode 100644 index 000000000..2a8c3e217 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING FIRE/DRAGON BREATHING FIRE 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 1.wav new file mode 100644 index 000000000..8fa013f28 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 10.wav new file mode 100644 index 000000000..70e626b93 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 11.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 11.wav new file mode 100644 index 000000000..908d68deb Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 11.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 12.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 12.wav new file mode 100644 index 000000000..a87125e33 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 12.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 13.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 13.wav new file mode 100644 index 000000000..9d8998c1f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 13.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 14.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 14.wav new file mode 100644 index 000000000..2ff6cb658 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 14.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 15.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 15.wav new file mode 100644 index 000000000..c91c119b0 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 15.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 16.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 16.wav new file mode 100644 index 000000000..a2e44f3bd Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 16.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 17.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 17.wav new file mode 100644 index 000000000..fec021402 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 17.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 18.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 18.wav new file mode 100644 index 000000000..dc236b0c0 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 18.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 19.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 19.wav new file mode 100644 index 000000000..1d441c7fd Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 19.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 2.wav new file mode 100644 index 000000000..84450547a Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 20.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 20.wav new file mode 100644 index 000000000..cbf64fba7 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 20.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 3.wav new file mode 100644 index 000000000..6d5da92b3 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 4.wav new file mode 100644 index 000000000..fa34ccacb Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 5.wav new file mode 100644 index 000000000..a75912eda Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 6.wav new file mode 100644 index 000000000..deba0ec21 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 7.wav new file mode 100644 index 000000000..7556cb664 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 8.wav new file mode 100644 index 000000000..34bb06130 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 9.wav new file mode 100644 index 000000000..252ba0b72 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON BREATHING/BREATHING 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 1.wav new file mode 100644 index 000000000..909832d63 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 2.wav new file mode 100644 index 000000000..6410391cd Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 3.wav new file mode 100644 index 000000000..5f6ff8839 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 4.wav new file mode 100644 index 000000000..c674cb1dd Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 5.wav new file mode 100644 index 000000000..f13257aef Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON EATING/EATING 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 1.wav new file mode 100644 index 000000000..e117fa1c8 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 10.wav new file mode 100644 index 000000000..20a727207 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 11.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 11.wav new file mode 100644 index 000000000..7d312c284 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 11.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 12.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 12.wav new file mode 100644 index 000000000..ef8096c1c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 12.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 13.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 13.wav new file mode 100644 index 000000000..b613b921f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 13.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 14.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 14.wav new file mode 100644 index 000000000..4d222e386 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 14.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 15.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 15.wav new file mode 100644 index 000000000..1b8e6b314 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 15.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 16.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 16.wav new file mode 100644 index 000000000..e56d4b440 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 16.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 17.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 17.wav new file mode 100644 index 000000000..3af373d19 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 17.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 18.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 18.wav new file mode 100644 index 000000000..2f1a5019c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 18.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 19.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 19.wav new file mode 100644 index 000000000..c0a120542 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 19.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 2.wav new file mode 100644 index 000000000..3b18dc665 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 20.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 20.wav new file mode 100644 index 000000000..c7d689c36 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 20.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 3.wav new file mode 100644 index 000000000..494a64005 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 4.wav new file mode 100644 index 000000000..52cb18baf Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 5.wav new file mode 100644 index 000000000..651577240 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 6.wav new file mode 100644 index 000000000..17391f785 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 7.wav new file mode 100644 index 000000000..52e21c993 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 8.wav new file mode 100644 index 000000000..da40ddd68 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 9.wav new file mode 100644 index 000000000..4686f74a3 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON FOOTSTEPS/Footsteps 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 1.wav new file mode 100644 index 000000000..3d5c3bf9e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 2.wav new file mode 100644 index 000000000..1d09feb1e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 3.wav new file mode 100644 index 000000000..bc9459c4b Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 4.wav new file mode 100644 index 000000000..8c64761e0 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 5.wav new file mode 100644 index 000000000..872684104 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON HISSES/HISSES 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 1.wav new file mode 100644 index 000000000..8f61fd016 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 2.wav new file mode 100644 index 000000000..a8f1d82a2 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 3.wav new file mode 100644 index 000000000..e18f32d8f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 4.wav new file mode 100644 index 000000000..ce32389ae Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 5.wav new file mode 100644 index 000000000..115c818da Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON LANDING/LANDING 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 1.wav new file mode 100644 index 000000000..adf1c384d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 10.wav new file mode 100644 index 000000000..ac88531c4 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 11.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 11.wav new file mode 100644 index 000000000..6c45e92a1 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 11.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 12.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 12.wav new file mode 100644 index 000000000..6eeb6449e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 12.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 13.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 13.wav new file mode 100644 index 000000000..18f70202c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 13.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 14.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 14.wav new file mode 100644 index 000000000..022b54228 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 14.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 15.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 15.wav new file mode 100644 index 000000000..ae9307a40 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 15.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 16.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 16.wav new file mode 100644 index 000000000..3339d1098 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 16.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 17.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 17.wav new file mode 100644 index 000000000..86a81392d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 17.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 18.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 18.wav new file mode 100644 index 000000000..fffa31dea Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 18.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 19.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 19.wav new file mode 100644 index 000000000..7965ee64d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 19.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 2.wav new file mode 100644 index 000000000..061f85b82 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 20.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 20.wav new file mode 100644 index 000000000..3e63e16e5 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 20.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 3.wav new file mode 100644 index 000000000..6bedd9d6f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 4.wav new file mode 100644 index 000000000..9bc8adff5 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 5.wav new file mode 100644 index 000000000..bdcbe4744 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 6.wav new file mode 100644 index 000000000..c284870ea Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 7.wav new file mode 100644 index 000000000..3ef5ae0c2 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 8.wav new file mode 100644 index 000000000..65c90557e Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 9.wav new file mode 100644 index 000000000..107b47c13 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON ROAR/ROAR 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 1.wav new file mode 100644 index 000000000..c38bf3938 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 2.wav new file mode 100644 index 000000000..b976d9724 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 3.wav new file mode 100644 index 000000000..2d5241c2a Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 4.wav new file mode 100644 index 000000000..21b56cb2c Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 5.wav new file mode 100644 index 000000000..22af82c32 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON SCREECH/SCREECH 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 1.wav new file mode 100644 index 000000000..9f4fa095f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 10.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 10.wav new file mode 100644 index 000000000..241de9846 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 2.wav new file mode 100644 index 000000000..02992270f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 3.wav new file mode 100644 index 000000000..f5273df57 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 4.wav new file mode 100644 index 000000000..9e8bc8432 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 5.wav new file mode 100644 index 000000000..66712f94b Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 6.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 6.wav new file mode 100644 index 000000000..69b544aac Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 7.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 7.wav new file mode 100644 index 000000000..5f99f6bed Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 8.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 8.wav new file mode 100644 index 000000000..af3aad33f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 9.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 9.wav new file mode 100644 index 000000000..bc88eb3a6 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING DAMAGE/TAKING DAMAGE 9.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 1.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 1.wav new file mode 100644 index 000000000..5b195db82 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 2.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 2.wav new file mode 100644 index 000000000..9da5cb69a Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 3.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 3.wav new file mode 100644 index 000000000..4221dab95 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 4.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 4.wav new file mode 100644 index 000000000..1960a88df Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 5.wav b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 5.wav new file mode 100644 index 000000000..5fa708e65 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/DRAGON TAKING FLIGHT/TAKING FLIGHT 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 1.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 1.wav new file mode 100644 index 000000000..4a415f5cb Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 1.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 10.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 10.wav new file mode 100644 index 000000000..cc396ca82 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 10.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 2.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 2.wav new file mode 100644 index 000000000..53938d42d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 2.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 3.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 3.wav new file mode 100644 index 000000000..5c2c3136d Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 3.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 4.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 4.wav new file mode 100644 index 000000000..8ed4ea3d1 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 4.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 5.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 5.wav new file mode 100644 index 000000000..1203df050 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 5.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 6.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 6.wav new file mode 100644 index 000000000..78b10cba8 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 6.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 7.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 7.wav new file mode 100644 index 000000000..5572020d8 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 7.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 8.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 8.wav new file mode 100644 index 000000000..e87acca1f Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 8.wav differ diff --git a/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 9.wav b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 9.wav new file mode 100644 index 000000000..8866a1d99 Binary files /dev/null and b/sounds/weapons/zaal/DRAGONS/FLAPPING WINGS/FLAPPING WINGS 9.wav differ diff --git a/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 1.wav b/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 1.wav new file mode 100644 index 000000000..5c845053a Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 1.wav differ diff --git a/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 2.wav b/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 2.wav new file mode 100644 index 000000000..b7ea1f315 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Breathing/Huge monster Breathing 2.wav differ diff --git a/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 1.wav b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 1.wav new file mode 100644 index 000000000..efce8bec8 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 1.wav differ diff --git a/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 2.wav b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 2.wav new file mode 100644 index 000000000..cf84de34e Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 2.wav differ diff --git a/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 3.wav b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 3.wav new file mode 100644 index 000000000..65cd4baef Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 3.wav differ diff --git a/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 4.wav b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 4.wav new file mode 100644 index 000000000..cd88c2380 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 4.wav differ diff --git a/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 5.wav b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 5.wav new file mode 100644 index 000000000..2b2d58c84 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster Growls/Huge monster Growls 5.wav differ diff --git a/sounds/weapons/zaal/Huge monster attack/Huge monster attack 1.wav b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 1.wav new file mode 100644 index 000000000..eaf302231 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 1.wav differ diff --git a/sounds/weapons/zaal/Huge monster attack/Huge monster attack 2.wav b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 2.wav new file mode 100644 index 000000000..2aefdaa5c Binary files /dev/null and b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 2.wav differ diff --git a/sounds/weapons/zaal/Huge monster attack/Huge monster attack 3.wav b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 3.wav new file mode 100644 index 000000000..902ad5f8c Binary files /dev/null and b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 3.wav differ diff --git a/sounds/weapons/zaal/Huge monster attack/Huge monster attack 4.wav b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 4.wav new file mode 100644 index 000000000..9a48fc475 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 4.wav differ diff --git a/sounds/weapons/zaal/Huge monster attack/Huge monster attack 5.wav b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 5.wav new file mode 100644 index 000000000..9655ff28c Binary files /dev/null and b/sounds/weapons/zaal/Huge monster attack/Huge monster attack 5.wav differ diff --git a/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 1.wav b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 1.wav new file mode 100644 index 000000000..c75cb5b14 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 1.wav differ diff --git a/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 2.wav b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 2.wav new file mode 100644 index 000000000..68116229f Binary files /dev/null and b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 2.wav differ diff --git a/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 3.wav b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 3.wav new file mode 100644 index 000000000..602411e78 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 3.wav differ diff --git a/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 4.wav b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 4.wav new file mode 100644 index 000000000..82af7ec89 Binary files /dev/null and b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 4.wav differ diff --git a/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 5.wav b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 5.wav new file mode 100644 index 000000000..f3c1113fb Binary files /dev/null and b/sounds/weapons/zaal/Huge monster footsteps/Huge monster footsteps 5.wav differ diff --git a/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 1.wav b/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 1.wav new file mode 100644 index 000000000..4c1c34d9c Binary files /dev/null and b/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 1.wav differ diff --git a/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 2.wav b/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 2.wav new file mode 100644 index 000000000..9466812ca Binary files /dev/null and b/sounds/weapons/zaal/Huge monster laugh/Huge monster laugh 2.wav differ diff --git a/sounds/weapons/zaal/Large monster Growls/Large monster Growls 1.wav b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 1.wav new file mode 100644 index 000000000..8d256b77a Binary files /dev/null and b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 1.wav differ diff --git a/sounds/weapons/zaal/Large monster Growls/Large monster Growls 2.wav b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 2.wav new file mode 100644 index 000000000..b2daee2b8 Binary files /dev/null and b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 2.wav differ diff --git a/sounds/weapons/zaal/Large monster Growls/Large monster Growls 3.wav b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 3.wav new file mode 100644 index 000000000..87c24e600 Binary files /dev/null and b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 3.wav differ diff --git a/sounds/weapons/zaal/Large monster Growls/Large monster Growls 4.wav b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 4.wav new file mode 100644 index 000000000..f1aebccda Binary files /dev/null and b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 4.wav differ diff --git a/sounds/weapons/zaal/Large monster Growls/Large monster Growls 5.wav b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 5.wav new file mode 100644 index 000000000..af77a9eef Binary files /dev/null and b/sounds/weapons/zaal/Large monster Growls/Large monster Growls 5.wav differ diff --git a/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 1.wav b/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 1.wav new file mode 100644 index 000000000..cd80ba9ba Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 1.wav differ diff --git a/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 2.wav b/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 2.wav new file mode 100644 index 000000000..14fa641b1 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Breathing/Medium monster Breathing 2.wav differ diff --git a/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 1.wav b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 1.wav new file mode 100644 index 000000000..a91109d16 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 1.wav differ diff --git a/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 2.wav b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 2.wav new file mode 100644 index 000000000..6f4f02246 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 2.wav differ diff --git a/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 3.wav b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 3.wav new file mode 100644 index 000000000..c0185a9bf Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 3.wav differ diff --git a/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 4.wav b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 4.wav new file mode 100644 index 000000000..b0eab2991 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 4.wav differ diff --git a/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 5.wav b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 5.wav new file mode 100644 index 000000000..87f6a6d17 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster Growls/Medium monster Growls 5.wav differ diff --git a/sounds/weapons/zaal/Medium monster attack/Medium monster attack 1.wav b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 1.wav new file mode 100644 index 000000000..845a00863 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 1.wav differ diff --git a/sounds/weapons/zaal/Medium monster attack/Medium monster attack 2.wav b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 2.wav new file mode 100644 index 000000000..33b1d0c1d Binary files /dev/null and b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 2.wav differ diff --git a/sounds/weapons/zaal/Medium monster attack/Medium monster attack 3.wav b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 3.wav new file mode 100644 index 000000000..8578ea344 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 3.wav differ diff --git a/sounds/weapons/zaal/Medium monster attack/Medium monster attack 4.wav b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 4.wav new file mode 100644 index 000000000..6bb4c5d23 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 4.wav differ diff --git a/sounds/weapons/zaal/Medium monster attack/Medium monster attack 5.wav b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 5.wav new file mode 100644 index 000000000..210f37a6c Binary files /dev/null and b/sounds/weapons/zaal/Medium monster attack/Medium monster attack 5.wav differ diff --git a/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 1.wav b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 1.wav new file mode 100644 index 000000000..f044f93a4 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 1.wav differ diff --git a/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 2.wav b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 2.wav new file mode 100644 index 000000000..fe5d08f11 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 2.wav differ diff --git a/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 3.wav b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 3.wav new file mode 100644 index 000000000..d1f07087d Binary files /dev/null and b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 3.wav differ diff --git a/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 4.wav b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 4.wav new file mode 100644 index 000000000..afae2e678 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 4.wav differ diff --git a/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 5.wav b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 5.wav new file mode 100644 index 000000000..2f10c0e37 Binary files /dev/null and b/sounds/weapons/zaal/Medium monster footsteps/Medium monster footsteps 5.wav differ diff --git a/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 1.wav b/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 1.wav new file mode 100644 index 000000000..518f58f6f Binary files /dev/null and b/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 1.wav differ diff --git a/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 2.wav b/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 2.wav new file mode 100644 index 000000000..1d8af910c Binary files /dev/null and b/sounds/weapons/zaal/Medium monster laugh/Medium monster laugh 2.wav differ diff --git a/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 1.wav b/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 1.wav new file mode 100644 index 000000000..d905faf66 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 1.wav differ diff --git a/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 2.wav b/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 2.wav new file mode 100644 index 000000000..6bf9521f8 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Breathing/Small monster Breathing 2.wav differ diff --git a/sounds/weapons/zaal/Small monster Growls/Small monster Growls 1.wav b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 1.wav new file mode 100644 index 000000000..d3a8c9c36 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 1.wav differ diff --git a/sounds/weapons/zaal/Small monster Growls/Small monster Growls 2.wav b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 2.wav new file mode 100644 index 000000000..229a81fc6 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 2.wav differ diff --git a/sounds/weapons/zaal/Small monster Growls/Small monster Growls 3.wav b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 3.wav new file mode 100644 index 000000000..6c4373073 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 3.wav differ diff --git a/sounds/weapons/zaal/Small monster Growls/Small monster Growls 4.wav b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 4.wav new file mode 100644 index 000000000..3df5ca3fe Binary files /dev/null and b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 4.wav differ diff --git a/sounds/weapons/zaal/Small monster Growls/Small monster Growls 5.wav b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 5.wav new file mode 100644 index 000000000..6569c5997 Binary files /dev/null and b/sounds/weapons/zaal/Small monster Growls/Small monster Growls 5.wav differ diff --git a/sounds/weapons/zaal/Small monster attack/Small monster attack 1.wav b/sounds/weapons/zaal/Small monster attack/Small monster attack 1.wav new file mode 100644 index 000000000..ef9f55ab5 Binary files /dev/null and b/sounds/weapons/zaal/Small monster attack/Small monster attack 1.wav differ diff --git a/sounds/weapons/zaal/Small monster attack/Small monster attack 2.wav b/sounds/weapons/zaal/Small monster attack/Small monster attack 2.wav new file mode 100644 index 000000000..f5617f080 Binary files /dev/null and b/sounds/weapons/zaal/Small monster attack/Small monster attack 2.wav differ diff --git a/sounds/weapons/zaal/Small monster attack/Small monster attack 3.wav b/sounds/weapons/zaal/Small monster attack/Small monster attack 3.wav new file mode 100644 index 000000000..001f5d389 Binary files /dev/null and b/sounds/weapons/zaal/Small monster attack/Small monster attack 3.wav differ diff --git a/sounds/weapons/zaal/Small monster attack/Small monster attack 4.wav b/sounds/weapons/zaal/Small monster attack/Small monster attack 4.wav new file mode 100644 index 000000000..d945f6a00 Binary files /dev/null and b/sounds/weapons/zaal/Small monster attack/Small monster attack 4.wav differ diff --git a/sounds/weapons/zaal/Small monster attack/Small monster attack 5.wav b/sounds/weapons/zaal/Small monster attack/Small monster attack 5.wav new file mode 100644 index 000000000..0bf628494 Binary files /dev/null and b/sounds/weapons/zaal/Small monster attack/Small monster attack 5.wav differ diff --git a/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 1.wav b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 1.wav new file mode 100644 index 000000000..fa635ebbc Binary files /dev/null and b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 1.wav differ diff --git a/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 2.wav b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 2.wav new file mode 100644 index 000000000..054001a9e Binary files /dev/null and b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 2.wav differ diff --git a/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 3.wav b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 3.wav new file mode 100644 index 000000000..93d089bd3 Binary files /dev/null and b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 3.wav differ diff --git a/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 4.wav b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 4.wav new file mode 100644 index 000000000..2236af627 Binary files /dev/null and b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 4.wav differ diff --git a/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 5.wav b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 5.wav new file mode 100644 index 000000000..eb322f2c5 Binary files /dev/null and b/sounds/weapons/zaal/Small monster footsteps/Small monster footsteps 5.wav differ diff --git a/sounds/weapons/zaal/Small monster laugh/Small monster laugh 1.wav b/sounds/weapons/zaal/Small monster laugh/Small monster laugh 1.wav new file mode 100644 index 000000000..a61f7f5e6 Binary files /dev/null and b/sounds/weapons/zaal/Small monster laugh/Small monster laugh 1.wav differ diff --git a/sounds/weapons/zaal/Small monster laugh/Small monster laugh 2.wav b/sounds/weapons/zaal/Small monster laugh/Small monster laugh 2.wav new file mode 100644 index 000000000..afdb9f5d0 Binary files /dev/null and b/sounds/weapons/zaal/Small monster laugh/Small monster laugh 2.wav differ diff --git a/sounds/weapons/zaal/large monster Breathing/large monster Breathing 1.wav b/sounds/weapons/zaal/large monster Breathing/large monster Breathing 1.wav new file mode 100644 index 000000000..687a2a6c6 Binary files /dev/null and b/sounds/weapons/zaal/large monster Breathing/large monster Breathing 1.wav differ diff --git a/sounds/weapons/zaal/large monster Breathing/large monster Breathing 2.wav b/sounds/weapons/zaal/large monster Breathing/large monster Breathing 2.wav new file mode 100644 index 000000000..a6164c6c0 Binary files /dev/null and b/sounds/weapons/zaal/large monster Breathing/large monster Breathing 2.wav differ diff --git a/sounds/weapons/zaal/large monster attack/large monster attack 1.wav b/sounds/weapons/zaal/large monster attack/large monster attack 1.wav new file mode 100644 index 000000000..0f6e0a8fb Binary files /dev/null and b/sounds/weapons/zaal/large monster attack/large monster attack 1.wav differ diff --git a/sounds/weapons/zaal/large monster attack/large monster attack 2.wav b/sounds/weapons/zaal/large monster attack/large monster attack 2.wav new file mode 100644 index 000000000..04de72826 Binary files /dev/null and b/sounds/weapons/zaal/large monster attack/large monster attack 2.wav differ diff --git a/sounds/weapons/zaal/large monster attack/large monster attack 3.wav b/sounds/weapons/zaal/large monster attack/large monster attack 3.wav new file mode 100644 index 000000000..384b1d3f6 Binary files /dev/null and b/sounds/weapons/zaal/large monster attack/large monster attack 3.wav differ diff --git a/sounds/weapons/zaal/large monster attack/large monster attack 4.wav b/sounds/weapons/zaal/large monster attack/large monster attack 4.wav new file mode 100644 index 000000000..950e1ad47 Binary files /dev/null and b/sounds/weapons/zaal/large monster attack/large monster attack 4.wav differ diff --git a/sounds/weapons/zaal/large monster attack/large monster attack 5.wav b/sounds/weapons/zaal/large monster attack/large monster attack 5.wav new file mode 100644 index 000000000..104bd93f2 Binary files /dev/null and b/sounds/weapons/zaal/large monster attack/large monster attack 5.wav differ diff --git a/sounds/weapons/zaal/large monster footsteps/large monster footsteps 1.wav b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 1.wav new file mode 100644 index 000000000..7b69e8acf Binary files /dev/null and b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 1.wav differ diff --git a/sounds/weapons/zaal/large monster footsteps/large monster footsteps 2.wav b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 2.wav new file mode 100644 index 000000000..d78ba01e5 Binary files /dev/null and b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 2.wav differ diff --git a/sounds/weapons/zaal/large monster footsteps/large monster footsteps 3.wav b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 3.wav new file mode 100644 index 000000000..e51346e6c Binary files /dev/null and b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 3.wav differ diff --git a/sounds/weapons/zaal/large monster footsteps/large monster footsteps 4.wav b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 4.wav new file mode 100644 index 000000000..1d05eee91 Binary files /dev/null and b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 4.wav differ diff --git a/sounds/weapons/zaal/large monster footsteps/large monster footsteps 5.wav b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 5.wav new file mode 100644 index 000000000..6b2cbe342 Binary files /dev/null and b/sounds/weapons/zaal/large monster footsteps/large monster footsteps 5.wav differ diff --git a/sounds/weapons/zaal/large monster laugh/large monster laugh 1.wav b/sounds/weapons/zaal/large monster laugh/large monster laugh 1.wav new file mode 100644 index 000000000..97db78e63 Binary files /dev/null and b/sounds/weapons/zaal/large monster laugh/large monster laugh 1.wav differ diff --git a/sounds/weapons/zaal/large monster laugh/large monster laugh 2.wav b/sounds/weapons/zaal/large monster laugh/large monster laugh 2.wav new file mode 100644 index 000000000..cc080e4c1 Binary files /dev/null and b/sounds/weapons/zaal/large monster laugh/large monster laugh 2.wav differ diff --git a/sounds/weapons/zaal/lingspit.wav b/sounds/weapons/zaal/lingspit.wav new file mode 100644 index 000000000..5ea1efa95 Binary files /dev/null and b/sounds/weapons/zaal/lingspit.wav differ diff --git a/sounds/weapons/zaal/queenmeleeroar.wav b/sounds/weapons/zaal/queenmeleeroar.wav new file mode 100644 index 000000000..16aa36a57 Binary files /dev/null and b/sounds/weapons/zaal/queenmeleeroar.wav differ diff --git a/sounds/weapons/zaal/queenroar.wav b/sounds/weapons/zaal/queenroar.wav new file mode 100644 index 000000000..db3a7dc70 Binary files /dev/null and b/sounds/weapons/zaal/queenroar.wav differ diff --git a/sounds/weapons/zaal/roachspit.wav b/sounds/weapons/zaal/roachspit.wav new file mode 100644 index 000000000..6a7594e09 Binary files /dev/null and b/sounds/weapons/zaal/roachspit.wav differ diff --git a/sounds/weapons/zaal/ultraliskroar.wav b/sounds/weapons/zaal/ultraliskroar.wav new file mode 100644 index 000000000..ce34c5344 Binary files /dev/null and b/sounds/weapons/zaal/ultraliskroar.wav differ diff --git a/sounds/weapons/zaal/zartyroar.wav b/sounds/weapons/zaal/zartyroar.wav new file mode 100644 index 000000000..dd2a16769 Binary files /dev/null and b/sounds/weapons/zaal/zartyroar.wav differ diff --git a/springignore.txt b/springignore.txt index 04aaf501d..0318ea62a 100644 --- a/springignore.txt +++ b/springignore.txt @@ -2,5 +2,24 @@ # This should allow to play multiplayer directly using a clone of the repo. # +.git /.git /.svn +/*/.svn +/*/*/.svn +/*/*/*/.svn +/*/*/*/*/.svn +/*/*/*/*/*/.svn +/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn +/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/.svn \ No newline at end of file diff --git a/story.txt b/story.txt index 27ed739bb..c8ee1b58b 100644 --- a/story.txt +++ b/story.txt @@ -1,62 +1,139 @@ -Act 1: Prehistory, the Cold War, and the Space War +Evolution RTS +Prologue +Act 1: Prehistory, the Cold War, the Space War +The planet Atera is a small, blue green planet orbiting a pale yellow star, itself orbited by two large moons: The Twin Eyes of Loz, the Goddess of War. These moons, pale white and gleaming in the skies of Atera, were the heralds of war and blood. -The planet Iammas is a small, blue green planet orbiting a pale yellow star, itself orbited by two large moons: The Twin Eyes of Loz, the Goddess of War. These moons, pale white and gleaming in the skies of Iammas, were the heralds of war and blood. +Their tidal patterns, complex and extreme, would flood areas, then open up new land routes. They would change the topography of whole regions in a short decade and bring the many tribes of Atera into contact with one another. The Ateran people were a lizardlike people, bipedal, tailed, with slitted eyes and aquatic bent. They could swim as well as walk, and their bodies were tough and flexible. -Their tidal patterns, complex and extreme, would flood areas, then open up new land routes. They would change the topography of whole regions in a short decade…and bring the many tribes of Iammas into contact with one another. The Iamman people were a lizardlike people, bipedal, tailed, with slitted eyes and aquatic bent. They could swim as well as walk, and their bodies were tough and flexible. +With spear and blowgun, the Aterans fought. They fought for land, for the Gods, for simple brutal pleasure. -With spear and blowgun, the Iammans fought. The fought for land, for the Gods, for simple brutal pleasure. +With bronze sword and shield, the Aterans fought. They fought for food, for mineral wealth, for slaves -With bronze sword and shield, the Iammans fought. They fought for food, for mineral wealth, for slaves +With gunpowder and lines of battle, the Aterans fought. For republics, for monarchies, for spices and for trade routes. -With gunpowder and lines of battle, the Iammans fought. For republics, for monarchies, for spices and for trade routes. +With the coming of their tenth millennium, the Aterans had formed into two coalitions, both poised to unleash the newest and most deadly weapons onto one another: Nuclear, biological, and chemical weapons. -With the coming of their tenth millennium, the Iammans had formed into two coalitions, both poised to unleash the newest and most deadly weapons onto one another: Nuclear, biological, and chemical weapons. - -The Northern Coalition and the Southern World Order stood in this uneasy peace, even as the first Iamman stepped on the Moon. +The Northern Coalition (NC) and the Southern World Order (SWO) stood in this uneasy peace, even as the first Ateran stepped on the Moon. It was only a short time before the war denied on the ground began in space. -In the vacume between the planets, Iamman blood crystallized and starships were pulped by cannon shells and laser blasts. The weapons had changed, and the field of battle had changed, but the simple truth of war had stayed the same: Young Immans were the ones who fought and the ones who died. - -It was then that two inventions came to the fore, inventions that would completely change the field of battle. One was the K.T Shield, a device that could ward off deadly energy attacks and make a ship invisible (for short periods of time) and the other was the Mass Drive, a device that could allow a starship to bridge massive distances in the blink of an eye. - -With these, the SWO triumphed and for the first time in ten thousand years, the Iamman people were at peace. +In the vacuum between the planets, Ateran blood crystallized and starships were pulped by cannon shells and laser blasts. The weapons had changed, and the field of battle had changed, but the simple truth of war had stayed the same: Young Aterans were the ones who fought and the ones who died. +It was then that two inventions came to the fore, inventions that would completely change the field of battle. One was the K.T. Shield, a device that could ward off deadly energy attacks and make a ship invisible (for short periods of time) and the other was the Mass Drive, a device that could allow a starship to bridge massive distances in the blink of an eye. +With these, the SWO triumphed and for the first time in ten thousand years, the Ateran people were at peace. -Act 2: Colonization, Martial Law, The Collapse. +Act 2: Colonization, Martial Law, the Collapse +The first Mass Drive capable starships were scout vessels, exploring nearby systems for life. They found rocks. Rocks and lifeless planets, incapable of supporting anything. But then they found them. A string of six livable planets, in six star systems, spread in a crescent constellation called The Arm of Kala, the Goddess of Peace. -The first Mass Drive capable star ships were scout vessels, exploring nearby systems for life. They found rocks. Rocks and lifeless planets, incapable of supporting anything. But then they found them. A string of six livable planets, in six star systems, spread in a crescent constellation called The Arm of Kala, the Goddess of Peace. - -The Outer Colonies were created…and war came once more. The Colonies seethed with rebellion, and the SWO reacted as anyone would expect: They cracked down. Rebellion was crushed and the Colonies were placed under martial law. +The Outer Colonies were created and war came once more. The Colonies seethed with rebellion, and the Southern World Order reacted as anyone would expect: They cracked down. Rebellion was crushed and the Colonies were placed under martial law. It was then that the Collapse came. -The Iamman planet, like many others, has a magnetosphere. And like many others, the magnetosphere periodically shifts its polarity, temporarily dropping and leaving the planet vulnerable. +The Ateran planet, like many others, has a magnetosphere. And like many others, the magnetosphere periodically shifts its polarity, temporarily dropping and leaving the planet vulnerable. Normally, this would be a non-issue. -However, the Iamman star happened to have the single largest recorded solar flare at exactly the same time. A wash of radiation bathed Iammas. Computers crashed, the network collapsed, countless terrabytes of information was lost completely. The economy collapsed. Communication collapsed. Civilization collapsed as well, as a massive rise in cancer deaths resulted. +However, the Ateran star happened to have the single largest recorded solar flare at exactly the same time. A wash of radiation bathed Atera. Computers crashed, the network collapsed, countless terabytes of information was lost completely. The economy collapsed. Communication collapsed. Civilization collapsed as well, and a massive rise in cancer deaths resulted. Chaos. Panic. War. Nuclear fire blossomed as panicked military officers believed they were under attack and fail-safes put in place centuries ago went into effect. -The Iammas homeworld was reduced to a dark age… +The Atera homeworld was reduced to a dark age. And the Outer Colonies? -They. +They did Nothing. + +Act 3: The Unification War +While Atera fell into chaos and darkness, the Outer Colonies reveled in their new found freedoms. They expanded, they built new cities, new colonies, new ships, new weapons. The first conflicts were minor, over viable planets that surrounded the Six Colonies. + +But the Ateran people could never balance on the knife’s edge of peace. + +Chapter 00 +Twenty years had passed since the Ateran Homeworld, Atera, was plunged into darkness and the freedom of the Outer Colonies finally realized. Initially, the shock of the devastation on Atera was both overwhelming and a relief. On one hand, trade with Atera and the Outer colonies was booming. Many raw materials were available in abundance upon the String of planets in the Arm of Kala that were not so easily obtained upon Atera. On the other hand, the Outer Colonies were finally free of the rule and oversight of Atera. + +Atera was practically uninhabitable compared to the planets of the Outer Colonies, Kali, Bi Xiu, Ashiesha, Pascia, Rohini, and Mot. Atera was an ever changing world of extreme tidal patterns and changing topography that made life in general a rather harsh reality. Even so, a sort of stubborn allegiance to Atera had developed in the years leading up to the collapse by it’s inhabitants. This illogical reasoning got to the point that the “Mudders” (as they were referred to by the people of the Outer Colonies) had developed an unhealthy dislike for the “Spacers”, and vice versa. This disdain was of course not enough to halt trade between the Outer Colonies and the Southern World Order (renamed simply to “The Order”, after control of Atera had been fully asserted by the SWO), but it did intensify relations. + +Some time after the initial rebellion of the Outer Colonies had been successfully quashed by The Order, relations and regulations finally relaxed to a level of uneasy peace. The Outer Colonies still governed themselves but with a modicum of “Order Oversight”�. This “oversight”� was more superficial than tangible, but it allowed The Order to exude an air of control over the known galaxy. + +Then the collapse came. Immediately, life on Atera, as they had known it, halted. Electronics of any kind were rendered useless and the people of Atera received a (in many cases) lethal dose of radiation. Trade ships from the Outer Colonies observed the chaos from afar, but regardless of any protests to the contrary, the collapse was seen as a net positive for the Outer Colonies. They almost universally agreed to not interfere with what was happening on Atera. + +Suddenly they were free to do as they wished, and each colony in turn flourished under independent rule. An interplanetary council, known as the Federation of Kala, was formed to unite the colonies under a common set of laws and trade agreements. This agreement lasted for decades without incident, but then the exploratory ships of Bi Xiu bumped into the Xenos. + +The Xeno planet (Designated “Nu-Gua”� by the astronomers of Bi Xiu) was situated in the habitable zone of a pale yellow star known as “5313 Lacertae”�. The system consisted of three planets, two of which were gas giants. Nu-Gua itself was accompanied by 3 tiny moons in stable orbits. Of all the potentially habitable worlds discovered thus far, Nu-Gua was widely considered the best hope for colonization. some 58% of it’s surface was covered with liquid water, and it’s atmosphere was estimated to be composed of oxygen and nitrogen, with trace amounts of carbon dioxide and argon. + +The exploratory ship commissioned by Bi Xiu was a large cruiser known as the Celestial Maiden. Leftover from the war with Atera and retrofitted for long voyages to distant worlds in hope of finding habitable planets. On approach to Nu-Gua, the observation deck of the Celestial Maiden reported sightings of potential cities and irregular formations upon the planet’s surface. + +As the Celestial Maiden drew closer to Nu-Gua, the observation deck reported satellites orbiting the planet. It was decided to attempt to make first contact, and a high orbit of about 117km from the surface of the Nu-Gua was established. Attempts using the standard forms of laser communication were met with no reaction initially, but the captain aboard the Celestial Maiden, being a patient man, decided to wait in orbit for a response. + +The Celestial Maiden never saw it coming. When the ship had attempted communication via laser, the people of Nu-Gua saw it as an act of aggression and responded in kind. Fired from the opposite side of the planet and slingshot around Nu-Gua’s largest moon, the 47 kiloton nuclear warhead practically incinerated the Celestial Maiden. + +Many weeks went by without any communication from the Celestial Maiden. A scout was organized and outfitted to visit Nu-Gua. The scout ship was able to get in and out, undetected, and reported finding scattered wreckage believed to be the ill fated Celestial Maiden. + +The Federation of Kala met in an emergency session and unilaterally declared war upon Nu-Gua. + +Opening hostilities were drawn out longer than originally expected, but the Xenos were defeated with relative ease and occupation was established upon Nu-Gua. Here the paths of each colony diverged. The colonies of Kali, Bi Xiu, Ashiesha, and Pascia, seething with malice and hatred, pushed for all out genocide. The colonies of Rohini and Mot pushed for a more measured approach; one of benevolence and instruction in the belief that the Xenos didn’t truly understand the gravity of what they had done. + +The Xenos were in a booming modern age and had achieved spaceflight only a little more than a century previously. Their weapons, crude projectiles by Ateran standards, were still deadly and effective. Their primary method of communication over long distances was the extremely slow and rather archaic practice of using radio waves. + +The Xenos themselves were a hideous race. Bare skinned and bi-pedal. Unsharpened teeth and no claws. In hand to hand combat, a Xeno stood practically no chance versus an Ateran’s scaled hide and clawed limbs. There was obvious intelligence and this is the quality that the colonies of Rohini and Mot seized upon in their arguments, saying: “If they can be taught and brought into modern times, by Ateran standards, then they should be.” + +The other colonies did not agree and began pre-emptively bombarding the planet’s surface. Troops landed and began systematically exterminating the Xenos. This prompted the colonies of Rohini and Mot to spring into action and land troops of their own while waging war in space above the planet and effectively blockading Nu-Gua. + +The Federation of Kala once again met in emergency session and summarily ejected the colonies of Rohini and Mot from the Federation while simultaneously declaring war and suspending all trade with the rogue colonies. With the might of the Federation bearing down upon them, Rohini and Mot were hard pressed to hold the blockade and eventually were forced to retreat to the far side of the planet. The armadas in space achieved a virtual standstill while their troops engaged each other on the planet’s surface. Throughout this time, the colonies of Rohini and Mot formed what they termed the “Loz Alliance”�. The Loz Alliance sought out the the beleaguered Xenos and entered peace talks. A treaty was formed and in exchange for help versus the Federation of Kala, they would have their independence from colonial rule. To renege on this treaty meant certain extermination. + +The Xenos turned out to be exceptionally gifted with the ability to learn new technologies. The armies of Nu-Gua’s citizens were turned in full force against the Federation of Kala. Even with this additional help, the Loz Alliance was hard pressed and steadily lost ground, until a group of courageous Xeno commandos gave their lives in a successful attempt to plant a fusion bomb in the powerplant fields erected by the Federation of Kala. As their power levels dropped, the forces of Kala found themselves losing ground to the Loz Alliance. + +Chapter 1: Incursion! +The armies of the Federation of Kala have been dealt a serious blow, but they are still a serious threat. The power fields allowed them to maintain a stranglehold on this sector, but their destruction has created an opening for us. + +One of our Nuclear Powerplants has been overrun by enemy forces. It is the only powerplant in this sector and an Overseer unit is not available to construct more. It is crucial that you reach the powerplant and protect it from destruction. + +Enemy forces are aware of the powerplant’s existence and location, but are choosing to use it as bait to lure our meager forces into an ambush. Our only advantage is that they have underestimated the size of our remaining forces in this sector. While they are not large in number, it is significantly more than they will be expecting. Even so, you will need to exercise caution. Remember, these are the only units that we have available to us until an Overseer unit arrives. Exercise caution. + +Chapter 2: Enemy Outpost +Our scouts have found the enemy’s main operations outpost in this sector. Their forces have been drawn off by our counter-attacks on other fronts, providing us with a limited window within which we may be able to destroy the outpost, and the factory responsible for fabricating all of their forces in this area. + +We still do not have an Overseer unit available for you to use, but we have gathered as much firepower as we can muster on such short notice. You will have an assault tank available to you. It is capable of dealing heavy damage to base defenses and structures, but cannot stand up to anti-armor skirmishers. You cannot hope to defeat the enemy without it. + +Chapter 3: Aerial Assault +Excellent news! Our efforts here on Nu-Gua have been progressing at a fast pace, much in part due to your achievements. The Federation of Kala has been pushed back so far that the surface troops are having to rely on cover from their ships in geosynchronous orbit for protection from our advancing ground forces. We have reports that the enemy is massing a huge aerial assault in which they hope to crush our advance. + +We cannot advance at this time as we are not strong enough to support both the battle in space as well as the battle on the ground, and we must achieve space superiority before we can advance further. + +Your mission is to prepare for the coming onslaught. If our reports are to be believed, you will be facing a nearly endless onslaught of bombers, gunships and fighters. You must hold the line and defend our skirmish line. If the enemy is able to break through then our ground forces will be nearly helpless to defend themselves. + +You will be given the use of an aerial engineer for this mission. You only have one, so do not lose it! It is possible that you may have to deal with some ground forces, but any advances by ground forces are likely to be very light. + +Chapter 4: Against the wall +We’ve almost done it! The Federation of Kala is reeling from our relentless assault both on the ground and in space! The Federation seems to be making a last stand and look as though they are poised for an evacuation if they are to fail. + +Your mission is the eliminate the enemy base in sector G-14. It is heavily defended and bristling to the teeth with offensive firepower. Exercise caution. Reports have come in stating that portions of the enemy base are inadequately covered with anti-air flak turrets. Unfortunately, we have no more details than that. It is recommended that you send some scout drones to test the aerial defenses. + +Chapter 5: Evacuation +The Federation is in full retreat! Their position in space is regrettably well fortified and we cannot press them any further. On the ground the federation is mass producing hover drone bombs and using them to cover their retreat. Press forward and take out the production facilities so that we can push the Federation of Kala out of this system for good! + +Hoverbombs are extremely fast and agile, proceed with caution as their explosion radius is quite large. The bombs are armored, so be sure to use units with bonus damage vs armored. + +Intermission +Meanwhile, closer to home… + +The forces of the Federation of Kala had been soundly routed. Nu-Gua was free again and the people of Nu-Gua flourished under their newfound bond with the Loz Alliance. -Did. +The confrontation in space far above Nu-Gua was later considered to be one of the strangest of the entire war. Very few lives were lost due to combat between ships. The Federation of Kala and the Loz alliance were hesitant to waste Ateran lives with reckless abandon. The Federation considered Xenos to be acceptable collateral damage and would kill them without reason and simply because they were not Ateran. The Federation still seethed with hatred over the loss of the Celestial Maiden. That the ship had been destroyed as a result of miscommunication (acknowledged and renounced retroactively by the Government of Nu-Gua) did not matter. In the eyes of the Federation it was blood for blood, and in this case that meant the complete and utter destruction of the Xenos. -Nothing. +Back in the colonies of the Federation of Kala, the council was in hot debate amongst themselves with regards to warring against their own kind in lieu of the Xenos. The colonies of Kali and Pascia pushed for a ceasefire and peacetalks to begin between the Loz Alliance and the Federation of Kala, reasoning that Nu-Gua could be dealt with in due time. +The colonies of Bi Xiu and Ashiesha argued that the Loz Alliance had turned their backs on the Federation and their own brethren, all for the “savages”� of Nu-Gua and deserved a traitor’s death. Bi Xiu’s foremost ambassador scorned Kali and Pascia for their marked restraint in the space battle above Nu-Gua, while the ambassadors of Kai and Pascia were quick to renounce Bi Xiu’s thirst for blood at any cost. +Eventually it was decided that the Loz Alliance must be subdued and subjected to rule under the Federation of Kala. A huge invasion fleet was dispatched to the world of Mot. -Act 3: The Unification War. +During this time the Loz Alliance had been busy instructing the Xenos in the ways of new technology and it’s usage. Nu-Gua was extremely rich in natural resources, more so than any two planets belonging to the Ateran colonies. Production facilities were erected on the planet and new ships were fabricated en-masse. The people of Nu-Gua were taught Ateran history, culture, and introduced to the Ateran way of life. In turn the Xenos taught the Aterans of the Loz Alliance the ways of Nu-Gua. They were taught of the various clever inventions of Nu-Gua that had resulted as an attempt to ease their way of life. The Ateran were introduced to the extensive military history of the Xenos. Many civil wars had occurred throughout the centuries. -While Immas fell into chaos and darkness, the Outer Colonies reveled in their new found freedoms. They expanded, they built new cities, new colonies, new ships…new weapons. The first conflicts were minor, over viable planets that surrounded the Six Colonies. +Initially there had been five main republics of Nu-Gua. These republics operated in the peace wrought by the threat of Mutually Assured Destruction. Eventually war broke out that engulfed the entire planet. After a very violent and bloody ten year struggle, the Xenos were united under a one world government and peace and balance were once again restored. Research into space travel was heavily invested in, and in 15 short years, the Xenos stepped foot on their largest moon. This achievement only served to fuel the desire of the Xenos to reach the stars. However, throughout all this, the Xenos retained their innate violent tendencies and innate fear of the unknown. -But the Iamman people could never balance on the knife’s edge of peace. +When the Celestial Maiden had hailed Nu-Gua, it had not even been previously spotted. The attempted laser communication was seen as an imminent attack or perhaps a test of the planetary defensive systems. The government panicked and in an emergency council session, voted with a scant majority to respond with a nuclear missile. -A new war was brewing. A violent conflict, between the Six Colonies, each one convinced that it was in the right, each one sure of its own ability to defeat its enemies. But they need Generals. They need soldiers. They need you. +Through the combined remorse on the part of the Xenos and their shared enemy, Nu-Gua and the Loz Alliance developed a strong bond of understanding and tentative trust. +Spies among the colonies of the Federation of Kala found out about the invasion fleet within hours of it’s departure. Emergency communications were sent to the colonies of Rohini and Mot, as well as to the Loz Alliance forces on Nu-Gua. The government of Nu-Gua immediately pledged their full backing and support. As it was, by the time the combined forces of the Xenos and the Loz Alliance arrived, the planet of Mot was under heavy assault. The war had begun in earnest. \ No newline at end of file diff --git a/unitpics/armflash.png b/unitpics/armflash.png deleted file mode 100644 index b55bf3a26..000000000 Binary files a/unitpics/armflash.png and /dev/null differ diff --git a/unitpics/burrow.png b/unitpics/burrow.png index 3cbbf38d9..6be986b11 100644 Binary files a/unitpics/burrow.png and b/unitpics/burrow.png differ diff --git a/unitpics/eaatank.png b/unitpics/eaatank.png index a0b441578..f529d3351 100644 Binary files a/unitpics/eaatank.png and b/unitpics/eaatank.png differ diff --git a/unitpics/eaaturret.png b/unitpics/eaaturret.png index 3383d3592..9a27fee42 100644 Binary files a/unitpics/eaaturret.png and b/unitpics/eaaturret.png differ diff --git a/unitpics/eairengineer.png b/unitpics/eairengineer.png index 46a2a1077..02a1f3d70 100644 Binary files a/unitpics/eairengineer.png and b/unitpics/eairengineer.png differ diff --git a/unitpics/eairengineer_t2.png b/unitpics/eairengineer_t2.png new file mode 100644 index 000000000..02a1f3d70 Binary files /dev/null and b/unitpics/eairengineer_t2.png differ diff --git a/unitpics/eairplant.png b/unitpics/eairplant.png index 7db3c723f..f093e7b50 100644 Binary files a/unitpics/eairplant.png and b/unitpics/eairplant.png differ diff --git a/unitpics/eairplant_t2.png b/unitpics/eairplant_t2.png new file mode 100644 index 000000000..f093e7b50 Binary files /dev/null and b/unitpics/eairplant_t2.png differ diff --git a/unitpics/eallterraa.png b/unitpics/eallterraa.png index c936300c3..c7a32a760 100644 Binary files a/unitpics/eallterraa.png and b/unitpics/eallterraa.png differ diff --git a/unitpics/eallterranarchid.png b/unitpics/eallterranarchid.png new file mode 100644 index 000000000..b663b4530 Binary files /dev/null and b/unitpics/eallterranarchid.png differ diff --git a/unitpics/eallterranarchid_t2.png b/unitpics/eallterranarchid_t2.png new file mode 100644 index 000000000..b663b4530 Binary files /dev/null and b/unitpics/eallterranarchid_t2.png differ diff --git a/unitpics/eallterrassault.png b/unitpics/eallterrassault.png index 6266824f6..a93ee2248 100644 Binary files a/unitpics/eallterrassault.png and b/unitpics/eallterrassault.png differ diff --git a/unitpics/eallterrassault_t2.png b/unitpics/eallterrassault_t2.png new file mode 100644 index 000000000..a93ee2248 Binary files /dev/null and b/unitpics/eallterrassault_t2.png differ diff --git a/unitpics/eallterrengineer.png b/unitpics/eallterrengineer.png index a50ad84bc..9f3abd355 100644 Binary files a/unitpics/eallterrengineer.png and b/unitpics/eallterrengineer.png differ diff --git a/unitpics/eallterrengineer_t2.png b/unitpics/eallterrengineer_t2.png new file mode 100644 index 000000000..9f3abd355 Binary files /dev/null and b/unitpics/eallterrengineer_t2.png differ diff --git a/unitpics/eallterrheavy.png b/unitpics/eallterrheavy.png index 0d20850b3..c292b1af2 100644 Binary files a/unitpics/eallterrheavy.png and b/unitpics/eallterrheavy.png differ diff --git a/unitpics/eallterrheavy_t2.png b/unitpics/eallterrheavy_t2.png new file mode 100644 index 000000000..c292b1af2 Binary files /dev/null and b/unitpics/eallterrheavy_t2.png differ diff --git a/unitpics/eallterrlight.png b/unitpics/eallterrlight.png index 143b297f8..993fddef4 100644 Binary files a/unitpics/eallterrlight.png and b/unitpics/eallterrlight.png differ diff --git a/unitpics/eallterrlight_t2.png b/unitpics/eallterrlight_t2.png new file mode 100644 index 000000000..993fddef4 Binary files /dev/null and b/unitpics/eallterrlight_t2.png differ diff --git a/unitpics/eallterrmed.png b/unitpics/eallterrmed.png index c7ef8d469..5d09548bd 100644 Binary files a/unitpics/eallterrmed.png and b/unitpics/eallterrmed.png differ diff --git a/unitpics/eallterrmed_t2.png b/unitpics/eallterrmed_t2.png new file mode 100644 index 000000000..5d09548bd Binary files /dev/null and b/unitpics/eallterrmed_t2.png differ diff --git a/unitpics/eallterrriot.png b/unitpics/eallterrriot.png index 26a1663ef..e6ce71ac4 100644 Binary files a/unitpics/eallterrriot.png and b/unitpics/eallterrriot.png differ diff --git a/unitpics/eallterrriot_t2.png b/unitpics/eallterrriot_t2.png new file mode 100644 index 000000000..e6ce71ac4 Binary files /dev/null and b/unitpics/eallterrriot_t2.png differ diff --git a/unitpics/eallterrshield.png b/unitpics/eallterrshield.png index 0dbefddcb..78f3749c8 100644 Binary files a/unitpics/eallterrshield.png and b/unitpics/eallterrshield.png differ diff --git a/unitpics/eallterrshield_t2.png b/unitpics/eallterrshield_t2.png new file mode 100644 index 000000000..78f3749c8 Binary files /dev/null and b/unitpics/eallterrshield_t2.png differ diff --git a/unitpics/eamphibaa.png b/unitpics/eamphibaa.png index 4e2bc52a8..2eb77ba43 100644 Binary files a/unitpics/eamphibaa.png and b/unitpics/eamphibaa.png differ diff --git a/unitpics/eamphibarty.png b/unitpics/eamphibarty.png index 0038a1014..167174f51 100644 Binary files a/unitpics/eamphibarty.png and b/unitpics/eamphibarty.png differ diff --git a/unitpics/eamphibarty_t2.png b/unitpics/eamphibarty_t2.png new file mode 100644 index 000000000..167174f51 Binary files /dev/null and b/unitpics/eamphibarty_t2.png differ diff --git a/unitpics/eamphibbuggy.png b/unitpics/eamphibbuggy.png index eec14b493..8d0e86716 100644 Binary files a/unitpics/eamphibbuggy.png and b/unitpics/eamphibbuggy.png differ diff --git a/unitpics/eamphibbuggy_t2.png b/unitpics/eamphibbuggy_t2.png new file mode 100644 index 000000000..8d0e86716 Binary files /dev/null and b/unitpics/eamphibbuggy_t2.png differ diff --git a/unitpics/eamphibdrone.png b/unitpics/eamphibdrone.png deleted file mode 100644 index c0f68f3ea..000000000 Binary files a/unitpics/eamphibdrone.png and /dev/null differ diff --git a/unitpics/eamphibengineer.png b/unitpics/eamphibengineer.png index 79c412b0f..f30702607 100644 Binary files a/unitpics/eamphibengineer.png and b/unitpics/eamphibengineer.png differ diff --git a/unitpics/eamphibengineer_t2.png b/unitpics/eamphibengineer_t2.png new file mode 100644 index 000000000..f30702607 Binary files /dev/null and b/unitpics/eamphibengineer_t2.png differ diff --git a/unitpics/eamphibfac.png b/unitpics/eamphibfac.png index 5463b6c65..942a18567 100644 Binary files a/unitpics/eamphibfac.png and b/unitpics/eamphibfac.png differ diff --git a/unitpics/eamphibfac_t2.png b/unitpics/eamphibfac_t2.png new file mode 100644 index 000000000..942a18567 Binary files /dev/null and b/unitpics/eamphibfac_t2.png differ diff --git a/unitpics/eamphibleveler.png b/unitpics/eamphibleveler.png new file mode 100644 index 000000000..ef94aabe3 Binary files /dev/null and b/unitpics/eamphibleveler.png differ diff --git a/unitpics/eamphibleveler_t2.png b/unitpics/eamphibleveler_t2.png new file mode 100644 index 000000000..ef94aabe3 Binary files /dev/null and b/unitpics/eamphibleveler_t2.png differ diff --git a/unitpics/eamphibmedtank.png b/unitpics/eamphibmedtank.png index b3845669f..797a922b0 100644 Binary files a/unitpics/eamphibmedtank.png and b/unitpics/eamphibmedtank.png differ diff --git a/unitpics/eamphibmedtank_t2.png b/unitpics/eamphibmedtank_t2.png new file mode 100644 index 000000000..797a922b0 Binary files /dev/null and b/unitpics/eamphibmedtank_t2.png differ diff --git a/unitpics/eamphibneedle.png b/unitpics/eamphibneedle.png new file mode 100644 index 000000000..2eb77ba43 Binary files /dev/null and b/unitpics/eamphibneedle.png differ diff --git a/unitpics/eamphibneedle_t2.png b/unitpics/eamphibneedle_t2.png new file mode 100644 index 000000000..2eb77ba43 Binary files /dev/null and b/unitpics/eamphibneedle_t2.png differ diff --git a/unitpics/eamphibriot.png b/unitpics/eamphibriot.png index 13beeda6b..d696b7d95 100644 Binary files a/unitpics/eamphibriot.png and b/unitpics/eamphibriot.png differ diff --git a/unitpics/eamphibriot_t2.png b/unitpics/eamphibriot_t2.png new file mode 100644 index 000000000..d696b7d95 Binary files /dev/null and b/unitpics/eamphibriot_t2.png differ diff --git a/unitpics/eamphibrock.png b/unitpics/eamphibrock.png index ab06cbf45..4013b44f3 100644 Binary files a/unitpics/eamphibrock.png and b/unitpics/eamphibrock.png differ diff --git a/unitpics/eamphibrock_t2.png b/unitpics/eamphibrock_t2.png new file mode 100644 index 000000000..4013b44f3 Binary files /dev/null and b/unitpics/eamphibrock_t2.png differ diff --git a/unitpics/eartytank.png b/unitpics/eartytank.png index e4ba09ab6..b06a53b02 100644 Binary files a/unitpics/eartytank.png and b/unitpics/eartytank.png differ diff --git a/unitpics/eartytank_t2.png b/unitpics/eartytank_t2.png new file mode 100644 index 000000000..b06a53b02 Binary files /dev/null and b/unitpics/eartytank_t2.png differ diff --git a/unitpics/eartyturret.png b/unitpics/eartyturret.png new file mode 100644 index 000000000..bc321b6bb Binary files /dev/null and b/unitpics/eartyturret.png differ diff --git a/unitpics/ebarricade.png b/unitpics/ebarricade.png index 047c686f8..6601b62aa 100644 Binary files a/unitpics/ebarricade.png and b/unitpics/ebarricade.png differ diff --git a/unitpics/ebarricade2.png b/unitpics/ebarricade2.png deleted file mode 100644 index 6139ae240..000000000 Binary files a/unitpics/ebarricade2.png and /dev/null differ diff --git a/unitpics/ebasefactory.png b/unitpics/ebasefactory.png index 5d82a9e76..cc02dc1c0 100644 Binary files a/unitpics/ebasefactory.png and b/unitpics/ebasefactory.png differ diff --git a/unitpics/ebasefactory_t2.png b/unitpics/ebasefactory_t2.png new file mode 100644 index 000000000..cc02dc1c0 Binary files /dev/null and b/unitpics/ebasefactory_t2.png differ diff --git a/unitpics/ebomb.png b/unitpics/ebomb.png index ea0c54f20..f995a19eb 100644 Binary files a/unitpics/ebomb.png and b/unitpics/ebomb.png differ diff --git a/unitpics/ebomber.png b/unitpics/ebomber.png index a66071859..f00e6b7f4 100644 Binary files a/unitpics/ebomber.png and b/unitpics/ebomber.png differ diff --git a/unitpics/ebomber_t2.png b/unitpics/ebomber_t2.png new file mode 100644 index 000000000..f00e6b7f4 Binary files /dev/null and b/unitpics/ebomber_t2.png differ diff --git a/unitpics/ebox.png b/unitpics/ebox.png new file mode 100644 index 000000000..bb5c881c1 Binary files /dev/null and b/unitpics/ebox.png differ diff --git a/unitpics/ecommander.png b/unitpics/ecommander.png index 8c51b81ef..be64a841d 100644 Binary files a/unitpics/ecommander.png and b/unitpics/ecommander.png differ diff --git a/unitpics/ecommanderai.png b/unitpics/ecommanderai.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/unitpics/ecommanderai.png differ diff --git a/unitpics/ecommanderbattle.png b/unitpics/ecommanderbattle.png new file mode 100644 index 000000000..d32e8adcc Binary files /dev/null and b/unitpics/ecommanderbattle.png differ diff --git a/unitpics/ecommanderbuild.png b/unitpics/ecommanderbuild.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/unitpics/ecommanderbuild.png differ diff --git a/unitpics/ecommandercloak.png b/unitpics/ecommandercloak.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/unitpics/ecommandercloak.png differ diff --git a/unitpics/ecommanderfactory.png b/unitpics/ecommanderfactory.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/unitpics/ecommanderfactory.png differ diff --git a/unitpics/ecommandershield.png b/unitpics/ecommandershield.png new file mode 100644 index 000000000..be64a841d Binary files /dev/null and b/unitpics/ecommandershield.png differ diff --git a/unitpics/ecommandfactory.png b/unitpics/ecommandfactory.png deleted file mode 100644 index 58344f20c..000000000 Binary files a/unitpics/ecommandfactory.png and /dev/null differ diff --git a/unitpics/ecruisesilo.png b/unitpics/ecruisesilo.png new file mode 100644 index 000000000..0d162dd4d Binary files /dev/null and b/unitpics/ecruisesilo.png differ diff --git a/unitpics/edrone.png b/unitpics/edrone.png index a1b3174be..314253b9c 100644 Binary files a/unitpics/edrone.png and b/unitpics/edrone.png differ diff --git a/unitpics/eengineer4.png b/unitpics/eengineer4.png deleted file mode 100644 index f35e8af74..000000000 Binary files a/unitpics/eengineer4.png and /dev/null differ diff --git a/unitpics/eengineer5.png b/unitpics/eengineer5.png index 71b2fd6d3..3767c97ac 100644 Binary files a/unitpics/eengineer5.png and b/unitpics/eengineer5.png differ diff --git a/unitpics/eengineer5_t2.png b/unitpics/eengineer5_t2.png new file mode 100644 index 000000000..3767c97ac Binary files /dev/null and b/unitpics/eengineer5_t2.png differ diff --git a/unitpics/eexkrabgroth.png b/unitpics/eexkrabgroth.png index cd3db689d..b663b4530 100644 Binary files a/unitpics/eexkrabgroth.png and b/unitpics/eexkrabgroth.png differ diff --git a/unitpics/eexnukearty.png b/unitpics/eexnukearty.png index 581e4a972..0527ba6bc 100644 Binary files a/unitpics/eexnukearty.png and b/unitpics/eexnukearty.png differ diff --git a/unitpics/eexperimentalfac.png b/unitpics/eexperimentalfac.png index a19bae06b..769539517 100644 Binary files a/unitpics/eexperimentalfac.png and b/unitpics/eexperimentalfac.png differ diff --git a/unitpics/eextankdestroyer.png b/unitpics/eextankdestroyer.png index 42bb17a00..2d37b2a40 100644 Binary files a/unitpics/eextankdestroyer.png and b/unitpics/eextankdestroyer.png differ diff --git a/unitpics/efatso2.png b/unitpics/efatso2.png index c19f62132..838082d41 100644 Binary files a/unitpics/efatso2.png and b/unitpics/efatso2.png differ diff --git a/unitpics/efighter.png b/unitpics/efighter.png index 3f7cb068a..2db90aa1b 100644 Binary files a/unitpics/efighter.png and b/unitpics/efighter.png differ diff --git a/unitpics/efighter_t2.png b/unitpics/efighter_t2.png new file mode 100644 index 000000000..2db90aa1b Binary files /dev/null and b/unitpics/efighter_t2.png differ diff --git a/unitpics/eflametank.png b/unitpics/eflametank.png index 5d6b6ec5a..ca062548b 100644 Binary files a/unitpics/eflametank.png and b/unitpics/eflametank.png differ diff --git a/unitpics/efusion2.png b/unitpics/efusion2.png index 3cbbf38d9..6be986b11 100644 Binary files a/unitpics/efusion2.png and b/unitpics/efusion2.png differ diff --git a/unitpics/egeothermal.png b/unitpics/egeothermal.png index 3fd492a93..a4e9808bf 100644 Binary files a/unitpics/egeothermal.png and b/unitpics/egeothermal.png differ diff --git a/unitpics/egunship2.png b/unitpics/egunship2.png index a90c9cbee..66c62108e 100644 Binary files a/unitpics/egunship2.png and b/unitpics/egunship2.png differ diff --git a/unitpics/egunship2_t2.png b/unitpics/egunship2_t2.png new file mode 100644 index 000000000..66c62108e Binary files /dev/null and b/unitpics/egunship2_t2.png differ diff --git a/unitpics/ehbotengineer.png b/unitpics/ehbotengineer.png new file mode 100644 index 000000000..1742ba712 Binary files /dev/null and b/unitpics/ehbotengineer.png differ diff --git a/unitpics/ehbotengineer_turret.png b/unitpics/ehbotengineer_turret.png new file mode 100644 index 000000000..c11c72a2e Binary files /dev/null and b/unitpics/ehbotengineer_turret.png differ diff --git a/unitpics/ehbotfac.png b/unitpics/ehbotfac.png new file mode 100644 index 000000000..8c99a02d0 Binary files /dev/null and b/unitpics/ehbotfac.png differ diff --git a/unitpics/ehbotkarganneth.png b/unitpics/ehbotkarganneth.png new file mode 100644 index 000000000..2388a900c Binary files /dev/null and b/unitpics/ehbotkarganneth.png differ diff --git a/unitpics/ehbotkarganneth_turret.png b/unitpics/ehbotkarganneth_turret.png new file mode 100644 index 000000000..c4ba09bca Binary files /dev/null and b/unitpics/ehbotkarganneth_turret.png differ diff --git a/unitpics/ehbotpeewee.png b/unitpics/ehbotpeewee.png new file mode 100644 index 000000000..8750f8c46 Binary files /dev/null and b/unitpics/ehbotpeewee.png differ diff --git a/unitpics/ehbotpeewee_turret.png b/unitpics/ehbotpeewee_turret.png new file mode 100644 index 000000000..4a023c482 Binary files /dev/null and b/unitpics/ehbotpeewee_turret.png differ diff --git a/unitpics/ehbotrocko.png b/unitpics/ehbotrocko.png new file mode 100644 index 000000000..e4e471519 Binary files /dev/null and b/unitpics/ehbotrocko.png differ diff --git a/unitpics/ehbotrocko_turret.png b/unitpics/ehbotrocko_turret.png new file mode 100644 index 000000000..23d9fbe79 Binary files /dev/null and b/unitpics/ehbotrocko_turret.png differ diff --git a/unitpics/ehbotsniper.png b/unitpics/ehbotsniper.png new file mode 100644 index 000000000..1ce0dc863 Binary files /dev/null and b/unitpics/ehbotsniper.png differ diff --git a/unitpics/ehbotsniper_turret.png b/unitpics/ehbotsniper_turret.png new file mode 100644 index 000000000..289ccd01b Binary files /dev/null and b/unitpics/ehbotsniper_turret.png differ diff --git a/unitpics/ehbotthud.png b/unitpics/ehbotthud.png new file mode 100644 index 000000000..a746f80c4 Binary files /dev/null and b/unitpics/ehbotthud.png differ diff --git a/unitpics/ehbotthud_turret.png b/unitpics/ehbotthud_turret.png new file mode 100644 index 000000000..116186c2b Binary files /dev/null and b/unitpics/ehbotthud_turret.png differ diff --git a/unitpics/eheavytank3.png b/unitpics/eheavytank3.png index ad22ae68f..de4a8b62c 100644 Binary files a/unitpics/eheavytank3.png and b/unitpics/eheavytank3.png differ diff --git a/unitpics/eheavytank3_t2.png b/unitpics/eheavytank3_t2.png new file mode 100644 index 000000000..de4a8b62c Binary files /dev/null and b/unitpics/eheavytank3_t2.png differ diff --git a/unitpics/eheavytank3_upgraded.png b/unitpics/eheavytank3_upgraded.png new file mode 100644 index 000000000..87e8b62fa Binary files /dev/null and b/unitpics/eheavytank3_upgraded.png differ diff --git a/unitpics/eheavytank_t3.png b/unitpics/eheavytank_t3.png new file mode 100644 index 000000000..02ae829ee Binary files /dev/null and b/unitpics/eheavytank_t3.png differ diff --git a/unitpics/eheavyturret2.png b/unitpics/eheavyturret2.png index e67b37691..37712ea7b 100644 Binary files a/unitpics/eheavyturret2.png and b/unitpics/eheavyturret2.png differ diff --git a/unitpics/ejammer2.png b/unitpics/ejammer2.png index b850161dc..1222ebf30 100644 Binary files a/unitpics/ejammer2.png and b/unitpics/ejammer2.png differ diff --git a/unitpics/ekmar.png b/unitpics/ekmar.png index f9bcf774e..d46130c4f 100644 Binary files a/unitpics/ekmar.png and b/unitpics/ekmar.png differ diff --git a/unitpics/ekrow.png b/unitpics/ekrow.png new file mode 100644 index 000000000..dd499bb37 Binary files /dev/null and b/unitpics/ekrow.png differ diff --git a/unitpics/elacerator.png b/unitpics/elacerator.png new file mode 100644 index 000000000..d8169411c Binary files /dev/null and b/unitpics/elacerator.png differ diff --git a/unitpics/elacerator_t2.png b/unitpics/elacerator_t2.png new file mode 100644 index 000000000..d8169411c Binary files /dev/null and b/unitpics/elacerator_t2.png differ diff --git a/unitpics/elaserbattery.png b/unitpics/elaserbattery.png new file mode 100644 index 000000000..4bf4676e5 Binary files /dev/null and b/unitpics/elaserbattery.png differ diff --git a/unitpics/elighttank3.png b/unitpics/elighttank3.png index b03a2d9ec..8ed489688 100644 Binary files a/unitpics/elighttank3.png and b/unitpics/elighttank3.png differ diff --git a/unitpics/elighttank3_t2.png b/unitpics/elighttank3_t2.png new file mode 100644 index 000000000..8ed489688 Binary files /dev/null and b/unitpics/elighttank3_t2.png differ diff --git a/unitpics/elighttank3_upgraded.png b/unitpics/elighttank3_upgraded.png new file mode 100644 index 000000000..e1fc6ce24 Binary files /dev/null and b/unitpics/elighttank3_upgraded.png differ diff --git a/unitpics/elightturret2.png b/unitpics/elightturret2.png index 9332899c0..cb3c1ffa0 100644 Binary files a/unitpics/elightturret2.png and b/unitpics/elightturret2.png differ diff --git a/unitpics/elrpc.png b/unitpics/elrpc.png index cac3783f1..ce0d661f2 100644 Binary files a/unitpics/elrpc.png and b/unitpics/elrpc.png differ diff --git a/unitpics/emaker.png b/unitpics/emaker.png index 534849849..15b014760 100644 Binary files a/unitpics/emaker.png and b/unitpics/emaker.png differ diff --git a/unitpics/emediumgen.png b/unitpics/emediumgen.png new file mode 100644 index 000000000..32824ab0c Binary files /dev/null and b/unitpics/emediumgen.png differ diff --git a/unitpics/emediumtank3.png b/unitpics/emediumtank3.png index 4057546c1..7fdf11d99 100644 Binary files a/unitpics/emediumtank3.png and b/unitpics/emediumtank3.png differ diff --git a/unitpics/emetalextractor.png b/unitpics/emetalextractor.png index e341292e9..fbf3a896f 100644 Binary files a/unitpics/emetalextractor.png and b/unitpics/emetalextractor.png differ diff --git a/unitpics/emine.png b/unitpics/emine.png index 8b4f1d41e..49230de33 100644 Binary files a/unitpics/emine.png and b/unitpics/emine.png differ diff --git a/unitpics/eminifac.png b/unitpics/eminifac.png index a465fb1a8..726c5c9f3 100644 Binary files a/unitpics/eminifac.png and b/unitpics/eminifac.png differ diff --git a/unitpics/eminifac_t2.png b/unitpics/eminifac_t2.png new file mode 100644 index 000000000..726c5c9f3 Binary files /dev/null and b/unitpics/eminifac_t2.png differ diff --git a/unitpics/emissiletank.png b/unitpics/emissiletank.png index 8ec718920..771036215 100644 Binary files a/unitpics/emissiletank.png and b/unitpics/emissiletank.png differ diff --git a/unitpics/emissiletank_t2.png b/unitpics/emissiletank_t2.png new file mode 100644 index 000000000..771036215 Binary files /dev/null and b/unitpics/emissiletank_t2.png differ diff --git a/unitpics/engineermarbuk.png b/unitpics/engineermarbuk.png index a50ad84bc..4946288de 100644 Binary files a/unitpics/engineermarbuk.png and b/unitpics/engineermarbuk.png differ diff --git a/unitpics/eorb.png b/unitpics/eorb.png index aaec5573b..0b7484000 100644 Binary files a/unitpics/eorb.png and b/unitpics/eorb.png differ diff --git a/unitpics/eradar2.png b/unitpics/eradar2.png index 9152167ce..57b09a790 100644 Binary files a/unitpics/eradar2.png and b/unitpics/eradar2.png differ diff --git a/unitpics/eriottank2.png b/unitpics/eriottank2.png index 32591ed7e..63074bd89 100644 Binary files a/unitpics/eriottank2.png and b/unitpics/eriottank2.png differ diff --git a/unitpics/eriottank2_t2.png b/unitpics/eriottank2_t2.png new file mode 100644 index 000000000..63074bd89 Binary files /dev/null and b/unitpics/eriottank2_t2.png differ diff --git a/unitpics/escout.png b/unitpics/escout.png index 4ad12189f..bc564f3bf 100644 Binary files a/unitpics/escout.png and b/unitpics/escout.png differ diff --git a/unitpics/escout_t2.png b/unitpics/escout_t2.png new file mode 100644 index 000000000..bc564f3bf Binary files /dev/null and b/unitpics/escout_t2.png differ diff --git a/unitpics/eshieldgen.png b/unitpics/eshieldgen.png index b7ba83ff6..fb74c7522 100644 Binary files a/unitpics/eshieldgen.png and b/unitpics/eshieldgen.png differ diff --git a/unitpics/esilo.png b/unitpics/esilo.png index fe9193dae..6c51bbea2 100644 Binary files a/unitpics/esilo.png and b/unitpics/esilo.png differ diff --git a/unitpics/esolar2.png b/unitpics/esolar2.png index 8f99a8b58..585f2e3cb 100644 Binary files a/unitpics/esolar2.png and b/unitpics/esolar2.png differ diff --git a/unitpics/estorage.png b/unitpics/estorage.png index 13e9f43da..a74854931 100644 Binary files a/unitpics/estorage.png and b/unitpics/estorage.png differ diff --git a/unitpics/esubmarine.png b/unitpics/esubmarine.png index fe54281f8..9fa071a98 100644 Binary files a/unitpics/esubmarine.png and b/unitpics/esubmarine.png differ diff --git a/unitpics/esubplane.png b/unitpics/esubplane.png deleted file mode 100644 index fe54281f8..000000000 Binary files a/unitpics/esubplane.png and /dev/null differ diff --git a/unitpics/etech1.png b/unitpics/etech1.png new file mode 100644 index 000000000..32824ab0c Binary files /dev/null and b/unitpics/etech1.png differ diff --git a/unitpics/etech2.png b/unitpics/etech2.png new file mode 100644 index 000000000..32824ab0c Binary files /dev/null and b/unitpics/etech2.png differ diff --git a/unitpics/etech3.png b/unitpics/etech3.png new file mode 100644 index 000000000..32824ab0c Binary files /dev/null and b/unitpics/etech3.png differ diff --git a/unitpics/etransport.png b/unitpics/etransport.png index b3ed4afec..2088e08a5 100644 Binary files a/unitpics/etransport.png and b/unitpics/etransport.png differ diff --git a/unitpics/etransport_t2.png b/unitpics/etransport_t2.png new file mode 100644 index 000000000..2088e08a5 Binary files /dev/null and b/unitpics/etransport_t2.png differ diff --git a/unitpics/euwfusion2.png b/unitpics/euwfusion2.png index f51839e30..20d61f402 100644 Binary files a/unitpics/euwfusion2.png and b/unitpics/euwfusion2.png differ diff --git a/unitpics/euwmetalextractor.png b/unitpics/euwmetalextractor.png index acd5eff7c..653ea353c 100644 Binary files a/unitpics/euwmetalextractor.png and b/unitpics/euwmetalextractor.png differ diff --git a/unitpics/euwsolar2.png b/unitpics/euwsolar2.png index f7c5b2884..cf149516f 100644 Binary files a/unitpics/euwsolar2.png and b/unitpics/euwsolar2.png differ diff --git a/unitpics/euwstorage.png b/unitpics/euwstorage.png index 2adac0d1e..9818d0ba8 100644 Binary files a/unitpics/euwstorage.png and b/unitpics/euwstorage.png differ diff --git a/unitpics/euwturret.png b/unitpics/euwturret.png index 92977798f..cbb5d19b4 100644 Binary files a/unitpics/euwturret.png and b/unitpics/euwturret.png differ diff --git a/unitpics/glsl_test.png b/unitpics/glsl_test.png index e31b27fb8..a0bde7e36 100644 Binary files a/unitpics/glsl_test.png and b/unitpics/glsl_test.png differ diff --git a/unitpics/goldtree.png b/unitpics/goldtree.png index ba9121f37..60a242df0 100644 Binary files a/unitpics/goldtree.png and b/unitpics/goldtree.png differ diff --git a/unitpics/loadingpics/DreamstateLogic.png b/unitpics/loadingpics/DreamstateLogic.png new file mode 100644 index 000000000..97f5a0c55 Binary files /dev/null and b/unitpics/loadingpics/DreamstateLogic.png differ diff --git a/unitpics/loadingpics/TheEnigmaTNG.png b/unitpics/loadingpics/TheEnigmaTNG.png new file mode 100644 index 000000000..35d0d5037 Binary files /dev/null and b/unitpics/loadingpics/TheEnigmaTNG.png differ diff --git a/unitpics/lootboxbronze.png b/unitpics/lootboxbronze.png new file mode 100644 index 000000000..201b107d0 Binary files /dev/null and b/unitpics/lootboxbronze.png differ diff --git a/unitpics/lootboxgold.png b/unitpics/lootboxgold.png new file mode 100644 index 000000000..201b107d0 Binary files /dev/null and b/unitpics/lootboxgold.png differ diff --git a/unitpics/lootboxplatinum.png b/unitpics/lootboxplatinum.png new file mode 100644 index 000000000..201b107d0 Binary files /dev/null and b/unitpics/lootboxplatinum.png differ diff --git a/unitpics/lootboxsilver.png b/unitpics/lootboxsilver.png new file mode 100644 index 000000000..201b107d0 Binary files /dev/null and b/unitpics/lootboxsilver.png differ diff --git a/unitpics/lozcommander.png b/unitpics/lozcommander.png new file mode 100644 index 000000000..2df811a34 Binary files /dev/null and b/unitpics/lozcommander.png differ diff --git a/unitpics/lozengineer.png b/unitpics/lozengineer.png new file mode 100644 index 000000000..bcd02cc63 Binary files /dev/null and b/unitpics/lozengineer.png differ diff --git a/unitpics/pattern/xcommander.png b/unitpics/pattern/xcommander.png new file mode 100644 index 000000000..87a46ee49 Binary files /dev/null and b/unitpics/pattern/xcommander.png differ diff --git a/unitpics/pattern/xcrasher.png b/unitpics/pattern/xcrasher.png new file mode 100644 index 000000000..726978d9c Binary files /dev/null and b/unitpics/pattern/xcrasher.png differ diff --git a/unitpics/pattern/xflea.png b/unitpics/pattern/xflea.png new file mode 100644 index 000000000..1e24308a1 Binary files /dev/null and b/unitpics/pattern/xflea.png differ diff --git a/unitpics/pattern/xhammer.png b/unitpics/pattern/xhammer.png new file mode 100644 index 000000000..12fbb3c7d Binary files /dev/null and b/unitpics/pattern/xhammer.png differ diff --git a/unitpics/pattern/xkconstructor.png b/unitpics/pattern/xkconstructor.png new file mode 100644 index 000000000..d2fa562a8 Binary files /dev/null and b/unitpics/pattern/xkconstructor.png differ diff --git a/unitpics/pattern/xllt.png b/unitpics/pattern/xllt.png new file mode 100644 index 000000000..ba7ae65f8 Binary files /dev/null and b/unitpics/pattern/xllt.png differ diff --git a/unitpics/pattern/xmetalextractor.png b/unitpics/pattern/xmetalextractor.png new file mode 100644 index 000000000..9db1cfeb3 Binary files /dev/null and b/unitpics/pattern/xmetalextractor.png differ diff --git a/unitpics/pattern/xmetalextractormoho.png b/unitpics/pattern/xmetalextractormoho.png new file mode 100644 index 000000000..38e1a3af4 Binary files /dev/null and b/unitpics/pattern/xmetalextractormoho.png differ diff --git a/unitpics/pattern/xrocketturret.png b/unitpics/pattern/xrocketturret.png new file mode 100644 index 000000000..737982fc4 Binary files /dev/null and b/unitpics/pattern/xrocketturret.png differ diff --git a/unitpics/pattern/xrocko.png b/unitpics/pattern/xrocko.png new file mode 100644 index 000000000..be5a40b23 Binary files /dev/null and b/unitpics/pattern/xrocko.png differ diff --git a/unitpics/pattern/xskulk.png b/unitpics/pattern/xskulk.png new file mode 100644 index 000000000..547358e7d Binary files /dev/null and b/unitpics/pattern/xskulk.png differ diff --git a/unitpics/pattern/xsolar.png b/unitpics/pattern/xsolar.png new file mode 100644 index 000000000..16de6689c Binary files /dev/null and b/unitpics/pattern/xsolar.png differ diff --git a/unitpics/pattern/xstorage.png b/unitpics/pattern/xstorage.png new file mode 100644 index 000000000..1331594bf Binary files /dev/null and b/unitpics/pattern/xstorage.png differ diff --git a/unitpics/pattern/xwarrior.png b/unitpics/pattern/xwarrior.png new file mode 100644 index 000000000..f67195982 Binary files /dev/null and b/unitpics/pattern/xwarrior.png differ diff --git a/unitpics/queen.png b/unitpics/queen.png index cd3db689d..b663b4530 100644 Binary files a/unitpics/queen.png and b/unitpics/queen.png differ diff --git a/unitpics/rand0adbush.png b/unitpics/rand0adbush.png index bc2a5123e..8998e9f90 100644 Binary files a/unitpics/rand0adbush.png and b/unitpics/rand0adbush.png differ diff --git a/unitpics/rand0adsnowtree.png b/unitpics/rand0adsnowtree.png index fac299f16..ad4ff5d04 100644 Binary files a/unitpics/rand0adsnowtree.png and b/unitpics/rand0adsnowtree.png differ diff --git a/unitpics/randagorm.png b/unitpics/randagorm.png index 235cb751a..50a9ebb85 100644 Binary files a/unitpics/randagorm.png and b/unitpics/randagorm.png differ diff --git a/unitpics/randartturilo.png b/unitpics/randartturilo.png index bc3c2cbfc..753ebe282 100644 Binary files a/unitpics/randartturilo.png and b/unitpics/randartturilo.png differ diff --git a/unitpics/randartturiwinterlo.png b/unitpics/randartturiwinterlo.png index c635fc6f9..964c6cd02 100644 Binary files a/unitpics/randartturiwinterlo.png and b/unitpics/randartturiwinterlo.png differ diff --git a/unitpics/randbehartlo.png b/unitpics/randbehartlo.png index e2857665d..5ef1870ca 100644 Binary files a/unitpics/randbehartlo.png and b/unitpics/randbehartlo.png differ diff --git a/unitpics/randbehetree.png b/unitpics/randbehetree.png index c00030f6e..ab2f3793e 100644 Binary files a/unitpics/randbehetree.png and b/unitpics/randbehetree.png differ diff --git a/unitpics/randcactus.png b/unitpics/randcactus.png index 4775c5d53..e95bd911b 100644 Binary files a/unitpics/randcactus.png and b/unitpics/randcactus.png differ diff --git a/unitpics/randespire.png b/unitpics/randespire.png index 986c965e4..6b17e4ea3 100644 Binary files a/unitpics/randespire.png and b/unitpics/randespire.png differ diff --git a/unitpics/randrock.png b/unitpics/randrock.png index f76bc1851..9eab237e5 100644 Binary files a/unitpics/randrock.png and b/unitpics/randrock.png differ diff --git a/unitpics/randsnowtree.png b/unitpics/randsnowtree.png index 05a3bcb39..e59cb8a33 100644 Binary files a/unitpics/randsnowtree.png and b/unitpics/randsnowtree.png differ diff --git a/unitpics/randtree.png b/unitpics/randtree.png index f3dbeecc0..3a1387709 100644 Binary files a/unitpics/randtree.png and b/unitpics/randtree.png differ diff --git a/unitpics/zaal_unitpics/zairbomber.png b/unitpics/zaal_unitpics/zairbomber.png new file mode 100644 index 000000000..abfe91eeb Binary files /dev/null and b/unitpics/zaal_unitpics/zairbomber.png differ diff --git a/unitpics/zaal_unitpics/zairscout.png b/unitpics/zaal_unitpics/zairscout.png new file mode 100644 index 000000000..c753cc76e Binary files /dev/null and b/unitpics/zaal_unitpics/zairscout.png differ diff --git a/unitpics/zaal_unitpics/zairtoairfighter.png b/unitpics/zaal_unitpics/zairtoairfighter.png new file mode 100644 index 000000000..a5aaf98e5 Binary files /dev/null and b/unitpics/zaal_unitpics/zairtoairfighter.png differ diff --git a/unitpics/zaal_unitpics/zairtogroundfighter.png b/unitpics/zaal_unitpics/zairtogroundfighter.png new file mode 100644 index 000000000..0938c97e2 Binary files /dev/null and b/unitpics/zaal_unitpics/zairtogroundfighter.png differ diff --git a/unitpics/zaal_unitpics/zarm.png b/unitpics/zaal_unitpics/zarm.png new file mode 100644 index 000000000..05f870f98 Binary files /dev/null and b/unitpics/zaal_unitpics/zarm.png differ diff --git a/unitpics/zaal_unitpics/zarty.png b/unitpics/zaal_unitpics/zarty.png new file mode 100644 index 000000000..37e22eddc Binary files /dev/null and b/unitpics/zaal_unitpics/zarty.png differ diff --git a/unitpics/zaal_unitpics/zassault.png b/unitpics/zaal_unitpics/zassault.png new file mode 100644 index 000000000..12f5cd83f Binary files /dev/null and b/unitpics/zaal_unitpics/zassault.png differ diff --git a/unitpics/zaal_unitpics/zespire1.png b/unitpics/zaal_unitpics/zespire1.png new file mode 100644 index 000000000..688d1e065 Binary files /dev/null and b/unitpics/zaal_unitpics/zespire1.png differ diff --git a/unitpics/zaal_unitpics/zespire4.png b/unitpics/zaal_unitpics/zespire4.png new file mode 100644 index 000000000..266af3b6a Binary files /dev/null and b/unitpics/zaal_unitpics/zespire4.png differ diff --git a/unitpics/zaal_unitpics/zespire5.png b/unitpics/zaal_unitpics/zespire5.png new file mode 100644 index 000000000..403e604ac Binary files /dev/null and b/unitpics/zaal_unitpics/zespire5.png differ diff --git a/unitpics/zaal_unitpics/zhatch.png b/unitpics/zaal_unitpics/zhatch.png new file mode 100644 index 000000000..380656558 Binary files /dev/null and b/unitpics/zaal_unitpics/zhatch.png differ diff --git a/unitpics/zaal_unitpics/zhive.png b/unitpics/zaal_unitpics/zhive.png new file mode 100644 index 000000000..0b9a7a4dc Binary files /dev/null and b/unitpics/zaal_unitpics/zhive.png differ diff --git a/unitpics/zaal_unitpics/zkamikaze.png b/unitpics/zaal_unitpics/zkamikaze.png new file mode 100644 index 000000000..411edc673 Binary files /dev/null and b/unitpics/zaal_unitpics/zkamikaze.png differ diff --git a/unitpics/zaal_unitpics/zlightswarm.png b/unitpics/zaal_unitpics/zlightswarm.png new file mode 100644 index 000000000..478c718c2 Binary files /dev/null and b/unitpics/zaal_unitpics/zlightswarm.png differ diff --git a/unitpics/zaal_unitpics/zmedswarm.png b/unitpics/zaal_unitpics/zmedswarm.png new file mode 100644 index 000000000..1ed19ab00 Binary files /dev/null and b/unitpics/zaal_unitpics/zmedswarm.png differ diff --git a/unitpics/zaal_unitpics/zmex.png b/unitpics/zaal_unitpics/zmex.png new file mode 100644 index 000000000..22ccc26ab Binary files /dev/null and b/unitpics/zaal_unitpics/zmex.png differ diff --git a/unitpics/zaal_unitpics/zpyro.png b/unitpics/zaal_unitpics/zpyro.png new file mode 100644 index 000000000..b118d82f5 Binary files /dev/null and b/unitpics/zaal_unitpics/zpyro.png differ diff --git a/unitpics/zaal_unitpics/zqueen.png b/unitpics/zaal_unitpics/zqueen.png new file mode 100644 index 000000000..8ee86597d Binary files /dev/null and b/unitpics/zaal_unitpics/zqueen.png differ diff --git a/unitpics/zaal_unitpics/zskirmisher.png b/unitpics/zaal_unitpics/zskirmisher.png new file mode 100644 index 000000000..8b86166c7 Binary files /dev/null and b/unitpics/zaal_unitpics/zskirmisher.png differ diff --git a/unitpics/zaal_unitpics/ztenticle.png b/unitpics/zaal_unitpics/ztenticle.png new file mode 100644 index 000000000..446a525a9 Binary files /dev/null and b/unitpics/zaal_unitpics/ztenticle.png differ diff --git a/unitpics/zaal_unitpics/ztumor.png b/unitpics/zaal_unitpics/ztumor.png new file mode 100644 index 000000000..27fe512fe Binary files /dev/null and b/unitpics/zaal_unitpics/ztumor.png differ diff --git a/unitpics/ztiberium.png b/unitpics/ztiberium.png new file mode 100644 index 000000000..784afed9b Binary files /dev/null and b/unitpics/ztiberium.png differ diff --git a/validmaps.lua b/validmaps.lua deleted file mode 100644 index 099068825..000000000 --- a/validmaps.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - -} \ No newline at end of file